@konstructio/ui 0.0.12-alpha.0 → 0.0.12-alpha.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.
- package/dist/{Combination-Cmu9JRkv.js → Combination-BQYb0Gw7.js} +72 -72
- package/dist/{Modal-L73dmnHv.js → Modal-W2GbkC_F.js} +238 -246
- package/dist/{chevron-up-CvquEaNg.js → chevron-up-DgLBQCKD.js} +1 -1
- package/dist/components/AlertDialog/AlertDialog.js +20 -23
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +3 -6
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Autocomplete/Autocomplete.js +15 -17
- package/dist/components/Autocomplete/components/List/List.js +7 -7
- package/dist/components/Breadcrumb/Breadcrumb.js +68 -69
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +16 -17
- package/dist/components/Breadcrumb/components/Item/Item.js +61 -0
- package/dist/components/Breadcrumb/components/Item/Item.variants.js +90 -0
- package/dist/components/Breadcrumb/components/index.js +4 -0
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +2 -3
- package/dist/components/Button/Button.js +14 -16
- package/dist/components/Card/Card.js +10 -12
- package/dist/components/Checkbox/Checkbox.js +13 -15
- package/dist/components/Dropdown/Dropdown.js +4 -6
- package/dist/components/Dropdown/components/List/List.js +9 -10
- package/dist/components/Dropdown/components/ListItem/ListItem.js +20 -21
- package/dist/components/Dropdown/components/Wrapper.js +31 -34
- package/dist/components/Dropdown/contexts/dropdown.provider.js +4 -4
- package/dist/components/Dropdown/hooks/useDropdown.js +12 -14
- package/dist/components/Dropdown/hooks/useNavigationList.js +8 -10
- package/dist/components/Input/Input.js +12 -14
- package/dist/components/Modal/Modal.js +3 -3
- package/dist/components/Modal/components/Wrapper/Wrapper.js +7 -9
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/Modal/contexts/Modal.provider.js +4 -4
- package/dist/components/NumberInput/NumberInput.js +9 -11
- package/dist/components/ProgressBar/ProgressBar.js +13 -16
- package/dist/components/Radio/Radio.js +55 -37
- package/dist/components/Radio/Radio.variants.js +69 -16
- package/dist/components/RadioCard/RadioCard.js +41 -0
- package/dist/components/RadioCard/RadioCard.variants.js +19 -0
- package/dist/components/RadioCardGroup/RadioCardGroup.js +47 -0
- package/dist/components/RadioCardGroup/RadioCardGroup.variants.js +21 -0
- package/dist/components/RadioGroup/RadioGroup.js +37 -27
- package/dist/components/RadioGroup/RadioGroup.variants.js +21 -0
- package/dist/components/Range/Range.js +20 -22
- package/dist/components/Sidebar/Sidebar.js +20 -22
- package/dist/components/Sidebar/components/Footer/Footer.js +9 -12
- package/dist/components/Sidebar/components/Logo/Logo.js +9 -12
- package/dist/components/Sidebar/components/Navigation/Navigation.js +12 -15
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.js +12 -15
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +17 -20
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.js +8 -11
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.js +10 -13
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +29 -27
- package/dist/components/Slider/Slider.js +18 -20
- package/dist/components/Switch/Switch.js +19 -21
- package/dist/components/TagSelect/TagSelect.js +19 -21
- package/dist/components/TextArea/TextArea.js +17 -19
- package/dist/components/Toast/Toast.js +52 -54
- package/dist/components/Tooltip/Tooltip.js +10 -12
- package/dist/components/index.js +50 -44
- package/dist/contexts/theme.provider.js +84 -14
- package/dist/{index-BaNV0qac.js → index-1GLoikpT.js} +6555 -6585
- package/dist/{AlertDialogTrigger-D4Tm_9M0.js → index-BVppSRDQ.js} +19 -21
- package/dist/{index-D68N8v8R.js → index-C5psggHV.js} +17 -17
- package/dist/{index-z-AJyzdv.js → index-CJsYodgi.js} +10 -10
- package/dist/{index-BedjZUuB.js → index-CoqDsznq.js} +1 -1
- package/dist/{index-BtibbG81.js → index-KEdwcThH.js} +1 -1
- package/dist/index.d.ts +522 -4
- package/dist/index.js +59 -53
- package/dist/package.json +1 -1
- package/dist/plugins/konstruct.js +3 -3
- package/dist/styles.css +1 -1
- package/dist/styles.js +1 -1
- package/dist/useBreadcrumb-CojbXFVD.js +1279 -0
- package/dist/{x-CRBgmX1Q.js → x-DU-Zw-L_.js} +1 -1
- package/package.json +1 -1
- package/dist/components/AlertDialog/AlertDialog.d.ts +0 -3
- package/dist/components/AlertDialog/AlertDialog.types.d.ts +0 -18
- package/dist/components/AlertDialog/AlertDialog.types.js +0 -1
- package/dist/components/AlertDialog/AlertDialog.variants.d.ts +0 -3
- package/dist/components/AlertDialog/components/AlertDialogTrigger.d.ts +0 -3
- package/dist/components/AlertDialog/components/AlertDialogTrigger.types.d.ts +0 -6
- package/dist/components/AlertDialog/components/AlertDialogTrigger.types.js +0 -1
- package/dist/components/AlertDialog/components/index.d.ts +0 -1
- package/dist/components/AlertDialog/hooks/index.d.ts +0 -1
- package/dist/components/AlertDialog/hooks/useAlertDialog.d.ts +0 -7
- package/dist/components/Autocomplete/Autocomplete.d.ts +0 -3
- package/dist/components/Autocomplete/Autocomplete.types.d.ts +0 -18
- package/dist/components/Autocomplete/Autocomplete.types.js +0 -1
- package/dist/components/Autocomplete/Autocomplete.variants.d.ts +0 -8
- package/dist/components/Autocomplete/components/List/List.d.ts +0 -3
- package/dist/components/Autocomplete/components/List/List.types.d.ts +0 -13
- package/dist/components/Autocomplete/components/List/List.types.js +0 -1
- package/dist/components/Autocomplete/components/List/List.variants.d.ts +0 -16
- package/dist/components/Autocomplete/components/index.d.ts +0 -1
- package/dist/components/Autocomplete/hooks/index.d.ts +0 -2
- package/dist/components/Autocomplete/hooks/useAutocomplete.d.ts +0 -17
- package/dist/components/Autocomplete/hooks/useNavigationList.d.ts +0 -10
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +0 -3
- package/dist/components/Breadcrumb/Breadcrumb.types.d.ts +0 -11
- package/dist/components/Breadcrumb/Breadcrumb.types.js +0 -1
- package/dist/components/Breadcrumb/Breadcrumb.variants.d.ts +0 -12
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.d.ts +0 -3
- package/dist/components/Button/Button.d.ts +0 -4
- package/dist/components/Button/Button.types.d.ts +0 -7
- package/dist/components/Button/Button.types.js +0 -1
- package/dist/components/Button/Button.variants.d.ts +0 -7
- package/dist/components/Card/Card.d.ts +0 -4
- package/dist/components/Card/Card.types.d.ts +0 -8
- package/dist/components/Card/Card.types.js +0 -1
- package/dist/components/Card/Card.variants.d.ts +0 -10
- package/dist/components/Checkbox/Checkbox.d.ts +0 -3
- package/dist/components/Checkbox/Checkbox.types.d.ts +0 -14
- package/dist/components/Checkbox/Checkbox.types.js +0 -1
- package/dist/components/Checkbox/Checkbox.variants.d.ts +0 -9
- package/dist/components/Dropdown/Dropdown.d.ts +0 -3
- package/dist/components/Dropdown/Dropdown.types.d.ts +0 -16
- package/dist/components/Dropdown/Dropdown.types.js +0 -1
- package/dist/components/Dropdown/Dropdown.variants.d.ts +0 -3
- package/dist/components/Dropdown/components/EmptyList.d.ts +0 -2
- package/dist/components/Dropdown/components/List/List.d.ts +0 -3
- package/dist/components/Dropdown/components/List/List.types.d.ts +0 -6
- package/dist/components/Dropdown/components/List/List.types.js +0 -1
- package/dist/components/Dropdown/components/List/List.variants.d.ts +0 -3
- package/dist/components/Dropdown/components/ListItem/ListItem.d.ts +0 -3
- package/dist/components/Dropdown/components/ListItem/ListItem.types.d.ts +0 -4
- package/dist/components/Dropdown/components/ListItem/ListItem.types.js +0 -1
- package/dist/components/Dropdown/components/ListItem/ListItem.variants.d.ts +0 -3
- package/dist/components/Dropdown/components/Wrapper.d.ts +0 -3
- package/dist/components/Dropdown/components/index.d.ts +0 -3
- package/dist/components/Dropdown/contexts/dropdown.context.d.ts +0 -8
- package/dist/components/Dropdown/contexts/dropdown.hook.d.ts +0 -2
- package/dist/components/Dropdown/contexts/dropdown.provider.d.ts +0 -5
- package/dist/components/Dropdown/contexts/index.d.ts +0 -2
- package/dist/components/Dropdown/hooks/useDropdown.d.ts +0 -11
- package/dist/components/Dropdown/hooks/useNavigationList.d.ts +0 -8
- package/dist/components/Input/Input.d.ts +0 -3
- package/dist/components/Input/Input.types.d.ts +0 -9
- package/dist/components/Input/Input.types.js +0 -1
- package/dist/components/Input/Input.variants.d.ts +0 -4
- package/dist/components/Modal/Modal.d.ts +0 -8
- package/dist/components/Modal/Modal.types.d.ts +0 -12
- package/dist/components/Modal/Modal.types.js +0 -1
- package/dist/components/Modal/components/Body/Body.d.ts +0 -3
- package/dist/components/Modal/components/Body/Body.types.d.ts +0 -5
- package/dist/components/Modal/components/Body/Body.types.js +0 -1
- package/dist/components/Modal/components/Footer/Footer.d.ts +0 -3
- package/dist/components/Modal/components/Footer/Footer.types.d.ts +0 -5
- package/dist/components/Modal/components/Footer/Footer.types.js +0 -1
- package/dist/components/Modal/components/Header/Header.d.ts +0 -3
- package/dist/components/Modal/components/Header/Header.types.d.ts +0 -5
- package/dist/components/Modal/components/Header/Header.types.js +0 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.d.ts +0 -3
- package/dist/components/Modal/components/Wrapper/Wrapper.types.d.ts +0 -7
- package/dist/components/Modal/components/Wrapper/Wrapper.types.js +0 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.variants.d.ts +0 -6
- package/dist/components/Modal/components/index.d.ts +0 -4
- package/dist/components/Modal/contexts/Modal.context.d.ts +0 -2
- package/dist/components/Modal/contexts/Modal.provider.d.ts +0 -4
- package/dist/components/Modal/contexts/Modal.types.d.ts +0 -9
- package/dist/components/Modal/contexts/Modal.types.js +0 -1
- package/dist/components/Modal/contexts/index.d.ts +0 -1
- package/dist/components/Modal/hooks/index.d.ts +0 -1
- package/dist/components/Modal/hooks/useModal.d.ts +0 -9
- package/dist/components/NumberInput/NumberInput.d.ts +0 -3
- package/dist/components/NumberInput/NumberInput.types.d.ts +0 -11
- package/dist/components/NumberInput/NumberInput.types.js +0 -1
- package/dist/components/NumberInput/NumberInput.variants.d.ts +0 -11
- package/dist/components/ProgressBar/ProgressBar.d.ts +0 -3
- package/dist/components/ProgressBar/ProgressBar.types.d.ts +0 -8
- package/dist/components/ProgressBar/ProgressBar.types.js +0 -1
- package/dist/components/ProgressBar/ProgressBar.variants.d.ts +0 -7
- package/dist/components/Radio/Radio.d.ts +0 -3
- package/dist/components/Radio/Radio.types.d.ts +0 -12
- package/dist/components/Radio/Radio.types.js +0 -1
- package/dist/components/Radio/Radio.variants.d.ts +0 -3
- package/dist/components/RadioGroup/RadioGroup.d.ts +0 -3
- package/dist/components/RadioGroup/RadioGroup.types.d.ts +0 -12
- package/dist/components/RadioGroup/RadioGroup.types.js +0 -1
- package/dist/components/Range/Range.d.ts +0 -3
- package/dist/components/Range/Range.types.d.ts +0 -13
- package/dist/components/Range/Range.types.js +0 -1
- package/dist/components/Range/Range.variants.d.ts +0 -14
- package/dist/components/Sidebar/Sidebar.d.ts +0 -5
- package/dist/components/Sidebar/Sidebar.types.d.ts +0 -18
- package/dist/components/Sidebar/Sidebar.types.js +0 -1
- package/dist/components/Sidebar/Sidebar.variants.d.ts +0 -6
- package/dist/components/Sidebar/components/Footer/Footer.d.ts +0 -3
- package/dist/components/Sidebar/components/Footer/Footer.types.d.ts +0 -6
- package/dist/components/Sidebar/components/Footer/Footer.types.js +0 -1
- package/dist/components/Sidebar/components/Footer/Footer.variants.d.ts +0 -3
- package/dist/components/Sidebar/components/Logo/Logo.d.ts +0 -3
- package/dist/components/Sidebar/components/Logo/Logo.types.d.ts +0 -6
- package/dist/components/Sidebar/components/Logo/Logo.types.js +0 -1
- package/dist/components/Sidebar/components/Logo/Logo.variants.d.ts +0 -3
- package/dist/components/Sidebar/components/Navigation/Navigation.d.ts +0 -4
- package/dist/components/Sidebar/components/Navigation/Navigation.types.d.ts +0 -16
- package/dist/components/Sidebar/components/Navigation/Navigation.types.js +0 -1
- package/dist/components/Sidebar/components/Navigation/Navigation.variants.d.ts +0 -3
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.d.ts +0 -3
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.types.d.ts +0 -8
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.types.js +0 -1
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.variants.d.ts +0 -3
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.d.ts +0 -3
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.types.d.ts +0 -17
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.types.js +0 -1
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.d.ts +0 -4
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.d.ts +0 -3
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.types.d.ts +0 -5
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.types.js +0 -1
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.variants.d.ts +0 -3
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.d.ts +0 -3
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.types.d.ts +0 -8
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.types.js +0 -1
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.variants.d.ts +0 -3
- package/dist/components/Sidebar/components/Wrapper/Wrapper.d.ts +0 -3
- package/dist/components/Sidebar/components/index.d.ts +0 -15
- package/dist/components/Slider/Slider.d.ts +0 -3
- package/dist/components/Slider/Slider.types.d.ts +0 -13
- package/dist/components/Slider/Slider.types.js +0 -1
- package/dist/components/Slider/Slider.variants.d.ts +0 -11
- package/dist/components/Switch/Switch.d.ts +0 -3
- package/dist/components/Switch/Switch.types.d.ts +0 -10
- package/dist/components/Switch/Switch.types.js +0 -1
- package/dist/components/Switch/Switch.variants.d.ts +0 -6
- package/dist/components/Tag/Tag.d.ts +0 -3
- package/dist/components/Tag/Tag.types.d.ts +0 -4
- package/dist/components/Tag/Tag.types.js +0 -1
- package/dist/components/Tag/Tag.variants.d.ts +0 -3
- package/dist/components/TagSelect/TagSelect.d.ts +0 -3
- package/dist/components/TagSelect/TagSelect.types.d.ts +0 -9
- package/dist/components/TagSelect/TagSelect.types.js +0 -1
- package/dist/components/TagSelect/TagSelect.variants.d.ts +0 -9
- package/dist/components/TagSelect/hooks/useTagSelect.d.ts +0 -9
- package/dist/components/TextArea/TextArea.d.ts +0 -3
- package/dist/components/TextArea/TextArea.types.d.ts +0 -10
- package/dist/components/TextArea/TextArea.types.js +0 -1
- package/dist/components/TextArea/TextArea.variants.d.ts +0 -3
- package/dist/components/Toast/Toast.d.ts +0 -3
- package/dist/components/Toast/Toast.types.d.ts +0 -12
- package/dist/components/Toast/Toast.types.js +0 -1
- package/dist/components/Toast/Toast.variants.d.ts +0 -9
- package/dist/components/Tooltip/Tooltip.d.ts +0 -3
- package/dist/components/Tooltip/Tooltip.types.d.ts +0 -8
- package/dist/components/Tooltip/Tooltip.types.js +0 -1
- package/dist/components/Tooltip/Tooltip.variants.d.ts +0 -8
- package/dist/components/Tooltip/hooks/useTooltip.d.ts +0 -4
- package/dist/components/index.d.ts +0 -21
- package/dist/contexts/index.d.ts +0 -3
- package/dist/contexts/theme.context.d.ts +0 -6
- package/dist/contexts/theme.hook.d.ts +0 -7
- package/dist/contexts/theme.provider.d.ts +0 -6
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/useToggle.d.ts +0 -1
- package/dist/js.cookie-OLEfuq_g.js +0 -74
- package/dist/plugins/index.d.ts +0 -1
- package/dist/plugins/konstruct.d.ts +0 -4
- package/dist/plugins/utils/colors.d.ts +0 -328
- package/dist/styles.d.ts +0 -0
- package/dist/useBreadcrumb-DxYsZvj_.js +0 -1398
- package/dist/utils/index.d.ts +0 -4
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
import { jsxs as P, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
2
|
+
import * as p from "react";
|
|
3
3
|
import { forwardRef as _, useState as H, useRef as A, useId as M, useImperativeHandle as $, useEffect as j, useCallback as z } from "react";
|
|
4
4
|
import { c as B, a as q, d as F } from "../../index-8vgf-x5i.js";
|
|
5
5
|
import { u as O } from "../../index-DoOsnuB6.js";
|
|
6
6
|
import { u as V, a as D } from "../../index-BxeV34ij.js";
|
|
7
|
-
import { P as g } from "../../index-
|
|
8
|
-
import "../../contexts/theme.context.js";
|
|
9
|
-
import { useTheme as L } from "../../contexts/theme.hook.js";
|
|
10
|
-
import "../../js.cookie-OLEfuq_g.js";
|
|
7
|
+
import { P as g } from "../../index-1GLoikpT.js";
|
|
11
8
|
import { cn as x } from "../../utils/index.js";
|
|
12
|
-
import { switchVariants as
|
|
13
|
-
|
|
9
|
+
import { switchVariants as L, thumbVariants as U } from "./Switch.variants.js";
|
|
10
|
+
import { useTheme as W } from "../../contexts/theme.hook.js";
|
|
11
|
+
var k = "Switch", [X, ie] = B(k), [G, J] = X(k), R = p.forwardRef(
|
|
14
12
|
(e, s) => {
|
|
15
13
|
const {
|
|
16
14
|
__scopeSwitch: t,
|
|
17
15
|
name: c,
|
|
18
16
|
checked: n,
|
|
19
|
-
defaultChecked:
|
|
17
|
+
defaultChecked: h,
|
|
20
18
|
required: o,
|
|
21
19
|
disabled: a,
|
|
22
20
|
value: i = "on",
|
|
23
21
|
onCheckedChange: m,
|
|
24
22
|
form: r,
|
|
25
23
|
...d
|
|
26
|
-
} = e, [l, b] =
|
|
24
|
+
} = e, [l, b] = p.useState(null), v = O(s, (C) => b(C)), f = p.useRef(!1), w = l ? r || !!l.closest("form") : !0, [S = !1, T] = q({
|
|
27
25
|
prop: n,
|
|
28
|
-
defaultProp:
|
|
26
|
+
defaultProp: h,
|
|
29
27
|
onChange: m
|
|
30
28
|
});
|
|
31
29
|
return /* @__PURE__ */ P(G, { scope: t, checked: S, disabled: a, children: [
|
|
@@ -65,7 +63,7 @@ var k = "Switch", [X, de] = B(k), [G, J] = X(k), R = h.forwardRef(
|
|
|
65
63
|
}
|
|
66
64
|
);
|
|
67
65
|
R.displayName = k;
|
|
68
|
-
var y = "SwitchThumb", N =
|
|
66
|
+
var y = "SwitchThumb", N = p.forwardRef(
|
|
69
67
|
(e, s) => {
|
|
70
68
|
const { __scopeSwitch: t, ...c } = e, n = J(y, t);
|
|
71
69
|
return /* @__PURE__ */ u(
|
|
@@ -81,9 +79,9 @@ var y = "SwitchThumb", N = h.forwardRef(
|
|
|
81
79
|
);
|
|
82
80
|
N.displayName = y;
|
|
83
81
|
var K = (e) => {
|
|
84
|
-
const { control: s, checked: t, bubbles: c = !0, ...n } = e,
|
|
85
|
-
return
|
|
86
|
-
const i =
|
|
82
|
+
const { control: s, checked: t, bubbles: c = !0, ...n } = e, h = p.useRef(null), o = V(t), a = D(s);
|
|
83
|
+
return p.useEffect(() => {
|
|
84
|
+
const i = h.current, m = window.HTMLInputElement.prototype, d = Object.getOwnPropertyDescriptor(m, "checked").set;
|
|
87
85
|
if (o !== t && d) {
|
|
88
86
|
const l = new Event("click", { bubbles: c });
|
|
89
87
|
d.call(i, t), i.dispatchEvent(l);
|
|
@@ -96,7 +94,7 @@ var K = (e) => {
|
|
|
96
94
|
defaultChecked: t,
|
|
97
95
|
...n,
|
|
98
96
|
tabIndex: -1,
|
|
99
|
-
ref:
|
|
97
|
+
ref: h,
|
|
100
98
|
style: {
|
|
101
99
|
...e.style,
|
|
102
100
|
...a,
|
|
@@ -112,17 +110,17 @@ function E(e) {
|
|
|
112
110
|
return e ? "checked" : "unchecked";
|
|
113
111
|
}
|
|
114
112
|
var Q = R, Y = N;
|
|
115
|
-
const
|
|
113
|
+
const ue = _(
|
|
116
114
|
({
|
|
117
115
|
name: e,
|
|
118
116
|
defaultChecked: s,
|
|
119
117
|
alignment: t = "horizontal",
|
|
120
118
|
theme: c,
|
|
121
119
|
thumbClassName: n,
|
|
122
|
-
className:
|
|
120
|
+
className: h,
|
|
123
121
|
label: o
|
|
124
122
|
}, a) => {
|
|
125
|
-
const [i, m] = H(s ?? !1), r = A(null), d = M(), { theme: l } =
|
|
123
|
+
const [i, m] = H(s ?? !1), r = A(null), d = M(), { theme: l } = W(), b = c ?? l, v = e ? `${d}-${e}` : d;
|
|
126
124
|
$(a, () => r.current, [r]), j(() => {
|
|
127
125
|
r.current && (r.current.value = `${i}`);
|
|
128
126
|
}, [i]);
|
|
@@ -153,12 +151,12 @@ const le = _(
|
|
|
153
151
|
id: v,
|
|
154
152
|
defaultChecked: s,
|
|
155
153
|
onCheckedChange: f,
|
|
156
|
-
className: x(
|
|
154
|
+
className: x(L({ theme: b, className: h })),
|
|
157
155
|
"aria-label": o,
|
|
158
156
|
children: /* @__PURE__ */ u(
|
|
159
157
|
Y,
|
|
160
158
|
{
|
|
161
|
-
className:
|
|
159
|
+
className: U({
|
|
162
160
|
theme: b,
|
|
163
161
|
className: n
|
|
164
162
|
})
|
|
@@ -182,5 +180,5 @@ const le = _(
|
|
|
182
180
|
}
|
|
183
181
|
);
|
|
184
182
|
export {
|
|
185
|
-
|
|
183
|
+
ue as Switch
|
|
186
184
|
};
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { jsxs as u, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as g, useId as w, useRef as C, useImperativeHandle as T, useEffect as R } from "react";
|
|
3
|
-
import "../../contexts/theme.context.js";
|
|
4
|
-
import { useTheme as S } from "../../contexts/theme.hook.js";
|
|
5
|
-
import "../../js.cookie-OLEfuq_g.js";
|
|
6
3
|
import { cn as r } from "../../utils/index.js";
|
|
7
4
|
import { Tag as d } from "../Tag/Tag.js";
|
|
8
|
-
import { useTagSelect as
|
|
9
|
-
import { tagSelectVariants as
|
|
10
|
-
import { C as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
import { useTagSelect as S } from "./hooks/useTagSelect.js";
|
|
6
|
+
import { tagSelectVariants as k, tagListVariants as I, tagItemVariants as V } from "./TagSelect.variants.js";
|
|
7
|
+
import { C as j } from "../../chevron-up-DgLBQCKD.js";
|
|
8
|
+
import { useTheme as y } from "../../contexts/theme.hook.js";
|
|
9
|
+
const z = g(({ label: s, name: l, options: f, placeholder: h = "Select a value...", theme: o }, x) => {
|
|
10
|
+
const c = w(), { theme: a } = y(), t = C(null), {
|
|
11
|
+
isOpen: n,
|
|
14
12
|
selectedTag: m,
|
|
15
13
|
value: p,
|
|
16
14
|
wrapperRef: b,
|
|
17
15
|
handleClickTag: N,
|
|
18
16
|
handleOpenDropdown: v
|
|
19
|
-
} =
|
|
17
|
+
} = S();
|
|
20
18
|
return T(x, () => t.current, [t]), R(() => {
|
|
21
19
|
t.current && (t.current.value = p);
|
|
22
20
|
}, [p]), /* @__PURE__ */ u("div", { ref: b, className: "flex flex-col w-full relative", children: [
|
|
@@ -25,18 +23,18 @@ const B = g(({ label: s, name: l, options: f, placeholder: h = "Select a value..
|
|
|
25
23
|
"div",
|
|
26
24
|
{
|
|
27
25
|
id: l ?? c,
|
|
28
|
-
className: r(
|
|
26
|
+
className: r(k({ theme: o ?? a })),
|
|
29
27
|
role: "combobox",
|
|
30
28
|
onClick: v,
|
|
31
|
-
"aria-expanded":
|
|
29
|
+
"aria-expanded": n,
|
|
32
30
|
children: [
|
|
33
31
|
m ? /* @__PURE__ */ e(d, { ...m }) : /* @__PURE__ */ e("span", { className: "text-base text-inherit", children: h }),
|
|
34
32
|
/* @__PURE__ */ e(
|
|
35
|
-
|
|
33
|
+
j,
|
|
36
34
|
{
|
|
37
35
|
className: r(
|
|
38
36
|
"w-4 h-4 text-inherit transition-all duration-50",
|
|
39
|
-
|
|
37
|
+
n ? "rotate-0" : "rotate-180"
|
|
40
38
|
)
|
|
41
39
|
}
|
|
42
40
|
)
|
|
@@ -44,15 +42,15 @@ const B = g(({ label: s, name: l, options: f, placeholder: h = "Select a value..
|
|
|
44
42
|
}
|
|
45
43
|
),
|
|
46
44
|
/* @__PURE__ */ e("input", { ref: t, type: "text", name: l, className: "hidden" }),
|
|
47
|
-
|
|
45
|
+
n ? /* @__PURE__ */ e(
|
|
48
46
|
"ul",
|
|
49
47
|
{
|
|
50
48
|
role: "listbox",
|
|
51
|
-
className: r(
|
|
52
|
-
children: f.map((
|
|
49
|
+
className: r(I({ theme: o ?? a })),
|
|
50
|
+
children: f.map((i) => /* @__PURE__ */ e(
|
|
53
51
|
"li",
|
|
54
52
|
{
|
|
55
|
-
className: r(
|
|
53
|
+
className: r(V({ theme: o ?? a })),
|
|
56
54
|
role: "option",
|
|
57
55
|
children: /* @__PURE__ */ e(
|
|
58
56
|
"button",
|
|
@@ -60,8 +58,8 @@ const B = g(({ label: s, name: l, options: f, placeholder: h = "Select a value..
|
|
|
60
58
|
type: "button",
|
|
61
59
|
role: "button",
|
|
62
60
|
className: "m-0 p-0 w-full",
|
|
63
|
-
onClick: () => N(
|
|
64
|
-
children: /* @__PURE__ */ e(d, { label:
|
|
61
|
+
onClick: () => N(i),
|
|
62
|
+
children: /* @__PURE__ */ e(d, { label: i.label, color: i.color })
|
|
65
63
|
}
|
|
66
64
|
)
|
|
67
65
|
}
|
|
@@ -71,5 +69,5 @@ const B = g(({ label: s, name: l, options: f, placeholder: h = "Select a value..
|
|
|
71
69
|
] });
|
|
72
70
|
});
|
|
73
71
|
export {
|
|
74
|
-
|
|
72
|
+
z as TagSelect
|
|
75
73
|
};
|
|
@@ -1,35 +1,33 @@
|
|
|
1
|
-
import { jsxs as h, jsx as
|
|
1
|
+
import { jsxs as h, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as v, useId as N, useState as T, useCallback as j } from "react";
|
|
3
|
-
import "../../
|
|
4
|
-
import {
|
|
5
|
-
import "../../
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
(x) => {
|
|
12
|
-
f(x.target.value), e == null || e();
|
|
3
|
+
import { cn as A } from "../../utils/index.js";
|
|
4
|
+
import { textAreaVariants as I } from "./TextArea.variants.js";
|
|
5
|
+
import { useTheme as V } from "../../contexts/theme.hook.js";
|
|
6
|
+
const S = v(
|
|
7
|
+
({ initialValue: m, label: t, name: o, placeholder: l, rows: c = 3, theme: i, onChange: e }, u) => {
|
|
8
|
+
const r = N(), { theme: d } = V(), s = o ? `${r}-name` : r, [f, n] = T(m ?? ""), x = j(
|
|
9
|
+
(p) => {
|
|
10
|
+
n(p.target.value), e == null || e();
|
|
13
11
|
},
|
|
14
12
|
[e]
|
|
15
13
|
);
|
|
16
14
|
return /* @__PURE__ */ h("div", { className: "flex flex-col gap-2", children: [
|
|
17
|
-
t ? /* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */
|
|
15
|
+
t ? /* @__PURE__ */ a("label", { htmlFor: s, className: "cursor-pointer", children: t }) : null,
|
|
16
|
+
/* @__PURE__ */ a(
|
|
19
17
|
"textarea",
|
|
20
18
|
{
|
|
21
|
-
id:
|
|
22
|
-
ref:
|
|
23
|
-
className: I(
|
|
19
|
+
id: s,
|
|
20
|
+
ref: u,
|
|
21
|
+
className: A(I({ theme: i ?? d })),
|
|
24
22
|
rows: c,
|
|
25
23
|
placeholder: l,
|
|
26
|
-
value:
|
|
27
|
-
onChange:
|
|
24
|
+
value: f,
|
|
25
|
+
onChange: x
|
|
28
26
|
}
|
|
29
27
|
)
|
|
30
28
|
] });
|
|
31
29
|
}
|
|
32
30
|
);
|
|
33
31
|
export {
|
|
34
|
-
|
|
32
|
+
S as TextArea
|
|
35
33
|
};
|
|
@@ -2,26 +2,24 @@ import { jsxs as D, jsx as c, Fragment as se } from "react/jsx-runtime";
|
|
|
2
2
|
import { u as ae, S as j } from "../../index-DoOsnuB6.js";
|
|
3
3
|
import * as s from "react";
|
|
4
4
|
import { useState as Re, useRef as be, useEffect as ge, useMemo as oe, isValidElement as re, useCallback as Se } from "react";
|
|
5
|
-
import { P as L, r as Ie, d as Ne } from "../../index-
|
|
5
|
+
import { P as L, r as Ie, d as Ne } from "../../index-1GLoikpT.js";
|
|
6
6
|
import { c as Ae, a as Fe, b as X, d as b, u as _e } from "../../index-8vgf-x5i.js";
|
|
7
7
|
import { c as De } from "../../index-BBjak_0p.js";
|
|
8
|
-
import { B as Le, R as Oe, P as Me } from "../../index-
|
|
8
|
+
import { B as Le, R as Oe, P as Me } from "../../index-CoqDsznq.js";
|
|
9
9
|
import { P as ke } from "../../index-D4Q2rMby.js";
|
|
10
|
-
import { V as ie, R as Ve } from "../../index-
|
|
11
|
-
import "../../contexts/theme.context.js";
|
|
12
|
-
import { useTheme as Ke } from "../../contexts/theme.hook.js";
|
|
13
|
-
import "../../js.cookie-OLEfuq_g.js";
|
|
10
|
+
import { V as ie, R as Ve } from "../../index-KEdwcThH.js";
|
|
14
11
|
import { cn as q } from "../../utils/index.js";
|
|
15
|
-
import { toastVariants as
|
|
16
|
-
import { X as
|
|
17
|
-
|
|
12
|
+
import { toastVariants as Ke, closeToastVariants as He, viewportToastVariants as We } from "./Toast.variants.js";
|
|
13
|
+
import { X as Xe } from "../../x-DU-Zw-L_.js";
|
|
14
|
+
import { useTheme as $e } from "../../contexts/theme.hook.js";
|
|
15
|
+
var Z = "ToastProvider", [ee, Ue, Ye] = De("Toast"), [ce, gt] = Ae("Toast", [Ye]), [Be, $] = ce(Z), ue = (e) => {
|
|
18
16
|
const {
|
|
19
17
|
__scopeToast: r,
|
|
20
18
|
label: o = "Notification",
|
|
21
19
|
duration: t = 5e3,
|
|
22
20
|
swipeDirection: u = "right",
|
|
23
21
|
swipeThreshold: d = 50,
|
|
24
|
-
children:
|
|
22
|
+
children: f
|
|
25
23
|
} = e, [m, v] = s.useState(null), [n, w] = s.useState(0), E = s.useRef(!1), I = s.useRef(!1);
|
|
26
24
|
return o.trim() || console.error(
|
|
27
25
|
`Invalid prop \`label\` supplied to \`${Z}\`. Expected non-empty \`string\`.`
|
|
@@ -40,7 +38,7 @@ var Z = "ToastProvider", [ee, Ue, Ye] = De("Toast"), [ce, It] = Ae("Toast", [Ye]
|
|
|
40
38
|
onToastRemove: s.useCallback(() => w((R) => R - 1), []),
|
|
41
39
|
isFocusedToastEscapeKeyDownRef: E,
|
|
42
40
|
isClosePausedRef: I,
|
|
43
|
-
children:
|
|
41
|
+
children: f
|
|
44
42
|
}
|
|
45
43
|
) });
|
|
46
44
|
};
|
|
@@ -52,7 +50,7 @@ var le = "ToastViewport", je = ["F8"], G = "toast.viewportPause", J = "toast.vie
|
|
|
52
50
|
hotkey: t = je,
|
|
53
51
|
label: u = "Notifications ({hotkey})",
|
|
54
52
|
...d
|
|
55
|
-
} = e,
|
|
53
|
+
} = e, f = $(le, o), m = Ue(o), v = s.useRef(null), n = s.useRef(null), w = s.useRef(null), E = s.useRef(null), I = ae(r, E, f.onViewportChange), R = t.join("+").replace(/Key/g, "").replace(/Digit/g, ""), g = f.toastCount > 0;
|
|
56
54
|
s.useEffect(() => {
|
|
57
55
|
const a = (P) => {
|
|
58
56
|
var T;
|
|
@@ -62,50 +60,50 @@ var le = "ToastViewport", je = ["F8"], G = "toast.viewportPause", J = "toast.vie
|
|
|
62
60
|
}, [t]), s.useEffect(() => {
|
|
63
61
|
const a = v.current, P = E.current;
|
|
64
62
|
if (g && a && P) {
|
|
65
|
-
const
|
|
66
|
-
if (!
|
|
63
|
+
const p = () => {
|
|
64
|
+
if (!f.isClosePausedRef.current) {
|
|
67
65
|
const C = new CustomEvent(G);
|
|
68
|
-
P.dispatchEvent(C),
|
|
66
|
+
P.dispatchEvent(C), f.isClosePausedRef.current = !0;
|
|
69
67
|
}
|
|
70
68
|
}, T = () => {
|
|
71
|
-
if (
|
|
69
|
+
if (f.isClosePausedRef.current) {
|
|
72
70
|
const C = new CustomEvent(J);
|
|
73
|
-
P.dispatchEvent(C),
|
|
71
|
+
P.dispatchEvent(C), f.isClosePausedRef.current = !1;
|
|
74
72
|
}
|
|
75
73
|
}, h = (C) => {
|
|
76
74
|
!a.contains(C.relatedTarget) && T();
|
|
77
75
|
}, y = () => {
|
|
78
76
|
a.contains(document.activeElement) || T();
|
|
79
77
|
};
|
|
80
|
-
return a.addEventListener("focusin",
|
|
81
|
-
a.removeEventListener("focusin",
|
|
78
|
+
return a.addEventListener("focusin", p), a.addEventListener("focusout", h), a.addEventListener("pointermove", p), a.addEventListener("pointerleave", y), window.addEventListener("blur", p), window.addEventListener("focus", T), () => {
|
|
79
|
+
a.removeEventListener("focusin", p), a.removeEventListener("focusout", h), a.removeEventListener("pointermove", p), a.removeEventListener("pointerleave", y), window.removeEventListener("blur", p), window.removeEventListener("focus", T);
|
|
82
80
|
};
|
|
83
81
|
}
|
|
84
|
-
}, [g,
|
|
82
|
+
}, [g, f.isClosePausedRef]);
|
|
85
83
|
const l = s.useCallback(
|
|
86
84
|
({ tabbingDirection: a }) => {
|
|
87
|
-
const
|
|
85
|
+
const p = m().map((T) => {
|
|
88
86
|
const h = T.ref.current, y = [h, ...at(h)];
|
|
89
87
|
return a === "forwards" ? y : y.reverse();
|
|
90
88
|
});
|
|
91
|
-
return (a === "forwards" ?
|
|
89
|
+
return (a === "forwards" ? p.reverse() : p).flat();
|
|
92
90
|
},
|
|
93
91
|
[m]
|
|
94
92
|
);
|
|
95
93
|
return s.useEffect(() => {
|
|
96
94
|
const a = E.current;
|
|
97
95
|
if (a) {
|
|
98
|
-
const P = (
|
|
96
|
+
const P = (p) => {
|
|
99
97
|
var y, C, N;
|
|
100
|
-
const T =
|
|
101
|
-
if (
|
|
102
|
-
const O = document.activeElement, F =
|
|
103
|
-
if (
|
|
98
|
+
const T = p.altKey || p.ctrlKey || p.metaKey;
|
|
99
|
+
if (p.key === "Tab" && !T) {
|
|
100
|
+
const O = document.activeElement, F = p.shiftKey;
|
|
101
|
+
if (p.target === a && F) {
|
|
104
102
|
(y = n.current) == null || y.focus();
|
|
105
103
|
return;
|
|
106
104
|
}
|
|
107
105
|
const A = l({ tabbingDirection: F ? "backwards" : "forwards" }), V = A.findIndex((i) => i === O);
|
|
108
|
-
z(A.slice(V + 1)) ?
|
|
106
|
+
z(A.slice(V + 1)) ? p.preventDefault() : F ? (C = n.current) == null || C.focus() : (N = w.current) == null || N.focus();
|
|
109
107
|
}
|
|
110
108
|
};
|
|
111
109
|
return a.addEventListener("keydown", P), () => a.removeEventListener("keydown", P);
|
|
@@ -150,9 +148,9 @@ var le = "ToastViewport", je = ["F8"], G = "toast.viewportPause", J = "toast.vie
|
|
|
150
148
|
}
|
|
151
149
|
);
|
|
152
150
|
de.displayName = le;
|
|
153
|
-
var
|
|
151
|
+
var fe = "ToastFocusProxy", Q = s.forwardRef(
|
|
154
152
|
(e, r) => {
|
|
155
|
-
const { __scopeToast: o, onFocusFromOutsideViewport: t, ...u } = e, d = $(
|
|
153
|
+
const { __scopeToast: o, onFocusFromOutsideViewport: t, ...u } = e, d = $(fe, o);
|
|
156
154
|
return /* @__PURE__ */ c(
|
|
157
155
|
ie,
|
|
158
156
|
{
|
|
@@ -161,19 +159,19 @@ var pe = "ToastFocusProxy", Q = s.forwardRef(
|
|
|
161
159
|
...u,
|
|
162
160
|
ref: r,
|
|
163
161
|
style: { position: "fixed" },
|
|
164
|
-
onFocus: (
|
|
162
|
+
onFocus: (f) => {
|
|
165
163
|
var n;
|
|
166
|
-
const m =
|
|
164
|
+
const m = f.relatedTarget;
|
|
167
165
|
!((n = d.viewport) != null && n.contains(m)) && t();
|
|
168
166
|
}
|
|
169
167
|
}
|
|
170
168
|
);
|
|
171
169
|
}
|
|
172
170
|
);
|
|
173
|
-
Q.displayName =
|
|
174
|
-
var U = "Toast", qe = "toast.swipeStart", ze = "toast.swipeMove", Ge = "toast.swipeCancel", Je = "toast.swipeEnd",
|
|
171
|
+
Q.displayName = fe;
|
|
172
|
+
var U = "Toast", qe = "toast.swipeStart", ze = "toast.swipeMove", Ge = "toast.swipeCancel", Je = "toast.swipeEnd", pe = s.forwardRef(
|
|
175
173
|
(e, r) => {
|
|
176
|
-
const { forceMount: o, open: t, defaultOpen: u, onOpenChange: d, ...
|
|
174
|
+
const { forceMount: o, open: t, defaultOpen: u, onOpenChange: d, ...f } = e, [m = !0, v] = Fe({
|
|
177
175
|
prop: t,
|
|
178
176
|
defaultProp: u,
|
|
179
177
|
onChange: d
|
|
@@ -182,7 +180,7 @@ var U = "Toast", qe = "toast.swipeStart", ze = "toast.swipeMove", Ge = "toast.sw
|
|
|
182
180
|
et,
|
|
183
181
|
{
|
|
184
182
|
open: m,
|
|
185
|
-
...
|
|
183
|
+
...f,
|
|
186
184
|
ref: r,
|
|
187
185
|
onClose: () => v(!1),
|
|
188
186
|
onPause: X(e.onPause),
|
|
@@ -205,7 +203,7 @@ var U = "Toast", qe = "toast.swipeStart", ze = "toast.swipeMove", Ge = "toast.sw
|
|
|
205
203
|
) });
|
|
206
204
|
}
|
|
207
205
|
);
|
|
208
|
-
|
|
206
|
+
pe.displayName = U;
|
|
209
207
|
var [Qe, Ze] = ce(U, {
|
|
210
208
|
onClose() {
|
|
211
209
|
}
|
|
@@ -216,7 +214,7 @@ var [Qe, Ze] = ce(U, {
|
|
|
216
214
|
type: t = "foreground",
|
|
217
215
|
duration: u,
|
|
218
216
|
open: d,
|
|
219
|
-
onClose:
|
|
217
|
+
onClose: f,
|
|
220
218
|
onEscapeKeyDown: m,
|
|
221
219
|
onPause: v,
|
|
222
220
|
onResume: n,
|
|
@@ -225,9 +223,9 @@ var [Qe, Ze] = ce(U, {
|
|
|
225
223
|
onSwipeCancel: I,
|
|
226
224
|
onSwipeEnd: R,
|
|
227
225
|
...g
|
|
228
|
-
} = e, l = $(U, o), [a, P] = s.useState(null),
|
|
226
|
+
} = e, l = $(U, o), [a, P] = s.useState(null), p = ae(r, (i) => P(i)), T = s.useRef(null), h = s.useRef(null), y = u || l.duration, C = s.useRef(0), N = s.useRef(y), O = s.useRef(0), { onToastAdd: F, onToastRemove: Y } = l, _ = X(() => {
|
|
229
227
|
var x;
|
|
230
|
-
(a == null ? void 0 : a.contains(document.activeElement)) && ((x = l.viewport) == null || x.focus()),
|
|
228
|
+
(a == null ? void 0 : a.contains(document.activeElement)) && ((x = l.viewport) == null || x.focus()), f();
|
|
231
229
|
}), A = s.useCallback(
|
|
232
230
|
(i) => {
|
|
233
231
|
!i || i === 1 / 0 || (window.clearTimeout(O.current), C.current = (/* @__PURE__ */ new Date()).getTime(), O.current = window.setTimeout(_, i));
|
|
@@ -280,7 +278,7 @@ var [Qe, Ze] = ce(U, {
|
|
|
280
278
|
"data-state": d ? "open" : "closed",
|
|
281
279
|
"data-swipe-direction": l.swipeDirection,
|
|
282
280
|
...g,
|
|
283
|
-
ref:
|
|
281
|
+
ref: p,
|
|
284
282
|
style: { userSelect: "none", touchAction: "none", ...e.style },
|
|
285
283
|
onKeyDown: b(e.onKeyDown, (i) => {
|
|
286
284
|
i.key === "Escape" && (m == null || m(i.nativeEvent), i.nativeEvent.defaultPrevented || (l.isFocusedToastEscapeKeyDownRef.current = !0, _()));
|
|
@@ -324,8 +322,8 @@ var [Qe, Ze] = ce(U, {
|
|
|
324
322
|
] }) : null;
|
|
325
323
|
}
|
|
326
324
|
), tt = (e) => {
|
|
327
|
-
const { __scopeToast: r, children: o, ...t } = e, u = $(U, r), [d,
|
|
328
|
-
return nt(() =>
|
|
325
|
+
const { __scopeToast: r, children: o, ...t } = e, u = $(U, r), [d, f] = s.useState(!1), [m, v] = s.useState(!1);
|
|
326
|
+
return nt(() => f(!0)), s.useEffect(() => {
|
|
329
327
|
const n = window.setTimeout(() => v(!0), 1e3);
|
|
330
328
|
return () => window.clearTimeout(n);
|
|
331
329
|
}, []), m ? null : /* @__PURE__ */ c(Me, { asChild: !0, children: /* @__PURE__ */ c(ie, { ...t, children: d && /* @__PURE__ */ D(se, { children: [
|
|
@@ -390,8 +388,8 @@ function Pe(e) {
|
|
|
390
388
|
const u = t.ariaHidden || t.hidden || t.style.display === "none", d = t.dataset.radixToastAnnounceExclude === "";
|
|
391
389
|
if (!u)
|
|
392
390
|
if (d) {
|
|
393
|
-
const
|
|
394
|
-
|
|
391
|
+
const f = t.dataset.radixToastAnnounceAlt;
|
|
392
|
+
f && r.push(f);
|
|
395
393
|
} else
|
|
396
394
|
r.push(...Pe(t));
|
|
397
395
|
}
|
|
@@ -432,19 +430,19 @@ function z(e) {
|
|
|
432
430
|
const r = document.activeElement;
|
|
433
431
|
return e.some((o) => o === r ? !0 : (o.focus(), document.activeElement !== r));
|
|
434
432
|
}
|
|
435
|
-
var it = ue, ct = de, ut =
|
|
436
|
-
const
|
|
433
|
+
var it = ue, ct = de, ut = pe, lt = me, dt = Te, ft = we;
|
|
434
|
+
const St = ({
|
|
437
435
|
title: e,
|
|
438
436
|
duration: r = 5e3,
|
|
439
437
|
titleClassName: o,
|
|
440
438
|
descriptionClassName: t,
|
|
441
439
|
description: u,
|
|
442
440
|
children: d,
|
|
443
|
-
theme:
|
|
441
|
+
theme: f,
|
|
444
442
|
showCloseButton: m = !0,
|
|
445
443
|
className: v
|
|
446
444
|
}) => {
|
|
447
|
-
const [n, w] = Re(!1), E = be(0), { theme: I } =
|
|
445
|
+
const [n, w] = Re(!1), E = be(0), { theme: I } = $e(), R = f ?? I;
|
|
448
446
|
ge(() => () => clearTimeout(E.current), []);
|
|
449
447
|
const g = oe(() => re(e) ? /* @__PURE__ */ c(j, { className: o, children: e }) : /* @__PURE__ */ c("h6", { className: o, children: e }), [e, o]), l = oe(() => re(u) ? /* @__PURE__ */ c(j, { className: t, children: u }) : /* @__PURE__ */ c("h6", { className: t, children: u }), [u, t]), a = Se(() => {
|
|
450
448
|
w(!1), E.current = window.setTimeout(() => w(!0), 100);
|
|
@@ -454,14 +452,14 @@ const Nt = ({
|
|
|
454
452
|
/* @__PURE__ */ D(
|
|
455
453
|
ut,
|
|
456
454
|
{
|
|
457
|
-
className: q(
|
|
455
|
+
className: q(Ke({ theme: R, className: v })),
|
|
458
456
|
open: n,
|
|
459
457
|
onOpenChange: w,
|
|
460
458
|
children: [
|
|
461
459
|
/* @__PURE__ */ c(lt, { asChild: !0, className: "text-lg mb-2 font-semibold", children: g }),
|
|
462
460
|
/* @__PURE__ */ c(dt, { asChild: !0, children: l }),
|
|
463
|
-
m && /* @__PURE__ */ c(
|
|
464
|
-
/* @__PURE__ */ c(
|
|
461
|
+
m && /* @__PURE__ */ c(ft, { asChild: !0, altText: "Close the toast", children: /* @__PURE__ */ D("button", { type: "button", className: "absolute right-1.5 top-1.5", children: [
|
|
462
|
+
/* @__PURE__ */ c(Xe, { className: q(He({ theme: R })) }),
|
|
465
463
|
/* @__PURE__ */ c(Ve, { children: "Close toast" })
|
|
466
464
|
] }) })
|
|
467
465
|
]
|
|
@@ -470,11 +468,11 @@ const Nt = ({
|
|
|
470
468
|
/* @__PURE__ */ c(
|
|
471
469
|
ct,
|
|
472
470
|
{
|
|
473
|
-
className: q(
|
|
471
|
+
className: q(We({ theme: R }))
|
|
474
472
|
}
|
|
475
473
|
)
|
|
476
474
|
] });
|
|
477
475
|
};
|
|
478
476
|
export {
|
|
479
|
-
|
|
477
|
+
St as Toast
|
|
480
478
|
};
|
|
@@ -1,33 +1,31 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as N, useRef as w, useImperativeHandle as x, useMemo as R, isValidElement as T } from "react";
|
|
3
3
|
import { S as a } from "../../index-DoOsnuB6.js";
|
|
4
|
-
import "../../contexts/theme.context.js";
|
|
5
|
-
import { useTheme as V } from "../../contexts/theme.hook.js";
|
|
6
|
-
import "../../js.cookie-OLEfuq_g.js";
|
|
7
4
|
import { cn as o } from "../../utils/index.js";
|
|
8
|
-
import { tooltipVariants as
|
|
9
|
-
import { useTooltip as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
import { tooltipVariants as V, arrowVariants as b } from "./Tooltip.variants.js";
|
|
6
|
+
import { useTooltip as j } from "./hooks/useTooltip.js";
|
|
7
|
+
import { useTheme as C } from "../../contexts/theme.hook.js";
|
|
8
|
+
const q = N(
|
|
9
|
+
({ children: t, content: l, className: n, theme: c, position: s, wrapperClassName: p }, f) => {
|
|
10
|
+
const d = w(null), { theme: h } = C(), m = c ?? h, { isVisible: u, componentRef: r } = j();
|
|
13
11
|
x(f, () => r.current, [r]);
|
|
14
12
|
const v = R(
|
|
15
13
|
() => T(t) ? t : /* @__PURE__ */ e("p", { className: "p-2", children: t }),
|
|
16
14
|
[t]
|
|
17
15
|
);
|
|
18
|
-
return /* @__PURE__ */ e("div", { className: o("w-full",
|
|
16
|
+
return /* @__PURE__ */ e("div", { className: o("w-full", p), children: /* @__PURE__ */ i("div", { className: "relative w-max", children: [
|
|
19
17
|
/* @__PURE__ */ e(a, { ref: r, className: o("cursor-pointer ", n), children: v }),
|
|
20
18
|
/* @__PURE__ */ i(
|
|
21
19
|
"div",
|
|
22
20
|
{
|
|
23
21
|
ref: d,
|
|
24
|
-
className: o(
|
|
22
|
+
className: o(V({ theme: m, position: s })),
|
|
25
23
|
"data-visible": u,
|
|
26
24
|
children: [
|
|
27
25
|
/* @__PURE__ */ e(
|
|
28
26
|
"span",
|
|
29
27
|
{
|
|
30
|
-
className: o(
|
|
28
|
+
className: o(b({ theme: m, position: s }))
|
|
31
29
|
}
|
|
32
30
|
),
|
|
33
31
|
/* @__PURE__ */ e(a, { children: l })
|
|
@@ -38,5 +36,5 @@ const z = N(
|
|
|
38
36
|
}
|
|
39
37
|
);
|
|
40
38
|
export {
|
|
41
|
-
|
|
39
|
+
q as Tooltip
|
|
42
40
|
};
|