@ismail-elkorchi/ui-shell 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +71 -68
  2. package/dist/custom-elements.json +1039 -0
  3. package/dist/index.d.ts +8 -6
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +6 -6
  6. package/dist/index.js.map +1 -1
  7. package/dist/register.d.ts +5 -5
  8. package/dist/register.d.ts.map +1 -1
  9. package/dist/register.js +5 -5
  10. package/dist/register.js.map +1 -1
  11. package/dist/src/internal/light-dom-slot-controller.d.ts +22 -0
  12. package/dist/src/internal/light-dom-slot-controller.d.ts.map +1 -0
  13. package/dist/src/internal/light-dom-slot-controller.js +91 -0
  14. package/dist/src/internal/light-dom-slot-controller.js.map +1 -0
  15. package/dist/src/internal/router.d.ts +36 -0
  16. package/dist/src/internal/router.d.ts.map +1 -0
  17. package/dist/{router.js → src/internal/router.js} +26 -19
  18. package/dist/src/internal/router.js.map +1 -0
  19. package/dist/src/structures/uik-shell-activity-bar-contract.d.ts +10 -0
  20. package/dist/src/structures/uik-shell-activity-bar-contract.d.ts.map +1 -0
  21. package/dist/src/structures/uik-shell-activity-bar-contract.js +2 -0
  22. package/dist/src/structures/uik-shell-activity-bar-contract.js.map +1 -0
  23. package/dist/src/structures/uik-shell-activity-bar.d.ts +30 -0
  24. package/dist/src/structures/uik-shell-activity-bar.d.ts.map +1 -0
  25. package/dist/src/structures/uik-shell-activity-bar.js +272 -0
  26. package/dist/src/structures/uik-shell-activity-bar.js.map +1 -0
  27. package/dist/src/structures/uik-shell-layout.d.ts +16 -0
  28. package/dist/src/structures/uik-shell-layout.d.ts.map +1 -0
  29. package/dist/src/structures/uik-shell-layout.js +123 -0
  30. package/dist/src/structures/uik-shell-layout.js.map +1 -0
  31. package/dist/src/structures/uik-shell-secondary-sidebar.d.ts +21 -0
  32. package/dist/src/structures/uik-shell-secondary-sidebar.d.ts.map +1 -0
  33. package/dist/src/structures/uik-shell-secondary-sidebar.js +169 -0
  34. package/dist/src/structures/uik-shell-secondary-sidebar.js.map +1 -0
  35. package/dist/src/structures/uik-shell-sidebar.d.ts +21 -0
  36. package/dist/src/structures/uik-shell-sidebar.d.ts.map +1 -0
  37. package/dist/src/structures/uik-shell-sidebar.js +176 -0
  38. package/dist/src/structures/uik-shell-sidebar.js.map +1 -0
  39. package/dist/src/structures/uik-shell-status-bar.d.ts +23 -0
  40. package/dist/src/structures/uik-shell-status-bar.d.ts.map +1 -0
  41. package/dist/src/structures/uik-shell-status-bar.js +144 -0
  42. package/dist/src/structures/uik-shell-status-bar.js.map +1 -0
  43. package/package.json +31 -27
  44. package/dist/ActivityBar.d.ts +0 -25
  45. package/dist/ActivityBar.d.ts.map +0 -1
  46. package/dist/ActivityBar.js +0 -81
  47. package/dist/ActivityBar.js.map +0 -1
  48. package/dist/AppShellLayout.d.ts +0 -17
  49. package/dist/AppShellLayout.d.ts.map +0 -1
  50. package/dist/AppShellLayout.js +0 -66
  51. package/dist/AppShellLayout.js.map +0 -1
  52. package/dist/SecondarySidebar.d.ts +0 -18
  53. package/dist/SecondarySidebar.d.ts.map +0 -1
  54. package/dist/SecondarySidebar.js +0 -84
  55. package/dist/SecondarySidebar.js.map +0 -1
  56. package/dist/Sidebar.d.ts +0 -20
  57. package/dist/Sidebar.d.ts.map +0 -1
  58. package/dist/Sidebar.js +0 -105
  59. package/dist/Sidebar.js.map +0 -1
  60. package/dist/Statusbar.d.ts +0 -19
  61. package/dist/Statusbar.d.ts.map +0 -1
  62. package/dist/Statusbar.js +0 -73
  63. package/dist/Statusbar.js.map +0 -1
  64. package/dist/router.d.ts +0 -36
  65. package/dist/router.d.ts.map +0 -1
  66. package/dist/router.js.map +0 -1
  67. package/dist/tailwind-source.css +0 -2
@@ -0,0 +1,272 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { LitElement, html, nothing, svg } from 'lit';
8
+ import { customElement, property, state } from 'lit/decorators.js';
9
+ import { styleMap } from 'lit/directives/style-map.js';
10
+ import '@ismail-elkorchi/ui-primitives/uik-button';
11
+ import { ensureLightDomRoot, LightDomSlotController } from '../internal/light-dom-slot-controller';
12
+ let UikShellActivityBar = class UikShellActivityBar extends LitElement {
13
+ #items_accessor_storage = [];
14
+ get items() { return this.#items_accessor_storage; }
15
+ set items(value) { this.#items_accessor_storage = value; }
16
+ #activeId_accessor_storage = '';
17
+ get activeId() { return this.#activeId_accessor_storage; }
18
+ set activeId(value) { this.#activeId_accessor_storage = value; }
19
+ #focusedId_accessor_storage = '';
20
+ get focusedId() { return this.#focusedId_accessor_storage; }
21
+ set focusedId(value) { this.#focusedId_accessor_storage = value; }
22
+ slotController;
23
+ connectedCallback() {
24
+ super.connectedCallback();
25
+ if (!this.style.display)
26
+ this.style.display = 'block';
27
+ if (!this.style.boxSizing)
28
+ this.style.boxSizing = 'border-box';
29
+ if (!this.style.height)
30
+ this.style.height = '100%';
31
+ this.slotController ??= new LightDomSlotController(this, '[data-shell-root]', [{ name: 'footer', containerSelector: '[data-shell-slot="footer"]' }]);
32
+ this.slotController.connect();
33
+ }
34
+ disconnectedCallback() {
35
+ this.slotController?.disconnect();
36
+ super.disconnectedCallback();
37
+ }
38
+ firstUpdated() {
39
+ this.slotController?.sync();
40
+ }
41
+ updated(changedProperties) {
42
+ if (changedProperties.has('items')) {
43
+ const hasFocused = this.items.some(item => item.id === this.focusedId);
44
+ if (!hasFocused) {
45
+ this.focusedId = this.resolveDefaultFocusId();
46
+ }
47
+ }
48
+ if (changedProperties.has('activeId') && this.activeId && !this.contains(document.activeElement)) {
49
+ this.focusedId = this.resolveDefaultFocusId();
50
+ }
51
+ }
52
+ createRenderRoot() {
53
+ return ensureLightDomRoot(this);
54
+ }
55
+ emitSelect(id) {
56
+ this.dispatchEvent(new CustomEvent('activity-bar-select', { detail: { id }, bubbles: true, composed: true }));
57
+ }
58
+ resolveDefaultFocusId() {
59
+ if (this.activeId && this.items.some(item => item.id === this.activeId))
60
+ return this.activeId;
61
+ return this.items[0]?.id ?? '';
62
+ }
63
+ focusItemById(id) {
64
+ const root = this.renderRoot;
65
+ const button = root?.querySelector(`uik-button[data-activity-id="${id}"]`);
66
+ button?.focus();
67
+ }
68
+ renderIcon(item) {
69
+ if (!item.icon) {
70
+ return html `<span
71
+ part="item-icon"
72
+ aria-hidden="true"
73
+ style=${styleMap({
74
+ fontSize: 'var(--uik-typography-font-size-1)',
75
+ fontWeight: 'var(--uik-typography-font-weight-semibold)',
76
+ lineHeight: 'var(--uik-typography-line-height-1)',
77
+ })}>
78
+ ${item.label.charAt(0).toUpperCase()}
79
+ </span>`;
80
+ }
81
+ if (typeof item.icon === 'string') {
82
+ return svg `<path
83
+ stroke-linecap="round"
84
+ stroke-linejoin="round"
85
+ stroke-width="var(--uik-border-width-1)"
86
+ d=${item.icon}></path>`;
87
+ }
88
+ return item.icon;
89
+ }
90
+ onItemClick = (event) => {
91
+ const currentTarget = event.currentTarget;
92
+ if (!(currentTarget instanceof HTMLElement))
93
+ return;
94
+ const { activityId } = currentTarget.dataset;
95
+ if (!activityId)
96
+ return;
97
+ this.emitSelect(activityId);
98
+ };
99
+ onItemFocus = (event) => {
100
+ const currentTarget = event.currentTarget;
101
+ if (!(currentTarget instanceof HTMLElement))
102
+ return;
103
+ const { activityId } = currentTarget.dataset;
104
+ if (!activityId)
105
+ return;
106
+ this.focusedId = activityId;
107
+ };
108
+ onItemKeydown = (event) => {
109
+ const currentTarget = event.currentTarget;
110
+ if (!(currentTarget instanceof HTMLElement))
111
+ return;
112
+ const { index } = currentTarget.dataset;
113
+ if (!index)
114
+ return;
115
+ const currentIndex = Number(index);
116
+ if (!Number.isFinite(currentIndex))
117
+ return;
118
+ const lastIndex = this.items.length - 1;
119
+ if (lastIndex < 0)
120
+ return;
121
+ let nextIndex = currentIndex;
122
+ switch (event.key) {
123
+ case 'ArrowUp':
124
+ case 'ArrowLeft':
125
+ nextIndex = Math.max(0, currentIndex - 1);
126
+ break;
127
+ case 'ArrowDown':
128
+ case 'ArrowRight':
129
+ nextIndex = Math.min(lastIndex, currentIndex + 1);
130
+ break;
131
+ case 'Home':
132
+ nextIndex = 0;
133
+ break;
134
+ case 'End':
135
+ nextIndex = lastIndex;
136
+ break;
137
+ default:
138
+ return;
139
+ }
140
+ if (nextIndex === currentIndex)
141
+ return;
142
+ event.preventDefault();
143
+ const nextItem = this.items[nextIndex];
144
+ if (!nextItem)
145
+ return;
146
+ this.focusedId = nextItem.id;
147
+ void this.updateComplete.then(() => {
148
+ this.focusItemById(nextItem.id);
149
+ });
150
+ };
151
+ renderItem(item, index, focusId) {
152
+ const isActive = this.activeId === item.id;
153
+ const isFocused = focusId === item.id;
154
+ const itemStyles = {
155
+ width: 'var(--uik-size-control-lg)',
156
+ height: 'var(--uik-size-control-lg)',
157
+ display: 'flex',
158
+ alignItems: 'center',
159
+ justifyContent: 'center',
160
+ position: 'relative',
161
+ };
162
+ const indicatorStyles = {
163
+ position: 'absolute',
164
+ insetInlineStart: 'var(--uik-space-0)',
165
+ insetBlock: 'var(--uik-space-0)',
166
+ width: 'var(--uik-border-width-2)',
167
+ backgroundColor: 'oklch(var(--uik-intent-primary-bg-default))',
168
+ borderTopRightRadius: 'var(--uik-radius-1)',
169
+ borderBottomRightRadius: 'var(--uik-radius-1)',
170
+ };
171
+ const iconStyles = {
172
+ width: 'var(--uik-size-icon-md)',
173
+ height: 'var(--uik-size-icon-md)',
174
+ };
175
+ const iconContent = this.renderIcon(item);
176
+ const iconTemplate = item.icon
177
+ ? html `<svg
178
+ part="item-icon"
179
+ aria-hidden="true"
180
+ style=${styleMap(iconStyles)}
181
+ fill="none"
182
+ stroke="currentColor"
183
+ viewBox="0 0 24 24">
184
+ ${iconContent}
185
+ </svg>`
186
+ : iconContent;
187
+ return html `
188
+ <div part="item" style=${styleMap(itemStyles)}>
189
+ ${isActive ? html `<div part="item-indicator" style=${styleMap(indicatorStyles)}></div>` : nothing}
190
+ <uik-button
191
+ part="item-button"
192
+ data-activity-item="true"
193
+ data-activity-id=${item.id}
194
+ data-index=${String(index)}
195
+ variant="ghost"
196
+ size="icon"
197
+ style=${styleMap({ width: '100%', height: '100%' })}
198
+ ?muted=${!isActive}
199
+ ?active=${isActive}
200
+ .tabIndexValue=${isFocused ? 0 : -1}
201
+ aria-pressed=${isActive ? 'true' : 'false'}
202
+ aria-label=${item.label}
203
+ title=${item.tooltip ?? item.label}
204
+ @click=${this.onItemClick}
205
+ @focusin=${this.onItemFocus}
206
+ @keydown=${this.onItemKeydown}>
207
+ ${iconTemplate}
208
+ </uik-button>
209
+ </div>
210
+ `;
211
+ }
212
+ render() {
213
+ const ariaLabelledby = this.getAttribute('aria-labelledby');
214
+ const ariaLabel = this.getAttribute('aria-label');
215
+ const hasLabelledby = Boolean(ariaLabelledby);
216
+ const hasLabel = typeof ariaLabel === 'string' && ariaLabel.trim().length > 0;
217
+ const resolvedLabel = hasLabel ? ariaLabel : hasLabelledby ? null : 'Activity bar';
218
+ const focusId = this.focusedId || this.resolveDefaultFocusId();
219
+ const containerStyles = {
220
+ width: 'var(--uik-component-shell-activity-bar-width)',
221
+ backgroundColor: 'oklch(var(--uik-component-shell-activity-bar-bg))',
222
+ color: 'oklch(var(--uik-component-shell-activity-bar-fg))',
223
+ paddingBlock: 'var(--uik-space-2)',
224
+ display: 'flex',
225
+ flexDirection: 'column',
226
+ alignItems: 'center',
227
+ flexShrink: '0',
228
+ height: '100%',
229
+ boxSizing: 'border-box',
230
+ };
231
+ const spacerStyles = {
232
+ flex: '1 1 auto',
233
+ minHeight: 'var(--uik-space-0)',
234
+ };
235
+ const footerStyles = {
236
+ display: 'flex',
237
+ flexDirection: 'column',
238
+ alignItems: 'center',
239
+ width: '100%',
240
+ };
241
+ const items = this.items.map((item, index) => this.renderItem(item, index, focusId));
242
+ return html `
243
+ <aside
244
+ part="activity-bar"
245
+ data-region="activity-bar"
246
+ role="toolbar"
247
+ aria-orientation="vertical"
248
+ aria-label=${resolvedLabel ?? nothing}
249
+ aria-labelledby=${ariaLabelledby ?? nothing}
250
+ style=${styleMap(containerStyles)}>
251
+ ${items}
252
+ <div part="spacer" style=${styleMap(spacerStyles)}></div>
253
+ <div part="footer" style=${styleMap(footerStyles)} data-shell-slot="footer">
254
+ </div>
255
+ </aside>
256
+ `;
257
+ }
258
+ };
259
+ __decorate([
260
+ property({ attribute: false })
261
+ ], UikShellActivityBar.prototype, "items", null);
262
+ __decorate([
263
+ property({ type: String })
264
+ ], UikShellActivityBar.prototype, "activeId", null);
265
+ __decorate([
266
+ state()
267
+ ], UikShellActivityBar.prototype, "focusedId", null);
268
+ UikShellActivityBar = __decorate([
269
+ customElement('uik-shell-activity-bar')
270
+ ], UikShellActivityBar);
271
+ export { UikShellActivityBar };
272
+ //# sourceMappingURL=uik-shell-activity-bar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uik-shell-activity-bar.js","sourceRoot":"","sources":["../../../src/structures/uik-shell-activity-bar.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAsB,MAAM,KAAK,CAAC;AACxE,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD,OAAO,2CAA2C,CAAC;AAGnD,OAAO,EAAC,kBAAkB,EAAE,sBAAsB,EAAC,MAAM,uCAAuC,CAAC;AA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ACnB,IAAI,EAAE,UAAU;YAChB,SAAS,EAAE,oBAAoB;SAChC,CAAC;QACF,MAAM,YAAY,GAAG;YACnB,OAAO,EAAE,MAAM;YACf,aAAa,EAAE,QAAQ;YACvB,UAAU,EAAE,QAAQ;YACpB,KAAK,EAAE,MAAM;SACd,CAAC;QACF,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;QACrF,OAAO,IAAI,CAAA;;;;;;qBAMM,aAAa,IAAI,OAAO;0BACnB,cAAc,IAAI,OAAO;gBACnC,QAAQ,CAAC,eAAe,CAAC;UAC/B,KAAK;mCACoB,QAAQ,CAAC,YAAY,CAAC;mCACtB,QAAQ,CAAC,YAAY,CAAC;;;KAGpD,CAAC;IACJ,CAAC;CACF,CAAA;AA7PwC;IAAtC,QAAQ,CAAC,EAAC,SAAS,EAAE,KAAK,EAAC,CAAC;gDAAgD;AAC1C;IAAlC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;mDAAwB;AACvB;IAAzB,KAAK,EAAE;oDAAiC;AAH9B,mBAAmB;IAD/B,aAAa,CAAC,wBAAwB,CAAC;GAC3B,mBAAmB,CA8P/B"}
@@ -0,0 +1,16 @@
1
+ import { LitElement } from 'lit';
2
+ export declare class UikShellLayout extends LitElement {
3
+ accessor isSecondarySidebarVisible: boolean;
4
+ private slotController?;
5
+ connectedCallback(): void;
6
+ disconnectedCallback(): void;
7
+ firstUpdated(): void;
8
+ createRenderRoot(): HTMLElement;
9
+ render(): import("lit-html").TemplateResult<1>;
10
+ }
11
+ declare global {
12
+ interface HTMLElementTagNameMap {
13
+ 'uik-shell-layout': UikShellLayout;
14
+ }
15
+ }
16
+ //# sourceMappingURL=uik-shell-layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uik-shell-layout.d.ts","sourceRoot":"","sources":["../../../src/structures/uik-shell-layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAO,MAAM,KAAK,CAAC;AAMrC,qBACa,cAAe,SAAQ,UAAU;IACjB,QAAQ,CAAC,yBAAyB,UAAS;IACtE,OAAO,CAAC,cAAc,CAAC,CAAyB;IAEvC,iBAAiB;IAoBjB,oBAAoB;IAKpB,YAAY;IAIZ,gBAAgB;IAIhB,MAAM;CAuEhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"}
@@ -0,0 +1,123 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { LitElement, html } from 'lit';
8
+ import { customElement, property } from 'lit/decorators.js';
9
+ import { styleMap } from 'lit/directives/style-map.js';
10
+ import { ensureLightDomRoot, LightDomSlotController } from '../internal/light-dom-slot-controller';
11
+ let UikShellLayout = class UikShellLayout extends LitElement {
12
+ #isSecondarySidebarVisible_accessor_storage = false;
13
+ get isSecondarySidebarVisible() { return this.#isSecondarySidebarVisible_accessor_storage; }
14
+ set isSecondarySidebarVisible(value) { this.#isSecondarySidebarVisible_accessor_storage = value; }
15
+ slotController;
16
+ connectedCallback() {
17
+ super.connectedCallback();
18
+ if (!this.style.display)
19
+ this.style.display = 'block';
20
+ if (!this.style.boxSizing)
21
+ this.style.boxSizing = 'border-box';
22
+ if (!this.style.height)
23
+ this.style.height = '100%';
24
+ if (!this.style.width)
25
+ this.style.width = '100%';
26
+ this.slotController ??= new LightDomSlotController(this, '[data-shell-root]', [
27
+ { name: 'activity-bar', containerSelector: '[data-shell-slot="activity-bar"]' },
28
+ { name: 'primary-sidebar', containerSelector: '[data-shell-slot="primary-sidebar"]' },
29
+ { name: 'main-content', containerSelector: '[data-shell-slot="main-content"]' },
30
+ { name: 'secondary-sidebar', containerSelector: '[data-shell-slot="secondary-sidebar"]' },
31
+ { name: 'status-bar', containerSelector: '[data-shell-slot="status-bar"]' },
32
+ ]);
33
+ this.slotController.connect();
34
+ }
35
+ disconnectedCallback() {
36
+ this.slotController?.disconnect();
37
+ super.disconnectedCallback();
38
+ }
39
+ firstUpdated() {
40
+ this.slotController?.sync();
41
+ }
42
+ createRenderRoot() {
43
+ return ensureLightDomRoot(this);
44
+ }
45
+ render() {
46
+ const layoutStyles = {
47
+ backgroundColor: 'oklch(var(--uik-surface-bg))',
48
+ color: 'oklch(var(--uik-text-default))',
49
+ display: 'flex',
50
+ flexDirection: 'column',
51
+ height: '100%',
52
+ width: '100%',
53
+ boxSizing: 'border-box',
54
+ };
55
+ const rowStyles = {
56
+ display: 'flex',
57
+ flex: '1 1 auto',
58
+ minHeight: 'var(--uik-space-0)',
59
+ overflow: 'hidden',
60
+ };
61
+ const fixedRegionStyles = {
62
+ flexShrink: '0',
63
+ };
64
+ const mainStyles = {
65
+ display: 'flex',
66
+ flex: '1 1 auto',
67
+ flexDirection: 'column',
68
+ minWidth: 'var(--uik-space-0)',
69
+ minHeight: 'var(--uik-space-0)',
70
+ };
71
+ const statusBarStyles = {
72
+ flexShrink: '0',
73
+ };
74
+ const secondaryStyles = {
75
+ ...fixedRegionStyles,
76
+ display: this.isSecondarySidebarVisible ? 'block' : 'none',
77
+ };
78
+ const slotColumnStyles = {
79
+ height: '100%',
80
+ minHeight: 'var(--uik-space-0)',
81
+ };
82
+ const mainSlotStyles = {
83
+ display: 'flex',
84
+ flex: '1 1 auto',
85
+ flexDirection: 'column',
86
+ minWidth: 'var(--uik-space-0)',
87
+ minHeight: 'var(--uik-space-0)',
88
+ height: '100%',
89
+ };
90
+ const statusSlotStyles = {
91
+ width: '100%',
92
+ };
93
+ return html `
94
+ <div part="layout" style=${styleMap(layoutStyles)} data-layout-layer="shell">
95
+ <div part="row" style=${styleMap(rowStyles)}>
96
+ <div part="activity-bar" style=${styleMap(fixedRegionStyles)} data-region="activity-bar">
97
+ <div data-shell-slot="activity-bar" style=${styleMap(slotColumnStyles)}></div>
98
+ </div>
99
+ <div part="primary-sidebar" style=${styleMap(fixedRegionStyles)} data-region="primary-sidebar">
100
+ <div data-shell-slot="primary-sidebar" style=${styleMap(slotColumnStyles)}></div>
101
+ </div>
102
+ <div part="main-content" style=${styleMap(mainStyles)} data-region="main-content">
103
+ <div data-shell-slot="main-content" style=${styleMap(mainSlotStyles)}></div>
104
+ </div>
105
+ <div part="secondary-sidebar" style=${styleMap(secondaryStyles)} data-region="secondary-sidebar">
106
+ <div data-shell-slot="secondary-sidebar" style=${styleMap(slotColumnStyles)}></div>
107
+ </div>
108
+ </div>
109
+ <div part="status-bar" style=${styleMap(statusBarStyles)} data-region="status-bar">
110
+ <div data-shell-slot="status-bar" style=${styleMap(statusSlotStyles)}></div>
111
+ </div>
112
+ </div>
113
+ `;
114
+ }
115
+ };
116
+ __decorate([
117
+ property({ type: Boolean })
118
+ ], UikShellLayout.prototype, "isSecondarySidebarVisible", null);
119
+ UikShellLayout = __decorate([
120
+ customElement('uik-shell-layout')
121
+ ], UikShellLayout);
122
+ export { UikShellLayout };
123
+ //# sourceMappingURL=uik-shell-layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uik-shell-layout.js","sourceRoot":"","sources":["../../../src/structures/uik-shell-layout.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,KAAK,CAAC;AACrC,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC1D,O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BAAoB;YAC9B,SAAS,EAAE,oBAAoB;YAC/B,MAAM,EAAE,MAAM;SACf,CAAC;QACF,MAAM,gBAAgB,GAAG;YACvB,KAAK,EAAE,MAAM;SACd,CAAC;QAEF,OAAO,IAAI,CAAA;iCACkB,QAAQ,CAAC,YAAY,CAAC;gCACvB,QAAQ,CAAC,SAAS,CAAC;2CACR,QAAQ,CAAC,iBAAiB,CAAC;wDACd,QAAQ,CAAC,gBAAgB,CAAC;;8CAEpC,QAAQ,CAAC,iBAAiB,CAAC;2DACd,QAAQ,CAAC,gBAAgB,CAAC;;2CAE1C,QAAQ,CAAC,UAAU,CAAC;wDACP,QAAQ,CAAC,cAAc,CAAC;;gDAEhC,QAAQ,CAAC,eAAe,CAAC;6DACZ,QAAQ,CAAC,gBAAgB,CAAC;;;uCAGhD,QAAQ,CAAC,eAAe,CAAC;oDACZ,QAAQ,CAAC,gBAAgB,CAAC;;;KAGzE,CAAC;IACJ,CAAC;CACF,CAAA;AA3GqC;IAAnC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;+DAA4C;AAD3D,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CA4G1B"}
@@ -0,0 +1,21 @@
1
+ import { LitElement, nothing } from 'lit';
2
+ import '@ismail-elkorchi/ui-primitives/uik-button';
3
+ import '@ismail-elkorchi/ui-primitives/uik-separator';
4
+ export declare class UikShellSecondarySidebar extends LitElement {
5
+ accessor isOpen: boolean;
6
+ accessor heading: string;
7
+ private accessor hasFooter;
8
+ private slotController?;
9
+ connectedCallback(): void;
10
+ disconnectedCallback(): void;
11
+ firstUpdated(): void;
12
+ createRenderRoot(): HTMLElement;
13
+ private close;
14
+ render(): import("lit-html").TemplateResult<1> | typeof nothing;
15
+ }
16
+ declare global {
17
+ interface HTMLElementTagNameMap {
18
+ 'uik-shell-secondary-sidebar': UikShellSecondarySidebar;
19
+ }
20
+ }
21
+ //# sourceMappingURL=uik-shell-secondary-sidebar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uik-shell-secondary-sidebar.d.ts","sourceRoot":"","sources":["../../../src/structures/uik-shell-secondary-sidebar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAQ,OAAO,EAAC,MAAM,KAAK,CAAC;AAI9C,OAAO,2CAA2C,CAAC;AACnD,OAAO,8CAA8C,CAAC;AAItD,qBACa,wBAAyB,SAAQ,UAAU;IAC3B,QAAQ,CAAC,MAAM,UAAS;IACzB,QAAQ,CAAC,OAAO,SAAM;IACvC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAC5C,OAAO,CAAC,cAAc,CAAC,CAAyB;IAEvC,iBAAiB;IAqBjB,oBAAoB;IAKpB,YAAY;IAIZ,gBAAgB;IAIzB,OAAO,CAAC,KAAK,CAEX;IAEO,MAAM;CAqGhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,6BAA6B,EAAE,wBAAwB,CAAC;KACzD;CACF"}
@@ -0,0 +1,169 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { LitElement, html, nothing } from 'lit';
8
+ import { customElement, property, state } from 'lit/decorators.js';
9
+ import { styleMap } from 'lit/directives/style-map.js';
10
+ import '@ismail-elkorchi/ui-primitives/uik-button';
11
+ import '@ismail-elkorchi/ui-primitives/uik-separator';
12
+ import { ensureLightDomRoot, LightDomSlotController } from '../internal/light-dom-slot-controller';
13
+ let UikShellSecondarySidebar = class UikShellSecondarySidebar extends LitElement {
14
+ #isOpen_accessor_storage = false;
15
+ get isOpen() { return this.#isOpen_accessor_storage; }
16
+ set isOpen(value) { this.#isOpen_accessor_storage = value; }
17
+ #heading_accessor_storage = '';
18
+ get heading() { return this.#heading_accessor_storage; }
19
+ set heading(value) { this.#heading_accessor_storage = value; }
20
+ #hasFooter_accessor_storage = false;
21
+ get hasFooter() { return this.#hasFooter_accessor_storage; }
22
+ set hasFooter(value) { this.#hasFooter_accessor_storage = value; }
23
+ slotController;
24
+ connectedCallback() {
25
+ super.connectedCallback();
26
+ if (!this.style.display)
27
+ this.style.display = 'block';
28
+ if (!this.style.boxSizing)
29
+ this.style.boxSizing = 'border-box';
30
+ if (!this.style.height)
31
+ this.style.height = '100%';
32
+ this.slotController ??= new LightDomSlotController(this, '[data-shell-root]', [
33
+ { name: null, containerSelector: '[data-shell-slot="default"]' },
34
+ { name: 'footer', containerSelector: '[data-shell-slot="footer"]' },
35
+ ], root => {
36
+ const footerContainer = root.querySelector('[data-shell-slot="footer"]');
37
+ const nextHasFooter = !!footerContainer?.querySelector('[slot="footer"]');
38
+ if (nextHasFooter !== this.hasFooter)
39
+ this.hasFooter = nextHasFooter;
40
+ });
41
+ this.slotController.connect();
42
+ }
43
+ disconnectedCallback() {
44
+ this.slotController?.disconnect();
45
+ super.disconnectedCallback();
46
+ }
47
+ firstUpdated() {
48
+ this.slotController?.sync();
49
+ }
50
+ createRenderRoot() {
51
+ return ensureLightDomRoot(this);
52
+ }
53
+ close = () => {
54
+ this.dispatchEvent(new CustomEvent('secondary-sidebar-close', { bubbles: true, composed: true }));
55
+ };
56
+ render() {
57
+ if (!this.isOpen)
58
+ return nothing;
59
+ const sidebarStyles = {
60
+ width: 'var(--uik-component-shell-secondary-sidebar-width)',
61
+ backgroundColor: 'oklch(var(--uik-component-shell-secondary-sidebar-bg))',
62
+ color: 'oklch(var(--uik-text-default))',
63
+ borderLeft: 'var(--uik-border-width-1) solid oklch(var(--uik-component-shell-divider-color))',
64
+ display: 'flex',
65
+ flexDirection: 'column',
66
+ flexShrink: '0',
67
+ height: '100%',
68
+ boxSizing: 'border-box',
69
+ };
70
+ const headerStyles = {
71
+ height: 'var(--uik-size-control-md)',
72
+ paddingInline: 'var(--uik-space-4)',
73
+ display: 'flex',
74
+ alignItems: 'center',
75
+ justifyContent: 'space-between',
76
+ flexShrink: '0',
77
+ userSelect: 'none',
78
+ };
79
+ const headingStyles = {
80
+ fontSize: 'var(--uik-typography-font-size-1)',
81
+ fontWeight: 'var(--uik-typography-font-weight-bold)',
82
+ letterSpacing: 'var(--uik-typography-letter-spacing-wide)',
83
+ lineHeight: 'var(--uik-typography-line-height-2)',
84
+ color: 'oklch(var(--uik-text-muted))',
85
+ textTransform: 'uppercase',
86
+ overflow: 'hidden',
87
+ textOverflow: 'ellipsis',
88
+ whiteSpace: 'nowrap',
89
+ };
90
+ const bodyContainerStyles = {
91
+ display: 'flex',
92
+ flexDirection: 'column',
93
+ flex: '1 1 auto',
94
+ minHeight: 'var(--uik-space-0)',
95
+ };
96
+ const bodyStyles = {
97
+ padding: 'var(--uik-space-4)',
98
+ overflowY: 'auto',
99
+ display: 'flex',
100
+ flexDirection: 'column',
101
+ flex: '1 1 auto',
102
+ minHeight: 'var(--uik-space-0)',
103
+ boxSizing: 'border-box',
104
+ scrollbarColor: 'oklch(var(--uik-component-shell-scrollbar-thumb)) oklch(var(--uik-component-shell-scrollbar-track))',
105
+ scrollbarWidth: 'thin',
106
+ };
107
+ const footerStyles = {
108
+ padding: 'var(--uik-space-3)',
109
+ backgroundColor: 'oklch(var(--uik-surface-card))',
110
+ };
111
+ return html `
112
+ <aside part="secondary-sidebar" data-region="secondary-sidebar" style=${styleMap(sidebarStyles)}>
113
+ <div part="header" style=${styleMap(headerStyles)}>
114
+ <span part="heading" style=${styleMap(headingStyles)}>${this.heading}</span>
115
+ <uik-button
116
+ part="close-button"
117
+ variant="ghost"
118
+ size="icon"
119
+ muted
120
+ aria-label="Close secondary sidebar"
121
+ title="Close secondary sidebar"
122
+ @click=${this.close}>
123
+ <svg
124
+ part="close-icon"
125
+ aria-hidden="true"
126
+ style=${styleMap({ width: 'var(--uik-size-icon-sm)', height: 'var(--uik-size-icon-sm)' })}
127
+ fill="none"
128
+ stroke="currentColor"
129
+ viewBox="0 0 24 24">
130
+ <path
131
+ stroke-linecap="round"
132
+ stroke-linejoin="round"
133
+ stroke-width="var(--uik-border-width-2)"
134
+ d="M6 18L18 6M6 6l12 12"></path>
135
+ </svg>
136
+ </uik-button>
137
+ </div>
138
+ <uik-separator
139
+ orientation="horizontal"
140
+ style="--uik-separator-color: var(--uik-component-shell-divider-color);"></uik-separator>
141
+ <div part="body-container" style=${styleMap(bodyContainerStyles)}>
142
+ <div part="body" style=${styleMap(bodyStyles)} data-shell-slot="default">
143
+ </div>
144
+ </div>
145
+ <div ?hidden=${!this.hasFooter}>
146
+ <uik-separator
147
+ orientation="horizontal"
148
+ style="--uik-separator-color: var(--uik-component-shell-divider-color);"></uik-separator>
149
+ <div part="footer" style=${styleMap(footerStyles)} data-shell-slot="footer">
150
+ </div>
151
+ </div>
152
+ </aside>
153
+ `;
154
+ }
155
+ };
156
+ __decorate([
157
+ property({ type: Boolean })
158
+ ], UikShellSecondarySidebar.prototype, "isOpen", null);
159
+ __decorate([
160
+ property({ type: String })
161
+ ], UikShellSecondarySidebar.prototype, "heading", null);
162
+ __decorate([
163
+ state()
164
+ ], UikShellSecondarySidebar.prototype, "hasFooter", null);
165
+ UikShellSecondarySidebar = __decorate([
166
+ customElement('uik-shell-secondary-sidebar')
167
+ ], UikShellSecondarySidebar);
168
+ export { UikShellSecondarySidebar };
169
+ //# sourceMappingURL=uik-shell-secondary-sidebar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uik-shell-secondary-sidebar.js","sourceRoot":"","sources":["../../../src/structures/uik-shell-secondary-sidebar.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,UAAU,EAAE,IAAI,EAAE,OAAO,EAAC,MAAM,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A;AAhJqC;IAAnC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;sDAAyB;AAChB;IAAlC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;uDAAuB;AACtB;IAAzB,KAAK,EAAE;yDAAoC;AAHjC,wBAAwB;IADpC,aAAa,CAAC,6BAA6B,CAAC;GAChC,wBAAwB,CAiJpC"}
@@ -0,0 +1,21 @@
1
+ import { LitElement } from 'lit';
2
+ import '@ismail-elkorchi/ui-primitives/uik-separator';
3
+ export declare class UikShellSidebar extends LitElement {
4
+ accessor heading: string;
5
+ accessor subtitle: string;
6
+ accessor isBodyPadded: boolean;
7
+ accessor isBodyScrollable: boolean;
8
+ private accessor hasFooter;
9
+ private slotController?;
10
+ connectedCallback(): void;
11
+ disconnectedCallback(): void;
12
+ firstUpdated(): void;
13
+ createRenderRoot(): HTMLElement;
14
+ render(): import("lit-html").TemplateResult<1>;
15
+ }
16
+ declare global {
17
+ interface HTMLElementTagNameMap {
18
+ 'uik-shell-sidebar': UikShellSidebar;
19
+ }
20
+ }
21
+ //# sourceMappingURL=uik-shell-sidebar.d.ts.map