@helpwave/hightide 0.1.36 → 0.1.38
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 +16 -9
- package/dist/components/dialog/Dialog.js.map +1 -1
- package/dist/components/dialog/Dialog.mjs +18 -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.d.mts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +333 -299
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +194 -159
- package/dist/components/index.mjs.map +1 -1
- package/dist/components/layout/Carousel.js.map +1 -1
- 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.map +1 -1
- 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/Navigation.d.mts +4 -4
- package/dist/components/navigation/Navigation.d.ts +4 -4
- package/dist/components/navigation/Navigation.js.map +1 -1
- package/dist/components/navigation/Navigation.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.d.mts +1 -1
- package/dist/components/navigation/index.d.ts +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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +358 -324
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +202 -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
package/dist/components/index.js
CHANGED
|
@@ -7827,7 +7827,6 @@ var import_clsx10 = __toESM(require("clsx"));
|
|
|
7827
7827
|
// src/components/dialog/Dialog.tsx
|
|
7828
7828
|
var import_react13 = require("react");
|
|
7829
7829
|
var import_react14 = require("react");
|
|
7830
|
-
var import_react15 = require("react");
|
|
7831
7830
|
var import_clsx9 = __toESM(require("clsx"));
|
|
7832
7831
|
var import_lucide_react3 = require("lucide-react");
|
|
7833
7832
|
|
|
@@ -8190,15 +8189,18 @@ var Dialog = ({
|
|
|
8190
8189
|
description,
|
|
8191
8190
|
isModal = true,
|
|
8192
8191
|
onClose,
|
|
8193
|
-
className,
|
|
8194
8192
|
backgroundClassName,
|
|
8195
8193
|
position = "center",
|
|
8196
|
-
isAnimated = true
|
|
8194
|
+
isAnimated = true,
|
|
8195
|
+
containerClassName,
|
|
8196
|
+
...props
|
|
8197
8197
|
}) => {
|
|
8198
8198
|
const translation = useTranslation([formTranslation]);
|
|
8199
8199
|
const [visible, setVisible] = (0, import_react14.useState)(isOpen);
|
|
8200
|
-
const
|
|
8201
|
-
|
|
8200
|
+
const generatedId = (0, import_react13.useId)();
|
|
8201
|
+
const id = props.id ?? generatedId;
|
|
8202
|
+
const ref = (0, import_react14.useRef)(null);
|
|
8203
|
+
(0, import_react14.useEffect)(() => {
|
|
8202
8204
|
if (isOpen) {
|
|
8203
8205
|
setVisible(true);
|
|
8204
8206
|
} else {
|
|
@@ -8223,14 +8225,16 @@ var Dialog = ({
|
|
|
8223
8225
|
none: ""
|
|
8224
8226
|
};
|
|
8225
8227
|
const positionStyle = positionMap[position];
|
|
8228
|
+
if (!visible) return;
|
|
8226
8229
|
return (0, import_react_dom.createPortal)(
|
|
8227
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
8230
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { id: `dialog-container-${id}`, className: (0, import_clsx9.default)("fixed inset-0 h-screen w-screen", containerClassName), children: [
|
|
8228
8231
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
8229
8232
|
"div",
|
|
8230
8233
|
{
|
|
8234
|
+
id: `dialog-background-${id}`,
|
|
8231
8235
|
hidden: !visible,
|
|
8232
8236
|
className: (0, import_clsx9.default)(
|
|
8233
|
-
"fixed inset-0 h-screen w-screen bg-overlay-shadow
|
|
8237
|
+
"fixed inset-0 h-screen w-screen bg-overlay-shadow",
|
|
8234
8238
|
{
|
|
8235
8239
|
"motion-safe:animate-fade-in": isOpen,
|
|
8236
8240
|
"motion-safe:animate-fade-out": !isOpen
|
|
@@ -8249,6 +8253,8 @@ var Dialog = ({
|
|
|
8249
8253
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
8250
8254
|
"div",
|
|
8251
8255
|
{
|
|
8256
|
+
...props,
|
|
8257
|
+
id: `dialog-${id}`,
|
|
8252
8258
|
ref,
|
|
8253
8259
|
hidden: !visible,
|
|
8254
8260
|
onKeyDown: (event) => {
|
|
@@ -8262,13 +8268,13 @@ var Dialog = ({
|
|
|
8262
8268
|
}
|
|
8263
8269
|
},
|
|
8264
8270
|
className: (0, import_clsx9.default)(
|
|
8265
|
-
"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)]
|
|
8271
|
+
"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)]",
|
|
8266
8272
|
{
|
|
8267
8273
|
"motion-safe:animate-pop-in": isOpen,
|
|
8268
8274
|
"motion-safe:animate-pop-out": !isOpen
|
|
8269
8275
|
},
|
|
8270
8276
|
positionStyle,
|
|
8271
|
-
className
|
|
8277
|
+
props.className
|
|
8272
8278
|
),
|
|
8273
8279
|
children: [
|
|
8274
8280
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "typography-title-lg mr-8", children: titleElement }),
|
|
@@ -8385,17 +8391,17 @@ var DiscardChangesDialog = ({
|
|
|
8385
8391
|
};
|
|
8386
8392
|
|
|
8387
8393
|
// src/components/user-action/input/Input.tsx
|
|
8388
|
-
var
|
|
8394
|
+
var import_react17 = require("react");
|
|
8389
8395
|
var import_clsx11 = __toESM(require("clsx"));
|
|
8390
8396
|
|
|
8391
8397
|
// src/hooks/useDelay.ts
|
|
8392
|
-
var
|
|
8398
|
+
var import_react15 = require("react");
|
|
8393
8399
|
var defaultOptions2 = {
|
|
8394
8400
|
delay: 3e3,
|
|
8395
8401
|
disabled: false
|
|
8396
8402
|
};
|
|
8397
8403
|
function useDelay(options) {
|
|
8398
|
-
const [timer, setTimer] = (0,
|
|
8404
|
+
const [timer, setTimer] = (0, import_react15.useState)(void 0);
|
|
8399
8405
|
const { delay, disabled } = {
|
|
8400
8406
|
...defaultOptions2,
|
|
8401
8407
|
...options
|
|
@@ -8414,12 +8420,12 @@ function useDelay(options) {
|
|
|
8414
8420
|
setTimer(void 0);
|
|
8415
8421
|
}, delay));
|
|
8416
8422
|
};
|
|
8417
|
-
(0,
|
|
8423
|
+
(0, import_react15.useEffect)(() => {
|
|
8418
8424
|
return () => {
|
|
8419
8425
|
clearTimeout(timer);
|
|
8420
8426
|
};
|
|
8421
8427
|
}, [timer]);
|
|
8422
|
-
(0,
|
|
8428
|
+
(0, import_react15.useEffect)(() => {
|
|
8423
8429
|
if (disabled) {
|
|
8424
8430
|
clearTimeout(timer);
|
|
8425
8431
|
setTimer(void 0);
|
|
@@ -8429,9 +8435,9 @@ function useDelay(options) {
|
|
|
8429
8435
|
}
|
|
8430
8436
|
|
|
8431
8437
|
// src/hooks/focus/useFocusManagement.ts
|
|
8432
|
-
var
|
|
8438
|
+
var import_react16 = require("react");
|
|
8433
8439
|
function useFocusManagement() {
|
|
8434
|
-
const getFocusableElements = (0,
|
|
8440
|
+
const getFocusableElements = (0, import_react16.useCallback)(() => {
|
|
8435
8441
|
return Array.from(
|
|
8436
8442
|
document.querySelectorAll(
|
|
8437
8443
|
'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
|
|
@@ -8440,7 +8446,7 @@ function useFocusManagement() {
|
|
|
8440
8446
|
(el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
|
|
8441
8447
|
);
|
|
8442
8448
|
}, []);
|
|
8443
|
-
const getNextFocusElement = (0,
|
|
8449
|
+
const getNextFocusElement = (0, import_react16.useCallback)(() => {
|
|
8444
8450
|
const elements = getFocusableElements();
|
|
8445
8451
|
if (elements.length === 0) {
|
|
8446
8452
|
return void 0;
|
|
@@ -8452,11 +8458,11 @@ function useFocusManagement() {
|
|
|
8452
8458
|
}
|
|
8453
8459
|
return nextElement;
|
|
8454
8460
|
}, [getFocusableElements]);
|
|
8455
|
-
const focusNext = (0,
|
|
8461
|
+
const focusNext = (0, import_react16.useCallback)(() => {
|
|
8456
8462
|
const nextElement = getNextFocusElement();
|
|
8457
8463
|
nextElement?.focus();
|
|
8458
8464
|
}, [getNextFocusElement]);
|
|
8459
|
-
const getPreviousFocusElement = (0,
|
|
8465
|
+
const getPreviousFocusElement = (0, import_react16.useCallback)(() => {
|
|
8460
8466
|
const elements = getFocusableElements();
|
|
8461
8467
|
if (elements.length === 0) {
|
|
8462
8468
|
return void 0;
|
|
@@ -8472,7 +8478,7 @@ function useFocusManagement() {
|
|
|
8472
8478
|
}
|
|
8473
8479
|
return previousElement;
|
|
8474
8480
|
}, [getFocusableElements]);
|
|
8475
|
-
const focusPrevious = (0,
|
|
8481
|
+
const focusPrevious = (0, import_react16.useCallback)(() => {
|
|
8476
8482
|
const previousElement = getPreviousFocusElement();
|
|
8477
8483
|
if (previousElement) previousElement.focus();
|
|
8478
8484
|
}, [getPreviousFocusElement]);
|
|
@@ -8493,7 +8499,7 @@ var defaultEditCompleteOptions = {
|
|
|
8493
8499
|
afterDelay: true,
|
|
8494
8500
|
delay: 2500
|
|
8495
8501
|
};
|
|
8496
|
-
var Input = (0,
|
|
8502
|
+
var Input = (0, import_react17.forwardRef)(function Input2({
|
|
8497
8503
|
value,
|
|
8498
8504
|
onChange,
|
|
8499
8505
|
onChangeText,
|
|
@@ -8515,8 +8521,8 @@ var Input = (0, import_react18.forwardRef)(function Input2({
|
|
|
8515
8521
|
restartTimer,
|
|
8516
8522
|
clearTimer
|
|
8517
8523
|
} = useDelay({ delay, disabled: !afterDelay });
|
|
8518
|
-
const innerRef = (0,
|
|
8519
|
-
(0,
|
|
8524
|
+
const innerRef = (0, import_react17.useRef)(null);
|
|
8525
|
+
(0, import_react17.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
8520
8526
|
const { focusNext } = useFocusManagement();
|
|
8521
8527
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
8522
8528
|
"input",
|
|
@@ -8601,7 +8607,7 @@ var InputDialog = ({
|
|
|
8601
8607
|
};
|
|
8602
8608
|
|
|
8603
8609
|
// src/components/user-action/select/Select.tsx
|
|
8604
|
-
var
|
|
8610
|
+
var import_react19 = require("react");
|
|
8605
8611
|
var import_clsx13 = __toESM(require("clsx"));
|
|
8606
8612
|
|
|
8607
8613
|
// src/utils/match.ts
|
|
@@ -8695,7 +8701,7 @@ var ChipList = ({
|
|
|
8695
8701
|
};
|
|
8696
8702
|
|
|
8697
8703
|
// src/hooks/useFloatingElement.ts
|
|
8698
|
-
var
|
|
8704
|
+
var import_react18 = require("react");
|
|
8699
8705
|
|
|
8700
8706
|
// src/utils/math.ts
|
|
8701
8707
|
var clamp = (value, range2 = [0, 1]) => {
|
|
@@ -8758,9 +8764,9 @@ function useFloatingElement({
|
|
|
8758
8764
|
screenPadding = 16,
|
|
8759
8765
|
gap = 4
|
|
8760
8766
|
}) {
|
|
8761
|
-
const [style, setStyle] = (0,
|
|
8767
|
+
const [style, setStyle] = (0, import_react18.useState)();
|
|
8762
8768
|
const isMounted = useIsMounted();
|
|
8763
|
-
const calculate = (0,
|
|
8769
|
+
const calculate = (0, import_react18.useCallback)(() => {
|
|
8764
8770
|
const containerRect = containerRef.current.getBoundingClientRect();
|
|
8765
8771
|
const windowRect = windowRef?.current.getBoundingClientRect() ?? {
|
|
8766
8772
|
top: 0,
|
|
@@ -8790,14 +8796,14 @@ function useFloatingElement({
|
|
|
8790
8796
|
}, [anchorRef, containerRef, gap, horizontalAlignment, screenPadding, verticalAlignment, windowRef]);
|
|
8791
8797
|
const height = containerRef.current?.getBoundingClientRect().height;
|
|
8792
8798
|
const width = containerRef.current?.getBoundingClientRect().width;
|
|
8793
|
-
(0,
|
|
8799
|
+
(0, import_react18.useEffect)(() => {
|
|
8794
8800
|
if (active && isMounted) {
|
|
8795
8801
|
calculate();
|
|
8796
8802
|
} else {
|
|
8797
8803
|
setStyle(void 0);
|
|
8798
8804
|
}
|
|
8799
8805
|
}, [calculate, active, isMounted, height, width]);
|
|
8800
|
-
(0,
|
|
8806
|
+
(0, import_react18.useEffect)(() => {
|
|
8801
8807
|
window.addEventListener("resize", calculate);
|
|
8802
8808
|
let timeout;
|
|
8803
8809
|
if (isPolling) {
|
|
@@ -8817,11 +8823,11 @@ function useFloatingElement({
|
|
|
8817
8823
|
var import_react_dom2 = require("react-dom");
|
|
8818
8824
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
8819
8825
|
var defaultToggleOpenOptions = {
|
|
8820
|
-
|
|
8826
|
+
highlightStartPositionBehavior: "first"
|
|
8821
8827
|
};
|
|
8822
|
-
var SelectContext = (0,
|
|
8828
|
+
var SelectContext = (0, import_react19.createContext)(null);
|
|
8823
8829
|
function useSelectContext() {
|
|
8824
|
-
const ctx = (0,
|
|
8830
|
+
const ctx = (0, import_react19.useContext)(SelectContext);
|
|
8825
8831
|
if (!ctx) {
|
|
8826
8832
|
throw new Error("SelectContext must be used within a ListBoxPrimitive");
|
|
8827
8833
|
}
|
|
@@ -8840,47 +8846,62 @@ var SelectRoot = ({
|
|
|
8840
8846
|
isMultiSelect = false,
|
|
8841
8847
|
iconAppearance = "left"
|
|
8842
8848
|
}) => {
|
|
8843
|
-
const
|
|
8844
|
-
const
|
|
8845
|
-
const generatedId = (0, import_react20.useId)();
|
|
8849
|
+
const triggerRef = (0, import_react19.useRef)(null);
|
|
8850
|
+
const generatedId = (0, import_react19.useId)();
|
|
8846
8851
|
const usedId = id ?? generatedId;
|
|
8847
|
-
const [internalState, setInternalState] = (0,
|
|
8848
|
-
isOpen
|
|
8852
|
+
const [internalState, setInternalState] = (0, import_react19.useState)({
|
|
8853
|
+
isOpen,
|
|
8854
|
+
options: []
|
|
8849
8855
|
});
|
|
8850
|
-
const selectedValues =
|
|
8856
|
+
const selectedValues = (0, import_react19.useMemo)(
|
|
8857
|
+
() => isMultiSelect ? values ?? [] : [value].filter(Boolean),
|
|
8858
|
+
[isMultiSelect, value, values]
|
|
8859
|
+
);
|
|
8860
|
+
const selectedOptions = (0, import_react19.useMemo)(
|
|
8861
|
+
() => selectedValues.map((value2) => internalState.options.find((option) => value2 === option.value)).filter(Boolean),
|
|
8862
|
+
[selectedValues, internalState.options]
|
|
8863
|
+
);
|
|
8851
8864
|
const state = {
|
|
8852
8865
|
...internalState,
|
|
8853
8866
|
id: usedId,
|
|
8854
8867
|
disabled,
|
|
8855
8868
|
invalid,
|
|
8856
8869
|
value: selectedValues,
|
|
8857
|
-
|
|
8858
|
-
selectedOptions: selectedValues.map((value2) => options.find((option) => value2 === option.value)).filter(Boolean)
|
|
8870
|
+
selectedOptions
|
|
8859
8871
|
};
|
|
8860
8872
|
const config = {
|
|
8861
8873
|
isMultiSelect,
|
|
8862
8874
|
iconAppearance
|
|
8863
8875
|
};
|
|
8864
|
-
const registerItem = (0,
|
|
8865
|
-
|
|
8866
|
-
const
|
|
8867
|
-
|
|
8876
|
+
const registerItem = (0, import_react19.useCallback)((item) => {
|
|
8877
|
+
setInternalState((prev) => {
|
|
8878
|
+
const updatedOptions = [...prev.options, item];
|
|
8879
|
+
updatedOptions.sort((a, b) => {
|
|
8868
8880
|
const aEl = a.ref.current;
|
|
8869
8881
|
const bEl = b.ref.current;
|
|
8870
8882
|
if (!aEl || !bEl) return 0;
|
|
8871
8883
|
return aEl.compareDocumentPosition(bEl) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
|
|
8872
8884
|
});
|
|
8873
|
-
return
|
|
8885
|
+
return {
|
|
8886
|
+
...prev,
|
|
8887
|
+
options: updatedOptions
|
|
8888
|
+
};
|
|
8874
8889
|
});
|
|
8875
8890
|
}, []);
|
|
8876
|
-
const unregisterItem = (0,
|
|
8877
|
-
|
|
8891
|
+
const unregisterItem = (0, import_react19.useCallback)((value2) => {
|
|
8892
|
+
setInternalState((prev) => {
|
|
8893
|
+
const updatedOptions = prev.options.filter((i) => i.value !== value2);
|
|
8894
|
+
return {
|
|
8895
|
+
...prev,
|
|
8896
|
+
options: updatedOptions
|
|
8897
|
+
};
|
|
8898
|
+
});
|
|
8878
8899
|
}, []);
|
|
8879
8900
|
const toggleSelection = (value2, isSelected) => {
|
|
8880
8901
|
if (disabled) {
|
|
8881
8902
|
return;
|
|
8882
8903
|
}
|
|
8883
|
-
const option = options.find((i) => i.value === value2);
|
|
8904
|
+
const option = state.options.find((i) => i.value === value2);
|
|
8884
8905
|
if (!option) {
|
|
8885
8906
|
console.error(`SelectOption with value: ${value2} not found`);
|
|
8886
8907
|
return;
|
|
@@ -8916,42 +8937,47 @@ var SelectRoot = ({
|
|
|
8916
8937
|
highlightedValue: value2
|
|
8917
8938
|
}));
|
|
8918
8939
|
};
|
|
8919
|
-
const registerTrigger = (0,
|
|
8940
|
+
const registerTrigger = (0, import_react19.useCallback)((ref) => {
|
|
8920
8941
|
triggerRef.current = ref.current;
|
|
8921
8942
|
}, []);
|
|
8922
|
-
const unregisterTrigger = (0,
|
|
8943
|
+
const unregisterTrigger = (0, import_react19.useCallback)(() => {
|
|
8923
8944
|
triggerRef.current = null;
|
|
8924
8945
|
}, []);
|
|
8925
8946
|
const toggleOpen = (isOpen2, toggleOpenOptions) => {
|
|
8926
|
-
const {
|
|
8927
|
-
let
|
|
8928
|
-
|
|
8929
|
-
|
|
8930
|
-
|
|
8931
|
-
|
|
8932
|
-
|
|
8933
|
-
|
|
8934
|
-
|
|
8947
|
+
const { highlightStartPositionBehavior } = { ...defaultToggleOpenOptions, ...toggleOpenOptions };
|
|
8948
|
+
let firstSelectedValue;
|
|
8949
|
+
let firstEnabledValue;
|
|
8950
|
+
for (let i = 0; i < state.options.length; i++) {
|
|
8951
|
+
const currentOption = state.options[highlightStartPositionBehavior === "first" ? i : state.options.length - i - 1];
|
|
8952
|
+
if (!currentOption.disabled) {
|
|
8953
|
+
if (!firstEnabledValue) {
|
|
8954
|
+
firstEnabledValue = currentOption.value;
|
|
8955
|
+
}
|
|
8956
|
+
if (selectedValues.includes(currentOption.value)) {
|
|
8957
|
+
firstSelectedValue = currentOption.value;
|
|
8958
|
+
break;
|
|
8959
|
+
}
|
|
8960
|
+
}
|
|
8935
8961
|
}
|
|
8936
8962
|
setInternalState((prevState) => ({
|
|
8937
8963
|
...prevState,
|
|
8938
8964
|
isOpen: isOpen2 ?? !prevState.isOpen,
|
|
8939
|
-
highlightedValue:
|
|
8965
|
+
highlightedValue: firstSelectedValue ?? firstEnabledValue
|
|
8940
8966
|
}));
|
|
8941
8967
|
};
|
|
8942
8968
|
const moveHighlightedIndex = (delta) => {
|
|
8943
|
-
let highlightedIndex = options.findIndex((value2) => value2.value === internalState.highlightedValue);
|
|
8969
|
+
let highlightedIndex = state.options.findIndex((value2) => value2.value === internalState.highlightedValue);
|
|
8944
8970
|
if (highlightedIndex === -1) {
|
|
8945
8971
|
highlightedIndex = 0;
|
|
8946
8972
|
}
|
|
8947
|
-
const optionLength = options.length;
|
|
8973
|
+
const optionLength = state.options.length;
|
|
8948
8974
|
const startIndex = (highlightedIndex + delta % optionLength + optionLength) % optionLength;
|
|
8949
8975
|
const isForward = delta >= 0;
|
|
8950
|
-
let highlightedValue = options[startIndex].value;
|
|
8951
|
-
for (let i = 0; i < options.length; i++) {
|
|
8976
|
+
let highlightedValue = state.options[startIndex].value;
|
|
8977
|
+
for (let i = 0; i < state.options.length; i++) {
|
|
8952
8978
|
const index = (startIndex + (isForward ? i : -i) + optionLength) % optionLength;
|
|
8953
|
-
if (!options[index].disabled) {
|
|
8954
|
-
highlightedValue = options[index].value;
|
|
8979
|
+
if (!state.options[index].disabled) {
|
|
8980
|
+
highlightedValue = state.options[index].value;
|
|
8955
8981
|
break;
|
|
8956
8982
|
}
|
|
8957
8983
|
}
|
|
@@ -8960,11 +8986,11 @@ var SelectRoot = ({
|
|
|
8960
8986
|
highlightedValue
|
|
8961
8987
|
}));
|
|
8962
8988
|
};
|
|
8963
|
-
(0,
|
|
8989
|
+
(0, import_react19.useEffect)(() => {
|
|
8964
8990
|
if (!internalState.highlightedValue) return;
|
|
8965
|
-
const highlighted = options.find((value2) => value2.value === internalState.highlightedValue);
|
|
8991
|
+
const highlighted = internalState.options.find((value2) => value2.value === internalState.highlightedValue);
|
|
8966
8992
|
if (highlighted) {
|
|
8967
|
-
highlighted.ref.current
|
|
8993
|
+
highlighted.ref.current?.scrollIntoView({ behavior: "instant", block: "nearest" });
|
|
8968
8994
|
} else {
|
|
8969
8995
|
console.error(`SelectRoot: Could not find highlighted value (${internalState.highlightedValue})`);
|
|
8970
8996
|
}
|
|
@@ -8988,14 +9014,14 @@ var SelectRoot = ({
|
|
|
8988
9014
|
};
|
|
8989
9015
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectContext.Provider, { value: contextValue, children });
|
|
8990
9016
|
};
|
|
8991
|
-
var SelectOption = (0,
|
|
9017
|
+
var SelectOption = (0, import_react19.forwardRef)(
|
|
8992
9018
|
function SelectOption2({ children, value, disabled = false, iconAppearance, className, ...restProps }, ref) {
|
|
8993
9019
|
const { state, config, item, trigger } = useSelectContext();
|
|
8994
9020
|
const { register, unregister, toggleSelection, highlightItem } = item;
|
|
8995
|
-
const itemRef = (0,
|
|
9021
|
+
const itemRef = (0, import_react19.useRef)(null);
|
|
8996
9022
|
iconAppearance ??= config.iconAppearance;
|
|
8997
9023
|
const label = children ?? value;
|
|
8998
|
-
(0,
|
|
9024
|
+
(0, import_react19.useEffect)(() => {
|
|
8999
9025
|
register({
|
|
9000
9026
|
value,
|
|
9001
9027
|
label,
|
|
@@ -9073,13 +9099,13 @@ var defaultSelectButtonTranslation = {
|
|
|
9073
9099
|
clickToSelect: "Zum ausw\xE4hlen dr\xFCcken"
|
|
9074
9100
|
}
|
|
9075
9101
|
};
|
|
9076
|
-
var SelectButton = (0,
|
|
9102
|
+
var SelectButton = (0, import_react19.forwardRef)(function SelectButton2({ placeholder, selectedDisplay, ...props }, ref) {
|
|
9077
9103
|
const translation = useTranslation([defaultSelectButtonTranslation]);
|
|
9078
9104
|
const { state, trigger } = useSelectContext();
|
|
9079
9105
|
const { register, unregister, toggleOpen } = trigger;
|
|
9080
|
-
const innerRef = (0,
|
|
9081
|
-
(0,
|
|
9082
|
-
(0,
|
|
9106
|
+
const innerRef = (0, import_react19.useRef)(null);
|
|
9107
|
+
(0, import_react19.useImperativeHandle)(ref, () => innerRef.current);
|
|
9108
|
+
(0, import_react19.useEffect)(() => {
|
|
9083
9109
|
register(innerRef);
|
|
9084
9110
|
return () => unregister();
|
|
9085
9111
|
}, [register, unregister]);
|
|
@@ -9101,12 +9127,12 @@ var SelectButton = (0, import_react20.forwardRef)(function SelectButton2({ place
|
|
|
9101
9127
|
props.onKeyDown?.(event);
|
|
9102
9128
|
switch (event.key) {
|
|
9103
9129
|
case "ArrowDown":
|
|
9104
|
-
toggleOpen(true, {
|
|
9130
|
+
toggleOpen(true, { highlightStartPositionBehavior: "first" });
|
|
9105
9131
|
event.preventDefault();
|
|
9106
9132
|
event.stopPropagation();
|
|
9107
9133
|
break;
|
|
9108
9134
|
case "ArrowUp":
|
|
9109
|
-
toggleOpen(true, {
|
|
9135
|
+
toggleOpen(true, { highlightStartPositionBehavior: "last" });
|
|
9110
9136
|
event.preventDefault();
|
|
9111
9137
|
event.stopPropagation();
|
|
9112
9138
|
break;
|
|
@@ -9152,12 +9178,12 @@ var SelectButton = (0, import_react20.forwardRef)(function SelectButton2({ place
|
|
|
9152
9178
|
}
|
|
9153
9179
|
);
|
|
9154
9180
|
});
|
|
9155
|
-
var SelectChipDisplay = (0,
|
|
9181
|
+
var SelectChipDisplay = (0, import_react19.forwardRef)(function SelectChipDisplay2({ ...props }, ref) {
|
|
9156
9182
|
const { state, trigger, item } = useSelectContext();
|
|
9157
9183
|
const { register, unregister, toggleOpen } = trigger;
|
|
9158
|
-
const innerRef = (0,
|
|
9159
|
-
(0,
|
|
9160
|
-
(0,
|
|
9184
|
+
const innerRef = (0, import_react19.useRef)(null);
|
|
9185
|
+
(0, import_react19.useImperativeHandle)(ref, () => innerRef.current);
|
|
9186
|
+
(0, import_react19.useEffect)(() => {
|
|
9161
9187
|
register(innerRef);
|
|
9162
9188
|
return () => unregister();
|
|
9163
9189
|
}, [register, unregister]);
|
|
@@ -9200,10 +9226,10 @@ var SelectChipDisplay = (0, import_react20.forwardRef)(function SelectChipDispla
|
|
|
9200
9226
|
onKeyDown: (event) => {
|
|
9201
9227
|
switch (event.key) {
|
|
9202
9228
|
case "ArrowDown":
|
|
9203
|
-
toggleOpen(true, {
|
|
9229
|
+
toggleOpen(true, { highlightStartPositionBehavior: "first" });
|
|
9204
9230
|
break;
|
|
9205
9231
|
case "ArrowUp":
|
|
9206
|
-
toggleOpen(true, {
|
|
9232
|
+
toggleOpen(true, { highlightStartPositionBehavior: "last" });
|
|
9207
9233
|
}
|
|
9208
9234
|
},
|
|
9209
9235
|
size: "small",
|
|
@@ -9220,14 +9246,15 @@ var SelectChipDisplay = (0, import_react20.forwardRef)(function SelectChipDispla
|
|
|
9220
9246
|
}
|
|
9221
9247
|
);
|
|
9222
9248
|
});
|
|
9223
|
-
var SelectContent = (0,
|
|
9249
|
+
var SelectContent = (0, import_react19.forwardRef)(
|
|
9224
9250
|
function SelectContent2({
|
|
9225
9251
|
alignment,
|
|
9226
9252
|
orientation = "vertical",
|
|
9253
|
+
containerClassName,
|
|
9227
9254
|
...props
|
|
9228
9255
|
}, ref) {
|
|
9229
|
-
const innerRef = (0,
|
|
9230
|
-
(0,
|
|
9256
|
+
const innerRef = (0, import_react19.useRef)(null);
|
|
9257
|
+
(0, import_react19.useImperativeHandle)(ref, () => innerRef.current);
|
|
9231
9258
|
const { trigger, state, config, item } = useSelectContext();
|
|
9232
9259
|
const position = useFloatingElement({
|
|
9233
9260
|
active: state.isOpen,
|
|
@@ -9240,81 +9267,88 @@ var SelectContent = (0, import_react20.forwardRef)(
|
|
|
9240
9267
|
active: state.isOpen && !!position
|
|
9241
9268
|
});
|
|
9242
9269
|
return (0, import_react_dom2.createPortal)(
|
|
9243
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
{
|
|
9247
|
-
|
|
9248
|
-
|
|
9249
|
-
|
|
9250
|
-
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
|
|
9258
|
-
|
|
9259
|
-
|
|
9260
|
-
|
|
9261
|
-
|
|
9262
|
-
|
|
9263
|
-
|
|
9264
|
-
|
|
9265
|
-
|
|
9266
|
-
|
|
9267
|
-
vertical: "ArrowDown",
|
|
9268
|
-
horizontal: "ArrowUp"
|
|
9269
|
-
}):
|
|
9270
|
-
item.moveHighlightedIndex(1);
|
|
9271
|
-
event.preventDefault();
|
|
9272
|
-
break;
|
|
9273
|
-
case match(orientation, {
|
|
9274
|
-
vertical: "ArrowUp",
|
|
9275
|
-
horizontal: "ArrowDown"
|
|
9276
|
-
}):
|
|
9277
|
-
item.moveHighlightedIndex(-1);
|
|
9278
|
-
event.preventDefault();
|
|
9279
|
-
break;
|
|
9280
|
-
case "Home":
|
|
9281
|
-
event.preventDefault();
|
|
9282
|
-
break;
|
|
9283
|
-
case "End":
|
|
9284
|
-
event.preventDefault();
|
|
9285
|
-
break;
|
|
9286
|
-
case "Enter":
|
|
9287
|
-
// Fall through
|
|
9288
|
-
case " ":
|
|
9289
|
-
if (state.highlightedValue) {
|
|
9290
|
-
item.toggleSelection(state.highlightedValue);
|
|
9291
|
-
if (!config.isMultiSelect) {
|
|
9270
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
9271
|
+
"div",
|
|
9272
|
+
{
|
|
9273
|
+
id: `select-container-${state.id}`,
|
|
9274
|
+
className: (0, import_clsx13.default)("fixed inset-0 w-screen h-screen", containerClassName),
|
|
9275
|
+
hidden: !state.isOpen,
|
|
9276
|
+
children: [
|
|
9277
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
9278
|
+
"div",
|
|
9279
|
+
{
|
|
9280
|
+
id: `select-background-${state.id}`,
|
|
9281
|
+
onClick: () => trigger.toggleOpen(false),
|
|
9282
|
+
className: (0, import_clsx13.default)("fixed inset-0 w-screen h-screen")
|
|
9283
|
+
}
|
|
9284
|
+
),
|
|
9285
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
9286
|
+
"ul",
|
|
9287
|
+
{
|
|
9288
|
+
...props,
|
|
9289
|
+
id: `${state.id}-listbox`,
|
|
9290
|
+
ref: innerRef,
|
|
9291
|
+
onKeyDown: (event) => {
|
|
9292
|
+
switch (event.key) {
|
|
9293
|
+
case "Escape":
|
|
9292
9294
|
trigger.toggleOpen(false);
|
|
9293
|
-
|
|
9294
|
-
|
|
9295
|
+
event.preventDefault();
|
|
9296
|
+
event.stopPropagation();
|
|
9297
|
+
break;
|
|
9298
|
+
case match(orientation, {
|
|
9299
|
+
vertical: "ArrowDown",
|
|
9300
|
+
horizontal: "ArrowUp"
|
|
9301
|
+
}):
|
|
9302
|
+
item.moveHighlightedIndex(1);
|
|
9303
|
+
event.preventDefault();
|
|
9304
|
+
break;
|
|
9305
|
+
case match(orientation, {
|
|
9306
|
+
vertical: "ArrowUp",
|
|
9307
|
+
horizontal: "ArrowDown"
|
|
9308
|
+
}):
|
|
9309
|
+
item.moveHighlightedIndex(-1);
|
|
9310
|
+
event.preventDefault();
|
|
9311
|
+
break;
|
|
9312
|
+
case "Home":
|
|
9313
|
+
event.preventDefault();
|
|
9314
|
+
break;
|
|
9315
|
+
case "End":
|
|
9316
|
+
event.preventDefault();
|
|
9317
|
+
break;
|
|
9318
|
+
case "Enter":
|
|
9319
|
+
// Fall through
|
|
9320
|
+
case " ":
|
|
9321
|
+
if (state.highlightedValue) {
|
|
9322
|
+
item.toggleSelection(state.highlightedValue);
|
|
9323
|
+
if (!config.isMultiSelect) {
|
|
9324
|
+
trigger.toggleOpen(false);
|
|
9325
|
+
}
|
|
9326
|
+
event.preventDefault();
|
|
9327
|
+
}
|
|
9328
|
+
break;
|
|
9295
9329
|
}
|
|
9296
|
-
|
|
9330
|
+
},
|
|
9331
|
+
className: (0, import_clsx13.default)("flex-col-0 p-2 bg-menu-background text-menu-text rounded-md shadow-hw-bottom focus-style-within overflow-auto", props.className),
|
|
9332
|
+
style: {
|
|
9333
|
+
opacity: position ? void 0 : 0,
|
|
9334
|
+
position: "fixed",
|
|
9335
|
+
...position
|
|
9336
|
+
},
|
|
9337
|
+
role: "listbox",
|
|
9338
|
+
"aria-multiselectable": config.isMultiSelect,
|
|
9339
|
+
"aria-orientation": orientation,
|
|
9340
|
+
tabIndex: position ? 0 : void 0,
|
|
9341
|
+
children: props.children
|
|
9297
9342
|
}
|
|
9298
|
-
|
|
9299
|
-
|
|
9300
|
-
|
|
9301
|
-
|
|
9302
|
-
position: "fixed",
|
|
9303
|
-
...position
|
|
9304
|
-
},
|
|
9305
|
-
role: "listbox",
|
|
9306
|
-
"aria-multiselectable": config.isMultiSelect,
|
|
9307
|
-
"aria-orientation": orientation,
|
|
9308
|
-
tabIndex: position ? 0 : void 0,
|
|
9309
|
-
children: props.children
|
|
9310
|
-
}
|
|
9311
|
-
)
|
|
9312
|
-
] }),
|
|
9343
|
+
)
|
|
9344
|
+
]
|
|
9345
|
+
}
|
|
9346
|
+
),
|
|
9313
9347
|
document.body
|
|
9314
9348
|
);
|
|
9315
9349
|
}
|
|
9316
9350
|
);
|
|
9317
|
-
var Select = (0,
|
|
9351
|
+
var Select = (0, import_react19.forwardRef)(function Select2({
|
|
9318
9352
|
children,
|
|
9319
9353
|
contentPanelProps,
|
|
9320
9354
|
buttonProps,
|
|
@@ -9336,7 +9370,7 @@ var Select = (0, import_react20.forwardRef)(function Select2({
|
|
|
9336
9370
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectContent, { ...contentPanelProps, children })
|
|
9337
9371
|
] });
|
|
9338
9372
|
});
|
|
9339
|
-
var SelectUncontrolled = (0,
|
|
9373
|
+
var SelectUncontrolled = (0, import_react19.forwardRef)(function SelectUncontrolled2({
|
|
9340
9374
|
value: initialValue,
|
|
9341
9375
|
onValueChanged,
|
|
9342
9376
|
...props
|
|
@@ -9352,7 +9386,7 @@ var SelectUncontrolled = (0, import_react20.forwardRef)(function SelectUncontrol
|
|
|
9352
9386
|
}
|
|
9353
9387
|
);
|
|
9354
9388
|
});
|
|
9355
|
-
var MultiSelect = (0,
|
|
9389
|
+
var MultiSelect = (0, import_react19.forwardRef)(function MultiSelect2({
|
|
9356
9390
|
children,
|
|
9357
9391
|
contentPanelProps,
|
|
9358
9392
|
buttonProps,
|
|
@@ -9363,7 +9397,7 @@ var MultiSelect = (0, import_react20.forwardRef)(function MultiSelect2({
|
|
|
9363
9397
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectContent, { ...contentPanelProps, children })
|
|
9364
9398
|
] });
|
|
9365
9399
|
});
|
|
9366
|
-
var MultiSelectUncontrolled = (0,
|
|
9400
|
+
var MultiSelectUncontrolled = (0, import_react19.forwardRef)(function MultiSelectUncontrolled2({
|
|
9367
9401
|
values: initialValues,
|
|
9368
9402
|
onValuesChanged,
|
|
9369
9403
|
...props
|
|
@@ -9379,7 +9413,7 @@ var MultiSelectUncontrolled = (0, import_react20.forwardRef)(function MultiSelec
|
|
|
9379
9413
|
}
|
|
9380
9414
|
);
|
|
9381
9415
|
});
|
|
9382
|
-
var MultiSelectChipDisplay = (0,
|
|
9416
|
+
var MultiSelectChipDisplay = (0, import_react19.forwardRef)(function MultiSelectChipDisplay2({
|
|
9383
9417
|
children,
|
|
9384
9418
|
contentPanelProps,
|
|
9385
9419
|
chipDisplayProps,
|
|
@@ -9390,7 +9424,7 @@ var MultiSelectChipDisplay = (0, import_react20.forwardRef)(function MultiSelect
|
|
|
9390
9424
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectContent, { ...contentPanelProps, children })
|
|
9391
9425
|
] });
|
|
9392
9426
|
});
|
|
9393
|
-
var MultiSelectChipDisplayUncontrolled = (0,
|
|
9427
|
+
var MultiSelectChipDisplayUncontrolled = (0, import_react19.forwardRef)(function MultiSelectChipDisplayUncontrolled2({
|
|
9394
9428
|
values: initialValues,
|
|
9395
9429
|
onValuesChanged,
|
|
9396
9430
|
...props
|
|
@@ -9463,7 +9497,7 @@ var import_lucide_react5 = require("lucide-react");
|
|
|
9463
9497
|
var import_clsx14 = __toESM(require("clsx"));
|
|
9464
9498
|
|
|
9465
9499
|
// src/theming/useTheme.tsx
|
|
9466
|
-
var
|
|
9500
|
+
var import_react20 = require("react");
|
|
9467
9501
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
9468
9502
|
var themes = ["light", "dark", "system"];
|
|
9469
9503
|
var defaultThemeTypeTranslation = {
|
|
@@ -9490,9 +9524,9 @@ var ThemeUtil = {
|
|
|
9490
9524
|
themes,
|
|
9491
9525
|
translation: defaultThemeTypeTranslation
|
|
9492
9526
|
};
|
|
9493
|
-
var ThemeContext = (0,
|
|
9527
|
+
var ThemeContext = (0, import_react20.createContext)(null);
|
|
9494
9528
|
var useTheme = () => {
|
|
9495
|
-
const context = (0,
|
|
9529
|
+
const context = (0, import_react20.useContext)(ThemeContext);
|
|
9496
9530
|
if (!context) {
|
|
9497
9531
|
throw new Error("useTheme must be used within ThemeContext. Try adding a ThemeProvider around your app.");
|
|
9498
9532
|
}
|
|
@@ -9564,7 +9598,7 @@ var ThemeDialog = ({
|
|
|
9564
9598
|
};
|
|
9565
9599
|
|
|
9566
9600
|
// src/components/form/FormElementWrapper.tsx
|
|
9567
|
-
var
|
|
9601
|
+
var import_react21 = require("react");
|
|
9568
9602
|
var import_clsx16 = require("clsx");
|
|
9569
9603
|
|
|
9570
9604
|
// src/components/user-action/Label.tsx
|
|
@@ -9602,7 +9636,7 @@ var FormElementWrapper = ({
|
|
|
9602
9636
|
containerClassName
|
|
9603
9637
|
}) => {
|
|
9604
9638
|
const [touched, setTouched] = useOverwritableState(initialIsShowingError, onIsShowingError);
|
|
9605
|
-
const generatedId = (0,
|
|
9639
|
+
const generatedId = (0, import_react21.useId)();
|
|
9606
9640
|
const usedId = id ?? generatedId;
|
|
9607
9641
|
const errorId = `${usedId}-description`;
|
|
9608
9642
|
const labelId = `${usedId}-label`;
|
|
@@ -9673,7 +9707,7 @@ var FormElementWrapper = ({
|
|
|
9673
9707
|
|
|
9674
9708
|
// src/components/icons-and-geometry/Avatar.tsx
|
|
9675
9709
|
var import_clsx17 = __toESM(require("clsx"));
|
|
9676
|
-
var
|
|
9710
|
+
var import_react22 = require("react");
|
|
9677
9711
|
var import_lucide_react6 = require("lucide-react");
|
|
9678
9712
|
|
|
9679
9713
|
// node_modules/@radix-ui/react-avatar/dist/index.mjs
|
|
@@ -10072,7 +10106,7 @@ var Avatar2 = ({ image, name, size = "md", fullyRounded, className = "" }) => {
|
|
|
10072
10106
|
maxHeight: pixels
|
|
10073
10107
|
};
|
|
10074
10108
|
const textClassName = textClassNameMapping[size];
|
|
10075
|
-
const displayName = (0,
|
|
10109
|
+
const displayName = (0, import_react22.useMemo)(() => {
|
|
10076
10110
|
const maxLetters = size === "sm" ? 1 : 2;
|
|
10077
10111
|
return (name ?? "").split(" ").filter((_, index) => index < maxLetters).map((value) => value[0]).join("").toUpperCase();
|
|
10078
10112
|
}, [name, size]);
|
|
@@ -10172,7 +10206,7 @@ var Circle = ({
|
|
|
10172
10206
|
};
|
|
10173
10207
|
|
|
10174
10208
|
// src/components/icons-and-geometry/Ring.tsx
|
|
10175
|
-
var
|
|
10209
|
+
var import_react23 = require("react");
|
|
10176
10210
|
var import_clsx19 = __toESM(require("clsx"));
|
|
10177
10211
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
10178
10212
|
var Ring = ({
|
|
@@ -10201,9 +10235,9 @@ var AnimatedRing = ({
|
|
|
10201
10235
|
onAnimationFinished,
|
|
10202
10236
|
style
|
|
10203
10237
|
}) => {
|
|
10204
|
-
const [currentWidth, setCurrentWidth] = (0,
|
|
10238
|
+
const [currentWidth, setCurrentWidth] = (0, import_react23.useState)(0);
|
|
10205
10239
|
const milliseconds = 1e3 * fillAnimationDuration;
|
|
10206
|
-
const animate = (0,
|
|
10240
|
+
const animate = (0, import_react23.useCallback)((timestamp, startTime) => {
|
|
10207
10241
|
const progress = Math.min((timestamp - startTime) / milliseconds, 1);
|
|
10208
10242
|
const newWidth = Math.min(width * progress, width);
|
|
10209
10243
|
setCurrentWidth(newWidth);
|
|
@@ -10217,7 +10251,7 @@ var AnimatedRing = ({
|
|
|
10217
10251
|
}
|
|
10218
10252
|
}
|
|
10219
10253
|
}, [milliseconds, onAnimationFinished, repeating, width]);
|
|
10220
|
-
(0,
|
|
10254
|
+
(0, import_react23.useEffect)(() => {
|
|
10221
10255
|
if (currentWidth < width) {
|
|
10222
10256
|
requestAnimationFrame((timestamp) => animate(timestamp, timestamp));
|
|
10223
10257
|
}
|
|
@@ -10252,10 +10286,10 @@ var RingWave = ({
|
|
|
10252
10286
|
onAnimationFinished,
|
|
10253
10287
|
style
|
|
10254
10288
|
}) => {
|
|
10255
|
-
const [currentInnerSize, setCurrentInnerSize] = (0,
|
|
10289
|
+
const [currentInnerSize, setCurrentInnerSize] = (0, import_react23.useState)(startInnerSize);
|
|
10256
10290
|
const distance = endInnerSize - startInnerSize;
|
|
10257
10291
|
const milliseconds = 1e3 * fillAnimationDuration;
|
|
10258
|
-
const animate = (0,
|
|
10292
|
+
const animate = (0, import_react23.useCallback)((timestamp, startTime) => {
|
|
10259
10293
|
const progress = Math.min((timestamp - startTime) / milliseconds, 1);
|
|
10260
10294
|
const newInnerSize = Math.min(
|
|
10261
10295
|
startInnerSize + distance * progress,
|
|
@@ -10272,7 +10306,7 @@ var RingWave = ({
|
|
|
10272
10306
|
}
|
|
10273
10307
|
}
|
|
10274
10308
|
}, [distance, endInnerSize, milliseconds, onAnimationFinished, repeating, startInnerSize]);
|
|
10275
|
-
(0,
|
|
10309
|
+
(0, import_react23.useEffect)(() => {
|
|
10276
10310
|
if (currentInnerSize < endInnerSize) {
|
|
10277
10311
|
requestAnimationFrame((timestamp) => animate(timestamp, timestamp));
|
|
10278
10312
|
}
|
|
@@ -10307,7 +10341,7 @@ var RadialRings = ({
|
|
|
10307
10341
|
sizeCircle2 = 200,
|
|
10308
10342
|
sizeCircle3 = 300
|
|
10309
10343
|
}) => {
|
|
10310
|
-
const [currentRing, setCurrentRing] = (0,
|
|
10344
|
+
const [currentRing, setCurrentRing] = (0, import_react23.useState)(0);
|
|
10311
10345
|
const size = sizeCircle3;
|
|
10312
10346
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
10313
10347
|
"div",
|
|
@@ -10456,13 +10490,13 @@ var TagIcon = ({
|
|
|
10456
10490
|
};
|
|
10457
10491
|
|
|
10458
10492
|
// src/components/layout/Carousel.tsx
|
|
10459
|
-
var
|
|
10493
|
+
var import_react24 = require("react");
|
|
10460
10494
|
var import_clsx20 = __toESM(require("clsx"));
|
|
10461
10495
|
var import_lucide_react7 = require("lucide-react");
|
|
10462
10496
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
10463
|
-
var CarouselContext = (0,
|
|
10497
|
+
var CarouselContext = (0, import_react24.createContext)(null);
|
|
10464
10498
|
var useCarouselContext = () => {
|
|
10465
|
-
const context = (0,
|
|
10499
|
+
const context = (0, import_react24.useContext)(CarouselContext);
|
|
10466
10500
|
if (!context) {
|
|
10467
10501
|
console.error("useCarouselContext must be used within CarouselContext");
|
|
10468
10502
|
}
|
|
@@ -10485,7 +10519,7 @@ function CarouselTabs({
|
|
|
10485
10519
|
defaultCarouselTabTranslationType
|
|
10486
10520
|
]);
|
|
10487
10521
|
const { id, slideCount, currentIndex, isLooping } = useCarouselContext();
|
|
10488
|
-
const tabRefs = (0,
|
|
10522
|
+
const tabRefs = (0, import_react24.useRef)([]);
|
|
10489
10523
|
const handleKeyDown = (event, index) => {
|
|
10490
10524
|
let newIndex = index;
|
|
10491
10525
|
if (event.key === "ArrowRight") {
|
|
@@ -10545,7 +10579,7 @@ var defaultCarouselSlideTranslationType = {
|
|
|
10545
10579
|
slideOf: `Slide {{index}} von {{length}} slides`
|
|
10546
10580
|
}
|
|
10547
10581
|
};
|
|
10548
|
-
var CarouselSlide = (0,
|
|
10582
|
+
var CarouselSlide = (0, import_react24.forwardRef)(
|
|
10549
10583
|
function CarouselSlide2({
|
|
10550
10584
|
index,
|
|
10551
10585
|
...props
|
|
@@ -10605,17 +10639,17 @@ var Carousel = ({
|
|
|
10605
10639
|
...props
|
|
10606
10640
|
}) => {
|
|
10607
10641
|
const translation = useTranslation([defaultCarouselTranslationType]);
|
|
10608
|
-
const slideRefs = (0,
|
|
10609
|
-
const [currentIndex, setCurrentIndex] = (0,
|
|
10610
|
-
const [hasFocus, setHasFocus] = (0,
|
|
10611
|
-
const [dragState, setDragState] = (0,
|
|
10642
|
+
const slideRefs = (0, import_react24.useRef)([]);
|
|
10643
|
+
const [currentIndex, setCurrentIndex] = (0, import_react24.useState)(0);
|
|
10644
|
+
const [hasFocus, setHasFocus] = (0, import_react24.useState)(false);
|
|
10645
|
+
const [dragState, setDragState] = (0, import_react24.useState)();
|
|
10612
10646
|
const isPaused = hasFocus;
|
|
10613
|
-
const carouselContainerRef = (0,
|
|
10614
|
-
const [disableClick, setDisableClick] = (0,
|
|
10615
|
-
const timeOut = (0,
|
|
10616
|
-
const length = (0,
|
|
10647
|
+
const carouselContainerRef = (0, import_react24.useRef)(null);
|
|
10648
|
+
const [disableClick, setDisableClick] = (0, import_react24.useState)(false);
|
|
10649
|
+
const timeOut = (0, import_react24.useRef)(void 0);
|
|
10650
|
+
const length = (0, import_react24.useMemo)(() => children.length, [children]);
|
|
10617
10651
|
const paddingItemCount = 3;
|
|
10618
|
-
const generatedId = "carousel" + (0,
|
|
10652
|
+
const generatedId = "carousel" + (0, import_react24.useId)();
|
|
10619
10653
|
const id = props.id ?? generatedId;
|
|
10620
10654
|
if (isAutoPlaying && !isLooping) {
|
|
10621
10655
|
console.error("When isAutoLooping is true, isLooping should also be true");
|
|
@@ -10624,7 +10658,7 @@ var Carousel = ({
|
|
|
10624
10658
|
autoLoopingTimeOut = Math.max(0, autoLoopingTimeOut);
|
|
10625
10659
|
animationTime = Math.max(100, animationTime);
|
|
10626
10660
|
autoLoopAnimationTime = Math.max(200, autoLoopAnimationTime);
|
|
10627
|
-
(0,
|
|
10661
|
+
(0, import_react24.useEffect)(() => {
|
|
10628
10662
|
const carousel = carouselContainerRef.current;
|
|
10629
10663
|
if (carousel) {
|
|
10630
10664
|
let onFocus = function() {
|
|
@@ -10647,7 +10681,7 @@ var Carousel = ({
|
|
|
10647
10681
|
const canGoLeft = () => {
|
|
10648
10682
|
return isLooping || currentIndex !== 0;
|
|
10649
10683
|
};
|
|
10650
|
-
const canGoRight = (0,
|
|
10684
|
+
const canGoRight = (0, import_react24.useCallback)(() => {
|
|
10651
10685
|
return isLooping || currentIndex !== length - 1;
|
|
10652
10686
|
}, [currentIndex, isLooping, length]);
|
|
10653
10687
|
const left = () => {
|
|
@@ -10655,12 +10689,12 @@ var Carousel = ({
|
|
|
10655
10689
|
setCurrentIndex(currentIndex - 1);
|
|
10656
10690
|
}
|
|
10657
10691
|
};
|
|
10658
|
-
const right = (0,
|
|
10692
|
+
const right = (0, import_react24.useCallback)(() => {
|
|
10659
10693
|
if (canGoRight()) {
|
|
10660
10694
|
setCurrentIndex((currentIndex + length + 1) % length);
|
|
10661
10695
|
}
|
|
10662
10696
|
}, [canGoRight, currentIndex, length]);
|
|
10663
|
-
(0,
|
|
10697
|
+
(0, import_react24.useEffect)(() => {
|
|
10664
10698
|
if (!timeOut.current && !isPaused) {
|
|
10665
10699
|
if (autoLoopingTimeOut > 0) {
|
|
10666
10700
|
timeOut.current = setTimeout(() => {
|
|
@@ -10712,7 +10746,7 @@ var Carousel = ({
|
|
|
10712
10746
|
}
|
|
10713
10747
|
setDragState(void 0);
|
|
10714
10748
|
};
|
|
10715
|
-
(0,
|
|
10749
|
+
(0, import_react24.useEffect)(() => {
|
|
10716
10750
|
setDisableClick(!dragState);
|
|
10717
10751
|
}, [dragState]);
|
|
10718
10752
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CarouselContext.Provider, { value: { id, currentIndex, slideCount: length, isLooping }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
@@ -11103,11 +11137,11 @@ var FAQSection = ({
|
|
|
11103
11137
|
};
|
|
11104
11138
|
|
|
11105
11139
|
// src/components/layout/FloatingContainer.tsx
|
|
11106
|
-
var
|
|
11140
|
+
var import_react25 = require("react");
|
|
11107
11141
|
var import_react_dom3 = require("react-dom");
|
|
11108
11142
|
var import_clsx23 = require("clsx");
|
|
11109
11143
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
11110
|
-
var FloatingContainer = (0,
|
|
11144
|
+
var FloatingContainer = (0, import_react25.forwardRef)(function FloatingContainer2({
|
|
11111
11145
|
children,
|
|
11112
11146
|
backgroundOverlay,
|
|
11113
11147
|
anchor,
|
|
@@ -11119,8 +11153,8 @@ var FloatingContainer = (0, import_react26.forwardRef)(function FloatingContaine
|
|
|
11119
11153
|
gap = 4,
|
|
11120
11154
|
...props
|
|
11121
11155
|
}, forwardRef17) {
|
|
11122
|
-
const innerRef = (0,
|
|
11123
|
-
(0,
|
|
11156
|
+
const innerRef = (0, import_react25.useRef)(null);
|
|
11157
|
+
(0, import_react25.useImperativeHandle)(forwardRef17, () => innerRef.current);
|
|
11124
11158
|
const position = useFloatingElement({
|
|
11125
11159
|
active: !props.hidden,
|
|
11126
11160
|
containerRef: innerRef,
|
|
@@ -11160,18 +11194,18 @@ var FloatingContainer = (0, import_react26.forwardRef)(function FloatingContaine
|
|
|
11160
11194
|
});
|
|
11161
11195
|
|
|
11162
11196
|
// src/components/layout/ListBox.tsx
|
|
11163
|
-
var
|
|
11197
|
+
var import_react26 = __toESM(require("react"));
|
|
11164
11198
|
var import_clsx24 = require("clsx");
|
|
11165
11199
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
11166
|
-
var ListBoxContext = (0,
|
|
11200
|
+
var ListBoxContext = (0, import_react26.createContext)(null);
|
|
11167
11201
|
function useListBoxContext() {
|
|
11168
|
-
const ctx = (0,
|
|
11202
|
+
const ctx = (0, import_react26.useContext)(ListBoxContext);
|
|
11169
11203
|
if (!ctx) {
|
|
11170
11204
|
throw new Error("ListBoxItem must be used within a ListBoxPrimitive");
|
|
11171
11205
|
}
|
|
11172
11206
|
return ctx;
|
|
11173
11207
|
}
|
|
11174
|
-
var ListBoxItem = (0,
|
|
11208
|
+
var ListBoxItem = (0, import_react26.forwardRef)(
|
|
11175
11209
|
function ListBoxItem2({ value, disabled = false, children, className, ...rest }, ref) {
|
|
11176
11210
|
const {
|
|
11177
11211
|
registerItem,
|
|
@@ -11181,9 +11215,9 @@ var ListBoxItem = (0, import_react27.forwardRef)(
|
|
|
11181
11215
|
onItemClick,
|
|
11182
11216
|
isSelected
|
|
11183
11217
|
} = useListBoxContext();
|
|
11184
|
-
const itemRef = (0,
|
|
11185
|
-
const id =
|
|
11186
|
-
(0,
|
|
11218
|
+
const itemRef = (0, import_react26.useRef)(null);
|
|
11219
|
+
const id = import_react26.default.useId();
|
|
11220
|
+
(0, import_react26.useEffect)(() => {
|
|
11187
11221
|
registerItem({ id, value, disabled, ref: itemRef });
|
|
11188
11222
|
return () => unregisterItem(id);
|
|
11189
11223
|
}, [id, value, disabled, registerItem, unregisterItem]);
|
|
@@ -11225,7 +11259,7 @@ var ListBoxItem = (0, import_react27.forwardRef)(
|
|
|
11225
11259
|
);
|
|
11226
11260
|
}
|
|
11227
11261
|
);
|
|
11228
|
-
var ListBoxPrimitive = (0,
|
|
11262
|
+
var ListBoxPrimitive = (0, import_react26.forwardRef)(
|
|
11229
11263
|
function ListBoxPrimitive2({
|
|
11230
11264
|
value,
|
|
11231
11265
|
onSelectionChanged,
|
|
@@ -11235,9 +11269,9 @@ var ListBoxPrimitive = (0, import_react27.forwardRef)(
|
|
|
11235
11269
|
orientation = "vertical",
|
|
11236
11270
|
...props
|
|
11237
11271
|
}, ref) {
|
|
11238
|
-
const itemsRef = (0,
|
|
11239
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
11240
|
-
const registerItem = (0,
|
|
11272
|
+
const itemsRef = (0, import_react26.useRef)([]);
|
|
11273
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react26.useState)(void 0);
|
|
11274
|
+
const registerItem = (0, import_react26.useCallback)((item) => {
|
|
11241
11275
|
itemsRef.current.push(item);
|
|
11242
11276
|
itemsRef.current.sort((a, b) => {
|
|
11243
11277
|
const aEl = a.ref.current;
|
|
@@ -11246,14 +11280,14 @@ var ListBoxPrimitive = (0, import_react27.forwardRef)(
|
|
|
11246
11280
|
return aEl.compareDocumentPosition(bEl) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
|
|
11247
11281
|
});
|
|
11248
11282
|
}, []);
|
|
11249
|
-
const unregisterItem = (0,
|
|
11283
|
+
const unregisterItem = (0, import_react26.useCallback)((id) => {
|
|
11250
11284
|
itemsRef.current = itemsRef.current.filter((i) => i.id !== id);
|
|
11251
11285
|
}, []);
|
|
11252
|
-
const isSelected = (0,
|
|
11286
|
+
const isSelected = (0, import_react26.useCallback)(
|
|
11253
11287
|
(val) => (value ?? []).includes(val),
|
|
11254
11288
|
[value]
|
|
11255
11289
|
);
|
|
11256
|
-
const onItemClickedHandler = (0,
|
|
11290
|
+
const onItemClickedHandler = (0, import_react26.useCallback)(
|
|
11257
11291
|
(id) => {
|
|
11258
11292
|
const index = itemsRef.current.findIndex((i) => i.id === id);
|
|
11259
11293
|
if (index === -1) {
|
|
@@ -11277,13 +11311,13 @@ var ListBoxPrimitive = (0, import_react27.forwardRef)(
|
|
|
11277
11311
|
},
|
|
11278
11312
|
[onItemClicked, isSelection, isMultiple, onSelectionChanged, isSelected, value]
|
|
11279
11313
|
);
|
|
11280
|
-
const setHighlightedId = (0,
|
|
11314
|
+
const setHighlightedId = (0, import_react26.useCallback)((id) => {
|
|
11281
11315
|
const index = itemsRef.current.findIndex((i) => i.id === id);
|
|
11282
11316
|
if (index !== -1) {
|
|
11283
11317
|
setHighlightedIndex(index);
|
|
11284
11318
|
}
|
|
11285
11319
|
}, []);
|
|
11286
|
-
(0,
|
|
11320
|
+
(0, import_react26.useEffect)(() => {
|
|
11287
11321
|
if (highlightedIndex !== void 0) {
|
|
11288
11322
|
itemsRef.current[highlightedIndex]?.ref.current?.scrollIntoView({ block: "nearest", behavior: "auto" });
|
|
11289
11323
|
}
|
|
@@ -11388,7 +11422,7 @@ var ListBoxMultipleUncontrolled = ({
|
|
|
11388
11422
|
}
|
|
11389
11423
|
);
|
|
11390
11424
|
};
|
|
11391
|
-
var ListBox = (0,
|
|
11425
|
+
var ListBox = (0, import_react26.forwardRef)(function ListBox2({
|
|
11392
11426
|
value,
|
|
11393
11427
|
onSelectionChanged,
|
|
11394
11428
|
...props
|
|
@@ -12522,7 +12556,7 @@ var ErrorComponent = ({
|
|
|
12522
12556
|
};
|
|
12523
12557
|
|
|
12524
12558
|
// src/components/loading-states/LoadingAndErrorComponent.tsx
|
|
12525
|
-
var
|
|
12559
|
+
var import_react27 = require("react");
|
|
12526
12560
|
|
|
12527
12561
|
// src/components/loading-states/LoadingContainer.tsx
|
|
12528
12562
|
var import_clsx28 = require("clsx");
|
|
@@ -12543,8 +12577,8 @@ var LoadingAndErrorComponent = ({
|
|
|
12543
12577
|
minimumLoadingDuration = 200,
|
|
12544
12578
|
className
|
|
12545
12579
|
}) => {
|
|
12546
|
-
const [isInMinimumLoading, setIsInMinimumLoading] = (0,
|
|
12547
|
-
const [hasUsedMinimumLoading, setHasUsedMinimumLoading] = (0,
|
|
12580
|
+
const [isInMinimumLoading, setIsInMinimumLoading] = (0, import_react27.useState)(false);
|
|
12581
|
+
const [hasUsedMinimumLoading, setHasUsedMinimumLoading] = (0, import_react27.useState)(false);
|
|
12548
12582
|
if (minimumLoadingDuration && !isInMinimumLoading && !hasUsedMinimumLoading) {
|
|
12549
12583
|
setIsInMinimumLoading(true);
|
|
12550
12584
|
setTimeout(() => {
|
|
@@ -12646,13 +12680,13 @@ var ProgressIndicator = ({
|
|
|
12646
12680
|
// src/components/navigation/BreadCrumb.tsx
|
|
12647
12681
|
var import_link = __toESM(require_link2());
|
|
12648
12682
|
var import_clsx32 = __toESM(require("clsx"));
|
|
12649
|
-
var
|
|
12683
|
+
var import_react28 = require("react");
|
|
12650
12684
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
12651
12685
|
var BreadCrumb = ({ crumbs, linkClassName, containerClassName }) => {
|
|
12652
12686
|
const color = "text-description";
|
|
12653
12687
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: (0, import_clsx32.default)("flex-row-0.5 items-center", containerClassName), children: crumbs.map((crumb, index) => {
|
|
12654
12688
|
const isLast = index === crumbs.length - 1;
|
|
12655
|
-
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
12689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_react28.Fragment, { children: [
|
|
12656
12690
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12657
12691
|
import_link.default,
|
|
12658
12692
|
{
|
|
@@ -12668,8 +12702,8 @@ var BreadCrumb = ({ crumbs, linkClassName, containerClassName }) => {
|
|
|
12668
12702
|
|
|
12669
12703
|
// src/components/navigation/Navigation.tsx
|
|
12670
12704
|
var import_lucide_react9 = require("lucide-react");
|
|
12705
|
+
var import_react29 = require("react");
|
|
12671
12706
|
var import_react30 = require("react");
|
|
12672
|
-
var import_react31 = require("react");
|
|
12673
12707
|
var import_link2 = __toESM(require_link2());
|
|
12674
12708
|
var import_clsx33 = __toESM(require("clsx"));
|
|
12675
12709
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
@@ -12682,10 +12716,10 @@ var NavigationItemWithSubItem = ({
|
|
|
12682
12716
|
horizontalAlignment = "center",
|
|
12683
12717
|
...options
|
|
12684
12718
|
}) => {
|
|
12685
|
-
const [isOpen, setOpen] = (0,
|
|
12686
|
-
const containerRef = (0,
|
|
12687
|
-
const triggerRef = (0,
|
|
12688
|
-
const id = (0,
|
|
12719
|
+
const [isOpen, setOpen] = (0, import_react30.useState)(false);
|
|
12720
|
+
const containerRef = (0, import_react30.useRef)();
|
|
12721
|
+
const triggerRef = (0, import_react30.useRef)(null);
|
|
12722
|
+
const id = (0, import_react30.useId)();
|
|
12689
12723
|
const style = useFloatingElement({
|
|
12690
12724
|
active: isOpen,
|
|
12691
12725
|
containerRef,
|
|
@@ -12693,7 +12727,7 @@ var NavigationItemWithSubItem = ({
|
|
|
12693
12727
|
horizontalAlignment,
|
|
12694
12728
|
...options
|
|
12695
12729
|
});
|
|
12696
|
-
const onBlur = (0,
|
|
12730
|
+
const onBlur = (0, import_react30.useCallback)((event) => {
|
|
12697
12731
|
const nextFocus = event.relatedTarget;
|
|
12698
12732
|
if (!containerRef.current?.contains(nextFocus) && !triggerRef.current?.contains(nextFocus)) {
|
|
12699
12733
|
setOpen(false);
|
|
@@ -12747,10 +12781,10 @@ var NavigationItemList = ({ items, ...restProps }) => {
|
|
|
12747
12781
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("nav", { ...restProps, className: (0, import_clsx33.default)("flex-row-6 items-center", restProps.className), children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("li", { children: isSubItem(item) ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(NavigationItemWithSubItem, { ...item }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_link2.default, { href: item.link, target: item.external ? "_blank" : void 0, className: "link", children: item.label }) }, index)) });
|
|
12748
12782
|
};
|
|
12749
12783
|
var Navigation = ({ ...props }) => {
|
|
12750
|
-
const [isMobileOpen, setIsMobileOpen] = (0,
|
|
12751
|
-
const id = (0,
|
|
12752
|
-
const menuRef = (0,
|
|
12753
|
-
(0,
|
|
12784
|
+
const [isMobileOpen, setIsMobileOpen] = (0, import_react30.useState)(false);
|
|
12785
|
+
const id = (0, import_react30.useId)();
|
|
12786
|
+
const menuRef = (0, import_react30.useRef)(null);
|
|
12787
|
+
(0, import_react29.useEffect)(() => {
|
|
12754
12788
|
menuRef.current?.focus();
|
|
12755
12789
|
}, [isMobileOpen]);
|
|
12756
12790
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
@@ -12805,7 +12839,7 @@ var Navigation = ({ ...props }) => {
|
|
|
12805
12839
|
// src/components/navigation/Pagination.tsx
|
|
12806
12840
|
var import_lucide_react10 = require("lucide-react");
|
|
12807
12841
|
var import_clsx34 = __toESM(require("clsx"));
|
|
12808
|
-
var
|
|
12842
|
+
var import_react31 = require("react");
|
|
12809
12843
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
12810
12844
|
var Pagination = ({
|
|
12811
12845
|
overwriteTranslation,
|
|
@@ -12816,11 +12850,11 @@ var Pagination = ({
|
|
|
12816
12850
|
style
|
|
12817
12851
|
}) => {
|
|
12818
12852
|
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
12819
|
-
const [value, setValue] = (0,
|
|
12853
|
+
const [value, setValue] = (0, import_react31.useState)((pageIndex + 1).toString());
|
|
12820
12854
|
const noPages = pageCount === 0;
|
|
12821
12855
|
const onFirstPage = pageIndex === 0 && !noPages;
|
|
12822
12856
|
const onLastPage = pageIndex === pageCount - 1;
|
|
12823
|
-
(0,
|
|
12857
|
+
(0, import_react31.useEffect)(() => {
|
|
12824
12858
|
if (noPages) {
|
|
12825
12859
|
setValue("0");
|
|
12826
12860
|
} else {
|
|
@@ -13499,7 +13533,7 @@ var PropertyBase = ({
|
|
|
13499
13533
|
};
|
|
13500
13534
|
|
|
13501
13535
|
// src/components/properties/CheckboxProperty.tsx
|
|
13502
|
-
var
|
|
13536
|
+
var import_react32 = require("react");
|
|
13503
13537
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
13504
13538
|
var CheckboxProperty = ({
|
|
13505
13539
|
overwriteTranslation,
|
|
@@ -13509,7 +13543,7 @@ var CheckboxProperty = ({
|
|
|
13509
13543
|
...baseProps
|
|
13510
13544
|
}) => {
|
|
13511
13545
|
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
13512
|
-
const id = (0,
|
|
13546
|
+
const id = (0, import_react32.useId)();
|
|
13513
13547
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
13514
13548
|
PropertyBase,
|
|
13515
13549
|
{
|
|
@@ -13732,10 +13766,10 @@ var import_lucide_react19 = require("lucide-react");
|
|
|
13732
13766
|
var import_clsx43 = __toESM(require("clsx"));
|
|
13733
13767
|
|
|
13734
13768
|
// src/components/user-action/Textarea.tsx
|
|
13735
|
-
var
|
|
13769
|
+
var import_react33 = require("react");
|
|
13736
13770
|
var import_clsx42 = __toESM(require("clsx"));
|
|
13737
13771
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
13738
|
-
var Textarea = (0,
|
|
13772
|
+
var Textarea = (0, import_react33.forwardRef)(function Textarea2({
|
|
13739
13773
|
id,
|
|
13740
13774
|
onChange,
|
|
13741
13775
|
onChangeText,
|
|
@@ -13809,7 +13843,7 @@ var TextareaWithHeadline = ({
|
|
|
13809
13843
|
containerClassName,
|
|
13810
13844
|
...props
|
|
13811
13845
|
}) => {
|
|
13812
|
-
const genId = (0,
|
|
13846
|
+
const genId = (0, import_react33.useId)();
|
|
13813
13847
|
const usedId = id ?? genId;
|
|
13814
13848
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
13815
13849
|
"div",
|
|
@@ -13924,7 +13958,7 @@ var TableFilters = {
|
|
|
13924
13958
|
};
|
|
13925
13959
|
|
|
13926
13960
|
// src/components/table/Table.tsx
|
|
13927
|
-
var
|
|
13961
|
+
var import_react39 = require("react");
|
|
13928
13962
|
var import_clsx48 = __toESM(require("clsx"));
|
|
13929
13963
|
var import_react_table = require("@tanstack/react-table");
|
|
13930
13964
|
var import_react_custom_scrollbars_23 = require("react-custom-scrollbars-2");
|
|
@@ -13940,9 +13974,9 @@ var TableCell = ({
|
|
|
13940
13974
|
};
|
|
13941
13975
|
|
|
13942
13976
|
// src/hooks/useResizeCallbackWrapper.ts
|
|
13943
|
-
var
|
|
13977
|
+
var import_react34 = require("react");
|
|
13944
13978
|
var useResizeCallbackWrapper = (callback) => {
|
|
13945
|
-
(0,
|
|
13979
|
+
(0, import_react34.useEffect)(() => {
|
|
13946
13980
|
window.addEventListener("resize", callback);
|
|
13947
13981
|
return () => {
|
|
13948
13982
|
window.removeEventListener("resize", callback);
|
|
@@ -13985,7 +14019,7 @@ var TableSortButton = ({
|
|
|
13985
14019
|
var import_lucide_react21 = require("lucide-react");
|
|
13986
14020
|
|
|
13987
14021
|
// src/components/user-action/Menu.tsx
|
|
13988
|
-
var
|
|
14022
|
+
var import_react37 = require("react");
|
|
13989
14023
|
var import_clsx47 = __toESM(require("clsx"));
|
|
13990
14024
|
|
|
13991
14025
|
// src/utils/bagFunctions.ts
|
|
@@ -14057,15 +14091,15 @@ var usePopoverPosition = (trigger, options) => {
|
|
|
14057
14091
|
};
|
|
14058
14092
|
|
|
14059
14093
|
// src/hooks/useHoverState.ts
|
|
14060
|
-
var
|
|
14094
|
+
var import_react35 = require("react");
|
|
14061
14095
|
var defaultUseHoverStateProps = {
|
|
14062
14096
|
closingDelay: 200,
|
|
14063
14097
|
isDisabled: false
|
|
14064
14098
|
};
|
|
14065
14099
|
var useHoverState = (props = void 0) => {
|
|
14066
14100
|
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
14067
|
-
const [isHovered, setIsHovered] = (0,
|
|
14068
|
-
const [timer, setTimer] = (0,
|
|
14101
|
+
const [isHovered, setIsHovered] = (0, import_react35.useState)(false);
|
|
14102
|
+
const [timer, setTimer] = (0, import_react35.useState)();
|
|
14069
14103
|
const onMouseEnter = () => {
|
|
14070
14104
|
if (isDisabled) {
|
|
14071
14105
|
return;
|
|
@@ -14081,14 +14115,14 @@ var useHoverState = (props = void 0) => {
|
|
|
14081
14115
|
setIsHovered(false);
|
|
14082
14116
|
}, closingDelay));
|
|
14083
14117
|
};
|
|
14084
|
-
(0,
|
|
14118
|
+
(0, import_react35.useEffect)(() => {
|
|
14085
14119
|
if (timer) {
|
|
14086
14120
|
return () => {
|
|
14087
14121
|
clearTimeout(timer);
|
|
14088
14122
|
};
|
|
14089
14123
|
}
|
|
14090
14124
|
});
|
|
14091
|
-
(0,
|
|
14125
|
+
(0, import_react35.useEffect)(() => {
|
|
14092
14126
|
if (timer) {
|
|
14093
14127
|
clearTimeout(timer);
|
|
14094
14128
|
}
|
|
@@ -14101,9 +14135,9 @@ var useHoverState = (props = void 0) => {
|
|
|
14101
14135
|
};
|
|
14102
14136
|
|
|
14103
14137
|
// src/hooks/useOutsideClick.ts
|
|
14104
|
-
var
|
|
14138
|
+
var import_react36 = require("react");
|
|
14105
14139
|
var useOutsideClick = (refs, handler) => {
|
|
14106
|
-
(0,
|
|
14140
|
+
(0, import_react36.useEffect)(() => {
|
|
14107
14141
|
const listener = (event) => {
|
|
14108
14142
|
if (event.target === null) return;
|
|
14109
14143
|
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
@@ -14161,10 +14195,10 @@ var Menu = ({
|
|
|
14161
14195
|
menuClassName = ""
|
|
14162
14196
|
}) => {
|
|
14163
14197
|
const { isHovered: isOpen, setIsHovered: setIsOpen } = useHoverState({ isDisabled: !showOnHover || disabled });
|
|
14164
|
-
const triggerRef = (0,
|
|
14165
|
-
const menuRef = (0,
|
|
14198
|
+
const triggerRef = (0, import_react37.useRef)(null);
|
|
14199
|
+
const menuRef = (0, import_react37.useRef)(null);
|
|
14166
14200
|
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
14167
|
-
const [isHidden, setIsHidden] = (0,
|
|
14201
|
+
const [isHidden, setIsHidden] = (0, import_react37.useState)(true);
|
|
14168
14202
|
const bag = {
|
|
14169
14203
|
isOpen,
|
|
14170
14204
|
close: () => setIsOpen(false),
|
|
@@ -14175,7 +14209,7 @@ var Menu = ({
|
|
|
14175
14209
|
triggerRef.current?.getBoundingClientRect(),
|
|
14176
14210
|
{ verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
|
|
14177
14211
|
);
|
|
14178
|
-
(0,
|
|
14212
|
+
(0, import_react37.useEffect)(() => {
|
|
14179
14213
|
if (!isOpen) return;
|
|
14180
14214
|
const triggerEl = triggerRef.current;
|
|
14181
14215
|
if (!triggerEl) return;
|
|
@@ -14192,7 +14226,7 @@ var Menu = ({
|
|
|
14192
14226
|
window.removeEventListener("resize", close);
|
|
14193
14227
|
};
|
|
14194
14228
|
}, [isOpen, setIsOpen]);
|
|
14195
|
-
(0,
|
|
14229
|
+
(0, import_react37.useEffect)(() => {
|
|
14196
14230
|
if (isOpen) {
|
|
14197
14231
|
setIsHidden(false);
|
|
14198
14232
|
}
|
|
@@ -14228,7 +14262,7 @@ var Menu = ({
|
|
|
14228
14262
|
};
|
|
14229
14263
|
|
|
14230
14264
|
// src/components/table/TableFilterButton.tsx
|
|
14231
|
-
var
|
|
14265
|
+
var import_react38 = require("react");
|
|
14232
14266
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
14233
14267
|
var defaultTableFilterTranslation = {
|
|
14234
14268
|
en: {
|
|
@@ -14254,9 +14288,9 @@ var TableFilterButton = ({
|
|
|
14254
14288
|
}) => {
|
|
14255
14289
|
const translation = useTranslation([formTranslation, defaultTableFilterTranslation]);
|
|
14256
14290
|
const columnFilterValue = column.getFilterValue();
|
|
14257
|
-
const [filterValue, setFilterValue] = (0,
|
|
14291
|
+
const [filterValue, setFilterValue] = (0, import_react38.useState)(columnFilterValue);
|
|
14258
14292
|
const hasFilter = !!filterValue;
|
|
14259
|
-
(0,
|
|
14293
|
+
(0, import_react38.useEffect)(() => {
|
|
14260
14294
|
setFilterValue(columnFilterValue);
|
|
14261
14295
|
}, [columnFilterValue]);
|
|
14262
14296
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
@@ -14370,22 +14404,22 @@ var Table = ({
|
|
|
14370
14404
|
columns,
|
|
14371
14405
|
...tableOptions
|
|
14372
14406
|
}) => {
|
|
14373
|
-
const ref = (0,
|
|
14374
|
-
const tableRef = (0,
|
|
14375
|
-
const [columnSizing, setColumnSizing] = (0,
|
|
14407
|
+
const ref = (0, import_react39.useRef)(null);
|
|
14408
|
+
const tableRef = (0, import_react39.useRef)(null);
|
|
14409
|
+
const [columnSizing, setColumnSizing] = (0, import_react39.useState)(columns.reduce((previousValue, currentValue) => {
|
|
14376
14410
|
return {
|
|
14377
14411
|
...previousValue,
|
|
14378
14412
|
[currentValue.id]: currentValue.minSize ?? defaultColumn.minSize
|
|
14379
14413
|
};
|
|
14380
14414
|
}, {}));
|
|
14381
|
-
const [columnSizingInfo, setColumnSizingInfo] = (0,
|
|
14382
|
-
const [pagination, setPagination] = (0,
|
|
14415
|
+
const [columnSizingInfo, setColumnSizingInfo] = (0, import_react39.useState)();
|
|
14416
|
+
const [pagination, setPagination] = (0, import_react39.useState)({
|
|
14383
14417
|
pageSize: 10,
|
|
14384
14418
|
pageIndex: 0,
|
|
14385
14419
|
...initialState?.pagination
|
|
14386
14420
|
});
|
|
14387
|
-
const [columnFilters, setColumnFilters] = (0,
|
|
14388
|
-
const computedColumnMinWidths = (0,
|
|
14421
|
+
const [columnFilters, setColumnFilters] = (0, import_react39.useState)(initialState?.columnFilters);
|
|
14422
|
+
const computedColumnMinWidths = (0, import_react39.useMemo)(() => {
|
|
14389
14423
|
return columns.reduce((previousValue, column) => {
|
|
14390
14424
|
return {
|
|
14391
14425
|
...previousValue,
|
|
@@ -14394,7 +14428,7 @@ var Table = ({
|
|
|
14394
14428
|
};
|
|
14395
14429
|
}, {});
|
|
14396
14430
|
}, [columns, defaultColumn]);
|
|
14397
|
-
const computedColumnMaxWidths = (0,
|
|
14431
|
+
const computedColumnMaxWidths = (0, import_react39.useMemo)(() => {
|
|
14398
14432
|
return columns.reduce((previousValue, column) => {
|
|
14399
14433
|
return {
|
|
14400
14434
|
...previousValue,
|
|
@@ -14402,12 +14436,12 @@ var Table = ({
|
|
|
14402
14436
|
};
|
|
14403
14437
|
}, {});
|
|
14404
14438
|
}, [columns, defaultColumn]);
|
|
14405
|
-
const tableMinWidth = (0,
|
|
14439
|
+
const tableMinWidth = (0, import_react39.useMemo)(() => {
|
|
14406
14440
|
return columns.reduce((sum, column) => {
|
|
14407
14441
|
return sum + computedColumnMinWidths[column.id];
|
|
14408
14442
|
}, 0);
|
|
14409
14443
|
}, [columns, computedColumnMinWidths]);
|
|
14410
|
-
const updateColumnSizes = (0,
|
|
14444
|
+
const updateColumnSizes = (0, import_react39.useMemo)(() => {
|
|
14411
14445
|
return (previous) => {
|
|
14412
14446
|
const updateSizing = {
|
|
14413
14447
|
...columnSizing,
|
|
@@ -14524,18 +14558,18 @@ var Table = ({
|
|
|
14524
14558
|
columnResizeMode: "onChange",
|
|
14525
14559
|
...tableOptions
|
|
14526
14560
|
});
|
|
14527
|
-
const [hasInitializedSizing, setHasInitializedSizing] = (0,
|
|
14528
|
-
(0,
|
|
14561
|
+
const [hasInitializedSizing, setHasInitializedSizing] = (0, import_react39.useState)(false);
|
|
14562
|
+
(0, import_react39.useEffect)(() => {
|
|
14529
14563
|
if (!hasInitializedSizing && ref.current) {
|
|
14530
14564
|
setHasInitializedSizing(true);
|
|
14531
14565
|
table.setColumnSizing(updateColumnSizes(columnSizing));
|
|
14532
14566
|
}
|
|
14533
14567
|
}, [columnSizing, hasInitializedSizing]);
|
|
14534
|
-
useResizeCallbackWrapper((0,
|
|
14568
|
+
useResizeCallbackWrapper((0, import_react39.useCallback)(() => {
|
|
14535
14569
|
table.setColumnSizing(updateColumnSizes);
|
|
14536
14570
|
}, [updateColumnSizes]));
|
|
14537
14571
|
const pageCount = table.getPageCount();
|
|
14538
|
-
(0,
|
|
14572
|
+
(0, import_react39.useEffect)(() => {
|
|
14539
14573
|
const totalPages = pageCount;
|
|
14540
14574
|
if (totalPages === 0) {
|
|
14541
14575
|
if (pagination.pageIndex !== 0) {
|
|
@@ -14551,7 +14585,7 @@ var Table = ({
|
|
|
14551
14585
|
}));
|
|
14552
14586
|
}
|
|
14553
14587
|
}, [data, pageCount, pagination.pageSize, pagination.pageIndex]);
|
|
14554
|
-
const columnSizeVars = (0,
|
|
14588
|
+
const columnSizeVars = (0, import_react39.useMemo)(() => {
|
|
14555
14589
|
const headers = table.getFlatHeaders();
|
|
14556
14590
|
const colSizes = {};
|
|
14557
14591
|
for (let i = 0; i < headers.length; i++) {
|
|
@@ -14686,7 +14720,7 @@ var TableWithSelection = ({
|
|
|
14686
14720
|
meta,
|
|
14687
14721
|
...props
|
|
14688
14722
|
}) => {
|
|
14689
|
-
const columnsWithSelection = (0,
|
|
14723
|
+
const columnsWithSelection = (0, import_react39.useMemo)(() => {
|
|
14690
14724
|
return [
|
|
14691
14725
|
{
|
|
14692
14726
|
id: selectionRowId,
|
|
@@ -14755,7 +14789,7 @@ var TableWithSelection = ({
|
|
|
14755
14789
|
};
|
|
14756
14790
|
|
|
14757
14791
|
// src/components/user-action/CopyToClipboardWrapper.tsx
|
|
14758
|
-
var
|
|
14792
|
+
var import_react40 = require("react");
|
|
14759
14793
|
var import_clsx49 = require("clsx");
|
|
14760
14794
|
|
|
14761
14795
|
// src/utils/writeToClipboard.ts
|
|
@@ -14775,8 +14809,8 @@ var CopyToClipboardWrapper = ({
|
|
|
14775
14809
|
zIndex = 10
|
|
14776
14810
|
}) => {
|
|
14777
14811
|
const translation = useTranslation([formTranslation]);
|
|
14778
|
-
const [isShowingIndication, setIsShowingIndication] = (0,
|
|
14779
|
-
const [isShowingConfirmation, setIsShowingConfirmation] = (0,
|
|
14812
|
+
const [isShowingIndication, setIsShowingIndication] = (0, import_react40.useState)(false);
|
|
14813
|
+
const [isShowingConfirmation, setIsShowingConfirmation] = (0, import_react40.useState)(false);
|
|
14780
14814
|
const positionClasses = {
|
|
14781
14815
|
top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,
|
|
14782
14816
|
bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,
|
|
@@ -14918,7 +14952,7 @@ var DateTimePicker = ({
|
|
|
14918
14952
|
};
|
|
14919
14953
|
|
|
14920
14954
|
// src/components/user-action/ScrollPicker.tsx
|
|
14921
|
-
var
|
|
14955
|
+
var import_react41 = require("react");
|
|
14922
14956
|
var import_clsx51 = __toESM(require("clsx"));
|
|
14923
14957
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
14924
14958
|
var up = 1;
|
|
@@ -14939,7 +14973,7 @@ var ScrollPicker = ({
|
|
|
14939
14973
|
transition,
|
|
14940
14974
|
items,
|
|
14941
14975
|
lastTimeStamp
|
|
14942
|
-
}, setAnimation] = (0,
|
|
14976
|
+
}, setAnimation] = (0, import_react41.useState)({
|
|
14943
14977
|
targetIndex: selectedIndex,
|
|
14944
14978
|
currentIndex: disabled ? selectedIndex : 0,
|
|
14945
14979
|
velocity: 0,
|
|
@@ -14955,7 +14989,7 @@ var ScrollPicker = ({
|
|
|
14955
14989
|
const itemHeight = 40;
|
|
14956
14990
|
const distance = 8;
|
|
14957
14991
|
const containerHeight = itemHeight * (itemsShownCount - 2) + distance * (itemsShownCount - 2 + 1);
|
|
14958
|
-
const getDirection = (0,
|
|
14992
|
+
const getDirection = (0, import_react41.useCallback)((targetIndex, currentIndex2, transition2, length) => {
|
|
14959
14993
|
if (targetIndex === currentIndex2) {
|
|
14960
14994
|
return transition2 > 0 ? up : down;
|
|
14961
14995
|
}
|
|
@@ -14965,7 +14999,7 @@ var ScrollPicker = ({
|
|
|
14965
14999
|
}
|
|
14966
15000
|
return distanceForward >= length / 2 ? down : up;
|
|
14967
15001
|
}, []);
|
|
14968
|
-
const animate = (0,
|
|
15002
|
+
const animate = (0, import_react41.useCallback)((timestamp, startTime) => {
|
|
14969
15003
|
setAnimation((prevState) => {
|
|
14970
15004
|
const {
|
|
14971
15005
|
targetIndex,
|
|
@@ -15038,7 +15072,7 @@ var ScrollPicker = ({
|
|
|
15038
15072
|
};
|
|
15039
15073
|
});
|
|
15040
15074
|
}, [disabled, getDirection, onChange]);
|
|
15041
|
-
(0,
|
|
15075
|
+
(0, import_react41.useEffect)(() => {
|
|
15042
15076
|
requestAnimationFrame((timestamp) => animate(timestamp, lastTimeStamp));
|
|
15043
15077
|
});
|
|
15044
15078
|
const opacity = (transition2, index, itemsCount) => {
|
|
@@ -15206,18 +15240,18 @@ var Tooltip = ({
|
|
|
15206
15240
|
};
|
|
15207
15241
|
|
|
15208
15242
|
// src/components/user-action/input/InsideLabelInput.tsx
|
|
15243
|
+
var import_react42 = require("react");
|
|
15209
15244
|
var import_react43 = require("react");
|
|
15210
|
-
var import_react44 = require("react");
|
|
15211
15245
|
var import_clsx54 = __toESM(require("clsx"));
|
|
15212
15246
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
15213
|
-
var InsideLabelInput = (0,
|
|
15247
|
+
var InsideLabelInput = (0, import_react43.forwardRef)(function InsideLabelInput2({
|
|
15214
15248
|
id: customId,
|
|
15215
15249
|
label,
|
|
15216
15250
|
...props
|
|
15217
15251
|
}, forwardedRef) {
|
|
15218
15252
|
const { value } = props;
|
|
15219
|
-
const [isFocused, setIsFocused] = (0,
|
|
15220
|
-
const generatedId = (0,
|
|
15253
|
+
const [isFocused, setIsFocused] = (0, import_react43.useState)(false);
|
|
15254
|
+
const generatedId = (0, import_react42.useId)();
|
|
15221
15255
|
const id = customId ?? generatedId;
|
|
15222
15256
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: (0, import_clsx54.default)("relative"), children: [
|
|
15223
15257
|
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
@@ -15270,20 +15304,20 @@ var InsideLabelInputUncontrolled = ({
|
|
|
15270
15304
|
};
|
|
15271
15305
|
|
|
15272
15306
|
// src/components/user-action/input/ToggleableInput.tsx
|
|
15273
|
-
var
|
|
15307
|
+
var import_react44 = require("react");
|
|
15274
15308
|
var import_lucide_react24 = require("lucide-react");
|
|
15275
15309
|
var import_clsx55 = __toESM(require("clsx"));
|
|
15276
15310
|
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
15277
|
-
var ToggleableInput = (0,
|
|
15311
|
+
var ToggleableInput = (0, import_react44.forwardRef)(function ToggleableInput2({
|
|
15278
15312
|
value,
|
|
15279
15313
|
initialState = "display",
|
|
15280
15314
|
editCompleteOptions,
|
|
15281
15315
|
...props
|
|
15282
15316
|
}, forwardedRef) {
|
|
15283
|
-
const [isEditing, setIsEditing] = (0,
|
|
15284
|
-
const innerRef = (0,
|
|
15285
|
-
(0,
|
|
15286
|
-
(0,
|
|
15317
|
+
const [isEditing, setIsEditing] = (0, import_react44.useState)(initialState !== "display");
|
|
15318
|
+
const innerRef = (0, import_react44.useRef)(null);
|
|
15319
|
+
(0, import_react44.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
15320
|
+
(0, import_react44.useEffect)(() => {
|
|
15287
15321
|
if (isEditing) {
|
|
15288
15322
|
innerRef.current?.focus();
|
|
15289
15323
|
}
|
|
@@ -15338,33 +15372,33 @@ var ToggleableInputUncontrolled = ({
|
|
|
15338
15372
|
};
|
|
15339
15373
|
|
|
15340
15374
|
// src/components/utils/FocusTrap.tsx
|
|
15375
|
+
var import_react45 = require("react");
|
|
15341
15376
|
var import_react46 = require("react");
|
|
15342
15377
|
var import_react47 = require("react");
|
|
15343
|
-
var import_react48 = require("react");
|
|
15344
15378
|
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
15345
|
-
var FocusTrap = (0,
|
|
15379
|
+
var FocusTrap = (0, import_react47.forwardRef)(function FocusTrap2({
|
|
15346
15380
|
active = true,
|
|
15347
15381
|
initialFocus,
|
|
15348
15382
|
focusFirst = false,
|
|
15349
15383
|
...props
|
|
15350
15384
|
}, forwardedRef) {
|
|
15351
|
-
const innerRef = (0,
|
|
15352
|
-
(0,
|
|
15385
|
+
const innerRef = (0, import_react45.useRef)(null);
|
|
15386
|
+
(0, import_react46.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
15353
15387
|
useFocusTrap({ container: innerRef, active, initialFocus, focusFirst });
|
|
15354
15388
|
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { ref: innerRef, ...props });
|
|
15355
15389
|
});
|
|
15356
15390
|
|
|
15357
15391
|
// src/components/utils/Transition.tsx
|
|
15358
|
-
var
|
|
15392
|
+
var import_react48 = require("react");
|
|
15359
15393
|
function Transition({
|
|
15360
15394
|
children,
|
|
15361
15395
|
show,
|
|
15362
15396
|
includeAnimation = true
|
|
15363
15397
|
}) {
|
|
15364
|
-
const [isOpen, setIsOpen] = (0,
|
|
15365
|
-
const [isTransitioning, setIsTransitioning] = (0,
|
|
15398
|
+
const [isOpen, setIsOpen] = (0, import_react48.useState)(show);
|
|
15399
|
+
const [isTransitioning, setIsTransitioning] = (0, import_react48.useState)(!isOpen);
|
|
15366
15400
|
const isUsingReducedMotion = typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : true;
|
|
15367
|
-
(0,
|
|
15401
|
+
(0, import_react48.useEffect)(() => {
|
|
15368
15402
|
setIsOpen(show);
|
|
15369
15403
|
setIsTransitioning(true);
|
|
15370
15404
|
}, [show]);
|