@ctrliq/quantic-components 1.62.2 → 1.63.0

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.
@@ -15,4 +15,5 @@ export declare const FocusedVariant: import("../shared/story").StoryObject<objec
15
15
  export declare const FocusedVariantWithTopbar: import("../shared/story").StoryObject<object>;
16
16
  export declare const ToggleableSidebar: import("../shared/story").StoryObject<object>;
17
17
  export declare const WithToolbar: import("../shared/story").StoryObject<object>;
18
+ export declare const SidebarWithStickyHeader: import("../shared/story").StoryObject<object>;
18
19
  export declare const FilledPageWithSplitter: import("../shared/story").StoryObject<object>;
@@ -249,6 +249,32 @@ export const WithToolbar = story().render(({ html }) => html `
249
249
  </quantic-page>
250
250
  </quantic-layout>
251
251
  `);
252
+ export const SidebarWithStickyHeader = story().render(({ html }) => html `
253
+ <quantic-layout>
254
+ <span slot="titlebar">Dashboard</span>
255
+ <quantic-navbar slot="navbar"></quantic-navbar>
256
+ <quantic-sidebar slot="sidebar" collapsible>
257
+ <div
258
+ slot="header"
259
+ style="display: flex; align-items: center; gap: var(--quantic-spacing-2); padding: var(--quantic-spacing-2); border-bottom: 1px solid var(--quantic-border-secondary); margin-bottom: var(--quantic-spacing-2);"
260
+ >
261
+ <quantic-icon-brand-fuzzball-solid size="sm"></quantic-icon-brand-fuzzball-solid>
262
+ <span style="font-weight: var(--quantic-font-weight-semibold); font-size: var(--quantic-font-size-sm);">CIQ Engineering</span>
263
+ </div>
264
+ ${Array.from({ length: 20 }, (_, i) => html `
265
+ <quantic-sidebar-menu-item href="#" label="Nav item ${i + 1}">
266
+ <quantic-icon-lucide-circle slot="icon" size="sm"></quantic-icon-lucide-circle>
267
+ </quantic-sidebar-menu-item>
268
+ `)}
269
+ </quantic-sidebar>
270
+ <quantic-page slot="body">
271
+ <quantic-panel variant="solid">
272
+ <quantic-panel-header slot="header">Sticky sidebar header</quantic-panel-header>
273
+ Scroll the sidebar — the header above the nav items stays fixed.
274
+ </quantic-panel>
275
+ </quantic-page>
276
+ </quantic-layout>
277
+ `);
252
278
  export const FilledPageWithSplitter = story().render(({ html }) => html `
253
279
  <quantic-layout>
254
280
  <span slot="titlebar">Workflow Editor</span>
@@ -41,36 +41,42 @@ let Sidebar = class Sidebar extends AutoHideEmptySlotsMixin(QuanticElement) {
41
41
  aria-label=${this.ariaLabel}
42
42
  aria-expanded=${this.isAsideExpanded !== false ? 'true' : 'false'}
43
43
  >
44
- <div class="body">
45
- <slot @slotchange=${this.handleAutoHide}></slot>
44
+ <div class="header">
45
+ <slot name="header" @slotchange=${this.handleAutoHide}></slot>
46
46
  </div>
47
47
 
48
- <div class="footer">
49
- <slot name="footer" @slotchange=${this.handleAutoHide}></slot>
50
- </div>
48
+ <div class="scroll-area">
49
+ <div class="body">
50
+ <slot @slotchange=${this.handleAutoHide}></slot>
51
+ </div>
52
+
53
+ <div class="footer">
54
+ <slot name="footer" @slotchange=${this.handleAutoHide}></slot>
55
+ </div>
51
56
 
52
- ${this.isDesktopViewport && this.collapsible
57
+ ${this.isDesktopViewport && this.collapsible
53
58
  ? html `<div class="toggle-container">
54
- <quantic-sidebar-menu-item
55
- @click=${this.handleToggle}
56
- title=${this.isAsideExpanded
59
+ <quantic-sidebar-menu-item
60
+ @click=${this.handleToggle}
61
+ title=${this.isAsideExpanded
57
62
  ? 'Collapse sidebar'
58
63
  : 'Expand sidebar'}
59
- label=${this.isAsideExpanded ? 'Collapse' : 'Expand sidebar'}
60
- variant=${SidebarMenuItemVariant.Secondary}
61
- >
62
- ${this.isAsideExpanded
64
+ label=${this.isAsideExpanded ? 'Collapse' : 'Expand sidebar'}
65
+ variant=${SidebarMenuItemVariant.Secondary}
66
+ >
67
+ ${this.isAsideExpanded
63
68
  ? html `<quantic-icon-lucide-panel-left-close
64
- slot="icon"
65
- size="sm"
66
- ></quantic-icon-lucide-panel-left-close>`
69
+ slot="icon"
70
+ size="sm"
71
+ ></quantic-icon-lucide-panel-left-close>`
67
72
  : html `<quantic-icon-lucide-panel-left
68
- slot="icon"
69
- size="sm"
70
- ></quantic-icon-lucide-panel-left>`}
71
- </quantic-sidebar-menu-item>
72
- </div>`
73
+ slot="icon"
74
+ size="sm"
75
+ ></quantic-icon-lucide-panel-left>`}
76
+ </quantic-sidebar-menu-item>
77
+ </div>`
73
78
  : null}
79
+ </div>
74
80
  </nav>
75
81
  `;
76
82
  }
@@ -82,6 +88,7 @@ Sidebar.meta = {
82
88
  category: 'navigation',
83
89
  subComponents: ['quantic-sidebar-menu-item', 'quantic-sidebar-menu-item-group'],
84
90
  slots: {
91
+ header: { description: 'Optional sticky header rendered above the scrollable content.' },
85
92
  '': { description: 'Primary nav items (quantic-sidebar-menu-item or quantic-sidebar-menu-item-group).' },
86
93
  footer: { description: 'Footer nav items pinned to the bottom of the sidebar.' },
87
94
  },
@@ -97,6 +104,24 @@ Sidebar.styles = css `
97
104
  flex-direction: column;
98
105
  height: 100%;
99
106
  flex: 1;
107
+ box-sizing: border-box;
108
+ overflow: hidden;
109
+ }
110
+
111
+ .header {
112
+ padding: var(--quantic-spacing-2);
113
+ padding-bottom: 0;
114
+ flex-shrink: 0;
115
+ }
116
+
117
+ .header:has(slot[hidden]) {
118
+ display: none;
119
+ }
120
+
121
+ .scroll-area {
122
+ flex: 1;
123
+ display: flex;
124
+ flex-direction: column;
100
125
  padding: var(--quantic-spacing-2);
101
126
  box-sizing: border-box;
102
127
  overflow-x: hidden;
@@ -105,20 +130,20 @@ Sidebar.styles = css `
105
130
  scrollbar-color: var(--quantic-border-secondary) transparent;
106
131
  }
107
132
 
108
- .main::-webkit-scrollbar {
133
+ .scroll-area::-webkit-scrollbar {
109
134
  width: 4px;
110
135
  }
111
136
 
112
- .main::-webkit-scrollbar-track {
137
+ .scroll-area::-webkit-scrollbar-track {
113
138
  background: transparent;
114
139
  }
115
140
 
116
- .main::-webkit-scrollbar-thumb {
141
+ .scroll-area::-webkit-scrollbar-thumb {
117
142
  background: var(--quantic-border-secondary);
118
143
  border-radius: var(--quantic-radius-full);
119
144
  }
120
145
 
121
- .main:not(.is-aside-expanded) .main {
146
+ .main:not(.is-aside-expanded) .scroll-area {
122
147
  padding: var(--quantic-spacing-1);
123
148
  }
124
149