@causw/core 0.0.8 → 0.0.10
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.d.mts +330 -286
- package/dist/index.d.ts +330 -286
- package/dist/index.js +1182 -219
- package/dist/index.mjs +1163 -219
- package/package.json +8 -4
- package/src/styles/global.css +155 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React4 = require('react');
|
|
4
4
|
var clsx = require('clsx');
|
|
5
5
|
var tailwindMerge = require('tailwind-merge');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var reactSlot = require('@radix-ui/react-slot');
|
|
6
8
|
|
|
7
9
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
10
|
|
|
9
|
-
var
|
|
11
|
+
var React4__default = /*#__PURE__*/_interopDefault(React4);
|
|
10
12
|
|
|
11
13
|
// src/components/Text/Text.tsx
|
|
14
|
+
function mergeStyles(...inputs) {
|
|
15
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
16
|
+
}
|
|
12
17
|
|
|
13
18
|
// src/components/Text/Text.styles.ts
|
|
14
19
|
var colorClasses = {
|
|
@@ -22,7 +27,7 @@ var colorClasses = {
|
|
|
22
27
|
"gray-700": "text-gray-700",
|
|
23
28
|
"gray-800": "text-gray-800",
|
|
24
29
|
"gray-900": "text-gray-900",
|
|
25
|
-
"blue-
|
|
30
|
+
"blue-100": "text-blue-100",
|
|
26
31
|
"blue-500": "text-blue-500",
|
|
27
32
|
"blue-700": "text-blue-700",
|
|
28
33
|
"red-100": "text-red-100",
|
|
@@ -30,245 +35,859 @@ var colorClasses = {
|
|
|
30
35
|
white: "text-white-main",
|
|
31
36
|
black: "text-black-main"
|
|
32
37
|
};
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
var alignClasses = {
|
|
39
|
+
left: "text-left",
|
|
40
|
+
center: "text-center",
|
|
41
|
+
right: "text-right",
|
|
42
|
+
justify: "text-justify"
|
|
43
|
+
};
|
|
44
|
+
var typographyStyles = {
|
|
45
|
+
// Caption variants
|
|
46
|
+
"caption-sm": "typo-caption-sm",
|
|
47
|
+
"caption-sm-point": "typo-caption-sm-point",
|
|
48
|
+
"caption-md": "typo-caption-md",
|
|
49
|
+
"caption-md-point": "typo-caption-md-point",
|
|
50
|
+
// Body2 variants
|
|
51
|
+
"body2-sm": "typo-body2-sm",
|
|
52
|
+
"body2-sm-point": "typo-body2-sm-point",
|
|
53
|
+
"body2-md": "typo-body2-md",
|
|
54
|
+
"body2-md-point": "typo-body2-md-point",
|
|
55
|
+
// Body variants
|
|
56
|
+
"body-sm": "typo-body-sm",
|
|
57
|
+
"body-sm-point": "typo-body-sm-point",
|
|
58
|
+
"body-md": "typo-body-md",
|
|
59
|
+
"body-md-point": "typo-body-md-point",
|
|
60
|
+
// Subtitle variants
|
|
61
|
+
"subtitle-sm": "typo-subtitle-sm",
|
|
62
|
+
"subtitle-sm-point": "typo-subtitle-sm-point",
|
|
63
|
+
"subtitle-md": "typo-subtitle-md",
|
|
64
|
+
"subtitle-md-point": "typo-subtitle-md-point",
|
|
65
|
+
// Title variants (always bold)
|
|
66
|
+
"title-sm": "typo-title-sm",
|
|
67
|
+
"title-md": "typo-title-md",
|
|
68
|
+
// Head variants (always bold)
|
|
69
|
+
"head-sm": "typo-head-sm",
|
|
70
|
+
"head-md": "typo-head-md",
|
|
71
|
+
// Fixed size variants
|
|
72
|
+
"fixed-12": "typo-fixed-12",
|
|
73
|
+
"fixed-14": "typo-fixed-14",
|
|
74
|
+
"fixed-15": "typo-fixed-15",
|
|
75
|
+
"fixed-16": "typo-fixed-16",
|
|
76
|
+
"fixed-18": "typo-fixed-18",
|
|
77
|
+
"fixed-20": "typo-fixed-20",
|
|
78
|
+
"fixed-24": "typo-fixed-24"
|
|
79
|
+
};
|
|
80
|
+
function textStyles({
|
|
81
|
+
typography,
|
|
82
|
+
textColor,
|
|
83
|
+
align
|
|
84
|
+
}) {
|
|
85
|
+
const baseStyles4 = "font-sans";
|
|
86
|
+
const colorClass = colorClasses[textColor];
|
|
87
|
+
const typographyClass = typographyStyles[typography];
|
|
88
|
+
const alignClass = align ? alignClasses[align] : "";
|
|
89
|
+
return mergeStyles([baseStyles4, colorClass, typographyClass, alignClass]);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// src/components/Text/Text.tsx
|
|
93
|
+
var Text = ({
|
|
94
|
+
typography = "body-sm",
|
|
95
|
+
textColor = "gray-700",
|
|
96
|
+
align,
|
|
97
|
+
as,
|
|
98
|
+
children,
|
|
99
|
+
className = "",
|
|
100
|
+
...props
|
|
101
|
+
}) => {
|
|
102
|
+
const Component = as || "span";
|
|
103
|
+
const classes = textStyles({ typography, textColor, align });
|
|
104
|
+
return React4__default.default.createElement(
|
|
105
|
+
Component,
|
|
106
|
+
{
|
|
107
|
+
className: mergeStyles(classes, className),
|
|
108
|
+
...props
|
|
46
109
|
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
110
|
+
children
|
|
111
|
+
);
|
|
112
|
+
};
|
|
113
|
+
Text.displayName = "Text";
|
|
114
|
+
var FieldContext = React4.createContext(null);
|
|
115
|
+
var useFieldContext = () => {
|
|
116
|
+
const context = React4.useContext(FieldContext);
|
|
117
|
+
if (!context) {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
return context;
|
|
121
|
+
};
|
|
122
|
+
var FieldRoot = ({
|
|
123
|
+
children,
|
|
124
|
+
disabled = false,
|
|
125
|
+
error = false,
|
|
126
|
+
className,
|
|
127
|
+
...props
|
|
128
|
+
}) => {
|
|
129
|
+
const id = React4.useId();
|
|
130
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FieldContext.Provider, { value: { id, disabled, error }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: mergeStyles("flex flex-col gap-2", className), ...props, children }) });
|
|
131
|
+
};
|
|
132
|
+
var FieldLabel = ({
|
|
133
|
+
children,
|
|
134
|
+
className,
|
|
135
|
+
typography = "body-sm-point",
|
|
136
|
+
textColor = "gray-700",
|
|
137
|
+
...labelProps
|
|
138
|
+
}) => {
|
|
139
|
+
const fieldContext = useFieldContext();
|
|
140
|
+
const id = fieldContext?.id;
|
|
141
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
142
|
+
Text,
|
|
143
|
+
{
|
|
144
|
+
typography,
|
|
145
|
+
textColor,
|
|
146
|
+
htmlFor: id,
|
|
147
|
+
className: mergeStyles("px-1", className),
|
|
148
|
+
...labelProps,
|
|
149
|
+
children
|
|
58
150
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
point: {
|
|
80
|
-
fontSize: "text-16",
|
|
81
|
-
lineHeight: "leading-normal",
|
|
82
|
-
fontWeight: "font-semibold"
|
|
83
|
-
}
|
|
151
|
+
);
|
|
152
|
+
};
|
|
153
|
+
var FieldDescription = ({
|
|
154
|
+
children,
|
|
155
|
+
className,
|
|
156
|
+
...props
|
|
157
|
+
}) => {
|
|
158
|
+
const fieldContext = useFieldContext();
|
|
159
|
+
const id = fieldContext?.id;
|
|
160
|
+
const error = fieldContext?.error;
|
|
161
|
+
if (error) return null;
|
|
162
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
163
|
+
Text,
|
|
164
|
+
{
|
|
165
|
+
typography: "body2-sm",
|
|
166
|
+
textColor: "gray-400",
|
|
167
|
+
id: id ? `${id}-description` : void 0,
|
|
168
|
+
className,
|
|
169
|
+
...props,
|
|
170
|
+
children
|
|
84
171
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
point: {
|
|
106
|
-
fontSize: "text-18",
|
|
107
|
-
lineHeight: "leading-normal",
|
|
108
|
-
fontWeight: "font-bold"
|
|
109
|
-
}
|
|
172
|
+
);
|
|
173
|
+
};
|
|
174
|
+
var FieldErrorDescription = ({
|
|
175
|
+
children,
|
|
176
|
+
className,
|
|
177
|
+
...props
|
|
178
|
+
}) => {
|
|
179
|
+
const fieldContext = useFieldContext();
|
|
180
|
+
const id = fieldContext?.id;
|
|
181
|
+
const error = fieldContext?.error;
|
|
182
|
+
if (!error) return null;
|
|
183
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
184
|
+
Text,
|
|
185
|
+
{
|
|
186
|
+
typography: "body2-sm",
|
|
187
|
+
textColor: "red-400",
|
|
188
|
+
id: id ? `${id}-error` : void 0,
|
|
189
|
+
className,
|
|
190
|
+
...props,
|
|
191
|
+
children
|
|
110
192
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
193
|
+
);
|
|
194
|
+
};
|
|
195
|
+
FieldRoot.displayName = "Field";
|
|
196
|
+
FieldLabel.displayName = "Field.Label";
|
|
197
|
+
FieldDescription.displayName = "Field.Description";
|
|
198
|
+
FieldErrorDescription.displayName = "Field.ErrorDescription";
|
|
199
|
+
var Field = Object.assign(FieldRoot, {
|
|
200
|
+
Label: FieldLabel,
|
|
201
|
+
Description: FieldDescription,
|
|
202
|
+
ErrorDescription: FieldErrorDescription
|
|
203
|
+
});
|
|
204
|
+
var TextInput = ({
|
|
205
|
+
id: idProp,
|
|
206
|
+
disabled: disabledProp,
|
|
207
|
+
error: errorProp,
|
|
208
|
+
className,
|
|
209
|
+
leftIcon,
|
|
210
|
+
rightIcon,
|
|
211
|
+
variant = "default",
|
|
212
|
+
typography = "body2-sm",
|
|
213
|
+
textColor = "gray-700",
|
|
214
|
+
...props
|
|
215
|
+
}) => {
|
|
216
|
+
const field = useFieldContext();
|
|
217
|
+
const id = idProp ?? field?.id;
|
|
218
|
+
const disabled = disabledProp ?? field?.disabled ?? false;
|
|
219
|
+
const error = errorProp ?? field?.error ?? false;
|
|
220
|
+
const classes = textStyles({ typography, textColor });
|
|
221
|
+
const inputStyles = mergeStyles(
|
|
222
|
+
"w-full bg-transparent outline-none",
|
|
223
|
+
"placeholder:text-gray-400",
|
|
224
|
+
"caret-gray-600"
|
|
225
|
+
);
|
|
226
|
+
const variantStyles = {
|
|
227
|
+
default: mergeStyles(
|
|
228
|
+
"rounded-md p-4",
|
|
229
|
+
"bg-white",
|
|
230
|
+
"focus-within:ring-2 focus-within:ring-gray-600"
|
|
231
|
+
),
|
|
232
|
+
underline: mergeStyles(
|
|
233
|
+
"py-2 px-0",
|
|
234
|
+
"border-b border-gray-400",
|
|
235
|
+
"bg-transparent",
|
|
236
|
+
"focus-within:border-gray-600"
|
|
237
|
+
)
|
|
238
|
+
};
|
|
239
|
+
const wrapperStyles = mergeStyles(
|
|
240
|
+
"flex items-center gap-2 self-stretch",
|
|
241
|
+
variantStyles[variant],
|
|
242
|
+
disabled && "cursor-not-allowed opacity-50",
|
|
243
|
+
error && variant === "default" && "ring-2 ring-red-400 focus-within:ring-red-400",
|
|
244
|
+
error && variant === "underline" && "border-red-400 focus-within:border-red-400",
|
|
245
|
+
className
|
|
246
|
+
);
|
|
247
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: wrapperStyles, children: [
|
|
248
|
+
leftIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0 text-gray-400", children: leftIcon }),
|
|
249
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
250
|
+
"input",
|
|
251
|
+
{
|
|
252
|
+
id,
|
|
253
|
+
disabled,
|
|
254
|
+
className: mergeStyles(inputStyles, classes),
|
|
255
|
+
...props
|
|
135
256
|
}
|
|
257
|
+
),
|
|
258
|
+
rightIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0 text-gray-400", children: rightIcon })
|
|
259
|
+
] });
|
|
260
|
+
};
|
|
261
|
+
TextInput.displayName = "TextInput";
|
|
262
|
+
function createPrimitive(node) {
|
|
263
|
+
const Node = (props) => {
|
|
264
|
+
const { asChild, ...primitiveProps } = props;
|
|
265
|
+
const Comp = asChild ? reactSlot.Slot : node;
|
|
266
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Comp, { ...primitiveProps });
|
|
267
|
+
};
|
|
268
|
+
Node.displayName = `Primitive.${node}`;
|
|
269
|
+
return Node;
|
|
270
|
+
}
|
|
271
|
+
var Primitive = {
|
|
272
|
+
div: createPrimitive("div"),
|
|
273
|
+
span: createPrimitive("span"),
|
|
274
|
+
img: createPrimitive("img"),
|
|
275
|
+
button: createPrimitive("button"),
|
|
276
|
+
label: createPrimitive("label"),
|
|
277
|
+
input: createPrimitive("input"),
|
|
278
|
+
textarea: createPrimitive("textarea"),
|
|
279
|
+
a: createPrimitive("a"),
|
|
280
|
+
p: createPrimitive("p"),
|
|
281
|
+
h2: createPrimitive("h2"),
|
|
282
|
+
ul: createPrimitive("ul"),
|
|
283
|
+
li: createPrimitive("li"),
|
|
284
|
+
svg: createPrimitive("svg"),
|
|
285
|
+
circle: createPrimitive("circle")
|
|
286
|
+
};
|
|
287
|
+
var TextAreaRoot = ({ className, children, ...props }) => {
|
|
288
|
+
const field = useFieldContext();
|
|
289
|
+
const wrapperStyles = mergeStyles(
|
|
290
|
+
"rounded-md p-4",
|
|
291
|
+
"bg-white",
|
|
292
|
+
"focus-within:ring-2 focus-within:ring-gray-600",
|
|
293
|
+
field?.disabled && "cursor-not-allowed opacity-50",
|
|
294
|
+
field?.error && "ring-2 ring-red-400 focus-within:ring-red-400",
|
|
295
|
+
className
|
|
296
|
+
);
|
|
297
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { className: wrapperStyles, ...props, children });
|
|
298
|
+
};
|
|
299
|
+
var TextAreaInput = ({
|
|
300
|
+
resize = true,
|
|
301
|
+
disabled: disabledProp,
|
|
302
|
+
className,
|
|
303
|
+
...props
|
|
304
|
+
}) => {
|
|
305
|
+
const field = useFieldContext();
|
|
306
|
+
const disabled = disabledProp ?? field?.disabled ?? false;
|
|
307
|
+
const textareaStyles = mergeStyles(
|
|
308
|
+
"w-full min-w-0 min-h-10 bg-transparent outline-none",
|
|
309
|
+
"typo-body-sm",
|
|
310
|
+
"text-gray-700 placeholder:text-gray-400",
|
|
311
|
+
"caret-gray-600",
|
|
312
|
+
resize ? "resize-y" : "resize-none",
|
|
313
|
+
disabled && "cursor-not-allowed",
|
|
314
|
+
className
|
|
315
|
+
);
|
|
316
|
+
return /* @__PURE__ */ jsxRuntime.jsx("textarea", { className: textareaStyles, disabled, ...props });
|
|
317
|
+
};
|
|
318
|
+
var TextAreaFooter = ({
|
|
319
|
+
className,
|
|
320
|
+
children,
|
|
321
|
+
...props
|
|
322
|
+
}) => {
|
|
323
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { className: mergeStyles("mt-2", className), ...props, children });
|
|
324
|
+
};
|
|
325
|
+
TextAreaRoot.displayName = "TextArea";
|
|
326
|
+
TextAreaInput.displayName = "TextArea.Input";
|
|
327
|
+
TextAreaFooter.displayName = "TextArea.Footer";
|
|
328
|
+
var TextArea = Object.assign(TextAreaRoot, {
|
|
329
|
+
Input: TextAreaInput,
|
|
330
|
+
Footer: TextAreaFooter
|
|
331
|
+
});
|
|
332
|
+
var RadioGroupContext = React4.createContext(null);
|
|
333
|
+
var useRadioGroupContext = () => {
|
|
334
|
+
return React4.useContext(RadioGroupContext);
|
|
335
|
+
};
|
|
336
|
+
var RadioGroup = ({
|
|
337
|
+
name,
|
|
338
|
+
value,
|
|
339
|
+
defaultValue,
|
|
340
|
+
onValueChange,
|
|
341
|
+
className,
|
|
342
|
+
children,
|
|
343
|
+
...props
|
|
344
|
+
}) => {
|
|
345
|
+
const [internalValue, setInternalValue] = React4__default.default.useState(defaultValue);
|
|
346
|
+
const currentValue = value ?? internalValue;
|
|
347
|
+
const handleChange = (newValue) => {
|
|
348
|
+
if (value === void 0) {
|
|
349
|
+
setInternalValue(newValue);
|
|
136
350
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
normal: {
|
|
153
|
-
fontSize: "text-32",
|
|
154
|
-
lineHeight: "leading-normal",
|
|
155
|
-
fontWeight: "font-bold"
|
|
156
|
-
},
|
|
157
|
-
point: {
|
|
158
|
-
fontSize: "text-32",
|
|
159
|
-
lineHeight: "leading-normal",
|
|
160
|
-
fontWeight: "font-bold"
|
|
161
|
-
}
|
|
351
|
+
onValueChange?.(newValue);
|
|
352
|
+
};
|
|
353
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
354
|
+
RadioGroupContext.Provider,
|
|
355
|
+
{
|
|
356
|
+
value: { name, value: currentValue, onChange: handleChange },
|
|
357
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
358
|
+
Primitive.div,
|
|
359
|
+
{
|
|
360
|
+
role: "radiogroup",
|
|
361
|
+
className: mergeStyles("flex flex-col gap-5", className),
|
|
362
|
+
...props,
|
|
363
|
+
children
|
|
364
|
+
}
|
|
365
|
+
)
|
|
162
366
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
point: {
|
|
184
|
-
fontSize: "text-48",
|
|
185
|
-
lineHeight: "leading-normal",
|
|
186
|
-
fontWeight: "font-bold"
|
|
367
|
+
);
|
|
368
|
+
};
|
|
369
|
+
var RadioIcon = ({ checked }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
370
|
+
"svg",
|
|
371
|
+
{
|
|
372
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
373
|
+
width: "20",
|
|
374
|
+
height: "20",
|
|
375
|
+
viewBox: "0 0 20 20",
|
|
376
|
+
fill: "none",
|
|
377
|
+
className: "transition-all duration-150 ease-in-out",
|
|
378
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
379
|
+
"circle",
|
|
380
|
+
{
|
|
381
|
+
cx: "10",
|
|
382
|
+
cy: "10",
|
|
383
|
+
r: checked ? 7 : 7.5,
|
|
384
|
+
stroke: "currentColor",
|
|
385
|
+
strokeWidth: checked ? 6 : 5,
|
|
386
|
+
className: "transition-all duration-150 ease-in-out"
|
|
187
387
|
}
|
|
388
|
+
)
|
|
389
|
+
}
|
|
390
|
+
);
|
|
391
|
+
var Radio = ({
|
|
392
|
+
value,
|
|
393
|
+
children,
|
|
394
|
+
className,
|
|
395
|
+
checked: checkedProp,
|
|
396
|
+
onChange,
|
|
397
|
+
...props
|
|
398
|
+
}) => {
|
|
399
|
+
const group = useRadioGroupContext();
|
|
400
|
+
const isChecked = group ? group.value === value : checkedProp;
|
|
401
|
+
const name = group?.name ?? props.name;
|
|
402
|
+
const handleChange = (e) => {
|
|
403
|
+
group?.onChange?.(value);
|
|
404
|
+
onChange?.(e);
|
|
405
|
+
};
|
|
406
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
407
|
+
"label",
|
|
408
|
+
{
|
|
409
|
+
className: mergeStyles(
|
|
410
|
+
"flex cursor-pointer items-center gap-2",
|
|
411
|
+
"transition-opacity duration-150 hover:opacity-80",
|
|
412
|
+
className
|
|
413
|
+
),
|
|
414
|
+
children: [
|
|
415
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
416
|
+
"input",
|
|
417
|
+
{
|
|
418
|
+
type: "radio",
|
|
419
|
+
name,
|
|
420
|
+
value,
|
|
421
|
+
checked: isChecked,
|
|
422
|
+
onChange: handleChange,
|
|
423
|
+
className: "sr-only",
|
|
424
|
+
...props
|
|
425
|
+
}
|
|
426
|
+
),
|
|
427
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
428
|
+
"span",
|
|
429
|
+
{
|
|
430
|
+
className: mergeStyles(
|
|
431
|
+
"flex-shrink-0 transition-colors duration-150",
|
|
432
|
+
isChecked ? "text-gray-800 hover:text-gray-800" : "text-gray-200 hover:text-gray-400"
|
|
433
|
+
),
|
|
434
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(RadioIcon, { checked: !!isChecked })
|
|
435
|
+
}
|
|
436
|
+
),
|
|
437
|
+
/* @__PURE__ */ jsxRuntime.jsx(Text, { typography: "body-sm", textColor: "gray-800", children })
|
|
438
|
+
]
|
|
188
439
|
}
|
|
440
|
+
);
|
|
441
|
+
};
|
|
442
|
+
RadioGroup.displayName = "RadioGroup";
|
|
443
|
+
Radio.displayName = "Radio";
|
|
444
|
+
var ToggleContext = React4__default.default.createContext(null);
|
|
445
|
+
var useToggleContext = () => {
|
|
446
|
+
const context = React4__default.default.useContext(ToggleContext);
|
|
447
|
+
if (!context) {
|
|
448
|
+
throw new Error(
|
|
449
|
+
"Toggle \uC11C\uBE0C \uCEF4\uD3EC\uB10C\uD2B8\uB294 <Toggle> \uCEF4\uD3EC\uB10C\uD2B8 \uB0B4\uBD80\uC5D0\uC11C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4. ex) <Toggle><Toggle.Switch /></Toggle>"
|
|
450
|
+
);
|
|
189
451
|
}
|
|
452
|
+
return context;
|
|
190
453
|
};
|
|
191
|
-
var
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
454
|
+
var ToggleRoot = ({
|
|
455
|
+
checked: checkedProp,
|
|
456
|
+
defaultChecked = false,
|
|
457
|
+
onCheckedChange,
|
|
458
|
+
disabled,
|
|
459
|
+
children,
|
|
460
|
+
className,
|
|
461
|
+
...props
|
|
462
|
+
}) => {
|
|
463
|
+
const [internalChecked, setInternalChecked] = React4.useState(defaultChecked);
|
|
464
|
+
const isChecked = checkedProp !== void 0 ? checkedProp : internalChecked;
|
|
465
|
+
const handleChange = () => {
|
|
466
|
+
if (disabled) return;
|
|
467
|
+
const newChecked = !isChecked;
|
|
468
|
+
if (checkedProp === void 0) {
|
|
469
|
+
setInternalChecked(newChecked);
|
|
470
|
+
}
|
|
471
|
+
onCheckedChange?.(newChecked);
|
|
472
|
+
};
|
|
473
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ToggleContext.Provider, { value: { checked: isChecked, disabled }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
474
|
+
"label",
|
|
475
|
+
{
|
|
476
|
+
className: mergeStyles(
|
|
477
|
+
"inline-flex cursor-pointer items-center gap-2",
|
|
478
|
+
disabled && "cursor-not-allowed opacity-50",
|
|
479
|
+
className
|
|
480
|
+
),
|
|
481
|
+
...props,
|
|
482
|
+
children: [
|
|
483
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
484
|
+
"input",
|
|
485
|
+
{
|
|
486
|
+
type: "checkbox",
|
|
487
|
+
checked: isChecked,
|
|
488
|
+
onChange: handleChange,
|
|
489
|
+
disabled,
|
|
490
|
+
className: "sr-only"
|
|
491
|
+
}
|
|
492
|
+
),
|
|
493
|
+
children
|
|
494
|
+
]
|
|
495
|
+
}
|
|
496
|
+
) });
|
|
497
|
+
};
|
|
498
|
+
var ToggleSwitch = () => {
|
|
499
|
+
const { checked } = useToggleContext();
|
|
500
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
501
|
+
"span",
|
|
502
|
+
{
|
|
503
|
+
className: mergeStyles(
|
|
504
|
+
"relative inline-flex items-center rounded-full p-1 transition-colors duration-200 ease-in-out",
|
|
505
|
+
"h-7 w-12",
|
|
506
|
+
// 48px x 28px
|
|
507
|
+
checked ? "bg-gray-600" : "bg-gray-200"
|
|
508
|
+
),
|
|
509
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
510
|
+
"span",
|
|
511
|
+
{
|
|
512
|
+
className: mergeStyles(
|
|
513
|
+
"pointer-events-none inline-block rounded-full bg-white shadow-sm transition-transform duration-200 ease-in-out",
|
|
514
|
+
"h-5 w-5",
|
|
515
|
+
// 20px
|
|
516
|
+
checked ? "translate-x-5" : "translate-x-0"
|
|
517
|
+
)
|
|
518
|
+
}
|
|
519
|
+
)
|
|
520
|
+
}
|
|
521
|
+
);
|
|
522
|
+
};
|
|
523
|
+
var ToggleLabel = ({
|
|
524
|
+
children,
|
|
525
|
+
typography = "fixed-16",
|
|
526
|
+
textColor = "gray-700",
|
|
527
|
+
...props
|
|
528
|
+
}) => {
|
|
529
|
+
const { disabled } = useToggleContext();
|
|
530
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
531
|
+
Text,
|
|
532
|
+
{
|
|
533
|
+
typography,
|
|
534
|
+
textColor: disabled ? "gray-400" : textColor,
|
|
535
|
+
...props,
|
|
536
|
+
children
|
|
537
|
+
}
|
|
538
|
+
);
|
|
539
|
+
};
|
|
540
|
+
ToggleRoot.displayName = "Toggle";
|
|
541
|
+
ToggleSwitch.displayName = "Toggle.Switch";
|
|
542
|
+
ToggleLabel.displayName = "Toggle.Label";
|
|
543
|
+
var Toggle = Object.assign(ToggleRoot, {
|
|
544
|
+
Switch: ToggleSwitch,
|
|
545
|
+
Label: ToggleLabel
|
|
546
|
+
});
|
|
547
|
+
var CheckboxContext = React4__default.default.createContext(null);
|
|
548
|
+
var useCheckboxContext = () => {
|
|
549
|
+
const context = React4__default.default.useContext(CheckboxContext);
|
|
550
|
+
if (!context) {
|
|
551
|
+
throw new Error(
|
|
552
|
+
"Checkbox \uC11C\uBE0C \uCEF4\uD3EC\uB10C\uD2B8\uB294 <Checkbox> \uCEF4\uD3EC\uB10C\uD2B8 \uB0B4\uBD80\uC5D0\uC11C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4. ex) <Checkbox><Checkbox.Indicator /></Checkbox>"
|
|
553
|
+
);
|
|
554
|
+
}
|
|
555
|
+
return context;
|
|
556
|
+
};
|
|
557
|
+
var CheckboxRoot = ({
|
|
558
|
+
checked: checkedProp,
|
|
559
|
+
defaultChecked = false,
|
|
560
|
+
onCheckedChange,
|
|
561
|
+
disabled,
|
|
562
|
+
children,
|
|
563
|
+
className,
|
|
564
|
+
...props
|
|
565
|
+
}) => {
|
|
566
|
+
const [internalChecked, setInternalChecked] = React4.useState(defaultChecked);
|
|
567
|
+
const isChecked = checkedProp !== void 0 ? checkedProp : internalChecked;
|
|
568
|
+
const handleChange = () => {
|
|
569
|
+
if (disabled) return;
|
|
570
|
+
const newChecked = !isChecked;
|
|
571
|
+
if (checkedProp === void 0) {
|
|
572
|
+
setInternalChecked(newChecked);
|
|
573
|
+
}
|
|
574
|
+
onCheckedChange?.(newChecked);
|
|
575
|
+
};
|
|
576
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CheckboxContext.Provider, { value: { checked: isChecked, disabled }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
577
|
+
"label",
|
|
578
|
+
{
|
|
579
|
+
className: mergeStyles(
|
|
580
|
+
"inline-flex cursor-pointer items-center gap-2",
|
|
581
|
+
disabled && "cursor-not-allowed opacity-50",
|
|
582
|
+
className
|
|
583
|
+
),
|
|
584
|
+
...props,
|
|
585
|
+
children: [
|
|
586
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
587
|
+
"input",
|
|
588
|
+
{
|
|
589
|
+
type: "checkbox",
|
|
590
|
+
checked: isChecked,
|
|
591
|
+
onChange: handleChange,
|
|
592
|
+
disabled,
|
|
593
|
+
className: "sr-only"
|
|
594
|
+
}
|
|
595
|
+
),
|
|
596
|
+
children
|
|
597
|
+
]
|
|
598
|
+
}
|
|
599
|
+
) });
|
|
600
|
+
};
|
|
601
|
+
var CheckboxIndicator = () => {
|
|
602
|
+
const { checked } = useCheckboxContext();
|
|
603
|
+
if (checked) {
|
|
604
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
605
|
+
"svg",
|
|
606
|
+
{
|
|
607
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
608
|
+
width: "18",
|
|
609
|
+
height: "18",
|
|
610
|
+
viewBox: "0 0 18 18",
|
|
611
|
+
fill: "none",
|
|
612
|
+
className: "flex-shrink-0",
|
|
613
|
+
children: [
|
|
614
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "18", height: "18", rx: "4", fill: "#1E2939" }),
|
|
615
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
616
|
+
"path",
|
|
617
|
+
{
|
|
618
|
+
d: "M5 9.08333L7.94737 12L13 7",
|
|
619
|
+
stroke: "white",
|
|
620
|
+
strokeWidth: "2",
|
|
621
|
+
strokeLinecap: "round",
|
|
622
|
+
strokeLinejoin: "round"
|
|
623
|
+
}
|
|
624
|
+
)
|
|
625
|
+
]
|
|
626
|
+
}
|
|
627
|
+
);
|
|
628
|
+
}
|
|
629
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
630
|
+
"span",
|
|
631
|
+
{
|
|
632
|
+
className: mergeStyles(
|
|
633
|
+
"flex-shrink-0",
|
|
634
|
+
"aspect-square h-[18px] w-[18px]",
|
|
635
|
+
"rounded border-2 border-gray-200 bg-white"
|
|
636
|
+
)
|
|
637
|
+
}
|
|
638
|
+
);
|
|
639
|
+
};
|
|
640
|
+
var CheckboxLabel = ({
|
|
641
|
+
children,
|
|
642
|
+
typography = "body-sm",
|
|
643
|
+
textColor = "gray-600",
|
|
644
|
+
...props
|
|
645
|
+
}) => {
|
|
646
|
+
const { disabled } = useCheckboxContext();
|
|
647
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
648
|
+
Text,
|
|
649
|
+
{
|
|
650
|
+
typography,
|
|
651
|
+
textColor: disabled ? "gray-400" : textColor,
|
|
652
|
+
...props,
|
|
653
|
+
children
|
|
654
|
+
}
|
|
655
|
+
);
|
|
656
|
+
};
|
|
657
|
+
CheckboxRoot.displayName = "Checkbox";
|
|
658
|
+
CheckboxIndicator.displayName = "Checkbox.Indicator";
|
|
659
|
+
CheckboxLabel.displayName = "Checkbox.Label";
|
|
660
|
+
var Checkbox = Object.assign(CheckboxRoot, {
|
|
661
|
+
Indicator: CheckboxIndicator,
|
|
662
|
+
Label: CheckboxLabel
|
|
663
|
+
});
|
|
664
|
+
|
|
665
|
+
// src/components/Button/Button.styles.ts
|
|
666
|
+
var baseStyles = "inline-flex items-center justify-center gap-[0.375rem] whitespace-nowrap rounded-[0.5rem] transition-colors duration-150 disabled:opacity-50 disabled:pointer-events-none";
|
|
667
|
+
var sizeStyles = {
|
|
668
|
+
sm: "min-w-[3rem] h-[1.875rem] px-[0.5rem] typo-body2-sm-point",
|
|
669
|
+
md: "h-[2.375rem] px-[0.75rem] typo-body2-sm-point"
|
|
670
|
+
};
|
|
671
|
+
var colorStyles = {
|
|
672
|
+
// base와 active에 대한 설정이 아직 정해지지 않음
|
|
673
|
+
white: {
|
|
674
|
+
base: "bg-white text-gray-400",
|
|
675
|
+
active: "bg-white text-gray-400"
|
|
216
676
|
},
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
fontWeight: "font-semibold"
|
|
677
|
+
gray: {
|
|
678
|
+
base: "bg-gray-100 text-gray-400",
|
|
679
|
+
active: "bg-gray-100 text-gray-400"
|
|
221
680
|
},
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
fontWeight: "font-bold"
|
|
681
|
+
red: {
|
|
682
|
+
base: "bg-red-100 text-red-400",
|
|
683
|
+
active: "bg-red-100 text-red-400"
|
|
226
684
|
}
|
|
227
685
|
};
|
|
228
|
-
function
|
|
229
|
-
variant,
|
|
686
|
+
function buttonStyles({
|
|
230
687
|
size,
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
688
|
+
color,
|
|
689
|
+
active = false,
|
|
690
|
+
disabled = false,
|
|
691
|
+
fullWidth = false
|
|
234
692
|
}) {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
config = point ? variantConfig.point : variantConfig.normal;
|
|
243
|
-
} else {
|
|
244
|
-
config = fixedStyles[16];
|
|
245
|
-
}
|
|
246
|
-
return `${baseStyles} ${colorClass} ${config.fontSize} ${config.lineHeight} ${config.fontWeight}`.trim();
|
|
693
|
+
return mergeStyles(
|
|
694
|
+
baseStyles,
|
|
695
|
+
disabled ? "cursor-not-allowed pointer-events-none" : "cursor-pointer",
|
|
696
|
+
sizeStyles[size],
|
|
697
|
+
active ? colorStyles[color].active : colorStyles[color].base,
|
|
698
|
+
fullWidth && "w-full"
|
|
699
|
+
);
|
|
247
700
|
}
|
|
248
|
-
function
|
|
249
|
-
|
|
701
|
+
function Button({
|
|
702
|
+
size = "md",
|
|
703
|
+
color = "gray",
|
|
704
|
+
active = false,
|
|
705
|
+
fullWidth = false,
|
|
706
|
+
disabled = false,
|
|
707
|
+
children,
|
|
708
|
+
...props
|
|
709
|
+
}) {
|
|
710
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
711
|
+
"button",
|
|
712
|
+
{
|
|
713
|
+
className: buttonStyles({
|
|
714
|
+
size,
|
|
715
|
+
color,
|
|
716
|
+
active,
|
|
717
|
+
disabled,
|
|
718
|
+
fullWidth
|
|
719
|
+
}),
|
|
720
|
+
disabled,
|
|
721
|
+
...props,
|
|
722
|
+
children
|
|
723
|
+
}
|
|
724
|
+
);
|
|
250
725
|
}
|
|
251
726
|
|
|
252
|
-
// src/components/
|
|
253
|
-
var
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
727
|
+
// src/components/CTAButton/CTAButton.styles.ts
|
|
728
|
+
var baseStyles2 = "inline-flex items-center justify-center h-[3.375rem] px-[0.5rem] rounded-[0.75rem] typo-fixed-15 whitespace-nowrap select-none transition-colors";
|
|
729
|
+
var widthStyles = {
|
|
730
|
+
default: "w-[18rem]",
|
|
731
|
+
full: "w-full"
|
|
732
|
+
};
|
|
733
|
+
var colorStyles2 = {
|
|
734
|
+
blue: "bg-blue-100 text-blue-700",
|
|
735
|
+
red: "bg-red-400 text-white",
|
|
736
|
+
dark: "bg-gray-700 text-white",
|
|
737
|
+
light: "bg-gray-100 text-gray-500",
|
|
738
|
+
white: "bg-white text-gray-500",
|
|
739
|
+
disabled: "bg-gray-200 text-gray-300"
|
|
740
|
+
};
|
|
741
|
+
function ctaButtonStyles({
|
|
742
|
+
color,
|
|
743
|
+
fullWidth = false,
|
|
744
|
+
disabled = false
|
|
745
|
+
}) {
|
|
746
|
+
return mergeStyles(
|
|
747
|
+
baseStyles2,
|
|
748
|
+
fullWidth ? widthStyles.full : widthStyles.default,
|
|
749
|
+
colorStyles2[disabled ? "disabled" : color],
|
|
750
|
+
disabled ? "pointer-events-none" : "cursor-pointer"
|
|
751
|
+
);
|
|
752
|
+
}
|
|
753
|
+
function CTAButton({
|
|
754
|
+
color = "light",
|
|
755
|
+
fullWidth = false,
|
|
756
|
+
disabled = false,
|
|
757
|
+
asChild = false,
|
|
758
|
+
className,
|
|
260
759
|
children,
|
|
760
|
+
...props
|
|
761
|
+
}) {
|
|
762
|
+
const Component = asChild ? reactSlot.Slot : "button";
|
|
763
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
764
|
+
Component,
|
|
765
|
+
{
|
|
766
|
+
type: asChild ? void 0 : "button",
|
|
767
|
+
disabled,
|
|
768
|
+
className: mergeStyles(
|
|
769
|
+
ctaButtonStyles({ color, fullWidth, disabled }),
|
|
770
|
+
className
|
|
771
|
+
),
|
|
772
|
+
...props,
|
|
773
|
+
children
|
|
774
|
+
}
|
|
775
|
+
);
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
// src/components/FloatingActionButton/FloatingActionButton.styles.ts
|
|
779
|
+
var baseStyles3 = "inline-flex items-center justify-center bg-gray-100 border border-gray-200 text-gray-500 typo-body-sm-point h-[2.875rem] rounded-[6.1875rem] select-none whitespace-nowrap transition-colors";
|
|
780
|
+
var paddingStyles = "px-[1rem] py-[0.625rem]";
|
|
781
|
+
var iconGapStyles = {
|
|
782
|
+
left: "gap-[0.25rem]",
|
|
783
|
+
right: "gap-[0.625rem]",
|
|
784
|
+
none: ""
|
|
785
|
+
};
|
|
786
|
+
function floatingActionButtonStyles({
|
|
787
|
+
iconPosition = "none",
|
|
788
|
+
disabled = false
|
|
789
|
+
}) {
|
|
790
|
+
return mergeStyles(
|
|
791
|
+
baseStyles3,
|
|
792
|
+
paddingStyles,
|
|
793
|
+
iconGapStyles[iconPosition],
|
|
794
|
+
disabled ? "opacity-50 pointer-events-none" : "cursor-pointer"
|
|
795
|
+
);
|
|
796
|
+
}
|
|
797
|
+
function FloatingActionButton({
|
|
798
|
+
leftIcon,
|
|
799
|
+
rightIcon,
|
|
800
|
+
disabled = false,
|
|
801
|
+
asChild = false,
|
|
802
|
+
children,
|
|
803
|
+
className,
|
|
804
|
+
...props
|
|
805
|
+
}) {
|
|
806
|
+
const iconPosition = leftIcon ? "left" : rightIcon ? "right" : "none";
|
|
807
|
+
const Component = asChild ? reactSlot.Slot : "button";
|
|
808
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
809
|
+
Component,
|
|
810
|
+
{
|
|
811
|
+
type: asChild ? void 0 : "button",
|
|
812
|
+
disabled,
|
|
813
|
+
className: mergeStyles(
|
|
814
|
+
floatingActionButtonStyles({ iconPosition, disabled }),
|
|
815
|
+
className
|
|
816
|
+
),
|
|
817
|
+
...props,
|
|
818
|
+
children: [
|
|
819
|
+
leftIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center", children: leftIcon }),
|
|
820
|
+
children && /* @__PURE__ */ jsxRuntime.jsx("span", { children }),
|
|
821
|
+
rightIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center", children: rightIcon })
|
|
822
|
+
]
|
|
823
|
+
}
|
|
824
|
+
);
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
// src/components/Box/Box.styles.ts
|
|
828
|
+
var paddingClasses = {
|
|
829
|
+
none: "p-0",
|
|
830
|
+
xs: "p-1",
|
|
831
|
+
// 4px
|
|
832
|
+
sm: "p-2",
|
|
833
|
+
// 8px
|
|
834
|
+
md: "p-4",
|
|
835
|
+
// 16px
|
|
836
|
+
lg: "p-6"
|
|
837
|
+
// 24px
|
|
838
|
+
};
|
|
839
|
+
var radiusClasses = {
|
|
840
|
+
none: "rounded-none",
|
|
841
|
+
xs: "rounded-sm",
|
|
842
|
+
sm: "rounded",
|
|
843
|
+
md: "rounded-md",
|
|
844
|
+
lg: "rounded-lg",
|
|
845
|
+
xl: "rounded-xl",
|
|
846
|
+
"2xl": "rounded-2xl",
|
|
847
|
+
"3xl": "rounded-3xl"
|
|
848
|
+
};
|
|
849
|
+
var displayClasses = {
|
|
850
|
+
block: "block",
|
|
851
|
+
flex: "flex",
|
|
852
|
+
grid: "grid",
|
|
853
|
+
"inline-block": "inline-block",
|
|
854
|
+
"inline-flex": "inline-flex",
|
|
855
|
+
none: "hidden"
|
|
856
|
+
};
|
|
857
|
+
var backgroundClasses = {
|
|
858
|
+
default: "",
|
|
859
|
+
subtle: "bg-gray-50",
|
|
860
|
+
inverse: "bg-gray-900 text-white",
|
|
861
|
+
transparent: "bg-transparent"
|
|
862
|
+
};
|
|
863
|
+
function boxStyles({
|
|
864
|
+
padding = "none",
|
|
865
|
+
radius = "none",
|
|
866
|
+
display = "block",
|
|
867
|
+
background = "default"
|
|
868
|
+
}) {
|
|
869
|
+
return mergeStyles([
|
|
870
|
+
paddingClasses[padding],
|
|
871
|
+
radiusClasses[radius],
|
|
872
|
+
displayClasses[display],
|
|
873
|
+
backgroundClasses[background]
|
|
874
|
+
]);
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
// src/components/Box/Box.tsx
|
|
878
|
+
var Box = ({
|
|
879
|
+
as,
|
|
880
|
+
padding,
|
|
881
|
+
radius,
|
|
882
|
+
display,
|
|
883
|
+
background,
|
|
261
884
|
className = "",
|
|
885
|
+
children,
|
|
262
886
|
...props
|
|
263
887
|
}) => {
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
fixedSize,
|
|
268
|
-
point,
|
|
269
|
-
color
|
|
270
|
-
});
|
|
271
|
-
return React__default.default.createElement(
|
|
888
|
+
const Component = as || "div";
|
|
889
|
+
const classes = boxStyles({ padding, radius, display, background });
|
|
890
|
+
return React4__default.default.createElement(
|
|
272
891
|
Component,
|
|
273
892
|
{
|
|
274
893
|
className: mergeStyles(classes, className),
|
|
@@ -277,7 +896,351 @@ var Text = ({
|
|
|
277
896
|
children
|
|
278
897
|
);
|
|
279
898
|
};
|
|
280
|
-
|
|
899
|
+
Box.displayName = "Box";
|
|
900
|
+
|
|
901
|
+
// src/components/Stack/Stack.styles.ts
|
|
902
|
+
var directionClasses = {
|
|
903
|
+
horizontal: "flex-row",
|
|
904
|
+
vertical: "flex-col"
|
|
905
|
+
};
|
|
906
|
+
var gapClasses = {
|
|
907
|
+
none: "gap-0",
|
|
908
|
+
xs: "gap-1",
|
|
909
|
+
// 4px
|
|
910
|
+
sm: "gap-2",
|
|
911
|
+
// 8px
|
|
912
|
+
md: "gap-4",
|
|
913
|
+
// 16px
|
|
914
|
+
lg: "gap-6",
|
|
915
|
+
// 24px
|
|
916
|
+
xl: "gap-8"
|
|
917
|
+
// 32px
|
|
918
|
+
};
|
|
919
|
+
var alignClasses2 = {
|
|
920
|
+
start: "items-start",
|
|
921
|
+
center: "items-center",
|
|
922
|
+
end: "items-end",
|
|
923
|
+
stretch: "items-stretch"
|
|
924
|
+
};
|
|
925
|
+
var justifyClasses = {
|
|
926
|
+
start: "justify-start",
|
|
927
|
+
center: "justify-center",
|
|
928
|
+
end: "justify-end",
|
|
929
|
+
between: "justify-between"
|
|
930
|
+
};
|
|
931
|
+
function stackStyles({
|
|
932
|
+
direction = "vertical",
|
|
933
|
+
gap = "md",
|
|
934
|
+
align = "stretch",
|
|
935
|
+
justify = "start"
|
|
936
|
+
}) {
|
|
937
|
+
return mergeStyles([
|
|
938
|
+
"flex",
|
|
939
|
+
// Base style
|
|
940
|
+
directionClasses[direction],
|
|
941
|
+
gapClasses[gap],
|
|
942
|
+
alignClasses2[align],
|
|
943
|
+
justifyClasses[justify]
|
|
944
|
+
]);
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
// src/components/Stack/Stack.tsx
|
|
948
|
+
var Stack = ({
|
|
949
|
+
as,
|
|
950
|
+
direction,
|
|
951
|
+
gap,
|
|
952
|
+
align,
|
|
953
|
+
justify,
|
|
954
|
+
className = "",
|
|
955
|
+
children,
|
|
956
|
+
...props
|
|
957
|
+
}) => {
|
|
958
|
+
const Component = as || "div";
|
|
959
|
+
const classes = stackStyles({ direction, gap, align, justify });
|
|
960
|
+
return React4__default.default.createElement(
|
|
961
|
+
Component,
|
|
962
|
+
{
|
|
963
|
+
className: mergeStyles(classes, className),
|
|
964
|
+
...props
|
|
965
|
+
},
|
|
966
|
+
children
|
|
967
|
+
);
|
|
968
|
+
};
|
|
969
|
+
Stack.displayName = "Stack";
|
|
970
|
+
var VStack = ({
|
|
971
|
+
...props
|
|
972
|
+
}) => {
|
|
973
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Stack, { direction: "vertical", ...props });
|
|
974
|
+
};
|
|
975
|
+
VStack.displayName = "VStack";
|
|
976
|
+
var HStack = ({
|
|
977
|
+
...props
|
|
978
|
+
}) => {
|
|
979
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Stack, { direction: "horizontal", ...props });
|
|
980
|
+
};
|
|
981
|
+
HStack.displayName = "HStack";
|
|
982
|
+
|
|
983
|
+
// src/components/Flex/Flex.styles.ts
|
|
984
|
+
var directionClasses2 = {
|
|
985
|
+
row: "flex-row",
|
|
986
|
+
"row-reverse": "flex-row-reverse",
|
|
987
|
+
column: "flex-col",
|
|
988
|
+
"column-reverse": "flex-col-reverse"
|
|
989
|
+
};
|
|
990
|
+
var gapClasses2 = {
|
|
991
|
+
none: "gap-0",
|
|
992
|
+
xs: "gap-1",
|
|
993
|
+
// 4px
|
|
994
|
+
sm: "gap-2",
|
|
995
|
+
// 8px
|
|
996
|
+
md: "gap-4",
|
|
997
|
+
// 16px
|
|
998
|
+
lg: "gap-6",
|
|
999
|
+
// 24px
|
|
1000
|
+
xl: "gap-8"
|
|
1001
|
+
// 32px
|
|
1002
|
+
};
|
|
1003
|
+
var alignClasses3 = {
|
|
1004
|
+
start: "items-start",
|
|
1005
|
+
center: "items-center",
|
|
1006
|
+
end: "items-end",
|
|
1007
|
+
stretch: "items-stretch",
|
|
1008
|
+
baseline: "items-baseline"
|
|
1009
|
+
};
|
|
1010
|
+
var justifyClasses2 = {
|
|
1011
|
+
start: "justify-start",
|
|
1012
|
+
center: "justify-center",
|
|
1013
|
+
end: "justify-end",
|
|
1014
|
+
between: "justify-between",
|
|
1015
|
+
around: "justify-around",
|
|
1016
|
+
evenly: "justify-evenly"
|
|
1017
|
+
};
|
|
1018
|
+
var wrapClasses = {
|
|
1019
|
+
nowrap: "flex-nowrap",
|
|
1020
|
+
wrap: "flex-wrap",
|
|
1021
|
+
"wrap-reverse": "flex-wrap-reverse"
|
|
1022
|
+
};
|
|
1023
|
+
function flexStyles({
|
|
1024
|
+
direction = "row",
|
|
1025
|
+
gap = "md",
|
|
1026
|
+
align = "stretch",
|
|
1027
|
+
justify = "start",
|
|
1028
|
+
wrap = "nowrap"
|
|
1029
|
+
}) {
|
|
1030
|
+
return mergeStyles([
|
|
1031
|
+
"flex",
|
|
1032
|
+
// Base style
|
|
1033
|
+
directionClasses2[direction],
|
|
1034
|
+
gapClasses2[gap],
|
|
1035
|
+
alignClasses3[align],
|
|
1036
|
+
justifyClasses2[justify],
|
|
1037
|
+
wrapClasses[wrap]
|
|
1038
|
+
]);
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
// src/components/Flex/Flex.tsx
|
|
1042
|
+
var Flex = ({
|
|
1043
|
+
as,
|
|
1044
|
+
direction,
|
|
1045
|
+
gap,
|
|
1046
|
+
align,
|
|
1047
|
+
justify,
|
|
1048
|
+
wrap,
|
|
1049
|
+
className = "",
|
|
1050
|
+
children,
|
|
1051
|
+
...props
|
|
1052
|
+
}) => {
|
|
1053
|
+
const Component = as || "div";
|
|
1054
|
+
const classes = flexStyles({ direction, gap, align, justify, wrap });
|
|
1055
|
+
return React4__default.default.createElement(
|
|
1056
|
+
Component,
|
|
1057
|
+
{
|
|
1058
|
+
className: mergeStyles(classes, className),
|
|
1059
|
+
...props
|
|
1060
|
+
},
|
|
1061
|
+
children
|
|
1062
|
+
);
|
|
1063
|
+
};
|
|
1064
|
+
Flex.displayName = "Flex";
|
|
1065
|
+
|
|
1066
|
+
// src/components/Grid/Grid.styles.ts
|
|
1067
|
+
var columnsClasses = {
|
|
1068
|
+
1: "grid-cols-1",
|
|
1069
|
+
2: "grid-cols-2",
|
|
1070
|
+
3: "grid-cols-3",
|
|
1071
|
+
4: "grid-cols-4",
|
|
1072
|
+
5: "grid-cols-5",
|
|
1073
|
+
6: "grid-cols-6",
|
|
1074
|
+
7: "grid-cols-7",
|
|
1075
|
+
8: "grid-cols-8",
|
|
1076
|
+
9: "grid-cols-9",
|
|
1077
|
+
10: "grid-cols-10",
|
|
1078
|
+
11: "grid-cols-11",
|
|
1079
|
+
12: "grid-cols-12",
|
|
1080
|
+
none: "grid-cols-none"
|
|
1081
|
+
};
|
|
1082
|
+
var rowsClasses = {
|
|
1083
|
+
1: "grid-rows-1",
|
|
1084
|
+
2: "grid-rows-2",
|
|
1085
|
+
3: "grid-rows-3",
|
|
1086
|
+
4: "grid-rows-4",
|
|
1087
|
+
5: "grid-rows-5",
|
|
1088
|
+
6: "grid-rows-6",
|
|
1089
|
+
none: "grid-rows-none"
|
|
1090
|
+
};
|
|
1091
|
+
var gapClasses3 = {
|
|
1092
|
+
none: "gap-0",
|
|
1093
|
+
xs: "gap-1",
|
|
1094
|
+
// 4px
|
|
1095
|
+
sm: "gap-2",
|
|
1096
|
+
// 8px
|
|
1097
|
+
md: "gap-4",
|
|
1098
|
+
// 16px
|
|
1099
|
+
lg: "gap-6",
|
|
1100
|
+
// 24px
|
|
1101
|
+
xl: "gap-8"
|
|
1102
|
+
// 32px
|
|
1103
|
+
};
|
|
1104
|
+
var flowClasses = {
|
|
1105
|
+
row: "grid-flow-row",
|
|
1106
|
+
col: "grid-flow-col",
|
|
1107
|
+
"row-dense": "grid-flow-row-dense",
|
|
1108
|
+
"col-dense": "grid-flow-col-dense"
|
|
1109
|
+
};
|
|
1110
|
+
function gridStyles({
|
|
1111
|
+
columns = "none",
|
|
1112
|
+
rows = "none",
|
|
1113
|
+
gap = "md",
|
|
1114
|
+
flow = "row"
|
|
1115
|
+
}) {
|
|
1116
|
+
return mergeStyles([
|
|
1117
|
+
"grid",
|
|
1118
|
+
columnsClasses[columns],
|
|
1119
|
+
rowsClasses[rows],
|
|
1120
|
+
gapClasses3[gap],
|
|
1121
|
+
flowClasses[flow]
|
|
1122
|
+
]);
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
// src/components/Grid/Grid.tsx
|
|
1126
|
+
var Grid = ({
|
|
1127
|
+
as,
|
|
1128
|
+
columns,
|
|
1129
|
+
rows,
|
|
1130
|
+
gap,
|
|
1131
|
+
flow,
|
|
1132
|
+
className = "",
|
|
1133
|
+
children,
|
|
1134
|
+
...props
|
|
1135
|
+
}) => {
|
|
1136
|
+
const Component = as || "div";
|
|
1137
|
+
const classes = gridStyles({ columns, rows, gap, flow });
|
|
1138
|
+
return React4__default.default.createElement(
|
|
1139
|
+
Component,
|
|
1140
|
+
{
|
|
1141
|
+
className: mergeStyles(classes, className),
|
|
1142
|
+
...props
|
|
1143
|
+
},
|
|
1144
|
+
children
|
|
1145
|
+
);
|
|
1146
|
+
};
|
|
1147
|
+
Grid.displayName = "Grid";
|
|
1148
|
+
|
|
1149
|
+
// src/components/Separator/Separator.styles.ts
|
|
1150
|
+
var orientationClasses = {
|
|
1151
|
+
horizontal: "h-px w-full my-2",
|
|
1152
|
+
vertical: "h-full w-px mx-2 self-stretch"
|
|
1153
|
+
};
|
|
1154
|
+
var colorClasses2 = "bg-gray-200";
|
|
1155
|
+
function separatorStyles({
|
|
1156
|
+
orientation = "horizontal"
|
|
1157
|
+
}) {
|
|
1158
|
+
return mergeStyles([colorClasses2, orientationClasses[orientation]]);
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
// src/components/Separator/Separator.tsx
|
|
1162
|
+
var Separator = ({
|
|
1163
|
+
as,
|
|
1164
|
+
orientation = "horizontal",
|
|
1165
|
+
className = "",
|
|
1166
|
+
...props
|
|
1167
|
+
}) => {
|
|
1168
|
+
const Component = as || "div";
|
|
1169
|
+
const classes = separatorStyles({ orientation });
|
|
1170
|
+
return React4__default.default.createElement(Component, {
|
|
1171
|
+
role: "separator",
|
|
1172
|
+
"aria-orientation": orientation,
|
|
1173
|
+
className: mergeStyles(classes, className),
|
|
1174
|
+
...props
|
|
1175
|
+
});
|
|
1176
|
+
};
|
|
1177
|
+
Separator.displayName = "Separator";
|
|
1178
|
+
|
|
1179
|
+
// src/components/Spacer/Spacer.styles.ts
|
|
1180
|
+
var sizeClasses = {
|
|
1181
|
+
1: "w-1 h-1",
|
|
1182
|
+
// 4px
|
|
1183
|
+
2: "w-2 h-2",
|
|
1184
|
+
// 8px
|
|
1185
|
+
4: "w-4 h-4",
|
|
1186
|
+
// 16px
|
|
1187
|
+
6: "w-6 h-6",
|
|
1188
|
+
// 24px
|
|
1189
|
+
8: "w-8 h-8",
|
|
1190
|
+
// 32px
|
|
1191
|
+
10: "w-10 h-10",
|
|
1192
|
+
// 40px
|
|
1193
|
+
12: "w-12 h-12",
|
|
1194
|
+
// 48px
|
|
1195
|
+
16: "w-16 h-16",
|
|
1196
|
+
// 64px
|
|
1197
|
+
20: "w-20 h-20",
|
|
1198
|
+
// 80px
|
|
1199
|
+
24: "w-24 h-24"
|
|
1200
|
+
// 96px
|
|
1201
|
+
};
|
|
1202
|
+
function spacerStyles({ size = "auto" }) {
|
|
1203
|
+
if (size === "auto") {
|
|
1204
|
+
return "flex-1";
|
|
1205
|
+
}
|
|
1206
|
+
return mergeStyles(["flex-none", sizeClasses[size]]);
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
// src/components/Spacer/Spacer.tsx
|
|
1210
|
+
var Spacer = ({
|
|
1211
|
+
as,
|
|
1212
|
+
size,
|
|
1213
|
+
className = "",
|
|
1214
|
+
...props
|
|
1215
|
+
}) => {
|
|
1216
|
+
const Component = as || "div";
|
|
1217
|
+
const classes = spacerStyles({ size });
|
|
1218
|
+
return React4__default.default.createElement(Component, {
|
|
1219
|
+
"aria-hidden": "true",
|
|
1220
|
+
className: mergeStyles(classes, className),
|
|
1221
|
+
...props
|
|
1222
|
+
});
|
|
1223
|
+
};
|
|
1224
|
+
Spacer.displayName = "Spacer";
|
|
281
1225
|
|
|
1226
|
+
exports.Box = Box;
|
|
1227
|
+
exports.Button = Button;
|
|
1228
|
+
exports.CTAButton = CTAButton;
|
|
1229
|
+
exports.Checkbox = Checkbox;
|
|
1230
|
+
exports.Field = Field;
|
|
1231
|
+
exports.Flex = Flex;
|
|
1232
|
+
exports.FloatingActionButton = FloatingActionButton;
|
|
1233
|
+
exports.Grid = Grid;
|
|
1234
|
+
exports.HStack = HStack;
|
|
1235
|
+
exports.Radio = Radio;
|
|
1236
|
+
exports.RadioGroup = RadioGroup;
|
|
1237
|
+
exports.Separator = Separator;
|
|
1238
|
+
exports.Spacer = Spacer;
|
|
1239
|
+
exports.Stack = Stack;
|
|
282
1240
|
exports.Text = Text;
|
|
1241
|
+
exports.TextArea = TextArea;
|
|
1242
|
+
exports.TextInput = TextInput;
|
|
1243
|
+
exports.Toggle = Toggle;
|
|
1244
|
+
exports.VStack = VStack;
|
|
283
1245
|
exports.mergeStyles = mergeStyles;
|
|
1246
|
+
exports.useRadioGroupContext = useRadioGroupContext;
|