@helpwave/hightide 0.2.0 → 0.3.0
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/index.d.mts +142 -196
- package/dist/index.d.ts +142 -196
- package/dist/index.js +862 -986
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1048 -1166
- package/dist/index.mjs.map +1 -1
- package/dist/style/globals.css +441 -556
- package/dist/style/uncompiled/globals.css +0 -215
- package/dist/style/uncompiled/theme/breakpoints.css +8 -0
- package/dist/style/uncompiled/theme/colors-basic.css +2 -0
- package/dist/style/uncompiled/theme/colors-component.css +1 -77
- package/dist/style/uncompiled/theme/colors-semantic.css +24 -20
- package/dist/style/uncompiled/theme/components.css +211 -0
- package/dist/style/uncompiled/theme/index.css +4 -1
- package/dist/style/uncompiled/utitlity/animation.css +3 -3
- package/dist/style/uncompiled/utitlity/coloring.css +126 -0
- package/dist/style/uncompiled/utitlity/index.css +2 -1
- package/package.json +1 -4
- /package/dist/style/uncompiled/{typography.css → theme/typography.css} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -6236,50 +6236,6 @@ var require_link2 = __commonJS({
|
|
|
6236
6236
|
}
|
|
6237
6237
|
});
|
|
6238
6238
|
|
|
6239
|
-
// src/coloring/shading.ts
|
|
6240
|
-
import tinycolor from "tinycolor2";
|
|
6241
|
-
|
|
6242
|
-
// src/coloring/types.ts
|
|
6243
|
-
var shadingColorValues = [0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1e3];
|
|
6244
|
-
|
|
6245
|
-
// src/coloring/shading.ts
|
|
6246
|
-
var generateShadingColors = (partialShading) => {
|
|
6247
|
-
const shading = {
|
|
6248
|
-
0: "#FFFFFF",
|
|
6249
|
-
1e3: "#000000"
|
|
6250
|
-
};
|
|
6251
|
-
let index = 1;
|
|
6252
|
-
while (index < shadingColorValues.length - 1) {
|
|
6253
|
-
const previous = shadingColorValues[index - 1];
|
|
6254
|
-
const current = shadingColorValues[index];
|
|
6255
|
-
if (partialShading[current] !== void 0) {
|
|
6256
|
-
shading[current] = partialShading[current];
|
|
6257
|
-
index++;
|
|
6258
|
-
continue;
|
|
6259
|
-
}
|
|
6260
|
-
let j = index + 1;
|
|
6261
|
-
while (j < shadingColorValues.length) {
|
|
6262
|
-
if (partialShading[shadingColorValues[j]] !== void 0) {
|
|
6263
|
-
break;
|
|
6264
|
-
}
|
|
6265
|
-
j++;
|
|
6266
|
-
}
|
|
6267
|
-
if (j === shadingColorValues.length) {
|
|
6268
|
-
j = shadingColorValues.length - 1;
|
|
6269
|
-
}
|
|
6270
|
-
const nextFound = shadingColorValues[j];
|
|
6271
|
-
const interval = nextFound - previous;
|
|
6272
|
-
for (let k = index; k < j; k++) {
|
|
6273
|
-
const current2 = shadingColorValues[k];
|
|
6274
|
-
const previousValue = partialShading[previous] ?? shading[previous];
|
|
6275
|
-
const nextValue = partialShading[nextFound] ?? shading[nextFound];
|
|
6276
|
-
shading[current2] = tinycolor.mix(tinycolor(previousValue), tinycolor(nextValue), (current2 - previous) / interval * 100).toHexString();
|
|
6277
|
-
}
|
|
6278
|
-
index = j;
|
|
6279
|
-
}
|
|
6280
|
-
return shading;
|
|
6281
|
-
};
|
|
6282
|
-
|
|
6283
6239
|
// src/components/icons-and-geometry/HelpwaveLogo.tsx
|
|
6284
6240
|
import { clsx } from "clsx";
|
|
6285
6241
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -6383,7 +6339,7 @@ var HelpwaveBadge = ({
|
|
|
6383
6339
|
|
|
6384
6340
|
// src/components/date/DatePicker.tsx
|
|
6385
6341
|
import { useEffect as useEffect5, useState as useState5 } from "react";
|
|
6386
|
-
import { ArrowDown, ArrowUp, ChevronDown as ChevronDown2 } from "lucide-react";
|
|
6342
|
+
import { ArrowDown, ArrowUp, Calendar, ChevronDown as ChevronDown2 } from "lucide-react";
|
|
6387
6343
|
|
|
6388
6344
|
// src/utils/array.ts
|
|
6389
6345
|
var equalSizeGroups = (array, groupSize) => {
|
|
@@ -6673,7 +6629,7 @@ var useOverwritableState = (initialValue, onChange) => {
|
|
|
6673
6629
|
};
|
|
6674
6630
|
|
|
6675
6631
|
// src/components/date/DayPicker.tsx
|
|
6676
|
-
import
|
|
6632
|
+
import clsx4 from "clsx";
|
|
6677
6633
|
|
|
6678
6634
|
// src/i18n/LocaleProvider.tsx
|
|
6679
6635
|
import { createContext, useContext, useEffect as useEffect2, useMemo, useState as useState3 } from "react";
|
|
@@ -7320,7 +7276,82 @@ var useLanguage = () => {
|
|
|
7320
7276
|
|
|
7321
7277
|
// src/components/date/DayPicker.tsx
|
|
7322
7278
|
import { useEffect as useEffect3, useState as useState4 } from "react";
|
|
7323
|
-
|
|
7279
|
+
|
|
7280
|
+
// src/components/user-action/Button.tsx
|
|
7281
|
+
import { forwardRef } from "react";
|
|
7282
|
+
import clsx3 from "clsx";
|
|
7283
|
+
import { jsxs as jsxs3 } from "react/jsx-runtime";
|
|
7284
|
+
var buttonColorsList = ["primary", "secondary", "positive", "warning", "negative", "neutral", "none"];
|
|
7285
|
+
var paddingMapping = {
|
|
7286
|
+
default: {
|
|
7287
|
+
tiny: "btn-xs",
|
|
7288
|
+
small: "btn-sm",
|
|
7289
|
+
medium: "btn-md",
|
|
7290
|
+
large: "btn-lg"
|
|
7291
|
+
},
|
|
7292
|
+
icon: {
|
|
7293
|
+
tiny: "icon-btn-xs",
|
|
7294
|
+
small: "icon-btn-sm",
|
|
7295
|
+
medium: "icon-btn-md",
|
|
7296
|
+
large: "icon-btn-lg"
|
|
7297
|
+
},
|
|
7298
|
+
none: {}
|
|
7299
|
+
};
|
|
7300
|
+
var ButtonUtil = {
|
|
7301
|
+
colors: buttonColorsList,
|
|
7302
|
+
colorClasses: {
|
|
7303
|
+
primary: "primary",
|
|
7304
|
+
secondary: "secondary",
|
|
7305
|
+
positive: "positive",
|
|
7306
|
+
warning: "warning",
|
|
7307
|
+
negative: "negative",
|
|
7308
|
+
neutral: "neutral",
|
|
7309
|
+
none: ""
|
|
7310
|
+
}
|
|
7311
|
+
};
|
|
7312
|
+
var Button = forwardRef(function SolidButton({
|
|
7313
|
+
children,
|
|
7314
|
+
layout = "default",
|
|
7315
|
+
size = "medium",
|
|
7316
|
+
color = "primary",
|
|
7317
|
+
coloringStyle = "solid",
|
|
7318
|
+
startIcon,
|
|
7319
|
+
endIcon,
|
|
7320
|
+
disabled,
|
|
7321
|
+
className,
|
|
7322
|
+
...restProps
|
|
7323
|
+
}, ref) {
|
|
7324
|
+
const colorClasses = ButtonUtil.colorClasses[color];
|
|
7325
|
+
return /* @__PURE__ */ jsxs3(
|
|
7326
|
+
"button",
|
|
7327
|
+
{
|
|
7328
|
+
...restProps,
|
|
7329
|
+
ref,
|
|
7330
|
+
className: clsx3(
|
|
7331
|
+
"group font-semibold",
|
|
7332
|
+
{
|
|
7333
|
+
"disabled": disabled,
|
|
7334
|
+
[colorClasses]: !disabled,
|
|
7335
|
+
"coloring-solid-hover": coloringStyle === "solid",
|
|
7336
|
+
"coloring-text-hover": coloringStyle === "text",
|
|
7337
|
+
"coloring-outline-hover": coloringStyle === "outline",
|
|
7338
|
+
"coloring-tonal-hover": coloringStyle === "tonal"
|
|
7339
|
+
},
|
|
7340
|
+
paddingMapping[layout][size],
|
|
7341
|
+
className
|
|
7342
|
+
),
|
|
7343
|
+
disabled,
|
|
7344
|
+
children: [
|
|
7345
|
+
startIcon,
|
|
7346
|
+
children,
|
|
7347
|
+
endIcon
|
|
7348
|
+
]
|
|
7349
|
+
}
|
|
7350
|
+
);
|
|
7351
|
+
});
|
|
7352
|
+
|
|
7353
|
+
// src/components/date/DayPicker.tsx
|
|
7354
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
7324
7355
|
var DayPicker = ({
|
|
7325
7356
|
displayedMonth,
|
|
7326
7357
|
selected,
|
|
@@ -7334,7 +7365,7 @@ var DayPicker = ({
|
|
|
7334
7365
|
const { locale } = useLocale();
|
|
7335
7366
|
const month = displayedMonth.getMonth();
|
|
7336
7367
|
const weeks = getWeeksForCalenderMonth(displayedMonth, weekStart);
|
|
7337
|
-
return /* @__PURE__ */
|
|
7368
|
+
return /* @__PURE__ */ jsxs4("div", { className: clsx4("flex-col-1 min-w-[220px] select-none", className), children: [
|
|
7338
7369
|
/* @__PURE__ */ jsx4("div", { className: "flex-row-2 text-center", children: weeks[0].map((weekDay, index) => /* @__PURE__ */ jsx4("div", { className: "flex-1 font-semibold", children: new Intl.DateTimeFormat(locale, { weekday: "long" }).format(weekDay).substring(0, 2) }, index)) }),
|
|
7339
7370
|
weeks.map((week, index) => /* @__PURE__ */ jsx4("div", { className: "flex-row-2 text-center", children: week.map((date) => {
|
|
7340
7371
|
const isSelected = !!selected && equalDate(selected, date);
|
|
@@ -7342,19 +7373,18 @@ var DayPicker = ({
|
|
|
7342
7373
|
const isSameMonth = date.getMonth() === month;
|
|
7343
7374
|
const isDayValid = isInTimeSpan(date, start, end);
|
|
7344
7375
|
return /* @__PURE__ */ jsx4(
|
|
7345
|
-
|
|
7376
|
+
Button,
|
|
7346
7377
|
{
|
|
7347
7378
|
disabled: !isDayValid,
|
|
7348
|
-
|
|
7379
|
+
color: isSelected ? "primary" : "neutral",
|
|
7380
|
+
coloringStyle: isSelected ? "solid" : "text",
|
|
7381
|
+
size: "small",
|
|
7382
|
+
className: clsx4(
|
|
7349
7383
|
"flex-1 rounded-full border-2",
|
|
7350
7384
|
{
|
|
7351
7385
|
"text-description": !isSameMonth && !isSelected && isDayValid,
|
|
7352
|
-
"
|
|
7353
|
-
"
|
|
7354
|
-
"hover:brightness-90 hover:bg-button-solid-primary-background hover:text-button-solid-primary-text": isDayValid,
|
|
7355
|
-
"text-disabled bg-disabled-background cursor-not-allowed": !isDayValid,
|
|
7356
|
-
"border-secondary": isToday && markToday,
|
|
7357
|
-
"border-transparent": !isToday || !markToday
|
|
7386
|
+
"border-on-background": isToday && markToday,
|
|
7387
|
+
"border-transparent": !(isToday && markToday)
|
|
7358
7388
|
}
|
|
7359
7389
|
),
|
|
7360
7390
|
onClick: () => onChange?.(date),
|
|
@@ -7394,20 +7424,19 @@ var DayPickerUncontrolled = ({
|
|
|
7394
7424
|
|
|
7395
7425
|
// src/components/date/YearMonthPicker.tsx
|
|
7396
7426
|
import { useEffect as useEffect4, useRef } from "react";
|
|
7397
|
-
import { Scrollbars } from "react-custom-scrollbars-2";
|
|
7398
7427
|
import clsx6 from "clsx";
|
|
7399
7428
|
|
|
7400
7429
|
// src/components/layout/Expandable.tsx
|
|
7401
|
-
import { forwardRef, useCallback as useCallback2, useId } from "react";
|
|
7430
|
+
import { forwardRef as forwardRef2, useCallback as useCallback2, useId } from "react";
|
|
7402
7431
|
import { ChevronDown } from "lucide-react";
|
|
7403
|
-
import
|
|
7404
|
-
import { jsx as jsx5, jsxs as
|
|
7432
|
+
import clsx5 from "clsx";
|
|
7433
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
7405
7434
|
var ExpansionIcon = ({ isExpanded, className }) => {
|
|
7406
7435
|
return /* @__PURE__ */ jsx5(
|
|
7407
7436
|
ChevronDown,
|
|
7408
7437
|
{
|
|
7409
7438
|
"aria-hidden": true,
|
|
7410
|
-
className:
|
|
7439
|
+
className: clsx5(
|
|
7411
7440
|
"min-w-6 w-6 min-h-6 h-6 transition-transform motion-safe:duration-200 motion-reduce:duration-0 ease-in-out",
|
|
7412
7441
|
{ "rotate-180": isExpanded },
|
|
7413
7442
|
className
|
|
@@ -7415,7 +7444,7 @@ var ExpansionIcon = ({ isExpanded, className }) => {
|
|
|
7415
7444
|
}
|
|
7416
7445
|
);
|
|
7417
7446
|
};
|
|
7418
|
-
var Expandable =
|
|
7447
|
+
var Expandable = forwardRef2(function Expandable2({
|
|
7419
7448
|
children,
|
|
7420
7449
|
id: providedId,
|
|
7421
7450
|
label,
|
|
@@ -7433,23 +7462,23 @@ var Expandable = forwardRef(function Expandable2({
|
|
|
7433
7462
|
icon ??= defaultIcon;
|
|
7434
7463
|
const generatedId = useId();
|
|
7435
7464
|
const id = providedId ?? generatedId;
|
|
7436
|
-
return /* @__PURE__ */
|
|
7465
|
+
return /* @__PURE__ */ jsxs5(
|
|
7437
7466
|
"div",
|
|
7438
7467
|
{
|
|
7439
7468
|
ref,
|
|
7440
7469
|
onClick: () => !clickOnlyOnHeader && !disabled && onChange?.(!isExpanded),
|
|
7441
|
-
className:
|
|
7442
|
-
"flex-col-0
|
|
7470
|
+
className: clsx5(
|
|
7471
|
+
"flex-col-0 surface coloring-solid group rounded-lg shadow-sm",
|
|
7443
7472
|
{ "cursor-pointer": !clickOnlyOnHeader && !disabled },
|
|
7444
7473
|
className
|
|
7445
7474
|
),
|
|
7446
7475
|
children: [
|
|
7447
|
-
/* @__PURE__ */
|
|
7476
|
+
/* @__PURE__ */ jsxs5(
|
|
7448
7477
|
"button",
|
|
7449
7478
|
{
|
|
7450
7479
|
onClick: () => clickOnlyOnHeader && !disabled && onChange?.(!isExpanded),
|
|
7451
|
-
className:
|
|
7452
|
-
"flex-row-2 py-2 px-4 rounded-lg justify-between items-center
|
|
7480
|
+
className: clsx5(
|
|
7481
|
+
"flex-row-2 py-2 px-4 rounded-lg justify-between items-center coloring-solid-hover select-none",
|
|
7453
7482
|
{
|
|
7454
7483
|
"group-hover:brightness-97": !isExpanded,
|
|
7455
7484
|
"hover:brightness-97": isExpanded && !disabled,
|
|
@@ -7470,10 +7499,10 @@ var Expandable = forwardRef(function Expandable2({
|
|
|
7470
7499
|
"div",
|
|
7471
7500
|
{
|
|
7472
7501
|
id: `${id}-content`,
|
|
7473
|
-
className:
|
|
7502
|
+
className: clsx5(
|
|
7474
7503
|
"flex-col-2 px-4 transition-all duration-300 ease-in-out",
|
|
7475
7504
|
{
|
|
7476
|
-
[
|
|
7505
|
+
[clsx5("max-h-96 opacity-100 pb-2 overflow-y-auto", contentExpandedClassName)]: isExpanded,
|
|
7477
7506
|
"max-h-0 opacity-0 overflow-hidden": !isExpanded
|
|
7478
7507
|
},
|
|
7479
7508
|
contentClassName
|
|
@@ -7486,7 +7515,7 @@ var Expandable = forwardRef(function Expandable2({
|
|
|
7486
7515
|
}
|
|
7487
7516
|
);
|
|
7488
7517
|
});
|
|
7489
|
-
var ExpandableUncontrolled =
|
|
7518
|
+
var ExpandableUncontrolled = forwardRef2(function ExpandableUncontrolled2({
|
|
7490
7519
|
isExpanded,
|
|
7491
7520
|
onChange,
|
|
7492
7521
|
...props
|
|
@@ -7503,274 +7532,14 @@ var ExpandableUncontrolled = forwardRef(function ExpandableUncontrolled2({
|
|
|
7503
7532
|
);
|
|
7504
7533
|
});
|
|
7505
7534
|
|
|
7506
|
-
// src/components/user-action/Button.tsx
|
|
7507
|
-
import { forwardRef as forwardRef2 } from "react";
|
|
7508
|
-
import clsx5 from "clsx";
|
|
7509
|
-
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
7510
|
-
var ButtonColorUtil = {
|
|
7511
|
-
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
7512
|
-
text: ["primary", "negative", "neutral"],
|
|
7513
|
-
outline: ["primary"]
|
|
7514
|
-
};
|
|
7515
|
-
var IconButtonUtil = {
|
|
7516
|
-
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
7517
|
-
};
|
|
7518
|
-
var paddingMapping = {
|
|
7519
|
-
none: "",
|
|
7520
|
-
small: "btn-sm",
|
|
7521
|
-
medium: "btn-md",
|
|
7522
|
-
large: "btn-lg"
|
|
7523
|
-
};
|
|
7524
|
-
var iconPaddingMapping = {
|
|
7525
|
-
none: "",
|
|
7526
|
-
tiny: "icon-btn-xs",
|
|
7527
|
-
small: "icon-btn-sm",
|
|
7528
|
-
medium: "icon-btn-md",
|
|
7529
|
-
large: "icon-btn-lg"
|
|
7530
|
-
};
|
|
7531
|
-
var ButtonUtil = {
|
|
7532
|
-
paddingMapping,
|
|
7533
|
-
iconPaddingMapping
|
|
7534
|
-
};
|
|
7535
|
-
var SolidButton = forwardRef2(function SolidButton2({
|
|
7536
|
-
children,
|
|
7537
|
-
color = "primary",
|
|
7538
|
-
size = "medium",
|
|
7539
|
-
startIcon,
|
|
7540
|
-
endIcon,
|
|
7541
|
-
onClick,
|
|
7542
|
-
className,
|
|
7543
|
-
...restProps
|
|
7544
|
-
}, ref) {
|
|
7545
|
-
const colorClasses = {
|
|
7546
|
-
primary: "not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text",
|
|
7547
|
-
secondary: "not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text",
|
|
7548
|
-
tertiary: "not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text",
|
|
7549
|
-
positive: "not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text",
|
|
7550
|
-
warning: "not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text",
|
|
7551
|
-
negative: "not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text",
|
|
7552
|
-
neutral: "not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text"
|
|
7553
|
-
}[color];
|
|
7554
|
-
const iconColorClasses = {
|
|
7555
|
-
primary: "not-group-disabled:text-button-solid-primary-icon",
|
|
7556
|
-
secondary: "not-group-disabled:text-button-solid-secondary-icon",
|
|
7557
|
-
tertiary: "not-group-disabled:text-button-solid-tertiary-icon",
|
|
7558
|
-
positive: "not-group-disabled:text-button-solid-positive-icon",
|
|
7559
|
-
warning: "not-group-disabled:text-button-solid-warning-icon",
|
|
7560
|
-
negative: "not-group-disabled:text-button-solid-negative-icon",
|
|
7561
|
-
neutral: "not-group-disabled:text-button-solid-neutral-icon"
|
|
7562
|
-
}[color];
|
|
7563
|
-
return /* @__PURE__ */ jsxs5(
|
|
7564
|
-
"button",
|
|
7565
|
-
{
|
|
7566
|
-
ref,
|
|
7567
|
-
onClick,
|
|
7568
|
-
className: clsx5(
|
|
7569
|
-
"group font-semibold",
|
|
7570
|
-
colorClasses,
|
|
7571
|
-
"not-disabled:hover:brightness-90",
|
|
7572
|
-
"disabled:text-disabled disabled:bg-disabled-background",
|
|
7573
|
-
ButtonUtil.paddingMapping[size],
|
|
7574
|
-
className
|
|
7575
|
-
),
|
|
7576
|
-
...restProps,
|
|
7577
|
-
children: [
|
|
7578
|
-
startIcon && /* @__PURE__ */ jsx6(
|
|
7579
|
-
"span",
|
|
7580
|
-
{
|
|
7581
|
-
className: clsx5(
|
|
7582
|
-
iconColorClasses,
|
|
7583
|
-
"group-disabled:text-disabled-icon"
|
|
7584
|
-
),
|
|
7585
|
-
children: startIcon
|
|
7586
|
-
}
|
|
7587
|
-
),
|
|
7588
|
-
children,
|
|
7589
|
-
endIcon && /* @__PURE__ */ jsx6(
|
|
7590
|
-
"span",
|
|
7591
|
-
{
|
|
7592
|
-
className: clsx5(
|
|
7593
|
-
iconColorClasses,
|
|
7594
|
-
"group-disabled:text-disabled-icon"
|
|
7595
|
-
),
|
|
7596
|
-
children: endIcon
|
|
7597
|
-
}
|
|
7598
|
-
)
|
|
7599
|
-
]
|
|
7600
|
-
}
|
|
7601
|
-
);
|
|
7602
|
-
});
|
|
7603
|
-
var OutlineButton = ({
|
|
7604
|
-
children,
|
|
7605
|
-
color = "primary",
|
|
7606
|
-
size = "medium",
|
|
7607
|
-
startIcon,
|
|
7608
|
-
endIcon,
|
|
7609
|
-
onClick,
|
|
7610
|
-
className,
|
|
7611
|
-
...restProps
|
|
7612
|
-
}) => {
|
|
7613
|
-
const colorClasses = {
|
|
7614
|
-
primary: "not-disabled:border-button-outline-primary-text not-disabled:text-button-outline-primary-text"
|
|
7615
|
-
}[color];
|
|
7616
|
-
const iconColorClasses = {
|
|
7617
|
-
primary: "not-group-disabled:text-button-outline-primary-icon"
|
|
7618
|
-
}[color];
|
|
7619
|
-
return /* @__PURE__ */ jsxs5(
|
|
7620
|
-
"button",
|
|
7621
|
-
{
|
|
7622
|
-
onClick,
|
|
7623
|
-
className: clsx5(
|
|
7624
|
-
"group font-semibold bg-transparent border-2 ",
|
|
7625
|
-
"not-disabled:hover:brightness-80",
|
|
7626
|
-
colorClasses,
|
|
7627
|
-
"disabled:text-disabled disabled:border-disabled-outline",
|
|
7628
|
-
ButtonUtil.paddingMapping[size],
|
|
7629
|
-
className
|
|
7630
|
-
),
|
|
7631
|
-
...restProps,
|
|
7632
|
-
children: [
|
|
7633
|
-
startIcon && /* @__PURE__ */ jsx6(
|
|
7634
|
-
"span",
|
|
7635
|
-
{
|
|
7636
|
-
className: clsx5(
|
|
7637
|
-
iconColorClasses,
|
|
7638
|
-
"group-disabled:text-disabled-icon"
|
|
7639
|
-
),
|
|
7640
|
-
children: startIcon
|
|
7641
|
-
}
|
|
7642
|
-
),
|
|
7643
|
-
children,
|
|
7644
|
-
endIcon && /* @__PURE__ */ jsx6(
|
|
7645
|
-
"span",
|
|
7646
|
-
{
|
|
7647
|
-
className: clsx5(
|
|
7648
|
-
iconColorClasses,
|
|
7649
|
-
"group-disabled:text-disabled-icon"
|
|
7650
|
-
),
|
|
7651
|
-
children: endIcon
|
|
7652
|
-
}
|
|
7653
|
-
)
|
|
7654
|
-
]
|
|
7655
|
-
}
|
|
7656
|
-
);
|
|
7657
|
-
};
|
|
7658
|
-
var TextButton = ({
|
|
7659
|
-
children,
|
|
7660
|
-
color = "neutral",
|
|
7661
|
-
size = "medium",
|
|
7662
|
-
startIcon,
|
|
7663
|
-
endIcon,
|
|
7664
|
-
onClick,
|
|
7665
|
-
coloredHoverBackground = true,
|
|
7666
|
-
className,
|
|
7667
|
-
...restProps
|
|
7668
|
-
}) => {
|
|
7669
|
-
const colorClasses = {
|
|
7670
|
-
primary: "not-disabled:bg-transparent not-disabled:text-button-text-primary-text not-disabled:focus-visible:outline-button-text-primary-text",
|
|
7671
|
-
negative: "not-disabled:bg-transparent not-disabled:text-button-text-negative-text not-disabled:focus-visible:outline-button-text-negative-text",
|
|
7672
|
-
neutral: "not-disabled:bg-transparent not-disabled:text-button-text-neutral-text not-disabled:focus-visible:outline-button-text-neutral-text"
|
|
7673
|
-
}[color];
|
|
7674
|
-
const backgroundColor = {
|
|
7675
|
-
primary: "not-disabled:hover:bg-button-text-primary-text/20 not-disabled:focus-visible:bg-button-text-primary-text/20",
|
|
7676
|
-
negative: "not-disabled:hover:bg-button-text-negative-text/20 not-disabled:focus-visible:bg-button-text-negative-text/20",
|
|
7677
|
-
neutral: "not-disabled:hover:bg-button-text-neutral-text/20 not-disabled:focus-visible:bg-button-text-neutral-text/20"
|
|
7678
|
-
}[color];
|
|
7679
|
-
const iconColorClasses = {
|
|
7680
|
-
primary: "not-group-disabled:text-button-text-primary-icon",
|
|
7681
|
-
negative: "not-group-disabled:text-button-text-negative-icon",
|
|
7682
|
-
neutral: "not-group-disabled:text-button-text-neutral-icon"
|
|
7683
|
-
}[color];
|
|
7684
|
-
return /* @__PURE__ */ jsxs5(
|
|
7685
|
-
"button",
|
|
7686
|
-
{
|
|
7687
|
-
onClick,
|
|
7688
|
-
className: clsx5(
|
|
7689
|
-
"group font-semibold",
|
|
7690
|
-
"disabled:text-disabled",
|
|
7691
|
-
colorClasses,
|
|
7692
|
-
{
|
|
7693
|
-
[backgroundColor]: coloredHoverBackground,
|
|
7694
|
-
"not-disabled:hover:bg-button-text-hover-background": !coloredHoverBackground
|
|
7695
|
-
},
|
|
7696
|
-
ButtonUtil.paddingMapping[size],
|
|
7697
|
-
className
|
|
7698
|
-
),
|
|
7699
|
-
...restProps,
|
|
7700
|
-
children: [
|
|
7701
|
-
startIcon && /* @__PURE__ */ jsx6(
|
|
7702
|
-
"span",
|
|
7703
|
-
{
|
|
7704
|
-
className: clsx5(
|
|
7705
|
-
iconColorClasses,
|
|
7706
|
-
"group-disabled:text-disabled-icon"
|
|
7707
|
-
),
|
|
7708
|
-
children: startIcon
|
|
7709
|
-
}
|
|
7710
|
-
),
|
|
7711
|
-
children,
|
|
7712
|
-
endIcon && /* @__PURE__ */ jsx6(
|
|
7713
|
-
"span",
|
|
7714
|
-
{
|
|
7715
|
-
className: clsx5(
|
|
7716
|
-
iconColorClasses,
|
|
7717
|
-
"group-disabled:text-disabled-icon"
|
|
7718
|
-
),
|
|
7719
|
-
children: endIcon
|
|
7720
|
-
}
|
|
7721
|
-
)
|
|
7722
|
-
]
|
|
7723
|
-
}
|
|
7724
|
-
);
|
|
7725
|
-
};
|
|
7726
|
-
var IconButton = forwardRef2(function IconButton2({
|
|
7727
|
-
children,
|
|
7728
|
-
color = "primary",
|
|
7729
|
-
size = "medium",
|
|
7730
|
-
className,
|
|
7731
|
-
...restProps
|
|
7732
|
-
}, ref) {
|
|
7733
|
-
const colorClasses = {
|
|
7734
|
-
primary: "not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text",
|
|
7735
|
-
secondary: "not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text",
|
|
7736
|
-
tertiary: "not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text",
|
|
7737
|
-
positive: "not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text",
|
|
7738
|
-
warning: "not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text",
|
|
7739
|
-
negative: "not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text",
|
|
7740
|
-
neutral: "not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text",
|
|
7741
|
-
transparent: "not-disabled:bg-transparent"
|
|
7742
|
-
}[color];
|
|
7743
|
-
return /* @__PURE__ */ jsx6(
|
|
7744
|
-
"button",
|
|
7745
|
-
{
|
|
7746
|
-
ref,
|
|
7747
|
-
className: clsx5(
|
|
7748
|
-
colorClasses,
|
|
7749
|
-
"not-disabled:hover:brightness-90",
|
|
7750
|
-
"disabled:text-disabled",
|
|
7751
|
-
{
|
|
7752
|
-
"disabled:bg-disabled-background": color !== "transparent",
|
|
7753
|
-
"disabled:opacity-70": color === "transparent",
|
|
7754
|
-
"not-disabled:hover:bg-button-text-hover-background": color === "transparent"
|
|
7755
|
-
},
|
|
7756
|
-
ButtonUtil.iconPaddingMapping[size],
|
|
7757
|
-
className
|
|
7758
|
-
),
|
|
7759
|
-
...restProps,
|
|
7760
|
-
children
|
|
7761
|
-
}
|
|
7762
|
-
);
|
|
7763
|
-
});
|
|
7764
|
-
|
|
7765
7535
|
// src/components/date/YearMonthPicker.tsx
|
|
7766
|
-
import { jsx as
|
|
7536
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
7767
7537
|
var YearMonthPicker = ({
|
|
7768
7538
|
displayedYearMonth = /* @__PURE__ */ new Date(),
|
|
7769
7539
|
start = subtractDuration(/* @__PURE__ */ new Date(), { years: 50 }),
|
|
7770
7540
|
end = addDuration(/* @__PURE__ */ new Date(), { years: 50 }),
|
|
7771
7541
|
onChange,
|
|
7772
7542
|
className = "",
|
|
7773
|
-
maxHeight = 300,
|
|
7774
7543
|
showValueOpen = true
|
|
7775
7544
|
}) => {
|
|
7776
7545
|
const { locale } = useLocale();
|
|
@@ -7791,16 +7560,16 @@ var YearMonthPicker = ({
|
|
|
7791
7560
|
return null;
|
|
7792
7561
|
}
|
|
7793
7562
|
const years = range([start.getFullYear(), end.getFullYear()], { exclusiveEnd: false });
|
|
7794
|
-
return /* @__PURE__ */
|
|
7563
|
+
return /* @__PURE__ */ jsx6("div", { className: clsx6("flex-col-1 select-none overflow-y-auto", className), children: years.map((year) => {
|
|
7795
7564
|
const selectedYear = displayedYearMonth.getFullYear() === year;
|
|
7796
|
-
return /* @__PURE__ */
|
|
7565
|
+
return /* @__PURE__ */ jsx6(
|
|
7797
7566
|
ExpandableUncontrolled,
|
|
7798
7567
|
{
|
|
7799
7568
|
ref: (displayedYearMonth.getFullYear() ?? (/* @__PURE__ */ new Date()).getFullYear()) === year ? ref : void 0,
|
|
7800
|
-
label: /* @__PURE__ */
|
|
7569
|
+
label: /* @__PURE__ */ jsx6("span", { className: clsx6({ "text-primary font-bold": selectedYear }), children: year }),
|
|
7801
7570
|
isExpanded: showValueOpen && selectedYear,
|
|
7802
7571
|
contentClassName: "gap-y-1",
|
|
7803
|
-
children: equalSizeGroups([...monthsList], 3).map((monthList, index) => /* @__PURE__ */
|
|
7572
|
+
children: equalSizeGroups([...monthsList], 3).map((monthList, index) => /* @__PURE__ */ jsx6("div", { className: "flex-row-1", children: monthList.map((month) => {
|
|
7804
7573
|
const monthIndex = monthsList.indexOf(month);
|
|
7805
7574
|
const newDate = new Date(year, monthIndex);
|
|
7806
7575
|
const selectedMonth = selectedYear && monthIndex === displayedYearMonth.getMonth();
|
|
@@ -7809,8 +7578,8 @@ var YearMonthPicker = ({
|
|
|
7809
7578
|
const isAfterStart = start === void 0 || start <= addDuration(subtractDuration(lastOfMonth, { days: 1 }), { months: 1 });
|
|
7810
7579
|
const isBeforeEnd = end === void 0 || firstOfMonth <= end;
|
|
7811
7580
|
const isValid = isAfterStart && isBeforeEnd;
|
|
7812
|
-
return /* @__PURE__ */
|
|
7813
|
-
|
|
7581
|
+
return /* @__PURE__ */ jsx6(
|
|
7582
|
+
Button,
|
|
7814
7583
|
{
|
|
7815
7584
|
disabled: !isValid,
|
|
7816
7585
|
color: selectedMonth && isValid ? "primary" : "neutral",
|
|
@@ -7827,7 +7596,7 @@ var YearMonthPicker = ({
|
|
|
7827
7596
|
},
|
|
7828
7597
|
year
|
|
7829
7598
|
);
|
|
7830
|
-
}) })
|
|
7599
|
+
}) });
|
|
7831
7600
|
};
|
|
7832
7601
|
var YearMonthPickerUncontrolled = ({
|
|
7833
7602
|
displayedYearMonth,
|
|
@@ -7835,7 +7604,7 @@ var YearMonthPickerUncontrolled = ({
|
|
|
7835
7604
|
...props
|
|
7836
7605
|
}) => {
|
|
7837
7606
|
const [yearMonth, setYearMonth] = useOverwritableState(displayedYearMonth, onChange);
|
|
7838
|
-
return /* @__PURE__ */
|
|
7607
|
+
return /* @__PURE__ */ jsx6(
|
|
7839
7608
|
YearMonthPicker,
|
|
7840
7609
|
{
|
|
7841
7610
|
displayedYearMonth: yearMonth,
|
|
@@ -7845,39 +7614,8 @@ var YearMonthPickerUncontrolled = ({
|
|
|
7845
7614
|
);
|
|
7846
7615
|
};
|
|
7847
7616
|
|
|
7848
|
-
// src/i18n/useHightideTranslation.ts
|
|
7849
|
-
import { combineTranslation, ICUUtil } from "@helpwave/internationalization";
|
|
7850
|
-
function useICUTranslation(translations, locale) {
|
|
7851
|
-
translations = Array.isArray(translations) ? translations : [translations];
|
|
7852
|
-
return function translate(key, values) {
|
|
7853
|
-
try {
|
|
7854
|
-
for (let i = 0; i < translations.length; i++) {
|
|
7855
|
-
const localizedTranslation = translations[i][locale];
|
|
7856
|
-
if (!localizedTranslation) continue;
|
|
7857
|
-
const msg = localizedTranslation[key];
|
|
7858
|
-
if (typeof msg === "string") {
|
|
7859
|
-
return ICUUtil.interpret(msg, values);
|
|
7860
|
-
}
|
|
7861
|
-
}
|
|
7862
|
-
console.warn(`useTranslation: No translation for key "${key}" found.`);
|
|
7863
|
-
} catch (e) {
|
|
7864
|
-
console.error(`useTranslation: Error translating key "${String(key)}"`, e);
|
|
7865
|
-
}
|
|
7866
|
-
return `{{${String(locale)}:${String(key)}}}`;
|
|
7867
|
-
};
|
|
7868
|
-
}
|
|
7869
|
-
function useHightideTranslation(extensions, overwrites) {
|
|
7870
|
-
const { locale: inferredLocale } = useLocale();
|
|
7871
|
-
const locale = overwrites?.locale ?? inferredLocale;
|
|
7872
|
-
const translationExtensions = ArrayUtil.resolveSingleOrArray(extensions);
|
|
7873
|
-
return combineTranslation([
|
|
7874
|
-
...translationExtensions,
|
|
7875
|
-
hightideTranslation
|
|
7876
|
-
], locale);
|
|
7877
|
-
}
|
|
7878
|
-
|
|
7879
7617
|
// src/components/date/DatePicker.tsx
|
|
7880
|
-
import { jsx as
|
|
7618
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
7881
7619
|
var DatePicker = ({
|
|
7882
7620
|
value = /* @__PURE__ */ new Date(),
|
|
7883
7621
|
start = subtractDuration(/* @__PURE__ */ new Date(), { years: 50 }),
|
|
@@ -7889,55 +7627,67 @@ var DatePicker = ({
|
|
|
7889
7627
|
className = ""
|
|
7890
7628
|
}) => {
|
|
7891
7629
|
const { locale } = useLocale();
|
|
7892
|
-
const translation = useHightideTranslation();
|
|
7893
7630
|
const [displayedMonth, setDisplayedMonth] = useState5(value);
|
|
7894
7631
|
const [displayMode, setDisplayMode] = useState5(initialDisplay);
|
|
7895
7632
|
useEffect5(() => {
|
|
7896
7633
|
setDisplayedMonth(value);
|
|
7897
7634
|
}, [value]);
|
|
7898
|
-
return /* @__PURE__ */ jsxs6("div", { className: clsx7("flex-col-
|
|
7899
|
-
/* @__PURE__ */ jsxs6("div", { className: "flex-row-2 items-center justify-between
|
|
7635
|
+
return /* @__PURE__ */ jsxs6("div", { className: clsx7("flex-col-3", className), children: [
|
|
7636
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex-row-2 items-center justify-between", children: [
|
|
7900
7637
|
/* @__PURE__ */ jsxs6(
|
|
7901
|
-
|
|
7638
|
+
Button,
|
|
7902
7639
|
{
|
|
7640
|
+
size: "small",
|
|
7641
|
+
coloringStyle: "text",
|
|
7903
7642
|
className: clsx7("flex-row-1 items-center cursor-pointer select-none", {
|
|
7904
7643
|
"text-disabled": displayMode !== "day"
|
|
7905
7644
|
}),
|
|
7906
7645
|
onClick: () => setDisplayMode(displayMode === "day" ? "yearMonth" : "day"),
|
|
7907
7646
|
children: [
|
|
7908
7647
|
`${new Intl.DateTimeFormat(LocalizationUtil.localToLanguage(locale), { month: "long" }).format(displayedMonth)} ${displayedMonth.getFullYear()}`,
|
|
7909
|
-
/* @__PURE__ */
|
|
7648
|
+
/* @__PURE__ */ jsx7(ChevronDown2, { size: 16 })
|
|
7910
7649
|
]
|
|
7911
7650
|
}
|
|
7912
7651
|
),
|
|
7913
7652
|
displayMode === "day" && /* @__PURE__ */ jsxs6("div", { className: "flex-row-2 justify-end", children: [
|
|
7914
|
-
/* @__PURE__ */
|
|
7915
|
-
|
|
7653
|
+
/* @__PURE__ */ jsx7(
|
|
7654
|
+
Button,
|
|
7655
|
+
{
|
|
7656
|
+
size: "small",
|
|
7657
|
+
coloringStyle: "tonal",
|
|
7658
|
+
onClick: () => {
|
|
7659
|
+
const newDate = /* @__PURE__ */ new Date();
|
|
7660
|
+
newDate.setHours(value.getHours(), value.getMinutes());
|
|
7661
|
+
onChange(newDate);
|
|
7662
|
+
},
|
|
7663
|
+
children: /* @__PURE__ */ jsx7(Calendar, { className: "size-5" })
|
|
7664
|
+
}
|
|
7665
|
+
),
|
|
7666
|
+
/* @__PURE__ */ jsx7(
|
|
7667
|
+
Button,
|
|
7916
7668
|
{
|
|
7917
7669
|
size: "small",
|
|
7918
|
-
color: "primary",
|
|
7919
7670
|
disabled: !isInTimeSpan(subtractDuration(displayedMonth, { months: 1 }), start, end),
|
|
7920
7671
|
onClick: () => {
|
|
7921
7672
|
setDisplayedMonth(subtractDuration(displayedMonth, { months: 1 }));
|
|
7922
7673
|
},
|
|
7923
|
-
children: /* @__PURE__ */
|
|
7674
|
+
children: /* @__PURE__ */ jsx7(ArrowUp, { size: 20 })
|
|
7924
7675
|
}
|
|
7925
7676
|
),
|
|
7926
|
-
/* @__PURE__ */
|
|
7927
|
-
|
|
7677
|
+
/* @__PURE__ */ jsx7(
|
|
7678
|
+
Button,
|
|
7928
7679
|
{
|
|
7929
7680
|
size: "small",
|
|
7930
|
-
color: "primary",
|
|
7931
7681
|
disabled: !isInTimeSpan(addDuration(displayedMonth, { months: 1 }), start, end),
|
|
7932
7682
|
onClick: () => {
|
|
7933
7683
|
setDisplayedMonth(addDuration(displayedMonth, { months: 1 }));
|
|
7934
7684
|
},
|
|
7935
|
-
children: /* @__PURE__ */
|
|
7685
|
+
children: /* @__PURE__ */ jsx7(ArrowDown, { size: 20 })
|
|
7936
7686
|
}
|
|
7937
7687
|
)
|
|
7938
7688
|
] })
|
|
7939
7689
|
] }),
|
|
7940
|
-
displayMode === "yearMonth" ? /* @__PURE__ */
|
|
7690
|
+
displayMode === "yearMonth" ? /* @__PURE__ */ jsx7(
|
|
7941
7691
|
YearMonthPicker,
|
|
7942
7692
|
{
|
|
7943
7693
|
...yearMonthPickerProps,
|
|
@@ -7949,33 +7699,19 @@ var DatePicker = ({
|
|
|
7949
7699
|
setDisplayMode("day");
|
|
7950
7700
|
}
|
|
7951
7701
|
}
|
|
7952
|
-
) : /* @__PURE__ */
|
|
7953
|
-
|
|
7954
|
-
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
|
|
7958
|
-
|
|
7959
|
-
|
|
7960
|
-
|
|
7961
|
-
onChange
|
|
7962
|
-
onChange?.(date);
|
|
7963
|
-
}
|
|
7964
|
-
}
|
|
7965
|
-
),
|
|
7966
|
-
/* @__PURE__ */ jsx8("div", { className: "mt-2", children: /* @__PURE__ */ jsx8(
|
|
7967
|
-
TextButton,
|
|
7968
|
-
{
|
|
7969
|
-
color: "primary",
|
|
7970
|
-
onClick: () => {
|
|
7971
|
-
const newDate = /* @__PURE__ */ new Date();
|
|
7972
|
-
newDate.setHours(value.getHours(), value.getMinutes());
|
|
7973
|
-
onChange(newDate);
|
|
7974
|
-
},
|
|
7975
|
-
children: translation("time.today")
|
|
7702
|
+
) : /* @__PURE__ */ jsx7(
|
|
7703
|
+
DayPicker,
|
|
7704
|
+
{
|
|
7705
|
+
...dayPickerProps,
|
|
7706
|
+
displayedMonth,
|
|
7707
|
+
start,
|
|
7708
|
+
end,
|
|
7709
|
+
selected: value,
|
|
7710
|
+
onChange: (date) => {
|
|
7711
|
+
onChange?.(date);
|
|
7976
7712
|
}
|
|
7977
|
-
|
|
7978
|
-
|
|
7713
|
+
}
|
|
7714
|
+
)
|
|
7979
7715
|
] });
|
|
7980
7716
|
};
|
|
7981
7717
|
var DatePickerUncontrolled = ({
|
|
@@ -7984,7 +7720,7 @@ var DatePickerUncontrolled = ({
|
|
|
7984
7720
|
...props
|
|
7985
7721
|
}) => {
|
|
7986
7722
|
const [date, setDate] = useOverwritableState(value, onChange);
|
|
7987
|
-
return /* @__PURE__ */
|
|
7723
|
+
return /* @__PURE__ */ jsx7(
|
|
7988
7724
|
DatePicker,
|
|
7989
7725
|
{
|
|
7990
7726
|
...props,
|
|
@@ -7994,8 +7730,39 @@ var DatePickerUncontrolled = ({
|
|
|
7994
7730
|
);
|
|
7995
7731
|
};
|
|
7996
7732
|
|
|
7733
|
+
// src/i18n/useHightideTranslation.ts
|
|
7734
|
+
import { combineTranslation, ICUUtil } from "@helpwave/internationalization";
|
|
7735
|
+
function useICUTranslation(translations, locale) {
|
|
7736
|
+
translations = Array.isArray(translations) ? translations : [translations];
|
|
7737
|
+
return function translate(key, values) {
|
|
7738
|
+
try {
|
|
7739
|
+
for (let i = 0; i < translations.length; i++) {
|
|
7740
|
+
const localizedTranslation = translations[i][locale];
|
|
7741
|
+
if (!localizedTranslation) continue;
|
|
7742
|
+
const msg = localizedTranslation[key];
|
|
7743
|
+
if (typeof msg === "string") {
|
|
7744
|
+
return ICUUtil.interpret(msg, values);
|
|
7745
|
+
}
|
|
7746
|
+
}
|
|
7747
|
+
console.warn(`useTranslation: No translation for key "${key}" found.`);
|
|
7748
|
+
} catch (e) {
|
|
7749
|
+
console.error(`useTranslation: Error translating key "${String(key)}"`, e);
|
|
7750
|
+
}
|
|
7751
|
+
return `{{${String(locale)}:${String(key)}}}`;
|
|
7752
|
+
};
|
|
7753
|
+
}
|
|
7754
|
+
function useHightideTranslation(extensions, overwrites) {
|
|
7755
|
+
const { locale: inferredLocale } = useLocale();
|
|
7756
|
+
const locale = overwrites?.locale ?? inferredLocale;
|
|
7757
|
+
const translationExtensions = ArrayUtil.resolveSingleOrArray(extensions);
|
|
7758
|
+
return combineTranslation([
|
|
7759
|
+
...translationExtensions,
|
|
7760
|
+
hightideTranslation
|
|
7761
|
+
], locale);
|
|
7762
|
+
}
|
|
7763
|
+
|
|
7997
7764
|
// src/components/date/TimeDisplay.tsx
|
|
7998
|
-
import { jsx as
|
|
7765
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
7999
7766
|
var TimeDisplay = ({
|
|
8000
7767
|
date,
|
|
8001
7768
|
mode = "daysFromToday"
|
|
@@ -8032,26 +7799,25 @@ var TimeDisplay = ({
|
|
|
8032
7799
|
} else {
|
|
8033
7800
|
fullString = `${date.getDate()}. ${monthToTranslation[date.getMonth()]} ${date.getFullYear()}`;
|
|
8034
7801
|
}
|
|
8035
|
-
return /* @__PURE__ */
|
|
7802
|
+
return /* @__PURE__ */ jsx8("span", { children: fullString });
|
|
8036
7803
|
};
|
|
8037
7804
|
|
|
8038
7805
|
// src/components/date/TimePicker.tsx
|
|
8039
7806
|
import { useEffect as useEffect6, useRef as useRef2 } from "react";
|
|
8040
|
-
import { Scrollbars as Scrollbars2 } from "react-custom-scrollbars-2";
|
|
8041
7807
|
import clsx8 from "clsx";
|
|
8042
|
-
import { jsx as
|
|
7808
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
8043
7809
|
var TimePicker = ({
|
|
8044
7810
|
time = /* @__PURE__ */ new Date(),
|
|
8045
7811
|
onChange,
|
|
8046
7812
|
is24HourFormat = true,
|
|
8047
7813
|
minuteIncrement = "5min",
|
|
8048
|
-
maxHeight =
|
|
7814
|
+
maxHeight = 280,
|
|
8049
7815
|
className = ""
|
|
8050
7816
|
}) => {
|
|
8051
7817
|
const minuteRef = useRef2(null);
|
|
8052
7818
|
const hourRef = useRef2(null);
|
|
8053
7819
|
const isPM = time.getHours() >= 11;
|
|
8054
|
-
const hours = is24HourFormat ? range(24) : range(
|
|
7820
|
+
const hours = is24HourFormat ? range(24) : range(12);
|
|
8055
7821
|
let minutes = range(60);
|
|
8056
7822
|
useEffect6(() => {
|
|
8057
7823
|
const scrollToItem = () => {
|
|
@@ -8098,55 +7864,55 @@ var TimePicker = ({
|
|
|
8098
7864
|
break;
|
|
8099
7865
|
}
|
|
8100
7866
|
const closestMinute = closestMatch(minutes, (item1, item2) => Math.abs(item1 - time.getMinutes()) < Math.abs(item2 - time.getMinutes()));
|
|
8101
|
-
const style = (selected) => clsx8(
|
|
8102
|
-
"chip-full hover:brightness-90 hover:bg-primary hover:text-on-primary rounded-md mr-3",
|
|
8103
|
-
{ "bg-primary text-on-primary": selected, "bg-white text-black": !selected }
|
|
8104
|
-
);
|
|
8105
7867
|
const onChangeWrapper = (transformer) => {
|
|
8106
7868
|
const newDate = new Date(time);
|
|
8107
7869
|
transformer(newDate);
|
|
8108
7870
|
onChange?.(newDate);
|
|
8109
7871
|
};
|
|
8110
|
-
return /* @__PURE__ */ jsxs7("div", { className: clsx8("flex-row-2 w-fit min-w-[150px] select-none", className), children: [
|
|
8111
|
-
/* @__PURE__ */
|
|
8112
|
-
const
|
|
8113
|
-
return /* @__PURE__ */
|
|
8114
|
-
|
|
7872
|
+
return /* @__PURE__ */ jsxs7("div", { className: clsx8("flex-row-2 w-fit min-w-[150px] select-none overflow-hidden", className), children: [
|
|
7873
|
+
/* @__PURE__ */ jsx9("div", { className: "flex-col-1 h-full overflow-y-auto min-w-16", children: hours.map((hour) => {
|
|
7874
|
+
const isSelected = hour === time.getHours() - (!is24HourFormat && isPM ? 12 : 0);
|
|
7875
|
+
return /* @__PURE__ */ jsx9(
|
|
7876
|
+
Button,
|
|
8115
7877
|
{
|
|
8116
|
-
|
|
8117
|
-
|
|
7878
|
+
size: "small",
|
|
7879
|
+
color: isSelected ? "primary" : "neutral",
|
|
7880
|
+
ref: isSelected ? hourRef : void 0,
|
|
8118
7881
|
onClick: () => onChangeWrapper((newDate) => newDate.setHours(hour + (!is24HourFormat && isPM ? 12 : 0))),
|
|
8119
7882
|
children: hour.toString().padStart(2, "0")
|
|
8120
7883
|
},
|
|
8121
7884
|
hour
|
|
8122
7885
|
);
|
|
8123
|
-
}) })
|
|
8124
|
-
/* @__PURE__ */
|
|
8125
|
-
const
|
|
8126
|
-
return /* @__PURE__ */
|
|
8127
|
-
|
|
7886
|
+
}) }),
|
|
7887
|
+
/* @__PURE__ */ jsx9("div", { className: "flex-col-1 h-full overflow-y-auto min-w-16", children: minutes.map((minute) => {
|
|
7888
|
+
const isSelected = minute === closestMinute;
|
|
7889
|
+
return /* @__PURE__ */ jsx9(
|
|
7890
|
+
Button,
|
|
8128
7891
|
{
|
|
8129
|
-
|
|
8130
|
-
|
|
7892
|
+
size: "small",
|
|
7893
|
+
color: isSelected ? "primary" : "neutral",
|
|
7894
|
+
ref: isSelected ? minuteRef : void 0,
|
|
8131
7895
|
onClick: () => onChangeWrapper((newDate) => newDate.setMinutes(minute)),
|
|
8132
7896
|
children: minute.toString().padStart(2, "0")
|
|
8133
7897
|
},
|
|
8134
7898
|
minute + minuteIncrement
|
|
8135
7899
|
);
|
|
8136
|
-
}) })
|
|
8137
|
-
!is24HourFormat && /* @__PURE__ */ jsxs7("div", { className: "flex-col-1", children: [
|
|
8138
|
-
/* @__PURE__ */
|
|
8139
|
-
|
|
7900
|
+
}) }),
|
|
7901
|
+
!is24HourFormat && /* @__PURE__ */ jsxs7("div", { className: "flex-col-1 min-w-16", children: [
|
|
7902
|
+
/* @__PURE__ */ jsx9(
|
|
7903
|
+
Button,
|
|
8140
7904
|
{
|
|
8141
|
-
|
|
7905
|
+
size: "small",
|
|
7906
|
+
color: !isPM ? "primary" : "neutral",
|
|
8142
7907
|
onClick: () => onChangeWrapper((newDate) => isPM && newDate.setHours(newDate.getHours() - 12)),
|
|
8143
7908
|
children: "AM"
|
|
8144
7909
|
}
|
|
8145
7910
|
),
|
|
8146
|
-
/* @__PURE__ */
|
|
8147
|
-
|
|
7911
|
+
/* @__PURE__ */ jsx9(
|
|
7912
|
+
Button,
|
|
8148
7913
|
{
|
|
8149
|
-
|
|
7914
|
+
size: "small",
|
|
7915
|
+
color: isPM ? "primary" : "neutral",
|
|
8150
7916
|
onClick: () => onChangeWrapper((newDate) => !isPM && newDate.setHours(newDate.getHours() + 12)),
|
|
8151
7917
|
children: "PM"
|
|
8152
7918
|
}
|
|
@@ -8160,7 +7926,7 @@ var TimePickerUncontrolled = ({
|
|
|
8160
7926
|
...props
|
|
8161
7927
|
}) => {
|
|
8162
7928
|
const [value, setValue] = useOverwritableState(time, onChange);
|
|
8163
|
-
return /* @__PURE__ */
|
|
7929
|
+
return /* @__PURE__ */ jsx9(
|
|
8164
7930
|
TimePicker,
|
|
8165
7931
|
{
|
|
8166
7932
|
...props,
|
|
@@ -8175,7 +7941,7 @@ import clsx10 from "clsx";
|
|
|
8175
7941
|
|
|
8176
7942
|
// src/components/dialog/Dialog.tsx
|
|
8177
7943
|
import { useId as useId3 } from "react";
|
|
8178
|
-
import { useEffect as
|
|
7944
|
+
import { useEffect as useEffect11, useRef as useRef4, useState as useState10 } from "react";
|
|
8179
7945
|
import clsx9 from "clsx";
|
|
8180
7946
|
import { X } from "lucide-react";
|
|
8181
7947
|
|
|
@@ -8412,7 +8178,58 @@ var useLogOnce = (message, condition, options) => {
|
|
|
8412
8178
|
|
|
8413
8179
|
// src/components/dialog/Dialog.tsx
|
|
8414
8180
|
import { createPortal } from "react-dom";
|
|
8415
|
-
|
|
8181
|
+
|
|
8182
|
+
// src/hooks/useZIndexRegister.ts
|
|
8183
|
+
import { useEffect as useEffect10, useMemo as useMemo2, useState as useState9 } from "react";
|
|
8184
|
+
var ZIndexRegistry = class _ZIndexRegistry {
|
|
8185
|
+
constructor() {
|
|
8186
|
+
this.listeners = /* @__PURE__ */ new Set();
|
|
8187
|
+
}
|
|
8188
|
+
static {
|
|
8189
|
+
this.instance = null;
|
|
8190
|
+
}
|
|
8191
|
+
static getInstance() {
|
|
8192
|
+
if (!_ZIndexRegistry.instance) {
|
|
8193
|
+
_ZIndexRegistry.instance = new _ZIndexRegistry();
|
|
8194
|
+
}
|
|
8195
|
+
return _ZIndexRegistry.instance;
|
|
8196
|
+
}
|
|
8197
|
+
register(callback) {
|
|
8198
|
+
this.listeners.add(callback);
|
|
8199
|
+
this.notify();
|
|
8200
|
+
}
|
|
8201
|
+
deregister(callback) {
|
|
8202
|
+
this.listeners.delete(callback);
|
|
8203
|
+
this.notify();
|
|
8204
|
+
}
|
|
8205
|
+
notify() {
|
|
8206
|
+
let i = 100;
|
|
8207
|
+
for (const callback of this.listeners) {
|
|
8208
|
+
callback(i++);
|
|
8209
|
+
}
|
|
8210
|
+
}
|
|
8211
|
+
};
|
|
8212
|
+
function useZIndexRegister(isActive) {
|
|
8213
|
+
const [zIndex, setZIndex] = useState9(0);
|
|
8214
|
+
const zIndexRegistry = useMemo2(() => ZIndexRegistry.getInstance(), []);
|
|
8215
|
+
useEffect10(() => {
|
|
8216
|
+
if (!isActive) {
|
|
8217
|
+
return;
|
|
8218
|
+
}
|
|
8219
|
+
function callback(zIndex2) {
|
|
8220
|
+
setZIndex(zIndex2);
|
|
8221
|
+
}
|
|
8222
|
+
zIndexRegistry.register(callback);
|
|
8223
|
+
return () => {
|
|
8224
|
+
zIndexRegistry.deregister(callback);
|
|
8225
|
+
setZIndex(0);
|
|
8226
|
+
};
|
|
8227
|
+
}, [isActive, zIndexRegistry]);
|
|
8228
|
+
return zIndex;
|
|
8229
|
+
}
|
|
8230
|
+
|
|
8231
|
+
// src/components/dialog/Dialog.tsx
|
|
8232
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
8416
8233
|
var Dialog = ({
|
|
8417
8234
|
children,
|
|
8418
8235
|
isOpen,
|
|
@@ -8427,11 +8244,11 @@ var Dialog = ({
|
|
|
8427
8244
|
...props
|
|
8428
8245
|
}) => {
|
|
8429
8246
|
const translation = useHightideTranslation();
|
|
8430
|
-
const [visible, setVisible] =
|
|
8247
|
+
const [visible, setVisible] = useState10(isOpen);
|
|
8431
8248
|
const generatedId = useId3();
|
|
8432
8249
|
const id = props.id ?? generatedId;
|
|
8433
8250
|
const ref = useRef4(null);
|
|
8434
|
-
|
|
8251
|
+
useEffect11(() => {
|
|
8435
8252
|
if (isOpen) {
|
|
8436
8253
|
setVisible(true);
|
|
8437
8254
|
} else {
|
|
@@ -8450,6 +8267,7 @@ var Dialog = ({
|
|
|
8450
8267
|
active: visible,
|
|
8451
8268
|
focusFirst: true
|
|
8452
8269
|
});
|
|
8270
|
+
const zIndex = useZIndexRegister(isOpen);
|
|
8453
8271
|
const positionMap = {
|
|
8454
8272
|
top: "fixed top-8 left-1/2 -translate-x-1/2",
|
|
8455
8273
|
center: "fixed left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2",
|
|
@@ -8458,89 +8276,98 @@ var Dialog = ({
|
|
|
8458
8276
|
const positionStyle = positionMap[position];
|
|
8459
8277
|
if (!visible) return;
|
|
8460
8278
|
return createPortal(
|
|
8461
|
-
/* @__PURE__ */ jsxs8(
|
|
8462
|
-
|
|
8463
|
-
|
|
8464
|
-
{
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8279
|
+
/* @__PURE__ */ jsxs8(
|
|
8280
|
+
"div",
|
|
8281
|
+
{
|
|
8282
|
+
id: `dialog-container-${id}`,
|
|
8283
|
+
className: clsx9("fixed inset-0 h-screen w-screen", containerClassName),
|
|
8284
|
+
style: { zIndex },
|
|
8285
|
+
children: [
|
|
8286
|
+
/* @__PURE__ */ jsx10(
|
|
8287
|
+
"div",
|
|
8469
8288
|
{
|
|
8470
|
-
|
|
8471
|
-
|
|
8472
|
-
|
|
8473
|
-
|
|
8474
|
-
|
|
8475
|
-
|
|
8476
|
-
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
|
|
8480
|
-
|
|
8481
|
-
|
|
8482
|
-
|
|
8483
|
-
|
|
8484
|
-
|
|
8485
|
-
|
|
8486
|
-
|
|
8487
|
-
...props,
|
|
8488
|
-
id: `dialog-${id}`,
|
|
8489
|
-
ref,
|
|
8490
|
-
hidden: !visible,
|
|
8491
|
-
onKeyDown: (event) => {
|
|
8492
|
-
if (event.key === "Escape") {
|
|
8493
|
-
onCloseWrapper();
|
|
8494
|
-
}
|
|
8495
|
-
},
|
|
8496
|
-
onAnimationEnd: () => {
|
|
8497
|
-
if (!isOpen) {
|
|
8498
|
-
setVisible(false);
|
|
8289
|
+
id: `dialog-background-${id}`,
|
|
8290
|
+
hidden: !visible,
|
|
8291
|
+
className: clsx9(
|
|
8292
|
+
"fixed inset-0 h-screen w-screen bg-overlay-shadow",
|
|
8293
|
+
{
|
|
8294
|
+
"motion-safe:animate-fade-in": isOpen,
|
|
8295
|
+
"motion-safe:animate-fade-out": !isOpen
|
|
8296
|
+
},
|
|
8297
|
+
backgroundClassName
|
|
8298
|
+
),
|
|
8299
|
+
onAnimationEnd: () => {
|
|
8300
|
+
if (!isOpen) {
|
|
8301
|
+
setVisible(false);
|
|
8302
|
+
}
|
|
8303
|
+
},
|
|
8304
|
+
onClick: onCloseWrapper,
|
|
8305
|
+
"aria-hidden": true
|
|
8499
8306
|
}
|
|
8500
|
-
},
|
|
8501
|
-
className: clsx9(
|
|
8502
|
-
"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)]",
|
|
8503
|
-
{
|
|
8504
|
-
"motion-safe:animate-pop-in": isOpen,
|
|
8505
|
-
"motion-safe:animate-pop-out": !isOpen
|
|
8506
|
-
},
|
|
8507
|
-
positionStyle,
|
|
8508
|
-
props.className
|
|
8509
8307
|
),
|
|
8510
|
-
|
|
8511
|
-
|
|
8512
|
-
|
|
8513
|
-
|
|
8514
|
-
|
|
8515
|
-
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
|
|
8308
|
+
/* @__PURE__ */ jsxs8(
|
|
8309
|
+
"div",
|
|
8310
|
+
{
|
|
8311
|
+
...props,
|
|
8312
|
+
id: `dialog-${id}`,
|
|
8313
|
+
ref,
|
|
8314
|
+
hidden: !visible,
|
|
8315
|
+
onKeyDown: (event) => {
|
|
8316
|
+
if (event.key === "Escape") {
|
|
8317
|
+
onCloseWrapper();
|
|
8318
|
+
}
|
|
8319
|
+
},
|
|
8320
|
+
onAnimationEnd: () => {
|
|
8321
|
+
if (!isOpen) {
|
|
8322
|
+
setVisible(false);
|
|
8323
|
+
}
|
|
8324
|
+
},
|
|
8325
|
+
className: clsx9(
|
|
8326
|
+
"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)]",
|
|
8327
|
+
{
|
|
8328
|
+
"motion-safe:animate-pop-in": isOpen,
|
|
8329
|
+
"motion-safe:animate-pop-out": !isOpen
|
|
8520
8330
|
},
|
|
8521
|
-
|
|
8522
|
-
|
|
8331
|
+
positionStyle,
|
|
8332
|
+
props.className
|
|
8333
|
+
),
|
|
8334
|
+
children: [
|
|
8335
|
+
/* @__PURE__ */ jsx10("div", { className: "typography-title-lg mr-8", children: titleElement }),
|
|
8336
|
+
description && /* @__PURE__ */ jsx10("div", { className: "text-description", children: description }),
|
|
8337
|
+
isModal && /* @__PURE__ */ jsx10(
|
|
8338
|
+
"div",
|
|
8523
8339
|
{
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
|
|
8340
|
+
className: "absolute top-0 right-0",
|
|
8341
|
+
style: {
|
|
8342
|
+
paddingTop: "inherit",
|
|
8343
|
+
paddingRight: "inherit"
|
|
8344
|
+
},
|
|
8345
|
+
children: /* @__PURE__ */ jsx10(
|
|
8346
|
+
Button,
|
|
8347
|
+
{
|
|
8348
|
+
layout: "icon",
|
|
8349
|
+
color: "neutral",
|
|
8350
|
+
size: "tiny",
|
|
8351
|
+
"aria-label": translation("close"),
|
|
8352
|
+
onClick: onCloseWrapper,
|
|
8353
|
+
children: /* @__PURE__ */ jsx10(X, {})
|
|
8354
|
+
}
|
|
8355
|
+
)
|
|
8529
8356
|
}
|
|
8530
|
-
)
|
|
8531
|
-
|
|
8532
|
-
|
|
8533
|
-
|
|
8534
|
-
|
|
8535
|
-
|
|
8536
|
-
|
|
8537
|
-
|
|
8357
|
+
),
|
|
8358
|
+
children
|
|
8359
|
+
]
|
|
8360
|
+
}
|
|
8361
|
+
)
|
|
8362
|
+
]
|
|
8363
|
+
}
|
|
8364
|
+
),
|
|
8538
8365
|
document.body
|
|
8539
8366
|
);
|
|
8540
8367
|
};
|
|
8541
8368
|
|
|
8542
8369
|
// src/components/dialog/ConfirmDialog.tsx
|
|
8543
|
-
import { jsx as
|
|
8370
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
8544
8371
|
var ConfirmDialog = ({
|
|
8545
8372
|
children,
|
|
8546
8373
|
onCancel,
|
|
@@ -8559,10 +8386,10 @@ var ConfirmDialog = ({
|
|
|
8559
8386
|
primary: "primary"
|
|
8560
8387
|
};
|
|
8561
8388
|
return /* @__PURE__ */ jsxs9(Dialog, { ...restProps, onClose: onCancel, className: clsx10("justify-between", className), children: [
|
|
8562
|
-
/* @__PURE__ */
|
|
8389
|
+
/* @__PURE__ */ jsx11("div", { className: "flex-col-2 grow", children }),
|
|
8563
8390
|
/* @__PURE__ */ jsxs9("div", { className: "flex-row-4 mt-3 justify-end", children: [
|
|
8564
|
-
onCancel && /* @__PURE__ */
|
|
8565
|
-
|
|
8391
|
+
onCancel && /* @__PURE__ */ jsx11(
|
|
8392
|
+
Button,
|
|
8566
8393
|
{
|
|
8567
8394
|
color: buttonOverwrites?.[0].color ?? "neutral",
|
|
8568
8395
|
onClick: onCancel,
|
|
@@ -8570,8 +8397,8 @@ var ConfirmDialog = ({
|
|
|
8570
8397
|
children: buttonOverwrites?.[0].text ?? translation("cancel")
|
|
8571
8398
|
}
|
|
8572
8399
|
),
|
|
8573
|
-
onDecline && /* @__PURE__ */
|
|
8574
|
-
|
|
8400
|
+
onDecline && /* @__PURE__ */ jsx11(
|
|
8401
|
+
Button,
|
|
8575
8402
|
{
|
|
8576
8403
|
color: buttonOverwrites?.[1].color ?? "negative",
|
|
8577
8404
|
onClick: onDecline,
|
|
@@ -8579,8 +8406,8 @@ var ConfirmDialog = ({
|
|
|
8579
8406
|
children: buttonOverwrites?.[1].text ?? translation("decline")
|
|
8580
8407
|
}
|
|
8581
8408
|
),
|
|
8582
|
-
/* @__PURE__ */
|
|
8583
|
-
|
|
8409
|
+
/* @__PURE__ */ jsx11(
|
|
8410
|
+
Button,
|
|
8584
8411
|
{
|
|
8585
8412
|
color: buttonOverwrites?.[2].color ?? mapping[confirmType],
|
|
8586
8413
|
onClick: onConfirm,
|
|
@@ -8593,7 +8420,7 @@ var ConfirmDialog = ({
|
|
|
8593
8420
|
};
|
|
8594
8421
|
|
|
8595
8422
|
// src/components/dialog/DiscardChangesDialog.tsx
|
|
8596
|
-
import { jsx as
|
|
8423
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
8597
8424
|
var DiscardChangesDialog = ({
|
|
8598
8425
|
children,
|
|
8599
8426
|
onCancel,
|
|
@@ -8604,7 +8431,7 @@ var DiscardChangesDialog = ({
|
|
|
8604
8431
|
...props
|
|
8605
8432
|
}) => {
|
|
8606
8433
|
const translation = useHightideTranslation();
|
|
8607
|
-
return /* @__PURE__ */
|
|
8434
|
+
return /* @__PURE__ */ jsx12(
|
|
8608
8435
|
ConfirmDialog,
|
|
8609
8436
|
{
|
|
8610
8437
|
...props,
|
|
@@ -8624,13 +8451,13 @@ import { forwardRef as forwardRef3, useImperativeHandle, useRef as useRef5 } fro
|
|
|
8624
8451
|
import clsx11 from "clsx";
|
|
8625
8452
|
|
|
8626
8453
|
// src/hooks/useDelay.ts
|
|
8627
|
-
import { useEffect as
|
|
8454
|
+
import { useEffect as useEffect12, useState as useState11 } from "react";
|
|
8628
8455
|
var defaultOptions2 = {
|
|
8629
8456
|
delay: 3e3,
|
|
8630
8457
|
disabled: false
|
|
8631
8458
|
};
|
|
8632
8459
|
function useDelay(options) {
|
|
8633
|
-
const [timer, setTimer] =
|
|
8460
|
+
const [timer, setTimer] = useState11(void 0);
|
|
8634
8461
|
const { delay, disabled } = {
|
|
8635
8462
|
...defaultOptions2,
|
|
8636
8463
|
...options
|
|
@@ -8649,12 +8476,12 @@ function useDelay(options) {
|
|
|
8649
8476
|
setTimer(void 0);
|
|
8650
8477
|
}, delay));
|
|
8651
8478
|
};
|
|
8652
|
-
|
|
8479
|
+
useEffect12(() => {
|
|
8653
8480
|
return () => {
|
|
8654
8481
|
clearTimeout(timer);
|
|
8655
8482
|
};
|
|
8656
8483
|
}, [timer]);
|
|
8657
|
-
|
|
8484
|
+
useEffect12(() => {
|
|
8658
8485
|
if (disabled) {
|
|
8659
8486
|
clearTimeout(timer);
|
|
8660
8487
|
setTimer(void 0);
|
|
@@ -8721,7 +8548,7 @@ function useFocusManagement() {
|
|
|
8721
8548
|
}
|
|
8722
8549
|
|
|
8723
8550
|
// src/components/user-action/input/Input.tsx
|
|
8724
|
-
import { jsx as
|
|
8551
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
8725
8552
|
var defaultEditCompleteOptions = {
|
|
8726
8553
|
allowEnterComplete: false,
|
|
8727
8554
|
onBlur: true,
|
|
@@ -8753,7 +8580,7 @@ var Input = forwardRef3(function Input2({
|
|
|
8753
8580
|
const innerRef = useRef5(null);
|
|
8754
8581
|
useImperativeHandle(forwardedRef, () => innerRef.current);
|
|
8755
8582
|
const { focusNext } = useFocusManagement();
|
|
8756
|
-
return /* @__PURE__ */
|
|
8583
|
+
return /* @__PURE__ */ jsx13(
|
|
8757
8584
|
"input",
|
|
8758
8585
|
{
|
|
8759
8586
|
...props,
|
|
@@ -8808,7 +8635,7 @@ var InputUncontrolled = ({
|
|
|
8808
8635
|
...props
|
|
8809
8636
|
}) => {
|
|
8810
8637
|
const [usedValue, setUsedValue] = useOverwritableState(value, onChangeText);
|
|
8811
|
-
return /* @__PURE__ */
|
|
8638
|
+
return /* @__PURE__ */ jsx13(
|
|
8812
8639
|
Input,
|
|
8813
8640
|
{
|
|
8814
8641
|
...props,
|
|
@@ -8819,34 +8646,34 @@ var InputUncontrolled = ({
|
|
|
8819
8646
|
};
|
|
8820
8647
|
|
|
8821
8648
|
// src/components/dialog/InputDialog.tsx
|
|
8822
|
-
import { jsx as
|
|
8649
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
8823
8650
|
var InputDialog = ({
|
|
8824
8651
|
inputs,
|
|
8825
8652
|
buttonOverwrites,
|
|
8826
8653
|
...props
|
|
8827
8654
|
}) => {
|
|
8828
|
-
return /* @__PURE__ */
|
|
8655
|
+
return /* @__PURE__ */ jsx14(
|
|
8829
8656
|
ConfirmDialog,
|
|
8830
8657
|
{
|
|
8831
8658
|
buttonOverwrites,
|
|
8832
8659
|
...props,
|
|
8833
|
-
children: inputs.map((inputProps, index) => /* @__PURE__ */
|
|
8660
|
+
children: inputs.map((inputProps, index) => /* @__PURE__ */ jsx14(Input, { ...inputProps }, `input ${index}`))
|
|
8834
8661
|
}
|
|
8835
8662
|
);
|
|
8836
8663
|
};
|
|
8837
8664
|
|
|
8838
|
-
// src/components/user-action/
|
|
8665
|
+
// src/components/user-action/Select.tsx
|
|
8839
8666
|
import {
|
|
8840
8667
|
createContext as createContext2,
|
|
8841
8668
|
forwardRef as forwardRef4,
|
|
8842
8669
|
useCallback as useCallback6,
|
|
8843
8670
|
useContext as useContext2,
|
|
8844
|
-
useEffect as
|
|
8671
|
+
useEffect as useEffect14,
|
|
8845
8672
|
useId as useId4,
|
|
8846
8673
|
useImperativeHandle as useImperativeHandle2,
|
|
8847
|
-
useMemo as
|
|
8674
|
+
useMemo as useMemo3,
|
|
8848
8675
|
useRef as useRef6,
|
|
8849
|
-
useState as
|
|
8676
|
+
useState as useState13
|
|
8850
8677
|
} from "react";
|
|
8851
8678
|
import clsx13 from "clsx";
|
|
8852
8679
|
|
|
@@ -8855,61 +8682,37 @@ var match = (key, values) => {
|
|
|
8855
8682
|
return values[key];
|
|
8856
8683
|
};
|
|
8857
8684
|
|
|
8858
|
-
// src/components/user-action/
|
|
8685
|
+
// src/components/user-action/Select.tsx
|
|
8859
8686
|
import { CheckIcon, Plus, XIcon } from "lucide-react";
|
|
8860
8687
|
|
|
8861
8688
|
// src/components/layout/Chip.tsx
|
|
8862
8689
|
import clsx12 from "clsx";
|
|
8863
|
-
import { jsx as
|
|
8864
|
-
var chipColors =
|
|
8690
|
+
import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
8691
|
+
var chipColors = ButtonUtil.colors;
|
|
8865
8692
|
var ChipUtil = {
|
|
8866
8693
|
colors: chipColors
|
|
8867
8694
|
};
|
|
8868
8695
|
var Chip = ({
|
|
8869
8696
|
children,
|
|
8870
8697
|
trailingIcon,
|
|
8871
|
-
color = "
|
|
8872
|
-
size = "
|
|
8873
|
-
icon = false,
|
|
8698
|
+
color = "neutral",
|
|
8699
|
+
size = "medium",
|
|
8874
8700
|
variant = "normal",
|
|
8875
8701
|
className = "",
|
|
8876
8702
|
...restProps
|
|
8877
8703
|
}) => {
|
|
8878
|
-
const colorMapping =
|
|
8879
|
-
default: "text-tag-default-text bg-tag-default-background",
|
|
8880
|
-
dark: "text-tag-dark-text bg-tag-dark-background",
|
|
8881
|
-
red: "text-tag-red-text bg-tag-red-background",
|
|
8882
|
-
yellow: "text-tag-yellow-text bg-tag-yellow-background",
|
|
8883
|
-
green: "text-tag-green-text bg-tag-green-background",
|
|
8884
|
-
blue: "text-tag-blue-text bg-tag-blue-background",
|
|
8885
|
-
pink: "text-tag-pink-text bg-tag-pink-background",
|
|
8886
|
-
orange: "text-tag-orange-text bg-tag-orange-background"
|
|
8887
|
-
}[color];
|
|
8888
|
-
const colorMappingIcon = {
|
|
8889
|
-
default: "text-tag-default-icon",
|
|
8890
|
-
dark: "text-tag-dark-icon",
|
|
8891
|
-
red: "text-tag-red-icon",
|
|
8892
|
-
yellow: "text-tag-yellow-icon",
|
|
8893
|
-
green: "text-tag-green-icon",
|
|
8894
|
-
blue: "text-tag-blue-icon",
|
|
8895
|
-
pink: "text-tag-pink-icon",
|
|
8896
|
-
orange: "text-tag-orange-icon"
|
|
8897
|
-
}[color];
|
|
8704
|
+
const colorMapping = ButtonUtil.colorClasses[color];
|
|
8898
8705
|
return /* @__PURE__ */ jsxs10(
|
|
8899
8706
|
"div",
|
|
8900
8707
|
{
|
|
8901
8708
|
...restProps,
|
|
8902
8709
|
className: clsx12(
|
|
8903
|
-
`flex-row-0 w-fit font-semibold`,
|
|
8710
|
+
`flex-row-0 w-fit font-semibold coloring-solid`,
|
|
8904
8711
|
colorMapping,
|
|
8905
|
-
|
|
8906
|
-
"
|
|
8907
|
-
"
|
|
8908
|
-
"
|
|
8909
|
-
} : {
|
|
8910
|
-
"p-0.5": size === "sm",
|
|
8911
|
-
"p-1": size === "md",
|
|
8912
|
-
"p-2": size === "lg"
|
|
8712
|
+
{
|
|
8713
|
+
"chip-sm": size === "small",
|
|
8714
|
+
"chip-md": size === "medium",
|
|
8715
|
+
"chip-lg": size === "large"
|
|
8913
8716
|
},
|
|
8914
8717
|
{
|
|
8915
8718
|
"rounded-md": variant === "normal",
|
|
@@ -8919,7 +8722,7 @@ var Chip = ({
|
|
|
8919
8722
|
),
|
|
8920
8723
|
children: [
|
|
8921
8724
|
children,
|
|
8922
|
-
trailingIcon
|
|
8725
|
+
trailingIcon
|
|
8923
8726
|
]
|
|
8924
8727
|
}
|
|
8925
8728
|
);
|
|
@@ -8928,12 +8731,12 @@ var ChipList = ({
|
|
|
8928
8731
|
list,
|
|
8929
8732
|
className = ""
|
|
8930
8733
|
}) => {
|
|
8931
|
-
return /* @__PURE__ */
|
|
8734
|
+
return /* @__PURE__ */ jsx15("div", { className: clsx12("flex flex-wrap gap-x-2 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ jsx15(
|
|
8932
8735
|
Chip,
|
|
8933
8736
|
{
|
|
8934
8737
|
...value,
|
|
8935
|
-
color: value.color
|
|
8936
|
-
variant: value.variant
|
|
8738
|
+
color: value.color,
|
|
8739
|
+
variant: value.variant,
|
|
8937
8740
|
children: value.children
|
|
8938
8741
|
},
|
|
8939
8742
|
index
|
|
@@ -8941,7 +8744,7 @@ var ChipList = ({
|
|
|
8941
8744
|
};
|
|
8942
8745
|
|
|
8943
8746
|
// src/hooks/useFloatingElement.ts
|
|
8944
|
-
import { useCallback as useCallback5, useEffect as
|
|
8747
|
+
import { useCallback as useCallback5, useEffect as useEffect13, useState as useState12 } from "react";
|
|
8945
8748
|
|
|
8946
8749
|
// src/utils/math.ts
|
|
8947
8750
|
var clamp = (value, range2 = [0, 1]) => {
|
|
@@ -9004,7 +8807,7 @@ function useFloatingElement({
|
|
|
9004
8807
|
screenPadding = 16,
|
|
9005
8808
|
gap = 4
|
|
9006
8809
|
}) {
|
|
9007
|
-
const [style, setStyle] =
|
|
8810
|
+
const [style, setStyle] = useState12();
|
|
9008
8811
|
const isMounted = useIsMounted();
|
|
9009
8812
|
const calculate = useCallback5(() => {
|
|
9010
8813
|
const containerRect = containerRef.current.getBoundingClientRect();
|
|
@@ -9036,14 +8839,14 @@ function useFloatingElement({
|
|
|
9036
8839
|
}, [anchorRef, containerRef, gap, horizontalAlignment, screenPadding, verticalAlignment, windowRef]);
|
|
9037
8840
|
const height = containerRef.current?.getBoundingClientRect().height;
|
|
9038
8841
|
const width = containerRef.current?.getBoundingClientRect().width;
|
|
9039
|
-
|
|
8842
|
+
useEffect13(() => {
|
|
9040
8843
|
if (active && isMounted) {
|
|
9041
8844
|
calculate();
|
|
9042
8845
|
} else {
|
|
9043
8846
|
setStyle(void 0);
|
|
9044
8847
|
}
|
|
9045
8848
|
}, [calculate, active, isMounted, height, width]);
|
|
9046
|
-
|
|
8849
|
+
useEffect13(() => {
|
|
9047
8850
|
window.addEventListener("resize", calculate);
|
|
9048
8851
|
let timeout;
|
|
9049
8852
|
if (isPolling) {
|
|
@@ -9059,9 +8862,9 @@ function useFloatingElement({
|
|
|
9059
8862
|
return style;
|
|
9060
8863
|
}
|
|
9061
8864
|
|
|
9062
|
-
// src/components/user-action/
|
|
8865
|
+
// src/components/user-action/Select.tsx
|
|
9063
8866
|
import { createPortal as createPortal2 } from "react-dom";
|
|
9064
|
-
import { jsx as
|
|
8867
|
+
import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
9065
8868
|
var defaultToggleOpenOptions = {
|
|
9066
8869
|
highlightStartPositionBehavior: "first"
|
|
9067
8870
|
};
|
|
@@ -9089,15 +8892,15 @@ var SelectRoot = ({
|
|
|
9089
8892
|
const triggerRef = useRef6(null);
|
|
9090
8893
|
const generatedId = useId4();
|
|
9091
8894
|
const usedId = id ?? generatedId;
|
|
9092
|
-
const [internalState, setInternalState] =
|
|
8895
|
+
const [internalState, setInternalState] = useState13({
|
|
9093
8896
|
isOpen,
|
|
9094
8897
|
options: []
|
|
9095
8898
|
});
|
|
9096
|
-
const selectedValues =
|
|
8899
|
+
const selectedValues = useMemo3(
|
|
9097
8900
|
() => isMultiSelect ? values ?? [] : [value].filter(Boolean),
|
|
9098
8901
|
[isMultiSelect, value, values]
|
|
9099
8902
|
);
|
|
9100
|
-
const selectedOptions =
|
|
8903
|
+
const selectedOptions = useMemo3(
|
|
9101
8904
|
() => selectedValues.map((value2) => internalState.options.find((option) => value2 === option.value)).filter(Boolean),
|
|
9102
8905
|
[selectedValues, internalState.options]
|
|
9103
8906
|
);
|
|
@@ -9226,7 +9029,7 @@ var SelectRoot = ({
|
|
|
9226
9029
|
highlightedValue
|
|
9227
9030
|
}));
|
|
9228
9031
|
};
|
|
9229
|
-
|
|
9032
|
+
useEffect14(() => {
|
|
9230
9033
|
if (!internalState.highlightedValue) return;
|
|
9231
9034
|
const highlighted = internalState.options.find((value2) => value2.value === internalState.highlightedValue);
|
|
9232
9035
|
if (highlighted) {
|
|
@@ -9252,7 +9055,7 @@ var SelectRoot = ({
|
|
|
9252
9055
|
toggleOpen
|
|
9253
9056
|
}
|
|
9254
9057
|
};
|
|
9255
|
-
return /* @__PURE__ */
|
|
9058
|
+
return /* @__PURE__ */ jsx16(SelectContext.Provider, { value: contextValue, children });
|
|
9256
9059
|
};
|
|
9257
9060
|
var SelectOption = forwardRef4(
|
|
9258
9061
|
function SelectOption2({ children, value, disabled = false, iconAppearance, className, ...restProps }, ref) {
|
|
@@ -9261,7 +9064,7 @@ var SelectOption = forwardRef4(
|
|
|
9261
9064
|
const itemRef = useRef6(null);
|
|
9262
9065
|
iconAppearance ??= config.iconAppearance;
|
|
9263
9066
|
const label = children ?? value;
|
|
9264
|
-
|
|
9067
|
+
useEffect14(() => {
|
|
9265
9068
|
register({
|
|
9266
9069
|
value,
|
|
9267
9070
|
label,
|
|
@@ -9311,7 +9114,7 @@ var SelectOption = forwardRef4(
|
|
|
9311
9114
|
}
|
|
9312
9115
|
},
|
|
9313
9116
|
children: [
|
|
9314
|
-
iconAppearance === "left" && /* @__PURE__ */
|
|
9117
|
+
iconAppearance === "left" && (state.value.length > 0 || config.isMultiSelect) && /* @__PURE__ */ jsx16(
|
|
9315
9118
|
CheckIcon,
|
|
9316
9119
|
{
|
|
9317
9120
|
className: clsx13("w-4 h-4", { "opacity-0": !isSelected || disabled }),
|
|
@@ -9319,7 +9122,7 @@ var SelectOption = forwardRef4(
|
|
|
9319
9122
|
}
|
|
9320
9123
|
),
|
|
9321
9124
|
label,
|
|
9322
|
-
iconAppearance === "right" && /* @__PURE__ */
|
|
9125
|
+
iconAppearance === "right" && (state.value.length > 0 || config.isMultiSelect) && /* @__PURE__ */ jsx16(
|
|
9323
9126
|
CheckIcon,
|
|
9324
9127
|
{
|
|
9325
9128
|
className: clsx13("w-4 h-4", { "opacity-0": !isSelected || disabled }),
|
|
@@ -9337,7 +9140,7 @@ var SelectButton = forwardRef4(function SelectButton2({ placeholder, selectedDis
|
|
|
9337
9140
|
const { register, unregister, toggleOpen } = trigger;
|
|
9338
9141
|
const innerRef = useRef6(null);
|
|
9339
9142
|
useImperativeHandle2(ref, () => innerRef.current);
|
|
9340
|
-
|
|
9143
|
+
useEffect14(() => {
|
|
9341
9144
|
register(innerRef);
|
|
9342
9145
|
return () => unregister();
|
|
9343
9146
|
}, [register, unregister]);
|
|
@@ -9391,11 +9194,11 @@ var SelectButton = forwardRef4(function SelectButton2({ placeholder, selectedDis
|
|
|
9391
9194
|
"aria-expanded": state.isOpen,
|
|
9392
9195
|
"aria-controls": state.isOpen ? `${state.id}-listbox` : void 0,
|
|
9393
9196
|
children: [
|
|
9394
|
-
hasValue ? selectedDisplay?.(state.value) ?? /* @__PURE__ */
|
|
9197
|
+
hasValue ? selectedDisplay?.(state.value) ?? /* @__PURE__ */ jsx16("div", { className: clsx13("flex flex-wrap gap-x-1 gap-y-2"), children: state.selectedOptions.map(({ value, label }, index) => /* @__PURE__ */ jsxs11("span", { className: "flex-row-0", children: [
|
|
9395
9198
|
label,
|
|
9396
|
-
index < state.value.length - 1 && /* @__PURE__ */
|
|
9199
|
+
index < state.value.length - 1 && /* @__PURE__ */ jsx16("span", { children: "," })
|
|
9397
9200
|
] }, value)) }) : placeholder ?? translation("clickToSelect"),
|
|
9398
|
-
/* @__PURE__ */
|
|
9201
|
+
/* @__PURE__ */ jsx16(
|
|
9399
9202
|
ExpansionIcon,
|
|
9400
9203
|
{
|
|
9401
9204
|
isExpanded: state.isOpen,
|
|
@@ -9415,7 +9218,7 @@ var SelectChipDisplay = forwardRef4(function SelectChipDisplay2({ ...props }, re
|
|
|
9415
9218
|
const { register, unregister, toggleOpen } = trigger;
|
|
9416
9219
|
const innerRef = useRef6(null);
|
|
9417
9220
|
useImperativeHandle2(ref, () => innerRef.current);
|
|
9418
|
-
|
|
9221
|
+
useEffect14(() => {
|
|
9419
9222
|
register(innerRef);
|
|
9420
9223
|
return () => unregister();
|
|
9421
9224
|
}, [register, unregister]);
|
|
@@ -9437,21 +9240,22 @@ var SelectChipDisplay = forwardRef4(function SelectChipDisplay2({ ...props }, re
|
|
|
9437
9240
|
children: [
|
|
9438
9241
|
state.selectedOptions.map(({ value, label }) => /* @__PURE__ */ jsxs11(Chip, { className: "gap-x-2", children: [
|
|
9439
9242
|
label,
|
|
9440
|
-
/* @__PURE__ */
|
|
9441
|
-
|
|
9243
|
+
/* @__PURE__ */ jsx16(
|
|
9244
|
+
Button,
|
|
9442
9245
|
{
|
|
9443
9246
|
onClick: () => {
|
|
9444
9247
|
item.toggleSelection(value, false);
|
|
9445
9248
|
},
|
|
9446
9249
|
size: "none",
|
|
9447
9250
|
color: "negative",
|
|
9251
|
+
coloringStyle: "text",
|
|
9448
9252
|
className: "flex-row-0 items-center px-0.5 py-0.5 w-6 h-6 rounded",
|
|
9449
|
-
children: /* @__PURE__ */
|
|
9253
|
+
children: /* @__PURE__ */ jsx16(XIcon, { className: "w-5 h-5" })
|
|
9450
9254
|
}
|
|
9451
9255
|
)
|
|
9452
9256
|
] }, value)),
|
|
9453
|
-
/* @__PURE__ */
|
|
9454
|
-
|
|
9257
|
+
/* @__PURE__ */ jsx16(
|
|
9258
|
+
Button,
|
|
9455
9259
|
{
|
|
9456
9260
|
id: state.id,
|
|
9457
9261
|
onClick: () => toggleOpen(),
|
|
@@ -9464,6 +9268,7 @@ var SelectChipDisplay = forwardRef4(function SelectChipDisplay2({ ...props }, re
|
|
|
9464
9268
|
toggleOpen(true, { highlightStartPositionBehavior: "last" });
|
|
9465
9269
|
}
|
|
9466
9270
|
},
|
|
9271
|
+
layout: "icon",
|
|
9467
9272
|
size: "small",
|
|
9468
9273
|
color: "neutral",
|
|
9469
9274
|
"aria-invalid": invalid,
|
|
@@ -9471,7 +9276,7 @@ var SelectChipDisplay = forwardRef4(function SelectChipDisplay2({ ...props }, re
|
|
|
9471
9276
|
"aria-haspopup": "listbox",
|
|
9472
9277
|
"aria-expanded": state.isOpen,
|
|
9473
9278
|
"aria-controls": state.isOpen ? `${state.id}-listbox` : void 0,
|
|
9474
|
-
children: /* @__PURE__ */
|
|
9279
|
+
children: /* @__PURE__ */ jsx16(Plus, {})
|
|
9475
9280
|
}
|
|
9476
9281
|
)
|
|
9477
9282
|
]
|
|
@@ -9498,15 +9303,17 @@ var SelectContent = forwardRef4(
|
|
|
9498
9303
|
container: innerRef,
|
|
9499
9304
|
active: state.isOpen && !!position
|
|
9500
9305
|
});
|
|
9306
|
+
const zIndex = useZIndexRegister(state.isOpen);
|
|
9501
9307
|
return createPortal2(
|
|
9502
9308
|
/* @__PURE__ */ jsxs11(
|
|
9503
9309
|
"div",
|
|
9504
9310
|
{
|
|
9505
9311
|
id: `select-container-${state.id}`,
|
|
9506
9312
|
className: clsx13("fixed inset-0 w-screen h-screen", containerClassName),
|
|
9313
|
+
style: { zIndex },
|
|
9507
9314
|
hidden: !state.isOpen,
|
|
9508
9315
|
children: [
|
|
9509
|
-
/* @__PURE__ */
|
|
9316
|
+
/* @__PURE__ */ jsx16(
|
|
9510
9317
|
"div",
|
|
9511
9318
|
{
|
|
9512
9319
|
id: `select-background-${state.id}`,
|
|
@@ -9514,7 +9321,7 @@ var SelectContent = forwardRef4(
|
|
|
9514
9321
|
className: clsx13("fixed inset-0 w-screen h-screen")
|
|
9515
9322
|
}
|
|
9516
9323
|
),
|
|
9517
|
-
/* @__PURE__ */
|
|
9324
|
+
/* @__PURE__ */ jsx16(
|
|
9518
9325
|
"ul",
|
|
9519
9326
|
{
|
|
9520
9327
|
...props,
|
|
@@ -9587,7 +9394,7 @@ var Select = forwardRef4(function Select2({
|
|
|
9587
9394
|
...props
|
|
9588
9395
|
}, ref) {
|
|
9589
9396
|
return /* @__PURE__ */ jsxs11(SelectRoot, { ...props, isMultiSelect: false, children: [
|
|
9590
|
-
/* @__PURE__ */
|
|
9397
|
+
/* @__PURE__ */ jsx16(
|
|
9591
9398
|
SelectButton,
|
|
9592
9399
|
{
|
|
9593
9400
|
ref,
|
|
@@ -9599,7 +9406,7 @@ var Select = forwardRef4(function Select2({
|
|
|
9599
9406
|
}
|
|
9600
9407
|
}
|
|
9601
9408
|
),
|
|
9602
|
-
/* @__PURE__ */
|
|
9409
|
+
/* @__PURE__ */ jsx16(SelectContent, { ...contentPanelProps, children })
|
|
9603
9410
|
] });
|
|
9604
9411
|
});
|
|
9605
9412
|
var SelectUncontrolled = forwardRef4(function SelectUncontrolled2({
|
|
@@ -9608,7 +9415,7 @@ var SelectUncontrolled = forwardRef4(function SelectUncontrolled2({
|
|
|
9608
9415
|
...props
|
|
9609
9416
|
}, ref) {
|
|
9610
9417
|
const [value, setValue] = useOverwritableState(initialValue, onValueChanged);
|
|
9611
|
-
return /* @__PURE__ */
|
|
9418
|
+
return /* @__PURE__ */ jsx16(
|
|
9612
9419
|
Select,
|
|
9613
9420
|
{
|
|
9614
9421
|
...props,
|
|
@@ -9625,8 +9432,8 @@ var MultiSelect = forwardRef4(function MultiSelect2({
|
|
|
9625
9432
|
...props
|
|
9626
9433
|
}, ref) {
|
|
9627
9434
|
return /* @__PURE__ */ jsxs11(SelectRoot, { ...props, isMultiSelect: true, children: [
|
|
9628
|
-
/* @__PURE__ */
|
|
9629
|
-
/* @__PURE__ */
|
|
9435
|
+
/* @__PURE__ */ jsx16(SelectButton, { ref, ...buttonProps }),
|
|
9436
|
+
/* @__PURE__ */ jsx16(SelectContent, { ...contentPanelProps, children })
|
|
9630
9437
|
] });
|
|
9631
9438
|
});
|
|
9632
9439
|
var MultiSelectUncontrolled = forwardRef4(function MultiSelectUncontrolled2({
|
|
@@ -9635,7 +9442,7 @@ var MultiSelectUncontrolled = forwardRef4(function MultiSelectUncontrolled2({
|
|
|
9635
9442
|
...props
|
|
9636
9443
|
}, ref) {
|
|
9637
9444
|
const [values, setValues] = useOverwritableState(initialValues, onValuesChanged);
|
|
9638
|
-
return /* @__PURE__ */
|
|
9445
|
+
return /* @__PURE__ */ jsx16(
|
|
9639
9446
|
MultiSelect,
|
|
9640
9447
|
{
|
|
9641
9448
|
...props,
|
|
@@ -9652,8 +9459,8 @@ var MultiSelectChipDisplay = forwardRef4(function MultiSelectChipDisplay2({
|
|
|
9652
9459
|
...props
|
|
9653
9460
|
}, ref) {
|
|
9654
9461
|
return /* @__PURE__ */ jsxs11(SelectRoot, { ...props, isMultiSelect: true, children: [
|
|
9655
|
-
/* @__PURE__ */
|
|
9656
|
-
/* @__PURE__ */
|
|
9462
|
+
/* @__PURE__ */ jsx16(SelectChipDisplay, { ref, ...chipDisplayProps }),
|
|
9463
|
+
/* @__PURE__ */ jsx16(SelectContent, { ...contentPanelProps, children })
|
|
9657
9464
|
] });
|
|
9658
9465
|
});
|
|
9659
9466
|
var MultiSelectChipDisplayUncontrolled = forwardRef4(function MultiSelectChipDisplayUncontrolled2({
|
|
@@ -9662,7 +9469,7 @@ var MultiSelectChipDisplayUncontrolled = forwardRef4(function MultiSelectChipDis
|
|
|
9662
9469
|
...props
|
|
9663
9470
|
}, ref) {
|
|
9664
9471
|
const [values, setValues] = useOverwritableState(initialValues, onValuesChanged);
|
|
9665
|
-
return /* @__PURE__ */
|
|
9472
|
+
return /* @__PURE__ */ jsx16(
|
|
9666
9473
|
MultiSelectChipDisplay,
|
|
9667
9474
|
{
|
|
9668
9475
|
...props,
|
|
@@ -9674,7 +9481,7 @@ var MultiSelectChipDisplayUncontrolled = forwardRef4(function MultiSelectChipDis
|
|
|
9674
9481
|
});
|
|
9675
9482
|
|
|
9676
9483
|
// src/components/dialog/LanguageDialog.tsx
|
|
9677
|
-
import { jsx as
|
|
9484
|
+
import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
9678
9485
|
var LanguageDialog = ({
|
|
9679
9486
|
onClose,
|
|
9680
9487
|
titleOverwrite,
|
|
@@ -9683,7 +9490,7 @@ var LanguageDialog = ({
|
|
|
9683
9490
|
}) => {
|
|
9684
9491
|
const { locale, setLocale } = useLocale();
|
|
9685
9492
|
const translation = useHightideTranslation();
|
|
9686
|
-
return /* @__PURE__ */
|
|
9493
|
+
return /* @__PURE__ */ jsx17(
|
|
9687
9494
|
Dialog,
|
|
9688
9495
|
{
|
|
9689
9496
|
titleElement: titleOverwrite ?? translation("language"),
|
|
@@ -9691,19 +9498,18 @@ var LanguageDialog = ({
|
|
|
9691
9498
|
onClose,
|
|
9692
9499
|
...props,
|
|
9693
9500
|
children: /* @__PURE__ */ jsxs12("div", { className: "w-64", children: [
|
|
9694
|
-
/* @__PURE__ */
|
|
9501
|
+
/* @__PURE__ */ jsx17(
|
|
9695
9502
|
Select,
|
|
9696
9503
|
{
|
|
9697
9504
|
value: locale,
|
|
9698
9505
|
onValueChanged: (language) => setLocale(language),
|
|
9699
|
-
contentPanelProps: { containerClassName: "z-200" },
|
|
9700
9506
|
buttonProps: {
|
|
9701
9507
|
selectedDisplay: (locale2) => LocalizationUtil.languagesLocalNames[locale2]
|
|
9702
9508
|
},
|
|
9703
|
-
children: LocalizationUtil.locals.map((local) => /* @__PURE__ */
|
|
9509
|
+
children: LocalizationUtil.locals.map((local) => /* @__PURE__ */ jsx17(SelectOption, { value: local, children: LocalizationUtil.languagesLocalNames[local] }, local))
|
|
9704
9510
|
}
|
|
9705
9511
|
),
|
|
9706
|
-
/* @__PURE__ */
|
|
9512
|
+
/* @__PURE__ */ jsx17("div", { className: "flex-row-4 mt-3 justify-end", children: /* @__PURE__ */ jsx17(Button, { color: "positive", onClick: onClose, children: translation("done") }) })
|
|
9707
9513
|
] })
|
|
9708
9514
|
}
|
|
9709
9515
|
);
|
|
@@ -9714,8 +9520,8 @@ import { MonitorCog, MoonIcon, SunIcon } from "lucide-react";
|
|
|
9714
9520
|
import clsx14 from "clsx";
|
|
9715
9521
|
|
|
9716
9522
|
// src/theming/useTheme.tsx
|
|
9717
|
-
import { createContext as createContext3, useCallback as useCallback7, useContext as useContext3, useEffect as
|
|
9718
|
-
import { jsx as
|
|
9523
|
+
import { createContext as createContext3, useCallback as useCallback7, useContext as useContext3, useEffect as useEffect15, useMemo as useMemo4, useState as useState14 } from "react";
|
|
9524
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
9719
9525
|
var themes = ["light", "dark", "system"];
|
|
9720
9526
|
var ThemeUtil = {
|
|
9721
9527
|
themes
|
|
@@ -9727,8 +9533,8 @@ var ThemeProvider = ({ children, theme }) => {
|
|
|
9727
9533
|
setValue: setStoredTheme,
|
|
9728
9534
|
deleteValue: deleteStoredTheme
|
|
9729
9535
|
} = useLocalStorage("theme", "system");
|
|
9730
|
-
const [themePreference, setThemePreference] =
|
|
9731
|
-
const resolvedTheme =
|
|
9536
|
+
const [themePreference, setThemePreference] = useState14("system");
|
|
9537
|
+
const resolvedTheme = useMemo4(() => {
|
|
9732
9538
|
if (theme && theme !== "system") {
|
|
9733
9539
|
return theme;
|
|
9734
9540
|
}
|
|
@@ -9740,7 +9546,7 @@ var ThemeProvider = ({ children, theme }) => {
|
|
|
9740
9546
|
}
|
|
9741
9547
|
return "light";
|
|
9742
9548
|
}, [storedTheme, theme, themePreference]);
|
|
9743
|
-
|
|
9549
|
+
useEffect15(() => {
|
|
9744
9550
|
if (!theme) return;
|
|
9745
9551
|
if (theme === "system") {
|
|
9746
9552
|
deleteStoredTheme();
|
|
@@ -9748,7 +9554,7 @@ var ThemeProvider = ({ children, theme }) => {
|
|
|
9748
9554
|
setStoredTheme(theme);
|
|
9749
9555
|
}
|
|
9750
9556
|
}, [theme]);
|
|
9751
|
-
|
|
9557
|
+
useEffect15(() => {
|
|
9752
9558
|
document.documentElement.setAttribute("data-theme", resolvedTheme);
|
|
9753
9559
|
}, [resolvedTheme]);
|
|
9754
9560
|
const getPreference = useCallback7(() => {
|
|
@@ -9756,10 +9562,10 @@ var ThemeProvider = ({ children, theme }) => {
|
|
|
9756
9562
|
const prefersLight = window.matchMedia("(prefers-color-scheme: light)").matches;
|
|
9757
9563
|
setThemePreference(prefersDark ? "dark" : prefersLight ? "light" : "system");
|
|
9758
9564
|
}, []);
|
|
9759
|
-
|
|
9565
|
+
useEffect15(() => {
|
|
9760
9566
|
getPreference();
|
|
9761
9567
|
}, [getPreference]);
|
|
9762
|
-
|
|
9568
|
+
useEffect15(() => {
|
|
9763
9569
|
const darkQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
9764
9570
|
const lightQuery = window.matchMedia("(prefers-color-scheme: light)");
|
|
9765
9571
|
const noPrefQuery = window.matchMedia("(prefers-color-scheme: no-preference)");
|
|
@@ -9772,7 +9578,7 @@ var ThemeProvider = ({ children, theme }) => {
|
|
|
9772
9578
|
noPrefQuery.removeEventListener("change", getPreference);
|
|
9773
9579
|
};
|
|
9774
9580
|
}, [getPreference]);
|
|
9775
|
-
return /* @__PURE__ */
|
|
9581
|
+
return /* @__PURE__ */ jsx18(
|
|
9776
9582
|
ThemeContext.Provider,
|
|
9777
9583
|
{
|
|
9778
9584
|
value: {
|
|
@@ -9798,14 +9604,14 @@ var useTheme = () => {
|
|
|
9798
9604
|
};
|
|
9799
9605
|
|
|
9800
9606
|
// src/components/dialog/ThemeDialog.tsx
|
|
9801
|
-
import { jsx as
|
|
9607
|
+
import { jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
9802
9608
|
var ThemeIcon = ({ theme, className }) => {
|
|
9803
9609
|
if (theme === "dark") {
|
|
9804
|
-
return /* @__PURE__ */
|
|
9610
|
+
return /* @__PURE__ */ jsx19(MoonIcon, { className: clsx14("w-4 h-4", className) });
|
|
9805
9611
|
} else if (theme === "light") {
|
|
9806
|
-
return /* @__PURE__ */
|
|
9612
|
+
return /* @__PURE__ */ jsx19(SunIcon, { className: clsx14("w-4 h-4", className) });
|
|
9807
9613
|
} else {
|
|
9808
|
-
return /* @__PURE__ */
|
|
9614
|
+
return /* @__PURE__ */ jsx19(MonitorCog, { className: clsx14("w-4 h-4", className) });
|
|
9809
9615
|
}
|
|
9810
9616
|
};
|
|
9811
9617
|
var ThemeDialog = ({
|
|
@@ -9816,7 +9622,7 @@ var ThemeDialog = ({
|
|
|
9816
9622
|
}) => {
|
|
9817
9623
|
const { theme, setTheme } = useTheme();
|
|
9818
9624
|
const translation = useHightideTranslation();
|
|
9819
|
-
return /* @__PURE__ */
|
|
9625
|
+
return /* @__PURE__ */ jsx19(
|
|
9820
9626
|
Dialog,
|
|
9821
9627
|
{
|
|
9822
9628
|
titleElement: titleOverwrite ?? translation("themes", { count: 1 }),
|
|
@@ -9824,29 +9630,26 @@ var ThemeDialog = ({
|
|
|
9824
9630
|
onClose,
|
|
9825
9631
|
...props,
|
|
9826
9632
|
children: /* @__PURE__ */ jsxs13("div", { className: "w-64", children: [
|
|
9827
|
-
/* @__PURE__ */
|
|
9633
|
+
/* @__PURE__ */ jsx19(
|
|
9828
9634
|
Select,
|
|
9829
9635
|
{
|
|
9830
9636
|
value: theme,
|
|
9831
9637
|
onValueChanged: (theme2) => setTheme(theme2),
|
|
9832
9638
|
iconAppearance: "right",
|
|
9833
|
-
contentPanelProps: {
|
|
9834
|
-
containerClassName: "z-200"
|
|
9835
|
-
},
|
|
9836
9639
|
buttonProps: {
|
|
9837
9640
|
selectedDisplay: (value) => /* @__PURE__ */ jsxs13("div", { className: "flex-row-2 items-center", children: [
|
|
9838
|
-
/* @__PURE__ */
|
|
9641
|
+
/* @__PURE__ */ jsx19(ThemeIcon, { theme }),
|
|
9839
9642
|
translation("themeMode", { theme: value })
|
|
9840
9643
|
] }),
|
|
9841
9644
|
className: "min-w-32"
|
|
9842
9645
|
},
|
|
9843
|
-
children: ThemeUtil.themes.map((theme2) => /* @__PURE__ */
|
|
9844
|
-
/* @__PURE__ */
|
|
9646
|
+
children: ThemeUtil.themes.map((theme2) => /* @__PURE__ */ jsx19(SelectOption, { value: theme2, className: "gap-x-6 justify-between", children: /* @__PURE__ */ jsxs13("div", { className: "flex-row-2 items-center", children: [
|
|
9647
|
+
/* @__PURE__ */ jsx19(ThemeIcon, { theme: theme2 }),
|
|
9845
9648
|
translation("themeMode", { theme: theme2 })
|
|
9846
9649
|
] }) }, theme2))
|
|
9847
9650
|
}
|
|
9848
9651
|
),
|
|
9849
|
-
/* @__PURE__ */
|
|
9652
|
+
/* @__PURE__ */ jsx19("div", { className: "flex-row-4 mt-3 justify-end", children: /* @__PURE__ */ jsx19(Button, { autoFocus: true, color: "positive", onClick: onClose, children: translation("done") }) })
|
|
9850
9653
|
] })
|
|
9851
9654
|
}
|
|
9852
9655
|
);
|
|
@@ -9858,7 +9661,7 @@ import { clsx as clsx16 } from "clsx";
|
|
|
9858
9661
|
|
|
9859
9662
|
// src/components/user-action/Label.tsx
|
|
9860
9663
|
import clsx15 from "clsx";
|
|
9861
|
-
import { jsx as
|
|
9664
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
9862
9665
|
var styleMapping = {
|
|
9863
9666
|
md: "typography-label-md color-label-text",
|
|
9864
9667
|
lg: "typography-label-lg color-label-text"
|
|
@@ -9869,11 +9672,11 @@ var Label = ({
|
|
|
9869
9672
|
className,
|
|
9870
9673
|
...props
|
|
9871
9674
|
}) => {
|
|
9872
|
-
return /* @__PURE__ */
|
|
9675
|
+
return /* @__PURE__ */ jsx20("label", { ...props, className: clsx15(styleMapping[size], className), children });
|
|
9873
9676
|
};
|
|
9874
9677
|
|
|
9875
9678
|
// src/components/form/FormElementWrapper.tsx
|
|
9876
|
-
import { jsx as
|
|
9679
|
+
import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
9877
9680
|
var FormElementWrapper = ({
|
|
9878
9681
|
children,
|
|
9879
9682
|
id,
|
|
@@ -9931,11 +9734,11 @@ var FormElementWrapper = ({
|
|
|
9931
9734
|
className: clsx16("flex-row-1 items-start", labelProps?.className),
|
|
9932
9735
|
children: [
|
|
9933
9736
|
label,
|
|
9934
|
-
required && /* @__PURE__ */
|
|
9737
|
+
required && /* @__PURE__ */ jsx21("div", { role: "none", className: "bg-primary w-2 h-2 rounded-full" })
|
|
9935
9738
|
]
|
|
9936
9739
|
}
|
|
9937
9740
|
),
|
|
9938
|
-
description && /* @__PURE__ */
|
|
9741
|
+
description && /* @__PURE__ */ jsx21(
|
|
9939
9742
|
"p",
|
|
9940
9743
|
{
|
|
9941
9744
|
...descriptionProps,
|
|
@@ -9945,7 +9748,7 @@ var FormElementWrapper = ({
|
|
|
9945
9748
|
}
|
|
9946
9749
|
),
|
|
9947
9750
|
children(bag),
|
|
9948
|
-
error && isShowingError && /* @__PURE__ */
|
|
9751
|
+
error && isShowingError && /* @__PURE__ */ jsx21(
|
|
9949
9752
|
"p",
|
|
9950
9753
|
{
|
|
9951
9754
|
...errorProps,
|
|
@@ -9962,9 +9765,9 @@ var FormElementWrapper = ({
|
|
|
9962
9765
|
|
|
9963
9766
|
// src/components/icons-and-geometry/Avatar.tsx
|
|
9964
9767
|
import clsx17 from "clsx";
|
|
9965
|
-
import { useMemo as
|
|
9768
|
+
import { useMemo as useMemo5, useState as useState15 } from "react";
|
|
9966
9769
|
import { UserIcon } from "lucide-react";
|
|
9967
|
-
import { jsx as
|
|
9770
|
+
import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
9968
9771
|
var avtarSizeList = ["sm", "md", "lg", "xl"];
|
|
9969
9772
|
var avatarSizeMapping = {
|
|
9970
9773
|
sm: 18,
|
|
@@ -9989,8 +9792,8 @@ var Avatar = ({
|
|
|
9989
9792
|
fullyRounded,
|
|
9990
9793
|
className = ""
|
|
9991
9794
|
}) => {
|
|
9992
|
-
const [hasError, setHasError] =
|
|
9993
|
-
const [isLoaded, setIsLoaded] =
|
|
9795
|
+
const [hasError, setHasError] = useState15(false);
|
|
9796
|
+
const [isLoaded, setIsLoaded] = useState15(false);
|
|
9994
9797
|
const pixels = avatarSizeMapping[size];
|
|
9995
9798
|
const sizeStyle = {
|
|
9996
9799
|
minWidth: pixels,
|
|
@@ -9999,7 +9802,7 @@ var Avatar = ({
|
|
|
9999
9802
|
maxHeight: pixels
|
|
10000
9803
|
};
|
|
10001
9804
|
const textClassName = textClassNameMapping[size];
|
|
10002
|
-
const displayName =
|
|
9805
|
+
const displayName = useMemo5(() => {
|
|
10003
9806
|
const maxLetters = size === "sm" ? 1 : 2;
|
|
10004
9807
|
return (name ?? "").split(" ").filter((_, index) => index < maxLetters).map((value) => value[0]).join("").toUpperCase();
|
|
10005
9808
|
}, [name, size]);
|
|
@@ -10018,7 +9821,7 @@ var Avatar = ({
|
|
|
10018
9821
|
),
|
|
10019
9822
|
style: sizeStyle,
|
|
10020
9823
|
children: [
|
|
10021
|
-
/* @__PURE__ */
|
|
9824
|
+
/* @__PURE__ */ jsx22(
|
|
10022
9825
|
"img",
|
|
10023
9826
|
{
|
|
10024
9827
|
src: image?.avatarUrl,
|
|
@@ -10028,7 +9831,7 @@ var Avatar = ({
|
|
|
10028
9831
|
onError: () => setHasError(true)
|
|
10029
9832
|
}
|
|
10030
9833
|
),
|
|
10031
|
-
name ? /* @__PURE__ */
|
|
9834
|
+
name ? /* @__PURE__ */ jsx22("span", { className: textClassName, children: displayName }) : /* @__PURE__ */ jsx22(UserIcon, { size: Math.round(pixels * 3 / 4) })
|
|
10032
9835
|
]
|
|
10033
9836
|
}
|
|
10034
9837
|
);
|
|
@@ -10046,12 +9849,12 @@ var AvatarGroup = ({
|
|
|
10046
9849
|
const notDisplayedProfiles = avatars.length - maxShownProfiles;
|
|
10047
9850
|
const avatarGroupWidth = diameter * (stackingOverlap * (displayedProfiles.length - 1) + 1);
|
|
10048
9851
|
return /* @__PURE__ */ jsxs15("div", { className: "flex-row-2 relative", style: { height: diameter + "px" }, children: [
|
|
10049
|
-
/* @__PURE__ */
|
|
9852
|
+
/* @__PURE__ */ jsx22("div", { style: { width: avatarGroupWidth + "px" }, children: displayedProfiles.map((avatar, index) => /* @__PURE__ */ jsx22(
|
|
10050
9853
|
"div",
|
|
10051
9854
|
{
|
|
10052
9855
|
className: "absolute",
|
|
10053
9856
|
style: { left: index * diameter * stackingOverlap + "px", zIndex: maxShownProfiles - index },
|
|
10054
|
-
children: /* @__PURE__ */
|
|
9857
|
+
children: /* @__PURE__ */ jsx22(
|
|
10055
9858
|
Avatar,
|
|
10056
9859
|
{
|
|
10057
9860
|
...avatar,
|
|
@@ -10063,7 +9866,7 @@ var AvatarGroup = ({
|
|
|
10063
9866
|
},
|
|
10064
9867
|
index
|
|
10065
9868
|
)) }),
|
|
10066
|
-
showTotalNumber && notDisplayedProfiles > 0 && /* @__PURE__ */
|
|
9869
|
+
showTotalNumber && notDisplayedProfiles > 0 && /* @__PURE__ */ jsx22(
|
|
10067
9870
|
"div",
|
|
10068
9871
|
{
|
|
10069
9872
|
className: clsx17(textClassNameMapping[size], "flex-row-2 truncate items-center"),
|
|
@@ -10078,7 +9881,7 @@ var AvatarGroup = ({
|
|
|
10078
9881
|
|
|
10079
9882
|
// src/components/icons-and-geometry/Circle.tsx
|
|
10080
9883
|
import clsx18 from "clsx";
|
|
10081
|
-
import { jsx as
|
|
9884
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
10082
9885
|
var Circle = ({
|
|
10083
9886
|
radius = 20,
|
|
10084
9887
|
className = "bg-primary",
|
|
@@ -10086,7 +9889,7 @@ var Circle = ({
|
|
|
10086
9889
|
...restProps
|
|
10087
9890
|
}) => {
|
|
10088
9891
|
const size = radius * 2;
|
|
10089
|
-
return /* @__PURE__ */
|
|
9892
|
+
return /* @__PURE__ */ jsx23(
|
|
10090
9893
|
"div",
|
|
10091
9894
|
{
|
|
10092
9895
|
className: clsx18(`rounded-full`, className),
|
|
@@ -10101,15 +9904,15 @@ var Circle = ({
|
|
|
10101
9904
|
};
|
|
10102
9905
|
|
|
10103
9906
|
// src/components/icons-and-geometry/Ring.tsx
|
|
10104
|
-
import { useCallback as useCallback8, useEffect as
|
|
9907
|
+
import { useCallback as useCallback8, useEffect as useEffect16, useState as useState16 } from "react";
|
|
10105
9908
|
import clsx19 from "clsx";
|
|
10106
|
-
import { jsx as
|
|
9909
|
+
import { jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
10107
9910
|
var Ring = ({
|
|
10108
9911
|
innerSize = 20,
|
|
10109
9912
|
width = 7,
|
|
10110
9913
|
className = "outline-primary"
|
|
10111
9914
|
}) => {
|
|
10112
|
-
return /* @__PURE__ */
|
|
9915
|
+
return /* @__PURE__ */ jsx24(
|
|
10113
9916
|
"div",
|
|
10114
9917
|
{
|
|
10115
9918
|
className: clsx19(`bg-transparent rounded-full outline`, className),
|
|
@@ -10130,7 +9933,7 @@ var AnimatedRing = ({
|
|
|
10130
9933
|
onAnimationFinished,
|
|
10131
9934
|
style
|
|
10132
9935
|
}) => {
|
|
10133
|
-
const [currentWidth, setCurrentWidth] =
|
|
9936
|
+
const [currentWidth, setCurrentWidth] = useState16(0);
|
|
10134
9937
|
const milliseconds = 1e3 * fillAnimationDuration;
|
|
10135
9938
|
const animate = useCallback8((timestamp, startTime) => {
|
|
10136
9939
|
const progress = Math.min((timestamp - startTime) / milliseconds, 1);
|
|
@@ -10146,12 +9949,12 @@ var AnimatedRing = ({
|
|
|
10146
9949
|
}
|
|
10147
9950
|
}
|
|
10148
9951
|
}, [milliseconds, onAnimationFinished, repeating, width]);
|
|
10149
|
-
|
|
9952
|
+
useEffect16(() => {
|
|
10150
9953
|
if (currentWidth < width) {
|
|
10151
9954
|
requestAnimationFrame((timestamp) => animate(timestamp, timestamp));
|
|
10152
9955
|
}
|
|
10153
9956
|
}, []);
|
|
10154
|
-
return /* @__PURE__ */
|
|
9957
|
+
return /* @__PURE__ */ jsx24(
|
|
10155
9958
|
"div",
|
|
10156
9959
|
{
|
|
10157
9960
|
className: "flex-row-2 items-center justify-center",
|
|
@@ -10160,7 +9963,7 @@ var AnimatedRing = ({
|
|
|
10160
9963
|
height: `${innerSize + 2 * width}px`,
|
|
10161
9964
|
...style
|
|
10162
9965
|
},
|
|
10163
|
-
children: /* @__PURE__ */
|
|
9966
|
+
children: /* @__PURE__ */ jsx24(
|
|
10164
9967
|
Ring,
|
|
10165
9968
|
{
|
|
10166
9969
|
innerSize,
|
|
@@ -10181,7 +9984,7 @@ var RingWave = ({
|
|
|
10181
9984
|
onAnimationFinished,
|
|
10182
9985
|
style
|
|
10183
9986
|
}) => {
|
|
10184
|
-
const [currentInnerSize, setCurrentInnerSize] =
|
|
9987
|
+
const [currentInnerSize, setCurrentInnerSize] = useState16(startInnerSize);
|
|
10185
9988
|
const distance = endInnerSize - startInnerSize;
|
|
10186
9989
|
const milliseconds = 1e3 * fillAnimationDuration;
|
|
10187
9990
|
const animate = useCallback8((timestamp, startTime) => {
|
|
@@ -10201,12 +10004,12 @@ var RingWave = ({
|
|
|
10201
10004
|
}
|
|
10202
10005
|
}
|
|
10203
10006
|
}, [distance, endInnerSize, milliseconds, onAnimationFinished, repeating, startInnerSize]);
|
|
10204
|
-
|
|
10007
|
+
useEffect16(() => {
|
|
10205
10008
|
if (currentInnerSize < endInnerSize) {
|
|
10206
10009
|
requestAnimationFrame((timestamp) => animate(timestamp, timestamp));
|
|
10207
10010
|
}
|
|
10208
10011
|
}, []);
|
|
10209
|
-
return /* @__PURE__ */
|
|
10012
|
+
return /* @__PURE__ */ jsx24(
|
|
10210
10013
|
"div",
|
|
10211
10014
|
{
|
|
10212
10015
|
className: "flex-row-2 items-center justify-center",
|
|
@@ -10215,7 +10018,7 @@ var RingWave = ({
|
|
|
10215
10018
|
height: `${endInnerSize + 2 * width}px`,
|
|
10216
10019
|
...style
|
|
10217
10020
|
},
|
|
10218
|
-
children: /* @__PURE__ */
|
|
10021
|
+
children: /* @__PURE__ */ jsx24(
|
|
10219
10022
|
Ring,
|
|
10220
10023
|
{
|
|
10221
10024
|
innerSize: currentInnerSize,
|
|
@@ -10236,7 +10039,7 @@ var RadialRings = ({
|
|
|
10236
10039
|
sizeCircle2 = 200,
|
|
10237
10040
|
sizeCircle3 = 300
|
|
10238
10041
|
}) => {
|
|
10239
|
-
const [currentRing, setCurrentRing] =
|
|
10042
|
+
const [currentRing, setCurrentRing] = useState16(0);
|
|
10240
10043
|
const size = sizeCircle3;
|
|
10241
10044
|
return /* @__PURE__ */ jsxs16(
|
|
10242
10045
|
"div",
|
|
@@ -10247,7 +10050,7 @@ var RadialRings = ({
|
|
|
10247
10050
|
height: `${sizeCircle3}px`
|
|
10248
10051
|
},
|
|
10249
10052
|
children: [
|
|
10250
|
-
/* @__PURE__ */
|
|
10053
|
+
/* @__PURE__ */ jsx24(
|
|
10251
10054
|
Circle,
|
|
10252
10055
|
{
|
|
10253
10056
|
radius: sizeCircle1 / 2,
|
|
@@ -10258,7 +10061,7 @@ var RadialRings = ({
|
|
|
10258
10061
|
}
|
|
10259
10062
|
}
|
|
10260
10063
|
),
|
|
10261
|
-
currentRing === 0 ? /* @__PURE__ */
|
|
10064
|
+
currentRing === 0 ? /* @__PURE__ */ jsx24(
|
|
10262
10065
|
AnimatedRing,
|
|
10263
10066
|
{
|
|
10264
10067
|
innerSize: sizeCircle1,
|
|
@@ -10278,7 +10081,7 @@ var RadialRings = ({
|
|
|
10278
10081
|
}
|
|
10279
10082
|
}
|
|
10280
10083
|
) : null,
|
|
10281
|
-
currentRing === 2 ? /* @__PURE__ */
|
|
10084
|
+
currentRing === 2 ? /* @__PURE__ */ jsx24(
|
|
10282
10085
|
RingWave,
|
|
10283
10086
|
{
|
|
10284
10087
|
startInnerSize: sizeCircle1 - waveWidth,
|
|
@@ -10295,7 +10098,7 @@ var RadialRings = ({
|
|
|
10295
10098
|
}
|
|
10296
10099
|
}
|
|
10297
10100
|
) : null,
|
|
10298
|
-
/* @__PURE__ */
|
|
10101
|
+
/* @__PURE__ */ jsx24(
|
|
10299
10102
|
Circle,
|
|
10300
10103
|
{
|
|
10301
10104
|
radius: sizeCircle2 / 2,
|
|
@@ -10310,7 +10113,7 @@ var RadialRings = ({
|
|
|
10310
10113
|
}
|
|
10311
10114
|
}
|
|
10312
10115
|
),
|
|
10313
|
-
currentRing === 1 ? /* @__PURE__ */
|
|
10116
|
+
currentRing === 1 ? /* @__PURE__ */ jsx24(
|
|
10314
10117
|
AnimatedRing,
|
|
10315
10118
|
{
|
|
10316
10119
|
innerSize: sizeCircle2 - 1,
|
|
@@ -10327,7 +10130,7 @@ var RadialRings = ({
|
|
|
10327
10130
|
}
|
|
10328
10131
|
}
|
|
10329
10132
|
) : null,
|
|
10330
|
-
currentRing === 2 ? /* @__PURE__ */
|
|
10133
|
+
currentRing === 2 ? /* @__PURE__ */ jsx24(
|
|
10331
10134
|
RingWave,
|
|
10332
10135
|
{
|
|
10333
10136
|
startInnerSize: sizeCircle2,
|
|
@@ -10344,7 +10147,7 @@ var RadialRings = ({
|
|
|
10344
10147
|
}
|
|
10345
10148
|
}
|
|
10346
10149
|
) : null,
|
|
10347
|
-
/* @__PURE__ */
|
|
10150
|
+
/* @__PURE__ */ jsx24(
|
|
10348
10151
|
Circle,
|
|
10349
10152
|
{
|
|
10350
10153
|
radius: sizeCircle3 / 2,
|
|
@@ -10366,12 +10169,12 @@ var RadialRings = ({
|
|
|
10366
10169
|
|
|
10367
10170
|
// src/components/icons-and-geometry/Tag.tsx
|
|
10368
10171
|
var import_image = __toESM(require_image());
|
|
10369
|
-
import { jsx as
|
|
10172
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
10370
10173
|
var TagIcon = ({
|
|
10371
10174
|
className,
|
|
10372
10175
|
size = 16
|
|
10373
10176
|
}) => {
|
|
10374
|
-
return /* @__PURE__ */
|
|
10177
|
+
return /* @__PURE__ */ jsx25(
|
|
10375
10178
|
import_image.default,
|
|
10376
10179
|
{
|
|
10377
10180
|
style: { width: `${size}px`, height: `${size}px`, minWidth: `${size}px`, minHeight: `${size}px` },
|
|
@@ -10390,15 +10193,15 @@ import {
|
|
|
10390
10193
|
forwardRef as forwardRef5,
|
|
10391
10194
|
useCallback as useCallback9,
|
|
10392
10195
|
useContext as useContext4,
|
|
10393
|
-
useEffect as
|
|
10196
|
+
useEffect as useEffect17,
|
|
10394
10197
|
useId as useId6,
|
|
10395
|
-
useMemo as
|
|
10198
|
+
useMemo as useMemo6,
|
|
10396
10199
|
useRef as useRef7,
|
|
10397
|
-
useState as
|
|
10200
|
+
useState as useState17
|
|
10398
10201
|
} from "react";
|
|
10399
10202
|
import clsx20 from "clsx";
|
|
10400
10203
|
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
10401
|
-
import { Fragment, jsx as
|
|
10204
|
+
import { Fragment, jsx as jsx26, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
10402
10205
|
var CarouselContext = createContext4(null);
|
|
10403
10206
|
var useCarouselContext = () => {
|
|
10404
10207
|
const context = useContext4(CarouselContext);
|
|
@@ -10426,7 +10229,7 @@ function CarouselTabs({
|
|
|
10426
10229
|
onChange(newIndex);
|
|
10427
10230
|
tabRefs.current[newIndex]?.focus();
|
|
10428
10231
|
};
|
|
10429
|
-
return /* @__PURE__ */
|
|
10232
|
+
return /* @__PURE__ */ jsx26(
|
|
10430
10233
|
"div",
|
|
10431
10234
|
{
|
|
10432
10235
|
className: "flex-row-1 items-center justify-center w-full my-2",
|
|
@@ -10435,7 +10238,7 @@ function CarouselTabs({
|
|
|
10435
10238
|
id: `${id}-tablist`,
|
|
10436
10239
|
children: range(slideCount).map((index) => {
|
|
10437
10240
|
const isSelected = currentIndex === index;
|
|
10438
|
-
return /* @__PURE__ */
|
|
10241
|
+
return /* @__PURE__ */ jsx26(
|
|
10439
10242
|
"button",
|
|
10440
10243
|
{
|
|
10441
10244
|
id: `${id}-tab-${index}`,
|
|
@@ -10470,7 +10273,7 @@ var CarouselSlide = forwardRef5(
|
|
|
10470
10273
|
}, ref) {
|
|
10471
10274
|
const translation = useHightideTranslation();
|
|
10472
10275
|
const { id, slideCount } = useCarouselContext();
|
|
10473
|
-
return /* @__PURE__ */
|
|
10276
|
+
return /* @__PURE__ */ jsx26(
|
|
10474
10277
|
"div",
|
|
10475
10278
|
{
|
|
10476
10279
|
...props,
|
|
@@ -10508,14 +10311,14 @@ var Carousel = ({
|
|
|
10508
10311
|
}) => {
|
|
10509
10312
|
const translation = useHightideTranslation();
|
|
10510
10313
|
const slideRefs = useRef7([]);
|
|
10511
|
-
const [currentIndex, setCurrentIndex] =
|
|
10512
|
-
const [hasFocus, setHasFocus] =
|
|
10513
|
-
const [dragState, setDragState] =
|
|
10314
|
+
const [currentIndex, setCurrentIndex] = useState17(0);
|
|
10315
|
+
const [hasFocus, setHasFocus] = useState17(false);
|
|
10316
|
+
const [dragState, setDragState] = useState17();
|
|
10514
10317
|
const isPaused = hasFocus;
|
|
10515
10318
|
const carouselContainerRef = useRef7(null);
|
|
10516
|
-
const [disableClick, setDisableClick] =
|
|
10319
|
+
const [disableClick, setDisableClick] = useState17(false);
|
|
10517
10320
|
const timeOut = useRef7(void 0);
|
|
10518
|
-
const length =
|
|
10321
|
+
const length = useMemo6(() => children.length, [children]);
|
|
10519
10322
|
const paddingItemCount = 3;
|
|
10520
10323
|
const generatedId = "carousel" + useId6();
|
|
10521
10324
|
const id = props.id ?? generatedId;
|
|
@@ -10526,7 +10329,7 @@ var Carousel = ({
|
|
|
10526
10329
|
autoLoopingTimeOut = Math.max(0, autoLoopingTimeOut);
|
|
10527
10330
|
animationTime = Math.max(100, animationTime);
|
|
10528
10331
|
autoLoopAnimationTime = Math.max(200, autoLoopAnimationTime);
|
|
10529
|
-
|
|
10332
|
+
useEffect17(() => {
|
|
10530
10333
|
const carousel = carouselContainerRef.current;
|
|
10531
10334
|
if (carousel) {
|
|
10532
10335
|
let onFocus = function() {
|
|
@@ -10554,7 +10357,7 @@ var Carousel = ({
|
|
|
10554
10357
|
}, [currentIndex, isLooping, length]);
|
|
10555
10358
|
const left = () => {
|
|
10556
10359
|
if (canGoLeft()) {
|
|
10557
|
-
setCurrentIndex(currentIndex - 1);
|
|
10360
|
+
setCurrentIndex((currentIndex + length - 1) % length);
|
|
10558
10361
|
}
|
|
10559
10362
|
};
|
|
10560
10363
|
const right = useCallback9(() => {
|
|
@@ -10562,7 +10365,7 @@ var Carousel = ({
|
|
|
10562
10365
|
setCurrentIndex((currentIndex + length + 1) % length);
|
|
10563
10366
|
}
|
|
10564
10367
|
}, [canGoRight, currentIndex, length]);
|
|
10565
|
-
|
|
10368
|
+
useEffect17(() => {
|
|
10566
10369
|
if (!timeOut.current && !isPaused) {
|
|
10567
10370
|
if (autoLoopingTimeOut > 0) {
|
|
10568
10371
|
timeOut.current = setTimeout(() => {
|
|
@@ -10614,13 +10417,13 @@ var Carousel = ({
|
|
|
10614
10417
|
}
|
|
10615
10418
|
setDragState(void 0);
|
|
10616
10419
|
};
|
|
10617
|
-
|
|
10420
|
+
useEffect17(() => {
|
|
10618
10421
|
setDisableClick(!dragState);
|
|
10619
10422
|
}, [dragState]);
|
|
10620
|
-
|
|
10423
|
+
useEffect17(() => {
|
|
10621
10424
|
onSlideChanged?.(currentIndex);
|
|
10622
10425
|
}, [currentIndex]);
|
|
10623
|
-
return /* @__PURE__ */
|
|
10426
|
+
return /* @__PURE__ */ jsx26(CarouselContext.Provider, { value: { id, currentIndex, slideCount: length, isLooping }, children: /* @__PURE__ */ jsxs17(
|
|
10624
10427
|
"div",
|
|
10625
10428
|
{
|
|
10626
10429
|
ref: carouselContainerRef,
|
|
@@ -10645,12 +10448,12 @@ var Carousel = ({
|
|
|
10645
10448
|
onPointerLeave: handlePointerUp,
|
|
10646
10449
|
className: clsx20(`flex-row-2 relative h-full`, heightClassName),
|
|
10647
10450
|
children: [
|
|
10648
|
-
/* @__PURE__ */
|
|
10451
|
+
/* @__PURE__ */ jsx26("div", { className: "flex-row-2 relative h-full w-full px-2 overflow-hidden", children: items.map(({
|
|
10649
10452
|
item,
|
|
10650
10453
|
index
|
|
10651
10454
|
}, listIndex) => {
|
|
10652
10455
|
const isInItems = before.length <= listIndex && listIndex < items.length - after.length;
|
|
10653
|
-
return /* @__PURE__ */
|
|
10456
|
+
return /* @__PURE__ */ jsx26(
|
|
10654
10457
|
CarouselSlide,
|
|
10655
10458
|
{
|
|
10656
10459
|
ref: isInItems ? slideRefs[index] : void 0,
|
|
@@ -10670,13 +10473,13 @@ var Carousel = ({
|
|
|
10670
10473
|
listIndex
|
|
10671
10474
|
);
|
|
10672
10475
|
}) }),
|
|
10673
|
-
/* @__PURE__ */
|
|
10476
|
+
/* @__PURE__ */ jsx26(
|
|
10674
10477
|
"div",
|
|
10675
10478
|
{
|
|
10676
10479
|
className: clsx20(`hidden desktop:block pointer-events-none absolute left-0 h-full w-[20%] bg-gradient-to-r to-transparent`, blurColor)
|
|
10677
10480
|
}
|
|
10678
10481
|
),
|
|
10679
|
-
/* @__PURE__ */
|
|
10482
|
+
/* @__PURE__ */ jsx26(
|
|
10680
10483
|
"div",
|
|
10681
10484
|
{
|
|
10682
10485
|
className: clsx20(`hidden desktop:block pointer-events-none absolute right-0 h-full w-[20%] bg-gradient-to-l to-transparent`, blurColor)
|
|
@@ -10684,7 +10487,7 @@ var Carousel = ({
|
|
|
10684
10487
|
)
|
|
10685
10488
|
]
|
|
10686
10489
|
}
|
|
10687
|
-
) : /* @__PURE__ */
|
|
10490
|
+
) : /* @__PURE__ */ jsx26(
|
|
10688
10491
|
"div",
|
|
10689
10492
|
{
|
|
10690
10493
|
ref: slideRefs[currentIndex],
|
|
@@ -10700,31 +10503,33 @@ var Carousel = ({
|
|
|
10700
10503
|
}
|
|
10701
10504
|
),
|
|
10702
10505
|
arrows && /* @__PURE__ */ jsxs17(Fragment, { children: [
|
|
10703
|
-
/* @__PURE__ */
|
|
10704
|
-
|
|
10506
|
+
/* @__PURE__ */ jsx26(
|
|
10507
|
+
Button,
|
|
10705
10508
|
{
|
|
10509
|
+
layout: "icon",
|
|
10706
10510
|
color: "neutral",
|
|
10707
10511
|
className: clsx20("absolute z-10 left-2 top-1/2 -translate-y-1/2 shadow-md", { hidden: !canGoLeft() }),
|
|
10708
10512
|
disabled: !canGoLeft(),
|
|
10709
10513
|
onClick: () => left(),
|
|
10710
|
-
children: /* @__PURE__ */
|
|
10514
|
+
children: /* @__PURE__ */ jsx26(ChevronLeft, { size: 24 })
|
|
10711
10515
|
}
|
|
10712
10516
|
),
|
|
10713
|
-
/* @__PURE__ */
|
|
10714
|
-
|
|
10517
|
+
/* @__PURE__ */ jsx26(
|
|
10518
|
+
Button,
|
|
10715
10519
|
{
|
|
10520
|
+
layout: "icon",
|
|
10716
10521
|
color: "neutral",
|
|
10717
10522
|
className: clsx20("absolute z-10 right-2 top-1/2 -translate-y-1/2 shadow-md", { hidden: !canGoRight() }),
|
|
10718
10523
|
disabled: !canGoRight(),
|
|
10719
10524
|
onClick: () => right(),
|
|
10720
|
-
children: /* @__PURE__ */
|
|
10525
|
+
children: /* @__PURE__ */ jsx26(ChevronRight, { size: 24 })
|
|
10721
10526
|
}
|
|
10722
10527
|
)
|
|
10723
10528
|
] })
|
|
10724
10529
|
]
|
|
10725
10530
|
}
|
|
10726
10531
|
),
|
|
10727
|
-
dots && /* @__PURE__ */
|
|
10532
|
+
dots && /* @__PURE__ */ jsx26(CarouselTabs, { onChange: setCurrentIndex })
|
|
10728
10533
|
]
|
|
10729
10534
|
}
|
|
10730
10535
|
) });
|
|
@@ -10732,7 +10537,7 @@ var Carousel = ({
|
|
|
10732
10537
|
|
|
10733
10538
|
// src/components/layout/DividerInserter.tsx
|
|
10734
10539
|
import clsx21 from "clsx";
|
|
10735
|
-
import { jsx as
|
|
10540
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
10736
10541
|
var DividerInserter = ({
|
|
10737
10542
|
children,
|
|
10738
10543
|
divider,
|
|
@@ -10749,14 +10554,14 @@ var DividerInserter = ({
|
|
|
10749
10554
|
}
|
|
10750
10555
|
}
|
|
10751
10556
|
}
|
|
10752
|
-
return /* @__PURE__ */
|
|
10557
|
+
return /* @__PURE__ */ jsx27("div", { className: clsx21(className), ...restProps, children: nodes });
|
|
10753
10558
|
};
|
|
10754
10559
|
|
|
10755
10560
|
// src/components/layout/FAQSection.tsx
|
|
10756
10561
|
import clsx22 from "clsx";
|
|
10757
10562
|
|
|
10758
10563
|
// src/components/layout/MarkdownInterpreter.tsx
|
|
10759
|
-
import { Fragment as Fragment2, jsx as
|
|
10564
|
+
import { Fragment as Fragment2, jsx as jsx28 } from "react/jsx-runtime";
|
|
10760
10565
|
var astNodeInserterType = ["helpwave", "newline"];
|
|
10761
10566
|
var ASTNodeInterpreter = ({
|
|
10762
10567
|
node,
|
|
@@ -10765,27 +10570,27 @@ var ASTNodeInterpreter = ({
|
|
|
10765
10570
|
}) => {
|
|
10766
10571
|
switch (node.type) {
|
|
10767
10572
|
case "newline":
|
|
10768
|
-
return /* @__PURE__ */
|
|
10573
|
+
return /* @__PURE__ */ jsx28("br", {});
|
|
10769
10574
|
case "text":
|
|
10770
|
-
return isRoot ? /* @__PURE__ */
|
|
10575
|
+
return isRoot ? /* @__PURE__ */ jsx28("span", { className, children: node.text }) : node.text;
|
|
10771
10576
|
case "helpwave":
|
|
10772
|
-
return /* @__PURE__ */
|
|
10577
|
+
return /* @__PURE__ */ jsx28("span", { className: "font-bold font-space no-underline", children: "helpwave" });
|
|
10773
10578
|
case "none":
|
|
10774
|
-
return isRoot ? /* @__PURE__ */
|
|
10579
|
+
return isRoot ? /* @__PURE__ */ jsx28("span", { className, children: node.children.map((value, index) => /* @__PURE__ */ jsx28(
|
|
10775
10580
|
ASTNodeInterpreter,
|
|
10776
10581
|
{
|
|
10777
10582
|
node: value
|
|
10778
10583
|
},
|
|
10779
10584
|
index
|
|
10780
|
-
)) }) : /* @__PURE__ */
|
|
10585
|
+
)) }) : /* @__PURE__ */ jsx28(Fragment2, { children: node.children.map((value, index) => /* @__PURE__ */ jsx28(ASTNodeInterpreter, { node: value }, index)) });
|
|
10781
10586
|
case "bold":
|
|
10782
|
-
return /* @__PURE__ */
|
|
10587
|
+
return /* @__PURE__ */ jsx28("b", { children: node.children.map((value, index) => /* @__PURE__ */ jsx28(ASTNodeInterpreter, { node: value }, index)) });
|
|
10783
10588
|
case "italic":
|
|
10784
|
-
return /* @__PURE__ */
|
|
10589
|
+
return /* @__PURE__ */ jsx28("i", { children: node.children.map((value, index) => /* @__PURE__ */ jsx28(ASTNodeInterpreter, { node: value }, index)) });
|
|
10785
10590
|
case "underline":
|
|
10786
|
-
return /* @__PURE__ */
|
|
10591
|
+
return /* @__PURE__ */ jsx28("u", { children: node.children.map((value, index) => /* @__PURE__ */ jsx28(ASTNodeInterpreter, { node: value }, index)) });
|
|
10787
10592
|
case "font-space":
|
|
10788
|
-
return /* @__PURE__ */
|
|
10593
|
+
return /* @__PURE__ */ jsx28("span", { className: "font-space", children: node.children.map((value, index) => /* @__PURE__ */ jsx28(
|
|
10789
10594
|
ASTNodeInterpreter,
|
|
10790
10595
|
{
|
|
10791
10596
|
node: value
|
|
@@ -10793,7 +10598,7 @@ var ASTNodeInterpreter = ({
|
|
|
10793
10598
|
index
|
|
10794
10599
|
)) });
|
|
10795
10600
|
case "primary":
|
|
10796
|
-
return /* @__PURE__ */
|
|
10601
|
+
return /* @__PURE__ */ jsx28("span", { className: "text-primary", children: node.children.map((value, index) => /* @__PURE__ */ jsx28(
|
|
10797
10602
|
ASTNodeInterpreter,
|
|
10798
10603
|
{
|
|
10799
10604
|
node: value
|
|
@@ -10801,7 +10606,7 @@ var ASTNodeInterpreter = ({
|
|
|
10801
10606
|
index
|
|
10802
10607
|
)) });
|
|
10803
10608
|
case "secondary":
|
|
10804
|
-
return /* @__PURE__ */
|
|
10609
|
+
return /* @__PURE__ */ jsx28("span", { className: "text-secondary", children: node.children.map((value, index) => /* @__PURE__ */ jsx28(
|
|
10805
10610
|
ASTNodeInterpreter,
|
|
10806
10611
|
{
|
|
10807
10612
|
node: value
|
|
@@ -10809,7 +10614,7 @@ var ASTNodeInterpreter = ({
|
|
|
10809
10614
|
index
|
|
10810
10615
|
)) });
|
|
10811
10616
|
case "warn":
|
|
10812
|
-
return /* @__PURE__ */
|
|
10617
|
+
return /* @__PURE__ */ jsx28("span", { className: "text-warning", children: node.children.map((value, index) => /* @__PURE__ */ jsx28(
|
|
10813
10618
|
ASTNodeInterpreter,
|
|
10814
10619
|
{
|
|
10815
10620
|
node: value
|
|
@@ -10817,7 +10622,7 @@ var ASTNodeInterpreter = ({
|
|
|
10817
10622
|
index
|
|
10818
10623
|
)) });
|
|
10819
10624
|
case "positive":
|
|
10820
|
-
return /* @__PURE__ */
|
|
10625
|
+
return /* @__PURE__ */ jsx28("span", { className: "text-positive", children: node.children.map((value, index) => /* @__PURE__ */ jsx28(
|
|
10821
10626
|
ASTNodeInterpreter,
|
|
10822
10627
|
{
|
|
10823
10628
|
node: value
|
|
@@ -10825,7 +10630,7 @@ var ASTNodeInterpreter = ({
|
|
|
10825
10630
|
index
|
|
10826
10631
|
)) });
|
|
10827
10632
|
case "negative":
|
|
10828
|
-
return /* @__PURE__ */
|
|
10633
|
+
return /* @__PURE__ */ jsx28("span", { className: "text-negative", children: node.children.map((value, index) => /* @__PURE__ */ jsx28(
|
|
10829
10634
|
ASTNodeInterpreter,
|
|
10830
10635
|
{
|
|
10831
10636
|
node: value
|
|
@@ -10983,24 +10788,24 @@ var optimizeTree = (node) => {
|
|
|
10983
10788
|
var MarkdownInterpreter = ({ text, className }) => {
|
|
10984
10789
|
const tree = parseMarkdown(text);
|
|
10985
10790
|
const optimizedTree = optimizeTree(tree);
|
|
10986
|
-
return /* @__PURE__ */
|
|
10791
|
+
return /* @__PURE__ */ jsx28(ASTNodeInterpreter, { node: optimizedTree, isRoot: true, className });
|
|
10987
10792
|
};
|
|
10988
10793
|
|
|
10989
10794
|
// src/components/layout/FAQSection.tsx
|
|
10990
|
-
import { jsx as
|
|
10795
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
10991
10796
|
var FAQSection = ({
|
|
10992
10797
|
entries,
|
|
10993
10798
|
expandableClassName
|
|
10994
10799
|
}) => {
|
|
10995
|
-
return /* @__PURE__ */
|
|
10800
|
+
return /* @__PURE__ */ jsx29("ul", { className: "flex-col-4", children: entries.map(({ id, title, content, ...restProps }) => /* @__PURE__ */ jsx29("li", { children: /* @__PURE__ */ jsx29(
|
|
10996
10801
|
ExpandableUncontrolled,
|
|
10997
10802
|
{
|
|
10998
10803
|
...restProps,
|
|
10999
|
-
label: /* @__PURE__ */
|
|
10804
|
+
label: /* @__PURE__ */ jsx29("span", { id, className: "typography-title-md", children: title }),
|
|
11000
10805
|
clickOnlyOnHeader: false,
|
|
11001
|
-
icon: (expanded) => /* @__PURE__ */
|
|
10806
|
+
icon: (expanded) => /* @__PURE__ */ jsx29(ExpansionIcon, { isExpanded: expanded, className: "text-primary" }),
|
|
11002
10807
|
className: clsx22("rounded-xl", expandableClassName),
|
|
11003
|
-
children: /* @__PURE__ */
|
|
10808
|
+
children: /* @__PURE__ */ jsx29("div", { className: "mt-2", children: content.type === "markdown" ? /* @__PURE__ */ jsx29(MarkdownInterpreter, { text: content.value }) : content.value })
|
|
11004
10809
|
},
|
|
11005
10810
|
id
|
|
11006
10811
|
) }, id)) });
|
|
@@ -11010,7 +10815,7 @@ var FAQSection = ({
|
|
|
11010
10815
|
import { forwardRef as forwardRef6, useImperativeHandle as useImperativeHandle3, useRef as useRef8 } from "react";
|
|
11011
10816
|
import { createPortal as createPortal3 } from "react-dom";
|
|
11012
10817
|
import { clsx as clsx23 } from "clsx";
|
|
11013
|
-
import { Fragment as Fragment3, jsx as
|
|
10818
|
+
import { Fragment as Fragment3, jsx as jsx30, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
11014
10819
|
var FloatingContainer = forwardRef6(function FloatingContainer2({
|
|
11015
10820
|
children,
|
|
11016
10821
|
backgroundOverlay,
|
|
@@ -11039,7 +10844,7 @@ var FloatingContainer = forwardRef6(function FloatingContainer2({
|
|
|
11039
10844
|
return createPortal3(
|
|
11040
10845
|
/* @__PURE__ */ jsxs18(Fragment3, { children: [
|
|
11041
10846
|
backgroundOverlay,
|
|
11042
|
-
/* @__PURE__ */
|
|
10847
|
+
/* @__PURE__ */ jsx30(
|
|
11043
10848
|
"div",
|
|
11044
10849
|
{
|
|
11045
10850
|
...props,
|
|
@@ -11064,9 +10869,9 @@ var FloatingContainer = forwardRef6(function FloatingContainer2({
|
|
|
11064
10869
|
});
|
|
11065
10870
|
|
|
11066
10871
|
// src/components/layout/ListBox.tsx
|
|
11067
|
-
import React4, { createContext as createContext5, forwardRef as forwardRef7, useCallback as useCallback10, useContext as useContext5, useEffect as
|
|
10872
|
+
import React4, { createContext as createContext5, forwardRef as forwardRef7, useCallback as useCallback10, useContext as useContext5, useEffect as useEffect18, useRef as useRef9, useState as useState18 } from "react";
|
|
11068
10873
|
import { clsx as clsx24 } from "clsx";
|
|
11069
|
-
import { jsx as
|
|
10874
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
11070
10875
|
var ListBoxContext = createContext5(null);
|
|
11071
10876
|
function useListBoxContext() {
|
|
11072
10877
|
const ctx = useContext5(ListBoxContext);
|
|
@@ -11087,13 +10892,13 @@ var ListBoxItem = forwardRef7(
|
|
|
11087
10892
|
} = useListBoxContext();
|
|
11088
10893
|
const itemRef = useRef9(null);
|
|
11089
10894
|
const id = React4.useId();
|
|
11090
|
-
|
|
10895
|
+
useEffect18(() => {
|
|
11091
10896
|
registerItem({ id, value, disabled, ref: itemRef });
|
|
11092
10897
|
return () => unregisterItem(id);
|
|
11093
10898
|
}, [id, value, disabled, registerItem, unregisterItem]);
|
|
11094
10899
|
const isHighlighted = highlightedId === id;
|
|
11095
10900
|
const selected = isSelected(value);
|
|
11096
|
-
return /* @__PURE__ */
|
|
10901
|
+
return /* @__PURE__ */ jsx31(
|
|
11097
10902
|
"li",
|
|
11098
10903
|
{
|
|
11099
10904
|
ref: (node) => {
|
|
@@ -11140,7 +10945,7 @@ var ListBoxPrimitive = forwardRef7(
|
|
|
11140
10945
|
...props
|
|
11141
10946
|
}, ref) {
|
|
11142
10947
|
const itemsRef = useRef9([]);
|
|
11143
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
10948
|
+
const [highlightedIndex, setHighlightedIndex] = useState18(void 0);
|
|
11144
10949
|
const registerItem = useCallback10((item) => {
|
|
11145
10950
|
itemsRef.current.push(item);
|
|
11146
10951
|
itemsRef.current.sort((a, b) => {
|
|
@@ -11187,7 +10992,7 @@ var ListBoxPrimitive = forwardRef7(
|
|
|
11187
10992
|
setHighlightedIndex(index);
|
|
11188
10993
|
}
|
|
11189
10994
|
}, []);
|
|
11190
|
-
|
|
10995
|
+
useEffect18(() => {
|
|
11191
10996
|
if (highlightedIndex !== void 0) {
|
|
11192
10997
|
itemsRef.current[highlightedIndex]?.ref.current?.scrollIntoView({ block: "nearest", behavior: "auto" });
|
|
11193
10998
|
}
|
|
@@ -11210,7 +11015,7 @@ var ListBoxPrimitive = forwardRef7(
|
|
|
11210
11015
|
}
|
|
11211
11016
|
setHighlightedIndex(nextIndex);
|
|
11212
11017
|
};
|
|
11213
|
-
return /* @__PURE__ */
|
|
11018
|
+
return /* @__PURE__ */ jsx31(ListBoxContext.Provider, { value: ctxValue, children: /* @__PURE__ */ jsx31(
|
|
11214
11019
|
"ul",
|
|
11215
11020
|
{
|
|
11216
11021
|
ref,
|
|
@@ -11275,7 +11080,7 @@ var ListBoxPrimitive = forwardRef7(
|
|
|
11275
11080
|
}
|
|
11276
11081
|
);
|
|
11277
11082
|
var ListBoxMultiple = ({ ...props }) => {
|
|
11278
|
-
return /* @__PURE__ */
|
|
11083
|
+
return /* @__PURE__ */ jsx31(ListBoxPrimitive, { ...props });
|
|
11279
11084
|
};
|
|
11280
11085
|
var ListBoxMultipleUncontrolled = ({
|
|
11281
11086
|
value: initialValue,
|
|
@@ -11283,7 +11088,7 @@ var ListBoxMultipleUncontrolled = ({
|
|
|
11283
11088
|
...props
|
|
11284
11089
|
}) => {
|
|
11285
11090
|
const [value, setValue] = useOverwritableState(initialValue, onSelectionChanged);
|
|
11286
|
-
return /* @__PURE__ */
|
|
11091
|
+
return /* @__PURE__ */ jsx31(
|
|
11287
11092
|
ListBoxMultiple,
|
|
11288
11093
|
{
|
|
11289
11094
|
...props,
|
|
@@ -11297,7 +11102,7 @@ var ListBox = forwardRef7(function ListBox2({
|
|
|
11297
11102
|
onSelectionChanged,
|
|
11298
11103
|
...props
|
|
11299
11104
|
}, ref) {
|
|
11300
|
-
return /* @__PURE__ */
|
|
11105
|
+
return /* @__PURE__ */ jsx31(
|
|
11301
11106
|
ListBoxPrimitive,
|
|
11302
11107
|
{
|
|
11303
11108
|
ref,
|
|
@@ -11316,7 +11121,7 @@ var ListBoxUncontrolled = ({
|
|
|
11316
11121
|
...props
|
|
11317
11122
|
}) => {
|
|
11318
11123
|
const [value, setValue] = useOverwritableState(initialValue, onSelectionChanged);
|
|
11319
|
-
return /* @__PURE__ */
|
|
11124
|
+
return /* @__PURE__ */ jsx31(
|
|
11320
11125
|
ListBox,
|
|
11321
11126
|
{
|
|
11322
11127
|
...props,
|
|
@@ -11328,9 +11133,9 @@ var ListBoxUncontrolled = ({
|
|
|
11328
11133
|
|
|
11329
11134
|
// src/components/layout/TabView.tsx
|
|
11330
11135
|
import { useId as useId7 } from "react";
|
|
11331
|
-
import { createContext as createContext6, useContext as useContext6, useState as
|
|
11136
|
+
import { createContext as createContext6, useContext as useContext6, useState as useState19, useEffect as useEffect19, useRef as useRef10 } from "react";
|
|
11332
11137
|
import clsx25 from "clsx";
|
|
11333
|
-
import { jsx as
|
|
11138
|
+
import { jsx as jsx32, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
11334
11139
|
var TabContext = createContext6(null);
|
|
11335
11140
|
function useTabContext() {
|
|
11336
11141
|
const ctx = useContext6(TabContext);
|
|
@@ -11338,8 +11143,8 @@ function useTabContext() {
|
|
|
11338
11143
|
return ctx;
|
|
11339
11144
|
}
|
|
11340
11145
|
function TabView({ children, outerDivProps, onTabChanged, initialTabIndex = 0, ...props }) {
|
|
11341
|
-
const [tabs, setTabs] =
|
|
11342
|
-
const [active, setActiveState] =
|
|
11146
|
+
const [tabs, setTabs] = useState19([]);
|
|
11147
|
+
const [active, setActiveState] = useState19(null);
|
|
11343
11148
|
const buttonRefs = useRef10({});
|
|
11344
11149
|
const setActive = (id) => {
|
|
11345
11150
|
setActiveState(id);
|
|
@@ -11374,8 +11179,8 @@ function TabView({ children, outerDivProps, onTabChanged, initialTabIndex = 0, .
|
|
|
11374
11179
|
buttonRefs.current[nextId]?.focus();
|
|
11375
11180
|
};
|
|
11376
11181
|
const value = { active, setActive, register, unregister, tabs };
|
|
11377
|
-
return /* @__PURE__ */
|
|
11378
|
-
/* @__PURE__ */
|
|
11182
|
+
return /* @__PURE__ */ jsx32(TabContext.Provider, { value, children: /* @__PURE__ */ jsxs19("div", { ...outerDivProps, className: clsx25("w-full", props.className), children: [
|
|
11183
|
+
/* @__PURE__ */ jsx32("div", { role: "tablist", ...props, className: clsx25("flex-row-0"), children: tabs.map((t) => /* @__PURE__ */ jsx32(
|
|
11379
11184
|
"button",
|
|
11380
11185
|
{
|
|
11381
11186
|
role: "tab",
|
|
@@ -11387,7 +11192,7 @@ function TabView({ children, outerDivProps, onTabChanged, initialTabIndex = 0, .
|
|
|
11387
11192
|
onClick: () => setActive(t.id),
|
|
11388
11193
|
onKeyDown: (e) => onKeyDown(e, t.id),
|
|
11389
11194
|
className: clsx25(
|
|
11390
|
-
"flex-row-0 grow justify-center px-3 pb-
|
|
11195
|
+
"flex-row-0 grow justify-center px-3 pb-2.25 typography-label-md font-bold border-b-2",
|
|
11391
11196
|
active === t.id ? "border-primary" : "text-description hover:text-on-background"
|
|
11392
11197
|
),
|
|
11393
11198
|
children: t.label
|
|
@@ -11401,11 +11206,11 @@ function Tab({ id: customId, label, children, ...props }) {
|
|
|
11401
11206
|
const { active, register, unregister } = useTabContext();
|
|
11402
11207
|
const generatedId = useId7();
|
|
11403
11208
|
const id = customId ?? generatedId;
|
|
11404
|
-
|
|
11209
|
+
useEffect19(() => {
|
|
11405
11210
|
register(id, label);
|
|
11406
11211
|
return () => unregister(id);
|
|
11407
11212
|
}, [id, label]);
|
|
11408
|
-
return /* @__PURE__ */
|
|
11213
|
+
return /* @__PURE__ */ jsx32(
|
|
11409
11214
|
"div",
|
|
11410
11215
|
{
|
|
11411
11216
|
role: "tabpanel",
|
|
@@ -11421,7 +11226,7 @@ function Tab({ id: customId, label, children, ...props }) {
|
|
|
11421
11226
|
|
|
11422
11227
|
// src/components/layout/TextImage.tsx
|
|
11423
11228
|
import clsx26 from "clsx";
|
|
11424
|
-
import { jsx as
|
|
11229
|
+
import { jsx as jsx33, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
11425
11230
|
var TextImage = ({
|
|
11426
11231
|
title,
|
|
11427
11232
|
description,
|
|
@@ -11443,7 +11248,7 @@ var TextImage = ({
|
|
|
11443
11248
|
secondary: "text-text-image-secondary-text bg-linear-to-r from-30% from-text-image-secondary-background to-text-image-secondary-background/55",
|
|
11444
11249
|
dark: "text-text-image-dark-text bg-linear-to-r from-30% from-text-image-dark-background to-text-image-dark-background/55"
|
|
11445
11250
|
};
|
|
11446
|
-
return /* @__PURE__ */
|
|
11251
|
+
return /* @__PURE__ */ jsx33(
|
|
11447
11252
|
"div",
|
|
11448
11253
|
{
|
|
11449
11254
|
className: clsx26("rounded-2xl w-full", className),
|
|
@@ -11456,12 +11261,12 @@ var TextImage = ({
|
|
|
11456
11261
|
{
|
|
11457
11262
|
className: clsx26(`flex-col-2 px-6 py-12 rounded-2xl h-full`, colorMapping[color], contentClassName),
|
|
11458
11263
|
children: [
|
|
11459
|
-
badge && /* @__PURE__ */
|
|
11264
|
+
badge && /* @__PURE__ */ jsx33("div", { className: clsx26(`chip-full mb-2 py-2 px-4 w-fit`, chipColorMapping[color]), children: /* @__PURE__ */ jsx33("span", { className: "text-lg font-bold", children: badge }) }),
|
|
11460
11265
|
/* @__PURE__ */ jsxs20("div", { className: "flex-col-1 overflow-hidden", children: [
|
|
11461
|
-
/* @__PURE__ */
|
|
11462
|
-
/* @__PURE__ */
|
|
11266
|
+
/* @__PURE__ */ jsx33("span", { className: "typography-title-lg", children: title }),
|
|
11267
|
+
/* @__PURE__ */ jsx33("span", { className: "text-ellipsis overflow-hidden", children: description })
|
|
11463
11268
|
] }),
|
|
11464
|
-
onShowMoreClicked && /* @__PURE__ */
|
|
11269
|
+
onShowMoreClicked && /* @__PURE__ */ jsx33("div", { className: "flex-row-2 mt-2 underline", children: /* @__PURE__ */ jsx33("button", { onClick: onShowMoreClicked, children: translation("showMore") }) })
|
|
11465
11270
|
]
|
|
11466
11271
|
}
|
|
11467
11272
|
)
|
|
@@ -11470,7 +11275,7 @@ var TextImage = ({
|
|
|
11470
11275
|
};
|
|
11471
11276
|
|
|
11472
11277
|
// src/components/layout/VerticalDivider.tsx
|
|
11473
|
-
import { jsx as
|
|
11278
|
+
import { jsx as jsx34, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
11474
11279
|
var VerticalDivider = ({
|
|
11475
11280
|
width = 1,
|
|
11476
11281
|
height = 100,
|
|
@@ -11478,7 +11283,7 @@ var VerticalDivider = ({
|
|
|
11478
11283
|
dashGap = 4,
|
|
11479
11284
|
dashLength = 4
|
|
11480
11285
|
}) => {
|
|
11481
|
-
return /* @__PURE__ */
|
|
11286
|
+
return /* @__PURE__ */ jsx34("div", { style: { width: width + "px", height: height + "px" }, children: /* @__PURE__ */ jsxs21(
|
|
11482
11287
|
"svg",
|
|
11483
11288
|
{
|
|
11484
11289
|
width,
|
|
@@ -11487,7 +11292,7 @@ var VerticalDivider = ({
|
|
|
11487
11292
|
fill: "none",
|
|
11488
11293
|
xmlns: "http://www.w3.org/2000/svg",
|
|
11489
11294
|
children: [
|
|
11490
|
-
/* @__PURE__ */
|
|
11295
|
+
/* @__PURE__ */ jsx34(
|
|
11491
11296
|
"line",
|
|
11492
11297
|
{
|
|
11493
11298
|
opacity: "0.5",
|
|
@@ -11501,7 +11306,7 @@ var VerticalDivider = ({
|
|
|
11501
11306
|
strokeLinecap: "round"
|
|
11502
11307
|
}
|
|
11503
11308
|
),
|
|
11504
|
-
/* @__PURE__ */
|
|
11309
|
+
/* @__PURE__ */ jsx34("defs", { children: /* @__PURE__ */ jsxs21(
|
|
11505
11310
|
"linearGradient",
|
|
11506
11311
|
{
|
|
11507
11312
|
id: "paint_linear",
|
|
@@ -11511,9 +11316,9 @@ var VerticalDivider = ({
|
|
|
11511
11316
|
y2: height,
|
|
11512
11317
|
gradientUnits: "userSpaceOnUse",
|
|
11513
11318
|
children: [
|
|
11514
|
-
/* @__PURE__ */
|
|
11515
|
-
/* @__PURE__ */
|
|
11516
|
-
/* @__PURE__ */
|
|
11319
|
+
/* @__PURE__ */ jsx34("stop", { stopOpacity: "0", stopColor: "currentColor" }),
|
|
11320
|
+
/* @__PURE__ */ jsx34("stop", { offset: "0.5", stopColor: "currentColor" }),
|
|
11321
|
+
/* @__PURE__ */ jsx34("stop", { offset: "1", stopColor: "currentColor", stopOpacity: "0" })
|
|
11517
11322
|
]
|
|
11518
11323
|
}
|
|
11519
11324
|
) })
|
|
@@ -11525,31 +11330,31 @@ var VerticalDivider = ({
|
|
|
11525
11330
|
// src/components/loading-states/ErrorComponent.tsx
|
|
11526
11331
|
import { AlertOctagon } from "lucide-react";
|
|
11527
11332
|
import clsx27 from "clsx";
|
|
11528
|
-
import { jsx as
|
|
11333
|
+
import { jsx as jsx35, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
11529
11334
|
var ErrorComponent = ({
|
|
11530
11335
|
errorText,
|
|
11531
11336
|
classname
|
|
11532
11337
|
}) => {
|
|
11533
11338
|
const translation = useHightideTranslation();
|
|
11534
11339
|
return /* @__PURE__ */ jsxs22("div", { className: clsx27("flex-col-4 items-center justify-center w-full h-24", classname), children: [
|
|
11535
|
-
/* @__PURE__ */
|
|
11340
|
+
/* @__PURE__ */ jsx35(AlertOctagon, { size: 64, className: "text-warning" }),
|
|
11536
11341
|
errorText ?? `${translation("errorOccurred")} :(`
|
|
11537
11342
|
] });
|
|
11538
11343
|
};
|
|
11539
11344
|
|
|
11540
11345
|
// src/components/loading-states/LoadingAndErrorComponent.tsx
|
|
11541
|
-
import { useState as
|
|
11346
|
+
import { useState as useState20 } from "react";
|
|
11542
11347
|
|
|
11543
11348
|
// src/components/loading-states/LoadingContainer.tsx
|
|
11544
11349
|
import { clsx as clsx28 } from "clsx";
|
|
11545
|
-
import { jsx as
|
|
11350
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
11546
11351
|
var LoadingContainer = ({ className }) => {
|
|
11547
|
-
return /* @__PURE__ */
|
|
11352
|
+
return /* @__PURE__ */ jsx36("div", { className: clsx28("relative overflow-hidden shimmer bg-disabled/30 rounded-md", className) });
|
|
11548
11353
|
};
|
|
11549
11354
|
|
|
11550
11355
|
// src/components/loading-states/LoadingAndErrorComponent.tsx
|
|
11551
11356
|
import { clsx as clsx29 } from "clsx";
|
|
11552
|
-
import { jsx as
|
|
11357
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
11553
11358
|
var LoadingAndErrorComponent = ({
|
|
11554
11359
|
children,
|
|
11555
11360
|
isLoading = false,
|
|
@@ -11559,8 +11364,8 @@ var LoadingAndErrorComponent = ({
|
|
|
11559
11364
|
minimumLoadingDuration = 200,
|
|
11560
11365
|
className
|
|
11561
11366
|
}) => {
|
|
11562
|
-
const [isInMinimumLoading, setIsInMinimumLoading] =
|
|
11563
|
-
const [hasUsedMinimumLoading, setHasUsedMinimumLoading] =
|
|
11367
|
+
const [isInMinimumLoading, setIsInMinimumLoading] = useState20(false);
|
|
11368
|
+
const [hasUsedMinimumLoading, setHasUsedMinimumLoading] = useState20(false);
|
|
11564
11369
|
if (minimumLoadingDuration && !isInMinimumLoading && !hasUsedMinimumLoading) {
|
|
11565
11370
|
setIsInMinimumLoading(true);
|
|
11566
11371
|
setTimeout(() => {
|
|
@@ -11569,41 +11374,40 @@ var LoadingAndErrorComponent = ({
|
|
|
11569
11374
|
}, minimumLoadingDuration);
|
|
11570
11375
|
}
|
|
11571
11376
|
if (isLoading || minimumLoadingDuration && isInMinimumLoading) {
|
|
11572
|
-
return loadingComponent ?? /* @__PURE__ */
|
|
11377
|
+
return loadingComponent ?? /* @__PURE__ */ jsx37(LoadingContainer, { className: clsx29(className) });
|
|
11573
11378
|
}
|
|
11574
11379
|
if (hasError) {
|
|
11575
|
-
return errorComponent ?? /* @__PURE__ */
|
|
11380
|
+
return errorComponent ?? /* @__PURE__ */ jsx37(LoadingContainer, { className: clsx29("bg-negative", className) });
|
|
11576
11381
|
}
|
|
11577
11382
|
return children;
|
|
11578
11383
|
};
|
|
11579
11384
|
|
|
11580
11385
|
// src/components/loading-states/LoadingAnimation.tsx
|
|
11581
11386
|
import clsx30 from "clsx";
|
|
11582
|
-
import { jsx as
|
|
11387
|
+
import { jsx as jsx38, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
11583
11388
|
var LoadingAnimation = ({
|
|
11584
11389
|
loadingText,
|
|
11585
11390
|
classname
|
|
11586
11391
|
}) => {
|
|
11587
11392
|
const translation = useHightideTranslation();
|
|
11588
11393
|
return /* @__PURE__ */ jsxs23("div", { className: clsx30("flex-col-2 items-center justify-center w-full h-24", classname), children: [
|
|
11589
|
-
/* @__PURE__ */
|
|
11394
|
+
/* @__PURE__ */ jsx38(HelpwaveLogo, { animate: "loading" }),
|
|
11590
11395
|
loadingText ?? `${translation("loading")}...`
|
|
11591
11396
|
] });
|
|
11592
11397
|
};
|
|
11593
11398
|
|
|
11594
11399
|
// src/components/loading-states/LoadingButton.tsx
|
|
11595
11400
|
import clsx31 from "clsx";
|
|
11596
|
-
import { jsx as
|
|
11401
|
+
import { jsx as jsx39, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
11597
11402
|
var LoadingButton = ({ isLoading = false, size = "medium", onClick, ...rest }) => {
|
|
11598
|
-
const paddingClass = ButtonUtil.paddingMapping[size];
|
|
11599
11403
|
return /* @__PURE__ */ jsxs24("div", { className: "inline-block relative", children: [
|
|
11600
|
-
isLoading && /* @__PURE__ */
|
|
11601
|
-
/* @__PURE__ */
|
|
11404
|
+
isLoading && /* @__PURE__ */ jsx39("div", { className: clsx31("flex-row-2 absolute inset-0 items-center justify-center bg-white/40"), children: /* @__PURE__ */ jsx39(HelpwaveLogo, { animate: "loading", className: "text-white" }) }),
|
|
11405
|
+
/* @__PURE__ */ jsx39(Button, { ...rest, size, disabled: rest.disabled, onClick })
|
|
11602
11406
|
] });
|
|
11603
11407
|
};
|
|
11604
11408
|
|
|
11605
11409
|
// src/components/loading-states/ProgressIndicator.tsx
|
|
11606
|
-
import { jsx as
|
|
11410
|
+
import { jsx as jsx40, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
11607
11411
|
var sizeMapping = { small: 16, medium: 24, big: 48 };
|
|
11608
11412
|
var ProgressIndicator = ({
|
|
11609
11413
|
progress,
|
|
@@ -11629,7 +11433,7 @@ var ProgressIndicator = ({
|
|
|
11629
11433
|
transform: `rotate(${rotation}deg)`
|
|
11630
11434
|
},
|
|
11631
11435
|
children: [
|
|
11632
|
-
/* @__PURE__ */
|
|
11436
|
+
/* @__PURE__ */ jsx40(
|
|
11633
11437
|
"circle",
|
|
11634
11438
|
{
|
|
11635
11439
|
cx: center,
|
|
@@ -11640,7 +11444,7 @@ var ProgressIndicator = ({
|
|
|
11640
11444
|
className: "stroke-progress-indicator-fill"
|
|
11641
11445
|
}
|
|
11642
11446
|
),
|
|
11643
|
-
/* @__PURE__ */
|
|
11447
|
+
/* @__PURE__ */ jsx40(
|
|
11644
11448
|
"circle",
|
|
11645
11449
|
{
|
|
11646
11450
|
cx: center,
|
|
@@ -11662,21 +11466,27 @@ var ProgressIndicator = ({
|
|
|
11662
11466
|
var import_link = __toESM(require_link2());
|
|
11663
11467
|
import clsx32 from "clsx";
|
|
11664
11468
|
import { Fragment as Fragment4 } from "react";
|
|
11665
|
-
import { jsx as
|
|
11469
|
+
import { jsx as jsx41, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
11666
11470
|
var BreadCrumb = ({ crumbs, linkClassName, containerClassName }) => {
|
|
11667
|
-
|
|
11668
|
-
return /* @__PURE__ */ jsx42("div", { className: clsx32("flex-row-0.5 items-center", containerClassName), children: crumbs.map((crumb, index) => {
|
|
11471
|
+
return /* @__PURE__ */ jsx41("div", { className: clsx32("flex-row-0.5 items-center", containerClassName), children: crumbs.map((crumb, index) => {
|
|
11669
11472
|
const isLast = index === crumbs.length - 1;
|
|
11670
11473
|
return /* @__PURE__ */ jsxs26(Fragment4, { children: [
|
|
11671
|
-
/* @__PURE__ */
|
|
11474
|
+
/* @__PURE__ */ jsx41(
|
|
11672
11475
|
import_link.default,
|
|
11673
11476
|
{
|
|
11674
11477
|
href: crumb.link,
|
|
11675
|
-
className: clsx32(
|
|
11478
|
+
className: clsx32(
|
|
11479
|
+
"btn-sm coloring-text-hover",
|
|
11480
|
+
{
|
|
11481
|
+
description: !isLast,
|
|
11482
|
+
neutral: isLast
|
|
11483
|
+
},
|
|
11484
|
+
linkClassName
|
|
11485
|
+
),
|
|
11676
11486
|
children: crumb.display
|
|
11677
11487
|
}
|
|
11678
11488
|
),
|
|
11679
|
-
!isLast && /* @__PURE__ */
|
|
11489
|
+
!isLast && /* @__PURE__ */ jsx41("span", { className: clsx32(`px-1`, "text-description"), children: "/" })
|
|
11680
11490
|
] }, index);
|
|
11681
11491
|
}) });
|
|
11682
11492
|
};
|
|
@@ -11684,10 +11494,10 @@ var BreadCrumb = ({ crumbs, linkClassName, containerClassName }) => {
|
|
|
11684
11494
|
// src/components/navigation/Navigation.tsx
|
|
11685
11495
|
var import_link2 = __toESM(require_link2());
|
|
11686
11496
|
import { Menu as MenuIcon, XIcon as XIcon2 } from "lucide-react";
|
|
11687
|
-
import { useEffect as
|
|
11688
|
-
import { useCallback as useCallback11, useId as useId8, useRef as useRef11, useState as
|
|
11497
|
+
import { useEffect as useEffect20 } from "react";
|
|
11498
|
+
import { useCallback as useCallback11, useId as useId8, useRef as useRef11, useState as useState21 } from "react";
|
|
11689
11499
|
import clsx33 from "clsx";
|
|
11690
|
-
import { Fragment as Fragment5, jsx as
|
|
11500
|
+
import { Fragment as Fragment5, jsx as jsx42, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
11691
11501
|
function isSubItem(item) {
|
|
11692
11502
|
return "items" in item && Array.isArray(item.items);
|
|
11693
11503
|
}
|
|
@@ -11697,7 +11507,7 @@ var NavigationItemWithSubItem = ({
|
|
|
11697
11507
|
horizontalAlignment = "center",
|
|
11698
11508
|
...options
|
|
11699
11509
|
}) => {
|
|
11700
|
-
const [isOpen, setOpen] =
|
|
11510
|
+
const [isOpen, setOpen] = useState21(false);
|
|
11701
11511
|
const containerRef = useRef11();
|
|
11702
11512
|
const triggerRef = useRef11(null);
|
|
11703
11513
|
const id = useId8();
|
|
@@ -11714,6 +11524,7 @@ var NavigationItemWithSubItem = ({
|
|
|
11714
11524
|
setOpen(false);
|
|
11715
11525
|
}
|
|
11716
11526
|
}, []);
|
|
11527
|
+
const zIndex = useZIndexRegister(isOpen);
|
|
11717
11528
|
return /* @__PURE__ */ jsxs27(Fragment5, { children: [
|
|
11718
11529
|
/* @__PURE__ */ jsxs27(
|
|
11719
11530
|
"button",
|
|
@@ -11730,11 +11541,11 @@ var NavigationItemWithSubItem = ({
|
|
|
11730
11541
|
"aria-controls": "navigation-items-" + id,
|
|
11731
11542
|
children: [
|
|
11732
11543
|
label,
|
|
11733
|
-
/* @__PURE__ */
|
|
11544
|
+
/* @__PURE__ */ jsx42(ExpansionIcon, { isExpanded: isOpen })
|
|
11734
11545
|
]
|
|
11735
11546
|
}
|
|
11736
11547
|
),
|
|
11737
|
-
/* @__PURE__ */
|
|
11548
|
+
/* @__PURE__ */ jsx42(
|
|
11738
11549
|
"ul",
|
|
11739
11550
|
{
|
|
11740
11551
|
id: "navigation-items-" + id,
|
|
@@ -11749,11 +11560,11 @@ var NavigationItemWithSubItem = ({
|
|
|
11749
11560
|
onBlur,
|
|
11750
11561
|
hidden: !isOpen,
|
|
11751
11562
|
className: clsx33(
|
|
11752
|
-
"fixed flex-col-4 p-4 bg-surface text-on-surface shadow-side shadow-hw-bottom rounded-md
|
|
11563
|
+
"fixed flex-col-4 p-4 bg-surface text-on-surface shadow-side shadow-hw-bottom rounded-md",
|
|
11753
11564
|
{ "opacity-0": !style }
|
|
11754
11565
|
),
|
|
11755
|
-
style,
|
|
11756
|
-
children: items.map(({ link, label: label2, external }, index) => /* @__PURE__ */
|
|
11566
|
+
style: { ...style, zIndex },
|
|
11567
|
+
children: items.map(({ link, label: label2, external }, index) => /* @__PURE__ */ jsx42("li", { children: /* @__PURE__ */ jsx42(
|
|
11757
11568
|
import_link2.default,
|
|
11758
11569
|
{
|
|
11759
11570
|
href: link,
|
|
@@ -11767,33 +11578,36 @@ var NavigationItemWithSubItem = ({
|
|
|
11767
11578
|
] });
|
|
11768
11579
|
};
|
|
11769
11580
|
var NavigationItemList = ({ items, ...restProps }) => {
|
|
11770
|
-
return /* @__PURE__ */
|
|
11581
|
+
return /* @__PURE__ */ jsx42("ul", { ...restProps, className: clsx33("flex-row-6 items-center", restProps.className), children: items.map((item, index) => /* @__PURE__ */ jsx42("li", { children: isSubItem(item) ? /* @__PURE__ */ jsx42(NavigationItemWithSubItem, { ...item }) : /* @__PURE__ */ jsx42(import_link2.default, { href: item.link, target: item.external ? "_blank" : void 0, className: "link", children: item.label }) }, index)) });
|
|
11771
11582
|
};
|
|
11772
11583
|
var Navigation = ({ ...props }) => {
|
|
11773
|
-
const [isMobileOpen, setIsMobileOpen] =
|
|
11584
|
+
const [isMobileOpen, setIsMobileOpen] = useState21(false);
|
|
11774
11585
|
const id = useId8();
|
|
11775
11586
|
const menuRef = useRef11(null);
|
|
11776
|
-
|
|
11587
|
+
useEffect20(() => {
|
|
11777
11588
|
menuRef.current?.focus();
|
|
11778
11589
|
}, [isMobileOpen]);
|
|
11590
|
+
const zIndex = useZIndexRegister(isMobileOpen);
|
|
11779
11591
|
return /* @__PURE__ */ jsxs27("nav", { children: [
|
|
11780
|
-
/* @__PURE__ */
|
|
11592
|
+
/* @__PURE__ */ jsx42(
|
|
11781
11593
|
NavigationItemList,
|
|
11782
11594
|
{
|
|
11783
11595
|
...props,
|
|
11784
11596
|
className: clsx33("hidden", { "desktop:flex": !isMobileOpen }, props.className)
|
|
11785
11597
|
}
|
|
11786
11598
|
),
|
|
11787
|
-
/* @__PURE__ */
|
|
11788
|
-
|
|
11599
|
+
/* @__PURE__ */ jsx42(
|
|
11600
|
+
Button,
|
|
11789
11601
|
{
|
|
11790
|
-
|
|
11602
|
+
layout: "icon",
|
|
11603
|
+
coloringStyle: "text",
|
|
11604
|
+
color: "neutral",
|
|
11791
11605
|
onClick: () => setIsMobileOpen(true),
|
|
11792
11606
|
className: "desktop:hidden",
|
|
11793
11607
|
"aria-haspopup": "true",
|
|
11794
11608
|
"aria-expanded": isMobileOpen,
|
|
11795
11609
|
"aria-controls": "navigation-menu-" + id,
|
|
11796
|
-
children: /* @__PURE__ */
|
|
11610
|
+
children: /* @__PURE__ */ jsx42(MenuIcon, { className: "w-6 h-6" })
|
|
11797
11611
|
}
|
|
11798
11612
|
),
|
|
11799
11613
|
/* @__PURE__ */ jsxs27(
|
|
@@ -11810,15 +11624,25 @@ var Navigation = ({ ...props }) => {
|
|
|
11810
11624
|
}
|
|
11811
11625
|
},
|
|
11812
11626
|
className: clsx33(
|
|
11813
|
-
"flex-col-8 items-center justify-center fixed inset-0 p-8 w-screen h-screen
|
|
11627
|
+
"flex-col-8 items-center justify-center fixed inset-0 p-8 w-screen h-screen bg-surface text-on-surface",
|
|
11814
11628
|
{
|
|
11815
11629
|
"desktop:hidden": isMobileOpen
|
|
11816
11630
|
},
|
|
11817
11631
|
props.className
|
|
11818
11632
|
),
|
|
11633
|
+
style: { zIndex },
|
|
11819
11634
|
children: [
|
|
11820
|
-
/* @__PURE__ */
|
|
11821
|
-
|
|
11635
|
+
/* @__PURE__ */ jsx42(
|
|
11636
|
+
Button,
|
|
11637
|
+
{
|
|
11638
|
+
layout: "icon",
|
|
11639
|
+
coloringStyle: "text",
|
|
11640
|
+
color: "neutral",
|
|
11641
|
+
onClick: () => setIsMobileOpen(false),
|
|
11642
|
+
children: /* @__PURE__ */ jsx42(XIcon2, {})
|
|
11643
|
+
}
|
|
11644
|
+
),
|
|
11645
|
+
/* @__PURE__ */ jsx42(NavigationItemList, { ...props, className: clsx33("flex-col-8", props.className) })
|
|
11822
11646
|
]
|
|
11823
11647
|
}
|
|
11824
11648
|
)
|
|
@@ -11828,8 +11652,8 @@ var Navigation = ({ ...props }) => {
|
|
|
11828
11652
|
// src/components/navigation/Pagination.tsx
|
|
11829
11653
|
import { ChevronFirst, ChevronLast, ChevronLeft as ChevronLeft2, ChevronRight as ChevronRight2 } from "lucide-react";
|
|
11830
11654
|
import clsx34 from "clsx";
|
|
11831
|
-
import { useEffect as
|
|
11832
|
-
import { jsx as
|
|
11655
|
+
import { useEffect as useEffect21, useState as useState22 } from "react";
|
|
11656
|
+
import { jsx as jsx43, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
11833
11657
|
var Pagination = ({
|
|
11834
11658
|
pageIndex,
|
|
11835
11659
|
pageCount,
|
|
@@ -11838,11 +11662,11 @@ var Pagination = ({
|
|
|
11838
11662
|
style
|
|
11839
11663
|
}) => {
|
|
11840
11664
|
const translation = useHightideTranslation();
|
|
11841
|
-
const [value, setValue] =
|
|
11665
|
+
const [value, setValue] = useState22((pageIndex + 1).toString());
|
|
11842
11666
|
const noPages = pageCount === 0;
|
|
11843
11667
|
const onFirstPage = pageIndex === 0 && !noPages;
|
|
11844
11668
|
const onLastPage = pageIndex === pageCount - 1;
|
|
11845
|
-
|
|
11669
|
+
useEffect21(() => {
|
|
11846
11670
|
if (noPages) {
|
|
11847
11671
|
setValue("0");
|
|
11848
11672
|
} else {
|
|
@@ -11853,10 +11677,30 @@ var Pagination = ({
|
|
|
11853
11677
|
onPageChanged(page);
|
|
11854
11678
|
};
|
|
11855
11679
|
return /* @__PURE__ */ jsxs28("div", { className: clsx34("flex-row-1", className), style, children: [
|
|
11856
|
-
/* @__PURE__ */
|
|
11857
|
-
|
|
11680
|
+
/* @__PURE__ */ jsx43(
|
|
11681
|
+
Button,
|
|
11682
|
+
{
|
|
11683
|
+
layout: "icon",
|
|
11684
|
+
coloringStyle: "text",
|
|
11685
|
+
color: "neutral",
|
|
11686
|
+
onClick: () => changePage(0),
|
|
11687
|
+
disabled: onFirstPage || noPages,
|
|
11688
|
+
children: /* @__PURE__ */ jsx43(ChevronFirst, {})
|
|
11689
|
+
}
|
|
11690
|
+
),
|
|
11691
|
+
/* @__PURE__ */ jsx43(
|
|
11692
|
+
Button,
|
|
11693
|
+
{
|
|
11694
|
+
layout: "icon",
|
|
11695
|
+
coloringStyle: "text",
|
|
11696
|
+
color: "neutral",
|
|
11697
|
+
onClick: () => changePage(pageIndex - 1),
|
|
11698
|
+
disabled: onFirstPage || noPages,
|
|
11699
|
+
children: /* @__PURE__ */ jsx43(ChevronLeft2, {})
|
|
11700
|
+
}
|
|
11701
|
+
),
|
|
11858
11702
|
/* @__PURE__ */ jsxs28("div", { className: "flex-row-2 min-w-56 items-center justify-center mx-2 text-center", children: [
|
|
11859
|
-
/* @__PURE__ */
|
|
11703
|
+
/* @__PURE__ */ jsx43(
|
|
11860
11704
|
Input,
|
|
11861
11705
|
{
|
|
11862
11706
|
value,
|
|
@@ -11880,8 +11724,8 @@ var Pagination = ({
|
|
|
11880
11724
|
editCompleteOptions: { delay: 800 }
|
|
11881
11725
|
}
|
|
11882
11726
|
),
|
|
11883
|
-
/* @__PURE__ */
|
|
11884
|
-
/* @__PURE__ */
|
|
11727
|
+
/* @__PURE__ */ jsx43("span", { className: "select-none w-10", children: translation("of") }),
|
|
11728
|
+
/* @__PURE__ */ jsx43(
|
|
11885
11729
|
"span",
|
|
11886
11730
|
{
|
|
11887
11731
|
className: "flex-row-2 w-24 items-center justify-center select-none h-10 bg-input-background text-input-text rounded-md font-bold",
|
|
@@ -11889,15 +11733,35 @@ var Pagination = ({
|
|
|
11889
11733
|
}
|
|
11890
11734
|
)
|
|
11891
11735
|
] }),
|
|
11892
|
-
/* @__PURE__ */
|
|
11893
|
-
|
|
11736
|
+
/* @__PURE__ */ jsx43(
|
|
11737
|
+
Button,
|
|
11738
|
+
{
|
|
11739
|
+
layout: "icon",
|
|
11740
|
+
coloringStyle: "text",
|
|
11741
|
+
color: "neutral",
|
|
11742
|
+
onClick: () => changePage(pageIndex + 1),
|
|
11743
|
+
disabled: onLastPage || noPages,
|
|
11744
|
+
children: /* @__PURE__ */ jsx43(ChevronRight2, {})
|
|
11745
|
+
}
|
|
11746
|
+
),
|
|
11747
|
+
/* @__PURE__ */ jsx43(
|
|
11748
|
+
Button,
|
|
11749
|
+
{
|
|
11750
|
+
layout: "icon",
|
|
11751
|
+
coloringStyle: "text",
|
|
11752
|
+
color: "neutral",
|
|
11753
|
+
onClick: () => changePage(pageCount - 1),
|
|
11754
|
+
disabled: onLastPage || noPages,
|
|
11755
|
+
children: /* @__PURE__ */ jsx43(ChevronLast, {})
|
|
11756
|
+
}
|
|
11757
|
+
)
|
|
11894
11758
|
] });
|
|
11895
11759
|
};
|
|
11896
11760
|
|
|
11897
11761
|
// src/components/navigation/StepperBar.tsx
|
|
11898
11762
|
import { Check, ChevronLeft as ChevronLeft3, ChevronRight as ChevronRight3 } from "lucide-react";
|
|
11899
11763
|
import clsx35 from "clsx";
|
|
11900
|
-
import { jsx as
|
|
11764
|
+
import { jsx as jsx44, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
11901
11765
|
var defaultState = {
|
|
11902
11766
|
currentStep: 0,
|
|
11903
11767
|
seenSteps: /* @__PURE__ */ new Set([0])
|
|
@@ -11924,8 +11788,8 @@ var StepperBar = ({
|
|
|
11924
11788
|
{
|
|
11925
11789
|
className: clsx35("flex-row-2 justify-between", className),
|
|
11926
11790
|
children: [
|
|
11927
|
-
/* @__PURE__ */
|
|
11928
|
-
|
|
11791
|
+
/* @__PURE__ */ jsx44("div", { className: "flex-row-2 flex-[2] justify-start", children: /* @__PURE__ */ jsxs29(
|
|
11792
|
+
Button,
|
|
11929
11793
|
{
|
|
11930
11794
|
disabled: currentStep === 0 || disabledSteps.has(currentStep),
|
|
11931
11795
|
onClick: () => {
|
|
@@ -11933,14 +11797,14 @@ var StepperBar = ({
|
|
|
11933
11797
|
},
|
|
11934
11798
|
className: "flex-row-1 items-center justify-center",
|
|
11935
11799
|
children: [
|
|
11936
|
-
/* @__PURE__ */
|
|
11800
|
+
/* @__PURE__ */ jsx44(ChevronLeft3, { size: 14 }),
|
|
11937
11801
|
translation("back")
|
|
11938
11802
|
]
|
|
11939
11803
|
}
|
|
11940
11804
|
) }),
|
|
11941
|
-
/* @__PURE__ */
|
|
11805
|
+
/* @__PURE__ */ jsx44("div", { className: "flex-row-2 flex-[5] justify-center items-center", children: showDots && dots.map((value, index) => {
|
|
11942
11806
|
const seen = seenSteps.has(index);
|
|
11943
|
-
return /* @__PURE__ */
|
|
11807
|
+
return /* @__PURE__ */ jsx44(
|
|
11944
11808
|
"div",
|
|
11945
11809
|
{
|
|
11946
11810
|
onClick: () => seen && update(index),
|
|
@@ -11960,26 +11824,26 @@ var StepperBar = ({
|
|
|
11960
11824
|
index
|
|
11961
11825
|
);
|
|
11962
11826
|
}) }),
|
|
11963
|
-
currentStep !== numberOfSteps && /* @__PURE__ */
|
|
11964
|
-
|
|
11827
|
+
currentStep !== numberOfSteps && /* @__PURE__ */ jsx44("div", { className: "flex-row-2 flex-[2] justify-end", children: /* @__PURE__ */ jsxs29(
|
|
11828
|
+
Button,
|
|
11965
11829
|
{
|
|
11966
11830
|
onClick: () => update(currentStep + 1),
|
|
11967
11831
|
className: "flex-row-1 items-center justify-center",
|
|
11968
11832
|
disabled: disabledSteps.has(currentStep),
|
|
11969
11833
|
children: [
|
|
11970
11834
|
translation("next"),
|
|
11971
|
-
/* @__PURE__ */
|
|
11835
|
+
/* @__PURE__ */ jsx44(ChevronRight3, { size: 14 })
|
|
11972
11836
|
]
|
|
11973
11837
|
}
|
|
11974
11838
|
) }),
|
|
11975
|
-
currentStep === numberOfSteps && /* @__PURE__ */
|
|
11976
|
-
|
|
11839
|
+
currentStep === numberOfSteps && /* @__PURE__ */ jsx44("div", { className: "flex-row-2 flex-[2] justify-end", children: /* @__PURE__ */ jsxs29(
|
|
11840
|
+
Button,
|
|
11977
11841
|
{
|
|
11978
11842
|
disabled: disabledSteps.has(currentStep),
|
|
11979
11843
|
onClick: onFinish,
|
|
11980
11844
|
className: "flex-row-1 items-center justify-center",
|
|
11981
11845
|
children: [
|
|
11982
|
-
/* @__PURE__ */
|
|
11846
|
+
/* @__PURE__ */ jsx44(Check, { size: 14 }),
|
|
11983
11847
|
finishText ?? translation("confirm")
|
|
11984
11848
|
]
|
|
11985
11849
|
}
|
|
@@ -11990,7 +11854,7 @@ var StepperBar = ({
|
|
|
11990
11854
|
};
|
|
11991
11855
|
var StepperBarUncontrolled = ({ state, onChange, ...props }) => {
|
|
11992
11856
|
const [usedState, setUsedState] = useOverwritableState(state, onChange);
|
|
11993
|
-
return /* @__PURE__ */
|
|
11857
|
+
return /* @__PURE__ */ jsx44(
|
|
11994
11858
|
StepperBar,
|
|
11995
11859
|
{
|
|
11996
11860
|
...props,
|
|
@@ -12006,7 +11870,7 @@ import { Check as Check3 } from "lucide-react";
|
|
|
12006
11870
|
// src/components/user-action/Checkbox.tsx
|
|
12007
11871
|
import { Check as Check2, Minus } from "lucide-react";
|
|
12008
11872
|
import clsx36 from "clsx";
|
|
12009
|
-
import { jsx as
|
|
11873
|
+
import { jsx as jsx45, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
12010
11874
|
var checkboxSizeMapping = {
|
|
12011
11875
|
sm: "size-5 border-1",
|
|
12012
11876
|
md: "size-6 border-1",
|
|
@@ -12062,9 +11926,9 @@ var Checkbox = ({
|
|
|
12062
11926
|
"aria-disabled": disabled,
|
|
12063
11927
|
tabIndex: disabled ? -1 : 0,
|
|
12064
11928
|
children: [
|
|
12065
|
-
!checked && !indeterminate && /* @__PURE__ */
|
|
12066
|
-
checked && !indeterminate && /* @__PURE__ */
|
|
12067
|
-
indeterminate && /* @__PURE__ */
|
|
11929
|
+
!checked && !indeterminate && /* @__PURE__ */ jsx45("div", { className: clsx36("bg-input-background", innerIconSize) }),
|
|
11930
|
+
checked && !indeterminate && /* @__PURE__ */ jsx45(Check2, { className: innerIconSize }),
|
|
11931
|
+
indeterminate && /* @__PURE__ */ jsx45(Minus, { className: innerIconSize })
|
|
12068
11932
|
]
|
|
12069
11933
|
}
|
|
12070
11934
|
);
|
|
@@ -12075,7 +11939,7 @@ var CheckboxUncontrolled = ({
|
|
|
12075
11939
|
...props
|
|
12076
11940
|
}) => {
|
|
12077
11941
|
const [checked, setChecked] = useOverwritableState(initialChecked, onCheckedChange);
|
|
12078
|
-
return /* @__PURE__ */
|
|
11942
|
+
return /* @__PURE__ */ jsx45(
|
|
12079
11943
|
Checkbox,
|
|
12080
11944
|
{
|
|
12081
11945
|
...props,
|
|
@@ -12088,7 +11952,7 @@ var CheckboxUncontrolled = ({
|
|
|
12088
11952
|
// src/components/properties/PropertyBase.tsx
|
|
12089
11953
|
import { AlertTriangle } from "lucide-react";
|
|
12090
11954
|
import clsx37 from "clsx";
|
|
12091
|
-
import { jsx as
|
|
11955
|
+
import { jsx as jsx46, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
12092
11956
|
var PropertyBase = ({
|
|
12093
11957
|
name,
|
|
12094
11958
|
input,
|
|
@@ -12114,8 +11978,8 @@ var PropertyBase = ({
|
|
|
12114
11978
|
className
|
|
12115
11979
|
),
|
|
12116
11980
|
children: [
|
|
12117
|
-
/* @__PURE__ */
|
|
12118
|
-
/* @__PURE__ */
|
|
11981
|
+
/* @__PURE__ */ jsx46("div", { className: "max-w-6 min-w-6 text-text-primary", children: icon }),
|
|
11982
|
+
/* @__PURE__ */ jsx46("span", { className: "font-semibold", children: name })
|
|
12119
11983
|
]
|
|
12120
11984
|
}
|
|
12121
11985
|
),
|
|
@@ -12132,12 +11996,13 @@ var PropertyBase = ({
|
|
|
12132
11996
|
),
|
|
12133
11997
|
children: [
|
|
12134
11998
|
input({ softRequired, hasValue }),
|
|
12135
|
-
requiredAndNoValue && /* @__PURE__ */
|
|
12136
|
-
onRemove && !readOnly && /* @__PURE__ */
|
|
12137
|
-
|
|
11999
|
+
requiredAndNoValue && /* @__PURE__ */ jsx46("div", { className: "text-warning", children: /* @__PURE__ */ jsx46(AlertTriangle, { size: 24 }) }),
|
|
12000
|
+
onRemove && !readOnly && /* @__PURE__ */ jsx46(
|
|
12001
|
+
Button,
|
|
12138
12002
|
{
|
|
12139
12003
|
onClick: onRemove,
|
|
12140
12004
|
color: "negative",
|
|
12005
|
+
coloringStyle: "text",
|
|
12141
12006
|
className: clsx37("items-center"),
|
|
12142
12007
|
disabled: !hasValue,
|
|
12143
12008
|
children: translation("remove")
|
|
@@ -12151,7 +12016,7 @@ var PropertyBase = ({
|
|
|
12151
12016
|
|
|
12152
12017
|
// src/components/properties/CheckboxProperty.tsx
|
|
12153
12018
|
import { useId as useId9 } from "react";
|
|
12154
|
-
import { jsx as
|
|
12019
|
+
import { jsx as jsx47, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
12155
12020
|
var CheckboxProperty = ({
|
|
12156
12021
|
value,
|
|
12157
12022
|
onChange,
|
|
@@ -12160,15 +12025,15 @@ var CheckboxProperty = ({
|
|
|
12160
12025
|
}) => {
|
|
12161
12026
|
const translation = useHightideTranslation();
|
|
12162
12027
|
const id = useId9();
|
|
12163
|
-
return /* @__PURE__ */
|
|
12028
|
+
return /* @__PURE__ */ jsx47(
|
|
12164
12029
|
PropertyBase,
|
|
12165
12030
|
{
|
|
12166
12031
|
...baseProps,
|
|
12167
12032
|
hasValue: true,
|
|
12168
12033
|
readOnly,
|
|
12169
|
-
icon: /* @__PURE__ */
|
|
12034
|
+
icon: /* @__PURE__ */ jsx47(Check3, { size: 24 }),
|
|
12170
12035
|
input: () => /* @__PURE__ */ jsxs32("div", { className: "flex-row-2 items-center", children: [
|
|
12171
|
-
/* @__PURE__ */
|
|
12036
|
+
/* @__PURE__ */ jsx47(
|
|
12172
12037
|
Checkbox,
|
|
12173
12038
|
{
|
|
12174
12039
|
id,
|
|
@@ -12178,7 +12043,7 @@ var CheckboxProperty = ({
|
|
|
12178
12043
|
"aria-labelledby": id + "label"
|
|
12179
12044
|
}
|
|
12180
12045
|
),
|
|
12181
|
-
/* @__PURE__ */
|
|
12046
|
+
/* @__PURE__ */ jsx47(Label, { id: id + "label", children: `${translation("yes")}/${translation("no")}` })
|
|
12182
12047
|
] })
|
|
12183
12048
|
}
|
|
12184
12049
|
);
|
|
@@ -12187,7 +12052,7 @@ var CheckboxProperty = ({
|
|
|
12187
12052
|
// src/components/properties/DateProperty.tsx
|
|
12188
12053
|
import { CalendarDays } from "lucide-react";
|
|
12189
12054
|
import clsx38 from "clsx";
|
|
12190
|
-
import { jsx as
|
|
12055
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
12191
12056
|
var DateProperty = ({
|
|
12192
12057
|
value,
|
|
12193
12058
|
onChange,
|
|
@@ -12198,13 +12063,13 @@ var DateProperty = ({
|
|
|
12198
12063
|
}) => {
|
|
12199
12064
|
const hasValue = !!value;
|
|
12200
12065
|
const dateText = value ? type === "dateTime" ? formatDateTime(value) : formatDate(value) : "";
|
|
12201
|
-
return /* @__PURE__ */
|
|
12066
|
+
return /* @__PURE__ */ jsx48(
|
|
12202
12067
|
PropertyBase,
|
|
12203
12068
|
{
|
|
12204
12069
|
...baseProps,
|
|
12205
12070
|
hasValue,
|
|
12206
|
-
icon: /* @__PURE__ */
|
|
12207
|
-
input: ({ softRequired }) => /* @__PURE__ */
|
|
12071
|
+
icon: /* @__PURE__ */ jsx48(CalendarDays, { size: 24 }),
|
|
12072
|
+
input: ({ softRequired }) => /* @__PURE__ */ jsx48(
|
|
12208
12073
|
Input,
|
|
12209
12074
|
{
|
|
12210
12075
|
className: clsx38("!ring-0 !border-0 !outline-0 !p-0 !m-0 !shadow-none !w-fit !rounded-none", { "bg-surface-warning": softRequired && !hasValue }),
|
|
@@ -12230,7 +12095,7 @@ var DateProperty = ({
|
|
|
12230
12095
|
// src/components/properties/MultiSelectProperty.tsx
|
|
12231
12096
|
import { List } from "lucide-react";
|
|
12232
12097
|
import clsx39 from "clsx";
|
|
12233
|
-
import { jsx as
|
|
12098
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
12234
12099
|
var MultiSelectProperty = ({
|
|
12235
12100
|
children,
|
|
12236
12101
|
values,
|
|
@@ -12238,13 +12103,13 @@ var MultiSelectProperty = ({
|
|
|
12238
12103
|
...props
|
|
12239
12104
|
}) => {
|
|
12240
12105
|
const hasValue = values.length > 0;
|
|
12241
|
-
return /* @__PURE__ */
|
|
12106
|
+
return /* @__PURE__ */ jsx49(
|
|
12242
12107
|
PropertyBase,
|
|
12243
12108
|
{
|
|
12244
12109
|
...props,
|
|
12245
12110
|
hasValue,
|
|
12246
|
-
icon: /* @__PURE__ */
|
|
12247
|
-
input: ({ softRequired }) => /* @__PURE__ */
|
|
12111
|
+
icon: /* @__PURE__ */ jsx49(List, { size: 24 }),
|
|
12112
|
+
input: ({ softRequired }) => /* @__PURE__ */ jsx49(
|
|
12248
12113
|
MultiSelectChipDisplay,
|
|
12249
12114
|
{
|
|
12250
12115
|
values,
|
|
@@ -12270,7 +12135,7 @@ var MultiSelectProperty = ({
|
|
|
12270
12135
|
// src/components/properties/NumberProperty.tsx
|
|
12271
12136
|
import { Binary } from "lucide-react";
|
|
12272
12137
|
import clsx40 from "clsx";
|
|
12273
|
-
import { jsx as
|
|
12138
|
+
import { jsx as jsx50, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
12274
12139
|
var NumberProperty = ({
|
|
12275
12140
|
value,
|
|
12276
12141
|
onChange,
|
|
@@ -12282,47 +12147,59 @@ var NumberProperty = ({
|
|
|
12282
12147
|
}) => {
|
|
12283
12148
|
const translation = useHightideTranslation();
|
|
12284
12149
|
const hasValue = value !== void 0;
|
|
12285
|
-
return /* @__PURE__ */
|
|
12150
|
+
return /* @__PURE__ */ jsx50(
|
|
12286
12151
|
PropertyBase,
|
|
12287
12152
|
{
|
|
12288
12153
|
...baseProps,
|
|
12289
12154
|
onRemove,
|
|
12290
12155
|
hasValue,
|
|
12291
|
-
icon: /* @__PURE__ */
|
|
12292
|
-
input: ({ softRequired }) =>
|
|
12293
|
-
|
|
12294
|
-
|
|
12295
|
-
|
|
12296
|
-
|
|
12297
|
-
|
|
12298
|
-
|
|
12299
|
-
|
|
12300
|
-
|
|
12301
|
-
|
|
12302
|
-
|
|
12303
|
-
|
|
12304
|
-
|
|
12305
|
-
|
|
12306
|
-
|
|
12307
|
-
|
|
12308
|
-
|
|
12309
|
-
|
|
12310
|
-
|
|
12311
|
-
|
|
12312
|
-
|
|
12313
|
-
|
|
12314
|
-
|
|
12315
|
-
|
|
12316
|
-
|
|
12317
|
-
|
|
12318
|
-
|
|
12156
|
+
icon: /* @__PURE__ */ jsx50(Binary, { size: 24 }),
|
|
12157
|
+
input: ({ softRequired }) => (
|
|
12158
|
+
// TODO this max width might be to low for some numbers
|
|
12159
|
+
/* @__PURE__ */ jsxs33(
|
|
12160
|
+
"div",
|
|
12161
|
+
{
|
|
12162
|
+
className: clsx40("relative flex-row-2 max-w-56", { "text-warning": softRequired && !hasValue }),
|
|
12163
|
+
children: [
|
|
12164
|
+
/* @__PURE__ */ jsx50(
|
|
12165
|
+
Input,
|
|
12166
|
+
{
|
|
12167
|
+
className: clsx40("!ring-0 !border-0 !outline-0 !py-0 pl-0 pr-8 !m-0 !shadow-none !rounded-none w-full", { "bg-surface-warning placeholder-warning": softRequired && !hasValue }),
|
|
12168
|
+
value: value?.toString() ?? "",
|
|
12169
|
+
type: "number",
|
|
12170
|
+
readOnly,
|
|
12171
|
+
placeholder: `${translation("value")}...`,
|
|
12172
|
+
onChangeText: (value2) => {
|
|
12173
|
+
const numberValue = parseFloat(value2);
|
|
12174
|
+
if (isNaN(numberValue)) {
|
|
12175
|
+
onRemove();
|
|
12176
|
+
} else {
|
|
12177
|
+
onChange?.(numberValue);
|
|
12178
|
+
}
|
|
12179
|
+
},
|
|
12180
|
+
onEditCompleted: (value2) => {
|
|
12181
|
+
const numberValue = parseFloat(value2);
|
|
12182
|
+
if (isNaN(numberValue)) {
|
|
12183
|
+
onRemove();
|
|
12184
|
+
} else {
|
|
12185
|
+
onEditComplete(numberValue);
|
|
12186
|
+
}
|
|
12319
12187
|
}
|
|
12320
12188
|
}
|
|
12321
|
-
|
|
12322
|
-
|
|
12323
|
-
|
|
12324
|
-
|
|
12325
|
-
|
|
12189
|
+
),
|
|
12190
|
+
suffix && /* @__PURE__ */ jsx50(
|
|
12191
|
+
"span",
|
|
12192
|
+
{
|
|
12193
|
+
className: clsx40(
|
|
12194
|
+
"absolute top-1/2 -translate-y-1/2 right-2",
|
|
12195
|
+
{ "bg-surface-warning": softRequired && !hasValue }
|
|
12196
|
+
),
|
|
12197
|
+
children: suffix
|
|
12198
|
+
}
|
|
12199
|
+
)
|
|
12200
|
+
]
|
|
12201
|
+
}
|
|
12202
|
+
)
|
|
12326
12203
|
)
|
|
12327
12204
|
}
|
|
12328
12205
|
);
|
|
@@ -12331,7 +12208,7 @@ var NumberProperty = ({
|
|
|
12331
12208
|
// src/components/properties/SelectProperty.tsx
|
|
12332
12209
|
import { List as List2 } from "lucide-react";
|
|
12333
12210
|
import clsx41 from "clsx";
|
|
12334
|
-
import { jsx as
|
|
12211
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
12335
12212
|
var SingleSelectProperty = ({
|
|
12336
12213
|
children,
|
|
12337
12214
|
value,
|
|
@@ -12340,13 +12217,13 @@ var SingleSelectProperty = ({
|
|
|
12340
12217
|
...props
|
|
12341
12218
|
}) => {
|
|
12342
12219
|
const hasValue = value !== void 0;
|
|
12343
|
-
return /* @__PURE__ */
|
|
12220
|
+
return /* @__PURE__ */ jsx51(
|
|
12344
12221
|
PropertyBase,
|
|
12345
12222
|
{
|
|
12346
12223
|
...props,
|
|
12347
12224
|
hasValue,
|
|
12348
|
-
icon: /* @__PURE__ */
|
|
12349
|
-
input: ({ softRequired }) => /* @__PURE__ */
|
|
12225
|
+
icon: /* @__PURE__ */ jsx51(List2, { size: 24 }),
|
|
12226
|
+
input: ({ softRequired }) => /* @__PURE__ */ jsx51(
|
|
12350
12227
|
Select,
|
|
12351
12228
|
{
|
|
12352
12229
|
value,
|
|
@@ -12375,7 +12252,7 @@ import clsx43 from "clsx";
|
|
|
12375
12252
|
// src/components/user-action/Textarea.tsx
|
|
12376
12253
|
import { forwardRef as forwardRef8, useId as useId10 } from "react";
|
|
12377
12254
|
import clsx42 from "clsx";
|
|
12378
|
-
import { jsx as
|
|
12255
|
+
import { jsx as jsx52, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
12379
12256
|
var Textarea = forwardRef8(function Textarea2({
|
|
12380
12257
|
id,
|
|
12381
12258
|
onChange,
|
|
@@ -12394,7 +12271,7 @@ var Textarea = forwardRef8(function Textarea2({
|
|
|
12394
12271
|
onEditCompleted?.(text);
|
|
12395
12272
|
clearTimer();
|
|
12396
12273
|
};
|
|
12397
|
-
return /* @__PURE__ */
|
|
12274
|
+
return /* @__PURE__ */ jsx52(
|
|
12398
12275
|
"textarea",
|
|
12399
12276
|
{
|
|
12400
12277
|
ref,
|
|
@@ -12432,7 +12309,7 @@ var TextareaUncontrolled = ({
|
|
|
12432
12309
|
...props
|
|
12433
12310
|
}) => {
|
|
12434
12311
|
const [text, setText] = useOverwritableState(value, onChangeText);
|
|
12435
|
-
return /* @__PURE__ */
|
|
12312
|
+
return /* @__PURE__ */ jsx52(
|
|
12436
12313
|
Textarea,
|
|
12437
12314
|
{
|
|
12438
12315
|
...props,
|
|
@@ -12464,8 +12341,8 @@ var TextareaWithHeadline = ({
|
|
|
12464
12341
|
containerClassName
|
|
12465
12342
|
),
|
|
12466
12343
|
children: [
|
|
12467
|
-
headline && /* @__PURE__ */
|
|
12468
|
-
/* @__PURE__ */
|
|
12344
|
+
headline && /* @__PURE__ */ jsx52(Label, { size: "md", ...headlineProps, htmlFor: usedId, children: headline }),
|
|
12345
|
+
/* @__PURE__ */ jsx52(
|
|
12469
12346
|
Textarea,
|
|
12470
12347
|
{
|
|
12471
12348
|
...props,
|
|
@@ -12483,7 +12360,7 @@ var TextareaWithHeadline = ({
|
|
|
12483
12360
|
};
|
|
12484
12361
|
|
|
12485
12362
|
// src/components/properties/TextProperty.tsx
|
|
12486
|
-
import { jsx as
|
|
12363
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
12487
12364
|
var TextProperty = ({
|
|
12488
12365
|
value,
|
|
12489
12366
|
readOnly,
|
|
@@ -12494,14 +12371,14 @@ var TextProperty = ({
|
|
|
12494
12371
|
}) => {
|
|
12495
12372
|
const translation = useHightideTranslation();
|
|
12496
12373
|
const hasValue = value !== void 0;
|
|
12497
|
-
return /* @__PURE__ */
|
|
12374
|
+
return /* @__PURE__ */ jsx53(
|
|
12498
12375
|
PropertyBase,
|
|
12499
12376
|
{
|
|
12500
12377
|
...baseProps,
|
|
12501
12378
|
onRemove,
|
|
12502
12379
|
hasValue,
|
|
12503
|
-
icon: /* @__PURE__ */
|
|
12504
|
-
input: ({ softRequired }) => /* @__PURE__ */
|
|
12380
|
+
icon: /* @__PURE__ */ jsx53(Text, { size: 24 }),
|
|
12381
|
+
input: ({ softRequired }) => /* @__PURE__ */ jsx53(
|
|
12505
12382
|
Textarea,
|
|
12506
12383
|
{
|
|
12507
12384
|
className: clsx43({
|
|
@@ -12534,11 +12411,11 @@ var TextProperty = ({
|
|
|
12534
12411
|
|
|
12535
12412
|
// src/components/table/FillerRowElement.tsx
|
|
12536
12413
|
import { clsx as clsx44 } from "clsx";
|
|
12537
|
-
import { jsx as
|
|
12414
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
12538
12415
|
var FillerRowElement = ({
|
|
12539
12416
|
className
|
|
12540
12417
|
}) => {
|
|
12541
|
-
return /* @__PURE__ */
|
|
12418
|
+
return /* @__PURE__ */ jsx54("div", { className: clsx44("flex flex-row items-center w-1/2 h-4 text-disabled font-bold", className), children: "-" });
|
|
12542
12419
|
};
|
|
12543
12420
|
|
|
12544
12421
|
// src/components/table/Filter.ts
|
|
@@ -12556,7 +12433,7 @@ var TableFilters = {
|
|
|
12556
12433
|
};
|
|
12557
12434
|
|
|
12558
12435
|
// src/components/table/Table.tsx
|
|
12559
|
-
import { useCallback as useCallback12, useEffect as
|
|
12436
|
+
import { useCallback as useCallback12, useEffect as useEffect27, useMemo as useMemo7, useRef as useRef13, useState as useState26 } from "react";
|
|
12560
12437
|
import clsx48 from "clsx";
|
|
12561
12438
|
import {
|
|
12562
12439
|
flexRender,
|
|
@@ -12566,22 +12443,21 @@ import {
|
|
|
12566
12443
|
getSortedRowModel,
|
|
12567
12444
|
useReactTable
|
|
12568
12445
|
} from "@tanstack/react-table";
|
|
12569
|
-
import { Scrollbars as Scrollbars3 } from "react-custom-scrollbars-2";
|
|
12570
12446
|
|
|
12571
12447
|
// src/components/table/TableCell.tsx
|
|
12572
12448
|
import { clsx as clsx45 } from "clsx";
|
|
12573
|
-
import { jsx as
|
|
12449
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
12574
12450
|
var TableCell = ({
|
|
12575
12451
|
children,
|
|
12576
12452
|
className
|
|
12577
12453
|
}) => {
|
|
12578
|
-
return /* @__PURE__ */
|
|
12454
|
+
return /* @__PURE__ */ jsx55("span", { className: clsx45("block max-w-full overflow-ellipsis truncate", className), children });
|
|
12579
12455
|
};
|
|
12580
12456
|
|
|
12581
12457
|
// src/hooks/useResizeCallbackWrapper.ts
|
|
12582
|
-
import { useEffect as
|
|
12458
|
+
import { useEffect as useEffect22 } from "react";
|
|
12583
12459
|
var useResizeCallbackWrapper = (callback) => {
|
|
12584
|
-
|
|
12460
|
+
useEffect22(() => {
|
|
12585
12461
|
window.addEventListener("resize", callback);
|
|
12586
12462
|
return () => {
|
|
12587
12463
|
window.removeEventListener("resize", callback);
|
|
@@ -12592,27 +12468,29 @@ var useResizeCallbackWrapper = (callback) => {
|
|
|
12592
12468
|
// src/components/table/TableSortButton.tsx
|
|
12593
12469
|
import { ChevronDown as ChevronDown3, ChevronsUpDown, ChevronUp } from "lucide-react";
|
|
12594
12470
|
import clsx46 from "clsx";
|
|
12595
|
-
import { jsx as
|
|
12471
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
12596
12472
|
var TableSortButton = ({
|
|
12597
12473
|
sortDirection,
|
|
12598
12474
|
invert = false,
|
|
12599
12475
|
color = "neutral",
|
|
12476
|
+
size = "tiny",
|
|
12600
12477
|
className,
|
|
12601
12478
|
...buttonProps
|
|
12602
12479
|
}) => {
|
|
12603
|
-
let icon = /* @__PURE__ */
|
|
12480
|
+
let icon = /* @__PURE__ */ jsx56(ChevronsUpDown, { className: "w-full h-full" });
|
|
12604
12481
|
if (sortDirection) {
|
|
12605
12482
|
let usedSortDirection = sortDirection;
|
|
12606
12483
|
if (invert) {
|
|
12607
12484
|
usedSortDirection = usedSortDirection === "desc" ? "asc" : "desc";
|
|
12608
12485
|
}
|
|
12609
|
-
icon = usedSortDirection === "asc" ? /* @__PURE__ */
|
|
12486
|
+
icon = usedSortDirection === "asc" ? /* @__PURE__ */ jsx56(ChevronUp, { className: "w-full h-full" }) : /* @__PURE__ */ jsx56(ChevronDown3, { className: "w-full h-full" });
|
|
12610
12487
|
}
|
|
12611
|
-
return /* @__PURE__ */
|
|
12612
|
-
|
|
12488
|
+
return /* @__PURE__ */ jsx56(
|
|
12489
|
+
Button,
|
|
12613
12490
|
{
|
|
12614
|
-
|
|
12491
|
+
layout: "icon",
|
|
12615
12492
|
color,
|
|
12493
|
+
size,
|
|
12616
12494
|
className: clsx46(className),
|
|
12617
12495
|
...buttonProps,
|
|
12618
12496
|
children: icon
|
|
@@ -12624,7 +12502,7 @@ var TableSortButton = ({
|
|
|
12624
12502
|
import { FilterIcon } from "lucide-react";
|
|
12625
12503
|
|
|
12626
12504
|
// src/components/user-action/Menu.tsx
|
|
12627
|
-
import { useEffect as
|
|
12505
|
+
import { useEffect as useEffect25, useRef as useRef12, useState as useState24 } from "react";
|
|
12628
12506
|
import clsx47 from "clsx";
|
|
12629
12507
|
|
|
12630
12508
|
// src/utils/bagFunctions.ts
|
|
@@ -12696,15 +12574,15 @@ var usePopoverPosition = (trigger, options) => {
|
|
|
12696
12574
|
};
|
|
12697
12575
|
|
|
12698
12576
|
// src/hooks/useHoverState.ts
|
|
12699
|
-
import { useEffect as
|
|
12577
|
+
import { useEffect as useEffect23, useState as useState23 } from "react";
|
|
12700
12578
|
var defaultUseHoverStateProps = {
|
|
12701
12579
|
closingDelay: 200,
|
|
12702
12580
|
isDisabled: false
|
|
12703
12581
|
};
|
|
12704
12582
|
var useHoverState = (props = void 0) => {
|
|
12705
12583
|
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
12706
|
-
const [isHovered, setIsHovered] =
|
|
12707
|
-
const [timer, setTimer] =
|
|
12584
|
+
const [isHovered, setIsHovered] = useState23(false);
|
|
12585
|
+
const [timer, setTimer] = useState23();
|
|
12708
12586
|
const onMouseEnter = () => {
|
|
12709
12587
|
if (isDisabled) {
|
|
12710
12588
|
return;
|
|
@@ -12720,14 +12598,14 @@ var useHoverState = (props = void 0) => {
|
|
|
12720
12598
|
setIsHovered(false);
|
|
12721
12599
|
}, closingDelay));
|
|
12722
12600
|
};
|
|
12723
|
-
|
|
12601
|
+
useEffect23(() => {
|
|
12724
12602
|
if (timer) {
|
|
12725
12603
|
return () => {
|
|
12726
12604
|
clearTimeout(timer);
|
|
12727
12605
|
};
|
|
12728
12606
|
}
|
|
12729
12607
|
});
|
|
12730
|
-
|
|
12608
|
+
useEffect23(() => {
|
|
12731
12609
|
if (timer) {
|
|
12732
12610
|
clearTimeout(timer);
|
|
12733
12611
|
}
|
|
@@ -12740,9 +12618,9 @@ var useHoverState = (props = void 0) => {
|
|
|
12740
12618
|
};
|
|
12741
12619
|
|
|
12742
12620
|
// src/hooks/useOutsideClick.ts
|
|
12743
|
-
import { useEffect as
|
|
12621
|
+
import { useEffect as useEffect24 } from "react";
|
|
12744
12622
|
var useOutsideClick = (refs, handler) => {
|
|
12745
|
-
|
|
12623
|
+
useEffect24(() => {
|
|
12746
12624
|
const listener = (event) => {
|
|
12747
12625
|
if (event.target === null) return;
|
|
12748
12626
|
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
@@ -12760,14 +12638,14 @@ var useOutsideClick = (refs, handler) => {
|
|
|
12760
12638
|
};
|
|
12761
12639
|
|
|
12762
12640
|
// src/components/user-action/Menu.tsx
|
|
12763
|
-
import { Fragment as Fragment6, jsx as
|
|
12641
|
+
import { Fragment as Fragment6, jsx as jsx57, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
12764
12642
|
var MenuItem = ({
|
|
12765
12643
|
children,
|
|
12766
12644
|
onClick,
|
|
12767
12645
|
alignment = "left",
|
|
12768
12646
|
isDisabled = false,
|
|
12769
12647
|
className
|
|
12770
|
-
}) => /* @__PURE__ */
|
|
12648
|
+
}) => /* @__PURE__ */ jsx57(
|
|
12771
12649
|
"div",
|
|
12772
12650
|
{
|
|
12773
12651
|
className: clsx47("block px-3 py-1.5 first:rounded-t-md last:rounded-b-md text-sm font-semibold text-nowrap", {
|
|
@@ -12803,7 +12681,7 @@ var Menu = ({
|
|
|
12803
12681
|
const triggerRef = useRef12(null);
|
|
12804
12682
|
const menuRef = useRef12(null);
|
|
12805
12683
|
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
12806
|
-
const [isHidden, setIsHidden] =
|
|
12684
|
+
const [isHidden, setIsHidden] = useState24(true);
|
|
12807
12685
|
const bag = {
|
|
12808
12686
|
isOpen,
|
|
12809
12687
|
close: () => setIsOpen(false),
|
|
@@ -12814,7 +12692,7 @@ var Menu = ({
|
|
|
12814
12692
|
triggerRef.current?.getBoundingClientRect(),
|
|
12815
12693
|
{ verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
|
|
12816
12694
|
);
|
|
12817
|
-
|
|
12695
|
+
useEffect25(() => {
|
|
12818
12696
|
if (!isOpen) return;
|
|
12819
12697
|
const triggerEl = triggerRef.current;
|
|
12820
12698
|
if (!triggerEl) return;
|
|
@@ -12831,14 +12709,15 @@ var Menu = ({
|
|
|
12831
12709
|
window.removeEventListener("resize", close);
|
|
12832
12710
|
};
|
|
12833
12711
|
}, [isOpen, setIsOpen]);
|
|
12834
|
-
|
|
12712
|
+
useEffect25(() => {
|
|
12835
12713
|
if (isOpen) {
|
|
12836
12714
|
setIsHidden(false);
|
|
12837
12715
|
}
|
|
12838
12716
|
}, [isOpen]);
|
|
12717
|
+
const zIndex = useZIndexRegister(isOpen);
|
|
12839
12718
|
return /* @__PURE__ */ jsxs35(Fragment6, { children: [
|
|
12840
12719
|
trigger(bag, triggerRef),
|
|
12841
|
-
createPortal4(/* @__PURE__ */
|
|
12720
|
+
createPortal4(/* @__PURE__ */ jsx57(
|
|
12842
12721
|
"div",
|
|
12843
12722
|
{
|
|
12844
12723
|
ref: menuRef,
|
|
@@ -12858,7 +12737,8 @@ var Menu = ({
|
|
|
12858
12737
|
}
|
|
12859
12738
|
},
|
|
12860
12739
|
style: {
|
|
12861
|
-
...menuPosition
|
|
12740
|
+
...menuPosition,
|
|
12741
|
+
zIndex
|
|
12862
12742
|
},
|
|
12863
12743
|
children: BagFunctionUtil.resolve(children, bag)
|
|
12864
12744
|
}
|
|
@@ -12867,25 +12747,34 @@ var Menu = ({
|
|
|
12867
12747
|
};
|
|
12868
12748
|
|
|
12869
12749
|
// src/components/table/TableFilterButton.tsx
|
|
12870
|
-
import { useEffect as
|
|
12871
|
-
import { Fragment as Fragment7, jsx as
|
|
12750
|
+
import { useEffect as useEffect26, useState as useState25 } from "react";
|
|
12751
|
+
import { Fragment as Fragment7, jsx as jsx58, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
12872
12752
|
var TableFilterButton = ({
|
|
12873
12753
|
filterType,
|
|
12874
12754
|
column
|
|
12875
12755
|
}) => {
|
|
12876
12756
|
const translation = useHightideTranslation();
|
|
12877
12757
|
const columnFilterValue = column.getFilterValue();
|
|
12878
|
-
const [filterValue, setFilterValue] =
|
|
12758
|
+
const [filterValue, setFilterValue] = useState25(columnFilterValue);
|
|
12879
12759
|
const hasFilter = !!filterValue;
|
|
12880
|
-
|
|
12760
|
+
useEffect26(() => {
|
|
12881
12761
|
setFilterValue(columnFilterValue);
|
|
12882
12762
|
}, [columnFilterValue]);
|
|
12883
|
-
return /* @__PURE__ */
|
|
12763
|
+
return /* @__PURE__ */ jsx58(
|
|
12884
12764
|
Menu,
|
|
12885
12765
|
{
|
|
12886
12766
|
trigger: ({ toggleOpen }, ref) => /* @__PURE__ */ jsxs36("div", { ref, className: "relative", children: [
|
|
12887
|
-
/* @__PURE__ */
|
|
12888
|
-
|
|
12767
|
+
/* @__PURE__ */ jsx58(
|
|
12768
|
+
Button,
|
|
12769
|
+
{
|
|
12770
|
+
layout: "icon",
|
|
12771
|
+
color: "neutral",
|
|
12772
|
+
size: "tiny",
|
|
12773
|
+
onClick: toggleOpen,
|
|
12774
|
+
children: /* @__PURE__ */ jsx58(FilterIcon, {})
|
|
12775
|
+
}
|
|
12776
|
+
),
|
|
12777
|
+
hasFilter && /* @__PURE__ */ jsx58(
|
|
12889
12778
|
"div",
|
|
12890
12779
|
{
|
|
12891
12780
|
className: "absolute top-0.5 right-0.5 w-2 h-2 rounded-full bg-primary pointer-events-none",
|
|
@@ -12894,8 +12783,8 @@ var TableFilterButton = ({
|
|
|
12894
12783
|
)
|
|
12895
12784
|
] }),
|
|
12896
12785
|
children: ({ close }) => /* @__PURE__ */ jsxs36("div", { className: "flex-col-1 p-2 items-start font-normal text-menu-text", children: [
|
|
12897
|
-
/* @__PURE__ */
|
|
12898
|
-
filterType === "text" && /* @__PURE__ */
|
|
12786
|
+
/* @__PURE__ */ jsx58("h4", { className: "typography-label-md-semibold", children: translation("filter") }),
|
|
12787
|
+
filterType === "text" && /* @__PURE__ */ jsx58(
|
|
12899
12788
|
Input,
|
|
12900
12789
|
{
|
|
12901
12790
|
value: filterValue ?? "",
|
|
@@ -12906,7 +12795,7 @@ var TableFilterButton = ({
|
|
|
12906
12795
|
}
|
|
12907
12796
|
),
|
|
12908
12797
|
filterType === "range" && /* @__PURE__ */ jsxs36("div", { className: "flex-row-2 items-center", children: [
|
|
12909
|
-
/* @__PURE__ */
|
|
12798
|
+
/* @__PURE__ */ jsx58(
|
|
12910
12799
|
Input,
|
|
12911
12800
|
{
|
|
12912
12801
|
value: filterValue?.[0] ?? "",
|
|
@@ -12919,8 +12808,8 @@ var TableFilterButton = ({
|
|
|
12919
12808
|
className: "h-10 input-indicator-hidden w-40"
|
|
12920
12809
|
}
|
|
12921
12810
|
),
|
|
12922
|
-
/* @__PURE__ */
|
|
12923
|
-
/* @__PURE__ */
|
|
12811
|
+
/* @__PURE__ */ jsx58("span", { className: "font-bold", children: "-" }),
|
|
12812
|
+
/* @__PURE__ */ jsx58(
|
|
12924
12813
|
Input,
|
|
12925
12814
|
{
|
|
12926
12815
|
value: filterValue?.[1] ?? "",
|
|
@@ -12935,7 +12824,7 @@ var TableFilterButton = ({
|
|
|
12935
12824
|
)
|
|
12936
12825
|
] }),
|
|
12937
12826
|
filterType === "dateRange" && /* @__PURE__ */ jsxs36(Fragment7, { children: [
|
|
12938
|
-
/* @__PURE__ */
|
|
12827
|
+
/* @__PURE__ */ jsx58(
|
|
12939
12828
|
Input,
|
|
12940
12829
|
{
|
|
12941
12830
|
value: filterValue?.[0] ? filterValue?.[0].toISOString().slice(0, 16) : "",
|
|
@@ -12948,7 +12837,7 @@ var TableFilterButton = ({
|
|
|
12948
12837
|
className: "h-10 w-50"
|
|
12949
12838
|
}
|
|
12950
12839
|
),
|
|
12951
|
-
/* @__PURE__ */
|
|
12840
|
+
/* @__PURE__ */ jsx58(
|
|
12952
12841
|
Input,
|
|
12953
12842
|
{
|
|
12954
12843
|
value: filterValue?.[1] ? filterValue?.[1].toISOString().slice(0, 16) : "",
|
|
@@ -12963,11 +12852,11 @@ var TableFilterButton = ({
|
|
|
12963
12852
|
)
|
|
12964
12853
|
] }),
|
|
12965
12854
|
/* @__PURE__ */ jsxs36("div", { className: "flex-row-2 justify-end w-full", children: [
|
|
12966
|
-
hasFilter && /* @__PURE__ */
|
|
12855
|
+
hasFilter && /* @__PURE__ */ jsx58(Button, { color: "negative", size: "small", onClick: () => {
|
|
12967
12856
|
column.setFilterValue(void 0);
|
|
12968
12857
|
close();
|
|
12969
12858
|
}, children: translation("remove") }),
|
|
12970
|
-
/* @__PURE__ */
|
|
12859
|
+
/* @__PURE__ */ jsx58(Button, { size: "small", onClick: () => {
|
|
12971
12860
|
column.setFilterValue(filterValue);
|
|
12972
12861
|
close();
|
|
12973
12862
|
}, children: translation("apply") })
|
|
@@ -12978,7 +12867,7 @@ var TableFilterButton = ({
|
|
|
12978
12867
|
};
|
|
12979
12868
|
|
|
12980
12869
|
// src/components/table/Table.tsx
|
|
12981
|
-
import { jsx as
|
|
12870
|
+
import { jsx as jsx59, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
12982
12871
|
var Table = ({
|
|
12983
12872
|
data,
|
|
12984
12873
|
fillerRow,
|
|
@@ -12986,6 +12875,7 @@ var Table = ({
|
|
|
12986
12875
|
onRowClick,
|
|
12987
12876
|
className,
|
|
12988
12877
|
tableClassName,
|
|
12878
|
+
tableContainerClassName,
|
|
12989
12879
|
defaultColumn,
|
|
12990
12880
|
state,
|
|
12991
12881
|
columns,
|
|
@@ -12993,20 +12883,20 @@ var Table = ({
|
|
|
12993
12883
|
}) => {
|
|
12994
12884
|
const ref = useRef13(null);
|
|
12995
12885
|
const tableRef = useRef13(null);
|
|
12996
|
-
const [columnSizing, setColumnSizing] =
|
|
12886
|
+
const [columnSizing, setColumnSizing] = useState26(columns.reduce((previousValue, currentValue) => {
|
|
12997
12887
|
return {
|
|
12998
12888
|
...previousValue,
|
|
12999
12889
|
[currentValue.id]: currentValue.minSize ?? defaultColumn.minSize
|
|
13000
12890
|
};
|
|
13001
12891
|
}, {}));
|
|
13002
|
-
const [columnSizingInfo, setColumnSizingInfo] =
|
|
13003
|
-
const [pagination, setPagination] =
|
|
12892
|
+
const [columnSizingInfo, setColumnSizingInfo] = useState26();
|
|
12893
|
+
const [pagination, setPagination] = useState26({
|
|
13004
12894
|
pageSize: 10,
|
|
13005
12895
|
pageIndex: 0,
|
|
13006
12896
|
...initialState?.pagination
|
|
13007
12897
|
});
|
|
13008
|
-
const [columnFilters, setColumnFilters] =
|
|
13009
|
-
const computedColumnMinWidths =
|
|
12898
|
+
const [columnFilters, setColumnFilters] = useState26(initialState?.columnFilters);
|
|
12899
|
+
const computedColumnMinWidths = useMemo7(() => {
|
|
13010
12900
|
return columns.reduce((previousValue, column) => {
|
|
13011
12901
|
return {
|
|
13012
12902
|
...previousValue,
|
|
@@ -13015,7 +12905,7 @@ var Table = ({
|
|
|
13015
12905
|
};
|
|
13016
12906
|
}, {});
|
|
13017
12907
|
}, [columns, defaultColumn]);
|
|
13018
|
-
const computedColumnMaxWidths =
|
|
12908
|
+
const computedColumnMaxWidths = useMemo7(() => {
|
|
13019
12909
|
return columns.reduce((previousValue, column) => {
|
|
13020
12910
|
return {
|
|
13021
12911
|
...previousValue,
|
|
@@ -13023,12 +12913,12 @@ var Table = ({
|
|
|
13023
12913
|
};
|
|
13024
12914
|
}, {});
|
|
13025
12915
|
}, [columns, defaultColumn]);
|
|
13026
|
-
const tableMinWidth =
|
|
12916
|
+
const tableMinWidth = useMemo7(() => {
|
|
13027
12917
|
return columns.reduce((sum, column) => {
|
|
13028
12918
|
return sum + computedColumnMinWidths[column.id];
|
|
13029
12919
|
}, 0);
|
|
13030
12920
|
}, [columns, computedColumnMinWidths]);
|
|
13031
|
-
const updateColumnSizes =
|
|
12921
|
+
const updateColumnSizes = useMemo7(() => {
|
|
13032
12922
|
return (previous) => {
|
|
13033
12923
|
const updateSizing = {
|
|
13034
12924
|
...columnSizing,
|
|
@@ -13097,7 +12987,7 @@ var Table = ({
|
|
|
13097
12987
|
minSize: 60,
|
|
13098
12988
|
maxSize: 700,
|
|
13099
12989
|
cell: ({ cell }) => {
|
|
13100
|
-
return /* @__PURE__ */
|
|
12990
|
+
return /* @__PURE__ */ jsx59(TableCell, { children: cell.getValue() });
|
|
13101
12991
|
},
|
|
13102
12992
|
...defaultColumn
|
|
13103
12993
|
},
|
|
@@ -13145,8 +13035,8 @@ var Table = ({
|
|
|
13145
13035
|
columnResizeMode: "onChange",
|
|
13146
13036
|
...tableOptions
|
|
13147
13037
|
});
|
|
13148
|
-
const [hasInitializedSizing, setHasInitializedSizing] =
|
|
13149
|
-
|
|
13038
|
+
const [hasInitializedSizing, setHasInitializedSizing] = useState26(false);
|
|
13039
|
+
useEffect27(() => {
|
|
13150
13040
|
if (!hasInitializedSizing && ref.current) {
|
|
13151
13041
|
setHasInitializedSizing(true);
|
|
13152
13042
|
table.setColumnSizing(updateColumnSizes(columnSizing));
|
|
@@ -13156,7 +13046,7 @@ var Table = ({
|
|
|
13156
13046
|
table.setColumnSizing(updateColumnSizes);
|
|
13157
13047
|
}, [updateColumnSizes]));
|
|
13158
13048
|
const pageCount = table.getPageCount();
|
|
13159
|
-
|
|
13049
|
+
useEffect27(() => {
|
|
13160
13050
|
const totalPages = pageCount;
|
|
13161
13051
|
if (totalPages === 0) {
|
|
13162
13052
|
if (pagination.pageIndex !== 0) {
|
|
@@ -13172,7 +13062,7 @@ var Table = ({
|
|
|
13172
13062
|
}));
|
|
13173
13063
|
}
|
|
13174
13064
|
}, [data, pageCount, pagination.pageSize, pagination.pageIndex]);
|
|
13175
|
-
const columnSizeVars =
|
|
13065
|
+
const columnSizeVars = useMemo7(() => {
|
|
13176
13066
|
const headers = table.getFlatHeaders();
|
|
13177
13067
|
const colSizes = {};
|
|
13178
13068
|
for (let i = 0; i < headers.length; i++) {
|
|
@@ -13182,126 +13072,116 @@ var Table = ({
|
|
|
13182
13072
|
}
|
|
13183
13073
|
return colSizes;
|
|
13184
13074
|
}, [table.getState().columnSizingInfo, table.getState().columnSizing]);
|
|
13185
|
-
console.log(table.getState().sorting);
|
|
13186
13075
|
return /* @__PURE__ */ jsxs37("div", { ref, className: clsx48("flex-col-4", className), children: [
|
|
13187
|
-
/* @__PURE__ */
|
|
13188
|
-
|
|
13076
|
+
/* @__PURE__ */ jsx59("div", { className: clsx48("flex-col-0 w-full overflow-auto", tableContainerClassName), children: /* @__PURE__ */ jsxs37(
|
|
13077
|
+
"table",
|
|
13189
13078
|
{
|
|
13190
|
-
|
|
13191
|
-
|
|
13192
|
-
|
|
13193
|
-
|
|
13194
|
-
|
|
13195
|
-
|
|
13196
|
-
|
|
13197
|
-
|
|
13198
|
-
|
|
13199
|
-
|
|
13200
|
-
|
|
13079
|
+
ref: tableRef,
|
|
13080
|
+
className: clsx48(tableClassName),
|
|
13081
|
+
style: {
|
|
13082
|
+
...columnSizeVars,
|
|
13083
|
+
width: Math.floor(Math.max(table.getTotalSize() - columns.length, ref.current?.offsetWidth ?? table.getTotalSize()))
|
|
13084
|
+
},
|
|
13085
|
+
children: [
|
|
13086
|
+
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx59("colgroup", { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx59(
|
|
13087
|
+
"col",
|
|
13088
|
+
{
|
|
13089
|
+
style: {
|
|
13090
|
+
width: `calc(var(--header-${header?.id}-size) * 1px)`,
|
|
13091
|
+
minWidth: header.column.columnDef.minSize,
|
|
13092
|
+
maxWidth: header.column.columnDef.maxSize
|
|
13093
|
+
}
|
|
13201
13094
|
},
|
|
13202
|
-
|
|
13203
|
-
|
|
13204
|
-
|
|
13205
|
-
|
|
13206
|
-
|
|
13207
|
-
|
|
13208
|
-
|
|
13209
|
-
|
|
13210
|
-
|
|
13211
|
-
|
|
13212
|
-
|
|
13213
|
-
|
|
13214
|
-
|
|
13215
|
-
|
|
13216
|
-
|
|
13217
|
-
|
|
13218
|
-
|
|
13219
|
-
|
|
13220
|
-
|
|
13221
|
-
/* @__PURE__ */ jsx60("div", { className: "flex-row-2 w-full", children: header.isPlaceholder ? null : /* @__PURE__ */ jsxs37("div", { className: "flex-row-1 items-center", children: [
|
|
13222
|
-
header.column.getCanSort() && /* @__PURE__ */ jsx60(
|
|
13223
|
-
TableSortButton,
|
|
13224
|
-
{
|
|
13225
|
-
sortDirection: header.column.getIsSorted(),
|
|
13226
|
-
onClick: () => {
|
|
13227
|
-
const sorted = header.column.getIsSorted();
|
|
13228
|
-
const isMulti = header.column.getCanMultiSort();
|
|
13229
|
-
console.log(isMulti, header.column.id);
|
|
13230
|
-
if (!isMulti) {
|
|
13231
|
-
table.resetSorting();
|
|
13232
|
-
}
|
|
13233
|
-
if (!sorted) {
|
|
13234
|
-
header.column.toggleSorting(true, isMulti);
|
|
13235
|
-
return;
|
|
13236
|
-
} else if (sorted === "desc") {
|
|
13237
|
-
header.column.toggleSorting(false, isMulti);
|
|
13238
|
-
}
|
|
13239
|
-
if (sorted === "asc") {
|
|
13240
|
-
header.column.clearSorting();
|
|
13241
|
-
}
|
|
13242
|
-
}
|
|
13095
|
+
header.id
|
|
13096
|
+
)) }, headerGroup.id)),
|
|
13097
|
+
/* @__PURE__ */ jsx59("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx59("tr", { className: table.options.meta?.headerRowClassName, children: headerGroup.headers.map((header) => {
|
|
13098
|
+
return /* @__PURE__ */ jsxs37(
|
|
13099
|
+
"th",
|
|
13100
|
+
{
|
|
13101
|
+
colSpan: header.colSpan,
|
|
13102
|
+
className: clsx48("relative group", header.column.columnDef.meta?.className),
|
|
13103
|
+
children: [
|
|
13104
|
+
/* @__PURE__ */ jsx59("div", { className: "flex-row-2 w-full", children: header.isPlaceholder ? null : /* @__PURE__ */ jsxs37("div", { className: "flex-row-1 items-center", children: [
|
|
13105
|
+
header.column.getCanSort() && /* @__PURE__ */ jsx59(
|
|
13106
|
+
TableSortButton,
|
|
13107
|
+
{
|
|
13108
|
+
sortDirection: header.column.getIsSorted(),
|
|
13109
|
+
onClick: () => {
|
|
13110
|
+
const sorted = header.column.getIsSorted();
|
|
13111
|
+
const isMulti = header.column.getCanMultiSort();
|
|
13112
|
+
if (!isMulti) {
|
|
13113
|
+
table.resetSorting();
|
|
13243
13114
|
}
|
|
13244
|
-
|
|
13245
|
-
|
|
13246
|
-
|
|
13247
|
-
{
|
|
13248
|
-
|
|
13249
|
-
filterType: header.column.columnDef.meta.filterType
|
|
13115
|
+
if (!sorted) {
|
|
13116
|
+
header.column.toggleSorting(true, isMulti);
|
|
13117
|
+
return;
|
|
13118
|
+
} else if (sorted === "desc") {
|
|
13119
|
+
header.column.toggleSorting(false, isMulti);
|
|
13250
13120
|
}
|
|
13251
|
-
|
|
13252
|
-
|
|
13253
|
-
header.column.columnDef.header,
|
|
13254
|
-
header.getContext()
|
|
13255
|
-
)
|
|
13256
|
-
] }) }),
|
|
13257
|
-
header.column.getCanResize() && /* @__PURE__ */ jsx60(
|
|
13258
|
-
"div",
|
|
13259
|
-
{
|
|
13260
|
-
onMouseDown: header.getResizeHandler(),
|
|
13261
|
-
onTouchStart: header.getResizeHandler(),
|
|
13262
|
-
onDoubleClick: () => {
|
|
13263
|
-
header.column.resetSize();
|
|
13264
|
-
},
|
|
13265
|
-
className: "table-resize-indicator w-2 rounded bg-primary cursor-col-resize select-none touch-none opacity-0 group-hover:opacity-100 transition-opacity",
|
|
13266
|
-
style: {
|
|
13267
|
-
opacity: !columnSizingInfo?.columnSizingStart ? void 0 : columnSizingInfo?.columnSizingStart?.findIndex(([id, _]) => id === header.column.id) !== -1 ? 1 : columnSizingInfo?.columnSizingStart?.length !== 0 ? 0 : void 0
|
|
13121
|
+
if (sorted === "asc") {
|
|
13122
|
+
header.column.clearSorting();
|
|
13268
13123
|
}
|
|
13269
13124
|
}
|
|
13270
|
-
|
|
13271
|
-
|
|
13272
|
-
|
|
13273
|
-
|
|
13274
|
-
|
|
13275
|
-
|
|
13276
|
-
|
|
13277
|
-
|
|
13278
|
-
|
|
13279
|
-
|
|
13125
|
+
}
|
|
13126
|
+
),
|
|
13127
|
+
header.column.getCanFilter() && header.column.columnDef.meta?.filterType ? /* @__PURE__ */ jsx59(
|
|
13128
|
+
TableFilterButton,
|
|
13129
|
+
{
|
|
13130
|
+
column: header.column,
|
|
13131
|
+
filterType: header.column.columnDef.meta.filterType
|
|
13132
|
+
}
|
|
13133
|
+
) : null,
|
|
13134
|
+
flexRender(
|
|
13135
|
+
header.column.columnDef.header,
|
|
13136
|
+
header.getContext()
|
|
13137
|
+
)
|
|
13138
|
+
] }) }),
|
|
13139
|
+
header.column.getCanResize() && /* @__PURE__ */ jsx59(
|
|
13140
|
+
"div",
|
|
13280
13141
|
{
|
|
13281
|
-
|
|
13282
|
-
|
|
13283
|
-
|
|
13284
|
-
|
|
13285
|
-
|
|
13286
|
-
|
|
13287
|
-
|
|
13288
|
-
|
|
13289
|
-
|
|
13290
|
-
|
|
13291
|
-
)
|
|
13292
|
-
|
|
13293
|
-
|
|
13294
|
-
|
|
13295
|
-
|
|
13296
|
-
|
|
13297
|
-
|
|
13298
|
-
|
|
13299
|
-
|
|
13300
|
-
|
|
13301
|
-
|
|
13142
|
+
onMouseDown: header.getResizeHandler(),
|
|
13143
|
+
onTouchStart: header.getResizeHandler(),
|
|
13144
|
+
onDoubleClick: () => {
|
|
13145
|
+
header.column.resetSize();
|
|
13146
|
+
},
|
|
13147
|
+
className: "table-resize-indicator w-2 rounded bg-primary cursor-col-resize select-none touch-none opacity-0 group-hover:opacity-100 transition-opacity",
|
|
13148
|
+
style: {
|
|
13149
|
+
opacity: !columnSizingInfo?.columnSizingStart ? void 0 : columnSizingInfo?.columnSizingStart?.findIndex(([id, _]) => id === header.column.id) !== -1 ? 1 : columnSizingInfo?.columnSizingStart?.length !== 0 ? 0 : void 0
|
|
13150
|
+
}
|
|
13151
|
+
}
|
|
13152
|
+
)
|
|
13153
|
+
]
|
|
13154
|
+
},
|
|
13155
|
+
header.id
|
|
13156
|
+
);
|
|
13157
|
+
}) }, headerGroup.id)) }),
|
|
13158
|
+
/* @__PURE__ */ jsxs37("tbody", { children: [
|
|
13159
|
+
table.getRowModel().rows.map((row) => {
|
|
13160
|
+
return /* @__PURE__ */ jsx59(
|
|
13161
|
+
"tr",
|
|
13162
|
+
{
|
|
13163
|
+
onClick: () => onRowClick?.(row, table),
|
|
13164
|
+
className: table.options.meta?.bodyRowClassName,
|
|
13165
|
+
children: row.getVisibleCells().map((cell) => {
|
|
13166
|
+
return /* @__PURE__ */ jsx59("td", { children: flexRender(
|
|
13167
|
+
cell.column.columnDef.cell,
|
|
13168
|
+
cell.getContext()
|
|
13169
|
+
) }, cell.id);
|
|
13170
|
+
})
|
|
13171
|
+
},
|
|
13172
|
+
row.id
|
|
13173
|
+
);
|
|
13174
|
+
}),
|
|
13175
|
+
range(table.getState().pagination.pageSize - table.getRowModel().rows.length, { allowEmptyRange: true }).map((row, index) => {
|
|
13176
|
+
return /* @__PURE__ */ jsx59("tr", { children: columns.map((column) => {
|
|
13177
|
+
return /* @__PURE__ */ jsx59("td", { children: fillerRow ? fillerRow(column.id, table) : /* @__PURE__ */ jsx59(FillerRowElement, {}) }, column.id);
|
|
13178
|
+
}) }, "filler-row-" + index);
|
|
13179
|
+
})
|
|
13180
|
+
] })
|
|
13181
|
+
]
|
|
13302
13182
|
}
|
|
13303
|
-
),
|
|
13304
|
-
/* @__PURE__ */
|
|
13183
|
+
) }),
|
|
13184
|
+
/* @__PURE__ */ jsx59("div", { className: "flex-row-2 justify-center", children: /* @__PURE__ */ jsx59(
|
|
13305
13185
|
Pagination,
|
|
13306
13186
|
{
|
|
13307
13187
|
pageIndex: table.getState().pagination.pageIndex,
|
|
@@ -13313,7 +13193,7 @@ var Table = ({
|
|
|
13313
13193
|
};
|
|
13314
13194
|
var TableUncontrolled = ({ data, ...props }) => {
|
|
13315
13195
|
const [usedDate] = useOverwritableState(data);
|
|
13316
|
-
return /* @__PURE__ */
|
|
13196
|
+
return /* @__PURE__ */ jsx59(
|
|
13317
13197
|
Table,
|
|
13318
13198
|
{
|
|
13319
13199
|
...props,
|
|
@@ -13332,12 +13212,12 @@ var TableWithSelection = ({
|
|
|
13332
13212
|
meta,
|
|
13333
13213
|
...props
|
|
13334
13214
|
}) => {
|
|
13335
|
-
const columnsWithSelection =
|
|
13215
|
+
const columnsWithSelection = useMemo7(() => {
|
|
13336
13216
|
return [
|
|
13337
13217
|
{
|
|
13338
13218
|
id: selectionRowId,
|
|
13339
13219
|
header: ({ table }) => {
|
|
13340
|
-
return /* @__PURE__ */
|
|
13220
|
+
return /* @__PURE__ */ jsx59(
|
|
13341
13221
|
Checkbox,
|
|
13342
13222
|
{
|
|
13343
13223
|
checked: table.getIsAllRowsSelected(),
|
|
@@ -13350,7 +13230,7 @@ var TableWithSelection = ({
|
|
|
13350
13230
|
);
|
|
13351
13231
|
},
|
|
13352
13232
|
cell: ({ row }) => {
|
|
13353
|
-
return /* @__PURE__ */
|
|
13233
|
+
return /* @__PURE__ */ jsx59(
|
|
13354
13234
|
Checkbox,
|
|
13355
13235
|
{
|
|
13356
13236
|
disabled: !row.getCanSelect(),
|
|
@@ -13368,15 +13248,15 @@ var TableWithSelection = ({
|
|
|
13368
13248
|
...columns
|
|
13369
13249
|
];
|
|
13370
13250
|
}, [columns, selectionRowId]);
|
|
13371
|
-
return /* @__PURE__ */
|
|
13251
|
+
return /* @__PURE__ */ jsx59(
|
|
13372
13252
|
Table,
|
|
13373
13253
|
{
|
|
13374
13254
|
columns: columnsWithSelection,
|
|
13375
13255
|
fillerRow: (columnId, table) => {
|
|
13376
13256
|
if (columnId === selectionRowId) {
|
|
13377
|
-
return /* @__PURE__ */
|
|
13257
|
+
return /* @__PURE__ */ jsx59(Checkbox, { checked: false, disabled: true, className: "max-w-6" });
|
|
13378
13258
|
}
|
|
13379
|
-
return fillerRow ? fillerRow(columnId, table) : /* @__PURE__ */
|
|
13259
|
+
return fillerRow ? fillerRow(columnId, table) : /* @__PURE__ */ jsx59(FillerRowElement, {});
|
|
13380
13260
|
},
|
|
13381
13261
|
state: {
|
|
13382
13262
|
rowSelection,
|
|
@@ -13401,7 +13281,7 @@ var TableWithSelection = ({
|
|
|
13401
13281
|
};
|
|
13402
13282
|
|
|
13403
13283
|
// src/components/user-action/CopyToClipboardWrapper.tsx
|
|
13404
|
-
import { useState as
|
|
13284
|
+
import { useState as useState27 } from "react";
|
|
13405
13285
|
import { clsx as clsx49 } from "clsx";
|
|
13406
13286
|
|
|
13407
13287
|
// src/utils/writeToClipboard.ts
|
|
@@ -13411,7 +13291,7 @@ var writeToClipboard = (text) => {
|
|
|
13411
13291
|
|
|
13412
13292
|
// src/components/user-action/CopyToClipboardWrapper.tsx
|
|
13413
13293
|
import { CheckIcon as CheckIcon2, Copy } from "lucide-react";
|
|
13414
|
-
import { jsx as
|
|
13294
|
+
import { jsx as jsx60, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
13415
13295
|
var CopyToClipboardWrapper = ({
|
|
13416
13296
|
children,
|
|
13417
13297
|
textToCopy,
|
|
@@ -13421,8 +13301,8 @@ var CopyToClipboardWrapper = ({
|
|
|
13421
13301
|
zIndex = 10
|
|
13422
13302
|
}) => {
|
|
13423
13303
|
const translation = useHightideTranslation();
|
|
13424
|
-
const [isShowingIndication, setIsShowingIndication] =
|
|
13425
|
-
const [isShowingConfirmation, setIsShowingConfirmation] =
|
|
13304
|
+
const [isShowingIndication, setIsShowingIndication] = useState27(false);
|
|
13305
|
+
const [isShowingConfirmation, setIsShowingConfirmation] = useState27(false);
|
|
13426
13306
|
const positionClasses = {
|
|
13427
13307
|
top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,
|
|
13428
13308
|
bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,
|
|
@@ -13476,14 +13356,14 @@ var CopyToClipboardWrapper = ({
|
|
|
13476
13356
|
},
|
|
13477
13357
|
children: [
|
|
13478
13358
|
isShowingConfirmation && /* @__PURE__ */ jsxs38("div", { className: "flex-row-1", children: [
|
|
13479
|
-
/* @__PURE__ */
|
|
13359
|
+
/* @__PURE__ */ jsx60(CheckIcon2, { size: 16, className: "text-positive" }),
|
|
13480
13360
|
translation("copied")
|
|
13481
13361
|
] }),
|
|
13482
13362
|
isShowingIndication && /* @__PURE__ */ jsxs38("div", { className: "flex-row-1 text-description", children: [
|
|
13483
|
-
/* @__PURE__ */
|
|
13363
|
+
/* @__PURE__ */ jsx60(Copy, { size: 16 }),
|
|
13484
13364
|
translation("clickToCopy")
|
|
13485
13365
|
] }),
|
|
13486
|
-
/* @__PURE__ */
|
|
13366
|
+
/* @__PURE__ */ jsx60(
|
|
13487
13367
|
"div",
|
|
13488
13368
|
{
|
|
13489
13369
|
className: clsx49(`absolute w-0 h-0`, triangleClasses[position]),
|
|
@@ -13500,7 +13380,7 @@ var CopyToClipboardWrapper = ({
|
|
|
13500
13380
|
|
|
13501
13381
|
// src/components/user-action/DateAndTimePicker.tsx
|
|
13502
13382
|
import clsx50 from "clsx";
|
|
13503
|
-
import { jsx as
|
|
13383
|
+
import { jsx as jsx61, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
13504
13384
|
var DateTimePicker = ({
|
|
13505
13385
|
value = /* @__PURE__ */ new Date(),
|
|
13506
13386
|
start = subtractDuration(/* @__PURE__ */ new Date(), { years: 50 }),
|
|
@@ -13518,12 +13398,12 @@ var DateTimePicker = ({
|
|
|
13518
13398
|
let dateDisplay;
|
|
13519
13399
|
let timeDisplay;
|
|
13520
13400
|
if (useDate) {
|
|
13521
|
-
dateDisplay = /* @__PURE__ */
|
|
13401
|
+
dateDisplay = /* @__PURE__ */ jsx61(
|
|
13522
13402
|
DatePicker,
|
|
13523
13403
|
{
|
|
13524
13404
|
...datePickerProps,
|
|
13525
|
-
className: "min-w-
|
|
13526
|
-
yearMonthPickerProps: {
|
|
13405
|
+
className: "min-w-80 min-h-71 max-h-71",
|
|
13406
|
+
yearMonthPickerProps: { className: "h-full grow" },
|
|
13527
13407
|
value,
|
|
13528
13408
|
start,
|
|
13529
13409
|
end,
|
|
@@ -13532,12 +13412,11 @@ var DateTimePicker = ({
|
|
|
13532
13412
|
);
|
|
13533
13413
|
}
|
|
13534
13414
|
if (useTime) {
|
|
13535
|
-
timeDisplay = /* @__PURE__ */
|
|
13415
|
+
timeDisplay = /* @__PURE__ */ jsx61(
|
|
13536
13416
|
TimePicker,
|
|
13537
13417
|
{
|
|
13538
13418
|
...timePickerProps,
|
|
13539
|
-
className: clsx50("h-
|
|
13540
|
-
maxHeight: 250,
|
|
13419
|
+
className: clsx50("min-h-71 max-h-71", { "justify-between w-full": mode === "time" }),
|
|
13541
13420
|
time: value,
|
|
13542
13421
|
onChange
|
|
13543
13422
|
}
|
|
@@ -13548,10 +13427,10 @@ var DateTimePicker = ({
|
|
|
13548
13427
|
dateDisplay,
|
|
13549
13428
|
timeDisplay
|
|
13550
13429
|
] }),
|
|
13551
|
-
/* @__PURE__ */
|
|
13552
|
-
/* @__PURE__ */
|
|
13553
|
-
/* @__PURE__ */
|
|
13554
|
-
|
|
13430
|
+
/* @__PURE__ */ jsx61("div", { className: "flex-row-2 justify-end", children: /* @__PURE__ */ jsxs39("div", { className: "flex-row-2 mt-1", children: [
|
|
13431
|
+
/* @__PURE__ */ jsx61(Button, { size: "medium", color: "negative", onClick: onRemove, children: translation("clear") }),
|
|
13432
|
+
/* @__PURE__ */ jsx61(
|
|
13433
|
+
Button,
|
|
13555
13434
|
{
|
|
13556
13435
|
size: "medium",
|
|
13557
13436
|
onClick: () => onFinish?.(value),
|
|
@@ -13563,9 +13442,9 @@ var DateTimePicker = ({
|
|
|
13563
13442
|
};
|
|
13564
13443
|
|
|
13565
13444
|
// src/components/user-action/ScrollPicker.tsx
|
|
13566
|
-
import { useCallback as useCallback13, useEffect as
|
|
13445
|
+
import { useCallback as useCallback13, useEffect as useEffect28, useState as useState28 } from "react";
|
|
13567
13446
|
import clsx51 from "clsx";
|
|
13568
|
-
import { jsx as
|
|
13447
|
+
import { jsx as jsx62, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
13569
13448
|
var up = 1;
|
|
13570
13449
|
var down = -1;
|
|
13571
13450
|
var ScrollPicker = ({
|
|
@@ -13584,7 +13463,7 @@ var ScrollPicker = ({
|
|
|
13584
13463
|
transition,
|
|
13585
13464
|
items,
|
|
13586
13465
|
lastTimeStamp
|
|
13587
|
-
}, setAnimation] =
|
|
13466
|
+
}, setAnimation] = useState28({
|
|
13588
13467
|
targetIndex: selectedIndex,
|
|
13589
13468
|
currentIndex: disabled ? selectedIndex : 0,
|
|
13590
13469
|
velocity: 0,
|
|
@@ -13683,7 +13562,7 @@ var ScrollPicker = ({
|
|
|
13683
13562
|
};
|
|
13684
13563
|
});
|
|
13685
13564
|
}, [disabled, getDirection, onChange]);
|
|
13686
|
-
|
|
13565
|
+
useEffect28(() => {
|
|
13687
13566
|
requestAnimationFrame((timestamp) => animate(timestamp, lastTimeStamp));
|
|
13688
13567
|
});
|
|
13689
13568
|
const opacity = (transition2, index, itemsCount) => {
|
|
@@ -13704,7 +13583,7 @@ var ScrollPicker = ({
|
|
|
13704
13583
|
}
|
|
13705
13584
|
return clamp(1 - opacityValue / max);
|
|
13706
13585
|
};
|
|
13707
|
-
return /* @__PURE__ */
|
|
13586
|
+
return /* @__PURE__ */ jsx62(
|
|
13708
13587
|
"div",
|
|
13709
13588
|
{
|
|
13710
13589
|
className: "relative overflow-hidden",
|
|
@@ -13716,14 +13595,14 @@ var ScrollPicker = ({
|
|
|
13716
13595
|
}
|
|
13717
13596
|
},
|
|
13718
13597
|
children: /* @__PURE__ */ jsxs40("div", { className: "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2", children: [
|
|
13719
|
-
/* @__PURE__ */
|
|
13598
|
+
/* @__PURE__ */ jsx62(
|
|
13720
13599
|
"div",
|
|
13721
13600
|
{
|
|
13722
13601
|
className: "absolute z-[1] top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2 w-full min-w-[40px] border border-divider/50 border-y-2 border-x-0 ",
|
|
13723
13602
|
style: { height: `${itemHeight}px` }
|
|
13724
13603
|
}
|
|
13725
13604
|
),
|
|
13726
|
-
/* @__PURE__ */
|
|
13605
|
+
/* @__PURE__ */ jsx62(
|
|
13727
13606
|
"div",
|
|
13728
13607
|
{
|
|
13729
13608
|
className: "flex-col-2 select-none",
|
|
@@ -13731,7 +13610,7 @@ var ScrollPicker = ({
|
|
|
13731
13610
|
transform: `translateY(${-transition * (distance + itemHeight)}px)`,
|
|
13732
13611
|
columnGap: `${distance}px`
|
|
13733
13612
|
},
|
|
13734
|
-
children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */
|
|
13613
|
+
children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */ jsx62(
|
|
13735
13614
|
"div",
|
|
13736
13615
|
{
|
|
13737
13616
|
className: clsx51(
|
|
@@ -13763,7 +13642,7 @@ var ScrollPicker = ({
|
|
|
13763
13642
|
// src/components/user-action/SearchBar.tsx
|
|
13764
13643
|
import { Search } from "lucide-react";
|
|
13765
13644
|
import { clsx as clsx52 } from "clsx";
|
|
13766
|
-
import { jsx as
|
|
13645
|
+
import { jsx as jsx63, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
13767
13646
|
var SearchBar = ({
|
|
13768
13647
|
placeholder,
|
|
13769
13648
|
onSearch,
|
|
@@ -13773,28 +13652,36 @@ var SearchBar = ({
|
|
|
13773
13652
|
}) => {
|
|
13774
13653
|
const translation = useHightideTranslation();
|
|
13775
13654
|
return /* @__PURE__ */ jsxs41("div", { className: clsx52("flex-row-2 justify-between items-center", containerClassName), children: [
|
|
13776
|
-
/* @__PURE__ */
|
|
13655
|
+
/* @__PURE__ */ jsx63(
|
|
13777
13656
|
Input,
|
|
13778
13657
|
{
|
|
13779
13658
|
...inputProps,
|
|
13780
13659
|
placeholder: placeholder ?? translation("search")
|
|
13781
13660
|
}
|
|
13782
13661
|
),
|
|
13783
|
-
onSearch && /* @__PURE__ */
|
|
13662
|
+
onSearch && /* @__PURE__ */ jsx63(
|
|
13663
|
+
Button,
|
|
13664
|
+
{
|
|
13665
|
+
layout: "icon",
|
|
13666
|
+
color: "neutral",
|
|
13667
|
+
disabled: disableOnSearch,
|
|
13668
|
+
onClick: onSearch,
|
|
13669
|
+
children: /* @__PURE__ */ jsx63(Search, { className: "w-full h-full" })
|
|
13670
|
+
}
|
|
13671
|
+
)
|
|
13784
13672
|
] });
|
|
13785
13673
|
};
|
|
13786
13674
|
|
|
13787
13675
|
// src/components/user-action/Tooltip.tsx
|
|
13788
13676
|
import { clsx as clsx53 } from "clsx";
|
|
13789
|
-
import { jsx as
|
|
13677
|
+
import { jsx as jsx64, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
13790
13678
|
var Tooltip = ({
|
|
13791
13679
|
tooltip,
|
|
13792
13680
|
children,
|
|
13793
13681
|
animationDelay = 650,
|
|
13794
13682
|
tooltipClassName = "",
|
|
13795
13683
|
containerClassName = "",
|
|
13796
|
-
position = "bottom"
|
|
13797
|
-
zIndex = 10
|
|
13684
|
+
position = "bottom"
|
|
13798
13685
|
}) => {
|
|
13799
13686
|
const { isHovered, handlers } = useHoverState();
|
|
13800
13687
|
const positionClasses = {
|
|
@@ -13816,6 +13703,7 @@ var Tooltip = ({
|
|
|
13816
13703
|
left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
|
|
13817
13704
|
right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
|
|
13818
13705
|
};
|
|
13706
|
+
const zIndex = useZIndexRegister(isHovered);
|
|
13819
13707
|
return /* @__PURE__ */ jsxs42(
|
|
13820
13708
|
"div",
|
|
13821
13709
|
{
|
|
@@ -13835,7 +13723,7 @@ var Tooltip = ({
|
|
|
13835
13723
|
style: { zIndex, animationDelay: animationDelay + "ms" },
|
|
13836
13724
|
children: [
|
|
13837
13725
|
tooltip,
|
|
13838
|
-
/* @__PURE__ */
|
|
13726
|
+
/* @__PURE__ */ jsx64(
|
|
13839
13727
|
"div",
|
|
13840
13728
|
{
|
|
13841
13729
|
className: clsx53(`absolute w-0 h-0`, triangleClasses[position]),
|
|
@@ -13852,20 +13740,20 @@ var Tooltip = ({
|
|
|
13852
13740
|
|
|
13853
13741
|
// src/components/user-action/input/InsideLabelInput.tsx
|
|
13854
13742
|
import { useId as useId11 } from "react";
|
|
13855
|
-
import { forwardRef as forwardRef9, useState as
|
|
13743
|
+
import { forwardRef as forwardRef9, useState as useState29 } from "react";
|
|
13856
13744
|
import clsx54 from "clsx";
|
|
13857
|
-
import { jsx as
|
|
13745
|
+
import { jsx as jsx65, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
13858
13746
|
var InsideLabelInput = forwardRef9(function InsideLabelInput2({
|
|
13859
13747
|
id: customId,
|
|
13860
13748
|
label,
|
|
13861
13749
|
...props
|
|
13862
13750
|
}, forwardedRef) {
|
|
13863
13751
|
const { value } = props;
|
|
13864
|
-
const [isFocused, setIsFocused] =
|
|
13752
|
+
const [isFocused, setIsFocused] = useState29(false);
|
|
13865
13753
|
const generatedId = useId11();
|
|
13866
13754
|
const id = customId ?? generatedId;
|
|
13867
13755
|
return /* @__PURE__ */ jsxs43("div", { className: clsx54("relative"), children: [
|
|
13868
|
-
/* @__PURE__ */
|
|
13756
|
+
/* @__PURE__ */ jsx65(
|
|
13869
13757
|
Input,
|
|
13870
13758
|
{
|
|
13871
13759
|
...props,
|
|
@@ -13883,7 +13771,7 @@ var InsideLabelInput = forwardRef9(function InsideLabelInput2({
|
|
|
13883
13771
|
}
|
|
13884
13772
|
}
|
|
13885
13773
|
),
|
|
13886
|
-
/* @__PURE__ */
|
|
13774
|
+
/* @__PURE__ */ jsx65(
|
|
13887
13775
|
"label",
|
|
13888
13776
|
{
|
|
13889
13777
|
id: id + "-label",
|
|
@@ -13905,7 +13793,7 @@ var InsideLabelInputUncontrolled = ({
|
|
|
13905
13793
|
...props
|
|
13906
13794
|
}) => {
|
|
13907
13795
|
const [value, setValue] = useOverwritableState(initialValue, props.onChangeText);
|
|
13908
|
-
return /* @__PURE__ */
|
|
13796
|
+
return /* @__PURE__ */ jsx65(
|
|
13909
13797
|
InsideLabelInput,
|
|
13910
13798
|
{
|
|
13911
13799
|
...props,
|
|
@@ -13916,26 +13804,26 @@ var InsideLabelInputUncontrolled = ({
|
|
|
13916
13804
|
};
|
|
13917
13805
|
|
|
13918
13806
|
// src/components/user-action/input/ToggleableInput.tsx
|
|
13919
|
-
import { forwardRef as forwardRef10, useEffect as
|
|
13807
|
+
import { forwardRef as forwardRef10, useEffect as useEffect29, useImperativeHandle as useImperativeHandle4, useRef as useRef14, useState as useState30 } from "react";
|
|
13920
13808
|
import { Pencil } from "lucide-react";
|
|
13921
13809
|
import clsx55 from "clsx";
|
|
13922
|
-
import { jsx as
|
|
13810
|
+
import { jsx as jsx66, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
13923
13811
|
var ToggleableInput = forwardRef10(function ToggleableInput2({
|
|
13924
13812
|
value,
|
|
13925
13813
|
initialState = "display",
|
|
13926
13814
|
editCompleteOptions,
|
|
13927
13815
|
...props
|
|
13928
13816
|
}, forwardedRef) {
|
|
13929
|
-
const [isEditing, setIsEditing] =
|
|
13817
|
+
const [isEditing, setIsEditing] = useState30(initialState !== "display");
|
|
13930
13818
|
const innerRef = useRef14(null);
|
|
13931
13819
|
useImperativeHandle4(forwardedRef, () => innerRef.current);
|
|
13932
|
-
|
|
13820
|
+
useEffect29(() => {
|
|
13933
13821
|
if (isEditing) {
|
|
13934
13822
|
innerRef.current?.focus();
|
|
13935
13823
|
}
|
|
13936
13824
|
}, [isEditing]);
|
|
13937
13825
|
return /* @__PURE__ */ jsxs44("div", { className: clsx55("relative flex-row-2", { "flex-1": isEditing }), children: [
|
|
13938
|
-
/* @__PURE__ */
|
|
13826
|
+
/* @__PURE__ */ jsx66(
|
|
13939
13827
|
Input,
|
|
13940
13828
|
{
|
|
13941
13829
|
...props,
|
|
@@ -13962,8 +13850,8 @@ var ToggleableInput = forwardRef10(function ToggleableInput2({
|
|
|
13962
13850
|
}
|
|
13963
13851
|
),
|
|
13964
13852
|
!isEditing && /* @__PURE__ */ jsxs44("div", { className: "absolute left-0 flex-row-2 items-center pointer-events-none touch-none w-full overflow-hidden", children: [
|
|
13965
|
-
/* @__PURE__ */
|
|
13966
|
-
/* @__PURE__ */
|
|
13853
|
+
/* @__PURE__ */ jsx66("span", { className: clsx55(" truncate"), children: value }),
|
|
13854
|
+
/* @__PURE__ */ jsx66(Pencil, { className: clsx55(`size-force-4`, { "text-transparent": isEditing }) })
|
|
13967
13855
|
] })
|
|
13968
13856
|
] });
|
|
13969
13857
|
});
|
|
@@ -13973,7 +13861,7 @@ var ToggleableInputUncontrolled = ({
|
|
|
13973
13861
|
...restProps
|
|
13974
13862
|
}) => {
|
|
13975
13863
|
const [value, setValue] = useOverwritableState(initialValue, onChangeText);
|
|
13976
|
-
return /* @__PURE__ */
|
|
13864
|
+
return /* @__PURE__ */ jsx66(
|
|
13977
13865
|
ToggleableInput,
|
|
13978
13866
|
{
|
|
13979
13867
|
value,
|
|
@@ -13987,7 +13875,7 @@ var ToggleableInputUncontrolled = ({
|
|
|
13987
13875
|
import { useRef as useRef15 } from "react";
|
|
13988
13876
|
import { useImperativeHandle as useImperativeHandle5 } from "react";
|
|
13989
13877
|
import { forwardRef as forwardRef11 } from "react";
|
|
13990
|
-
import { jsx as
|
|
13878
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
13991
13879
|
var FocusTrap = forwardRef11(function FocusTrap2({
|
|
13992
13880
|
active = true,
|
|
13993
13881
|
initialFocus,
|
|
@@ -13997,20 +13885,20 @@ var FocusTrap = forwardRef11(function FocusTrap2({
|
|
|
13997
13885
|
const innerRef = useRef15(null);
|
|
13998
13886
|
useImperativeHandle5(forwardedRef, () => innerRef.current);
|
|
13999
13887
|
useFocusTrap({ container: innerRef, active, initialFocus, focusFirst });
|
|
14000
|
-
return /* @__PURE__ */
|
|
13888
|
+
return /* @__PURE__ */ jsx67("div", { ref: innerRef, ...props });
|
|
14001
13889
|
});
|
|
14002
13890
|
|
|
14003
13891
|
// src/components/utils/Transition.tsx
|
|
14004
|
-
import { useEffect as
|
|
13892
|
+
import { useEffect as useEffect30, useState as useState31 } from "react";
|
|
14005
13893
|
function Transition({
|
|
14006
13894
|
children,
|
|
14007
13895
|
show,
|
|
14008
13896
|
includeAnimation = true
|
|
14009
13897
|
}) {
|
|
14010
|
-
const [isOpen, setIsOpen] =
|
|
14011
|
-
const [isTransitioning, setIsTransitioning] =
|
|
13898
|
+
const [isOpen, setIsOpen] = useState31(show);
|
|
13899
|
+
const [isTransitioning, setIsTransitioning] = useState31(!isOpen);
|
|
14012
13900
|
const isUsingReducedMotion = typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : true;
|
|
14013
|
-
|
|
13901
|
+
useEffect30(() => {
|
|
14014
13902
|
setIsOpen(show);
|
|
14015
13903
|
setIsTransitioning(true);
|
|
14016
13904
|
}, [show]);
|
|
@@ -14035,7 +13923,7 @@ function Transition({
|
|
|
14035
13923
|
}
|
|
14036
13924
|
|
|
14037
13925
|
// src/hooks/focus/useFocusGuards.ts
|
|
14038
|
-
import { useEffect as
|
|
13926
|
+
import { useEffect as useEffect31 } from "react";
|
|
14039
13927
|
var selectorName = "data-hw-focus-guard";
|
|
14040
13928
|
function FocusGuard() {
|
|
14041
13929
|
const element = document.createElement("div");
|
|
@@ -14073,7 +13961,7 @@ var FocusGuardsService = class _FocusGuardsService {
|
|
|
14073
13961
|
}
|
|
14074
13962
|
};
|
|
14075
13963
|
var useFocusGuards = () => {
|
|
14076
|
-
|
|
13964
|
+
useEffect31(() => {
|
|
14077
13965
|
FocusGuardsService.getInstance().add();
|
|
14078
13966
|
return () => {
|
|
14079
13967
|
FocusGuardsService.getInstance().remove();
|
|
@@ -14082,10 +13970,10 @@ var useFocusGuards = () => {
|
|
|
14082
13970
|
};
|
|
14083
13971
|
|
|
14084
13972
|
// src/hooks/focus/useFocusOnceVisible.ts
|
|
14085
|
-
import React6, { useEffect as
|
|
13973
|
+
import React6, { useEffect as useEffect32 } from "react";
|
|
14086
13974
|
var useFocusOnceVisible = (ref, disable = false) => {
|
|
14087
13975
|
const [hasUsedFocus, setHasUsedFocus] = React6.useState(false);
|
|
14088
|
-
|
|
13976
|
+
useEffect32(() => {
|
|
14089
13977
|
if (disable || hasUsedFocus) {
|
|
14090
13978
|
return;
|
|
14091
13979
|
}
|
|
@@ -14111,7 +13999,7 @@ var useRerender = () => {
|
|
|
14111
13999
|
};
|
|
14112
14000
|
|
|
14113
14001
|
// src/hooks/useSearch.ts
|
|
14114
|
-
import { useCallback as useCallback14, useEffect as
|
|
14002
|
+
import { useCallback as useCallback14, useEffect as useEffect33, useMemo as useMemo8, useState as useState32 } from "react";
|
|
14115
14003
|
|
|
14116
14004
|
// src/utils/simpleSearch.ts
|
|
14117
14005
|
var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
|
|
@@ -14150,9 +14038,9 @@ var useSearch = ({
|
|
|
14150
14038
|
filter,
|
|
14151
14039
|
disabled = false
|
|
14152
14040
|
}) => {
|
|
14153
|
-
const [search, setSearch] =
|
|
14154
|
-
const [result, setResult] =
|
|
14155
|
-
const searchTags =
|
|
14041
|
+
const [search, setSearch] = useState32(initialSearch ?? "");
|
|
14042
|
+
const [result, setResult] = useState32(list);
|
|
14043
|
+
const searchTags = useMemo8(() => additionalSearchTags ?? [], [additionalSearchTags]);
|
|
14156
14044
|
const updateSearch = useCallback14((newSearch) => {
|
|
14157
14045
|
const usedSearch = newSearch ?? search;
|
|
14158
14046
|
if (newSearch) {
|
|
@@ -14160,24 +14048,24 @@ var useSearch = ({
|
|
|
14160
14048
|
}
|
|
14161
14049
|
setResult(MultiSubjectSearchWithMapping([usedSearch, ...searchTags], list, searchMapping));
|
|
14162
14050
|
}, [searchTags, list, search, searchMapping]);
|
|
14163
|
-
|
|
14051
|
+
useEffect33(() => {
|
|
14164
14052
|
if (isSearchInstant) {
|
|
14165
14053
|
setResult(MultiSubjectSearchWithMapping([search, ...searchTags], list, searchMapping));
|
|
14166
14054
|
}
|
|
14167
14055
|
}, [searchTags, isSearchInstant, list, search, searchMapping, additionalSearchTags]);
|
|
14168
|
-
const filteredResult =
|
|
14056
|
+
const filteredResult = useMemo8(() => {
|
|
14169
14057
|
if (!filter) {
|
|
14170
14058
|
return result;
|
|
14171
14059
|
}
|
|
14172
14060
|
return result.filter(filter);
|
|
14173
14061
|
}, [result, filter]);
|
|
14174
|
-
const sortedAndFilteredResult =
|
|
14062
|
+
const sortedAndFilteredResult = useMemo8(() => {
|
|
14175
14063
|
if (!sortingFunction) {
|
|
14176
14064
|
return filteredResult;
|
|
14177
14065
|
}
|
|
14178
14066
|
return filteredResult.sort(sortingFunction);
|
|
14179
14067
|
}, [filteredResult, sortingFunction]);
|
|
14180
|
-
const usedResult =
|
|
14068
|
+
const usedResult = useMemo8(() => {
|
|
14181
14069
|
if (!disabled) {
|
|
14182
14070
|
return sortedAndFilteredResult;
|
|
14183
14071
|
}
|
|
@@ -14408,7 +14296,7 @@ export {
|
|
|
14408
14296
|
AvatarUtil,
|
|
14409
14297
|
BagFunctionUtil,
|
|
14410
14298
|
BreadCrumb,
|
|
14411
|
-
|
|
14299
|
+
Button,
|
|
14412
14300
|
ButtonUtil,
|
|
14413
14301
|
Carousel,
|
|
14414
14302
|
CarouselSlide,
|
|
@@ -14442,8 +14330,6 @@ export {
|
|
|
14442
14330
|
FormElementWrapper,
|
|
14443
14331
|
HelpwaveBadge,
|
|
14444
14332
|
HelpwaveLogo,
|
|
14445
|
-
IconButton,
|
|
14446
|
-
IconButtonUtil,
|
|
14447
14333
|
Input,
|
|
14448
14334
|
InputDialog,
|
|
14449
14335
|
InputUncontrolled,
|
|
@@ -14479,7 +14365,6 @@ export {
|
|
|
14479
14365
|
Navigation,
|
|
14480
14366
|
NavigationItemList,
|
|
14481
14367
|
NumberProperty,
|
|
14482
|
-
OutlineButton,
|
|
14483
14368
|
Pagination,
|
|
14484
14369
|
ProgressIndicator,
|
|
14485
14370
|
PromiseUtils,
|
|
@@ -14500,7 +14385,6 @@ export {
|
|
|
14500
14385
|
SimpleSearch,
|
|
14501
14386
|
SimpleSearchWithMapping,
|
|
14502
14387
|
SingleSelectProperty,
|
|
14503
|
-
SolidButton,
|
|
14504
14388
|
StepperBar,
|
|
14505
14389
|
StepperBarUncontrolled,
|
|
14506
14390
|
Tab,
|
|
@@ -14513,7 +14397,6 @@ export {
|
|
|
14513
14397
|
TableUncontrolled,
|
|
14514
14398
|
TableWithSelection,
|
|
14515
14399
|
TagIcon,
|
|
14516
|
-
TextButton,
|
|
14517
14400
|
TextImage,
|
|
14518
14401
|
TextProperty,
|
|
14519
14402
|
Textarea,
|
|
@@ -14545,7 +14428,6 @@ export {
|
|
|
14545
14428
|
equalSizeGroups,
|
|
14546
14429
|
formatDate,
|
|
14547
14430
|
formatDateTime,
|
|
14548
|
-
generateShadingColors,
|
|
14549
14431
|
getBetweenDuration,
|
|
14550
14432
|
getDaysInMonth,
|
|
14551
14433
|
getNeighbours,
|
|
@@ -14558,7 +14440,6 @@ export {
|
|
|
14558
14440
|
noop,
|
|
14559
14441
|
range,
|
|
14560
14442
|
resolveSetState,
|
|
14561
|
-
shadingColorValues,
|
|
14562
14443
|
subtractDuration,
|
|
14563
14444
|
useDelay,
|
|
14564
14445
|
useFloatingElement,
|
|
@@ -14583,6 +14464,7 @@ export {
|
|
|
14583
14464
|
useTabContext,
|
|
14584
14465
|
useTheme,
|
|
14585
14466
|
useTranslatedValidators,
|
|
14467
|
+
useZIndexRegister,
|
|
14586
14468
|
validateEmail,
|
|
14587
14469
|
weekDayList,
|
|
14588
14470
|
writeToClipboard
|