@devalok/shilp-sutra 0.55.0 → 0.56.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 (74) hide show
  1. package/BREAKING.json +13 -0
  2. package/MIGRATION.md +56 -0
  3. package/README.md +16 -1
  4. package/dist/_chunks/badge-group.js +45 -45
  5. package/dist/_chunks/emoji-suggestion.js +32 -30
  6. package/dist/_chunks/emoji-suggestion.js.map +1 -1
  7. package/dist/_chunks/mention-suggestion.js +35 -34
  8. package/dist/_chunks/mention-suggestion.js.map +1 -1
  9. package/dist/_chunks/primitives-internal.js +437 -537
  10. package/dist/_chunks/primitives-internal.js.map +1 -1
  11. package/dist/composed/content-card.js +18 -18
  12. package/dist/composed/extensions/emoji-node.js +8 -7
  13. package/dist/composed/extensions/emoji-node.js.map +1 -1
  14. package/dist/composed/rich-chat-input.js +535 -526
  15. package/dist/composed/rich-chat-input.js.map +1 -1
  16. package/dist/composed/rich-text-editor.js +201 -193
  17. package/dist/composed/rich-text-editor.js.map +1 -1
  18. package/dist/tokens/primitives.css +6 -1
  19. package/dist/tokens/semantic.css +1 -1
  20. package/dist/ui/alert.js +29 -29
  21. package/dist/ui/avatar.js +42 -42
  22. package/dist/ui/banner.js +25 -25
  23. package/dist/ui/button.js +31 -31
  24. package/dist/ui/button.js.map +1 -1
  25. package/dist/ui/card.js +39 -39
  26. package/dist/ui/checkbox.d.ts.map +1 -1
  27. package/dist/ui/checkbox.js +1 -0
  28. package/dist/ui/checkbox.js.map +1 -1
  29. package/dist/ui/combobox.js +135 -135
  30. package/dist/ui/combobox.js.map +1 -1
  31. package/dist/ui/dot.js +13 -13
  32. package/dist/ui/input.js +25 -25
  33. package/dist/ui/lib/utils.js +2 -1
  34. package/dist/ui/lib/utils.js.map +1 -1
  35. package/dist/ui/number-input.js +36 -36
  36. package/dist/ui/progress.js +55 -55
  37. package/dist/ui/select.js +58 -58
  38. package/dist/ui/sheet.js +46 -46
  39. package/dist/ui/sidebar.js +128 -128
  40. package/dist/ui/sidebar.js.map +1 -1
  41. package/dist/ui/skeleton.js +39 -39
  42. package/dist/ui/slider.d.ts.map +1 -1
  43. package/dist/ui/slider.js +18 -17
  44. package/dist/ui/slider.js.map +1 -1
  45. package/dist/ui/surface.js +9 -9
  46. package/dist/ui/switch.d.ts.map +1 -1
  47. package/dist/ui/switch.js +1 -0
  48. package/dist/ui/switch.js.map +1 -1
  49. package/dist/ui/tabs.js +47 -47
  50. package/dist/ui/text.js +8 -8
  51. package/dist/ui/textarea.js +12 -12
  52. package/dist/ui/toggle.js +12 -12
  53. package/docs/recipes/install-astro.md +2 -2
  54. package/docs/recipes/install-next-app-router.md +2 -2
  55. package/docs/recipes/install-remix.md +2 -2
  56. package/docs/recipes/install-tanstack-start.md +2 -2
  57. package/docs/recipes/install-vite.md +2 -2
  58. package/docs/recipes/troubleshoot.md +26 -5
  59. package/llms.txt +1 -1
  60. package/mcp-manifest.json +24 -3
  61. package/package.json +39 -11
  62. package/skill/SKILL.md +1 -1
  63. package/skill/references/components.md +1 -1
  64. package/skill/references/setup-astro.md +2 -2
  65. package/skill/references/setup-next-app-router.md +2 -2
  66. package/skill/references/setup-remix.md +2 -2
  67. package/skill/references/setup-tanstack-start.md +2 -2
  68. package/skill/references/setup-vite.md +2 -2
  69. package/skill/references/troubleshoot.md +26 -5
  70. package/dist/_chunks/tiptap.js +0 -18809
  71. package/dist/_chunks/tiptap.js.map +0 -1
  72. package/dist/_chunks/vendor-utils.js +0 -1766
  73. package/dist/_chunks/vendor-utils.js.map +0 -1
  74. package/scripts/welcome.mjs +0 -312
package/dist/ui/dot.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { cva as e } from "../_chunks/vendor-utils.js";
3
- import { cn as t } from "./lib/utils.js";
4
- import * as n from "react";
5
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
+ import { cn as e } from "./lib/utils.js";
3
+ import * as t from "react";
4
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
+ import { cva as i } from "class-variance-authority";
6
6
  //#region src/ui/dot.tsx
7
7
  var a = {
8
8
  accent: "bg-accent-9",
@@ -40,7 +40,7 @@ var a = {
40
40
  slow: "2s",
41
41
  normal: "1s",
42
42
  fast: "0.6s"
43
- }, u = e("relative inline-flex shrink-0 rounded-pill", {
43
+ }, u = i("relative inline-flex shrink-0 rounded-pill", {
44
44
  variants: { size: {
45
45
  xs: "h-1 w-1",
46
46
  sm: "h-1.5 w-1.5",
@@ -53,26 +53,26 @@ var a = {
53
53
  sm: "text-body-xs",
54
54
  md: "text-body-sm",
55
55
  lg: "text-body-sm"
56
- }, f = n.forwardRef(({ color: e = "neutral", size: n = "md", variant: f = "filled", withBorder: p = !1, pulse: m = !1, pulseSpeed: h = "normal", label: g, labelPosition: _ = "end", labelClassName: v, className: y, "aria-label": b, ...x }, S) => {
57
- let C = n ?? "md", w = g != null || b != null, T = m && f !== "off", E = t(u({ size: C }), f === "filled" && a[e], f === "ring" && t("border-[1.5px] bg-transparent", o[e]), f === "off" && t("border", s[e]), p && "ring-2 ring-surface-raised"), D = g == null ? null : /* @__PURE__ */ r("span", {
58
- className: t(d[C], c[e], "font-sans", v),
56
+ }, f = t.forwardRef(({ color: t = "neutral", size: i = "md", variant: f = "filled", withBorder: p = !1, pulse: m = !1, pulseSpeed: h = "normal", label: g, labelPosition: _ = "end", labelClassName: v, className: y, "aria-label": b, ...x }, S) => {
57
+ let C = i ?? "md", w = g != null || b != null, T = m && f !== "off", E = e(u({ size: C }), f === "filled" && a[t], f === "ring" && e("border-[1.5px] bg-transparent", o[t]), f === "off" && e("border", s[t]), p && "ring-2 ring-surface-raised"), D = g == null ? null : /* @__PURE__ */ n("span", {
58
+ className: e(d[C], c[t], "font-sans", v),
59
59
  children: g
60
60
  });
61
- return /* @__PURE__ */ i("span", {
61
+ return /* @__PURE__ */ r("span", {
62
62
  ref: S,
63
63
  role: w ? "status" : void 0,
64
64
  "aria-hidden": !w || void 0,
65
65
  "aria-label": b,
66
- className: t("inline-flex items-center gap-ds-02", y),
66
+ className: e("inline-flex items-center gap-ds-02", y),
67
67
  ...x,
68
68
  children: [
69
69
  _ === "start" && D,
70
- /* @__PURE__ */ r("span", {
70
+ /* @__PURE__ */ n("span", {
71
71
  className: "relative inline-flex shrink-0",
72
- children: /* @__PURE__ */ r("span", {
72
+ children: /* @__PURE__ */ n("span", {
73
73
  "data-pulse": T ? "" : void 0,
74
74
  style: T ? { animationDuration: l[h] } : void 0,
75
- className: t(E, T && "animate-pulse motion-reduce:animate-none")
75
+ className: e(E, T && "animate-pulse motion-reduce:animate-none")
76
76
  })
77
77
  }),
78
78
  _ === "end" && D
package/dist/ui/input.js CHANGED
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import { IconProvider as e } from "./icon-context.js";
3
- import { cva as t } from "../_chunks/vendor-utils.js";
4
- import { cn as n } from "./lib/utils.js";
5
- import { useFormField as r } from "./form.js";
6
- import { resolveFieldState as i } from "../_chunks/field-state.js";
7
- import * as a from "react";
8
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
3
+ import { cn as t } from "./lib/utils.js";
4
+ import { useFormField as n } from "./form.js";
5
+ import { resolveFieldState as r } from "../_chunks/field-state.js";
6
+ import * as i from "react";
7
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
8
+ import { cva as s } from "class-variance-authority";
9
9
  //#region src/ui/input.tsx
10
- var c = t([
10
+ var c = s([
11
11
  "relative flex items-center w-full font-sans",
12
12
  "bg-surface-raised-hover text-surface-fg",
13
13
  "border border-surface-border-strong rounded-control",
@@ -34,8 +34,8 @@ var c = t([
34
34
  sm: "sm",
35
35
  md: "md",
36
36
  lg: "lg"
37
- }, d = a.forwardRef(({ className: t, type: a, state: d, size: f = "md", startSection: p, endSection: m, startSectionClickable: h, endSectionClickable: g, startSectionType: _, endSectionType: v, wrapperClassName: y, ...b }, x) => {
38
- let S = f ?? "md", C = r(), w = i(d, C.state), T = b["aria-describedby"] ?? C.helperTextId, E = b["aria-required"] ?? C.required, D = b.id ?? C.inputId, O = !!p, k = !!m, A = _ ?? (typeof p == "string" ? "label" : "icon"), j = v ?? (typeof m == "string" ? "label" : "icon"), M = {
37
+ }, d = i.forwardRef(({ className: i, type: s, state: d, size: f = "md", startSection: p, endSection: m, startSectionClickable: h, endSectionClickable: g, startSectionType: _, endSectionType: v, wrapperClassName: y, ...b }, x) => {
38
+ let S = f ?? "md", C = n(), w = r(d, C.state), T = b["aria-describedby"] ?? C.helperTextId, E = b["aria-required"] ?? C.required, D = b.id ?? C.inputId, O = !!p, k = !!m, A = _ ?? (typeof p == "string" ? "label" : "icon"), j = v ?? (typeof m == "string" ? "label" : "icon"), M = {
39
39
  xs: "px-ds-02",
40
40
  sm: "px-ds-02",
41
41
  md: "px-ds-03",
@@ -46,28 +46,28 @@ var c = t([
46
46
  md: "text-body-sm",
47
47
  lg: "text-body-md"
48
48
  };
49
- return /* @__PURE__ */ s("div", {
50
- className: n(c({ size: S }), w === "error" && "border-error-7 focus-within:ring-error-7", w === "warning" && "border-warning-7 focus-within:ring-warning-7", w === "success" && "border-success-7 focus-within:ring-success-7", y),
49
+ return /* @__PURE__ */ o("div", {
50
+ className: t(c({ size: S }), w === "error" && "border-error-7 focus-within:ring-error-7", w === "warning" && "border-warning-7 focus-within:ring-warning-7", w === "success" && "border-success-7 focus-within:ring-success-7", y),
51
51
  children: [
52
- O && A === "label" && /* @__PURE__ */ o("span", {
53
- className: n("flex items-center shrink-0 select-none self-stretch", "border-r border-surface-border", "bg-surface-raised text-surface-fg-muted", "rounded-l-[inherit]", M[S], N[S], !h && "pointer-events-none"),
52
+ O && A === "label" && /* @__PURE__ */ a("span", {
53
+ className: t("flex items-center shrink-0 select-none self-stretch", "border-r border-surface-border", "bg-surface-raised text-surface-fg-muted", "rounded-l-[inherit]", M[S], N[S], !h && "pointer-events-none"),
54
54
  children: p
55
55
  }),
56
- O && A === "icon" && /* @__PURE__ */ o(e, {
56
+ O && A === "icon" && /* @__PURE__ */ a(e, {
57
57
  size: u[S],
58
- children: /* @__PURE__ */ o("span", {
59
- className: n("flex items-center justify-center shrink-0 self-stretch text-surface-fg-muted", l[S], !h && "pointer-events-none"),
58
+ children: /* @__PURE__ */ a("span", {
59
+ className: t("flex items-center justify-center shrink-0 self-stretch text-surface-fg-muted", l[S], !h && "pointer-events-none"),
60
60
  children: p
61
61
  })
62
62
  }),
63
- /* @__PURE__ */ o("input", {
64
- type: a,
65
- className: n("flex-1 min-w-0 h-full bg-transparent outline-hidden font-sans", "placeholder:text-surface-fg-subtle", "disabled:cursor-not-allowed", "read-only:cursor-default", {
63
+ /* @__PURE__ */ a("input", {
64
+ type: s,
65
+ className: t("flex-1 min-w-0 h-full bg-transparent outline-hidden font-sans", "placeholder:text-surface-fg-subtle", "disabled:cursor-not-allowed", "read-only:cursor-default", {
66
66
  xs: "px-ds-02",
67
67
  sm: "px-ds-03",
68
68
  md: "px-ds-03",
69
69
  lg: "px-ds-04"
70
- }[S], O && A === "icon" && "pl-0", k && j === "icon" && "pr-0", t),
70
+ }[S], O && A === "icon" && "pl-0", k && j === "icon" && "pr-0", i),
71
71
  "aria-invalid": w === "error" || void 0,
72
72
  "aria-describedby": T,
73
73
  "aria-required": E || void 0,
@@ -75,14 +75,14 @@ var c = t([
75
75
  ...b,
76
76
  id: D
77
77
  }),
78
- k && j === "label" && /* @__PURE__ */ o("span", {
79
- className: n("flex items-center shrink-0 select-none self-stretch", "border-l border-surface-border", "bg-surface-raised text-surface-fg-muted", "rounded-r-[inherit]", M[S], N[S], !g && "pointer-events-none"),
78
+ k && j === "label" && /* @__PURE__ */ a("span", {
79
+ className: t("flex items-center shrink-0 select-none self-stretch", "border-l border-surface-border", "bg-surface-raised text-surface-fg-muted", "rounded-r-[inherit]", M[S], N[S], !g && "pointer-events-none"),
80
80
  children: m
81
81
  }),
82
- k && j === "icon" && /* @__PURE__ */ o(e, {
82
+ k && j === "icon" && /* @__PURE__ */ a(e, {
83
83
  size: u[S],
84
- children: /* @__PURE__ */ o("span", {
85
- className: n("flex items-center justify-center shrink-0 self-stretch text-surface-fg-muted", l[S], !g && "pointer-events-none"),
84
+ children: /* @__PURE__ */ a("span", {
85
+ className: t("flex items-center justify-center shrink-0 self-stretch text-surface-fg-muted", l[S], !g && "pointer-events-none"),
86
86
  children: m
87
87
  })
88
88
  })
@@ -1,4 +1,5 @@
1
- import { clsx as e, extendTailwindMerge as t } from "../../_chunks/vendor-utils.js";
1
+ import { clsx as e } from "clsx";
2
+ import { extendTailwindMerge as t } from "tailwind-merge";
2
3
  //#region src/ui/lib/utils.ts
3
4
  var n = t({ extend: {
4
5
  theme: { spacing: [
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":[],"sources":["../../../src/ui/lib/utils.ts"],"sourcesContent":["// @server-safe\nimport { type ClassValue,clsx } from 'clsx'\nimport { extendTailwindMerge } from 'tailwind-merge'\n\nconst twMerge = extendTailwindMerge({\n extend: {\n theme: {\n spacing: ['ds-01', 'ds-02', 'ds-02b', 'ds-03', 'ds-04', 'ds-05', 'ds-05b', 'ds-06', 'ds-06b', 'ds-07', 'ds-08', 'ds-09', 'ds-10', 'ds-11', 'ds-12', 'ds-13'],\n },\n classGroups: {\n // All size ramps live in the font-size group so they're mutually exclusive\n // with EACH OTHER but NOT confused with text-COLOR utilities (text-error-11,\n // text-surface-fg, …). Without registering these, tw-merge classifies\n // `text-body-md` as a colour and silently strips a real colour on the same element.\n 'font-size': [\n { 'text-ds': ['xs', 'sm', 'md', 'base', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl'] },\n { 'text-heading': ['2xl', 'xl', 'lg', 'md', 'sm', 'xs'] },\n { 'text-body': ['lg', 'md', 'sm', 'xs'] },\n { 'text-label': ['lg', 'md', 'sm', 'xs'] },\n { 'text-label-plain': ['lg', 'md', 'sm'] },\n 'text-caption',\n 'text-code',\n ],\n },\n },\n})\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";;AAIA,IAAM,IAAU,EAAoB,EAClC,QAAQ;CACN,OAAO,EACL,SAAS;EAAC;EAAS;EAAS;EAAU;EAAS;EAAS;EAAS;EAAU;EAAS;EAAU;EAAS;EAAS;EAAS;EAAS;EAAS;EAAS;CAAO,EAC7J;CACA,aAAa,EAKX,aAAa;EACX,EAAE,WAAW;GAAC;GAAM;GAAM;GAAM;GAAQ;GAAM;GAAM;GAAO;GAAO;GAAO;GAAO;EAAK,EAAE;EACvF,EAAE,gBAAgB;GAAC;GAAO;GAAM;GAAM;GAAM;GAAM;EAAI,EAAE;EACxD,EAAE,aAAa;GAAC;GAAM;GAAM;GAAM;EAAI,EAAE;EACxC,EAAE,cAAc;GAAC;GAAM;GAAM;GAAM;EAAI,EAAE;EACzC,EAAE,oBAAoB;GAAC;GAAM;GAAM;EAAI,EAAE;EACzC;EACA;CACF,EACF;AACF,EACF,CAAC;AAED,SAAgB,EAAG,GAAG,GAAsB;CAC1C,OAAO,EAAQ,EAAK,CAAM,CAAC;AAC7B"}
1
+ {"version":3,"file":"utils.js","names":[],"sources":["../../../src/ui/lib/utils.ts"],"sourcesContent":["// @server-safe\nimport { type ClassValue,clsx } from 'clsx'\nimport { extendTailwindMerge } from 'tailwind-merge'\n\nconst twMerge = extendTailwindMerge({\n extend: {\n theme: {\n spacing: ['ds-01', 'ds-02', 'ds-02b', 'ds-03', 'ds-04', 'ds-05', 'ds-05b', 'ds-06', 'ds-06b', 'ds-07', 'ds-08', 'ds-09', 'ds-10', 'ds-11', 'ds-12', 'ds-13'],\n },\n classGroups: {\n // All size ramps live in the font-size group so they're mutually exclusive\n // with EACH OTHER but NOT confused with text-COLOR utilities (text-error-11,\n // text-surface-fg, …). Without registering these, tw-merge classifies\n // `text-body-md` as a colour and silently strips a real colour on the same element.\n 'font-size': [\n { 'text-ds': ['xs', 'sm', 'md', 'base', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl'] },\n { 'text-heading': ['2xl', 'xl', 'lg', 'md', 'sm', 'xs'] },\n { 'text-body': ['lg', 'md', 'sm', 'xs'] },\n { 'text-label': ['lg', 'md', 'sm', 'xs'] },\n { 'text-label-plain': ['lg', 'md', 'sm'] },\n 'text-caption',\n 'text-code',\n ],\n },\n },\n})\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";;;AAIA,IAAM,IAAU,EAAoB,EAClC,QAAQ;CACN,OAAO,EACL,SAAS;EAAC;EAAS;EAAS;EAAU;EAAS;EAAS;EAAS;EAAU;EAAS;EAAU;EAAS;EAAS;EAAS;EAAS;EAAS;EAAS;CAAO,EAC7J;CACA,aAAa,EAKX,aAAa;EACX,EAAE,WAAW;GAAC;GAAM;GAAM;GAAM;GAAQ;GAAM;GAAM;GAAO;GAAO;GAAO;GAAO;EAAK,EAAE;EACvF,EAAE,gBAAgB;GAAC;GAAO;GAAM;GAAM;GAAM;GAAM;EAAI,EAAE;EACxD,EAAE,aAAa;GAAC;GAAM;GAAM;GAAM;EAAI,EAAE;EACxC,EAAE,cAAc;GAAC;GAAM;GAAM;GAAM;EAAI,EAAE;EACzC,EAAE,oBAAoB;GAAC;GAAM;GAAM;EAAI,EAAE;EACzC;EACA;CACF,EACF;AACF,EACF,CAAC;AAED,SAAgB,EAAG,GAAG,GAAsB;CAC1C,OAAO,EAAQ,EAAK,CAAM,CAAC;AAC7B"}
@@ -1,14 +1,14 @@
1
1
  "use client";
2
- import { cva as e } from "../_chunks/vendor-utils.js";
3
- import { cn as t } from "./lib/utils.js";
4
- import { Icon as n } from "./icon.js";
5
- import { useFormField as r } from "./form.js";
6
- import { resolveFieldState as i } from "../_chunks/field-state.js";
7
- import * as a from "react";
8
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
9
- import { IconMinus as c, IconPlus as l } from "@tabler/icons-react";
2
+ import { cn as e } from "./lib/utils.js";
3
+ import { Icon as t } from "./icon.js";
4
+ import { useFormField as n } from "./form.js";
5
+ import { resolveFieldState as r } from "../_chunks/field-state.js";
6
+ import * as i from "react";
7
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
8
+ import { IconMinus as s, IconPlus as c } from "@tabler/icons-react";
9
+ import { cva as l } from "class-variance-authority";
10
10
  //#region src/ui/number-input.tsx
11
- var u = e("flex items-center justify-between rounded-control border border-surface-border-strong", {
11
+ var u = l("flex items-center justify-between rounded-control border border-surface-border-strong", {
12
12
  variants: { size: {
13
13
  xs: "h-ds-xs-plus",
14
14
  sm: "h-ds-sm",
@@ -36,43 +36,43 @@ var u = e("flex items-center justify-between rounded-control border border-surfa
36
36
  error: "border-error-7",
37
37
  warning: "border-warning-7",
38
38
  success: "border-success-7"
39
- }, h = a.forwardRef(({ value: e = 0, onValueChange: a, min: h = -(2 ** 53 - 1), max: g = 2 ** 53 - 1, step: _ = 1, disabled: v = !1, className: y, size: b = "md", state: x, "aria-label": S, ...C }, w) => {
40
- let T = b ?? "md", E = r(), D = S ?? (C.id || E.helperTextId ? void 0 : "Numeric value"), O = i(x, E.state) ?? "default", k = (e) => {
39
+ }, h = i.forwardRef(({ value: i = 0, onValueChange: l, min: h = -(2 ** 53 - 1), max: g = 2 ** 53 - 1, step: _ = 1, disabled: v = !1, className: y, size: b = "md", state: x, "aria-label": S, ...C }, w) => {
40
+ let T = b ?? "md", E = n(), D = S ?? (C.id || E.helperTextId ? void 0 : "Numeric value"), O = r(x, E.state) ?? "default", k = (e) => {
41
41
  let t = e.target.value.trim();
42
42
  if (t === "" || t === "-") {
43
- a?.(h >= 0 ? h : 0);
43
+ l?.(h >= 0 ? h : 0);
44
44
  return;
45
45
  }
46
46
  let n = Number(t);
47
- Number.isNaN(n) || a?.(Math.min(Math.max(n, h), g));
48
- }, A = (t) => {
49
- t.preventDefault();
50
- let n = e + _;
51
- n <= g && a?.(n);
52
- }, j = (t) => {
53
- t.preventDefault();
54
- let n = e - _;
55
- n >= h && a?.(n);
47
+ Number.isNaN(n) || l?.(Math.min(Math.max(n, h), g));
48
+ }, A = (e) => {
49
+ e.preventDefault();
50
+ let t = i + _;
51
+ t <= g && l?.(t);
52
+ }, j = (e) => {
53
+ e.preventDefault();
54
+ let t = i - _;
55
+ t >= h && l?.(t);
56
56
  }, M = d[T], N = f[T], P = p[T];
57
- return /* @__PURE__ */ s("div", {
58
- className: t(u({ size: T }), m[O], y),
57
+ return /* @__PURE__ */ o("div", {
58
+ className: e(u({ size: T }), m[O], y),
59
59
  children: [
60
- /* @__PURE__ */ o("button", {
60
+ /* @__PURE__ */ a("button", {
61
61
  type: "button",
62
62
  onClick: j,
63
- disabled: v || e <= h,
63
+ disabled: v || i <= h,
64
64
  "aria-label": "Decrease value",
65
65
  title: "Decrease",
66
- className: t("flex items-center justify-center border-0 rounded-control-inner text-surface-fg-subtle hover:bg-surface-raised-hover hover:text-surface-fg-muted active:scale-90 transition-[color,background-color,transform] duration-fast-01 ease-productive-standard disabled:opacity-action-disabled disabled:pointer-events-none", M),
67
- children: /* @__PURE__ */ o(n, {
68
- icon: c,
66
+ className: e("flex items-center justify-center border-0 rounded-control-inner text-surface-fg-subtle hover:bg-surface-raised-hover hover:text-surface-fg-muted active:scale-90 transition-[color,background-color,transform] duration-fast-01 ease-productive-standard disabled:opacity-action-disabled disabled:pointer-events-none", M),
67
+ children: /* @__PURE__ */ a(t, {
68
+ icon: s,
69
69
  size: N
70
70
  })
71
71
  }),
72
- /* @__PURE__ */ o("input", {
72
+ /* @__PURE__ */ a("input", {
73
73
  ref: w,
74
74
  type: "number",
75
- value: e,
75
+ value: i,
76
76
  onChange: k,
77
77
  min: h,
78
78
  max: g,
@@ -81,19 +81,19 @@ var u = e("flex items-center justify-between rounded-control border border-surfa
81
81
  "aria-label": D,
82
82
  "aria-invalid": O === "error" || void 0,
83
83
  "aria-describedby": C["aria-describedby"] ?? E.helperTextId,
84
- className: t("bg-transparent font-semibold border-0 text-center text-surface-fg-muted focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none", P),
84
+ className: e("bg-transparent font-semibold border-0 text-center text-surface-fg-muted focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none", P),
85
85
  ...C,
86
86
  id: C.id ?? E.inputId
87
87
  }),
88
- /* @__PURE__ */ o("button", {
88
+ /* @__PURE__ */ a("button", {
89
89
  type: "button",
90
90
  onClick: A,
91
- disabled: v || e >= g,
91
+ disabled: v || i >= g,
92
92
  "aria-label": "Increase value",
93
93
  title: "Increase",
94
- className: t("flex items-center justify-center border-0 rounded-control-inner text-surface-fg-subtle hover:bg-surface-raised-hover hover:text-surface-fg-muted active:scale-90 transition-[color,background-color,transform] duration-fast-01 ease-productive-standard disabled:opacity-action-disabled disabled:pointer-events-none", M),
95
- children: /* @__PURE__ */ o(n, {
96
- icon: l,
94
+ className: e("flex items-center justify-center border-0 rounded-control-inner text-surface-fg-subtle hover:bg-surface-raised-hover hover:text-surface-fg-muted active:scale-90 transition-[color,background-color,transform] duration-fast-01 ease-productive-standard disabled:opacity-action-disabled disabled:pointer-events-none", M),
95
+ children: /* @__PURE__ */ a(t, {
96
+ icon: c,
97
97
  size: N
98
98
  })
99
99
  })
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import { springs as e } from "./lib/motion.js";
3
- import { cva as t } from "../_chunks/vendor-utils.js";
4
- import { cn as n } from "./lib/utils.js";
5
- import { Root as r } from "../_chunks/primitives/react-progress.js";
6
- import * as i from "react";
7
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
8
- import { motion as s } from "framer-motion";
3
+ import { cn as t } from "./lib/utils.js";
4
+ import { Root as n } from "../_chunks/primitives/react-progress.js";
5
+ import * as r from "react";
6
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
+ import { motion as o } from "framer-motion";
8
+ import { cva as s } from "class-variance-authority";
9
9
  //#region src/ui/progress.tsx
10
- var c = t("relative w-full overflow-hidden rounded-pill bg-surface-raised", {
10
+ var c = s("relative w-full overflow-hidden rounded-pill bg-surface-raised", {
11
11
  variants: { size: {
12
12
  sm: "h-1",
13
13
  md: "h-2",
@@ -19,127 +19,127 @@ var c = t("relative w-full overflow-hidden rounded-pill bg-surface-raised", {
19
19
  success: "bg-success-9",
20
20
  warning: "bg-warning-9",
21
21
  error: "bg-error-9"
22
- }, u = t("h-full transition-[width] duration-moderate-02 ease-expressive-standard", {
22
+ }, u = s("h-full transition-[width] duration-moderate-02 ease-expressive-standard", {
23
23
  variants: { color: l },
24
24
  defaultVariants: { color: "accent" }
25
25
  });
26
26
  function d(e) {
27
27
  return e == null ? "accent" : e > 100 ? "error" : e >= 85 ? "success" : e >= 60 ? "warning" : "accent";
28
28
  }
29
- var f = (e, t) => Math.max(0, Math.min(100, e / t * 100)), p = i.createContext(null);
29
+ var f = (e, t) => Math.max(0, Math.min(100, e / t * 100)), p = r.createContext(null);
30
30
  function m(e) {
31
- let t = i.useContext(p);
31
+ let t = r.useContext(p);
32
32
  if (!t) throw Error(`<Progress.${e}> must be rendered inside <Progress.Root>.`);
33
33
  return t;
34
34
  }
35
- var h = i.forwardRef(({ value: e = null, max: t = 100, size: r = "md", className: o, children: s, ...c }, l) => {
36
- let u = i.useMemo(() => ({
35
+ var h = r.forwardRef(({ value: e = null, max: n = 100, size: a = "md", className: o, children: s, ...c }, l) => {
36
+ let u = r.useMemo(() => ({
37
37
  value: e,
38
- max: t,
39
- size: r,
38
+ max: n,
39
+ size: a,
40
40
  indeterminate: e == null
41
41
  }), [
42
42
  e,
43
- t,
44
- r
43
+ n,
44
+ a
45
45
  ]);
46
- return /* @__PURE__ */ a(p.Provider, {
46
+ return /* @__PURE__ */ i(p.Provider, {
47
47
  value: u,
48
- children: /* @__PURE__ */ a("div", {
48
+ children: /* @__PURE__ */ i("div", {
49
49
  ref: l,
50
- className: n("flex w-full items-center gap-ds-03", o),
50
+ className: t("flex w-full items-center gap-ds-03", o),
51
51
  ...c,
52
52
  children: s
53
53
  })
54
54
  });
55
55
  });
56
56
  h.displayName = "Progress.Root";
57
- var g = i.forwardRef(({ className: e, children: t, ...i }, o) => {
57
+ var g = r.forwardRef(({ className: e, children: r, ...a }, o) => {
58
58
  let { value: s, max: l, size: u, indeterminate: d } = m("Track");
59
- return /* @__PURE__ */ a(r, {
59
+ return /* @__PURE__ */ i(n, {
60
60
  ref: o,
61
61
  value: d ? null : s,
62
62
  max: l,
63
- className: n(c({ size: u }), "flex-1", e),
64
- ...i,
65
- children: t
63
+ className: t(c({ size: u }), "flex-1", e),
64
+ ...a,
65
+ children: r
66
66
  });
67
67
  });
68
68
  g.displayName = "Progress.Track";
69
- var _ = i.forwardRef(({ color: t, autoColor: r, className: i, ...o }, c) => {
70
- let { value: l, max: p, indeterminate: h } = m("Indicator"), g = t ?? (r === !1 ? "accent" : d(l));
71
- return h ? /* @__PURE__ */ a("div", {
69
+ var _ = r.forwardRef(({ color: n, autoColor: r, className: a, ...s }, c) => {
70
+ let { value: l, max: p, indeterminate: h } = m("Indicator"), g = n ?? (r === !1 ? "accent" : d(l));
71
+ return h ? /* @__PURE__ */ i("div", {
72
72
  ref: c,
73
- className: n(u({ color: g }), "w-2/5 animate-progress-indeterminate motion-reduce:animate-none", i),
74
- ...o
75
- }) : /* @__PURE__ */ a(s.div, {
73
+ className: t(u({ color: g }), "w-2/5 animate-progress-indeterminate motion-reduce:animate-none", a),
74
+ ...s
75
+ }) : /* @__PURE__ */ i(o.div, {
76
76
  ref: c,
77
- className: n(u({ color: g }), "transition-colors", i),
77
+ className: t(u({ color: g }), "transition-colors", a),
78
78
  initial: !1,
79
79
  animate: { width: `${f(l ?? 0, p)}%` },
80
80
  transition: e.smooth,
81
- ...o
81
+ ...s
82
82
  });
83
83
  });
84
84
  _.displayName = "Progress.Indicator";
85
- var v = i.forwardRef(({ value: e, color: t = "accent", className: r, style: i, ...o }, s) => {
85
+ var v = r.forwardRef(({ value: e, color: n = "accent", className: r, style: a, ...o }, s) => {
86
86
  let { max: c } = m("Segment");
87
- return /* @__PURE__ */ a("div", {
87
+ return /* @__PURE__ */ i("div", {
88
88
  ref: s,
89
89
  "aria-hidden": "true",
90
- className: n("h-full first:rounded-l-pill last:rounded-r-pill", l[t], r),
90
+ className: t("h-full first:rounded-l-pill last:rounded-r-pill", l[n], r),
91
91
  style: {
92
92
  width: `${f(e, c)}%`,
93
- ...i
93
+ ...a
94
94
  },
95
95
  ...o
96
96
  });
97
97
  });
98
98
  v.displayName = "Progress.Segment";
99
- var y = i.forwardRef(({ className: e, ...t }, r) => (m("Label"), /* @__PURE__ */ a("span", {
99
+ var y = r.forwardRef(({ className: e, ...n }, r) => (m("Label"), /* @__PURE__ */ i("span", {
100
100
  ref: r,
101
- className: n("shrink-0 text-body-sm font-medium text-surface-fg", e),
102
- ...t
101
+ className: t("shrink-0 text-body-sm font-medium text-surface-fg", e),
102
+ ...n
103
103
  })));
104
104
  y.displayName = "Progress.Label";
105
- var b = i.forwardRef(({ className: e, format: t, children: r, ...i }, o) => {
105
+ var b = r.forwardRef(({ className: e, format: n, children: r, ...a }, o) => {
106
106
  let { value: s, max: c, indeterminate: l } = m("Value"), u = l ? 0 : f(s ?? 0, c);
107
- return /* @__PURE__ */ a("span", {
107
+ return /* @__PURE__ */ i("span", {
108
108
  ref: o,
109
- className: n("shrink-0 text-caption text-surface-fg-muted tabular-nums", e),
110
- ...i,
111
- children: r ?? (l ? "" : t ? t(u, s, c) : `${Math.round(u)}%`)
109
+ className: t("shrink-0 text-caption text-surface-fg-muted tabular-nums", e),
110
+ ...a,
111
+ children: r ?? (l ? "" : n ? n(u, s, c) : `${Math.round(u)}%`)
112
112
  });
113
113
  });
114
114
  b.displayName = "Progress.Value";
115
- var x = i.forwardRef(({ value: e = null, max: t = 100, size: r, color: s, autoColor: c, label: l, showValue: u, segments: d, trackClassName: f, indicatorClassName: p, className: m, "aria-label": x, "aria-labelledby": S, ...C }, w) => {
116
- let T = i.useId(), E = l != null;
117
- return /* @__PURE__ */ o(h, {
115
+ var x = r.forwardRef(({ value: e = null, max: n = 100, size: o, color: s, autoColor: c, label: l, showValue: u, segments: d, trackClassName: f, indicatorClassName: p, className: m, "aria-label": x, "aria-labelledby": S, ...C }, w) => {
116
+ let T = r.useId(), E = l != null;
117
+ return /* @__PURE__ */ a(h, {
118
118
  ref: w,
119
119
  value: e,
120
- max: t,
121
- size: r ?? "md",
120
+ max: n,
121
+ size: o ?? "md",
122
122
  className: m,
123
123
  ...C,
124
124
  children: [
125
- E && /* @__PURE__ */ a(y, {
125
+ E && /* @__PURE__ */ i(y, {
126
126
  id: T,
127
127
  children: l
128
128
  }),
129
- /* @__PURE__ */ a(g, {
129
+ /* @__PURE__ */ i(g, {
130
130
  "aria-label": x,
131
131
  "aria-labelledby": S ?? (E ? T : void 0),
132
- className: n(d && "flex", f),
133
- children: d ? d.map((e, t) => /* @__PURE__ */ a(v, {
132
+ className: t(d && "flex", f),
133
+ children: d ? d.map((e, t) => /* @__PURE__ */ i(v, {
134
134
  value: e.value,
135
135
  color: e.color
136
- }, t)) : /* @__PURE__ */ a(_, {
136
+ }, t)) : /* @__PURE__ */ i(_, {
137
137
  color: s,
138
138
  autoColor: c,
139
139
  className: p
140
140
  })
141
141
  }),
142
- u && e != null && /* @__PURE__ */ a(b, {})
142
+ u && e != null && /* @__PURE__ */ i(b, {})
143
143
  ]
144
144
  });
145
145
  });