fina-react-ds 1.0.22 → 1.0.24

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 (108) hide show
  1. package/dist/components/alert-dialog.d.ts +1 -1
  2. package/dist/components/alert-dialog.js +65 -59
  3. package/dist/components/avatar.d.ts +1 -1
  4. package/dist/components/avatar.js +19 -19
  5. package/dist/components/badge.js +12 -11
  6. package/dist/components/button.js +12 -11
  7. package/dist/components/checkbox.d.ts +1 -1
  8. package/dist/components/checkbox.js +17 -17
  9. package/dist/components/dialog.d.ts +1 -1
  10. package/dist/components/dialog.js +60 -60
  11. package/dist/components/dropdown-menu.d.ts +1 -1
  12. package/dist/components/dropdown-menu.js +93 -93
  13. package/dist/components/form.d.ts +2 -3
  14. package/dist/components/form.js +2 -2
  15. package/dist/components/hover-card.d.ts +1 -1
  16. package/dist/components/hover-card.js +23 -23
  17. package/dist/components/label.d.ts +1 -1
  18. package/dist/components/label.js +12 -12
  19. package/dist/components/popover.d.ts +1 -1
  20. package/dist/components/popover.js +28 -28
  21. package/dist/components/separator.d.ts +1 -1
  22. package/dist/components/separator.js +10 -10
  23. package/dist/components/sheet.d.ts +1 -1
  24. package/dist/components/sheet.js +73 -73
  25. package/dist/components/sidebar.js +73 -69
  26. package/dist/components/switch.d.ts +1 -1
  27. package/dist/components/switch.js +13 -13
  28. package/dist/components/tabs.d.ts +1 -1
  29. package/dist/components/tabs.js +22 -22
  30. package/dist/components/tooltip.d.ts +1 -1
  31. package/dist/components/tooltip.js +27 -27
  32. package/dist/index.d.ts +5 -3
  33. package/dist/index.js +186 -172
  34. package/dist/lib/http.d.ts +13 -0
  35. package/dist/lib/http.js +58 -0
  36. package/dist/lib/yup.d.ts +2 -0
  37. package/dist/lib/yup.js +88 -0
  38. package/package.json +5 -3
  39. package/dist/_virtual/index.js +0 -5
  40. package/dist/_virtual/index2.js +0 -4
  41. package/dist/_virtual/use-sync-external-store-shim.development.js +0 -4
  42. package/dist/_virtual/use-sync-external-store-shim.production.js +0 -4
  43. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -534
  44. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -430
  45. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -215
  46. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -159
  47. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -149
  48. package/dist/node_modules/@radix-ui/primitive/dist/index.js +0 -12
  49. package/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.js +0 -130
  50. package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +0 -24
  51. package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +0 -80
  52. package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +0 -258
  53. package/dist/node_modules/@radix-ui/react-collection/dist/index.js +0 -51
  54. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -34
  55. package/dist/node_modules/@radix-ui/react-context/dist/index.js +0 -76
  56. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +0 -265
  57. package/dist/node_modules/@radix-ui/react-direction/dist/index.js +0 -12
  58. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -133
  59. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +0 -230
  60. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +0 -21
  61. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -149
  62. package/dist/node_modules/@radix-ui/react-hover-card/dist/index.js +0 -192
  63. package/dist/node_modules/@radix-ui/react-id/dist/index.js +0 -16
  64. package/dist/node_modules/@radix-ui/react-label/dist/index.js +0 -22
  65. package/dist/node_modules/@radix-ui/react-menu/dist/index.js +0 -663
  66. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +0 -247
  67. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +0 -224
  68. package/dist/node_modules/@radix-ui/react-portal/dist/index.js +0 -16
  69. package/dist/node_modules/@radix-ui/react-presence/dist/index.js +0 -77
  70. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +0 -39
  71. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +0 -189
  72. package/dist/node_modules/@radix-ui/react-separator/dist/index.js +0 -27
  73. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +0 -67
  74. package/dist/node_modules/@radix-ui/react-switch/dist/index.js +0 -136
  75. package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +0 -168
  76. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +0 -348
  77. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +0 -16
  78. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -59
  79. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +0 -17
  80. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +0 -19
  81. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +0 -6
  82. package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +0 -11
  83. package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +0 -30
  84. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +0 -32
  85. package/dist/node_modules/aria-hidden/dist/es2015/index.js +0 -54
  86. package/dist/node_modules/get-nonce/dist/es2015/index.js +0 -9
  87. package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +0 -11
  88. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +0 -116
  89. package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +0 -33
  90. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +0 -18
  91. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +0 -70
  92. package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +0 -5
  93. package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +0 -7
  94. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +0 -73
  95. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +0 -7
  96. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +0 -27
  97. package/dist/node_modules/react-style-singleton/dist/es2015/component.js +0 -13
  98. package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +0 -17
  99. package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +0 -35
  100. package/dist/node_modules/tslib/tslib.es6.js +0 -31
  101. package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +0 -9
  102. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +0 -29
  103. package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +0 -28
  104. package/dist/node_modules/use-sidecar/dist/es2015/exports.js +0 -21
  105. package/dist/node_modules/use-sidecar/dist/es2015/medium.js +0 -72
  106. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -73
  107. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -62
  108. package/dist/node_modules/use-sync-external-store/shim/index.js +0 -13
@@ -1,189 +0,0 @@
1
- var j = Object.defineProperty;
2
- var I = (e, o) => j(e, "name", { value: o, configurable: !0 });
3
- import * as c from "react";
4
- import { composeEventHandlers as p } from "../../primitive/dist/index.js";
5
- import { createCollection as z } from "../../react-collection/dist/index.js";
6
- import { useComposedRefs as q } from "../../react-compose-refs/dist/index.js";
7
- import { createContextScope as J } from "../../react-context/dist/index.js";
8
- import { useId as Q } from "../../react-id/dist/index.js";
9
- import { Primitive as N } from "../../react-primitive/dist/index.js";
10
- import { useCallbackRef as W } from "../../react-use-callback-ref/dist/index.js";
11
- import { useControllableState as X } from "../../react-use-controllable-state/dist/index.js";
12
- import { useDirection as Z } from "../../react-direction/dist/index.js";
13
- import { jsx as d } from "react/jsx-runtime";
14
- var D = "rovingFocusGroup.onEntryFocus", $ = { bubbles: !1, cancelable: !0 }, b = "RovingFocusGroup", [P, O, ee] = z(b), [oe, Ee] = J(
15
- b,
16
- [ee]
17
- ), [te, re] = oe(b), K = c.forwardRef(
18
- (e, o) => /* @__PURE__ */ d(P.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d(P.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d(ne, { ...e, ref: o }) }) })
19
- );
20
- K.displayName = b;
21
- var ne = c.forwardRef((e, o) => {
22
- const {
23
- __scopeRovingFocusGroup: s,
24
- orientation: t,
25
- loop: w = !1,
26
- dir: C,
27
- currentTabStopId: v,
28
- defaultCurrentTabStopId: S,
29
- onCurrentTabStopIdChange: h,
30
- onEntryFocus: m,
31
- preventScrollOnEntryFocus: u = !1,
32
- ...F
33
- } = e, g = c.useRef(null), R = q(o, g), E = Z(C), [T, r] = X({
34
- prop: v,
35
- defaultProp: S ?? null,
36
- onChange: h,
37
- caller: b
38
- }), [i, A] = c.useState(!1), a = W(m), l = O(s), _ = c.useRef(!1), [U, x] = c.useState(0);
39
- return c.useEffect(() => {
40
- const n = g.current;
41
- if (n)
42
- return n.addEventListener(D, a), () => n.removeEventListener(D, a);
43
- }, [a]), /* @__PURE__ */ d(
44
- te,
45
- {
46
- scope: s,
47
- orientation: t,
48
- dir: E,
49
- loop: w,
50
- currentTabStopId: T,
51
- onItemFocus: c.useCallback(
52
- (n) => r(n),
53
- [r]
54
- ),
55
- onItemShiftTab: c.useCallback(() => A(!0), []),
56
- onFocusableItemAdd: c.useCallback(
57
- () => x((n) => n + 1),
58
- []
59
- ),
60
- onFocusableItemRemove: c.useCallback(
61
- () => x((n) => n - 1),
62
- []
63
- ),
64
- children: /* @__PURE__ */ d(
65
- N.div,
66
- {
67
- tabIndex: i || U === 0 ? -1 : 0,
68
- "data-orientation": t,
69
- ...F,
70
- ref: R,
71
- style: { outline: "none", ...e.style },
72
- onMouseDown: p(e.onMouseDown, () => {
73
- _.current = !0;
74
- }),
75
- onFocus: p(e.onFocus, (n) => {
76
- const B = !_.current;
77
- if (n.target === n.currentTarget && B && !i) {
78
- const G = new CustomEvent(D, $);
79
- if (n.currentTarget.dispatchEvent(G), !G.defaultPrevented) {
80
- const y = l().filter((f) => f.focusable), Y = y.find((f) => f.active), H = y.find((f) => f.id === T), V = [Y, H, ...y].filter(
81
- Boolean
82
- ).map((f) => f.ref.current);
83
- L(V, u);
84
- }
85
- }
86
- _.current = !1;
87
- }),
88
- onBlur: p(e.onBlur, () => A(!1))
89
- }
90
- )
91
- }
92
- );
93
- }), M = "RovingFocusGroupItem", k = c.forwardRef(
94
- (e, o) => {
95
- const {
96
- __scopeRovingFocusGroup: s,
97
- focusable: t = !0,
98
- active: w = !1,
99
- tabStopId: C,
100
- children: v,
101
- ...S
102
- } = e, h = Q(), m = C || h, u = re(M, s), F = u.currentTabStopId === m, g = O(s), { onFocusableItemAdd: R, onFocusableItemRemove: E, currentTabStopId: T } = u;
103
- return c.useEffect(() => {
104
- if (t)
105
- return R(), () => E();
106
- }, [t, R, E]), /* @__PURE__ */ d(
107
- P.ItemSlot,
108
- {
109
- scope: s,
110
- id: m,
111
- focusable: t,
112
- active: w,
113
- children: /* @__PURE__ */ d(
114
- N.span,
115
- {
116
- tabIndex: F ? 0 : -1,
117
- "data-orientation": u.orientation,
118
- ...S,
119
- ref: o,
120
- onMouseDown: p(e.onMouseDown, (r) => {
121
- t ? u.onItemFocus(m) : r.preventDefault();
122
- }),
123
- onFocus: p(e.onFocus, () => u.onItemFocus(m)),
124
- onKeyDown: p(e.onKeyDown, (r) => {
125
- if (r.key === "Tab" && r.shiftKey) {
126
- u.onItemShiftTab();
127
- return;
128
- }
129
- if (r.target !== r.currentTarget) return;
130
- const i = ue(r, u.orientation, u.dir);
131
- if (i !== void 0) {
132
- if (r.metaKey || r.ctrlKey || r.altKey || r.shiftKey) return;
133
- r.preventDefault();
134
- let a = g().filter((l) => l.focusable).map((l) => l.ref.current);
135
- if (i === "last") a.reverse();
136
- else if (i === "prev" || i === "next") {
137
- i === "prev" && a.reverse();
138
- const l = a.indexOf(r.currentTarget);
139
- a = u.loop ? ae(a, l + 1) : a.slice(l + 1);
140
- }
141
- setTimeout(() => L(a));
142
- }
143
- }),
144
- children: typeof v == "function" ? v({ isCurrentTabStop: F, hasTabStop: T != null }) : v
145
- }
146
- )
147
- }
148
- );
149
- }
150
- );
151
- k.displayName = M;
152
- var ce = {
153
- ArrowLeft: "prev",
154
- ArrowUp: "prev",
155
- ArrowRight: "next",
156
- ArrowDown: "next",
157
- PageUp: "first",
158
- Home: "first",
159
- PageDown: "last",
160
- End: "last"
161
- };
162
- function se(e, o) {
163
- return o !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
164
- }
165
- I(se, "getDirectionAwareKey");
166
- function ue(e, o, s) {
167
- const t = se(e.key, s);
168
- if (!(o === "vertical" && ["ArrowLeft", "ArrowRight"].includes(t)) && !(o === "horizontal" && ["ArrowUp", "ArrowDown"].includes(t)))
169
- return ce[t];
170
- }
171
- I(ue, "getFocusIntent");
172
- function L(e, o = !1) {
173
- const s = document.activeElement;
174
- for (const t of e)
175
- if (t === s || (t.focus({ preventScroll: o }), document.activeElement !== s)) return;
176
- }
177
- I(L, "focusFirst");
178
- function ae(e, o) {
179
- return e.map((s, t) => e[(o + t) % e.length]);
180
- }
181
- I(ae, "wrapArray");
182
- var Te = K, we = k;
183
- export {
184
- we as Item,
185
- Te as Root,
186
- K as RovingFocusGroup,
187
- k as RovingFocusGroupItem,
188
- Ee as createRovingFocusGroupScope
189
- };
@@ -1,27 +0,0 @@
1
- var v = Object.defineProperty;
2
- var i = (r, o) => v(r, "name", { value: o, configurable: !0 });
3
- import * as m from "react";
4
- import { Primitive as d } from "../../react-primitive/dist/index.js";
5
- import { jsx as l } from "react/jsx-runtime";
6
- var f = "Separator", n = "horizontal", O = ["horizontal", "vertical"], e = m.forwardRef((r, o) => {
7
- const { decorative: s, orientation: a = n, ...c } = r, t = N(a) ? a : n, p = s ? { role: "none" } : { "aria-orientation": t === "vertical" ? t : void 0, role: "separator" };
8
- return /* @__PURE__ */ l(
9
- d.div,
10
- {
11
- "data-orientation": t,
12
- ...p,
13
- ...c,
14
- ref: o
15
- }
16
- );
17
- });
18
- e.displayName = f;
19
- function N(r) {
20
- return O.includes(r);
21
- }
22
- i(N, "isValidOrientation");
23
- var E = e;
24
- export {
25
- E as Root,
26
- e as Separator
27
- };
@@ -1,67 +0,0 @@
1
- var S = Object.defineProperty;
2
- var a = (e, t) => S(e, "name", { value: t, configurable: !0 });
3
- import * as l from "react";
4
- import { composeRefs as g } from "../../react-compose-refs/dist/index.js";
5
- import { jsx as u, Fragment as E } from "react/jsx-runtime";
6
- // @__NO_SIDE_EFFECTS__
7
- function C(e) {
8
- const t = /* @__PURE__ */ R(e), o = l.forwardRef((n, r) => {
9
- const { children: i, ...c } = n, s = l.Children.toArray(i), f = s.find(b);
10
- if (f) {
11
- const p = f.props.children, y = s.map((d) => d === f ? l.Children.count(p) > 1 ? l.Children.only(null) : l.isValidElement(p) ? p.props.children : null : d);
12
- return /* @__PURE__ */ u(t, { ...c, ref: r, children: l.isValidElement(p) ? l.cloneElement(p, void 0, y) : null });
13
- }
14
- return /* @__PURE__ */ u(t, { ...c, ref: r, children: i });
15
- });
16
- return o.displayName = `${e}.Slot`, o;
17
- }
18
- a(C, "createSlot");
19
- var N = /* @__PURE__ */ C("Slot");
20
- // @__NO_SIDE_EFFECTS__
21
- function R(e) {
22
- const t = l.forwardRef((o, n) => {
23
- const { children: r, ...i } = o;
24
- if (l.isValidElement(r)) {
25
- const c = _(r), s = h(i, r.props);
26
- return r.type !== l.Fragment && (s.ref = n ? g(n, c) : c), l.cloneElement(r, s);
27
- }
28
- return l.Children.count(r) > 1 ? l.Children.only(null) : null;
29
- });
30
- return t.displayName = `${e}.SlotClone`, t;
31
- }
32
- a(R, "createSlotClone");
33
- var m = Symbol("radix.slottable");
34
- // @__NO_SIDE_EFFECTS__
35
- function O(e) {
36
- const t = /* @__PURE__ */ a(({ children: o }) => /* @__PURE__ */ u(E, { children: o }), "Slottable2");
37
- return t.displayName = `${e}.Slottable`, t.__radixId = m, t;
38
- }
39
- a(O, "createSlottable");
40
- function b(e) {
41
- return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === m;
42
- }
43
- a(b, "isSlottable");
44
- function h(e, t) {
45
- const o = { ...t };
46
- for (const n in t) {
47
- const r = e[n], i = t[n];
48
- /^on[A-Z]/.test(n) ? r && i ? o[n] = (...s) => {
49
- const f = i(...s);
50
- return r(...s), f;
51
- } : r && (o[n] = r) : n === "style" ? o[n] = { ...r, ...i } : n === "className" && (o[n] = [r, i].filter(Boolean).join(" "));
52
- }
53
- return { ...e, ...o };
54
- }
55
- a(h, "mergeProps");
56
- function _(e) {
57
- var n, r;
58
- let t = (n = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : n.get, o = t && "isReactWarning" in t && t.isReactWarning;
59
- return o ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, o = t && "isReactWarning" in t && t.isReactWarning, o ? e.props.ref : e.props.ref || e.ref);
60
- }
61
- a(_, "getElementRef");
62
- export {
63
- N as Root,
64
- N as Slot,
65
- C as createSlot,
66
- O as createSlottable
67
- };
@@ -1,136 +0,0 @@
1
- var I = Object.defineProperty;
2
- var P = (e, o) => I(e, "name", { value: o, configurable: !0 });
3
- import * as c from "react";
4
- import { composeEventHandlers as M } from "../../primitive/dist/index.js";
5
- import { useComposedRefs as y } from "../../react-compose-refs/dist/index.js";
6
- import { createContextScope as H } from "../../react-context/dist/index.js";
7
- import { useControllableState as j } from "../../react-use-controllable-state/dist/index.js";
8
- import { usePrevious as A } from "../../react-use-previous/dist/index.js";
9
- import { useSize as U } from "../../react-use-size/dist/index.js";
10
- import { Primitive as R } from "../../react-primitive/dist/index.js";
11
- import { jsxs as q, jsx as m } from "react/jsx-runtime";
12
- var h = "Switch", [z, Z] = H(h), [L, O] = z(h), E = c.forwardRef(
13
- (e, o) => {
14
- const {
15
- __scopeSwitch: t,
16
- name: n,
17
- checked: r,
18
- defaultChecked: S,
19
- required: i,
20
- disabled: s,
21
- value: p = "on",
22
- onCheckedChange: w,
23
- form: a,
24
- ...v
25
- } = e, [d, u] = c.useState(null), b = y(o, (f) => u(f)), C = c.useRef(!1), k = d ? a || !!d.closest("form") : !0, [l, N] = j({
26
- prop: r,
27
- defaultProp: S ?? !1,
28
- onChange: w,
29
- caller: h
30
- });
31
- return /* @__PURE__ */ q(L, { scope: t, checked: l, disabled: s, children: [
32
- /* @__PURE__ */ m(
33
- R.button,
34
- {
35
- type: "button",
36
- role: "switch",
37
- "aria-checked": l,
38
- "aria-required": i,
39
- "data-state": B(l),
40
- "data-disabled": s ? "" : void 0,
41
- disabled: s,
42
- value: p,
43
- ...v,
44
- ref: b,
45
- onClick: M(e.onClick, (f) => {
46
- N((T) => !T), k && (C.current = f.isPropagationStopped(), C.current || f.stopPropagation());
47
- })
48
- }
49
- ),
50
- k && /* @__PURE__ */ m(
51
- g,
52
- {
53
- control: d,
54
- bubbles: !C.current,
55
- name: n,
56
- value: p,
57
- checked: l,
58
- required: i,
59
- disabled: s,
60
- form: a,
61
- style: { transform: "translateX(-100%)" }
62
- }
63
- )
64
- ] });
65
- }
66
- );
67
- E.displayName = h;
68
- var _ = "SwitchThumb", x = c.forwardRef(
69
- (e, o) => {
70
- const { __scopeSwitch: t, ...n } = e, r = O(_, t);
71
- return /* @__PURE__ */ m(
72
- R.span,
73
- {
74
- "data-state": B(r.checked),
75
- "data-disabled": r.disabled ? "" : void 0,
76
- ...n,
77
- ref: o
78
- }
79
- );
80
- }
81
- );
82
- x.displayName = _;
83
- var D = "SwitchBubbleInput", g = c.forwardRef(
84
- ({
85
- __scopeSwitch: e,
86
- control: o,
87
- checked: t,
88
- bubbles: n = !0,
89
- ...r
90
- }, S) => {
91
- const i = c.useRef(null), s = y(i, S), p = A(t), w = U(o);
92
- return c.useEffect(() => {
93
- const a = i.current;
94
- if (!a) return;
95
- const v = window.HTMLInputElement.prototype, u = Object.getOwnPropertyDescriptor(
96
- v,
97
- "checked"
98
- ).set;
99
- if (p !== t && u) {
100
- const b = new Event("click", { bubbles: n });
101
- u.call(a, t), a.dispatchEvent(b);
102
- }
103
- }, [p, t, n]), /* @__PURE__ */ m(
104
- "input",
105
- {
106
- type: "checkbox",
107
- "aria-hidden": !0,
108
- defaultChecked: t,
109
- ...r,
110
- tabIndex: -1,
111
- ref: s,
112
- style: {
113
- ...r.style,
114
- ...w,
115
- position: "absolute",
116
- pointerEvents: "none",
117
- opacity: 0,
118
- margin: 0
119
- }
120
- }
121
- );
122
- }
123
- );
124
- g.displayName = D;
125
- function B(e) {
126
- return e ? "checked" : "unchecked";
127
- }
128
- P(B, "getState");
129
- var $ = E, ee = x;
130
- export {
131
- $ as Root,
132
- E as Switch,
133
- x as SwitchThumb,
134
- ee as Thumb,
135
- Z as createSwitchScope
136
- };
@@ -1,168 +0,0 @@
1
- var E = Object.defineProperty;
2
- var b = (e, a) => E(e, "name", { value: a, configurable: !0 });
3
- import * as v from "react";
4
- import { composeEventHandlers as T } from "../../primitive/dist/index.js";
5
- import { createContextScope as F } from "../../react-context/dist/index.js";
6
- import { createRovingFocusGroupScope as h, Root as w, Item as D } from "../../react-roving-focus/dist/index.js";
7
- import { Presence as V } from "../../react-presence/dist/index.js";
8
- import { Primitive as p } from "../../react-primitive/dist/index.js";
9
- import { useDirection as G } from "../../react-direction/dist/index.js";
10
- import { useControllableState as L } from "../../react-use-controllable-state/dist/index.js";
11
- import { useId as $ } from "../../react-id/dist/index.js";
12
- import { jsx as l } from "react/jsx-runtime";
13
- var g = "Tabs", [k, X] = F(g, [
14
- h
15
- ]), I = h(), [K, C] = k(g), R = v.forwardRef(
16
- (e, a) => {
17
- const {
18
- __scopeTabs: s,
19
- value: t,
20
- onValueChange: n,
21
- defaultValue: c,
22
- orientation: o = "horizontal",
23
- dir: d,
24
- activationMode: f = "automatic",
25
- ...m
26
- } = e, i = G(d), [r, u] = L({
27
- prop: t,
28
- onChange: n,
29
- defaultProp: c ?? "",
30
- caller: g
31
- });
32
- return /* @__PURE__ */ l(
33
- K,
34
- {
35
- scope: s,
36
- baseId: $(),
37
- value: r,
38
- onValueChange: u,
39
- orientation: o,
40
- dir: i,
41
- activationMode: f,
42
- children: /* @__PURE__ */ l(
43
- p.div,
44
- {
45
- dir: i,
46
- "data-orientation": o,
47
- ...m,
48
- ref: a
49
- }
50
- )
51
- }
52
- );
53
- }
54
- );
55
- R.displayName = g;
56
- var _ = "TabsList", y = v.forwardRef(
57
- (e, a) => {
58
- const { __scopeTabs: s, loop: t = !0, ...n } = e, c = C(_, s), o = I(s);
59
- return /* @__PURE__ */ l(
60
- w,
61
- {
62
- asChild: !0,
63
- ...o,
64
- orientation: c.orientation,
65
- dir: c.dir,
66
- loop: t,
67
- children: /* @__PURE__ */ l(
68
- p.div,
69
- {
70
- role: "tablist",
71
- "aria-orientation": c.orientation,
72
- ...n,
73
- ref: a
74
- }
75
- )
76
- }
77
- );
78
- }
79
- );
80
- y.displayName = _;
81
- var A = "TabsTrigger", S = v.forwardRef(
82
- (e, a) => {
83
- const { __scopeTabs: s, value: t, disabled: n = !1, ...c } = e, o = C(A, s), d = I(s), f = P(o.baseId, t), m = x(o.baseId, t), i = t === o.value;
84
- return /* @__PURE__ */ l(
85
- D,
86
- {
87
- asChild: !0,
88
- ...d,
89
- focusable: !n,
90
- active: i,
91
- children: /* @__PURE__ */ l(
92
- p.button,
93
- {
94
- type: "button",
95
- role: "tab",
96
- "aria-selected": i,
97
- "aria-controls": m,
98
- "data-state": i ? "active" : "inactive",
99
- "data-disabled": n ? "" : void 0,
100
- disabled: n,
101
- id: f,
102
- ...c,
103
- ref: a,
104
- onMouseDown: T(e.onMouseDown, (r) => {
105
- !n && r.button === 0 && r.ctrlKey === !1 ? o.onValueChange(t) : r.preventDefault();
106
- }),
107
- onKeyDown: T(e.onKeyDown, (r) => {
108
- [" ", "Enter"].includes(r.key) && o.onValueChange(t);
109
- }),
110
- onFocus: T(e.onFocus, () => {
111
- const r = o.activationMode !== "manual";
112
- !i && !n && r && o.onValueChange(t);
113
- })
114
- }
115
- )
116
- }
117
- );
118
- }
119
- );
120
- S.displayName = A;
121
- var M = "TabsContent", N = v.forwardRef(
122
- (e, a) => {
123
- const { __scopeTabs: s, value: t, forceMount: n, children: c, ...o } = e, d = C(M, s), f = P(d.baseId, t), m = x(d.baseId, t), i = t === d.value, r = v.useRef(i);
124
- return v.useEffect(() => {
125
- const u = requestAnimationFrame(() => r.current = !1);
126
- return () => cancelAnimationFrame(u);
127
- }, []), /* @__PURE__ */ l(V, { present: n || i, children: /* @__PURE__ */ b(({ present: u }) => /* @__PURE__ */ l(
128
- p.div,
129
- {
130
- "data-state": i ? "active" : "inactive",
131
- "data-orientation": d.orientation,
132
- role: "tabpanel",
133
- "aria-labelledby": f,
134
- hidden: !u,
135
- id: m,
136
- tabIndex: 0,
137
- ...o,
138
- ref: a,
139
- style: {
140
- ...e.style,
141
- animationDuration: r.current ? "0s" : void 0
142
- },
143
- children: u && c
144
- }
145
- ), "children") });
146
- }
147
- );
148
- N.displayName = M;
149
- function P(e, a) {
150
- return `${e}-trigger-${a}`;
151
- }
152
- b(P, "makeTriggerId");
153
- function x(e, a) {
154
- return `${e}-content-${a}`;
155
- }
156
- b(x, "makeContentId");
157
- var Y = R, Z = y, ee = S, te = N;
158
- export {
159
- te as Content,
160
- Z as List,
161
- Y as Root,
162
- R as Tabs,
163
- N as TabsContent,
164
- y as TabsList,
165
- S as TabsTrigger,
166
- ee as Trigger,
167
- X as createTabsScope
168
- };