@konstructio/ui 0.1.2-alpha.5 → 0.1.2-alpha.50
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-VYaRRJBZ.js → Combination-BtmnusWq.js} +141 -138
- package/dist/DatePicker.css +1 -1
- package/dist/Modal-CjC-CIJ8.js +99 -0
- package/dist/assets/icons/index.js +7 -0
- package/dist/chevron-down-DgT-uSF9.js +5 -0
- package/dist/chevron-right-DYvXLeql.js +7 -0
- package/dist/chevron-up-DEfvgPCw.js +54 -0
- package/dist/chevron-up-DrQr2Fwd.js +5 -0
- package/dist/components/Alert/Alert.js +2 -2
- package/dist/components/AlertDialog/AlertDialog.js +81 -53
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +3 -2
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Badge/Badge.js +41 -44
- package/dist/components/Badge/Badge.variants.js +52 -13
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +3 -3
- package/dist/components/Breadcrumb/components/Item/Item.js +22 -22
- package/dist/components/Breadcrumb/components/Item/Item.variants.js +25 -14
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.variants.js +108 -98
- package/dist/components/Card/Card.variants.js +7 -12
- package/dist/components/Checkbox/Checkbox.js +108 -105
- package/dist/components/Checkbox/Checkbox.variants.js +34 -7
- 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 +2 -2
- 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/Counter/Counter.js +210 -0
- package/dist/components/Counter/Counter.variants.js +70 -0
- package/dist/components/Datepicker/DatePicker.js +1587 -1353
- package/dist/components/Divider/Divider.variants.js +1 -1
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/Filter.js +1 -1
- package/dist/components/Filter/Filter.variants.js +8 -7
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +71 -45
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +2 -2
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +76 -43
- package/dist/components/Filter/components/ResetButton/ResetButton.js +15 -12
- package/dist/components/Filter/events/index.js +3 -3
- package/dist/components/ImageUpload/ImageUpload.js +221 -0
- package/dist/components/ImageUpload/ImageUpload.variants.js +109 -0
- package/dist/components/Input/Input.js +185 -118
- package/dist/components/Input/Input.variants.js +24 -19
- package/dist/components/Loading/Loading.js +1 -7
- package/dist/components/Modal/Modal.js +2 -2
- package/dist/components/Modal/components/Body/Body.js +1 -1
- package/dist/components/Modal/components/Footer/Footer.js +1 -1
- package/dist/components/Modal/components/Header/Header.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +4 -4
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +34 -0
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +30 -0
- package/dist/components/MultiSelectDropdown/components/Item/Item.js +30 -0
- package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +38 -0
- package/dist/components/MultiSelectDropdown/components/List/List.js +30 -0
- package/dist/components/MultiSelectDropdown/components/List/List.variants.js +25 -0
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +119 -0
- package/dist/components/MultiSelectDropdown/components/index.js +8 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.context.js +21 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.hook.js +13 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.provider.js +138 -0
- package/dist/components/MultiSelectDropdown/contexts/index.js +6 -0
- package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +32 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +8 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +46 -0
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +36 -0
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +690 -0
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +60 -0
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +45 -0
- package/dist/components/PhoneNumberInput/components/Wrapper.js +651 -0
- package/dist/components/PhoneNumberInput/components/index.js +6 -0
- package/dist/components/PhoneNumberInput/contexts/index.js +8 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.context.js +28 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.hook.js +13 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +6144 -0
- package/dist/components/PhoneNumberInput/utils/index.js +11 -0
- package/dist/components/PieChart/PieChart.js +463 -482
- package/dist/components/Radio/Radio.js +47 -44
- package/dist/components/Radio/Radio.variants.js +12 -8
- package/dist/components/RadioCard/RadioCard.variants.js +1 -6
- package/dist/components/RadioGroup/RadioGroup.js +10 -10
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Select/Select.js +48 -0
- package/dist/components/{Dropdown/Dropdown.variants.js → Select/Select.variants.js} +17 -11
- package/dist/components/Select/components/List/List.js +172 -0
- package/dist/components/{Dropdown → Select}/components/List/List.variants.js +11 -8
- package/dist/components/Select/components/ListItem/ListItem.js +117 -0
- package/dist/components/{Dropdown → Select}/components/ListItem/ListItem.variants.js +5 -4
- package/dist/components/Select/components/Wrapper.js +226 -0
- package/dist/components/Select/constants/index.js +4 -0
- package/dist/components/Select/constants/pagination.js +4 -0
- package/dist/components/Select/contexts/index.js +6 -0
- package/dist/components/Select/contexts/select.context.js +36 -0
- package/dist/components/Select/contexts/select.hook.js +11 -0
- package/dist/components/Select/contexts/select.provider.js +58 -0
- package/dist/components/Select/hooks/useNavigationList.js +50 -0
- package/dist/components/Select/hooks/useSelect.js +103 -0
- package/dist/components/Sidebar/Sidebar.variants.js +2 -2
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Switch/Switch.js +156 -129
- package/dist/components/Switch/Switch.variants.js +19 -10
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.variants.js +4 -3
- 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/Tag/Tag.js +1 -1
- package/dist/components/Tag/Tag.variants.js +1 -0
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +49 -98
- package/dist/components/TimePicker/TimePicker.js +1 -1
- package/dist/components/TimePicker/TimePicker.variants.js +26 -14
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +30 -20
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +57 -35
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +53 -45
- package/dist/components/Toast/Toast.js +283 -256
- package/dist/components/Toast/Toast.variants.js +37 -24
- package/dist/components/Tooltip/Tooltip.js +15 -14
- package/dist/components/Tooltip/Tooltip.variants.js +5 -4
- package/dist/components/Typography/Typography.js +23 -25
- package/dist/components/Typography/Typography.variants.js +55 -52
- package/dist/components/VirtualizedTable/VirtualizedTable.js +97 -71
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +95 -33
- package/dist/components/VirtualizedTable/components/Body/Body.js +73 -21
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +94 -91
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +20 -20
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +61 -44
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +33 -21
- package/dist/components/VirtualizedTable/components/Header/Header.js +61 -41
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +43 -22
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +106 -0
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +22 -1858
- package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +27 -0
- package/dist/components/VirtualizedTable/components/index.js +8 -6
- package/dist/components/VirtualizedTable/contexts/table.context.js +1 -0
- package/dist/components/VirtualizedTable/contexts/table.provider.js +68 -761
- package/dist/components/index.js +94 -86
- package/dist/contexts/theme.provider.js +0 -1
- package/dist/{createLucideIcon-D2CN7Ma9.js → createLucideIcon-D4r5Phnh.js} +0 -24
- package/dist/ellipsis-vertical-BVPtjl5f.js +9 -0
- package/dist/{index-C1g_chDT.js → index-AV6ZtGhy.js} +2 -2
- package/dist/index-BG8O18ZY.js +93 -0
- package/dist/index-BKjcReYh.js +55 -0
- package/dist/{index-N2OStZoU.js → index-BOE_3f_Z.js} +4 -25
- package/dist/{index-Cd2vhaop.js → index-BlSRBdPy.js} +5 -6
- package/dist/index-BmVmDQGH.js +662 -0
- package/dist/index-BvoZGpli.js +60 -0
- package/dist/index-Byr10W8m.js +1873 -0
- package/dist/{index-Dx2grAuN.js → index-CSWGJT-v.js} +0 -20
- package/dist/index-CeZcoQDw.js +479 -0
- package/dist/index-D6KzX_ef.js +135 -0
- package/dist/{index-B7t8D14s.js → index-D9SSJ6om.js} +4 -4
- package/dist/index-DKfEnhKr.js +200 -0
- package/dist/index-DLcqcWxM.js +29 -0
- package/dist/{index-ti1b9kqV.js → index-DMb4KD0b.js} +4 -4
- package/dist/{index-BAEWsOG1.js → index-DtEcCIrM.js} +1 -1
- package/dist/{index-bwWKd82e.js → index-Dy59FQl5.js} +1 -1
- package/dist/{index-C84F4YyO.js → index-gSPwC-1I.js} +10 -11
- package/dist/{index-Bnb0ezr3.js → index-vcSp8YRZ.js} +11 -12
- package/dist/index.d.ts +2142 -99
- package/dist/index.js +116 -106
- package/dist/libphonenumber-FTwQ9nyV.js +11549 -0
- package/dist/loader-juvMSJ9L.js +5 -0
- package/dist/package.json +43 -33
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +194 -168
- package/dist/ui/theme.css +27 -0
- package/dist/{useBreadcrumb-B8DnuqkR.js → useBreadcrumb-BAHbGQ_O.js} +0 -10
- package/dist/utils/index.js +534 -501
- package/dist/x-BXShoIAM.js +8 -0
- package/dist/{x-4F_5p77m.js → x-Eoa9FJjA.js} +1 -1
- package/package.json +43 -33
- package/dist/Modal-D-NOEWMX.js +0 -98
- package/dist/chevron-down-MZvQoT2F.js +0 -11
- package/dist/chevron-right-VYBOBhRt.js +0 -19
- package/dist/components/Dropdown/Dropdown.js +0 -42
- package/dist/components/Dropdown/components/List/List.js +0 -79
- package/dist/components/Dropdown/components/ListItem/ListItem.js +0 -67
- package/dist/components/Dropdown/components/Wrapper.js +0 -205
- package/dist/components/Dropdown/contexts/dropdown.context.js +0 -19
- package/dist/components/Dropdown/contexts/dropdown.hook.js +0 -13
- package/dist/components/Dropdown/contexts/dropdown.provider.js +0 -30
- package/dist/components/Dropdown/contexts/index.js +0 -6
- package/dist/components/Dropdown/hooks/useDropdown.js +0 -58
- package/dist/components/Dropdown/hooks/useNavigationList.js +0 -62
- package/dist/components/NumberInput/NumberInput.js +0 -179
- package/dist/components/NumberInput/NumberInput.variants.js +0 -50
- package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +0 -16
- package/dist/index-BITvcJAz.js +0 -423
- package/dist/index-BfXxHr_2.js +0 -125
- package/dist/index-Cvx4lqTq.js +0 -47
- package/dist/index-DBbEcSUG.js +0 -31
- package/dist/index-DQH6odE9.js +0 -82
- package/dist/index-DzIBBMjs.js +0 -436
- package/dist/index-os7vysFS.js +0 -131
- /package/dist/components/{Dropdown → Select}/components/EmptyList.js +0 -0
- /package/dist/components/{Dropdown → Select}/components/index.js +0 -0
|
@@ -1,53 +1,54 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsxs as c, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as V, useId as j, useCallback as w } from "react";
|
|
3
|
+
import { Typography as d } from "../Typography/Typography.js";
|
|
3
4
|
import { cn as a } from "../../utils/index.js";
|
|
4
|
-
import { radioVariants as
|
|
5
|
-
const
|
|
5
|
+
import { radioVariants as F, labelRadioVariants as p, wrapperRadioVariants as $ } from "./Radio.variants.js";
|
|
6
|
+
const C = V(
|
|
6
7
|
({
|
|
7
8
|
checked: r = !1,
|
|
8
|
-
className:
|
|
9
|
-
defaultChecked:
|
|
9
|
+
className: f,
|
|
10
|
+
defaultChecked: l,
|
|
10
11
|
disabled: e,
|
|
11
|
-
label:
|
|
12
|
-
labelTextClassName:
|
|
13
|
-
description:
|
|
14
|
-
descriptionClassName:
|
|
15
|
-
name:
|
|
16
|
-
theme:
|
|
17
|
-
value:
|
|
18
|
-
wrapperClassName:
|
|
19
|
-
onChange:
|
|
20
|
-
},
|
|
21
|
-
const
|
|
22
|
-
(
|
|
23
|
-
|
|
12
|
+
label: N,
|
|
13
|
+
labelTextClassName: h,
|
|
14
|
+
description: o,
|
|
15
|
+
descriptionClassName: x,
|
|
16
|
+
name: m,
|
|
17
|
+
theme: R,
|
|
18
|
+
value: n,
|
|
19
|
+
wrapperClassName: u,
|
|
20
|
+
onChange: i
|
|
21
|
+
}, y) => {
|
|
22
|
+
const t = `${j()}-${m}`, b = w(
|
|
23
|
+
(g) => {
|
|
24
|
+
i?.(g);
|
|
24
25
|
},
|
|
25
|
-
[
|
|
26
|
+
[i]
|
|
26
27
|
);
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
+
return /* @__PURE__ */ c(
|
|
28
29
|
"label",
|
|
29
30
|
{
|
|
30
|
-
htmlFor:
|
|
31
|
+
htmlFor: t,
|
|
31
32
|
className: a(
|
|
32
|
-
|
|
33
|
-
className:
|
|
33
|
+
$({
|
|
34
|
+
className: u,
|
|
34
35
|
disabled: e || !1
|
|
35
36
|
})
|
|
36
37
|
),
|
|
37
|
-
"data-theme":
|
|
38
|
+
"data-theme": R,
|
|
38
39
|
children: [
|
|
39
40
|
/* @__PURE__ */ s(
|
|
40
41
|
"input",
|
|
41
42
|
{
|
|
42
|
-
ref:
|
|
43
|
-
id:
|
|
43
|
+
ref: y,
|
|
44
|
+
id: t,
|
|
44
45
|
type: "radio",
|
|
45
|
-
name:
|
|
46
|
-
value:
|
|
46
|
+
name: m,
|
|
47
|
+
value: n,
|
|
47
48
|
checked: r,
|
|
48
|
-
defaultChecked:
|
|
49
|
+
defaultChecked: l,
|
|
49
50
|
className: "hidden peer",
|
|
50
|
-
onChange: () => b(
|
|
51
|
+
onChange: () => b(n),
|
|
51
52
|
disabled: e
|
|
52
53
|
}
|
|
53
54
|
),
|
|
@@ -55,31 +56,33 @@ const $ = g(
|
|
|
55
56
|
"span",
|
|
56
57
|
{
|
|
57
58
|
className: a(
|
|
58
|
-
|
|
59
|
-
className:
|
|
59
|
+
F({
|
|
60
|
+
className: f,
|
|
60
61
|
disabled: e || !1,
|
|
61
|
-
checked: r ||
|
|
62
|
+
checked: r || l || !1
|
|
62
63
|
})
|
|
63
64
|
)
|
|
64
65
|
}
|
|
65
66
|
),
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ c("div", { className: a(o && "flex flex-col gap-1"), children: [
|
|
67
68
|
/* @__PURE__ */ s(
|
|
68
|
-
|
|
69
|
+
d,
|
|
69
70
|
{
|
|
71
|
+
component: "span",
|
|
70
72
|
className: a(
|
|
71
|
-
|
|
73
|
+
p({ className: h })
|
|
72
74
|
),
|
|
73
|
-
children:
|
|
75
|
+
children: N
|
|
74
76
|
}
|
|
75
77
|
),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
+
o && /* @__PURE__ */ s(
|
|
79
|
+
d,
|
|
78
80
|
{
|
|
81
|
+
component: "span",
|
|
79
82
|
className: a(
|
|
80
|
-
|
|
83
|
+
p({ className: x })
|
|
81
84
|
),
|
|
82
|
-
children:
|
|
85
|
+
children: o
|
|
83
86
|
}
|
|
84
87
|
)
|
|
85
88
|
] })
|
|
@@ -88,7 +91,7 @@ const $ = g(
|
|
|
88
91
|
);
|
|
89
92
|
}
|
|
90
93
|
);
|
|
91
|
-
|
|
94
|
+
C.displayName = "KonstructRadio";
|
|
92
95
|
export {
|
|
93
|
-
|
|
96
|
+
C as Radio
|
|
94
97
|
};
|
|
@@ -15,7 +15,8 @@ const a = e(
|
|
|
15
15
|
), o = e(
|
|
16
16
|
[
|
|
17
17
|
"border",
|
|
18
|
-
"border-
|
|
18
|
+
"border-zinc-400",
|
|
19
|
+
"dark:border-metal-600",
|
|
19
20
|
"duration-300",
|
|
20
21
|
"inline-block",
|
|
21
22
|
"rounded-full",
|
|
@@ -61,22 +62,25 @@ const a = e(
|
|
|
61
62
|
disabled: !0,
|
|
62
63
|
checked: !0,
|
|
63
64
|
class: [
|
|
64
|
-
"peer-checked:border-
|
|
65
|
-
"peer-checked:before:bg-
|
|
65
|
+
"peer-checked:border-zinc-300",
|
|
66
|
+
"peer-checked:before:bg-zinc-300",
|
|
66
67
|
"cursor-not-allowed",
|
|
67
|
-
"[&+span]:cursor-not-allowed"
|
|
68
|
+
"[&+span]:cursor-not-allowed",
|
|
69
|
+
"dark:peer-checked:before:bg-aurora-500/50",
|
|
70
|
+
"dark:peer-checked:border-aurora-500/50"
|
|
68
71
|
]
|
|
69
72
|
},
|
|
70
73
|
{
|
|
71
74
|
disabled: !0,
|
|
72
75
|
checked: !1,
|
|
73
76
|
class: [
|
|
74
|
-
"peer-checked:border-
|
|
75
|
-
"peer-checked:
|
|
76
|
-
"peer-checked:before:bg-gray-200",
|
|
77
|
+
"peer-checked:border-zinc-300",
|
|
78
|
+
"peer-checked:before:bg-zinc-50",
|
|
77
79
|
"cursor-not-allowed",
|
|
78
80
|
"[&+span]:cursor-not-allowed",
|
|
79
|
-
"bg-gray-50"
|
|
81
|
+
"bg-gray-50",
|
|
82
|
+
"dark:bg-metal-800",
|
|
83
|
+
"dark:bg-metal-800"
|
|
80
84
|
]
|
|
81
85
|
}
|
|
82
86
|
],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { S as k } from "../../index-
|
|
2
|
+
import { S as k } from "../../index-BvoZGpli.js";
|
|
3
3
|
import { useState as x, useCallback as C } from "react";
|
|
4
4
|
import { cn as r } from "../../utils/index.js";
|
|
5
5
|
import { Radio as G } from "../Radio/Radio.js";
|
|
@@ -8,11 +8,11 @@ const y = ({
|
|
|
8
8
|
asChild: m,
|
|
9
9
|
className: s,
|
|
10
10
|
defaultChecked: c,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
direction: a,
|
|
12
|
+
name: i,
|
|
13
|
+
options: d,
|
|
14
|
+
theme: n,
|
|
15
|
+
wrapperClassName: p,
|
|
16
16
|
onValueChange: t
|
|
17
17
|
}) => {
|
|
18
18
|
const f = m ? k : "div", [l, S] = x(
|
|
@@ -27,14 +27,14 @@ const y = ({
|
|
|
27
27
|
f,
|
|
28
28
|
{
|
|
29
29
|
className: r(
|
|
30
|
-
R({ className:
|
|
30
|
+
R({ className: p, direction: a })
|
|
31
31
|
),
|
|
32
|
-
"data-theme":
|
|
33
|
-
children:
|
|
32
|
+
"data-theme": n,
|
|
33
|
+
children: d.map(({ value: o, ...N }) => /* @__PURE__ */ e(
|
|
34
34
|
G,
|
|
35
35
|
{
|
|
36
36
|
value: o,
|
|
37
|
-
name:
|
|
37
|
+
name: i,
|
|
38
38
|
className: r(s),
|
|
39
39
|
checked: l === o,
|
|
40
40
|
onChange: () => h(o),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { R as g, T as R, a as V, b as c } from "../../index-
|
|
2
|
+
import { R as g, T as R, a as V, b as c } from "../../index-gSPwC-1I.js";
|
|
3
3
|
import { forwardRef as v, useRef as b, useState as j, useImperativeHandle as k, useEffect as w, useCallback as y } from "react";
|
|
4
4
|
import { cn as a } from "../../utils/index.js";
|
|
5
5
|
import { rangeOutsideVariants as C, trackVariants as T, thumbVariants as i, rangeVariants as S } from "./Range.variants.js";
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as e, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as v } from "react";
|
|
3
|
+
import { cn as l } from "../../utils/index.js";
|
|
4
|
+
import { SelectProvider as N } from "./contexts/select.provider.js";
|
|
5
|
+
import { Wrapper as j } from "./components/Wrapper.js";
|
|
6
|
+
const W = v(
|
|
7
|
+
({
|
|
8
|
+
error: t,
|
|
9
|
+
errorClassName: r,
|
|
10
|
+
helperText: s,
|
|
11
|
+
helperTextClassName: a,
|
|
12
|
+
highlightSearch: c,
|
|
13
|
+
mainWrapperClassName: o,
|
|
14
|
+
name: m,
|
|
15
|
+
value: p,
|
|
16
|
+
options: d,
|
|
17
|
+
onChange: f,
|
|
18
|
+
onBlur: i,
|
|
19
|
+
...n
|
|
20
|
+
}, x) => /* @__PURE__ */ e(
|
|
21
|
+
N,
|
|
22
|
+
{
|
|
23
|
+
highlightSearch: c,
|
|
24
|
+
name: m,
|
|
25
|
+
value: p,
|
|
26
|
+
options: d,
|
|
27
|
+
onBlur: i,
|
|
28
|
+
onChange: f,
|
|
29
|
+
children: /* @__PURE__ */ h("div", { className: l("relative w-full", o), children: [
|
|
30
|
+
/* @__PURE__ */ e(
|
|
31
|
+
j,
|
|
32
|
+
{
|
|
33
|
+
error: t,
|
|
34
|
+
name: m,
|
|
35
|
+
ref: x,
|
|
36
|
+
onBlur: i,
|
|
37
|
+
...n
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
t ? /* @__PURE__ */ e("span", { className: l("text-xs text-red-700", r), children: t }) : null,
|
|
41
|
+
!t && s ? /* @__PURE__ */ e("span", { className: l("text-xs text-metal-600", a), children: s }) : null
|
|
42
|
+
] })
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
);
|
|
46
|
+
export {
|
|
47
|
+
W as Select
|
|
48
|
+
};
|
|
@@ -22,8 +22,9 @@ const a = e(
|
|
|
22
22
|
"aria-expanded:text-aurora-500",
|
|
23
23
|
"kubefirst:aria-expanded:border-kubefirst-primary",
|
|
24
24
|
"kubefirst:aria-expanded:text-kubefirst-secondary",
|
|
25
|
-
"dark:border-
|
|
26
|
-
"dark:focus-visible:bg-
|
|
25
|
+
"dark:border-metal-700",
|
|
26
|
+
"dark:focus-visible:bg-metal-800",
|
|
27
|
+
"dark:bg-metal-800"
|
|
27
28
|
],
|
|
28
29
|
{
|
|
29
30
|
variants: {
|
|
@@ -35,10 +36,15 @@ const a = e(
|
|
|
35
36
|
"kubefirst:text-red-600"
|
|
36
37
|
],
|
|
37
38
|
false: ""
|
|
39
|
+
},
|
|
40
|
+
disabled: {
|
|
41
|
+
true: ["cursor-default", "bg-gray-100", "dark:bg-metal-700/80"],
|
|
42
|
+
false: []
|
|
38
43
|
}
|
|
39
44
|
},
|
|
40
45
|
defaultVariants: {
|
|
41
|
-
hasError: !1
|
|
46
|
+
hasError: !1,
|
|
47
|
+
disabled: !1
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
50
|
), t = e([
|
|
@@ -46,24 +52,24 @@ const a = e(
|
|
|
46
52
|
"bg-transparent",
|
|
47
53
|
"border-none",
|
|
48
54
|
"outline-none",
|
|
49
|
-
"text-
|
|
55
|
+
"text-metal-700",
|
|
50
56
|
"text-sm",
|
|
51
57
|
"capitalize",
|
|
52
58
|
"placeholder:text-sm",
|
|
53
59
|
"placeholder:normal-case",
|
|
54
60
|
"placeholder:select-none",
|
|
55
|
-
"dark:placeholder:text-
|
|
56
|
-
"dark:text-
|
|
57
|
-
]),
|
|
61
|
+
"dark:placeholder:text-metal-400",
|
|
62
|
+
"dark:text-metal-50"
|
|
63
|
+
]), d = e([
|
|
58
64
|
"mb-1",
|
|
59
65
|
"cursor-pointer",
|
|
60
66
|
"text-sm",
|
|
61
|
-
"leading-
|
|
67
|
+
"leading-5",
|
|
62
68
|
"tracking-[0.1px]",
|
|
63
|
-
"dark:text-
|
|
69
|
+
"dark:text-metal-50"
|
|
64
70
|
]);
|
|
65
71
|
export {
|
|
66
|
-
a as dropdownVariants,
|
|
67
72
|
t as inputVariants,
|
|
68
|
-
|
|
73
|
+
d as labelVariants,
|
|
74
|
+
a as selectVariants
|
|
69
75
|
};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { jsxs as V, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { S as Z } from "../../../../index-BvoZGpli.js";
|
|
3
|
+
import { d as B } from "../../../../debounce-BFejQm9P.js";
|
|
4
|
+
import { forwardRef as G, useRef as C, useState as J, useImperativeHandle as K, useMemo as M, useEffect as Q } from "react";
|
|
5
|
+
import { Loading as R } from "../../../Loading/Loading.js";
|
|
6
|
+
import { cn as o } from "../../../../utils/index.js";
|
|
7
|
+
import { useNavigationUlList as W } from "../../hooks/useNavigationList.js";
|
|
8
|
+
import { ListItem as b } from "../ListItem/ListItem.js";
|
|
9
|
+
import { listVariants as X } from "./List.variants.js";
|
|
10
|
+
import { DEFAULT_LIST_SIZE as Y } from "../../constants/pagination.js";
|
|
11
|
+
import { useSelectContext as $ } from "../../contexts/select.hook.js";
|
|
12
|
+
const fe = G(
|
|
13
|
+
({
|
|
14
|
+
additionalOptions: F,
|
|
15
|
+
className: N,
|
|
16
|
+
inputRef: l,
|
|
17
|
+
isLoading: E,
|
|
18
|
+
itemClassName: i,
|
|
19
|
+
name: I,
|
|
20
|
+
searchable: x = !1,
|
|
21
|
+
listItemSecondRowClassName: c,
|
|
22
|
+
wrapperInputRef: S,
|
|
23
|
+
isInfiniteScrollEnabled: u,
|
|
24
|
+
onFetchMoreOptions: f,
|
|
25
|
+
noOptionsText: y
|
|
26
|
+
}, j) => {
|
|
27
|
+
const n = C(null), m = C(null), [p, L] = J(!1), {
|
|
28
|
+
isOpen: O,
|
|
29
|
+
searchTerm: g,
|
|
30
|
+
canFilter: P,
|
|
31
|
+
canContinueFetching: a,
|
|
32
|
+
page: d,
|
|
33
|
+
options: w,
|
|
34
|
+
isTyping: k,
|
|
35
|
+
setOptions: T,
|
|
36
|
+
setPage: U,
|
|
37
|
+
setCanContinueFetching: _
|
|
38
|
+
} = $();
|
|
39
|
+
K(j, () => n.current, [n]);
|
|
40
|
+
const h = x && P ? w.filter((e) => {
|
|
41
|
+
const t = g.toLowerCase();
|
|
42
|
+
return (typeof e.label == "string" ? e.label.toLowerCase() : "").includes(t);
|
|
43
|
+
}) : w;
|
|
44
|
+
W({
|
|
45
|
+
ulRef: n,
|
|
46
|
+
wrapperInputRef: S,
|
|
47
|
+
searchable: x,
|
|
48
|
+
filteredOptions: h
|
|
49
|
+
});
|
|
50
|
+
const q = h.filter(
|
|
51
|
+
(e, t, s) => t === s.findIndex((v) => v.value === e.value)
|
|
52
|
+
), z = h.length === 0, A = M(
|
|
53
|
+
() => B(async (e) => {
|
|
54
|
+
const [t] = e;
|
|
55
|
+
if (t.isIntersecting && !p && f && a)
|
|
56
|
+
try {
|
|
57
|
+
L(!0);
|
|
58
|
+
const s = d + 1, { data: v, hasMore: D } = await f({
|
|
59
|
+
page: s,
|
|
60
|
+
pageSize: Y,
|
|
61
|
+
termOfSearch: g
|
|
62
|
+
});
|
|
63
|
+
U(s), _(D), T((H) => [...H, ...v]);
|
|
64
|
+
} catch {
|
|
65
|
+
console.error("Error fetching more options");
|
|
66
|
+
} finally {
|
|
67
|
+
L(!1);
|
|
68
|
+
}
|
|
69
|
+
}, 100),
|
|
70
|
+
[p, f, g, d]
|
|
71
|
+
);
|
|
72
|
+
return Q(() => {
|
|
73
|
+
if (u && a && m.current && !k) {
|
|
74
|
+
const e = new IntersectionObserver(A, {
|
|
75
|
+
threshold: 0.1
|
|
76
|
+
});
|
|
77
|
+
return e.observe(m.current), () => e.disconnect();
|
|
78
|
+
}
|
|
79
|
+
}, [
|
|
80
|
+
u,
|
|
81
|
+
a,
|
|
82
|
+
p,
|
|
83
|
+
k,
|
|
84
|
+
d
|
|
85
|
+
]), /* @__PURE__ */ V(
|
|
86
|
+
"ul",
|
|
87
|
+
{
|
|
88
|
+
ref: n,
|
|
89
|
+
title: I,
|
|
90
|
+
role: "listbox",
|
|
91
|
+
className: o(X({ className: N })),
|
|
92
|
+
"data-state": O ? "open" : "closed",
|
|
93
|
+
children: [
|
|
94
|
+
E ? /* @__PURE__ */ r(
|
|
95
|
+
b,
|
|
96
|
+
{
|
|
97
|
+
className: o("select-none", i),
|
|
98
|
+
isClickable: !1,
|
|
99
|
+
inputRef: l,
|
|
100
|
+
value: "Loading...",
|
|
101
|
+
label: "Loading...",
|
|
102
|
+
listItemSecondRowClassName: c
|
|
103
|
+
}
|
|
104
|
+
) : z ? /* @__PURE__ */ r(
|
|
105
|
+
b,
|
|
106
|
+
{
|
|
107
|
+
isEmpty: !0,
|
|
108
|
+
className: o("select-none", i),
|
|
109
|
+
isClickable: !1,
|
|
110
|
+
inputRef: l,
|
|
111
|
+
value: y ?? "",
|
|
112
|
+
label: y ?? "No options",
|
|
113
|
+
listItemSecondRowClassName: c
|
|
114
|
+
}
|
|
115
|
+
) : q.map((e) => /* @__PURE__ */ r(
|
|
116
|
+
b,
|
|
117
|
+
{
|
|
118
|
+
className: o("select-none", i),
|
|
119
|
+
isClickable: !0,
|
|
120
|
+
inputRef: l,
|
|
121
|
+
listItemSecondRowClassName: c,
|
|
122
|
+
...e
|
|
123
|
+
},
|
|
124
|
+
e.value
|
|
125
|
+
)),
|
|
126
|
+
u && a && /* @__PURE__ */ r(
|
|
127
|
+
"li",
|
|
128
|
+
{
|
|
129
|
+
ref: m,
|
|
130
|
+
role: "option",
|
|
131
|
+
"data-action": "true",
|
|
132
|
+
className: "flex items-center justify-center py-3",
|
|
133
|
+
onClick: (e) => e.stopPropagation(),
|
|
134
|
+
children: /* @__PURE__ */ r(R, { className: "w-4 h-4 text-aurora-500 select-none" })
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
F?.map((e, t) => /* @__PURE__ */ r("li", { role: "option", "data-action": "true", children: /* @__PURE__ */ r(
|
|
138
|
+
Z,
|
|
139
|
+
{
|
|
140
|
+
className: o(
|
|
141
|
+
"flex",
|
|
142
|
+
"min-h-10",
|
|
143
|
+
"py-2",
|
|
144
|
+
"px-6",
|
|
145
|
+
"w-full",
|
|
146
|
+
"h-full",
|
|
147
|
+
"gap-1",
|
|
148
|
+
"items-center",
|
|
149
|
+
"text-sm",
|
|
150
|
+
"[&>svg]:-ml-1",
|
|
151
|
+
"[&>svg]:w-3.5",
|
|
152
|
+
"[&>svg]:h-3.5",
|
|
153
|
+
"[&>svg]:shrink-0",
|
|
154
|
+
"cursor-pointer",
|
|
155
|
+
"select-none",
|
|
156
|
+
"hover:bg-gray-50",
|
|
157
|
+
"hover:dark:bg-metal-700",
|
|
158
|
+
"focus:outline-0",
|
|
159
|
+
"text-blue-600",
|
|
160
|
+
"dark:text-aurora-500"
|
|
161
|
+
),
|
|
162
|
+
children: e
|
|
163
|
+
}
|
|
164
|
+
) }, t))
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
export {
|
|
171
|
+
fe as List
|
|
172
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
const
|
|
1
|
+
import { c as t } from "../../../../index-D29mdTf5.js";
|
|
2
|
+
const o = t([
|
|
3
|
+
"scrollbar",
|
|
3
4
|
"absolute",
|
|
4
5
|
"bg-white",
|
|
5
6
|
"border",
|
|
@@ -11,18 +12,20 @@ const t = o([
|
|
|
11
12
|
"top-full",
|
|
12
13
|
"w-full",
|
|
13
14
|
"z-10",
|
|
14
|
-
"max-h-
|
|
15
|
+
"max-h-44",
|
|
15
16
|
"overflow-y-auto",
|
|
16
17
|
"border-gray-200",
|
|
17
18
|
"text-zinc-700",
|
|
18
19
|
"animate-in",
|
|
19
20
|
"fade-in-50",
|
|
20
21
|
"zoom-in-95",
|
|
21
|
-
"duration-
|
|
22
|
-
"dark:bg-
|
|
23
|
-
"dark:border-
|
|
24
|
-
"dark:text-
|
|
22
|
+
"duration-200",
|
|
23
|
+
"dark:bg-metal-800",
|
|
24
|
+
"dark:border-metal-700",
|
|
25
|
+
"dark:text-metal-50",
|
|
26
|
+
"[&>li:first-child]:mt-2",
|
|
27
|
+
"[&>li:last-child]:mb-2"
|
|
25
28
|
]);
|
|
26
29
|
export {
|
|
27
|
-
|
|
30
|
+
o as listVariants
|
|
28
31
|
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { jsx as n, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as I, useCallback as u } from "react";
|
|
3
|
+
import { cn as s } from "../../../../utils/index.js";
|
|
4
|
+
import { Typography as y } from "../../../Typography/Typography.js";
|
|
5
|
+
import { listItemVariants as L } from "./ListItem.variants.js";
|
|
6
|
+
import { useSelectContext as V } from "../../contexts/select.hook.js";
|
|
7
|
+
function j(c, r) {
|
|
8
|
+
const i = r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = new RegExp(`(${i})`, "gi");
|
|
9
|
+
return c.split(o).map((a, t) => a.toLowerCase() === r.toLowerCase() ? /* @__PURE__ */ n(
|
|
10
|
+
"mark",
|
|
11
|
+
{
|
|
12
|
+
className: "bg-transparent font-semibold text-metal-800 dark:text-metal-50",
|
|
13
|
+
children: a
|
|
14
|
+
},
|
|
15
|
+
t
|
|
16
|
+
) : /* @__PURE__ */ n("span", { children: a }, t));
|
|
17
|
+
}
|
|
18
|
+
const K = ({
|
|
19
|
+
isEmpty: c,
|
|
20
|
+
isClickable: r,
|
|
21
|
+
className: i,
|
|
22
|
+
inputRef: o,
|
|
23
|
+
listItemSecondRowClassName: a,
|
|
24
|
+
...t
|
|
25
|
+
}) => {
|
|
26
|
+
const { searchTerm: m, highlightSearchEnabled: h, setValue: x, toggleOpen: g } = V(), b = I(null), f = u(
|
|
27
|
+
(e) => {
|
|
28
|
+
x(e.value, o), g(!1);
|
|
29
|
+
},
|
|
30
|
+
[x, g]
|
|
31
|
+
), N = u(
|
|
32
|
+
(e, l) => {
|
|
33
|
+
e.key === "Enter" && (e.stopPropagation(), f(l));
|
|
34
|
+
},
|
|
35
|
+
[f]
|
|
36
|
+
), w = u(
|
|
37
|
+
({ label: e, rightComponent: l, subLabel: p, rightComponentClassName: C }) => {
|
|
38
|
+
if (c)
|
|
39
|
+
return /* @__PURE__ */ n(
|
|
40
|
+
y,
|
|
41
|
+
{
|
|
42
|
+
variant: "body2",
|
|
43
|
+
className: "text-zinc-800 dark:text-metal-50 italic",
|
|
44
|
+
children: e
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
if (typeof e != "string")
|
|
48
|
+
return e;
|
|
49
|
+
const k = h && m.length > 0 ? j(e, m) : [e];
|
|
50
|
+
return /* @__PURE__ */ d(
|
|
51
|
+
y,
|
|
52
|
+
{
|
|
53
|
+
variant: "body2",
|
|
54
|
+
className: "text-zinc-700 dark:text-metal-50 font-medium",
|
|
55
|
+
children: [
|
|
56
|
+
l ? /* @__PURE__ */ d(
|
|
57
|
+
"span",
|
|
58
|
+
{
|
|
59
|
+
className: s("flex gap-2 items-center", C),
|
|
60
|
+
children: [
|
|
61
|
+
k,
|
|
62
|
+
" ",
|
|
63
|
+
l
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
) : k,
|
|
67
|
+
p ? /* @__PURE__ */ n(
|
|
68
|
+
"span",
|
|
69
|
+
{
|
|
70
|
+
className: s(
|
|
71
|
+
"block font-normal text-sm text-metal-800 dark:text-metal-50",
|
|
72
|
+
a
|
|
73
|
+
),
|
|
74
|
+
children: p
|
|
75
|
+
}
|
|
76
|
+
) : null
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
},
|
|
81
|
+
[h, m]
|
|
82
|
+
);
|
|
83
|
+
return /* @__PURE__ */ d(
|
|
84
|
+
"li",
|
|
85
|
+
{
|
|
86
|
+
ref: b,
|
|
87
|
+
role: "option",
|
|
88
|
+
"data-action": "false",
|
|
89
|
+
className: s(L({ className: i })),
|
|
90
|
+
tabIndex: 0,
|
|
91
|
+
onClick: (e) => {
|
|
92
|
+
r && (f(t), e.stopPropagation());
|
|
93
|
+
},
|
|
94
|
+
onKeyDown: (e) => N(e, t),
|
|
95
|
+
children: [
|
|
96
|
+
t.leftIcon ? /* @__PURE__ */ n(
|
|
97
|
+
"span",
|
|
98
|
+
{
|
|
99
|
+
className: s(
|
|
100
|
+
"w-4 h-4 flex justify-center",
|
|
101
|
+
{
|
|
102
|
+
"items-center": !t.subLabel,
|
|
103
|
+
"items-baseline -tranmetal-y-2": !!t.subLabel
|
|
104
|
+
},
|
|
105
|
+
t.leftIconClassName
|
|
106
|
+
),
|
|
107
|
+
children: t.leftIcon
|
|
108
|
+
}
|
|
109
|
+
) : null,
|
|
110
|
+
w(t)
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
};
|
|
115
|
+
export {
|
|
116
|
+
K as ListItem
|
|
117
|
+
};
|