@devalok/shilp-sutra 0.18.0 → 0.18.2

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 (214) hide show
  1. package/dist/_chunks/motion-provider.js +24 -0
  2. package/dist/_chunks/primitives.js +101 -101
  3. package/dist/_chunks/tree-view.js +12 -12
  4. package/dist/_chunks/use-calendar.js +1 -1
  5. package/dist/_chunks/vendor-utils.js +2 -2
  6. package/dist/composed/activity-feed.js +21 -21
  7. package/dist/composed/avatar-group.js +25 -25
  8. package/dist/composed/command-palette.js +3 -3
  9. package/dist/composed/confirm-dialog.js +1 -1
  10. package/dist/composed/content-card.js +1 -1
  11. package/dist/composed/empty-state.js +2 -2
  12. package/dist/composed/error-boundary.js +2 -2
  13. package/dist/composed/global-loading.js +10 -10
  14. package/dist/composed/lib/string-utils.d.ts +0 -1
  15. package/dist/composed/lib/string-utils.js +0 -1
  16. package/dist/composed/loading-skeleton.js +1 -1
  17. package/dist/composed/member-picker.js +6 -6
  18. package/dist/composed/page-header.js +1 -1
  19. package/dist/composed/page-skeletons.js +1 -1
  20. package/dist/composed/priority-indicator.js +6 -6
  21. package/dist/composed/rich-text-editor.js +1 -1
  22. package/dist/composed/schedule-view.js +15 -15
  23. package/dist/composed/simple-tooltip.js +8 -8
  24. package/dist/composed/status-badge.js +12 -12
  25. package/dist/motion/index.d.ts +1 -1
  26. package/dist/motion/index.d.ts.map +1 -1
  27. package/dist/motion/index.js +8 -6
  28. package/dist/motion/primitives-index.js +184 -8
  29. package/dist/shell/app-command-palette.js +1 -1
  30. package/dist/shell/bottom-navbar.js +3 -3
  31. package/dist/shell/notification-center.js +35 -35
  32. package/dist/shell/notification-preferences.js +29 -28
  33. package/dist/shell/sidebar.js +56 -56
  34. package/dist/shell/top-bar.js +25 -25
  35. package/dist/ui/accordion.js +11 -11
  36. package/dist/ui/alert-dialog.js +41 -41
  37. package/dist/ui/alert.js +10 -10
  38. package/dist/ui/aspect-ratio.js +5 -5
  39. package/dist/ui/autocomplete.js +15 -15
  40. package/dist/ui/avatar.js +4 -4
  41. package/dist/ui/badge.js +11 -11
  42. package/dist/ui/banner.js +3 -3
  43. package/dist/ui/breadcrumb.js +8 -8
  44. package/dist/ui/button-group.js +4 -4
  45. package/dist/ui/button.js +25 -25
  46. package/dist/ui/card.js +5 -5
  47. package/dist/ui/charts/index.js +4 -4
  48. package/dist/ui/checkbox.js +4 -4
  49. package/dist/ui/chip.js +14 -14
  50. package/dist/ui/code.js +1 -1
  51. package/dist/ui/collapsible.js +7 -7
  52. package/dist/ui/color-input.js +1 -1
  53. package/dist/ui/combobox.js +5 -5
  54. package/dist/ui/container.js +4 -4
  55. package/dist/ui/context-menu.js +4 -4
  56. package/dist/ui/data-table-toolbar.js +18 -18
  57. package/dist/ui/data-table.js +55 -55
  58. package/dist/ui/dialog.js +3 -3
  59. package/dist/ui/dropdown-menu.js +3 -3
  60. package/dist/ui/file-upload.js +10 -10
  61. package/dist/ui/form.js +1 -1
  62. package/dist/ui/hover-card.js +12 -12
  63. package/dist/ui/icon-button.js +9 -9
  64. package/dist/ui/index.js +322 -516
  65. package/dist/ui/input-otp.js +4 -4
  66. package/dist/ui/input.js +9 -9
  67. package/dist/ui/label.js +9 -9
  68. package/dist/ui/lib/date-utils.d.ts +0 -1
  69. package/dist/{_chunks → ui/lib}/date-utils.js +1 -2
  70. package/dist/{_chunks/motion2.js → ui/lib/motion.js} +13 -14
  71. package/dist/ui/lib/use-ripple.d.ts.map +1 -1
  72. package/dist/ui/lib/utils.js +1 -1
  73. package/dist/ui/link.js +1 -1
  74. package/dist/ui/menubar.js +66 -66
  75. package/dist/ui/navigation-menu.js +4 -4
  76. package/dist/ui/number-input.js +9 -9
  77. package/dist/ui/pagination.js +1 -1
  78. package/dist/ui/popover.js +18 -18
  79. package/dist/ui/progress.js +4 -4
  80. package/dist/ui/radio.js +11 -11
  81. package/dist/ui/search-input.js +2 -2
  82. package/dist/ui/segmented-control.d.ts +2 -0
  83. package/dist/ui/segmented-control.d.ts.map +1 -1
  84. package/dist/ui/segmented-control.js +59 -55
  85. package/dist/ui/select.js +19 -19
  86. package/dist/ui/separator.js +5 -5
  87. package/dist/ui/sheet.js +10 -10
  88. package/dist/ui/sidebar.js +574 -38
  89. package/dist/ui/skeleton.js +1 -1
  90. package/dist/ui/slider.js +9 -9
  91. package/dist/ui/spinner.js +2 -2
  92. package/dist/ui/stack.js +1 -1
  93. package/dist/ui/stat-card.js +35 -35
  94. package/dist/ui/stepper.d.ts +1 -3
  95. package/dist/ui/stepper.d.ts.map +1 -1
  96. package/dist/ui/stepper.js +74 -74
  97. package/dist/ui/switch.js +7 -7
  98. package/dist/ui/table.js +28 -28
  99. package/dist/ui/tabs.js +10 -10
  100. package/dist/ui/text.js +1 -1
  101. package/dist/ui/textarea.js +10 -10
  102. package/dist/ui/toast.js +12 -12
  103. package/dist/ui/toaster.js +11 -11
  104. package/dist/ui/toggle-group.js +2 -2
  105. package/dist/ui/toggle.js +8 -8
  106. package/dist/ui/tooltip.js +21 -21
  107. package/dist/ui/visually-hidden.js +3 -3
  108. package/docs/components/_header.md +83 -0
  109. package/docs/components/composed/activity-feed.md +43 -0
  110. package/docs/components/composed/avatar-group.md +32 -0
  111. package/docs/components/composed/command-palette.md +40 -0
  112. package/docs/components/composed/confirm-dialog.md +46 -0
  113. package/docs/components/composed/content-card.md +36 -0
  114. package/docs/components/composed/date-picker.md +130 -0
  115. package/docs/components/composed/empty-state.md +53 -0
  116. package/docs/components/composed/error-boundary.md +29 -0
  117. package/docs/components/composed/global-loading.md +27 -0
  118. package/docs/components/composed/loading-skeleton.md +51 -0
  119. package/docs/components/composed/member-picker.md +35 -0
  120. package/docs/components/composed/page-header.md +41 -0
  121. package/docs/components/composed/page-skeletons.md +32 -0
  122. package/docs/components/composed/priority-indicator.md +32 -0
  123. package/docs/components/composed/rich-text-editor.md +71 -0
  124. package/docs/components/composed/schedule-view.md +39 -0
  125. package/docs/components/composed/simple-tooltip.md +33 -0
  126. package/docs/components/composed/status-badge.md +41 -0
  127. package/docs/components/shell/app-command-palette.md +44 -0
  128. package/docs/components/shell/bottom-navbar.md +48 -0
  129. package/docs/components/shell/command-registry.md +48 -0
  130. package/docs/components/shell/link-context.md +41 -0
  131. package/docs/components/shell/notification-center.md +63 -0
  132. package/docs/components/shell/notification-preferences.md +42 -0
  133. package/docs/components/shell/sidebar.md +88 -0
  134. package/docs/components/shell/top-bar.md +63 -0
  135. package/docs/components/ui/accordion.md +48 -0
  136. package/docs/components/ui/alert-dialog.md +58 -0
  137. package/docs/components/ui/alert.md +43 -0
  138. package/docs/components/ui/aspect-ratio.md +25 -0
  139. package/docs/components/ui/autocomplete.md +48 -0
  140. package/docs/components/ui/avatar.md +34 -0
  141. package/docs/components/ui/badge.md +48 -0
  142. package/docs/components/ui/banner.md +35 -0
  143. package/docs/components/ui/breadcrumb.md +37 -0
  144. package/docs/components/ui/button-group.md +32 -0
  145. package/docs/components/ui/button.md +55 -0
  146. package/docs/components/ui/card.md +48 -0
  147. package/docs/components/ui/charts.md +43 -0
  148. package/docs/components/ui/checkbox.md +31 -0
  149. package/docs/components/ui/chip.md +43 -0
  150. package/docs/components/ui/code.md +28 -0
  151. package/docs/components/ui/collapsible.md +40 -0
  152. package/docs/components/ui/color-input.md +37 -0
  153. package/docs/components/ui/combobox.md +54 -0
  154. package/docs/components/ui/container.md +26 -0
  155. package/docs/components/ui/context-menu.md +43 -0
  156. package/docs/components/ui/data-table-toolbar.md +44 -0
  157. package/docs/components/ui/data-table.md +91 -0
  158. package/docs/components/ui/dialog.md +51 -0
  159. package/docs/components/ui/dropdown-menu.md +45 -0
  160. package/docs/components/ui/file-upload.md +41 -0
  161. package/docs/components/ui/form.md +51 -0
  162. package/docs/components/ui/hover-card.md +32 -0
  163. package/docs/components/ui/icon-button.md +33 -0
  164. package/docs/components/ui/input-otp.md +44 -0
  165. package/docs/components/ui/input.md +48 -0
  166. package/docs/components/ui/label.md +25 -0
  167. package/docs/components/ui/link.md +29 -0
  168. package/docs/components/ui/menubar.md +44 -0
  169. package/docs/components/ui/navigation-menu.md +46 -0
  170. package/docs/components/ui/number-input.md +44 -0
  171. package/docs/components/ui/pagination.md +48 -0
  172. package/docs/components/ui/popover.md +30 -0
  173. package/docs/components/ui/progress.md +29 -0
  174. package/docs/components/ui/radio.md +34 -0
  175. package/docs/components/ui/search-input.md +43 -0
  176. package/docs/components/ui/segmented-control.md +50 -0
  177. package/docs/components/ui/select.md +49 -0
  178. package/docs/components/ui/separator.md +29 -0
  179. package/docs/components/ui/sheet.md +47 -0
  180. package/docs/components/ui/sidebar.md +72 -0
  181. package/docs/components/ui/skeleton.md +77 -0
  182. package/docs/components/ui/slider.md +29 -0
  183. package/docs/components/ui/spinner.md +50 -0
  184. package/docs/components/ui/stack.md +39 -0
  185. package/docs/components/ui/stat-card.md +61 -0
  186. package/docs/components/ui/stepper.md +49 -0
  187. package/docs/components/ui/switch.md +34 -0
  188. package/docs/components/ui/table.md +47 -0
  189. package/docs/components/ui/tabs.md +56 -0
  190. package/docs/components/ui/text.md +37 -0
  191. package/docs/components/ui/textarea.md +39 -0
  192. package/docs/components/ui/toast.md +65 -0
  193. package/docs/components/ui/toaster.md +47 -0
  194. package/docs/components/ui/toggle-group.md +43 -0
  195. package/docs/components/ui/toggle.md +37 -0
  196. package/docs/components/ui/tooltip.md +33 -0
  197. package/docs/components/ui/tree-view.md +65 -0
  198. package/docs/components/ui/visually-hidden.md +21 -0
  199. package/llms-full.txt +3384 -1591
  200. package/llms.txt +4 -4
  201. package/package.json +28 -3
  202. package/dist/_chunks/avatar.js +0 -52
  203. package/dist/_chunks/button-group.js +0 -27
  204. package/dist/_chunks/button.js +0 -113
  205. package/dist/_chunks/card.js +0 -50
  206. package/dist/_chunks/checkbox.js +0 -16
  207. package/dist/_chunks/form.js +0 -27
  208. package/dist/_chunks/sidebar.js +0 -606
  209. package/dist/_chunks/spinner.js +0 -64
  210. package/dist/_chunks/tooltip.js +0 -30
  211. package/dist/_chunks/utils.js +0 -17
  212. package/dist/motion/motion-provider.js +0 -24
  213. package/dist/motion/primitives.js +0 -187
  214. /package/dist/_chunks/{motion.js → framer.js} +0 -0
package/llms.txt CHANGED
@@ -17,8 +17,8 @@
17
17
  **New motion system:**
18
18
  - `import { MotionProvider, springs, tweens } from '@devalok/shilp-sutra/motion'`
19
19
  - `import { MotionFade, MotionCollapse, MotionSlide, MotionPop, MotionScale, MotionStagger } from '@devalok/shilp-sutra/motion/primitives'`
20
- - Springs: `springs.bouncy`, `springs.smooth`, `springs.snappy`, `springs.gentle`, `springs.rigid`
21
- - Tweens: `tweens.fade`, `tweens.standard`, `tweens.gentle`
20
+ - Springs: `springs.snappy`, `springs.smooth`, `springs.bouncy`, `springs.gentle`
21
+ - Tweens: `tweens.fade`, `tweens.colorShift`
22
22
 
23
23
  **Spinner v2:** New props `state?: 'spinning' | 'success' | 'error'`, `variant?: 'filled' | 'bare'`, `delay?: number`, `onComplete?: () => void`
24
24
 
@@ -286,8 +286,8 @@ NOTIFICATION SELECTION GUIDE:
286
286
  ## Server-Safe Components (no "use client")
287
287
 
288
288
  These can be imported directly in Next.js Server Components:
289
- - UI: Text, Skeleton, Spinner, Stack, Container, Table (and sub-components), Code, VisuallyHidden
290
- - Composed: ContentCard, EmptyState, PageHeader, LoadingSkeleton, PageSkeletons, PriorityIndicator, StatusBadge
289
+ - UI: Text, Skeleton, Stack, Container, Table (and sub-components), Code, VisuallyHidden
290
+ - Composed: ContentCard, PageHeader, LoadingSkeleton, PageSkeletons, PriorityIndicator
291
291
 
292
292
  Use per-component imports for server components:
293
293
  import { Text } from '@devalok/shilp-sutra/ui/text'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devalok/shilp-sutra",
3
- "version": "0.18.0",
3
+ "version": "0.18.2",
4
4
  "description": "Devalok Design System — tokens, components, and patterns for Next.js",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -483,6 +483,11 @@
483
483
  "default": "./dist/shell/top-bar.js",
484
484
  "types": "./dist/shell/top-bar.d.ts"
485
485
  },
486
+ "./shell/command-registry": {
487
+ "import": "./dist/shell/command-registry.js",
488
+ "default": "./dist/shell/command-registry.js",
489
+ "types": "./dist/shell/command-registry.d.ts"
490
+ },
486
491
  "./hooks": {
487
492
  "import": "./dist/hooks/index.js",
488
493
  "default": "./dist/hooks/index.js",
@@ -509,6 +514,12 @@
509
514
  "default": "./dist/tailwind/index.js",
510
515
  "types": "./dist/tailwind/index.d.ts"
511
516
  },
517
+ "./tailwind/preset": {
518
+ "require": "./dist/tailwind/index.cjs",
519
+ "import": "./dist/tailwind/preset.js",
520
+ "default": "./dist/tailwind/preset.js",
521
+ "types": "./dist/tailwind/preset.d.ts"
522
+ },
512
523
  "./utils": {
513
524
  "import": "./dist/ui/lib/utils.js",
514
525
  "default": "./dist/ui/lib/utils.js",
@@ -520,6 +531,16 @@
520
531
  "default": "./dist/ui/lib/utils.js",
521
532
  "types": "./dist/ui/lib/utils.d.ts"
522
533
  },
534
+ "./ui/lib/motion": {
535
+ "import": "./dist/ui/lib/motion.js",
536
+ "default": "./dist/ui/lib/motion.js",
537
+ "types": "./dist/ui/lib/motion.d.ts"
538
+ },
539
+ "./ui/lib/date-utils": {
540
+ "import": "./dist/ui/lib/date-utils.js",
541
+ "default": "./dist/ui/lib/date-utils.js",
542
+ "types": "./dist/ui/lib/date-utils.d.ts"
543
+ },
523
544
  "./composed/lib/string-utils": {
524
545
  "import": "./dist/composed/lib/string-utils.js",
525
546
  "default": "./dist/composed/lib/string-utils.js",
@@ -534,18 +555,22 @@
534
555
  "import": "./dist/motion/primitives-index.js",
535
556
  "default": "./dist/motion/primitives-index.js",
536
557
  "types": "./dist/motion/primitives-index.d.ts"
537
- }
558
+ },
559
+ "./docs/*": "./docs/components/*"
538
560
  },
539
561
  "files": [
540
562
  "dist",
563
+ "docs/components",
541
564
  "fonts",
542
565
  "README.md",
543
566
  "llms.txt",
544
567
  "llms-full.txt"
545
568
  ],
546
569
  "scripts": {
547
- "build": "vite build && pnpm build:tokens && node scripts/fix-dts-primitives.mjs && node scripts/inject-use-client.mjs && node scripts/build-tailwind-cjs.mjs",
570
+ "build": "vite build && pnpm build:tokens && node scripts/fix-dts-primitives.mjs && node scripts/inject-use-client.mjs && node scripts/build-tailwind-cjs.mjs && pnpm build:docs",
548
571
  "build:tokens": "node scripts/copy-tokens.mjs",
572
+ "build:docs": "node scripts/build-component-docs.mjs",
573
+ "build:docs:check": "node scripts/build-component-docs.mjs --check",
549
574
  "typecheck": "tsc --noEmit",
550
575
  "lint": "eslint src/",
551
576
  "test": "vitest run",
@@ -1,52 +0,0 @@
1
- "use client";
2
- import { jsxs as p, jsx as l } from "react/jsx-runtime";
3
- import * as i from "react";
4
- import { R as n, I as o, F as t } from "./primitives.js";
5
- import { ag as u } from "./vendor-utils.js";
6
- import { t as h } from "./motion2.js";
7
- import { c as r } from "./utils.js";
8
- import { m as w } from "./motion.js";
9
- const x = u("relative flex shrink-0 overflow-hidden", {
10
- variants: {
11
- size: {
12
- xs: "h-ds-xs w-ds-xs",
13
- sm: "h-ds-sm w-ds-sm",
14
- md: "h-ds-md w-ds-md",
15
- lg: "h-ds-lg w-ds-lg",
16
- xl: "h-ds-xl w-ds-xl"
17
- },
18
- shape: {
19
- circle: "rounded-ds-full",
20
- square: "rounded-ds-none",
21
- rounded: "rounded-ds-md"
22
- }
23
- },
24
- defaultVariants: { size: "md", shape: "circle" }
25
- }), g = {
26
- online: "bg-success-9",
27
- offline: "bg-surface-3",
28
- busy: "bg-error-9",
29
- away: "bg-warning-9"
30
- }, b = {
31
- online: "Online",
32
- offline: "Offline",
33
- busy: "Busy",
34
- away: "Away"
35
- }, y = {
36
- xs: "h-ds-02b w-ds-02b",
37
- sm: "h-[8px] w-[8px]",
38
- md: "h-ds-03 w-ds-03",
39
- lg: "h-[12px] w-[12px]",
40
- xl: "h-ds-04 w-ds-04"
41
- }, N = i.forwardRef(({ className: s, size: a, shape: e, status: d, children: m, ...c }, f) => p("span", { className: "relative inline-flex shrink-0", children: [l(n, { ref: f, className: r(x({ size: a, shape: e }), s), ...c, children: m }), d && l("span", { className: r("absolute bottom-0 right-0 rounded-ds-full ring-2 ring-surface-1", g[d], y[a ?? "md"]), role: "img", "aria-label": b[d] })] }));
42
- N.displayName = n.displayName;
43
- const v = i.forwardRef(({ className: s, ...a }, e) => l(w.span, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: h.fade, className: "h-full w-full", children: l(o, { ref: e, className: r("aspect-square h-full w-full", s), ...a }) }));
44
- v.displayName = o.displayName;
45
- const R = i.forwardRef(({ className: s, ...a }, e) => l(t, { ref: e, className: r("flex h-full w-full items-center justify-center rounded-ds-full bg-accent-2 text-accent-11", s), ...a }));
46
- R.displayName = t.displayName;
47
- export {
48
- N as A,
49
- v as a,
50
- R as b,
51
- x as c
52
- };
@@ -1,27 +0,0 @@
1
- "use client";
2
- import { jsx as r } from "react/jsx-runtime";
3
- import * as o from "react";
4
- import { c as f } from "./utils.js";
5
- const l = o.createContext({});
6
- function h() {
7
- return o.useContext(l);
8
- }
9
- const p = o.forwardRef(({ className: u, variant: t, color: n, size: e, orientation: i = "horizontal", children: d, ...s }, c) => {
10
- const a = o.useMemo(() => ({ variant: t, color: n, size: e }), [t, n, e]);
11
- return r(l.Provider, { value: a, children: r("div", { ref: c, role: "group", className: f("inline-flex", i === "horizontal" ? [
12
- "flex-row",
13
- "[&>*:not(:first-child)]:rounded-l-none",
14
- "[&>*:not(:last-child)]:rounded-r-none",
15
- "[&>*:not(:first-child)]:-ml-px"
16
- ] : [
17
- "flex-col",
18
- "[&>*:not(:first-child)]:rounded-t-none",
19
- "[&>*:not(:last-child)]:rounded-b-none",
20
- "[&>*:not(:first-child)]:-mt-px"
21
- ], u), ...s, children: d }) });
22
- });
23
- p.displayName = "ButtonGroup";
24
- export {
25
- p as B,
26
- h as u
27
- };
@@ -1,113 +0,0 @@
1
- "use client";
2
- import { jsx as e, jsxs as C } from "react/jsx-runtime";
3
- import { ag as K } from "./vendor-utils.js";
4
- import { IconCheck as L, IconX as O } from "@tabler/icons-react";
5
- import { S as P, a as Q } from "./primitives.js";
6
- import * as n from "react";
7
- import { u as U } from "./button-group.js";
8
- import { s as Y } from "./motion2.js";
9
- import { c as a } from "./utils.js";
10
- import { S as Z } from "./spinner.js";
11
- import { A as _, m as $ } from "./motion.js";
12
- const R = K("inline-flex items-center justify-center gap-ds-03 whitespace-nowrap font-sans font-semibold select-none border border-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-action-disabled", {
13
- variants: {
14
- variant: {
15
- solid: "",
16
- default: "",
17
- // alias → solid
18
- outline: "",
19
- ghost: "",
20
- destructive: "",
21
- // alias → solid + error
22
- link: "text-info-11 underline-offset-4 hover:underline active:opacity-80"
23
- },
24
- color: {
25
- default: "",
26
- error: ""
27
- },
28
- size: {
29
- sm: "h-ds-sm rounded-ds-md px-ds-04 text-ds-sm",
30
- md: "h-ds-md rounded-ds-md px-ds-05 text-ds-md",
31
- lg: "h-ds-lg rounded-ds-lg px-ds-06 text-ds-base",
32
- icon: "h-ds-md w-ds-md rounded-ds-md",
33
- // alias → icon-md
34
- "icon-sm": "h-ds-sm w-ds-sm rounded-ds-md",
35
- "icon-md": "h-ds-md w-ds-md rounded-ds-md",
36
- "icon-lg": "h-ds-lg w-ds-lg rounded-ds-lg"
37
- }
38
- },
39
- compoundVariants: [
40
- // solid + default (primary)
41
- { variant: "solid", color: "default", className: "bg-accent-9 text-accent-fg hover:bg-accent-10 active:bg-accent-10 shadow-01 hover:shadow-brand" },
42
- // "default" alias → same as solid + default
43
- { variant: "default", color: "default", className: "bg-accent-9 text-accent-fg hover:bg-accent-10 active:bg-accent-10 shadow-01 hover:shadow-brand" },
44
- { variant: "default", color: "error", className: "bg-error-9 text-accent-fg hover:bg-error-9 active:bg-error-9 shadow-01" },
45
- // "destructive" alias → solid + error
46
- { variant: "destructive", color: "default", className: "bg-error-9 text-accent-fg hover:bg-error-9 active:bg-error-9 shadow-01" },
47
- { variant: "destructive", color: "error", className: "bg-error-9 text-accent-fg hover:bg-error-9 active:bg-error-9 shadow-01" },
48
- // solid + error
49
- { variant: "solid", color: "error", className: "bg-error-9 text-accent-fg hover:bg-error-9 active:bg-error-9 shadow-01" },
50
- // outline + default (secondary)
51
- { variant: "outline", color: "default", className: "bg-transparent text-accent-11 border-accent-7 hover:bg-accent-2 active:bg-surface-4" },
52
- // outline + error (error-ghost)
53
- { variant: "outline", color: "error", className: "bg-transparent text-error-11 border border-error-7 hover:bg-error-3 active:bg-error-3" },
54
- // ghost + default
55
- { variant: "ghost", color: "default", className: "bg-transparent text-surface-fg-muted hover:bg-surface-2 hover:text-surface-fg active:bg-surface-4" },
56
- // ghost + error
57
- { variant: "ghost", color: "error", className: "bg-transparent text-error-11 hover:bg-error-3 hover:text-error-11 active:bg-error-3" }
58
- ],
59
- defaultVariants: {
60
- variant: "solid",
61
- color: "default",
62
- size: "md"
63
- }
64
- }), W = {
65
- sm: "h-ico-sm w-ico-sm [&>svg]:h-ico-sm [&>svg]:w-ico-sm",
66
- md: "h-ico-sm w-ico-sm [&>svg]:h-ico-sm [&>svg]:w-ico-sm",
67
- lg: "h-ico-md w-ico-md [&>svg]:h-ico-md [&>svg]:w-ico-md",
68
- icon: "h-ico-sm w-ico-sm [&>svg]:h-ico-sm [&>svg]:w-ico-sm",
69
- "icon-sm": "h-ico-sm w-ico-sm [&>svg]:h-ico-sm [&>svg]:w-ico-sm",
70
- "icon-md": "h-ico-sm w-ico-sm [&>svg]:h-ico-sm [&>svg]:w-ico-sm",
71
- "icon-lg": "h-ico-md w-ico-md [&>svg]:h-ico-md [&>svg]:w-ico-md"
72
- }, ee = {
73
- sm: "sm",
74
- md: "sm",
75
- lg: "md",
76
- icon: "sm",
77
- "icon-sm": "sm",
78
- "icon-md": "sm",
79
- "icon-lg": "md"
80
- }, re = n.forwardRef(({ className: h, variant: A, color: B, size: V, asChild: E = !1, startIcon: b, endIcon: p, loading: F = !1, loadingPosition: d = "start", fullWidth: w = !1, disabled: x, onClick: M, onClickAsync: m, asyncFeedbackDuration: T = 1500, children: c, ...N }, y) => {
81
- const u = U(), S = A ?? u.variant, z = B ?? u.color, i = V ?? u.size ?? "md", f = W[i], G = ee[i], [t, l] = n.useState("idle"), j = n.useRef(), o = n.useRef(!0);
82
- n.useEffect(() => () => {
83
- o.current = !1, clearTimeout(j.current);
84
- }, []);
85
- const I = (v) => {
86
- !m || t !== "idle" || (l("loading"), m(v).then(() => {
87
- o.current && l("success");
88
- }).catch(() => {
89
- o.current && l("error");
90
- }).finally(() => {
91
- o.current && (j.current = setTimeout(() => {
92
- o.current && l("idle");
93
- }, T));
94
- }));
95
- }, k = !!m, r = k ? t === "loading" : F, s = t === "success" || t === "error", g = r ? e(Z, { size: G }) : null;
96
- if (E) {
97
- const v = {
98
- className: a(R({ variant: S, color: z, size: i }), w && "w-full", h),
99
- ref: y,
100
- disabled: x || r,
101
- "aria-busy": r || void 0,
102
- ...N
103
- };
104
- return e(P, { ...v, children: e(Q, { children: c }) });
105
- }
106
- const X = () => r && d === "start" ? g : b ? e("span", { className: a("inline-flex shrink-0 items-center justify-center", f), children: b }) : null, q = () => r && d === "end" ? g : p ? e("span", { className: a("inline-flex shrink-0 items-center justify-center", f), children: p }) : null, D = () => r && d === "center" ? C("span", { className: "relative inline-flex items-center justify-center", children: [e("span", { className: "invisible", children: c }), e("span", { className: "absolute inset-0 flex items-center justify-center", children: g })] }) : c, H = s ? t === "success" ? "bg-success-9 text-accent-fg border-transparent hover:bg-success-9" : "bg-error-9 text-accent-fg border-transparent hover:bg-error-9" : void 0, J = s ? e(_, { mode: "wait", children: e($.span, { initial: { opacity: 0, scale: 0.5 }, animate: { opacity: 1, scale: 1 }, exit: { opacity: 0, scale: 0.5 }, transition: Y.bouncy, className: a("inline-flex shrink-0 items-center justify-center", f), children: t === "success" ? e(L, { className: "h-full w-full" }) : e(O, { className: "h-full w-full" }) }, t) }) : null;
107
- return C("button", { ...N, className: a(R({ variant: S, color: z, size: i }), w && "w-full", !r && !s && "active:scale-[0.97] transition-transform duration-100", H, s && "transition-colors duration-200", h), ref: y, disabled: x || r || s, "aria-busy": r || void 0, onClick: k ? I : M, children: [s ? J : X(), s ? c : D(), s ? null : q()] });
108
- });
109
- re.displayName = "Button";
110
- export {
111
- re as B,
112
- R as b
113
- };
@@ -1,50 +0,0 @@
1
- "use client";
2
- import { jsx as s } from "react/jsx-runtime";
3
- import * as o from "react";
4
- import { bc as f, bd as h } from "./primitives.js";
5
- import { s as l, m as v } from "./motion2.js";
6
- import { c as d } from "./utils.js";
7
- import { m } from "./motion.js";
8
- import { ag as N } from "./vendor-utils.js";
9
- const C = o.forwardRef(({ className: e, error: a, checked: r, defaultChecked: n, onCheckedChange: t, ...i }, b) => {
10
- const [u, p] = o.useState(n ?? !1), g = r !== void 0 ? r : u, w = o.useCallback((c) => {
11
- r === void 0 && p(c), t == null || t(c);
12
- }, [r, t]);
13
- return s(f, { className: d("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-ds-full border-2 border-surface-border-strong shadow-01 transition-colors duration-fast-01 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-action-disabled data-[state=checked]:border-transparent data-[state=checked]:bg-accent-9 data-[state=unchecked]:bg-surface-border-strong", a && "border-error-7 data-[state=checked]:bg-error-9", e), checked: r, defaultChecked: n, onCheckedChange: w, ...i, ref: b, children: s(h, { asChild: !0, children: s(m.span, { className: "pointer-events-none block h-ico-md w-ico-md rounded-ds-full bg-accent-fg shadow-02 ring-0", animate: { x: g ? 20 : 0 }, transition: l.snappy }) }) });
14
- });
15
- C.displayName = f.displayName;
16
- const y = N("rounded-ds-lg text-surface-fg", {
17
- variants: {
18
- variant: {
19
- default: "bg-surface-1 border border-surface-border shadow-01",
20
- elevated: "bg-surface-1 border border-surface-border shadow-02",
21
- outline: "bg-transparent border-2 border-surface-border-strong shadow-none",
22
- flat: "bg-surface-2 border-none shadow-none"
23
- }
24
- },
25
- defaultVariants: { variant: "default" }
26
- }), x = o.forwardRef(({ className: e, variant: a, interactive: r, ...n }, t) => {
27
- const i = d(y({ variant: a }), r && "hover:shadow-02 hover:border-surface-border-strong cursor-pointer", e);
28
- return r ? s(m.div, { ref: t, whileHover: { y: -2 }, whileTap: { scale: 0.98 }, transition: l.snappy, className: i, ...v(n) }) : s("div", { ref: t, className: i, ...n });
29
- });
30
- x.displayName = "Card";
31
- const R = o.forwardRef(({ className: e, ...a }, r) => s("div", { ref: r, className: d("flex flex-col space-y-ds-02b p-ds-06", e), ...a }));
32
- R.displayName = "CardHeader";
33
- const k = o.forwardRef(({ className: e, ...a }, r) => s("div", { ref: r, className: d("font-sans font-semibold leading-ds-none tracking-ds-tight text-surface-fg", e), ...a }));
34
- k.displayName = "CardTitle";
35
- const T = o.forwardRef(({ className: e, ...a }, r) => s("div", { ref: r, className: d("text-ds-md text-surface-fg-muted", e), ...a }));
36
- T.displayName = "CardDescription";
37
- const H = o.forwardRef(({ className: e, ...a }, r) => s("div", { ref: r, className: d("p-ds-06 pt-0", e), ...a }));
38
- H.displayName = "CardContent";
39
- const S = o.forwardRef(({ className: e, ...a }, r) => s("div", { ref: r, className: d("flex items-center p-ds-06 pt-0", e), ...a }));
40
- S.displayName = "CardFooter";
41
- export {
42
- x as C,
43
- C as S,
44
- R as a,
45
- k as b,
46
- H as c,
47
- T as d,
48
- S as e,
49
- y as f
50
- };
@@ -1,16 +0,0 @@
1
- "use client";
2
- import { jsx as e } from "react/jsx-runtime";
3
- import { C as a, b as m } from "./primitives.js";
4
- import { IconMinus as l, IconCheck as f } from "@tabler/icons-react";
5
- import * as b from "react";
6
- import { s as u } from "./motion2.js";
7
- import { c as h } from "./utils.js";
8
- import { A as p, m as x } from "./motion.js";
9
- const g = b.forwardRef(({ className: c, error: i, indeterminate: r, checked: s, ...o }, n) => {
10
- const t = r ? "indeterminate" : s, d = t === !0 || t === "indeterminate";
11
- return e(a, { ref: n, checked: t, className: h("peer flex items-center justify-center h-ico-md w-ico-md shrink-0 rounded-ds-sm", "border border-surface-border-strong", "bg-surface-3", "transition-colors duration-fast-01", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2", "disabled:cursor-not-allowed disabled:opacity-action-disabled", "data-[state=checked]:bg-accent-9 data-[state=checked]:border-accent-7 data-[state=checked]:text-accent-fg", "data-[state=indeterminate]:bg-accent-9 data-[state=indeterminate]:border-accent-7 data-[state=indeterminate]:text-accent-fg", i && "border-error-7", c), ...o, children: e(p, { children: d && e(m, { forceMount: !0, asChild: !0, children: e(x.span, { className: "flex items-center justify-center text-current", initial: { scale: 0, opacity: 0 }, animate: { scale: 1, opacity: 1 }, exit: { scale: 0, opacity: 0 }, transition: u.bouncy, children: t === "indeterminate" ? e(l, { className: "h-ico-sm w-ico-sm" }) : e(f, { className: "h-ico-sm w-ico-sm" }) }) }) }) });
12
- });
13
- g.displayName = a.displayName;
14
- export {
15
- g as C
16
- };
@@ -1,27 +0,0 @@
1
- "use client";
2
- import { jsx as d } from "react/jsx-runtime";
3
- import * as e from "react";
4
- import { c as m } from "./utils.js";
5
- const i = e.createContext({}), u = e.forwardRef(({ className: a, helperTextId: n, state: t = "helper", required: r, children: l, ...s }, o) => {
6
- const c = e.useId(), x = n || `${c}-helper`, p = e.useMemo(() => ({ state: t, helperTextId: x, required: r }), [t, x, r]);
7
- return d(i.Provider, { value: p, children: d("div", { ref: o, className: m("flex flex-col gap-ds-02", a), ...s, children: l }) });
8
- });
9
- u.displayName = "FormField";
10
- const f = {
11
- helper: "text-surface-fg-subtle",
12
- error: "text-error-11",
13
- warning: "text-warning-11",
14
- success: "text-success-11"
15
- }, F = e.forwardRef(({ className: a, id: n, state: t, ...r }, l) => {
16
- const s = e.useContext(i), o = t ?? s.state ?? "helper", c = n ?? s.helperTextId;
17
- return d("p", { ref: l, id: c, role: o === "error" ? "alert" : void 0, className: m("text-ds-sm", f[o], a), ...r });
18
- });
19
- F.displayName = "FormHelperText";
20
- function I() {
21
- return e.useContext(i);
22
- }
23
- export {
24
- u as F,
25
- F as a,
26
- I as u
27
- };