@devalok/shilp-sutra 0.2.1 → 0.3.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 (73) hide show
  1. package/README.md +239 -0
  2. package/dist/composed/content-card.d.ts +2 -2
  3. package/dist/composed/error-boundary.js +1 -1
  4. package/dist/shell/notification-preferences.js +14 -14
  5. package/dist/tailwind/index.cjs +15 -10
  6. package/dist/tailwind/preset.d.ts.map +1 -1
  7. package/dist/tailwind/preset.js +15 -10
  8. package/dist/tokens/index.css +1 -0
  9. package/dist/tokens/semantic.css +3 -3
  10. package/dist/tokens/typography.css +7 -7
  11. package/dist/ui/alert.d.ts +8 -8
  12. package/dist/ui/alert.d.ts.map +1 -1
  13. package/dist/ui/alert.js +10 -10
  14. package/dist/ui/autocomplete.d.ts +3 -3
  15. package/dist/ui/autocomplete.d.ts.map +1 -1
  16. package/dist/ui/autocomplete.js +1 -1
  17. package/dist/ui/badge.d.ts +10 -7
  18. package/dist/ui/badge.d.ts.map +1 -1
  19. package/dist/ui/badge.js +82 -30
  20. package/dist/ui/banner.d.ts +6 -6
  21. package/dist/ui/banner.d.ts.map +1 -1
  22. package/dist/ui/banner.js +17 -17
  23. package/dist/ui/button-group.d.ts +8 -5
  24. package/dist/ui/button-group.d.ts.map +1 -1
  25. package/dist/ui/button-group.js +17 -17
  26. package/dist/ui/button.d.ts +10 -8
  27. package/dist/ui/button.d.ts.map +1 -1
  28. package/dist/ui/button.js +65 -47
  29. package/dist/ui/chip.d.ts +5 -5
  30. package/dist/ui/chip.js +10 -10
  31. package/dist/ui/combobox.d.ts +6 -7
  32. package/dist/ui/combobox.d.ts.map +1 -1
  33. package/dist/ui/combobox.js +32 -31
  34. package/dist/ui/dialog.d.ts +5 -11
  35. package/dist/ui/dialog.d.ts.map +1 -1
  36. package/dist/ui/dialog.js +53 -53
  37. package/dist/ui/file-upload.js +34 -34
  38. package/dist/ui/form.d.ts +31 -28
  39. package/dist/ui/form.d.ts.map +1 -1
  40. package/dist/ui/form.js +34 -32
  41. package/dist/ui/icon-button.d.ts +4 -4
  42. package/dist/ui/index.d.ts +3 -3
  43. package/dist/ui/index.d.ts.map +1 -1
  44. package/dist/ui/index.js +69 -69
  45. package/dist/ui/number-input.d.ts +8 -10
  46. package/dist/ui/number-input.d.ts.map +1 -1
  47. package/dist/ui/number-input.js +48 -47
  48. package/dist/ui/progress.d.ts +1 -1
  49. package/dist/ui/search-input.js +8 -8
  50. package/dist/ui/sheet.d.ts +6 -12
  51. package/dist/ui/sheet.d.ts.map +1 -1
  52. package/dist/ui/sheet.js +49 -49
  53. package/dist/ui/sidebar.d.ts +1 -1
  54. package/dist/ui/slider.d.ts +1 -0
  55. package/dist/ui/slider.d.ts.map +1 -1
  56. package/dist/ui/spinner.js +7 -7
  57. package/dist/ui/switch.d.ts +4 -1
  58. package/dist/ui/switch.d.ts.map +1 -1
  59. package/dist/ui/switch.js +13 -12
  60. package/dist/ui/toast.d.ts +3 -3
  61. package/dist/ui/toast.js +22 -22
  62. package/dist/ui/toaster.d.ts +3 -3
  63. package/dist/ui/toggle-group.d.ts +2 -2
  64. package/dist/ui/toggle.d.ts +2 -2
  65. package/fonts/Inter-Italic-Variable.woff2 +0 -0
  66. package/fonts/Inter-Variable.woff2 +0 -0
  67. package/fonts/Ranade-Variable.woff2 +0 -0
  68. package/fonts/Ranade-VariableItalic.woff2 +0 -0
  69. package/package.json +208 -160
  70. package/fonts/GoogleSans-Italic-Variable.ttf +0 -0
  71. package/fonts/GoogleSans-Variable.ttf +0 -0
  72. package/fonts/Ranade-Variable.ttf +0 -0
  73. package/fonts/Ranade-VariableItalic.ttf +0 -0
package/dist/ui/button.js CHANGED
@@ -1,23 +1,25 @@
1
1
  "use client";
2
- import { jsx as r, jsxs as g } from "react/jsx-runtime";
2
+ import { jsx as r, jsxs as p } from "react/jsx-runtime";
3
3
  import { cva as B } from "class-variance-authority";
4
- import { Root as C, Slottable as R } from "../primitives/react-slot.js";
5
- import * as V from "react";
6
- import { useButtonGroup as E } from "./button-group.js";
7
- import { cn as t } from "./lib/utils.js";
8
- import { Spinner as G } from "./spinner.js";
9
- const p = B(
4
+ import { Root as R, Slottable as E } from "../primitives/react-slot.js";
5
+ import * as G from "react";
6
+ import { useButtonGroup as M } from "./button-group.js";
7
+ import { cn as o } from "./lib/utils.js";
8
+ import { Spinner as q } from "./spinner.js";
9
+ const x = B(
10
10
  "inline-flex items-center justify-center gap-ds-03 whitespace-nowrap font-sans font-semibold select-none border border-transparent transition-[color,background-color,border-color,box-shadow] duration-fast-01 ease-productive-standard focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-[0.38]",
11
11
  {
12
12
  variants: {
13
13
  variant: {
14
- primary: "bg-interactive text-text-on-color hover:bg-interactive-hover active:bg-interactive-active shadow-01 hover:shadow-brand",
15
- secondary: "bg-transparent text-interactive border-border-interactive hover:bg-interactive-subtle active:bg-layer-active",
16
- ghost: "bg-transparent text-text-secondary hover:bg-layer-02 hover:text-text-primary active:bg-layer-active",
17
- error: "bg-error text-text-on-color hover:bg-error-hover active:bg-error-hover shadow-01",
18
- "error-ghost": "bg-transparent text-error border border-border-error hover:bg-error-surface active:bg-error-surface",
14
+ solid: "",
15
+ outline: "",
16
+ ghost: "",
19
17
  link: "text-text-link underline-offset-4 hover:underline active:opacity-[0.8]"
20
18
  },
19
+ color: {
20
+ default: "",
21
+ error: ""
22
+ },
21
23
  size: {
22
24
  sm: "h-ds-sm rounded-ds-md px-ds-04 text-ds-sm",
23
25
  md: "h-ds-md rounded-ds-md px-ds-05 text-ds-md",
@@ -27,80 +29,96 @@ const p = B(
27
29
  "icon-lg": "h-ds-lg w-ds-lg rounded-ds-lg"
28
30
  }
29
31
  },
32
+ compoundVariants: [
33
+ // solid + default (primary)
34
+ { variant: "solid", color: "default", className: "bg-interactive text-text-on-color hover:bg-interactive-hover active:bg-interactive-active shadow-01 hover:shadow-brand" },
35
+ // solid + error
36
+ { variant: "solid", color: "error", className: "bg-error text-text-on-color hover:bg-error-hover active:bg-error-hover shadow-01" },
37
+ // outline + default (secondary)
38
+ { variant: "outline", color: "default", className: "bg-transparent text-interactive border-border-interactive hover:bg-interactive-subtle active:bg-layer-active" },
39
+ // outline + error (error-ghost)
40
+ { variant: "outline", color: "error", className: "bg-transparent text-error border border-border-error hover:bg-error-surface active:bg-error-surface" },
41
+ // ghost + default
42
+ { variant: "ghost", color: "default", className: "bg-transparent text-text-secondary hover:bg-layer-02 hover:text-text-primary active:bg-layer-active" },
43
+ // ghost + error
44
+ { variant: "ghost", color: "error", className: "bg-transparent text-error hover:bg-error-surface hover:text-error active:bg-error-surface" }
45
+ ],
30
46
  defaultVariants: {
31
- variant: "primary",
47
+ variant: "solid",
48
+ color: "default",
32
49
  size: "md"
33
50
  }
34
51
  }
35
- ), M = {
52
+ ), A = {
36
53
  sm: "h-ico-sm w-ico-sm [&>svg]:h-ico-sm [&>svg]:w-ico-sm",
37
54
  md: "h-ico-sm w-ico-sm [&>svg]:h-ico-sm [&>svg]:w-ico-sm",
38
55
  lg: "h-ico-md w-ico-md [&>svg]:h-ico-md [&>svg]:w-ico-md",
39
56
  "icon-sm": "h-ico-sm w-ico-sm [&>svg]:h-ico-sm [&>svg]:w-ico-sm",
40
57
  "icon-md": "h-ico-sm w-ico-sm [&>svg]:h-ico-sm [&>svg]:w-ico-sm",
41
58
  "icon-lg": "h-ico-md w-ico-md [&>svg]:h-ico-md [&>svg]:w-ico-md"
42
- }, q = {
59
+ }, D = {
43
60
  sm: "sm",
44
61
  md: "sm",
45
62
  lg: "md",
46
63
  "icon-sm": "sm",
47
64
  "icon-md": "sm",
48
65
  "icon-lg": "md"
49
- }, A = V.forwardRef(
66
+ }, F = G.forwardRef(
50
67
  ({
51
68
  className: c,
52
- variant: x,
53
- size: w,
54
- asChild: y = !1,
55
- startIcon: a,
56
- endIcon: d,
69
+ variant: w,
70
+ color: y,
71
+ size: N,
72
+ asChild: z = !1,
73
+ startIcon: d,
74
+ endIcon: l,
57
75
  loading: e = !1,
58
- loadingPosition: o = "start",
76
+ loadingPosition: t = "start",
59
77
  fullWidth: m = !1,
60
- disabled: l,
78
+ disabled: v,
61
79
  children: i,
62
- ...v
63
- }, u) => {
64
- const b = E(), f = x ?? b.variant, s = w ?? b.size ?? "md", h = M[s], z = q[s], n = e ? /* @__PURE__ */ r(G, { size: z }) : null;
65
- if (y) {
66
- const k = {
67
- className: t(
68
- p({ variant: f, size: s, className: c }),
80
+ ...u
81
+ }, f) => {
82
+ const n = M(), b = w ?? n.variant, h = y ?? n.color, s = N ?? n.size ?? "md", g = A[s], S = D[s], a = e ? /* @__PURE__ */ r(q, { size: S }) : null;
83
+ if (z) {
84
+ const V = {
85
+ className: o(
86
+ x({ variant: b, color: h, size: s, className: c }),
69
87
  m && "w-full"
70
88
  ),
71
- ref: u,
72
- disabled: l || e,
89
+ ref: f,
90
+ disabled: v || e,
73
91
  "aria-busy": e || void 0,
74
- ...v
92
+ ...u
75
93
  };
76
- return /* @__PURE__ */ r(C, { ...k, children: /* @__PURE__ */ r(R, { children: i }) });
94
+ return /* @__PURE__ */ r(R, { ...V, children: /* @__PURE__ */ r(E, { children: i }) });
77
95
  }
78
- const S = () => e && o === "start" ? n : a ? /* @__PURE__ */ r("span", { className: t("inline-flex shrink-0 items-center justify-center", h), children: a }) : null, N = () => e && o === "end" ? n : d ? /* @__PURE__ */ r("span", { className: t("inline-flex shrink-0 items-center justify-center", h), children: d }) : null, j = () => e && o === "center" ? /* @__PURE__ */ g("span", { className: "relative inline-flex items-center justify-center", children: [
96
+ const j = () => e && t === "start" ? a : d ? /* @__PURE__ */ r("span", { className: o("inline-flex shrink-0 items-center justify-center", g), children: d }) : null, k = () => e && t === "end" ? a : l ? /* @__PURE__ */ r("span", { className: o("inline-flex shrink-0 items-center justify-center", g), children: l }) : null, C = () => e && t === "center" ? /* @__PURE__ */ p("span", { className: "relative inline-flex items-center justify-center", children: [
79
97
  /* @__PURE__ */ r("span", { className: "invisible", children: i }),
80
- /* @__PURE__ */ r("span", { className: "absolute inset-0 flex items-center justify-center", children: n })
98
+ /* @__PURE__ */ r("span", { className: "absolute inset-0 flex items-center justify-center", children: a })
81
99
  ] }) : i;
82
- return /* @__PURE__ */ g(
100
+ return /* @__PURE__ */ p(
83
101
  "button",
84
102
  {
85
- className: t(
86
- p({ variant: f, size: s, className: c }),
103
+ className: o(
104
+ x({ variant: b, color: h, size: s, className: c }),
87
105
  m && "w-full"
88
106
  ),
89
- ref: u,
90
- disabled: l || e,
107
+ ref: f,
108
+ disabled: v || e,
91
109
  "aria-busy": e || void 0,
92
- ...v,
110
+ ...u,
93
111
  children: [
94
- S(),
95
112
  j(),
96
- N()
113
+ C(),
114
+ k()
97
115
  ]
98
116
  }
99
117
  );
100
118
  }
101
119
  );
102
- A.displayName = "Button";
120
+ F.displayName = "Button";
103
121
  export {
104
- A as Button,
105
- p as buttonVariants
122
+ F as Button,
123
+ x as buttonVariants
106
124
  };
package/dist/ui/chip.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  declare const chipVariants: (props?: ({
5
5
  variant?: "filled" | "outlined" | null | undefined;
6
6
  size?: "sm" | "md" | "lg" | null | undefined;
7
- color?: "primary" | "error" | "default" | "warning" | "success" | "cyan" | "indigo" | "orange" | "teal" | "info" | "amber" | "slate" | "emerald" | null | undefined;
7
+ color?: "default" | "error" | "warning" | "success" | "cyan" | "indigo" | "orange" | "teal" | "info" | "amber" | "slate" | "emerald" | "primary" | null | undefined;
8
8
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
9
9
  type ChipColor = 'default' | 'primary' | 'success' | 'error' | 'warning' | 'info' | 'teal' | 'amber' | 'slate' | 'indigo' | 'cyan' | 'orange' | 'emerald';
10
10
  /**
@@ -15,8 +15,8 @@ type ChipColor = 'default' | 'primary' | 'success' | 'error' | 'warning' | 'info
15
15
  * - `color` controls **intent/category**: `"default"` | `"primary"` | `"success"` | `"error"` |
16
16
  * `"warning"` | `"info"` | `"teal"` | `"amber"` | `"slate"` | `"indigo"` | `"cyan"` | `"orange"` | `"emerald"`
17
17
  *
18
- * **Comparison with Badge:** Badge uses `variant=` for intent (e.g. `variant="success"`).
19
- * Chip uses `color=` for intent. They are different don't mix them up.
18
+ * **Comparison with Badge:** Badge now uses `color=` for intent (e.g. `color="success"`), same as Chip.
19
+ * Badge also has `variant=` for visual style (`subtle` | `solid` | `outline`).
20
20
  *
21
21
  * **Important:** Use the `label` prop, NOT `children`. Chip does not render children.
22
22
  *
@@ -38,7 +38,7 @@ type ChipColor = 'default' | 'primary' | 'success' | 'error' | 'warning' | 'info
38
38
  * // <Chip>High Priority</Chip>
39
39
  *
40
40
  * // Badge comparison:
41
- * // <Badge variant="success">Done</Badge> ← Badge uses variant= for intent
41
+ * // <Badge color="success">Done</Badge> ← Badge uses color= for intent
42
42
  * // <Chip label="Done" color="success" /> ← Chip uses color= for intent
43
43
  */
44
44
  type ChipProps = Omit<VariantProps<typeof chipVariants>, 'color'> & {
@@ -53,7 +53,7 @@ type ChipProps = Omit<VariantProps<typeof chipVariants>, 'color'> & {
53
53
  declare const Chip: React.ForwardRefExoticComponent<Omit<VariantProps<(props?: ({
54
54
  variant?: "filled" | "outlined" | null | undefined;
55
55
  size?: "sm" | "md" | "lg" | null | undefined;
56
- color?: "primary" | "error" | "default" | "warning" | "success" | "cyan" | "indigo" | "orange" | "teal" | "info" | "amber" | "slate" | "emerald" | null | undefined;
56
+ color?: "default" | "error" | "warning" | "success" | "cyan" | "indigo" | "orange" | "teal" | "info" | "amber" | "slate" | "emerald" | "primary" | null | undefined;
57
57
  } & import('class-variance-authority/types').ClassProp) | undefined) => string>, "color"> & {
58
58
  label: string;
59
59
  color?: ChipColor;
package/dist/ui/chip.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsxs as u, jsx as e } from "react/jsx-runtime";
2
+ import { jsxs as u, jsx as r } from "react/jsx-runtime";
3
3
  import * as v from "react";
4
4
  import { IconX as p } from "@tabler/icons-react";
5
5
  import { cva as N } from "class-variance-authority";
@@ -67,29 +67,29 @@ const w = N(
67
67
  }
68
68
  ), C = v.forwardRef(
69
69
  ({ label: t, variant: l, size: i, color: n, icon: o, onClick: s, onDelete: c, disabled: a, className: d, ...g }, b) => {
70
- const r = !!s, m = r ? "button" : "span", x = r && !a ? "cursor-pointer hover:bg-field-hover" : "", y = a ? "opacity-action-disabled cursor-not-allowed" : "";
70
+ const e = !!s, m = e ? "button" : "span", x = e && !a ? "cursor-pointer hover:bg-field-hover" : "", y = a ? "opacity-action-disabled cursor-not-allowed" : "";
71
71
  return /* @__PURE__ */ u(
72
72
  m,
73
73
  {
74
74
  ref: b,
75
75
  className: h(w({ variant: l, size: i, color: n }), x, y, d),
76
- onClick: r ? s : void 0,
77
- disabled: r ? a : void 0,
78
- type: r ? "button" : void 0,
76
+ onClick: e ? s : void 0,
77
+ disabled: e ? a : void 0,
78
+ type: e ? "button" : void 0,
79
79
  ...g,
80
80
  children: [
81
- o && /* @__PURE__ */ e("span", { className: "flex-shrink-0 [&>svg]:w-ico-sm [&>svg]:h-ico-sm", children: o }),
82
- /* @__PURE__ */ e("span", { children: t }),
83
- c && /* @__PURE__ */ e(
81
+ o && /* @__PURE__ */ r("span", { className: "flex-shrink-0 [&>svg]:w-ico-sm [&>svg]:h-ico-sm", children: o }),
82
+ /* @__PURE__ */ r("span", { children: t }),
83
+ c && /* @__PURE__ */ r(
84
84
  "button",
85
85
  {
86
86
  type: "button",
87
87
  "aria-label": `Remove ${t}`,
88
- className: "flex-shrink-0 rounded-ds-full p-ds-01 hover:bg-layer-03 transition-colors duration-fast-01 [&>svg]:w-ico-sm [&>svg]:h-ico-sm",
88
+ className: "flex-shrink-0 min-h-6 min-w-6 flex items-center justify-center rounded-ds-full p-ds-01 hover:bg-layer-03 transition-colors duration-fast-01 [&>svg]:w-ico-sm [&>svg]:h-ico-sm",
89
89
  onClick: (f) => {
90
90
  f.stopPropagation(), c();
91
91
  },
92
- children: /* @__PURE__ */ e(p, { className: "h-ico-sm w-ico-sm" })
92
+ children: /* @__PURE__ */ r(p, { className: "h-ico-sm w-ico-sm" })
93
93
  }
94
94
  )
95
95
  ]
@@ -18,7 +18,7 @@ export interface ComboboxOption {
18
18
  * **Single vs multi:** `multiple={false}` (default) — `value` is a `string`. When `multiple={true}`,
19
19
  * `value` is `string[]` and selected items appear as dismissible pills in the trigger.
20
20
  *
21
- * **`onChange` signature:** always `(value: string | string[]) => void`. Check `multiple` to determine
21
+ * **`onValueChange` signature:** always `(value: string | string[]) => void`. Check `multiple` to determine
22
22
  * which type you'll receive.
23
23
  *
24
24
  * **Custom rendering:** Use `renderOption` to return custom JSX per option (e.g. avatars, badges).
@@ -28,7 +28,7 @@ export interface ComboboxOption {
28
28
  * <Combobox
29
29
  * options={[{ value: 'in', label: 'India' }, { value: 'us', label: 'United States' }]}
30
30
  * value={country}
31
- * onChange={(v) => setCountry(v as string)}
31
+ * onValueChange={(v) => setCountry(v as string)}
32
32
  * placeholder="Select country"
33
33
  * />
34
34
  *
@@ -38,7 +38,7 @@ export interface ComboboxOption {
38
38
  * multiple
39
39
  * options={tagOptions}
40
40
  * value={selectedTags}
41
- * onChange={(v) => setSelectedTags(v as string[])}
41
+ * onValueChange={(v) => setSelectedTags(v as string[])}
42
42
  * placeholder="Select tags..."
43
43
  * />
44
44
  *
@@ -47,7 +47,7 @@ export interface ComboboxOption {
47
47
  * <Combobox
48
48
  * options={users.map(u => ({ value: u.id, label: u.name }))}
49
49
  * value={assigneeId}
50
- * onChange={(v) => setAssigneeId(v as string)}
50
+ * onValueChange={(v) => setAssigneeId(v as string)}
51
51
  * renderOption={(option, selected) => (
52
52
  * <span className="flex items-center gap-ds-03">
53
53
  * <Avatar size="xs"><AvatarFallback>{option.label[0]}</AvatarFallback></Avatar>
@@ -57,16 +57,15 @@ export interface ComboboxOption {
57
57
  * />
58
58
  * // These are just a few ways — feel free to combine props creatively!
59
59
  */
60
- export interface ComboboxProps {
60
+ export interface ComboboxProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
61
61
  options: ComboboxOption[];
62
62
  value?: string | string[];
63
- onChange: (value: string | string[]) => void;
63
+ onValueChange: (value: string | string[]) => void;
64
64
  placeholder?: string;
65
65
  searchPlaceholder?: string;
66
66
  emptyMessage?: string;
67
67
  multiple?: boolean;
68
68
  disabled?: boolean;
69
- className?: string;
70
69
  triggerClassName?: string;
71
70
  /** Max visible items in the dropdown before scroll (default 6) */
72
71
  maxVisible?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../src/ui/combobox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,cAAc,EAAE,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IACzB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAA;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,kEAAk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,QAAQ,EAAE,OAAO,KAAK,KAAK,CAAC,SAAS,CAAA;CAC9E;AAQD,QAAA,MAAM,QAAQ,yFA4Xb,CAAA;AAGD,OAAO,EAAE,QAAQ,EAAE,CAAA"}
@@ -1,14 +1,14 @@
1
1
  "use client";
2
- import { jsx as r, jsxs as d, Fragment as F } from "react/jsx-runtime";
2
+ import { jsx as r, jsxs as d, Fragment as B } from "react/jsx-runtime";
3
3
  import * as a from "react";
4
- import { Root as V, Trigger as B, Portal as G, Content as U } from "../primitives/react-popover.js";
5
- import { IconChevronDown as q, IconSearch as J, IconCheck as Q, IconX as W } from "@tabler/icons-react";
4
+ import { Root as G, Trigger as U, Portal as q, Content as J } from "../primitives/react-popover.js";
5
+ import { IconChevronDown as Q, IconSearch as W, IconCheck as Y, IconX as Z } from "@tabler/icons-react";
6
6
  import { cn as x } from "./lib/utils.js";
7
- const P = 2, Y = 36, Z = a.forwardRef(
7
+ const P = 2, V = 36, ee = a.forwardRef(
8
8
  ({
9
9
  options: u,
10
10
  value: f,
11
- onChange: m,
11
+ onValueChange: m,
12
12
  placeholder: S = "Select...",
13
13
  searchPlaceholder: A = "Search...",
14
14
  emptyMessage: L = "No results found",
@@ -17,14 +17,15 @@ const P = 2, Y = 36, Z = a.forwardRef(
17
17
  className: T,
18
18
  triggerClassName: $,
19
19
  maxVisible: j = 6,
20
- renderOption: E
21
- }, H) => {
20
+ renderOption: E,
21
+ ...H
22
+ }, M) => {
22
23
  const [h, w] = a.useState(!1), [v, y] = a.useState(""), [i, c] = a.useState(-1), k = a.useRef(null), N = a.useRef(null), R = a.useId(), I = a.useId(), n = a.useMemo(() => f == null ? [] : Array.isArray(f) ? f : [f], [f]), o = a.useMemo(
23
24
  () => v ? u.filter(
24
25
  (e) => e.label.toLowerCase().includes(v.toLowerCase())
25
26
  ) : u,
26
27
  [u, v]
27
- ), M = a.useCallback(
28
+ ), O = a.useCallback(
28
29
  (e) => n.includes(e),
29
30
  [n]
30
31
  ), g = a.useCallback(
@@ -36,14 +37,14 @@ const P = 2, Y = 36, Z = a.forwardRef(
36
37
  m(e), w(!1);
37
38
  },
38
39
  [b, n, m]
39
- ), O = a.useCallback(
40
+ ), _ = a.useCallback(
40
41
  (e, t) => {
41
42
  e.stopPropagation(), e.preventDefault();
42
43
  const s = n.filter((l) => l !== t);
43
44
  m(s);
44
45
  },
45
46
  [n, m]
46
- ), _ = a.useCallback(
47
+ ), z = a.useCallback(
47
48
  (e) => {
48
49
  p || (w(e), e || (y(""), c(-1)));
49
50
  },
@@ -70,7 +71,7 @@ const P = 2, Y = 36, Z = a.forwardRef(
70
71
  return e;
71
72
  },
72
73
  [o]
73
- ), z = a.useCallback(
74
+ ), K = a.useCallback(
74
75
  (e) => {
75
76
  switch (e.key) {
76
77
  case "ArrowDown": {
@@ -121,11 +122,11 @@ const P = 2, Y = 36, Z = a.forwardRef(
121
122
  t && ((e = t.scrollIntoView) == null || e.call(t, { block: "nearest" }));
122
123
  }
123
124
  }, [i]);
124
- const K = a.useCallback(() => {
125
+ const X = a.useCallback(() => {
125
126
  if (n.length === 0) return null;
126
127
  const e = u.find((t) => t.value === n[0]);
127
128
  return (e == null ? void 0 : e.label) ?? null;
128
- }, [n, u]), X = () => {
129
+ }, [n, u]), F = () => {
129
130
  if (b && n.length > 0) {
130
131
  const e = n.slice(0, P), t = n.length - P;
131
132
  return /* @__PURE__ */ d("span", { className: "flex flex-1 flex-wrap items-center gap-ds-02 overflow-hidden", children: [
@@ -142,10 +143,10 @@ const P = 2, Y = 36, Z = a.forwardRef(
142
143
  {
143
144
  type: "button",
144
145
  className: "inline-flex items-center justify-center rounded-ds-full outline-none hover:opacity-75",
145
- onClick: (D) => O(D, s),
146
+ onClick: (D) => _(D, s),
146
147
  "aria-label": `Remove ${l.label}`,
147
148
  tabIndex: -1,
148
- children: /* @__PURE__ */ r(W, { className: "h-3 w-3", "aria-hidden": "true" })
149
+ children: /* @__PURE__ */ r(Z, { className: "h-3 w-3", "aria-hidden": "true" })
149
150
  }
150
151
  )
151
152
  ]
@@ -161,17 +162,17 @@ const P = 2, Y = 36, Z = a.forwardRef(
161
162
  ] });
162
163
  }
163
164
  if (!b && n.length === 1) {
164
- const e = K();
165
+ const e = X();
165
166
  if (e)
166
167
  return /* @__PURE__ */ r("span", { className: "flex-1 truncate text-left", children: e });
167
168
  }
168
169
  return /* @__PURE__ */ r("span", { className: "flex-1 truncate text-left text-text-placeholder", children: S });
169
170
  };
170
- return /* @__PURE__ */ r(V, { open: h, onOpenChange: _, children: /* @__PURE__ */ d("div", { className: x("relative", T), children: [
171
- /* @__PURE__ */ r(B, { asChild: !0, disabled: p, children: /* @__PURE__ */ d(
171
+ return /* @__PURE__ */ r(G, { open: h, onOpenChange: z, children: /* @__PURE__ */ d("div", { className: x("relative", T), ...H, children: [
172
+ /* @__PURE__ */ r(U, { asChild: !0, disabled: p, children: /* @__PURE__ */ d(
172
173
  "button",
173
174
  {
174
- ref: H,
175
+ ref: M,
175
176
  type: "button",
176
177
  role: "combobox",
177
178
  "aria-expanded": h,
@@ -187,13 +188,13 @@ const P = 2, Y = 36, Z = a.forwardRef(
187
188
  $
188
189
  ),
189
190
  children: [
190
- X(),
191
- /* @__PURE__ */ r(q, { className: x("ml-ds-02 h-ico-sm w-ico-sm shrink-0 opacity-[0.5] transition-transform duration-fast-01", h && "rotate-180"), "aria-hidden": "true" })
191
+ F(),
192
+ /* @__PURE__ */ r(Q, { className: x("ml-ds-02 h-ico-sm w-ico-sm shrink-0 opacity-[0.5] transition-transform duration-fast-01", h && "rotate-180"), "aria-hidden": "true" })
192
193
  ]
193
194
  }
194
195
  ) }),
195
- /* @__PURE__ */ r(G, { children: /* @__PURE__ */ d(
196
- U,
196
+ /* @__PURE__ */ r(q, { children: /* @__PURE__ */ d(
197
+ J,
197
198
  {
198
199
  className: x(
199
200
  "z-dropdown w-[var(--radix-popover-trigger-width)] overflow-hidden rounded-ds-lg border border-border-subtle bg-layer-01 shadow-02",
@@ -207,7 +208,7 @@ const P = 2, Y = 36, Z = a.forwardRef(
207
208
  },
208
209
  children: [
209
210
  /* @__PURE__ */ d("div", { className: "flex items-center gap-ds-02 border-b border-border-subtle px-ds-04", children: [
210
- /* @__PURE__ */ r(J, { className: "h-ico-sm w-ico-sm shrink-0 text-text-tertiary", "aria-hidden": "true" }),
211
+ /* @__PURE__ */ r(W, { className: "h-ico-sm w-ico-sm shrink-0 text-text-tertiary", "aria-hidden": "true" }),
211
212
  /* @__PURE__ */ r(
212
213
  "input",
213
214
  {
@@ -219,7 +220,7 @@ const P = 2, Y = 36, Z = a.forwardRef(
219
220
  onChange: (e) => {
220
221
  y(e.target.value), c(-1);
221
222
  },
222
- onKeyDown: z,
223
+ onKeyDown: K,
223
224
  "aria-autocomplete": "list",
224
225
  "aria-controls": I,
225
226
  "aria-activedescendant": i >= 0 ? `${R}-option-${i}` : void 0,
@@ -235,9 +236,9 @@ const P = 2, Y = 36, Z = a.forwardRef(
235
236
  role: "listbox",
236
237
  "aria-multiselectable": b || void 0,
237
238
  className: "overflow-auto p-ds-02",
238
- style: { maxHeight: `${j * Y}px` },
239
+ style: { maxHeight: `${j * V}px` },
239
240
  children: o.map((e, t) => {
240
- const s = M(e.value);
241
+ const s = O(e.value);
241
242
  return /* @__PURE__ */ d(
242
243
  "li",
243
244
  {
@@ -263,11 +264,11 @@ const P = 2, Y = 36, Z = a.forwardRef(
263
264
  },
264
265
  children: [
265
266
  e.icon && /* @__PURE__ */ r("span", { className: "flex h-ico-sm w-ico-sm items-center justify-center shrink-0", children: e.icon }),
266
- /* @__PURE__ */ r("span", { className: "flex flex-1 flex-col", children: E ? E(e, s) : /* @__PURE__ */ d(F, { children: [
267
+ /* @__PURE__ */ r("span", { className: "flex flex-1 flex-col", children: E ? E(e, s) : /* @__PURE__ */ d(B, { children: [
267
268
  /* @__PURE__ */ r("span", { children: e.label }),
268
269
  e.description && /* @__PURE__ */ r("span", { className: "text-ds-sm text-text-secondary", children: e.description })
269
270
  ] }) }),
270
- s && /* @__PURE__ */ r(Q, { className: "h-ico-sm w-ico-sm shrink-0", "aria-hidden": "true" })
271
+ s && /* @__PURE__ */ r(Y, { className: "h-ico-sm w-ico-sm shrink-0", "aria-hidden": "true" })
271
272
  ]
272
273
  },
273
274
  e.value
@@ -281,7 +282,7 @@ const P = 2, Y = 36, Z = a.forwardRef(
281
282
  ] }) });
282
283
  }
283
284
  );
284
- Z.displayName = "Combobox";
285
+ ee.displayName = "Combobox";
285
286
  export {
286
- Z as Combobox
287
+ ee as Combobox
287
288
  };
@@ -22,7 +22,7 @@ import * as DialogPrimitive from '../primitives/react-dialog';
22
22
  * // Confirmation dialog:
23
23
  * <Dialog>
24
24
  * <DialogTrigger asChild>
25
- * <Button variant="error">Delete project</Button>
25
+ * <Button variant="solid" color="error">Delete project</Button>
26
26
  * </DialogTrigger>
27
27
  * <DialogContent>
28
28
  * <DialogHeader>
@@ -32,8 +32,8 @@ import * as DialogPrimitive from '../primitives/react-dialog';
32
32
  * </DialogDescription>
33
33
  * </DialogHeader>
34
34
  * <DialogFooter>
35
- * <DialogClose asChild><Button variant="secondary">Cancel</Button></DialogClose>
36
- * <Button variant="error" onClick={handleDelete}>Delete</Button>
35
+ * <DialogClose asChild><Button variant="outline">Cancel</Button></DialogClose>
36
+ * <Button variant="solid" color="error" onClick={handleDelete}>Delete</Button>
37
37
  * </DialogFooter>
38
38
  * </DialogContent>
39
39
  * </Dialog>
@@ -61,14 +61,8 @@ declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitiv
61
61
  * (e.g. CommandPalette in shared/).
62
62
  */
63
63
  declare const DialogContentRaw: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
64
- declare const DialogHeader: {
65
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
66
- displayName: string;
67
- };
68
- declare const DialogFooter: {
69
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
70
- displayName: string;
71
- };
64
+ declare const DialogHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
65
+ declare const DialogFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
72
66
  declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
73
67
  declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
74
68
  export { Dialog, DialogPortal, DialogOverlay, DialogTrigger, DialogClose, DialogContent, DialogContentRaw, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/ui/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,0BAA0B,CAAA;AAK3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,QAAA,MAAM,MAAM,uCAAuB,CAAA;AAEnC,QAAA,MAAM,aAAa,8GAA0B,CAAA;AAE7C,QAAA,MAAM,YAAY,6CAAyB,CAAA;AAE3C,QAAA,MAAM,WAAW,4GAAwB,CAAA;AAEzC,QAAA,MAAM,aAAa,8JAYjB,CAAA;AAGF,QAAA,MAAM,aAAa,8JAqBjB,CAAA;AAGF;;;;;GAKG;AACH,QAAA,MAAM,gBAAgB,8JASpB,CAAA;AAGF,QAAA,MAAM,YAAY;8BAGf,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;CAQtC,CAAA;AAGD,QAAA,MAAM,YAAY;8BAGf,KAA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