@ecopages/radiant-ui 0.1.0-beta.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.
- package/README.md +70 -0
- package/dist/components/ui/alert/alert.css +27 -0
- package/dist/components/ui/alert/alert.d.ts +4 -0
- package/dist/components/ui/alert/alert.script.d.ts +25 -0
- package/dist/components/ui/alert/index.d.ts +2 -0
- package/dist/components/ui/alert/index.js +2 -0
- package/dist/components/ui/alert/index.js.map +7 -0
- package/dist/components/ui/breadcrumb/breadcrumb.css +41 -0
- package/dist/components/ui/breadcrumb/breadcrumb.d.ts +59 -0
- package/dist/components/ui/breadcrumb/breadcrumb.script.d.ts +40 -0
- package/dist/components/ui/breadcrumb/index.d.ts +2 -0
- package/dist/components/ui/breadcrumb/index.js +2 -0
- package/dist/components/ui/breadcrumb/index.js.map +7 -0
- package/dist/components/ui/button/button.d.ts +37 -0
- package/dist/components/ui/button/index.d.ts +1 -0
- package/dist/components/ui/button/index.js +2 -0
- package/dist/components/ui/button/index.js.map +7 -0
- package/dist/components/ui/carousel/carousel.css +170 -0
- package/dist/components/ui/carousel/carousel.d.ts +39 -0
- package/dist/components/ui/carousel/carousel.script.d.ts +113 -0
- package/dist/components/ui/carousel/index.d.ts +2 -0
- package/dist/components/ui/carousel/index.js +2 -0
- package/dist/components/ui/carousel/index.js.map +7 -0
- package/dist/components/ui/checkbox/checkbox.css +55 -0
- package/dist/components/ui/checkbox/checkbox.d.ts +4 -0
- package/dist/components/ui/checkbox/checkbox.script.d.ts +58 -0
- package/dist/components/ui/checkbox/index.d.ts +2 -0
- package/dist/components/ui/checkbox/index.js +2 -0
- package/dist/components/ui/checkbox/index.js.map +7 -0
- package/dist/components/ui/combobox/combobox.css +65 -0
- package/dist/components/ui/combobox/combobox.d.ts +53 -0
- package/dist/components/ui/combobox/combobox.script.d.ts +89 -0
- package/dist/components/ui/combobox/index.d.ts +2 -0
- package/dist/components/ui/combobox/index.js +2 -0
- package/dist/components/ui/combobox/index.js.map +7 -0
- package/dist/components/ui/dialog/dialog-registry.d.ts +34 -0
- package/dist/components/ui/dialog/dialog-registry.test.d.ts +1 -0
- package/dist/components/ui/dialog/dialog-types.d.ts +55 -0
- package/dist/components/ui/dialog/dialog.css +53 -0
- package/dist/components/ui/dialog/dialog.d.ts +36 -0
- package/dist/components/ui/dialog/dialog.script.d.ts +61 -0
- package/dist/components/ui/dialog/index.d.ts +4 -0
- package/dist/components/ui/dialog/index.js +2 -0
- package/dist/components/ui/dialog/index.js.map +7 -0
- package/dist/components/ui/disclosure/disclosure-group.script.d.ts +31 -0
- package/dist/components/ui/disclosure/disclosure.css +105 -0
- package/dist/components/ui/disclosure/disclosure.d.ts +35 -0
- package/dist/components/ui/disclosure/disclosure.script.d.ts +38 -0
- package/dist/components/ui/disclosure/index.d.ts +3 -0
- package/dist/components/ui/disclosure/index.js +2 -0
- package/dist/components/ui/disclosure/index.js.map +7 -0
- package/dist/components/ui/feed/feed.css +14 -0
- package/dist/components/ui/feed/feed.d.ts +12 -0
- package/dist/components/ui/feed/feed.script.d.ts +22 -0
- package/dist/components/ui/feed/index.d.ts +2 -0
- package/dist/components/ui/feed/index.js +2 -0
- package/dist/components/ui/feed/index.js.map +7 -0
- package/dist/components/ui/field/field-context.d.ts +20 -0
- package/dist/components/ui/field/field-description.d.ts +8 -0
- package/dist/components/ui/field/field-error.d.ts +9 -0
- package/dist/components/ui/field/field-ssr-hydration.test.d.ts +1 -0
- package/dist/components/ui/field/field.css +26 -0
- package/dist/components/ui/field/field.d.ts +4 -0
- package/dist/components/ui/field/field.script.d.ts +68 -0
- package/dist/components/ui/field/index.d.ts +5 -0
- package/dist/components/ui/field/index.js +2 -0
- package/dist/components/ui/field/index.js.map +7 -0
- package/dist/components/ui/form/control-protocol.d.ts +19 -0
- package/dist/components/ui/form/form-context.d.ts +27 -0
- package/dist/components/ui/form/form-field.test.d.ts +3 -0
- package/dist/components/ui/form/form-store.d.ts +53 -0
- package/dist/components/ui/form/form-store.test.d.ts +1 -0
- package/dist/components/ui/form/form.css +12 -0
- package/dist/components/ui/form/form.d.ts +5 -0
- package/dist/components/ui/form/form.script.d.ts +67 -0
- package/dist/components/ui/form/index.d.ts +7 -0
- package/dist/components/ui/form/index.js +2 -0
- package/dist/components/ui/form/index.js.map +7 -0
- package/dist/components/ui/form/resolvers.d.ts +3 -0
- package/dist/components/ui/form/types.d.ts +72 -0
- package/dist/components/ui/grid/grid.css +47 -0
- package/dist/components/ui/grid/grid.d.ts +7 -0
- package/dist/components/ui/grid/grid.script.d.ts +26 -0
- package/dist/components/ui/grid/index.d.ts +2 -0
- package/dist/components/ui/grid/index.js +2 -0
- package/dist/components/ui/grid/index.js.map +7 -0
- package/dist/components/ui/input/index.d.ts +1 -0
- package/dist/components/ui/input/index.js +2 -0
- package/dist/components/ui/input/index.js.map +7 -0
- package/dist/components/ui/input/input.css +32 -0
- package/dist/components/ui/input/input.d.ts +23 -0
- package/dist/components/ui/label/index.d.ts +1 -0
- package/dist/components/ui/label/index.js +2 -0
- package/dist/components/ui/label/index.js.map +7 -0
- package/dist/components/ui/label/label.css +8 -0
- package/dist/components/ui/label/label.d.ts +9 -0
- package/dist/components/ui/listbox/index.d.ts +2 -0
- package/dist/components/ui/listbox/index.js +2 -0
- package/dist/components/ui/listbox/index.js.map +7 -0
- package/dist/components/ui/listbox/listbox.css +23 -0
- package/dist/components/ui/listbox/listbox.d.ts +12 -0
- package/dist/components/ui/listbox/listbox.script.d.ts +40 -0
- package/dist/components/ui/menu-button/index.d.ts +2 -0
- package/dist/components/ui/menu-button/index.js +2 -0
- package/dist/components/ui/menu-button/index.js.map +7 -0
- package/dist/components/ui/menu-button/menu-button.css +43 -0
- package/dist/components/ui/menu-button/menu-button.d.ts +13 -0
- package/dist/components/ui/menu-button/menu-button.script.d.ts +64 -0
- package/dist/components/ui/menubar/index.d.ts +2 -0
- package/dist/components/ui/menubar/index.js +2 -0
- package/dist/components/ui/menubar/index.js.map +7 -0
- package/dist/components/ui/menubar/menubar.css +45 -0
- package/dist/components/ui/menubar/menubar.d.ts +16 -0
- package/dist/components/ui/menubar/menubar.script.d.ts +52 -0
- package/dist/components/ui/meter/index.d.ts +2 -0
- package/dist/components/ui/meter/index.js +2 -0
- package/dist/components/ui/meter/index.js.map +7 -0
- package/dist/components/ui/meter/meter.css +17 -0
- package/dist/components/ui/meter/meter.d.ts +4 -0
- package/dist/components/ui/meter/meter.script.d.ts +33 -0
- package/dist/components/ui/navigation-menu/index.d.ts +2 -0
- package/dist/components/ui/navigation-menu/index.js +2 -0
- package/dist/components/ui/navigation-menu/index.js.map +7 -0
- package/dist/components/ui/navigation-menu/navigation-menu.css +90 -0
- package/dist/components/ui/navigation-menu/navigation-menu.d.ts +28 -0
- package/dist/components/ui/navigation-menu/navigation-menu.script.d.ts +49 -0
- package/dist/components/ui/radio-group/index.d.ts +2 -0
- package/dist/components/ui/radio-group/index.js +2 -0
- package/dist/components/ui/radio-group/index.js.map +7 -0
- package/dist/components/ui/radio-group/radio-group.css +44 -0
- package/dist/components/ui/radio-group/radio-group.d.ts +12 -0
- package/dist/components/ui/radio-group/radio-group.script.d.ts +52 -0
- package/dist/components/ui/sidebar/index.d.ts +3 -0
- package/dist/components/ui/sidebar/index.js +2 -0
- package/dist/components/ui/sidebar/index.js.map +7 -0
- package/dist/components/ui/sidebar/sidebar-trigger.script.d.ts +53 -0
- package/dist/components/ui/sidebar/sidebar.css +362 -0
- package/dist/components/ui/sidebar/sidebar.d.ts +141 -0
- package/dist/components/ui/sidebar/sidebar.script.d.ts +140 -0
- package/dist/components/ui/sidebar/sidebar.test.d.ts +1 -0
- package/dist/components/ui/slider/index.d.ts +2 -0
- package/dist/components/ui/slider/index.js +2 -0
- package/dist/components/ui/slider/index.js.map +7 -0
- package/dist/components/ui/slider/slider.css +51 -0
- package/dist/components/ui/slider/slider.d.ts +7 -0
- package/dist/components/ui/slider/slider.script.d.ts +102 -0
- package/dist/components/ui/spinbutton/index.d.ts +2 -0
- package/dist/components/ui/spinbutton/index.js +2 -0
- package/dist/components/ui/spinbutton/index.js.map +7 -0
- package/dist/components/ui/spinbutton/spinbutton.css +19 -0
- package/dist/components/ui/spinbutton/spinbutton.d.ts +4 -0
- package/dist/components/ui/spinbutton/spinbutton.script.d.ts +64 -0
- package/dist/components/ui/switch/index.d.ts +2 -0
- package/dist/components/ui/switch/index.js +2 -0
- package/dist/components/ui/switch/index.js.map +7 -0
- package/dist/components/ui/switch/switch.css +47 -0
- package/dist/components/ui/switch/switch.d.ts +4 -0
- package/dist/components/ui/switch/switch.script.d.ts +51 -0
- package/dist/components/ui/tabs/index.d.ts +2 -0
- package/dist/components/ui/tabs/index.js +2 -0
- package/dist/components/ui/tabs/index.js.map +7 -0
- package/dist/components/ui/tabs/tabs.css +28 -0
- package/dist/components/ui/tabs/tabs.d.ts +12 -0
- package/dist/components/ui/tabs/tabs.script.d.ts +54 -0
- package/dist/components/ui/textarea/index.d.ts +1 -0
- package/dist/components/ui/textarea/index.js +2 -0
- package/dist/components/ui/textarea/index.js.map +7 -0
- package/dist/components/ui/textarea/textarea.css +33 -0
- package/dist/components/ui/textarea/textarea.d.ts +23 -0
- package/dist/components/ui/toast/index.d.ts +5 -0
- package/dist/components/ui/toast/index.js +2 -0
- package/dist/components/ui/toast/index.js.map +7 -0
- package/dist/components/ui/toast/toast-api.d.ts +29 -0
- package/dist/components/ui/toast/toast-context.d.ts +59 -0
- package/dist/components/ui/toast/toast-state.d.ts +25 -0
- package/dist/components/ui/toast/toast.css +315 -0
- package/dist/components/ui/toast/toast.d.ts +8 -0
- package/dist/components/ui/toast/toast.script.d.ts +91 -0
- package/dist/components/ui/toast/toast.test.d.ts +2 -0
- package/dist/components/ui/toast/toaster.script.d.ts +79 -0
- package/dist/components/ui/toolbar/index.d.ts +2 -0
- package/dist/components/ui/toolbar/index.js +2 -0
- package/dist/components/ui/toolbar/index.js.map +7 -0
- package/dist/components/ui/toolbar/toolbar.css +16 -0
- package/dist/components/ui/toolbar/toolbar.d.ts +4 -0
- package/dist/components/ui/toolbar/toolbar.script.d.ts +30 -0
- package/dist/components/ui/tooltip/index.d.ts +2 -0
- package/dist/components/ui/tooltip/index.js +2 -0
- package/dist/components/ui/tooltip/index.js.map +7 -0
- package/dist/components/ui/tooltip/tooltip.css +25 -0
- package/dist/components/ui/tooltip/tooltip.d.ts +4 -0
- package/dist/components/ui/tooltip/tooltip.script.d.ts +70 -0
- package/dist/components/ui/tree/index.d.ts +2 -0
- package/dist/components/ui/tree/index.js +2 -0
- package/dist/components/ui/tree/index.js.map +7 -0
- package/dist/components/ui/tree/tree.css +54 -0
- package/dist/components/ui/tree/tree.d.ts +13 -0
- package/dist/components/ui/tree/tree.script.d.ts +45 -0
- package/dist/components/ui/treegrid/index.d.ts +2 -0
- package/dist/components/ui/treegrid/index.js +2 -0
- package/dist/components/ui/treegrid/index.js.map +7 -0
- package/dist/components/ui/treegrid/treegrid.css +77 -0
- package/dist/components/ui/treegrid/treegrid.d.ts +14 -0
- package/dist/components/ui/treegrid/treegrid.script.d.ts +49 -0
- package/dist/components/ui/window-splitter/index.d.ts +2 -0
- package/dist/components/ui/window-splitter/index.js +2 -0
- package/dist/components/ui/window-splitter/index.js.map +7 -0
- package/dist/components/ui/window-splitter/window-splitter.css +35 -0
- package/dist/components/ui/window-splitter/window-splitter.d.ts +8 -0
- package/dist/components/ui/window-splitter/window-splitter.script.d.ts +49 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +7 -0
- package/dist/lib/focusable-elements.d.ts +2 -0
- package/dist/lib/radiant-view.d.ts +17 -0
- package/dist/lib/roving-tabindex.d.ts +27 -0
- package/dist/styles/components/button.css +115 -0
- package/dist/styles/radiant-ui-core.css +7 -0
- package/dist/styles/radiant-ui.css +10 -0
- package/dist/styles/styles.css +36 -0
- package/dist/styles/tailwind.css +41 -0
- package/dist/styles/themes/aurora.css +19 -0
- package/dist/styles/themes/default-compact-soft.css +19 -0
- package/dist/styles/themes/default.css +2 -0
- package/dist/styles/themes/glacier.css +19 -0
- package/dist/styles/tokens/colors/aurora.css +73 -0
- package/dist/styles/tokens/colors/basalt.css +36 -0
- package/dist/styles/tokens/colors/glacier.css +45 -0
- package/dist/styles/tokens/colors/palettes.css +3 -0
- package/dist/styles/tokens/elevation/default.css +22 -0
- package/dist/styles/tokens/elevation/flat.css +22 -0
- package/dist/styles/tokens/motion/default.css +19 -0
- package/dist/styles/tokens/motion/snappy.css +19 -0
- package/dist/styles/tokens/presets/colors/aurora.css +126 -0
- package/dist/styles/tokens/presets/colors/basalt.css +126 -0
- package/dist/styles/tokens/presets/colors/ember.css +134 -0
- package/dist/styles/tokens/presets/colors/glacier.css +130 -0
- package/dist/styles/tokens/presets/colors/index.css +4 -0
- package/dist/styles/tokens/presets/radius.css +45 -0
- package/dist/styles/tokens/presets/spacing.css +57 -0
- package/dist/styles/tokens/radius/default.css +34 -0
- package/dist/styles/tokens/radius/edgy.css +35 -0
- package/dist/styles/tokens/radius/sharp.css +2 -0
- package/dist/styles/tokens/radius/soft.css +34 -0
- package/dist/styles/tokens/semantic.css +80 -0
- package/dist/styles/tokens/spacing/compact.css +23 -0
- package/dist/styles/tokens/spacing/default.css +23 -0
- package/dist/styles/tokens/spacing/scale-bridge.css +17 -0
- package/dist/styles/tokens/spacing/wide.css +23 -0
- package/dist/styles/tokens/system.css +36 -0
- package/dist/styles/tokens/typography/default.css +37 -0
- package/dist/styles/utilities/sheen.css +7 -0
- package/dist/types.d.ts +14 -0
- package/package.json +371 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/ui/sidebar/sidebar.script.tsx", "../../../../src/components/ui/sidebar/sidebar-trigger.script.tsx", "../../../../src/lib/radiant-view.ts", "../../../../src/components/ui/sidebar/sidebar.tsx"],
|
|
4
|
+
"sourcesContent": ["import { RadiantElement, bound, customElement, event, onEvent, onUpdated, prop, query, state } from '@ecopages/radiant';\nimport type { EventEmitter } from '@ecopages/radiant/tools/event-emitter';\n\nexport type RuiSidebarVariant = 'sidebar' | 'inset';\nexport type RuiSidebarSide = 'left' | 'right';\nexport type RuiSidebarCollapsible = 'off' | 'icon' | 'full';\nexport type RuiSidebarState = 'expanded' | 'collapsed';\n\nexport type RuiSidebarProps = {\n\t/** Visual treatment. `sidebar` is the default bordered pane; `inset` floats inside a card. Default: `sidebar`. */\n\tvariant?: RuiSidebarVariant;\n\t/** Which edge the sidebar sits on. Default: `left`. */\n\tside?: RuiSidebarSide;\n\t/** Collapse behavior. `off` keeps the pane open; `icon` collapses to an icon rail; `full` collapses fully. Default: `off`. */\n\tcollapsible?: RuiSidebarCollapsible;\n\t/** Initial open state when uncontrolled. Default: `true`. */\n\tdefaultOpen?: boolean;\n\t/** Controlled open state. */\n\topen?: boolean;\n\t/** Initial width in pixels when uncontrolled. Default: `256`. */\n\tdefaultWidth?: number;\n\t/** Controlled width in pixels. */\n\twidth?: number;\n\t/** Minimum width in pixels when resizing. Default: `200`. */\n\tminWidth?: number;\n\t/** Maximum width in pixels when resizing. Default: `480`. */\n\tmaxWidth?: number;\n\t/** Hide on viewports below this width. Default: `768`. */\n\tmobileBreakpoint?: number;\n\t/** Accessible name announced by the pane landmark and triggers. Default: `Sidebar`. */\n\tlabel?: string;\n};\n\nexport type RuiSidebarToggleDetail = { open: boolean; state: RuiSidebarState };\nexport type RuiSidebarResizeDetail = { width: number };\n\ntype RuiSidebarBindings = {\n\tlabel: string;\n};\n\nconst DEFAULT_WIDTH = 256;\nconst ICON_WIDTH = 48;\nconst DEFAULT_MIN_WIDTH = 200;\nconst DEFAULT_MAX_WIDTH = 480;\nconst DEFAULT_MOBILE_BREAKPOINT = 768;\nconst KEYBOARD_SHORTCUT = 'b';\nconst KEYBOARD_STEP = 8;\nconst KEYBOARD_STEP_LARGE = 32;\n\nfunction isModifierPressed(event: KeyboardEvent): boolean {\n\treturn event.metaKey || event.ctrlKey;\n}\n\nfunction isMediaQuerySupported(): boolean {\n\treturn typeof window !== 'undefined' && typeof window.matchMedia === 'function';\n}\n\nfunction isHorizontalSide(side: RuiSidebarSide): boolean {\n\treturn side === 'left' || side === 'right';\n}\n\n/**\n * `<rui-sidebar>` \u2014 a resizable, collapsible side panel.\n *\n * The sidebar hosts the pane content in the default slot. When the parent\n * supplies a `RuiSidebarRail` element (or the `collapsible` mode is not\n * `off`), the sidebar manages open/closed state, a focusable resize handle,\n * and keyboard navigation that follows the APG Window Splitter pattern.\n *\n * When `collapsible=\"off\"` (the default), the pane stays open and exposes\n * a draggable resize handle. When `collapsible=\"icon\"`, the pane collapses\n * to a narrow rail. When `collapsible=\"full\"`, the pane is hidden until\n * toggled, and shown as an overlay drawer below the mobile breakpoint.\n *\n * The host reflects `data-state`, `data-collapsible`, `data-variant`,\n * `data-side`, and `data-mobile` so the stylesheet can drive every visual\n * mode without imperative JS.\n *\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/windowsplitter/\n *\n * @element rui-sidebar\n * @slot - Pane content. Stack header, content, and footer inside.\n * @fires rui-sidebar-toggle - Emitted on every open/closed transition.\n * `detail` is `{ open, state }`.\n * @fires rui-sidebar-resize - Emitted on every width change. `detail` is `{ width }`.\n * @fires rui-sidebar-mobile-change - Emitted when the host flips between\n * mobile drawer mode and inline mode. `detail` is `{ mobile: boolean }`.\n */\n@customElement('rui-sidebar')\nexport class RuiSidebar extends RadiantElement<RuiSidebarBindings> {\n\t@prop({ type: String, reflect: true, defaultValue: 'sidebar' }) variant: RuiSidebarVariant;\n\t@prop({ type: String, reflect: true, defaultValue: 'left' }) side: RuiSidebarSide;\n\t@prop({ type: String, reflect: true, defaultValue: 'off' }) collapsible: RuiSidebarCollapsible;\n\t@prop({ type: Number, defaultValue: DEFAULT_WIDTH }) defaultWidth: number;\n\t@prop({ type: Number, reflect: true, attribute: 'width' }) width: number | undefined;\n\t@prop({ type: Number, defaultValue: DEFAULT_MIN_WIDTH }) minWidth: number;\n\t@prop({ type: Number, defaultValue: DEFAULT_MAX_WIDTH }) maxWidth: number;\n\t@prop({ type: Boolean, defaultValue: true }) defaultOpen: boolean;\n\t@prop({ type: Boolean, attribute: 'open' }) open: boolean | undefined;\n\t@prop({ type: Number, defaultValue: DEFAULT_MOBILE_BREAKPOINT }) mobileBreakpoint: number;\n\t@prop({ type: String, defaultValue: 'Sidebar' }) label: string;\n\n\t@query({ ref: 'root' }) rootTarget: HTMLElement;\n\t@query({ ref: 'pane' }) paneTarget: HTMLElement;\n\t@query({ ref: 'handle' }) handleTarget: HTMLElement;\n\t@query({ ref: 'scrim' }) scrimTarget: HTMLButtonElement;\n\n\t@event({ name: 'rui-sidebar-toggle', bubbles: true, composed: true })\n\ttoggleEvent: EventEmitter<RuiSidebarToggleDetail>;\n\n\t@event({ name: 'rui-sidebar-resize', bubbles: true, composed: true })\n\tresizeEvent: EventEmitter<RuiSidebarResizeDetail>;\n\n\t@event({ name: 'rui-sidebar-mobile-change', bubbles: true, composed: true })\n\tmobileChangeEvent: EventEmitter<{ mobile: boolean }>;\n\n\t@state isMobile = false;\n\tprivate mediaQuery: MediaQueryList | null = null;\n\tprivate readonly mediaListener = (event: MediaQueryListEvent): void => this.setMobile(event.matches);\n\n\tprivate dragging = false;\n\tprivate dragStartCoord = 0;\n\tprivate dragStartSize = 0;\n\n\toverride connectedCallback(): void {\n\t\tsuper.connectedCallback();\n\n\t\tif (this.open === undefined) {\n\t\t\tthis.open = this.defaultOpen;\n\t\t}\n\t\tthis.ensureWidthInitialized();\n\n\t\tthis.setAttribute('role', 'complementary');\n\t\tthis.setAttribute('aria-label', this.label);\n\t\tthis.syncHostAttributes();\n\t\t// Deferred JSX `.prop` bindings flush after connectedCallback \u2014 settle width\n\t\t// and re-bind the mobile media query after props are applied.\n\t\tqueueMicrotask(() => {\n\t\t\tif (this.open === undefined) {\n\t\t\t\tthis.open = this.defaultOpen;\n\t\t\t}\n\t\t\tthis.ensureWidthInitialized();\n\t\t\tthis.syncPaneWidthVar();\n\t\t\tthis.bindMobileMediaQuery();\n\t\t});\n\t}\n\n\toverride disconnectedCallback(): void {\n\t\tthis.endDrag();\n\t\tthis.unbindMobileMediaQuery();\n\t\tsuper.disconnectedCallback();\n\t}\n\n\t/**\n\t * Keep host `data-*` in sync for `:has(> rui-sidebar[...])` and public API.\n\t * Visual styles target the inner `.rui-sidebar` root (host is `display: contents`).\n\t */\n\tprivate syncHostAttributes(): void {\n\t\tconst paneState: RuiSidebarState = this.isOpen() ? 'expanded' : 'collapsed';\n\t\tthis.setAttribute('data-state', paneState);\n\t\tthis.setAttribute('data-collapsible', this.collapsible);\n\t\tthis.setAttribute('data-variant', this.variant);\n\t\tthis.setAttribute('data-side', this.side);\n\t\tthis.setAttribute('data-mobile', String(this.isMobile));\n\t\tthis.setAttribute('data-pane-width', String(this.paneWidth()));\n\t}\n\n\tprivate isOpen(): boolean {\n\t\treturn this.open !== false;\n\t}\n\n\t/**\n\t * Optional `Number` props initialize to `0` when no attribute/default is set\n\t * (`defaultValueForType(Number)`). Treat that unset `0` as \u201Cuse defaultWidth\u201D.\n\t */\n\tprivate ensureWidthInitialized(): void {\n\t\tif (this.hasAttribute('width')) return;\n\t\tif (this.width === undefined || this.width === 0) {\n\t\t\tthis.width = this.defaultWidth;\n\t\t}\n\t}\n\n\t@onUpdated([\n\t\t'open',\n\t\t'collapsible',\n\t\t'variant',\n\t\t'side',\n\t\t'width',\n\t\t'defaultWidth',\n\t\t'defaultOpen',\n\t\t'minWidth',\n\t\t'maxWidth',\n\t\t'isMobile',\n\t])\n\tonStateUpdated(): void {\n\t\tthis.syncHostAttributes();\n\t\tthis.syncPaneWidthVar();\n\t}\n\n\t@onUpdated(['mobileBreakpoint'])\n\tonMobileBreakpointUpdated(): void {\n\t\tthis.bindMobileMediaQuery();\n\t}\n\n\tprivate unbindMobileMediaQuery(): void {\n\t\tthis.mediaQuery?.removeEventListener('change', this.mediaListener);\n\t\tthis.mediaQuery = null;\n\t}\n\n\tprivate bindMobileMediaQuery(): void {\n\t\tthis.unbindMobileMediaQuery();\n\n\t\tif (this.mobileBreakpoint <= 0 || !isMediaQuerySupported()) {\n\t\t\tthis.setMobile(false);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.mediaQuery = window.matchMedia(`(max-width: ${this.mobileBreakpoint - 1}px)`);\n\t\tthis.mediaQuery.addEventListener('change', this.mediaListener);\n\t\tthis.setMobile(this.mediaQuery.matches);\n\t}\n\n\tprivate setMobile(next: boolean): void {\n\t\tif (next === this.isMobile) return;\n\t\tthis.isMobile = next;\n\t\tthis.mobileChangeEvent.emit({ mobile: next });\n\t}\n\n\tprivate clampWidth(next: number): number {\n\t\treturn Math.min(this.maxWidth, Math.max(this.minWidth, next));\n\t}\n\n\tprivate paneWidth(): number {\n\t\tif (!this.isOpen()) {\n\t\t\t// Mobile is always a full drawer \u2014 never leave an icon rail when closed.\n\t\t\tif (this.isMobile) return 0;\n\t\t\treturn this.collapsible === 'icon' ? ICON_WIDTH : 0;\n\t\t}\n\t\tconst configured = this.width && this.width > 0 ? this.width : this.defaultWidth;\n\t\treturn configured;\n\t}\n\n\t/** Drive layout through the CSS variable only \u2014 never set inline pane width. */\n\tprivate syncPaneWidthVar(width = this.paneWidth()): void {\n\t\tconst root = this.rootTarget;\n\t\tif (root) {\n\t\t\troot.style.setProperty('--rui-sidebar-pane-width', `${width}px`);\n\t\t}\n\t\tif (this.paneTarget) {\n\t\t\tthis.paneTarget.style.removeProperty('width');\n\t\t\tthis.paneTarget.style.removeProperty('height');\n\t\t}\n\t\tthis.setAttribute('data-pane-width', String(width));\n\t}\n\n\tprivate applyWidth(next: number, emit: boolean): void {\n\t\tconst clamped = this.clampWidth(next);\n\t\tthis.width = clamped;\n\t\tthis.syncPaneWidthVar(clamped);\n\t\tif (emit) {\n\t\t\tthis.resizeEvent.emit({ width: clamped });\n\t\t}\n\t}\n\n\ttoggle(): void {\n\t\tthis.setOpen(!this.isOpen());\n\t}\n\n\tsetOpen(next: boolean): void {\n\t\tconst wasOpen = this.isOpen();\n\t\tif (next === wasOpen) {\n\t\t\tthis.syncPaneWidthVar();\n\t\t\treturn;\n\t\t}\n\t\tthis.open = next;\n\t\tconst paneState: RuiSidebarState = next ? 'expanded' : 'collapsed';\n\t\tthis.setAttribute('data-state', paneState);\n\t\tthis.syncPaneWidthVar();\n\t\tthis.toggleEvent.emit({ open: next, state: paneState });\n\t}\n\n\tprivate beginDrag(event: PointerEvent): void {\n\t\tif (event.button !== 0) return;\n\t\tif (this.collapsible !== 'off') return;\n\t\tthis.dragging = true;\n\t\tconst horizontal = isHorizontalSide(this.side);\n\t\tthis.dragStartCoord = horizontal ? event.clientX : event.clientY;\n\t\tthis.dragStartSize = this.paneWidth();\n\t\tthis.handleTarget?.setPointerCapture(event.pointerId);\n\t\tdocument.addEventListener('pointermove', this.onPointerMove);\n\t\tdocument.addEventListener('pointerup', this.onPointerUp);\n\t\tdocument.addEventListener('pointercancel', this.onPointerUp);\n\t}\n\n\tprivate endDrag(): void {\n\t\tif (!this.dragging) return;\n\t\tthis.dragging = false;\n\t\tdocument.removeEventListener('pointermove', this.onPointerMove);\n\t\tdocument.removeEventListener('pointerup', this.onPointerUp);\n\t\tdocument.removeEventListener('pointercancel', this.onPointerUp);\n\t}\n\n\t@bound\n\tprivate onPointerMove(event: PointerEvent): void {\n\t\tif (!this.dragging) return;\n\t\tconst horizontal = isHorizontalSide(this.side);\n\t\tconst coord = horizontal ? event.clientX : event.clientY;\n\t\tconst delta = this.side === 'right' ? this.dragStartCoord - coord : coord - this.dragStartCoord;\n\t\tthis.applyWidth(this.dragStartSize + delta, true);\n\t}\n\n\t@bound\n\tprivate onPointerUp(): void {\n\t\tthis.endDrag();\n\t}\n\n\t@bound\n\tprivate onHandlePointerDown(event: Event): void {\n\t\tevent.preventDefault();\n\t\tthis.beginDrag(event as PointerEvent);\n\t}\n\n\t@bound\n\tprivate onHandleKeydown(event: Event): void {\n\t\tconst keyboardEvent = event as KeyboardEvent;\n\t\tconst current = this.paneWidth();\n\t\tconst horizontal = isHorizontalSide(this.side);\n\t\tconst prevKey = horizontal ? 'ArrowLeft' : 'ArrowUp';\n\t\tconst nextKey = horizontal ? 'ArrowRight' : 'ArrowDown';\n\t\tlet next = current;\n\n\t\tif (keyboardEvent.key === prevKey) {\n\t\t\tnext = current - (keyboardEvent.shiftKey ? KEYBOARD_STEP_LARGE : KEYBOARD_STEP);\n\t\t} else if (keyboardEvent.key === nextKey) {\n\t\t\tnext = current + (keyboardEvent.shiftKey ? KEYBOARD_STEP_LARGE : KEYBOARD_STEP);\n\t\t} else if (keyboardEvent.key === 'Home') {\n\t\t\tnext = this.minWidth;\n\t\t} else if (keyboardEvent.key === 'End') {\n\t\t\tnext = this.maxWidth;\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\t\tthis.applyWidth(next, true);\n\t}\n\n\t@bound\n\tprivate onScrimClick(): void {\n\t\tif (this.isMobile) {\n\t\t\tthis.setOpen(false);\n\t\t}\n\t}\n\n\t@onEvent({ document: true, type: 'keydown' })\n\tonHostKeydown(event: Event): void {\n\t\tconst keyboardEvent = event as KeyboardEvent;\n\t\tif (keyboardEvent.key === 'Escape' && this.isMobile && this.isOpen()) {\n\t\t\tkeyboardEvent.preventDefault();\n\t\t\tthis.setOpen(false);\n\t\t\treturn;\n\t\t}\n\n\t\tif (isModifierPressed(keyboardEvent) && keyboardEvent.key.toLowerCase() === KEYBOARD_SHORTCUT) {\n\t\t\tkeyboardEvent.preventDefault();\n\t\t\tthis.toggle();\n\t\t}\n\t}\n\n\t/**\n\t * Only the pane's `aria-label` is bound below. `data-state`/`data-collapsible`/\n\t * `data-variant`/`data-side`/`data-mobile` and the handle's `aria-value*`/\n\t * `aria-orientation` stay plain reads deliberately \u2014 this component's open/\n\t * close, drag-resize, and mobile-detection paths are the same high-frequency\n\t * interactive category where two sibling components in this migration\n\t * (tooltip, menu-button) hit real regressions from binding conversion that\n\t * weren't fully root-caused. Deferred as a follow-up rather than risking the\n\t * same class of bug here under the same review budget.\n\t */\n\toverride render() {\n\t\tconst horizontal = isHorizontalSide(this.side);\n\t\tconst open = this.isOpen();\n\t\tconst paneState: RuiSidebarState = open ? 'expanded' : 'collapsed';\n\t\tconst showHandle = this.collapsible === 'off' && open && !this.isMobile;\n\t\tconst widthVar = `${this.paneWidth()}px`;\n\t\t// Icon rail stays interactive when collapsed on desktop; mobile drawer does not.\n\t\tconst paneInert = open || (!this.isMobile && this.collapsible === 'icon') ? undefined : '';\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclass=\"rui-sidebar\"\n\t\t\t\tstyle={{ '--rui-sidebar-pane-width': widthVar } as Record<string, string>}\n\t\t\t\tdata-ref=\"root\"\n\t\t\t\tdata-state={paneState}\n\t\t\t\tdata-collapsible={this.collapsible}\n\t\t\t\tdata-variant={this.variant}\n\t\t\t\tdata-side={this.side}\n\t\t\t\tdata-mobile={String(this.isMobile)}\n\t\t\t>\n\t\t\t\t{/* Scrim first so it stacks under the pane (dialog pattern). */}\n\t\t\t\t<button\n\t\t\t\t\tdata-ref=\"scrim\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"rui-sidebar__scrim\"\n\t\t\t\t\ttabindex={-1}\n\t\t\t\t\taria-label=\"Close sidebar\"\n\t\t\t\t\thidden={!this.isMobile || !open}\n\t\t\t\t\ton:click={this.onScrimClick}\n\t\t\t\t></button>\n\t\t\t\t<div\n\t\t\t\t\tdata-ref=\"pane\"\n\t\t\t\t\tclass=\"rui-sidebar__pane\"\n\t\t\t\t\tdata-side={this.side}\n\t\t\t\t\tdata-variant={this.variant}\n\t\t\t\t\taria-label={this.$.label}\n\t\t\t\t\tinert={paneInert}\n\t\t\t\t>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</div>\n\t\t\t\t{showHandle ? (\n\t\t\t\t\t<div\n\t\t\t\t\t\tdata-ref=\"handle\"\n\t\t\t\t\t\tclass=\"rui-sidebar__handle\"\n\t\t\t\t\t\trole=\"separator\"\n\t\t\t\t\t\ttabindex={0}\n\t\t\t\t\t\taria-orientation={horizontal ? 'vertical' : 'horizontal'}\n\t\t\t\t\t\taria-valuenow={this.paneWidth()}\n\t\t\t\t\t\taria-valuemin={this.minWidth}\n\t\t\t\t\t\taria-valuemax={this.maxWidth}\n\t\t\t\t\t\taria-label={`${this.label} resize handle`}\n\t\t\t\t\t\ton:pointerdown={this.onHandlePointerDown}\n\t\t\t\t\t\ton:keydown={this.onHandleKeydown}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"rui-sidebar__handle-grip\" aria-hidden=\"true\"></span>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</div>\n\t\t);\n\t}\n}\n", "import { RadiantElement, bound, customElement, onUpdated, prop, query } from '@ecopages/radiant';\nimport type { RuiSidebarToggleDetail } from './sidebar.script';\n\nexport type RuiSidebarTriggerPlacement = 'header' | 'inset';\n\nexport type RuiSidebarTriggerProps = {\n\t/** ID of the `rui-sidebar` this trigger controls. */\n\tcontrols?: string;\n\t/** Accessible name for the trigger button. Default: `Toggle sidebar`. */\n\ttriggerLabel?: string;\n\t/**\n\t * Where the trigger is rendered. `header` is shown while the sidebar is expanded;\n\t * `inset` while collapsed (desktop icon rail / mobile drawer closed). CSS on\n\t * `.rui-sidebar-provider` hides the inactive placement.\n\t */\n\tplacement?: RuiSidebarTriggerPlacement;\n\t/** Variant passed through to the rendered button. */\n\tvariant?: 'filled' | 'outline' | 'ghost';\n\t/** Size passed through to the rendered button. */\n\tsize?: 'sm' | 'md' | 'lg';\n};\n\n/**\n * `<rui-sidebar-trigger>` \u2014 toggle button for a sibling `rui-sidebar`.\n *\n * The trigger looks up the sidebar by `id` on every click so it works even\n * when the trigger element is re-mounted independently of the sidebar. The\n * trigger also subscribes to `rui-sidebar-toggle` events to mirror the\n * sidebar's `data-state` in its own `aria-expanded` attribute.\n *\n * @element rui-sidebar-trigger\n * @slot - Visible label. Defaults to a hamburger glyph when empty.\n */\n@customElement('rui-sidebar-trigger')\nexport class RuiSidebarTrigger extends RadiantElement {\n\t@prop({ type: String, defaultValue: '' }) controls: string;\n\t/** `label` is not a safe reactive attribute name in the DOM; bind via `button-label`. */\n\t@prop({ type: String, attribute: 'button-label', defaultValue: 'Toggle sidebar' }) buttonLabel: string;\n\t@prop({ type: String, reflect: true, attribute: 'data-placement', defaultValue: '' }) placement:\n\t\tRuiSidebarTriggerPlacement | '';\n\t@prop({ type: String, defaultValue: 'ghost' }) variant: NonNullable<RuiSidebarTriggerProps['variant']>;\n\t@prop({ type: String, defaultValue: 'md' }) size: NonNullable<RuiSidebarTriggerProps['size']>;\n\n\t@query({ ref: 'button' }) buttonTarget: HTMLButtonElement;\n\n\tprivate sidebarListener: ((event: Event) => void) | null = null;\n\tprivate attachedSidebar: HTMLElement | null = null;\n\n\toverride connectedCallback(): void {\n\t\tsuper.connectedCallback();\n\t\tthis.syncWithSidebar();\n\t\t// JSX `.prop` bindings flush after connect when the trigger lives in a sidebar slot.\n\t\tqueueMicrotask(() => this.syncWithSidebar());\n\t}\n\n\toverride disconnectedCallback(): void {\n\t\tthis.detachFromSidebar();\n\t\tsuper.disconnectedCallback();\n\t}\n\n\t@onUpdated(['controls', 'buttonLabel', 'placement'])\n\tonControlsUpdated(): void {\n\t\tthis.detachFromSidebar();\n\t\tthis.syncWithSidebar();\n\t\tthis.applyState(this.attachedSidebar ? this.readState(this.attachedSidebar) : 'expanded');\n\t}\n\n\tprivate resolveSidebar(): (HTMLElement & { toggle?: () => void }) | null {\n\t\tconst id = this.controls?.trim();\n\t\tif (id) {\n\t\t\tconst byId = document.getElementById(id);\n\t\t\tif (byId) {\n\t\t\t\treturn byId as HTMLElement & { toggle?: () => void };\n\t\t\t}\n\t\t}\n\t\tconst host = this.closest('rui-sidebar');\n\t\tif (host?.id) {\n\t\t\treturn host as HTMLElement & { toggle?: () => void };\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate syncWithSidebar(): void {\n\t\tconst sidebar = this.resolveSidebar();\n\t\tif (sidebar === this.attachedSidebar) {\n\t\t\tif (sidebar) this.applyState(this.readState(sidebar));\n\t\t\treturn;\n\t\t}\n\t\tthis.detachFromSidebar();\n\t\tif (!sidebar) return;\n\t\tthis.attachedSidebar = sidebar;\n\t\tthis.sidebarListener = (event: Event) => {\n\t\t\tconst detail = (event as CustomEvent<RuiSidebarToggleDetail>).detail;\n\t\t\tthis.applyState(detail.state);\n\t\t};\n\t\tsidebar.addEventListener('rui-sidebar-toggle', this.sidebarListener);\n\t\tthis.applyState(this.readState(sidebar));\n\t}\n\n\tprivate detachFromSidebar(): void {\n\t\tif (this.attachedSidebar && this.sidebarListener) {\n\t\t\tthis.attachedSidebar.removeEventListener('rui-sidebar-toggle', this.sidebarListener);\n\t\t}\n\t\tthis.attachedSidebar = null;\n\t\tthis.sidebarListener = null;\n\t}\n\n\tprivate readState(sidebar: HTMLElement): 'expanded' | 'collapsed' {\n\t\treturn (sidebar.getAttribute('data-state') as 'expanded' | 'collapsed' | null) ?? 'expanded';\n\t}\n\n\tprivate resolvedButtonLabel(): string {\n\t\tconst fromData = this.getAttribute('data-button-label')?.trim();\n\t\tif (fromData) return fromData;\n\t\tconst fromAttribute = this.getAttribute('button-label')?.trim();\n\t\tif (fromAttribute) return fromAttribute;\n\t\treturn this.buttonLabel || 'Toggle sidebar';\n\t}\n\n\tprivate applyState(state: 'expanded' | 'collapsed'): void {\n\t\tconst button = this.buttonTarget;\n\t\tif (!button) return;\n\t\tconst sidebar = this.resolveSidebar();\n\t\tconst buttonLabel = this.resolvedButtonLabel();\n\t\tbutton.setAttribute('aria-expanded', String(state === 'expanded'));\n\t\tbutton.setAttribute('data-sidebar-state', state);\n\t\tbutton.setAttribute('aria-label', buttonLabel);\n\t\tif (sidebar?.id) {\n\t\t\tbutton.setAttribute('aria-controls', sidebar.id);\n\t\t} else if (this.controls) {\n\t\t\tbutton.setAttribute('aria-controls', this.controls);\n\t\t}\n\t}\n\n\t@bound\n\tprivate onClick(event: Event): void {\n\t\tevent.preventDefault();\n\t\tconst sidebar = this.resolveSidebar();\n\t\tif (sidebar && typeof sidebar.toggle === 'function') {\n\t\t\tsidebar.toggle();\n\t\t}\n\t}\n\n\tprivate placementClass(): string {\n\t\tif (this.placement === 'header') return 'rui-sidebar__trigger--header';\n\t\tif (this.placement === 'inset') return 'rui-sidebar__trigger--inset';\n\t\treturn '';\n\t}\n\n\tprivate renderDefaultIcon() {\n\t\tconst sidebar = this.resolveSidebar();\n\t\tconst state = sidebar ? this.readState(sidebar) : 'expanded';\n\t\tconst showCollapse = this.placement === 'header' || (this.placement !== 'inset' && state === 'expanded');\n\t\tconst showExpand = this.placement === 'inset' || (this.placement !== 'header' && state === 'collapsed');\n\n\t\treturn (\n\t\t\t<span class=\"rui-sidebar__trigger-icon\" aria-hidden=\"true\">\n\t\t\t\t{showCollapse ? (\n\t\t\t\t\t<svg\n\t\t\t\t\t\tclass=\"rui-sidebar__trigger-glyph rui-sidebar__trigger-glyph--collapse\"\n\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<path d=\"M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\" />\n\t\t\t\t\t\t<path d=\"M9 3v18\" />\n\t\t\t\t\t\t<path d=\"m14 15 3-3-3-3\" />\n\t\t\t\t\t</svg>\n\t\t\t\t) : null}\n\t\t\t\t{showExpand ? (\n\t\t\t\t\t<svg\n\t\t\t\t\t\tclass=\"rui-sidebar__trigger-glyph rui-sidebar__trigger-glyph--expand\"\n\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<path d=\"M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\" />\n\t\t\t\t\t\t<path d=\"M9 3v18\" />\n\t\t\t\t\t\t<path d=\"m14 9-3 3 3 3\" />\n\t\t\t\t\t</svg>\n\t\t\t\t) : null}\n\t\t\t</span>\n\t\t);\n\t}\n\n\toverride render() {\n\t\tconst sidebar = this.resolveSidebar();\n\t\tconst controlsId = sidebar?.id || this.controls || null;\n\t\tconst buttonLabel = this.resolvedButtonLabel();\n\t\tconst state = sidebar ? this.readState(sidebar) : 'expanded';\n\t\treturn (\n\t\t\t<button\n\t\t\t\tdata-ref=\"button\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass={`rui-button rui-button--${this.variant} rui-button--${this.size} rui-sidebar__trigger ${this.placementClass()}`.trim()}\n\t\t\t\tdata-sidebar-state={state}\n\t\t\t\taria-expanded={String(state === 'expanded')}\n\t\t\t\taria-controls={controlsId || null}\n\t\t\t\taria-label={buttonLabel}\n\t\t\t\ton-native:click={this.onClick}\n\t\t\t>\n\t\t\t\t<slot>{this.renderDefaultIcon()}</slot>\n\t\t\t</button>\n\t\t);\n\t}\n}\n", "import type { JsxRenderable } from '@ecopages/jsx';\n\nconst RADIANT_VIEW_ELEMENT = Symbol.for('@ecopages/storybook-radiant.viewElement');\nconst RADIANT_SCRIPT_MODULE = Symbol.for('@ecopages/storybook-radiant.scriptModule');\nconst RADIANT_SCRIPT_EXPORT = Symbol.for('@ecopages/storybook-radiant.scriptExport');\n\nexport type RadiantViewComponent<TArgs = unknown> = ((args: TArgs) => JsxRenderable) & {\n\t[RADIANT_VIEW_ELEMENT]?: CustomElementConstructor;\n\t[RADIANT_SCRIPT_MODULE]?: string;\n\t[RADIANT_SCRIPT_EXPORT]?: string;\n};\n\nfunction linkViewToElement<TArgs>(\n\tview: RadiantViewComponent<TArgs>,\n\telement: CustomElementConstructor & {\n\t\t[RADIANT_SCRIPT_MODULE]?: string;\n\t\t[RADIANT_SCRIPT_EXPORT]?: string;\n\t},\n): void {\n\tview[RADIANT_VIEW_ELEMENT] = element;\n\n\tconst ssrModule = element[RADIANT_SCRIPT_MODULE];\n\tif (ssrModule) {\n\t\tview[RADIANT_SCRIPT_MODULE] = ssrModule;\n\t\tview[RADIANT_SCRIPT_EXPORT] = element[RADIANT_SCRIPT_EXPORT] ?? element.name;\n\t}\n}\n\n/** Link a JSX view export to its RadiantElement class (same symbols as the Storybook framework). */\nexport function defineRadiantView<TArgs>(\n\telement: CustomElementConstructor & {\n\t\t[RADIANT_SCRIPT_MODULE]?: string;\n\t\t[RADIANT_SCRIPT_EXPORT]?: string;\n\t},\n\trender: (args: TArgs) => JsxRenderable,\n): RadiantViewComponent<TArgs> {\n\tconst view = ((args: TArgs) => render(args)) as RadiantViewComponent<TArgs>;\n\tlinkViewToElement(view, element);\n\treturn view;\n}\n\n/** Re-copy SSR metadata from the linked element (e.g. after HMR). */\nexport function syncRadiantViewMetadata(view: RadiantViewComponent): void {\n\tconst element = view[RADIANT_VIEW_ELEMENT];\n\tif (element) {\n\t\tlinkViewToElement(view, element);\n\t}\n}\n", "import type { JsxRenderable } from '@ecopages/jsx';\nimport type { RadiantSlotProps } from '../../../types';\nimport { defineRadiantView } from '../../../lib/radiant-view';\nimport type { RuiSidebarProps, RuiSidebarCollapsible, RuiSidebarSide, RuiSidebarVariant } from './sidebar.script';\nimport { RuiSidebar as RuiSidebarElement } from './sidebar.script';\nimport type { RuiSidebarTriggerProps } from './sidebar-trigger.script';\nimport { RuiSidebarTrigger as RuiSidebarTriggerElement } from './sidebar-trigger.script';\nimport './sidebar.css';\n\nfunction cx(...parts: Array<string | false | null | undefined>): string {\n\treturn parts.filter(Boolean).join(' ');\n}\n\nexport type RuiSidebarProviderProps = {\n\t/** Layout context. `default` is the standard shell; `full` removes chrome. */\n\tlayout?: 'default' | 'full';\n\t/** Slot for the sidebar element. */\n\tsidebar?: JsxRenderable;\n\t/** Slot for the inset (main content). */\n\tchildren?: JsxRenderable;\n\t/** Extra class names. */\n\tclass?: string;\n};\n\n/**\n * `<div>` shell that wraps the sidebar and the main inset. Reflects\n * `data-layout` so stylesheets can adapt. Plays the role of\n * `SidebarProvider` from common sidebar kits, but without a runtime context \u2014\n * coordination between trigger, sidebar, and inset is achieved through\n * `id`/`aria-controls` and shared `data-*` attributes.\n */\nexport function RuiSidebarProvider({\n\tlayout = 'default',\n\tsidebar,\n\tchildren,\n\tclass: className,\n}: RuiSidebarProviderProps) {\n\treturn (\n\t\t<div class={cx('rui-sidebar-provider', className)} data-layout={layout}>\n\t\t\t{sidebar}\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\nexport type RuiSidebarHeaderProps = {\n\tchildren: JsxRenderable;\n\tclass?: string;\n\t/** Accessible name for the header region. */\n\t'aria-label'?: string;\n};\n\n/** Top section of the sidebar pane (logo, search, primary trigger). */\nexport function RuiSidebarHeader({ children, class: className, 'aria-label': ariaLabel }: RuiSidebarHeaderProps) {\n\treturn (\n\t\t<div class={cx('rui-sidebar__header', className)} aria-label={ariaLabel}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\nexport type RuiSidebarContentProps = {\n\tchildren: JsxRenderable;\n\tclass?: string;\n\t/** Optional label for the scrolling content region. */\n\t'aria-label'?: string;\n};\n\n/** Scrollable middle section. Multiple allowed; each becomes its own region. */\nexport function RuiSidebarContent({ children, class: className, 'aria-label': ariaLabel }: RuiSidebarContentProps) {\n\treturn (\n\t\t<div class={cx('rui-sidebar__content', className)} aria-label={ariaLabel}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\nexport type RuiSidebarFooterProps = {\n\tchildren: JsxRenderable;\n\tclass?: string;\n};\n\n/** Pinned bottom section (user, theme toggle, settings). */\nexport function RuiSidebarFooter({ children, class: className }: RuiSidebarFooterProps) {\n\treturn <div class={cx('rui-sidebar__footer', className)}>{children}</div>;\n}\n\nexport type RuiSidebarSeparatorProps = {\n\tclass?: string;\n\t/** Accessible label for the separator. */\n\t'aria-label'?: string;\n};\n\n/** Horizontal rule between sidebar sections. */\nexport function RuiSidebarSeparator({ class: className, 'aria-label': ariaLabel }: RuiSidebarSeparatorProps) {\n\treturn (\n\t\t<hr\n\t\t\trole=\"separator\"\n\t\t\taria-orientation=\"horizontal\"\n\t\t\taria-label={ariaLabel}\n\t\t\tclass={cx('rui-sidebar__separator', className)}\n\t\t/>\n\t);\n}\n\nexport type RuiSidebarGroupProps = {\n\tchildren: JsxRenderable;\n\tclass?: string;\n\t/** Accessible label for the group region. */\n\t'aria-label'?: string;\n};\n\n/** Landmark group of related sidebar items. */\nexport function RuiSidebarGroup({ children, class: className, 'aria-label': ariaLabel }: RuiSidebarGroupProps) {\n\treturn (\n\t\t<section class={cx('rui-sidebar__group', className)} aria-label={ariaLabel}>\n\t\t\t{children}\n\t\t</section>\n\t);\n}\n\nexport type RuiSidebarGroupLabelProps = {\n\tchildren: JsxRenderable;\n\tclass?: string;\n\t/** Optional `id` so the group can be referenced by `aria-labelledby`. */\n\tid?: string;\n};\n\n/** Heading for a sidebar group. */\nexport function RuiSidebarGroupLabel({ children, class: className, id }: RuiSidebarGroupLabelProps) {\n\treturn (\n\t\t<h2 id={id} class={cx('rui-sidebar__group-label', className)}>\n\t\t\t{children}\n\t\t</h2>\n\t);\n}\n\nexport type RuiSidebarGroupActionProps = {\n\tchildren: JsxRenderable;\n\tclass?: string;\n\t/** Accessible label for the action button. */\n\t'aria-label'?: string;\n};\n\n/** Top-right action button inside a group header. */\nexport function RuiSidebarGroupAction({\n\tchildren,\n\tclass: className,\n\t'aria-label': ariaLabel,\n}: RuiSidebarGroupActionProps) {\n\treturn (\n\t\t<button type=\"button\" aria-label={ariaLabel} class={cx('rui-sidebar__group-action', className)}>\n\t\t\t{children}\n\t\t</button>\n\t);\n}\n\nexport type RuiSidebarGroupHeaderProps = {\n\tlabel: JsxRenderable;\n\taction?: JsxRenderable;\n\tclass?: string;\n};\n\n/** Convenience: a label + optional action in one row. */\nexport function RuiSidebarGroupHeader({ label, action, class: className }: RuiSidebarGroupHeaderProps) {\n\treturn (\n\t\t<div class={cx('rui-sidebar__group-header', className)}>\n\t\t\t<RuiSidebarGroupLabel>{label}</RuiSidebarGroupLabel>\n\t\t\t{action}\n\t\t</div>\n\t);\n}\n\nexport type RuiSidebarMenuProps = {\n\tchildren: JsxRenderable;\n\tclass?: string;\n\t/** Accessible label for the menu list. */\n\t'aria-label'?: string;\n};\n\n/** `<ul>` of sidebar items. */\nexport function RuiSidebarMenu({ children, class: className, 'aria-label': ariaLabel }: RuiSidebarMenuProps) {\n\treturn (\n\t\t<ul role=\"list\" class={cx('rui-sidebar__menu', className)} aria-label={ariaLabel}>\n\t\t\t{children}\n\t\t</ul>\n\t);\n}\n\nexport type RuiSidebarMenuItemProps = {\n\tchildren: JsxRenderable;\n\tclass?: string;\n};\n\n/** `<li>` of a sidebar menu. */\nexport function RuiSidebarMenuItem({ children, class: className }: RuiSidebarMenuItemProps) {\n\treturn <li class={cx('rui-sidebar__menu-item', className)}>{children}</li>;\n}\n\nexport type RuiSidebarMenuButtonProps = {\n\tchildren: JsxRenderable;\n\tclass?: string;\n\t/** Mark this button as the current page. */\n\tisActive?: boolean;\n\t/** Render as a different element via the `as` prop. Default: `a` when `href` is set, else `button`. */\n\tas?: 'a' | 'button';\n\t/** Forwarded to anchor or button. */\n\thref?: string;\n\ttype?: 'button' | 'submit' | 'reset';\n\t/** Optional tooltip label for collapsed-icon mode. */\n\ttooltip?: string;\n\tdisabled?: boolean;\n\t/** Click handler for `button` mode. */\n\tonClick?: (event: Event) => void;\n};\n\n/**\n * The clickable surface inside a `RuiSidebarMenuItem`. When the sidebar\n * collapses to icon mode, only this element remains visible; it must keep an\n * accessible name via `tooltip` or visible children.\n */\nexport function RuiSidebarMenuButton({\n\tchildren,\n\tclass: className,\n\tisActive,\n\tas,\n\thref,\n\ttype = 'button',\n\ttooltip,\n\tdisabled,\n\tonClick,\n}: RuiSidebarMenuButtonProps) {\n\tconst classNames = cx('rui-sidebar__menu-button', isActive && 'rui-sidebar__menu-button--active', className);\n\tconst title = tooltip;\n\tconst ariaLabel = typeof children === 'string' ? undefined : tooltip;\n\n\tif (as === 'button' || (!as && !href)) {\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype={type}\n\t\t\t\tclass={classNames}\n\t\t\t\taria-current={isActive ? 'page' : undefined}\n\t\t\t\tdisabled={disabled}\n\t\t\t\ttitle={title}\n\t\t\t\taria-label={ariaLabel}\n\t\t\t\ton:click={onClick}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</button>\n\t\t);\n\t}\n\n\treturn (\n\t\t<a\n\t\t\thref={href}\n\t\t\tclass={classNames}\n\t\t\taria-current={isActive ? 'page' : undefined}\n\t\t\ttitle={title}\n\t\t\taria-label={ariaLabel}\n\t\t>\n\t\t\t{children}\n\t\t</a>\n\t);\n}\n\nexport type RuiSidebarMenuActionProps = RuiSidebarMenuButtonProps;\n\n/** Smaller, secondary button (e.g. `+ New`) below a menu or group. */\nexport function RuiSidebarMenuAction(props: RuiSidebarMenuActionProps) {\n\tconst { class: className, ...rest } = props;\n\treturn <RuiSidebarMenuButton class={cx('rui-sidebar__menu-action', className)} {...rest} />;\n}\n\nexport type RuiSidebarInsetProps = {\n\tchildren: JsxRenderable;\n\tclass?: string;\n\t/** Optional `id` so the sidebar trigger can target the main landmark. */\n\tid?: string;\n};\n\n/** The main content area that sits next to the sidebar. */\nexport function RuiSidebarInset({ children, class: className, id }: RuiSidebarInsetProps) {\n\treturn (\n\t\t<main id={id} class={cx('rui-sidebar__inset', className)}>\n\t\t\t{children}\n\t\t</main>\n\t);\n}\n\nexport type RuiSidebarViewProps = RuiSidebarProps &\n\tRadiantSlotProps & {\n\t\tid: string;\n\t\tchildren: JsxRenderable;\n\t\tclass?: string;\n\t};\n\nexport const RuiSidebar = defineRadiantView(\n\tRuiSidebarElement,\n\t({\n\t\tslot,\n\t\tid,\n\t\tvariant,\n\t\tside,\n\t\tcollapsible,\n\t\tdefaultOpen,\n\t\topen,\n\t\tdefaultWidth,\n\t\twidth,\n\t\tmobileBreakpoint,\n\t\tlabel,\n\t\tclass: className,\n\t\tchildren,\n\t}: RuiSidebarViewProps) => (\n\t\t<rui-sidebar\n\t\t\tslot={slot}\n\t\t\tid={id}\n\t\t\tclass={className}\n\t\t\tvariant={variant as RuiSidebarVariant | undefined}\n\t\t\tside={side as RuiSidebarSide | undefined}\n\t\t\tcollapsible={collapsible as RuiSidebarCollapsible | undefined}\n\t\t\tprop:defaultOpen={defaultOpen}\n\t\t\tprop:open={open}\n\t\t\tprop:defaultWidth={defaultWidth}\n\t\t\tprop:width={width}\n\t\t\tprop:mobileBreakpoint={mobileBreakpoint}\n\t\t\tlabel={label}\n\t\t>\n\t\t\t{children}\n\t\t</rui-sidebar>\n\t),\n);\n\nexport type RuiSidebarTriggerViewProps = RuiSidebarTriggerProps &\n\tRadiantSlotProps & {\n\t\tchildren?: JsxRenderable;\n\t\tclass?: string;\n\t};\n\nexport const RuiSidebarTrigger = defineRadiantView(\n\tRuiSidebarTriggerElement,\n\t({\n\t\tslot,\n\t\tcontrols,\n\t\ttriggerLabel,\n\t\tplacement,\n\t\tvariant,\n\t\tsize,\n\t\tclass: className,\n\t\tchildren,\n\t}: RuiSidebarTriggerViewProps) => (\n\t\t<rui-sidebar-trigger\n\t\t\tslot={slot}\n\t\t\tclass={className}\n\t\t\tprop:controls={controls}\n\t\t\tprop:buttonLabel={triggerLabel ?? 'Toggle sidebar'}\n\t\t\tattr:data-button-label={triggerLabel ?? 'Toggle sidebar'}\n\t\t\tprop:placement={placement}\n\t\t\tattr:data-placement={placement}\n\t\t\tvariant={variant}\n\t\t\tsize={size}\n\t\t>\n\t\t\t{children}\n\t\t</rui-sidebar-trigger>\n\t),\n);\n"],
|
|
5
|
+
"m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
|
6
|
+
"names": ["RadiantElement", "bound", "customElement", "event", "onEvent", "onUpdated", "prop", "query", "state", "DEFAULT_WIDTH", "ICON_WIDTH", "DEFAULT_MIN_WIDTH", "DEFAULT_MAX_WIDTH", "DEFAULT_MOBILE_BREAKPOINT", "KEYBOARD_SHORTCUT", "KEYBOARD_STEP", "KEYBOARD_STEP_LARGE", "isModifierPressed", "isMediaQuerySupported", "isHorizontalSide", "side", "RuiSidebar", "paneState", "next", "width", "root", "emit", "clamped", "wasOpen", "horizontal", "coord", "delta", "keyboardEvent", "current", "prevKey", "nextKey", "open", "showHandle", "widthVar", "paneInert", "RadiantElement", "bound", "customElement", "onUpdated", "prop", "query", "RuiSidebarTrigger", "id", "byId", "host", "sidebar", "event", "detail", "fromData", "fromAttribute", "state", "button", "buttonLabel", "showCollapse", "showExpand", "controlsId", "RADIANT_VIEW_ELEMENT", "RADIANT_SCRIPT_MODULE", "RADIANT_SCRIPT_EXPORT", "linkViewToElement", "view", "element", "ssrModule", "defineRadiantView", "render", "args", "cx", "parts", "RuiSidebarProvider", "layout", "sidebar", "children", "className", "RuiSidebarHeader", "ariaLabel", "RuiSidebarContent", "RuiSidebarFooter", "RuiSidebarSeparator", "RuiSidebarGroup", "RuiSidebarGroupLabel", "id", "RuiSidebarGroupAction", "RuiSidebarGroupHeader", "label", "action", "RuiSidebarMenu", "RuiSidebarMenuItem", "RuiSidebarMenuButton", "isActive", "as", "href", "type", "tooltip", "disabled", "onClick", "classNames", "title", "RuiSidebarMenuAction", "props", "rest", "RuiSidebarInset", "RuiSidebar", "defineRadiantView", "slot", "variant", "side", "collapsible", "defaultOpen", "open", "defaultWidth", "width", "mobileBreakpoint", "RuiSidebarTrigger", "controls", "triggerLabel", "placement", "size"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { RadiantElement } from '@ecopages/radiant';
|
|
2
|
+
export type RuiSidebarTriggerPlacement = 'header' | 'inset';
|
|
3
|
+
export type RuiSidebarTriggerProps = {
|
|
4
|
+
/** ID of the `rui-sidebar` this trigger controls. */
|
|
5
|
+
controls?: string;
|
|
6
|
+
/** Accessible name for the trigger button. Default: `Toggle sidebar`. */
|
|
7
|
+
triggerLabel?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Where the trigger is rendered. `header` is shown while the sidebar is expanded;
|
|
10
|
+
* `inset` while collapsed (desktop icon rail / mobile drawer closed). CSS on
|
|
11
|
+
* `.rui-sidebar-provider` hides the inactive placement.
|
|
12
|
+
*/
|
|
13
|
+
placement?: RuiSidebarTriggerPlacement;
|
|
14
|
+
/** Variant passed through to the rendered button. */
|
|
15
|
+
variant?: 'filled' | 'outline' | 'ghost';
|
|
16
|
+
/** Size passed through to the rendered button. */
|
|
17
|
+
size?: 'sm' | 'md' | 'lg';
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* `<rui-sidebar-trigger>` — toggle button for a sibling `rui-sidebar`.
|
|
21
|
+
*
|
|
22
|
+
* The trigger looks up the sidebar by `id` on every click so it works even
|
|
23
|
+
* when the trigger element is re-mounted independently of the sidebar. The
|
|
24
|
+
* trigger also subscribes to `rui-sidebar-toggle` events to mirror the
|
|
25
|
+
* sidebar's `data-state` in its own `aria-expanded` attribute.
|
|
26
|
+
*
|
|
27
|
+
* @element rui-sidebar-trigger
|
|
28
|
+
* @slot - Visible label. Defaults to a hamburger glyph when empty.
|
|
29
|
+
*/
|
|
30
|
+
export declare class RuiSidebarTrigger extends RadiantElement {
|
|
31
|
+
controls: string;
|
|
32
|
+
/** `label` is not a safe reactive attribute name in the DOM; bind via `button-label`. */
|
|
33
|
+
buttonLabel: string;
|
|
34
|
+
placement: RuiSidebarTriggerPlacement | '';
|
|
35
|
+
variant: NonNullable<RuiSidebarTriggerProps['variant']>;
|
|
36
|
+
size: NonNullable<RuiSidebarTriggerProps['size']>;
|
|
37
|
+
buttonTarget: HTMLButtonElement;
|
|
38
|
+
private sidebarListener;
|
|
39
|
+
private attachedSidebar;
|
|
40
|
+
connectedCallback(): void;
|
|
41
|
+
disconnectedCallback(): void;
|
|
42
|
+
onControlsUpdated(): void;
|
|
43
|
+
private resolveSidebar;
|
|
44
|
+
private syncWithSidebar;
|
|
45
|
+
private detachFromSidebar;
|
|
46
|
+
private readState;
|
|
47
|
+
private resolvedButtonLabel;
|
|
48
|
+
private applyState;
|
|
49
|
+
private onClick;
|
|
50
|
+
private placementClass;
|
|
51
|
+
private renderDefaultIcon;
|
|
52
|
+
render(): import("@ecopages/jsx").JsxRenderable;
|
|
53
|
+
}
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
@reference '../../../styles/radiant-ui.css';
|
|
2
|
+
|
|
3
|
+
rui-sidebar {
|
|
4
|
+
@apply contents;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/* -------------------------------------------------------------------------- */
|
|
8
|
+
/* Provider */
|
|
9
|
+
/* -------------------------------------------------------------------------- */
|
|
10
|
+
|
|
11
|
+
.rui-sidebar-provider {
|
|
12
|
+
@apply relative flex h-svh min-w-0 w-full flex-1 overflow-hidden bg-background;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.rui-sidebar-provider[data-layout='full'] {
|
|
16
|
+
@apply bg-transparent;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.rui-sidebar-provider:has(> rui-sidebar[data-mobile='true'][data-state='expanded']) {
|
|
20
|
+
@apply overflow-hidden;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* -------------------------------------------------------------------------- */
|
|
24
|
+
/* Host */
|
|
25
|
+
/* -------------------------------------------------------------------------- */
|
|
26
|
+
|
|
27
|
+
.rui-sidebar {
|
|
28
|
+
@apply relative flex h-full min-w-0 shrink-0 self-stretch bg-surface text-on-background;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.rui-sidebar[data-side='right'] {
|
|
32
|
+
@apply flex-row-reverse;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.rui-sidebar[data-variant='inset'] {
|
|
36
|
+
@apply rounded-lg border border-border bg-background;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.rui-sidebar[data-state='collapsed'] {
|
|
40
|
+
@apply min-w-0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* -------------------------------------------------------------------------- */
|
|
44
|
+
/* Pane */
|
|
45
|
+
/* -------------------------------------------------------------------------- */
|
|
46
|
+
|
|
47
|
+
.rui-sidebar__pane {
|
|
48
|
+
@apply flex h-full min-h-0 min-w-0 flex-col overflow-hidden;
|
|
49
|
+
transition: width var(--duration-normal) var(--ease-out);
|
|
50
|
+
width: var(--rui-sidebar-pane-width, 256px);
|
|
51
|
+
flex: 0 0 auto;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.rui-sidebar[data-state='collapsed'][data-collapsible='full'] > .rui-sidebar__pane,
|
|
55
|
+
.rui-sidebar[data-state='collapsed'][data-collapsible='off'] > .rui-sidebar__pane {
|
|
56
|
+
@apply w-0 overflow-hidden;
|
|
57
|
+
opacity: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.rui-sidebar[data-collapsible='icon'][data-state='collapsed'] > .rui-sidebar__pane {
|
|
61
|
+
@apply items-center;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* -------------------------------------------------------------------------- */
|
|
65
|
+
/* Resize handle */
|
|
66
|
+
/* -------------------------------------------------------------------------- */
|
|
67
|
+
|
|
68
|
+
.rui-sidebar__handle {
|
|
69
|
+
@apply flex shrink-0 cursor-col-resize items-center justify-center bg-border p-0 outline-hidden;
|
|
70
|
+
width: 6px;
|
|
71
|
+
transition: background-color var(--duration-fast) var(--ease-standard);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.rui-sidebar[data-side='right'] > .rui-sidebar__handle {
|
|
75
|
+
@apply cursor-col-resize;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.rui-sidebar__handle:hover,
|
|
79
|
+
.rui-sidebar__handle:focus-visible {
|
|
80
|
+
@apply bg-primary;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.rui-sidebar__handle:focus-visible {
|
|
84
|
+
@apply ring-2 ring-focus-ring;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.rui-sidebar__handle-grip {
|
|
88
|
+
@apply block h-8 w-0.5 rounded-full bg-on-surface/30;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.rui-sidebar__handle:hover .rui-sidebar__handle-grip,
|
|
92
|
+
.rui-sidebar__handle:focus-visible .rui-sidebar__handle-grip {
|
|
93
|
+
@apply bg-on-primary;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* -------------------------------------------------------------------------- */
|
|
97
|
+
/* Pane internals */
|
|
98
|
+
/* -------------------------------------------------------------------------- */
|
|
99
|
+
|
|
100
|
+
.rui-sidebar__header,
|
|
101
|
+
.rui-sidebar__content,
|
|
102
|
+
.rui-sidebar__footer,
|
|
103
|
+
.rui-sidebar__separator,
|
|
104
|
+
.rui-sidebar__group,
|
|
105
|
+
.rui-sidebar__menu,
|
|
106
|
+
.rui-sidebar__menu-item,
|
|
107
|
+
.rui-sidebar__menu-button,
|
|
108
|
+
.rui-sidebar__menu-action,
|
|
109
|
+
.rui-sidebar__group-label,
|
|
110
|
+
.rui-sidebar__group-action,
|
|
111
|
+
.rui-sidebar__group-header {
|
|
112
|
+
box-sizing: border-box;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.rui-sidebar__header {
|
|
116
|
+
@apply flex h-14 shrink-0 flex-row items-center gap-2 border-b border-border px-3;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.rui-sidebar[data-collapsible='icon'][data-state='collapsed'] .rui-sidebar__header {
|
|
120
|
+
@apply flex-col justify-center gap-1 px-1 py-2;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.rui-sidebar[data-collapsible='icon'][data-state='collapsed'] .rui-sidebar__brand {
|
|
124
|
+
@apply w-full flex-none justify-center gap-0;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.rui-sidebar[data-collapsible='icon'][data-state='collapsed'] .rui-sidebar__brand-text {
|
|
128
|
+
@apply hidden;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.rui-sidebar__content {
|
|
132
|
+
@apply flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-3;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.rui-sidebar[data-collapsible='icon'][data-state='collapsed'] .rui-sidebar__content {
|
|
136
|
+
@apply gap-2 overflow-x-hidden px-1;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.rui-sidebar__footer {
|
|
140
|
+
@apply flex shrink-0 flex-col gap-2 border-t border-border p-3;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.rui-sidebar[data-collapsible='icon'][data-state='collapsed'] .rui-sidebar__footer {
|
|
144
|
+
@apply items-center gap-1 px-1 py-2;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.rui-sidebar__separator {
|
|
148
|
+
@apply mx-2 my-1 border-0 border-t border-border;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.rui-sidebar__group {
|
|
152
|
+
@apply flex flex-col gap-1;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.rui-sidebar__group-header {
|
|
156
|
+
@apply flex items-center justify-between gap-1;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.rui-sidebar__group-label {
|
|
160
|
+
@apply m-0 px-2 text-xs font-semibold tracking-wide text-on-surface uppercase;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.rui-sidebar__group-action {
|
|
164
|
+
@apply inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent p-0 text-on-surface;
|
|
165
|
+
transition: background-color var(--duration-fast) var(--ease-standard);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.rui-sidebar__group-action:hover {
|
|
169
|
+
@apply bg-primary/10;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.rui-sidebar__group-action:focus-visible {
|
|
173
|
+
@apply bg-primary/10 outline-hidden ring-2 ring-focus-ring ring-inset;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.rui-sidebar__menu {
|
|
177
|
+
@apply m-0 flex list-none flex-col gap-0.5 p-0;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.rui-sidebar__menu-item {
|
|
181
|
+
@apply list-none;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.rui-sidebar__menu-button {
|
|
185
|
+
@apply flex w-full min-w-0 items-center gap-2 rounded-md border-0 bg-transparent px-2 py-1.5 text-left text-sm cursor-pointer text-on-background;
|
|
186
|
+
transition: background-color var(--duration-fast) var(--ease-standard);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.rui-sidebar__menu-button:hover {
|
|
190
|
+
@apply bg-primary/10;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.rui-sidebar__menu-button:focus-visible {
|
|
194
|
+
@apply bg-primary/10 outline-hidden ring-2 ring-focus-ring ring-inset;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.rui-sidebar__menu-button[aria-current='page'],
|
|
198
|
+
.rui-sidebar__menu-button--active {
|
|
199
|
+
@apply bg-primary/15 font-medium text-on-background;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.rui-sidebar__menu-button[aria-disabled='true'],
|
|
203
|
+
.rui-sidebar__menu-button[disabled] {
|
|
204
|
+
@apply pointer-events-none cursor-not-allowed opacity-muted text-on-surface;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.rui-sidebar__menu-action {
|
|
208
|
+
@apply text-on-surface;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.rui-sidebar__menu-action:hover {
|
|
212
|
+
@apply bg-primary/5;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.rui-sidebar__menu-button > :first-child {
|
|
216
|
+
@apply shrink-0;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.rui-sidebar__menu-button > :last-child {
|
|
220
|
+
@apply min-w-0 flex-1 truncate;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/* When collapsed to icon mode, hide every menu label and decorative chrome. */
|
|
224
|
+
.rui-sidebar[data-collapsible='icon'][data-state='collapsed'] .rui-sidebar__menu-button,
|
|
225
|
+
.rui-sidebar[data-collapsible='icon'][data-state='collapsed'] .rui-sidebar__menu-action {
|
|
226
|
+
@apply size-8 w-8 justify-center gap-0 p-0;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.rui-sidebar[data-collapsible='icon'][data-state='collapsed'] .rui-sidebar__menu-button > :last-child,
|
|
230
|
+
.rui-sidebar[data-collapsible='icon'][data-state='collapsed'] .rui-sidebar__menu-action > :last-child,
|
|
231
|
+
.rui-sidebar[data-collapsible='icon'][data-state='collapsed'] .rui-sidebar__group-label,
|
|
232
|
+
.rui-sidebar[data-collapsible='icon'][data-state='collapsed'] .rui-sidebar__group-header,
|
|
233
|
+
.rui-sidebar[data-collapsible='icon'][data-state='collapsed'] .rui-sidebar__group-action,
|
|
234
|
+
.rui-sidebar[data-collapsible='icon'][data-state='collapsed'] .rui-sidebar__group-actions,
|
|
235
|
+
.rui-sidebar[data-collapsible='icon'][data-state='collapsed'] .rui-sidebar__separator,
|
|
236
|
+
.rui-sidebar[data-collapsible='icon'][data-state='collapsed']
|
|
237
|
+
.rui-sidebar__footer
|
|
238
|
+
> *:not(.rui-sidebar__menu):not(button):not(a) {
|
|
239
|
+
@apply hidden;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.rui-sidebar__icon {
|
|
243
|
+
@apply size-4 shrink-0;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/* -------------------------------------------------------------------------- */
|
|
247
|
+
/* Inset */
|
|
248
|
+
/* -------------------------------------------------------------------------- */
|
|
249
|
+
|
|
250
|
+
.rui-sidebar__inset {
|
|
251
|
+
@apply flex min-h-0 min-w-0 w-full flex-1 flex-col gap-0 overflow-hidden bg-background;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/* -------------------------------------------------------------------------- */
|
|
255
|
+
/* Trigger */
|
|
256
|
+
/* -------------------------------------------------------------------------- */
|
|
257
|
+
|
|
258
|
+
.rui-sidebar__trigger {
|
|
259
|
+
@apply inline-flex size-9 shrink-0 items-center justify-center p-0;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.rui-sidebar__trigger-icon {
|
|
263
|
+
@apply flex size-4 items-center justify-center;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.rui-sidebar__trigger-glyph {
|
|
267
|
+
@apply size-4 shrink-0;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/* -------------------------------------------------------------------------- */
|
|
271
|
+
/* Alternate header (collapse) vs inset (open) triggers */
|
|
272
|
+
/* -------------------------------------------------------------------------- */
|
|
273
|
+
|
|
274
|
+
.rui-sidebar-provider:has(> rui-sidebar[data-collapsible='off']:not([data-mobile='true']))
|
|
275
|
+
rui-sidebar-trigger[data-placement='header'],
|
|
276
|
+
.rui-sidebar-provider:has(> rui-sidebar[data-collapsible='off']:not([data-mobile='true']))
|
|
277
|
+
rui-sidebar-trigger[data-placement='inset'] {
|
|
278
|
+
@apply hidden;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.rui-sidebar-provider:has(> rui-sidebar[data-state='expanded']:not([data-mobile='true']))
|
|
282
|
+
rui-sidebar-trigger[data-placement='inset'] {
|
|
283
|
+
@apply hidden;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.rui-sidebar-provider:has(> rui-sidebar[data-state='collapsed']:not([data-mobile='true']))
|
|
287
|
+
rui-sidebar-trigger[data-placement='header'] {
|
|
288
|
+
@apply hidden;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.rui-sidebar-provider:has(> rui-sidebar[data-state='expanded'][data-mobile='true'])
|
|
292
|
+
rui-sidebar-trigger[data-placement='inset'] {
|
|
293
|
+
@apply hidden;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.rui-sidebar-provider:has(> rui-sidebar[data-state='collapsed'][data-mobile='true'])
|
|
297
|
+
rui-sidebar-trigger[data-placement='header'] {
|
|
298
|
+
@apply hidden;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/* -------------------------------------------------------------------------- */
|
|
302
|
+
/* Mobile drawer */
|
|
303
|
+
/* -------------------------------------------------------------------------- */
|
|
304
|
+
|
|
305
|
+
.rui-sidebar[data-mobile='true'] {
|
|
306
|
+
@apply fixed inset-0 z-(--z-modal) flex min-w-0 bg-transparent;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.rui-sidebar[data-mobile='true'][data-state='collapsed'] {
|
|
310
|
+
@apply pointer-events-none;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.rui-sidebar[data-mobile='true'][data-state='expanded'] {
|
|
314
|
+
@apply pointer-events-auto;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.rui-sidebar[data-mobile='true'] > .rui-sidebar__pane {
|
|
318
|
+
@apply relative z-(--z-modal) h-full bg-surface text-on-background;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.rui-sidebar[data-mobile='true'][data-variant='inset'] > .rui-sidebar__pane {
|
|
322
|
+
@apply bg-background;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.rui-sidebar[data-mobile='true'][data-state='collapsed'] > .rui-sidebar__pane {
|
|
326
|
+
@apply w-0 overflow-hidden opacity-0;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.rui-sidebar[data-mobile='true'][data-state='expanded'] > .rui-sidebar__pane {
|
|
330
|
+
@apply w-72 max-w-[85vw] opacity-100;
|
|
331
|
+
box-shadow: var(--shadow-modal);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.rui-sidebar[data-mobile='true'][data-side='left'] > .rui-sidebar__pane {
|
|
335
|
+
@apply me-auto;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.rui-sidebar[data-mobile='true'][data-side='right'] > .rui-sidebar__pane {
|
|
339
|
+
@apply ms-auto;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.rui-sidebar__scrim {
|
|
343
|
+
@apply absolute inset-0 z-(--z-overlay) cursor-pointer border-0 p-0 bg-overlay;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.rui-sidebar[data-mobile='true'] > .rui-sidebar__handle {
|
|
347
|
+
@apply hidden;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/* -------------------------------------------------------------------------- */
|
|
351
|
+
/* Reduced motion */
|
|
352
|
+
/* -------------------------------------------------------------------------- */
|
|
353
|
+
|
|
354
|
+
@media (prefers-reduced-motion: reduce) {
|
|
355
|
+
.rui-sidebar__pane,
|
|
356
|
+
.rui-sidebar__handle,
|
|
357
|
+
.rui-sidebar__handle-grip,
|
|
358
|
+
.rui-sidebar__group-action,
|
|
359
|
+
.rui-sidebar__menu-button {
|
|
360
|
+
transition: none;
|
|
361
|
+
}
|
|
362
|
+
}
|