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