@devalok/shilp-sutra 0.34.0 → 0.34.1

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 (172) hide show
  1. package/dist/_chunks/badge-group.js +306 -246
  2. package/dist/_chunks/chat.js +513 -0
  3. package/dist/_chunks/date-picker.js +748 -0
  4. package/dist/_chunks/document-preview.js +109 -90
  5. package/dist/_chunks/file-preview.js +492 -504
  6. package/dist/_chunks/framer.js +5564 -5613
  7. package/dist/_chunks/image-preview.js +127 -88
  8. package/dist/_chunks/keybinding.js +12 -14
  9. package/dist/_chunks/link-context.js +19 -16
  10. package/dist/_chunks/mention-suggestion.js +353 -350
  11. package/dist/_chunks/motion-provider.js +26 -20
  12. package/dist/_chunks/popover.js +127 -0
  13. package/dist/_chunks/primitives.js +7584 -6425
  14. package/dist/_chunks/rich-chat-input.js +2070 -0
  15. package/dist/_chunks/rolldown-runtime.js +21 -0
  16. package/dist/_chunks/shared.js +126 -0
  17. package/dist/_chunks/sonner.js +605 -734
  18. package/dist/_chunks/stat-row.js +418 -440
  19. package/dist/_chunks/tiptap.js +15850 -19964
  20. package/dist/_chunks/tree-view.js +231 -290
  21. package/dist/_chunks/use-calendar.js +161 -208
  22. package/dist/_chunks/vendor-client.js +314 -2199
  23. package/dist/_chunks/vendor-utils.js +1721 -2978
  24. package/dist/ai/ai-command-provider.js +23 -17
  25. package/dist/ai/block-renderer.js +68 -51
  26. package/dist/ai/blocks/index.js +2 -12
  27. package/dist/ai/command-bar.js +470 -519
  28. package/dist/ai/conversation.js +241 -227
  29. package/dist/ai/index.js +181 -167
  30. package/dist/ai/types.js +0 -1
  31. package/dist/composed/activity-feed.js +232 -202
  32. package/dist/composed/avatar-group.js +164 -222
  33. package/dist/composed/bulk-action-bar.js +174 -165
  34. package/dist/composed/command-palette.js +290 -308
  35. package/dist/composed/confirm-dialog.js +28 -48
  36. package/dist/composed/content-card.js +69 -108
  37. package/dist/composed/date-picker/index.js +3 -13
  38. package/dist/composed/deadline-indicator.js +68 -74
  39. package/dist/composed/emoji-picker.js +83 -110
  40. package/dist/composed/empty-state.js +64 -103
  41. package/dist/composed/error-boundary.js +129 -127
  42. package/dist/composed/file-preview.js +2 -12
  43. package/dist/composed/filter-bar.js +98 -130
  44. package/dist/composed/form-section.js +61 -45
  45. package/dist/composed/global-loading.js +34 -47
  46. package/dist/composed/index.js +34 -92
  47. package/dist/composed/inline-edit.js +92 -107
  48. package/dist/composed/lib/string-utils.js +8 -8
  49. package/dist/composed/loading-skeleton.js +103 -171
  50. package/dist/composed/markdown-viewer.js +187 -139
  51. package/dist/composed/master-detail.js +147 -156
  52. package/dist/composed/member-picker.js +46 -49
  53. package/dist/composed/multi-select-popover.js +181 -179
  54. package/dist/composed/page-header.js +54 -76
  55. package/dist/composed/page-skeletons.js +143 -127
  56. package/dist/composed/priority-indicator.js +105 -111
  57. package/dist/composed/responsive-overlay.js +36 -41
  58. package/dist/composed/rich-chat-input.js +2 -1860
  59. package/dist/composed/rich-text-editor.js +561 -424
  60. package/dist/composed/schedule-view.js +134 -185
  61. package/dist/composed/simple-tooltip.js +21 -21
  62. package/dist/composed/status-badge.js +133 -137
  63. package/dist/hooks/index.js +7 -12
  64. package/dist/hooks/use-color-mode.js +28 -25
  65. package/dist/hooks/use-mobile.js +13 -13
  66. package/dist/hooks/use-toast.js +2 -4
  67. package/dist/hooks/use-touch-device.js +9 -11
  68. package/dist/hooks/use-viewport-height.js +14 -14
  69. package/dist/motion/index.js +3 -11
  70. package/dist/motion/primitives-index.js +226 -186
  71. package/dist/shell/app-command-palette.js +203 -234
  72. package/dist/shell/bottom-navbar.js +150 -190
  73. package/dist/shell/command-registry.js +13 -14
  74. package/dist/shell/index.js +10 -20
  75. package/dist/shell/link-context.js +2 -5
  76. package/dist/shell/notification-center.js +238 -259
  77. package/dist/shell/notification-preferences.js +241 -184
  78. package/dist/shell/sidebar.js +251 -281
  79. package/dist/shell/top-bar.js +203 -237
  80. package/dist/tailwind/index.cjs +426 -442
  81. package/dist/tailwind/index.js +2 -4
  82. package/dist/tailwind/preset.js +443 -459
  83. package/dist/ui/accordion.js +52 -60
  84. package/dist/ui/alert-dialog.js +111 -156
  85. package/dist/ui/alert.js +177 -99
  86. package/dist/ui/aspect-ratio.js +13 -16
  87. package/dist/ui/autocomplete.js +112 -148
  88. package/dist/ui/avatar.js +196 -169
  89. package/dist/ui/badge-group.js +2 -7
  90. package/dist/ui/badge-indicator.js +42 -51
  91. package/dist/ui/badge.js +2 -15
  92. package/dist/ui/banner.js +76 -68
  93. package/dist/ui/breadcrumb.js +65 -84
  94. package/dist/ui/button-group.js +109 -102
  95. package/dist/ui/button-processing.js +69 -73
  96. package/dist/ui/button.js +393 -279
  97. package/dist/ui/card.js +151 -157
  98. package/dist/ui/charts/index.js +1002 -1319
  99. package/dist/ui/chat/index.js +2 -11
  100. package/dist/ui/checkbox.js +77 -100
  101. package/dist/ui/code.js +18 -32
  102. package/dist/ui/collapsible.js +21 -29
  103. package/dist/ui/color-input.js +453 -372
  104. package/dist/ui/color-swatch.js +60 -90
  105. package/dist/ui/combobox.js +244 -293
  106. package/dist/ui/container.js +18 -24
  107. package/dist/ui/context-menu.js +154 -203
  108. package/dist/ui/data-table-body.js +116 -213
  109. package/dist/ui/data-table-bulk-actions.js +43 -59
  110. package/dist/ui/data-table-card.js +84 -71
  111. package/dist/ui/data-table-context.js +39 -42
  112. package/dist/ui/data-table-header.js +98 -139
  113. package/dist/ui/data-table-pagination.js +69 -82
  114. package/dist/ui/data-table-toolbar.js +104 -130
  115. package/dist/ui/data-table.js +278 -354
  116. package/dist/ui/devalok-grain.js +77 -66
  117. package/dist/ui/dialog.js +122 -151
  118. package/dist/ui/dropdown-menu.js +152 -203
  119. package/dist/ui/file-upload.js +242 -266
  120. package/dist/ui/form.js +60 -56
  121. package/dist/ui/hover-card.js +54 -54
  122. package/dist/ui/icon-button.js +21 -26
  123. package/dist/ui/icon-context.js +17 -17
  124. package/dist/ui/icon-group.js +22 -29
  125. package/dist/ui/icon.js +201 -121
  126. package/dist/ui/index.js +74 -350
  127. package/dist/ui/input-otp.js +44 -48
  128. package/dist/ui/input.js +92 -169
  129. package/dist/ui/label.js +17 -22
  130. package/dist/ui/lib/date-utils.js +14 -11
  131. package/dist/ui/lib/motion.js +77 -36
  132. package/dist/ui/lib/utils.js +39 -16
  133. package/dist/ui/link.js +13 -24
  134. package/dist/ui/menubar.js +132 -210
  135. package/dist/ui/navigation-menu.js +163 -193
  136. package/dist/ui/number-input.js +72 -95
  137. package/dist/ui/pagination.js +122 -159
  138. package/dist/ui/popover.js +2 -131
  139. package/dist/ui/progress-ring.js +133 -143
  140. package/dist/ui/progress.js +51 -95
  141. package/dist/ui/radio.js +41 -50
  142. package/dist/ui/search-input.js +51 -53
  143. package/dist/ui/segmented-control.js +93 -114
  144. package/dist/ui/select.js +131 -157
  145. package/dist/ui/separator.js +15 -25
  146. package/dist/ui/sheet.js +135 -163
  147. package/dist/ui/sidebar.js +357 -600
  148. package/dist/ui/skeleton.js +179 -231
  149. package/dist/ui/slider.js +24 -34
  150. package/dist/ui/spinner.js +226 -205
  151. package/dist/ui/split-button.js +227 -276
  152. package/dist/ui/stack.js +56 -70
  153. package/dist/ui/stat-card.js +259 -251
  154. package/dist/ui/status-dot.js +67 -63
  155. package/dist/ui/stepper.js +119 -168
  156. package/dist/ui/switch.js +51 -54
  157. package/dist/ui/table.js +57 -90
  158. package/dist/ui/tabs.js +139 -156
  159. package/dist/ui/text.js +52 -59
  160. package/dist/ui/textarea.js +40 -57
  161. package/dist/ui/toast-types.js +0 -1
  162. package/dist/ui/toast.js +554 -536
  163. package/dist/ui/toaster.js +23 -33
  164. package/dist/ui/toggle-group.js +37 -41
  165. package/dist/ui/toggle.js +36 -40
  166. package/dist/ui/tooltip.js +80 -65
  167. package/dist/ui/tree-view/index.js +2 -6
  168. package/dist/ui/visually-hidden.js +12 -10
  169. package/llms-full.txt +1 -1
  170. package/package.json +1 -1
  171. package/dist/_chunks/date-time-picker.js +0 -851
  172. package/dist/_chunks/typing-indicator.js +0 -565
@@ -1,56 +1,56 @@
1
1
  "use client";
2
- import { jsx as e } from "react/jsx-runtime";
3
- import * as r from "react";
4
- import { ad as u, ae as p, af as C, ag as g } from "../_chunks/primitives.js";
5
- import { cn as v } from "./lib/utils.js";
6
- import { tweens as h, springs as y } from "./lib/motion.js";
7
- import { A as x, m as b } from "../_chunks/framer.js";
8
- const m = r.createContext(!1), H = ({
9
- open: t,
10
- defaultOpen: n = !1,
11
- onOpenChange: a,
12
- ...s
13
- }) => {
14
- const [i, c] = r.useState(n), o = t !== void 0, d = o ? t : i, f = r.useCallback(
15
- (l) => {
16
- o || c(l), a?.(l);
17
- },
18
- [o, a]
19
- );
20
- return /* @__PURE__ */ e(m.Provider, { value: d, children: /* @__PURE__ */ e(g, { open: d, onOpenChange: f, ...s }) });
21
- };
22
- H.displayName = "HoverCard";
23
- const M = C, w = r.forwardRef(({ className: t, align: n = "center", sideOffset: a = 4, children: s, ...i }, c) => {
24
- const o = r.useContext(m);
25
- return /* @__PURE__ */ e(x, { children: o && /* @__PURE__ */ e(u, { forceMount: !0, children: /* @__PURE__ */ e(
26
- p,
27
- {
28
- ref: c,
29
- align: n,
30
- sideOffset: a,
31
- forceMount: !0,
32
- asChild: !0,
33
- ...i,
34
- children: /* @__PURE__ */ e(
35
- b.div,
36
- {
37
- initial: { opacity: 0, scale: 0.95 },
38
- animate: { opacity: 1, scale: 1 },
39
- exit: { opacity: 0, scale: 0.95 },
40
- transition: { ...y.snappy, opacity: h.fade },
41
- className: v(
42
- "z-popover w-64 rounded-ds-lg border border-surface-border-strong bg-surface-overlay p-ds-05 shadow-floating outline-hidden",
43
- t
44
- ),
45
- children: s
46
- }
47
- )
48
- }
49
- ) }) });
50
- });
51
- w.displayName = p.displayName;
52
- export {
53
- H as HoverCard,
54
- w as HoverCardContent,
55
- M as HoverCardTrigger
2
+ import { dt as e, ft as t, mt as n, pt as r } from "../_chunks/primitives.js";
3
+ import { a as i, c as a } from "../_chunks/framer.js";
4
+ import { springs as o, tweens as s } from "./lib/motion.js";
5
+ import { cn as c } from "./lib/utils.js";
6
+ import * as l from "react";
7
+ import { jsx as u } from "react/jsx-runtime";
8
+ //#region src/ui/hover-card.tsx
9
+ var d = l.createContext(!1), f = ({ open: e, defaultOpen: t = !1, onOpenChange: n, ...i }) => {
10
+ let [a, o] = l.useState(t), s = e !== void 0, c = s ? e : a, f = l.useCallback((e) => {
11
+ s || o(e), n?.(e);
12
+ }, [s, n]);
13
+ return /* @__PURE__ */ u(d.Provider, {
14
+ value: c,
15
+ children: /* @__PURE__ */ u(r, {
16
+ open: c,
17
+ onOpenChange: f,
18
+ ...i
19
+ })
20
+ });
56
21
  };
22
+ f.displayName = "HoverCard";
23
+ var p = n, m = l.forwardRef(({ className: n, align: r = "center", sideOffset: f = 4, children: p, ...m }, h) => /* @__PURE__ */ u(a, { children: l.useContext(d) && /* @__PURE__ */ u(t, {
24
+ forceMount: !0,
25
+ children: /* @__PURE__ */ u(e, {
26
+ ref: h,
27
+ align: r,
28
+ sideOffset: f,
29
+ forceMount: !0,
30
+ asChild: !0,
31
+ ...m,
32
+ children: /* @__PURE__ */ u(i.div, {
33
+ initial: {
34
+ opacity: 0,
35
+ scale: .95
36
+ },
37
+ animate: {
38
+ opacity: 1,
39
+ scale: 1
40
+ },
41
+ exit: {
42
+ opacity: 0,
43
+ scale: .95
44
+ },
45
+ transition: {
46
+ ...o.snappy,
47
+ opacity: s.fade
48
+ },
49
+ className: c("z-popover w-64 rounded-ds-lg border border-surface-border-strong bg-surface-overlay p-ds-05 shadow-floating outline-hidden", n),
50
+ children: p
51
+ })
52
+ })
53
+ }) }));
54
+ m.displayName = e.displayName;
55
+ //#endregion
56
+ export { f as HoverCard, m as HoverCardContent, p as HoverCardTrigger };
@@ -1,27 +1,22 @@
1
1
  "use client";
2
- import { jsx as e } from "react/jsx-runtime";
3
- import * as s from "react";
4
- import { Button as a } from "./button.js";
5
- import { cn as d } from "./lib/utils.js";
6
- const l = {
7
- sm: "icon-sm",
8
- md: "icon-md",
9
- lg: "icon-lg"
10
- }, f = s.forwardRef(
11
- ({ icon: o, shape: r = "square", size: n = "md", className: t, loading: i, ...m }, c) => /* @__PURE__ */ e(
12
- a,
13
- {
14
- ref: c,
15
- size: l[n],
16
- className: d(r === "circle" && "rounded-ds-full", t),
17
- loading: i,
18
- loadingPosition: "center",
19
- ...m,
20
- children: o
21
- }
22
- )
23
- );
24
- f.displayName = "IconButton";
25
- export {
26
- f as IconButton
27
- };
2
+ import { cn as e } from "./lib/utils.js";
3
+ import { Button as t } from "./button.js";
4
+ import * as n from "react";
5
+ import { jsx as r } from "react/jsx-runtime";
6
+ //#region src/ui/icon-button.tsx
7
+ var i = {
8
+ sm: "icon-sm",
9
+ md: "icon-md",
10
+ lg: "icon-lg"
11
+ }, a = n.forwardRef(({ icon: n, shape: a = "square", size: o = "md", className: s, loading: c, ...l }, u) => /* @__PURE__ */ r(t, {
12
+ ref: u,
13
+ size: i[o],
14
+ className: e(a === "circle" && "rounded-ds-full", s),
15
+ loading: c,
16
+ loadingPosition: "center",
17
+ ...l,
18
+ children: n
19
+ }));
20
+ a.displayName = "IconButton";
21
+ //#endregion
22
+ export { a as IconButton };
@@ -1,20 +1,20 @@
1
1
  "use client";
2
- import { jsx as u } from "react/jsx-runtime";
3
- import * as o from "react";
4
- const n = o.createContext({});
5
- function i({
6
- size: t,
7
- stroke: e,
8
- children: r
9
- }) {
10
- const c = o.useMemo(() => ({ size: t, stroke: e }), [t, e]);
11
- return /* @__PURE__ */ u(n.Provider, { value: c, children: r });
2
+ import * as e from "react";
3
+ import { jsx as t } from "react/jsx-runtime";
4
+ //#region src/ui/icon-context.tsx
5
+ var n = e.createContext({});
6
+ function r({ size: r, stroke: i, children: a }) {
7
+ let o = e.useMemo(() => ({
8
+ size: r,
9
+ stroke: i
10
+ }), [r, i]);
11
+ return /* @__PURE__ */ t(n.Provider, {
12
+ value: o,
13
+ children: a
14
+ });
12
15
  }
13
- function m() {
14
- return o.useContext(n);
16
+ function i() {
17
+ return e.useContext(n);
15
18
  }
16
- export {
17
- n as IconContext,
18
- i as IconProvider,
19
- m as useIconContext
20
- };
19
+ //#endregion
20
+ export { n as IconContext, r as IconProvider, i as useIconContext };
@@ -1,31 +1,24 @@
1
1
  "use client";
2
+ import { cn as e } from "./lib/utils.js";
3
+ import { IconProvider as t } from "./icon-context.js";
4
+ import * as n from "react";
2
5
  import { jsx as r } from "react/jsx-runtime";
3
- import * as m from "react";
4
- import { cn as n } from "./lib/utils.js";
5
- import { IconProvider as c } from "./icon-context.js";
6
- const f = {
7
- tight: "gap-0.5",
8
- default: "gap-1",
9
- loose: "gap-2"
10
- }, d = m.forwardRef(({
11
- size: e,
12
- stroke: a,
13
- gap: t = "default",
14
- label: i,
15
- role: o,
16
- className: l,
17
- children: p
18
- }, s) => /* @__PURE__ */ r(c, { size: e, stroke: a, children: /* @__PURE__ */ r(
19
- "div",
20
- {
21
- ref: s,
22
- role: o,
23
- "aria-label": o ? i : void 0,
24
- className: n("inline-flex items-center", f[t], l),
25
- children: p
26
- }
27
- ) }));
28
- d.displayName = "IconGroup";
29
- export {
30
- d as IconGroup
31
- };
6
+ //#region src/ui/icon-group.tsx
7
+ var i = {
8
+ tight: "gap-0.5",
9
+ default: "gap-1",
10
+ loose: "gap-2"
11
+ }, a = n.forwardRef(({ size: n, stroke: a, gap: o = "default", label: s, role: c, className: l, children: u }, d) => /* @__PURE__ */ r(t, {
12
+ size: n,
13
+ stroke: a,
14
+ children: /* @__PURE__ */ r("div", {
15
+ ref: d,
16
+ role: c,
17
+ "aria-label": c ? s : void 0,
18
+ className: e("inline-flex items-center", i[o], l),
19
+ children: u
20
+ })
21
+ }));
22
+ a.displayName = "IconGroup";
23
+ //#endregion
24
+ export { a as IconGroup };
package/dist/ui/icon.js CHANGED
@@ -1,122 +1,202 @@
1
1
  "use client";
2
- import { jsx as i, jsxs as w, Fragment as O } from "react/jsx-runtime";
3
- import * as z from "react";
4
- import { tweens as C, springs as P } from "./lib/motion.js";
5
- import { cn as E } from "./lib/utils.js";
6
- import { Spinner as R } from "./spinner.js";
7
- import { useIconContext as L } from "./icon-context.js";
8
- import { u as N, A as _, m as c } from "../_chunks/framer.js";
9
- const j = {
10
- xs: 14,
11
- sm: 16,
12
- md: 18,
13
- lg: 20,
14
- xl: 24,
15
- "2xl": 32
16
- }, A = {
17
- light: { xs: 1.25, sm: 1.5, md: 1.5, lg: 1.75, xl: 2, "2xl": 2 },
18
- regular: { xs: 1.5, sm: 2, md: 2, lg: 2, xl: 2, "2xl": 2.25 },
19
- bold: { xs: 2, sm: 2.5, md: 2.5, lg: 2.5, xl: 2.5, "2xl": 2.5 }
20
- }, X = {
21
- spin: {
22
- animate: { rotate: 360 },
23
- transition: { duration: 1, repeat: 1 / 0, ease: "linear" }
24
- },
25
- pulse: {
26
- animate: { scale: [1, 1.15, 1] },
27
- transition: { duration: 2, repeat: 1 / 0, ease: "easeInOut" }
28
- },
29
- bounce: {
30
- animate: { y: [0, -4, 0] },
31
- transition: { duration: 1.5, repeat: 1 / 0, ease: "easeInOut" }
32
- }
33
- }, M = {
34
- xs: "sm",
35
- sm: "sm",
36
- md: "md",
37
- lg: "md",
38
- xl: "lg",
39
- "2xl": "lg"
40
- }, Z = z.forwardRef(
41
- ({ icon: s, size: f, stroke: k, label: e, animate: t, state: d, className: l }, p) => {
42
- const u = L(), m = f ?? u.size ?? "md", I = k ?? u.stroke ?? "regular", o = j[m], r = A[I][m], x = N();
43
- if (d && d !== "idle") {
44
- const a = M[m], n = d === "loading" ? "spinning" : d;
45
- return /* @__PURE__ */ i(_, { mode: "wait", children: /* @__PURE__ */ i(
46
- c.span,
47
- {
48
- initial: { opacity: 0 },
49
- animate: { opacity: 1 },
50
- exit: { opacity: 0 },
51
- transition: C.fade,
52
- className: "inline-flex",
53
- children: /* @__PURE__ */ i(R, { size: a, state: n, variant: "bare" })
54
- },
55
- "spinner"
56
- ) });
57
- }
58
- if (t === "draw" && !x) {
59
- const a = {
60
- initial: { pathLength: 0, opacity: 0 },
61
- animate: { pathLength: 1, opacity: 1 },
62
- transition: { pathLength: { duration: 0.35, ease: "easeOut" }, opacity: { duration: 0.1 } }
63
- }, n = s.displayName ?? "", y = n === "Check" || n === "IconCheck" || n === "CircleCheck";
64
- if (y || (n === "X" || n === "IconX"))
65
- return /* @__PURE__ */ i(
66
- "svg",
67
- {
68
- ref: p,
69
- width: o,
70
- height: o,
71
- viewBox: "0 0 24 24",
72
- fill: "none",
73
- stroke: "currentColor",
74
- strokeWidth: r,
75
- strokeLinecap: "round",
76
- strokeLinejoin: "round",
77
- className: l,
78
- "aria-hidden": e ? void 0 : "true",
79
- "aria-label": e,
80
- role: e ? "img" : void 0,
81
- children: y ? /* @__PURE__ */ i(c.polyline, { points: "4 12 10 18 20 6", ...a }) : /* @__PURE__ */ w(O, { children: [
82
- /* @__PURE__ */ i(c.line, { x1: "6", y1: "6", x2: "18", y2: "18", ...a }),
83
- /* @__PURE__ */ i(
84
- c.line,
85
- {
86
- x1: "18",
87
- y1: "6",
88
- x2: "6",
89
- y2: "18",
90
- ...a,
91
- transition: {
92
- pathLength: { duration: 0.25, ease: "easeOut", delay: 0.1 },
93
- opacity: { duration: 0.1, delay: 0.1 }
94
- }
95
- }
96
- )
97
- ] })
98
- }
99
- );
100
- }
101
- const h = typeof t == "string" && t !== "none" && t !== "draw" ? X[t] : null, g = typeof t == "object" && t !== null && (t.rotate !== void 0 || t.scale !== void 0) ? t : null;
102
- if (x || !h && !g)
103
- return e ? /* @__PURE__ */ i(s, { ref: p, size: o, stroke: r, className: l, title: e, "aria-label": e, role: "img" }) : /* @__PURE__ */ i(s, { ref: p, size: o, stroke: r, className: l, "aria-hidden": "true" });
104
- const S = h ?? {
105
- animate: g,
106
- transition: P.snappy
107
- }, v = e ? /* @__PURE__ */ i(s, { size: o, stroke: r, title: e, "aria-label": e, role: "img" }) : /* @__PURE__ */ i(s, { size: o, stroke: r, "aria-hidden": "true" });
108
- return /* @__PURE__ */ i(
109
- c.span,
110
- {
111
- ref: p,
112
- className: E("inline-flex", l),
113
- ...S,
114
- children: v
115
- }
116
- );
117
- }
118
- );
119
- Z.displayName = "Icon";
120
- export {
121
- Z as Icon
122
- };
2
+ import { a as e, c as t, n } from "../_chunks/framer.js";
3
+ import { springs as r, tweens as i } from "./lib/motion.js";
4
+ import { cn as a } from "./lib/utils.js";
5
+ import { Spinner as o } from "./spinner.js";
6
+ import { useIconContext as s } from "./icon-context.js";
7
+ import * as c from "react";
8
+ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
9
+ //#region src/ui/icon.tsx
10
+ var f = {
11
+ xs: 14,
12
+ sm: 16,
13
+ md: 18,
14
+ lg: 20,
15
+ xl: 24,
16
+ "2xl": 32
17
+ }, p = {
18
+ light: {
19
+ xs: 1.25,
20
+ sm: 1.5,
21
+ md: 1.5,
22
+ lg: 1.75,
23
+ xl: 2,
24
+ "2xl": 2
25
+ },
26
+ regular: {
27
+ xs: 1.5,
28
+ sm: 2,
29
+ md: 2,
30
+ lg: 2,
31
+ xl: 2,
32
+ "2xl": 2.25
33
+ },
34
+ bold: {
35
+ xs: 2,
36
+ sm: 2.5,
37
+ md: 2.5,
38
+ lg: 2.5,
39
+ xl: 2.5,
40
+ "2xl": 2.5
41
+ }
42
+ }, m = {
43
+ spin: {
44
+ animate: { rotate: 360 },
45
+ transition: {
46
+ duration: 1,
47
+ repeat: Infinity,
48
+ ease: "linear"
49
+ }
50
+ },
51
+ pulse: {
52
+ animate: { scale: [
53
+ 1,
54
+ 1.15,
55
+ 1
56
+ ] },
57
+ transition: {
58
+ duration: 2,
59
+ repeat: Infinity,
60
+ ease: "easeInOut"
61
+ }
62
+ },
63
+ bounce: {
64
+ animate: { y: [
65
+ 0,
66
+ -4,
67
+ 0
68
+ ] },
69
+ transition: {
70
+ duration: 1.5,
71
+ repeat: Infinity,
72
+ ease: "easeInOut"
73
+ }
74
+ }
75
+ }, h = {
76
+ xs: "sm",
77
+ sm: "sm",
78
+ md: "md",
79
+ lg: "md",
80
+ xl: "lg",
81
+ "2xl": "lg"
82
+ }, g = c.forwardRef(({ icon: c, size: g, stroke: _, label: v, animate: y, state: b, className: x }, S) => {
83
+ let C = s(), w = g ?? C.size ?? "md", T = _ ?? C.stroke ?? "regular", E = f[w], D = p[T][w], O = n();
84
+ if (b && b !== "idle") {
85
+ let n = h[w], r = b === "loading" ? "spinning" : b;
86
+ return /* @__PURE__ */ u(t, {
87
+ mode: "wait",
88
+ children: /* @__PURE__ */ u(e.span, {
89
+ initial: { opacity: 0 },
90
+ animate: { opacity: 1 },
91
+ exit: { opacity: 0 },
92
+ transition: i.fade,
93
+ className: "inline-flex",
94
+ children: /* @__PURE__ */ u(o, {
95
+ size: n,
96
+ state: r,
97
+ variant: "bare"
98
+ })
99
+ }, "spinner")
100
+ });
101
+ }
102
+ if (y === "draw" && !O) {
103
+ let t = {
104
+ initial: {
105
+ pathLength: 0,
106
+ opacity: 0
107
+ },
108
+ animate: {
109
+ pathLength: 1,
110
+ opacity: 1
111
+ },
112
+ transition: {
113
+ pathLength: {
114
+ duration: .35,
115
+ ease: "easeOut"
116
+ },
117
+ opacity: { duration: .1 }
118
+ }
119
+ }, n = c.displayName ?? "", r = n === "Check" || n === "IconCheck" || n === "CircleCheck";
120
+ if (r || n === "X" || n === "IconX") return /* @__PURE__ */ u("svg", {
121
+ ref: S,
122
+ width: E,
123
+ height: E,
124
+ viewBox: "0 0 24 24",
125
+ fill: "none",
126
+ stroke: "currentColor",
127
+ strokeWidth: D,
128
+ strokeLinecap: "round",
129
+ strokeLinejoin: "round",
130
+ className: x,
131
+ "aria-hidden": v ? void 0 : "true",
132
+ "aria-label": v,
133
+ role: v ? "img" : void 0,
134
+ children: r ? /* @__PURE__ */ u(e.polyline, {
135
+ points: "4 12 10 18 20 6",
136
+ ...t
137
+ }) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(e.line, {
138
+ x1: "6",
139
+ y1: "6",
140
+ x2: "18",
141
+ y2: "18",
142
+ ...t
143
+ }), /* @__PURE__ */ u(e.line, {
144
+ x1: "18",
145
+ y1: "6",
146
+ x2: "6",
147
+ y2: "18",
148
+ ...t,
149
+ transition: {
150
+ pathLength: {
151
+ duration: .25,
152
+ ease: "easeOut",
153
+ delay: .1
154
+ },
155
+ opacity: {
156
+ duration: .1,
157
+ delay: .1
158
+ }
159
+ }
160
+ })] })
161
+ });
162
+ }
163
+ let k = typeof y == "string" && y !== "none" && y !== "draw" ? m[y] : null, A = typeof y == "object" && y && (y.rotate !== void 0 || y.scale !== void 0) ? y : null;
164
+ if (O || !k && !A) return v ? /* @__PURE__ */ u(c, {
165
+ ref: S,
166
+ size: E,
167
+ stroke: D,
168
+ className: x,
169
+ title: v,
170
+ "aria-label": v,
171
+ role: "img"
172
+ }) : /* @__PURE__ */ u(c, {
173
+ ref: S,
174
+ size: E,
175
+ stroke: D,
176
+ className: x,
177
+ "aria-hidden": "true"
178
+ });
179
+ let j = k ?? {
180
+ animate: A,
181
+ transition: r.snappy
182
+ }, M = v ? /* @__PURE__ */ u(c, {
183
+ size: E,
184
+ stroke: D,
185
+ title: v,
186
+ "aria-label": v,
187
+ role: "img"
188
+ }) : /* @__PURE__ */ u(c, {
189
+ size: E,
190
+ stroke: D,
191
+ "aria-hidden": "true"
192
+ });
193
+ return /* @__PURE__ */ u(e.span, {
194
+ ref: S,
195
+ className: a("inline-flex", x),
196
+ ...j,
197
+ children: M
198
+ });
199
+ });
200
+ g.displayName = "Icon";
201
+ //#endregion
202
+ export { g as Icon };