@dimasbaguspm/versaur 0.0.0 → 0.0.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.
- package/dist/index.js +6996 -66
- package/package.json +2 -10
- package/dist/alert-DzSPXqwS.js +0 -167
- package/dist/app-bar-B4nQkgdL.js +0 -92
- package/dist/avatar-Bsn24V6g.js +0 -91
- package/dist/badge-DqLCHm9q.js +0 -184
- package/dist/bottom-bar-DOQ3gVwW.js +0 -73
- package/dist/breadcrumbs-PJV3izUu.js +0 -59
- package/dist/button-C8OibEPE.js +0 -81
- package/dist/button-float-B8tdLJkX.js +0 -107
- package/dist/button-icon-CWji4cBA.js +0 -89
- package/dist/calendar-CkLj89o2.js +0 -112
- package/dist/checkbox-input-CSboebwt.js +0 -167
- package/dist/chip-input-C1PJPDFq.js +0 -189
- package/dist/cn-Ca4KprQ1.js +0 -2730
- package/dist/components/alert.js +0 -4
- package/dist/components/app-bar.js +0 -4
- package/dist/components/avatar.js +0 -4
- package/dist/components/badge.js +0 -4
- package/dist/components/bottom-bar.js +0 -4
- package/dist/components/breadcrumbs.js +0 -4
- package/dist/components/button-float.js +0 -4
- package/dist/components/button-icon.js +0 -4
- package/dist/components/button.js +0 -4
- package/dist/components/calendar.js +0 -4
- package/dist/components/checkbox-input.js +0 -4
- package/dist/components/chip-input.js +0 -4
- package/dist/components/date-single-picker-input.js +0 -4
- package/dist/components/drawer.js +0 -9
- package/dist/components/icon.js +0 -4
- package/dist/components/loading-indicator.js +0 -4
- package/dist/components/menu.js +0 -4
- package/dist/components/modal.js +0 -4
- package/dist/components/radio-input.js +0 -4
- package/dist/components/segment-multiple-input.js +0 -4
- package/dist/components/segment-single-input.js +0 -4
- package/dist/components/select-input.js +0 -4
- package/dist/components/skeleton.js +0 -4
- package/dist/components/snackbar.js +0 -4
- package/dist/components/switch-input.js +0 -7
- package/dist/components/tabs.js +0 -4
- package/dist/components/text-input.js +0 -4
- package/dist/components/text.js +0 -4
- package/dist/components/textarea-input.js +0 -4
- package/dist/components/tile.js +0 -4
- package/dist/components/top-bar.js +0 -4
- package/dist/date-single-picker-input--Ew0O9NQ.js +0 -252
- package/dist/drawer-DrnAR2a4.js +0 -218
- package/dist/helpers-CEDtBUGM.js +0 -37
- package/dist/hooks/index.js +0 -1
- package/dist/icon-D-lTZMHY.js +0 -44
- package/dist/index-DU1SCUkk.js +0 -329
- package/dist/loading-indicator-BZMnT5PA.js +0 -168
- package/dist/menu-BZvilMF7.js +0 -174
- package/dist/modal-BGAtqMl9.js +0 -149
- package/dist/radio-input-BRGoevZY.js +0 -173
- package/dist/segment-multiple-input-VwHCqFd6.js +0 -229
- package/dist/segment-single-input-Cqoo7-C2.js +0 -228
- package/dist/select-input-DCb0usvK.js +0 -108
- package/dist/skeleton-D4X5USf_.js +0 -59
- package/dist/snackbar-CYias-fJ.js +0 -79
- package/dist/switch-input-C5s1lvYh.js +0 -186
- package/dist/tabs-C8aRKfxS.js +0 -216
- package/dist/text-B7e-au41.js +0 -120
- package/dist/text-input-BsWvUk_H.js +0 -73
- package/dist/textarea-input-DZExXEE8.js +0 -102
- package/dist/tile-Du7YciCG.js +0 -51
- package/dist/top-bar-ErHvwR4K.js +0 -62
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
import { c as C, j as r } from "./index-DU1SCUkk.js";
|
|
2
|
-
import a, { createContext as N, useContext as V } from "react";
|
|
3
|
-
import { c as j } from "./cn-Ca4KprQ1.js";
|
|
4
|
-
const M = C(
|
|
5
|
-
"inline-flex rounded-lg border overflow-hidden bg-neutral/50 p-1",
|
|
6
|
-
{
|
|
7
|
-
variants: {
|
|
8
|
-
variant: {
|
|
9
|
-
// Core variants using Versaur color system
|
|
10
|
-
primary: "border-coral/20",
|
|
11
|
-
secondary: "border-sage/20",
|
|
12
|
-
tertiary: "border-mist/20",
|
|
13
|
-
ghost: "border-slate/20",
|
|
14
|
-
neutral: "border-gray-200",
|
|
15
|
-
// Outline variants
|
|
16
|
-
"primary-outline": "border-coral",
|
|
17
|
-
"secondary-outline": "border-sage",
|
|
18
|
-
"tertiary-outline": "border-mist",
|
|
19
|
-
"ghost-outline": "border-slate",
|
|
20
|
-
"neutral-outline": "border-gray-400",
|
|
21
|
-
// Semantic variants
|
|
22
|
-
success: "border-success/20",
|
|
23
|
-
"success-outline": "border-success",
|
|
24
|
-
info: "border-info/20",
|
|
25
|
-
"info-outline": "border-info",
|
|
26
|
-
warning: "border-warning/20",
|
|
27
|
-
"warning-outline": "border-warning",
|
|
28
|
-
danger: "border-danger/20",
|
|
29
|
-
"danger-outline": "border-danger"
|
|
30
|
-
},
|
|
31
|
-
size: {
|
|
32
|
-
sm: "text-xs",
|
|
33
|
-
md: "text-sm",
|
|
34
|
-
lg: "text-base"
|
|
35
|
-
},
|
|
36
|
-
error: {
|
|
37
|
-
true: "border-danger",
|
|
38
|
-
false: ""
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
defaultVariants: {
|
|
42
|
-
variant: "primary",
|
|
43
|
-
size: "md",
|
|
44
|
-
error: !1
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
), z = C(
|
|
48
|
-
"relative flex flex-row items-center px-3 py-2 text-center font-medium transition-all duration-200 cursor-pointer border-0 bg-transparent outline-none focus:ring-2 focus:ring-offset-1",
|
|
49
|
-
{
|
|
50
|
-
variants: {
|
|
51
|
-
variant: {
|
|
52
|
-
// Core variants using Versaur color system
|
|
53
|
-
primary: "text-slate hover:text-coral focus:ring-coral/30",
|
|
54
|
-
secondary: "text-slate hover:text-sage focus:ring-sage/30",
|
|
55
|
-
tertiary: "text-slate hover:text-mist focus:ring-mist/30",
|
|
56
|
-
ghost: "text-slate hover:text-slate focus:ring-slate/30",
|
|
57
|
-
neutral: "text-slate hover:text-gray-700 focus:ring-gray-400/30",
|
|
58
|
-
// Outline variants
|
|
59
|
-
"primary-outline": "text-coral hover:bg-coral/10 focus:ring-coral/30",
|
|
60
|
-
"secondary-outline": "text-sage hover:bg-sage/10 focus:ring-sage/30",
|
|
61
|
-
"tertiary-outline": "text-mist hover:bg-mist/10 focus:ring-mist/30",
|
|
62
|
-
"ghost-outline": "text-slate hover:bg-slate/10 focus:ring-slate/30",
|
|
63
|
-
"neutral-outline": "text-gray-600 hover:bg-gray-100 focus:ring-gray-500/30",
|
|
64
|
-
// Semantic variants
|
|
65
|
-
success: "text-slate hover:text-success focus:ring-success/30",
|
|
66
|
-
"success-outline": "text-success hover:bg-success/10 focus:ring-success/30",
|
|
67
|
-
info: "text-slate hover:text-info focus:ring-info/30",
|
|
68
|
-
"info-outline": "text-info hover:bg-info/10 focus:ring-info/30",
|
|
69
|
-
warning: "text-slate hover:text-warning focus:ring-warning/30",
|
|
70
|
-
"warning-outline": "text-warning hover:bg-warning/10 focus:ring-warning/30",
|
|
71
|
-
danger: "text-slate hover:text-danger focus:ring-danger/30",
|
|
72
|
-
"danger-outline": "text-danger hover:bg-danger/10 focus:ring-danger/30"
|
|
73
|
-
},
|
|
74
|
-
size: {
|
|
75
|
-
sm: "px-2 py-1.5 text-xs",
|
|
76
|
-
md: "px-3 py-2 text-sm",
|
|
77
|
-
lg: "px-4 py-2.5 text-base"
|
|
78
|
-
},
|
|
79
|
-
rounded: {
|
|
80
|
-
first: "rounded-l-md",
|
|
81
|
-
middle: "",
|
|
82
|
-
last: "rounded-r-md",
|
|
83
|
-
single: "rounded-md"
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
defaultVariants: {
|
|
87
|
-
variant: "primary",
|
|
88
|
-
size: "md",
|
|
89
|
-
rounded: "middle"
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
), E = (s) => {
|
|
93
|
-
const n = {
|
|
94
|
-
// Core variants - override hover text color changes
|
|
95
|
-
primary: "bg-coral text-white shadow-sm hover:text-white",
|
|
96
|
-
secondary: "bg-sage text-white shadow-sm hover:text-white",
|
|
97
|
-
tertiary: "bg-mist text-white shadow-sm hover:text-white",
|
|
98
|
-
ghost: "bg-slate text-white shadow-sm hover:text-white",
|
|
99
|
-
neutral: "bg-gray-500 text-white shadow-sm hover:text-white",
|
|
100
|
-
// Outline variants - override hover text color changes
|
|
101
|
-
"primary-outline": "bg-coral text-white shadow-sm hover:text-white",
|
|
102
|
-
"secondary-outline": "bg-sage text-white shadow-sm hover:text-white",
|
|
103
|
-
"tertiary-outline": "bg-mist text-white shadow-sm hover:text-white",
|
|
104
|
-
"ghost-outline": "bg-slate text-white shadow-sm hover:text-white",
|
|
105
|
-
"neutral-outline": "bg-gray-500 text-white shadow-sm hover:text-white",
|
|
106
|
-
// Semantic variants - override hover text color changes
|
|
107
|
-
success: "bg-success text-white shadow-sm hover:text-white",
|
|
108
|
-
"success-outline": "bg-success text-white shadow-sm hover:text-white",
|
|
109
|
-
info: "bg-info text-white shadow-sm hover:text-white",
|
|
110
|
-
"info-outline": "bg-info text-white shadow-sm hover:text-white",
|
|
111
|
-
warning: "bg-warning text-white shadow-sm hover:text-white",
|
|
112
|
-
"warning-outline": "bg-warning text-white shadow-sm hover:text-white",
|
|
113
|
-
danger: "bg-danger text-white shadow-sm hover:text-white",
|
|
114
|
-
"danger-outline": "bg-danger text-white shadow-sm hover:text-white"
|
|
115
|
-
};
|
|
116
|
-
return n[s || "primary"] || n.primary;
|
|
117
|
-
}, S = N(null), O = () => {
|
|
118
|
-
const s = V(S);
|
|
119
|
-
if (!s)
|
|
120
|
-
throw new Error(
|
|
121
|
-
"useSegmentMultipleInputContext must be used within SegmentMultipleInputContext"
|
|
122
|
-
);
|
|
123
|
-
return s;
|
|
124
|
-
}, I = a.forwardRef(
|
|
125
|
-
({ children: s, className: n, disabled: c, id: u, value: o, position: b = "middle", ...h }, v) => {
|
|
126
|
-
const e = O(), p = a.useId(), x = u || p, l = c || e.disabled, m = e.error ? "danger" : e.variant || "primary", t = e.value?.includes(o) ?? !1, y = (d) => {
|
|
127
|
-
if (!l) {
|
|
128
|
-
const w = e.value || [];
|
|
129
|
-
let i;
|
|
130
|
-
t ? i = w.filter((f) => f !== o) : i = [...w, o], e.onChange?.(i);
|
|
131
|
-
}
|
|
132
|
-
h.onChange?.(d);
|
|
133
|
-
};
|
|
134
|
-
return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
135
|
-
/* @__PURE__ */ r.jsx(
|
|
136
|
-
"input",
|
|
137
|
-
{
|
|
138
|
-
ref: v,
|
|
139
|
-
type: "checkbox",
|
|
140
|
-
id: x,
|
|
141
|
-
name: `${e.name}[]`,
|
|
142
|
-
value: o,
|
|
143
|
-
checked: t,
|
|
144
|
-
disabled: l,
|
|
145
|
-
onChange: y,
|
|
146
|
-
className: "sr-only",
|
|
147
|
-
...h
|
|
148
|
-
}
|
|
149
|
-
),
|
|
150
|
-
/* @__PURE__ */ r.jsx(
|
|
151
|
-
"label",
|
|
152
|
-
{
|
|
153
|
-
htmlFor: x,
|
|
154
|
-
className: j(
|
|
155
|
-
z({
|
|
156
|
-
variant: m,
|
|
157
|
-
size: e.size,
|
|
158
|
-
rounded: b
|
|
159
|
-
}),
|
|
160
|
-
// Apply selected state styling
|
|
161
|
-
t && E(m),
|
|
162
|
-
t && "relative z-10",
|
|
163
|
-
// Apply disabled styling directly since labels don't support disabled attribute
|
|
164
|
-
l && "opacity-50 cursor-not-allowed pointer-events-none",
|
|
165
|
-
n
|
|
166
|
-
),
|
|
167
|
-
children: s
|
|
168
|
-
}
|
|
169
|
-
)
|
|
170
|
-
] });
|
|
171
|
-
}
|
|
172
|
-
);
|
|
173
|
-
I.displayName = "SegmentOption";
|
|
174
|
-
const R = a.forwardRef(
|
|
175
|
-
({
|
|
176
|
-
variant: s = "primary",
|
|
177
|
-
size: n = "md",
|
|
178
|
-
label: c,
|
|
179
|
-
helperText: u,
|
|
180
|
-
error: o,
|
|
181
|
-
className: b,
|
|
182
|
-
disabled: h,
|
|
183
|
-
name: v,
|
|
184
|
-
value: e = [],
|
|
185
|
-
onChange: p,
|
|
186
|
-
children: x,
|
|
187
|
-
...l
|
|
188
|
-
}, m) => {
|
|
189
|
-
const t = !!o, y = {
|
|
190
|
-
variant: s,
|
|
191
|
-
size: n,
|
|
192
|
-
disabled: h,
|
|
193
|
-
error: t,
|
|
194
|
-
name: v,
|
|
195
|
-
value: e,
|
|
196
|
-
onChange: p
|
|
197
|
-
}, d = a.Children.toArray(x), w = d.map((i, f) => {
|
|
198
|
-
if (a.isValidElement(i)) {
|
|
199
|
-
let g;
|
|
200
|
-
return d.length === 1 ? g = "single" : f === 0 ? g = "first" : f === d.length - 1 ? g = "last" : g = "middle", a.cloneElement(
|
|
201
|
-
i,
|
|
202
|
-
{ position: g }
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
return i;
|
|
206
|
-
});
|
|
207
|
-
return /* @__PURE__ */ r.jsx(S.Provider, { value: y, children: /* @__PURE__ */ r.jsxs("div", { ref: m, className: j("w-full", b), ...l, children: [
|
|
208
|
-
c && /* @__PURE__ */ r.jsx("div", { className: "block text-sm font-medium text-foreground mb-3", children: c }),
|
|
209
|
-
/* @__PURE__ */ r.jsx(
|
|
210
|
-
"div",
|
|
211
|
-
{
|
|
212
|
-
className: M({
|
|
213
|
-
variant: t ? "danger" : s,
|
|
214
|
-
size: n,
|
|
215
|
-
error: t
|
|
216
|
-
}),
|
|
217
|
-
children: w
|
|
218
|
-
}
|
|
219
|
-
),
|
|
220
|
-
t && /* @__PURE__ */ r.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: o }),
|
|
221
|
-
!t && u && /* @__PURE__ */ r.jsx("div", { className: "mt-2 text-sm text-gray-600", children: u })
|
|
222
|
-
] }) });
|
|
223
|
-
}
|
|
224
|
-
), P = Object.assign(R, {
|
|
225
|
-
Option: I
|
|
226
|
-
});
|
|
227
|
-
export {
|
|
228
|
-
P as S
|
|
229
|
-
};
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import { c as S, j as t } from "./index-DU1SCUkk.js";
|
|
2
|
-
import i, { createContext as N, useContext as V } from "react";
|
|
3
|
-
import { c as C } from "./cn-Ca4KprQ1.js";
|
|
4
|
-
const z = S(
|
|
5
|
-
"inline-flex rounded-lg border overflow-hidden bg-neutral/50 p-1",
|
|
6
|
-
{
|
|
7
|
-
variants: {
|
|
8
|
-
variant: {
|
|
9
|
-
// Core variants using Versaur color system
|
|
10
|
-
primary: "border-coral/20",
|
|
11
|
-
secondary: "border-sage/20",
|
|
12
|
-
tertiary: "border-mist/20",
|
|
13
|
-
ghost: "border-slate/20",
|
|
14
|
-
neutral: "border-gray-200",
|
|
15
|
-
// Outline variants
|
|
16
|
-
"primary-outline": "border-coral",
|
|
17
|
-
"secondary-outline": "border-sage",
|
|
18
|
-
"tertiary-outline": "border-mist",
|
|
19
|
-
"ghost-outline": "border-slate",
|
|
20
|
-
"neutral-outline": "border-gray-400",
|
|
21
|
-
// Semantic variants
|
|
22
|
-
success: "border-success/20",
|
|
23
|
-
"success-outline": "border-success",
|
|
24
|
-
info: "border-info/20",
|
|
25
|
-
"info-outline": "border-info",
|
|
26
|
-
warning: "border-warning/20",
|
|
27
|
-
"warning-outline": "border-warning",
|
|
28
|
-
danger: "border-danger/20",
|
|
29
|
-
"danger-outline": "border-danger"
|
|
30
|
-
},
|
|
31
|
-
size: {
|
|
32
|
-
sm: "text-xs",
|
|
33
|
-
md: "text-sm",
|
|
34
|
-
lg: "text-base"
|
|
35
|
-
},
|
|
36
|
-
error: {
|
|
37
|
-
true: "border-danger",
|
|
38
|
-
false: ""
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
defaultVariants: {
|
|
42
|
-
variant: "primary",
|
|
43
|
-
size: "md",
|
|
44
|
-
error: !1
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
), E = S(
|
|
48
|
-
"relative flex flex-row items-center px-3 py-2 text-center font-medium transition-all duration-200 cursor-pointer border-0 bg-transparent outline-none focus:ring-2 focus:ring-offset-1",
|
|
49
|
-
{
|
|
50
|
-
variants: {
|
|
51
|
-
variant: {
|
|
52
|
-
// Core variants using Versaur color system
|
|
53
|
-
primary: "text-slate hover:text-coral focus:ring-coral/30",
|
|
54
|
-
secondary: "text-slate hover:text-sage focus:ring-sage/30",
|
|
55
|
-
tertiary: "text-slate hover:text-mist focus:ring-mist/30",
|
|
56
|
-
ghost: "text-slate hover:text-slate focus:ring-slate/30",
|
|
57
|
-
neutral: "text-slate hover:text-gray-700 focus:ring-gray-400/30",
|
|
58
|
-
// Outline variants
|
|
59
|
-
"primary-outline": "text-coral hover:bg-coral/10 focus:ring-coral/30",
|
|
60
|
-
"secondary-outline": "text-sage hover:bg-sage/10 focus:ring-sage/30",
|
|
61
|
-
"tertiary-outline": "text-mist hover:bg-mist/10 focus:ring-mist/30",
|
|
62
|
-
"ghost-outline": "text-slate hover:bg-slate/10 focus:ring-slate/30",
|
|
63
|
-
"neutral-outline": "text-gray-600 hover:bg-gray-100 focus:ring-gray-500/30",
|
|
64
|
-
// Semantic variants
|
|
65
|
-
success: "text-slate hover:text-success focus:ring-success/30",
|
|
66
|
-
"success-outline": "text-success hover:bg-success/10 focus:ring-success/30",
|
|
67
|
-
info: "text-slate hover:text-info focus:ring-info/30",
|
|
68
|
-
"info-outline": "text-info hover:bg-info/10 focus:ring-info/30",
|
|
69
|
-
warning: "text-slate hover:text-warning focus:ring-warning/30",
|
|
70
|
-
"warning-outline": "text-warning hover:bg-warning/10 focus:ring-warning/30",
|
|
71
|
-
danger: "text-slate hover:text-danger focus:ring-danger/30",
|
|
72
|
-
"danger-outline": "text-danger hover:bg-danger/10 focus:ring-danger/30"
|
|
73
|
-
},
|
|
74
|
-
size: {
|
|
75
|
-
sm: "px-2 py-1.5 text-xs",
|
|
76
|
-
md: "px-3 py-2 text-sm",
|
|
77
|
-
lg: "px-4 py-2.5 text-base"
|
|
78
|
-
},
|
|
79
|
-
rounded: {
|
|
80
|
-
first: "rounded-l-md",
|
|
81
|
-
middle: "",
|
|
82
|
-
last: "rounded-r-md",
|
|
83
|
-
single: "rounded-md"
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
defaultVariants: {
|
|
87
|
-
variant: "primary",
|
|
88
|
-
size: "md",
|
|
89
|
-
rounded: "middle"
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
), O = (r) => {
|
|
93
|
-
const s = {
|
|
94
|
-
// Core variants - override hover text color changes
|
|
95
|
-
primary: "bg-coral text-white shadow-sm hover:text-white",
|
|
96
|
-
secondary: "bg-sage text-white shadow-sm hover:text-white",
|
|
97
|
-
tertiary: "bg-mist text-white shadow-sm hover:text-white",
|
|
98
|
-
ghost: "bg-slate text-white shadow-sm hover:text-white",
|
|
99
|
-
neutral: "bg-gray-500 text-white shadow-sm hover:text-white",
|
|
100
|
-
// Outline variants - override hover text color changes
|
|
101
|
-
"primary-outline": "bg-coral text-white shadow-sm hover:text-white",
|
|
102
|
-
"secondary-outline": "bg-sage text-white shadow-sm hover:text-white",
|
|
103
|
-
"tertiary-outline": "bg-mist text-white shadow-sm hover:text-white",
|
|
104
|
-
"ghost-outline": "bg-slate text-white shadow-sm hover:text-white",
|
|
105
|
-
"neutral-outline": "bg-gray-500 text-white shadow-sm hover:text-white",
|
|
106
|
-
// Semantic variants - override hover text color changes
|
|
107
|
-
success: "bg-success text-white shadow-sm hover:text-white",
|
|
108
|
-
"success-outline": "bg-success text-white shadow-sm hover:text-white",
|
|
109
|
-
info: "bg-info text-white shadow-sm hover:text-white",
|
|
110
|
-
"info-outline": "bg-info text-white shadow-sm hover:text-white",
|
|
111
|
-
warning: "bg-warning text-white shadow-sm hover:text-white",
|
|
112
|
-
"warning-outline": "bg-warning text-white shadow-sm hover:text-white",
|
|
113
|
-
danger: "bg-danger text-white shadow-sm hover:text-white",
|
|
114
|
-
"danger-outline": "bg-danger text-white shadow-sm hover:text-white"
|
|
115
|
-
};
|
|
116
|
-
return s[r || "primary"] || s.primary;
|
|
117
|
-
}, j = N(null), R = () => {
|
|
118
|
-
const r = V(j);
|
|
119
|
-
if (!r)
|
|
120
|
-
throw new Error(
|
|
121
|
-
"useSegmentSingleInputContext must be used within SegmentSingleInputContext"
|
|
122
|
-
);
|
|
123
|
-
return r;
|
|
124
|
-
}, I = i.forwardRef(
|
|
125
|
-
({ children: r, className: s, disabled: d, id: c, value: o, position: m = "middle", ...h }, w) => {
|
|
126
|
-
const e = R(), f = i.useId(), u = c || f, a = d || e.disabled, x = e.error ? "danger" : e.variant || "primary", n = e.value === o, b = (g) => {
|
|
127
|
-
if (!a) {
|
|
128
|
-
const v = e.value === o ? null : o;
|
|
129
|
-
e.onChange?.(v);
|
|
130
|
-
}
|
|
131
|
-
h.onChange?.(g);
|
|
132
|
-
};
|
|
133
|
-
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
134
|
-
/* @__PURE__ */ t.jsx(
|
|
135
|
-
"input",
|
|
136
|
-
{
|
|
137
|
-
ref: w,
|
|
138
|
-
type: "radio",
|
|
139
|
-
id: u,
|
|
140
|
-
name: e.name,
|
|
141
|
-
value: o,
|
|
142
|
-
checked: n,
|
|
143
|
-
disabled: a,
|
|
144
|
-
onChange: b,
|
|
145
|
-
className: "sr-only",
|
|
146
|
-
...h
|
|
147
|
-
}
|
|
148
|
-
),
|
|
149
|
-
/* @__PURE__ */ t.jsx(
|
|
150
|
-
"label",
|
|
151
|
-
{
|
|
152
|
-
htmlFor: u,
|
|
153
|
-
className: C(
|
|
154
|
-
E({
|
|
155
|
-
variant: x,
|
|
156
|
-
size: e.size,
|
|
157
|
-
rounded: m
|
|
158
|
-
}),
|
|
159
|
-
// Apply selected state styling
|
|
160
|
-
n && O(x),
|
|
161
|
-
n && "relative z-10",
|
|
162
|
-
// Apply disabled styling directly since labels don't support disabled attribute
|
|
163
|
-
a && "opacity-50 cursor-not-allowed pointer-events-none",
|
|
164
|
-
s
|
|
165
|
-
),
|
|
166
|
-
children: r
|
|
167
|
-
}
|
|
168
|
-
)
|
|
169
|
-
] });
|
|
170
|
-
}
|
|
171
|
-
);
|
|
172
|
-
I.displayName = "SegmentOption";
|
|
173
|
-
const k = i.forwardRef(
|
|
174
|
-
({
|
|
175
|
-
variant: r = "primary",
|
|
176
|
-
size: s = "md",
|
|
177
|
-
label: d,
|
|
178
|
-
helperText: c,
|
|
179
|
-
error: o,
|
|
180
|
-
className: m,
|
|
181
|
-
disabled: h,
|
|
182
|
-
name: w,
|
|
183
|
-
value: e,
|
|
184
|
-
onChange: f,
|
|
185
|
-
children: u,
|
|
186
|
-
...a
|
|
187
|
-
}, x) => {
|
|
188
|
-
const n = !!o, b = {
|
|
189
|
-
variant: r,
|
|
190
|
-
size: s,
|
|
191
|
-
disabled: h,
|
|
192
|
-
error: n,
|
|
193
|
-
name: w,
|
|
194
|
-
value: e,
|
|
195
|
-
onChange: f
|
|
196
|
-
}, g = i.Children.toArray(u), v = g.map((p, y) => {
|
|
197
|
-
if (i.isValidElement(p)) {
|
|
198
|
-
let l;
|
|
199
|
-
return g.length === 1 ? l = "single" : y === 0 ? l = "first" : y === g.length - 1 ? l = "last" : l = "middle", i.cloneElement(
|
|
200
|
-
p,
|
|
201
|
-
{ position: l }
|
|
202
|
-
);
|
|
203
|
-
}
|
|
204
|
-
return p;
|
|
205
|
-
});
|
|
206
|
-
return /* @__PURE__ */ t.jsx(j.Provider, { value: b, children: /* @__PURE__ */ t.jsxs("div", { ref: x, className: C("w-full", m), ...a, children: [
|
|
207
|
-
d && /* @__PURE__ */ t.jsx("div", { className: "block text-sm font-medium text-foreground mb-3", children: d }),
|
|
208
|
-
/* @__PURE__ */ t.jsx(
|
|
209
|
-
"div",
|
|
210
|
-
{
|
|
211
|
-
className: z({
|
|
212
|
-
variant: n ? "danger" : r,
|
|
213
|
-
size: s,
|
|
214
|
-
error: n
|
|
215
|
-
}),
|
|
216
|
-
children: v
|
|
217
|
-
}
|
|
218
|
-
),
|
|
219
|
-
n && /* @__PURE__ */ t.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: o }),
|
|
220
|
-
!n && c && /* @__PURE__ */ t.jsx("div", { className: "mt-2 text-sm text-gray-600", children: c })
|
|
221
|
-
] }) });
|
|
222
|
-
}
|
|
223
|
-
), _ = Object.assign(k, {
|
|
224
|
-
Option: I
|
|
225
|
-
});
|
|
226
|
-
export {
|
|
227
|
-
_ as S
|
|
228
|
-
};
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { c as p, j as r } from "./index-DU1SCUkk.js";
|
|
2
|
-
import d from "react";
|
|
3
|
-
import { c as i } from "./cn-Ca4KprQ1.js";
|
|
4
|
-
const h = p(
|
|
5
|
-
"block w-full rounded-md border bg-white transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none disabled:bg-gray-50 appearance-none bg-no-repeat bg-right pr-10",
|
|
6
|
-
{
|
|
7
|
-
variants: {
|
|
8
|
-
variant: {
|
|
9
|
-
// Core variants using Versaur color system
|
|
10
|
-
primary: "border-coral/30 text-foreground focus:border-coral focus:ring-coral/20",
|
|
11
|
-
secondary: "border-sage/30 text-foreground focus:border-sage focus:ring-sage/20",
|
|
12
|
-
tertiary: "border-mist/30 text-foreground focus:border-mist focus:ring-mist/20",
|
|
13
|
-
ghost: "border-slate/30 text-foreground focus:border-slate focus:ring-slate/20",
|
|
14
|
-
neutral: "border-gray-300 text-foreground focus:border-gray-400 focus:ring-gray-400/20",
|
|
15
|
-
// Outline variants
|
|
16
|
-
"primary-outline": "border-coral text-foreground focus:border-coral focus:ring-coral/20",
|
|
17
|
-
"secondary-outline": "border-sage text-foreground focus:border-sage focus:ring-sage/20",
|
|
18
|
-
"tertiary-outline": "border-mist text-foreground focus:border-mist focus:ring-mist/20",
|
|
19
|
-
"ghost-outline": "border-slate text-foreground focus:border-slate focus:ring-slate/20",
|
|
20
|
-
"neutral-outline": "border-gray-400 text-foreground focus:border-gray-500 focus:ring-gray-500/20",
|
|
21
|
-
// Semantic variants
|
|
22
|
-
success: "border-success/30 text-foreground focus:border-success focus:ring-success/20",
|
|
23
|
-
"success-outline": "border-success text-foreground focus:border-success focus:ring-success/20",
|
|
24
|
-
info: "border-info/30 text-foreground focus:border-info focus:ring-info/20",
|
|
25
|
-
"info-outline": "border-info text-foreground focus:border-info focus:ring-info/20",
|
|
26
|
-
warning: "border-warning/30 text-foreground focus:border-warning focus:ring-warning/20",
|
|
27
|
-
"warning-outline": "border-warning text-foreground focus:border-warning focus:ring-warning/20",
|
|
28
|
-
danger: "border-danger bg-danger/5 text-foreground focus:border-danger focus:ring-danger/20",
|
|
29
|
-
"danger-outline": "border-danger bg-danger/5 text-foreground focus:border-danger focus:ring-danger/20"
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
defaultVariants: {
|
|
33
|
-
variant: "primary"
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
), v = d.forwardRef(
|
|
37
|
-
({
|
|
38
|
-
variant: c = "primary",
|
|
39
|
-
label: u,
|
|
40
|
-
helperText: o,
|
|
41
|
-
error: s,
|
|
42
|
-
className: g,
|
|
43
|
-
disabled: n,
|
|
44
|
-
id: f,
|
|
45
|
-
placeholder: t,
|
|
46
|
-
children: l,
|
|
47
|
-
...b
|
|
48
|
-
}, x) => {
|
|
49
|
-
const m = d.useId(), a = f || m, e = !!s;
|
|
50
|
-
return /* @__PURE__ */ r.jsxs("div", { children: [
|
|
51
|
-
/* @__PURE__ */ r.jsx(
|
|
52
|
-
"label",
|
|
53
|
-
{
|
|
54
|
-
htmlFor: a,
|
|
55
|
-
className: "block text-sm font-medium text-foreground mb-2",
|
|
56
|
-
children: u
|
|
57
|
-
}
|
|
58
|
-
),
|
|
59
|
-
/* @__PURE__ */ r.jsxs("div", { className: i("relative w-full", g), children: [
|
|
60
|
-
/* @__PURE__ */ r.jsxs(
|
|
61
|
-
"select",
|
|
62
|
-
{
|
|
63
|
-
ref: x,
|
|
64
|
-
id: a,
|
|
65
|
-
"aria-invalid": e,
|
|
66
|
-
"aria-disabled": n,
|
|
67
|
-
disabled: n,
|
|
68
|
-
className: i(
|
|
69
|
-
h({
|
|
70
|
-
variant: e ? "danger" : c
|
|
71
|
-
}),
|
|
72
|
-
"h-10 pl-3"
|
|
73
|
-
),
|
|
74
|
-
...b,
|
|
75
|
-
children: [
|
|
76
|
-
t && /* @__PURE__ */ r.jsx("option", { value: "", disabled: !0, hidden: !0, children: t }),
|
|
77
|
-
l
|
|
78
|
-
]
|
|
79
|
-
}
|
|
80
|
-
),
|
|
81
|
-
/* @__PURE__ */ r.jsx("div", { className: "absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none", children: /* @__PURE__ */ r.jsx(
|
|
82
|
-
"svg",
|
|
83
|
-
{
|
|
84
|
-
className: "w-5 h-5 text-gray-400",
|
|
85
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
86
|
-
viewBox: "0 0 20 20",
|
|
87
|
-
fill: "currentColor",
|
|
88
|
-
"aria-hidden": "true",
|
|
89
|
-
children: /* @__PURE__ */ r.jsx(
|
|
90
|
-
"path",
|
|
91
|
-
{
|
|
92
|
-
fillRule: "evenodd",
|
|
93
|
-
d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",
|
|
94
|
-
clipRule: "evenodd"
|
|
95
|
-
}
|
|
96
|
-
)
|
|
97
|
-
}
|
|
98
|
-
) })
|
|
99
|
-
] }),
|
|
100
|
-
e && /* @__PURE__ */ r.jsx("div", { className: "mt-1 text-sm text-danger", role: "alert", children: s }),
|
|
101
|
-
!e && o && /* @__PURE__ */ r.jsx("div", { className: "mt-1 text-sm text-gray-600", children: o })
|
|
102
|
-
] });
|
|
103
|
-
}
|
|
104
|
-
);
|
|
105
|
-
v.displayName = "SelectInput";
|
|
106
|
-
export {
|
|
107
|
-
v as S
|
|
108
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { c as u, j as a } from "./index-DU1SCUkk.js";
|
|
2
|
-
import * as m from "react";
|
|
3
|
-
import { c } from "./cn-Ca4KprQ1.js";
|
|
4
|
-
const p = u("w-full overflow-hidden bg-neutral-200", {
|
|
5
|
-
variants: {
|
|
6
|
-
shape: {
|
|
7
|
-
rectangle: "rounded-none",
|
|
8
|
-
rounded: "rounded-md",
|
|
9
|
-
circle: "rounded-full",
|
|
10
|
-
square: "aspect-square rounded-md"
|
|
11
|
-
},
|
|
12
|
-
size: {
|
|
13
|
-
sm: "h-4",
|
|
14
|
-
md: "h-6",
|
|
15
|
-
lg: "h-8",
|
|
16
|
-
xl: "h-12"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
defaultVariants: {
|
|
20
|
-
shape: "rounded",
|
|
21
|
-
size: "md"
|
|
22
|
-
}
|
|
23
|
-
}), w = m.forwardRef(
|
|
24
|
-
function({ shape: o = "rounded", size: n = "md", height: e, className: s, style: r, ...t }, d) {
|
|
25
|
-
const l = ["sm", "md", "lg", "xl"].includes(n) ? n : "md", i = e ? {
|
|
26
|
-
...r,
|
|
27
|
-
height: typeof e == "number" ? `${e}px` : e
|
|
28
|
-
} : r;
|
|
29
|
-
return /* @__PURE__ */ a.jsx(
|
|
30
|
-
"div",
|
|
31
|
-
{
|
|
32
|
-
ref: d,
|
|
33
|
-
role: "presentation",
|
|
34
|
-
className: c(
|
|
35
|
-
"relative",
|
|
36
|
-
p({ shape: o, size: l }),
|
|
37
|
-
s
|
|
38
|
-
),
|
|
39
|
-
style: i,
|
|
40
|
-
"aria-hidden": "true",
|
|
41
|
-
...t,
|
|
42
|
-
children: /* @__PURE__ */ a.jsx(
|
|
43
|
-
"span",
|
|
44
|
-
{
|
|
45
|
-
className: [
|
|
46
|
-
"absolute inset-0 block w-full h-full",
|
|
47
|
-
"animate-loading-bar",
|
|
48
|
-
"bg-gradient-to-r from-transparent via-white/60 to-transparent pointer-events-none"
|
|
49
|
-
].join(" "),
|
|
50
|
-
"aria-hidden": "true"
|
|
51
|
-
}
|
|
52
|
-
)
|
|
53
|
-
}
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
);
|
|
57
|
-
export {
|
|
58
|
-
w as S
|
|
59
|
-
};
|