@konstructio/ui 0.1.2-alpha.101 → 0.1.2-alpha.103
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/AlertDialogTrigger-CgcsW_ta.js +109 -0
- package/dist/{Breadcrumb-Bmv0vzgt.js → Breadcrumb-Cp3abB2w.js} +1 -1
- package/dist/Checkbox-DzAx7n67.js +249 -0
- package/dist/{CommandInput-CYYsk_31.js → CommandInput-BnvRMfLI.js} +2 -2
- package/dist/{Counter-DWKyr569.js → Counter-CY0xGnVM.js} +2 -2
- package/dist/{DayPicker-CwO8Zff5.js → DayPicker-kweJz134.js} +750 -746
- package/dist/{DropdownButton-Beel5_gN.js → DropdownButton-DnlwdPmb.js} +1 -1
- package/dist/FlagSelectorList-BoYG-_It.js +852 -0
- package/dist/{HamburgerTrigger-7a4POUaM.js → HamburgerTrigger-1vOTrm8-.js} +2 -2
- package/dist/{Input-DG3snJf_.js → Input-CW0VwW2T.js} +4 -4
- package/dist/{Modal-Bcu6LLAp.js → Modal-Bfzggwlr.js} +2 -2
- package/dist/{Spinner-BegZ5yd7.js → Spinner-Lw9mZYhg.js} +1 -1
- package/dist/Switch-WBRr8uOJ.js +196 -0
- package/dist/Toast-ByH-l4XK.js +459 -0
- package/dist/{Wrapper-DwxJAkNQ.js → Wrapper-ClJ_Mham.js} +2 -2
- package/dist/{Wrapper-DtT29fc5.js → Wrapper-XeeD3av7.js} +1 -1
- package/dist/components/Alert/Alert.js +2 -2
- package/dist/components/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Command/Command.js +2 -2
- package/dist/components/Command/components/Command.js +1 -1
- package/dist/components/Command/components/CommandEmpty.js +1 -1
- package/dist/components/Command/components/CommandGroup.js +1 -1
- package/dist/components/Command/components/CommandInput.js +1 -1
- package/dist/components/Command/components/CommandItem.js +1 -1
- package/dist/components/Command/components/CommandList.js +1 -1
- package/dist/components/Command/components/CommandSeparator.js +1 -1
- package/dist/components/Command/components/DialogContent.js +2 -2
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/Command/components/index.js +1 -1
- package/dist/components/Counter/Counter.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.js +1 -1
- package/dist/components/Datepicker/DatePicker.js +2 -3
- package/dist/components/Drawer/Drawer.js +2 -2
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/Filter.js +4 -3
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +23 -24
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +60 -65
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +35 -43
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +40 -45
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.js +33 -34
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.js +45 -51
- package/dist/components/Filter/components/FilterDropdown/FilterDropdown.js +28 -0
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +56 -61
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.js +33 -34
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.js +70 -75
- package/dist/components/Filter/contexts/filter.provider.js +8 -5
- package/dist/components/Filter/utils/index.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/LineChart/LineChart.js +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +1 -1
- package/dist/components/MultiSelectDropdown/components/List/List.js +1 -1
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/MultiSelectDropdown/components/index.js +1 -1
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +2 -2
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +1 -1
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +2 -2
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +2 -2
- package/dist/components/PhoneNumberInput/components/Wrapper.js +1 -1
- package/dist/components/PhoneNumberInput/components/index.js +2 -2
- package/dist/components/PhoneNumberInput/contexts/index.js +1 -1
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +1 -1
- package/dist/components/PieChart/PieChart.js +1 -1
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Select/components/List/List.js +1 -1
- package/dist/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.js +1 -1
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +1 -1
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/Sidebar/components/index.js +1 -1
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Spinner/Spinner.js +1 -1
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Table/components/Filter.js +1 -1
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/components/Content.js +1 -1
- package/dist/components/Tabs/components/List.js +1 -1
- package/dist/components/Tabs/components/Trigger.js +1 -1
- package/dist/components/TagSelect/TagSelect.js +1 -1
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/TagSelect/components/index.js +1 -1
- package/dist/components/Toast/Toast.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/VirtualizedTable/VirtualizedTable.js +87 -87
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +19 -19
- package/dist/components/VirtualizedTable/components/Body/Body.js +50 -49
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +67 -21
- package/dist/components/VirtualizedTable/components/ExpandableRow/ExpandableRow.js +1 -1
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +53 -63
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +10 -10
- package/dist/components/VirtualizedTable/components/Header/Header.js +47 -34
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +19 -15
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +10 -10
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +8 -8
- package/dist/components/VirtualizedTable/contexts/index.js +1 -1
- package/dist/components/VirtualizedTable/contexts/table.context.js +1 -0
- package/dist/components/VirtualizedTable/contexts/table.provider.js +1 -1
- package/dist/components/index.js +10 -10
- package/dist/{components-CYt24H4n.js → components-BIHlj4yH.js} +1 -1
- package/dist/{debounce-KoeGNmnW.js → debounce-C5Ycjilj.js} +14 -14
- package/dist/dist-2bGlmy8N2.js +165 -0
- package/dist/dist-BiJrNvNo.js +193 -0
- package/dist/dist-BuFiu480.js +13 -0
- package/dist/dist-C2aTw0m62.js +1320 -0
- package/dist/{dist-DvoMuWKO2.js → dist-C2s4VX-42.js} +4 -4
- package/dist/dist-CT6d9xe7.js +441 -0
- package/dist/dist-CTvBzxW8.js +31 -0
- package/dist/dist-CVDFmWf2.js +358 -0
- package/dist/dist-D4FePjTS.js +194 -0
- package/dist/dist-DISvWx7U.js +99 -0
- package/dist/dist-Db6UeFo4.js +291 -0
- package/dist/{dist-DGO9opgu.js → dist-Dse3gSmZ.js} +49 -49
- package/dist/dist-j7FOUrFU.js +206 -0
- package/dist/{dist-C8NWUTUh.js → dist-l-aDnQZC.js} +1 -1
- package/dist/es2015-BWf6xQHm.js +222 -0
- package/dist/index.js +10 -10
- package/dist/{isObject-1ZmdWuhC.js → isObject-BeFFiVJK.js} +8 -8
- package/dist/lib/components/Alert/Alert.types.d.ts +1 -1
- package/dist/lib/components/AlertDialog/AlertDialog.types.d.ts +1 -1
- package/dist/lib/components/AlertDialog/components/AlertDialogTrigger.types.d.ts +2 -2
- package/dist/lib/components/Autocomplete/Autocomplete.types.d.ts +1 -1
- package/dist/lib/components/Breadcrumb/Breadcrumb.types.d.ts +1 -1
- package/dist/lib/components/Breadcrumb/components/BackButton/BackButton.types.d.ts +1 -1
- package/dist/lib/components/Breadcrumb/components/Item/Item.types.d.ts +1 -1
- package/dist/lib/components/Button/Button.types.d.ts +1 -1
- package/dist/lib/components/ButtonGroup/ButtonGroup.types.d.ts +1 -1
- package/dist/lib/components/Card/Card.types.d.ts +1 -1
- package/dist/lib/components/Checkbox/Checkbox.types.d.ts +1 -1
- package/dist/lib/components/Command/Command.types.d.ts +1 -1
- package/dist/lib/components/Counter/Counter.types.d.ts +1 -1
- package/dist/lib/components/DateRangePicker/DateRangePicker.types.d.ts +1 -1
- package/dist/lib/components/Drawer/Drawer.types.d.ts +1 -1
- package/dist/lib/components/Filter/Filter.types.d.ts +1 -1
- package/dist/lib/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.d.ts +2 -3
- package/dist/lib/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.d.ts +1 -2
- package/dist/lib/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.d.ts +2 -3
- package/dist/lib/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.types.d.ts +1 -1
- package/dist/lib/components/Filter/components/FilterDropdown/FilterDropdown.d.ts +3 -0
- package/dist/lib/components/Filter/components/FilterDropdown/FilterDropdown.types.d.ts +9 -0
- package/dist/lib/components/Filter/components/ResetButton/ResetButton.types.d.ts +1 -1
- package/dist/lib/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.d.ts +1 -2
- package/dist/lib/components/Filter/contexts/filter.context.d.ts +1 -0
- package/dist/lib/components/ImageUpload/ImageUpload.types.d.ts +1 -1
- package/dist/lib/components/Input/Input.types.d.ts +1 -1
- package/dist/lib/components/LineChart/LineChart.types.d.ts +1 -1
- package/dist/lib/components/Loading/Loading.types.d.ts +1 -1
- package/dist/lib/components/Modal/Modal.types.d.ts +1 -1
- package/dist/lib/components/Modal/components/Wrapper/Wrapper.types.d.ts +1 -1
- package/dist/lib/components/MultiSelectDropdown/components/Item/Item.types.d.ts +1 -1
- package/dist/lib/components/MultiSelectDropdown/components/List/List.types.d.ts +1 -1
- package/dist/lib/components/MultiSelectDropdown/components/Wrapper/Wrapper.types.d.ts +1 -1
- package/dist/lib/components/ProgressBar/ProgressBar.types.d.ts +1 -1
- package/dist/lib/components/Radio/Radio.types.d.ts +1 -1
- package/dist/lib/components/RadioCard/RadioCard.types.d.ts +1 -1
- package/dist/lib/components/RadioCardGroup/RadioCardGroup.types.d.ts +1 -1
- package/dist/lib/components/RadioGroup/RadioGroup.types.d.ts +1 -1
- package/dist/lib/components/Range/Range.types.d.ts +1 -1
- package/dist/lib/components/Select/Select.types.d.ts +1 -1
- package/dist/lib/components/Sidebar/Sidebar.types.d.ts +2 -2
- package/dist/lib/components/Sidebar/components/Label/Label.types.d.ts +1 -1
- package/dist/lib/components/Slider/Slider.types.d.ts +1 -1
- package/dist/lib/components/Spinner/Spinner.types.d.ts +2 -2
- package/dist/lib/components/Stepper/Stepper.types.d.ts +1 -1
- package/dist/lib/components/Stepper/components/StepItem/StepItem.types.d.ts +1 -1
- package/dist/lib/components/Switch/Switch.types.d.ts +1 -1
- package/dist/lib/components/Table/Table.types.d.ts +1 -1
- package/dist/lib/components/Tabs/Tabs.types.d.ts +1 -1
- package/dist/lib/components/TagSelect/TagSelect.types.d.ts +1 -1
- package/dist/lib/components/TagSelect/components/Item/Item.types.d.ts +2 -2
- package/dist/lib/components/TagSelect/components/List/List.types.d.ts +1 -1
- package/dist/lib/components/TagSelect/components/Wrapper/Wrapper.types.d.ts +1 -1
- package/dist/lib/components/TagSelect/contexts/TagSelect.types.d.ts +1 -1
- package/dist/lib/components/TextArea/TextArea.types.d.ts +1 -1
- package/dist/lib/components/Toast/Toast.types.d.ts +1 -1
- package/dist/lib/components/Typography/Typography.types.d.ts +1 -1
- package/dist/lib/components/VirtualizedTable/VirtualizedTable.types.d.ts +27 -3
- package/dist/lib/components/VirtualizedTable/components/Body/Body.d.ts +1 -1
- package/dist/lib/components/VirtualizedTable/components/Body/Body.types.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.types.d.ts +2 -0
- package/dist/lib/components/VirtualizedTable/components/Filter/Filter.types.d.ts +1 -1
- package/dist/lib/components/VirtualizedTable/components/Header/Header.d.ts +1 -1
- package/dist/lib/components/VirtualizedTable/components/Header/Header.types.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/components/Pagination/Pagination.types.d.ts +2 -0
- package/dist/lib/components/VirtualizedTable/components/TruncateText/TruncateText.types.d.ts +1 -1
- package/dist/lib/components/VirtualizedTable/contexts/table.context.d.ts +2 -0
- package/dist/lib/components/VirtualizedTable/contexts/table.provider.d.ts +1 -1
- package/dist/lib/components/VirtualizedTable/contexts/table.types.d.ts +1 -0
- package/dist/lib/contexts/theme.context.d.ts +1 -1
- package/dist/lib/contexts/theme.hook.d.ts +1 -1
- package/dist/package.json +34 -33
- package/dist/{phone-number.provider-CJJOFYk-.js → phone-number.provider-BxQCTxp8.js} +457 -457
- package/dist/{prop-types-CaJpPVsa.js → prop-types-CfEYxTbR.js} +52 -52
- package/dist/styles.css +1 -1
- package/dist/{table.provider-9uUt5a-s.js → table.provider-2sAkE7z_.js} +395 -368
- package/dist/{utils-B6A9pnrH.js → utils-B-BTGYA5.js} +193 -193
- package/dist/{x-CESTrenk.js → x-BI9jmc7e.js} +1 -1
- package/package.json +34 -33
- package/dist/AlertDialogTrigger-HhbFOOUE.js +0 -124
- package/dist/Checkbox-B1rTwzR3.js +0 -240
- package/dist/FlagSelectorList-BARhzfj2.js +0 -848
- package/dist/Switch-1RGhhTtg.js +0 -178
- package/dist/Toast-CS-igZor.js +0 -467
- package/dist/dist-7edduNXi.js +0 -398
- package/dist/dist-BkYHh2kH.js +0 -408
- package/dist/dist-C6Cif8-U.js +0 -28
- package/dist/dist-CeuUxVmT.js +0 -13
- package/dist/dist-CfYOvauX.js +0 -125
- package/dist/dist-CktbIsHq.js +0 -264
- package/dist/dist-DGqWMRtc.js +0 -183
- package/dist/dist-DdFwUrO22.js +0 -11
- package/dist/dist-DnGj9MTf.js +0 -1692
- package/dist/dist-eAwtFCCA.js +0 -87
- /package/dist/{dist-AihTpWdF2.js → dist-AihTpWdF.js} +0 -0
package/dist/Switch-1RGhhTtg.js
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import { a as N } from "./dist-DqKFpce5.js";
|
|
2
|
-
import { t as R } from "./dist-CVy-ulDZ.js";
|
|
3
|
-
import { t as v } from "./utils-Cx-WzRZF.js";
|
|
4
|
-
import { a as z, i as U, t as G } from "./dist-CfYOvauX.js";
|
|
5
|
-
import { Typography as I } from "./components/Typography/Typography.js";
|
|
6
|
-
import { t as L } from "./dist-DdFwUrO22.js";
|
|
7
|
-
import { t as O } from "./dist-DvoMuWKO2.js";
|
|
8
|
-
import { switchVariants as V, thumbVariants as D } from "./components/Switch/Switch.variants.js";
|
|
9
|
-
import * as b from "react";
|
|
10
|
-
import { forwardRef as W, useEffect as X, useId as J, useImperativeHandle as K, useRef as Q } from "react";
|
|
11
|
-
import { Fragment as Y, jsx as l, jsxs as x } from "react/jsx-runtime";
|
|
12
|
-
var g = "Switch", [Z, he] = z(g), [ee, _] = Z(g);
|
|
13
|
-
function te(e) {
|
|
14
|
-
const { __scopeSwitch: a, checked: o, children: i, defaultChecked: t, disabled: r, form: n, name: f, onCheckedChange: m, required: d, value: u = "on", internal_do_not_use_render: p } = e, [c, C] = G({
|
|
15
|
-
prop: o,
|
|
16
|
-
defaultProp: t ?? !1,
|
|
17
|
-
onChange: m,
|
|
18
|
-
caller: g
|
|
19
|
-
}), [h, s] = b.useState(null), [S, k] = b.useState(null), w = {
|
|
20
|
-
checked: c,
|
|
21
|
-
setChecked: C,
|
|
22
|
-
disabled: r,
|
|
23
|
-
control: h,
|
|
24
|
-
setControl: s,
|
|
25
|
-
name: f,
|
|
26
|
-
form: n,
|
|
27
|
-
value: u,
|
|
28
|
-
hasConsumerStoppedPropagationRef: b.useRef(!1),
|
|
29
|
-
required: d,
|
|
30
|
-
defaultChecked: t,
|
|
31
|
-
isFormControl: h ? !!n || !!h.closest("form") : !0,
|
|
32
|
-
bubbleInput: S,
|
|
33
|
-
setBubbleInput: k
|
|
34
|
-
};
|
|
35
|
-
return /* @__PURE__ */ l(ee, {
|
|
36
|
-
scope: a,
|
|
37
|
-
...w,
|
|
38
|
-
children: re(p) ? p(w) : i
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
var P = "SwitchTrigger", E = b.forwardRef(({ __scopeSwitch: e, onClick: a, ...o }, i) => {
|
|
42
|
-
const { value: t, disabled: r, checked: n, required: f, setControl: m, setChecked: d, hasConsumerStoppedPropagationRef: u, isFormControl: p, bubbleInput: c } = _(P, e), C = N(i, m);
|
|
43
|
-
return /* @__PURE__ */ l(R.button, {
|
|
44
|
-
type: "button",
|
|
45
|
-
role: "switch",
|
|
46
|
-
"aria-checked": n,
|
|
47
|
-
"aria-required": f,
|
|
48
|
-
"data-state": q(n),
|
|
49
|
-
"data-disabled": r ? "" : void 0,
|
|
50
|
-
disabled: r,
|
|
51
|
-
value: t,
|
|
52
|
-
...o,
|
|
53
|
-
ref: C,
|
|
54
|
-
onClick: U(a, (h) => {
|
|
55
|
-
d((s) => !s), c && p && (u.current = h.isPropagationStopped(), u.current || h.stopPropagation());
|
|
56
|
-
})
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
E.displayName = P;
|
|
60
|
-
var T = b.forwardRef((e, a) => {
|
|
61
|
-
const { __scopeSwitch: o, name: i, checked: t, defaultChecked: r, required: n, disabled: f, value: m, onCheckedChange: d, form: u, ...p } = e;
|
|
62
|
-
return /* @__PURE__ */ l(te, {
|
|
63
|
-
__scopeSwitch: o,
|
|
64
|
-
checked: t,
|
|
65
|
-
defaultChecked: r,
|
|
66
|
-
disabled: f,
|
|
67
|
-
required: n,
|
|
68
|
-
onCheckedChange: d,
|
|
69
|
-
name: i,
|
|
70
|
-
form: u,
|
|
71
|
-
value: m,
|
|
72
|
-
internal_do_not_use_render: ({ isFormControl: c }) => /* @__PURE__ */ x(Y, { children: [/* @__PURE__ */ l(E, {
|
|
73
|
-
...p,
|
|
74
|
-
ref: a,
|
|
75
|
-
__scopeSwitch: o
|
|
76
|
-
}), c && /* @__PURE__ */ l($, { __scopeSwitch: o })] })
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
T.displayName = g;
|
|
80
|
-
var B = "SwitchThumb", F = b.forwardRef((e, a) => {
|
|
81
|
-
const { __scopeSwitch: o, ...i } = e, t = _(B, o);
|
|
82
|
-
return /* @__PURE__ */ l(R.span, {
|
|
83
|
-
"data-state": q(t.checked),
|
|
84
|
-
"data-disabled": t.disabled ? "" : void 0,
|
|
85
|
-
...i,
|
|
86
|
-
ref: a
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
F.displayName = B;
|
|
90
|
-
var M = "SwitchBubbleInput", $ = b.forwardRef(({ __scopeSwitch: e, ...a }, o) => {
|
|
91
|
-
const { control: i, hasConsumerStoppedPropagationRef: t, checked: r, defaultChecked: n, required: f, disabled: m, name: d, value: u, form: p, bubbleInput: c, setBubbleInput: C } = _(M, e), h = N(o, C), s = L(r), S = O(i);
|
|
92
|
-
b.useEffect(() => {
|
|
93
|
-
const w = c;
|
|
94
|
-
if (!w) return;
|
|
95
|
-
const H = window.HTMLInputElement.prototype, y = Object.getOwnPropertyDescriptor(H, "checked").set, A = !t.current;
|
|
96
|
-
if (s !== r && y) {
|
|
97
|
-
const j = new Event("click", { bubbles: A });
|
|
98
|
-
y.call(w, r), w.dispatchEvent(j);
|
|
99
|
-
}
|
|
100
|
-
}, [
|
|
101
|
-
c,
|
|
102
|
-
s,
|
|
103
|
-
r,
|
|
104
|
-
t
|
|
105
|
-
]);
|
|
106
|
-
const k = b.useRef(r);
|
|
107
|
-
return /* @__PURE__ */ l(R.input, {
|
|
108
|
-
type: "checkbox",
|
|
109
|
-
"aria-hidden": !0,
|
|
110
|
-
defaultChecked: n ?? k.current,
|
|
111
|
-
required: f,
|
|
112
|
-
disabled: m,
|
|
113
|
-
name: d,
|
|
114
|
-
value: u,
|
|
115
|
-
form: p,
|
|
116
|
-
...a,
|
|
117
|
-
tabIndex: -1,
|
|
118
|
-
ref: h,
|
|
119
|
-
style: {
|
|
120
|
-
...a.style,
|
|
121
|
-
...S,
|
|
122
|
-
position: "absolute",
|
|
123
|
-
pointerEvents: "none",
|
|
124
|
-
opacity: 0,
|
|
125
|
-
margin: 0,
|
|
126
|
-
transform: "translateX(-100%)"
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
$.displayName = M;
|
|
131
|
-
function re(e) {
|
|
132
|
-
return typeof e == "function";
|
|
133
|
-
}
|
|
134
|
-
function q(e) {
|
|
135
|
-
return e ? "checked" : "unchecked";
|
|
136
|
-
}
|
|
137
|
-
var fe = W(({ alignment: e = "horizontal", className: a, defaultChecked: o, disabled: i = !1, helperText: t, helperTextClassName: r, label: n, labelClassName: f, labelWrapperClassName: m, name: d, theme: u, thumbClassName: p, value: c, onChange: C }, h) => {
|
|
138
|
-
const s = Q(null), S = J(), k = d ? `${S}-${d}` : S;
|
|
139
|
-
return K(h, () => s.current, [s]), X(() => {
|
|
140
|
-
s.current && (s.current.value = `${c}`);
|
|
141
|
-
}, [c]), /* @__PURE__ */ x("div", {
|
|
142
|
-
className: v("w-full", "flex", "gap-3", e === "vertical" ? "flex-col" : "flex-row", m),
|
|
143
|
-
"data-theme": u,
|
|
144
|
-
children: [
|
|
145
|
-
/* @__PURE__ */ l(T, {
|
|
146
|
-
id: k,
|
|
147
|
-
defaultChecked: o,
|
|
148
|
-
checked: c,
|
|
149
|
-
onCheckedChange: (w) => C?.(w),
|
|
150
|
-
className: v(V({ className: a })),
|
|
151
|
-
"aria-label": n,
|
|
152
|
-
disabled: i,
|
|
153
|
-
children: /* @__PURE__ */ l(F, { className: D({ className: p }) })
|
|
154
|
-
}),
|
|
155
|
-
n ? /* @__PURE__ */ x(I, {
|
|
156
|
-
component: "label",
|
|
157
|
-
className: v("flex", "flex-col", "text-sm", "dark:text-white", "select-none", f),
|
|
158
|
-
htmlFor: k,
|
|
159
|
-
style: { paddingRight: 15 },
|
|
160
|
-
children: [n, t ? /* @__PURE__ */ l(I, {
|
|
161
|
-
component: "span",
|
|
162
|
-
className: v("text-xs", "select-none", "text-slate-600", "dark:text-metal-400", r),
|
|
163
|
-
children: t
|
|
164
|
-
}) : null]
|
|
165
|
-
}) : null,
|
|
166
|
-
/* @__PURE__ */ l("input", {
|
|
167
|
-
ref: s,
|
|
168
|
-
name: d,
|
|
169
|
-
type: "text",
|
|
170
|
-
className: "hidden",
|
|
171
|
-
"aria-hidden": "true"
|
|
172
|
-
})
|
|
173
|
-
]
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
export {
|
|
177
|
-
fe as t
|
|
178
|
-
};
|
package/dist/Toast-CS-igZor.js
DELETED
|
@@ -1,467 +0,0 @@
|
|
|
1
|
-
import { t as ge } from "./x-CESTrenk.js";
|
|
2
|
-
import { a as ae, t as Y } from "./dist-DqKFpce5.js";
|
|
3
|
-
import { n as be, t as D } from "./dist-CVy-ulDZ.js";
|
|
4
|
-
import { n as ie, t as Se } from "./dist-C6Cif8-U.js";
|
|
5
|
-
import { t as W } from "./utils-Cx-WzRZF.js";
|
|
6
|
-
import { CheckCircleFilledIcon as Ne } from "./assets/icons/components/CheckCircleFilled.js";
|
|
7
|
-
import { ErrorIcon as Ae } from "./assets/icons/components/Error.js";
|
|
8
|
-
import { InformationOutlineIcon as _e } from "./assets/icons/components/InformationOutline.js";
|
|
9
|
-
import { WarningTriangleIcon as De } from "./assets/icons/components/WarningTriangle.js";
|
|
10
|
-
import { a as Ie, i as g, r as Fe, t as Le } from "./dist-CfYOvauX.js";
|
|
11
|
-
import { t as H } from "./dist-ppXKUlVt.js";
|
|
12
|
-
import { i as Me, n as ke, t as Oe } from "./dist-DGqWMRtc.js";
|
|
13
|
-
import { t as Ve } from "./dist-eAwtFCCA.js";
|
|
14
|
-
import { t as Ke } from "./dist-C8NWUTUh.js";
|
|
15
|
-
import { closeToastVariants as We, toastVariants as $e, viewportToastVariants as He } from "./components/Toast/Toast.variants.js";
|
|
16
|
-
import * as n from "react";
|
|
17
|
-
import { isValidElement as z, useCallback as Xe, useEffect as Ue, useMemo as oe, useRef as Ye } from "react";
|
|
18
|
-
import * as ze from "react-dom";
|
|
19
|
-
import { Fragment as ce, jsx as s, jsxs as A } from "react/jsx-runtime";
|
|
20
|
-
var J = "ToastProvider", [Q, Be, je] = Ke("Toast"), [ue, It] = Ie("Toast", [je]), [qe, X] = ue(J), le = (t) => {
|
|
21
|
-
const { __scopeToast: r, label: e = "Notification", duration: o = 5e3, swipeDirection: a = "right", swipeThreshold: d = 50, announcerContainer: p, children: T } = t, [v, i] = n.useState(null), [C, m] = n.useState(0), x = n.useRef(!1), S = n.useRef(!1);
|
|
22
|
-
return e.trim() || console.error(`Invalid prop \`label\` supplied to \`${J}\`. Expected non-empty \`string\`.`), /* @__PURE__ */ s(Q.Provider, {
|
|
23
|
-
scope: r,
|
|
24
|
-
children: /* @__PURE__ */ s(qe, {
|
|
25
|
-
scope: r,
|
|
26
|
-
label: e,
|
|
27
|
-
duration: o,
|
|
28
|
-
swipeDirection: a,
|
|
29
|
-
swipeThreshold: d,
|
|
30
|
-
toastCount: C,
|
|
31
|
-
viewport: v,
|
|
32
|
-
onViewportChange: i,
|
|
33
|
-
onToastAdd: n.useCallback(() => m((h) => h + 1), []),
|
|
34
|
-
onToastRemove: n.useCallback(() => m((h) => h - 1), []),
|
|
35
|
-
isFocusedToastEscapeKeyDownRef: x,
|
|
36
|
-
isClosePausedRef: S,
|
|
37
|
-
announcerContainer: p,
|
|
38
|
-
children: T
|
|
39
|
-
})
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
le.displayName = J;
|
|
43
|
-
var de = "ToastViewport", Ge = ["F8"], j = "toast.viewportPause", q = "toast.viewportResume", fe = n.forwardRef((t, r) => {
|
|
44
|
-
const { __scopeToast: e, hotkey: o = Ge, label: a = "Notifications ({hotkey})", ...d } = t, p = X(de, e), T = Be(e), v = n.useRef(null), i = n.useRef(null), C = n.useRef(null), m = n.useRef(null), x = ae(r, m, p.onViewportChange), S = o.join("+").replace(/Key/g, "").replace(/Digit/g, ""), h = p.toastCount > 0;
|
|
45
|
-
n.useEffect(() => {
|
|
46
|
-
const l = (E) => {
|
|
47
|
-
o.length !== 0 && o.every((f) => E[f] || E.code === f) && m.current?.focus();
|
|
48
|
-
};
|
|
49
|
-
return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
|
|
50
|
-
}, [o]), n.useEffect(() => {
|
|
51
|
-
const l = v.current, E = m.current;
|
|
52
|
-
if (h && l && E) {
|
|
53
|
-
const f = () => {
|
|
54
|
-
if (!p.isClosePausedRef.current) {
|
|
55
|
-
const R = new CustomEvent(j);
|
|
56
|
-
E.dispatchEvent(R), p.isClosePausedRef.current = !0;
|
|
57
|
-
}
|
|
58
|
-
}, w = () => {
|
|
59
|
-
if (p.isClosePausedRef.current) {
|
|
60
|
-
const R = new CustomEvent(q);
|
|
61
|
-
E.dispatchEvent(R), p.isClosePausedRef.current = !1;
|
|
62
|
-
}
|
|
63
|
-
}, y = (R) => {
|
|
64
|
-
l.contains(R.relatedTarget) || w();
|
|
65
|
-
}, P = () => {
|
|
66
|
-
l.contains(document.activeElement) || w();
|
|
67
|
-
};
|
|
68
|
-
return l.addEventListener("focusin", f), l.addEventListener("focusout", y), l.addEventListener("pointermove", f), l.addEventListener("pointerleave", P), window.addEventListener("blur", f), window.addEventListener("focus", w), () => {
|
|
69
|
-
l.removeEventListener("focusin", f), l.removeEventListener("focusout", y), l.removeEventListener("pointermove", f), l.removeEventListener("pointerleave", P), window.removeEventListener("blur", f), window.removeEventListener("focus", w);
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
}, [h, p.isClosePausedRef]);
|
|
73
|
-
const u = n.useCallback(({ tabbingDirection: l }) => {
|
|
74
|
-
const E = T().map((f) => {
|
|
75
|
-
const w = f.ref.current, y = [w, ...ut(w)];
|
|
76
|
-
return l === "forwards" ? y : y.reverse();
|
|
77
|
-
});
|
|
78
|
-
return (l === "forwards" ? E.reverse() : E).flat();
|
|
79
|
-
}, [T]);
|
|
80
|
-
return n.useEffect(() => {
|
|
81
|
-
const l = m.current;
|
|
82
|
-
if (l) {
|
|
83
|
-
const E = (f) => {
|
|
84
|
-
const w = f.altKey || f.ctrlKey || f.metaKey;
|
|
85
|
-
if (f.key === "Tab" && !w) {
|
|
86
|
-
const y = document.activeElement, P = f.shiftKey;
|
|
87
|
-
if (f.target === l && P) {
|
|
88
|
-
i.current?.focus();
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
const R = u({ tabbingDirection: P ? "backwards" : "forwards" }), I = R.findIndex((_) => _ === y);
|
|
92
|
-
B(R.slice(I + 1)) ? f.preventDefault() : P ? i.current?.focus() : C.current?.focus();
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
return l.addEventListener("keydown", E), () => l.removeEventListener("keydown", E);
|
|
96
|
-
}
|
|
97
|
-
}, [T, u]), /* @__PURE__ */ A(ke, {
|
|
98
|
-
ref: v,
|
|
99
|
-
role: "region",
|
|
100
|
-
"aria-label": a.replace("{hotkey}", S),
|
|
101
|
-
tabIndex: -1,
|
|
102
|
-
style: { pointerEvents: h ? void 0 : "none" },
|
|
103
|
-
children: [
|
|
104
|
-
h && /* @__PURE__ */ s(G, {
|
|
105
|
-
ref: i,
|
|
106
|
-
onFocusFromOutsideViewport: () => {
|
|
107
|
-
B(u({ tabbingDirection: "forwards" }));
|
|
108
|
-
}
|
|
109
|
-
}),
|
|
110
|
-
/* @__PURE__ */ s(Q.Slot, {
|
|
111
|
-
scope: e,
|
|
112
|
-
children: /* @__PURE__ */ s(D.ol, {
|
|
113
|
-
tabIndex: -1,
|
|
114
|
-
...d,
|
|
115
|
-
ref: x
|
|
116
|
-
})
|
|
117
|
-
}),
|
|
118
|
-
h && /* @__PURE__ */ s(G, {
|
|
119
|
-
ref: C,
|
|
120
|
-
onFocusFromOutsideViewport: () => {
|
|
121
|
-
B(u({ tabbingDirection: "backwards" }));
|
|
122
|
-
}
|
|
123
|
-
})
|
|
124
|
-
]
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
fe.displayName = de;
|
|
128
|
-
var pe = "ToastFocusProxy", G = n.forwardRef((t, r) => {
|
|
129
|
-
const { __scopeToast: e, onFocusFromOutsideViewport: o, ...a } = t, d = X(pe, e);
|
|
130
|
-
return /* @__PURE__ */ s(ie, {
|
|
131
|
-
tabIndex: 0,
|
|
132
|
-
...a,
|
|
133
|
-
ref: r,
|
|
134
|
-
style: { position: "fixed" },
|
|
135
|
-
onFocus: (p) => {
|
|
136
|
-
const T = p.relatedTarget;
|
|
137
|
-
d.viewport?.contains(T) || o();
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
G.displayName = pe;
|
|
142
|
-
var k = "Toast", Je = "toast.swipeStart", Qe = "toast.swipeMove", Ze = "toast.swipeCancel", et = "toast.swipeEnd", me = n.forwardRef((t, r) => {
|
|
143
|
-
const { forceMount: e, open: o, defaultOpen: a, onOpenChange: d, ...p } = t, [T, v] = Le({
|
|
144
|
-
prop: o,
|
|
145
|
-
defaultProp: a ?? !0,
|
|
146
|
-
onChange: d,
|
|
147
|
-
caller: k
|
|
148
|
-
});
|
|
149
|
-
return /* @__PURE__ */ s(Ve, {
|
|
150
|
-
present: e || T,
|
|
151
|
-
children: /* @__PURE__ */ s(ot, {
|
|
152
|
-
open: T,
|
|
153
|
-
...p,
|
|
154
|
-
ref: r,
|
|
155
|
-
onClose: () => v(!1),
|
|
156
|
-
onPause: H(t.onPause),
|
|
157
|
-
onResume: H(t.onResume),
|
|
158
|
-
onSwipeStart: g(t.onSwipeStart, (i) => {
|
|
159
|
-
i.currentTarget.setAttribute("data-swipe", "start");
|
|
160
|
-
}),
|
|
161
|
-
onSwipeMove: g(t.onSwipeMove, (i) => {
|
|
162
|
-
const { x: C, y: m } = i.detail.delta;
|
|
163
|
-
i.currentTarget.setAttribute("data-swipe", "move"), i.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${C}px`), i.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${m}px`);
|
|
164
|
-
}),
|
|
165
|
-
onSwipeCancel: g(t.onSwipeCancel, (i) => {
|
|
166
|
-
i.currentTarget.setAttribute("data-swipe", "cancel"), i.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), i.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), i.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"), i.currentTarget.style.removeProperty("--radix-toast-swipe-end-y");
|
|
167
|
-
}),
|
|
168
|
-
onSwipeEnd: g(t.onSwipeEnd, (i) => {
|
|
169
|
-
const { x: C, y: m } = i.detail.delta;
|
|
170
|
-
i.currentTarget.setAttribute("data-swipe", "end"), i.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), i.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), i.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${C}px`), i.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${m}px`), v(!1);
|
|
171
|
-
})
|
|
172
|
-
})
|
|
173
|
-
});
|
|
174
|
-
});
|
|
175
|
-
me.displayName = k;
|
|
176
|
-
var [tt, rt] = ue(k, { onClose() {
|
|
177
|
-
} }), ot = n.forwardRef((t, r) => {
|
|
178
|
-
const { __scopeToast: e, type: o = "foreground", duration: a, open: d, onClose: p, onEscapeKeyDown: T, onPause: v, onResume: i, onSwipeStart: C, onSwipeMove: m, onSwipeCancel: x, onSwipeEnd: S, ...h } = t, u = X(k, e), [l, E] = n.useState(null), f = ae(r, E), w = n.useRef(null), y = n.useRef(null), P = a || u.duration, R = n.useRef(0), I = n.useRef(P), _ = n.useRef(0), { onToastAdd: Z, onToastRemove: ee } = u, F = H(() => {
|
|
179
|
-
l?.contains(document.activeElement) && u.viewport?.focus(), p();
|
|
180
|
-
}), O = n.useCallback((c) => {
|
|
181
|
-
!c || c === 1 / 0 || (window.clearTimeout(_.current), R.current = (/* @__PURE__ */ new Date()).getTime(), _.current = window.setTimeout(F, c));
|
|
182
|
-
}, [F]);
|
|
183
|
-
n.useEffect(() => {
|
|
184
|
-
const c = u.viewport;
|
|
185
|
-
if (c) {
|
|
186
|
-
const b = () => {
|
|
187
|
-
O(I.current), i?.();
|
|
188
|
-
}, N = () => {
|
|
189
|
-
const L = (/* @__PURE__ */ new Date()).getTime() - R.current;
|
|
190
|
-
I.current = I.current - L, window.clearTimeout(_.current), v?.();
|
|
191
|
-
};
|
|
192
|
-
return c.addEventListener(j, N), c.addEventListener(q, b), () => {
|
|
193
|
-
c.removeEventListener(j, N), c.removeEventListener(q, b);
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
}, [
|
|
197
|
-
u.viewport,
|
|
198
|
-
P,
|
|
199
|
-
v,
|
|
200
|
-
i,
|
|
201
|
-
O
|
|
202
|
-
]), n.useEffect(() => {
|
|
203
|
-
d && !u.isClosePausedRef.current && O(P);
|
|
204
|
-
}, [
|
|
205
|
-
d,
|
|
206
|
-
P,
|
|
207
|
-
u.isClosePausedRef,
|
|
208
|
-
O
|
|
209
|
-
]), n.useEffect(() => () => {
|
|
210
|
-
window.clearTimeout(_.current);
|
|
211
|
-
}, []), n.useEffect(() => (Z(), () => ee()), [Z, ee]);
|
|
212
|
-
const te = n.useMemo(() => l ? xe(l) : null, [l]);
|
|
213
|
-
return u.viewport ? /* @__PURE__ */ A(ce, { children: [te && /* @__PURE__ */ s(nt, {
|
|
214
|
-
__scopeToast: e,
|
|
215
|
-
role: "status",
|
|
216
|
-
"aria-live": o === "foreground" ? "assertive" : "polite",
|
|
217
|
-
children: te
|
|
218
|
-
}), /* @__PURE__ */ s(tt, {
|
|
219
|
-
scope: e,
|
|
220
|
-
onClose: F,
|
|
221
|
-
children: ze.createPortal(/* @__PURE__ */ s(Q.ItemSlot, {
|
|
222
|
-
scope: e,
|
|
223
|
-
children: /* @__PURE__ */ s(Me, {
|
|
224
|
-
asChild: !0,
|
|
225
|
-
onEscapeKeyDown: g(T, () => {
|
|
226
|
-
u.isFocusedToastEscapeKeyDownRef.current || F(), u.isFocusedToastEscapeKeyDownRef.current = !1;
|
|
227
|
-
}),
|
|
228
|
-
children: /* @__PURE__ */ s(D.li, {
|
|
229
|
-
tabIndex: 0,
|
|
230
|
-
"data-state": d ? "open" : "closed",
|
|
231
|
-
"data-swipe-direction": u.swipeDirection,
|
|
232
|
-
...h,
|
|
233
|
-
ref: f,
|
|
234
|
-
style: {
|
|
235
|
-
userSelect: "none",
|
|
236
|
-
touchAction: "none",
|
|
237
|
-
...t.style
|
|
238
|
-
},
|
|
239
|
-
onKeyDown: g(t.onKeyDown, (c) => {
|
|
240
|
-
c.key === "Escape" && (T?.(c.nativeEvent), c.nativeEvent.defaultPrevented || (u.isFocusedToastEscapeKeyDownRef.current = !0, F()));
|
|
241
|
-
}),
|
|
242
|
-
onPointerDown: g(t.onPointerDown, (c) => {
|
|
243
|
-
c.button === 0 && (w.current = {
|
|
244
|
-
x: c.clientX,
|
|
245
|
-
y: c.clientY
|
|
246
|
-
});
|
|
247
|
-
}),
|
|
248
|
-
onPointerMove: g(t.onPointerMove, (c) => {
|
|
249
|
-
if (!w.current) return;
|
|
250
|
-
const b = c.clientX - w.current.x, N = c.clientY - w.current.y, L = !!y.current, M = ["left", "right"].includes(u.swipeDirection), V = ["left", "up"].includes(u.swipeDirection) ? Math.min : Math.max, Pe = M ? V(0, b) : 0, Re = M ? 0 : V(0, N), U = c.pointerType === "touch" ? 10 : 2, K = {
|
|
251
|
-
x: Pe,
|
|
252
|
-
y: Re
|
|
253
|
-
}, re = {
|
|
254
|
-
originalEvent: c,
|
|
255
|
-
delta: K
|
|
256
|
-
};
|
|
257
|
-
L ? (y.current = K, $(Qe, m, re, { discrete: !1 })) : ne(K, u.swipeDirection, U) ? (y.current = K, $(Je, C, re, { discrete: !1 }), c.target.setPointerCapture(c.pointerId)) : (Math.abs(b) > U || Math.abs(N) > U) && (w.current = null);
|
|
258
|
-
}),
|
|
259
|
-
onPointerUp: g(t.onPointerUp, (c) => {
|
|
260
|
-
const b = y.current, N = c.target;
|
|
261
|
-
if (N.hasPointerCapture(c.pointerId) && N.releasePointerCapture(c.pointerId), y.current = null, w.current = null, b) {
|
|
262
|
-
const L = c.currentTarget, M = {
|
|
263
|
-
originalEvent: c,
|
|
264
|
-
delta: b
|
|
265
|
-
};
|
|
266
|
-
ne(b, u.swipeDirection, u.swipeThreshold) ? $(et, S, M, { discrete: !0 }) : $(Ze, x, M, { discrete: !0 }), L.addEventListener("click", (V) => V.preventDefault(), { once: !0 });
|
|
267
|
-
}
|
|
268
|
-
})
|
|
269
|
-
})
|
|
270
|
-
})
|
|
271
|
-
}), u.viewport)
|
|
272
|
-
})] }) : null;
|
|
273
|
-
}), nt = (t) => {
|
|
274
|
-
const { __scopeToast: r, children: e, ...o } = t, a = X(k, r), [d, p] = n.useState(!1), [T, v] = n.useState(!1);
|
|
275
|
-
return it(() => p(!0)), n.useEffect(() => {
|
|
276
|
-
const i = window.setTimeout(() => v(!0), 1e3);
|
|
277
|
-
return () => window.clearTimeout(i);
|
|
278
|
-
}, []), T ? null : /* @__PURE__ */ s(Oe, {
|
|
279
|
-
asChild: !0,
|
|
280
|
-
container: a.announcerContainer || void 0,
|
|
281
|
-
children: /* @__PURE__ */ s(ie, {
|
|
282
|
-
...o,
|
|
283
|
-
children: d && /* @__PURE__ */ A(ce, { children: [
|
|
284
|
-
a.label,
|
|
285
|
-
" ",
|
|
286
|
-
e
|
|
287
|
-
] })
|
|
288
|
-
})
|
|
289
|
-
});
|
|
290
|
-
}, st = "ToastTitle", Te = n.forwardRef((t, r) => {
|
|
291
|
-
const { __scopeToast: e, ...o } = t;
|
|
292
|
-
return /* @__PURE__ */ s(D.div, {
|
|
293
|
-
...o,
|
|
294
|
-
ref: r
|
|
295
|
-
});
|
|
296
|
-
});
|
|
297
|
-
Te.displayName = st;
|
|
298
|
-
var at = "ToastDescription", we = n.forwardRef((t, r) => {
|
|
299
|
-
const { __scopeToast: e, ...o } = t;
|
|
300
|
-
return /* @__PURE__ */ s(D.div, {
|
|
301
|
-
...o,
|
|
302
|
-
ref: r
|
|
303
|
-
});
|
|
304
|
-
});
|
|
305
|
-
we.displayName = at;
|
|
306
|
-
var ve = "ToastAction", Ee = n.forwardRef((t, r) => {
|
|
307
|
-
const { altText: e, ...o } = t;
|
|
308
|
-
return e.trim() ? /* @__PURE__ */ s(Ce, {
|
|
309
|
-
altText: e,
|
|
310
|
-
asChild: !0,
|
|
311
|
-
children: /* @__PURE__ */ s(ye, {
|
|
312
|
-
...o,
|
|
313
|
-
ref: r
|
|
314
|
-
})
|
|
315
|
-
}) : (console.error(`Invalid prop \`altText\` supplied to \`${ve}\`. Expected non-empty \`string\`.`), null);
|
|
316
|
-
});
|
|
317
|
-
Ee.displayName = ve;
|
|
318
|
-
var he = "ToastClose", ye = n.forwardRef((t, r) => {
|
|
319
|
-
const { __scopeToast: e, ...o } = t, a = rt(he, e);
|
|
320
|
-
return /* @__PURE__ */ s(Ce, {
|
|
321
|
-
asChild: !0,
|
|
322
|
-
children: /* @__PURE__ */ s(D.button, {
|
|
323
|
-
type: "button",
|
|
324
|
-
...o,
|
|
325
|
-
ref: r,
|
|
326
|
-
onClick: g(t.onClick, a.onClose)
|
|
327
|
-
})
|
|
328
|
-
});
|
|
329
|
-
});
|
|
330
|
-
ye.displayName = he;
|
|
331
|
-
var Ce = n.forwardRef((t, r) => {
|
|
332
|
-
const { __scopeToast: e, altText: o, ...a } = t;
|
|
333
|
-
return /* @__PURE__ */ s(D.div, {
|
|
334
|
-
"data-radix-toast-announce-exclude": "",
|
|
335
|
-
"data-radix-toast-announce-alt": o || void 0,
|
|
336
|
-
...a,
|
|
337
|
-
ref: r
|
|
338
|
-
});
|
|
339
|
-
});
|
|
340
|
-
function xe(t) {
|
|
341
|
-
const r = [];
|
|
342
|
-
return Array.from(t.childNodes).forEach((e) => {
|
|
343
|
-
if (e.nodeType === e.TEXT_NODE && e.textContent && r.push(e.textContent), ct(e)) {
|
|
344
|
-
const o = e.ariaHidden || e.hidden || e.style.display === "none", a = e.dataset.radixToastAnnounceExclude === "";
|
|
345
|
-
if (!o) if (a) {
|
|
346
|
-
const d = e.dataset.radixToastAnnounceAlt;
|
|
347
|
-
d && r.push(d);
|
|
348
|
-
} else r.push(...xe(e));
|
|
349
|
-
}
|
|
350
|
-
}), r;
|
|
351
|
-
}
|
|
352
|
-
function $(t, r, e, { discrete: o }) {
|
|
353
|
-
const a = e.originalEvent.currentTarget, d = new CustomEvent(t, {
|
|
354
|
-
bubbles: !0,
|
|
355
|
-
cancelable: !0,
|
|
356
|
-
detail: e
|
|
357
|
-
});
|
|
358
|
-
r && a.addEventListener(t, r, { once: !0 }), o ? be(a, d) : a.dispatchEvent(d);
|
|
359
|
-
}
|
|
360
|
-
var ne = (t, r, e = 0) => {
|
|
361
|
-
const o = Math.abs(t.x), a = Math.abs(t.y), d = o > a;
|
|
362
|
-
return r === "left" || r === "right" ? d && o > e : !d && a > e;
|
|
363
|
-
};
|
|
364
|
-
function it(t = () => {
|
|
365
|
-
}) {
|
|
366
|
-
const r = H(t);
|
|
367
|
-
Fe(() => {
|
|
368
|
-
let e = 0, o = 0;
|
|
369
|
-
return e = window.requestAnimationFrame(() => o = window.requestAnimationFrame(r)), () => {
|
|
370
|
-
window.cancelAnimationFrame(e), window.cancelAnimationFrame(o);
|
|
371
|
-
};
|
|
372
|
-
}, [r]);
|
|
373
|
-
}
|
|
374
|
-
function ct(t) {
|
|
375
|
-
return t.nodeType === t.ELEMENT_NODE;
|
|
376
|
-
}
|
|
377
|
-
function ut(t) {
|
|
378
|
-
const r = [], e = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, { acceptNode: (o) => {
|
|
379
|
-
const a = o.tagName === "INPUT" && o.type === "hidden";
|
|
380
|
-
return o.disabled || o.hidden || a ? NodeFilter.FILTER_SKIP : o.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
381
|
-
} });
|
|
382
|
-
for (; e.nextNode(); ) r.push(e.currentNode);
|
|
383
|
-
return r;
|
|
384
|
-
}
|
|
385
|
-
function B(t) {
|
|
386
|
-
const r = document.activeElement;
|
|
387
|
-
return t.some((e) => e === r ? !0 : (e.focus(), document.activeElement !== r));
|
|
388
|
-
}
|
|
389
|
-
var lt = le, dt = fe, ft = me, pt = Te, se = we, mt = Ee, Ft = ({ title: t, duration: r = 5e3, titleClassName: e, descriptionClassName: o, description: a, children: d, theme: p, showCloseButton: T = !0, closeButtonClassName: v, className: i, open: C = !1, setOpen: m, variant: x }) => {
|
|
390
|
-
const S = Ye(0);
|
|
391
|
-
Ue(() => () => clearTimeout(S.current), []);
|
|
392
|
-
const h = oe(() => z(t) ? /* @__PURE__ */ s(Y, {
|
|
393
|
-
className: e,
|
|
394
|
-
children: t
|
|
395
|
-
}) : t, [t, e]), u = oe(() => z(a) ? /* @__PURE__ */ s(Y, {
|
|
396
|
-
className: o,
|
|
397
|
-
children: a
|
|
398
|
-
}) : a, [a, o]);
|
|
399
|
-
return /* @__PURE__ */ A(lt, {
|
|
400
|
-
swipeDirection: "right",
|
|
401
|
-
duration: r,
|
|
402
|
-
children: [
|
|
403
|
-
/* @__PURE__ */ s(Y, {
|
|
404
|
-
onClick: Xe(() => {
|
|
405
|
-
m(!1), S.current = window.setTimeout(() => m(!0), 100);
|
|
406
|
-
}, [m]),
|
|
407
|
-
children: d
|
|
408
|
-
}),
|
|
409
|
-
/* @__PURE__ */ A(ft, {
|
|
410
|
-
className: W($e({
|
|
411
|
-
variant: x,
|
|
412
|
-
className: i
|
|
413
|
-
})),
|
|
414
|
-
"data-theme": p,
|
|
415
|
-
open: C,
|
|
416
|
-
onOpenChange: m,
|
|
417
|
-
children: [/* @__PURE__ */ A("div", {
|
|
418
|
-
className: "flex gap-2 items-center flex-1",
|
|
419
|
-
children: [
|
|
420
|
-
x === "success" && /* @__PURE__ */ s(Ne, {
|
|
421
|
-
size: 20,
|
|
422
|
-
className: "shrink-0"
|
|
423
|
-
}),
|
|
424
|
-
x === "error" && /* @__PURE__ */ s(Ae, {
|
|
425
|
-
size: 20,
|
|
426
|
-
className: "shrink-0"
|
|
427
|
-
}),
|
|
428
|
-
x === "warning" && /* @__PURE__ */ s(De, {
|
|
429
|
-
size: 20,
|
|
430
|
-
className: "shrink-0"
|
|
431
|
-
}),
|
|
432
|
-
x === "info" && /* @__PURE__ */ s(_e, {
|
|
433
|
-
size: 20,
|
|
434
|
-
className: "shrink-0"
|
|
435
|
-
}),
|
|
436
|
-
/* @__PURE__ */ A("div", {
|
|
437
|
-
className: "flex flex-col gap-1",
|
|
438
|
-
children: [/* @__PURE__ */ s(pt, {
|
|
439
|
-
asChild: !0,
|
|
440
|
-
className: e,
|
|
441
|
-
children: h
|
|
442
|
-
}), u && (z(u) ? /* @__PURE__ */ s(se, {
|
|
443
|
-
asChild: !0,
|
|
444
|
-
children: u
|
|
445
|
-
}) : /* @__PURE__ */ s(se, {
|
|
446
|
-
className: W("text-sm", o),
|
|
447
|
-
children: u
|
|
448
|
-
}))]
|
|
449
|
-
})
|
|
450
|
-
]
|
|
451
|
-
}), T && /* @__PURE__ */ s(mt, {
|
|
452
|
-
asChild: !0,
|
|
453
|
-
altText: "Close the toast",
|
|
454
|
-
children: /* @__PURE__ */ A("button", {
|
|
455
|
-
type: "button",
|
|
456
|
-
className: "cursor-pointer",
|
|
457
|
-
children: [/* @__PURE__ */ s(ge, { className: W(We({ className: v })) }), /* @__PURE__ */ s(Se, { children: "Close toast" })]
|
|
458
|
-
})
|
|
459
|
-
})]
|
|
460
|
-
}),
|
|
461
|
-
/* @__PURE__ */ s(dt, { className: W(He()) })
|
|
462
|
-
]
|
|
463
|
-
});
|
|
464
|
-
};
|
|
465
|
-
export {
|
|
466
|
-
Ft as t
|
|
467
|
-
};
|