Skip to content

Commit 1d8d987

Browse files
committed
refactor(tile-manager): header / resize-indicator / stories
1 parent af8b1fc commit 1d8d987

File tree

11 files changed

+116
-48
lines changed

11 files changed

+116
-48
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { css } from 'lit';
2+
3+
import type { Themes } from '../../../theming/types.js';
4+
// Shared Styles
5+
import { styles as bootstrap } from './shared/header/tile-header.bootstrap.css.js';
6+
import { styles as fluent } from './shared/header/tile-header.fluent.css.js';
7+
8+
const light = {
9+
bootstrap: css`
10+
${bootstrap}
11+
`,
12+
fluent: css`
13+
${fluent}
14+
`,
15+
};
16+
17+
const dark = {
18+
bootstrap: css`
19+
${bootstrap}
20+
`,
21+
fluent: css`
22+
${fluent}
23+
`,
24+
};
25+
26+
export const all: Themes = { light, dark };

src/components/tile-manager/themes/resize.base.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
@use 'styles/utilities' as *;
33

44
:host {
5+
--resize-display: none;
6+
57
display: contents;
68
}
79

@@ -11,7 +13,8 @@
1113
}
1214

1315
[part='trigger'] {
14-
display: inline-flex;
16+
display: var(--resize-display);
17+
cursor: nwse-resize;
1518
position: absolute;
1619
bottom: rem(2px);
1720
right: rem(2px);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@use 'styles/utilities' as *;
2+
3+
[part='header'] {
4+
padding-block: sizable(rem(8px), rem(9px), rem(9px));
5+
}
6+
7+
::slotted([slot='title']) {
8+
@include type-style('h5');
9+
10+
margin: 0;
11+
}

src/components/tile-manager/themes/shared/header/tile-header.common.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@ $theme: $material;
1111

1212
[part='title'] {
1313
color: var-get($theme, 'title-color');
14+
}
15+
16+
igc-divider {
17+
--color: var-get($theme, 'divider-color');
1418
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@use 'styles/utilities' as *;
2+
3+
[part='header'] {
4+
padding-block: sizable(rem(8px), rem(12px), rem(12px));
5+
}

src/components/tile-manager/themes/shared/tile/tile.common.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ $theme: $material;
2727
}
2828

2929
[part~='dragging'] {
30+
--resize-display: none;
3031
opacity: .6;
3132
box-shadow: var-get($theme, 'drag-elevation');
3233
}

src/components/tile-manager/themes/tile-header.base.scss

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,11 @@
44
[part='header'] {
55
display: flex;
66
align-items: center;
7-
box-sizing: border-box;
7+
gap: sizable(rem(12px), rem(16px), rem(16px));
88
padding-block: sizable(rem(8px), rem(13px), rem(13px));
99
padding-inline: sizable(rem(12px), rem(16px), rem(20px));
1010
}
1111

12-
[part='title'] {
13-
display: block;
14-
flex: 1 1 100%;
15-
}
16-
1712
::slotted([slot='title']) {
1813
@include type-style('h6');
1914

@@ -23,4 +18,5 @@
2318
[part='actions'] {
2419
display: flex;
2520
gap: rem(8px);
21+
margin-inline-start: auto;
2622
}

src/components/tile-manager/themes/tile-manager.base.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@
1515
grid-auto-rows: minmax(var(--ig-min-row-height), auto);
1616
grid-gap: rem(10px);
1717
grid-auto-flow: dense;
18+
overflow-x: scroll;
1819
}

src/components/tile-manager/themes/tile.base.scss

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,20 @@
88
grid-row: var(--ig-row-start, auto) / span var(--ig-row-span, 1);
99
}
1010

11+
:host(:hover) {
12+
igc-resize {
13+
--resize-display: inline-flex;
14+
}
15+
}
16+
1117
[part~='base'] {
1218
width: 100%;
1319
height: 100%;
20+
overflow: hidden;
1421
}
1522

1623
[part='content-container'] {
1724
display: block;
18-
overflow: auto;
1925
border-radius: inherit;
2026

2127
::slotted(*) {
@@ -44,14 +50,3 @@
4450
// opacity: 0.5;
4551
// pointer-events: none;
4652
// }
47-
48-
// .resize-handle {
49-
// position: absolute;
50-
// width: 15px;
51-
// height: 15px;
52-
// right: 0;
53-
// bottom: 0;
54-
// cursor: se-resize;
55-
// background: rgba(0 0 0);
56-
// z-index: 999;
57-
// }

src/components/tile-manager/tile-header.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import { consume } from '@lit/context';
22
import { LitElement, html } from 'lit';
3+
import { themes } from '../../theming/theming-decorator.js';
34
import IgcIconButtonComponent from '../button/icon-button.js';
45
import { tileContext } from '../common/context.js';
56
import { registerComponent } from '../common/definitions/register.js';
7+
import IgcDividerComponent from '../divider/divider.js';
8+
import { all } from './themes/header.js';
69
import { styles as shared } from './themes/shared/header/tile-header.common.css.js';
710
import { styles } from './themes/tile-header.base.css.js';
811
import type IgcTileComponent from './tile.js';
@@ -17,13 +20,18 @@ import type IgcTileComponent from './tile.js';
1720
* @csspart title - The tile title container
1821
* @csspart actions - The tile actions container
1922
*/
23+
@themes(all)
2024
export default class IgcTileHeaderComponent extends LitElement {
2125
public static readonly tagName = 'igc-tile-header';
2226
public static override styles = [styles, shared];
2327

2428
/* blazorSuppress */
2529
public static register() {
26-
registerComponent(IgcTileHeaderComponent, IgcIconButtonComponent);
30+
registerComponent(
31+
IgcTileHeaderComponent,
32+
IgcIconButtonComponent,
33+
IgcDividerComponent
34+
);
2735
}
2836

2937
@consume({ context: tileContext, subscribe: true })
@@ -76,6 +84,7 @@ export default class IgcTileHeaderComponent extends LitElement {
7684
<slot name="actions"></slot>
7785
</section>
7886
</div>
87+
<igc-divider></igc-divider>
7988
`;
8089
}
8190
}

0 commit comments

Comments
 (0)