@devalok/shilp-sutra 0.3.0 → 0.4.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 (45) hide show
  1. package/dist/composed/date-picker/date-range-picker.js +9 -9
  2. package/dist/ui/accordion.d.ts +3 -0
  3. package/dist/ui/accordion.d.ts.map +1 -1
  4. package/dist/ui/alert-dialog.d.ts +2 -8
  5. package/dist/ui/alert-dialog.d.ts.map +1 -1
  6. package/dist/ui/alert-dialog.js +46 -46
  7. package/dist/ui/alert.d.ts +2 -2
  8. package/dist/ui/alert.d.ts.map +1 -1
  9. package/dist/ui/badge.d.ts +1 -1
  10. package/dist/ui/badge.d.ts.map +1 -1
  11. package/dist/ui/banner.d.ts +2 -2
  12. package/dist/ui/banner.d.ts.map +1 -1
  13. package/dist/ui/button-group.d.ts +1 -1
  14. package/dist/ui/button-group.d.ts.map +1 -1
  15. package/dist/ui/button.d.ts +1 -1
  16. package/dist/ui/button.d.ts.map +1 -1
  17. package/dist/ui/chip.d.ts +7 -7
  18. package/dist/ui/chip.d.ts.map +1 -1
  19. package/dist/ui/chip.js +41 -41
  20. package/dist/ui/collapsible.d.ts +1 -0
  21. package/dist/ui/collapsible.d.ts.map +1 -1
  22. package/dist/ui/hover-card.d.ts +1 -0
  23. package/dist/ui/hover-card.d.ts.map +1 -1
  24. package/dist/ui/index.d.ts +12 -12
  25. package/dist/ui/index.d.ts.map +1 -1
  26. package/dist/ui/index.js +334 -331
  27. package/dist/ui/radio.d.ts +2 -0
  28. package/dist/ui/radio.d.ts.map +1 -1
  29. package/dist/ui/segmented-control.d.ts +10 -10
  30. package/dist/ui/segmented-control.d.ts.map +1 -1
  31. package/dist/ui/segmented-control.js +70 -70
  32. package/dist/ui/separator.d.ts +1 -0
  33. package/dist/ui/separator.d.ts.map +1 -1
  34. package/dist/ui/toast.d.ts +1 -1
  35. package/dist/ui/toast.js +2 -2
  36. package/dist/ui/toaster.d.ts +1 -1
  37. package/dist/ui/toggle-group.d.ts +3 -0
  38. package/dist/ui/toggle-group.d.ts.map +1 -1
  39. package/dist/ui/toggle.d.ts +1 -0
  40. package/dist/ui/toggle.d.ts.map +1 -1
  41. package/dist/ui/toggle.js +1 -1
  42. package/dist/ui/tree-view/tree-item.d.ts +2 -0
  43. package/dist/ui/tree-view/tree-item.d.ts.map +1 -1
  44. package/dist/ui/tree-view/tree-item.js +20 -18
  45. package/package.json +208 -208
@@ -3,5 +3,7 @@ import * as RadioGroupPrimitive from '../primitives/react-radio-group';
3
3
  import * as React from 'react';
4
4
  declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
5
  declare const RadioGroupItem: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
6
+ export type RadioGroupProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>;
7
+ export type RadioGroupItemProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>;
6
8
  export { RadioGroup, RadioGroupItem };
7
9
  //# sourceMappingURL=radio.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../src/ui/radio.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,mBAAmB,MAAM,+BAA+B,CAAA;AAEpE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,QAAA,MAAM,UAAU,+JAKd,CAAA;AAGF,QAAA,MAAM,cAAc,yKAuBlB,CAAA;AAGF,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../src/ui/radio.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,mBAAmB,MAAM,+BAA+B,CAAA;AAEpE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,QAAA,MAAM,UAAU,+JAKd,CAAA;AAGF,QAAA,MAAM,cAAc,yKAuBlB,CAAA;AAGF,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,wBAAwB,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAA;AAC7F,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,wBAAwB,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAA;AAEjG,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAA"}
@@ -2,13 +2,13 @@
2
2
  import { default as React } from 'react';
3
3
  declare const segmentedControlItemVariants: (props?: ({
4
4
  size?: "sm" | "md" | "lg" | null | undefined;
5
- color?: "filled" | "tonal" | null | undefined;
5
+ variant?: "filled" | "tonal" | null | undefined;
6
6
  selected?: boolean | null | undefined;
7
7
  isHovered?: boolean | null | undefined;
8
8
  isDisabled?: boolean | null | undefined;
9
9
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
10
10
  export type SegmentedControlSize = 'sm' | 'md' | 'lg' | 'small' | 'medium' | 'big';
11
- export type SegmentedControlColor = 'filled' | 'tonal';
11
+ export type SegmentedControlVariant = 'filled' | 'tonal';
12
12
  /**
13
13
  * A single option in a `<SegmentedControl>`. The `id` must be unique across all options in
14
14
  * the same control — it is used as the selection key for `selectedId` and `onSelect`.
@@ -28,7 +28,7 @@ export interface SegmentedControlOption {
28
28
  * **`size`:** `'sm'` | `'md'` (default) | `'lg'`. Legacy aliases `'small'` | `'medium'` | `'big'` are
29
29
  * also accepted for backward compatibility but prefer the canonical form.
30
30
  *
31
- * **`color`:** `'tonal'` (default, subdued) | `'filled'` (vibrant brand color when selected).
31
+ * **`variant`:** `'tonal'` (default, subdued) | `'filled'` (vibrant brand color when selected).
32
32
  *
33
33
  * **Options:** Each option needs a unique `id`, a display `text`, and an optional `icon` component.
34
34
  *
@@ -38,7 +38,7 @@ export interface SegmentedControlOption {
38
38
  * // View mode switcher (list vs grid vs board):
39
39
  * <SegmentedControl
40
40
  * size="md"
41
- * color="tonal"
41
+ * variant="tonal"
42
42
  * options={[
43
43
  * { id: 'list', text: 'List' },
44
44
  * { id: 'grid', text: 'Grid' },
@@ -49,10 +49,10 @@ export interface SegmentedControlOption {
49
49
  * />
50
50
  *
51
51
  * @example
52
- * // Time range selector with filled color (more prominent):
52
+ * // Time range selector with filled variant (more prominent):
53
53
  * <SegmentedControl
54
54
  * size="sm"
55
- * color="filled"
55
+ * variant="filled"
56
56
  * options={[
57
57
  * { id: '7d', text: '7D' },
58
58
  * { id: '30d', text: '30D' },
@@ -65,7 +65,7 @@ export interface SegmentedControlOption {
65
65
  */
66
66
  export interface SegmentedControlProps {
67
67
  size: SegmentedControlSize;
68
- color: SegmentedControlColor;
68
+ variant: SegmentedControlVariant;
69
69
  options: SegmentedControlOption[];
70
70
  selectedId: string;
71
71
  onSelect: (id: string) => void;
@@ -88,13 +88,13 @@ declare const SegmentedControl: React.ForwardRefExoticComponent<SegmentedControl
88
88
  *
89
89
  * <div role="tablist" className="inline-flex rounded-full border border-border bg-layer-02">
90
90
  * <SegmentedControlItem
91
- * size="md" color="tonal" text="List"
91
+ * size="md" variant="tonal" text="List"
92
92
  * isSelected={view === 'list'} isFocused={focused === 'list'}
93
93
  * onClick={() => setView('list')}
94
94
  * onFocus={() => setFocused('list')} onBlur={() => setFocused(null)}
95
95
  * />
96
96
  * <SegmentedControlItem
97
- * size="md" color="tonal" text="Grid" icon={IconLayoutGrid}
97
+ * size="md" variant="tonal" text="Grid" icon={IconLayoutGrid}
98
98
  * isSelected={view === 'grid'} isFocused={focused === 'grid'}
99
99
  * onClick={() => setView('grid')}
100
100
  * onFocus={() => setFocused('grid')} onBlur={() => setFocused(null)}
@@ -105,7 +105,7 @@ declare const SegmentedControl: React.ForwardRefExoticComponent<SegmentedControl
105
105
  */
106
106
  export interface SegmentedControlItemProps {
107
107
  size: 'sm' | 'md' | 'lg';
108
- color: SegmentedControlColor;
108
+ variant: SegmentedControlVariant;
109
109
  text: string;
110
110
  /** Optional icon component rendered before the text label. */
111
111
  icon?: React.ComponentType<{
@@ -1 +1 @@
1
- {"version":3,"file":"segmented-control.d.ts","sourceRoot":"","sources":["../../src/ui/segmented-control.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2B,MAAM,OAAO,CAAA;AAM/C,QAAA,MAAM,4BAA4B;;;;;;8EAsGjC,CAAA;AAqBD,MAAM,MAAM,oBAAoB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;AAClF,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,OAAO,CAAA;AAEtD;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,8DAA8D;IAC9D,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACnD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,oBAAoB,CAAA;IAC1B,KAAK,EAAE,qBAAqB,CAAA;IAC5B,OAAO,EAAE,sBAAsB,EAAE,CAAA;IACjC,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAGD,QAAA,MAAM,gBAAgB,8FAoFrB,CAAA;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;IACxB,KAAK,EAAE,qBAAqB,CAAA;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,8DAA8D;IAC9D,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAClD,UAAU,EAAE,OAAO,CAAA;IACnB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB;AAED,QAAA,MAAM,oBAAoB,qGA0FzB,CAAA;AAGD,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,CAAA"}
1
+ {"version":3,"file":"segmented-control.d.ts","sourceRoot":"","sources":["../../src/ui/segmented-control.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2B,MAAM,OAAO,CAAA;AAM/C,QAAA,MAAM,4BAA4B;;;;;;8EAsGjC,CAAA;AAqBD,MAAM,MAAM,oBAAoB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;AAClF,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,OAAO,CAAA;AAExD;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,8DAA8D;IAC9D,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACnD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,oBAAoB,CAAA;IAC1B,OAAO,EAAE,uBAAuB,CAAA;IAChC,OAAO,EAAE,sBAAsB,EAAE,CAAA;IACjC,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAGD,QAAA,MAAM,gBAAgB,8FAoFrB,CAAA;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;IACxB,OAAO,EAAE,uBAAuB,CAAA;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,8DAA8D;IAC9D,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAClD,UAAU,EAAE,OAAO,CAAA;IACnB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB;AAED,QAAA,MAAM,oBAAoB,qGA0FzB,CAAA;AAGD,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,CAAA"}
@@ -21,7 +21,7 @@ const z = S(
21
21
  md: "px-ds-02b py-ds-03 pl-ds-04 text-ds-md",
22
22
  lg: "h-[56px] px-ds-06 py-ds-05 text-ds-md"
23
23
  },
24
- color: {
24
+ variant: {
25
25
  filled: "text-text-on-color [text-shadow:0px_1px_1px_var(--color-text-shadow)]",
26
26
  tonal: "text-text-tertiary"
27
27
  },
@@ -42,7 +42,7 @@ const z = S(
42
42
  // Selected + filled
43
43
  {
44
44
  selected: !0,
45
- color: "filled",
45
+ variant: "filled",
46
46
  className: [
47
47
  "bg-interactive",
48
48
  "shadow-[0px_1px_3px_0.05px_var(--color-interactive-hover),inset_0px_8px_16px_0px_var(--color-inset-glow-strong),inset_0px_2px_0px_0px_var(--color-inset-glow-subtle)]"
@@ -51,13 +51,13 @@ const z = S(
51
51
  // Selected + tonal
52
52
  {
53
53
  selected: !0,
54
- color: "tonal",
54
+ variant: "tonal",
55
55
  className: "bg-field text-text-primary"
56
56
  },
57
57
  // Hover + filled
58
58
  {
59
59
  isHovered: !0,
60
- color: "filled",
60
+ variant: "filled",
61
61
  className: [
62
62
  "bg-interactive",
63
63
  "shadow-[0px_4px_8px_0px_var(--color-interactive-hover),0px_1px_3px_0.05px_var(--color-layer-02),inset_0px_8px_16px_0px_var(--color-inset-glow-strong),inset_0px_2px_0px_0px_var(--color-inset-glow-subtle)]"
@@ -66,29 +66,29 @@ const z = S(
66
66
  // Hover + tonal
67
67
  {
68
68
  isHovered: !0,
69
- color: "tonal",
69
+ variant: "tonal",
70
70
  className: "text-text-primary"
71
71
  },
72
72
  // Disabled + filled
73
73
  {
74
74
  isDisabled: !0,
75
- color: "filled",
75
+ variant: "filled",
76
76
  className: "text-text-placeholder"
77
77
  },
78
78
  // Disabled + tonal
79
79
  {
80
80
  isDisabled: !0,
81
- color: "tonal",
81
+ variant: "tonal",
82
82
  className: "text-text-placeholder"
83
83
  },
84
84
  // Filled + SVG icon fill
85
85
  {
86
- color: "filled",
86
+ variant: "filled",
87
87
  className: "[&_svg_path]:fill-icon-on-color"
88
88
  },
89
89
  // Filled + disabled SVG icon fill
90
90
  {
91
- color: "filled",
91
+ variant: "filled",
92
92
  isDisabled: !0,
93
93
  className: "[&_svg_path]:fill-icon-disabled"
94
94
  },
@@ -100,7 +100,7 @@ const z = S(
100
100
  ],
101
101
  defaultVariants: {
102
102
  size: "md",
103
- color: "tonal",
103
+ variant: "tonal",
104
104
  selected: !1,
105
105
  isHovered: !1,
106
106
  isDisabled: !1
@@ -119,43 +119,43 @@ function j(p) {
119
119
  }
120
120
  const E = w.forwardRef(
121
121
  function({
122
- size: h,
123
- color: x,
124
- options: o,
122
+ size: g,
123
+ variant: x,
124
+ options: s,
125
125
  selectedId: m,
126
- onSelect: d,
126
+ onSelect: i,
127
127
  disabled: f = !1,
128
128
  className: t = ""
129
- }, s) {
130
- const b = j(h), [_, i] = D(null), v = M(null), a = w.useCallback((e) => {
131
- v.current = e, typeof s == "function" ? s(e) : s && (s.current = e);
132
- }, [s]), y = (e) => {
129
+ }, n) {
130
+ const h = j(g), [v, d] = D(null), b = M(null), l = w.useCallback((e) => {
131
+ b.current = e, typeof n == "function" ? n(e) : n && (n.current = e);
132
+ }, [n]), y = (e) => {
133
133
  if (f) return;
134
- const r = o.findIndex((g) => g.id === _);
135
- let l = r;
134
+ const o = s.findIndex((_) => _.id === v);
135
+ let a = o;
136
136
  switch (e.key) {
137
137
  case "ArrowLeft":
138
- e.preventDefault(), l = r > 0 ? r - 1 : o.length - 1;
138
+ e.preventDefault(), a = o > 0 ? o - 1 : s.length - 1;
139
139
  break;
140
140
  case "ArrowRight":
141
- e.preventDefault(), l = r < o.length - 1 ? r + 1 : 0;
141
+ e.preventDefault(), a = o < s.length - 1 ? o + 1 : 0;
142
142
  break;
143
143
  case "Home":
144
- e.preventDefault(), l = 0;
144
+ e.preventDefault(), a = 0;
145
145
  break;
146
146
  case "End":
147
- e.preventDefault(), l = o.length - 1;
147
+ e.preventDefault(), a = s.length - 1;
148
148
  break;
149
149
  default:
150
150
  return;
151
151
  }
152
- const c = o[l];
153
- i(c.id), d(c.id);
152
+ const c = s[a];
153
+ d(c.id), i(c.id);
154
154
  };
155
155
  return /* @__PURE__ */ u(
156
156
  "div",
157
157
  {
158
- ref: a,
158
+ ref: l,
159
159
  className: N(
160
160
  "inline-flex gap-0 p-0 rounded-ds-full",
161
161
  "bg-layer-02",
@@ -166,19 +166,19 @@ const E = w.forwardRef(
166
166
  onKeyDown: y,
167
167
  tabIndex: -1,
168
168
  "aria-label": "Segmented control options",
169
- children: o.map((e) => /* @__PURE__ */ u(
169
+ children: s.map((e) => /* @__PURE__ */ u(
170
170
  k,
171
171
  {
172
- size: b,
173
- color: x,
172
+ size: h,
173
+ variant: x,
174
174
  text: e.text,
175
175
  icon: e.icon,
176
176
  isSelected: e.id === m,
177
- onClick: () => d(e.id),
177
+ onClick: () => i(e.id),
178
178
  disabled: f,
179
- isFocused: e.id === _,
180
- onFocus: () => i(e.id),
181
- onBlur: () => i(null)
179
+ isFocused: e.id === v,
180
+ onFocus: () => d(e.id),
181
+ onBlur: () => d(null)
182
182
  },
183
183
  e.id
184
184
  ))
@@ -189,57 +189,57 @@ const E = w.forwardRef(
189
189
  E.displayName = "SegmentedControl";
190
190
  const k = w.forwardRef(
191
191
  function({
192
- size: h,
193
- color: x,
194
- text: o,
192
+ size: g,
193
+ variant: x,
194
+ text: s,
195
195
  icon: m,
196
- isSelected: d,
196
+ isSelected: i,
197
197
  onClick: f,
198
198
  disabled: t = !1,
199
- isFocused: s,
200
- onFocus: b,
201
- onBlur: _
202
- }, i) {
203
- const [v, a] = D("default"), { ripples: y, createRipple: e } = I(), r = () => {
204
- !t && !s && a("hover");
205
- }, l = () => {
206
- t || a("default");
199
+ isFocused: n,
200
+ onFocus: h,
201
+ onBlur: v
202
+ }, d) {
203
+ const [b, l] = D("default"), { ripples: y, createRipple: e } = I(), o = () => {
204
+ !t && !n && l("hover");
205
+ }, a = () => {
206
+ t || l("default");
207
207
  }, c = () => {
208
- t || a("pressed");
209
- }, g = () => {
210
- t || a("hover");
208
+ t || l("pressed");
209
+ }, _ = () => {
210
+ t || l("hover");
211
211
  };
212
212
  return /* @__PURE__ */ C(
213
213
  "button",
214
214
  {
215
- ref: i,
215
+ ref: d,
216
216
  className: N(
217
217
  z({
218
- size: h,
219
- color: x,
220
- selected: d,
221
- isHovered: v === "hover",
218
+ size: g,
219
+ variant: x,
220
+ selected: i,
221
+ isHovered: b === "hover",
222
222
  isDisabled: t
223
223
  })
224
224
  ),
225
- onClick: (n) => {
226
- e(n), f();
225
+ onClick: (r) => {
226
+ e(r), f();
227
227
  },
228
228
  disabled: t,
229
229
  type: "button",
230
230
  role: "tab",
231
- "aria-selected": d,
231
+ "aria-selected": i,
232
232
  "aria-disabled": t,
233
- onMouseEnter: r,
234
- onMouseLeave: l,
233
+ onMouseEnter: o,
234
+ onMouseLeave: a,
235
235
  onMouseDown: c,
236
- onMouseUp: g,
236
+ onMouseUp: _,
237
237
  onTouchStart: c,
238
- onTouchEnd: g,
239
- onFocus: b,
240
- onBlur: _,
238
+ onTouchEnd: _,
239
+ onFocus: h,
240
+ onBlur: v,
241
241
  children: [
242
- y.map((n) => /* @__PURE__ */ u(
242
+ y.map((r) => /* @__PURE__ */ u(
243
243
  "span",
244
244
  {
245
245
  className: N(
@@ -247,16 +247,16 @@ const k = w.forwardRef(
247
247
  H[x]
248
248
  ),
249
249
  style: {
250
- left: n.x,
251
- top: n.y,
252
- width: n.size,
253
- height: n.size
250
+ left: r.x,
251
+ top: r.y,
252
+ width: r.size,
253
+ height: r.size
254
254
  }
255
255
  },
256
- n.id
256
+ r.id
257
257
  )),
258
258
  m && /* @__PURE__ */ u(m, { className: "h-ico-sm w-ico-sm shrink-0" }),
259
- /* @__PURE__ */ u("span", { className: "font-accent leading-none", children: o })
259
+ /* @__PURE__ */ u("span", { className: "font-accent leading-none", children: s })
260
260
  ]
261
261
  }
262
262
  );
@@ -2,5 +2,6 @@
2
2
  import * as React from 'react';
3
3
  import * as SeparatorPrimitive from '../primitives/react-separator';
4
4
  declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
+ export type SeparatorProps = React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>;
5
6
  export { Separator };
6
7
  //# sourceMappingURL=separator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../../src/ui/separator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,kBAAkB,MAAM,6BAA6B,CAAA;AAIjE,QAAA,MAAM,SAAS,6JAoBd,CAAA;AAGD,OAAO,EAAE,SAAS,EAAE,CAAA"}
1
+ {"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../../src/ui/separator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,kBAAkB,MAAM,6BAA6B,CAAA;AAIjE,QAAA,MAAM,SAAS,6JAoBd,CAAA;AAGD,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,wBAAwB,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAA;AAE3F,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -5,7 +5,7 @@ import * as ToastPrimitives from '../primitives/react-toast';
5
5
  declare const ToastProvider: React.FC<ToastPrimitives.ToastProviderProps>;
6
6
  declare const ToastViewport: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastViewportProps & React.RefAttributes<HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
7
7
  declare const Toast: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
8
- color?: "default" | "error" | "warning" | "success" | "info" | null | undefined;
8
+ color?: "error" | "warning" | "success" | "neutral" | "info" | null | undefined;
9
9
  } & import('class-variance-authority/types').ClassProp) | undefined) => string> & React.RefAttributes<HTMLLIElement>>;
10
10
  declare const ToastAction: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
11
11
  declare const ToastClose: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastCloseProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
package/dist/ui/toast.js CHANGED
@@ -22,7 +22,7 @@ const v = u(
22
22
  {
23
23
  variants: {
24
24
  color: {
25
- default: "border-border bg-layer-01 text-text-primary",
25
+ neutral: "border-border bg-layer-01 text-text-primary",
26
26
  success: "border-success-border bg-success-surface text-success-text",
27
27
  warning: "border-warning-border bg-warning-surface text-warning-text",
28
28
  error: "destructive group border-border-error bg-error-surface text-error-text",
@@ -30,7 +30,7 @@ const v = u(
30
30
  }
31
31
  },
32
32
  defaultVariants: {
33
- color: "default"
33
+ color: "neutral"
34
34
  }
35
35
  }
36
36
  ), w = r.forwardRef(({ className: e, color: t, ...o }, f) => /* @__PURE__ */ s(
@@ -34,7 +34,7 @@
34
34
  * import { toast } from '@devalok/shilp-sutra'
35
35
  * toast({ title: 'Deleted', color: 'error' })
36
36
  *
37
- * // Valid colors: 'default' | 'success' | 'warning' | 'error' | 'info'
37
+ * // Valid colors: 'neutral' | 'success' | 'warning' | 'error' | 'info'
38
38
  */
39
39
  export declare function Toaster(): import("react/jsx-runtime").JSX.Element;
40
40
  export declare namespace Toaster {
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { VariantProps } from 'class-variance-authority';
3
+ import { toggleVariants } from './toggle';
3
4
  import * as React from 'react';
4
5
  import * as ToggleGroupPrimitive from '../primitives/react-toggle-group';
5
6
  declare const ToggleGroup: React.ForwardRefExoticComponent<((Omit<ToggleGroupPrimitive.ToggleGroupSingleProps & React.RefAttributes<HTMLDivElement>, "ref"> | Omit<ToggleGroupPrimitive.ToggleGroupMultipleProps & React.RefAttributes<HTMLDivElement>, "ref">) & VariantProps<(props?: ({
@@ -10,5 +11,7 @@ declare const ToggleGroupItem: React.ForwardRefExoticComponent<Omit<ToggleGroupP
10
11
  variant?: "outline" | "default" | null | undefined;
11
12
  size?: "sm" | "md" | "lg" | null | undefined;
12
13
  } & import('class-variance-authority/types').ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
14
+ export type ToggleGroupProps = React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants>;
15
+ export type ToggleGroupItemProps = React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>;
13
16
  export { ToggleGroup, ToggleGroupItem };
14
17
  //# sourceMappingURL=toggle-group.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toggle-group.d.ts","sourceRoot":"","sources":["../../src/ui/toggle-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,oBAAoB,MAAM,gCAAgC,CAAA;AACtE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAY5D,QAAA,MAAM,WAAW;;;uHAcf,CAAA;AAGF,QAAA,MAAM,eAAe;;;yHAoBnB,CAAA;AAGF,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,CAAA"}
1
+ {"version":3,"file":"toggle-group.d.ts","sourceRoot":"","sources":["../../src/ui/toggle-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,oBAAoB,MAAM,gCAAgC,CAAA;AACtE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAG5D,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AASzC,QAAA,MAAM,WAAW;;;uHAcf,CAAA;AAGF,QAAA,MAAM,eAAe;;;yHAoBnB,CAAA;AAGF,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,wBAAwB,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,GAC7F,YAAY,CAAC,OAAO,cAAc,CAAC,CAAA;AACrC,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,wBAAwB,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,GACjG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAA;AAErC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,CAAA"}
@@ -10,5 +10,6 @@ declare const Toggle: React.ForwardRefExoticComponent<Omit<TogglePrimitive.Toggl
10
10
  variant?: "outline" | "default" | null | undefined;
11
11
  size?: "sm" | "md" | "lg" | null | undefined;
12
12
  } & import('class-variance-authority/types').ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
13
+ export type ToggleProps = React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>;
13
14
  export { Toggle, toggleVariants };
14
15
  //# sourceMappingURL=toggle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../src/ui/toggle.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,cAAc;;;8EAqBnB,CAAA;AAED,QAAA,MAAM,MAAM;;;yHAUV,CAAA;AAGF,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../src/ui/toggle.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,cAAc;;;8EAqBnB,CAAA;AAED,QAAA,MAAM,MAAM;;;yHAUV,CAAA;AAGF,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,wBAAwB,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,GACnF,YAAY,CAAC,OAAO,cAAc,CAAC,CAAA;AAErC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
package/dist/ui/toggle.js CHANGED
@@ -27,7 +27,7 @@ const m = n(
27
27
  e,
28
28
  {
29
29
  ref: a,
30
- className: l(m({ variant: s, size: i, className: t })),
30
+ className: l(m({ variant: s, size: i }), t),
31
31
  ...o
32
32
  }
33
33
  ));
@@ -17,6 +17,8 @@ export interface TreeItemProps {
17
17
  children?: React.ReactNode;
18
18
  /** Depth level (used internally) */
19
19
  depth?: number;
20
+ /** Additional CSS class names */
21
+ className?: string;
20
22
  }
21
23
  declare const TreeItem: React.ForwardRefExoticComponent<TreeItemProps & React.RefAttributes<HTMLLIElement>>;
22
24
  export { TreeItem };
@@ -1 +1 @@
1
- {"version":3,"file":"tree-item.d.ts","sourceRoot":"","sources":["../../../src/ui/tree-view/tree-item.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAM,WAAW,aAAa;IAC5B,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAA;IACd,4BAA4B;IAC5B,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,uDAAuD;IACvD,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAChC,oDAAoD;IACpD,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,wBAAwB;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,QAAA,MAAM,QAAQ,qFAkMb,CAAA;AAGD,OAAO,EAAE,QAAQ,EAAE,CAAA"}
1
+ {"version":3,"file":"tree-item.d.ts","sourceRoot":"","sources":["../../../src/ui/tree-view/tree-item.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAM,WAAW,aAAa;IAC5B,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAA;IACd,4BAA4B;IAC5B,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,uDAAuD;IACvD,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAChC,oDAAoD;IACpD,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,wBAAwB;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,QAAA,MAAM,QAAQ,qFAoMb,CAAA;AAGD,OAAO,EAAE,QAAQ,EAAE,CAAA"}
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import { jsxs as C, jsx as r } from "react/jsx-runtime";
3
- import { IconChevronRight as D } from "@tabler/icons-react";
3
+ import { IconChevronRight as P } from "@tabler/icons-react";
4
4
  import * as s from "react";
5
5
  import { cn as m } from "../lib/utils.js";
6
- import { Checkbox as P } from "../checkbox.js";
7
- import { useTreeContext as R } from "./tree-view.js";
8
- const S = s.forwardRef(
6
+ import { Checkbox as R } from "../checkbox.js";
7
+ import { useTreeContext as S } from "./tree-view.js";
8
+ const j = s.forwardRef(
9
9
  ({
10
10
  itemId: n,
11
11
  label: y,
@@ -14,13 +14,14 @@ const S = s.forwardRef(
14
14
  actions: g,
15
15
  disabled: o = !1,
16
16
  children: d,
17
- depth: p = 0
18
- }, N) => {
19
- const t = R(), a = s.Children.count(d) > 0, i = t.tree.isExpanded(n), c = t.tree.isSelected(n), w = (e) => {
17
+ depth: p = 0,
18
+ className: N
19
+ }, w) => {
20
+ const t = S(), a = s.Children.count(d) > 0, i = t.tree.isExpanded(n), c = t.tree.isSelected(n), b = (e) => {
20
21
  o || t.tree.select(n, e);
21
- }, b = (e) => {
22
- e.stopPropagation(), !o && t.tree.toggle(n);
23
22
  }, E = (e) => {
23
+ e.stopPropagation(), !o && t.tree.toggle(n);
24
+ }, D = (e) => {
24
25
  o || ((e.key === "Enter" || e.key === " ") && (e.preventDefault(), t.tree.select(n)), e.key === "ArrowRight" && a && !i && (e.preventDefault(), e.stopPropagation(), t.tree.toggle(n)), e.key === "ArrowLeft" && a && i && (e.preventDefault(), e.stopPropagation(), t.tree.toggle(n)));
25
26
  }, x = s.useMemo(() => {
26
27
  if (!t.checkboxes || !a)
@@ -39,7 +40,7 @@ const S = s.forwardRef(
39
40
  return /* @__PURE__ */ C(
40
41
  "li",
41
42
  {
42
- ref: N,
43
+ ref: w,
43
44
  role: "treeitem",
44
45
  "aria-expanded": a ? i : void 0,
45
46
  "aria-selected": c,
@@ -53,15 +54,16 @@ const S = s.forwardRef(
53
54
  role: "presentation",
54
55
  "data-tree-item": n,
55
56
  tabIndex: o ? -1 : 0,
56
- onClick: w,
57
- onKeyDown: E,
57
+ onClick: b,
58
+ onKeyDown: D,
58
59
  style: { paddingLeft: p * 20 + 8 },
59
60
  className: m(
60
61
  "flex items-center gap-ds-02 py-ds-02 px-ds-02 rounded-ds-md cursor-pointer transition-colors duration-fast-01",
61
62
  "hover:bg-layer-02",
62
63
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus",
63
64
  c && "bg-interactive-selected text-text-interactive",
64
- o && "opacity-[0.38] cursor-not-allowed pointer-events-none"
65
+ o && "opacity-[0.38] cursor-not-allowed pointer-events-none",
66
+ N
65
67
  ),
66
68
  children: [
67
69
  a ? /* @__PURE__ */ r(
@@ -70,10 +72,10 @@ const S = s.forwardRef(
70
72
  type: "button",
71
73
  tabIndex: -1,
72
74
  "aria-hidden": "true",
73
- onClick: b,
75
+ onClick: E,
74
76
  className: "flex shrink-0 items-center justify-center p-0 border-0 bg-transparent cursor-pointer",
75
77
  children: /* @__PURE__ */ r(
76
- D,
78
+ P,
77
79
  {
78
80
  size: 16,
79
81
  className: m(
@@ -85,7 +87,7 @@ const S = s.forwardRef(
85
87
  }
86
88
  ) : /* @__PURE__ */ r("span", { className: "inline-block w-4 shrink-0", "aria-hidden": "true" }),
87
89
  t.checkboxes && /* @__PURE__ */ r(
88
- P,
90
+ R,
89
91
  {
90
92
  checked: x.checked,
91
93
  indeterminate: x.indeterminate,
@@ -131,7 +133,7 @@ const S = s.forwardRef(
131
133
  );
132
134
  }
133
135
  );
134
- S.displayName = "TreeItem";
136
+ j.displayName = "TreeItem";
135
137
  export {
136
- S as TreeItem
138
+ j as TreeItem
137
139
  };