@kumix/ui 0.3.7 → 0.3.8
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 +25 -24
- package/dist/cascader-types-BnH6wYD-.d.ts +183 -0
- package/dist/cascader-types-BnH6wYD-.d.ts.map +1 -0
- package/dist/components/motion/animated-sidebar.d.ts.map +1 -1
- package/dist/components/motion/animated-sidebar.js +12 -3
- package/dist/components/motion/animated-sidebar.js.map +1 -1
- package/dist/components/motion/attachment-upload.d.ts.map +1 -1
- package/dist/components/motion/attachment-upload.js +9 -5
- package/dist/components/motion/attachment-upload.js.map +1 -1
- package/dist/components/motion/bottom-sheet.d.ts.map +1 -1
- package/dist/components/motion/bottom-sheet.js +77 -74
- package/dist/components/motion/bottom-sheet.js.map +1 -1
- package/dist/components/motion/center-morph-modal.d.ts.map +1 -1
- package/dist/components/motion/center-morph-modal.js +82 -88
- package/dist/components/motion/center-morph-modal.js.map +1 -1
- package/dist/components/motion/command-palette.d.ts.map +1 -1
- package/dist/components/motion/command-palette.js +48 -26
- package/dist/components/motion/command-palette.js.map +1 -1
- package/dist/components/motion/drawer.d.ts.map +1 -1
- package/dist/components/motion/drawer.js +30 -30
- package/dist/components/motion/drawer.js.map +1 -1
- package/dist/components/motion/loader.js +20 -22
- package/dist/components/motion/loader.js.map +1 -1
- package/dist/components/motion/morphing-modal.d.ts.map +1 -1
- package/dist/components/motion/morphing-modal.js +83 -83
- package/dist/components/motion/morphing-modal.js.map +1 -1
- package/dist/components/motion/morphing-search.d.ts +28 -0
- package/dist/components/motion/morphing-search.d.ts.map +1 -0
- package/dist/components/motion/morphing-search.js +418 -0
- package/dist/components/motion/morphing-search.js.map +1 -0
- package/dist/components/motion/project-folder.js +20 -20
- package/dist/components/motion/project-folder.js.map +1 -1
- package/dist/components/reui/badge.d.ts +1 -1
- package/dist/components/reui/cascader/cascader-async.d.ts +90 -0
- package/dist/components/reui/cascader/cascader-async.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-async.js +549 -0
- package/dist/components/reui/cascader/cascader-async.js.map +1 -0
- package/dist/components/reui/cascader/cascader-columns.d.ts +29 -0
- package/dist/components/reui/cascader/cascader-columns.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-columns.js +135 -0
- package/dist/components/reui/cascader/cascader-columns.js.map +1 -0
- package/dist/components/reui/cascader/cascader-context.d.ts +193 -0
- package/dist/components/reui/cascader/cascader-context.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-context.js +59 -0
- package/dist/components/reui/cascader/cascader-context.js.map +1 -0
- package/dist/components/reui/cascader/cascader-footer.d.ts +85 -0
- package/dist/components/reui/cascader/cascader-footer.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-footer.js +456 -0
- package/dist/components/reui/cascader/cascader-footer.js.map +1 -0
- package/dist/components/reui/cascader/cascader-i18n.d.ts +17 -0
- package/dist/components/reui/cascader/cascader-i18n.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-i18n.js +68 -0
- package/dist/components/reui/cascader/cascader-i18n.js.map +1 -0
- package/dist/components/reui/cascader/cascader-item.d.ts +115 -0
- package/dist/components/reui/cascader/cascader-item.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-item.js +530 -0
- package/dist/components/reui/cascader/cascader-item.js.map +1 -0
- package/dist/components/reui/cascader/cascader-lib.d.ts +141 -0
- package/dist/components/reui/cascader/cascader-lib.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-lib.js +576 -0
- package/dist/components/reui/cascader/cascader-lib.js.map +1 -0
- package/dist/components/reui/cascader/cascader-nav.d.ts +59 -0
- package/dist/components/reui/cascader/cascader-nav.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-nav.js +312 -0
- package/dist/components/reui/cascader/cascader-nav.js.map +1 -0
- package/dist/components/reui/cascader/cascader-types.d.ts +2 -0
- package/dist/components/reui/cascader/cascader-types.js +2 -0
- package/dist/components/reui/cascader/cascader-virtual.d.ts +65 -0
- package/dist/components/reui/cascader/cascader-virtual.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-virtual.js +240 -0
- package/dist/components/reui/cascader/cascader-virtual.js.map +1 -0
- package/dist/components/reui/cascader/cascader.d.ts +322 -0
- package/dist/components/reui/cascader/cascader.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader.js +1459 -0
- package/dist/components/reui/cascader/cascader.js.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-event.d.ts +28 -47
- package/dist/components/reui/event-calendar/event-calendar-event.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-event.js +26 -44
- package/dist/components/reui/event-calendar/event-calendar-event.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-nav.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-types.d.ts +19 -57
- package/dist/components/reui/event-calendar/event-calendar-types.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-advanced.d.ts +52 -0
- package/dist/components/reui/filters/filters-advanced.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-advanced.js +1191 -0
- package/dist/components/reui/filters/filters-advanced.js.map +1 -0
- package/dist/components/reui/filters/filters-builder.d.ts +43 -0
- package/dist/components/reui/filters/filters-builder.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-builder.js +152 -0
- package/dist/components/reui/filters/filters-builder.js.map +1 -0
- package/dist/components/reui/filters/filters-chip.d.ts +79 -0
- package/dist/components/reui/filters/filters-chip.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-chip.js +553 -0
- package/dist/components/reui/filters/filters-chip.js.map +1 -0
- package/dist/components/reui/filters/filters-context.d.ts +290 -0
- package/dist/components/reui/filters/filters-context.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-context.js +277 -0
- package/dist/components/reui/filters/filters-context.js.map +1 -0
- package/dist/components/reui/filters/filters-date.d.ts +43 -0
- package/dist/components/reui/filters/filters-date.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-date.js +143 -0
- package/dist/components/reui/filters/filters-date.js.map +1 -0
- package/dist/components/reui/filters/filters-dnd.d.ts +101 -0
- package/dist/components/reui/filters/filters-dnd.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-dnd.js +454 -0
- package/dist/components/reui/filters/filters-dnd.js.map +1 -0
- package/dist/components/reui/filters/filters-draft.d.ts +2 -0
- package/dist/components/reui/filters/filters-draft.js +128 -0
- package/dist/components/reui/filters/filters-draft.js.map +1 -0
- package/dist/components/reui/filters/filters-editors.d.ts +91 -0
- package/dist/components/reui/filters/filters-editors.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-editors.js +773 -0
- package/dist/components/reui/filters/filters-editors.js.map +1 -0
- package/dist/components/reui/filters/filters-i18n.d.ts +24 -0
- package/dist/components/reui/filters/filters-i18n.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-i18n.js +127 -0
- package/dist/components/reui/filters/filters-i18n.js.map +1 -0
- package/dist/components/reui/filters/filters-lib.d.ts +171 -0
- package/dist/components/reui/filters/filters-lib.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-lib.js +336 -0
- package/dist/components/reui/filters/filters-lib.js.map +1 -0
- package/dist/components/reui/filters/filters-operators.d.ts +49 -0
- package/dist/components/reui/filters/filters-operators.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-operators.js +300 -0
- package/dist/components/reui/filters/filters-operators.js.map +1 -0
- package/dist/components/reui/filters/filters-query.d.ts +132 -0
- package/dist/components/reui/filters/filters-query.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-query.js +476 -0
- package/dist/components/reui/filters/filters-query.js.map +1 -0
- package/dist/components/reui/filters/filters-types.d.ts +452 -0
- package/dist/components/reui/filters/filters-types.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-types.js +2 -0
- package/dist/components/reui/filters/filters.d.ts +114 -0
- package/dist/components/reui/filters/filters.d.ts.map +1 -0
- package/dist/components/reui/filters/filters.js +638 -0
- package/dist/components/reui/filters/filters.js.map +1 -0
- package/dist/components/reui/frame.d.ts +1 -1
- package/dist/components/reui/gantt/gantt-bar.js +1 -1
- package/dist/components/reui/gantt/gantt-nav.js +1 -1
- package/dist/components/reui/gantt/gantt-types.d.ts +25 -71
- package/dist/components/reui/gantt/gantt-types.d.ts.map +1 -1
- package/dist/components/reui/gantt/gantt-view.js +1 -1
- package/dist/components/ui/attachment.d.ts +1 -1
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/bubble.d.ts +1 -1
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/field.d.ts +1 -1
- package/dist/components/ui/field.js +2 -2
- package/dist/components/ui/field.js.map +1 -1
- package/dist/components/ui/item.d.ts +1 -1
- package/dist/components/ui/radio-group.js +1 -1
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/sidebar.d.ts +1 -1
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/switch.js +1 -1
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/toggle.d.ts +1 -1
- package/dist/filters-draft-DEAl3TO-.d.ts +70 -0
- package/dist/filters-draft-DEAl3TO-.d.ts.map +1 -0
- package/dist/lib/text-shimmer.d.ts +2 -2
- package/dist/lib/text-shimmer.d.ts.map +1 -1
- package/dist/lib/text-shimmer.js +2 -2
- package/dist/lib/text-shimmer.js.map +1 -1
- package/dist/presence-gate-BekdC4Bo.js +24 -0
- package/dist/presence-gate-BekdC4Bo.js.map +1 -0
- package/package.json +9 -9
- package/dist/components/reui/filters.d.ts +0 -176
- package/dist/components/reui/filters.d.ts.map +0 -1
- package/dist/components/reui/filters.js +0 -1223
- package/dist/components/reui/filters.js.map +0 -1
package/README.md
CHANGED
|
@@ -4,16 +4,16 @@ React UI kit for Kumix products. Built on **Base UI**, **Tailwind CSS**, **class
|
|
|
4
4
|
|
|
5
5
|
## Sources
|
|
6
6
|
|
|
7
|
-
| Path | Origin
|
|
8
|
-
| --------------------------------- |
|
|
9
|
-
| `src/components/ui/*` | [shadcn/ui](https://ui.shadcn.com/) (base-nova style)
|
|
10
|
-
| `src/components/reui/*` | [ReUI](https://reui.io/) registry (`@reui/*`)
|
|
11
|
-
| `src/components/motion/*` | [beUI](https://beui.dev/) registry (`@beui/*`, Motion-based)
|
|
12
|
-
| `src/components/agents/*` | [beUI](https://beui.dev/) AI agent components (`@beui/*`)
|
|
13
|
-
| `src/components/custom/*` | Hand-written Kumix-specific components
|
|
14
|
-
| `src/hooks/*` | Package helpers (+ ReUI `use-file-upload`, beUI helpers)
|
|
15
|
-
| `src/lib/*` | Shared utilities (beUI `ease`, `tick-sound`, `text-shimmer`, `favicon`) | — |
|
|
16
|
-
| `src/style.css` · `src/theme.css` | Tailwind entry + design tokens
|
|
7
|
+
| Path | Origin | Docs / previews |
|
|
8
|
+
| --------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
|
|
9
|
+
| `src/components/ui/*` | [shadcn/ui](https://ui.shadcn.com/) (base-nova style) | [ui.shadcn.com/docs/components](https://ui.shadcn.com/docs/components) |
|
|
10
|
+
| `src/components/reui/*` | [ReUI](https://reui.io/) registry (`@reui/*`) | [reui.io/docs](https://reui.io/docs) · [components](https://reui.io/components) |
|
|
11
|
+
| `src/components/motion/*` | [beUI](https://beui.dev/) registry (`@beui/*`, Motion-based) | [beui.dev/components/motion](https://beui.dev/components/motion) |
|
|
12
|
+
| `src/components/agents/*` | [beUI](https://beui.dev/) AI agent components (`@beui/*`) | [beui.dev/components/agents](https://beui.dev/components/agents) |
|
|
13
|
+
| `src/components/custom/*` | Hand-written Kumix-specific components | — |
|
|
14
|
+
| `src/hooks/*` | Package helpers (+ ReUI `use-file-upload`, beUI helpers) | — |
|
|
15
|
+
| `src/lib/*` | Shared utilities (beUI `ease`, `tick-sound`, `text-shimmer`, `favicon`, `presence-gate`) | — |
|
|
16
|
+
| `src/style.css` · `src/theme.css` | Tailwind entry + design tokens | — |
|
|
17
17
|
|
|
18
18
|
For **previews, props, and usage examples** of each component, use the upstream docs:
|
|
19
19
|
|
|
@@ -112,29 +112,30 @@ Mapped from source:
|
|
|
112
112
|
|
|
113
113
|
Base UI / shadcn base-nova. Preview: [ui.shadcn.com](https://ui.shadcn.com/docs/components).
|
|
114
114
|
|
|
115
|
-
`accordion` · `alert` · `alert-dialog` · `aspect-ratio` · `attachment` · `avatar` · `badge` · `breadcrumb` · `bubble` · `button` · `button-group` · `calendar` · `card` · `carousel` · `chart` · `checkbox` · `collapsible` · `combobox` · `command` · `context-menu` · `dialog` · `direction` · `drawer` · `dropdown-menu` · `empty` · `field` · `hover-card` · `input` · `input-group` · `input-otp` · `item` · `kbd` · `label` · `marker` · `menubar` · `message` · `message-scroller` · `native-select` · `navigation-menu` · `pagination` · `popover` · `progress` · `questionnaire` · `radio-group` · `resizable` · `scroll-area` · `select` · `separator` · `sheet` · `sidebar` · `skeleton` · `slider` · `spinner` · `switch` · `table` · `tabs` · `textarea` · `toggle` · `toggle-group` · `tooltip`
|
|
115
|
+
`accordion` · `alert` · `alert-dialog` · `aspect-ratio` · `attachment` · `avatar` · `badge` · `breadcrumb` · `bubble` · `button` · `button-group` · `calendar` · `card` · `carousel` · `chart` · `checkbox` · `collapsible` · `combobox` · `command` · `context-menu` · `dialog` · `direction` · `drawer` · `dropdown-menu` · `empty` · `field` · `hover-card` · `input` · `input-group` · `input-otp` · `item` · `kbd` · `label` · `marker` · `menubar` · `message` · `message-scroller` · `native-select` · `navigation-menu` · `pagination` · `popover` · `progress` · `questionnaire` · `radio-group` · `resizable` · `scroll-area` · `select` · `separator` · `sheet` · `sidebar` · `skeleton` · `slider` · `spinner` · `switch` · `table` · `tabs` · `textarea` · `toggle` · `toggle-group` · `toast` · `tooltip`
|
|
116
116
|
|
|
117
117
|
### ReUI (`components/reui`)
|
|
118
118
|
|
|
119
119
|
Extended patterns. Preview: [reui.io](https://reui.io/docs).
|
|
120
120
|
|
|
121
|
-
| Module
|
|
122
|
-
|
|
|
123
|
-
| `alert` · `badge`
|
|
124
|
-
| `autocomplete`
|
|
125
|
-
| `
|
|
126
|
-
| `
|
|
127
|
-
| `
|
|
128
|
-
| `
|
|
129
|
-
| `
|
|
130
|
-
| `
|
|
131
|
-
| `
|
|
121
|
+
| Module | Notes |
|
|
122
|
+
| ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
|
|
123
|
+
| `alert` · `badge` | Extended variants (info/success/warning/…) |
|
|
124
|
+
| `autocomplete` | Base UI autocomplete |
|
|
125
|
+
| `cascader/*` | Multi-column cascading select, i18n, async |
|
|
126
|
+
| `data-grid/*` | Table, pagination, filters, DnD, virtual |
|
|
127
|
+
| `date-selector` | Day / month / quarter / range |
|
|
128
|
+
| `event-calendar/*` | Month, week, day, agenda, resource |
|
|
129
|
+
| `filters/*` | Advanced filter builder (chip, date, DnD) |
|
|
130
|
+
| `frame` | Nested panel layout |
|
|
131
|
+
| `gantt/*` | Day–year scales, resources, DnD |
|
|
132
|
+
| `icon-stack` · `icon-tile` · `kanban` · `number-field` · `phone-input` · `rating` · `scrollspy` · `sortable` · `stepper` · `timeline` · `tree` | — |
|
|
132
133
|
|
|
133
134
|
### beUI (`components/motion`)
|
|
134
135
|
|
|
135
136
|
Animated components built with [Motion](https://motion.dev). Preview: [beui.dev](https://beui.dev/components/motion). Bundled — `motion`, `lenis`, `@paper-design/shaders-react` are included, no extra installs needed.
|
|
136
137
|
|
|
137
|
-
`action-swap` · `animated-badge` · `animated-number` · `animated-sidebar` · `animated-toast-stack` · `attachment-upload` · `availability-scheduler/*` (copy-menu, day-row, time-select) · `bloom-menu` · `bottom-sheet` · `bounce-sidebar` · `bouncy-accordion` · `button/*` (base, stateful, magnetic, `ButtonLink`) · `center-morph-modal` · `checkbox` · `chromatic-text-reveal` · `command-palette` · `context-menu` · `cylinder-carousel` · `dock` · `drawer` · `dynamic-island` · `expandable-action-bar` · `expandable-tabs` · `feedback-widget` · `file-upload` · `hold-action-button` · `infinite-masonry` · `input` · `loader` · `magnetic` · `marquee` · `morphing-modal` · `morphing-tabs` · `not-found/*` (glitch, magnetic, spotlight, stacked, terminal) · `notification-stack` · `number-ticker` · `otp-input` · `overflow-actions` · `parallax` · `popover` · `popover-morph` · `preview-rail` · `pull-to-refresh` · `radio` · `range-slider` (5 variants) · `scroll-progress` · `scroll-reveal` · `scroll-to` · `select` · `select-morph` · `shader-background` · `shared-layout-bg` · `slide-action-button` · `smooth-scroll` · `swipeable-list` · `switch` · `table/*` (virtualized, editable, async) · `tabs` · `text-cascade` · `text-reveal` · `text-shimmer` · `theme-toggle` · `tilt-card` · `tooltip` · `wheel-picker`
|
|
138
|
+
`action-swap` (4 variants: base, blur, cascade, roll) · `animated-badge` · `animated-number` · `animated-sidebar` · `animated-toast-stack` · `attachment-upload` · `availability-scheduler/*` (copy-menu, day-row, time-select) · `bloom-menu` · `bottom-sheet` · `bounce-sidebar` · `bouncy-accordion` · `button/*` (base, stateful, magnetic, `ButtonLink`) · `center-morph-modal` · `checkbox` · `chromatic-text-reveal` · `combobox` + `combobox/*` (trigger, list, content, context) · `command-palette` · `context-menu` · `cylinder-carousel` · `dock` · `drawer` · `dynamic-island` · `expandable-action-bar` · `expandable-tabs` · `feedback-widget` · `file-upload` · `hold-action-button` · `infinite-masonry` · `input` · `loader` · `magnetic` · `marquee` · `morphing-modal` · `morphing-search` · `morphing-tabs` · `not-found/*` (glitch, magnetic, spotlight, stacked, terminal) · `notification-stack` · `number-ticker` · `otp-input` · `overflow-actions` · `parallax` · `popover` · `popover-morph` · `preview-rail` · `project-folder` · `pull-to-refresh` · `radio` · `range-slider` (5 variants) · `scroll-progress` · `scroll-reveal` · `scroll-to` · `select` · `select-morph` · `shader-background` · `shared-layout-bg` · `signup-form` · `slide-action-button` · `smooth-scroll` · `swipeable-list` · `switch` · `table/*` (virtualized, editable, async) · `tabs` · `text-cascade` · `text-reveal` · `text-scramble` · `text-shimmer` · `theme-toggle` · `tilt-card` · `tooltip` · `wheel-picker`
|
|
138
139
|
|
|
139
140
|
### beUI — AI Agents (`components/agents`)
|
|
140
141
|
|
|
@@ -152,7 +153,7 @@ Hand-written Kumix-specific composite components (not from any registry).
|
|
|
152
153
|
|
|
153
154
|
### Hooks
|
|
154
155
|
|
|
155
|
-
`use-body-classes` · `use-copy-to-clipboard` · `use-file-upload` · `use-hover-capable` · `use-hydrated` · `use-intersection-observer` · `use-is-mac` · `use-media-query` · `use-meta-color` · `use-mobile` · `use-mutation-observer` · `use-scroll-position` · `use-slider` · `use-slider-input` · `use-viewport`
|
|
156
|
+
`use-body-classes` · `use-copy-to-clipboard` · `use-dismiss` · `use-favicon` · `use-file-upload` · `use-hover-capable` · `use-hover-gesture` · `use-hydrated` · `use-intersection-observer` · `use-is-mac` · `use-media-query` · `use-meta-color` · `use-mobile` · `use-mutation-observer` · `use-scroll-position` · `use-slider` · `use-slider-input` · `use-tap-gesture` · `use-touch-capable` · `use-viewport`
|
|
156
157
|
|
|
157
158
|
- `useIsMobile` (`use-mobile`) — fixed `768px` breakpoint; used by `sidebar` / `date-selector`. First paint may be `false` until mount.
|
|
158
159
|
- `useMediaQuery` — arbitrary query string; SSR-safe via `useSyncExternalStore` (server snapshot `false`).
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region src/components/reui/cascader/cascader-types.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* A node in the cascader tree. Two input shapes normalize to one internal
|
|
5
|
+
* index: nested (nodes carry `children`), or flat adjacency plus the root's
|
|
6
|
+
* `getParent`, which skips the re-nesting step for large datasets.
|
|
7
|
+
*/
|
|
8
|
+
interface CascaderNode<T = unknown> {
|
|
9
|
+
/** Stable id. Also the committed selection value. */
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
icon?: React$1.ReactNode;
|
|
13
|
+
description?: string;
|
|
14
|
+
children?: CascaderNode<T>[];
|
|
15
|
+
/** Declares a branch before load; async nodes read as leaves without it. */
|
|
16
|
+
hasChildren?: boolean;
|
|
17
|
+
/** Trailing count. Defaults to known children; set it for async nodes. */
|
|
18
|
+
count?: number;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
keywords?: string[];
|
|
21
|
+
/**
|
|
22
|
+
* Only read on a node nested inside a `getChildren` result. For the level a
|
|
23
|
+
* node OWNS the authoritative signal is that level's `CascaderLoadResult`.
|
|
24
|
+
*/
|
|
25
|
+
hasMore?: boolean;
|
|
26
|
+
data?: T;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* One footer ACTION. Deliberately not a `CascaderNode`, so a command can never
|
|
30
|
+
* be passed where an option is expected and join the ring, filter or selection.
|
|
31
|
+
*/
|
|
32
|
+
interface CascaderActionItem {
|
|
33
|
+
/** Stable key. Falls back to the label when it is a string, then the index. */
|
|
34
|
+
value?: string;
|
|
35
|
+
label: React$1.ReactNode;
|
|
36
|
+
icon?: React$1.ReactNode;
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
/** Ignored when `items` is present - a flyout opens instead. */
|
|
39
|
+
onSelect?: () => void;
|
|
40
|
+
/** Turns the row into a submenu trigger. One level deep on purpose. */
|
|
41
|
+
items?: CascaderActionItem[];
|
|
42
|
+
/** Consecutive entries sharing a heading are drawn under one. */
|
|
43
|
+
group?: string;
|
|
44
|
+
}
|
|
45
|
+
/** Panel layout. See the docs for the keyboard map of each. */
|
|
46
|
+
type CascaderMode = "drill" | "columns" | "tree";
|
|
47
|
+
type CascaderSearchScope = "level" | "deep";
|
|
48
|
+
/**
|
|
49
|
+
* Which nodes may be committed. The predicate arm is generic over the payload
|
|
50
|
+
* rather than quantified per call: a per-call `<T>` would force every predicate
|
|
51
|
+
* to accept EVERY payload, so `(node: CascaderNode<Member>) => boolean` could
|
|
52
|
+
* never satisfy it.
|
|
53
|
+
*/
|
|
54
|
+
type CascaderSelectable<T = unknown> = "leaf" | "any" | ((node: CascaderNode<T>) => boolean);
|
|
55
|
+
type CascaderCollapse = "middle" | "start" | "none";
|
|
56
|
+
type CascaderValueDisplay = "path" | "leaf" | "count";
|
|
57
|
+
type CascaderChangeReason = "select" | "deselect" | "clear";
|
|
58
|
+
/** Second argument to `onValueChange`: resolved nodes, so no re-lookup. */
|
|
59
|
+
interface CascaderChangeDetails<T = unknown> {
|
|
60
|
+
/** The node committed or toggled. Null when the selection was cleared. */
|
|
61
|
+
node: CascaderNode<T> | null;
|
|
62
|
+
/** Ancestor chain of `node`, root first, node last. */
|
|
63
|
+
path: CascaderNode<T>[];
|
|
64
|
+
nodes: CascaderNode<T>[];
|
|
65
|
+
reason: CascaderChangeReason;
|
|
66
|
+
}
|
|
67
|
+
/** Normalized tree, built once per `items` identity, shared by every mode. */
|
|
68
|
+
interface CascaderIndex<T = unknown> {
|
|
69
|
+
byValue: Map<string, CascaderNode<T>>;
|
|
70
|
+
/** Children by parent value. Root children are keyed by `ROOT_KEY`. */
|
|
71
|
+
childrenOf: Map<string, CascaderNode<T>[]>;
|
|
72
|
+
parentOf: Map<string, string | null>;
|
|
73
|
+
/** Zero-based depth by node value. */
|
|
74
|
+
depthOf: Map<string, number>;
|
|
75
|
+
/** Top level nodes, in input order. */
|
|
76
|
+
roots: CascaderNode<T>[];
|
|
77
|
+
/** Every node in a stable, depth-first order. Used by deep search. */
|
|
78
|
+
all: CascaderNode<T>[];
|
|
79
|
+
}
|
|
80
|
+
interface CascaderFlatNode<T = unknown> {
|
|
81
|
+
node: CascaderNode<T>;
|
|
82
|
+
depth: number;
|
|
83
|
+
/** Known children, or a declared `hasChildren`. */
|
|
84
|
+
branch: boolean;
|
|
85
|
+
expanded: boolean;
|
|
86
|
+
/** Sibling count, plus one when the level has a paging row. */
|
|
87
|
+
setSize: number;
|
|
88
|
+
/** One-based index among siblings. */
|
|
89
|
+
posInSet: number;
|
|
90
|
+
}
|
|
91
|
+
/** One segment of a rendered path, after collapsing. */
|
|
92
|
+
type CascaderPathSegment<T = unknown> = {
|
|
93
|
+
type: "node";
|
|
94
|
+
node: CascaderNode<T>;
|
|
95
|
+
} | {
|
|
96
|
+
type: "ellipsis";
|
|
97
|
+
hidden: CascaderNode<T>[];
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Async load state for one node's children. Deliberately WITHOUT a `status`
|
|
101
|
+
* field: "declared a branch, never fetched" and "fetched and genuinely empty"
|
|
102
|
+
* are told apart by MAP MEMBERSHIP, and a second source of that truth would
|
|
103
|
+
* eventually disagree with the first.
|
|
104
|
+
*/
|
|
105
|
+
interface CascaderLoadState {
|
|
106
|
+
loading: boolean;
|
|
107
|
+
error: boolean;
|
|
108
|
+
hasMore: boolean;
|
|
109
|
+
/** Opaque cursor handed back to `getChildren` for the next page. */
|
|
110
|
+
cursor?: string;
|
|
111
|
+
}
|
|
112
|
+
/** Why a level was fetched. `resolve`: `resolveValue` hit an unloaded node. */
|
|
113
|
+
type CascaderLoadReason = "level" | "more" | "prefetch" | "retry" | "resolve";
|
|
114
|
+
/** Argument handed to `getChildren`. */
|
|
115
|
+
interface CascaderLoadContext {
|
|
116
|
+
/** Aborted when the request is superseded or the popup closes. */
|
|
117
|
+
signal: AbortSignal;
|
|
118
|
+
cursor?: string;
|
|
119
|
+
reason?: CascaderLoadReason;
|
|
120
|
+
}
|
|
121
|
+
/** Value returned by `getChildren`. A bare array is also accepted. */
|
|
122
|
+
interface CascaderLoadResult<T = unknown> {
|
|
123
|
+
items: CascaderNode<T>[];
|
|
124
|
+
nextCursor?: string;
|
|
125
|
+
/** Defaults to whether `nextCursor` was supplied. */
|
|
126
|
+
hasMore?: boolean;
|
|
127
|
+
}
|
|
128
|
+
/** Argument handed to `onSearch`. */
|
|
129
|
+
interface CascaderSearchContext {
|
|
130
|
+
signal: AbortSignal;
|
|
131
|
+
/** The path the user is searching within, deepest last. */
|
|
132
|
+
path: string[];
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Every user facing string, so the primitive ships no hardcoded copy. The
|
|
136
|
+
* callbacks take plain labels, not nodes: a `CascaderNode<T>` parameter would
|
|
137
|
+
* force this object to carry the item generic. `*Announcement` is live-region.
|
|
138
|
+
*/
|
|
139
|
+
interface CascaderLabels {
|
|
140
|
+
search: string | ((parentLabel?: string) => string);
|
|
141
|
+
back: string;
|
|
142
|
+
/** A level's FIRST page. `loadingMore` is the next, `loadMore` its idle row. */
|
|
143
|
+
loading: string;
|
|
144
|
+
loadingMore: string;
|
|
145
|
+
loadMore: string;
|
|
146
|
+
error: string;
|
|
147
|
+
retry: string;
|
|
148
|
+
empty: string;
|
|
149
|
+
/** Rendered by `CascaderValue` when `display="count"`. */
|
|
150
|
+
selectedCount: (count: number) => string;
|
|
151
|
+
breadcrumbLabel: string;
|
|
152
|
+
chipsLabel: string;
|
|
153
|
+
removeChip: (label: string) => string;
|
|
154
|
+
/** Trail separator. Not every locale writes one with a slash. */
|
|
155
|
+
pathSeparator: string;
|
|
156
|
+
/** Names the root level wherever there is no parent node to name it. */
|
|
157
|
+
rootLevel: string;
|
|
158
|
+
itemCount: (count: number) => string;
|
|
159
|
+
/** Appended to a branch row's name outside tree mode: it opens another list. */
|
|
160
|
+
branchAffordance: string;
|
|
161
|
+
/** Columns-trail rows are plain buttons, so they carry no `aria-selected`. */
|
|
162
|
+
selectedState: string;
|
|
163
|
+
/** Same for the mixed state, which a `role="button"` row may not carry. */
|
|
164
|
+
partiallySelectedState: string;
|
|
165
|
+
columnsLabel: string;
|
|
166
|
+
actionsLabel: string;
|
|
167
|
+
submenuAffordance: string;
|
|
168
|
+
panelLabel: string;
|
|
169
|
+
/** Read per mode AND per direction: the level keys mirror in RTL. */
|
|
170
|
+
keyboardHint: (mode: CascaderMode, dir: "ltr" | "rtl") => string;
|
|
171
|
+
rootAnnouncement: (count: number) => string;
|
|
172
|
+
expandedAnnouncement: (label: string, count: number) => string;
|
|
173
|
+
collapsedAnnouncement: (label: string) => string;
|
|
174
|
+
levelAnnouncement: (parentLabel: string, depth: number, count: number) => string;
|
|
175
|
+
resultsAnnouncement: (count: number) => string;
|
|
176
|
+
maxReachedAnnouncement: (max: number) => string;
|
|
177
|
+
/** `count` is the descendants swept along; `selecting` is the direction. */
|
|
178
|
+
cascadeAnnouncement: (label: string, count: number, selecting: boolean) => string;
|
|
179
|
+
searchingAnnouncement: string;
|
|
180
|
+
}
|
|
181
|
+
//#endregion
|
|
182
|
+
export { CascaderSelectable as _, CascaderFlatNode as a, CascaderLoadContext as c, CascaderLoadState as d, CascaderMode as f, CascaderSearchScope as g, CascaderSearchContext as h, CascaderCollapse as i, CascaderLoadReason as l, CascaderPathSegment as m, CascaderChangeDetails as n, CascaderIndex as o, CascaderNode as p, CascaderChangeReason as r, CascaderLabels as s, CascaderActionItem as t, CascaderLoadResult as u, CascaderValueDisplay as v };
|
|
183
|
+
//# sourceMappingURL=cascader-types-BnH6wYD-.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cascader-types-BnH6wYD-.d.ts","names":[],"sources":["../src/components/reui/cascader/cascader-types.tsx"],"mappings":";;;;;;;UASiB,aAAa;;EAE5B;EACA;EACA,OAAO,QAAM;EACb;EACA,WAAW,aAAa;;EAExB;;EAEA;EACA;EACA;;;;;EAKA;EACA,OAAO;;;;;;UAOQ;;EAEf;EACA,OAAO,QAAM;EACb,OAAO,QAAM;EACb;;EAEA;;EAEA,QAAQ;;EAER;;;KAIU;KAEA;;;;;;;KAQA,mBAAmB,kCAAkC,MAAM,aAAa;KAExE;KAEA;KAEA;;UAGK,sBAAsB;;EAErC,MAAM,aAAa;;EAEnB,MAAM,aAAa;EACnB,OAAO,aAAa;EACpB,QAAQ;;;UAIO,cAAc;EAC7B,SAAS,YAAY,aAAa;;EAElC,YAAY,YAAY,aAAa;EACrC,UAAU;;EAEV,SAAS;;EAET,OAAO,aAAa;;EAEpB,KAAK,aAAa;;UAGH,iBAAiB;EAChC,MAAM,aAAa;EACnB;;EAEA;EACA;;EAEA;;EAEA;;;KAIU,oBAAoB;EAC1B;EAAc,MAAM,aAAa;;EACjC;EAAkB,QAAQ,aAAa;;;;;;;;UAQ5B;EACf;EACA;EACA;;EAEA;;;KAIU;;UAGK;;EAEf,QAAQ;EACR;EACA,SAAS;;;UAIM,mBAAmB;EAClC,OAAO,aAAa;EACpB;;EAEA;;;UAIe;EACf,QAAQ;;EAER;;;;;;;UAQe;EACf,mBAAmB;EACnB;;EAEA;EACA;EACA;EACA;EACA;EACA;;EAEA,gBAAgB;EAChB;EACA;EACA,aAAa;;EAEb;;EAEA;EACA,YAAY;;EAEZ;;EAEA;;EAEA;EACA;EACA;EACA;EACA;;EAEA,eAAe,MAAM,cAAc;EACnC,mBAAmB;EACnB,uBAAuB,eAAe;EACtC,wBAAwB;EACxB,oBAAoB,qBAAqB,eAAe;EACxD,sBAAsB;EACtB,yBAAyB;;EAEzB,sBAAsB,eAAe,eAAe;EACpD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animated-sidebar.d.ts","names":[],"sources":["../../../src/components/motion/animated-sidebar.tsx"],"mappings":";;;KA+BK;KACA;KACA;KACA;UAyGK;EACR;EACA;EACA;EACA;EACA;EACA,UAAU;EACV,gBAAgB;EAChB,OAAO;EACP;EACA,YAAY,MAAM,UAAU;;iBAad,sBAAkB;KAgB7B,uBAAuB;EAC1B;EACA;EACA;;UAGe,qCAAqC,eAAe;EACnE;EACA;EACA,gBAAgB;EAChB;EACA;EACA,sBAAsB;EACtB,QAAQ;;iBAGM,0BACd,UACA,MACA,aACA,cACA,YACA,mBACA,oBACA,WACA,UACG,SACF,+CAA4B,IAAA;
|
|
1
|
+
{"version":3,"file":"animated-sidebar.d.ts","names":[],"sources":["../../../src/components/motion/animated-sidebar.tsx"],"mappings":";;;KA+BK;KACA;KACA;KACA;UAyGK;EACR;EACA;EACA;EACA;EACA;EACA,UAAU;EACV,gBAAgB;EAChB,OAAO;EACP;EACA,YAAY,MAAM,UAAU;;iBAad,sBAAkB;KAgB7B,uBAAuB;EAC1B;EACA;EACA;;UAGe,q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ACA,UACA,cACA,UACA,eACA,QACA,KACA,UACA,aACC,iDAA8B,IAAA"}
|
|
@@ -175,7 +175,13 @@ function MobileSidebar({ ariaLabel, children, className, side }) {
|
|
|
175
175
|
const context = useAnimatedSidebar();
|
|
176
176
|
const panelRef = useRef(null);
|
|
177
177
|
const [mounted, setMounted] = useState(false);
|
|
178
|
+
const [hidden, setHidden] = useState(!context.openMobile);
|
|
179
|
+
const openMobileRef = useRef(context.openMobile);
|
|
178
180
|
useEffect(() => setMounted(true), []);
|
|
181
|
+
useEffect(() => {
|
|
182
|
+
openMobileRef.current = context.openMobile;
|
|
183
|
+
if (context.openMobile) setHidden(false);
|
|
184
|
+
}, [context.openMobile]);
|
|
179
185
|
useEffect(() => {
|
|
180
186
|
if (!context.openMobile) return;
|
|
181
187
|
const body = document.body;
|
|
@@ -208,7 +214,7 @@ function MobileSidebar({ ariaLabel, children, className, side }) {
|
|
|
208
214
|
}, [context.openMobile, context.triggerRef]);
|
|
209
215
|
if (!mounted) return null;
|
|
210
216
|
return createPortal(/* @__PURE__ */ jsxs("div", {
|
|
211
|
-
className: cn("pointer-events-none fixed
|
|
217
|
+
className: cn("pointer-events-none fixed top-0 left-0 z-50 size-0 md:hidden", hidden && !context.openMobile ? "invisible" : "visible"),
|
|
212
218
|
children: [/* @__PURE__ */ jsx(motion.button, {
|
|
213
219
|
type: "button",
|
|
214
220
|
"aria-label": "Close sidebar",
|
|
@@ -217,7 +223,7 @@ function MobileSidebar({ ariaLabel, children, className, side }) {
|
|
|
217
223
|
animate: { opacity: context.openMobile ? 1 : 0 },
|
|
218
224
|
transition: context.reduce ? REDUCED_TRANSITION : PANEL_TRANSITION,
|
|
219
225
|
onClick: () => context.setOpenMobile(false),
|
|
220
|
-
className: cn("
|
|
226
|
+
className: cn("fixed inset-0 bg-black/40", context.openMobile ? "pointer-events-auto" : "pointer-events-none")
|
|
221
227
|
}), /* @__PURE__ */ jsx(motion.div, {
|
|
222
228
|
ref: panelRef,
|
|
223
229
|
role: "dialog",
|
|
@@ -235,6 +241,9 @@ function MobileSidebar({ ariaLabel, children, className, side }) {
|
|
|
235
241
|
x: context.reduce ? 0 : context.openMobile ? "0%" : side === "left" ? "-100%" : "100%"
|
|
236
242
|
},
|
|
237
243
|
transition: context.reduce ? REDUCED_TRANSITION : PANEL_TRANSITION,
|
|
244
|
+
onAnimationComplete: () => {
|
|
245
|
+
if (!openMobileRef.current) setHidden(true);
|
|
246
|
+
},
|
|
238
247
|
onKeyDown: (event) => {
|
|
239
248
|
if (event.key === "Escape") {
|
|
240
249
|
event.preventDefault();
|
|
@@ -258,7 +267,7 @@ function MobileSidebar({ ariaLabel, children, className, side }) {
|
|
|
258
267
|
first.focus();
|
|
259
268
|
}
|
|
260
269
|
},
|
|
261
|
-
className: cn("pointer-events-auto
|
|
270
|
+
className: cn("pointer-events-auto fixed inset-y-0 flex h-dvh w-(--sidebar-width-mobile) max-w-[88vw] flex-col overflow-hidden", "border-border bg-background shadow-2xl will-change-transform", side === "left" ? "left-0 border-r" : "right-0 border-l", !context.openMobile && "pointer-events-none", className),
|
|
262
271
|
children: /* @__PURE__ */ jsx(AnimatedSidebarPanelContext.Provider, {
|
|
263
272
|
value: {
|
|
264
273
|
collapsed: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animated-sidebar.js","names":[],"sources":["../../../src/components/motion/animated-sidebar.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ButtonHTMLAttributes,\n type CSSProperties,\n createContext,\n forwardRef,\n type HTMLAttributes,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useId,\n useRef,\n useState,\n useSyncExternalStore,\n} from \"react\";\nimport { ChevronRight } from \"lucide-react\";\nimport {\n AnimatePresence,\n type HTMLMotionProps,\n motion,\n useReducedMotion,\n type Variants,\n} from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_DRAWER, EASE_OUT, SPRING_LAYOUT, SPRING_PRESS } from \"../../lib/ease\";\nimport { SharedLayoutBg } from \"./shared-layout-bg\";\n\ntype SidebarState = \"expanded\" | \"collapsed\";\ntype SidebarSide = \"left\" | \"right\";\ntype SidebarVariant = \"sidebar\" | \"floating\" | \"inset\";\ntype SidebarCollapsible = \"offcanvas\" | \"icon\" | \"none\";\n\nconst MOBILE_QUERY = \"(max-width: 767px)\";\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\";\n\nconst PANEL_TRANSITION = {\n duration: 0.36,\n ease: EASE_DRAWER,\n} as const;\n\n// The desktop rail settles at a hard zero-width boundary. Keep the spring\n// critically damped so it cannot overshoot, pause against that boundary, and\n// then snap back during the final frame.\nconst SIDEBAR_MORPH_TRANSITION = {\n type: \"spring\",\n stiffness: 380,\n damping: 35,\n mass: 0.75,\n} as const;\n\nconst LABEL_ENTER_TRANSITION = {\n duration: 0.2,\n delay: 0.08,\n ease: EASE_OUT,\n} as const;\n\nconst LABEL_EXIT_TRANSITION = {\n duration: 0.12,\n ease: EASE_OUT,\n} as const;\n\nconst SUBMENU_TRANSITION = {\n duration: 0.18,\n ease: EASE_OUT,\n} as const;\n\nconst SUBMENU_VARIANTS: Variants = {\n closed: {\n opacity: 0,\n clipPath: \"inset(0 0 100% 0 round 8px)\",\n transition: {\n duration: 0.14,\n ease: EASE_OUT,\n staggerChildren: 0.025,\n staggerDirection: -1,\n },\n },\n open: {\n opacity: 1,\n clipPath: \"inset(0 0 0% 0 round 8px)\",\n transition: {\n duration: 0.2,\n delayChildren: 0.035,\n ease: EASE_OUT,\n staggerChildren: 0.045,\n },\n },\n};\n\nconst SUBMENU_ITEM_VARIANTS: Variants = {\n closed: {\n opacity: 0,\n y: -6,\n filter: \"blur(3px)\",\n },\n open: {\n opacity: 1,\n y: 0,\n filter: \"blur(0px)\",\n transition: SUBMENU_TRANSITION,\n },\n};\n\nconst REDUCED_TRANSITION = {\n duration: 0.16,\n ease: EASE_OUT,\n} as const;\n\nconst FOCUSABLE_SELECTOR = [\n \"a[href]\",\n \"button:not([disabled])\",\n \"input:not([disabled])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n \"[tabindex]:not([tabindex='-1'])\",\n].join(\",\");\n\nfunction subscribeToMobileQuery(callback: () => void) {\n const query = window.matchMedia(MOBILE_QUERY);\n query.addEventListener(\"change\", callback);\n return () => query.removeEventListener(\"change\", callback);\n}\n\nfunction getMobileSnapshot() {\n return window.matchMedia(MOBILE_QUERY).matches;\n}\n\nfunction getServerMobileSnapshot() {\n return false;\n}\n\nfunction useIsMobile() {\n return useSyncExternalStore(subscribeToMobileQuery, getMobileSnapshot, getServerMobileSnapshot);\n}\n\ninterface AnimatedSidebarContextValue {\n isMobile: boolean;\n layoutId: string;\n open: boolean;\n openMobile: boolean;\n reduce: boolean;\n setOpen: (open: boolean) => void;\n setOpenMobile: (open: boolean) => void;\n state: SidebarState;\n toggleSidebar: () => void;\n triggerRef: React.RefObject<HTMLButtonElement | null>;\n}\n\nconst AnimatedSidebarContext = createContext<AnimatedSidebarContextValue | null>(null);\n\ninterface AnimatedSidebarPanelContextValue {\n collapsed: boolean;\n collapsible: SidebarCollapsible;\n side: SidebarSide;\n}\n\nconst AnimatedSidebarPanelContext = createContext<AnimatedSidebarPanelContextValue | null>(null);\n\nexport function useAnimatedSidebar() {\n const context = useContext(AnimatedSidebarContext);\n if (!context) {\n throw new Error(\"useAnimatedSidebar must be used inside AnimatedSidebarProvider.\");\n }\n return context;\n}\n\nfunction useAnimatedSidebarPanel() {\n const context = useContext(AnimatedSidebarPanelContext);\n if (!context) {\n throw new Error(\"Animated Sidebar parts must be used inside AnimatedSidebar.\");\n }\n return context;\n}\n\ntype SidebarProviderStyle = CSSProperties & {\n \"--sidebar-width\"?: string;\n \"--sidebar-width-icon\"?: string;\n \"--sidebar-width-mobile\"?: string;\n};\n\nexport interface AnimatedSidebarProviderProps extends HTMLAttributes<HTMLDivElement> {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n openMobile?: boolean;\n defaultOpenMobile?: boolean;\n onOpenMobileChange?: (open: boolean) => void;\n style?: SidebarProviderStyle;\n}\n\nexport function AnimatedSidebarProvider({\n children,\n open,\n defaultOpen = true,\n onOpenChange,\n openMobile,\n defaultOpenMobile = false,\n onOpenMobileChange,\n className,\n style,\n ...props\n}: AnimatedSidebarProviderProps) {\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const [internalOpenMobile, setInternalOpenMobile] = useState(defaultOpenMobile);\n const isMobile = useIsMobile();\n const reduce = useReducedMotion() ?? false;\n const generatedId = useId();\n const triggerRef = useRef<HTMLButtonElement>(null);\n const desktopOpen = open ?? internalOpen;\n const mobileOpen = openMobile ?? internalOpenMobile;\n\n const setOpen = useCallback(\n (nextOpen: boolean) => {\n if (open === undefined) setInternalOpen(nextOpen);\n onOpenChange?.(nextOpen);\n },\n [onOpenChange, open],\n );\n\n const setOpenMobile = useCallback(\n (nextOpen: boolean) => {\n if (openMobile === undefined) setInternalOpenMobile(nextOpen);\n onOpenMobileChange?.(nextOpen);\n },\n [onOpenMobileChange, openMobile],\n );\n\n const toggleSidebar = useCallback(() => {\n if (isMobile) setOpenMobile(!mobileOpen);\n else setOpen(!desktopOpen);\n }, [desktopOpen, isMobile, mobileOpen, setOpen, setOpenMobile]);\n\n useEffect(() => {\n const handleShortcut = (event: KeyboardEvent) => {\n if (\n event.key.toLowerCase() === SIDEBAR_KEYBOARD_SHORTCUT &&\n (event.metaKey || event.ctrlKey)\n ) {\n event.preventDefault();\n toggleSidebar();\n }\n };\n\n window.addEventListener(\"keydown\", handleShortcut);\n return () => window.removeEventListener(\"keydown\", handleShortcut);\n }, [toggleSidebar]);\n\n return (\n <AnimatedSidebarContext.Provider\n value={{\n isMobile,\n layoutId: `${generatedId}-active`,\n open: desktopOpen,\n openMobile: mobileOpen,\n reduce,\n setOpen,\n setOpenMobile,\n state: desktopOpen ? \"expanded\" : \"collapsed\",\n toggleSidebar,\n triggerRef,\n }}\n >\n <div\n {...props}\n data-slot=\"sidebar-wrapper\"\n data-state={desktopOpen ? \"expanded\" : \"collapsed\"}\n style={{\n \"--sidebar-width\": \"16rem\",\n \"--sidebar-width-icon\": \"4.25rem\",\n \"--sidebar-width-mobile\": \"18rem\",\n ...style,\n }}\n className={cn(\"group/sidebar-wrapper flex min-h-svh w-full min-w-0\", className)}\n >\n {children}\n </div>\n </AnimatedSidebarContext.Provider>\n );\n}\n\nfunction MobileSidebar({\n ariaLabel,\n children,\n className,\n side,\n}: {\n ariaLabel: string;\n children: ReactNode;\n className?: string;\n side: SidebarSide;\n}) {\n const context = useAnimatedSidebar();\n const panelRef = useRef<HTMLDivElement>(null);\n const [mounted, setMounted] = useState(false);\n\n useEffect(() => setMounted(true), []);\n\n useEffect(() => {\n if (!context.openMobile) return;\n\n const body = document.body;\n const scrollY = window.scrollY;\n const previousBodyStyles = {\n left: body.style.left,\n overflow: body.style.overflow,\n position: body.style.position,\n right: body.style.right,\n top: body.style.top,\n };\n\n body.style.position = \"fixed\";\n body.style.top = `-${scrollY}px`;\n body.style.left = \"0\";\n body.style.right = \"0\";\n body.style.overflow = \"hidden\";\n\n const focusFrame = requestAnimationFrame(() => {\n const firstFocusable = panelRef.current?.querySelector<HTMLElement>(FOCUSABLE_SELECTOR);\n (firstFocusable ?? panelRef.current)?.focus({ preventScroll: true });\n });\n\n return () => {\n cancelAnimationFrame(focusFrame);\n body.style.position = previousBodyStyles.position;\n body.style.top = previousBodyStyles.top;\n body.style.left = previousBodyStyles.left;\n body.style.right = previousBodyStyles.right;\n body.style.overflow = previousBodyStyles.overflow;\n window.scrollTo(0, scrollY);\n context.triggerRef.current?.focus({ preventScroll: true });\n };\n }, [context.openMobile, context.triggerRef]);\n\n if (!mounted) return null;\n\n return createPortal(\n <div\n className={cn(\n \"pointer-events-none fixed inset-0 z-50 md:hidden\",\n context.openMobile ? \"visible\" : \"invisible\",\n )}\n >\n <motion.button\n type=\"button\"\n aria-label=\"Close sidebar\"\n tabIndex={context.openMobile ? 0 : -1}\n initial={false}\n animate={{ opacity: context.openMobile ? 1 : 0 }}\n transition={context.reduce ? REDUCED_TRANSITION : PANEL_TRANSITION}\n onClick={() => context.setOpenMobile(false)}\n className={cn(\n \"absolute inset-0 bg-black/40\",\n context.openMobile ? \"pointer-events-auto\" : \"pointer-events-none\",\n )}\n />\n\n <motion.div\n ref={panelRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={ariaLabel}\n aria-hidden={!context.openMobile}\n inert={!context.openMobile}\n tabIndex={-1}\n data-mobile=\"true\"\n data-state={context.openMobile ? \"expanded\" : \"collapsed\"}\n data-side={side}\n initial={false}\n animate={{\n opacity: context.reduce ? (context.openMobile ? 1 : 0) : 1,\n x: context.reduce ? 0 : context.openMobile ? \"0%\" : side === \"left\" ? \"-100%\" : \"100%\",\n }}\n transition={context.reduce ? REDUCED_TRANSITION : PANEL_TRANSITION}\n onKeyDown={(event) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n context.setOpenMobile(false);\n return;\n }\n\n if (event.key !== \"Tab\") return;\n const focusable = panelRef.current\n ? Array.from(panelRef.current.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR))\n : [];\n\n if (focusable.length === 0) {\n event.preventDefault();\n panelRef.current?.focus();\n return;\n }\n\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n if (event.shiftKey && document.activeElement === first) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && document.activeElement === last) {\n event.preventDefault();\n first.focus();\n }\n }}\n className={cn(\n \"pointer-events-auto absolute inset-y-0 flex h-dvh w-(--sidebar-width-mobile) max-w-[88vw] flex-col overflow-hidden\",\n \"border-border bg-background shadow-2xl will-change-transform\",\n side === \"left\" ? \"left-0 border-r\" : \"right-0 border-l\",\n !context.openMobile && \"pointer-events-none\",\n className,\n )}\n >\n <AnimatedSidebarPanelContext.Provider\n value={{ collapsed: false, collapsible: \"none\", side }}\n >\n {children}\n </AnimatedSidebarPanelContext.Provider>\n </motion.div>\n </div>,\n document.body,\n );\n}\n\nexport interface AnimatedSidebarProps extends Omit<HTMLMotionProps<\"aside\">, \"children\"> {\n children?: ReactNode;\n side?: SidebarSide;\n variant?: SidebarVariant;\n collapsible?: SidebarCollapsible;\n ariaLabel?: string;\n panelClassName?: string;\n}\n\nexport const AnimatedSidebar = forwardRef<HTMLElement, AnimatedSidebarProps>(\n function AnimatedSidebar(\n {\n side = \"left\",\n variant = \"sidebar\",\n collapsible = \"icon\",\n ariaLabel = \"Sidebar\",\n children,\n className,\n panelClassName,\n style,\n ...props\n },\n forwardedRef,\n ) {\n const context = useAnimatedSidebar();\n const collapsed = collapsible !== \"none\" && !context.open;\n const offcanvas = collapsed && collapsible === \"offcanvas\";\n const width = offcanvas\n ? \"0px\"\n : collapsed\n ? \"var(--sidebar-width-icon)\"\n : \"var(--sidebar-width)\";\n\n if (context.isMobile) {\n return (\n <MobileSidebar ariaLabel={ariaLabel} className={className} side={side}>\n {children}\n </MobileSidebar>\n );\n }\n\n return (\n <motion.aside\n {...props}\n ref={forwardedRef}\n initial={false}\n aria-label={ariaLabel}\n data-slot=\"sidebar\"\n data-state={collapsed ? \"collapsed\" : \"expanded\"}\n data-collapsible={collapsible}\n data-variant={variant}\n data-side={side}\n animate={{ width }}\n transition={context.reduce ? { duration: 0 } : SIDEBAR_MORPH_TRANSITION}\n style={style}\n className={cn(\n \"group/sidebar relative hidden h-auto shrink-0 will-change-[width] md:block\",\n \"peer\",\n side === \"right\" && \"order-last\",\n className,\n )}\n >\n <motion.div\n initial={false}\n animate={{\n opacity: offcanvas ? 0 : 1,\n x: offcanvas ? (side === \"left\" ? \"-100%\" : \"100%\") : \"0%\",\n }}\n transition={context.reduce ? REDUCED_TRANSITION : PANEL_TRANSITION}\n className={cn(\n \"sticky top-0 flex h-svh w-full flex-col overflow-hidden bg-background\",\n collapsible === \"offcanvas\" && \"w-(--sidebar-width)\",\n variant === \"sidebar\" &&\n (side === \"left\" ? \"border-border border-r\" : \"border-border border-l\"),\n variant === \"floating\" &&\n \"m-2 h-[calc(100svh-1rem)] rounded-2xl border border-border shadow-sm\",\n variant === \"inset\" && \"m-2 h-[calc(100svh-1rem)] rounded-2xl\",\n panelClassName,\n )}\n >\n <AnimatedSidebarPanelContext.Provider value={{ collapsed, collapsible, side }}>\n {children}\n </AnimatedSidebarPanelContext.Provider>\n </motion.div>\n </motion.aside>\n );\n },\n);\n\nexport interface AnimatedSidebarTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {}\n\nexport const AnimatedSidebarTrigger = forwardRef<HTMLButtonElement, AnimatedSidebarTriggerProps>(\n function AnimatedSidebarTrigger({ className, onClick, type = \"button\", ...props }, forwardedRef) {\n const context = useAnimatedSidebar();\n const expanded = context.isMobile ? context.openMobile : context.open;\n\n return (\n <button\n {...props}\n ref={(node) => {\n context.triggerRef.current = node;\n if (typeof forwardedRef === \"function\") forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n }}\n type={type}\n aria-label={props[\"aria-label\"] ?? \"Toggle sidebar\"}\n aria-expanded={expanded}\n data-slot=\"sidebar-trigger\"\n data-state={expanded ? \"expanded\" : \"collapsed\"}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) context.toggleSidebar();\n }}\n className={cn(\n \"inline-flex size-10 shrink-0 items-center justify-center rounded-xl outline-none\",\n \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n className,\n )}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarCloseProps extends ButtonHTMLAttributes<HTMLButtonElement> {}\n\nexport const AnimatedSidebarClose = forwardRef<HTMLButtonElement, AnimatedSidebarCloseProps>(\n function AnimatedSidebarClose({ className, onClick, type = \"button\", ...props }, forwardedRef) {\n const context = useAnimatedSidebar();\n\n return (\n <button\n {...props}\n ref={forwardedRef}\n type={type}\n aria-label={props[\"aria-label\"] ?? \"Close sidebar\"}\n onClick={(event) => {\n onClick?.(event);\n if (event.defaultPrevented) return;\n if (context.isMobile) context.setOpenMobile(false);\n else context.setOpen(false);\n }}\n className={cn(\n \"inline-flex size-10 shrink-0 items-center justify-center rounded-xl outline-none\",\n \"focus-visible:ring-2 focus-visible:ring-ring\",\n className,\n )}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarRailProps extends ButtonHTMLAttributes<HTMLButtonElement> {}\n\nexport const AnimatedSidebarRail = forwardRef<HTMLButtonElement, AnimatedSidebarRailProps>(\n function AnimatedSidebarRail({ className, onClick, type = \"button\", ...props }, forwardedRef) {\n const context = useAnimatedSidebar();\n const panel = useAnimatedSidebarPanel();\n\n return (\n <button\n {...props}\n ref={forwardedRef}\n type={type}\n data-side={panel.side}\n aria-label={props[\"aria-label\"] ?? \"Toggle sidebar\"}\n title=\"Toggle sidebar\"\n tabIndex={-1}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) context.toggleSidebar();\n }}\n className={cn(\n \"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 outline-none md:block\",\n \"after:absolute after:inset-y-0 after:left-1/2 after:w-px after:bg-transparent after:transition-colors hover:after:bg-border\",\n \"data-[side=right]:right-0 data-[side=left]:left-full data-[side=right]:translate-x-1/2\",\n className,\n )}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarInsetProps extends HTMLMotionProps<\"main\"> {}\n\nexport const AnimatedSidebarInset = forwardRef<HTMLElement, AnimatedSidebarInsetProps>(\n function AnimatedSidebarInset({ className, ...props }, forwardedRef) {\n return (\n <motion.main\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-inset\"\n className={cn(\n \"relative flex min-h-svh min-w-0 flex-1 flex-col bg-background\",\n \"md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-2xl md:peer-data-[variant=inset]:shadow-sm\",\n className,\n )}\n />\n );\n },\n);\n\nexport const AnimatedSidebarHeader = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarHeader({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-header\"\n className={cn(\"flex shrink-0 flex-col gap-2 p-3\", className)}\n />\n );\n },\n);\n\nexport const AnimatedSidebarContent = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarContent({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-content\"\n className={cn(\n \"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overflow-x-hidden overscroll-contain px-2 py-2\",\n className,\n )}\n />\n );\n },\n);\n\nexport const AnimatedSidebarFooter = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarFooter({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-footer\"\n className={cn(\n \"flex shrink-0 flex-col gap-2 border-border border-t p-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]\",\n className,\n )}\n />\n );\n },\n);\n\nexport const AnimatedSidebarGroup = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarGroup({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-group\"\n className={cn(\"flex w-full min-w-0 flex-col px-1 py-1.5\", className)}\n />\n );\n },\n);\n\nexport const AnimatedSidebarGroupLabel = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarGroupLabel({ children, className, ...props }, forwardedRef) {\n const { collapsed } = useAnimatedSidebarPanel();\n\n return (\n <div\n {...props}\n ref={forwardedRef}\n aria-hidden={collapsed}\n data-slot=\"sidebar-group-label\"\n className={cn(\n \"mb-1 h-7 overflow-hidden px-2 font-medium text-[10px] text-muted-foreground uppercase tracking-[0.14em] transition-opacity\",\n collapsed ? \"opacity-0\" : \"opacity-100\",\n className,\n )}\n >\n {children}\n </div>\n );\n },\n);\n\nexport const AnimatedSidebarGroupContent = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement>\n>(function AnimatedSidebarGroupContent({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-group-content\"\n className={cn(\"w-full min-w-0\", className)}\n />\n );\n});\n\nexport const AnimatedSidebarMenu = forwardRef<HTMLUListElement, HTMLAttributes<HTMLUListElement>>(\n function AnimatedSidebarMenu({ children, className, ...props }, forwardedRef) {\n return (\n <SharedLayoutBg\n {...props}\n ref={forwardedRef as React.Ref<HTMLElement>}\n as=\"ul\"\n inset={0}\n pillClassName=\"rounded-xl bg-muted/70\"\n pillContainerClassName=\"inset-y-auto top-0 h-9\"\n data-slot=\"sidebar-menu\"\n className={cn(\"flex w-full min-w-0 list-none flex-col gap-0.5\", className)}\n >\n {children}\n </SharedLayoutBg>\n );\n },\n);\n\nexport const AnimatedSidebarMenuItem = forwardRef<HTMLLIElement, HTMLMotionProps<\"li\">>(\n function AnimatedSidebarMenuItem({ className, ...props }, forwardedRef) {\n return (\n <motion.li\n {...props}\n ref={forwardedRef}\n layout=\"position\"\n transition={SPRING_LAYOUT}\n data-slot=\"sidebar-menu-item\"\n className={cn(\"relative\", className)}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarMenuSubProps extends Omit<HTMLMotionProps<\"ul\">, \"children\"> {\n open: boolean;\n children?: ReactNode;\n}\n\nexport const AnimatedSidebarMenuSub = forwardRef<HTMLUListElement, AnimatedSidebarMenuSubProps>(\n function AnimatedSidebarMenuSub({ open, children, className, ...props }, forwardedRef) {\n const context = useAnimatedSidebar();\n const panel = useAnimatedSidebarPanel();\n\n return (\n <AnimatePresence initial={false} mode=\"popLayout\">\n {open && !panel.collapsed ? (\n <motion.ul\n {...props}\n ref={forwardedRef}\n key=\"sidebar-submenu\"\n variants={context.reduce ? undefined : SUBMENU_VARIANTS}\n initial={context.reduce ? false : \"closed\"}\n animate={context.reduce ? { opacity: 1 } : \"open\"}\n exit={context.reduce ? { opacity: 0 } : \"closed\"}\n transition={context.reduce ? { duration: 0.12 } : undefined}\n data-slot=\"sidebar-menu-sub\"\n className={cn(\n \"relative mt-1 ml-5 flex min-w-0 flex-col gap-0.5 border-border border-l pl-3\",\n className,\n )}\n >\n {children}\n </motion.ul>\n ) : null}\n </AnimatePresence>\n );\n },\n);\n\nexport const AnimatedSidebarMenuSubItem = forwardRef<HTMLLIElement, HTMLMotionProps<\"li\">>(\n function AnimatedSidebarMenuSubItem({ className, ...props }, forwardedRef) {\n return (\n <motion.li\n {...props}\n ref={forwardedRef}\n variants={SUBMENU_ITEM_VARIANTS}\n data-slot=\"sidebar-menu-sub-item\"\n className={cn(\"relative min-w-0\", className)}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarMenuSubButtonProps {\n children: ReactNode;\n icon?: ReactNode;\n href?: string;\n isActive?: boolean;\n disabled?: boolean;\n closeOnSelect?: boolean;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\";\n rel?: string;\n onSelect?: () => void;\n className?: string;\n}\n\nexport function AnimatedSidebarMenuSubButton({\n children,\n icon,\n href,\n isActive = false,\n disabled = false,\n closeOnSelect = true,\n target,\n rel,\n onSelect,\n className,\n}: AnimatedSidebarMenuSubButtonProps) {\n const context = useAnimatedSidebar();\n\n const select = (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onSelect?.();\n if (context.isMobile && closeOnSelect) context.setOpenMobile(false);\n };\n\n const content = (\n <>\n <span aria-hidden=\"true\" className=\"grid size-4 shrink-0 place-items-center\">\n {icon ?? <span className=\"size-1 rounded-full bg-current\" />}\n </span>\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n </>\n );\n\n const interactiveClassName = cn(\n \"flex min-h-8 w-full min-w-0 items-center gap-2 rounded-lg px-2 text-left text-xs outline-none\",\n \"text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground\",\n \"focus-visible:bg-muted/70 focus-visible:ring-2 focus-visible:ring-ring\",\n isActive && \"bg-muted/70 text-foreground\",\n disabled && \"cursor-not-allowed opacity-40\",\n className,\n );\n\n return href ? (\n <motion.a\n href={href}\n target={target}\n rel={rel ?? (target === \"_blank\" ? \"noreferrer noopener\" : undefined)}\n aria-current={isActive ? \"page\" : undefined}\n aria-disabled={disabled || undefined}\n tabIndex={disabled ? -1 : undefined}\n onClick={select}\n whileTap={context.reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={interactiveClassName}\n >\n {content}\n </motion.a>\n ) : (\n <motion.button\n type=\"button\"\n disabled={disabled}\n aria-current={isActive ? \"page\" : undefined}\n onClick={select}\n whileTap={context.reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={interactiveClassName}\n >\n {content}\n </motion.button>\n );\n}\n\nexport interface AnimatedSidebarMenuButtonProps {\n children: ReactNode;\n icon?: ReactNode;\n badge?: ReactNode;\n href?: string;\n isActive?: boolean;\n ariaExpanded?: boolean;\n disabled?: boolean;\n closeOnSelect?: boolean;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\";\n rel?: string;\n onSelect?: () => void;\n className?: string;\n}\n\nexport function AnimatedSidebarMenuButton({\n children,\n icon,\n badge,\n href,\n isActive = false,\n ariaExpanded,\n disabled = false,\n closeOnSelect,\n target,\n rel,\n onSelect,\n className,\n}: AnimatedSidebarMenuButtonProps) {\n const context = useAnimatedSidebar();\n const panel = useAnimatedSidebarPanel();\n const textLabel = typeof children === \"string\" ? children : undefined;\n\n const select = (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onSelect?.();\n const shouldCloseOnSelect = closeOnSelect ?? ariaExpanded === undefined;\n if (context.isMobile && shouldCloseOnSelect) {\n context.setOpenMobile(false);\n }\n // A submenu cannot render in the icon rail, so opening one from there\n // leaves its children unreachable — a pointer can still fall back to the\n // rail or the shortcut, a finger has nothing. Selecting a group unfolds\n // the panel that is about to hold it.\n if (ariaExpanded !== undefined && panel.collapsed && !context.isMobile) {\n context.setOpen(true);\n }\n };\n\n const content = (\n <>\n {isActive ? (\n <motion.span\n layoutId={context.layoutId}\n transition={context.reduce ? { duration: 0 } : SPRING_LAYOUT}\n className=\"absolute inset-0 rounded-xl bg-muted\"\n />\n ) : null}\n {icon ? (\n <span aria-hidden=\"true\" className=\"relative z-10 grid size-5 shrink-0 place-items-center\">\n {icon}\n </span>\n ) : null}\n <motion.span\n initial={false}\n animate={{\n opacity: panel.collapsed ? 0 : 1,\n x: panel.collapsed ? -4 : 0,\n }}\n transition={\n context.reduce\n ? REDUCED_TRANSITION\n : panel.collapsed\n ? LABEL_EXIT_TRANSITION\n : LABEL_ENTER_TRANSITION\n }\n aria-hidden={panel.collapsed}\n className={cn(\n \"relative z-10 min-w-0 flex-1 truncate\",\n panel.collapsed && \"pointer-events-none\",\n )}\n >\n {children}\n </motion.span>\n {badge && !panel.collapsed ? (\n <span className=\"relative z-10 shrink-0 text-muted-foreground text-xs\">{badge}</span>\n ) : null}\n {ariaExpanded !== undefined ? (\n <motion.span\n aria-hidden=\"true\"\n initial={false}\n animate={{\n opacity: panel.collapsed ? 0 : 1,\n rotate: ariaExpanded ? 90 : 0,\n x: panel.collapsed ? 4 : 0,\n }}\n transition={context.reduce ? { duration: 0 } : SPRING_LAYOUT}\n className=\"relative z-10 grid size-4 shrink-0 place-items-center text-muted-foreground\"\n >\n <ChevronRight className=\"size-3.5\" />\n </motion.span>\n ) : null}\n </>\n );\n\n const interactiveClassName = cn(\n \"relative flex min-h-9 w-full min-w-0 items-center gap-2.5 overflow-hidden rounded-xl px-3 text-left font-medium text-sm outline-none\",\n \"text-muted-foreground transition-colors hover:text-foreground\",\n \"focus-visible:bg-muted/70 focus-visible:ring-2 focus-visible:ring-ring\",\n isActive && \"text-foreground\",\n disabled && \"cursor-not-allowed opacity-40\",\n className,\n );\n\n return href ? (\n <motion.a\n href={href}\n target={target}\n rel={rel ?? (target === \"_blank\" ? \"noreferrer noopener\" : undefined)}\n aria-current={isActive ? \"page\" : undefined}\n aria-expanded={ariaExpanded}\n aria-disabled={disabled || undefined}\n aria-label={panel.collapsed ? textLabel : undefined}\n title={panel.collapsed ? textLabel : undefined}\n tabIndex={disabled ? -1 : undefined}\n onClick={select}\n whileTap={context.reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={interactiveClassName}\n >\n {content}\n </motion.a>\n ) : (\n <motion.button\n type=\"button\"\n disabled={disabled}\n aria-current={isActive ? \"page\" : undefined}\n aria-expanded={ariaExpanded}\n aria-label={panel.collapsed ? textLabel : undefined}\n title={panel.collapsed ? textLabel : undefined}\n onClick={select}\n whileTap={context.reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={interactiveClassName}\n >\n {content}\n </motion.button>\n );\n}\n"],"mappings":";;;;;;;;;;AAoCA,MAAM,eAAe;AACrB,MAAM,4BAA4B;AAElC,MAAM,mBAAmB;CACvB,UAAU;CACV,MAAM;AACR;AAKA,MAAM,2BAA2B;CAC/B,MAAM;CACN,WAAW;CACX,SAAS;CACT,MAAM;AACR;AAEA,MAAM,yBAAyB;CAC7B,UAAU;CACV,OAAO;CACP,MAAM;AACR;AAEA,MAAM,wBAAwB;CAC5B,UAAU;CACV,MAAM;AACR;AAEA,MAAM,qBAAqB;CACzB,UAAU;CACV,MAAM;AACR;AAEA,MAAM,mBAA6B;CACjC,QAAQ;EACN,SAAS;EACT,UAAU;EACV,YAAY;GACV,UAAU;GACV,MAAM;GACN,iBAAiB;GACjB,kBAAkB;EACpB;CACF;CACA,MAAM;EACJ,SAAS;EACT,UAAU;EACV,YAAY;GACV,UAAU;GACV,eAAe;GACf,MAAM;GACN,iBAAiB;EACnB;CACF;AACF;AAEA,MAAM,wBAAkC;CACtC,QAAQ;EACN,SAAS;EACT,GAAG;EACH,QAAQ;CACV;CACA,MAAM;EACJ,SAAS;EACT,GAAG;EACH,QA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wBAAwB,KAAA;EAC3D,gBAAc,WAAW,SAAS,KAAA;EAClC,iBAAe;EACf,iBAAe,YAAY,KAAA;EAC3B,cAAY,MAAM,YAAY,YAAY,KAAA;EAC1C,OAAO,MAAM,YAAY,YAAY,KAAA;EACrC,UAAU,WAAW,KAAK,KAAA;EAC1B,SAAS;EACT,UAAU,QAAQ,UAAU,WAAW,KAAA,IAAY,EAAE,OAAO,IAAK;EACjE,YAAY;EACZ,WAAW;EAEV,UAAA;CACO,CAAA,IAEV,oBAAC,OAAO,QAAR;EACE,MAAK;EACK;EACV,gBAAc,WAAW,SAAS,KAAA;EAClC,iBAAe;EACf,cAAY,MAAM,YAAY,YAAY,KAAA;EAC1C,OAAO,MAAM,YAAY,YAAY,KAAA;EACrC,SAAS;EACT,UAAU,QAAQ,UAAU,WAAW,KAAA,IAAY,EAAE,OAAO,IAAK;EACjE,YAAY;EACZ,WAAW;EAEV,UAAA;CACY,CAAA;AAEnB"}
|
|
1
|
+
{"version":3,"file":"animated-sidebar.js","names":[],"sources":["../../../src/components/motion/animated-sidebar.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ButtonHTMLAttributes,\n type CSSProperties,\n createContext,\n forwardRef,\n type HTMLAttributes,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useId,\n useRef,\n useState,\n useSyncExternalStore,\n} from \"react\";\nimport { ChevronRight } from \"lucide-react\";\nimport {\n AnimatePresence,\n type HTMLMotionProps,\n motion,\n useReducedMotion,\n type Variants,\n} from \"motion/react\";\nimport { createPortal } from \"react-dom\";\n\nimport { cn } from \"@kumix/utils\";\nimport { EASE_DRAWER, EASE_OUT, SPRING_LAYOUT, SPRING_PRESS } from \"../../lib/ease\";\nimport { SharedLayoutBg } from \"./shared-layout-bg\";\n\ntype SidebarState = \"expanded\" | \"collapsed\";\ntype SidebarSide = \"left\" | \"right\";\ntype SidebarVariant = \"sidebar\" | \"floating\" | \"inset\";\ntype SidebarCollapsible = \"offcanvas\" | \"icon\" | \"none\";\n\nconst MOBILE_QUERY = \"(max-width: 767px)\";\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\";\n\nconst PANEL_TRANSITION = {\n duration: 0.36,\n ease: EASE_DRAWER,\n} as const;\n\n// The desktop rail settles at a hard zero-width boundary. Keep the spring\n// critically damped so it cannot overshoot, pause against that boundary, and\n// then snap back during the final frame.\nconst SIDEBAR_MORPH_TRANSITION = {\n type: \"spring\",\n stiffness: 380,\n damping: 35,\n mass: 0.75,\n} as const;\n\nconst LABEL_ENTER_TRANSITION = {\n duration: 0.2,\n delay: 0.08,\n ease: EASE_OUT,\n} as const;\n\nconst LABEL_EXIT_TRANSITION = {\n duration: 0.12,\n ease: EASE_OUT,\n} as const;\n\nconst SUBMENU_TRANSITION = {\n duration: 0.18,\n ease: EASE_OUT,\n} as const;\n\nconst SUBMENU_VARIANTS: Variants = {\n closed: {\n opacity: 0,\n clipPath: \"inset(0 0 100% 0 round 8px)\",\n transition: {\n duration: 0.14,\n ease: EASE_OUT,\n staggerChildren: 0.025,\n staggerDirection: -1,\n },\n },\n open: {\n opacity: 1,\n clipPath: \"inset(0 0 0% 0 round 8px)\",\n transition: {\n duration: 0.2,\n delayChildren: 0.035,\n ease: EASE_OUT,\n staggerChildren: 0.045,\n },\n },\n};\n\nconst SUBMENU_ITEM_VARIANTS: Variants = {\n closed: {\n opacity: 0,\n y: -6,\n filter: \"blur(3px)\",\n },\n open: {\n opacity: 1,\n y: 0,\n filter: \"blur(0px)\",\n transition: SUBMENU_TRANSITION,\n },\n};\n\nconst REDUCED_TRANSITION = {\n duration: 0.16,\n ease: EASE_OUT,\n} as const;\n\nconst FOCUSABLE_SELECTOR = [\n \"a[href]\",\n \"button:not([disabled])\",\n \"input:not([disabled])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n \"[tabindex]:not([tabindex='-1'])\",\n].join(\",\");\n\nfunction subscribeToMobileQuery(callback: () => void) {\n const query = window.matchMedia(MOBILE_QUERY);\n query.addEventListener(\"change\", callback);\n return () => query.removeEventListener(\"change\", callback);\n}\n\nfunction getMobileSnapshot() {\n return window.matchMedia(MOBILE_QUERY).matches;\n}\n\nfunction getServerMobileSnapshot() {\n return false;\n}\n\nfunction useIsMobile() {\n return useSyncExternalStore(subscribeToMobileQuery, getMobileSnapshot, getServerMobileSnapshot);\n}\n\ninterface AnimatedSidebarContextValue {\n isMobile: boolean;\n layoutId: string;\n open: boolean;\n openMobile: boolean;\n reduce: boolean;\n setOpen: (open: boolean) => void;\n setOpenMobile: (open: boolean) => void;\n state: SidebarState;\n toggleSidebar: () => void;\n triggerRef: React.RefObject<HTMLButtonElement | null>;\n}\n\nconst AnimatedSidebarContext = createContext<AnimatedSidebarContextValue | null>(null);\n\ninterface AnimatedSidebarPanelContextValue {\n collapsed: boolean;\n collapsible: SidebarCollapsible;\n side: SidebarSide;\n}\n\nconst AnimatedSidebarPanelContext = createContext<AnimatedSidebarPanelContextValue | null>(null);\n\nexport function useAnimatedSidebar() {\n const context = useContext(AnimatedSidebarContext);\n if (!context) {\n throw new Error(\"useAnimatedSidebar must be used inside AnimatedSidebarProvider.\");\n }\n return context;\n}\n\nfunction useAnimatedSidebarPanel() {\n const context = useContext(AnimatedSidebarPanelContext);\n if (!context) {\n throw new Error(\"Animated Sidebar parts must be used inside AnimatedSidebar.\");\n }\n return context;\n}\n\ntype SidebarProviderStyle = CSSProperties & {\n \"--sidebar-width\"?: string;\n \"--sidebar-width-icon\"?: string;\n \"--sidebar-width-mobile\"?: string;\n};\n\nexport interface AnimatedSidebarProviderProps extends HTMLAttributes<HTMLDivElement> {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n openMobile?: boolean;\n defaultOpenMobile?: boolean;\n onOpenMobileChange?: (open: boolean) => void;\n style?: SidebarProviderStyle;\n}\n\nexport function AnimatedSidebarProvider({\n children,\n open,\n defaultOpen = true,\n onOpenChange,\n openMobile,\n defaultOpenMobile = false,\n onOpenMobileChange,\n className,\n style,\n ...props\n}: AnimatedSidebarProviderProps) {\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const [internalOpenMobile, setInternalOpenMobile] = useState(defaultOpenMobile);\n const isMobile = useIsMobile();\n const reduce = useReducedMotion() ?? false;\n const generatedId = useId();\n const triggerRef = useRef<HTMLButtonElement>(null);\n const desktopOpen = open ?? internalOpen;\n const mobileOpen = openMobile ?? internalOpenMobile;\n\n const setOpen = useCallback(\n (nextOpen: boolean) => {\n if (open === undefined) setInternalOpen(nextOpen);\n onOpenChange?.(nextOpen);\n },\n [onOpenChange, open],\n );\n\n const setOpenMobile = useCallback(\n (nextOpen: boolean) => {\n if (openMobile === undefined) setInternalOpenMobile(nextOpen);\n onOpenMobileChange?.(nextOpen);\n },\n [onOpenMobileChange, openMobile],\n );\n\n const toggleSidebar = useCallback(() => {\n if (isMobile) setOpenMobile(!mobileOpen);\n else setOpen(!desktopOpen);\n }, [desktopOpen, isMobile, mobileOpen, setOpen, setOpenMobile]);\n\n useEffect(() => {\n const handleShortcut = (event: KeyboardEvent) => {\n if (\n event.key.toLowerCase() === SIDEBAR_KEYBOARD_SHORTCUT &&\n (event.metaKey || event.ctrlKey)\n ) {\n event.preventDefault();\n toggleSidebar();\n }\n };\n\n window.addEventListener(\"keydown\", handleShortcut);\n return () => window.removeEventListener(\"keydown\", handleShortcut);\n }, [toggleSidebar]);\n\n return (\n <AnimatedSidebarContext.Provider\n value={{\n isMobile,\n layoutId: `${generatedId}-active`,\n open: desktopOpen,\n openMobile: mobileOpen,\n reduce,\n setOpen,\n setOpenMobile,\n state: desktopOpen ? \"expanded\" : \"collapsed\",\n toggleSidebar,\n triggerRef,\n }}\n >\n <div\n {...props}\n data-slot=\"sidebar-wrapper\"\n data-state={desktopOpen ? \"expanded\" : \"collapsed\"}\n style={{\n \"--sidebar-width\": \"16rem\",\n \"--sidebar-width-icon\": \"4.25rem\",\n \"--sidebar-width-mobile\": \"18rem\",\n ...style,\n }}\n className={cn(\"group/sidebar-wrapper flex min-h-svh w-full min-w-0\", className)}\n >\n {children}\n </div>\n </AnimatedSidebarContext.Provider>\n );\n}\n\nfunction MobileSidebar({\n ariaLabel,\n children,\n className,\n side,\n}: {\n ariaLabel: string;\n children: ReactNode;\n className?: string;\n side: SidebarSide;\n}) {\n const context = useAnimatedSidebar();\n const panelRef = useRef<HTMLDivElement>(null);\n const [mounted, setMounted] = useState(false);\n // The sheet is mounted for as long as the viewport is mobile, so it hides\n // itself while closed rather than sitting there transparent and interactive.\n // Opening shows it in the same commit that starts the slide — a delayed show\n // would run the focus effect below against a still-hidden panel, and focus()\n // on a hidden element is ignored. Closing waits for the slide to finish, and\n // the panel's own exit tells us when that is: no duration to keep in sync.\n const [hidden, setHidden] = useState(!context.openMobile);\n // The completion callback fires for the open slide too, and it reads state\n // from whenever motion settles: a ref keeps it on the current one.\n const openMobileRef = useRef(context.openMobile);\n\n useEffect(() => setMounted(true), []);\n\n useEffect(() => {\n openMobileRef.current = context.openMobile;\n if (context.openMobile) setHidden(false);\n }, [context.openMobile]);\n\n useEffect(() => {\n if (!context.openMobile) return;\n\n const body = document.body;\n const scrollY = window.scrollY;\n const previousBodyStyles = {\n left: body.style.left,\n overflow: body.style.overflow,\n position: body.style.position,\n right: body.style.right,\n top: body.style.top,\n };\n\n body.style.position = \"fixed\";\n body.style.top = `-${scrollY}px`;\n body.style.left = \"0\";\n body.style.right = \"0\";\n body.style.overflow = \"hidden\";\n\n const focusFrame = requestAnimationFrame(() => {\n const firstFocusable = panelRef.current?.querySelector<HTMLElement>(FOCUSABLE_SELECTOR);\n (firstFocusable ?? panelRef.current)?.focus({ preventScroll: true });\n });\n\n return () => {\n cancelAnimationFrame(focusFrame);\n body.style.position = previousBodyStyles.position;\n body.style.top = previousBodyStyles.top;\n body.style.left = previousBodyStyles.left;\n body.style.right = previousBodyStyles.right;\n body.style.overflow = previousBodyStyles.overflow;\n window.scrollTo(0, scrollY);\n context.triggerRef.current?.focus({ preventScroll: true });\n };\n }, [context.openMobile, context.triggerRef]);\n\n if (!mounted) return null;\n\n // This container groups the sheet for hiding and the z-index and carries no\n // box: both children are `fixed` and resolve against the viewport themselves.\n // The scrim spans the viewport edges but paints a colour, and the panel is\n // inset off one side and paints its own surface, so no layer here is a\n return createPortal(\n <div\n className={cn(\n \"pointer-events-none fixed top-0 left-0 z-50 size-0 md:hidden\",\n hidden && !context.openMobile ? \"invisible\" : \"visible\",\n )}\n >\n <motion.button\n type=\"button\"\n aria-label=\"Close sidebar\"\n tabIndex={context.openMobile ? 0 : -1}\n initial={false}\n animate={{ opacity: context.openMobile ? 1 : 0 }}\n transition={context.reduce ? REDUCED_TRANSITION : PANEL_TRANSITION}\n onClick={() => context.setOpenMobile(false)}\n className={cn(\n \"fixed inset-0 bg-black/40\",\n context.openMobile ? \"pointer-events-auto\" : \"pointer-events-none\",\n )}\n />\n\n <motion.div\n ref={panelRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={ariaLabel}\n aria-hidden={!context.openMobile}\n inert={!context.openMobile}\n tabIndex={-1}\n data-mobile=\"true\"\n data-state={context.openMobile ? \"expanded\" : \"collapsed\"}\n data-side={side}\n initial={false}\n animate={{\n opacity: context.reduce ? (context.openMobile ? 1 : 0) : 1,\n x: context.reduce ? 0 : context.openMobile ? \"0%\" : side === \"left\" ? \"-100%\" : \"100%\",\n }}\n transition={context.reduce ? REDUCED_TRANSITION : PANEL_TRANSITION}\n onAnimationComplete={() => {\n if (!openMobileRef.current) setHidden(true);\n }}\n onKeyDown={(event) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n context.setOpenMobile(false);\n return;\n }\n\n if (event.key !== \"Tab\") return;\n const focusable = panelRef.current\n ? Array.from(panelRef.current.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR))\n : [];\n\n if (focusable.length === 0) {\n event.preventDefault();\n panelRef.current?.focus();\n return;\n }\n\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n if (event.shiftKey && document.activeElement === first) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && document.activeElement === last) {\n event.preventDefault();\n first.focus();\n }\n }}\n className={cn(\n \"pointer-events-auto fixed inset-y-0 flex h-dvh w-(--sidebar-width-mobile) max-w-[88vw] flex-col overflow-hidden\",\n \"border-border bg-background shadow-2xl will-change-transform\",\n side === \"left\" ? \"left-0 border-r\" : \"right-0 border-l\",\n !context.openMobile && \"pointer-events-none\",\n className,\n )}\n >\n <AnimatedSidebarPanelContext.Provider\n value={{ collapsed: false, collapsible: \"none\", side }}\n >\n {children}\n </AnimatedSidebarPanelContext.Provider>\n </motion.div>\n </div>,\n document.body,\n );\n}\n\nexport interface AnimatedSidebarProps extends Omit<HTMLMotionProps<\"aside\">, \"children\"> {\n children?: ReactNode;\n side?: SidebarSide;\n variant?: SidebarVariant;\n collapsible?: SidebarCollapsible;\n ariaLabel?: string;\n panelClassName?: string;\n}\n\nexport const AnimatedSidebar = forwardRef<HTMLElement, AnimatedSidebarProps>(\n function AnimatedSidebar(\n {\n side = \"left\",\n variant = \"sidebar\",\n collapsible = \"icon\",\n ariaLabel = \"Sidebar\",\n children,\n className,\n panelClassName,\n style,\n ...props\n },\n forwardedRef,\n ) {\n const context = useAnimatedSidebar();\n const collapsed = collapsible !== \"none\" && !context.open;\n const offcanvas = collapsed && collapsible === \"offcanvas\";\n const width = offcanvas\n ? \"0px\"\n : collapsed\n ? \"var(--sidebar-width-icon)\"\n : \"var(--sidebar-width)\";\n\n if (context.isMobile) {\n return (\n <MobileSidebar ariaLabel={ariaLabel} className={className} side={side}>\n {children}\n </MobileSidebar>\n );\n }\n\n return (\n <motion.aside\n {...props}\n ref={forwardedRef}\n initial={false}\n aria-label={ariaLabel}\n data-slot=\"sidebar\"\n data-state={collapsed ? \"collapsed\" : \"expanded\"}\n data-collapsible={collapsible}\n data-variant={variant}\n data-side={side}\n animate={{ width }}\n transition={context.reduce ? { duration: 0 } : SIDEBAR_MORPH_TRANSITION}\n style={style}\n className={cn(\n \"group/sidebar relative hidden h-auto shrink-0 will-change-[width] md:block\",\n \"peer\",\n side === \"right\" && \"order-last\",\n className,\n )}\n >\n <motion.div\n initial={false}\n animate={{\n opacity: offcanvas ? 0 : 1,\n x: offcanvas ? (side === \"left\" ? \"-100%\" : \"100%\") : \"0%\",\n }}\n transition={context.reduce ? REDUCED_TRANSITION : PANEL_TRANSITION}\n className={cn(\n \"sticky top-0 flex h-svh w-full flex-col overflow-hidden bg-background\",\n collapsible === \"offcanvas\" && \"w-(--sidebar-width)\",\n variant === \"sidebar\" &&\n (side === \"left\" ? \"border-border border-r\" : \"border-border border-l\"),\n variant === \"floating\" &&\n \"m-2 h-[calc(100svh-1rem)] rounded-2xl border border-border shadow-sm\",\n variant === \"inset\" && \"m-2 h-[calc(100svh-1rem)] rounded-2xl\",\n panelClassName,\n )}\n >\n <AnimatedSidebarPanelContext.Provider value={{ collapsed, collapsible, side }}>\n {children}\n </AnimatedSidebarPanelContext.Provider>\n </motion.div>\n </motion.aside>\n );\n },\n);\n\nexport interface AnimatedSidebarTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {}\n\nexport const AnimatedSidebarTrigger = forwardRef<HTMLButtonElement, AnimatedSidebarTriggerProps>(\n function AnimatedSidebarTrigger({ className, onClick, type = \"button\", ...props }, forwardedRef) {\n const context = useAnimatedSidebar();\n const expanded = context.isMobile ? context.openMobile : context.open;\n\n return (\n <button\n {...props}\n ref={(node) => {\n context.triggerRef.current = node;\n if (typeof forwardedRef === \"function\") forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n }}\n type={type}\n aria-label={props[\"aria-label\"] ?? \"Toggle sidebar\"}\n aria-expanded={expanded}\n data-slot=\"sidebar-trigger\"\n data-state={expanded ? \"expanded\" : \"collapsed\"}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) context.toggleSidebar();\n }}\n className={cn(\n \"inline-flex size-10 shrink-0 items-center justify-center rounded-xl outline-none\",\n \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n className,\n )}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarCloseProps extends ButtonHTMLAttributes<HTMLButtonElement> {}\n\nexport const AnimatedSidebarClose = forwardRef<HTMLButtonElement, AnimatedSidebarCloseProps>(\n function AnimatedSidebarClose({ className, onClick, type = \"button\", ...props }, forwardedRef) {\n const context = useAnimatedSidebar();\n\n return (\n <button\n {...props}\n ref={forwardedRef}\n type={type}\n aria-label={props[\"aria-label\"] ?? \"Close sidebar\"}\n onClick={(event) => {\n onClick?.(event);\n if (event.defaultPrevented) return;\n if (context.isMobile) context.setOpenMobile(false);\n else context.setOpen(false);\n }}\n className={cn(\n \"inline-flex size-10 shrink-0 items-center justify-center rounded-xl outline-none\",\n \"focus-visible:ring-2 focus-visible:ring-ring\",\n className,\n )}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarRailProps extends ButtonHTMLAttributes<HTMLButtonElement> {}\n\nexport const AnimatedSidebarRail = forwardRef<HTMLButtonElement, AnimatedSidebarRailProps>(\n function AnimatedSidebarRail({ className, onClick, type = \"button\", ...props }, forwardedRef) {\n const context = useAnimatedSidebar();\n const panel = useAnimatedSidebarPanel();\n\n return (\n <button\n {...props}\n ref={forwardedRef}\n type={type}\n data-side={panel.side}\n aria-label={props[\"aria-label\"] ?? \"Toggle sidebar\"}\n title=\"Toggle sidebar\"\n tabIndex={-1}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) context.toggleSidebar();\n }}\n className={cn(\n \"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 outline-none md:block\",\n \"after:absolute after:inset-y-0 after:left-1/2 after:w-px after:bg-transparent after:transition-colors hover:after:bg-border\",\n \"data-[side=right]:right-0 data-[side=left]:left-full data-[side=right]:translate-x-1/2\",\n className,\n )}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarInsetProps extends HTMLMotionProps<\"main\"> {}\n\nexport const AnimatedSidebarInset = forwardRef<HTMLElement, AnimatedSidebarInsetProps>(\n function AnimatedSidebarInset({ className, ...props }, forwardedRef) {\n return (\n <motion.main\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-inset\"\n className={cn(\n \"relative flex min-h-svh min-w-0 flex-1 flex-col bg-background\",\n \"md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-2xl md:peer-data-[variant=inset]:shadow-sm\",\n className,\n )}\n />\n );\n },\n);\n\nexport const AnimatedSidebarHeader = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarHeader({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-header\"\n className={cn(\"flex shrink-0 flex-col gap-2 p-3\", className)}\n />\n );\n },\n);\n\nexport const AnimatedSidebarContent = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarContent({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-content\"\n className={cn(\n \"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overflow-x-hidden overscroll-contain px-2 py-2\",\n className,\n )}\n />\n );\n },\n);\n\nexport const AnimatedSidebarFooter = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarFooter({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-footer\"\n className={cn(\n \"flex shrink-0 flex-col gap-2 border-border border-t p-3 pb-[max(0.75rem,env(safe-area-inset-bottom))]\",\n className,\n )}\n />\n );\n },\n);\n\nexport const AnimatedSidebarGroup = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarGroup({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-group\"\n className={cn(\"flex w-full min-w-0 flex-col px-1 py-1.5\", className)}\n />\n );\n },\n);\n\nexport const AnimatedSidebarGroupLabel = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function AnimatedSidebarGroupLabel({ children, className, ...props }, forwardedRef) {\n const { collapsed } = useAnimatedSidebarPanel();\n\n return (\n <div\n {...props}\n ref={forwardedRef}\n aria-hidden={collapsed}\n data-slot=\"sidebar-group-label\"\n className={cn(\n \"mb-1 h-7 overflow-hidden px-2 font-medium text-[10px] text-muted-foreground uppercase tracking-[0.14em] transition-opacity\",\n collapsed ? \"opacity-0\" : \"opacity-100\",\n className,\n )}\n >\n {children}\n </div>\n );\n },\n);\n\nexport const AnimatedSidebarGroupContent = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement>\n>(function AnimatedSidebarGroupContent({ className, ...props }, forwardedRef) {\n return (\n <div\n {...props}\n ref={forwardedRef}\n data-slot=\"sidebar-group-content\"\n className={cn(\"w-full min-w-0\", className)}\n />\n );\n});\n\nexport const AnimatedSidebarMenu = forwardRef<HTMLUListElement, HTMLAttributes<HTMLUListElement>>(\n function AnimatedSidebarMenu({ children, className, ...props }, forwardedRef) {\n return (\n <SharedLayoutBg\n {...props}\n ref={forwardedRef as React.Ref<HTMLElement>}\n as=\"ul\"\n inset={0}\n pillClassName=\"rounded-xl bg-muted/70\"\n pillContainerClassName=\"inset-y-auto top-0 h-9\"\n data-slot=\"sidebar-menu\"\n className={cn(\"flex w-full min-w-0 list-none flex-col gap-0.5\", className)}\n >\n {children}\n </SharedLayoutBg>\n );\n },\n);\n\nexport const AnimatedSidebarMenuItem = forwardRef<HTMLLIElement, HTMLMotionProps<\"li\">>(\n function AnimatedSidebarMenuItem({ className, ...props }, forwardedRef) {\n return (\n <motion.li\n {...props}\n ref={forwardedRef}\n layout=\"position\"\n transition={SPRING_LAYOUT}\n data-slot=\"sidebar-menu-item\"\n className={cn(\"relative\", className)}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarMenuSubProps extends Omit<HTMLMotionProps<\"ul\">, \"children\"> {\n open: boolean;\n children?: ReactNode;\n}\n\nexport const AnimatedSidebarMenuSub = forwardRef<HTMLUListElement, AnimatedSidebarMenuSubProps>(\n function AnimatedSidebarMenuSub({ open, children, className, ...props }, forwardedRef) {\n const context = useAnimatedSidebar();\n const panel = useAnimatedSidebarPanel();\n\n return (\n <AnimatePresence initial={false} mode=\"popLayout\">\n {open && !panel.collapsed ? (\n <motion.ul\n {...props}\n ref={forwardedRef}\n key=\"sidebar-submenu\"\n variants={context.reduce ? undefined : SUBMENU_VARIANTS}\n initial={context.reduce ? false : \"closed\"}\n animate={context.reduce ? { opacity: 1 } : \"open\"}\n exit={context.reduce ? { opacity: 0 } : \"closed\"}\n transition={context.reduce ? { duration: 0.12 } : undefined}\n data-slot=\"sidebar-menu-sub\"\n className={cn(\n \"relative mt-1 ml-5 flex min-w-0 flex-col gap-0.5 border-border border-l pl-3\",\n className,\n )}\n >\n {children}\n </motion.ul>\n ) : null}\n </AnimatePresence>\n );\n },\n);\n\nexport const AnimatedSidebarMenuSubItem = forwardRef<HTMLLIElement, HTMLMotionProps<\"li\">>(\n function AnimatedSidebarMenuSubItem({ className, ...props }, forwardedRef) {\n return (\n <motion.li\n {...props}\n ref={forwardedRef}\n variants={SUBMENU_ITEM_VARIANTS}\n data-slot=\"sidebar-menu-sub-item\"\n className={cn(\"relative min-w-0\", className)}\n />\n );\n },\n);\n\nexport interface AnimatedSidebarMenuSubButtonProps {\n children: ReactNode;\n icon?: ReactNode;\n href?: string;\n isActive?: boolean;\n disabled?: boolean;\n closeOnSelect?: boolean;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\";\n rel?: string;\n onSelect?: () => void;\n className?: string;\n}\n\nexport function AnimatedSidebarMenuSubButton({\n children,\n icon,\n href,\n isActive = false,\n disabled = false,\n closeOnSelect = true,\n target,\n rel,\n onSelect,\n className,\n}: AnimatedSidebarMenuSubButtonProps) {\n const context = useAnimatedSidebar();\n\n const select = (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onSelect?.();\n if (context.isMobile && closeOnSelect) context.setOpenMobile(false);\n };\n\n const content = (\n <>\n <span aria-hidden=\"true\" className=\"grid size-4 shrink-0 place-items-center\">\n {icon ?? <span className=\"size-1 rounded-full bg-current\" />}\n </span>\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n </>\n );\n\n const interactiveClassName = cn(\n \"flex min-h-8 w-full min-w-0 items-center gap-2 rounded-lg px-2 text-left text-xs outline-none\",\n \"text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground\",\n \"focus-visible:bg-muted/70 focus-visible:ring-2 focus-visible:ring-ring\",\n isActive && \"bg-muted/70 text-foreground\",\n disabled && \"cursor-not-allowed opacity-40\",\n className,\n );\n\n return href ? (\n <motion.a\n href={href}\n target={target}\n rel={rel ?? (target === \"_blank\" ? \"noreferrer noopener\" : undefined)}\n aria-current={isActive ? \"page\" : undefined}\n aria-disabled={disabled || undefined}\n tabIndex={disabled ? -1 : undefined}\n onClick={select}\n whileTap={context.reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={interactiveClassName}\n >\n {content}\n </motion.a>\n ) : (\n <motion.button\n type=\"button\"\n disabled={disabled}\n aria-current={isActive ? \"page\" : undefined}\n onClick={select}\n whileTap={context.reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={interactiveClassName}\n >\n {content}\n </motion.button>\n );\n}\n\nexport interface AnimatedSidebarMenuButtonProps {\n children: ReactNode;\n icon?: ReactNode;\n badge?: ReactNode;\n href?: string;\n isActive?: boolean;\n ariaExpanded?: boolean;\n disabled?: boolean;\n closeOnSelect?: boolean;\n target?: \"_blank\" | \"_self\" | \"_parent\" | \"_top\";\n rel?: string;\n onSelect?: () => void;\n className?: string;\n}\n\nexport function AnimatedSidebarMenuButton({\n children,\n icon,\n badge,\n href,\n isActive = false,\n ariaExpanded,\n disabled = false,\n closeOnSelect,\n target,\n rel,\n onSelect,\n className,\n}: AnimatedSidebarMenuButtonProps) {\n const context = useAnimatedSidebar();\n const panel = useAnimatedSidebarPanel();\n const textLabel = typeof children === \"string\" ? children : undefined;\n\n const select = (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onSelect?.();\n const shouldCloseOnSelect = closeOnSelect ?? ariaExpanded === undefined;\n if (context.isMobile && shouldCloseOnSelect) {\n context.setOpenMobile(false);\n }\n // A submenu cannot render in the icon rail, so opening one from there\n // leaves its children unreachable — a pointer can still fall back to the\n // rail or the shortcut, a finger has nothing. Selecting a group unfolds\n // the panel that is about to hold it.\n if (ariaExpanded !== undefined && panel.collapsed && !context.isMobile) {\n context.setOpen(true);\n }\n };\n\n const content = (\n <>\n {isActive ? (\n <motion.span\n layoutId={context.layoutId}\n transition={context.reduce ? { duration: 0 } : SPRING_LAYOUT}\n className=\"absolute inset-0 rounded-xl bg-muted\"\n />\n ) : null}\n {icon ? (\n <span aria-hidden=\"true\" className=\"relative z-10 grid size-5 shrink-0 place-items-center\">\n {icon}\n </span>\n ) : null}\n <motion.span\n initial={false}\n animate={{\n opacity: panel.collapsed ? 0 : 1,\n x: panel.collapsed ? -4 : 0,\n }}\n transition={\n context.reduce\n ? REDUCED_TRANSITION\n : panel.collapsed\n ? LABEL_EXIT_TRANSITION\n : LABEL_ENTER_TRANSITION\n }\n aria-hidden={panel.collapsed}\n className={cn(\n \"relative z-10 min-w-0 flex-1 truncate\",\n panel.collapsed && \"pointer-events-none\",\n )}\n >\n {children}\n </motion.span>\n {badge && !panel.collapsed ? (\n <span className=\"relative z-10 shrink-0 text-muted-foreground text-xs\">{badge}</span>\n ) : null}\n {ariaExpanded !== undefined ? (\n <motion.span\n aria-hidden=\"true\"\n initial={false}\n animate={{\n opacity: panel.collapsed ? 0 : 1,\n rotate: ariaExpanded ? 90 : 0,\n x: panel.collapsed ? 4 : 0,\n }}\n transition={context.reduce ? { duration: 0 } : SPRING_LAYOUT}\n className=\"relative z-10 grid size-4 shrink-0 place-items-center text-muted-foreground\"\n >\n <ChevronRight className=\"size-3.5\" />\n </motion.span>\n ) : null}\n </>\n );\n\n const interactiveClassName = cn(\n \"relative flex min-h-9 w-full min-w-0 items-center gap-2.5 overflow-hidden rounded-xl px-3 text-left font-medium text-sm outline-none\",\n \"text-muted-foreground transition-colors hover:text-foreground\",\n \"focus-visible:bg-muted/70 focus-visible:ring-2 focus-visible:ring-ring\",\n isActive && \"text-foreground\",\n disabled && \"cursor-not-allowed opacity-40\",\n className,\n );\n\n return href ? (\n <motion.a\n href={href}\n target={target}\n rel={rel ?? (target === \"_blank\" ? \"noreferrer noopener\" : undefined)}\n aria-current={isActive ? \"page\" : undefined}\n aria-expanded={ariaExpanded}\n aria-disabled={disabled || undefined}\n aria-label={panel.collapsed ? textLabel : undefined}\n title={panel.collapsed ? textLabel : undefined}\n tabIndex={disabled ? -1 : undefined}\n onClick={select}\n whileTap={context.reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={interactiveClassName}\n >\n {content}\n </motion.a>\n ) : (\n <motion.button\n type=\"button\"\n disabled={disabled}\n aria-current={isActive ? \"page\" : undefined}\n aria-expanded={ariaExpanded}\n aria-label={panel.collapsed ? textLabel : undefined}\n title={panel.collapsed ? textLabel : undefined}\n onClick={select}\n whileTap={context.reduce || disabled ? undefined : { scale: 0.98 }}\n transition={SPRING_PRESS}\n className={interactiveClassName}\n >\n {content}\n </motion.button>\n );\n}\n"],"mappings":";;;;;;;;;;AAoCA,MAAM,eAAe;AACrB,MAAM,4BAA4B;AAElC,MAAM,mBAAmB;CACvB,UAAU;CACV,MAAM;AACR;AAKA,MAAM,2BAA2B;CAC/B,MAAM;CACN,WAAW;CACX,SAAS;CACT,MAAM;AACR;AAEA,MAAM,yBAAyB;CAC7B,UAAU;CACV,OAAO;CACP,MAAM;AACR;AAEA,MAAM,wBAAwB;CAC5B,UAAU;CACV,MAAM;AACR;AAEA,MAAM,qBAAqB;CACzB,UA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CAAA;AAEnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment-upload.d.ts","names":[],"sources":["../../../src/components/motion/attachment-upload.tsx"],"mappings":";
|
|
1
|
+
{"version":3,"file":"attachment-upload.d.ts","names":[],"sources":["../../../src/components/motion/attachment-upload.tsx"],"mappings":";KA0BY;KACA;KACA;KAEA;EACV;EACA;EACA,MAAM;EACN;EACA;EACA;EACA;EACA;EACA,SAAS;EACT;EACA,OAAO;;KAGG;EACV;EACA;EACA;;UAGe;EACf,QAAQ;EACR,eAAe;EACf,iBAAiB,OAAO;EACxB,gBAAgB,OAAO,wBAAwB,OAAO;EACtD,mBAAmB,OAAO,QAAQ,QAAQ;EAC1C,YAAY,MAAM;EAClB,WAAW,MAAM;EACjB;EACA,iBAAiB,MAAM;EACvB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,aAAa;;iBAskBC,mBACd,OACA,cACA,eACA,cACA,iBACA,UACA,SACA,WACA,eACA,QACA,UACA,UACA,aACA,UACA,OACA,aACA,kBACA,WACA,cACC,wCAAqB,IAAA"}
|