bako-ui 0.2.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/README.md +333 -0
- package/dist/index.d.mts +313 -0
- package/dist/index.d.ts +313 -0
- package/dist/index.js +1164 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1017 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +77 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1164 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('@chakra-ui/react');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var react$1 = require('react');
|
|
6
|
+
var reactDom = require('react-dom');
|
|
7
|
+
var reactHookForm = require('react-hook-form');
|
|
8
|
+
var useMaskInput = require('use-mask-input');
|
|
9
|
+
var anatomy = require('@chakra-ui/react/anatomy');
|
|
10
|
+
|
|
11
|
+
// src/components/Stack/stack.tsx
|
|
12
|
+
var Stack = react.Stack;
|
|
13
|
+
var HStack = react.HStack;
|
|
14
|
+
var VStack = react.VStack;
|
|
15
|
+
var flex_default = react.Flex;
|
|
16
|
+
function Grid(props) {
|
|
17
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Grid, { ...props });
|
|
18
|
+
}
|
|
19
|
+
function GridItem(props) {
|
|
20
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.GridItem, { ...props });
|
|
21
|
+
}
|
|
22
|
+
var text_default = react.Text;
|
|
23
|
+
var heading_default = react.Heading;
|
|
24
|
+
var box_default = react.Box;
|
|
25
|
+
var Badge = react.Badge;
|
|
26
|
+
function Button({
|
|
27
|
+
colorPalette = "primary",
|
|
28
|
+
...props
|
|
29
|
+
}) {
|
|
30
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Button, { colorPalette, ...props });
|
|
31
|
+
}
|
|
32
|
+
var Card = react.Card;
|
|
33
|
+
var card_default = Card;
|
|
34
|
+
var Clipboard = react.Clipboard;
|
|
35
|
+
var close_button_default = react$1.forwardRef(
|
|
36
|
+
function CloseButton(props, ref) {
|
|
37
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.CloseButton, { ref, ...props });
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
function Container(props) {
|
|
41
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Container, { ...props });
|
|
42
|
+
}
|
|
43
|
+
var icon_button_default = react$1.forwardRef(
|
|
44
|
+
function IconButton(props, ref) {
|
|
45
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.IconButton, { ref, ...props });
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
var QrCode = react.QrCode;
|
|
49
|
+
var separator_default = react.Separator;
|
|
50
|
+
var image_default = react.Image;
|
|
51
|
+
var Icon = react$1.forwardRef(function Icon2(props, ref) {
|
|
52
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Icon, { ref, ...props });
|
|
53
|
+
});
|
|
54
|
+
var icon_default = Icon;
|
|
55
|
+
var link_default = react$1.forwardRef(
|
|
56
|
+
function Link(props, ref) {
|
|
57
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Link, { ref, ...props });
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
var link_overlay_default = react$1.forwardRef(
|
|
61
|
+
function LinkOverlay(props, ref) {
|
|
62
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.LinkOverlay, { ref, ...props });
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
var loader_default = react.Spinner;
|
|
66
|
+
var Skeleton = react.Skeleton;
|
|
67
|
+
var SkeletonCircle = react.SkeletonCircle;
|
|
68
|
+
var SkeletonText = react.SkeletonText;
|
|
69
|
+
var Checkbox = react$1.forwardRef(
|
|
70
|
+
function Checkbox2(props, ref) {
|
|
71
|
+
const { icon, children, inputProps, rootRef, ...rest } = props;
|
|
72
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Checkbox.Root, { ref: rootRef, ...rest, children: [
|
|
73
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Checkbox.HiddenInput, { ref, ...inputProps }),
|
|
74
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Checkbox.Control, { children: icon || /* @__PURE__ */ jsxRuntime.jsx(react.Checkbox.Indicator, {}) }),
|
|
75
|
+
children != null && /* @__PURE__ */ jsxRuntime.jsx(react.Checkbox.Label, { children })
|
|
76
|
+
] });
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
var checkbox_default = Checkbox;
|
|
80
|
+
var Combobox = {
|
|
81
|
+
...react.Combobox,
|
|
82
|
+
Portal: react.Portal
|
|
83
|
+
};
|
|
84
|
+
var input_default = react$1.forwardRef(
|
|
85
|
+
function Input(props, ref) {
|
|
86
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Input, { ref, ...props });
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
function MoneyField({
|
|
90
|
+
value,
|
|
91
|
+
onChange,
|
|
92
|
+
thousandSeparator = ",",
|
|
93
|
+
decimalSeparator = ".",
|
|
94
|
+
decimalScale = 2,
|
|
95
|
+
...props
|
|
96
|
+
}) {
|
|
97
|
+
const inputRef = react$1.useRef(null);
|
|
98
|
+
const config2 = react$1.useMemo(
|
|
99
|
+
() => ({
|
|
100
|
+
thousandSeparator,
|
|
101
|
+
decimalSeparator,
|
|
102
|
+
decimalScale
|
|
103
|
+
}),
|
|
104
|
+
[thousandSeparator, decimalSeparator, decimalScale]
|
|
105
|
+
);
|
|
106
|
+
const formatNumber = react$1.useCallback(
|
|
107
|
+
(num) => {
|
|
108
|
+
const numStr = String(num).replace(/[^\d.-]/g, "");
|
|
109
|
+
if (!numStr || numStr === "-") return "";
|
|
110
|
+
const [integerPart, decimalPart] = numStr.split(".");
|
|
111
|
+
const formattedInteger = integerPart.replace(
|
|
112
|
+
/\B(?=(\d{3})+(?!\d))/g,
|
|
113
|
+
config2.thousandSeparator
|
|
114
|
+
);
|
|
115
|
+
let result = formattedInteger;
|
|
116
|
+
if (decimalPart !== void 0) {
|
|
117
|
+
const limitedDecimal = decimalPart.slice(0, config2.decimalScale);
|
|
118
|
+
result = `${formattedInteger}${config2.decimalSeparator}${limitedDecimal}`;
|
|
119
|
+
}
|
|
120
|
+
return result;
|
|
121
|
+
},
|
|
122
|
+
[config2]
|
|
123
|
+
);
|
|
124
|
+
const unformatNumber = react$1.useCallback(
|
|
125
|
+
(formatted) => {
|
|
126
|
+
return formatted.replace(new RegExp(`\\${config2.thousandSeparator}`, "g"), "").replace(new RegExp(`\\${config2.decimalSeparator}`, "g"), ".");
|
|
127
|
+
},
|
|
128
|
+
[config2]
|
|
129
|
+
);
|
|
130
|
+
const displayValue = react$1.useMemo(() => {
|
|
131
|
+
if (!value && value !== 0) return "";
|
|
132
|
+
return formatNumber(value);
|
|
133
|
+
}, [value, formatNumber]);
|
|
134
|
+
const handleChange = react$1.useCallback(
|
|
135
|
+
(event) => {
|
|
136
|
+
const inputValue = event.target.value;
|
|
137
|
+
const cursorPosition = event.target.selectionStart || 0;
|
|
138
|
+
const rawValue = unformatNumber(inputValue);
|
|
139
|
+
if (rawValue === "" || rawValue === "-" || !Number.isNaN(Number(rawValue))) {
|
|
140
|
+
onChange(rawValue);
|
|
141
|
+
setTimeout(() => {
|
|
142
|
+
if (inputRef.current) {
|
|
143
|
+
const newFormattedValue = formatNumber(rawValue);
|
|
144
|
+
const diff = newFormattedValue.length - inputValue.length;
|
|
145
|
+
inputRef.current.setSelectionRange(
|
|
146
|
+
cursorPosition + diff,
|
|
147
|
+
cursorPosition + diff
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
}, 0);
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
[formatNumber, unformatNumber, onChange]
|
|
154
|
+
);
|
|
155
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
156
|
+
react.Input,
|
|
157
|
+
{
|
|
158
|
+
ref: inputRef,
|
|
159
|
+
value: displayValue,
|
|
160
|
+
type: "text",
|
|
161
|
+
onChange: handleChange,
|
|
162
|
+
color: "fg.inverted",
|
|
163
|
+
...props
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
var RadioGroup = react$1.forwardRef(
|
|
168
|
+
function RadioGroup2(props, ref) {
|
|
169
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.RadioGroup.Root, { ref, spaceX: 2, ...props });
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
var Radio = react$1.forwardRef(
|
|
173
|
+
function Radio2(props, ref) {
|
|
174
|
+
const { children, inputProps, ...rest } = props;
|
|
175
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.RadioGroup.Item, { ...rest, children: [
|
|
176
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.RadioGroup.ItemHiddenInput, { ref, ...inputProps }),
|
|
177
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.RadioGroup.ItemControl, {}),
|
|
178
|
+
children != null && /* @__PURE__ */ jsxRuntime.jsx(react.RadioGroup.ItemText, { children })
|
|
179
|
+
] });
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
var radio_default = Radio;
|
|
183
|
+
var floatingStyles = ({
|
|
184
|
+
hasValue,
|
|
185
|
+
withStartIcon
|
|
186
|
+
}) => react.defineStyle({
|
|
187
|
+
pos: "absolute",
|
|
188
|
+
px: "1",
|
|
189
|
+
top: hasValue ? "0" : "50%",
|
|
190
|
+
transform: hasValue ? "none" : "translateY(-50%)",
|
|
191
|
+
insetStart: withStartIcon ? "9" : "2.5",
|
|
192
|
+
color: "bg.emphasized",
|
|
193
|
+
fontWeight: "normal",
|
|
194
|
+
pointerEvents: "none",
|
|
195
|
+
transition: "all 0.2s",
|
|
196
|
+
fontSize: hasValue ? "2xs" : "sm",
|
|
197
|
+
_peerPlaceholderShown: {
|
|
198
|
+
insetStart: withStartIcon ? "9" : "2.5"
|
|
199
|
+
},
|
|
200
|
+
_peerFocusVisible: {
|
|
201
|
+
top: "0",
|
|
202
|
+
transform: "none",
|
|
203
|
+
insetStart: withStartIcon ? "9" : "2.5",
|
|
204
|
+
fontSize: "2xs"
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
function ComboboxHiddenInput(props) {
|
|
208
|
+
return /* @__PURE__ */ jsxRuntime.jsx("input", { type: "hidden", ...props });
|
|
209
|
+
}
|
|
210
|
+
function RhfCombobox({
|
|
211
|
+
control,
|
|
212
|
+
name,
|
|
213
|
+
defaultValue,
|
|
214
|
+
label,
|
|
215
|
+
error,
|
|
216
|
+
options,
|
|
217
|
+
disabled = false,
|
|
218
|
+
helperText,
|
|
219
|
+
isLoadingOptions = false,
|
|
220
|
+
noOptionsText = "No items found",
|
|
221
|
+
openOnFocus = true,
|
|
222
|
+
slotProps,
|
|
223
|
+
variant,
|
|
224
|
+
clearTriggerIcon,
|
|
225
|
+
showTrigger = false,
|
|
226
|
+
allowCustomValue = true
|
|
227
|
+
}) {
|
|
228
|
+
const {
|
|
229
|
+
field: { value, onChange, ref, ...rest }
|
|
230
|
+
} = reactHookForm.useController({ defaultValue, control, name });
|
|
231
|
+
const { contains } = react.useFilter({ sensitivity: "base" });
|
|
232
|
+
const { collection, filter } = react.useListCollection({
|
|
233
|
+
initialItems: options,
|
|
234
|
+
filter: contains
|
|
235
|
+
});
|
|
236
|
+
const [inputValue, setInputValue] = react$1.useState(value || "");
|
|
237
|
+
const handleValueChange = react$1.useCallback(
|
|
238
|
+
(details) => {
|
|
239
|
+
const newValue = details.value[0] || "";
|
|
240
|
+
onChange(newValue);
|
|
241
|
+
setInputValue(newValue);
|
|
242
|
+
},
|
|
243
|
+
[onChange]
|
|
244
|
+
);
|
|
245
|
+
const handleInputValueChange = react$1.useCallback(
|
|
246
|
+
(details) => {
|
|
247
|
+
setInputValue(details.inputValue);
|
|
248
|
+
reactDom.flushSync(() => {
|
|
249
|
+
filter(details.inputValue);
|
|
250
|
+
});
|
|
251
|
+
if (allowCustomValue) {
|
|
252
|
+
onChange(details.inputValue);
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
[filter, allowCustomValue, onChange]
|
|
256
|
+
);
|
|
257
|
+
const handleOpenChange = react$1.useCallback(
|
|
258
|
+
(details) => {
|
|
259
|
+
var _a, _b;
|
|
260
|
+
if (allowCustomValue && details.open && inputValue.trim() !== "") {
|
|
261
|
+
const hasMatchingOptions = collection.items.length > 0;
|
|
262
|
+
if (!hasMatchingOptions) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
(_b = (_a = slotProps == null ? void 0 : slotProps.root) == null ? void 0 : _a.onOpenChange) == null ? void 0 : _b.call(_a, details);
|
|
267
|
+
},
|
|
268
|
+
[slotProps == null ? void 0 : slotProps.root, allowCustomValue, inputValue, collection.items.length]
|
|
269
|
+
);
|
|
270
|
+
const hasValue = react$1.useMemo(() => {
|
|
271
|
+
if (!value) {
|
|
272
|
+
return false;
|
|
273
|
+
}
|
|
274
|
+
if (Array.isArray(value)) {
|
|
275
|
+
return value.length > 0;
|
|
276
|
+
}
|
|
277
|
+
const stringValue = typeof value === "string" ? value : String(value);
|
|
278
|
+
return !!stringValue || stringValue.length > 0;
|
|
279
|
+
}, [value]);
|
|
280
|
+
const inputProps = label ? {
|
|
281
|
+
pt: 2,
|
|
282
|
+
px: 3,
|
|
283
|
+
placeholder: ""
|
|
284
|
+
} : {};
|
|
285
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Field.Root, { invalid: !!error, children: [
|
|
286
|
+
label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
287
|
+
react.Field.Label,
|
|
288
|
+
{
|
|
289
|
+
color: "bg.emphasized",
|
|
290
|
+
htmlFor: rest.name,
|
|
291
|
+
...slotProps == null ? void 0 : slotProps.label,
|
|
292
|
+
css: floatingStyles({
|
|
293
|
+
hasValue,
|
|
294
|
+
withStartIcon: false
|
|
295
|
+
}),
|
|
296
|
+
children: label
|
|
297
|
+
}
|
|
298
|
+
),
|
|
299
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
300
|
+
react.Combobox.Root,
|
|
301
|
+
{
|
|
302
|
+
collection,
|
|
303
|
+
width: "full",
|
|
304
|
+
variant,
|
|
305
|
+
inputValue,
|
|
306
|
+
value: value ? [value] : [],
|
|
307
|
+
borderRadius: "lg",
|
|
308
|
+
onValueChange: handleValueChange,
|
|
309
|
+
onOpenChange: handleOpenChange,
|
|
310
|
+
onInputValueChange: handleInputValueChange,
|
|
311
|
+
disabled,
|
|
312
|
+
openOnClick: openOnFocus,
|
|
313
|
+
multiple: false,
|
|
314
|
+
invalid: !!error,
|
|
315
|
+
allowCustomValue,
|
|
316
|
+
selectionBehavior: "preserve",
|
|
317
|
+
...slotProps == null ? void 0 : slotProps.root,
|
|
318
|
+
children: [
|
|
319
|
+
/* @__PURE__ */ jsxRuntime.jsxs(react.Combobox.Control, { children: [
|
|
320
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
321
|
+
react.Combobox.Input,
|
|
322
|
+
{
|
|
323
|
+
color: "fg",
|
|
324
|
+
ref,
|
|
325
|
+
...inputProps,
|
|
326
|
+
...slotProps == null ? void 0 : slotProps.input
|
|
327
|
+
}
|
|
328
|
+
),
|
|
329
|
+
/* @__PURE__ */ jsxRuntime.jsxs(react.Combobox.IndicatorGroup, { children: [
|
|
330
|
+
clearTriggerIcon ? /* @__PURE__ */ jsxRuntime.jsx(react.Combobox.ClearTrigger, { hidden: !hasValue, color: "unset", asChild: true, children: clearTriggerIcon }) : /* @__PURE__ */ jsxRuntime.jsx(react.Combobox.ClearTrigger, { hidden: !hasValue, color: "unset" }),
|
|
331
|
+
showTrigger && /* @__PURE__ */ jsxRuntime.jsx(react.Combobox.Trigger, {})
|
|
332
|
+
] })
|
|
333
|
+
] }),
|
|
334
|
+
/* @__PURE__ */ jsxRuntime.jsx(ComboboxHiddenInput, { name: rest.name, value: value || "" }),
|
|
335
|
+
helperText && /* @__PURE__ */ jsxRuntime.jsx(react.Field.HelperText, { children: helperText }),
|
|
336
|
+
error && /* @__PURE__ */ jsxRuntime.jsx(react.Field.ErrorText, { children: error.message }),
|
|
337
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Combobox.Positioner, { children: /* @__PURE__ */ jsxRuntime.jsxs(react.Combobox.Content, { children: [
|
|
338
|
+
!allowCustomValue && /* @__PURE__ */ jsxRuntime.jsx(react.Combobox.Empty, { children: noOptionsText }),
|
|
339
|
+
isLoadingOptions && /* @__PURE__ */ jsxRuntime.jsxs(react.HStack, { p: "2", children: [
|
|
340
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Spinner, { size: "xs", borderWidth: "1px" }),
|
|
341
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Span, { children: "Loading..." })
|
|
342
|
+
] }),
|
|
343
|
+
!isLoadingOptions && collection.items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(react.Combobox.Item, { item, children: [
|
|
344
|
+
!item.imageUrl && item.label,
|
|
345
|
+
item.imageUrl && /* @__PURE__ */ jsxRuntime.jsxs(react.Flex, { gap: 2, align: "center", children: [
|
|
346
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
347
|
+
react.Image,
|
|
348
|
+
{
|
|
349
|
+
src: item.imageUrl,
|
|
350
|
+
boxSize: "5",
|
|
351
|
+
alt: `${item.label} image`
|
|
352
|
+
}
|
|
353
|
+
),
|
|
354
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Span, { children: item.label })
|
|
355
|
+
] }),
|
|
356
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Combobox.ItemIndicator, {})
|
|
357
|
+
] }, item.value))
|
|
358
|
+
] }) }) })
|
|
359
|
+
]
|
|
360
|
+
}
|
|
361
|
+
)
|
|
362
|
+
] });
|
|
363
|
+
}
|
|
364
|
+
function RhfInput({
|
|
365
|
+
control,
|
|
366
|
+
defaultValue,
|
|
367
|
+
name,
|
|
368
|
+
label,
|
|
369
|
+
error,
|
|
370
|
+
type = "text",
|
|
371
|
+
helperText,
|
|
372
|
+
slotProps,
|
|
373
|
+
...props
|
|
374
|
+
}) {
|
|
375
|
+
var _a;
|
|
376
|
+
const {
|
|
377
|
+
field: { value, onChange, ref, ...rest }
|
|
378
|
+
} = reactHookForm.useController({ control, defaultValue, name });
|
|
379
|
+
const { inputGroup } = slotProps || {};
|
|
380
|
+
const hasValue = react$1.useMemo(
|
|
381
|
+
() => value != null && value !== "" && value.toString().length > 0,
|
|
382
|
+
[value]
|
|
383
|
+
);
|
|
384
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Field.Root, { invalid: !!error, children: [
|
|
385
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.InputGroup, { borderRadius: "sm", ...inputGroup, children: /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { position: "relative", w: "full", ...slotProps == null ? void 0 : slotProps.root, children: [
|
|
386
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
387
|
+
react.Input,
|
|
388
|
+
{
|
|
389
|
+
value,
|
|
390
|
+
ref,
|
|
391
|
+
borderTopLeftRadius: (inputGroup == null ? void 0 : inputGroup.startAddon) ? "none" : "sm",
|
|
392
|
+
borderBottomLeftRadius: (inputGroup == null ? void 0 : inputGroup.startAddon) ? "none" : "sm",
|
|
393
|
+
borderTopRightRadius: (inputGroup == null ? void 0 : inputGroup.endAddon) ? "none" : "sm",
|
|
394
|
+
borderBottomRightRadius: (inputGroup == null ? void 0 : inputGroup.endAddon) ? "none" : "sm",
|
|
395
|
+
type,
|
|
396
|
+
onChange,
|
|
397
|
+
className: `peer ${((_a = slotProps == null ? void 0 : slotProps.input) == null ? void 0 : _a.className) || ""}`,
|
|
398
|
+
pt: 2,
|
|
399
|
+
pl: (inputGroup == null ? void 0 : inputGroup.startElement) ? "10" : "3",
|
|
400
|
+
pr: (inputGroup == null ? void 0 : inputGroup.endElement) ? "10" : "3",
|
|
401
|
+
color: "fg.inverted",
|
|
402
|
+
...rest,
|
|
403
|
+
...slotProps == null ? void 0 : slotProps.input,
|
|
404
|
+
...props,
|
|
405
|
+
placeholder: " "
|
|
406
|
+
}
|
|
407
|
+
),
|
|
408
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
409
|
+
react.Field.Label,
|
|
410
|
+
{
|
|
411
|
+
css: floatingStyles({
|
|
412
|
+
hasValue,
|
|
413
|
+
withStartIcon: !!(inputGroup == null ? void 0 : inputGroup.startElement)
|
|
414
|
+
}),
|
|
415
|
+
htmlFor: name,
|
|
416
|
+
...slotProps == null ? void 0 : slotProps.label,
|
|
417
|
+
children: label
|
|
418
|
+
}
|
|
419
|
+
)
|
|
420
|
+
] }) }),
|
|
421
|
+
(error == null ? void 0 : error.message) && /* @__PURE__ */ jsxRuntime.jsx(react.Field.ErrorText, { children: error == null ? void 0 : error.message }),
|
|
422
|
+
helperText && /* @__PURE__ */ jsxRuntime.jsx(react.Field.HelperText, { color: "bg.emphasized", children: helperText })
|
|
423
|
+
] });
|
|
424
|
+
}
|
|
425
|
+
function RhfMoneyField({
|
|
426
|
+
control,
|
|
427
|
+
defaultValue,
|
|
428
|
+
name,
|
|
429
|
+
label,
|
|
430
|
+
error,
|
|
431
|
+
thousandSeparator,
|
|
432
|
+
decimalSeparator,
|
|
433
|
+
decimalScale,
|
|
434
|
+
helperText,
|
|
435
|
+
slotProps,
|
|
436
|
+
disabled = false,
|
|
437
|
+
...props
|
|
438
|
+
}) {
|
|
439
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
440
|
+
const {
|
|
441
|
+
field: { value, onChange, ...rest }
|
|
442
|
+
} = reactHookForm.useController({ control, defaultValue, name });
|
|
443
|
+
const hasValue = react$1.useMemo(() => {
|
|
444
|
+
return String(value).length > 0;
|
|
445
|
+
}, [value]);
|
|
446
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Field.Root, { invalid: !!error, children: [
|
|
447
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.InputGroup, { borderRadius: "sm", ...slotProps == null ? void 0 : slotProps.inputGroup, children: /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { position: "relative", w: "full", ...slotProps == null ? void 0 : slotProps.root, children: [
|
|
448
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
449
|
+
MoneyField,
|
|
450
|
+
{
|
|
451
|
+
value,
|
|
452
|
+
onChange,
|
|
453
|
+
thousandSeparator,
|
|
454
|
+
decimalSeparator,
|
|
455
|
+
decimalScale,
|
|
456
|
+
disabled,
|
|
457
|
+
className: `peer ${(props == null ? void 0 : props.className) || ""}`,
|
|
458
|
+
pt: 2,
|
|
459
|
+
pl: ((_a = slotProps == null ? void 0 : slotProps.inputGroup) == null ? void 0 : _a.startElement) ? "10" : "3",
|
|
460
|
+
pr: ((_b = slotProps == null ? void 0 : slotProps.inputGroup) == null ? void 0 : _b.endElement) ? "10" : "3",
|
|
461
|
+
color: "fg.inverted",
|
|
462
|
+
borderTopLeftRadius: ((_c = slotProps == null ? void 0 : slotProps.inputGroup) == null ? void 0 : _c.startAddon) ? "none" : "sm",
|
|
463
|
+
borderBottomLeftRadius: ((_d = slotProps == null ? void 0 : slotProps.inputGroup) == null ? void 0 : _d.startAddon) ? "none" : "sm",
|
|
464
|
+
borderTopRightRadius: ((_e = slotProps == null ? void 0 : slotProps.inputGroup) == null ? void 0 : _e.endAddon) ? "none" : "sm",
|
|
465
|
+
borderBottomRightRadius: ((_f = slotProps == null ? void 0 : slotProps.inputGroup) == null ? void 0 : _f.endAddon) ? "none" : "sm",
|
|
466
|
+
placeholder: " ",
|
|
467
|
+
...rest,
|
|
468
|
+
...props
|
|
469
|
+
}
|
|
470
|
+
),
|
|
471
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
472
|
+
react.Field.Label,
|
|
473
|
+
{
|
|
474
|
+
css: floatingStyles({
|
|
475
|
+
hasValue,
|
|
476
|
+
withStartIcon: !!((_g = slotProps == null ? void 0 : slotProps.inputGroup) == null ? void 0 : _g.startElement)
|
|
477
|
+
}),
|
|
478
|
+
htmlFor: rest.name,
|
|
479
|
+
...slotProps == null ? void 0 : slotProps.label,
|
|
480
|
+
children: label
|
|
481
|
+
}
|
|
482
|
+
)
|
|
483
|
+
] }) }),
|
|
484
|
+
(error == null ? void 0 : error.message) && /* @__PURE__ */ jsxRuntime.jsx(react.Field.ErrorText, { children: error.message }),
|
|
485
|
+
helperText && /* @__PURE__ */ jsxRuntime.jsx(react.Field.HelperText, { color: "bg.emphasized", children: helperText })
|
|
486
|
+
] });
|
|
487
|
+
}
|
|
488
|
+
var Select = {
|
|
489
|
+
...react.Select,
|
|
490
|
+
Portal: react.Portal
|
|
491
|
+
};
|
|
492
|
+
var Switch = react$1.forwardRef(
|
|
493
|
+
function Switch2(props, ref) {
|
|
494
|
+
const { children, inputProps, thumbLabel, ...rest } = props;
|
|
495
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Switch.Root, { ...rest, children: [
|
|
496
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Switch.HiddenInput, { ref, ...inputProps }),
|
|
497
|
+
/* @__PURE__ */ jsxRuntime.jsxs(react.Switch.Control, { children: [
|
|
498
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Switch.Thumb, {}),
|
|
499
|
+
thumbLabel && /* @__PURE__ */ jsxRuntime.jsx(react.Switch.Indicator, { fallback: thumbLabel.off, children: thumbLabel.on })
|
|
500
|
+
] }),
|
|
501
|
+
children != null && /* @__PURE__ */ jsxRuntime.jsx(react.Switch.Label, { children })
|
|
502
|
+
] });
|
|
503
|
+
}
|
|
504
|
+
);
|
|
505
|
+
var switch_default = Switch;
|
|
506
|
+
function TextArea(props) {
|
|
507
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Textarea, { ...props });
|
|
508
|
+
}
|
|
509
|
+
var defaultMaskOptions = {
|
|
510
|
+
placeholder: "",
|
|
511
|
+
showMaskOnFocus: false,
|
|
512
|
+
showMaskOnHover: false
|
|
513
|
+
};
|
|
514
|
+
var TextMask = react$1.forwardRef(
|
|
515
|
+
({ mask, maskOptions, ...props }, ref) => {
|
|
516
|
+
const mergedMaskOptions = {
|
|
517
|
+
...defaultMaskOptions,
|
|
518
|
+
...maskOptions
|
|
519
|
+
};
|
|
520
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
521
|
+
react.Input,
|
|
522
|
+
{
|
|
523
|
+
ref: react.mergeRefs(ref, useMaskInput.withMask(mask, mergedMaskOptions)),
|
|
524
|
+
...props
|
|
525
|
+
}
|
|
526
|
+
);
|
|
527
|
+
}
|
|
528
|
+
);
|
|
529
|
+
var text_mask_default = TextMask;
|
|
530
|
+
function Avatar(props) {
|
|
531
|
+
const { name, src, fallback, slotProps, ...rest } = props;
|
|
532
|
+
const { image: imageProps = {}, fallback: fallbackProps = {} } = slotProps || {};
|
|
533
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Avatar.Root, { ...rest, children: [
|
|
534
|
+
src && /* @__PURE__ */ jsxRuntime.jsx(react.Avatar.Image, { src, alt: name, ...imageProps }),
|
|
535
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Avatar.Fallback, { name, ...fallbackProps, children: fallback || (name ? void 0 : /* @__PURE__ */ jsxRuntime.jsx(react.Avatar.Icon, {})) })
|
|
536
|
+
] });
|
|
537
|
+
}
|
|
538
|
+
function AvatarGroup(props) {
|
|
539
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Group, { ...props });
|
|
540
|
+
}
|
|
541
|
+
var EmptyState = react.EmptyState;
|
|
542
|
+
function Tooltip(props) {
|
|
543
|
+
const { children, content, showArrow = true, ...rest } = props;
|
|
544
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Tooltip.Root, { ...rest, children: [
|
|
545
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Tooltip.Trigger, { asChild: true, children }),
|
|
546
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Tooltip.Positioner, { children: /* @__PURE__ */ jsxRuntime.jsxs(react.Tooltip.Content, { children: [
|
|
547
|
+
showArrow && /* @__PURE__ */ jsxRuntime.jsx(react.Tooltip.Arrow, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Tooltip.ArrowTip, {}) }),
|
|
548
|
+
content
|
|
549
|
+
] }) }) })
|
|
550
|
+
] });
|
|
551
|
+
}
|
|
552
|
+
var Dialog = {
|
|
553
|
+
...react.Dialog,
|
|
554
|
+
Portal: react.Portal
|
|
555
|
+
};
|
|
556
|
+
var Drawer = {
|
|
557
|
+
...react.Drawer,
|
|
558
|
+
Portal: react.Portal
|
|
559
|
+
};
|
|
560
|
+
var Popover = {
|
|
561
|
+
...react.Popover,
|
|
562
|
+
Portal: react.Portal
|
|
563
|
+
};
|
|
564
|
+
var toaster = react.createToaster({
|
|
565
|
+
placement: "bottom-end",
|
|
566
|
+
overlap: false
|
|
567
|
+
});
|
|
568
|
+
var Toast = { ...react.Toast, Toaster: react.Toaster };
|
|
569
|
+
var Accordion = {
|
|
570
|
+
...react.Accordion
|
|
571
|
+
};
|
|
572
|
+
var Breadcrumb = {
|
|
573
|
+
...react.Breadcrumb
|
|
574
|
+
};
|
|
575
|
+
var List = react.List;
|
|
576
|
+
var Steps = {
|
|
577
|
+
...react.Steps
|
|
578
|
+
};
|
|
579
|
+
var Tabs = react.Tabs;
|
|
580
|
+
var Menu = {
|
|
581
|
+
...react.Menu,
|
|
582
|
+
Portal: react.Portal
|
|
583
|
+
};
|
|
584
|
+
var CheckIcon = react.createIcon({
|
|
585
|
+
displayName: "CheckIcon",
|
|
586
|
+
viewBox: "0 0 24 24",
|
|
587
|
+
path: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
588
|
+
"svg",
|
|
589
|
+
{
|
|
590
|
+
fill: "currentColor",
|
|
591
|
+
width: "24px",
|
|
592
|
+
height: "24px",
|
|
593
|
+
viewBox: "0 0 0.72 0.72",
|
|
594
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
595
|
+
"enable-background": "new 0 0 24 24",
|
|
596
|
+
children: [
|
|
597
|
+
/* @__PURE__ */ jsxRuntime.jsx("title", { children: "check" }),
|
|
598
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0.561 0.216c-0.012 -0.012 -0.03 -0.012 -0.042 0l-0.225 0.225 -0.093 -0.093c-0.012 -0.012 -0.03 -0.012 -0.042 0s-0.012 0.03 0 0.042l0.114 0.114c0.006 0.006 0.012 0.009 0.021 0.009s0.015 -0.003 0.021 -0.009l0.246 -0.246c0.012 -0.012 0.012 -0.03 0 -0.042" })
|
|
599
|
+
]
|
|
600
|
+
}
|
|
601
|
+
)
|
|
602
|
+
});
|
|
603
|
+
var CloseIcon = react.createIcon({
|
|
604
|
+
displayName: "CloseIcon",
|
|
605
|
+
viewBox: "0 0 24 24",
|
|
606
|
+
path: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
607
|
+
"svg",
|
|
608
|
+
{
|
|
609
|
+
width: "24px",
|
|
610
|
+
height: "24px",
|
|
611
|
+
viewBox: "0 0 0.48 0.48",
|
|
612
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
613
|
+
fill: "currentColor",
|
|
614
|
+
children: [
|
|
615
|
+
/* @__PURE__ */ jsxRuntime.jsx("title", { children: "close" }),
|
|
616
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
617
|
+
"path",
|
|
618
|
+
{
|
|
619
|
+
"fill-rule": "evenodd",
|
|
620
|
+
"clip-rule": "evenodd",
|
|
621
|
+
d: "m0.24 0.261 0.109 0.109 0.021 -0.021L0.261 0.24l0.109 -0.109 -0.021 -0.021L0.24 0.219 0.131 0.109l-0.021 0.021L0.219 0.24l-0.109 0.109 0.021 0.021z"
|
|
622
|
+
}
|
|
623
|
+
)
|
|
624
|
+
]
|
|
625
|
+
}
|
|
626
|
+
)
|
|
627
|
+
});
|
|
628
|
+
var WalletIcon = react.createIcon({
|
|
629
|
+
displayName: "WalletIcon",
|
|
630
|
+
viewBox: "0 0 21 18",
|
|
631
|
+
path: /* @__PURE__ */ jsxRuntime.jsx(
|
|
632
|
+
"path",
|
|
633
|
+
{
|
|
634
|
+
d: "M20 4H21V14H20V17C20 17.2652 19.8946 17.5196 19.7071 17.7071C19.5196 17.8946 19.2652 18 19 18H1C0.734784 18 0.48043 17.8946 0.292893 17.7071C0.105357 17.5196 0 17.2652 0 17V1C0 0.734784 0.105357 0.48043 0.292893 0.292893C0.48043 0.105357 0.734784 0 1 0H19C19.2652 0 19.5196 0.105357 19.7071 0.292893C19.8946 0.48043 20 0.734784 20 1V4ZM18 14H12C10.6739 14 9.40215 13.4732 8.46447 12.5355C7.52678 11.5979 7 10.3261 7 9C7 7.67392 7.52678 6.40215 8.46447 5.46447C9.40215 4.52678 10.6739 4 12 4H18V2H2V16H18V14ZM19 12V6H12C11.2044 6 10.4413 6.31607 9.87868 6.87868C9.31607 7.44129 9 8.20435 9 9C9 9.79565 9.31607 10.5587 9.87868 11.1213C10.4413 11.6839 11.2044 12 12 12H19ZM12 8H15V10H12V8Z",
|
|
635
|
+
fill: "currentColor"
|
|
636
|
+
}
|
|
637
|
+
)
|
|
638
|
+
});
|
|
639
|
+
var ThemeProvider = (props) => {
|
|
640
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.ChakraProvider, { ...props });
|
|
641
|
+
};
|
|
642
|
+
var badgeRecipe = react.defineRecipe({
|
|
643
|
+
base: {
|
|
644
|
+
borderRadius: "xl"
|
|
645
|
+
},
|
|
646
|
+
variants: {
|
|
647
|
+
variant: {
|
|
648
|
+
outline: {
|
|
649
|
+
border: "1px solid",
|
|
650
|
+
borderColor: "colorPalette.subtle/25",
|
|
651
|
+
bg: "colorPalette.subtle/10",
|
|
652
|
+
color: "colorPalette.solid"
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
});
|
|
657
|
+
var buttonRecipe = react.defineRecipe({
|
|
658
|
+
base: {
|
|
659
|
+
borderRadius: "lg"
|
|
660
|
+
},
|
|
661
|
+
variants: {
|
|
662
|
+
variant: {}
|
|
663
|
+
},
|
|
664
|
+
defaultVariants: { colorPalette: "primary" }
|
|
665
|
+
});
|
|
666
|
+
var cardRecipe = react.defineRecipe({
|
|
667
|
+
variants: {
|
|
668
|
+
variant: {
|
|
669
|
+
subtle: {}
|
|
670
|
+
}
|
|
671
|
+
},
|
|
672
|
+
defaultVariants: {
|
|
673
|
+
variant: "subtle"
|
|
674
|
+
}
|
|
675
|
+
});
|
|
676
|
+
var iconRecipe = react.defineRecipe({
|
|
677
|
+
variants: {
|
|
678
|
+
size: {
|
|
679
|
+
inherit: {},
|
|
680
|
+
xs: { boxSize: "3" },
|
|
681
|
+
sm: { boxSize: "4" },
|
|
682
|
+
md: { boxSize: "5" },
|
|
683
|
+
lg: { boxSize: "6" },
|
|
684
|
+
xl: { boxSize: "7" },
|
|
685
|
+
"2xl": { boxSize: "8" }
|
|
686
|
+
}
|
|
687
|
+
},
|
|
688
|
+
defaultVariants: {
|
|
689
|
+
size: "md"
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
var inputRecipe = react.defineRecipe({
|
|
693
|
+
variants: {
|
|
694
|
+
variant: {
|
|
695
|
+
outline: {
|
|
696
|
+
bg: "transparent",
|
|
697
|
+
borderWidth: "1px",
|
|
698
|
+
borderColor: "gray.450",
|
|
699
|
+
focusVisibleRing: "inside",
|
|
700
|
+
outlineWidth: "3px",
|
|
701
|
+
focusRingColor: "var(--focus-color)",
|
|
702
|
+
_focusVisible: {
|
|
703
|
+
borderColor: "border"
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
});
|
|
709
|
+
var linkRecipe = react.defineRecipe({
|
|
710
|
+
variants: {
|
|
711
|
+
variant: {
|
|
712
|
+
underline: {
|
|
713
|
+
color: "textPrimary"
|
|
714
|
+
},
|
|
715
|
+
plain: {
|
|
716
|
+
color: "textPrimary"
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
});
|
|
721
|
+
|
|
722
|
+
// src/theme/recipes/index.ts
|
|
723
|
+
var recipes = {
|
|
724
|
+
button: buttonRecipe,
|
|
725
|
+
card: cardRecipe,
|
|
726
|
+
input: inputRecipe,
|
|
727
|
+
badge: badgeRecipe,
|
|
728
|
+
icon: iconRecipe,
|
|
729
|
+
link: linkRecipe
|
|
730
|
+
};
|
|
731
|
+
var semanticColors = react.defineSemanticTokens.colors({
|
|
732
|
+
bg: {
|
|
733
|
+
DEFAULT: {
|
|
734
|
+
value: {
|
|
735
|
+
_light: "{colors.background}",
|
|
736
|
+
_dark: "{colors.background}"
|
|
737
|
+
}
|
|
738
|
+
},
|
|
739
|
+
panel: {
|
|
740
|
+
value: { _light: "{colors.gray.600}", _dark: "{colors.gray.600}" }
|
|
741
|
+
},
|
|
742
|
+
muted: {
|
|
743
|
+
value: { _light: "{colors.gray.500}", _dark: "{colors.gray.500}" }
|
|
744
|
+
}
|
|
745
|
+
},
|
|
746
|
+
fg: {
|
|
747
|
+
DEFAULT: {
|
|
748
|
+
value: { _light: "{colors.gray.50}", _dark: "{colors.gray.50}" }
|
|
749
|
+
},
|
|
750
|
+
muted: {
|
|
751
|
+
value: { _light: "{colors.gray.200}", _dark: "{colors.gray.200}" }
|
|
752
|
+
}
|
|
753
|
+
},
|
|
754
|
+
red: {
|
|
755
|
+
solid: {
|
|
756
|
+
value: {
|
|
757
|
+
_light: "{colors.red.100}",
|
|
758
|
+
_dark: "{colors.red.100}"
|
|
759
|
+
}
|
|
760
|
+
},
|
|
761
|
+
contrast: {
|
|
762
|
+
value: { _light: "white", _dark: "white" }
|
|
763
|
+
},
|
|
764
|
+
fg: {
|
|
765
|
+
value: { _light: "{colors.red.700}", _dark: "{colors.red.300}" }
|
|
766
|
+
},
|
|
767
|
+
subtle: {
|
|
768
|
+
value: { _light: "{colors.red.100}", _dark: "{colors.red.900}" }
|
|
769
|
+
},
|
|
770
|
+
muted: {
|
|
771
|
+
value: { _light: "{colors.red.200}", _dark: "{colors.red.800}" }
|
|
772
|
+
},
|
|
773
|
+
emphasized: {
|
|
774
|
+
value: { _light: "{colors.red.300}", _dark: "{colors.red.700}" }
|
|
775
|
+
},
|
|
776
|
+
focusRing: {
|
|
777
|
+
value: { _light: "{colors.red.500}", _dark: "{colors.red.500}" }
|
|
778
|
+
}
|
|
779
|
+
},
|
|
780
|
+
primary: {
|
|
781
|
+
DEFAULT: {
|
|
782
|
+
value: { _light: "{colors.primary}", _dark: "{colors.primary}" }
|
|
783
|
+
},
|
|
784
|
+
solid: {
|
|
785
|
+
value: {
|
|
786
|
+
_light: "{colors.primary.default}",
|
|
787
|
+
_dark: "{colors.primary.default}"
|
|
788
|
+
}
|
|
789
|
+
},
|
|
790
|
+
muted: {
|
|
791
|
+
value: {
|
|
792
|
+
_light: "{colors.gray.300/40}",
|
|
793
|
+
_dark: "{colors.gray.300/40}"
|
|
794
|
+
}
|
|
795
|
+
},
|
|
796
|
+
contrast: {
|
|
797
|
+
value: { _light: "black", _dark: "black" }
|
|
798
|
+
},
|
|
799
|
+
fg: {
|
|
800
|
+
value: { _light: "{colors.gray.100}", _dark: "{colors.gray.100}" }
|
|
801
|
+
},
|
|
802
|
+
subtle: {
|
|
803
|
+
value: {
|
|
804
|
+
_light: "{colors.gray.300/20}",
|
|
805
|
+
_dark: "{colors.gray.300/20}"
|
|
806
|
+
}
|
|
807
|
+
},
|
|
808
|
+
emphasized: {
|
|
809
|
+
value: { _light: "{colors.gray.400}", _dark: "{colors.gray.400}" }
|
|
810
|
+
},
|
|
811
|
+
border: {
|
|
812
|
+
value: {
|
|
813
|
+
_light: "{colors.gray.600}",
|
|
814
|
+
_dark: "{colors.gray.600}"
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
},
|
|
818
|
+
green: {
|
|
819
|
+
contrast: {
|
|
820
|
+
value: { _light: "white", _dark: "white" }
|
|
821
|
+
},
|
|
822
|
+
fg: {
|
|
823
|
+
value: { _light: "{colors.green.300}", _dark: "{colors.green.300}" }
|
|
824
|
+
},
|
|
825
|
+
subtle: {
|
|
826
|
+
value: { _light: "{colors.green.100}", _dark: "{colors.green.100}" }
|
|
827
|
+
},
|
|
828
|
+
muted: {
|
|
829
|
+
value: { _light: "{colors.green.100}", _dark: "{colors.green.100}" }
|
|
830
|
+
},
|
|
831
|
+
emphasized: {
|
|
832
|
+
value: { _light: "{colors.green.300}", _dark: "{colors.green.300}" }
|
|
833
|
+
},
|
|
834
|
+
solid: {
|
|
835
|
+
value: { _light: "{colors.green.300}", _dark: "{colors.green.300}" }
|
|
836
|
+
},
|
|
837
|
+
focusRing: {
|
|
838
|
+
value: { _light: "{colors.green.300}", _dark: "{colors.green.300}" }
|
|
839
|
+
}
|
|
840
|
+
},
|
|
841
|
+
yellow: {
|
|
842
|
+
contrast: {
|
|
843
|
+
value: { _light: "black", _dark: "black" }
|
|
844
|
+
},
|
|
845
|
+
fg: {
|
|
846
|
+
value: { _light: "{colors.yellow.800}", _dark: "{colors.yellow.300}" }
|
|
847
|
+
},
|
|
848
|
+
subtle: {
|
|
849
|
+
value: { _light: "{colors.yellow.150}", _dark: "{colors.yellow.150}" }
|
|
850
|
+
},
|
|
851
|
+
muted: {
|
|
852
|
+
value: { _light: "{colors.yellow.200}", _dark: "{colors.yellow.800}" }
|
|
853
|
+
},
|
|
854
|
+
emphasized: {
|
|
855
|
+
value: { _light: "{colors.yellow.300}", _dark: "{colors.yellow.700}" }
|
|
856
|
+
},
|
|
857
|
+
solid: {
|
|
858
|
+
value: { _light: "{colors.yellow.100}", _dark: "{colors.yellow.100}" }
|
|
859
|
+
},
|
|
860
|
+
focusRing: {
|
|
861
|
+
value: { _light: "{colors.yellow.500}", _dark: "{colors.yellow.500}" }
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
});
|
|
865
|
+
|
|
866
|
+
// src/theme/semantic-tokens/index.ts
|
|
867
|
+
var semanticTokens = {
|
|
868
|
+
colors: semanticColors
|
|
869
|
+
};
|
|
870
|
+
var menuSlotRecipe = react.defineSlotRecipe({
|
|
871
|
+
slots: anatomy.menuAnatomy.keys(),
|
|
872
|
+
base: {
|
|
873
|
+
content: {
|
|
874
|
+
color: "primary.fg"
|
|
875
|
+
},
|
|
876
|
+
item: {
|
|
877
|
+
color: "primary.fg"
|
|
878
|
+
}
|
|
879
|
+
},
|
|
880
|
+
variants: {
|
|
881
|
+
variant: {
|
|
882
|
+
subtle: {
|
|
883
|
+
item: {
|
|
884
|
+
_highlighted: {
|
|
885
|
+
bg: "primary.emphasized"
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
});
|
|
892
|
+
var tabsSlotRecipe = react.defineSlotRecipe({
|
|
893
|
+
slots: anatomy.tabsAnatomy.keys(),
|
|
894
|
+
variants: {
|
|
895
|
+
variant: {
|
|
896
|
+
enclosed: {
|
|
897
|
+
trigger: {
|
|
898
|
+
_selected: {
|
|
899
|
+
color: "fg"
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
},
|
|
903
|
+
outline: {
|
|
904
|
+
trigger: {
|
|
905
|
+
_selected: {
|
|
906
|
+
color: "fg"
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
},
|
|
910
|
+
plain: {
|
|
911
|
+
trigger: {
|
|
912
|
+
_selected: {
|
|
913
|
+
color: "fg"
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
});
|
|
920
|
+
|
|
921
|
+
// src/theme/slot-recipes/index.ts
|
|
922
|
+
var slotRecipes = {
|
|
923
|
+
menu: menuSlotRecipe,
|
|
924
|
+
tabs: tabsSlotRecipe
|
|
925
|
+
};
|
|
926
|
+
var colorsTokens = react.defineTokens.colors({
|
|
927
|
+
primary: {
|
|
928
|
+
contrast: { value: "{colors.gray.500}" },
|
|
929
|
+
default: { value: "{colors.yellow.100}" }
|
|
930
|
+
},
|
|
931
|
+
secondary: {
|
|
932
|
+
default: { value: "{colors.gray.500}" },
|
|
933
|
+
contrast: { value: "{colors.gray.300}" }
|
|
934
|
+
},
|
|
935
|
+
textPrimary: { value: "{colors.gray.50}" },
|
|
936
|
+
textSecondary: { value: "{colors.gray.300}" },
|
|
937
|
+
background: { value: "#0D0D0C" },
|
|
938
|
+
// ------------------------------------------
|
|
939
|
+
gray: {
|
|
940
|
+
"50": { value: "#F5F5F5" },
|
|
941
|
+
"100": { value: "#CFCCC9" },
|
|
942
|
+
"200": { value: "#AAA6A1" },
|
|
943
|
+
"300": { value: "#868079" },
|
|
944
|
+
"400": { value: "#5E5955" },
|
|
945
|
+
"500": { value: "#201F1D" },
|
|
946
|
+
"600": { value: "#151413" }
|
|
947
|
+
},
|
|
948
|
+
yellow: {
|
|
949
|
+
"50": { value: "#EED07C" },
|
|
950
|
+
"100": { value: "#FFC010" },
|
|
951
|
+
"150": { value: "#E3AF13" },
|
|
952
|
+
"200": { value: "#B68F40" },
|
|
953
|
+
"300": { value: "#F16517" },
|
|
954
|
+
"400": { value: "#B24F18" },
|
|
955
|
+
"500": { value: "#54372D" }
|
|
956
|
+
},
|
|
957
|
+
red: {
|
|
958
|
+
50: { value: "#EF9B8F" },
|
|
959
|
+
100: { value: "#F05D48" },
|
|
960
|
+
200: { value: "#F2290D" }
|
|
961
|
+
},
|
|
962
|
+
green: {
|
|
963
|
+
50: { value: "#8CEEB3" },
|
|
964
|
+
100: { value: "#00F48B" },
|
|
965
|
+
200: { value: "#00E55C" },
|
|
966
|
+
300: { value: "#00943B" }
|
|
967
|
+
},
|
|
968
|
+
blue: {
|
|
969
|
+
50: { value: "#90CDFA" },
|
|
970
|
+
100: { value: "#008EF4" },
|
|
971
|
+
200: { value: "#005DA0" }
|
|
972
|
+
}
|
|
973
|
+
});
|
|
974
|
+
var fontsTokens = react.defineTokens.fonts({
|
|
975
|
+
heading: { value: "Inter, sans-serif" },
|
|
976
|
+
body: { value: "Inter, sans-serif" }
|
|
977
|
+
});
|
|
978
|
+
|
|
979
|
+
// src/theme/tokens/index.ts
|
|
980
|
+
var tokens = {
|
|
981
|
+
colors: colorsTokens,
|
|
982
|
+
fonts: fontsTokens
|
|
983
|
+
};
|
|
984
|
+
|
|
985
|
+
// src/theme/index.ts
|
|
986
|
+
var config = react.defineConfig({
|
|
987
|
+
theme: {
|
|
988
|
+
tokens,
|
|
989
|
+
semanticTokens,
|
|
990
|
+
breakpoints: {
|
|
991
|
+
xs: "25em",
|
|
992
|
+
// 400px
|
|
993
|
+
sm: "48em",
|
|
994
|
+
// 768px
|
|
995
|
+
md: "64em",
|
|
996
|
+
// 1024px
|
|
997
|
+
lg: "80em",
|
|
998
|
+
// 1280px
|
|
999
|
+
xl: "90em"
|
|
1000
|
+
// 1440px
|
|
1001
|
+
},
|
|
1002
|
+
recipes,
|
|
1003
|
+
slotRecipes
|
|
1004
|
+
},
|
|
1005
|
+
globalCss: {
|
|
1006
|
+
body: {
|
|
1007
|
+
color: "textPrimary",
|
|
1008
|
+
bg: "background",
|
|
1009
|
+
minH: "100vh"
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
});
|
|
1013
|
+
var theme = react.createSystem(react.defaultConfig, config);
|
|
1014
|
+
var theme_default = theme;
|
|
1015
|
+
|
|
1016
|
+
Object.defineProperty(exports, "Alert", {
|
|
1017
|
+
enumerable: true,
|
|
1018
|
+
get: function () { return react.Alert; }
|
|
1019
|
+
});
|
|
1020
|
+
Object.defineProperty(exports, "ButtonGroup", {
|
|
1021
|
+
enumerable: true,
|
|
1022
|
+
get: function () { return react.ButtonGroup; }
|
|
1023
|
+
});
|
|
1024
|
+
Object.defineProperty(exports, "Center", {
|
|
1025
|
+
enumerable: true,
|
|
1026
|
+
get: function () { return react.Center; }
|
|
1027
|
+
});
|
|
1028
|
+
Object.defineProperty(exports, "ChakraIcon", {
|
|
1029
|
+
enumerable: true,
|
|
1030
|
+
get: function () { return react.Icon; }
|
|
1031
|
+
});
|
|
1032
|
+
Object.defineProperty(exports, "ClientOnly", {
|
|
1033
|
+
enumerable: true,
|
|
1034
|
+
get: function () { return react.ClientOnly; }
|
|
1035
|
+
});
|
|
1036
|
+
Object.defineProperty(exports, "Field", {
|
|
1037
|
+
enumerable: true,
|
|
1038
|
+
get: function () { return react.Field; }
|
|
1039
|
+
});
|
|
1040
|
+
Object.defineProperty(exports, "FormatNumber", {
|
|
1041
|
+
enumerable: true,
|
|
1042
|
+
get: function () { return react.FormatNumber; }
|
|
1043
|
+
});
|
|
1044
|
+
Object.defineProperty(exports, "InputGroup", {
|
|
1045
|
+
enumerable: true,
|
|
1046
|
+
get: function () { return react.InputGroup; }
|
|
1047
|
+
});
|
|
1048
|
+
Object.defineProperty(exports, "Portal", {
|
|
1049
|
+
enumerable: true,
|
|
1050
|
+
get: function () { return react.Portal; }
|
|
1051
|
+
});
|
|
1052
|
+
Object.defineProperty(exports, "Spacer", {
|
|
1053
|
+
enumerable: true,
|
|
1054
|
+
get: function () { return react.Spacer; }
|
|
1055
|
+
});
|
|
1056
|
+
Object.defineProperty(exports, "Span", {
|
|
1057
|
+
enumerable: true,
|
|
1058
|
+
get: function () { return react.Span; }
|
|
1059
|
+
});
|
|
1060
|
+
Object.defineProperty(exports, "createIcon", {
|
|
1061
|
+
enumerable: true,
|
|
1062
|
+
get: function () { return react.createIcon; }
|
|
1063
|
+
});
|
|
1064
|
+
Object.defineProperty(exports, "createListCollection", {
|
|
1065
|
+
enumerable: true,
|
|
1066
|
+
get: function () { return react.createListCollection; }
|
|
1067
|
+
});
|
|
1068
|
+
Object.defineProperty(exports, "createToaster", {
|
|
1069
|
+
enumerable: true,
|
|
1070
|
+
get: function () { return react.createToaster; }
|
|
1071
|
+
});
|
|
1072
|
+
Object.defineProperty(exports, "useAccordion", {
|
|
1073
|
+
enumerable: true,
|
|
1074
|
+
get: function () { return react.useAccordion; }
|
|
1075
|
+
});
|
|
1076
|
+
Object.defineProperty(exports, "useAccordionContext", {
|
|
1077
|
+
enumerable: true,
|
|
1078
|
+
get: function () { return react.useAccordionContext; }
|
|
1079
|
+
});
|
|
1080
|
+
Object.defineProperty(exports, "useAccordionItemContext", {
|
|
1081
|
+
enumerable: true,
|
|
1082
|
+
get: function () { return react.useAccordionItemContext; }
|
|
1083
|
+
});
|
|
1084
|
+
Object.defineProperty(exports, "useClipboard", {
|
|
1085
|
+
enumerable: true,
|
|
1086
|
+
get: function () { return react.useClipboard; }
|
|
1087
|
+
});
|
|
1088
|
+
Object.defineProperty(exports, "useMediaQuery", {
|
|
1089
|
+
enumerable: true,
|
|
1090
|
+
get: function () { return react.useMediaQuery; }
|
|
1091
|
+
});
|
|
1092
|
+
Object.defineProperty(exports, "useSteps", {
|
|
1093
|
+
enumerable: true,
|
|
1094
|
+
get: function () { return react.useSteps; }
|
|
1095
|
+
});
|
|
1096
|
+
Object.defineProperty(exports, "useStepsContext", {
|
|
1097
|
+
enumerable: true,
|
|
1098
|
+
get: function () { return react.useStepsContext; }
|
|
1099
|
+
});
|
|
1100
|
+
Object.defineProperty(exports, "useStepsItemContext", {
|
|
1101
|
+
enumerable: true,
|
|
1102
|
+
get: function () { return react.useStepsItemContext; }
|
|
1103
|
+
});
|
|
1104
|
+
exports.Accordion = Accordion;
|
|
1105
|
+
exports.Avatar = Avatar;
|
|
1106
|
+
exports.AvatarGroup = AvatarGroup;
|
|
1107
|
+
exports.Badge = Badge;
|
|
1108
|
+
exports.Box = box_default;
|
|
1109
|
+
exports.Breadcrumb = Breadcrumb;
|
|
1110
|
+
exports.Button = Button;
|
|
1111
|
+
exports.Card = card_default;
|
|
1112
|
+
exports.CheckIcon = CheckIcon;
|
|
1113
|
+
exports.Checkbox = checkbox_default;
|
|
1114
|
+
exports.Clipboard = Clipboard;
|
|
1115
|
+
exports.CloseButton = close_button_default;
|
|
1116
|
+
exports.CloseIcon = CloseIcon;
|
|
1117
|
+
exports.Combobox = Combobox;
|
|
1118
|
+
exports.Container = Container;
|
|
1119
|
+
exports.Dialog = Dialog;
|
|
1120
|
+
exports.Drawer = Drawer;
|
|
1121
|
+
exports.EmptyState = EmptyState;
|
|
1122
|
+
exports.Flex = flex_default;
|
|
1123
|
+
exports.Grid = Grid;
|
|
1124
|
+
exports.GridItem = GridItem;
|
|
1125
|
+
exports.HStack = HStack;
|
|
1126
|
+
exports.Heading = heading_default;
|
|
1127
|
+
exports.Icon = icon_default;
|
|
1128
|
+
exports.IconButton = icon_button_default;
|
|
1129
|
+
exports.Image = image_default;
|
|
1130
|
+
exports.Input = input_default;
|
|
1131
|
+
exports.Link = link_default;
|
|
1132
|
+
exports.LinkOverlay = link_overlay_default;
|
|
1133
|
+
exports.List = List;
|
|
1134
|
+
exports.Loader = loader_default;
|
|
1135
|
+
exports.Menu = Menu;
|
|
1136
|
+
exports.MoneyField = MoneyField;
|
|
1137
|
+
exports.Popover = Popover;
|
|
1138
|
+
exports.QrCode = QrCode;
|
|
1139
|
+
exports.Radio = radio_default;
|
|
1140
|
+
exports.RadioGroup = RadioGroup;
|
|
1141
|
+
exports.RhfCombobox = RhfCombobox;
|
|
1142
|
+
exports.RhfInput = RhfInput;
|
|
1143
|
+
exports.RhfMoneyField = RhfMoneyField;
|
|
1144
|
+
exports.Select = Select;
|
|
1145
|
+
exports.Separator = separator_default;
|
|
1146
|
+
exports.Skeleton = Skeleton;
|
|
1147
|
+
exports.SkeletonCircle = SkeletonCircle;
|
|
1148
|
+
exports.SkeletonText = SkeletonText;
|
|
1149
|
+
exports.Stack = Stack;
|
|
1150
|
+
exports.Steps = Steps;
|
|
1151
|
+
exports.Switch = switch_default;
|
|
1152
|
+
exports.Tabs = Tabs;
|
|
1153
|
+
exports.Text = text_default;
|
|
1154
|
+
exports.TextArea = TextArea;
|
|
1155
|
+
exports.TextMask = text_mask_default;
|
|
1156
|
+
exports.ThemeProvider = ThemeProvider;
|
|
1157
|
+
exports.Toast = Toast;
|
|
1158
|
+
exports.Tooltip = Tooltip;
|
|
1159
|
+
exports.VStack = VStack;
|
|
1160
|
+
exports.WalletIcon = WalletIcon;
|
|
1161
|
+
exports.theme = theme_default;
|
|
1162
|
+
exports.toaster = toaster;
|
|
1163
|
+
//# sourceMappingURL=index.js.map
|
|
1164
|
+
//# sourceMappingURL=index.js.map
|