@devalok/shilp-sutra 0.3.1 → 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.
- package/dist/composed/date-picker/date-range-picker.js +9 -9
- package/dist/ui/accordion.d.ts +3 -0
- package/dist/ui/accordion.d.ts.map +1 -1
- package/dist/ui/alert-dialog.d.ts +2 -8
- package/dist/ui/alert-dialog.d.ts.map +1 -1
- package/dist/ui/alert-dialog.js +46 -46
- package/dist/ui/alert.d.ts +1 -1
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/banner.d.ts +1 -1
- package/dist/ui/button-group.d.ts +1 -1
- package/dist/ui/button-group.d.ts.map +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/chip.d.ts +7 -7
- package/dist/ui/chip.d.ts.map +1 -1
- package/dist/ui/chip.js +41 -41
- package/dist/ui/collapsible.d.ts +1 -0
- package/dist/ui/collapsible.d.ts.map +1 -1
- package/dist/ui/hover-card.d.ts +1 -0
- package/dist/ui/hover-card.d.ts.map +1 -1
- package/dist/ui/index.d.ts +12 -12
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +334 -331
- package/dist/ui/radio.d.ts +2 -0
- package/dist/ui/radio.d.ts.map +1 -1
- package/dist/ui/segmented-control.d.ts +10 -10
- package/dist/ui/segmented-control.d.ts.map +1 -1
- package/dist/ui/segmented-control.js +70 -70
- package/dist/ui/separator.d.ts +1 -0
- package/dist/ui/separator.d.ts.map +1 -1
- package/dist/ui/toast.d.ts +1 -1
- package/dist/ui/toast.js +2 -2
- package/dist/ui/toaster.d.ts +1 -1
- package/dist/ui/toggle-group.d.ts +3 -0
- package/dist/ui/toggle-group.d.ts.map +1 -1
- package/dist/ui/toggle.d.ts +1 -0
- package/dist/ui/toggle.d.ts.map +1 -1
- package/dist/ui/toggle.js +1 -1
- package/dist/ui/tree-view/tree-item.d.ts +2 -0
- package/dist/ui/tree-view/tree-item.d.ts.map +1 -1
- package/dist/ui/tree-view/tree-item.js +20 -18
- package/package.json +1 -1
package/dist/ui/radio.d.ts
CHANGED
|
@@ -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
|
package/dist/ui/radio.d.ts.map
CHANGED
|
@@ -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
|
-
|
|
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
|
|
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
|
-
* **`
|
|
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
|
-
*
|
|
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
|
|
52
|
+
* // Time range selector with filled variant (more prominent):
|
|
53
53
|
* <SegmentedControl
|
|
54
54
|
* size="sm"
|
|
55
|
-
*
|
|
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
|
-
|
|
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"
|
|
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"
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
54
|
+
variant: "tonal",
|
|
55
55
|
className: "bg-field text-text-primary"
|
|
56
56
|
},
|
|
57
57
|
// Hover + filled
|
|
58
58
|
{
|
|
59
59
|
isHovered: !0,
|
|
60
|
-
|
|
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
|
-
|
|
69
|
+
variant: "tonal",
|
|
70
70
|
className: "text-text-primary"
|
|
71
71
|
},
|
|
72
72
|
// Disabled + filled
|
|
73
73
|
{
|
|
74
74
|
isDisabled: !0,
|
|
75
|
-
|
|
75
|
+
variant: "filled",
|
|
76
76
|
className: "text-text-placeholder"
|
|
77
77
|
},
|
|
78
78
|
// Disabled + tonal
|
|
79
79
|
{
|
|
80
80
|
isDisabled: !0,
|
|
81
|
-
|
|
81
|
+
variant: "tonal",
|
|
82
82
|
className: "text-text-placeholder"
|
|
83
83
|
},
|
|
84
84
|
// Filled + SVG icon fill
|
|
85
85
|
{
|
|
86
|
-
|
|
86
|
+
variant: "filled",
|
|
87
87
|
className: "[&_svg_path]:fill-icon-on-color"
|
|
88
88
|
},
|
|
89
89
|
// Filled + disabled SVG icon fill
|
|
90
90
|
{
|
|
91
|
-
|
|
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
|
-
|
|
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:
|
|
123
|
-
|
|
124
|
-
options:
|
|
122
|
+
size: g,
|
|
123
|
+
variant: x,
|
|
124
|
+
options: s,
|
|
125
125
|
selectedId: m,
|
|
126
|
-
onSelect:
|
|
126
|
+
onSelect: i,
|
|
127
127
|
disabled: f = !1,
|
|
128
128
|
className: t = ""
|
|
129
|
-
},
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
}, [
|
|
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
|
|
135
|
-
let
|
|
134
|
+
const o = s.findIndex((_) => _.id === v);
|
|
135
|
+
let a = o;
|
|
136
136
|
switch (e.key) {
|
|
137
137
|
case "ArrowLeft":
|
|
138
|
-
e.preventDefault(),
|
|
138
|
+
e.preventDefault(), a = o > 0 ? o - 1 : s.length - 1;
|
|
139
139
|
break;
|
|
140
140
|
case "ArrowRight":
|
|
141
|
-
e.preventDefault(),
|
|
141
|
+
e.preventDefault(), a = o < s.length - 1 ? o + 1 : 0;
|
|
142
142
|
break;
|
|
143
143
|
case "Home":
|
|
144
|
-
e.preventDefault(),
|
|
144
|
+
e.preventDefault(), a = 0;
|
|
145
145
|
break;
|
|
146
146
|
case "End":
|
|
147
|
-
e.preventDefault(),
|
|
147
|
+
e.preventDefault(), a = s.length - 1;
|
|
148
148
|
break;
|
|
149
149
|
default:
|
|
150
150
|
return;
|
|
151
151
|
}
|
|
152
|
-
const c =
|
|
153
|
-
|
|
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:
|
|
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:
|
|
169
|
+
children: s.map((e) => /* @__PURE__ */ u(
|
|
170
170
|
k,
|
|
171
171
|
{
|
|
172
|
-
size:
|
|
173
|
-
|
|
172
|
+
size: h,
|
|
173
|
+
variant: x,
|
|
174
174
|
text: e.text,
|
|
175
175
|
icon: e.icon,
|
|
176
176
|
isSelected: e.id === m,
|
|
177
|
-
onClick: () =>
|
|
177
|
+
onClick: () => i(e.id),
|
|
178
178
|
disabled: f,
|
|
179
|
-
isFocused: e.id ===
|
|
180
|
-
onFocus: () =>
|
|
181
|
-
onBlur: () =>
|
|
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:
|
|
193
|
-
|
|
194
|
-
text:
|
|
192
|
+
size: g,
|
|
193
|
+
variant: x,
|
|
194
|
+
text: s,
|
|
195
195
|
icon: m,
|
|
196
|
-
isSelected:
|
|
196
|
+
isSelected: i,
|
|
197
197
|
onClick: f,
|
|
198
198
|
disabled: t = !1,
|
|
199
|
-
isFocused:
|
|
200
|
-
onFocus:
|
|
201
|
-
onBlur:
|
|
202
|
-
},
|
|
203
|
-
const [
|
|
204
|
-
!t && !
|
|
205
|
-
},
|
|
206
|
-
t ||
|
|
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 ||
|
|
209
|
-
},
|
|
210
|
-
t ||
|
|
208
|
+
t || l("pressed");
|
|
209
|
+
}, _ = () => {
|
|
210
|
+
t || l("hover");
|
|
211
211
|
};
|
|
212
212
|
return /* @__PURE__ */ C(
|
|
213
213
|
"button",
|
|
214
214
|
{
|
|
215
|
-
ref:
|
|
215
|
+
ref: d,
|
|
216
216
|
className: N(
|
|
217
217
|
z({
|
|
218
|
-
size:
|
|
219
|
-
|
|
220
|
-
selected:
|
|
221
|
-
isHovered:
|
|
218
|
+
size: g,
|
|
219
|
+
variant: x,
|
|
220
|
+
selected: i,
|
|
221
|
+
isHovered: b === "hover",
|
|
222
222
|
isDisabled: t
|
|
223
223
|
})
|
|
224
224
|
),
|
|
225
|
-
onClick: (
|
|
226
|
-
e(
|
|
225
|
+
onClick: (r) => {
|
|
226
|
+
e(r), f();
|
|
227
227
|
},
|
|
228
228
|
disabled: t,
|
|
229
229
|
type: "button",
|
|
230
230
|
role: "tab",
|
|
231
|
-
"aria-selected":
|
|
231
|
+
"aria-selected": i,
|
|
232
232
|
"aria-disabled": t,
|
|
233
|
-
onMouseEnter:
|
|
234
|
-
onMouseLeave:
|
|
233
|
+
onMouseEnter: o,
|
|
234
|
+
onMouseLeave: a,
|
|
235
235
|
onMouseDown: c,
|
|
236
|
-
onMouseUp:
|
|
236
|
+
onMouseUp: _,
|
|
237
237
|
onTouchStart: c,
|
|
238
|
-
onTouchEnd:
|
|
239
|
-
onFocus:
|
|
240
|
-
onBlur:
|
|
238
|
+
onTouchEnd: _,
|
|
239
|
+
onFocus: h,
|
|
240
|
+
onBlur: v,
|
|
241
241
|
children: [
|
|
242
|
-
y.map((
|
|
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:
|
|
251
|
-
top:
|
|
252
|
-
width:
|
|
253
|
-
height:
|
|
250
|
+
left: r.x,
|
|
251
|
+
top: r.y,
|
|
252
|
+
width: r.size,
|
|
253
|
+
height: r.size
|
|
254
254
|
}
|
|
255
255
|
},
|
|
256
|
-
|
|
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:
|
|
259
|
+
/* @__PURE__ */ u("span", { className: "font-accent leading-none", children: s })
|
|
260
260
|
]
|
|
261
261
|
}
|
|
262
262
|
);
|
package/dist/ui/separator.d.ts
CHANGED
|
@@ -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"}
|
package/dist/ui/toast.d.ts
CHANGED
|
@@ -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?: "
|
|
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
|
-
|
|
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: "
|
|
33
|
+
color: "neutral"
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
), w = r.forwardRef(({ className: e, color: t, ...o }, f) => /* @__PURE__ */ s(
|
package/dist/ui/toaster.d.ts
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* import { toast } from '@devalok/shilp-sutra'
|
|
35
35
|
* toast({ title: 'Deleted', color: 'error' })
|
|
36
36
|
*
|
|
37
|
-
* // Valid colors: '
|
|
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;
|
|
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"}
|
package/dist/ui/toggle.d.ts
CHANGED
|
@@ -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
|
package/dist/ui/toggle.d.ts.map
CHANGED
|
@@ -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
|
@@ -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;
|
|
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
|
|
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
|
|
7
|
-
import { useTreeContext as
|
|
8
|
-
const
|
|
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
|
-
|
|
19
|
-
|
|
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:
|
|
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:
|
|
57
|
-
onKeyDown:
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
136
|
+
j.displayName = "TreeItem";
|
|
135
137
|
export {
|
|
136
|
-
|
|
138
|
+
j as TreeItem
|
|
137
139
|
};
|