@kushagradhawan/kookie-ui 0.1.44 → 0.1.45
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.
- package/components.css +57 -98
- package/dist/cjs/components/shell.d.ts +3 -3
- package/dist/cjs/components/shell.d.ts.map +1 -1
- package/dist/cjs/components/shell.js +1 -1
- package/dist/cjs/components/shell.js.map +2 -2
- package/dist/cjs/components/sidebar.props.d.ts +1 -1
- package/dist/cjs/components/sidebar.props.js +1 -1
- package/dist/cjs/components/sidebar.props.js.map +2 -2
- package/dist/esm/components/shell.d.ts +3 -3
- package/dist/esm/components/shell.d.ts.map +1 -1
- package/dist/esm/components/shell.js +1 -1
- package/dist/esm/components/shell.js.map +2 -2
- package/dist/esm/components/sidebar.props.d.ts +1 -1
- package/dist/esm/components/sidebar.props.js +1 -1
- package/dist/esm/components/sidebar.props.js.map +2 -2
- package/package.json +1 -1
- package/schemas/base-button.json +1 -1
- package/schemas/button.json +1 -1
- package/schemas/icon-button.json +1 -1
- package/schemas/index.json +6 -6
- package/schemas/toggle-button.json +1 -1
- package/schemas/toggle-icon-button.json +1 -1
- package/src/components/_internal/base-sidebar-menu.css +6 -1
- package/src/components/_internal/base-sidebar.css +6 -29
- package/src/components/shell.css +22 -0
- package/src/components/shell.tsx +7 -9
- package/src/components/sidebar.css +55 -99
- package/src/components/sidebar.props.tsx +1 -1
- package/styles.css +57 -98
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/sidebar.props.tsx"],
|
|
4
|
-
"sourcesContent": ["import { asChildPropDef } from '../props/as-child.prop.js';\nimport { colorPropDef } from '../props/color.prop.js';\nimport { highContrastPropDef } from '../props/high-contrast.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\n// Re-export base menu props for sidebar menu components\nexport {\n baseMenuContentPropDefs as sidebarContentPropDefs,\n baseMenuItemPropDefs as sidebarItemPropDefs,\n baseMenuCheckboxItemPropDefs as sidebarCheckboxItemPropDefs,\n baseMenuRadioItemPropDefs as sidebarRadioItemPropDefs,\n} from './_internal/base-menu.props.js';\n\n// Sidebar container props\nconst sizes = ['1', '2'] as const;\nconst variants = ['soft', 'outline', 'surface', 'ghost'] as const;\nconst menuVariants = ['solid', 'soft'] as const;\nconst types = ['sidebar'
|
|
5
|
-
"mappings": "AAAA,OAAS,kBAAAA,MAAsB,4BAC/B,OAAS,gBAAAC,MAAoB,yBAC7B,OAAS,uBAAAC,MAA2B,iCAKpC,OAC6B,2BAA3BC,EACwB,wBAAxBC,EACgC,gCAAhCC,EAC6B,6BAA7BC,MACK,iCAGP,MAAMC,EAAQ,CAAC,IAAK,GAAG,EACjBC,EAAW,CAAC,OAAQ,UAAW,UAAW,OAAO,EACjDC,EAAe,CAAC,QAAS,MAAM,EAC/BC,EAAQ,CAAC,
|
|
4
|
+
"sourcesContent": ["import { asChildPropDef } from '../props/as-child.prop.js';\nimport { colorPropDef } from '../props/color.prop.js';\nimport { highContrastPropDef } from '../props/high-contrast.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\n// Re-export base menu props for sidebar menu components\nexport {\n baseMenuContentPropDefs as sidebarContentPropDefs,\n baseMenuItemPropDefs as sidebarItemPropDefs,\n baseMenuCheckboxItemPropDefs as sidebarCheckboxItemPropDefs,\n baseMenuRadioItemPropDefs as sidebarRadioItemPropDefs,\n} from './_internal/base-menu.props.js';\n\n// Sidebar container props\nconst sizes = ['1', '2'] as const;\nconst variants = ['soft', 'outline', 'surface', 'ghost'] as const;\nconst menuVariants = ['solid', 'soft'] as const;\nconst types = ['sidebar'] as const;\nconst sides = ['left', 'right'] as const;\nconst collapsibleModes = ['offcanvas', 'icon', 'none'] as const;\nconst layouts = ['rail', 'panel'] as const;\n\nconst sidebarPropDefs = {\n ...asChildPropDef,\n size: { type: 'enum', className: 'rt-r-size', values: sizes, default: '2', responsive: true },\n variant: { type: 'enum', className: 'rt-variant', values: variants, default: 'outline' },\n menuVariant: {\n type: 'enum',\n className: 'rt-menu-variant',\n values: menuVariants,\n default: 'soft',\n },\n type: { type: 'enum', className: 'rt-type', values: types, default: 'sidebar' },\n side: { type: 'enum', className: 'rt-side', values: sides, default: 'left' },\n collapsible: {\n type: 'enum',\n className: 'rt-collapsible',\n values: collapsibleModes,\n default: 'offcanvas',\n },\n layout: { type: 'enum', className: 'rt-layout', values: layouts, default: undefined },\n panelBackground: { type: 'enum', values: ['solid', 'translucent'], default: undefined },\n ...colorPropDef,\n ...highContrastPropDef,\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n menuVariant: PropDef<(typeof menuVariants)[number]>;\n type: PropDef<(typeof types)[number]>;\n side: PropDef<(typeof sides)[number]>;\n collapsible: PropDef<(typeof collapsibleModes)[number]>;\n layout: PropDef<(typeof layouts)[number]>;\n panelBackground: PropDef<'solid' | 'translucent'>;\n};\n\nexport { sidebarPropDefs };\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,kBAAAA,MAAsB,4BAC/B,OAAS,gBAAAC,MAAoB,yBAC7B,OAAS,uBAAAC,MAA2B,iCAKpC,OAC6B,2BAA3BC,EACwB,wBAAxBC,EACgC,gCAAhCC,EAC6B,6BAA7BC,MACK,iCAGP,MAAMC,EAAQ,CAAC,IAAK,GAAG,EACjBC,EAAW,CAAC,OAAQ,UAAW,UAAW,OAAO,EACjDC,EAAe,CAAC,QAAS,MAAM,EAC/BC,EAAQ,CAAC,SAAS,EAClBC,EAAQ,CAAC,OAAQ,OAAO,EACxBC,EAAmB,CAAC,YAAa,OAAQ,MAAM,EAC/CC,EAAU,CAAC,OAAQ,OAAO,EAE1BC,EAAkB,CACtB,GAAGd,EACH,KAAM,CAAE,KAAM,OAAQ,UAAW,YAAa,OAAQO,EAAO,QAAS,IAAK,WAAY,EAAK,EAC5F,QAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQC,EAAU,QAAS,SAAU,EACvF,YAAa,CACX,KAAM,OACN,UAAW,kBACX,OAAQC,EACR,QAAS,MACX,EACA,KAAM,CAAE,KAAM,OAAQ,UAAW,UAAW,OAAQC,EAAO,QAAS,SAAU,EAC9E,KAAM,CAAE,KAAM,OAAQ,UAAW,UAAW,OAAQC,EAAO,QAAS,MAAO,EAC3E,YAAa,CACX,KAAM,OACN,UAAW,iBACX,OAAQC,EACR,QAAS,WACX,EACA,OAAQ,CAAE,KAAM,OAAQ,UAAW,YAAa,OAAQC,EAAS,QAAS,MAAU,EACpF,gBAAiB,CAAE,KAAM,OAAQ,OAAQ,CAAC,QAAS,aAAa,EAAG,QAAS,MAAU,EACtF,GAAGZ,EACH,GAAGC,CACL",
|
|
6
6
|
"names": ["asChildPropDef", "colorPropDef", "highContrastPropDef", "baseMenuContentPropDefs", "baseMenuItemPropDefs", "baseMenuCheckboxItemPropDefs", "baseMenuRadioItemPropDefs", "sizes", "variants", "menuVariants", "types", "sides", "collapsibleModes", "layouts", "sidebarPropDefs"]
|
|
7
7
|
}
|
package/package.json
CHANGED
package/schemas/base-button.json
CHANGED
|
@@ -279,6 +279,6 @@
|
|
|
279
279
|
"title": "Base-button Component Props",
|
|
280
280
|
"description": "Props schema for the base-button component in Kookie UI",
|
|
281
281
|
"version": "1.0.0",
|
|
282
|
-
"generatedAt": "2025-09-
|
|
282
|
+
"generatedAt": "2025-09-10T11:43:38.640Z",
|
|
283
283
|
"source": "Zod schema"
|
|
284
284
|
}
|
package/schemas/button.json
CHANGED
|
@@ -530,6 +530,6 @@
|
|
|
530
530
|
"title": "Button Component Props",
|
|
531
531
|
"description": "Props schema for the button component in Kookie UI",
|
|
532
532
|
"version": "1.0.0",
|
|
533
|
-
"generatedAt": "2025-09-
|
|
533
|
+
"generatedAt": "2025-09-10T11:43:38.645Z",
|
|
534
534
|
"source": "Zod schema"
|
|
535
535
|
}
|
package/schemas/icon-button.json
CHANGED
|
@@ -313,6 +313,6 @@
|
|
|
313
313
|
"title": "Icon-button Component Props",
|
|
314
314
|
"description": "Props schema for the icon-button component in Kookie UI",
|
|
315
315
|
"version": "1.0.0",
|
|
316
|
-
"generatedAt": "2025-09-
|
|
316
|
+
"generatedAt": "2025-09-10T11:43:38.646Z",
|
|
317
317
|
"source": "Zod schema"
|
|
318
318
|
}
|
package/schemas/index.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"title": "Kookie UI Button Components",
|
|
4
4
|
"description": "Complete JSON Schema collection for all button components in Kookie UI",
|
|
5
5
|
"version": "1.0.0",
|
|
6
|
-
"generatedAt": "2025-09-
|
|
6
|
+
"generatedAt": "2025-09-10T11:43:38.648Z",
|
|
7
7
|
"source": "Zod schemas",
|
|
8
8
|
"components": {
|
|
9
9
|
"base-button": {
|
|
@@ -287,7 +287,7 @@
|
|
|
287
287
|
"title": "Base-button Component Props",
|
|
288
288
|
"description": "Props schema for the base-button component in Kookie UI",
|
|
289
289
|
"version": "1.0.0",
|
|
290
|
-
"generatedAt": "2025-09-
|
|
290
|
+
"generatedAt": "2025-09-10T11:43:38.640Z",
|
|
291
291
|
"source": "Zod schema"
|
|
292
292
|
},
|
|
293
293
|
"button": {
|
|
@@ -822,7 +822,7 @@
|
|
|
822
822
|
"title": "Button Component Props",
|
|
823
823
|
"description": "Props schema for the button component in Kookie UI",
|
|
824
824
|
"version": "1.0.0",
|
|
825
|
-
"generatedAt": "2025-09-
|
|
825
|
+
"generatedAt": "2025-09-10T11:43:38.645Z",
|
|
826
826
|
"source": "Zod schema"
|
|
827
827
|
},
|
|
828
828
|
"icon-button": {
|
|
@@ -1140,7 +1140,7 @@
|
|
|
1140
1140
|
"title": "Icon-button Component Props",
|
|
1141
1141
|
"description": "Props schema for the icon-button component in Kookie UI",
|
|
1142
1142
|
"version": "1.0.0",
|
|
1143
|
-
"generatedAt": "2025-09-
|
|
1143
|
+
"generatedAt": "2025-09-10T11:43:38.646Z",
|
|
1144
1144
|
"source": "Zod schema"
|
|
1145
1145
|
},
|
|
1146
1146
|
"toggle-button": {
|
|
@@ -1683,7 +1683,7 @@
|
|
|
1683
1683
|
"title": "Toggle-button Component Props",
|
|
1684
1684
|
"description": "Props schema for the toggle-button component in Kookie UI",
|
|
1685
1685
|
"version": "1.0.0",
|
|
1686
|
-
"generatedAt": "2025-09-
|
|
1686
|
+
"generatedAt": "2025-09-10T11:43:38.647Z",
|
|
1687
1687
|
"source": "Zod schema"
|
|
1688
1688
|
},
|
|
1689
1689
|
"toggle-icon-button": {
|
|
@@ -2009,7 +2009,7 @@
|
|
|
2009
2009
|
"title": "Toggle-icon-button Component Props",
|
|
2010
2010
|
"description": "Props schema for the toggle-icon-button component in Kookie UI",
|
|
2011
2011
|
"version": "1.0.0",
|
|
2012
|
-
"generatedAt": "2025-09-
|
|
2012
|
+
"generatedAt": "2025-09-10T11:43:38.648Z",
|
|
2013
2013
|
"source": "Zod schema"
|
|
2014
2014
|
}
|
|
2015
2015
|
}
|
|
@@ -538,6 +538,6 @@
|
|
|
538
538
|
"title": "Toggle-button Component Props",
|
|
539
539
|
"description": "Props schema for the toggle-button component in Kookie UI",
|
|
540
540
|
"version": "1.0.0",
|
|
541
|
-
"generatedAt": "2025-09-
|
|
541
|
+
"generatedAt": "2025-09-10T11:43:38.647Z",
|
|
542
542
|
"source": "Zod schema"
|
|
543
543
|
}
|
|
@@ -321,6 +321,6 @@
|
|
|
321
321
|
"title": "Toggle-icon-button Component Props",
|
|
322
322
|
"description": "Props schema for the toggle-icon-button component in Kookie UI",
|
|
323
323
|
"version": "1.0.0",
|
|
324
|
-
"generatedAt": "2025-09-
|
|
324
|
+
"generatedAt": "2025-09-10T11:43:38.648Z",
|
|
325
325
|
"source": "Zod schema"
|
|
326
326
|
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/*
|
|
2
|
+
Base Sidebar Menu Styles
|
|
3
|
+
- Extends Base Menu primitives for sidebar context
|
|
4
|
+
- Provides Sidebar menu structure: Menu, MenuItem, MenuButton, Sub* parts
|
|
5
|
+
- Relies on Base Menu tokens: --base-menu-*
|
|
6
|
+
*/
|
|
2
7
|
|
|
3
8
|
/* Sidebar Menu - based on rt-BaseMenuViewport */
|
|
4
9
|
.rt-SidebarMenu {
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/*
|
|
2
|
+
Base Sidebar Layout and Container Styles
|
|
3
|
+
- Slot containers: Root, Container, Header, Content, Footer, Separator
|
|
4
|
+
- No visual variants here; only structure and slot-level primitives
|
|
5
|
+
- Shared tokens defined/consumed: --sidebar-base-border-radius, etc.
|
|
6
|
+
*/
|
|
2
7
|
|
|
3
8
|
/* Sidebar Provider - handles positioning */
|
|
4
9
|
.rt-SidebarProvider {
|
|
@@ -31,34 +36,6 @@
|
|
|
31
36
|
flex: 1;
|
|
32
37
|
height: 100%;
|
|
33
38
|
}
|
|
34
|
-
|
|
35
|
-
/* Floating type - ONLY visual changes */
|
|
36
|
-
&:where([data-type='floating']) {
|
|
37
|
-
border-radius: var(--sidebar-base-border-radius);
|
|
38
|
-
margin: var(--space-2);
|
|
39
|
-
height: calc(100% - var(--space-4));
|
|
40
|
-
overflow: visible; /* Ensure shadow is not clipped */
|
|
41
|
-
position: relative; /* Ensure proper stacking context for floating sidebars */
|
|
42
|
-
|
|
43
|
-
/* Ensure Theme wrapper has proper border radius in floating mode */
|
|
44
|
-
& :where(.radix-themes) {
|
|
45
|
-
border-radius: inherit;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/* Set border radius for floating sidebars based on size - set on the root where it's used */
|
|
51
|
-
.rt-SidebarRoot:where([data-type='floating']) {
|
|
52
|
-
/* Default radius for floating sidebars */
|
|
53
|
-
--sidebar-base-border-radius: var(--radius-5);
|
|
54
|
-
|
|
55
|
-
&:where(.rt-r-size-1) {
|
|
56
|
-
--sidebar-base-border-radius: var(--radius-5);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
&:where(.rt-r-size-2) {
|
|
60
|
-
--sidebar-base-border-radius: var(--radius-6);
|
|
61
|
-
}
|
|
62
39
|
}
|
|
63
40
|
|
|
64
41
|
/* Sidebar Container */
|
package/src/components/shell.css
CHANGED
|
@@ -231,6 +231,28 @@
|
|
|
231
231
|
transition: opacity var(--motion-duration-small) var(--motion-ease-standard);
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
+
/* Stacked Sidebar: left side, floating without reflow */
|
|
235
|
+
.rt-ShellSidebar[data-presentation='stacked'] {
|
|
236
|
+
position: absolute;
|
|
237
|
+
inset-block: 0;
|
|
238
|
+
inset-inline-start: 0;
|
|
239
|
+
z-index: 31; /* between left and inspector; above content */
|
|
240
|
+
transform: translateX(-100%);
|
|
241
|
+
will-change: transform;
|
|
242
|
+
transition:
|
|
243
|
+
transform var(--motion-duration-small) var(--motion-ease-standard),
|
|
244
|
+
box-shadow var(--motion-duration-small) var(--motion-ease-standard);
|
|
245
|
+
box-shadow: 4px 0 12px -6px rgba(0, 0, 0, 0.2);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.rt-ShellSidebar[data-presentation='stacked'][data-open] {
|
|
249
|
+
transform: translateX(0);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.rt-ShellSidebar[data-presentation='stacked'][data-peek] {
|
|
253
|
+
transform: translateX(0);
|
|
254
|
+
}
|
|
255
|
+
|
|
234
256
|
/* Content - main work area (always required) */
|
|
235
257
|
.rt-ShellContent {
|
|
236
258
|
flex: 1;
|
package/src/components/shell.tsx
CHANGED
|
@@ -1577,6 +1577,7 @@ const Sidebar = React.forwardRef<
|
|
|
1577
1577
|
data-mode={shell.sidebarMode}
|
|
1578
1578
|
data-peek={shell.peekTarget === 'sidebar' || undefined}
|
|
1579
1579
|
data-presentation={resolvedPresentation}
|
|
1580
|
+
data-open={(isStacked && isContentVisible) || undefined}
|
|
1580
1581
|
style={{
|
|
1581
1582
|
...style,
|
|
1582
1583
|
['--sidebar-size' as any]: `${expandedSize}px`,
|
|
@@ -2072,10 +2073,10 @@ interface TriggerProps extends React.ComponentPropsWithoutRef<'button'> {
|
|
|
2072
2073
|
target: PaneTarget;
|
|
2073
2074
|
action?: TriggerAction;
|
|
2074
2075
|
/**
|
|
2075
|
-
*
|
|
2076
|
-
*
|
|
2076
|
+
* Whether to show peek preview on hover when the target pane is collapsed.
|
|
2077
|
+
* Defaults to false.
|
|
2077
2078
|
*/
|
|
2078
|
-
peekOnHover?: boolean
|
|
2079
|
+
peekOnHover?: boolean;
|
|
2079
2080
|
}
|
|
2080
2081
|
|
|
2081
2082
|
const Trigger = React.forwardRef<HTMLButtonElement, TriggerProps>(
|
|
@@ -2132,12 +2133,9 @@ const Trigger = React.forwardRef<HTMLButtonElement, TriggerProps>(
|
|
|
2132
2133
|
const handleMouseEnter = React.useCallback(
|
|
2133
2134
|
(event: React.MouseEvent<HTMLButtonElement>) => {
|
|
2134
2135
|
onMouseEnter?.(event);
|
|
2135
|
-
if (!peekOnHover) return;
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
// Use the actual target for peek behavior (not mapped to left)
|
|
2139
|
-
shell.peekPane(target);
|
|
2140
|
-
}
|
|
2136
|
+
if (!peekOnHover || !isCollapsed) return;
|
|
2137
|
+
// Use the actual target for peek behavior (not mapped to left)
|
|
2138
|
+
shell.peekPane(target);
|
|
2141
2139
|
},
|
|
2142
2140
|
[onMouseEnter, peekOnHover, isCollapsed, shell, target],
|
|
2143
2141
|
);
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Sidebar CSS (integration layer)
|
|
3
|
+
- Depends on Base Menu tokens/behavior
|
|
4
|
+
- Composes Sidebar container/layout + menu pieces
|
|
5
|
+
- Adds layout variants (rail/panel), sizes, and visual variants
|
|
6
|
+
- Non-breaking: organization and documentation only
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/* Imports: order matters → base tokens, container/layout, then menu parts */
|
|
1
10
|
@import './_internal/base-menu.css';
|
|
2
11
|
@import './_internal/base-sidebar.css';
|
|
3
12
|
@import './_internal/base-sidebar-menu.css';
|
|
@@ -65,125 +74,70 @@
|
|
|
65
74
|
|
|
66
75
|
/* Note: label styling omitted to avoid type-selector-specificity; use Text component for fine control */
|
|
67
76
|
|
|
68
|
-
/*
|
|
69
|
-
.rt-SidebarContainer
|
|
70
|
-
|
|
71
|
-
|
|
77
|
+
/* Base variables and panel background support (mirrors Card pattern) */
|
|
78
|
+
.rt-SidebarContainer {
|
|
79
|
+
--sidebar-border-width: 0px;
|
|
80
|
+
--sidebar-side-border-width: 0px;
|
|
81
|
+
--sidebar-background-color: transparent;
|
|
82
|
+
--sidebar-border-color: var(--gray-6);
|
|
83
|
+
transition: var(--transition-background-blur);
|
|
84
|
+
background-color: var(--sidebar-background-color);
|
|
72
85
|
|
|
73
|
-
/*
|
|
74
|
-
|
|
75
|
-
--color
|
|
76
|
-
backdrop-filter: none;
|
|
77
|
-
--backdrop-filter-panel: none;
|
|
78
|
-
--backdrop-filter-components: none;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
&:where([data-panel-background='translucent']) {
|
|
82
|
-
--color-panel: var(--color-panel-translucent);
|
|
86
|
+
/* Theme-level translucent override */
|
|
87
|
+
:where([data-panel-background='translucent']) & {
|
|
88
|
+
--sidebar-border-color: var(--gray-a6);
|
|
83
89
|
backdrop-filter: var(--backdrop-filter-panel);
|
|
84
|
-
--backdrop-filter-panel: blur(var(--backdrop-blur-panel));
|
|
85
|
-
--backdrop-filter-components: blur(var(--backdrop-blur-components));
|
|
86
90
|
}
|
|
87
91
|
|
|
88
|
-
/*
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
/* Component-level overrides */
|
|
93
|
+
&:where([data-panel-background='solid']) {
|
|
94
|
+
backdrop-filter: none;
|
|
95
|
+
--backdrop-filter-panel: none;
|
|
91
96
|
}
|
|
97
|
+
}
|
|
92
98
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
99
|
+
/* Centralized borders: apply a consistent inset border; avoid context coupling */
|
|
100
|
+
.rt-SidebarContainer {
|
|
101
|
+
/* Vertical-only borders (left & right), no top/bottom */
|
|
102
|
+
box-shadow:
|
|
103
|
+
inset var(--sidebar-side-border-width) 0 0 0 var(--sidebar-border-color),
|
|
104
|
+
inset calc(var(--sidebar-side-border-width) * -1) 0 0 0 var(--sidebar-border-color);
|
|
105
|
+
}
|
|
97
106
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
107
|
+
/* Container Variants (variables only) */
|
|
108
|
+
.rt-SidebarContainer:where(.rt-variant-outline) {
|
|
109
|
+
--sidebar-border-width: 1px;
|
|
110
|
+
--sidebar-side-border-width: 1px;
|
|
111
|
+
--sidebar-background-color: transparent;
|
|
101
112
|
}
|
|
102
113
|
|
|
103
114
|
.rt-SidebarContainer:where(.rt-variant-ghost) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
115
|
+
--sidebar-border-width: 0px;
|
|
116
|
+
--sidebar-side-border-width: 0px;
|
|
117
|
+
--sidebar-background-color: transparent;
|
|
107
118
|
}
|
|
108
119
|
|
|
109
120
|
.rt-SidebarContainer:where(.rt-variant-soft) {
|
|
121
|
+
--sidebar-border-width: 0px;
|
|
122
|
+
--sidebar-side-border-width: 0px;
|
|
110
123
|
/* Base state: solid colors for solid panels */
|
|
111
|
-
background-color: var(--gray-2);
|
|
124
|
+
--sidebar-background-color: var(--gray-2);
|
|
112
125
|
|
|
113
126
|
/* Theme-level translucent override */
|
|
114
127
|
:where([data-panel-background='translucent']) & {
|
|
115
|
-
background-color: color-mix(in srgb, var(--gray-a2), var(--gray-2) 60%);
|
|
116
|
-
backdrop-filter: var(--backdrop-filter-panel);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/* Component-level overrides (higher specificity) */
|
|
120
|
-
&:where([data-panel-background='solid']) {
|
|
121
|
-
background-color: var(--gray-2);
|
|
122
|
-
backdrop-filter: none;
|
|
123
|
-
--backdrop-filter-components: none;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
&:where([data-panel-background='translucent']) {
|
|
127
|
-
background-color: color-mix(in srgb, var(--gray-a2), var(--gray-2) 60%);
|
|
128
|
-
backdrop-filter: var(--backdrop-filter-panel);
|
|
129
|
-
--backdrop-filter-panel: blur(var(--backdrop-blur-panel));
|
|
130
|
-
--backdrop-filter-components: blur(var(--backdrop-blur-components));
|
|
128
|
+
--sidebar-background-color: color-mix(in srgb, var(--gray-a2), var(--gray-2) 60%);
|
|
131
129
|
}
|
|
132
130
|
}
|
|
133
131
|
|
|
134
132
|
.rt-SidebarContainer:where(.rt-variant-surface) {
|
|
135
|
-
|
|
136
|
-
|
|
133
|
+
--sidebar-border-width: 1px;
|
|
134
|
+
--sidebar-side-border-width: 1px;
|
|
135
|
+
/* Base state: neutral gray background */
|
|
136
|
+
--sidebar-background-color: var(--gray-1);
|
|
137
137
|
|
|
138
138
|
/* Theme-level translucent override */
|
|
139
139
|
:where([data-panel-background='translucent']) & {
|
|
140
|
-
background-color: color-mix(in srgb, var(--gray-a1), var(--gray-1) 60%);
|
|
141
|
-
backdrop-filter: var(--backdrop-filter-panel);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/* Component-level overrides (higher specificity) */
|
|
145
|
-
&:where([data-panel-background='solid']) {
|
|
146
|
-
background-color: var(--gray-1);
|
|
147
|
-
backdrop-filter: none;
|
|
148
|
-
--backdrop-filter-panel: none;
|
|
149
|
-
--backdrop-filter-components: none;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
&:where([data-panel-background='translucent']) {
|
|
153
|
-
background-color: color-mix(in srgb, var(--gray-a1), var(--gray-1) 60%);
|
|
154
|
-
backdrop-filter: var(--backdrop-filter-panel);
|
|
155
|
-
--backdrop-filter-panel: blur(var(--backdrop-blur-panel));
|
|
156
|
-
--backdrop-filter-components: blur(var(--backdrop-blur-components));
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/* Inset border like Card surface variant */
|
|
160
|
-
/* Floating sidebars get full inset border */
|
|
161
|
-
:where(.rt-SidebarRoot[data-type='floating']) & {
|
|
162
|
-
box-shadow: inset 0 0 0 1px var(--gray-6);
|
|
163
|
-
|
|
164
|
-
/* Theme-level translucent override */
|
|
165
|
-
:where([data-panel-background='translucent']) & {
|
|
166
|
-
box-shadow: inset 0 0 0 1px var(--gray-a6);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
/* Non-floating sidebars get border only on the content-facing side */
|
|
171
|
-
:where(.rt-SidebarRoot[data-type='sidebar'][data-side='left']) & {
|
|
172
|
-
box-shadow: inset -1px 0 0 0 var(--gray-6);
|
|
173
|
-
|
|
174
|
-
/* Theme-level translucent override */
|
|
175
|
-
:where([data-panel-background='translucent']) & {
|
|
176
|
-
box-shadow: inset -1px 0 0 0 var(--gray-a6);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
:where(.rt-SidebarRoot[data-type='sidebar'][data-side='right']) & {
|
|
181
|
-
box-shadow: inset 1px 0 0 0 var(--gray-6);
|
|
182
|
-
|
|
183
|
-
/* Theme-level translucent override */
|
|
184
|
-
:where([data-panel-background='translucent']) & {
|
|
185
|
-
box-shadow: inset 1px 0 0 0 var(--gray-a6);
|
|
186
|
-
}
|
|
140
|
+
--sidebar-background-color: color-mix(in srgb, var(--gray-a1), var(--gray-1) 60%);
|
|
187
141
|
}
|
|
188
142
|
}
|
|
189
143
|
|
|
@@ -193,8 +147,8 @@
|
|
|
193
147
|
flex-direction: row;
|
|
194
148
|
align-items: center;
|
|
195
149
|
gap: var(--space-2);
|
|
196
|
-
padding: var(--base-
|
|
197
|
-
min-height: var(--
|
|
150
|
+
padding: var(--sidebar-base-padding);
|
|
151
|
+
min-height: var(--sidebar-item-height);
|
|
198
152
|
|
|
199
153
|
/* Make MenuButtons expand to full width */
|
|
200
154
|
& :where(.rt-SidebarMenuButton) {
|
|
@@ -207,8 +161,8 @@
|
|
|
207
161
|
flex-direction: row;
|
|
208
162
|
align-items: center;
|
|
209
163
|
gap: var(--space-2);
|
|
210
|
-
padding: var(--base-
|
|
211
|
-
min-height: var(--
|
|
164
|
+
padding: var(--sidebar-base-padding);
|
|
165
|
+
min-height: var(--sidebar-item-height);
|
|
212
166
|
|
|
213
167
|
/* Make MenuButtons expand to full width */
|
|
214
168
|
& :where(.rt-SidebarMenuButton) {
|
|
@@ -359,9 +313,11 @@
|
|
|
359
313
|
.rt-SidebarContainer {
|
|
360
314
|
&:where(.rt-r-size-1) {
|
|
361
315
|
--sidebar-base-padding: var(--space-3);
|
|
316
|
+
--sidebar-item-height: var(--space-5);
|
|
362
317
|
}
|
|
363
318
|
&:where(.rt-r-size-2) {
|
|
364
319
|
--sidebar-base-padding: var(--space-4);
|
|
320
|
+
--sidebar-item-height: var(--space-6);
|
|
365
321
|
}
|
|
366
322
|
}
|
|
367
323
|
|
|
@@ -16,7 +16,7 @@ export {
|
|
|
16
16
|
const sizes = ['1', '2'] as const;
|
|
17
17
|
const variants = ['soft', 'outline', 'surface', 'ghost'] as const;
|
|
18
18
|
const menuVariants = ['solid', 'soft'] as const;
|
|
19
|
-
const types = ['sidebar'
|
|
19
|
+
const types = ['sidebar'] as const;
|
|
20
20
|
const sides = ['left', 'right'] as const;
|
|
21
21
|
const collapsibleModes = ['offcanvas', 'icon', 'none'] as const;
|
|
22
22
|
const layouts = ['rail', 'panel'] as const;
|