@web-my-money/primitives 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/dist/accordion/index.d.mts +9 -0
  2. package/dist/accordion/index.d.ts +9 -0
  3. package/dist/accordion/index.js +99 -0
  4. package/dist/accordion/index.mjs +14 -0
  5. package/dist/alert-dialog/index.d.mts +22 -0
  6. package/dist/alert-dialog/index.d.ts +22 -0
  7. package/dist/alert-dialog/index.js +206 -0
  8. package/dist/alert-dialog/index.mjs +29 -0
  9. package/dist/avatar/index.d.mts +23 -0
  10. package/dist/avatar/index.d.ts +23 -0
  11. package/dist/avatar/index.js +133 -0
  12. package/dist/avatar/index.mjs +10 -0
  13. package/dist/badge/index.d.mts +15 -0
  14. package/dist/badge/index.d.ts +15 -0
  15. package/dist/badge/index.js +96 -0
  16. package/dist/badge/index.mjs +10 -0
  17. package/dist/breadcrumb/index.d.mts +20 -0
  18. package/dist/breadcrumb/index.d.ts +20 -0
  19. package/dist/breadcrumb/index.js +126 -0
  20. package/dist/breadcrumb/index.mjs +20 -0
  21. package/dist/button/index.d.mts +12 -0
  22. package/dist/button/index.d.ts +12 -0
  23. package/dist/button/index.js +88 -0
  24. package/dist/button/index.mjs +10 -0
  25. package/dist/calendar/index.d.mts +29 -0
  26. package/dist/calendar/index.d.ts +29 -0
  27. package/dist/calendar/index.js +191 -0
  28. package/dist/calendar/index.mjs +9 -0
  29. package/dist/card/index.d.mts +13 -0
  30. package/dist/card/index.d.ts +13 -0
  31. package/dist/card/index.js +141 -0
  32. package/dist/card/index.mjs +19 -0
  33. package/dist/carousel/index.d.mts +20 -0
  34. package/dist/carousel/index.d.ts +20 -0
  35. package/dist/carousel/index.js +236 -0
  36. package/dist/carousel/index.mjs +19 -0
  37. package/dist/checkbox/index.d.mts +6 -0
  38. package/dist/checkbox/index.d.ts +6 -0
  39. package/dist/checkbox/index.js +63 -0
  40. package/dist/checkbox/index.mjs +8 -0
  41. package/dist/chunk-32LEHNCH.mjs +155 -0
  42. package/dist/chunk-3ZJ4L43B.mjs +92 -0
  43. package/dist/chunk-4KQNZMKT.mjs +47 -0
  44. package/dist/chunk-4W6U222X.mjs +113 -0
  45. package/dist/chunk-556SM2PJ.mjs +40 -0
  46. package/dist/chunk-5LYTCNI6.mjs +127 -0
  47. package/dist/chunk-5N7LGYZK.mjs +137 -0
  48. package/dist/chunk-6OG237U6.mjs +54 -0
  49. package/dist/chunk-7TMIJ7HZ.mjs +149 -0
  50. package/dist/chunk-DTENOVQN.mjs +44 -0
  51. package/dist/chunk-DUGW62XX.mjs +143 -0
  52. package/dist/chunk-DWLKKYIU.mjs +156 -0
  53. package/dist/chunk-DYCSGLM5.mjs +32 -0
  54. package/dist/chunk-DZPJV6MN.mjs +66 -0
  55. package/dist/chunk-FT72MNAV.mjs +25 -0
  56. package/dist/chunk-FV6JTZAK.mjs +30 -0
  57. package/dist/chunk-GLD4KQD3.mjs +90 -0
  58. package/dist/chunk-GWVW5OI6.mjs +106 -0
  59. package/dist/chunk-JWCA4M7E.mjs +160 -0
  60. package/dist/chunk-K4UYYX45.mjs +199 -0
  61. package/dist/chunk-KVQKOJNU.mjs +52 -0
  62. package/dist/chunk-LPMRBQLR.mjs +120 -0
  63. package/dist/chunk-M6HSM6GV.mjs +68 -0
  64. package/dist/chunk-NE5LEVMC.mjs +201 -0
  65. package/dist/chunk-NGWDLZ6E.mjs +33 -0
  66. package/dist/chunk-NH5ZVHAV.mjs +36 -0
  67. package/dist/chunk-PFXSPRVI.mjs +65 -0
  68. package/dist/chunk-PJO7WJ4G.mjs +10 -0
  69. package/dist/chunk-PTXZWR7Y.mjs +76 -0
  70. package/dist/chunk-SG747CBC.mjs +34 -0
  71. package/dist/chunk-UDQDW22Y.mjs +71 -0
  72. package/dist/chunk-UGOA6M4S.mjs +120 -0
  73. package/dist/chunk-UXU54FBX.mjs +63 -0
  74. package/dist/chunk-WYBX5VJ4.mjs +49 -0
  75. package/dist/chunk-Y7DNVOKO.mjs +57 -0
  76. package/dist/chunk-YNOS3JA2.mjs +29 -0
  77. package/dist/chunk-YPTARV3T.mjs +57 -0
  78. package/dist/chunk-YYFQVSPV.mjs +17 -0
  79. package/dist/chunk-ZR3J34NX.mjs +85 -0
  80. package/dist/collapsible/index.d.mts +8 -0
  81. package/dist/collapsible/index.d.ts +8 -0
  82. package/dist/collapsible/index.js +64 -0
  83. package/dist/collapsible/index.mjs +12 -0
  84. package/dist/combobox/index.d.mts +18 -0
  85. package/dist/combobox/index.d.ts +18 -0
  86. package/dist/combobox/index.js +198 -0
  87. package/dist/combobox/index.mjs +32 -0
  88. package/dist/context-menu/index.d.mts +16 -0
  89. package/dist/context-menu/index.d.ts +16 -0
  90. package/dist/context-menu/index.js +177 -0
  91. package/dist/context-menu/index.mjs +28 -0
  92. package/dist/date-range-input/index.d.mts +17 -0
  93. package/dist/date-range-input/index.d.ts +17 -0
  94. package/dist/date-range-input/index.js +284 -0
  95. package/dist/date-range-input/index.mjs +11 -0
  96. package/dist/dialog/index.d.mts +19 -0
  97. package/dist/dialog/index.d.ts +19 -0
  98. package/dist/dialog/index.js +240 -0
  99. package/dist/dialog/index.mjs +27 -0
  100. package/dist/dropdown-menu/index.d.mts +16 -0
  101. package/dist/dropdown-menu/index.d.ts +16 -0
  102. package/dist/dropdown-menu/index.js +189 -0
  103. package/dist/dropdown-menu/index.mjs +28 -0
  104. package/dist/field/index.d.mts +24 -0
  105. package/dist/field/index.d.ts +24 -0
  106. package/dist/field/index.js +88 -0
  107. package/dist/field/index.mjs +16 -0
  108. package/dist/hover-card/index.d.mts +8 -0
  109. package/dist/hover-card/index.d.ts +8 -0
  110. package/dist/hover-card/index.js +79 -0
  111. package/dist/hover-card/index.mjs +12 -0
  112. package/dist/index.d.mts +73 -0
  113. package/dist/index.d.ts +73 -0
  114. package/dist/index.js +3167 -0
  115. package/dist/index.mjs +452 -0
  116. package/dist/input/index.d.mts +5 -0
  117. package/dist/input/index.d.ts +5 -0
  118. package/dist/input/index.js +54 -0
  119. package/dist/input/index.mjs +7 -0
  120. package/dist/kbd/index.d.mts +8 -0
  121. package/dist/kbd/index.d.ts +8 -0
  122. package/dist/kbd/index.js +64 -0
  123. package/dist/kbd/index.mjs +9 -0
  124. package/dist/lightbox/index.d.mts +17 -0
  125. package/dist/lightbox/index.d.ts +17 -0
  126. package/dist/lightbox/index.js +151 -0
  127. package/dist/lightbox/index.mjs +24 -0
  128. package/dist/pagination/index.d.mts +33 -0
  129. package/dist/pagination/index.d.ts +33 -0
  130. package/dist/pagination/index.js +212 -0
  131. package/dist/pagination/index.mjs +25 -0
  132. package/dist/popover/index.d.mts +11 -0
  133. package/dist/popover/index.d.ts +11 -0
  134. package/dist/popover/index.js +120 -0
  135. package/dist/popover/index.mjs +18 -0
  136. package/dist/progress/index.d.mts +6 -0
  137. package/dist/progress/index.d.ts +6 -0
  138. package/dist/progress/index.js +60 -0
  139. package/dist/progress/index.mjs +8 -0
  140. package/dist/radio-group/index.d.mts +8 -0
  141. package/dist/radio-group/index.d.ts +8 -0
  142. package/dist/radio-group/index.js +71 -0
  143. package/dist/radio-group/index.mjs +10 -0
  144. package/dist/resizable/index.d.mts +10 -0
  145. package/dist/resizable/index.d.ts +10 -0
  146. package/dist/resizable/index.js +80 -0
  147. package/dist/resizable/index.mjs +12 -0
  148. package/dist/scroll-area/index.d.mts +6 -0
  149. package/dist/scroll-area/index.d.ts +6 -0
  150. package/dist/scroll-area/index.js +74 -0
  151. package/dist/scroll-area/index.mjs +8 -0
  152. package/dist/select/index.d.mts +17 -0
  153. package/dist/select/index.d.ts +17 -0
  154. package/dist/select/index.js +238 -0
  155. package/dist/select/index.mjs +26 -0
  156. package/dist/separator/index.d.mts +6 -0
  157. package/dist/separator/index.d.ts +6 -0
  158. package/dist/separator/index.js +59 -0
  159. package/dist/separator/index.mjs +8 -0
  160. package/dist/sheet/index.d.mts +38 -0
  161. package/dist/sheet/index.d.ts +38 -0
  162. package/dist/sheet/index.js +212 -0
  163. package/dist/sheet/index.mjs +27 -0
  164. package/dist/skeleton/index.d.mts +17 -0
  165. package/dist/skeleton/index.d.ts +17 -0
  166. package/dist/skeleton/index.js +80 -0
  167. package/dist/skeleton/index.mjs +11 -0
  168. package/dist/slide-over/index.d.mts +92 -0
  169. package/dist/slide-over/index.d.ts +92 -0
  170. package/dist/slide-over/index.js +298 -0
  171. package/dist/slide-over/index.mjs +31 -0
  172. package/dist/slider/index.d.mts +6 -0
  173. package/dist/slider/index.d.ts +6 -0
  174. package/dist/slider/index.js +47 -0
  175. package/dist/slider/index.mjs +8 -0
  176. package/dist/switch/index.d.mts +8 -0
  177. package/dist/switch/index.d.ts +8 -0
  178. package/dist/switch/index.js +66 -0
  179. package/dist/switch/index.mjs +8 -0
  180. package/dist/tabs/index.d.mts +9 -0
  181. package/dist/tabs/index.d.ts +9 -0
  182. package/dist/tabs/index.js +96 -0
  183. package/dist/tabs/index.mjs +14 -0
  184. package/dist/toast/index.d.mts +19 -0
  185. package/dist/toast/index.d.ts +19 -0
  186. package/dist/toast/index.js +107 -0
  187. package/dist/toast/index.mjs +10 -0
  188. package/dist/toggle/index.d.mts +14 -0
  189. package/dist/toggle/index.d.ts +14 -0
  190. package/dist/toggle/index.js +89 -0
  191. package/dist/toggle/index.mjs +12 -0
  192. package/dist/tooltip/index.d.mts +9 -0
  193. package/dist/tooltip/index.d.ts +9 -0
  194. package/dist/tooltip/index.js +101 -0
  195. package/dist/tooltip/index.mjs +14 -0
  196. package/package.json +235 -0
@@ -0,0 +1,92 @@
1
+ import * as React from 'react';
2
+ import { Dialog } from '@base-ui/react/dialog';
3
+
4
+ interface UseRecordNavOptions {
5
+ /** CSS selector matching navigable record elements, e.g. '[data-record-id]'. */
6
+ selector: string;
7
+ /** Attribute to read each record's id from. Default 'data-record-id'. */
8
+ idAttribute?: string;
9
+ /** Currently open record id — next/prev is computed relative to this. */
10
+ currentId?: string | null;
11
+ /** Called with the next/previous record's id. */
12
+ onNavigate: (id: string) => void;
13
+ /** Enable the listener (e.g. only while a SlideOver is open). Default true. */
14
+ enabled?: boolean;
15
+ /** Key bindings. Default { next: "j", prev: "k" }. */
16
+ keys?: {
17
+ next?: string;
18
+ prev?: string;
19
+ };
20
+ }
21
+ /**
22
+ * Keyboard record-to-record navigation over whatever's currently rendered in
23
+ * the DOM (generalizes wmm-tasks' j/k board navigation) — no separate fetched
24
+ * list, no ordering logic: it walks `document.querySelectorAll(selector)` in
25
+ * DOM order, so navigation always matches what the user sees on screen.
26
+ * Ignored while focus is in a form control, or with any modifier key held.
27
+ *
28
+ * useRecordNav({
29
+ * selector: "[data-task-id]",
30
+ * currentId: openTaskId,
31
+ * onNavigate: (id) => openTask(id),
32
+ * enabled: !!openTaskId,
33
+ * });
34
+ */
35
+ declare function useRecordNav({ selector, idAttribute, currentId, onNavigate, enabled, keys, }: UseRecordNavOptions): void;
36
+
37
+ /**
38
+ * SlideOver — a large detail/record view over the current screen (task detail,
39
+ * client profile, order detail): bigger than Dialog, not edge-anchored like
40
+ * Sheet. Modeled on the wmm-tasks task-detail panel, rebuilt on Base UI Dialog
41
+ * (real focus trap + a11y instead of a hand-rolled one) with size variants
42
+ * instead of one fixed width, and an optional multi-column body for
43
+ * properties-rail / main-content / discussion-rail layouts.
44
+ *
45
+ * Three complementary "show detail over the current view" options exist —
46
+ * pick by content, not habit:
47
+ * - Dialog — small, single decision (confirm, short form)
48
+ * - Sheet — edge-anchored panel (filters, mobile actions), side= any edge
49
+ * - SlideOver — large record/detail view, optionally multi-column, often
50
+ * paired with a URL param so the underlying list stays intact
51
+ * (see @web-my-money/blocks/next's useUrlPanelParam)
52
+ */
53
+ declare function SlideOver({ ...props }: Dialog.Root.Props): React.JSX.Element;
54
+ declare function SlideOverTrigger({ ...props }: Dialog.Trigger.Props): React.JSX.Element;
55
+ declare function SlideOverPortal({ ...props }: Dialog.Portal.Props): React.JSX.Element;
56
+ declare function SlideOverClose({ ...props }: Dialog.Close.Props): React.JSX.Element;
57
+ declare function SlideOverOverlay({ className, ...props }: Dialog.Backdrop.Props): React.JSX.Element;
58
+ type SlideOverSize = "md" | "lg" | "xl" | "full";
59
+ interface SlideOverContentProps extends Dialog.Popup.Props {
60
+ size?: SlideOverSize;
61
+ showCloseButton?: boolean;
62
+ }
63
+ declare function SlideOverContent({ className, children, size, showCloseButton, ...props }: SlideOverContentProps): React.JSX.Element;
64
+ declare function SlideOverHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
65
+ /** Footer strip — pairs well with a keyboard-shortcut legend (see `shortcuts`). */
66
+ declare function SlideOverFooter({ className, shortcuts, children, ...props }: React.ComponentProps<"div"> & {
67
+ shortcuts?: React.ReactNode;
68
+ }): React.JSX.Element;
69
+ declare function SlideOverTitle({ className, ...props }: Dialog.Title.Props): React.JSX.Element;
70
+ declare function SlideOverDescription({ className, ...props }: Dialog.Description.Props): React.JSX.Element;
71
+ interface SlideOverColumn {
72
+ key: string;
73
+ content: React.ReactNode;
74
+ /** Tailwind width classes for the column at `lg:` and up. Default: flexes to fill. */
75
+ width?: string;
76
+ /** Order at `lg:` and up (mobile always stacks in array order). */
77
+ order?: number;
78
+ className?: string;
79
+ }
80
+ /**
81
+ * The wmm-tasks 3-column body convention: named columns that stack vertically
82
+ * on mobile (one shared scroll context) and sit side-by-side with independent
83
+ * scroll on `lg:` and up. Pass 1-3 columns; a single column just fills the
84
+ * body. `order`/`width` let the visual arrangement differ from array order
85
+ * (e.g. render [rail, main, discussion] but display main first on mobile).
86
+ */
87
+ declare function SlideOverColumns({ columns, className, }: {
88
+ columns: SlideOverColumn[];
89
+ className?: string;
90
+ }): React.JSX.Element;
91
+
92
+ export { SlideOver, SlideOverClose, type SlideOverColumn, SlideOverColumns, SlideOverContent, type SlideOverContentProps, SlideOverDescription, SlideOverFooter, SlideOverHeader, SlideOverOverlay, SlideOverPortal, type SlideOverSize, SlideOverTitle, SlideOverTrigger, type UseRecordNavOptions, useRecordNav };
@@ -0,0 +1,298 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+
31
+ // src/slide-over/index.tsx
32
+ var slide_over_exports = {};
33
+ __export(slide_over_exports, {
34
+ SlideOver: () => SlideOver,
35
+ SlideOverClose: () => SlideOverClose,
36
+ SlideOverColumns: () => SlideOverColumns,
37
+ SlideOverContent: () => SlideOverContent,
38
+ SlideOverDescription: () => SlideOverDescription,
39
+ SlideOverFooter: () => SlideOverFooter,
40
+ SlideOverHeader: () => SlideOverHeader,
41
+ SlideOverOverlay: () => SlideOverOverlay,
42
+ SlideOverPortal: () => SlideOverPortal,
43
+ SlideOverTitle: () => SlideOverTitle,
44
+ SlideOverTrigger: () => SlideOverTrigger,
45
+ useRecordNav: () => useRecordNav
46
+ });
47
+ module.exports = __toCommonJS(slide_over_exports);
48
+ var import_dialog = require("@base-ui/react/dialog");
49
+
50
+ // src/utils.ts
51
+ var import_clsx = require("clsx");
52
+ var import_tailwind_merge = require("tailwind-merge");
53
+ function cn(...inputs) {
54
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
55
+ }
56
+
57
+ // src/button/index.tsx
58
+ var import_button = require("@base-ui/react/button");
59
+ var import_class_variance_authority = require("class-variance-authority");
60
+ var import_jsx_runtime = require("react/jsx-runtime");
61
+ var buttonVariants = (0, import_class_variance_authority.cva)(
62
+ "group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
63
+ {
64
+ variants: {
65
+ variant: {
66
+ default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
67
+ outline: "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
68
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
69
+ ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
70
+ destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
71
+ link: "text-primary underline-offset-4 hover:underline"
72
+ },
73
+ size: {
74
+ default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
75
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
76
+ sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
77
+ lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",
78
+ icon: "size-8",
79
+ "icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
80
+ "icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
81
+ "icon-lg": "size-9"
82
+ }
83
+ },
84
+ defaultVariants: {
85
+ variant: "default",
86
+ size: "default"
87
+ }
88
+ }
89
+ );
90
+ function Button({
91
+ className,
92
+ variant = "default",
93
+ size = "default",
94
+ ...props
95
+ }) {
96
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
97
+ import_button.Button,
98
+ {
99
+ "data-slot": "button",
100
+ className: cn(buttonVariants({ variant, size, className })),
101
+ ...props
102
+ }
103
+ );
104
+ }
105
+
106
+ // src/slide-over/index.tsx
107
+ var import_lucide_react = require("lucide-react");
108
+
109
+ // src/slide-over/use-record-nav.ts
110
+ var React = __toESM(require("react"));
111
+ function useRecordNav({
112
+ selector,
113
+ idAttribute = "data-record-id",
114
+ currentId,
115
+ onNavigate,
116
+ enabled = true,
117
+ keys
118
+ }) {
119
+ const nextKey = keys?.next ?? "j";
120
+ const prevKey = keys?.prev ?? "k";
121
+ const onNavigateRef = React.useRef(onNavigate);
122
+ onNavigateRef.current = onNavigate;
123
+ React.useEffect(() => {
124
+ if (!enabled) return;
125
+ function onKeyDown(e) {
126
+ const target = e.target;
127
+ const tag = target?.tagName;
128
+ if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT" || target?.isContentEditable) return;
129
+ if (e.metaKey || e.ctrlKey || e.altKey) return;
130
+ if (e.key !== nextKey && e.key !== prevKey) return;
131
+ const nodes = Array.from(document.querySelectorAll(selector));
132
+ if (nodes.length === 0) return;
133
+ const ids = nodes.map((n) => n.getAttribute(idAttribute)).filter((id) => !!id);
134
+ const currentIndex = currentId ? ids.indexOf(currentId) : -1;
135
+ const delta = e.key === nextKey ? 1 : -1;
136
+ const nextIndex = currentIndex === -1 ? 0 : (currentIndex + delta + ids.length) % ids.length;
137
+ const nextId = ids[nextIndex];
138
+ if (nextId) {
139
+ e.preventDefault();
140
+ onNavigateRef.current(nextId);
141
+ }
142
+ }
143
+ document.addEventListener("keydown", onKeyDown);
144
+ return () => document.removeEventListener("keydown", onKeyDown);
145
+ }, [enabled, selector, idAttribute, currentId, nextKey, prevKey]);
146
+ }
147
+
148
+ // src/slide-over/index.tsx
149
+ var import_jsx_runtime2 = require("react/jsx-runtime");
150
+ function SlideOver({ ...props }) {
151
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dialog.Dialog.Root, { "data-slot": "slide-over", ...props });
152
+ }
153
+ function SlideOverTrigger({ ...props }) {
154
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dialog.Dialog.Trigger, { "data-slot": "slide-over-trigger", ...props });
155
+ }
156
+ function SlideOverPortal({ ...props }) {
157
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dialog.Dialog.Portal, { "data-slot": "slide-over-portal", ...props });
158
+ }
159
+ function SlideOverClose({ ...props }) {
160
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dialog.Dialog.Close, { "data-slot": "slide-over-close", ...props });
161
+ }
162
+ function SlideOverOverlay({ className, ...props }) {
163
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
164
+ import_dialog.Dialog.Backdrop,
165
+ {
166
+ "data-slot": "dialog-overlay",
167
+ className: cn("fixed inset-0 z-50 bg-black/50", className),
168
+ ...props
169
+ }
170
+ );
171
+ }
172
+ var SIZE_STYLES = {
173
+ md: "sm:max-w-2xl",
174
+ lg: "sm:max-w-4xl lg:max-w-5xl",
175
+ xl: "sm:max-w-6xl lg:max-w-7xl xl:max-w-[90rem]",
176
+ full: "sm:max-w-[100vw]"
177
+ };
178
+ function SlideOverContent({
179
+ className,
180
+ children,
181
+ size = "lg",
182
+ showCloseButton = true,
183
+ ...props
184
+ }) {
185
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(SlideOverPortal, { children: [
186
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SlideOverOverlay, {}),
187
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
188
+ import_dialog.Dialog.Popup,
189
+ {
190
+ "data-slot": "slide-over-content",
191
+ className: cn(
192
+ "fixed inset-0 z-50 flex w-full max-w-[100vw] flex-col overflow-hidden bg-card text-card-foreground outline-none sm:inset-y-6 sm:left-1/2 sm:h-[calc(100%-3rem)] sm:-translate-x-1/2 sm:rounded-xl sm:border sm:border-border sm:shadow-2xl",
193
+ SIZE_STYLES[size],
194
+ className
195
+ ),
196
+ ...props,
197
+ children: [
198
+ children,
199
+ showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
200
+ SlideOverClose,
201
+ {
202
+ render: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Button, { variant: "ghost", className: "absolute right-3 top-3 z-10", size: "icon-sm" }),
203
+ children: [
204
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react.XIcon, {}),
205
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "sr-only", children: "Close" })
206
+ ]
207
+ }
208
+ )
209
+ ]
210
+ }
211
+ )
212
+ ] });
213
+ }
214
+ function SlideOverHeader({ className, ...props }) {
215
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
216
+ "div",
217
+ {
218
+ "data-slot": "slide-over-header",
219
+ className: cn("flex shrink-0 items-center gap-3 border-b border-border px-4 py-3 sm:px-6", className),
220
+ ...props
221
+ }
222
+ );
223
+ }
224
+ function SlideOverFooter({
225
+ className,
226
+ shortcuts,
227
+ children,
228
+ ...props
229
+ }) {
230
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
231
+ "div",
232
+ {
233
+ "data-slot": "slide-over-footer",
234
+ className: cn(
235
+ "flex shrink-0 flex-wrap items-center justify-between gap-2 border-t border-border px-4 py-2.5 text-xs text-muted-foreground sm:px-6",
236
+ className
237
+ ),
238
+ ...props,
239
+ children: [
240
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "flex items-center gap-3", children: shortcuts }),
241
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "flex items-center gap-2", children })
242
+ ]
243
+ }
244
+ );
245
+ }
246
+ function SlideOverTitle({ className, ...props }) {
247
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
248
+ import_dialog.Dialog.Title,
249
+ {
250
+ "data-slot": "slide-over-title",
251
+ className: cn("truncate font-heading text-base font-semibold", className),
252
+ ...props
253
+ }
254
+ );
255
+ }
256
+ function SlideOverDescription({ className, ...props }) {
257
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
258
+ import_dialog.Dialog.Description,
259
+ {
260
+ "data-slot": "slide-over-description",
261
+ className: cn("text-sm text-muted-foreground", className),
262
+ ...props
263
+ }
264
+ );
265
+ }
266
+ function SlideOverColumns({
267
+ columns,
268
+ className
269
+ }) {
270
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: cn("flex flex-1 flex-col overflow-y-auto lg:flex-row lg:overflow-hidden", className), children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
271
+ "div",
272
+ {
273
+ className: cn(
274
+ "flex flex-col lg:h-full lg:overflow-y-auto",
275
+ col.width ?? "lg:flex-1",
276
+ col.className
277
+ ),
278
+ style: col.order != null ? { order: col.order } : void 0,
279
+ children: col.content
280
+ },
281
+ col.key
282
+ )) });
283
+ }
284
+ // Annotate the CommonJS export names for ESM import in node:
285
+ 0 && (module.exports = {
286
+ SlideOver,
287
+ SlideOverClose,
288
+ SlideOverColumns,
289
+ SlideOverContent,
290
+ SlideOverDescription,
291
+ SlideOverFooter,
292
+ SlideOverHeader,
293
+ SlideOverOverlay,
294
+ SlideOverPortal,
295
+ SlideOverTitle,
296
+ SlideOverTrigger,
297
+ useRecordNav
298
+ });
@@ -0,0 +1,31 @@
1
+ "use client";
2
+ import {
3
+ SlideOver,
4
+ SlideOverClose,
5
+ SlideOverColumns,
6
+ SlideOverContent,
7
+ SlideOverDescription,
8
+ SlideOverFooter,
9
+ SlideOverHeader,
10
+ SlideOverOverlay,
11
+ SlideOverPortal,
12
+ SlideOverTitle,
13
+ SlideOverTrigger,
14
+ useRecordNav
15
+ } from "../chunk-NE5LEVMC.mjs";
16
+ import "../chunk-YPTARV3T.mjs";
17
+ import "../chunk-PJO7WJ4G.mjs";
18
+ export {
19
+ SlideOver,
20
+ SlideOverClose,
21
+ SlideOverColumns,
22
+ SlideOverContent,
23
+ SlideOverDescription,
24
+ SlideOverFooter,
25
+ SlideOverHeader,
26
+ SlideOverOverlay,
27
+ SlideOverPortal,
28
+ SlideOverTitle,
29
+ SlideOverTrigger,
30
+ useRecordNav
31
+ };
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ import { Slider as Slider$1 } from '@base-ui/react/slider';
3
+
4
+ declare function Slider({ className, ...props }: Slider$1.Root.Props): React.JSX.Element;
5
+
6
+ export { Slider };
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ import { Slider as Slider$1 } from '@base-ui/react/slider';
3
+
4
+ declare function Slider({ className, ...props }: Slider$1.Root.Props): React.JSX.Element;
5
+
6
+ export { Slider };
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ "use client";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/slider/index.tsx
22
+ var slider_exports = {};
23
+ __export(slider_exports, {
24
+ Slider: () => Slider
25
+ });
26
+ module.exports = __toCommonJS(slider_exports);
27
+ var import_slider = require("@base-ui/react/slider");
28
+
29
+ // src/utils.ts
30
+ var import_clsx = require("clsx");
31
+ var import_tailwind_merge = require("tailwind-merge");
32
+ function cn(...inputs) {
33
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
34
+ }
35
+
36
+ // src/slider/index.tsx
37
+ var import_jsx_runtime = require("react/jsx-runtime");
38
+ function Slider({ className, ...props }) {
39
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_slider.Slider.Root, { "data-slot": "slider", className: cn("w-full", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_slider.Slider.Control, { className: "flex w-full touch-none items-center py-2 select-none", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_slider.Slider.Track, { className: "relative h-1.5 w-full rounded-full bg-muted", children: [
40
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_slider.Slider.Indicator, { className: "absolute rounded-full bg-primary" }),
41
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_slider.Slider.Thumb, { className: "size-4 rounded-full border-2 border-primary bg-background shadow-sm outline-none focus-visible:ring-2 focus-visible:ring-ring data-dragging:scale-110 transition-transform" })
42
+ ] }) }) });
43
+ }
44
+ // Annotate the CommonJS export names for ESM import in node:
45
+ 0 && (module.exports = {
46
+ Slider
47
+ });
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import {
3
+ Slider
4
+ } from "../chunk-YYFQVSPV.mjs";
5
+ import "../chunk-PJO7WJ4G.mjs";
6
+ export {
7
+ Slider
8
+ };
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { Switch as Switch$1 } from '@base-ui/react/switch';
3
+
4
+ declare function Switch({ className, size, ...props }: Switch$1.Root.Props & {
5
+ size?: "sm" | "default";
6
+ }): React.JSX.Element;
7
+
8
+ export { Switch };
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { Switch as Switch$1 } from '@base-ui/react/switch';
3
+
4
+ declare function Switch({ className, size, ...props }: Switch$1.Root.Props & {
5
+ size?: "sm" | "default";
6
+ }): React.JSX.Element;
7
+
8
+ export { Switch };
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ "use client";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/switch/index.tsx
22
+ var switch_exports = {};
23
+ __export(switch_exports, {
24
+ Switch: () => Switch
25
+ });
26
+ module.exports = __toCommonJS(switch_exports);
27
+ var import_switch = require("@base-ui/react/switch");
28
+
29
+ // src/utils.ts
30
+ var import_clsx = require("clsx");
31
+ var import_tailwind_merge = require("tailwind-merge");
32
+ function cn(...inputs) {
33
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
34
+ }
35
+
36
+ // src/switch/index.tsx
37
+ var import_jsx_runtime = require("react/jsx-runtime");
38
+ function Switch({
39
+ className,
40
+ size = "default",
41
+ ...props
42
+ }) {
43
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
44
+ import_switch.Switch.Root,
45
+ {
46
+ "data-slot": "switch",
47
+ "data-size": size,
48
+ className: cn(
49
+ "peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",
50
+ className
51
+ ),
52
+ ...props,
53
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
54
+ import_switch.Switch.Thumb,
55
+ {
56
+ "data-slot": "switch-thumb",
57
+ className: "pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"
58
+ }
59
+ )
60
+ }
61
+ );
62
+ }
63
+ // Annotate the CommonJS export names for ESM import in node:
64
+ 0 && (module.exports = {
65
+ Switch
66
+ });
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import {
3
+ Switch
4
+ } from "../chunk-NH5ZVHAV.mjs";
5
+ import "../chunk-PJO7WJ4G.mjs";
6
+ export {
7
+ Switch
8
+ };
@@ -0,0 +1,9 @@
1
+ import * as React$1 from 'react';
2
+ import { Tabs as Tabs$1 } from '@base-ui/react/tabs';
3
+
4
+ declare const TabsList: ({ className, ...props }: React.ComponentPropsWithoutRef<typeof Tabs$1.List>) => React$1.JSX.Element;
5
+ declare const TabsTrigger: ({ className, ...props }: React.ComponentPropsWithoutRef<typeof Tabs$1.Tab>) => React$1.JSX.Element;
6
+ declare const TabsContent: ({ className, ...props }: React.ComponentPropsWithoutRef<typeof Tabs$1.Panel>) => React$1.JSX.Element;
7
+ declare const Tabs: ({ className, ...props }: React.ComponentPropsWithoutRef<typeof Tabs$1.Root>) => React$1.JSX.Element;
8
+
9
+ export { Tabs, TabsContent, TabsList, TabsTrigger };
@@ -0,0 +1,9 @@
1
+ import * as React$1 from 'react';
2
+ import { Tabs as Tabs$1 } from '@base-ui/react/tabs';
3
+
4
+ declare const TabsList: ({ className, ...props }: React.ComponentPropsWithoutRef<typeof Tabs$1.List>) => React$1.JSX.Element;
5
+ declare const TabsTrigger: ({ className, ...props }: React.ComponentPropsWithoutRef<typeof Tabs$1.Tab>) => React$1.JSX.Element;
6
+ declare const TabsContent: ({ className, ...props }: React.ComponentPropsWithoutRef<typeof Tabs$1.Panel>) => React$1.JSX.Element;
7
+ declare const Tabs: ({ className, ...props }: React.ComponentPropsWithoutRef<typeof Tabs$1.Root>) => React$1.JSX.Element;
8
+
9
+ export { Tabs, TabsContent, TabsList, TabsTrigger };