@konstructio/ui 0.1.2-alpha.106 → 0.1.2-alpha.107
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/README.md +118 -31
- package/dist/{AdditionalOptions-D0BAS2HG.js → AdditionalOptions-Crcnz0_g.js} +1 -1
- package/dist/{AlertDialogTrigger-BOrb536P.js → AlertDialogTrigger-ouMGAlJW.js} +1 -1
- package/dist/{Breadcrumb-DVBxqgW_.js → Breadcrumb-MrF1Z6w2.js} +1 -1
- package/dist/{Checkbox-B20uoUKD.js → Checkbox-8KnRLpQG.js} +86 -87
- package/dist/{CommandInput-BWt6-vUK.js → CommandInput-CGnqfudl.js} +1 -1
- package/dist/{Counter-DiQb-he2.js → Counter-CDXdP1Af.js} +1 -1
- package/dist/{DropdownButton-hCVYZ1LA.js → DropdownButton-D4QlKGg7.js} +5 -5
- package/dist/{FlagSelectorList-CnJjnsp6.js → FlagSelectorList-tYZNl-tz.js} +22 -18
- package/dist/{HamburgerTrigger-BT2yUUJ-.js → HamburgerTrigger-B_NGSZ2r.js} +19 -19
- package/dist/{ImageUpload-DgCBCa5X.js → ImageUpload-D7HKSXK8.js} +71 -66
- package/dist/Input-is8n7emP.js +195 -0
- package/dist/{Loading-DUh9PMJN.js → Loading-DO8JOWBV.js} +1 -1
- package/dist/{Modal-CkAf9UY7.js → Modal-Dq9BHD_9.js} +2 -2
- package/dist/{Spinner-CUwE2bLm.js → Spinner-BJE79VTl.js} +1 -1
- package/dist/{StepIndicatorContent-CjbjVjS1.js → StepIndicatorContent-BGDvxLzV.js} +1 -1
- package/dist/{Switch-CyJXptgc.js → Switch-C7286Bcu.js} +2 -2
- package/dist/{Toast-DLJDExxw.js → Toast-jSx3Lao8.js} +2 -2
- package/dist/Wrapper-2AUlYAHQ.js +195 -0
- package/dist/{Wrapper-CvDRHgN4.js → Wrapper-CyHxGs4E.js} +1 -1
- package/dist/{Wrapper-B8Ja3k4j.js → Wrapper-a7RVCcrn.js} +238 -232
- package/dist/components/Alert/Alert.js +1 -1
- package/dist/components/AlertDialog/AlertDialog.js +2 -2
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Autocomplete/Autocomplete.js +1 -1
- package/dist/components/Autocomplete/components/List/List.js +1 -1
- package/dist/components/Autocomplete/hooks/useAutocomplete.js +1 -1
- package/dist/components/Badge/Badge.js +2 -2
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/components/BackButton/BackButton.js +1 -1
- package/dist/components/Breadcrumb/components/Item/Item.js +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.js +65 -60
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.js +2 -2
- package/dist/components/ButtonGroup/components/ButtonGroupLabel/ButtonGroupLabel.js +10 -9
- package/dist/components/ButtonGroup/components/ButtonGroupMessage/ButtonGroupMessage.js +8 -6
- package/dist/components/Card/Card.js +25 -22
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Command/Command.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/CommandShortcut.js +1 -1
- package/dist/components/Command/components/DialogContent.js +1 -1
- 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/DateRangePicker.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarDivider/CalendarDivider.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +2 -2
- package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +3 -3
- package/dist/components/DateRangePicker/components/CalendarPanel/components/NavigationButton/NavigationButton.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +2 -2
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/dayPickerClassNames.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/index.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/index.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useIndependentCarousel.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/utils/index.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/DateTimeInputs.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.js +48 -41
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.js +48 -41
- package/dist/components/DateRangePicker/components/PresetPanel/PresetPanel.js +1 -1
- package/dist/components/Datepicker/DatePicker.js +1 -1
- package/dist/components/Divider/Divider.js +7 -7
- package/dist/components/Drawer/Drawer.js +1 -1
- package/dist/components/Drawer/components/Body/Body.js +1 -1
- package/dist/components/Drawer/components/Footer/Footer.js +1 -1
- package/dist/components/Drawer/components/Header/Header.js +1 -1
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/Filter.js +1 -1
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +2 -2
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
- package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.js +1 -1
- package/dist/components/Filter/components/FilterDropdown/FilterDropdown.js +2 -2
- package/dist/components/Filter/components/ResetButton/ResetButton.js +1 -1
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +2 -2
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.js +1 -1
- package/dist/components/ImageUpload/ImageUpload.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/LineChart/LineChart.js +1 -1
- package/dist/components/Loading/Loading.js +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- 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 +1 -1
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +1 -1
- package/dist/components/MultiSelectDropdown/components/Item/Item.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/MultiSelectDropdown/contexts/MultiSelectDropdown.context.js +4 -3
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.provider.js +17 -16
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +1 -1
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +1 -1
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +3 -3
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/PhoneNumberInput/components/Wrapper.js +1 -1
- package/dist/components/PhoneNumberInput/components/index.js +2 -2
- package/dist/components/PieChart/PieChart.js +1 -1
- package/dist/components/ProgressBar/ProgressBar.js +1 -1
- package/dist/components/Radio/Radio.js +1 -1
- package/dist/components/RadioCard/RadioCard.js +1 -1
- package/dist/components/RadioCardGroup/RadioCardGroup.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/Range/Range.js +2 -2
- package/dist/components/Select/Select.js +32 -28
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.js +1 -1
- package/dist/components/Select/components/AdditionalOptions/AdditionalOptions.variants.js +1 -1
- package/dist/components/Select/components/List/List.js +78 -67
- package/dist/components/Select/components/ListItem/ListItem.js +1 -1
- package/dist/components/Select/components/Wrapper.js +1 -1
- package/dist/components/Select/components/index.js +2 -2
- package/dist/components/Sidebar/components/CollapseTrigger/CollapseTrigger.js +1 -1
- package/dist/components/Sidebar/components/Footer/Footer.js +1 -1
- package/dist/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.js +1 -1
- package/dist/components/Sidebar/components/Label/Label.js +1 -1
- package/dist/components/Sidebar/components/Logo/Logo.js +1 -1
- package/dist/components/Sidebar/components/Navigation/Navigation.js +1 -1
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.js +1 -1
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +2 -2
- package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.js +1 -1
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.js +1 -1
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +25 -24
- package/dist/components/Sidebar/components/index.js +1 -1
- package/dist/components/Slider/Slider.js +2 -2
- package/dist/components/Spinner/Spinner.js +1 -1
- package/dist/components/Stepper/Stepper.js +1 -1
- package/dist/components/Stepper/components/HorizontalStepItem/HorizontalStepItem.js +2 -2
- package/dist/components/Stepper/components/StepConnector/StepConnector.js +1 -1
- package/dist/components/Stepper/components/StepIndicatorContent/StepIndicatorContent.js +1 -1
- package/dist/components/Stepper/components/VerticalStepItem/VerticalStepItem.js +2 -2
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Table/Table.js +1 -1
- package/dist/components/Table/components/Body.js +1 -1
- package/dist/components/Table/components/Filter.js +1 -1
- package/dist/components/Table/components/Head.js +1 -1
- package/dist/components/Table/components/Row.js +1 -1
- package/dist/components/Tabs/Tabs.js +2 -2
- package/dist/components/Tabs/components/Content.js +2 -2
- package/dist/components/Tabs/components/List.js +2 -2
- package/dist/components/Tabs/components/Trigger.js +2 -2
- package/dist/components/Tag/Tag.js +8 -8
- package/dist/components/TagSelect/TagSelect.js +1 -1
- package/dist/components/TagSelect/components/Item/Item.js +1 -1
- package/dist/components/TagSelect/components/List/List.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/TextArea/TextArea.js +71 -26
- package/dist/components/TextArea/TextArea.variants.js +49 -13
- package/dist/components/TimePicker/components/HoursList/HoursList.js +1 -1
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +1 -1
- package/dist/components/TimePicker/components/MinutesList/MinutesList.js +1 -1
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +113 -98
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +19 -18
- package/dist/components/Toast/Toast.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +2 -2
- package/dist/components/Typography/Typography.js +1 -1
- package/dist/components/VirtualizedTable/VirtualizedTable.js +2 -2
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +1 -1
- package/dist/components/VirtualizedTable/components/Body/Body.js +2 -2
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +1 -1
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +2 -2
- package/dist/components/VirtualizedTable/components/ExpandableRow/ExpandableRow.js +1 -1
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +2 -2
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +1 -1
- package/dist/components/VirtualizedTable/components/Header/Header.js +2 -2
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +1 -1
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +1 -1
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +1 -1
- package/dist/components/VirtualizedTable/contexts/index.js +1 -1
- package/dist/components/VirtualizedTable/contexts/table.provider.js +1 -1
- package/dist/components/index.js +12 -12
- package/dist/{components-MnxnhLqM.js → components-CaEW5ge4.js} +32 -32
- package/dist/{constants-CSsr7_YV.js → constants-HQIXhj2t.js} +1 -1
- package/dist/contexts/index.js +1 -1
- package/dist/contexts/theme.provider.js +1 -1
- package/dist/{dist-Z0F27ATp2.js → dist-9WbMf_jT.js} +1 -1
- package/dist/{dist-oJzmvhAb.js → dist-AxOGvL82.js} +1 -1
- package/dist/{dist-CqNOgbfR.js → dist-BIBFLVt1.js} +3 -3
- package/dist/{dist-B6ExqXM_2.js → dist-BnCbAI-c.js} +1 -1
- package/dist/{dist-C87gsBDM.js → dist-CszFjHAP.js} +2 -2
- package/dist/{dist-ut_BEHii.js → dist-pxvIAJzo.js} +2 -2
- package/dist/hooks/useMediaQuery.js +1 -1
- package/dist/index.js +14 -14
- package/dist/lib/components/ButtonGroup/components/ButtonGroupLabel/ButtonGroupLabel.types.d.ts +1 -1
- package/dist/lib/components/ButtonGroup/components/ButtonGroupMessage/ButtonGroupMessage.types.d.ts +2 -0
- package/dist/lib/components/Card/Card.types.d.ts +1 -0
- package/dist/lib/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.types.d.ts +1 -0
- package/dist/lib/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.types.d.ts +1 -0
- package/dist/lib/components/Divider/Divider.d.ts +3 -2
- package/dist/lib/components/Divider/Divider.types.d.ts +4 -0
- package/dist/lib/components/Input/Input.types.d.ts +4 -0
- package/dist/lib/components/MultiSelectDropdown/MultiSelectDropdown.types.d.ts +2 -0
- package/dist/lib/components/MultiSelectDropdown/contexts/MultiSelectDropdown.types.d.ts +2 -0
- package/dist/lib/components/Select/Select.types.d.ts +2 -0
- package/dist/lib/components/Select/components/List/List.types.d.ts +3 -0
- package/dist/lib/components/Select/components/Wrapper.d.ts +2 -0
- package/dist/lib/components/Sidebar/Sidebar.types.d.ts +2 -0
- package/dist/lib/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.types.d.ts +2 -0
- package/dist/lib/components/Tag/Tag.types.d.ts +1 -0
- package/dist/lib/components/TextArea/TextArea.d.ts +6 -0
- package/dist/lib/components/TextArea/TextArea.types.d.ts +13 -2
- package/dist/lib/components/TextArea/TextArea.variants.d.ts +4 -1
- package/dist/lib/components/TimePicker/TimePicker.types.d.ts +4 -0
- package/dist/lib/components/TimePicker/components/WrapperList/WrapperList.types.d.ts +1 -0
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/package.json +21 -21
- package/dist/{react-B6Nc0Fib.js → react-7zQ6bvbE.js} +290 -289
- package/dist/styles.css +1 -1
- package/dist/{table.provider-DfZ74xMZ.js → table.provider-CWzODR1t.js} +1 -1
- package/dist/{theme.provider-Dw4O3ocC.js → theme.provider-CSL1WCYG.js} +1 -1
- package/dist/utils/index.js +6 -5
- package/dist/{utils-Cx-WzRZF.js → utils-B-6R7kNE.js} +8 -4
- package/package.json +21 -21
- package/dist/Input-wp-rsCmX.js +0 -188
- package/dist/Wrapper-R8fik3ah.js +0 -182
- /package/dist/{dist-DGOjiAnB2.js → dist-DGOjiAnB.js} +0 -0
- /package/dist/{dist-DwxO2RoR2.js → dist-DwxO2RoR.js} +0 -0
- /package/dist/{dist-pWlMx4Fi2.js → dist-pWlMx4Fi.js} +0 -0
- /package/dist/{x-a_LpoXzG2.js → x-a_LpoXzG.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as N } from "./utils-
|
|
2
|
-
import { Typography as
|
|
1
|
+
import { t as N } from "./utils-B-6R7kNE.js";
|
|
2
|
+
import { Typography as L } from "./components/Typography/Typography.js";
|
|
3
3
|
import { usePhoneNumberContext as K } from "./components/PhoneNumberInput/contexts/phone-number.hook.js";
|
|
4
4
|
import { TruncateText as $ } from "./components/PhoneNumberInput/components/TruncateText/TruncateText.js";
|
|
5
5
|
import * as M from "react";
|
|
@@ -61,22 +61,24 @@ function I(l, t, e) {
|
|
|
61
61
|
s = h;
|
|
62
62
|
}, o;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function V(l, t) {
|
|
65
65
|
if (l === void 0) throw new Error(`Unexpected undefined${t ? `: ${t}` : ""}`);
|
|
66
66
|
return l;
|
|
67
67
|
}
|
|
68
68
|
var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
|
|
69
69
|
let s;
|
|
70
|
-
return function(...i) {
|
|
70
|
+
return Object.assign(function(...i) {
|
|
71
71
|
l.clearTimeout(s), s = l.setTimeout(() => t.apply(this, i), e);
|
|
72
|
-
}
|
|
72
|
+
}, { cancel: () => {
|
|
73
|
+
l.clearTimeout(s);
|
|
74
|
+
} });
|
|
73
75
|
}, T, D = () => {
|
|
74
76
|
if (T !== void 0) return T;
|
|
75
77
|
if (typeof navigator > "u") return T = !1;
|
|
76
78
|
if (/iP(hone|od|ad)/.test(navigator.userAgent)) return T = !0;
|
|
77
79
|
const l = navigator.maxTouchPoints;
|
|
78
80
|
return T = navigator.platform === "MacIntel" && l !== void 0 && l > 0;
|
|
79
|
-
},
|
|
81
|
+
}, W = (l) => {
|
|
80
82
|
const { offsetWidth: t, offsetHeight: e } = l;
|
|
81
83
|
return {
|
|
82
84
|
width: t,
|
|
@@ -98,7 +100,7 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
|
|
|
98
100
|
height: Math.round(a)
|
|
99
101
|
});
|
|
100
102
|
};
|
|
101
|
-
if (i(
|
|
103
|
+
if (i(W(e)), !s.ResizeObserver) return () => {
|
|
102
104
|
};
|
|
103
105
|
const n = new s.ResizeObserver((o) => {
|
|
104
106
|
const h = () => {
|
|
@@ -113,7 +115,7 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
|
|
|
113
115
|
return;
|
|
114
116
|
}
|
|
115
117
|
}
|
|
116
|
-
i(
|
|
118
|
+
i(W(e));
|
|
117
119
|
};
|
|
118
120
|
l.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(h) : h();
|
|
119
121
|
});
|
|
@@ -131,7 +133,7 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
|
|
|
131
133
|
o = e(s), h?.(), t(o, r);
|
|
132
134
|
}, d = a(!0), c = a(!1);
|
|
133
135
|
return s.addEventListener("scroll", d, C), n && s.addEventListener("scrollend", c, C), () => {
|
|
134
|
-
s.removeEventListener("scroll", d), n && s.removeEventListener("scrollend", c);
|
|
136
|
+
s.removeEventListener("scroll", d), n && s.removeEventListener("scrollend", c), h?.cancel();
|
|
135
137
|
};
|
|
136
138
|
}, it = (l, t) => st(l, t, (e) => {
|
|
137
139
|
const { horizontal: s, isRtl: i } = l.options;
|
|
@@ -175,7 +177,7 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
|
|
|
175
177
|
}
|
|
176
178
|
return;
|
|
177
179
|
}
|
|
178
|
-
this.shouldMeasureDuringScroll(h) && this.resizeItem(h, this.options.measureElement(o, i, this));
|
|
180
|
+
this.isIndexInRange(h) && this.shouldMeasureDuringScroll(h) && this.resizeItem(h, this.options.measureElement(o, i, this));
|
|
179
181
|
};
|
|
180
182
|
this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(n) : n();
|
|
181
183
|
});
|
|
@@ -284,7 +286,7 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
|
|
|
284
286
|
this.range ? this.range.endIndex : null
|
|
285
287
|
]
|
|
286
288
|
}), this.cleanup = () => {
|
|
287
|
-
this.unsubs.filter(Boolean).forEach((t) => t()), this.unsubs = [], this.observer.disconnect(), this.rafId != null && this.targetWindow && (this.targetWindow.cancelAnimationFrame(this.rafId), this.rafId = null), this.scrollState = null, this._iosDeferredAdjustment = 0, this._iosTouching = !1, this._iosJustTouchEnded = !1, this.scrollElement = null, this.targetWindow = null;
|
|
289
|
+
this.unsubs.filter(Boolean).forEach((t) => t()), this.unsubs = [], this.observer.disconnect(), this.rafId != null && this.targetWindow && (this.targetWindow.cancelAnimationFrame(this.rafId), this.rafId = null), this.scrollState = null, this.isScrolling = !1, this.scrollDirection = null, this._iosDeferredAdjustment = 0, this._iosTouching = !1, this._iosJustTouchEnded = !1, this.scrollElement = null, this.targetWindow = null;
|
|
288
290
|
}, this._didMount = () => () => {
|
|
289
291
|
this.cleanup();
|
|
290
292
|
}, this._willUpdate = () => {
|
|
@@ -360,7 +362,7 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
|
|
|
360
362
|
lanes: o,
|
|
361
363
|
laneAssignmentMode: h,
|
|
362
364
|
gap: a
|
|
363
|
-
}), { key: !1 }), this.getMeasurements = I(() => [this.getMeasurementOptions(), this.itemSizeCacheVersion], ({ count: t, paddingStart: e, scrollMargin: s, getItemKey: i, enabled: n, lanes: o, laneAssignmentMode: h, gap: a }, d) => {
|
|
365
|
+
}), { key: !1 }), this.isIndexInRange = (t) => t >= 0 && t < this.options.count, this.getMeasurements = I(() => [this.getMeasurementOptions(), this.itemSizeCacheVersion], ({ count: t, paddingStart: e, scrollMargin: s, getItemKey: i, enabled: n, lanes: o, laneAssignmentMode: h, gap: a }, d) => {
|
|
364
366
|
const c = this.itemSizeCache;
|
|
365
367
|
if (!n)
|
|
366
368
|
return this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
|
|
@@ -476,11 +478,13 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
|
|
|
476
478
|
});
|
|
477
479
|
return;
|
|
478
480
|
}
|
|
479
|
-
const e = this.indexFromElement(t)
|
|
481
|
+
const e = this.indexFromElement(t);
|
|
482
|
+
if (!this.isIndexInRange(e)) return;
|
|
483
|
+
const s = this.options.getItemKey(e), i = this.elementsCache.get(s);
|
|
480
484
|
i !== t && (i && this.observer.unobserve(i), this.observer.observe(t), this.elementsCache.set(s, t)), (!this.isScrolling || this.scrollState) && this.shouldMeasureDuringScroll(e) && this.resizeItem(e, this.options.measureElement(t, void 0, this));
|
|
481
485
|
}, this.resizeItem = (t, e) => {
|
|
482
486
|
var s, i;
|
|
483
|
-
if (
|
|
487
|
+
if (!this.isIndexInRange(t)) return;
|
|
484
488
|
let n, o, h;
|
|
485
489
|
const a = this._flatMeasurements;
|
|
486
490
|
if (this.options.lanes === 1 && a !== null)
|
|
@@ -517,8 +521,8 @@ var Q = (l, t) => Math.abs(l - t) < 1.01, X = (l, t, e) => {
|
|
|
517
521
|
}), this.getVirtualItemForOffset = (t) => {
|
|
518
522
|
const e = this.getMeasurements();
|
|
519
523
|
if (e.length === 0) return;
|
|
520
|
-
const s = this._flatMeasurements, i = this.options.lanes === 1 && s != null, n = P(0, e.length - 1, i ? (o) => s[o * 2] : (o) =>
|
|
521
|
-
return
|
|
524
|
+
const s = this._flatMeasurements, i = this.options.lanes === 1 && s != null, n = P(0, e.length - 1, i ? (o) => s[o * 2] : (o) => V(e[o]).start, t);
|
|
525
|
+
return V(e[n]);
|
|
522
526
|
}, this.getMaxScrollOffset = () => {
|
|
523
527
|
if (!this.scrollElement) return 0;
|
|
524
528
|
if ("scrollHeight" in this.scrollElement) return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
|
|
@@ -814,7 +818,7 @@ var bt = ({ showFlagOnSearch: l, showNameOnSearch: t }) => {
|
|
|
814
818
|
className: "relative",
|
|
815
819
|
children: /* @__PURE__ */ x("li", {
|
|
816
820
|
className: "w-full flex items-center h-10 select-none px-6",
|
|
817
|
-
children: /* @__PURE__ */ x(
|
|
821
|
+
children: /* @__PURE__ */ x(L, {
|
|
818
822
|
variant: "body2",
|
|
819
823
|
component: "span",
|
|
820
824
|
className: "flex gap-2 items-center text-left",
|
|
@@ -839,7 +843,7 @@ var bt = ({ showFlagOnSearch: l, showNameOnSearch: t }) => {
|
|
|
839
843
|
children: /* @__PURE__ */ x("button", {
|
|
840
844
|
className: N("w-full", "h-full", "cursor-pointer", "px-6", "hover:bg-gray-50", "transition-colors", "duration-150", "focus-visible:outline-0", "hover:outline-gray-100", "focus:bg-gray-50", "dark:hover:bg-metal-700"),
|
|
841
845
|
onClick: () => n(d),
|
|
842
|
-
children: /* @__PURE__ */ U(
|
|
846
|
+
children: /* @__PURE__ */ U(L, {
|
|
843
847
|
variant: "body2",
|
|
844
848
|
component: "span",
|
|
845
849
|
className: "flex gap-2 items-center text-left",
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { o as m } from "./rolldown-runtime-Dw9YIBcH.js";
|
|
2
|
-
import { t as
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as y } from "./utils-
|
|
2
|
+
import { t as c } from "./prop-types-BCUW56rg.js";
|
|
3
|
+
import { t as g } from "./dist-DX0sBG3Q.js";
|
|
4
|
+
import { t as y } from "./utils-B-6R7kNE.js";
|
|
5
5
|
import { hamburgerTriggerVariants as d } from "./components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.variants.js";
|
|
6
6
|
import a, { forwardRef as v } from "react";
|
|
7
7
|
import { jsx as u, jsxs as b } from "react/jsx-runtime";
|
|
8
|
-
var p = /* @__PURE__ */ m(
|
|
8
|
+
var p = /* @__PURE__ */ m(c());
|
|
9
9
|
function s() {
|
|
10
10
|
return s = Object.assign || function(r) {
|
|
11
11
|
for (var n = 1; n < arguments.length; n++) {
|
|
12
|
-
var
|
|
13
|
-
for (var
|
|
12
|
+
var t = arguments[n];
|
|
13
|
+
for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && (r[e] = t[e]);
|
|
14
14
|
}
|
|
15
15
|
return r;
|
|
16
16
|
}, s.apply(this, arguments);
|
|
17
17
|
}
|
|
18
18
|
function h(r, n) {
|
|
19
19
|
if (r == null) return {};
|
|
20
|
-
var
|
|
20
|
+
var t = x(r, n), e, o;
|
|
21
21
|
if (Object.getOwnPropertySymbols) {
|
|
22
22
|
var i = Object.getOwnPropertySymbols(r);
|
|
23
23
|
for (o = 0; o < i.length; o++)
|
|
24
|
-
|
|
24
|
+
e = i[o], !(n.indexOf(e) >= 0) && Object.prototype.propertyIsEnumerable.call(r, e) && (t[e] = r[e]);
|
|
25
25
|
}
|
|
26
|
-
return
|
|
26
|
+
return t;
|
|
27
27
|
}
|
|
28
28
|
function x(r, n) {
|
|
29
29
|
if (r == null) return {};
|
|
30
|
-
var
|
|
31
|
-
for (i = 0; i <
|
|
32
|
-
o =
|
|
33
|
-
return
|
|
30
|
+
var t = {}, e = Object.keys(r), o, i;
|
|
31
|
+
for (i = 0; i < e.length; i++)
|
|
32
|
+
o = e[i], !(n.indexOf(o) >= 0) && (t[o] = r[o]);
|
|
33
|
+
return t;
|
|
34
34
|
}
|
|
35
35
|
var l = v(function(r, n) {
|
|
36
|
-
var
|
|
36
|
+
var t = r.color, e = t === void 0 ? "currentColor" : t, o = r.size, i = o === void 0 ? 24 : o, f = h(r, ["color", "size"]);
|
|
37
37
|
return /* @__PURE__ */ a.createElement("svg", s({
|
|
38
38
|
ref: n,
|
|
39
39
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -41,7 +41,7 @@ var l = v(function(r, n) {
|
|
|
41
41
|
height: i,
|
|
42
42
|
viewBox: "0 0 24 24",
|
|
43
43
|
fill: "none",
|
|
44
|
-
stroke:
|
|
44
|
+
stroke: e,
|
|
45
45
|
strokeWidth: "2",
|
|
46
46
|
strokeLinecap: "round",
|
|
47
47
|
strokeLinejoin: "round"
|
|
@@ -67,17 +67,17 @@ l.propTypes = {
|
|
|
67
67
|
size: p.default.oneOfType([p.default.string, p.default.number])
|
|
68
68
|
};
|
|
69
69
|
l.displayName = "Menu";
|
|
70
|
-
var O = ({ isOpen: r, onClick: n, className: e }) => /* @__PURE__ */ b("button", {
|
|
70
|
+
var O = ({ isOpen: r, onClick: n, className: t, openNavigationLabel: e = "Open navigation" }) => /* @__PURE__ */ b("button", {
|
|
71
71
|
type: "button",
|
|
72
|
-
"aria-label":
|
|
72
|
+
"aria-label": e,
|
|
73
73
|
"aria-expanded": r,
|
|
74
74
|
"aria-haspopup": "menu",
|
|
75
|
-
className: y(d({ className:
|
|
75
|
+
className: y(d({ className: t })),
|
|
76
76
|
onClick: n,
|
|
77
77
|
children: [/* @__PURE__ */ u(l, {
|
|
78
78
|
size: 20,
|
|
79
79
|
"aria-hidden": "true"
|
|
80
|
-
}), /* @__PURE__ */ u(
|
|
80
|
+
}), /* @__PURE__ */ u(g, { children: e })]
|
|
81
81
|
});
|
|
82
82
|
O.displayName = "KonstructSidebarHamburgerTrigger";
|
|
83
83
|
export {
|
|
@@ -1,85 +1,86 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { LoaderIcon as
|
|
3
|
-
import { PhotoLibraryIcon as
|
|
4
|
-
import { WarningIcon as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { t as
|
|
7
|
-
import { helperTextVariants as
|
|
8
|
-
import { useEffect as
|
|
9
|
-
import { Fragment as
|
|
1
|
+
import { t as c } from "./utils-B-6R7kNE.js";
|
|
2
|
+
import { LoaderIcon as ee } from "./assets/icons/components/Loader.js";
|
|
3
|
+
import { PhotoLibraryIcon as te } from "./assets/icons/components/PhotoLibrary.js";
|
|
4
|
+
import { WarningIcon as ae } from "./assets/icons/components/Warning.js";
|
|
5
|
+
import { Button as b } from "./components/Button/Button.js";
|
|
6
|
+
import { t as P } from "./x-a_LpoXzG.js";
|
|
7
|
+
import { helperTextVariants as re, imageUploadVariants as le, inputContainerVariants as ie, inputFieldVariants as se, labelVariants as ne } from "./components/ImageUpload/ImageUpload.variants.js";
|
|
8
|
+
import { useEffect as oe, useId as ce, useRef as S, useState as g } from "react";
|
|
9
|
+
import { Fragment as T, jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
10
10
|
var t = /* @__PURE__ */ (function(n) {
|
|
11
11
|
return n.Default = "default", n.Uploading = "uploading", n.Complete = "complete", n.Error = "error", n;
|
|
12
|
-
})({}),
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
})({}), de = ({ className: n, error: z, fileName: E, fileSize: I, fileUrl: M, helperText: R = "Logo should be 32 x 32 pixels with transparent background (larger images will be downscaled proportionally to fit). Accepted file type is SVG, PNG, JPEG. Max file size is 5MB.", isRequired: U = !1, label: N = "Item logo", labelClassName: L, labelWrapperClassName: A, name: $, onChange: k, onRemove: J, status: v = t.Default, theme: f, uploadButtonText: K = "Upload logo", accept: B = "image/svg+xml,image/png,image/jpeg,image/jpg", maxSize: W = 5242880 }) => {
|
|
13
|
+
const w = ce(), C = `${w}-message`, h = S(null), o = S(null), [H, d] = g(v), [X, G] = g(M), [q, j] = g(E), [O, D] = g(I);
|
|
14
|
+
oe(() => () => {
|
|
15
|
+
o.current && clearTimeout(o.current);
|
|
16
16
|
}, []);
|
|
17
|
-
const a = v !== t.Default ? v :
|
|
17
|
+
const a = v !== t.Default ? v : H, F = M ?? X, m = E ?? q, x = I ?? O, u = !!z || a === t.Error, Q = (i) => {
|
|
18
18
|
const r = i.target.files?.[0];
|
|
19
19
|
if (!r) return;
|
|
20
|
-
if (!
|
|
20
|
+
if (!B.split(",").map((s) => s.trim()).some((s) => {
|
|
21
21
|
if (s.includes("*")) {
|
|
22
|
-
const
|
|
23
|
-
return r.type.startsWith(
|
|
22
|
+
const _ = s.split("/")[0];
|
|
23
|
+
return r.type.startsWith(_);
|
|
24
24
|
}
|
|
25
25
|
return r.type === s;
|
|
26
26
|
})) {
|
|
27
27
|
d(t.Error), k?.(i);
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
|
-
if (r.size >
|
|
30
|
+
if (r.size > W) {
|
|
31
31
|
d(t.Error), k?.(i);
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
d(t.Uploading),
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
d(t.Uploading), j(r.name), D(Z(r.size));
|
|
35
|
+
const p = new FileReader();
|
|
36
|
+
p.onloadend = () => {
|
|
37
|
+
G(p.result), o.current = setTimeout(() => {
|
|
38
38
|
d(t.Complete);
|
|
39
39
|
}, 500);
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
},
|
|
40
|
+
}, p.readAsDataURL(r), k?.(i);
|
|
41
|
+
}, V = () => {
|
|
42
|
+
o.current && (clearTimeout(o.current), o.current = null), G(void 0), j(void 0), D(void 0), d(t.Default), h.current && (h.current.value = ""), J?.();
|
|
43
|
+
}, Y = () => {
|
|
44
44
|
h.current?.click();
|
|
45
|
-
},
|
|
45
|
+
}, Z = (i) => {
|
|
46
46
|
if (i === 0) return "0 Bytes";
|
|
47
|
-
const r = 1024,
|
|
47
|
+
const r = 1024, p = [
|
|
48
48
|
"Bytes",
|
|
49
49
|
"KB",
|
|
50
50
|
"MB",
|
|
51
51
|
"GB"
|
|
52
52
|
], s = Math.floor(Math.log(i) / Math.log(r));
|
|
53
|
-
return `${parseFloat((i / Math.pow(r, s)).toFixed(2))}${
|
|
54
|
-
},
|
|
53
|
+
return `${parseFloat((i / Math.pow(r, s)).toFixed(2))}${p[s]}`;
|
|
54
|
+
}, y = z || (u ? "Invalid file format. Accepted file type is SVG, PNG, JPEG. Max file size is 5MB." : R || "Logo should be 32 x 32 pixels with transparent background (larger images will be downscaled proportionally to fit). Accepted file type is SVG, PNG, JPEG. Max file size is 5MB.");
|
|
55
55
|
return /* @__PURE__ */ l("div", {
|
|
56
|
-
className:
|
|
56
|
+
className: c(le({
|
|
57
57
|
status: a,
|
|
58
58
|
className: n
|
|
59
59
|
})),
|
|
60
60
|
"data-theme": f,
|
|
61
61
|
children: [
|
|
62
|
-
|
|
63
|
-
className:
|
|
62
|
+
N && /* @__PURE__ */ e("div", {
|
|
63
|
+
className: c(A),
|
|
64
64
|
children: /* @__PURE__ */ l("label", {
|
|
65
|
-
htmlFor:
|
|
66
|
-
className:
|
|
67
|
-
children: [
|
|
65
|
+
htmlFor: w,
|
|
66
|
+
className: c(ne({ className: L }), "cursor-pointer"),
|
|
67
|
+
children: [N, U && /* @__PURE__ */ e("span", {
|
|
68
|
+
"aria-hidden": "true",
|
|
68
69
|
className: "text-red-600 dark:text-red-500 text-xs mt-0.5",
|
|
69
70
|
children: "*"
|
|
70
71
|
})]
|
|
71
72
|
})
|
|
72
73
|
}),
|
|
73
74
|
/* @__PURE__ */ l("div", {
|
|
74
|
-
className:
|
|
75
|
+
className: c(ie({ status: a })),
|
|
75
76
|
children: [
|
|
76
77
|
/* @__PURE__ */ l("div", {
|
|
77
|
-
className:
|
|
78
|
-
"justify-between":
|
|
79
|
-
"justify-start": !
|
|
78
|
+
className: c(se({ status: a }), {
|
|
79
|
+
"justify-between": u,
|
|
80
|
+
"justify-start": !u
|
|
80
81
|
}),
|
|
81
82
|
children: [
|
|
82
|
-
a === t.Uploading && /* @__PURE__ */ l(
|
|
83
|
+
a === t.Uploading && /* @__PURE__ */ l(T, { children: [/* @__PURE__ */ e(ee, {
|
|
83
84
|
size: 20,
|
|
84
85
|
className: "shrink-0 animate-spin text-metal-400"
|
|
85
86
|
}), m && /* @__PURE__ */ l("div", {
|
|
@@ -92,10 +93,10 @@ var t = /* @__PURE__ */ (function(n) {
|
|
|
92
93
|
children: x
|
|
93
94
|
})]
|
|
94
95
|
})] }),
|
|
95
|
-
a === t.Complete &&
|
|
96
|
+
a === t.Complete && F && /* @__PURE__ */ l(T, { children: [/* @__PURE__ */ e("div", {
|
|
96
97
|
className: "w-8 h-8 shrink-0 relative",
|
|
97
98
|
children: /* @__PURE__ */ e("img", {
|
|
98
|
-
src:
|
|
99
|
+
src: F,
|
|
99
100
|
alt: m || "Uploaded image",
|
|
100
101
|
className: "w-full h-full object-contain"
|
|
101
102
|
})
|
|
@@ -109,53 +110,54 @@ var t = /* @__PURE__ */ (function(n) {
|
|
|
109
110
|
children: x
|
|
110
111
|
})]
|
|
111
112
|
})] }),
|
|
112
|
-
(a === t.Default || a === t.Error && !
|
|
113
|
+
(a === t.Default || a === t.Error && !F) && /* @__PURE__ */ e("div", {
|
|
113
114
|
className: "w-8 h-8 shrink-0 flex items-center justify-center",
|
|
114
|
-
children: /* @__PURE__ */ e(
|
|
115
|
+
children: /* @__PURE__ */ e(te, { className: "w-8 h-8 text-slate-400 dark:text-slate-500 kubefirst-dark:text-slate-500" })
|
|
115
116
|
}),
|
|
116
|
-
|
|
117
|
+
u && /* @__PURE__ */ e("div", {
|
|
117
118
|
className: "shrink-0",
|
|
118
|
-
children: /* @__PURE__ */ e(
|
|
119
|
+
children: /* @__PURE__ */ e(ae, { className: "w-5 h-5 text-red-700 dark:text-red-500 kubefirst-dark:text-red-500" })
|
|
119
120
|
})
|
|
120
121
|
]
|
|
121
122
|
}),
|
|
122
|
-
(a === t.Default || a === t.Error) && /* @__PURE__ */ e(
|
|
123
|
+
(a === t.Default || a === t.Error) && /* @__PURE__ */ e(b, {
|
|
123
124
|
variant: "secondary",
|
|
124
|
-
onClick:
|
|
125
|
+
onClick: Y,
|
|
125
126
|
theme: f,
|
|
126
127
|
className: "h-10 px-4 py-2 shrink-0",
|
|
127
|
-
children:
|
|
128
|
+
children: K
|
|
128
129
|
}),
|
|
129
|
-
a === t.Uploading && /* @__PURE__ */ e(
|
|
130
|
+
a === t.Uploading && /* @__PURE__ */ e(b, {
|
|
130
131
|
variant: "secondary",
|
|
131
132
|
shape: "circle",
|
|
132
133
|
size: "medium",
|
|
133
|
-
onClick:
|
|
134
|
+
onClick: V,
|
|
134
135
|
theme: f,
|
|
135
136
|
className: "shrink-0",
|
|
136
137
|
"aria-label": "Cancel upload",
|
|
137
|
-
children: /* @__PURE__ */ e(
|
|
138
|
+
children: /* @__PURE__ */ e(P, { className: "w-6 h-6" })
|
|
138
139
|
}),
|
|
139
|
-
a === t.Complete && /* @__PURE__ */ e(
|
|
140
|
+
a === t.Complete && /* @__PURE__ */ e(b, {
|
|
140
141
|
variant: "secondary",
|
|
141
142
|
shape: "circle",
|
|
142
143
|
size: "medium",
|
|
143
|
-
onClick:
|
|
144
|
+
onClick: V,
|
|
144
145
|
theme: f,
|
|
145
146
|
className: "shrink-0",
|
|
146
147
|
"aria-label": "Remove file",
|
|
147
|
-
children: /* @__PURE__ */ e(
|
|
148
|
+
children: /* @__PURE__ */ e(P, { className: "w-6 h-6" })
|
|
148
149
|
})
|
|
149
150
|
]
|
|
150
151
|
}),
|
|
151
|
-
|
|
152
|
+
y && /* @__PURE__ */ l("div", {
|
|
152
153
|
className: "flex w-full gap-2",
|
|
153
154
|
children: [
|
|
154
155
|
/* @__PURE__ */ e("div", {
|
|
155
156
|
className: "flex-1 min-w-0",
|
|
156
157
|
children: /* @__PURE__ */ e("p", {
|
|
157
|
-
|
|
158
|
-
|
|
158
|
+
id: C,
|
|
159
|
+
className: c(re({ status: a })),
|
|
160
|
+
children: y
|
|
159
161
|
})
|
|
160
162
|
}),
|
|
161
163
|
(a === t.Default || a === t.Error) && /* @__PURE__ */ e("div", { className: "shrink-0 w-29" }),
|
|
@@ -164,18 +166,21 @@ var t = /* @__PURE__ */ (function(n) {
|
|
|
164
166
|
}),
|
|
165
167
|
/* @__PURE__ */ e("input", {
|
|
166
168
|
ref: h,
|
|
167
|
-
id:
|
|
169
|
+
id: w,
|
|
168
170
|
type: "file",
|
|
169
|
-
name:
|
|
170
|
-
accept:
|
|
171
|
-
onChange:
|
|
171
|
+
name: $,
|
|
172
|
+
accept: B,
|
|
173
|
+
onChange: Q,
|
|
172
174
|
className: "hidden",
|
|
173
|
-
"aria-label":
|
|
175
|
+
"aria-label": N ? void 0 : "File upload",
|
|
176
|
+
"aria-invalid": u || void 0,
|
|
177
|
+
"aria-describedby": y ? C : void 0,
|
|
178
|
+
"aria-required": U || void 0
|
|
174
179
|
})
|
|
175
180
|
]
|
|
176
181
|
});
|
|
177
182
|
};
|
|
178
|
-
|
|
183
|
+
de.displayName = "KonstructImageUpload";
|
|
179
184
|
export {
|
|
180
|
-
|
|
185
|
+
de as t
|
|
181
186
|
};
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { o as R } from "./rolldown-runtime-Dw9YIBcH.js";
|
|
2
|
+
import { t as q } from "./prop-types-BCUW56rg.js";
|
|
3
|
+
import { n as D, t as l } from "./utils-B-6R7kNE.js";
|
|
4
|
+
import { SearchIcon as F } from "./assets/icons/components/Search.js";
|
|
5
|
+
import { WarningIcon as K } from "./assets/icons/components/Warning.js";
|
|
6
|
+
import { Typography as g } from "./components/Typography/Typography.js";
|
|
7
|
+
import { inputVariants as V } from "./components/Input/Input.variants.js";
|
|
8
|
+
import d, { forwardRef as w, useId as G, useRef as J, useState as Q } from "react";
|
|
9
|
+
import { jsx as i, jsxs as v } from "react/jsx-runtime";
|
|
10
|
+
var c = /* @__PURE__ */ R(q());
|
|
11
|
+
function y() {
|
|
12
|
+
return y = Object.assign || function(e) {
|
|
13
|
+
for (var o = 1; o < arguments.length; o++) {
|
|
14
|
+
var r = arguments[o];
|
|
15
|
+
for (var t in r) Object.prototype.hasOwnProperty.call(r, t) && (e[t] = r[t]);
|
|
16
|
+
}
|
|
17
|
+
return e;
|
|
18
|
+
}, y.apply(this, arguments);
|
|
19
|
+
}
|
|
20
|
+
function U(e, o) {
|
|
21
|
+
if (e == null) return {};
|
|
22
|
+
var r = X(e, o), t, n;
|
|
23
|
+
if (Object.getOwnPropertySymbols) {
|
|
24
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
25
|
+
for (n = 0; n < a.length; n++)
|
|
26
|
+
t = a[n], !(o.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(e, t) && (r[t] = e[t]);
|
|
27
|
+
}
|
|
28
|
+
return r;
|
|
29
|
+
}
|
|
30
|
+
function X(e, o) {
|
|
31
|
+
if (e == null) return {};
|
|
32
|
+
var r = {}, t = Object.keys(e), n, a;
|
|
33
|
+
for (a = 0; a < t.length; a++)
|
|
34
|
+
n = t[a], !(o.indexOf(n) >= 0) && (r[n] = e[n]);
|
|
35
|
+
return r;
|
|
36
|
+
}
|
|
37
|
+
var b = w(function(e, o) {
|
|
38
|
+
var r = e.color, t = r === void 0 ? "currentColor" : r, n = e.size, a = n === void 0 ? 24 : n, p = U(e, ["color", "size"]);
|
|
39
|
+
return /* @__PURE__ */ d.createElement("svg", y({
|
|
40
|
+
ref: o,
|
|
41
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
42
|
+
width: a,
|
|
43
|
+
height: a,
|
|
44
|
+
viewBox: "0 0 24 24",
|
|
45
|
+
fill: "none",
|
|
46
|
+
stroke: t,
|
|
47
|
+
strokeWidth: "2",
|
|
48
|
+
strokeLinecap: "round",
|
|
49
|
+
strokeLinejoin: "round"
|
|
50
|
+
}, p), /* @__PURE__ */ d.createElement("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }), /* @__PURE__ */ d.createElement("line", {
|
|
51
|
+
x1: "1",
|
|
52
|
+
y1: "1",
|
|
53
|
+
x2: "23",
|
|
54
|
+
y2: "23"
|
|
55
|
+
}));
|
|
56
|
+
});
|
|
57
|
+
b.propTypes = {
|
|
58
|
+
color: c.default.string,
|
|
59
|
+
size: c.default.oneOfType([c.default.string, c.default.number])
|
|
60
|
+
};
|
|
61
|
+
b.displayName = "EyeOff";
|
|
62
|
+
function x() {
|
|
63
|
+
return x = Object.assign || function(e) {
|
|
64
|
+
for (var o = 1; o < arguments.length; o++) {
|
|
65
|
+
var r = arguments[o];
|
|
66
|
+
for (var t in r) Object.prototype.hasOwnProperty.call(r, t) && (e[t] = r[t]);
|
|
67
|
+
}
|
|
68
|
+
return e;
|
|
69
|
+
}, x.apply(this, arguments);
|
|
70
|
+
}
|
|
71
|
+
function Y(e, o) {
|
|
72
|
+
if (e == null) return {};
|
|
73
|
+
var r = Z(e, o), t, n;
|
|
74
|
+
if (Object.getOwnPropertySymbols) {
|
|
75
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
76
|
+
for (n = 0; n < a.length; n++)
|
|
77
|
+
t = a[n], !(o.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(e, t) && (r[t] = e[t]);
|
|
78
|
+
}
|
|
79
|
+
return r;
|
|
80
|
+
}
|
|
81
|
+
function Z(e, o) {
|
|
82
|
+
if (e == null) return {};
|
|
83
|
+
var r = {}, t = Object.keys(e), n, a;
|
|
84
|
+
for (a = 0; a < t.length; a++)
|
|
85
|
+
n = t[a], !(o.indexOf(n) >= 0) && (r[n] = e[n]);
|
|
86
|
+
return r;
|
|
87
|
+
}
|
|
88
|
+
var O = w(function(e, o) {
|
|
89
|
+
var r = e.color, t = r === void 0 ? "currentColor" : r, n = e.size, a = n === void 0 ? 24 : n, p = Y(e, ["color", "size"]);
|
|
90
|
+
return /* @__PURE__ */ d.createElement("svg", x({
|
|
91
|
+
ref: o,
|
|
92
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
93
|
+
width: a,
|
|
94
|
+
height: a,
|
|
95
|
+
viewBox: "0 0 24 24",
|
|
96
|
+
fill: "none",
|
|
97
|
+
stroke: t,
|
|
98
|
+
strokeWidth: "2",
|
|
99
|
+
strokeLinecap: "round",
|
|
100
|
+
strokeLinejoin: "round"
|
|
101
|
+
}, p), /* @__PURE__ */ d.createElement("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }), /* @__PURE__ */ d.createElement("circle", {
|
|
102
|
+
cx: "12",
|
|
103
|
+
cy: "12",
|
|
104
|
+
r: "3"
|
|
105
|
+
}));
|
|
106
|
+
});
|
|
107
|
+
O.propTypes = {
|
|
108
|
+
color: c.default.string,
|
|
109
|
+
size: c.default.oneOfType([c.default.string, c.default.number])
|
|
110
|
+
};
|
|
111
|
+
O.displayName = "Eye";
|
|
112
|
+
var ee = w(({ className: e, error: o, helperText: r, helperTextClassName: t, hidePasswordLabel: n = "Hide password", id: a, isRequired: p = !1, isSearch: j = !1, label: k, labelAction: I, labelClassName: _, labelWrapperClassName: z, name: $, showPasswordLabel: T = "Show password", theme: L, type: f = "text", ...W }, S) => {
|
|
113
|
+
const M = G(), u = a ?? M, N = `${u}-error`, E = `${u}-helper-text`, B = J(f === "password"), [m, C] = Q(() => f !== "password"), s = typeof o == "string" && o.length > 0, h = f === "password", P = !s && !!r, A = D(s && N, P && E), H = m ? O : b;
|
|
114
|
+
return /* @__PURE__ */ v("div", {
|
|
115
|
+
className: "flex flex-col gap-2 w-full relative",
|
|
116
|
+
"data-theme": L,
|
|
117
|
+
children: [
|
|
118
|
+
k ? /* @__PURE__ */ v("div", {
|
|
119
|
+
className: l("flex items-center justify-between", z),
|
|
120
|
+
children: [/* @__PURE__ */ v(g, {
|
|
121
|
+
component: "label",
|
|
122
|
+
variant: "labelLarge",
|
|
123
|
+
htmlFor: u,
|
|
124
|
+
className: l("cursor-pointer", "flex", "gap-1", "text-sm", "font-medium", _),
|
|
125
|
+
children: [
|
|
126
|
+
k,
|
|
127
|
+
" ",
|
|
128
|
+
p && /* @__PURE__ */ i(g, {
|
|
129
|
+
component: "span",
|
|
130
|
+
"aria-hidden": "true",
|
|
131
|
+
className: l("text-red-600", "dark:text-red-500", "text-xs", "mt-0.5"),
|
|
132
|
+
children: "*"
|
|
133
|
+
})
|
|
134
|
+
]
|
|
135
|
+
}), I]
|
|
136
|
+
}) : null,
|
|
137
|
+
/* @__PURE__ */ v("div", {
|
|
138
|
+
className: "relative",
|
|
139
|
+
children: [
|
|
140
|
+
j ? /* @__PURE__ */ i("i", {
|
|
141
|
+
className: l("absolute", "left-2.5", "top-1/2", "-translate-y-1/2", "text-slate-400", "dark:text-metal-400", { "text-red-700": s }),
|
|
142
|
+
children: /* @__PURE__ */ i(F, { className: "w-5 h-5" })
|
|
143
|
+
}) : null,
|
|
144
|
+
/* @__PURE__ */ i("input", {
|
|
145
|
+
...W,
|
|
146
|
+
id: u,
|
|
147
|
+
ref: S,
|
|
148
|
+
name: $,
|
|
149
|
+
type: m ? B.current ? "text" : f : "password",
|
|
150
|
+
"data-error": s,
|
|
151
|
+
"aria-invalid": s || void 0,
|
|
152
|
+
"aria-describedby": A,
|
|
153
|
+
"aria-required": p || void 0,
|
|
154
|
+
className: l(V({
|
|
155
|
+
className: e,
|
|
156
|
+
variant: s ? "error" : "default"
|
|
157
|
+
}), {
|
|
158
|
+
"pr-10": h || s,
|
|
159
|
+
"pr-16": h && s,
|
|
160
|
+
"pl-8": j
|
|
161
|
+
})
|
|
162
|
+
}),
|
|
163
|
+
s ? /* @__PURE__ */ i("i", {
|
|
164
|
+
className: l("-translate-y-1/2", "absolute", "text-red-700", "top-1/2", "dark:text-red-500", h ? "right-10" : "right-3"),
|
|
165
|
+
children: /* @__PURE__ */ i(K, { className: "w-5 h-5" })
|
|
166
|
+
}) : null,
|
|
167
|
+
h ? /* @__PURE__ */ i("button", {
|
|
168
|
+
type: "button",
|
|
169
|
+
"aria-label": m ? n : T,
|
|
170
|
+
className: l("-translate-y-1/2", "absolute", "cursor-pointer", "right-3", "text-slate-400", "top-1/2"),
|
|
171
|
+
onClick: () => C(!m),
|
|
172
|
+
children: /* @__PURE__ */ i(H, { className: "w-5 h-5" })
|
|
173
|
+
}) : null
|
|
174
|
+
]
|
|
175
|
+
}),
|
|
176
|
+
s ? /* @__PURE__ */ i(g, {
|
|
177
|
+
component: "span",
|
|
178
|
+
id: N,
|
|
179
|
+
className: l("text-xs", "tracking-normal", "text-red-700", "dark:text-red-400"),
|
|
180
|
+
children: o
|
|
181
|
+
}) : null,
|
|
182
|
+
P ? /* @__PURE__ */ i(g, {
|
|
183
|
+
component: "span",
|
|
184
|
+
id: E,
|
|
185
|
+
variant: "body1",
|
|
186
|
+
className: l("text-xs", "text-slate-600", "dark:text-slate-200", "select-none", "tracking-normal", t),
|
|
187
|
+
children: r
|
|
188
|
+
}) : null
|
|
189
|
+
]
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
ee.displayName = "KonstructInput";
|
|
193
|
+
export {
|
|
194
|
+
ee as t
|
|
195
|
+
};
|