@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t } from "../../utils-Cx-WzRZF.js";
|
|
2
2
|
import { t as h } from "../../chevron-left-DxGDBBKA.js";
|
|
3
3
|
import { t as f } from "../../chevron-right-CDwgDdp-.js";
|
|
4
|
-
import { t as p } from "../../DayPicker-
|
|
4
|
+
import { t as p } from "../../DayPicker-kweJz134.js";
|
|
5
5
|
import { datePickerVariants as k } from "./DatePicker.variants.js";
|
|
6
6
|
import '../../style.css';/* empty css */
|
|
7
7
|
import { useCallback as g, useState as w } from "react";
|
|
@@ -29,12 +29,11 @@ var y = ({ className: l, showOutsideDays: n = !0, animate: d = !0, arrowClassNam
|
|
|
29
29
|
nav: t("absolute", "right-4", "top-3.5", "flex", "justify-center", "items-center", "gap-1", s),
|
|
30
30
|
outside: "text-slate-400 dark:text-metal-500",
|
|
31
31
|
selected: t("[&>button]:bg-blue-600", "[&>button]:text-white", "[&>button]:hover:bg-blue-700", "[&>button]:transition-all", "[&>button]:duration-300", "[&>button]:rounded-full", "dark:[&>button]:bg-aurora-500", "dark:[&>button]:hover:bg-aurora-500", "dark:[&>button]:text-metal-900"),
|
|
32
|
-
table: "w-full",
|
|
33
32
|
weekdays: "text-slate-500 dark:text-metal-300",
|
|
34
33
|
weeks: t("text-slate-700", "[&>tr>td]:border-transparent", "[&>tr>td]:border-r-[8px]", "[&>tr>td]:last:border-r-0", "dark:text-white"),
|
|
35
34
|
weekday: "font-semibold text-sm uppercase text-sm",
|
|
36
35
|
today: "text-blue-600 dark:text-aurora-500 data-[selected=true]:text-white",
|
|
37
|
-
month_grid: t("[&>thead]:table-header-group", "[&>thead]:relative", "[&>thead]:after:block", '[&>thead]:after:content-[" "]', "[&>thead]:after:h-4")
|
|
36
|
+
month_grid: t("w-full", "[&>thead]:table-header-group", "[&>thead]:relative", "[&>thead]:after:block", '[&>thead]:after:content-[" "]', "[&>thead]:after:h-4")
|
|
38
37
|
},
|
|
39
38
|
components: { Chevron: ({ className: e, ...r }) => r.orientation === "left" ? /* @__PURE__ */ a(h, {
|
|
40
39
|
className: t(e),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as z } from "../../x-
|
|
3
|
-
import { t as B } from "../../dist-
|
|
2
|
+
import { t as z } from "../../x-BI9jmc7e.js";
|
|
3
|
+
import { t as B } from "../../dist-CTvBzxW8.js";
|
|
4
4
|
import { t as o } from "../../utils-Cx-WzRZF.js";
|
|
5
5
|
import { t as C } from "../../Combination-cjXRJS03.js";
|
|
6
6
|
import { DrawerContext as F } from "./contexts/Drawer.context.js";
|
|
@@ -9,11 +9,12 @@ import { ResetButton as c } from "./components/ResetButton/ResetButton.js";
|
|
|
9
9
|
import { TextMultiSelect as s } from "./components/TextMultiSelect/TextMultiSelect.js";
|
|
10
10
|
import { TimeFilterDropdown as D } from "./components/TimeFilterDropdown/TimeFilterDropdown.js";
|
|
11
11
|
import { jsx as e } from "react/jsx-runtime";
|
|
12
|
-
var t = ({ className:
|
|
12
|
+
var t = ({ className: o, theme: r = "civo", children: i, closeOnApply: m = !0 }) => /* @__PURE__ */ e(a, {
|
|
13
13
|
closeOnApply: m,
|
|
14
|
+
theme: r,
|
|
14
15
|
children: /* @__PURE__ */ e("div", {
|
|
15
|
-
className: l(p({ className:
|
|
16
|
-
"data-theme":
|
|
16
|
+
className: l(p({ className: o })),
|
|
17
|
+
"data-theme": r,
|
|
17
18
|
children: i
|
|
18
19
|
})
|
|
19
20
|
});
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { useFilterContext as
|
|
1
|
+
import { useFilterContext as w } from "../../contexts/filter.hook.js";
|
|
2
2
|
import { FilterEvent as p, sendOpenFilterEvent as F } from "../../events/index.js";
|
|
3
|
-
import { useCallback as
|
|
4
|
-
var
|
|
5
|
-
const { closeOnApply: o } =
|
|
3
|
+
import { useCallback as d, useEffect as m, useId as L, useMemo as u, useState as v } from "react";
|
|
4
|
+
var _ = ({ onApply: l, options: c = [] }) => {
|
|
5
|
+
const { closeOnApply: o } = w(), a = L(), [O, r] = v(!1), [s, i] = v([]);
|
|
6
6
|
m(() => {
|
|
7
7
|
const e = new AbortController();
|
|
8
8
|
return document.addEventListener(p.OPEN, (t) => {
|
|
9
|
-
t.detail !== a &&
|
|
9
|
+
t.detail !== a && r(!1);
|
|
10
10
|
}, { signal: e.signal }), document.addEventListener(p.RESET, () => {
|
|
11
11
|
i([]), l?.([]);
|
|
12
12
|
}, { signal: e.signal }), () => {
|
|
13
13
|
e.abort();
|
|
14
14
|
};
|
|
15
15
|
}, [a, l]);
|
|
16
|
-
const
|
|
16
|
+
const g = d((e) => {
|
|
17
|
+
e && (F(a), i((t) => t.filter((n) => n.isApplied))), r(e);
|
|
18
|
+
}, [a]), f = d(() => r(!1), []), h = d((e, t) => {
|
|
17
19
|
i(t ? [...s, {
|
|
18
20
|
...e,
|
|
19
21
|
isApplied: !1
|
|
@@ -21,47 +23,44 @@ var B = ({ onApply: l, options: c = [] }) => {
|
|
|
21
23
|
...n,
|
|
22
24
|
isRemoved: !0
|
|
23
25
|
} : n));
|
|
24
|
-
}, [i, s]),
|
|
25
|
-
i([]), l?.([]), o &&
|
|
26
|
-
}, [o, l]), A =
|
|
26
|
+
}, [i, s]), E = d(() => {
|
|
27
|
+
i([]), l?.([]), o && r(!1);
|
|
28
|
+
}, [o, l]), A = d(() => {
|
|
27
29
|
const e = s?.filter((t) => !t.isRemoved).map((t) => ({
|
|
28
30
|
...t,
|
|
29
31
|
isApplied: !0
|
|
30
32
|
}));
|
|
31
|
-
i(e), l?.(e.map(({ isApplied: t, isRemoved: n, ...
|
|
33
|
+
i(e), l?.(e.map(({ isApplied: t, isRemoved: n, ...b }) => b)), o && r(!1);
|
|
32
34
|
}, [
|
|
33
35
|
o,
|
|
34
36
|
l,
|
|
35
37
|
s,
|
|
36
38
|
i
|
|
37
|
-
]), C =
|
|
39
|
+
]), C = u(() => s.filter((e) => e.isApplied), [s]), R = u(() => c.length > 0 && c.every((e) => s.some((t) => t.id === e.id && !t.isRemoved)), [c, s]), S = d((e, t) => {
|
|
38
40
|
t && i(e.map((n) => ({
|
|
39
41
|
...n,
|
|
40
42
|
isApplied: !1
|
|
41
43
|
})));
|
|
42
44
|
}, []);
|
|
43
45
|
return m(() => {
|
|
44
|
-
const e = new AbortController()
|
|
45
|
-
|
|
46
|
-
};
|
|
47
|
-
return document.addEventListener("mousedown", t, { signal: e.signal }), document.addEventListener("visibilitychange", () => {
|
|
46
|
+
const e = new AbortController();
|
|
47
|
+
return document.addEventListener("visibilitychange", () => {
|
|
48
48
|
document.hidden && f();
|
|
49
49
|
}, { signal: e.signal }), () => {
|
|
50
50
|
e.abort();
|
|
51
51
|
};
|
|
52
|
-
}, [f
|
|
53
|
-
isOpen:
|
|
54
|
-
isAllSelected:
|
|
52
|
+
}, [f]), {
|
|
53
|
+
isOpen: O,
|
|
54
|
+
isAllSelected: R,
|
|
55
55
|
selectedCount: C,
|
|
56
56
|
selectedOptions: s,
|
|
57
|
-
wrapperRef: u,
|
|
58
57
|
handleApplyOptions: A,
|
|
59
|
-
|
|
60
|
-
handleResetOptions:
|
|
61
|
-
handleSelectAll:
|
|
62
|
-
handleSelectOption:
|
|
58
|
+
handleOpenChange: g,
|
|
59
|
+
handleResetOptions: E,
|
|
60
|
+
handleSelectAll: S,
|
|
61
|
+
handleSelectOption: h
|
|
63
62
|
};
|
|
64
63
|
};
|
|
65
64
|
export {
|
|
66
|
-
|
|
65
|
+
_ as useBadgeMultiSelect
|
|
67
66
|
};
|
|
@@ -1,76 +1,71 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { t as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { t as
|
|
1
|
+
import { t as m } from "../../../../Checkbox-DzAx7n67.js";
|
|
2
|
+
import { t as d } from "../../../../utils-Cx-WzRZF.js";
|
|
3
|
+
import { Button as h } from "../../../Button/Button.js";
|
|
4
|
+
import { t as O } from "../../../../chevron-down-DNP-OOAQ.js";
|
|
5
5
|
import { Badge as c } from "../../../Badge/Badge.js";
|
|
6
|
-
import { filterButtonIconVariants as
|
|
6
|
+
import { filterButtonIconVariants as S, filterButtonVariants as B } from "../../Filter.variants.js";
|
|
7
|
+
import { FilterDropdown as A } from "../FilterDropdown/FilterDropdown.js";
|
|
7
8
|
import { useBadgeMultiSelect as I } from "./BadgeMultiSelect.hook.js";
|
|
8
|
-
import { jsx as a, jsxs as l } from "react/jsx-runtime";
|
|
9
|
-
var
|
|
10
|
-
const {
|
|
11
|
-
onApply:
|
|
12
|
-
options:
|
|
9
|
+
import { Fragment as j, jsx as a, jsxs as l } from "react/jsx-runtime";
|
|
10
|
+
var E = ({ options: r, label: g, position: p = "left", onApply: f, showSelectAll: u = !0, selectAllLabel: x = "All" }) => {
|
|
11
|
+
const { isOpen: t, isAllSelected: i, selectedOptions: C, selectedCount: s, handleOpenChange: b, handleResetOptions: v, handleApplyOptions: k, handleSelectAll: y, handleSelectOption: N } = I({
|
|
12
|
+
onApply: f,
|
|
13
|
+
options: r
|
|
13
14
|
});
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
className:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
15
|
+
return r.length === 0 ? null : /* @__PURE__ */ l(A, {
|
|
16
|
+
isOpen: t,
|
|
17
|
+
position: p,
|
|
18
|
+
contentClassName: "border border-gray-200",
|
|
19
|
+
triggerClassName: d(B(), { "text-slate-700 dark:text-metal-50": t }),
|
|
20
|
+
trigger: /* @__PURE__ */ l(j, { children: [
|
|
21
|
+
g,
|
|
22
|
+
s.length > 0 && /* @__PURE__ */ a(c, { label: s.length.toString() }),
|
|
23
|
+
/* @__PURE__ */ a(O, { className: d(S(), { "rotate-180 text-blue-600 dark:text-aurora-500": t }) })
|
|
24
|
+
] }),
|
|
25
|
+
onOpenChange: b,
|
|
26
|
+
children: [/* @__PURE__ */ a("div", {
|
|
27
|
+
className: "px-6 py-4",
|
|
28
|
+
children: /* @__PURE__ */ l("div", {
|
|
29
|
+
className: "flex flex-col gap-2",
|
|
30
|
+
children: [u && /* @__PURE__ */ l("div", {
|
|
31
|
+
className: "flex gap-4",
|
|
32
|
+
children: [/* @__PURE__ */ a(m, {
|
|
33
|
+
defaultChecked: i,
|
|
34
|
+
onChange: (e) => y(r, e)
|
|
35
|
+
}, `select-all-${i}`), /* @__PURE__ */ a(c, { label: x })]
|
|
36
|
+
}), r.map((e) => {
|
|
37
|
+
const o = !!C.find((n) => n.id === e.id);
|
|
38
|
+
return /* @__PURE__ */ l("div", {
|
|
35
39
|
className: "flex gap-4",
|
|
36
|
-
children: [/* @__PURE__ */ a(
|
|
37
|
-
defaultChecked:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, `${e.id}-${o}`), /* @__PURE__ */ a(c, {
|
|
49
|
-
label: e.label,
|
|
50
|
-
variant: e.variant,
|
|
51
|
-
leftIcon: e.leftIcon,
|
|
52
|
-
rightIcon: e.rightIcon,
|
|
53
|
-
loading: e.loading
|
|
54
|
-
})]
|
|
55
|
-
}, e.id);
|
|
56
|
-
})]
|
|
57
|
-
})
|
|
58
|
-
}), /* @__PURE__ */ l("div", {
|
|
59
|
-
className: r("flex", "justify-center", "items-center", "gap-4", "px-6", "py-4", "border-t", "border-gray-200", "dark:border-metal-700"),
|
|
60
|
-
children: [/* @__PURE__ */ a(f, {
|
|
61
|
-
variant: "secondary",
|
|
62
|
-
appearance: "compact",
|
|
63
|
-
onClick: C,
|
|
64
|
-
children: "Reset"
|
|
65
|
-
}), /* @__PURE__ */ a(f, {
|
|
66
|
-
appearance: "compact",
|
|
67
|
-
onClick: N,
|
|
68
|
-
children: "Apply"
|
|
40
|
+
children: [/* @__PURE__ */ a(m, {
|
|
41
|
+
defaultChecked: o,
|
|
42
|
+
"data-label": e.id,
|
|
43
|
+
onChange: (n) => N(e, n)
|
|
44
|
+
}, `${e.id}-${o}`), /* @__PURE__ */ a(c, {
|
|
45
|
+
label: e.label,
|
|
46
|
+
variant: e.variant,
|
|
47
|
+
leftIcon: e.leftIcon,
|
|
48
|
+
rightIcon: e.rightIcon,
|
|
49
|
+
loading: e.loading
|
|
50
|
+
})]
|
|
51
|
+
}, e.id);
|
|
69
52
|
})]
|
|
53
|
+
})
|
|
54
|
+
}), /* @__PURE__ */ l("div", {
|
|
55
|
+
className: d("flex", "justify-center", "items-center", "gap-4", "px-6", "py-4", "border-t", "border-gray-200", "dark:border-metal-700"),
|
|
56
|
+
children: [/* @__PURE__ */ a(h, {
|
|
57
|
+
variant: "secondary",
|
|
58
|
+
appearance: "compact",
|
|
59
|
+
onClick: v,
|
|
60
|
+
children: "Reset"
|
|
61
|
+
}), /* @__PURE__ */ a(h, {
|
|
62
|
+
appearance: "compact",
|
|
63
|
+
onClick: k,
|
|
64
|
+
children: "Apply"
|
|
70
65
|
})]
|
|
71
66
|
})]
|
|
72
67
|
});
|
|
73
68
|
};
|
|
74
69
|
export {
|
|
75
|
-
|
|
70
|
+
E as BadgeMultiSelect
|
|
76
71
|
};
|
|
@@ -1,58 +1,50 @@
|
|
|
1
|
-
import { useFilterContext as
|
|
2
|
-
import { FilterEvent as
|
|
3
|
-
import { t as
|
|
4
|
-
import { useCallback as
|
|
5
|
-
var
|
|
6
|
-
const { closeOnApply:
|
|
1
|
+
import { useFilterContext as S } from "../../contexts/filter.hook.js";
|
|
2
|
+
import { FilterEvent as u, sendOpenFilterEvent as y } from "../../events/index.js";
|
|
3
|
+
import { t as C } from "../../../../utils-B-BTGYA5.js";
|
|
4
|
+
import { useCallback as o, useEffect as p, useId as F, useMemo as L, useState as d } from "react";
|
|
5
|
+
var k = ({ onApply: t, countryCode: c = "US" }) => {
|
|
6
|
+
const { closeOnApply: a } = S(), n = F(), [v, s] = d(!1), [i, r] = d(), [m, l] = d(), g = L(() => m?.toLocaleDateString(C(c), {
|
|
7
7
|
day: "numeric",
|
|
8
8
|
month: "short",
|
|
9
9
|
year: "numeric"
|
|
10
|
-
}), [
|
|
11
|
-
|
|
10
|
+
}), [m, c]), h = o((e) => {
|
|
11
|
+
e && y(n), s(e);
|
|
12
|
+
}, [n]), D = o(() => {
|
|
13
|
+
l(i), t?.(i), a && s(!1);
|
|
12
14
|
}, [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
]),
|
|
17
|
-
|
|
18
|
-
}, [
|
|
19
|
-
return
|
|
15
|
+
a,
|
|
16
|
+
t,
|
|
17
|
+
i
|
|
18
|
+
]), E = o((e) => r(e), []), f = o(() => s(!1), []), b = o(() => {
|
|
19
|
+
r(void 0), l(void 0), t?.(), a && s(!1);
|
|
20
|
+
}, [a, t]);
|
|
21
|
+
return p(() => {
|
|
20
22
|
const e = new AbortController();
|
|
21
|
-
return document.addEventListener(
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
};
|
|
26
|
-
}, [t]), m(() => {
|
|
27
|
-
const e = new AbortController();
|
|
28
|
-
return document.addEventListener(f.OPEN, (s) => {
|
|
29
|
-
s.detail !== t && o(!1);
|
|
30
|
-
}, { signal: e.signal }), document.addEventListener(f.RESET, () => {
|
|
31
|
-
d(void 0), c(void 0), n?.();
|
|
23
|
+
return document.addEventListener(u.OPEN, (O) => {
|
|
24
|
+
O.detail !== n && s(!1);
|
|
25
|
+
}, { signal: e.signal }), document.addEventListener(u.RESET, () => {
|
|
26
|
+
r(void 0), l(void 0), t?.();
|
|
32
27
|
}, { signal: e.signal }), () => {
|
|
33
28
|
e.abort();
|
|
34
29
|
};
|
|
35
|
-
}, [
|
|
36
|
-
const e = new AbortController()
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return document.addEventListener("mousedown", s, { signal: e.signal }), document.addEventListener("visibilitychange", () => {
|
|
40
|
-
document.hidden && u();
|
|
30
|
+
}, [n, t]), p(() => {
|
|
31
|
+
const e = new AbortController();
|
|
32
|
+
return document.addEventListener("visibilitychange", () => {
|
|
33
|
+
document.hidden && f();
|
|
41
34
|
}, { signal: e.signal }), () => {
|
|
42
35
|
e.abort();
|
|
43
36
|
};
|
|
44
|
-
}, [
|
|
45
|
-
id:
|
|
46
|
-
appliedDay:
|
|
47
|
-
isOpen:
|
|
48
|
-
selectedDay:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
handleReset: L
|
|
37
|
+
}, [f]), {
|
|
38
|
+
id: n,
|
|
39
|
+
appliedDay: g,
|
|
40
|
+
isOpen: v,
|
|
41
|
+
selectedDay: i,
|
|
42
|
+
handleApply: D,
|
|
43
|
+
handleOpenChange: h,
|
|
44
|
+
handleSelect: E,
|
|
45
|
+
handleReset: b
|
|
54
46
|
};
|
|
55
47
|
};
|
|
56
48
|
export {
|
|
57
|
-
|
|
49
|
+
k as useDateFilterDropdown
|
|
58
50
|
};
|
|
@@ -1,55 +1,50 @@
|
|
|
1
1
|
import { t as e } from "../../../../utils-Cx-WzRZF.js";
|
|
2
|
-
import { Button as
|
|
3
|
-
import { t as
|
|
2
|
+
import { Button as l } from "../../../Button/Button.js";
|
|
3
|
+
import { t as u } from "../../../../chevron-down-DNP-OOAQ.js";
|
|
4
4
|
import { Badge as x } from "../../../Badge/Badge.js";
|
|
5
|
-
import { DatePicker as
|
|
6
|
-
import { filterButtonIconVariants as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
import { DatePicker as y } from "../../../Datepicker/DatePicker.js";
|
|
6
|
+
import { filterButtonIconVariants as C, filterButtonVariants as D } from "../../Filter.variants.js";
|
|
7
|
+
import { FilterDropdown as w } from "../FilterDropdown/FilterDropdown.js";
|
|
8
|
+
import { useDateFilterDropdown as N } from "./DateFilterDropdown.hook.js";
|
|
9
|
+
import { Fragment as S, jsx as t, jsxs as o } from "react/jsx-runtime";
|
|
10
|
+
var R = ({ label: p, position: i = "left", countryCode: s = "US", onApply: m }) => {
|
|
11
|
+
const { id: c, appliedDay: n, isOpen: r, selectedDay: a, handleApply: d, handleOpenChange: f, handleSelect: h, handleReset: g } = N({
|
|
12
|
+
onApply: m,
|
|
12
13
|
countryCode: s
|
|
13
14
|
});
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
className:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
children: "Reset"
|
|
44
|
-
}), /* @__PURE__ */ t(i, {
|
|
45
|
-
appearance: "compact",
|
|
46
|
-
onClick: f,
|
|
47
|
-
children: "Apply"
|
|
48
|
-
})]
|
|
15
|
+
return /* @__PURE__ */ o(w, {
|
|
16
|
+
isOpen: r,
|
|
17
|
+
position: i,
|
|
18
|
+
contentClassName: e("border", "border-gray-200", "flex", "flex-col", "gap-4", "py-4", "px-6"),
|
|
19
|
+
triggerClassName: e(D(), { "text-slate-700": r }),
|
|
20
|
+
trigger: /* @__PURE__ */ o(S, { children: [
|
|
21
|
+
p,
|
|
22
|
+
n && /* @__PURE__ */ t(x, { label: n }),
|
|
23
|
+
/* @__PURE__ */ t(u, { className: e(C(), { "rotate-180 text-blue-600 dark:text-aurora-500": r }) })
|
|
24
|
+
] }),
|
|
25
|
+
onOpenChange: f,
|
|
26
|
+
children: [/* @__PURE__ */ t(y, {
|
|
27
|
+
className: "p-0",
|
|
28
|
+
arrowClassName: "-top-1 right-0",
|
|
29
|
+
monthsClassName: e("shadow-none", "p-0", "w-auto", "dark:border-transparent"),
|
|
30
|
+
defaultSelected: a,
|
|
31
|
+
defaultMonth: a,
|
|
32
|
+
onSelect: h
|
|
33
|
+
}, a?.toISOString() ?? c), /* @__PURE__ */ o("div", {
|
|
34
|
+
className: e("flex", "justify-end", "items-center", "gap-4", "py-2"),
|
|
35
|
+
children: [/* @__PURE__ */ t(l, {
|
|
36
|
+
variant: "secondary",
|
|
37
|
+
appearance: "compact",
|
|
38
|
+
onClick: g,
|
|
39
|
+
children: "Reset"
|
|
40
|
+
}), /* @__PURE__ */ t(l, {
|
|
41
|
+
appearance: "compact",
|
|
42
|
+
onClick: d,
|
|
43
|
+
children: "Apply"
|
|
49
44
|
})]
|
|
50
45
|
})]
|
|
51
46
|
});
|
|
52
47
|
};
|
|
53
48
|
export {
|
|
54
|
-
|
|
49
|
+
R as DateFilterDropdown
|
|
55
50
|
};
|
package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.js
CHANGED
|
@@ -1,63 +1,62 @@
|
|
|
1
1
|
import { useFilterContext as F } from "../../contexts/filter.hook.js";
|
|
2
|
-
import { FilterEvent as g, sendOpenFilterEvent as
|
|
3
|
-
import { t as
|
|
4
|
-
import { useCallback as a, useEffect as
|
|
5
|
-
var
|
|
6
|
-
const { closeOnApply:
|
|
2
|
+
import { FilterEvent as g, sendOpenFilterEvent as L } from "../../events/index.js";
|
|
3
|
+
import { t as S } from "../../../../utils-B-BTGYA5.js";
|
|
4
|
+
import { useCallback as a, useEffect as u, useId as D, useMemo as w, useState as f } from "react";
|
|
5
|
+
var k = ({ defaultRange: h, onApply: t, countryCode: v = "US" }) => {
|
|
6
|
+
const { closeOnApply: s } = F(), o = D(), [p, r] = f(!1), [i, l] = f(h), [n, d] = f(), R = w(() => {
|
|
7
7
|
if (!n?.from) return;
|
|
8
|
-
const e = (
|
|
8
|
+
const e = (c) => c.toLocaleDateString(S(v), {
|
|
9
9
|
day: "numeric",
|
|
10
10
|
month: "short"
|
|
11
11
|
});
|
|
12
12
|
return n.to ? `${e(n.from)} - ${e(n.to)}` : e(n.from);
|
|
13
|
-
}, [n]),
|
|
13
|
+
}, [n]), E = a((e) => {
|
|
14
|
+
e && L(o), r(e);
|
|
15
|
+
}, [o]), C = a(() => {
|
|
14
16
|
const e = {
|
|
15
|
-
from:
|
|
16
|
-
to:
|
|
17
|
+
from: i?.from,
|
|
18
|
+
to: i?.to
|
|
17
19
|
};
|
|
18
|
-
|
|
20
|
+
d(e), t?.(e), s && r(!1);
|
|
19
21
|
}, [
|
|
20
|
-
|
|
22
|
+
s,
|
|
21
23
|
t,
|
|
22
|
-
|
|
24
|
+
i
|
|
23
25
|
]), b = a((e) => {
|
|
24
|
-
|
|
26
|
+
l({
|
|
25
27
|
from: e.from,
|
|
26
28
|
to: e.to
|
|
27
29
|
});
|
|
28
|
-
}, []), m = a(() => r(!1), []),
|
|
29
|
-
|
|
30
|
-
}, [
|
|
31
|
-
return
|
|
30
|
+
}, []), m = a(() => r(!1), []), O = a(() => {
|
|
31
|
+
l(void 0), d(void 0), t?.(), s && r(!1);
|
|
32
|
+
}, [s, t]);
|
|
33
|
+
return u(() => {
|
|
32
34
|
const e = new AbortController();
|
|
33
|
-
return document.addEventListener(g.OPEN, (
|
|
34
|
-
|
|
35
|
+
return document.addEventListener(g.OPEN, (c) => {
|
|
36
|
+
c.detail !== o && r(!1);
|
|
35
37
|
}, { signal: e.signal }), document.addEventListener(g.RESET, () => {
|
|
36
|
-
|
|
38
|
+
l(void 0), d(void 0), t?.();
|
|
37
39
|
}, { signal: e.signal }), () => {
|
|
38
40
|
e.abort();
|
|
39
41
|
};
|
|
40
|
-
}, [o, t]),
|
|
41
|
-
const e = new AbortController()
|
|
42
|
-
|
|
43
|
-
};
|
|
44
|
-
return document.addEventListener("mousedown", s, { signal: e.signal }), document.addEventListener("visibilitychange", () => {
|
|
42
|
+
}, [o, t]), u(() => {
|
|
43
|
+
const e = new AbortController();
|
|
44
|
+
return document.addEventListener("visibilitychange", () => {
|
|
45
45
|
document.hidden && m();
|
|
46
46
|
}, { signal: e.signal }), () => {
|
|
47
47
|
e.abort();
|
|
48
48
|
};
|
|
49
|
-
}, [m
|
|
49
|
+
}, [m]), {
|
|
50
50
|
id: o,
|
|
51
|
-
appliedRange:
|
|
52
|
-
isOpen:
|
|
53
|
-
selectedRange:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
handleOpen: C,
|
|
51
|
+
appliedRange: R,
|
|
52
|
+
isOpen: p,
|
|
53
|
+
selectedRange: i,
|
|
54
|
+
handleApply: C,
|
|
55
|
+
handleOpenChange: E,
|
|
57
56
|
handleRangeChange: b,
|
|
58
|
-
handleReset:
|
|
57
|
+
handleReset: O
|
|
59
58
|
};
|
|
60
59
|
};
|
|
61
60
|
export {
|
|
62
|
-
|
|
61
|
+
k as useDateRangeFilterDropdown
|
|
63
62
|
};
|