@kumix/ui 0.3.17 → 0.3.18
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 +3 -2
- package/dist/components/agents/agent-activity/activity-row.js +1 -1
- package/dist/components/agents/agent-activity/index.js +1 -1
- package/dist/components/agents/agent-code.js +1 -1
- package/dist/components/agents/ai-sidebar.js +1 -1
- package/dist/components/agents/approval-card/index.js +1 -1
- package/dist/components/agents/citations.js +1 -1
- package/dist/components/agents/code-block.js +1 -1
- package/dist/components/agents/file-diff.js +1 -1
- package/dist/components/agents/image-generation.js +1 -1
- package/dist/components/agents/message-bubble.js +1 -1
- package/dist/components/agents/prompt-input.js +1 -1
- package/dist/components/agents/streaming-response.js +1 -1
- package/dist/components/agents/todo-list.js +1 -1
- package/dist/components/agents/tool-approval.js +1 -1
- package/dist/components/agents/tool-result.js +1 -1
- package/dist/components/custom/confirm-dialog.js +1 -1
- package/dist/components/motion/adaptive-stepper.js +1 -1
- package/dist/components/motion/animated-badge.js +1 -1
- package/dist/components/motion/animated-sidebar.js +1 -1
- package/dist/components/motion/animated-sidebar.js.map +1 -1
- package/dist/components/motion/animated-toast-stack.js +1 -1
- package/dist/components/motion/attachment-upload.d.ts.map +1 -1
- package/dist/components/motion/attachment-upload.js +1 -1
- package/dist/components/motion/attachment-upload.js.map +1 -1
- package/dist/components/motion/availability-scheduler/copy-menu.js +1 -1
- package/dist/components/motion/availability-scheduler/day-row.js +2 -2
- package/dist/components/motion/availability-scheduler/index.js +1 -1
- package/dist/components/motion/bloom-menu.js +1 -1
- package/dist/components/motion/bottom-sheet.js.map +1 -1
- package/dist/components/motion/bouncy-accordion.js +1 -1
- package/dist/components/motion/breadcrumb.d.ts +37 -0
- package/dist/components/motion/breadcrumb.d.ts.map +1 -0
- package/dist/components/motion/breadcrumb.js +259 -0
- package/dist/components/motion/breadcrumb.js.map +1 -0
- package/dist/components/motion/button/stateful.js +1 -1
- package/dist/components/motion/card-folder.js +1 -1
- package/dist/components/motion/center-morph-modal.js +1 -1
- package/dist/components/motion/color-selector.d.ts +28 -0
- package/dist/components/motion/color-selector.d.ts.map +1 -0
- package/dist/components/motion/color-selector.js +97 -0
- package/dist/components/motion/color-selector.js.map +1 -0
- package/dist/components/motion/combobox/list.js +1 -1
- package/dist/components/motion/combobox/trigger.js +1 -1
- package/dist/components/motion/command-palette.js +1 -1
- package/dist/components/motion/command-palette.js.map +1 -1
- package/dist/components/motion/context-menu.js +1 -1
- package/dist/components/motion/drawer.js.map +1 -1
- package/dist/components/motion/feedback-widget.js +1 -1
- package/dist/components/motion/file-tree.js +1 -1
- package/dist/components/motion/file-upload.js +1 -1
- package/dist/components/motion/infinite-masonry.js +1 -1
- package/dist/components/motion/morphing-modal.js.map +1 -1
- package/dist/components/motion/morphing-search.js +1 -1
- package/dist/components/motion/morphing-search.js.map +1 -1
- package/dist/components/motion/morphing-tabs.js +1 -1
- package/dist/components/motion/multi-select/list.js +1 -1
- package/dist/components/motion/multi-select/trigger.js +1 -1
- package/dist/components/motion/notification-stack.js +1 -1
- package/dist/components/motion/overflow-actions.js +1 -1
- package/dist/components/motion/popover-morph.d.ts +1 -1
- package/dist/components/motion/popover-morph.d.ts.map +1 -1
- package/dist/components/motion/popover-morph.js +50 -22
- package/dist/components/motion/popover-morph.js.map +1 -1
- package/dist/components/motion/project-folder.js +1 -1
- package/dist/components/motion/project-folder.js.map +1 -1
- package/dist/components/motion/select-morph.js +1 -1
- package/dist/components/motion/select.js +1 -1
- package/dist/components/motion/signup-form.js +1 -1
- package/dist/components/motion/table/row-handle.js +1 -1
- package/dist/components/motion/table/table-header.js +1 -1
- package/dist/components/motion/tabs.js +1 -1
- package/dist/components/motion/theme-toggle.js +1 -1
- package/dist/components/motion/tooltip/positioner.d.ts +33 -0
- package/dist/components/motion/tooltip/positioner.d.ts.map +1 -0
- package/dist/components/motion/tooltip/positioner.js +3 -0
- package/dist/components/motion/tooltip-surface.d.ts +5 -4
- package/dist/components/motion/tooltip-surface.d.ts.map +1 -1
- package/dist/components/motion/tooltip-surface.js +22 -73
- package/dist/components/motion/tooltip-surface.js.map +1 -1
- package/dist/components/motion/tooltip.d.ts +3 -1
- package/dist/components/motion/tooltip.d.ts.map +1 -1
- package/dist/components/motion/tooltip.js +54 -103
- package/dist/components/motion/tooltip.js.map +1 -1
- package/dist/components/reui/alert.js +1 -1
- package/dist/components/reui/autocomplete.js +1 -1
- package/dist/components/reui/badge.d.ts +2 -2
- package/dist/components/reui/cascader/cascader-columns.js +1 -1
- package/dist/components/reui/cascader/cascader-footer.js +1 -1
- package/dist/components/reui/cascader/cascader-item.js +1 -1
- package/dist/components/reui/cascader/cascader-nav.js +1 -1
- package/dist/components/reui/cascader/cascader.js +1 -1
- package/dist/components/reui/data-grid/data-grid-column-filter.js +1 -1
- package/dist/components/reui/data-grid/data-grid-column-header.js +1 -1
- package/dist/components/reui/data-grid/data-grid-pagination.js +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +1 -1
- package/dist/components/reui/data-grid/data-grid-table-dnd.js +1 -1
- package/dist/components/reui/data-grid/data-grid-table.js +1 -1
- package/dist/components/reui/date-selector.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-event.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-month-view.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-nav.js +1 -1
- package/dist/components/reui/filters/filters-advanced.js +1 -1
- package/dist/components/reui/filters/filters-builder.js +1 -1
- package/dist/components/reui/filters/filters-chip.js +1 -1
- package/dist/components/reui/filters/filters-editors.js +1 -1
- package/dist/components/reui/filters/filters.js +1 -1
- package/dist/components/reui/frame.d.ts +2 -2
- package/dist/components/reui/frame.js +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-view.js +1 -1
- package/dist/components/reui/icon-tile.d.ts +2 -2
- package/dist/components/reui/kanban.d.ts.map +1 -1
- package/dist/components/reui/kanban.js +30 -1
- package/dist/components/reui/kanban.js.map +1 -1
- package/dist/components/reui/number-field.js +1 -1
- package/dist/components/reui/phone-input.js +1 -1
- package/dist/components/reui/rating.js +1 -1
- package/dist/components/reui/tree.js +1 -1
- package/dist/components/ui/accordion.js +1 -1
- package/dist/components/ui/alert-dialog.js +1 -1
- package/dist/components/ui/alert.js +1 -1
- package/dist/components/ui/attachment.d.ts +2 -2
- package/dist/components/ui/attachment.js +1 -1
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/breadcrumb.js +1 -1
- package/dist/components/ui/bubble.d.ts +1 -1
- package/dist/components/ui/bubble.js +1 -1
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button-group.js +1 -1
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/calendar.js +1 -1
- package/dist/components/ui/carousel.js +1 -1
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/combobox.js +1 -1
- package/dist/components/ui/command.js +1 -1
- package/dist/components/ui/context-menu.js +1 -1
- package/dist/components/ui/dialog.js +1 -1
- package/dist/components/ui/dropdown-menu.js +1 -1
- package/dist/components/ui/empty.js +1 -1
- package/dist/components/ui/field.d.ts +1 -1
- package/dist/components/ui/field.js +1 -1
- package/dist/components/ui/input-group.d.ts +1 -1
- package/dist/components/ui/input-group.js +1 -1
- package/dist/components/ui/input-otp.js +1 -1
- package/dist/components/ui/item.d.ts +3 -3
- package/dist/components/ui/item.js +1 -1
- package/dist/components/ui/marker.d.ts +1 -1
- package/dist/components/ui/marker.js +1 -1
- package/dist/components/ui/menubar.js +1 -1
- package/dist/components/ui/message-scroller.js +1 -1
- package/dist/components/ui/native-select.js +1 -1
- package/dist/components/ui/navigation-menu.js +1 -1
- package/dist/components/ui/pagination.js +1 -1
- package/dist/components/ui/questionnaire.js +1 -1
- package/dist/components/ui/select.js +1 -1
- package/dist/components/ui/sheet.js +1 -1
- package/dist/components/ui/sidebar.d.ts +1 -1
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/spinner.js +1 -1
- package/dist/components/ui/tabs.d.ts +1 -1
- package/dist/components/ui/tabs.js +1 -1
- package/dist/components/ui/toast.js +1 -1
- package/dist/components/ui/toggle.d.ts +1 -1
- package/dist/components/ui/toggle.js +1 -1
- package/dist/{copy-menu-TIKvPaAZ.js → copy-menu-C5GaT4Z-.js} +2 -2
- package/dist/{copy-menu-TIKvPaAZ.js.map → copy-menu-C5GaT4Z-.js.map} +1 -1
- package/dist/positioner-3mCqiebN.js +204 -0
- package/dist/positioner-3mCqiebN.js.map +1 -0
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ This package is a maintained distribution: imports rewritten for monorepo (`@kum
|
|
|
30
30
|
bun add @kumix/ui @kumix/utils
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
Install peers (see `package.json` → `peerDependencies`). Six peers are **always required**: `react`, `@kumix/utils`, `@base-ui/react`, `class-variance-authority`, `lucide-react`, `motion`. The remaining
|
|
33
|
+
Install peers (see `package.json` → `peerDependencies`). Six peers are **always required**: `react`, `@kumix/utils`, `@base-ui/react`, `class-variance-authority`, `lucide-react`, `motion`. The remaining 22 are **optional** via `peerDependenciesMeta` — install only what your imported components need.
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
36
|
bun add @base-ui/react class-variance-authority lucide-react motion react @kumix/utils
|
|
@@ -54,6 +54,7 @@ bun add @base-ui/react class-variance-authority lucide-react motion react @kumix
|
|
|
54
54
|
| `react-resizable-panels` | resizable |
|
|
55
55
|
| `@headless-tree/core` | tree |
|
|
56
56
|
| `shiki` | `agents/code-block`, `reui/code-block` |
|
|
57
|
+
| `@floating-ui/dom` | `motion/tooltip` |
|
|
57
58
|
|
|
58
59
|
## Import paths
|
|
59
60
|
|
|
@@ -136,7 +137,7 @@ Extended patterns. Preview: [reui.io](https://reui.io/docs).
|
|
|
136
137
|
|
|
137
138
|
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.
|
|
138
139
|
|
|
139
|
-
`action-swap` (4 variants: base, blur, cascade, roll) · `adaptive-stepper` (+ `Liquid` easing backdrop) · `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, magnetic, metallic, stateful, `ButtonLink`) · `card-folder` · `center-morph-modal` · `checkbox` · `chromatic-text-reveal` · `combobox` + `combobox/*` (trigger, list, content, context) · `command-palette` · `context-menu` · `cylinder-carousel` · `digit-swap` · `dock` · `drawer` · `dynamic-island` · `expandable-action-bar` · `expandable-control` · `expandable-tabs` · `expanding-arrow-button` · `feedback-widget` · `file-tree` · `file-upload` · `hold-action-button` · `infinite-masonry` · `input` (`reserveErrorLine` reserves one validation line) · `liquid` (gooey SVG backdrop: `Liquid`, `LiquidItem`) · `loader` · `magnetic` · `marquee` · `morphing-modal` · `morphing-search` · `morphing-tabs` · `multi-select/*` (composable: trigger, list, content, context — entry `multi-select`) · `not-found/*` (glitch, magnetic, spotlight, stacked, terminal) · `notification-stack` · `number-ticker` · `otp-input` · `overflow-actions` · `parallax` · `popover` · `popover-morph` · `popover-position` (shared popover positioning helper) · `preview-rail` · `project-folder` · `pull-to-refresh` · `radio` · `range-slider` (6 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` (controlled + uncontrolled; `anchorRef`/`anchorPoint` for chart integration) · `tooltip-surface` (shared animated surface) · `wheel-picker`
|
|
140
|
+
`action-swap` (4 variants: base, blur, cascade, roll) · `adaptive-stepper` (+ `Liquid` easing backdrop) · `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` · `breadcrumb` · `button/*` (base, magnetic, metallic, stateful, `ButtonLink`) · `card-folder` · `center-morph-modal` · `checkbox` · `chromatic-text-reveal` · `color-selector` · `combobox` + `combobox/*` (trigger, list, content, context) · `command-palette` · `context-menu` · `cylinder-carousel` · `digit-swap` · `dock` · `drawer` · `dynamic-island` · `expandable-action-bar` · `expandable-control` · `expandable-tabs` · `expanding-arrow-button` · `feedback-widget` · `file-tree` · `file-upload` · `hold-action-button` · `infinite-masonry` · `input` (`reserveErrorLine` reserves one validation line) · `liquid` (gooey SVG backdrop: `Liquid`, `LiquidItem`) · `loader` · `magnetic` · `marquee` · `morphing-modal` · `morphing-search` · `morphing-tabs` · `multi-select/*` (composable: trigger, list, content, context — entry `multi-select`) · `not-found/*` (glitch, magnetic, spotlight, stacked, terminal) · `notification-stack` · `number-ticker` · `otp-input` · `overflow-actions` · `parallax` · `popover` · `popover-morph` · `popover-position` (shared popover positioning helper) · `preview-rail` · `project-folder` · `pull-to-refresh` · `radio` · `range-slider` (6 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` (controlled + uncontrolled; `followCursor`; `@floating-ui/dom` positioning; `anchorRef`/`anchorPoint` for chart integration) · `tooltip-surface` (shared animated surface) · `wheel-picker`
|
|
140
141
|
|
|
141
142
|
### beUI — AI Agents (`components/agents`)
|
|
142
143
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { EASE_OUT, SPRING_LAYOUT } from "../../../lib/ease.js";
|
|
3
3
|
import { cn } from "@kumix/utils";
|
|
4
|
-
import { Check, Circle, FileText, Globe2, ImageIcon, MessageSquare, PencilLine, Search, Sparkles, SquareTerminal, Wrench } from "lucide-react";
|
|
5
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
5
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
6
|
+
import { Check, Circle, FileText, Globe2, ImageIcon, MessageSquare, PencilLine, Search, Sparkles, SquareTerminal, Wrench } from "lucide-react";
|
|
7
7
|
//#region src/components/agents/agent-activity/activity-row.tsx
|
|
8
8
|
function StepRow({ item }) {
|
|
9
9
|
const state = item.status ?? "complete";
|
|
@@ -5,9 +5,9 @@ import { ActivityRow } from "./activity-row.js";
|
|
|
5
5
|
import { ThinkingShimmer } from "../loading-states/thinking-shimmer.js";
|
|
6
6
|
import { useCallback, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
7
7
|
import { cn } from "@kumix/utils";
|
|
8
|
-
import { ChevronDown } from "lucide-react";
|
|
9
8
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
9
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
10
|
+
import { ChevronDown } from "lucide-react";
|
|
11
11
|
//#region src/components/agents/agent-activity/index.tsx
|
|
12
12
|
function formatDuration(duration) {
|
|
13
13
|
const seconds = Math.max(0, Math.round(duration));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment, useEffect, useState } from "react";
|
|
3
3
|
import { cn } from "@kumix/utils";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
4
|
import { createHighlighter } from "shiki";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/agents/agent-code.tsx
|
|
7
7
|
const LIGHT_THEME = "github-light-high-contrast";
|
|
8
8
|
const DARK_THEME = "github-dark-high-contrast";
|
|
@@ -4,9 +4,9 @@ import { EASE_OUT, SPRING_LAYOUT } from "../../lib/ease.js";
|
|
|
4
4
|
import { MorphPopover, MorphPopoverContent, MorphPopoverTrigger } from "../motion/popover-morph.js";
|
|
5
5
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
6
6
|
import { cn } from "@kumix/utils";
|
|
7
|
-
import { ArrowDown, ArrowUp, Bookmark, FileText, Folder, FolderInput, FolderOpen, MoreHorizontal, Pencil, Undo2 } from "lucide-react";
|
|
8
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
8
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
9
|
+
import { ArrowDown, ArrowUp, Bookmark, FileText, Folder, FolderInput, FolderOpen, MoreHorizontal, Pencil, Undo2 } from "lucide-react";
|
|
10
10
|
//#region src/components/agents/ai-sidebar.tsx
|
|
11
11
|
const ROW_REVEAL = {
|
|
12
12
|
duration: .16,
|
|
@@ -9,9 +9,9 @@ import { Input } from "../../motion/input.js";
|
|
|
9
9
|
import { RadioGroup, RadioGroupItem } from "../../motion/radio.js";
|
|
10
10
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
11
11
|
import { cn } from "@kumix/utils";
|
|
12
|
-
import { ArrowLeft, ArrowRight, Check, CircleHelp, LoaderCircle, MessageSquareText, X } from "lucide-react";
|
|
13
12
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
14
13
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
14
|
+
import { ArrowLeft, ArrowRight, Check, CircleHelp, LoaderCircle, MessageSquareText, X } from "lucide-react";
|
|
15
15
|
//#region src/components/agents/approval-card/index.tsx
|
|
16
16
|
const EMPTY_ANSWER = {
|
|
17
17
|
selected: [],
|
|
@@ -4,9 +4,9 @@ import { EASE_OUT, SPRING_LAYOUT, SPRING_SWAP } from "../../lib/ease.js";
|
|
|
4
4
|
import { AgentDisclosure } from "./agent-disclosure.js";
|
|
5
5
|
import { useCallback, useId, useState } from "react";
|
|
6
6
|
import { cn } from "@kumix/utils";
|
|
7
|
-
import { BookOpenText, ChevronDown, ExternalLink, Globe2 } from "lucide-react";
|
|
8
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
8
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
9
|
+
import { BookOpenText, ChevronDown, ExternalLink, Globe2 } from "lucide-react";
|
|
10
10
|
//#region src/components/agents/citations.tsx
|
|
11
11
|
function citationTargetId(prefix, citationId) {
|
|
12
12
|
return `${prefix}-${citationId.replace(/[^a-zA-Z0-9_-]/g, "-")}`;
|
|
@@ -3,9 +3,9 @@ import { SPRING_PRESS } from "../../lib/ease.js";
|
|
|
3
3
|
import { AgentCodeLine, useAgentCodeTokens } from "./agent-code.js";
|
|
4
4
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
5
5
|
import { cn } from "@kumix/utils";
|
|
6
|
-
import { Check, Copy, FileCode2, LoaderCircle } from "lucide-react";
|
|
7
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
7
|
import { motion, useReducedMotion } from "motion/react";
|
|
8
|
+
import { Check, Copy, FileCode2, LoaderCircle } from "lucide-react";
|
|
9
9
|
//#region src/components/agents/code-block.tsx
|
|
10
10
|
function CodeBlock({ code, language = "typescript", filename, status = "complete", showLineNumbers = true, highlightLines = [], maxHeight = 280, wrap = false, copyable = true, onCopy, className }) {
|
|
11
11
|
const reduce = useReducedMotion() ?? false;
|
|
@@ -4,9 +4,9 @@ import { AgentCodeLine, useAgentCodeTokens } from "./agent-code.js";
|
|
|
4
4
|
import { AgentDisclosure } from "./agent-disclosure.js";
|
|
5
5
|
import { useCallback, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
6
6
|
import { cn } from "@kumix/utils";
|
|
7
|
-
import { Check, ChevronDown, Copy, FileCode2, LoaderCircle } from "lucide-react";
|
|
8
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
8
|
import { motion, useReducedMotion } from "motion/react";
|
|
9
|
+
import { Check, ChevronDown, Copy, FileCode2, LoaderCircle } from "lucide-react";
|
|
10
10
|
//#region src/components/agents/file-diff.tsx
|
|
11
11
|
function ChangeCount({ value, type }) {
|
|
12
12
|
if (!value) return null;
|
|
@@ -3,9 +3,9 @@ import { useHoverCapable } from "../../hooks/use-hover-capable.js";
|
|
|
3
3
|
import { EASE_IN_OUT, EASE_OUT, SPRING_PRESS } from "../../lib/ease.js";
|
|
4
4
|
import { useEffect, useRef } from "react";
|
|
5
5
|
import { cn } from "@kumix/utils";
|
|
6
|
-
import { Check, CircleAlert, RotateCcw } from "lucide-react";
|
|
7
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
7
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
8
|
+
import { Check, CircleAlert, RotateCcw } from "lucide-react";
|
|
9
9
|
//#region src/components/agents/image-generation.tsx
|
|
10
10
|
const STATUS_TEXT = {
|
|
11
11
|
queued: "Waiting to generate",
|
|
@@ -3,9 +3,9 @@ import { EASE_OUT, SPRING_LAYOUT, SPRING_SWAP } from "../../lib/ease.js";
|
|
|
3
3
|
import { MessageSideContext } from "./message-context.js";
|
|
4
4
|
import { cloneElement, createContext, useCallback, useContext, useId, useState } from "react";
|
|
5
5
|
import { cn } from "@kumix/utils";
|
|
6
|
-
import { ChevronDown } from "lucide-react";
|
|
7
6
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
7
|
import { motion, useReducedMotion } from "motion/react";
|
|
8
|
+
import { ChevronDown } from "lucide-react";
|
|
9
9
|
//#region src/components/agents/message-bubble.tsx
|
|
10
10
|
const MessageBubbleContext = createContext({
|
|
11
11
|
animateIn: true,
|
|
@@ -6,9 +6,9 @@ import "../motion/button/index.js";
|
|
|
6
6
|
import { Select, SelectContent, SelectItem, SelectTrigger } from "../motion/select.js";
|
|
7
7
|
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
8
8
|
import { cn } from "@kumix/utils";
|
|
9
|
-
import { ArrowUp, Plus, Square } from "lucide-react";
|
|
10
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
10
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
11
|
+
import { ArrowUp, Plus, Square } from "lucide-react";
|
|
12
12
|
//#region src/components/agents/prompt-input.tsx
|
|
13
13
|
function PromptInput({ value, defaultValue = "", onValueChange, models = [], model, defaultModel, onModelChange, actions = [], onAction, onSubmit, loading = false, onStop, minRows = 2, maxRows = 8, leadingAction, className, disabled, placeholder = "Ask the agent to do something…", "aria-label": ariaLabel = "Prompt", onKeyDown, ...textareaProps }) {
|
|
14
14
|
const reduce = useReducedMotion() ?? false;
|
|
@@ -4,9 +4,9 @@ import { AgentDisclosure } from "./agent-disclosure.js";
|
|
|
4
4
|
import { CitationList, CitationStack } from "./citations.js";
|
|
5
5
|
import { useCallback, useEffect, useId, useRef, useState } from "react";
|
|
6
6
|
import { cn } from "@kumix/utils";
|
|
7
|
-
import { Check, ChevronDown, Copy, RotateCcw, ThumbsDown, ThumbsUp } from "lucide-react";
|
|
8
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
8
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
9
|
+
import { Check, ChevronDown, Copy, RotateCcw, ThumbsDown, ThumbsUp } from "lucide-react";
|
|
10
10
|
//#region src/components/agents/streaming-response.tsx
|
|
11
11
|
function ResponseAction({ label, active = false, onClick, children }) {
|
|
12
12
|
const reduce = useReducedMotion() ?? false;
|
|
@@ -4,9 +4,9 @@ import { AgentDisclosure } from "./agent-disclosure.js";
|
|
|
4
4
|
import { ActionSwapRollText } from "../motion/action-swap-roll.js";
|
|
5
5
|
import { useCallback, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
6
6
|
import { cn } from "@kumix/utils";
|
|
7
|
-
import { ChevronDown, ListTodo } from "lucide-react";
|
|
8
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
8
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
9
|
+
import { ChevronDown, ListTodo } from "lucide-react";
|
|
10
10
|
//#region src/components/agents/todo-list.tsx
|
|
11
11
|
function statusLabel(status) {
|
|
12
12
|
if (status === "in-progress") return "In progress";
|
|
@@ -4,9 +4,9 @@ import { AgentCode } from "./agent-code.js";
|
|
|
4
4
|
import { AgentDisclosure } from "./agent-disclosure.js";
|
|
5
5
|
import { useCallback, useEffect, useId, useRef, useState } from "react";
|
|
6
6
|
import { cn } from "@kumix/utils";
|
|
7
|
-
import { Check, ChevronDown, CircleAlert, LoaderCircle, ShieldCheck, X } from "lucide-react";
|
|
8
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
8
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
9
|
+
import { Check, ChevronDown, CircleAlert, LoaderCircle, ShieldCheck, X } from "lucide-react";
|
|
10
10
|
//#region src/components/agents/tool-approval.tsx
|
|
11
11
|
function getStatusCopy(status) {
|
|
12
12
|
if (status === "approving") return "Approving";
|
|
@@ -5,9 +5,9 @@ import { AgentDisclosure } from "./agent-disclosure.js";
|
|
|
5
5
|
import { ActionSwapRollText } from "../motion/action-swap-roll.js";
|
|
6
6
|
import { useCallback, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
7
7
|
import { cn } from "@kumix/utils";
|
|
8
|
-
import { Ban, Braces, Check, ChevronDown, CircleCheck, CircleX, Copy, LoaderCircle, RotateCcw, SquareTerminal, Wrench } from "lucide-react";
|
|
9
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
9
|
import { motion, useReducedMotion } from "motion/react";
|
|
10
|
+
import { Ban, Braces, Check, ChevronDown, CircleCheck, CircleX, Copy, LoaderCircle, RotateCcw, SquareTerminal, Wrench } from "lucide-react";
|
|
11
11
|
//#region src/components/agents/tool-result.tsx
|
|
12
12
|
function getStatusLabel(status) {
|
|
13
13
|
if (status === "running") return "Running";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogMedia, AlertDialogTitle } from "../ui/alert-dialog.js";
|
|
3
3
|
import { Spinner } from "../ui/spinner.js";
|
|
4
|
-
import { CircleAlertIcon, ShieldQuestionMarkIcon } from "lucide-react";
|
|
5
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { CircleAlertIcon, ShieldQuestionMarkIcon } from "lucide-react";
|
|
6
6
|
//#region src/components/custom/confirm-dialog.tsx
|
|
7
7
|
function ConfirmDialog({ open, onOpenChange, onConfirm, title, description, confirmText, cancelText, loading = false }) {
|
|
8
8
|
return /* @__PURE__ */ jsx(AlertDialog, {
|
|
@@ -3,9 +3,9 @@ import { EASE_OUT, SPRING_PRESS } from "../../lib/ease.js";
|
|
|
3
3
|
import { Liquid, LiquidItem } from "./liquid.js";
|
|
4
4
|
import { createContext, useCallback, useContext, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
5
5
|
import { cn } from "@kumix/utils";
|
|
6
|
-
import { Minus, Plus } from "lucide-react";
|
|
7
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
7
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
8
|
+
import { Minus, Plus } from "lucide-react";
|
|
9
9
|
//#region src/components/motion/adaptive-stepper.tsx
|
|
10
10
|
const STEPPER_LIQUID_TRANSITION = {
|
|
11
11
|
duration: 600,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { EASE_OUT } from "../../lib/ease.js";
|
|
3
3
|
import { cn } from "@kumix/utils";
|
|
4
|
-
import { AlertTriangle, Check, Circle, Info, LoaderCircle, X } from "lucide-react";
|
|
5
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
5
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
6
|
+
import { AlertTriangle, Check, Circle, Info, LoaderCircle, X } from "lucide-react";
|
|
7
7
|
//#region src/components/motion/animated-badge.tsx
|
|
8
8
|
const STATUS_CLASS = {
|
|
9
9
|
neutral: "border-border bg-card text-muted-foreground",
|
|
@@ -3,9 +3,9 @@ import { EASE_DRAWER, EASE_OUT, SPRING_LAYOUT, SPRING_PRESS } from "../../lib/ea
|
|
|
3
3
|
import { SharedLayoutBg } from "./shared-layout-bg.js";
|
|
4
4
|
import { createContext, createElement, forwardRef, useCallback, useContext, useEffect, useId, useRef, useState, useSyncExternalStore } from "react";
|
|
5
5
|
import { cn } from "@kumix/utils";
|
|
6
|
-
import { ChevronRight } from "lucide-react";
|
|
7
6
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
7
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
8
|
+
import { ChevronRight } from "lucide-react";
|
|
9
9
|
import { createPortal } from "react-dom";
|
|
10
10
|
//#region src/components/motion/animated-sidebar.tsx
|
|
11
11
|
const MOBILE_QUERY = "(max-width: 767px)";
|
|
@@ -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 // 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 // transparent edge-spanning one. See tests/fixed-overlay-edge-sampling.test.tsx.\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,M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V,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 // transparent edge-spanning one.\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,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;C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M,YAAY,IAAI;IAC/B,QAAQ,eAAe,KAAK;IAC5B,GAAG,MAAM,YAAY,IAAI;GAC3B;GACA,YAAY,QAAQ,SAAS,EAAE,UAAU,EAAE,IAAI;GAC/C,WAAU;GAEV,UAAA,oBAAC,cAAD,EAAc,WAAU,WAAY,CAAA;EACzB,CAAA,IACX;CACJ,EAAA,CAAA;CAGJ,MAAM,uBAAuB,GAC3B,wIACA,iEACA,0EACA,YAAY,mBACZ,YAAY,iCACZ,SACF;CAEA,OAAO,OACL,oBAAC,OAAO,GAAR;EACQ;EACE;EACR,KAAK,QAAQ,WAAW,WAAW,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"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { EASE_OUT } from "../../lib/ease.js";
|
|
3
3
|
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { cn } from "@kumix/utils";
|
|
5
|
-
import { AlertCircle, Bell, Check, Info, LoaderCircle, X } from "lucide-react";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
6
|
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
7
|
+
import { AlertCircle, Bell, Check, Info, LoaderCircle, X } from "lucide-react";
|
|
8
8
|
import { createPortal } from "react-dom";
|
|
9
9
|
//#region src/components/motion/animated-toast-stack.tsx
|
|
10
10
|
const STACK_SPRING = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment-upload.d.ts","names":[],"sources":["../../../src/components/motion/attachment-upload.tsx"],"mappings":";YA0BY;YACA;YACA;YAEA;EACV;EACA;EACA,MAAM;EACN;EACA;EACA;EACA;EACA;EACA,SAAS;EACT;EACA,OAAO;;YAGG;EACV;EACA;EACA;;iBAGe;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;;
|
|
1
|
+
{"version":3,"file":"attachment-upload.d.ts","names":[],"sources":["../../../src/components/motion/attachment-upload.tsx"],"mappings":";YA0BY;YACA;YACA;YAEA;EACV;EACA;EACA,MAAM;EACN;EACA;EACA;EACA;EACA;EACA,SAAS;EACT;EACA,OAAO;;YAGG;EACV;EACA;EACA;;iBAGe;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;;wBAukBC,mBACd,OACA,cACA,eACA,cACA,iBACA,UACA,SACA,WACA,eACA,QACA,UACA,UACA,aACA,UACA,OACA,aACA,kBACA,WACA,cACC,wCAAqB,IAAA"}
|
|
@@ -4,9 +4,9 @@ import { t as PresenceGate } from "../../presence-gate-BekdC4Bo.js";
|
|
|
4
4
|
import { Tooltip } from "./tooltip.js";
|
|
5
5
|
import { useCallback, useEffect, useId, useRef, useState } from "react";
|
|
6
6
|
import { cn } from "@kumix/utils";
|
|
7
|
-
import { AlertCircle, Check, ExternalLink, FileImage, Link, LoaderCircle, Mic, Paperclip, Pause, Play, RotateCcw, Upload, X } from "lucide-react";
|
|
8
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
8
|
import { AnimatePresence, LayoutGroup, motion, useReducedMotion } from "motion/react";
|
|
9
|
+
import { AlertCircle, Check, ExternalLink, FileImage, Link, LoaderCircle, Mic, Paperclip, Pause, Play, RotateCcw, Upload, X } from "lucide-react";
|
|
10
10
|
import { createPortal } from "react-dom";
|
|
11
11
|
//#region src/components/motion/attachment-upload.tsx
|
|
12
12
|
const ITEM_TRANSITION = {
|