@tarsis/toolkit 0.6.6 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/Container-BVX2MW1U.cjs +138 -0
  2. package/dist/Container-BirkN1fA.js +119 -0
  3. package/dist/SelectBase-BC6WKZVF.cjs +448 -0
  4. package/dist/SelectBase-DPcXvMTa.js +399 -0
  5. package/dist/Slot-SOe-b2n6.cjs +77 -0
  6. package/dist/Slot-z71j7q57.js +65 -0
  7. package/dist/animation-BFpILbqb.js +102 -0
  8. package/dist/animation-BauloIgQ.cjs +119 -0
  9. package/dist/assets-BMqH4phf.cjs +52 -0
  10. package/dist/assets-huTvlamy.js +29 -0
  11. package/dist/audio/fail.mp3 +0 -0
  12. package/dist/audio/fail.ogg +0 -0
  13. package/dist/audio/hover.mp3 +0 -0
  14. package/dist/audio/hover.ogg +0 -0
  15. package/dist/audio/lock/fail.mp3 +0 -0
  16. package/dist/audio/lock/fail.ogg +0 -0
  17. package/dist/audio/lock/hover.mp3 +0 -0
  18. package/dist/audio/lock/hover.ogg +0 -0
  19. package/dist/audio/lock/prev-next.mp3 +0 -0
  20. package/dist/audio/lock/prev-next.ogg +0 -0
  21. package/dist/audio/lock/select.mp3 +0 -0
  22. package/dist/audio/lock/select.ogg +0 -0
  23. package/dist/audio/lock/success.mp3 +0 -0
  24. package/dist/audio/lock/success.ogg +0 -0
  25. package/dist/audio/prev-next.mp3 +0 -0
  26. package/dist/audio/prev-next.ogg +0 -0
  27. package/dist/audio/select.mp3 +0 -0
  28. package/dist/audio/select.ogg +0 -0
  29. package/dist/audio/success.mp3 +0 -0
  30. package/dist/audio/success.ogg +0 -0
  31. package/dist/chunk-CKQMccvm.cjs +28 -0
  32. package/dist/fonts/orbitron/orbitron-black.fnt +426 -0
  33. package/dist/fonts/orbitron/orbitron-black.png +0 -0
  34. package/dist/fonts/orbitron-black.fnt +426 -0
  35. package/dist/fonts/orbitron-black.png +0 -0
  36. package/dist/gl-B0NhVYRl.cjs +177 -0
  37. package/dist/gl-BipoEx9s.js +171 -0
  38. package/dist/hooks.cjs +661 -24
  39. package/dist/hooks.d.ts +72 -0
  40. package/dist/hooks.js +635 -1
  41. package/dist/index.cjs +26708 -384
  42. package/dist/index.d.ts +913 -27
  43. package/dist/index.js +26282 -3
  44. package/dist/layout.cjs +5 -0
  45. package/dist/layout.d.ts +45 -0
  46. package/dist/layout.js +2 -0
  47. package/dist/primitives.cjs +13 -0
  48. package/dist/primitives.d.ts +178 -0
  49. package/dist/primitives.js +3 -0
  50. package/dist/server.cjs +25 -0
  51. package/dist/server.d.ts +70 -0
  52. package/dist/server.js +2 -0
  53. package/dist/styles.css +4020 -2946
  54. package/dist/tokens-B2AxRYyF.js +434 -0
  55. package/dist/tokens-DlMougUi.cjs +469 -0
  56. package/dist/tokens.cjs +12 -0
  57. package/dist/tokens.d.ts +435 -0
  58. package/dist/tokens.js +3 -0
  59. package/dist/useMergeRefs-BM2-gSLn.js +16 -0
  60. package/dist/useMergeRefs-C_l6omwU.cjs +28 -0
  61. package/dist/utils-BGgmkNY4.cjs +330 -0
  62. package/dist/utils-Dw5El_3G.js +222 -0
  63. package/dist/utils.cjs +44 -38
  64. package/dist/utils.d.ts +75 -0
  65. package/dist/utils.js +3 -1
  66. package/dist/values-BTw18-W5.js +138 -0
  67. package/dist/values-BqSJ0h9o.cjs +275 -0
  68. package/package.json +88 -36
  69. package/dist/gl-C1OpenGq.js +0 -3258
  70. package/dist/gl-LtHwn-bj.cjs +0 -3262
  71. package/dist/index-Cz74WvnK.js +0 -3910
  72. package/dist/index-DhWWozeo.cjs +0 -3912
  73. package/dist/index-DvXp0wCM.cjs +0 -116866
  74. package/dist/index-JZY8IMW2.js +0 -116503
  75. package/dist/svg-BT_esDTZ.cjs +0 -236
  76. package/dist/svg-CQLdTbLk.js +0 -205
  77. package/dist/useWindowReady-6kIdYolB.cjs +0 -9317
  78. package/dist/useWindowReady-tUs-ONyG.js +0 -9224
@@ -0,0 +1,138 @@
1
+ const require_chunk = require("./chunk-CKQMccvm.cjs");
2
+ const require_Slot = require("./Slot-SOe-b2n6.cjs");
3
+ let clsx = require("clsx");
4
+ clsx = require_chunk.__toESM(clsx);
5
+ let react = require("react");
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
+ var Stack_module_default = {
8
+ root: "_root_1hgvp_1",
9
+ divider: "_divider_1hgvp_10"
10
+ };
11
+ //#endregion
12
+ //#region src/components/primitives/Stack/Stack.tsx
13
+ var Stack = ({ gap, align, divider, asChild = false, className, style, children, ref, ...rest }) => {
14
+ const composedStyle = {
15
+ ...style,
16
+ ...gap ? { "--stack-gap": gap } : void 0,
17
+ ...align ? { "--stack-align": alignMap$1[align] } : void 0
18
+ };
19
+ const composedClassName = (0, clsx.default)(Stack_module_default.root, className);
20
+ const content = divider ? interleaveWithDivider(children, divider) : children;
21
+ if (asChild) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Slot.Slot, {
22
+ ref,
23
+ className: composedClassName,
24
+ style: composedStyle,
25
+ ...rest,
26
+ children: content
27
+ });
28
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
29
+ ref,
30
+ className: composedClassName,
31
+ style: composedStyle,
32
+ ...rest,
33
+ children: content
34
+ });
35
+ };
36
+ var alignMap$1 = {
37
+ start: "flex-start",
38
+ center: "center",
39
+ end: "flex-end",
40
+ stretch: "stretch"
41
+ };
42
+ var interleaveWithDivider = (children, divider) => {
43
+ const items = react.Children.toArray(children).filter(Boolean);
44
+ const result = [];
45
+ for (let i = 0; i < items.length; i++) {
46
+ result.push(items[i]);
47
+ if (i < items.length - 1) result.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
48
+ className: Stack_module_default.divider,
49
+ role: "separator",
50
+ "aria-hidden": "true",
51
+ children: divider
52
+ }, `divider-${i}`));
53
+ }
54
+ return result;
55
+ };
56
+ var Cluster_module_default = { root: "_root_1upg0_1" };
57
+ //#endregion
58
+ //#region src/components/primitives/Cluster/Cluster.tsx
59
+ var justifyMap = {
60
+ start: "flex-start",
61
+ center: "center",
62
+ end: "flex-end",
63
+ between: "space-between"
64
+ };
65
+ var alignMap = {
66
+ start: "flex-start",
67
+ center: "center",
68
+ end: "flex-end",
69
+ stretch: "stretch",
70
+ baseline: "baseline"
71
+ };
72
+ var Cluster = ({ gap, justify, align, asChild = false, className, style, children, ref, ...rest }) => {
73
+ const composedStyle = {
74
+ ...style,
75
+ ...gap ? { "--cluster-gap": gap } : void 0,
76
+ ...justify ? { "--cluster-justify": justifyMap[justify] } : void 0,
77
+ ...align ? { "--cluster-align": alignMap[align] } : void 0
78
+ };
79
+ const composedClassName = (0, clsx.default)(Cluster_module_default.root, className);
80
+ if (asChild) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Slot.Slot, {
81
+ ref,
82
+ className: composedClassName,
83
+ style: composedStyle,
84
+ ...rest,
85
+ children
86
+ });
87
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
88
+ ref,
89
+ className: composedClassName,
90
+ style: composedStyle,
91
+ ...rest,
92
+ children
93
+ });
94
+ };
95
+ var Container_module_default = { root: "_root_jx4le_1" };
96
+ //#endregion
97
+ //#region src/components/primitives/Container/Container.tsx
98
+ var Container = ({ maxWidth, padding, asChild = false, className, style, children, ref, ...rest }) => {
99
+ const composedStyle = {
100
+ ...style,
101
+ ...maxWidth ? { "--container-max-width": maxWidth } : void 0,
102
+ ...padding ? { "--container-padding": padding } : void 0
103
+ };
104
+ const composedClassName = (0, clsx.default)(Container_module_default.root, className);
105
+ if (asChild) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Slot.Slot, {
106
+ ref,
107
+ className: composedClassName,
108
+ style: composedStyle,
109
+ ...rest,
110
+ children
111
+ });
112
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
113
+ ref,
114
+ className: composedClassName,
115
+ style: composedStyle,
116
+ ...rest,
117
+ children
118
+ });
119
+ };
120
+ //#endregion
121
+ Object.defineProperty(exports, "Cluster", {
122
+ enumerable: true,
123
+ get: function() {
124
+ return Cluster;
125
+ }
126
+ });
127
+ Object.defineProperty(exports, "Container", {
128
+ enumerable: true,
129
+ get: function() {
130
+ return Container;
131
+ }
132
+ });
133
+ Object.defineProperty(exports, "Stack", {
134
+ enumerable: true,
135
+ get: function() {
136
+ return Stack;
137
+ }
138
+ });
@@ -0,0 +1,119 @@
1
+ import { t as Slot } from "./Slot-z71j7q57.js";
2
+ import cn from "clsx";
3
+ import { Children } from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ var Stack_module_default = {
6
+ root: "_root_1hgvp_1",
7
+ divider: "_divider_1hgvp_10"
8
+ };
9
+ //#endregion
10
+ //#region src/components/primitives/Stack/Stack.tsx
11
+ var Stack = ({ gap, align, divider, asChild = false, className, style, children, ref, ...rest }) => {
12
+ const composedStyle = {
13
+ ...style,
14
+ ...gap ? { "--stack-gap": gap } : void 0,
15
+ ...align ? { "--stack-align": alignMap$1[align] } : void 0
16
+ };
17
+ const composedClassName = cn(Stack_module_default.root, className);
18
+ const content = divider ? interleaveWithDivider(children, divider) : children;
19
+ if (asChild) return /* @__PURE__ */ jsx(Slot, {
20
+ ref,
21
+ className: composedClassName,
22
+ style: composedStyle,
23
+ ...rest,
24
+ children: content
25
+ });
26
+ return /* @__PURE__ */ jsx("div", {
27
+ ref,
28
+ className: composedClassName,
29
+ style: composedStyle,
30
+ ...rest,
31
+ children: content
32
+ });
33
+ };
34
+ var alignMap$1 = {
35
+ start: "flex-start",
36
+ center: "center",
37
+ end: "flex-end",
38
+ stretch: "stretch"
39
+ };
40
+ var interleaveWithDivider = (children, divider) => {
41
+ const items = Children.toArray(children).filter(Boolean);
42
+ const result = [];
43
+ for (let i = 0; i < items.length; i++) {
44
+ result.push(items[i]);
45
+ if (i < items.length - 1) result.push(/* @__PURE__ */ jsx("div", {
46
+ className: Stack_module_default.divider,
47
+ role: "separator",
48
+ "aria-hidden": "true",
49
+ children: divider
50
+ }, `divider-${i}`));
51
+ }
52
+ return result;
53
+ };
54
+ var Cluster_module_default = { root: "_root_1upg0_1" };
55
+ //#endregion
56
+ //#region src/components/primitives/Cluster/Cluster.tsx
57
+ var justifyMap = {
58
+ start: "flex-start",
59
+ center: "center",
60
+ end: "flex-end",
61
+ between: "space-between"
62
+ };
63
+ var alignMap = {
64
+ start: "flex-start",
65
+ center: "center",
66
+ end: "flex-end",
67
+ stretch: "stretch",
68
+ baseline: "baseline"
69
+ };
70
+ var Cluster = ({ gap, justify, align, asChild = false, className, style, children, ref, ...rest }) => {
71
+ const composedStyle = {
72
+ ...style,
73
+ ...gap ? { "--cluster-gap": gap } : void 0,
74
+ ...justify ? { "--cluster-justify": justifyMap[justify] } : void 0,
75
+ ...align ? { "--cluster-align": alignMap[align] } : void 0
76
+ };
77
+ const composedClassName = cn(Cluster_module_default.root, className);
78
+ if (asChild) return /* @__PURE__ */ jsx(Slot, {
79
+ ref,
80
+ className: composedClassName,
81
+ style: composedStyle,
82
+ ...rest,
83
+ children
84
+ });
85
+ return /* @__PURE__ */ jsx("div", {
86
+ ref,
87
+ className: composedClassName,
88
+ style: composedStyle,
89
+ ...rest,
90
+ children
91
+ });
92
+ };
93
+ var Container_module_default = { root: "_root_jx4le_1" };
94
+ //#endregion
95
+ //#region src/components/primitives/Container/Container.tsx
96
+ var Container = ({ maxWidth, padding, asChild = false, className, style, children, ref, ...rest }) => {
97
+ const composedStyle = {
98
+ ...style,
99
+ ...maxWidth ? { "--container-max-width": maxWidth } : void 0,
100
+ ...padding ? { "--container-padding": padding } : void 0
101
+ };
102
+ const composedClassName = cn(Container_module_default.root, className);
103
+ if (asChild) return /* @__PURE__ */ jsx(Slot, {
104
+ ref,
105
+ className: composedClassName,
106
+ style: composedStyle,
107
+ ...rest,
108
+ children
109
+ });
110
+ return /* @__PURE__ */ jsx("div", {
111
+ ref,
112
+ className: composedClassName,
113
+ style: composedStyle,
114
+ ...rest,
115
+ children
116
+ });
117
+ };
118
+ //#endregion
119
+ export { Cluster as n, Stack as r, Container as t };
@@ -0,0 +1,448 @@
1
+ const require_chunk = require("./chunk-CKQMccvm.cjs");
2
+ const require_useMergeRefs = require("./useMergeRefs-C_l6omwU.cjs");
3
+ const require_hooks = require("./hooks.cjs");
4
+ let clsx = require("clsx");
5
+ clsx = require_chunk.__toESM(clsx);
6
+ let react = require("react");
7
+ let react_jsx_runtime = require("react/jsx-runtime");
8
+ let _floating_ui_react = require("@floating-ui/react");
9
+ let react_dom = require("react-dom");
10
+ //#region src/components/primitives/VisuallyHidden/VisuallyHidden.tsx
11
+ var hiddenStyles = {
12
+ position: "absolute",
13
+ width: 1,
14
+ height: 1,
15
+ padding: 0,
16
+ margin: -1,
17
+ overflow: "hidden",
18
+ clip: "rect(0, 0, 0, 0)",
19
+ whiteSpace: "nowrap",
20
+ borderWidth: 0
21
+ };
22
+ var VisuallyHidden = ({ children, style, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
23
+ style: {
24
+ ...hiddenStyles,
25
+ ...style
26
+ },
27
+ ...props,
28
+ children
29
+ });
30
+ //#endregion
31
+ //#region src/components/primitives/Portal/Portal.tsx
32
+ var Portal = ({ children, container }) => {
33
+ const mountNode = (0, react.useMemo)(() => typeof document !== "undefined" ? container ?? document.body : null, [container]);
34
+ if (!mountNode) return null;
35
+ return (0, react_dom.createPortal)(children, mountNode);
36
+ };
37
+ var FormField_module_default = {
38
+ root: "_root_1m3zs_1",
39
+ label: "_label_1m3zs_8",
40
+ error: "_error_1m3zs_15",
41
+ hint: "_hint_1m3zs_22"
42
+ };
43
+ //#endregion
44
+ //#region src/components/primitives/FormField/FormFieldContext.ts
45
+ var FormFieldContext = (0, react.createContext)(null);
46
+ function useFormFieldContext() {
47
+ const ctx = (0, react.useContext)(FormFieldContext);
48
+ if (!ctx) throw new Error("FormField compound components must be used within <FormField>");
49
+ return ctx;
50
+ }
51
+ //#endregion
52
+ //#region src/components/primitives/FormField/FormField.tsx
53
+ var FormFieldRoot = ({ children, className, style, id, hasError = false, hasHint = false }) => {
54
+ const field = require_hooks.useFormField({
55
+ id,
56
+ hasError,
57
+ hasHint
58
+ });
59
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FormFieldContext.Provider, {
60
+ value: field,
61
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
62
+ className: (0, clsx.default)(FormField_module_default.root, className),
63
+ style,
64
+ "data-has-error": hasError ? "" : void 0,
65
+ children
66
+ })
67
+ });
68
+ };
69
+ var FormFieldLabel = ({ children, className }) => {
70
+ const { labelProps } = useFormFieldContext();
71
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
72
+ ...labelProps,
73
+ className: (0, clsx.default)(FormField_module_default.label, className),
74
+ children
75
+ });
76
+ };
77
+ var FormFieldControl = ({ children }) => {
78
+ const { fieldProps } = useFormFieldContext();
79
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: children(fieldProps) });
80
+ };
81
+ var FormFieldError = ({ children, className }) => {
82
+ const { errorProps } = useFormFieldContext();
83
+ if (!children) return null;
84
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
85
+ ...errorProps,
86
+ className: (0, clsx.default)(FormField_module_default.error, className),
87
+ children
88
+ });
89
+ };
90
+ var FormFieldHint = ({ children, className }) => {
91
+ const { hintProps } = useFormFieldContext();
92
+ if (!children) return null;
93
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
94
+ ...hintProps,
95
+ className: (0, clsx.default)(FormField_module_default.hint, className),
96
+ children
97
+ });
98
+ };
99
+ var FormField = Object.assign(FormFieldRoot, {
100
+ Label: FormFieldLabel,
101
+ Control: FormFieldControl,
102
+ Error: FormFieldError,
103
+ Hint: FormFieldHint
104
+ });
105
+ //#endregion
106
+ //#region src/components/primitives/DialogBase/DialogBase.module.scss
107
+ var dialog = "_dialog_bhv2h_1";
108
+ var content = "_content_bhv2h_29";
109
+ var DialogBase_module_default = {
110
+ dialog,
111
+ "dialog-backdrop-fade-in": "_dialog-backdrop-fade-in_bhv2h_1",
112
+ content,
113
+ "dialog-content-enter": "_dialog-content-enter_bhv2h_1"
114
+ };
115
+ //#endregion
116
+ //#region src/components/primitives/DialogBase/DialogBase.tsx
117
+ var DialogBase = ({ open, onClose, children, className, overlayClassName, style, ref: externalRef, closeOnOverlayClick = true, closeOnEscape = true, ...ariaProps }) => {
118
+ const internalRef = (0, react.useRef)(null);
119
+ const dialogRef = require_useMergeRefs.useMergeRefs(internalRef, externalRef ?? null);
120
+ (0, react.useEffect)(() => {
121
+ const dialog = internalRef.current;
122
+ if (!dialog) return;
123
+ if (open && !dialog.open) dialog.showModal();
124
+ else if (!open && dialog.open) dialog.close();
125
+ }, [open]);
126
+ (0, react.useEffect)(() => {
127
+ if (!open) return;
128
+ const originalOverflow = document.body.style.overflow;
129
+ document.body.style.overflow = "hidden";
130
+ return () => {
131
+ document.body.style.overflow = originalOverflow;
132
+ };
133
+ }, [open]);
134
+ const handleCancel = (0, react.useCallback)((e) => {
135
+ e.preventDefault();
136
+ if (closeOnEscape) onClose();
137
+ }, [closeOnEscape, onClose]);
138
+ const handleBackdropClick = (0, react.useCallback)((e) => {
139
+ if (!closeOnOverlayClick) return;
140
+ if (e.target === internalRef.current) onClose();
141
+ }, [closeOnOverlayClick, onClose]);
142
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dialog", {
143
+ ref: dialogRef,
144
+ className: (0, clsx.default)(DialogBase_module_default.dialog, overlayClassName),
145
+ onCancel: handleCancel,
146
+ onClick: handleBackdropClick,
147
+ "aria-label": ariaProps["aria-label"],
148
+ "aria-labelledby": ariaProps["aria-labelledby"],
149
+ "aria-describedby": ariaProps["aria-describedby"],
150
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
151
+ className: (0, clsx.default)(DialogBase_module_default.content, className),
152
+ style,
153
+ children
154
+ })
155
+ });
156
+ };
157
+ var PopoverBase_module_default = {
158
+ popover: "_popover_stzls_1",
159
+ "popover-enter": "_popover-enter_stzls_1"
160
+ };
161
+ //#endregion
162
+ //#region src/components/primitives/PopoverBase/PopoverBase.tsx
163
+ var PopoverBase = ({ open, onOpenChange, trigger, children, placement = "bottom", offsetValue = 8, className, style, triggerRef: externalTriggerRef, ...ariaProps }) => {
164
+ const { refs, floatingStyles, context } = (0, _floating_ui_react.useFloating)({
165
+ open,
166
+ onOpenChange,
167
+ placement,
168
+ middleware: [
169
+ (0, _floating_ui_react.offset)(offsetValue),
170
+ (0, _floating_ui_react.flip)(),
171
+ (0, _floating_ui_react.shift)({ padding: 8 })
172
+ ],
173
+ whileElementsMounted: _floating_ui_react.autoUpdate
174
+ });
175
+ const { getReferenceProps, getFloatingProps } = (0, _floating_ui_react.useInteractions)([
176
+ (0, _floating_ui_react.useClick)(context),
177
+ (0, _floating_ui_react.useDismiss)(context),
178
+ (0, _floating_ui_react.useRole)(context)
179
+ ]);
180
+ const setTriggerRef = (0, react.useCallback)((node) => {
181
+ refs.setReference(node);
182
+ }, [refs]);
183
+ const setFloatingRef = (0, react.useCallback)((node) => {
184
+ refs.setFloating(node);
185
+ }, [refs]);
186
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
187
+ ref: require_useMergeRefs.useMergeRefs(setTriggerRef, externalTriggerRef ?? null),
188
+ ...getReferenceProps(),
189
+ style: { display: "inline-flex" },
190
+ children: trigger
191
+ }), open && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_floating_ui_react.FloatingPortal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_floating_ui_react.FloatingFocusManager, {
192
+ context,
193
+ modal: false,
194
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
195
+ ref: setFloatingRef,
196
+ className: (0, clsx.default)(PopoverBase_module_default.popover, className),
197
+ style: {
198
+ ...floatingStyles,
199
+ ...style
200
+ },
201
+ "aria-label": ariaProps["aria-label"],
202
+ "aria-labelledby": ariaProps["aria-labelledby"],
203
+ ...getFloatingProps(),
204
+ children
205
+ })
206
+ }) })] });
207
+ };
208
+ var TooltipBase_module_default = {
209
+ tooltip: "_tooltip_n91kb_1",
210
+ "tooltip-enter": "_tooltip-enter_n91kb_1"
211
+ };
212
+ //#endregion
213
+ //#region src/components/primitives/TooltipBase/TooltipBase.tsx
214
+ var TooltipBase = ({ content, children, placement = "top", delayMs = 300, closeDelayMs = 0, open: controlledOpen, onOpenChange: controlledOnOpenChange, className, style, triggerRef: externalTriggerRef }) => {
215
+ const [uncontrolledOpen, setUncontrolledOpen] = (0, react.useState)(false);
216
+ const isControlled = controlledOpen !== void 0;
217
+ const open = isControlled ? controlledOpen : uncontrolledOpen;
218
+ const onOpenChange = isControlled ? controlledOnOpenChange ?? (() => {}) : setUncontrolledOpen;
219
+ const tooltipId = (0, react.useId)();
220
+ const { refs, floatingStyles, context } = (0, _floating_ui_react.useFloating)({
221
+ open,
222
+ onOpenChange,
223
+ placement,
224
+ middleware: [
225
+ (0, _floating_ui_react.offset)(6),
226
+ (0, _floating_ui_react.flip)(),
227
+ (0, _floating_ui_react.shift)({ padding: 8 })
228
+ ],
229
+ whileElementsMounted: _floating_ui_react.autoUpdate
230
+ });
231
+ const { getReferenceProps, getFloatingProps } = (0, _floating_ui_react.useInteractions)([
232
+ (0, _floating_ui_react.useHover)(context, {
233
+ delay: {
234
+ open: delayMs,
235
+ close: closeDelayMs
236
+ },
237
+ handleClose: (0, _floating_ui_react.safePolygon)()
238
+ }),
239
+ (0, _floating_ui_react.useFocus)(context),
240
+ (0, _floating_ui_react.useDismiss)(context),
241
+ (0, _floating_ui_react.useRole)(context, { role: "tooltip" })
242
+ ]);
243
+ const setTriggerRef = (0, react.useCallback)((node) => {
244
+ refs.setReference(node);
245
+ }, [refs]);
246
+ const setFloatingRef = (0, react.useCallback)((node) => {
247
+ refs.setFloating(node);
248
+ }, [refs]);
249
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
250
+ ref: require_useMergeRefs.useMergeRefs(setTriggerRef, externalTriggerRef ?? null),
251
+ ...getReferenceProps(),
252
+ "aria-describedby": open ? tooltipId : void 0,
253
+ style: { display: "inline-flex" },
254
+ children
255
+ }), open && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_floating_ui_react.FloatingPortal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
256
+ ref: setFloatingRef,
257
+ id: tooltipId,
258
+ role: "tooltip",
259
+ className: (0, clsx.default)(TooltipBase_module_default.tooltip, className),
260
+ style: {
261
+ ...floatingStyles,
262
+ ...style
263
+ },
264
+ ...getFloatingProps(),
265
+ children: content
266
+ }) })] });
267
+ };
268
+ var SelectBase_module_default = {
269
+ root: "_root_fausy_1",
270
+ trigger: "_trigger_fausy_14",
271
+ disabled: "_disabled_fausy_53",
272
+ value: "_value_fausy_59",
273
+ chevron: "_chevron_fausy_66",
274
+ listbox: "_listbox_fausy_76",
275
+ option: "_option_fausy_87",
276
+ active: "_active_fausy_102",
277
+ selected: "_selected_fausy_106",
278
+ optionDisabled: "_optionDisabled_fausy_110"
279
+ };
280
+ //#endregion
281
+ //#region src/components/primitives/SelectBase/SelectBase.tsx
282
+ var SelectContext = (0, react.createContext)(null);
283
+ var SelectBase = ({ options, value: controlledValue, defaultValue, onChange, placeholder = "Select...", disabled = false, name, className, style, ref, ...ariaProps }) => {
284
+ const [selectedValue, setSelectedValue] = require_hooks.useControllableState(controlledValue, defaultValue ?? void 0, onChange);
285
+ const [isOpen, setIsOpen] = (0, react.useState)(false);
286
+ const [activeIndex, setActiveIndex] = (0, react.useState)(null);
287
+ const listRef = (0, react.useRef)([]);
288
+ const triggerId = (0, react.useId)();
289
+ const listboxId = (0, react.useId)();
290
+ const { refs, floatingStyles, context } = (0, _floating_ui_react.useFloating)({
291
+ open: isOpen,
292
+ onOpenChange: setIsOpen,
293
+ whileElementsMounted: _floating_ui_react.autoUpdate,
294
+ placement: "bottom-start",
295
+ middleware: [
296
+ (0, _floating_ui_react.offset)(4),
297
+ (0, _floating_ui_react.flip)(),
298
+ (0, _floating_ui_react.shift)({ padding: 8 }),
299
+ (0, _floating_ui_react.size)({ apply({ rects, elements }) {
300
+ Object.assign(elements.floating.style, { minWidth: `${rects.reference.width}px` });
301
+ } })
302
+ ]
303
+ });
304
+ const { getReferenceProps, getFloatingProps, getItemProps } = (0, _floating_ui_react.useInteractions)([
305
+ (0, _floating_ui_react.useClick)(context),
306
+ (0, _floating_ui_react.useDismiss)(context),
307
+ (0, _floating_ui_react.useRole)(context, { role: "listbox" }),
308
+ (0, _floating_ui_react.useListNavigation)(context, {
309
+ listRef,
310
+ activeIndex,
311
+ onNavigate: setActiveIndex,
312
+ loop: true
313
+ })
314
+ ]);
315
+ const handleSelect = (0, react.useCallback)((value) => {
316
+ setSelectedValue(value);
317
+ setIsOpen(false);
318
+ }, [setSelectedValue]);
319
+ const selectedOption = options.find((o) => o.value === selectedValue);
320
+ const getItemPropsForIndex = (0, react.useCallback)((_index) => getItemProps({ role: "option" }), [getItemProps]);
321
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectContext.Provider, {
322
+ value: {
323
+ isOpen,
324
+ activeIndex,
325
+ selectedValue,
326
+ getItemProps: getItemPropsForIndex,
327
+ handleSelect,
328
+ listRef
329
+ },
330
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
331
+ ref,
332
+ className: (0, clsx.default)(SelectBase_module_default.root, className),
333
+ style,
334
+ children: [
335
+ name && selectedValue !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
336
+ type: "hidden",
337
+ name,
338
+ value: selectedValue
339
+ }),
340
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
341
+ ref: refs.setReference,
342
+ type: "button",
343
+ id: triggerId,
344
+ className: (0, clsx.default)(SelectBase_module_default.trigger, disabled && SelectBase_module_default.disabled),
345
+ disabled,
346
+ "aria-expanded": isOpen,
347
+ "aria-haspopup": "listbox",
348
+ "aria-controls": isOpen ? listboxId : void 0,
349
+ "aria-label": ariaProps["aria-label"],
350
+ "aria-labelledby": ariaProps["aria-labelledby"],
351
+ ...getReferenceProps(),
352
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
353
+ className: SelectBase_module_default.value,
354
+ children: selectedOption ? selectedOption.label : placeholder
355
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
356
+ className: SelectBase_module_default.chevron,
357
+ "aria-hidden": "true",
358
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
359
+ width: "12",
360
+ height: "12",
361
+ viewBox: "0 0 12 12",
362
+ fill: "none",
363
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
364
+ d: "M3 4.5L6 7.5L9 4.5",
365
+ stroke: "currentColor",
366
+ strokeWidth: "1.5",
367
+ strokeLinecap: "round",
368
+ strokeLinejoin: "round"
369
+ })
370
+ })
371
+ })]
372
+ }),
373
+ isOpen && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
374
+ ref: refs.setFloating,
375
+ id: listboxId,
376
+ role: "listbox",
377
+ className: SelectBase_module_default.listbox,
378
+ style: floatingStyles,
379
+ "aria-labelledby": triggerId,
380
+ ...getFloatingProps(),
381
+ children: options.map((option, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
382
+ ref: (node) => {
383
+ listRef.current[index] = node;
384
+ },
385
+ role: "option",
386
+ className: (0, clsx.default)(SelectBase_module_default.option, activeIndex === index && SelectBase_module_default.active, option.value === selectedValue && SelectBase_module_default.selected, option.disabled && SelectBase_module_default.optionDisabled),
387
+ "aria-selected": option.value === selectedValue,
388
+ "aria-disabled": option.disabled,
389
+ tabIndex: activeIndex === index ? 0 : -1,
390
+ ...getItemProps({ onClick: () => {
391
+ if (!option.disabled) handleSelect(option.value);
392
+ } }),
393
+ children: option.label
394
+ }, option.value))
395
+ })
396
+ ]
397
+ })
398
+ });
399
+ };
400
+ //#endregion
401
+ Object.defineProperty(exports, "DialogBase", {
402
+ enumerable: true,
403
+ get: function() {
404
+ return DialogBase;
405
+ }
406
+ });
407
+ Object.defineProperty(exports, "FormField", {
408
+ enumerable: true,
409
+ get: function() {
410
+ return FormField;
411
+ }
412
+ });
413
+ Object.defineProperty(exports, "PopoverBase", {
414
+ enumerable: true,
415
+ get: function() {
416
+ return PopoverBase;
417
+ }
418
+ });
419
+ Object.defineProperty(exports, "Portal", {
420
+ enumerable: true,
421
+ get: function() {
422
+ return Portal;
423
+ }
424
+ });
425
+ Object.defineProperty(exports, "SelectBase", {
426
+ enumerable: true,
427
+ get: function() {
428
+ return SelectBase;
429
+ }
430
+ });
431
+ Object.defineProperty(exports, "TooltipBase", {
432
+ enumerable: true,
433
+ get: function() {
434
+ return TooltipBase;
435
+ }
436
+ });
437
+ Object.defineProperty(exports, "VisuallyHidden", {
438
+ enumerable: true,
439
+ get: function() {
440
+ return VisuallyHidden;
441
+ }
442
+ });
443
+ Object.defineProperty(exports, "useFormFieldContext", {
444
+ enumerable: true,
445
+ get: function() {
446
+ return useFormFieldContext;
447
+ }
448
+ });