@helpwave/hightide 0.1.37 → 0.1.39
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/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs.map +1 -1
- package/dist/components/date/DayPicker.js.map +1 -1
- package/dist/components/date/DayPicker.mjs.map +1 -1
- package/dist/components/date/TimeDisplay.js.map +1 -1
- package/dist/components/date/TimeDisplay.mjs.map +1 -1
- package/dist/components/date/YearMonthPicker.js.map +1 -1
- package/dist/components/date/YearMonthPicker.mjs.map +1 -1
- package/dist/components/date/index.js.map +1 -1
- package/dist/components/date/index.mjs.map +1 -1
- package/dist/components/dialog/ConfirmDialog.js +15 -9
- package/dist/components/dialog/ConfirmDialog.js.map +1 -1
- package/dist/components/dialog/ConfirmDialog.mjs +16 -10
- package/dist/components/dialog/ConfirmDialog.mjs.map +1 -1
- package/dist/components/dialog/Dialog.d.mts +4 -5
- package/dist/components/dialog/Dialog.d.ts +4 -5
- package/dist/components/dialog/Dialog.js +15 -9
- package/dist/components/dialog/Dialog.js.map +1 -1
- package/dist/components/dialog/Dialog.mjs +16 -10
- package/dist/components/dialog/Dialog.mjs.map +1 -1
- package/dist/components/dialog/DiscardChangesDialog.js +15 -9
- package/dist/components/dialog/DiscardChangesDialog.js.map +1 -1
- package/dist/components/dialog/DiscardChangesDialog.mjs +16 -10
- package/dist/components/dialog/DiscardChangesDialog.mjs.map +1 -1
- package/dist/components/dialog/InputDialog.js +15 -9
- package/dist/components/dialog/InputDialog.js.map +1 -1
- package/dist/components/dialog/InputDialog.mjs +16 -10
- package/dist/components/dialog/InputDialog.mjs.map +1 -1
- package/dist/components/dialog/LanguageDialog.js +188 -154
- package/dist/components/dialog/LanguageDialog.js.map +1 -1
- package/dist/components/dialog/LanguageDialog.mjs +151 -116
- package/dist/components/dialog/LanguageDialog.mjs.map +1 -1
- package/dist/components/dialog/ThemeDialog.js +191 -157
- package/dist/components/dialog/ThemeDialog.js.map +1 -1
- package/dist/components/dialog/ThemeDialog.mjs +151 -116
- package/dist/components/dialog/ThemeDialog.mjs.map +1 -1
- package/dist/components/dialog/index.js +205 -171
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/dialog/index.mjs +152 -117
- package/dist/components/dialog/index.mjs.map +1 -1
- package/dist/components/index.js +337 -299
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +198 -159
- package/dist/components/index.mjs.map +1 -1
- package/dist/components/layout/Carousel.d.mts +2 -1
- package/dist/components/layout/Carousel.d.ts +2 -1
- package/dist/components/layout/Carousel.js +4 -0
- package/dist/components/layout/Carousel.js.map +1 -1
- package/dist/components/layout/Carousel.mjs +4 -0
- package/dist/components/layout/Carousel.mjs.map +1 -1
- package/dist/components/layout/TextImage.js.map +1 -1
- package/dist/components/layout/TextImage.mjs.map +1 -1
- package/dist/components/layout/index.js +4 -0
- package/dist/components/layout/index.js.map +1 -1
- package/dist/components/layout/index.mjs +4 -0
- package/dist/components/layout/index.mjs.map +1 -1
- package/dist/components/loading-states/ErrorComponent.js.map +1 -1
- package/dist/components/loading-states/ErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.mjs.map +1 -1
- package/dist/components/loading-states/index.js.map +1 -1
- package/dist/components/loading-states/index.mjs.map +1 -1
- package/dist/components/navigation/Pagination.js.map +1 -1
- package/dist/components/navigation/Pagination.mjs.map +1 -1
- package/dist/components/navigation/StepperBar.js.map +1 -1
- package/dist/components/navigation/StepperBar.mjs.map +1 -1
- package/dist/components/navigation/index.js.map +1 -1
- package/dist/components/navigation/index.mjs.map +1 -1
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.mjs.map +1 -1
- package/dist/components/properties/MultiSelectProperty.js +129 -101
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +131 -102
- package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.mjs.map +1 -1
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs.map +1 -1
- package/dist/components/properties/SelectProperty.js +129 -101
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +131 -102
- package/dist/components/properties/SelectProperty.mjs.map +1 -1
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.mjs.map +1 -1
- package/dist/components/properties/index.js +129 -101
- package/dist/components/properties/index.js.map +1 -1
- package/dist/components/properties/index.mjs +131 -102
- package/dist/components/properties/index.mjs.map +1 -1
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/table/Table.mjs.map +1 -1
- package/dist/components/table/TableFilterButton.js.map +1 -1
- package/dist/components/table/TableFilterButton.mjs.map +1 -1
- package/dist/components/table/index.js.map +1 -1
- package/dist/components/table/index.mjs.map +1 -1
- package/dist/components/user-action/CopyToClipboardWrapper.js.map +1 -1
- package/dist/components/user-action/CopyToClipboardWrapper.mjs.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
- package/dist/components/user-action/SearchBar.js.map +1 -1
- package/dist/components/user-action/SearchBar.mjs.map +1 -1
- package/dist/components/user-action/index.js +129 -101
- package/dist/components/user-action/index.js.map +1 -1
- package/dist/components/user-action/index.mjs +131 -102
- package/dist/components/user-action/index.mjs.map +1 -1
- package/dist/components/user-action/select/Select.d.mts +2 -0
- package/dist/components/user-action/select/Select.d.ts +2 -0
- package/dist/components/user-action/select/Select.js +129 -101
- package/dist/components/user-action/select/Select.js.map +1 -1
- package/dist/components/user-action/select/Select.mjs +131 -102
- package/dist/components/user-action/select/Select.mjs.map +1 -1
- package/dist/components/user-action/select/index.js +129 -101
- package/dist/components/user-action/select/index.js.map +1 -1
- package/dist/components/user-action/select/index.mjs +131 -102
- package/dist/components/user-action/select/index.mjs.map +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/hooks/useValidators.js.map +1 -1
- package/dist/hooks/useValidators.mjs.map +1 -1
- package/dist/index.js +362 -324
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +206 -167
- package/dist/index.mjs.map +1 -1
- package/dist/localization/LanguageProvider.js +1 -1
- package/dist/localization/LanguageProvider.js.map +1 -1
- package/dist/localization/LanguageProvider.mjs +1 -1
- package/dist/localization/LanguageProvider.mjs.map +1 -1
- package/dist/localization/index.js +1 -1
- package/dist/localization/index.js.map +1 -1
- package/dist/localization/index.mjs +1 -1
- package/dist/localization/index.mjs.map +1 -1
- package/dist/localization/useTranslation.js.map +1 -1
- package/dist/localization/useTranslation.mjs.map +1 -1
- package/dist/style/globals.css +0 -3
- package/dist/theming/index.js +1 -1
- package/dist/theming/index.js.map +1 -1
- package/dist/theming/index.mjs +1 -1
- package/dist/theming/index.mjs.map +1 -1
- package/dist/theming/useTheme.js +1 -1
- package/dist/theming/useTheme.js.map +1 -1
- package/dist/theming/useTheme.mjs +1 -1
- package/dist/theming/useTheme.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -346,7 +346,6 @@ var import_clsx3 = __toESM(require("clsx"));
|
|
|
346
346
|
// src/components/dialog/Dialog.tsx
|
|
347
347
|
var import_react7 = require("react");
|
|
348
348
|
var import_react8 = require("react");
|
|
349
|
-
var import_react9 = require("react");
|
|
350
349
|
var import_clsx2 = __toESM(require("clsx"));
|
|
351
350
|
var import_lucide_react = require("lucide-react");
|
|
352
351
|
|
|
@@ -709,15 +708,18 @@ var Dialog = ({
|
|
|
709
708
|
description,
|
|
710
709
|
isModal = true,
|
|
711
710
|
onClose,
|
|
712
|
-
className,
|
|
713
711
|
backgroundClassName,
|
|
714
712
|
position = "center",
|
|
715
|
-
isAnimated = true
|
|
713
|
+
isAnimated = true,
|
|
714
|
+
containerClassName,
|
|
715
|
+
...props
|
|
716
716
|
}) => {
|
|
717
717
|
const translation = useTranslation([formTranslation]);
|
|
718
718
|
const [visible, setVisible] = (0, import_react8.useState)(isOpen);
|
|
719
|
-
const
|
|
720
|
-
|
|
719
|
+
const generatedId = (0, import_react7.useId)();
|
|
720
|
+
const id = props.id ?? generatedId;
|
|
721
|
+
const ref = (0, import_react8.useRef)(null);
|
|
722
|
+
(0, import_react8.useEffect)(() => {
|
|
721
723
|
if (isOpen) {
|
|
722
724
|
setVisible(true);
|
|
723
725
|
} else {
|
|
@@ -742,14 +744,16 @@ var Dialog = ({
|
|
|
742
744
|
none: ""
|
|
743
745
|
};
|
|
744
746
|
const positionStyle = positionMap[position];
|
|
747
|
+
if (!visible) return;
|
|
745
748
|
return (0, import_react_dom.createPortal)(
|
|
746
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
749
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { id: `dialog-container-${id}`, className: (0, import_clsx2.default)("fixed inset-0 h-screen w-screen", containerClassName), children: [
|
|
747
750
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
748
751
|
"div",
|
|
749
752
|
{
|
|
753
|
+
id: `dialog-background-${id}`,
|
|
750
754
|
hidden: !visible,
|
|
751
755
|
className: (0, import_clsx2.default)(
|
|
752
|
-
"fixed inset-0 h-screen w-screen bg-overlay-shadow
|
|
756
|
+
"fixed inset-0 h-screen w-screen bg-overlay-shadow",
|
|
753
757
|
{
|
|
754
758
|
"motion-safe:animate-fade-in": isOpen,
|
|
755
759
|
"motion-safe:animate-fade-out": !isOpen
|
|
@@ -768,6 +772,8 @@ var Dialog = ({
|
|
|
768
772
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
769
773
|
"div",
|
|
770
774
|
{
|
|
775
|
+
...props,
|
|
776
|
+
id: `dialog-${id}`,
|
|
771
777
|
ref,
|
|
772
778
|
hidden: !visible,
|
|
773
779
|
onKeyDown: (event) => {
|
|
@@ -781,13 +787,13 @@ var Dialog = ({
|
|
|
781
787
|
}
|
|
782
788
|
},
|
|
783
789
|
className: (0, import_clsx2.default)(
|
|
784
|
-
"flex-col-2 p-4 bg-overlay-background text-overlay-text rounded-xl shadow-hw-bottom max-w-[calc(100vw_-_2rem)] max-h-[calc(100vh_-_2rem)]
|
|
790
|
+
"flex-col-2 p-4 bg-overlay-background text-overlay-text rounded-xl shadow-hw-bottom max-w-[calc(100vw_-_2rem)] max-h-[calc(100vh_-_2rem)]",
|
|
785
791
|
{
|
|
786
792
|
"motion-safe:animate-pop-in": isOpen,
|
|
787
793
|
"motion-safe:animate-pop-out": !isOpen
|
|
788
794
|
},
|
|
789
795
|
positionStyle,
|
|
790
|
-
className
|
|
796
|
+
props.className
|
|
791
797
|
),
|
|
792
798
|
children: [
|
|
793
799
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "typography-title-lg mr-8", children: titleElement }),
|
|
@@ -904,17 +910,17 @@ var DiscardChangesDialog = ({
|
|
|
904
910
|
};
|
|
905
911
|
|
|
906
912
|
// src/components/user-action/input/Input.tsx
|
|
907
|
-
var
|
|
913
|
+
var import_react12 = require("react");
|
|
908
914
|
var import_clsx4 = __toESM(require("clsx"));
|
|
909
915
|
|
|
910
916
|
// src/hooks/useDelay.ts
|
|
911
|
-
var
|
|
917
|
+
var import_react9 = require("react");
|
|
912
918
|
var defaultOptions2 = {
|
|
913
919
|
delay: 3e3,
|
|
914
920
|
disabled: false
|
|
915
921
|
};
|
|
916
922
|
function useDelay(options) {
|
|
917
|
-
const [timer, setTimer] = (0,
|
|
923
|
+
const [timer, setTimer] = (0, import_react9.useState)(void 0);
|
|
918
924
|
const { delay, disabled } = {
|
|
919
925
|
...defaultOptions2,
|
|
920
926
|
...options
|
|
@@ -933,12 +939,12 @@ function useDelay(options) {
|
|
|
933
939
|
setTimer(void 0);
|
|
934
940
|
}, delay));
|
|
935
941
|
};
|
|
936
|
-
(0,
|
|
942
|
+
(0, import_react9.useEffect)(() => {
|
|
937
943
|
return () => {
|
|
938
944
|
clearTimeout(timer);
|
|
939
945
|
};
|
|
940
946
|
}, [timer]);
|
|
941
|
-
(0,
|
|
947
|
+
(0, import_react9.useEffect)(() => {
|
|
942
948
|
if (disabled) {
|
|
943
949
|
clearTimeout(timer);
|
|
944
950
|
setTimer(void 0);
|
|
@@ -948,9 +954,9 @@ function useDelay(options) {
|
|
|
948
954
|
}
|
|
949
955
|
|
|
950
956
|
// src/hooks/focus/useFocusManagement.ts
|
|
951
|
-
var
|
|
957
|
+
var import_react10 = require("react");
|
|
952
958
|
function useFocusManagement() {
|
|
953
|
-
const getFocusableElements = (0,
|
|
959
|
+
const getFocusableElements = (0, import_react10.useCallback)(() => {
|
|
954
960
|
return Array.from(
|
|
955
961
|
document.querySelectorAll(
|
|
956
962
|
'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
|
|
@@ -959,7 +965,7 @@ function useFocusManagement() {
|
|
|
959
965
|
(el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
|
|
960
966
|
);
|
|
961
967
|
}, []);
|
|
962
|
-
const getNextFocusElement = (0,
|
|
968
|
+
const getNextFocusElement = (0, import_react10.useCallback)(() => {
|
|
963
969
|
const elements = getFocusableElements();
|
|
964
970
|
if (elements.length === 0) {
|
|
965
971
|
return void 0;
|
|
@@ -971,11 +977,11 @@ function useFocusManagement() {
|
|
|
971
977
|
}
|
|
972
978
|
return nextElement;
|
|
973
979
|
}, [getFocusableElements]);
|
|
974
|
-
const focusNext = (0,
|
|
980
|
+
const focusNext = (0, import_react10.useCallback)(() => {
|
|
975
981
|
const nextElement = getNextFocusElement();
|
|
976
982
|
nextElement?.focus();
|
|
977
983
|
}, [getNextFocusElement]);
|
|
978
|
-
const getPreviousFocusElement = (0,
|
|
984
|
+
const getPreviousFocusElement = (0, import_react10.useCallback)(() => {
|
|
979
985
|
const elements = getFocusableElements();
|
|
980
986
|
if (elements.length === 0) {
|
|
981
987
|
return void 0;
|
|
@@ -991,7 +997,7 @@ function useFocusManagement() {
|
|
|
991
997
|
}
|
|
992
998
|
return previousElement;
|
|
993
999
|
}, [getFocusableElements]);
|
|
994
|
-
const focusPrevious = (0,
|
|
1000
|
+
const focusPrevious = (0, import_react10.useCallback)(() => {
|
|
995
1001
|
const previousElement = getPreviousFocusElement();
|
|
996
1002
|
if (previousElement) previousElement.focus();
|
|
997
1003
|
}, [getPreviousFocusElement]);
|
|
@@ -1005,10 +1011,10 @@ function useFocusManagement() {
|
|
|
1005
1011
|
}
|
|
1006
1012
|
|
|
1007
1013
|
// src/hooks/useOverwritableState.ts
|
|
1008
|
-
var
|
|
1014
|
+
var import_react11 = require("react");
|
|
1009
1015
|
var useOverwritableState = (initialValue, onChange) => {
|
|
1010
|
-
const [state, setState] = (0,
|
|
1011
|
-
(0,
|
|
1016
|
+
const [state, setState] = (0, import_react11.useState)(initialValue);
|
|
1017
|
+
(0, import_react11.useEffect)(() => {
|
|
1012
1018
|
setState(initialValue);
|
|
1013
1019
|
}, [initialValue]);
|
|
1014
1020
|
const onChangeWrapper = (action) => {
|
|
@@ -1027,7 +1033,7 @@ var defaultEditCompleteOptions = {
|
|
|
1027
1033
|
afterDelay: true,
|
|
1028
1034
|
delay: 2500
|
|
1029
1035
|
};
|
|
1030
|
-
var Input = (0,
|
|
1036
|
+
var Input = (0, import_react12.forwardRef)(function Input2({
|
|
1031
1037
|
value,
|
|
1032
1038
|
onChange,
|
|
1033
1039
|
onChangeText,
|
|
@@ -1049,8 +1055,8 @@ var Input = (0, import_react13.forwardRef)(function Input2({
|
|
|
1049
1055
|
restartTimer,
|
|
1050
1056
|
clearTimer
|
|
1051
1057
|
} = useDelay({ delay, disabled: !afterDelay });
|
|
1052
|
-
const innerRef = (0,
|
|
1053
|
-
(0,
|
|
1058
|
+
const innerRef = (0, import_react12.useRef)(null);
|
|
1059
|
+
(0, import_react12.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
1054
1060
|
const { focusNext } = useFocusManagement();
|
|
1055
1061
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1056
1062
|
"input",
|
|
@@ -1120,11 +1126,11 @@ var InputDialog = ({
|
|
|
1120
1126
|
};
|
|
1121
1127
|
|
|
1122
1128
|
// src/components/user-action/select/Select.tsx
|
|
1123
|
-
var
|
|
1129
|
+
var import_react15 = require("react");
|
|
1124
1130
|
var import_clsx7 = __toESM(require("clsx"));
|
|
1125
1131
|
|
|
1126
1132
|
// src/components/layout/Expandable.tsx
|
|
1127
|
-
var
|
|
1133
|
+
var import_react13 = require("react");
|
|
1128
1134
|
var import_lucide_react2 = require("lucide-react");
|
|
1129
1135
|
var import_clsx5 = __toESM(require("clsx"));
|
|
1130
1136
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
@@ -1141,7 +1147,7 @@ var ExpansionIcon = ({ isExpanded, className }) => {
|
|
|
1141
1147
|
}
|
|
1142
1148
|
);
|
|
1143
1149
|
};
|
|
1144
|
-
var Expandable = (0,
|
|
1150
|
+
var Expandable = (0, import_react13.forwardRef)(function Expandable2({
|
|
1145
1151
|
children,
|
|
1146
1152
|
id: providedId,
|
|
1147
1153
|
label,
|
|
@@ -1155,9 +1161,9 @@ var Expandable = (0, import_react14.forwardRef)(function Expandable2({
|
|
|
1155
1161
|
contentClassName,
|
|
1156
1162
|
contentExpandedClassName
|
|
1157
1163
|
}, ref) {
|
|
1158
|
-
const defaultIcon = (0,
|
|
1164
|
+
const defaultIcon = (0, import_react13.useCallback)((expanded) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ExpansionIcon, { isExpanded: expanded }), []);
|
|
1159
1165
|
icon ??= defaultIcon;
|
|
1160
|
-
const generatedId = (0,
|
|
1166
|
+
const generatedId = (0, import_react13.useId)();
|
|
1161
1167
|
const id = providedId ?? generatedId;
|
|
1162
1168
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1163
1169
|
"div",
|
|
@@ -1212,7 +1218,7 @@ var Expandable = (0, import_react14.forwardRef)(function Expandable2({
|
|
|
1212
1218
|
}
|
|
1213
1219
|
);
|
|
1214
1220
|
});
|
|
1215
|
-
var ExpandableUncontrolled = (0,
|
|
1221
|
+
var ExpandableUncontrolled = (0, import_react13.forwardRef)(function ExpandableUncontrolled2({
|
|
1216
1222
|
isExpanded,
|
|
1217
1223
|
onChange,
|
|
1218
1224
|
...props
|
|
@@ -1301,7 +1307,7 @@ var Chip = ({
|
|
|
1301
1307
|
};
|
|
1302
1308
|
|
|
1303
1309
|
// src/hooks/useFloatingElement.ts
|
|
1304
|
-
var
|
|
1310
|
+
var import_react14 = require("react");
|
|
1305
1311
|
|
|
1306
1312
|
// src/utils/math.ts
|
|
1307
1313
|
var clamp = (value, range = [0, 1]) => {
|
|
@@ -1364,9 +1370,9 @@ function useFloatingElement({
|
|
|
1364
1370
|
screenPadding = 16,
|
|
1365
1371
|
gap = 4
|
|
1366
1372
|
}) {
|
|
1367
|
-
const [style, setStyle] = (0,
|
|
1373
|
+
const [style, setStyle] = (0, import_react14.useState)();
|
|
1368
1374
|
const isMounted = useIsMounted();
|
|
1369
|
-
const calculate = (0,
|
|
1375
|
+
const calculate = (0, import_react14.useCallback)(() => {
|
|
1370
1376
|
const containerRect = containerRef.current.getBoundingClientRect();
|
|
1371
1377
|
const windowRect = windowRef?.current.getBoundingClientRect() ?? {
|
|
1372
1378
|
top: 0,
|
|
@@ -1396,14 +1402,14 @@ function useFloatingElement({
|
|
|
1396
1402
|
}, [anchorRef, containerRef, gap, horizontalAlignment, screenPadding, verticalAlignment, windowRef]);
|
|
1397
1403
|
const height = containerRef.current?.getBoundingClientRect().height;
|
|
1398
1404
|
const width = containerRef.current?.getBoundingClientRect().width;
|
|
1399
|
-
(0,
|
|
1405
|
+
(0, import_react14.useEffect)(() => {
|
|
1400
1406
|
if (active && isMounted) {
|
|
1401
1407
|
calculate();
|
|
1402
1408
|
} else {
|
|
1403
1409
|
setStyle(void 0);
|
|
1404
1410
|
}
|
|
1405
1411
|
}, [calculate, active, isMounted, height, width]);
|
|
1406
|
-
(0,
|
|
1412
|
+
(0, import_react14.useEffect)(() => {
|
|
1407
1413
|
window.addEventListener("resize", calculate);
|
|
1408
1414
|
let timeout;
|
|
1409
1415
|
if (isPolling) {
|
|
@@ -1423,11 +1429,11 @@ function useFloatingElement({
|
|
|
1423
1429
|
var import_react_dom2 = require("react-dom");
|
|
1424
1430
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1425
1431
|
var defaultToggleOpenOptions = {
|
|
1426
|
-
|
|
1432
|
+
highlightStartPositionBehavior: "first"
|
|
1427
1433
|
};
|
|
1428
|
-
var SelectContext = (0,
|
|
1434
|
+
var SelectContext = (0, import_react15.createContext)(null);
|
|
1429
1435
|
function useSelectContext() {
|
|
1430
|
-
const ctx = (0,
|
|
1436
|
+
const ctx = (0, import_react15.useContext)(SelectContext);
|
|
1431
1437
|
if (!ctx) {
|
|
1432
1438
|
throw new Error("SelectContext must be used within a ListBoxPrimitive");
|
|
1433
1439
|
}
|
|
@@ -1446,47 +1452,62 @@ var SelectRoot = ({
|
|
|
1446
1452
|
isMultiSelect = false,
|
|
1447
1453
|
iconAppearance = "left"
|
|
1448
1454
|
}) => {
|
|
1449
|
-
const
|
|
1450
|
-
const
|
|
1451
|
-
const generatedId = (0, import_react16.useId)();
|
|
1455
|
+
const triggerRef = (0, import_react15.useRef)(null);
|
|
1456
|
+
const generatedId = (0, import_react15.useId)();
|
|
1452
1457
|
const usedId = id ?? generatedId;
|
|
1453
|
-
const [internalState, setInternalState] = (0,
|
|
1454
|
-
isOpen
|
|
1458
|
+
const [internalState, setInternalState] = (0, import_react15.useState)({
|
|
1459
|
+
isOpen,
|
|
1460
|
+
options: []
|
|
1455
1461
|
});
|
|
1456
|
-
const selectedValues =
|
|
1462
|
+
const selectedValues = (0, import_react15.useMemo)(
|
|
1463
|
+
() => isMultiSelect ? values ?? [] : [value].filter(Boolean),
|
|
1464
|
+
[isMultiSelect, value, values]
|
|
1465
|
+
);
|
|
1466
|
+
const selectedOptions = (0, import_react15.useMemo)(
|
|
1467
|
+
() => selectedValues.map((value2) => internalState.options.find((option) => value2 === option.value)).filter(Boolean),
|
|
1468
|
+
[selectedValues, internalState.options]
|
|
1469
|
+
);
|
|
1457
1470
|
const state = {
|
|
1458
1471
|
...internalState,
|
|
1459
1472
|
id: usedId,
|
|
1460
1473
|
disabled,
|
|
1461
1474
|
invalid,
|
|
1462
1475
|
value: selectedValues,
|
|
1463
|
-
|
|
1464
|
-
selectedOptions: selectedValues.map((value2) => options.find((option) => value2 === option.value)).filter(Boolean)
|
|
1476
|
+
selectedOptions
|
|
1465
1477
|
};
|
|
1466
1478
|
const config = {
|
|
1467
1479
|
isMultiSelect,
|
|
1468
1480
|
iconAppearance
|
|
1469
1481
|
};
|
|
1470
|
-
const registerItem = (0,
|
|
1471
|
-
|
|
1472
|
-
const
|
|
1473
|
-
|
|
1482
|
+
const registerItem = (0, import_react15.useCallback)((item) => {
|
|
1483
|
+
setInternalState((prev) => {
|
|
1484
|
+
const updatedOptions = [...prev.options, item];
|
|
1485
|
+
updatedOptions.sort((a, b) => {
|
|
1474
1486
|
const aEl = a.ref.current;
|
|
1475
1487
|
const bEl = b.ref.current;
|
|
1476
1488
|
if (!aEl || !bEl) return 0;
|
|
1477
1489
|
return aEl.compareDocumentPosition(bEl) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
|
|
1478
1490
|
});
|
|
1479
|
-
return
|
|
1491
|
+
return {
|
|
1492
|
+
...prev,
|
|
1493
|
+
options: updatedOptions
|
|
1494
|
+
};
|
|
1480
1495
|
});
|
|
1481
1496
|
}, []);
|
|
1482
|
-
const unregisterItem = (0,
|
|
1483
|
-
|
|
1497
|
+
const unregisterItem = (0, import_react15.useCallback)((value2) => {
|
|
1498
|
+
setInternalState((prev) => {
|
|
1499
|
+
const updatedOptions = prev.options.filter((i) => i.value !== value2);
|
|
1500
|
+
return {
|
|
1501
|
+
...prev,
|
|
1502
|
+
options: updatedOptions
|
|
1503
|
+
};
|
|
1504
|
+
});
|
|
1484
1505
|
}, []);
|
|
1485
1506
|
const toggleSelection = (value2, isSelected) => {
|
|
1486
1507
|
if (disabled) {
|
|
1487
1508
|
return;
|
|
1488
1509
|
}
|
|
1489
|
-
const option = options.find((i) => i.value === value2);
|
|
1510
|
+
const option = state.options.find((i) => i.value === value2);
|
|
1490
1511
|
if (!option) {
|
|
1491
1512
|
console.error(`SelectOption with value: ${value2} not found`);
|
|
1492
1513
|
return;
|
|
@@ -1522,42 +1543,47 @@ var SelectRoot = ({
|
|
|
1522
1543
|
highlightedValue: value2
|
|
1523
1544
|
}));
|
|
1524
1545
|
};
|
|
1525
|
-
const registerTrigger = (0,
|
|
1546
|
+
const registerTrigger = (0, import_react15.useCallback)((ref) => {
|
|
1526
1547
|
triggerRef.current = ref.current;
|
|
1527
1548
|
}, []);
|
|
1528
|
-
const unregisterTrigger = (0,
|
|
1549
|
+
const unregisterTrigger = (0, import_react15.useCallback)(() => {
|
|
1529
1550
|
triggerRef.current = null;
|
|
1530
1551
|
}, []);
|
|
1531
1552
|
const toggleOpen = (isOpen2, toggleOpenOptions) => {
|
|
1532
|
-
const {
|
|
1533
|
-
let
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1553
|
+
const { highlightStartPositionBehavior } = { ...defaultToggleOpenOptions, ...toggleOpenOptions };
|
|
1554
|
+
let firstSelectedValue;
|
|
1555
|
+
let firstEnabledValue;
|
|
1556
|
+
for (let i = 0; i < state.options.length; i++) {
|
|
1557
|
+
const currentOption = state.options[highlightStartPositionBehavior === "first" ? i : state.options.length - i - 1];
|
|
1558
|
+
if (!currentOption.disabled) {
|
|
1559
|
+
if (!firstEnabledValue) {
|
|
1560
|
+
firstEnabledValue = currentOption.value;
|
|
1561
|
+
}
|
|
1562
|
+
if (selectedValues.includes(currentOption.value)) {
|
|
1563
|
+
firstSelectedValue = currentOption.value;
|
|
1564
|
+
break;
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1541
1567
|
}
|
|
1542
1568
|
setInternalState((prevState) => ({
|
|
1543
1569
|
...prevState,
|
|
1544
1570
|
isOpen: isOpen2 ?? !prevState.isOpen,
|
|
1545
|
-
highlightedValue:
|
|
1571
|
+
highlightedValue: firstSelectedValue ?? firstEnabledValue
|
|
1546
1572
|
}));
|
|
1547
1573
|
};
|
|
1548
1574
|
const moveHighlightedIndex = (delta) => {
|
|
1549
|
-
let highlightedIndex = options.findIndex((value2) => value2.value === internalState.highlightedValue);
|
|
1575
|
+
let highlightedIndex = state.options.findIndex((value2) => value2.value === internalState.highlightedValue);
|
|
1550
1576
|
if (highlightedIndex === -1) {
|
|
1551
1577
|
highlightedIndex = 0;
|
|
1552
1578
|
}
|
|
1553
|
-
const optionLength = options.length;
|
|
1579
|
+
const optionLength = state.options.length;
|
|
1554
1580
|
const startIndex = (highlightedIndex + delta % optionLength + optionLength) % optionLength;
|
|
1555
1581
|
const isForward = delta >= 0;
|
|
1556
|
-
let highlightedValue = options[startIndex].value;
|
|
1557
|
-
for (let i = 0; i < options.length; i++) {
|
|
1582
|
+
let highlightedValue = state.options[startIndex].value;
|
|
1583
|
+
for (let i = 0; i < state.options.length; i++) {
|
|
1558
1584
|
const index = (startIndex + (isForward ? i : -i) + optionLength) % optionLength;
|
|
1559
|
-
if (!options[index].disabled) {
|
|
1560
|
-
highlightedValue = options[index].value;
|
|
1585
|
+
if (!state.options[index].disabled) {
|
|
1586
|
+
highlightedValue = state.options[index].value;
|
|
1561
1587
|
break;
|
|
1562
1588
|
}
|
|
1563
1589
|
}
|
|
@@ -1566,11 +1592,11 @@ var SelectRoot = ({
|
|
|
1566
1592
|
highlightedValue
|
|
1567
1593
|
}));
|
|
1568
1594
|
};
|
|
1569
|
-
(0,
|
|
1595
|
+
(0, import_react15.useEffect)(() => {
|
|
1570
1596
|
if (!internalState.highlightedValue) return;
|
|
1571
|
-
const highlighted = options.find((value2) => value2.value === internalState.highlightedValue);
|
|
1597
|
+
const highlighted = internalState.options.find((value2) => value2.value === internalState.highlightedValue);
|
|
1572
1598
|
if (highlighted) {
|
|
1573
|
-
highlighted.ref.current
|
|
1599
|
+
highlighted.ref.current?.scrollIntoView({ behavior: "instant", block: "nearest" });
|
|
1574
1600
|
} else {
|
|
1575
1601
|
console.error(`SelectRoot: Could not find highlighted value (${internalState.highlightedValue})`);
|
|
1576
1602
|
}
|
|
@@ -1594,14 +1620,14 @@ var SelectRoot = ({
|
|
|
1594
1620
|
};
|
|
1595
1621
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SelectContext.Provider, { value: contextValue, children });
|
|
1596
1622
|
};
|
|
1597
|
-
var SelectOption = (0,
|
|
1623
|
+
var SelectOption = (0, import_react15.forwardRef)(
|
|
1598
1624
|
function SelectOption2({ children, value, disabled = false, iconAppearance, className, ...restProps }, ref) {
|
|
1599
1625
|
const { state, config, item, trigger } = useSelectContext();
|
|
1600
1626
|
const { register, unregister, toggleSelection, highlightItem } = item;
|
|
1601
|
-
const itemRef = (0,
|
|
1627
|
+
const itemRef = (0, import_react15.useRef)(null);
|
|
1602
1628
|
iconAppearance ??= config.iconAppearance;
|
|
1603
1629
|
const label = children ?? value;
|
|
1604
|
-
(0,
|
|
1630
|
+
(0, import_react15.useEffect)(() => {
|
|
1605
1631
|
register({
|
|
1606
1632
|
value,
|
|
1607
1633
|
label,
|
|
@@ -1679,13 +1705,13 @@ var defaultSelectButtonTranslation = {
|
|
|
1679
1705
|
clickToSelect: "Zum ausw\xE4hlen dr\xFCcken"
|
|
1680
1706
|
}
|
|
1681
1707
|
};
|
|
1682
|
-
var SelectButton = (0,
|
|
1708
|
+
var SelectButton = (0, import_react15.forwardRef)(function SelectButton2({ placeholder, selectedDisplay, ...props }, ref) {
|
|
1683
1709
|
const translation = useTranslation([defaultSelectButtonTranslation]);
|
|
1684
1710
|
const { state, trigger } = useSelectContext();
|
|
1685
1711
|
const { register, unregister, toggleOpen } = trigger;
|
|
1686
|
-
const innerRef = (0,
|
|
1687
|
-
(0,
|
|
1688
|
-
(0,
|
|
1712
|
+
const innerRef = (0, import_react15.useRef)(null);
|
|
1713
|
+
(0, import_react15.useImperativeHandle)(ref, () => innerRef.current);
|
|
1714
|
+
(0, import_react15.useEffect)(() => {
|
|
1689
1715
|
register(innerRef);
|
|
1690
1716
|
return () => unregister();
|
|
1691
1717
|
}, [register, unregister]);
|
|
@@ -1707,12 +1733,12 @@ var SelectButton = (0, import_react16.forwardRef)(function SelectButton2({ place
|
|
|
1707
1733
|
props.onKeyDown?.(event);
|
|
1708
1734
|
switch (event.key) {
|
|
1709
1735
|
case "ArrowDown":
|
|
1710
|
-
toggleOpen(true, {
|
|
1736
|
+
toggleOpen(true, { highlightStartPositionBehavior: "first" });
|
|
1711
1737
|
event.preventDefault();
|
|
1712
1738
|
event.stopPropagation();
|
|
1713
1739
|
break;
|
|
1714
1740
|
case "ArrowUp":
|
|
1715
|
-
toggleOpen(true, {
|
|
1741
|
+
toggleOpen(true, { highlightStartPositionBehavior: "last" });
|
|
1716
1742
|
event.preventDefault();
|
|
1717
1743
|
event.stopPropagation();
|
|
1718
1744
|
break;
|
|
@@ -1758,12 +1784,12 @@ var SelectButton = (0, import_react16.forwardRef)(function SelectButton2({ place
|
|
|
1758
1784
|
}
|
|
1759
1785
|
);
|
|
1760
1786
|
});
|
|
1761
|
-
var SelectChipDisplay = (0,
|
|
1787
|
+
var SelectChipDisplay = (0, import_react15.forwardRef)(function SelectChipDisplay2({ ...props }, ref) {
|
|
1762
1788
|
const { state, trigger, item } = useSelectContext();
|
|
1763
1789
|
const { register, unregister, toggleOpen } = trigger;
|
|
1764
|
-
const innerRef = (0,
|
|
1765
|
-
(0,
|
|
1766
|
-
(0,
|
|
1790
|
+
const innerRef = (0, import_react15.useRef)(null);
|
|
1791
|
+
(0, import_react15.useImperativeHandle)(ref, () => innerRef.current);
|
|
1792
|
+
(0, import_react15.useEffect)(() => {
|
|
1767
1793
|
register(innerRef);
|
|
1768
1794
|
return () => unregister();
|
|
1769
1795
|
}, [register, unregister]);
|
|
@@ -1806,10 +1832,10 @@ var SelectChipDisplay = (0, import_react16.forwardRef)(function SelectChipDispla
|
|
|
1806
1832
|
onKeyDown: (event) => {
|
|
1807
1833
|
switch (event.key) {
|
|
1808
1834
|
case "ArrowDown":
|
|
1809
|
-
toggleOpen(true, {
|
|
1835
|
+
toggleOpen(true, { highlightStartPositionBehavior: "first" });
|
|
1810
1836
|
break;
|
|
1811
1837
|
case "ArrowUp":
|
|
1812
|
-
toggleOpen(true, {
|
|
1838
|
+
toggleOpen(true, { highlightStartPositionBehavior: "last" });
|
|
1813
1839
|
}
|
|
1814
1840
|
},
|
|
1815
1841
|
size: "small",
|
|
@@ -1826,14 +1852,15 @@ var SelectChipDisplay = (0, import_react16.forwardRef)(function SelectChipDispla
|
|
|
1826
1852
|
}
|
|
1827
1853
|
);
|
|
1828
1854
|
});
|
|
1829
|
-
var SelectContent = (0,
|
|
1855
|
+
var SelectContent = (0, import_react15.forwardRef)(
|
|
1830
1856
|
function SelectContent2({
|
|
1831
1857
|
alignment,
|
|
1832
1858
|
orientation = "vertical",
|
|
1859
|
+
containerClassName,
|
|
1833
1860
|
...props
|
|
1834
1861
|
}, ref) {
|
|
1835
|
-
const innerRef = (0,
|
|
1836
|
-
(0,
|
|
1862
|
+
const innerRef = (0, import_react15.useRef)(null);
|
|
1863
|
+
(0, import_react15.useImperativeHandle)(ref, () => innerRef.current);
|
|
1837
1864
|
const { trigger, state, config, item } = useSelectContext();
|
|
1838
1865
|
const position = useFloatingElement({
|
|
1839
1866
|
active: state.isOpen,
|
|
@@ -1846,81 +1873,88 @@ var SelectContent = (0, import_react16.forwardRef)(
|
|
|
1846
1873
|
active: state.isOpen && !!position
|
|
1847
1874
|
});
|
|
1848
1875
|
return (0, import_react_dom2.createPortal)(
|
|
1849
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
{
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
vertical: "ArrowDown",
|
|
1874
|
-
horizontal: "ArrowUp"
|
|
1875
|
-
}):
|
|
1876
|
-
item.moveHighlightedIndex(1);
|
|
1877
|
-
event.preventDefault();
|
|
1878
|
-
break;
|
|
1879
|
-
case match(orientation, {
|
|
1880
|
-
vertical: "ArrowUp",
|
|
1881
|
-
horizontal: "ArrowDown"
|
|
1882
|
-
}):
|
|
1883
|
-
item.moveHighlightedIndex(-1);
|
|
1884
|
-
event.preventDefault();
|
|
1885
|
-
break;
|
|
1886
|
-
case "Home":
|
|
1887
|
-
event.preventDefault();
|
|
1888
|
-
break;
|
|
1889
|
-
case "End":
|
|
1890
|
-
event.preventDefault();
|
|
1891
|
-
break;
|
|
1892
|
-
case "Enter":
|
|
1893
|
-
// Fall through
|
|
1894
|
-
case " ":
|
|
1895
|
-
if (state.highlightedValue) {
|
|
1896
|
-
item.toggleSelection(state.highlightedValue);
|
|
1897
|
-
if (!config.isMultiSelect) {
|
|
1876
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1877
|
+
"div",
|
|
1878
|
+
{
|
|
1879
|
+
id: `select-container-${state.id}`,
|
|
1880
|
+
className: (0, import_clsx7.default)("fixed inset-0 w-screen h-screen", containerClassName),
|
|
1881
|
+
hidden: !state.isOpen,
|
|
1882
|
+
children: [
|
|
1883
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1884
|
+
"div",
|
|
1885
|
+
{
|
|
1886
|
+
id: `select-background-${state.id}`,
|
|
1887
|
+
onClick: () => trigger.toggleOpen(false),
|
|
1888
|
+
className: (0, import_clsx7.default)("fixed inset-0 w-screen h-screen")
|
|
1889
|
+
}
|
|
1890
|
+
),
|
|
1891
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1892
|
+
"ul",
|
|
1893
|
+
{
|
|
1894
|
+
...props,
|
|
1895
|
+
id: `${state.id}-listbox`,
|
|
1896
|
+
ref: innerRef,
|
|
1897
|
+
onKeyDown: (event) => {
|
|
1898
|
+
switch (event.key) {
|
|
1899
|
+
case "Escape":
|
|
1898
1900
|
trigger.toggleOpen(false);
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
+
event.preventDefault();
|
|
1902
|
+
event.stopPropagation();
|
|
1903
|
+
break;
|
|
1904
|
+
case match(orientation, {
|
|
1905
|
+
vertical: "ArrowDown",
|
|
1906
|
+
horizontal: "ArrowUp"
|
|
1907
|
+
}):
|
|
1908
|
+
item.moveHighlightedIndex(1);
|
|
1909
|
+
event.preventDefault();
|
|
1910
|
+
break;
|
|
1911
|
+
case match(orientation, {
|
|
1912
|
+
vertical: "ArrowUp",
|
|
1913
|
+
horizontal: "ArrowDown"
|
|
1914
|
+
}):
|
|
1915
|
+
item.moveHighlightedIndex(-1);
|
|
1916
|
+
event.preventDefault();
|
|
1917
|
+
break;
|
|
1918
|
+
case "Home":
|
|
1919
|
+
event.preventDefault();
|
|
1920
|
+
break;
|
|
1921
|
+
case "End":
|
|
1922
|
+
event.preventDefault();
|
|
1923
|
+
break;
|
|
1924
|
+
case "Enter":
|
|
1925
|
+
// Fall through
|
|
1926
|
+
case " ":
|
|
1927
|
+
if (state.highlightedValue) {
|
|
1928
|
+
item.toggleSelection(state.highlightedValue);
|
|
1929
|
+
if (!config.isMultiSelect) {
|
|
1930
|
+
trigger.toggleOpen(false);
|
|
1931
|
+
}
|
|
1932
|
+
event.preventDefault();
|
|
1933
|
+
}
|
|
1934
|
+
break;
|
|
1901
1935
|
}
|
|
1902
|
-
|
|
1936
|
+
},
|
|
1937
|
+
className: (0, import_clsx7.default)("flex-col-0 p-2 bg-menu-background text-menu-text rounded-md shadow-hw-bottom focus-style-within overflow-auto", props.className),
|
|
1938
|
+
style: {
|
|
1939
|
+
opacity: position ? void 0 : 0,
|
|
1940
|
+
position: "fixed",
|
|
1941
|
+
...position
|
|
1942
|
+
},
|
|
1943
|
+
role: "listbox",
|
|
1944
|
+
"aria-multiselectable": config.isMultiSelect,
|
|
1945
|
+
"aria-orientation": orientation,
|
|
1946
|
+
tabIndex: position ? 0 : void 0,
|
|
1947
|
+
children: props.children
|
|
1903
1948
|
}
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
position: "fixed",
|
|
1909
|
-
...position
|
|
1910
|
-
},
|
|
1911
|
-
role: "listbox",
|
|
1912
|
-
"aria-multiselectable": config.isMultiSelect,
|
|
1913
|
-
"aria-orientation": orientation,
|
|
1914
|
-
tabIndex: position ? 0 : void 0,
|
|
1915
|
-
children: props.children
|
|
1916
|
-
}
|
|
1917
|
-
)
|
|
1918
|
-
] }),
|
|
1949
|
+
)
|
|
1950
|
+
]
|
|
1951
|
+
}
|
|
1952
|
+
),
|
|
1919
1953
|
document.body
|
|
1920
1954
|
);
|
|
1921
1955
|
}
|
|
1922
1956
|
);
|
|
1923
|
-
var Select = (0,
|
|
1957
|
+
var Select = (0, import_react15.forwardRef)(function Select2({
|
|
1924
1958
|
children,
|
|
1925
1959
|
contentPanelProps,
|
|
1926
1960
|
buttonProps,
|
|
@@ -1942,7 +1976,7 @@ var Select = (0, import_react16.forwardRef)(function Select2({
|
|
|
1942
1976
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SelectContent, { ...contentPanelProps, children })
|
|
1943
1977
|
] });
|
|
1944
1978
|
});
|
|
1945
|
-
var SelectUncontrolled = (0,
|
|
1979
|
+
var SelectUncontrolled = (0, import_react15.forwardRef)(function SelectUncontrolled2({
|
|
1946
1980
|
value: initialValue,
|
|
1947
1981
|
onValueChanged,
|
|
1948
1982
|
...props
|
|
@@ -1958,7 +1992,7 @@ var SelectUncontrolled = (0, import_react16.forwardRef)(function SelectUncontrol
|
|
|
1958
1992
|
}
|
|
1959
1993
|
);
|
|
1960
1994
|
});
|
|
1961
|
-
var MultiSelect = (0,
|
|
1995
|
+
var MultiSelect = (0, import_react15.forwardRef)(function MultiSelect2({
|
|
1962
1996
|
children,
|
|
1963
1997
|
contentPanelProps,
|
|
1964
1998
|
buttonProps,
|
|
@@ -1969,7 +2003,7 @@ var MultiSelect = (0, import_react16.forwardRef)(function MultiSelect2({
|
|
|
1969
2003
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SelectContent, { ...contentPanelProps, children })
|
|
1970
2004
|
] });
|
|
1971
2005
|
});
|
|
1972
|
-
var MultiSelectUncontrolled = (0,
|
|
2006
|
+
var MultiSelectUncontrolled = (0, import_react15.forwardRef)(function MultiSelectUncontrolled2({
|
|
1973
2007
|
values: initialValues,
|
|
1974
2008
|
onValuesChanged,
|
|
1975
2009
|
...props
|
|
@@ -1985,7 +2019,7 @@ var MultiSelectUncontrolled = (0, import_react16.forwardRef)(function MultiSelec
|
|
|
1985
2019
|
}
|
|
1986
2020
|
);
|
|
1987
2021
|
});
|
|
1988
|
-
var MultiSelectChipDisplay = (0,
|
|
2022
|
+
var MultiSelectChipDisplay = (0, import_react15.forwardRef)(function MultiSelectChipDisplay2({
|
|
1989
2023
|
children,
|
|
1990
2024
|
contentPanelProps,
|
|
1991
2025
|
chipDisplayProps,
|
|
@@ -1996,7 +2030,7 @@ var MultiSelectChipDisplay = (0, import_react16.forwardRef)(function MultiSelect
|
|
|
1996
2030
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SelectContent, { ...contentPanelProps, children })
|
|
1997
2031
|
] });
|
|
1998
2032
|
});
|
|
1999
|
-
var MultiSelectChipDisplayUncontrolled = (0,
|
|
2033
|
+
var MultiSelectChipDisplayUncontrolled = (0, import_react15.forwardRef)(function MultiSelectChipDisplayUncontrolled2({
|
|
2000
2034
|
values: initialValues,
|
|
2001
2035
|
onValuesChanged,
|
|
2002
2036
|
...props
|
|
@@ -2069,7 +2103,7 @@ var import_lucide_react4 = require("lucide-react");
|
|
|
2069
2103
|
var import_clsx8 = __toESM(require("clsx"));
|
|
2070
2104
|
|
|
2071
2105
|
// src/theming/useTheme.tsx
|
|
2072
|
-
var
|
|
2106
|
+
var import_react16 = require("react");
|
|
2073
2107
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2074
2108
|
var themes = ["light", "dark", "system"];
|
|
2075
2109
|
var defaultThemeTypeTranslation = {
|
|
@@ -2096,9 +2130,9 @@ var ThemeUtil = {
|
|
|
2096
2130
|
themes,
|
|
2097
2131
|
translation: defaultThemeTypeTranslation
|
|
2098
2132
|
};
|
|
2099
|
-
var ThemeContext = (0,
|
|
2133
|
+
var ThemeContext = (0, import_react16.createContext)(null);
|
|
2100
2134
|
var useTheme = () => {
|
|
2101
|
-
const context = (0,
|
|
2135
|
+
const context = (0, import_react16.useContext)(ThemeContext);
|
|
2102
2136
|
if (!context) {
|
|
2103
2137
|
throw new Error("useTheme must be used within ThemeContext. Try adding a ThemeProvider around your app.");
|
|
2104
2138
|
}
|