@jztack/ui 0.0.0-stage → 0.2.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 (143) hide show
  1. package/README.md +101 -2
  2. package/dist/components/alert.d.ts +25 -0
  3. package/dist/components/alert.d.ts.map +1 -0
  4. package/dist/components/alert.js +40 -0
  5. package/dist/components/alert.js.map +1 -0
  6. package/dist/components/app-shell.d.ts +64 -0
  7. package/dist/components/app-shell.d.ts.map +1 -0
  8. package/dist/components/app-shell.js +33 -0
  9. package/dist/components/app-shell.js.map +1 -0
  10. package/dist/components/avatar.d.ts +12 -0
  11. package/dist/components/avatar.d.ts.map +1 -0
  12. package/dist/components/avatar.js +23 -0
  13. package/dist/components/avatar.js.map +1 -0
  14. package/dist/components/badge.d.ts +42 -0
  15. package/dist/components/badge.d.ts.map +1 -0
  16. package/dist/components/badge.js +113 -0
  17. package/dist/components/badge.js.map +1 -0
  18. package/dist/components/button.d.ts +30 -0
  19. package/dist/components/button.d.ts.map +1 -0
  20. package/dist/components/button.js +57 -0
  21. package/dist/components/button.js.map +1 -0
  22. package/dist/components/card.d.ts +28 -0
  23. package/dist/components/card.d.ts.map +1 -0
  24. package/dist/components/card.js +54 -0
  25. package/dist/components/card.js.map +1 -0
  26. package/dist/components/checkbox.d.ts +5 -0
  27. package/dist/components/checkbox.d.ts.map +1 -0
  28. package/dist/components/checkbox.js +10 -0
  29. package/dist/components/checkbox.js.map +1 -0
  30. package/dist/components/confirm-action-modal.d.ts +49 -0
  31. package/dist/components/confirm-action-modal.d.ts.map +1 -0
  32. package/dist/components/confirm-action-modal.js +88 -0
  33. package/dist/components/confirm-action-modal.js.map +1 -0
  34. package/dist/components/delete-button.d.ts +26 -0
  35. package/dist/components/delete-button.d.ts.map +1 -0
  36. package/dist/components/delete-button.js +36 -0
  37. package/dist/components/delete-button.js.map +1 -0
  38. package/dist/components/dialog.d.ts +22 -0
  39. package/dist/components/dialog.d.ts.map +1 -0
  40. package/dist/components/dialog.js +38 -0
  41. package/dist/components/dialog.js.map +1 -0
  42. package/dist/components/dropdown-menu.d.ts +30 -0
  43. package/dist/components/dropdown-menu.d.ts.map +1 -0
  44. package/dist/components/dropdown-menu.js +88 -0
  45. package/dist/components/dropdown-menu.js.map +1 -0
  46. package/dist/components/empty-state.d.ts +20 -0
  47. package/dist/components/empty-state.d.ts.map +1 -0
  48. package/dist/components/empty-state.js +8 -0
  49. package/dist/components/empty-state.js.map +1 -0
  50. package/dist/components/error-boundary.d.ts +39 -0
  51. package/dist/components/error-boundary.d.ts.map +1 -0
  52. package/dist/components/error-boundary.js +57 -0
  53. package/dist/components/error-boundary.js.map +1 -0
  54. package/dist/components/form-field.d.ts +78 -0
  55. package/dist/components/form-field.d.ts.map +1 -0
  56. package/dist/components/form-field.js +56 -0
  57. package/dist/components/form-field.js.map +1 -0
  58. package/dist/components/input.d.ts +9 -0
  59. package/dist/components/input.d.ts.map +1 -0
  60. package/dist/components/input.js +12 -0
  61. package/dist/components/input.js.map +1 -0
  62. package/dist/components/label.d.ts +5 -0
  63. package/dist/components/label.d.ts.map +1 -0
  64. package/dist/components/label.js +8 -0
  65. package/dist/components/label.js.map +1 -0
  66. package/dist/components/page-header.d.ts +23 -0
  67. package/dist/components/page-header.d.ts.map +1 -0
  68. package/dist/components/page-header.js +10 -0
  69. package/dist/components/page-header.js.map +1 -0
  70. package/dist/components/progress.d.ts +5 -0
  71. package/dist/components/progress.d.ts.map +1 -0
  72. package/dist/components/progress.js +13 -0
  73. package/dist/components/progress.js.map +1 -0
  74. package/dist/components/radio-group.d.ts +6 -0
  75. package/dist/components/radio-group.d.ts.map +1 -0
  76. package/dist/components/radio-group.js +11 -0
  77. package/dist/components/radio-group.js.map +1 -0
  78. package/dist/components/scroll-area.d.ts +6 -0
  79. package/dist/components/scroll-area.d.ts.map +1 -0
  80. package/dist/components/scroll-area.js +11 -0
  81. package/dist/components/scroll-area.js.map +1 -0
  82. package/dist/components/select.d.ts +16 -0
  83. package/dist/components/select.d.ts.map +1 -0
  84. package/dist/components/select.js +44 -0
  85. package/dist/components/select.js.map +1 -0
  86. package/dist/components/separator.d.ts +5 -0
  87. package/dist/components/separator.d.ts.map +1 -0
  88. package/dist/components/separator.js +9 -0
  89. package/dist/components/separator.js.map +1 -0
  90. package/dist/components/sheet.d.ts +46 -0
  91. package/dist/components/sheet.d.ts.map +1 -0
  92. package/dist/components/sheet.js +58 -0
  93. package/dist/components/sheet.js.map +1 -0
  94. package/dist/components/skeleton.d.ts +3 -0
  95. package/dist/components/skeleton.d.ts.map +1 -0
  96. package/dist/components/skeleton.js +7 -0
  97. package/dist/components/skeleton.js.map +1 -0
  98. package/dist/components/sonner.d.ts +29 -0
  99. package/dist/components/sonner.d.ts.map +1 -0
  100. package/dist/components/sonner.js +28 -0
  101. package/dist/components/sonner.js.map +1 -0
  102. package/dist/components/switch.d.ts +20 -0
  103. package/dist/components/switch.d.ts.map +1 -0
  104. package/dist/components/switch.js +15 -0
  105. package/dist/components/switch.js.map +1 -0
  106. package/dist/components/table.d.ts +11 -0
  107. package/dist/components/table.d.ts.map +1 -0
  108. package/dist/components/table.js +28 -0
  109. package/dist/components/table.js.map +1 -0
  110. package/dist/components/textarea.d.ts +4 -0
  111. package/dist/components/textarea.d.ts.map +1 -0
  112. package/dist/components/textarea.js +7 -0
  113. package/dist/components/textarea.js.map +1 -0
  114. package/dist/components/toggle-group.d.ts +11 -0
  115. package/dist/components/toggle-group.d.ts.map +1 -0
  116. package/dist/components/toggle-group.js +24 -0
  117. package/dist/components/toggle-group.js.map +1 -0
  118. package/dist/components/toggle.d.ts +15 -0
  119. package/dist/components/toggle.d.ts.map +1 -0
  120. package/dist/components/toggle.js +30 -0
  121. package/dist/components/toggle.js.map +1 -0
  122. package/dist/components/tooltip.d.ts +8 -0
  123. package/dist/components/tooltip.d.ts.map +1 -0
  124. package/dist/components/tooltip.js +17 -0
  125. package/dist/components/tooltip.js.map +1 -0
  126. package/dist/haptics.d.ts +38 -0
  127. package/dist/haptics.d.ts.map +1 -0
  128. package/dist/haptics.js +64 -0
  129. package/dist/haptics.js.map +1 -0
  130. package/dist/hooks/useClickOpenDisclosure.d.ts +19 -0
  131. package/dist/hooks/useClickOpenDisclosure.d.ts.map +1 -0
  132. package/dist/hooks/useClickOpenDisclosure.js +77 -0
  133. package/dist/hooks/useClickOpenDisclosure.js.map +1 -0
  134. package/dist/index.d.ts +56 -0
  135. package/dist/index.d.ts.map +1 -0
  136. package/dist/index.js +45 -0
  137. package/dist/index.js.map +1 -0
  138. package/dist/lib/utils.d.ts +7 -0
  139. package/dist/lib/utils.d.ts.map +1 -0
  140. package/dist/lib/utils.js +15 -0
  141. package/dist/lib/utils.js.map +1 -0
  142. package/dist/styles.css +157 -0
  143. package/package.json +188 -3
@@ -0,0 +1,28 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ import type * as React from 'react';
3
+ /**
4
+ * Card with the Surface behaviour (DESIGN.md §2.7): the `variant` axis is
5
+ * where the fleet's three card recipes and Tabbie's glass-surface converge.
6
+ * Tokens supply the values; the behaviour (translucency + blur) lives here.
7
+ *
8
+ * Default variant: `raised` in every theme at the component level — under
9
+ * light themes that is Justin's decision (Dec 4, 2026); dark-theme apps
10
+ * (Tabbie) opt into `glass` explicitly or via their own composition, and
11
+ * any visual diff at Tabbie adoption is fixed in the tabbie theme's token
12
+ * values, never as a component branch.
13
+ */
14
+ declare const cardVariants: (props?: ({
15
+ variant?: "flat" | "glass" | "raised" | null | undefined;
16
+ size?: "default" | "sm" | null | undefined;
17
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
18
+ export interface CardProps extends React.ComponentProps<'div'>, VariantProps<typeof cardVariants> {
19
+ }
20
+ declare function Card({ className, variant, size, ...props }: CardProps): React.JSX.Element;
21
+ declare function CardHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
22
+ declare function CardTitle({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
23
+ declare function CardDescription({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
24
+ declare function CardAction({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
25
+ declare function CardContent({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
26
+ declare function CardFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
27
+ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, cardVariants, };
28
+ //# sourceMappingURL=card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/components/card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAIpC;;;;;;;;;;GAUG;AACH,QAAA,MAAM,YAAY;;;8EAoBjB,CAAC;AAEF,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC,OAAO,YAAY,CAAC;CAAG;AAEpG,iBAAS,IAAI,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,IAAgB,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,qBAU1E;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAWvE;AAED,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAWtE;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQ5E;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQvE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAIxE;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAWvE;AAED,OAAO,EACL,IAAI,EACJ,UAAU,EACV,WAAW,EACX,eAAe,EACf,UAAU,EACV,UAAU,EACV,SAAS,EACT,YAAY,GACb,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cva } from 'class-variance-authority';
3
+ import { cn } from '../lib/utils.js';
4
+ /**
5
+ * Card with the Surface behaviour (DESIGN.md §2.7): the `variant` axis is
6
+ * where the fleet's three card recipes and Tabbie's glass-surface converge.
7
+ * Tokens supply the values; the behaviour (translucency + blur) lives here.
8
+ *
9
+ * Default variant: `raised` in every theme at the component level — under
10
+ * light themes that is Justin's decision (Dec 4, 2026); dark-theme apps
11
+ * (Tabbie) opt into `glass` explicitly or via their own composition, and
12
+ * any visual diff at Tabbie adoption is fixed in the tabbie theme's token
13
+ * values, never as a component branch.
14
+ */
15
+ const cardVariants = cva('group/card flex flex-col gap-(--card-spacing) overflow-hidden py-(--card-spacing) text-sm [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl', {
16
+ variants: {
17
+ variant: {
18
+ raised: 'rounded-xl bg-card text-card-foreground shadow-sm ring-1 ring-foreground/10',
19
+ glass: 'rounded-xl border border-border bg-[color-mix(in_oklch,var(--card)_55%,transparent)] text-card-foreground shadow-lg backdrop-blur-xl',
20
+ flat: 'rounded-xl border border-border bg-card text-card-foreground',
21
+ },
22
+ size: {
23
+ default: '',
24
+ sm: '',
25
+ },
26
+ },
27
+ defaultVariants: {
28
+ variant: 'raised',
29
+ size: 'default',
30
+ },
31
+ });
32
+ function Card({ className, variant, size = 'default', ...props }) {
33
+ return (_jsx("div", { "data-slot": "card", "data-size": size, "data-variant": variant ?? 'raised', className: cn(cardVariants({ variant, size }), className), ...props }));
34
+ }
35
+ function CardHeader({ className, ...props }) {
36
+ return (_jsx("div", { "data-slot": "card-header", className: cn('group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)', className), ...props }));
37
+ }
38
+ function CardTitle({ className, ...props }) {
39
+ return (_jsx("div", { "data-slot": "card-title", className: cn('font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm', className), ...props }));
40
+ }
41
+ function CardDescription({ className, ...props }) {
42
+ return (_jsx("div", { "data-slot": "card-description", className: cn('text-sm text-muted-foreground', className), ...props }));
43
+ }
44
+ function CardAction({ className, ...props }) {
45
+ return (_jsx("div", { "data-slot": "card-action", className: cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className), ...props }));
46
+ }
47
+ function CardContent({ className, ...props }) {
48
+ return (_jsx("div", { "data-slot": "card-content", className: cn('px-(--card-spacing)', className), ...props }));
49
+ }
50
+ function CardFooter({ className, ...props }) {
51
+ return (_jsx("div", { "data-slot": "card-footer", className: cn('flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)', className), ...props }));
52
+ }
53
+ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, cardVariants, };
54
+ //# sourceMappingURL=card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.js","sourceRoot":"","sources":["../../src/components/card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC;;;;;;;;;;GAUG;AACH,MAAM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E,OAAO,CACL,2BACY,aAAa,EACvB,SAAS,EAAE,EAAE,CAAC,gEAAgE,EAAE,SAAS,CAAC,KACtF,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B;IACvE,OAAO,CACL,2BAAe,cAAc,EAAC,SAAS,EAAE,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAC7F,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B;IACtE,OAAO,CACL,2BACY,aAAa,EACvB,SAAS,EAAE,EAAE,CACX,wEAAwE,EACxE,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EACL,IAAI,EACJ,UAAU,EACV,WAAW,EACX,eAAe,EACf,UAAU,EACV,UAAU,EACV,SAAS,EACT,YAAY,GACb,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Checkbox as CheckboxPrimitive } from 'radix-ui';
2
+ import type * as React from 'react';
3
+ declare function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>): React.JSX.Element;
4
+ export { Checkbox };
5
+ //# sourceMappingURL=checkbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/components/checkbox.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAGpC,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,qBAkB7F;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,10 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { CheckIcon } from 'lucide-react';
4
+ import { Checkbox as CheckboxPrimitive } from 'radix-ui';
5
+ import { cn } from '../lib/utils.js';
6
+ function Checkbox({ className, ...props }) {
7
+ return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn('peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary', className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "grid place-content-center text-current transition-none [&>svg]:size-3.5", children: _jsx(CheckIcon, {}) }) }));
8
+ }
9
+ export { Checkbox };
10
+ //# sourceMappingURL=checkbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../src/components/checkbox.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAEzD,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,SAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAuD;IAC5F,OAAO,CACL,KAAC,iBAAiB,CAAC,IAAI,iBACX,UAAU,EACpB,SAAS,EAAE,EAAE,CACX,y1BAAy1B,EACz1B,SAAS,CACV,KACG,KAAK,YAET,KAAC,iBAAiB,CAAC,SAAS,iBAChB,oBAAoB,EAC9B,SAAS,EAAC,yEAAyE,YAEnF,KAAC,SAAS,KAAG,GACe,GACP,CAC1B,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,49 @@
1
+ import type { ReactElement, ReactNode } from 'react';
2
+ /**
3
+ * ConfirmActionModal (DESIGN.md §3.3) — Tabbie's
4
+ * `shared/ConfirmActionModal.tsx` ported nearly whole. It was already
5
+ * prop-driven except for three dictionary calls (cancel / pleaseWait /
6
+ * moreInformation), which are now required label props — the library
7
+ * carries no dictionary (§4.1).
8
+ *
9
+ * This is one of the two sanctioned destructive-action shapes (Justin's
10
+ * decision, Dec 4, 2026): ConfirmActionModal for high-impact or
11
+ * irreversible actions; DeleteButton's two-step inline confirm for
12
+ * row-level deletes. No per-app improvisation.
13
+ *
14
+ * Behaviour kept from the source: async onConfirm — the modal stays open
15
+ * while pending, closes on resolve, stays open and re-enables on reject;
16
+ * confirm is disabled after the first click (double-submit guard); the
17
+ * content is snapshotted while open so the parent's close-time state
18
+ * cleanup can't blank the closing animation; auto-focus is suppressed
19
+ * (focus lands on the dialog, not a button — a destructive default-focus
20
+ * is a footgun). The source's glass-surface styling becomes the library
21
+ * Card-glass recipe expressed in contract tokens.
22
+ */
23
+ export interface ConfirmActionModalProps {
24
+ isOpen: boolean;
25
+ onClose: () => void;
26
+ title: string;
27
+ description: string;
28
+ confirmLabel: string;
29
+ cancelLabel: string;
30
+ /** Shown with a spinner on the confirm button while pending. */
31
+ busyLabel?: string;
32
+ /** aria-label for the tooltip trigger; required iff descriptionInTooltip. */
33
+ moreInfoLabel?: string;
34
+ onConfirm: () => undefined | Promise<unknown>;
35
+ /** Destructive Button variant + danger tone. */
36
+ isDestructive?: boolean;
37
+ /** Tabbie's click-tooltip mode: the description moves into a
38
+ * click-triggered tooltip beside the title (and stays in the
39
+ * accessibility tree as the dialog description). */
40
+ descriptionInTooltip?: boolean;
41
+ isConfirmDisabled?: boolean;
42
+ /** External busy state. */
43
+ isLoading?: boolean;
44
+ /** Detail block between title and description (e.g. an amount). */
45
+ children?: ReactNode;
46
+ }
47
+ export default function ConfirmActionModal(props: ConfirmActionModalProps): ReactElement;
48
+ export { ConfirmActionModal };
49
+ //# sourceMappingURL=confirm-action-modal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confirm-action-modal.d.ts","sourceRoot":"","sources":["../../src/components/confirm-action-modal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQrD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9C,gDAAgD;IAChD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;yDAEqD;IACrD,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,2BAA2B;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAsED,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,YAAY,CAoBvF;AAqGD,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1,88 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Info, Loader2 } from 'lucide-react';
3
+ import { useLayoutEffect, useMemo, useRef, useState } from 'react';
4
+ import { onDialogOpenChange } from '../lib/utils.js';
5
+ import { Button } from './button.js';
6
+ import { Dialog, DialogContent, DialogDescription, DialogTitle } from './dialog.js';
7
+ import { Tooltip, TooltipContent, TooltipTrigger } from './tooltip.js';
8
+ function useModalContent(props) {
9
+ const content = useMemo(() => ({
10
+ title: props.title,
11
+ description: props.description,
12
+ confirmLabel: props.confirmLabel,
13
+ isDestructive: props.isDestructive,
14
+ descriptionInTooltip: props.descriptionInTooltip,
15
+ children: props.children,
16
+ }), [
17
+ props.title,
18
+ props.description,
19
+ props.confirmLabel,
20
+ props.isDestructive,
21
+ props.descriptionInTooltip,
22
+ props.children,
23
+ ]);
24
+ const snapshot = useRef(content);
25
+ // Only committed open content may survive the parent's close-time state cleanup.
26
+ useLayoutEffect(() => {
27
+ if (props.isOpen)
28
+ snapshot.current = content;
29
+ }, [props.isOpen, content]);
30
+ return props.isOpen ? content : snapshot.current;
31
+ }
32
+ function useConfirmation({ isOpen, isLoading, onConfirm, onClose }) {
33
+ const [hasConfirmed, setHasConfirmed] = useState(false);
34
+ const [isWorking, setIsWorking] = useState(false);
35
+ const isBusy = Boolean(isLoading) || isWorking;
36
+ const [wasOpen, setWasOpen] = useState(isOpen);
37
+ if (isOpen !== wasOpen) {
38
+ setWasOpen(isOpen);
39
+ if (isOpen) {
40
+ setHasConfirmed(false);
41
+ setIsWorking(false);
42
+ }
43
+ }
44
+ const handleConfirm = () => {
45
+ setHasConfirmed(true);
46
+ const result = onConfirm();
47
+ if (result instanceof Promise) {
48
+ setIsWorking(true);
49
+ void result
50
+ .then(() => {
51
+ onClose();
52
+ })
53
+ .catch(() => {
54
+ setHasConfirmed(false);
55
+ })
56
+ .finally(() => {
57
+ setIsWorking(false);
58
+ });
59
+ }
60
+ else {
61
+ onClose();
62
+ }
63
+ };
64
+ return { hasConfirmed, isBusy, handleConfirm };
65
+ }
66
+ export default function ConfirmActionModal(props) {
67
+ const content = useModalContent(props);
68
+ const confirmation = useConfirmation(props);
69
+ return (_jsx(Dialog, { open: props.isOpen, onOpenChange: onDialogOpenChange(props.onClose), children: _jsxs(DialogContent, { onOpenAutoFocus: (event) => event.preventDefault(), className: "flex w-full max-w-sm flex-col items-center gap-4 border border-border bg-[color-mix(in_oklch,var(--card)_55%,transparent)] p-6 text-center shadow-lg backdrop-blur-xl", onInteractOutside: (event) => {
70
+ const target = event.target;
71
+ if (target instanceof Element && target.closest('[data-slot="tooltip-content"]')) {
72
+ event.preventDefault();
73
+ }
74
+ }, children: [_jsx(ConfirmationContent, { content: content, moreInfoLabel: props.moreInfoLabel }), _jsx(ConfirmationActions, { ...props, ...confirmation })] }) }));
75
+ }
76
+ function ConfirmationContent({ content, moreInfoLabel, }) {
77
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center justify-center gap-1", children: [_jsx(DialogTitle, { className: "text-lg leading-normal font-semibold", children: content.title }), content.descriptionInTooltip && (_jsx(DescriptionTooltip, { description: content.description, moreInfoLabel: moreInfoLabel }))] }), content.children, _jsx(DialogDescription, { className: content.descriptionInTooltip ? 'sr-only' : 'text-sm text-muted-foreground', children: content.description })] }));
78
+ }
79
+ function ConfirmationActions(props) {
80
+ return (_jsxs("div", { className: "mt-2 flex w-full gap-3", children: [_jsx(Button, { type: "button", variant: "secondary", size: "lg", onClick: props.onClose, disabled: props.isBusy, className: "flex-1 rounded-full", children: props.cancelLabel }), _jsx(Button, { type: "button", variant: props.isDestructive ? 'destructive' : 'default', size: "lg", onClick: props.handleConfirm, disabled: props.hasConfirmed || props.isConfirmDisabled || props.isBusy, "aria-busy": props.isBusy, className: "flex-1 rounded-full font-semibold", children: props.isBusy ? (_jsxs("span", { className: "flex items-center justify-center gap-1.5", children: [_jsx(Loader2, { className: "size-4 animate-spin" }), _jsx("span", { children: props.busyLabel })] })) : (props.confirmLabel) })] }));
81
+ }
82
+ /** Click-only: hover would open it while the pointer is just passing the title. */
83
+ function DescriptionTooltip({ description, moreInfoLabel, }) {
84
+ const [isOpen, setIsOpen] = useState(false);
85
+ return (_jsxs(Tooltip, { open: isOpen, children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": moreInfoLabel, "aria-expanded": isOpen, className: "min-h-11 min-w-11 text-muted-foreground", onClick: () => setIsOpen((current) => !current), children: _jsx(Info, {}) }) }), _jsx(TooltipContent, { side: "bottom", sideOffset: 6, className: "block max-w-xs whitespace-normal text-center leading-snug", onPointerDownOutside: () => setIsOpen(false), onEscapeKeyDown: () => setIsOpen(false), children: description })] }));
86
+ }
87
+ export { ConfirmActionModal };
88
+ //# sourceMappingURL=confirm-action-modal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confirm-action-modal.js","sourceRoot":"","sources":["../../src/components/confirm-action-modal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAqDvE,SAAS,eAAe,CAAC,KAA8B;IACrD,MAAM,OAAO,GAAG,OAAO,CACrB,GAAG,EAAE,CAAC,CAAC;QACL,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,YAAY,EAAE,KAAK,CAAC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ops' inline two-step delete,
4
+ * ported with its semantics verbatim and its hard-coded strings moved to
5
+ * props: first tap arms, second executes; disarms on cancel or when focus
6
+ * leaves the group; a failed delete surfaces the error inline and STAYS
7
+ * ARMED for retry (a silent no-op delete is the worst outcome).
8
+ *
9
+ * This is one of the two sanctioned destructive-action shapes (Justin's
10
+ * decision, Dec 4, 2026): DeleteButton for row-level deletes,
11
+ * ConfirmActionModal for high-impact or irreversible actions.
12
+ */
13
+ export interface DeleteButtonProps {
14
+ /** Resting label, e.g. "Delete vendor". */
15
+ label: string;
16
+ /** Armed label, e.g. "Confirm delete". */
17
+ confirmLabel: string;
18
+ /** e.g. "Keep". */
19
+ cancelLabel: string;
20
+ /** e.g. "Deleting…". Falls back to confirmLabel. */
21
+ busyLabel?: string;
22
+ onDelete: () => Promise<void>;
23
+ }
24
+ declare function DeleteButton({ label, confirmLabel, cancelLabel, busyLabel, onDelete, }: DeleteButtonProps): React.JSX.Element;
25
+ export { DeleteButton };
26
+ //# sourceMappingURL=delete-button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-button.d.ts","sourceRoot":"","sources":["../../src/components/delete-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B;;;;;;;;;;GAUG;AACH,MAAM,WAAW,iBAAiB;IAChC,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B;AAED,iBAAS,YAAY,CAAC,EACpB,KAAK,EACL,YAAY,EACZ,WAAW,EACX,SAAS,EACT,QAAQ,GACT,EAAE,iBAAiB,qBAgEnB;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { Button } from './button.js';
4
+ import { FormError } from './form-field.js';
5
+ function DeleteButton({ label, confirmLabel, cancelLabel, busyLabel, onDelete, }) {
6
+ const [armed, setArmed] = React.useState(false);
7
+ const [busy, setBusy] = React.useState(false);
8
+ const [error, setError] = React.useState(null);
9
+ const handleConfirm = async () => {
10
+ setBusy(true);
11
+ setError(null);
12
+ try {
13
+ await onDelete();
14
+ setArmed(false);
15
+ }
16
+ catch (err) {
17
+ // Surface the failure inline and stay armed so the user can retry.
18
+ setError(err instanceof Error ? err.message : 'Could not delete. Please try again.');
19
+ }
20
+ finally {
21
+ setBusy(false);
22
+ }
23
+ };
24
+ if (!armed) {
25
+ return (_jsxs("span", { "data-slot": "delete-button", className: "inline-flex flex-col items-start gap-1", children: [_jsx(Button, { type: "button", variant: "ghost", className: "text-destructive hover:bg-danger-bg hover:text-danger-foreground", onClick: () => {
26
+ setError(null);
27
+ setArmed(true);
28
+ }, children: label }), error ? _jsx(FormError, { message: error }) : null] }));
29
+ }
30
+ return (_jsxs("span", { "data-slot": "delete-button", className: "inline-flex flex-col items-start gap-1", onBlur: (event) => {
31
+ if (!event.currentTarget.contains(event.relatedTarget))
32
+ setArmed(false);
33
+ }, children: [_jsxs("span", { className: "flex items-center gap-2", children: [_jsx(Button, { type: "button", disabled: busy, "aria-busy": busy, onClick: handleConfirm, className: "bg-destructive text-destructive-foreground hover:bg-destructive/90", children: busy ? (busyLabel ?? confirmLabel) : confirmLabel }), _jsx(Button, { type: "button", variant: "ghost", onClick: () => setArmed(false), children: cancelLabel })] }), error ? _jsx(FormError, { message: error }) : null] }));
34
+ }
35
+ export { DeleteButton };
36
+ //# sourceMappingURL=delete-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-button.js","sourceRoot":"","sources":["../../src/components/delete-button.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,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jB,CAAC,YAEA,KAAK,GACC,EACR,KAAK,CAAC,CAAC,CAAC,KAAC,SAAS,IAAC,OAAO,EAAE,KAAK,GAAI,CAAC,CAAC,CAAC,IAAI,IACxC,CACR,CAAC;IACJ,CAAC;IAED,OAAO,CAEL,6BACY,eAAe,EACzB,SAAS,EAAC,wCAAwC,EAClD,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;YAChB,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC;gBAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC1E,CAAC,aAED,gBAAM,SAAS,EAAC,yBAAyB,aACvC,KAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,IAAI,eACH,IAAI,EACf,OAAO,EAAE,aAAa,EACtB,SAAS,EAAC,oEAAoE,YAE7E,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,GAC3C,EACT,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAC,OAAO,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,YACjE,WAAW,GACL,IACJ,EACN,KAAK,CAAC,CAAC,CAAC,KAAC,SAAS,IAAC,OAAO,EAAE,KAAK,GAAI,CAAC,CAAC,CAAC,IAAI,IACxC,CACR,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { Dialog as DialogPrimitive } from 'radix-ui';
2
+ import type * as React from 'react';
3
+ declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
4
+ declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
5
+ declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
6
+ declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element;
7
+ declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
8
+ declare function DialogContent({ className, children, showCloseButton, closeLabel, onOpenAutoFocus, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
9
+ showCloseButton?: boolean;
10
+ /** sr-only label for the close button (DESIGN.md §4.1: residual built-in
11
+ * strings are accessibility labels, each with an override prop). */
12
+ closeLabel?: string;
13
+ }): React.JSX.Element;
14
+ declare function DialogHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
15
+ declare function DialogFooter({ className, showCloseButton, closeLabel, children, ...props }: React.ComponentProps<'div'> & {
16
+ showCloseButton?: boolean;
17
+ closeLabel?: string;
18
+ }): React.JSX.Element;
19
+ declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
20
+ declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
21
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
22
+ //# sourceMappingURL=dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/components/dialog.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAKpC,iBAAS,MAAM,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,qBAE9E;AAED,iBAAS,aAAa,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAExF;AAED,iBAAS,YAAY,CAAC,E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AM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAC"}
@@ -0,0 +1,38 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { XIcon } from 'lucide-react';
4
+ import { Dialog as DialogPrimitive } from 'radix-ui';
5
+ import { cn } from '../lib/utils.js';
6
+ import { Button } from './button.js';
7
+ function Dialog({ ...props }) {
8
+ return _jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
9
+ }
10
+ function DialogTrigger({ ...props }) {
11
+ return _jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
12
+ }
13
+ function DialogPortal({ ...props }) {
14
+ return _jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
15
+ }
16
+ function DialogClose({ ...props }) {
17
+ return _jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
18
+ }
19
+ function DialogOverlay({ className, ...props }) {
20
+ return (_jsx(DialogPrimitive.Overlay, { "data-slot": "dialog-overlay", className: cn('fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0', className), ...props }));
21
+ }
22
+ function DialogContent({ className, children, showCloseButton = true, closeLabel = 'Close', onOpenAutoFocus = (event) => event.preventDefault(), ...props }) {
23
+ return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { "data-slot": "dialog-content", onOpenAutoFocus: onOpenAutoFocus, className: cn('fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100dvh-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95', className), ...props, children: [children, showCloseButton && (_jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", asChild: true, children: _jsxs(Button, { variant: "ghost", className: "absolute top-2 right-2 after:absolute after:-inset-2", size: "icon-sm", children: [_jsx(XIcon, {}), _jsx("span", { className: "sr-only", children: closeLabel })] }) }))] })] }));
24
+ }
25
+ function DialogHeader({ className, ...props }) {
26
+ return (_jsx("div", { "data-slot": "dialog-header", className: cn('flex flex-col gap-2', className), ...props }));
27
+ }
28
+ function DialogFooter({ className, showCloseButton = false, closeLabel = 'Close', children, ...props }) {
29
+ return (_jsxs("div", { "data-slot": "dialog-footer", className: cn('-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end', className), ...props, children: [children, showCloseButton && (_jsx(DialogPrimitive.Close, { asChild: true, children: _jsx(Button, { variant: "outline", children: closeLabel }) }))] }));
30
+ }
31
+ function DialogTitle({ className, ...props }) {
32
+ return (_jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", className: cn('font-heading text-base leading-none font-medium', className), ...props }));
33
+ }
34
+ function DialogDescription({ className, ...props }) {
35
+ return (_jsx(DialogPrimitive.Description, { "data-slot": "dialog-description", className: cn('text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground', className), ...props }));
36
+ }
37
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
38
+ //# sourceMappingURL=dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../src/components/dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;A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AAoG,EACpG,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';
2
+ import * as React from 'react';
3
+ declare function DropdownMenu({ modal, open: controlledOpen, defaultOpen, onOpenChange, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): React.JSX.Element;
4
+ declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): React.JSX.Element;
5
+ declare function DropdownMenuTrigger({ onPointerDown, onClick, onKeyDown, disabled, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): React.JSX.Element;
6
+ declare function DropdownMenuContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): React.JSX.Element;
7
+ declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): React.JSX.Element;
8
+ declare function DropdownMenuItem({ className, inset, variant, onSelect, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
9
+ inset?: boolean;
10
+ variant?: 'default' | 'destructive';
11
+ }): React.JSX.Element;
12
+ declare function DropdownMenuCheckboxItem({ className, children, checked, inset, onSelect, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {
13
+ inset?: boolean;
14
+ }): React.JSX.Element;
15
+ declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): React.JSX.Element;
16
+ declare function DropdownMenuRadioItem({ className, children, inset, onSelect, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {
17
+ inset?: boolean;
18
+ }): React.JSX.Element;
19
+ declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
20
+ inset?: boolean;
21
+ }): React.JSX.Element;
22
+ declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): React.JSX.Element;
23
+ declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
24
+ declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): React.JSX.Element;
25
+ declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
26
+ inset?: boolean;
27
+ }): React.JSX.Element;
28
+ declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): React.JSX.Element;
29
+ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, };
30
+ //# sourceMappingURL=dropdown-menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../src/components/dropdown-menu.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,IAAI,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,iBAAS,YAAY,CAAC,EACpB,KAAa,EACb,IAAI,EAAE,cAAc,EACpB,WAAW,EACX,YAAY,EACZ,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,IAAI,CAAC,qBAazD;AAED,iBAAS,kBAAkB,CAAC,EAC1B,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,C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jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Tabbie's DropdownMenu, ported per DESIGN.md §2.8: the click-open
4
+ * disclosure hook is vendored into this package
5
+ * (hooks/useClickOpenDisclosure), and the haptic calls route through the
6
+ * library haptics engine — inert until an app calls configureHaptics().
7
+ * Item min-height is 40px (48px when an item is a primary touch action is
8
+ * the call site's responsibility, via className).
9
+ */
10
+ import { CheckIcon, ChevronRightIcon } from 'lucide-react';
11
+ import { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';
12
+ import * as React from 'react';
13
+ import { triggerHaptic } from '../haptics.js';
14
+ import { useClickOpenDisclosure, } from '../hooks/useClickOpenDisclosure.js';
15
+ import { cn } from '../lib/utils.js';
16
+ const DropdownClickContext = React.createContext(null);
17
+ function DropdownMenu({ modal = false, open: controlledOpen, defaultOpen, onOpenChange, ...props }) {
18
+ const disclosure = useClickOpenDisclosure({ open: controlledOpen, defaultOpen, onOpenChange });
19
+ return (_jsx(DropdownClickContext.Provider, { value: disclosure, children: _jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", modal: modal, open: disclosure.open, onOpenChange: disclosure.handleRootOpenChange, ...props }) }));
20
+ }
21
+ function DropdownMenuPortal({ ...props }) {
22
+ return _jsx(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
23
+ }
24
+ function DropdownMenuTrigger({ onPointerDown, onClick, onKeyDown, disabled, ...props }) {
25
+ const dropdownClick = React.useContext(DropdownClickContext);
26
+ return (_jsx(DropdownMenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", disabled: disabled, onPointerDown: (event) => {
27
+ dropdownClick?.handleTriggerPointerDown();
28
+ onPointerDown?.(event);
29
+ }, onClick: (event) => {
30
+ onClick?.(event);
31
+ if (!event.defaultPrevented && !disabled) {
32
+ triggerHaptic('light');
33
+ dropdownClick?.handleTriggerClick();
34
+ }
35
+ }, onKeyDown: (event) => {
36
+ if (event.key === 'Enter' || event.key === ' ' || event.key === 'ArrowDown') {
37
+ triggerHaptic('light');
38
+ }
39
+ onKeyDown?.(event);
40
+ }, ...props }));
41
+ }
42
+ function DropdownMenuContent({ className, align = 'start', sideOffset = 4, ...props }) {
43
+ return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { "data-slot": "dropdown-menu-content", sideOffset: sideOffset, align: align, className: cn('pointer-events-auto z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95', className), ...props }) }));
44
+ }
45
+ function DropdownMenuGroup({ ...props }) {
46
+ return _jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
47
+ }
48
+ function DropdownMenuItem({ className, inset, variant = 'default', onSelect, ...props }) {
49
+ return (_jsx(DropdownMenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn("group/dropdown-menu-item relative flex min-h-10 cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive", className), onSelect: (event) => {
50
+ triggerHaptic(variant === 'destructive' ? 'heavy' : 'light');
51
+ onSelect?.(event);
52
+ }, ...props }));
53
+ }
54
+ function DropdownMenuCheckboxItem({ className, children, checked, inset, onSelect, ...props }) {
55
+ return (_jsxs(DropdownMenuPrimitive.CheckboxItem, { "data-slot": "dropdown-menu-checkbox-item", "data-inset": inset, className: cn("relative flex min-h-10 cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), checked: checked, onSelect: (event) => {
56
+ triggerHaptic('selection');
57
+ onSelect?.(event);
58
+ }, ...props, children: [_jsx("span", { className: "pointer-events-none absolute right-2 flex items-center justify-center", "data-slot": "dropdown-menu-checkbox-item-indicator", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CheckIcon, {}) }) }), children] }));
59
+ }
60
+ function DropdownMenuRadioGroup({ ...props }) {
61
+ return _jsx(DropdownMenuPrimitive.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props });
62
+ }
63
+ function DropdownMenuRadioItem({ className, children, inset, onSelect, ...props }) {
64
+ return (_jsxs(DropdownMenuPrimitive.RadioItem, { "data-slot": "dropdown-menu-radio-item", "data-inset": inset, className: cn("relative flex min-h-10 cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), onSelect: (event) => {
65
+ triggerHaptic('selection');
66
+ onSelect?.(event);
67
+ }, ...props, children: [_jsx("span", { className: "pointer-events-none absolute right-2 flex items-center justify-center", "data-slot": "dropdown-menu-radio-item-indicator", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CheckIcon, {}) }) }), children] }));
68
+ }
69
+ function DropdownMenuLabel({ className, inset, ...props }) {
70
+ return (_jsx(DropdownMenuPrimitive.Label, { "data-slot": "dropdown-menu-label", "data-inset": inset, className: cn('px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7', className), ...props }));
71
+ }
72
+ function DropdownMenuSeparator({ className, ...props }) {
73
+ return (_jsx(DropdownMenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", className: cn('-mx-1 my-1 h-px bg-border', className), ...props }));
74
+ }
75
+ function DropdownMenuShortcut({ className, ...props }) {
76
+ return (_jsx("span", { "data-slot": "dropdown-menu-shortcut", className: cn('ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground', className), ...props }));
77
+ }
78
+ function DropdownMenuSub({ ...props }) {
79
+ return _jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
80
+ }
81
+ function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
82
+ return (_jsxs(DropdownMenuPrimitive.SubTrigger, { "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset, className: cn("flex min-h-10 cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto" })] }));
83
+ }
84
+ function DropdownMenuSubContent({ className, ...props }) {
85
+ return (_jsx(DropdownMenuPrimitive.SubContent, { "data-slot": "dropdown-menu-sub-content", className: cn('pointer-events-auto z-50 min-w-[96px] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95', className), ...props }));
86
+ }
87
+ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, };
88
+ //# sourceMappingURL=dropdown-menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../src/components/dropdown-menu.tsx"],"names":[],"mappings":";AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,YAAY,IAAI,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAEL,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,MAAM,oBAAoB,GAAG,KAAK,CAAC,aAAa,CAA6B,IAAI,CAAC,CAAC;AAEnF,SAAS,YAAY,CAAC,EACpB,KAAK,GAAG,KAAK,EACb,IAAI,EAAE,cAAc,EACpB,WAAW,EACX,YAAY,EACZ,GAAG,KAAK,EACgD;IACxD,MAAM,UAAU,GAAG,sBAAsB,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC,CAAC;IAC/F,OAAO,CACL,KAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,UAA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EACrB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,GACpB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { LucideIcon } from 'lucide-react';
2
+ import type * as React from 'react';
3
+ /**
4
+ * EmptyState (DESIGN.md §3.2) — absorbs Wedding Ops' EmptyState
5
+ * (title/body/children) and Tabbie's FriendsEmptyState (icon medallion +
6
+ * title + description + action). All copy arrives via props; the action is
7
+ * the caller's node (typically a Button — the app owns handler + label).
8
+ */
9
+ export interface EmptyStateProps {
10
+ /** Rendered in the medallion; omit for a text-only state. */
11
+ icon?: LucideIcon;
12
+ title: string;
13
+ description?: string;
14
+ /** Typically a Button; the app owns the handler and label. */
15
+ action?: React.ReactNode;
16
+ className?: string;
17
+ }
18
+ declare function EmptyState({ icon: Icon, title, description, action, className }: EmptyStateProps): React.JSX.Element;
19
+ export { EmptyState };
20
+ //# sourceMappingURL=empty-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"empty-state.d.ts","sourceRoot":"","sources":["../../src/components/empty-state.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAKpC;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,6DAA6D;IAC7D,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8DAA8D;IAC9D,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iBAAS,UAAU,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,eAAe,qBAuBzF;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}