@keboola/design 6.3.0 → 6.5.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/rjsf.cjs CHANGED
@@ -30,10 +30,10 @@ var DOMPurify = require('dompurify');
30
30
  var reactCollapsible = require('@radix-ui/react-collapsible');
31
31
  var RadixTabs = require('@radix-ui/react-tabs');
32
32
  var ScrollAreaPrimitive2 = require('@radix-ui/react-scroll-area');
33
- var TextareaAutosize = require('react-textarea-autosize');
34
- var reactPopover = require('@radix-ui/react-popover');
35
33
  var RLabel = require('@radix-ui/react-label');
34
+ var TextareaAutosize = require('react-textarea-autosize');
36
35
  var reactCheckbox = require('@radix-ui/react-checkbox');
36
+ var reactPopover = require('@radix-ui/react-popover');
37
37
  var combobox = require('@base-ui/react/combobox');
38
38
  var RRadioGroup = require('@radix-ui/react-radio-group');
39
39
  var RSeparator = require('@radix-ui/react-separator');
@@ -67,8 +67,8 @@ var colors__default = /*#__PURE__*/_interopDefault(colors);
67
67
  var DOMPurify__default = /*#__PURE__*/_interopDefault(DOMPurify);
68
68
  var RadixTabs__namespace = /*#__PURE__*/_interopNamespace(RadixTabs);
69
69
  var ScrollAreaPrimitive2__namespace = /*#__PURE__*/_interopNamespace(ScrollAreaPrimitive2);
70
- var TextareaAutosize__default = /*#__PURE__*/_interopDefault(TextareaAutosize);
71
70
  var RLabel__namespace = /*#__PURE__*/_interopNamespace(RLabel);
71
+ var TextareaAutosize__default = /*#__PURE__*/_interopDefault(TextareaAutosize);
72
72
  var RRadioGroup__namespace = /*#__PURE__*/_interopNamespace(RRadioGroup);
73
73
  var RSeparator__namespace = /*#__PURE__*/_interopNamespace(RSeparator);
74
74
 
@@ -333,6 +333,7 @@ var Tooltip = ({
333
333
  placement = "right",
334
334
  forceHide = false,
335
335
  forceShow = false,
336
+ delayDuration,
336
337
  // trigger props
337
338
  triggerAsChild = false
338
339
  }) => {
@@ -352,6 +353,7 @@ var Tooltip = ({
352
353
  {
353
354
  open: !!tooltip && (open || forceShow) && !forceHide,
354
355
  onOpenChange: setOpen,
356
+ delayDuration,
355
357
  disableHoverableContent: isActionVariant,
356
358
  children: [
357
359
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -415,7 +417,8 @@ var HelpBlock = ({ children, className, state = "default", ...rest }) => {
415
417
  var icons_exports = {};
416
418
  __export(icons_exports, {
417
419
  Google: () => Google,
418
- Keboola: () => Keboola
420
+ Keboola: () => Keboola,
421
+ Microsoft: () => Microsoft
419
422
  });
420
423
  __reExport(icons_exports, lucide_react_star__namespace);
421
424
  var Google = React26.forwardRef(
@@ -474,6 +477,7 @@ var Keboola = React26.forwardRef(
474
477
  width: size,
475
478
  height: size,
476
479
  viewBox: "0 0 300 512",
480
+ overflow: "visible",
477
481
  fill: color,
478
482
  className: cn("lucide", className),
479
483
  ...rest,
@@ -485,6 +489,29 @@ var Keboola = React26.forwardRef(
485
489
  )
486
490
  );
487
491
  Keboola.displayName = "Keboola";
492
+ var Microsoft = React26.forwardRef(
493
+ ({ size = 24, className, children, ...rest }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
494
+ "svg",
495
+ {
496
+ ref,
497
+ xmlns: "http://www.w3.org/2000/svg",
498
+ width: size,
499
+ height: size,
500
+ viewBox: "0 0 21 21",
501
+ fill: "none",
502
+ className: cn("lucide", className),
503
+ ...rest,
504
+ children: [
505
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "0", y: "0", width: "10", height: "10", fill: "#F25022" }),
506
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "11", y: "0", width: "10", height: "10", fill: "#7FBA00" }),
507
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "0", y: "11", width: "10", height: "10", fill: "#00A4EF" }),
508
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "11", y: "11", width: "10", height: "10", fill: "#FFB900" }),
509
+ children
510
+ ]
511
+ }
512
+ )
513
+ );
514
+ Microsoft.displayName = "Microsoft";
488
515
  var variants = classVarianceAuthority.cva(
489
516
  [
490
517
  "tailwindcss-preflight",
@@ -1015,14 +1042,9 @@ var getLanguageMode = (mode) => {
1015
1042
  return langJson.json();
1016
1043
  }
1017
1044
  };
1045
+ var shouldLintJson = (mode, readOnly) => mode === "application/json" && !readOnly;
1018
1046
  var KbdSeparator = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("span", { ...props, className: cn("tw-text-xs tw-text-muted-foreground", className) });
1019
- var KbdGroup = ({
1020
- ref,
1021
- className,
1022
- children,
1023
- separator,
1024
- ...props
1025
- }) => {
1047
+ var KbdGroup = ({ ref, className, children, separator, ...props }) => {
1026
1048
  return /* @__PURE__ */ jsxRuntime.jsx(
1027
1049
  "kbd",
1028
1050
  {
@@ -1113,7 +1135,7 @@ var CodeEditor = ({
1113
1135
  const commonExtensions = React26.useMemo(() => {
1114
1136
  return [
1115
1137
  getLanguageMode(mode),
1116
- mode === "application/json" && lint.linter(langJson.jsonParseLinter()),
1138
+ shouldLintJson(mode, readOnly) && lint.linter(langJson.jsonParseLinter()),
1117
1139
  withLineWrapping ? view.EditorView.lineWrapping : [],
1118
1140
  CodeMirror.EditorState.languageData.of(() => [
1119
1141
  { autocomplete: completeAny ? autocomplete.completeAnyWord : autocompletions }
@@ -1131,7 +1153,7 @@ var CodeEditor = ({
1131
1153
  autocomplete.autocompletion({ activateOnTyping: completeAny }),
1132
1154
  baseTheme
1133
1155
  ].filter(Boolean);
1134
- }, [autocompletions, completeAny, extraKeys, mode, withLineWrapping, baseTheme]);
1156
+ }, [autocompletions, completeAny, extraKeys, mode, readOnly, withLineWrapping, baseTheme]);
1135
1157
  const extensions = React26.useMemo(() => {
1136
1158
  return [
1137
1159
  ...commonExtensions,
@@ -1602,12 +1624,7 @@ var GridObjectField = ({
1602
1624
  gridContent
1603
1625
  ] });
1604
1626
  };
1605
- var CollapsibleContent = ({
1606
- ref,
1607
- className,
1608
- children,
1609
- ...props
1610
- }) => /* @__PURE__ */ jsxRuntime.jsx(
1627
+ var CollapsibleContent = ({ ref, className, children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
1611
1628
  reactCollapsible.Content,
1612
1629
  {
1613
1630
  ref,
@@ -1623,12 +1640,7 @@ var CollapsibleContent = ({
1623
1640
  var Collapsible = (props) => /* @__PURE__ */ jsxRuntime.jsx(reactCollapsible.Root, { ...props });
1624
1641
  Collapsible.Trigger = reactCollapsible.CollapsibleTrigger;
1625
1642
  Collapsible.Content = CollapsibleContent;
1626
- var AlertAction = ({
1627
- ref,
1628
- className,
1629
- asChild = false,
1630
- ...props
1631
- }) => {
1643
+ var AlertAction = ({ ref, className, asChild = false, ...props }) => {
1632
1644
  const Comp = asChild ? reactSlot.Slot : "div";
1633
1645
  return /* @__PURE__ */ jsxRuntime.jsx(
1634
1646
  Comp,
@@ -1666,12 +1678,7 @@ var AlertCollapsibleIcon = ({ open }) => /* @__PURE__ */ jsxRuntime.jsx(Tooltip,
1666
1678
  )
1667
1679
  }
1668
1680
  ) });
1669
- var AlertDescription = ({
1670
- ref,
1671
- children,
1672
- className,
1673
- ...rest
1674
- }) => /* @__PURE__ */ jsxRuntime.jsx(
1681
+ var AlertDescription = ({ ref, children, className, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(
1675
1682
  "div",
1676
1683
  {
1677
1684
  ...rest,
@@ -1724,13 +1731,7 @@ var AlertIcon = ({ variant, icon, className, ...rest }) => /* @__PURE__ */ jsxRu
1724
1731
  children: icon ?? VARIANT_ICONS[variant]
1725
1732
  }
1726
1733
  );
1727
- var AlertRoot = ({
1728
- ref,
1729
- children,
1730
- className,
1731
- variant,
1732
- ...rest
1733
- }) => {
1734
+ var AlertRoot = ({ ref, children, className, variant, ...rest }) => {
1734
1735
  const renderArgo = useArgoDesign();
1735
1736
  return /* @__PURE__ */ jsxRuntime.jsx(
1736
1737
  "div",
@@ -1787,11 +1788,7 @@ var AlertRoot = ({
1787
1788
  }
1788
1789
  );
1789
1790
  };
1790
- var AlertTitle = ({
1791
- ref,
1792
- className,
1793
- ...props
1794
- }) => /* @__PURE__ */ jsxRuntime.jsx(
1791
+ var AlertTitle = ({ ref, className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
1795
1792
  "div",
1796
1793
  {
1797
1794
  ...props,
@@ -2321,6 +2318,55 @@ var ErrorListTemplate = ({ errors }) => {
2321
2318
  if (!errors.length) return null;
2322
2319
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw-mb-4", children: errors.map((error) => /* @__PURE__ */ jsxRuntime.jsx("p", { className: "tw-text-xs tw-text-error-500", children: error.message }, `${error.property}:${error.message}`)) });
2323
2320
  };
2321
+ var Optional = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("span", { ...props, "aria-hidden": true, className: cn("tw-ml-0.5", "tw-text-muted-foreground", className), children: "(optional)" });
2322
+ var Required = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("span", { ...props, "aria-hidden": true, className: cn("tw-ml-0.5", "tw-text-primary", className), children: "*" });
2323
+ var Label = ({ className, children, id, htmlFor, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(
2324
+ RLabel__namespace.Root,
2325
+ {
2326
+ ...rest,
2327
+ id: id?.toString(),
2328
+ htmlFor: htmlFor?.toString(),
2329
+ className: cn(
2330
+ "tw-m-0 tw-text-foreground tw-font-normal peer-disabled:tw-opacity-50",
2331
+ className
2332
+ ),
2333
+ children
2334
+ }
2335
+ );
2336
+ Label.Optional = Optional;
2337
+ Label.Required = Required;
2338
+ var Link = ({
2339
+ ref,
2340
+ children,
2341
+ target = "_blank",
2342
+ rel = "noopener noreferrer",
2343
+ onClick,
2344
+ className,
2345
+ ...rest
2346
+ }) => {
2347
+ const handleOnClick = (event) => {
2348
+ event.stopPropagation();
2349
+ onClick?.(event);
2350
+ };
2351
+ return (
2352
+ // oxlint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
2353
+ /* @__PURE__ */ jsxRuntime.jsx(
2354
+ "a",
2355
+ {
2356
+ ...rest,
2357
+ ref,
2358
+ target,
2359
+ rel,
2360
+ onClick: handleOnClick,
2361
+ className: cn(
2362
+ "tw-text-primary tw-underline hover:tw-text-primary/90 hover:tw-no-underline",
2363
+ className
2364
+ ),
2365
+ children
2366
+ }
2367
+ )
2368
+ );
2369
+ };
2324
2370
  var FormGroupContext = React26.createContext({
2325
2371
  state: "default"
2326
2372
  });
@@ -2368,12 +2414,7 @@ var InputGroupAddon = ({
2368
2414
  className,
2369
2415
  ...props
2370
2416
  }) => /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, "data-align": align, className: cn(addonVariants({ align, className })), children });
2371
- var InputGroupButton = ({
2372
- ref,
2373
- className,
2374
- tabIndex = -1,
2375
- ...props
2376
- }) => /* @__PURE__ */ jsxRuntime.jsx(
2417
+ var InputGroupButton = ({ ref, className, tabIndex = -1, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
2377
2418
  Button,
2378
2419
  {
2379
2420
  ...props,
@@ -2384,11 +2425,7 @@ var InputGroupButton = ({
2384
2425
  className: cn("tw-size-5", "[&_svg]:tw-text-muted-foreground", className)
2385
2426
  }
2386
2427
  );
2387
- var InputGroupInput = ({
2388
- ref,
2389
- className,
2390
- ...inputProps
2391
- }) => /* @__PURE__ */ jsxRuntime.jsx(
2428
+ var InputGroupInput = ({ ref, className, ...inputProps }) => /* @__PURE__ */ jsxRuntime.jsx(
2392
2429
  "input",
2393
2430
  {
2394
2431
  ...inputProps,
@@ -2627,8 +2664,15 @@ var inputGroupVariants = classVarianceAuthority.cva(
2627
2664
  "tw-border-input",
2628
2665
  "tw-text-foreground",
2629
2666
  "has-[:is(input,textarea):disabled]:tw-opacity-50",
2667
+ // readonly: keep the themed input surface/border. The base layer's fixed
2668
+ // `neutral-150` (a light grey) is correct for the legacy light chrome but
2669
+ // collides with argo's themed `foreground` text — light-on-light, invisible
2670
+ // in dark mode. Re-pin to the same `muted`/`input` tokens the editable argo
2671
+ // input uses (validated AA), so readonly stays legible in every scheme.
2672
+ "has-[:is(input,textarea)[readonly]]:tw-bg-muted",
2673
+ "has-[:is(input,textarea)[readonly]]:tw-border-input",
2630
2674
  // higher specificity than has-[:is(input,textarea):focus] — prevents focus border on readonly
2631
- "has-[:is(input,textarea)[readonly]:focus]:tw-border-neutral-150",
2675
+ "has-[:is(input,textarea)[readonly]:focus]:tw-border-input",
2632
2676
  // aria-invalid on the control surfaces the error chrome without a `state` prop — the
2633
2677
  // accessible path (uses the themeable `destructive` status token).
2634
2678
  "has-[:is(input,textarea)[aria-invalid=true]]:tw-border-destructive",
@@ -2709,6 +2753,29 @@ InputGroup.Addon = InputGroupAddon;
2709
2753
  InputGroup.Button = InputGroupButton;
2710
2754
  InputGroup.TextArea = InputGroupTextArea;
2711
2755
  InputGroup.Text = InputGroupText;
2756
+ var useControllableState = ({
2757
+ prop,
2758
+ defaultProp,
2759
+ onChange
2760
+ }) => {
2761
+ const [uncontrolled, setUncontrolled] = React26.useState(defaultProp);
2762
+ const isControlled = prop !== void 0;
2763
+ const value = prop !== void 0 ? prop : uncontrolled;
2764
+ const valueRef = React26.useRef(value);
2765
+ valueRef.current = value;
2766
+ const onChangeRef = React26.useRef(onChange);
2767
+ onChangeRef.current = onChange;
2768
+ const setValue = React26.useCallback(
2769
+ (next) => {
2770
+ const nextValue = typeof next === "function" ? next(valueRef.current) : next;
2771
+ valueRef.current = nextValue;
2772
+ if (!isControlled) setUncontrolled(nextValue);
2773
+ onChangeRef.current?.(nextValue);
2774
+ },
2775
+ [isControlled]
2776
+ );
2777
+ return [value, setValue];
2778
+ };
2712
2779
 
2713
2780
  // src/blocks/ColorInput/utils.ts
2714
2781
  var HEX_CHARSET = /^[0-9a-fA-F]+$/;
@@ -2800,13 +2867,13 @@ var ColorInput = ({
2800
2867
  ...restInputProps
2801
2868
  }) => {
2802
2869
  const inputRef = React26.useRef(null);
2803
- const [internalValue, setInternalValue] = React26.useState(defaultValue ?? "");
2870
+ const [value, setValue] = useControllableState({
2871
+ // A `null` controlled value stays controlled (coerced to ''); `undefined` is uncontrolled.
2872
+ prop: valueProp === null ? "" : valueProp,
2873
+ defaultProp: defaultValue ?? "",
2874
+ onChange: onValueChange
2875
+ });
2804
2876
  const isControlled = valueProp !== void 0;
2805
- const value = isControlled ? valueProp ?? "" : internalValue;
2806
- const setValue = (nextValue) => {
2807
- if (!isControlled) setInternalValue(nextValue);
2808
- onValueChange?.(nextValue);
2809
- };
2810
2877
  const canClear = allowClear && !!value && !disabled && !readOnly;
2811
2878
  const swatchColor = coerceHexInputValue(value);
2812
2879
  const isValidSwatch = isCompleteHexColor(swatchColor);
@@ -2909,10 +2976,7 @@ var ColorInput = ({
2909
2976
  }
2910
2977
  );
2911
2978
  };
2912
- var FormGroupColorInput = ({
2913
- ref,
2914
- ...props
2915
- }) => {
2979
+ var FormGroupColorInput = ({ ref, ...props }) => {
2916
2980
  const { state } = useFormGroupContext();
2917
2981
  return /* @__PURE__ */ jsxRuntime.jsx(ColorInput, { state, ...props, ref });
2918
2982
  };
@@ -2986,10 +3050,7 @@ var NumberInput = ({
2986
3050
  }
2987
3051
  );
2988
3052
  };
2989
- var FormGroupNumberInput = ({
2990
- ref,
2991
- ...props
2992
- }) => {
3053
+ var FormGroupNumberInput = ({ ref, ...props }) => {
2993
3054
  const { state } = useFormGroupContext();
2994
3055
  return /* @__PURE__ */ jsxRuntime.jsx(NumberInput, { ...props, ref, state });
2995
3056
  };
@@ -3001,8 +3062,18 @@ var Textarea = ({
3001
3062
  variant,
3002
3063
  sizing,
3003
3064
  focusVariant,
3065
+ // value handling
3066
+ value: valueProp,
3067
+ defaultValue,
3068
+ onValueChange,
3004
3069
  ...rest
3005
3070
  }) => {
3071
+ const [value, setValue] = useControllableState({
3072
+ // `undefined` stays uncontrolled; any provided value (incl. `null`) is controlled, coerced to ''.
3073
+ prop: valueProp === void 0 ? void 0 : valueProp ?? "",
3074
+ defaultProp: defaultValue ?? "",
3075
+ onChange: onValueChange
3076
+ });
3006
3077
  return /* @__PURE__ */ jsxRuntime.jsx(
3007
3078
  InputGroup,
3008
3079
  {
@@ -3011,7 +3082,7 @@ var Textarea = ({
3011
3082
  focusVariant,
3012
3083
  variant,
3013
3084
  className: containerClassName,
3014
- children: /* @__PURE__ */ jsxRuntime.jsx(InputGroup.TextArea, { ...rest, ref })
3085
+ children: /* @__PURE__ */ jsxRuntime.jsx(InputGroup.TextArea, { ...rest, ref, value, onValueChange: setValue })
3015
3086
  }
3016
3087
  );
3017
3088
  };
@@ -3020,488 +3091,997 @@ var FormGroupTextarea = (props) => {
3020
3091
  return /* @__PURE__ */ jsxRuntime.jsx(Textarea, { state, ...props });
3021
3092
  };
3022
3093
 
3023
- // ../../node_modules/.pnpm/@date-fns+tz@1.4.1/node_modules/@date-fns/tz/tzName/index.js
3024
- function tzName(timeZone, date, format2 = "long") {
3025
- return new Intl.DateTimeFormat("en-US", {
3026
- // Enforces engine to render the time. Without the option JavaScriptCore omits it.
3027
- hour: "numeric",
3028
- timeZone,
3029
- timeZoneName: format2
3030
- }).format(date).split(/\s/g).slice(2).join(" ");
3031
- }
3032
-
3033
- // ../../node_modules/.pnpm/@date-fns+tz@1.4.1/node_modules/@date-fns/tz/tzOffset/index.js
3034
- var offsetFormatCache = {};
3035
- var offsetCache = {};
3036
- function tzOffset(timeZone, date) {
3037
- try {
3038
- const format2 = offsetFormatCache[timeZone] ||= new Intl.DateTimeFormat("en-US", {
3039
- timeZone,
3040
- timeZoneName: "longOffset"
3041
- }).format;
3042
- const offsetStr = format2(date).split("GMT")[1];
3043
- if (offsetStr in offsetCache) return offsetCache[offsetStr];
3044
- return calcOffset(offsetStr, offsetStr.split(":"));
3045
- } catch {
3046
- if (timeZone in offsetCache) return offsetCache[timeZone];
3047
- const captures = timeZone?.match(offsetRe);
3048
- if (captures) return calcOffset(timeZone, captures.slice(1));
3049
- return NaN;
3050
- }
3051
- }
3052
- var offsetRe = /([+-]\d\d):?(\d\d)?/;
3053
- function calcOffset(cacheStr, values) {
3054
- const hours = +(values[0] || 0);
3055
- const minutes = +(values[1] || 0);
3056
- const seconds = +(values[2] || 0) / 60;
3057
- return offsetCache[cacheStr] = hours * 60 + minutes > 0 ? hours * 60 + minutes + seconds : hours * 60 - minutes - seconds;
3058
- }
3059
-
3060
- // ../../node_modules/.pnpm/@date-fns+tz@1.4.1/node_modules/@date-fns/tz/date/mini.js
3061
- var TZDateMini = class _TZDateMini extends Date {
3062
- //#region static
3063
- constructor(...args) {
3064
- super();
3065
- if (args.length > 1 && typeof args[args.length - 1] === "string") {
3066
- this.timeZone = args.pop();
3067
- }
3068
- this.internal = /* @__PURE__ */ new Date();
3069
- if (isNaN(tzOffset(this.timeZone, this))) {
3070
- this.setTime(NaN);
3071
- } else {
3072
- if (!args.length) {
3073
- this.setTime(Date.now());
3074
- } else if (typeof args[0] === "number" && (args.length === 1 || args.length === 2 && typeof args[1] !== "number")) {
3075
- this.setTime(args[0]);
3076
- } else if (typeof args[0] === "string") {
3077
- this.setTime(+new Date(args[0]));
3078
- } else if (args[0] instanceof Date) {
3079
- this.setTime(+args[0]);
3080
- } else {
3081
- this.setTime(+new Date(...args));
3082
- adjustToSystemTZ(this);
3083
- syncToInternal(this);
3084
- }
3085
- }
3086
- }
3087
- static tz(tz, ...args) {
3088
- return args.length ? new _TZDateMini(...args, tz) : new _TZDateMini(Date.now(), tz);
3089
- }
3090
- //#endregion
3091
- //#region time zone
3092
- withTimeZone(timeZone) {
3093
- return new _TZDateMini(+this, timeZone);
3094
- }
3095
- getTimezoneOffset() {
3096
- const offset = -tzOffset(this.timeZone, this);
3097
- return offset > 0 ? Math.floor(offset) : Math.ceil(offset);
3098
- }
3099
- //#endregion
3100
- //#region time
3101
- setTime(time) {
3102
- Date.prototype.setTime.apply(this, arguments);
3103
- syncToInternal(this);
3104
- return +this;
3105
- }
3106
- //#endregion
3107
- //#region date-fns integration
3108
- [/* @__PURE__ */ Symbol.for("constructDateFrom")](date) {
3109
- return new _TZDateMini(+new Date(date), this.timeZone);
3110
- }
3111
- //#endregion
3094
+ // src/blocks/TextInput/utils.ts
3095
+ var genInputTestId = (prefix = "") => {
3096
+ const ps = createPrefixedString(prefix);
3097
+ return {
3098
+ toString: () => prefix,
3099
+ inputWrapper: ps`input-wrapper`,
3100
+ input: ps`input`,
3101
+ clearButton: ps`clear-button`
3102
+ };
3112
3103
  };
3113
- var re = /^(get|set)(?!UTC)/;
3114
- Object.getOwnPropertyNames(Date.prototype).forEach((method) => {
3115
- if (!re.test(method)) return;
3116
- const utcMethod = method.replace(re, "$1UTC");
3117
- if (!TZDateMini.prototype[utcMethod]) return;
3118
- if (method.startsWith("get")) {
3119
- TZDateMini.prototype[method] = function() {
3120
- return this.internal[utcMethod]();
3121
- };
3122
- } else {
3123
- TZDateMini.prototype[method] = function() {
3124
- Date.prototype[utcMethod].apply(this.internal, arguments);
3125
- syncFromInternal(this);
3126
- return +this;
3127
- };
3128
- TZDateMini.prototype[utcMethod] = function() {
3129
- Date.prototype[utcMethod].apply(this, arguments);
3130
- syncToInternal(this);
3131
- return +this;
3132
- };
3133
- }
3134
- });
3135
- function syncToInternal(date) {
3136
- date.internal.setTime(+date);
3137
- date.internal.setUTCSeconds(date.internal.getUTCSeconds() - Math.round(-tzOffset(date.timeZone, date) * 60));
3138
- }
3139
- function syncFromInternal(date) {
3140
- Date.prototype.setFullYear.call(date, date.internal.getUTCFullYear(), date.internal.getUTCMonth(), date.internal.getUTCDate());
3141
- Date.prototype.setHours.call(date, date.internal.getUTCHours(), date.internal.getUTCMinutes(), date.internal.getUTCSeconds(), date.internal.getUTCMilliseconds());
3142
- adjustToSystemTZ(date);
3143
- }
3144
- function adjustToSystemTZ(date) {
3145
- const baseOffset = tzOffset(date.timeZone, date);
3146
- const offset = baseOffset > 0 ? Math.floor(baseOffset) : Math.ceil(baseOffset);
3147
- const prevHour = /* @__PURE__ */ new Date(+date);
3148
- prevHour.setUTCHours(prevHour.getUTCHours() - 1);
3149
- const systemOffset = -(/* @__PURE__ */ new Date(+date)).getTimezoneOffset();
3150
- const prevHourSystemOffset = -(/* @__PURE__ */ new Date(+prevHour)).getTimezoneOffset();
3151
- const systemDSTChange = systemOffset - prevHourSystemOffset;
3152
- const dstShift = Date.prototype.getHours.apply(date) !== date.internal.getUTCHours();
3153
- if (systemDSTChange && dstShift) date.internal.setUTCMinutes(date.internal.getUTCMinutes() + systemDSTChange);
3154
- const offsetDiff = systemOffset - offset;
3155
- if (offsetDiff) Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetDiff);
3156
- const systemDate = /* @__PURE__ */ new Date(+date);
3157
- systemDate.setUTCSeconds(0);
3158
- const systemSecondsOffset = systemOffset > 0 ? systemDate.getSeconds() : (systemDate.getSeconds() - 60) % 60;
3159
- const secondsOffset = Math.round(-(tzOffset(date.timeZone, date) * 60)) % 60;
3160
- if (secondsOffset || systemSecondsOffset) {
3161
- date.internal.setUTCSeconds(date.internal.getUTCSeconds() + secondsOffset);
3162
- Date.prototype.setUTCSeconds.call(date, Date.prototype.getUTCSeconds.call(date) + secondsOffset + systemSecondsOffset);
3163
- }
3164
- const postBaseOffset = tzOffset(date.timeZone, date);
3165
- const postOffset = postBaseOffset > 0 ? Math.floor(postBaseOffset) : Math.ceil(postBaseOffset);
3166
- const postSystemOffset = -(/* @__PURE__ */ new Date(+date)).getTimezoneOffset();
3167
- const postOffsetDiff = postSystemOffset - postOffset;
3168
- const offsetChanged = postOffset !== offset;
3169
- const postDiff = postOffsetDiff - offsetDiff;
3170
- if (offsetChanged && postDiff) {
3171
- Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + postDiff);
3172
- const newBaseOffset = tzOffset(date.timeZone, date);
3173
- const newOffset = newBaseOffset > 0 ? Math.floor(newBaseOffset) : Math.ceil(newBaseOffset);
3174
- const offsetChange = postOffset - newOffset;
3175
- if (offsetChange) {
3176
- date.internal.setUTCMinutes(date.internal.getUTCMinutes() + offsetChange);
3177
- Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetChange);
3104
+ var sanitizeTextInputValue = (value) => {
3105
+ if (typeof value === "string" && value.trim() === "") return "";
3106
+ return value;
3107
+ };
3108
+ var TextInput = ({
3109
+ ref: forwardedRef,
3110
+ state = "default",
3111
+ sizing = "default",
3112
+ className,
3113
+ prefix = null,
3114
+ rightSuffix = null,
3115
+ rightSuffixVariant = "default",
3116
+ leftSuffix = null,
3117
+ allowClear = false,
3118
+ onClear,
3119
+ disabled = false,
3120
+ testId: prefixTestId = "",
3121
+ autoFocus = false,
3122
+ id,
3123
+ name,
3124
+ variant,
3125
+ readOnly,
3126
+ type = "text",
3127
+ focusVariant = "default",
3128
+ onChange,
3129
+ onBlur,
3130
+ onValueChange,
3131
+ onValueBlur,
3132
+ value: valueProp,
3133
+ defaultValue,
3134
+ ...inputProps
3135
+ }) => {
3136
+ const inputRef = React26.useRef(null);
3137
+ const [value, setValue] = useControllableState({
3138
+ // `undefined` stays uncontrolled; any provided value (incl. `null`) is controlled and coerced
3139
+ // to a string. Whitespace-only input collapses to '' via `sanitizeTextInputValue`.
3140
+ prop: valueProp === void 0 ? void 0 : sanitizeTextInputValue(valueProp) ?? "",
3141
+ defaultProp: sanitizeTextInputValue(defaultValue) ?? "",
3142
+ onChange: onValueChange
3143
+ });
3144
+ const testId = genInputTestId(prefixTestId);
3145
+ const isClearButtonVisible = !!value && !disabled && !readOnly || !!onClear;
3146
+ const handleChange = (event) => {
3147
+ setValue(event.target.value);
3148
+ onChange?.(event);
3149
+ };
3150
+ const handleBlur = (event) => {
3151
+ onValueBlur?.(event.target.value);
3152
+ onBlur?.(event);
3153
+ };
3154
+ const handleClear = () => {
3155
+ if (inputRef.current === null) return;
3156
+ inputRef.current.value = "";
3157
+ inputRef.current.focus();
3158
+ onClear?.();
3159
+ handleChange(createChangeInputEvent(inputRef.current));
3160
+ };
3161
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3162
+ InputGroup,
3163
+ {
3164
+ state,
3165
+ variant,
3166
+ sizing,
3167
+ focusVariant,
3168
+ className,
3169
+ "data-testid": testId.inputWrapper,
3170
+ children: [
3171
+ prefix && /* @__PURE__ */ jsxRuntime.jsx(InputGroup.Addon, { align: "inline-start", children: prefix }),
3172
+ /* @__PURE__ */ jsxRuntime.jsx(
3173
+ InputGroup.Input,
3174
+ {
3175
+ ...inputProps,
3176
+ value,
3177
+ autoFocus,
3178
+ type,
3179
+ onChange: handleChange,
3180
+ onBlur: handleBlur,
3181
+ ref: mergeRefs(forwardedRef ?? null, inputRef),
3182
+ disabled,
3183
+ id,
3184
+ name,
3185
+ readOnly,
3186
+ "data-testid": testId.input
3187
+ }
3188
+ ),
3189
+ (leftSuffix || allowClear || rightSuffix) && /* @__PURE__ */ jsxRuntime.jsxs(InputGroup.Addon, { align: "inline-end", children: [
3190
+ leftSuffix,
3191
+ allowClear && isClearButtonVisible && /* @__PURE__ */ jsxRuntime.jsx(
3192
+ InputGroup.Button,
3193
+ {
3194
+ "aria-label": "Clear",
3195
+ onMouseDown: (e) => e.preventDefault(),
3196
+ onClick: handleClear,
3197
+ "data-testid": testId.clearButton,
3198
+ children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.X, { className: "tw-size-4" })
3199
+ }
3200
+ ),
3201
+ rightSuffix && /* @__PURE__ */ jsxRuntime.jsx(
3202
+ "div",
3203
+ {
3204
+ className: cn({
3205
+ "tw-whitespace-nowrap tw-bg-muted tw-px-4 -tw-mr-4 tw-py-2.5": rightSuffixVariant === "addon"
3206
+ }),
3207
+ children: rightSuffix
3208
+ }
3209
+ )
3210
+ ] })
3211
+ ]
3178
3212
  }
3213
+ );
3214
+ };
3215
+ var FormGroupTextInput = ({ ref, ...props }) => {
3216
+ const { state } = useFormGroupContext();
3217
+ return /* @__PURE__ */ jsxRuntime.jsx(TextInput, { state, ...props, ref });
3218
+ };
3219
+ var FormGroup = ({ className, children, state, ...rest }) => {
3220
+ return /* @__PURE__ */ jsxRuntime.jsx(FormGroupProvider, { value: { state }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ...rest, className: cn("tw-flex tw-flex-col tw-gap-1", className), children }) });
3221
+ };
3222
+ FormGroup.Help = FormGroupHelp;
3223
+ FormGroup.Error = FormGroupError;
3224
+ FormGroup.TextInput = FormGroupTextInput;
3225
+ FormGroup.NumberInput = FormGroupNumberInput;
3226
+ FormGroup.ColorInput = FormGroupColorInput;
3227
+ FormGroup.Textarea = FormGroupTextarea;
3228
+ var RootFormDataContext = React26.createContext({});
3229
+ var RootFormDataProvider = RootFormDataContext;
3230
+ var useRootFormData = () => React26.use(RootFormDataContext);
3231
+ var resolveByPath2 = (parts, data) => {
3232
+ let current = data;
3233
+ for (const part of parts) {
3234
+ if (current == null || typeof current !== "object") return void 0;
3235
+ current = current[part];
3179
3236
  }
3180
- }
3181
-
3182
- // ../../node_modules/.pnpm/@date-fns+tz@1.4.1/node_modules/@date-fns/tz/date/index.js
3183
- var TZDate = class _TZDate extends TZDateMini {
3184
- //#region static
3185
- static tz(tz, ...args) {
3186
- return args.length ? new _TZDate(...args, tz) : new _TZDate(Date.now(), tz);
3187
- }
3188
- //#endregion
3189
- //#region representation
3190
- toISOString() {
3191
- const [sign, hours, minutes] = this.tzComponents();
3192
- const tz = `${sign}${hours}:${minutes}`;
3193
- return this.internal.toISOString().slice(0, -1) + tz;
3237
+ return current;
3238
+ };
3239
+ var resolveDependencyValue = (path, formData, parentPath) => {
3240
+ if (path.startsWith("root.")) {
3241
+ return resolveByPath2(path.replace(/^root\./, "").split("."), formData);
3194
3242
  }
3195
- toString() {
3196
- return `${this.toDateString()} ${this.toTimeString()}`;
3243
+ const parent = resolveByPath2(parentPath.map(String), formData);
3244
+ if (parent && typeof parent === "object") {
3245
+ const sibling = resolveByPath2(path.split("."), parent);
3246
+ if (sibling !== void 0) return sibling;
3197
3247
  }
3198
- toDateString() {
3199
- const [day, date, month, year] = this.internal.toUTCString().split(" ");
3200
- return `${day?.slice(0, -1)} ${month} ${date} ${year}`;
3248
+ return resolveByPath2(path.split("."), formData);
3249
+ };
3250
+ var evaluateDependencies = (dependencies, formData, parentPath) => {
3251
+ for (const [path, expected] of Object.entries(dependencies)) {
3252
+ const actual = resolveDependencyValue(path, formData, parentPath);
3253
+ if (Array.isArray(expected)) {
3254
+ if (!expected.includes(actual)) return false;
3255
+ } else if (expected === "") {
3256
+ if (actual !== "" && actual !== void 0 && actual !== null) return false;
3257
+ } else {
3258
+ if (actual !== expected) return false;
3259
+ }
3201
3260
  }
3202
- toTimeString() {
3203
- const time = this.internal.toUTCString().split(" ")[4];
3204
- const [sign, hours, minutes] = this.tzComponents();
3205
- return `${time} GMT${sign}${hours}${minutes} (${tzName(this.timeZone, this)})`;
3261
+ return true;
3262
+ };
3263
+ var DocumentationLinkIcon = ({
3264
+ documentation
3265
+ }) => /* @__PURE__ */ jsxRuntime.jsx(
3266
+ Tooltip,
3267
+ {
3268
+ placement: "top",
3269
+ variant: "explanatory",
3270
+ tooltip: documentation.tooltip ?? "Open documentation",
3271
+ triggerAsChild: true,
3272
+ children: /* @__PURE__ */ jsxRuntime.jsx(Link, { href: documentation.link, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw-cursor-pointer tw-text-neutral-400 hover:tw-text-neutral-600", children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.BookOpen, { className: "tw-size-4" }) }) })
3206
3273
  }
3207
- toLocaleString(locales, options) {
3208
- return Date.prototype.toLocaleString.call(this, locales, {
3209
- ...options,
3210
- timeZone: options?.timeZone || this.timeZone
3211
- });
3274
+ );
3275
+ var FieldTemplateBody = ({
3276
+ id,
3277
+ label,
3278
+ rawHelp,
3279
+ rawDescription,
3280
+ rawErrors,
3281
+ children,
3282
+ schema,
3283
+ uiSchema,
3284
+ displayLabel
3285
+ }) => {
3286
+ const widget = uiSchema?.["ui:widget"];
3287
+ if (widget === "test-connection" || widget === "sync-action") {
3288
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
3212
3289
  }
3213
- toLocaleDateString(locales, options) {
3214
- return Date.prototype.toLocaleDateString.call(this, locales, {
3215
- ...options,
3216
- timeZone: options?.timeZone || this.timeZone
3217
- });
3290
+ if (schema.type === "object") {
3291
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
3218
3292
  }
3219
- toLocaleTimeString(locales, options) {
3220
- return Date.prototype.toLocaleTimeString.call(this, locales, {
3221
- ...options,
3222
- timeZone: options?.timeZone || this.timeZone
3223
- });
3293
+ if (schema.type === "array" && !uiSchema?.["ui:widget"]) {
3294
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
3224
3295
  }
3225
- //#endregion
3226
- //#region private
3227
- tzComponents() {
3228
- const offset = this.getTimezoneOffset();
3229
- const sign = offset > 0 ? "-" : "+";
3230
- const hours = String(Math.floor(Math.abs(offset) / 60)).padStart(2, "0");
3231
- const minutes = String(Math.abs(offset) % 60).padStart(2, "0");
3232
- return [sign, hours, minutes];
3296
+ const uiOptions = uiSchema?.["ui:options"];
3297
+ const documentation = uiOptions?.documentation;
3298
+ const hasErrors = rawErrors && rawErrors.length > 0;
3299
+ const isCheckbox = schema.type === "boolean" && uiSchema?.["ui:widget"] !== "select";
3300
+ const showLabel = displayLabel && label && !isCheckbox;
3301
+ const hasHelpIcons = Boolean(rawHelp || documentation);
3302
+ const helpIcons = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3303
+ rawHelp && /* @__PURE__ */ jsxRuntime.jsx(TooltipIcon, { rawHelp }),
3304
+ documentation && /* @__PURE__ */ jsxRuntime.jsx(DocumentationLinkIcon, { documentation })
3305
+ ] });
3306
+ return /* @__PURE__ */ jsxRuntime.jsxs(FormGroup, { state: hasErrors ? "error" : "default", children: [
3307
+ showLabel && /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: id, children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "tw-inline-flex tw-items-center tw-gap-1", children: [
3308
+ label,
3309
+ helpIcons
3310
+ ] }) }),
3311
+ !showLabel && !isCheckbox && hasHelpIcons && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw-flex tw-items-center tw-gap-1", children: helpIcons }),
3312
+ isCheckbox && hasHelpIcons ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center tw-gap-1", children: [
3313
+ children,
3314
+ helpIcons
3315
+ ] }) : children,
3316
+ rawDescription && /* @__PURE__ */ jsxRuntime.jsx(FormGroup.Help, { children: /* @__PURE__ */ jsxRuntime.jsx("span", { dangerouslySetInnerHTML: { __html: DOMPurify__default.default.sanitize(rawDescription) } }) }),
3317
+ hasErrors && /* @__PURE__ */ jsxRuntime.jsx(FormGroup.Help, { children: rawErrors.join(". ") })
3318
+ ] });
3319
+ };
3320
+ var FieldTemplateWithDependencies = ({
3321
+ dependencies,
3322
+ ...props
3323
+ }) => {
3324
+ const rootFormData = useRootFormData();
3325
+ const parentPath = props.fieldPathId.path.slice(0, -1);
3326
+ if (!evaluateDependencies(dependencies, rootFormData, parentPath)) {
3327
+ return null;
3233
3328
  }
3234
- //#endregion
3235
- withTimeZone(timeZone) {
3236
- return new _TZDate(+this, timeZone);
3329
+ return /* @__PURE__ */ jsxRuntime.jsx(FieldTemplateBody, { ...props });
3330
+ };
3331
+ var FieldTemplate = (props) => {
3332
+ if (props.hidden) return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw-hidden", children: props.children });
3333
+ if (props.uiSchema?.["ui:widget"] === "template-watch") {
3334
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw-hidden", children: props.children });
3237
3335
  }
3238
- //#region date-fns integration
3239
- [/* @__PURE__ */ Symbol.for("constructDateFrom")](date) {
3240
- return new _TZDate(+new Date(date), this.timeZone);
3336
+ const uiOptions = props.uiSchema?.["ui:options"];
3337
+ const dependencies = uiOptions?.dependencies;
3338
+ if (dependencies) {
3339
+ return /* @__PURE__ */ jsxRuntime.jsx(FieldTemplateWithDependencies, { dependencies, ...props });
3241
3340
  }
3242
- //#endregion
3341
+ return /* @__PURE__ */ jsxRuntime.jsx(FieldTemplateBody, { ...props });
3243
3342
  };
3244
- var millisecondsInWeek = 6048e5;
3245
- var millisecondsInDay = 864e5;
3246
- var constructFromSymbol = /* @__PURE__ */ Symbol.for("constructDateFrom");
3247
-
3248
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constructFrom.js
3249
- function constructFrom(date, value) {
3250
- if (typeof date === "function") return date(value);
3251
- if (date && typeof date === "object" && constructFromSymbol in date)
3252
- return date[constructFromSymbol](value);
3253
- if (date instanceof Date) return new date.constructor(value);
3254
- return new Date(value);
3255
- }
3256
-
3257
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/toDate.js
3258
- function toDate(argument, context) {
3259
- return constructFrom(context || argument, argument);
3260
- }
3261
-
3262
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addDays.js
3263
- function addDays(date, amount, options) {
3264
- const _date = toDate(date, options?.in);
3265
- if (isNaN(amount)) return constructFrom(date, NaN);
3266
- if (!amount) return _date;
3267
- _date.setDate(_date.getDate() + amount);
3268
- return _date;
3269
- }
3270
-
3271
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addMonths.js
3272
- function addMonths(date, amount, options) {
3273
- const _date = toDate(date, options?.in);
3274
- if (isNaN(amount)) return constructFrom(date, NaN);
3275
- if (!amount) {
3276
- return _date;
3343
+ var ObjectFieldTemplate = ({
3344
+ title,
3345
+ description,
3346
+ properties,
3347
+ formData,
3348
+ uiSchema,
3349
+ schema,
3350
+ fieldPathId
3351
+ }) => {
3352
+ const isRoot = !fieldPathId?.path?.length;
3353
+ const uiOptions = uiSchema?.["ui:options"];
3354
+ const hasCollapsed = uiOptions?.collapsed !== void 0;
3355
+ const collapsed = !!uiOptions?.collapsed;
3356
+ const disableCollapse = !!uiOptions?.disableCollapse;
3357
+ const lastPathSegment = fieldPathId?.path?.at(-1);
3358
+ const isArrayItem = typeof lastPathSegment === "number";
3359
+ const childSchemas = schema.properties;
3360
+ const isContainerSchema = (s) => {
3361
+ if (!s) return false;
3362
+ if (s.properties || s.items) return true;
3363
+ if (Array.isArray(s.type)) return s.type.includes("object") || s.type.includes("array");
3364
+ return s.type === "object" || s.type === "array";
3365
+ };
3366
+ const visibleProperties = properties.filter((prop) => {
3367
+ const childUi = uiSchema?.[prop.name];
3368
+ if (childUi?.["ui:widget"] !== "hidden") return true;
3369
+ return !isContainerSchema(childSchemas?.[prop.name]);
3370
+ });
3371
+ const isHiddenMount = (name) => {
3372
+ const w = uiSchema?.[name]?.["ui:widget"];
3373
+ return w === "hidden" || w === "template-watch";
3374
+ };
3375
+ const renderChildren = (props) => props.map((prop) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: isHiddenMount(prop.name) ? "tw-hidden" : void 0, children: prop.content }, prop.name));
3376
+ if (isRoot) {
3377
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw-flex tw-flex-col tw-gap-4 [&>div:empty]:tw-hidden", children: renderChildren(visibleProperties) });
3277
3378
  }
3278
- const dayOfMonth = _date.getDate();
3279
- const endOfDesiredMonth = constructFrom(date, _date.getTime());
3280
- endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
3281
- const daysInMonth = endOfDesiredMonth.getDate();
3282
- if (dayOfMonth >= daysInMonth) {
3283
- return endOfDesiredMonth;
3284
- } else {
3285
- _date.setFullYear(
3286
- endOfDesiredMonth.getFullYear(),
3287
- endOfDesiredMonth.getMonth(),
3288
- dayOfMonth
3379
+ const childrenContent = renderChildren(visibleProperties);
3380
+ if (hasCollapsed && !disableCollapse) {
3381
+ const data = formData ?? {};
3382
+ const hasValues = Object.values(data).some(
3383
+ (v) => v !== void 0 && v !== null && v !== "" && v !== false
3384
+ );
3385
+ const defaultExpanded = hasValues ? !collapsed : true;
3386
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3387
+ CollapsiblePanel,
3388
+ {
3389
+ className: "tw-rounded-lg",
3390
+ headerClassName: "tw-rounded-lg",
3391
+ header: title || "Settings",
3392
+ defaultExpanded,
3393
+ bodyClassName: "tw-flex tw-flex-col tw-gap-4 [&>div:empty]:tw-hidden",
3394
+ children: [
3395
+ description,
3396
+ childrenContent
3397
+ ]
3398
+ }
3289
3399
  );
3290
- return _date;
3291
3400
  }
3292
- }
3293
-
3294
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/defaultOptions.js
3295
- var defaultOptions = {};
3296
- function getDefaultOptions() {
3297
- return defaultOptions;
3298
- }
3299
-
3300
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfWeek.js
3301
- function startOfWeek(date, options) {
3302
- const defaultOptions2 = getDefaultOptions();
3303
- const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
3304
- const _date = toDate(date, options?.in);
3305
- const day = _date.getDay();
3306
- const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
3307
- _date.setDate(_date.getDate() - diff);
3308
- _date.setHours(0, 0, 0, 0);
3309
- return _date;
3310
- }
3311
-
3312
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfISOWeek.js
3313
- function startOfISOWeek(date, options) {
3314
- return startOfWeek(date, { ...options, weekStartsOn: 1 });
3315
- }
3316
-
3317
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISOWeekYear.js
3318
- function getISOWeekYear(date, options) {
3319
- const _date = toDate(date, options?.in);
3320
- const year = _date.getFullYear();
3321
- const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
3322
- fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
3323
- fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
3324
- const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
3325
- const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
3326
- fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
3327
- fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
3328
- const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
3329
- if (_date.getTime() >= startOfNextYear.getTime()) {
3330
- return year + 1;
3331
- } else if (_date.getTime() >= startOfThisYear.getTime()) {
3332
- return year;
3333
- } else {
3334
- return year - 1;
3401
+ if (isArrayItem) {
3402
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw-flex tw-flex-col tw-gap-4 [&>div:empty]:tw-hidden", children: childrenContent });
3335
3403
  }
3336
- }
3337
-
3338
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
3339
- function getTimezoneOffsetInMilliseconds(date) {
3340
- const _date = toDate(date);
3341
- const utcDate = new Date(
3342
- Date.UTC(
3343
- _date.getFullYear(),
3344
- _date.getMonth(),
3345
- _date.getDate(),
3346
- _date.getHours(),
3347
- _date.getMinutes(),
3348
- _date.getSeconds(),
3349
- _date.getMilliseconds()
3404
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tw-rounded-lg tw-border tw-border-solid tw-border-neutral-200 tw-bg-white tw-p-4", children: [
3405
+ title && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "tw-mb-2 tw-text-base tw-font-medium tw-text-neutral-800", children: title }),
3406
+ description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "tw-mb-3 tw-text-xs tw-text-neutral-400", children: description }),
3407
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw-flex tw-flex-col tw-gap-4 [&>div:empty]:tw-hidden", children: childrenContent })
3408
+ ] });
3409
+ };
3410
+ var FieldBoxDescription = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
3411
+ "span",
3412
+ {
3413
+ ...props,
3414
+ "data-slot": "field-box-description",
3415
+ className: cn(
3416
+ "tw-text-xs",
3417
+ "tw-text-muted-foreground",
3418
+ "group-has-[:disabled]/field-box:tw-opacity-50",
3419
+ className
3350
3420
  )
3351
- );
3352
- utcDate.setUTCFullYear(_date.getFullYear());
3353
- return +date - +utcDate;
3354
- }
3355
-
3356
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/normalizeDates.js
3357
- function normalizeDates(context, ...dates) {
3358
- const normalize = constructFrom.bind(
3359
- null,
3360
- dates.find((date) => typeof date === "object")
3361
- );
3362
- return dates.map(normalize);
3363
- }
3364
-
3365
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfDay.js
3366
- function startOfDay(date, options) {
3367
- const _date = toDate(date, options?.in);
3368
- _date.setHours(0, 0, 0, 0);
3369
- return _date;
3370
- }
3371
-
3372
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarDays.js
3373
- function differenceInCalendarDays(laterDate, earlierDate, options) {
3374
- const [laterDate_, earlierDate_] = normalizeDates(
3375
- options?.in,
3376
- laterDate,
3377
- earlierDate
3378
- );
3379
- const laterStartOfDay = startOfDay(laterDate_);
3380
- const earlierStartOfDay = startOfDay(earlierDate_);
3381
- const laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);
3382
- const earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
3383
- return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
3384
- }
3385
-
3386
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfISOWeekYear.js
3387
- function startOfISOWeekYear(date, options) {
3388
- const year = getISOWeekYear(date, options);
3389
- const fourthOfJanuary = constructFrom(date, 0);
3390
- fourthOfJanuary.setFullYear(year, 0, 4);
3391
- fourthOfJanuary.setHours(0, 0, 0, 0);
3392
- return startOfISOWeek(fourthOfJanuary);
3393
- }
3394
-
3395
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addWeeks.js
3396
- function addWeeks(date, amount, options) {
3397
- return addDays(date, amount * 7, options);
3421
+ }
3422
+ );
3423
+ var FieldBoxTitle = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
3424
+ "span",
3425
+ {
3426
+ ...props,
3427
+ "data-slot": "field-box-title",
3428
+ className: cn(
3429
+ "tw-text-sm",
3430
+ "tw-font-medium",
3431
+ "tw-text-foreground",
3432
+ "group-has-[:disabled]/field-box:tw-cursor-not-allowed",
3433
+ "group-has-[:disabled]/field-box:tw-opacity-50",
3434
+ className
3435
+ )
3436
+ }
3437
+ );
3438
+ var fieldBoxVariants = classVarianceAuthority.cva(
3439
+ [
3440
+ "tw-group/field-box",
3441
+ "tw-m-0",
3442
+ "tw-inline-flex",
3443
+ "tw-gap-3",
3444
+ "tw-items-center",
3445
+ "has-[[data-slot=field-box-description]]:tw-items-start",
3446
+ "tw-cursor-pointer",
3447
+ "tw-select-none",
3448
+ "has-[:disabled]:tw-cursor-not-allowed"
3449
+ ],
3450
+ {
3451
+ variants: {
3452
+ variant: {
3453
+ default: [],
3454
+ boxed: [
3455
+ "tw-rounded-lg",
3456
+ "tw-border",
3457
+ "tw-border-solid",
3458
+ "tw-border-border",
3459
+ "tw-p-3",
3460
+ "tw-transition-colors",
3461
+ "has-[[data-state=checked]]:tw-border-primary",
3462
+ "has-[[data-state=checked]]:tw-bg-accent",
3463
+ "has-[[data-state=indeterminate]]:tw-border-primary",
3464
+ "has-[[data-state=indeterminate]]:tw-bg-accent"
3465
+ ]
3466
+ }
3467
+ },
3468
+ defaultVariants: {
3469
+ variant: "default"
3470
+ }
3471
+ }
3472
+ );
3473
+ var FieldBoxRoot = ({
3474
+ ref,
3475
+ className,
3476
+ variant,
3477
+ position = "start",
3478
+ control,
3479
+ children,
3480
+ ...rest
3481
+ }) => /* @__PURE__ */ jsxRuntime.jsxs(
3482
+ "label",
3483
+ {
3484
+ ...rest,
3485
+ ref,
3486
+ className: cn(
3487
+ fieldBoxVariants({ variant, className }),
3488
+ position === "end" && "tw-flex-row-reverse"
3489
+ ),
3490
+ children: [
3491
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw-inline-flex tw-min-h-5 tw-shrink-0 tw-items-center group-has-[[data-slot=field-box-description]]/field-box:tw-mt-0.5", children: control }),
3492
+ children != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw-flex tw-flex-1 tw-flex-col tw-gap-0.5", children })
3493
+ ]
3494
+ }
3495
+ );
3496
+ var FieldBox = Object.assign(FieldBoxRoot, {
3497
+ Title: FieldBoxTitle,
3498
+ Description: FieldBoxDescription
3499
+ });
3500
+ var rootVariants = classVarianceAuthority.cva(
3501
+ [
3502
+ // reset
3503
+ "tailwindcss-preflight",
3504
+ // position
3505
+ "tw-flex",
3506
+ "tw-items-center",
3507
+ "tw-justify-center",
3508
+ "tw-peer",
3509
+ "tw-size-4",
3510
+ "tw-shrink-0",
3511
+ "tw-cursor-pointer",
3512
+ // border
3513
+ "tw-border",
3514
+ "tw-border-solid",
3515
+ // disabled
3516
+ "disabled:tw-opacity-50",
3517
+ "disabled:tw-cursor-not-allowed"
3518
+ ],
3519
+ {
3520
+ defaultVariants: {
3521
+ variant: "default"
3522
+ },
3523
+ variants: {
3524
+ variant: {
3525
+ default: [
3526
+ "tw-rounded",
3527
+ "tw-border-neutral-200",
3528
+ "data-[state=checked]:tw-bg-primary",
3529
+ "data-[state=checked]:tw-border-primary",
3530
+ "data-[state=indeterminate]:tw-bg-white",
3531
+ "data-[state=indeterminate]:tw-border-neutral-200"
3532
+ ],
3533
+ argo: [
3534
+ "tw-rounded",
3535
+ "tw-border-input",
3536
+ "tw-transition-colors",
3537
+ "data-[state=checked]:tw-bg-primary",
3538
+ "data-[state=checked]:tw-border-primary",
3539
+ "data-[state=indeterminate]:tw-bg-primary",
3540
+ "data-[state=indeterminate]:tw-border-primary",
3541
+ // focus
3542
+ "focus-visible:tw-outline-none",
3543
+ "focus-visible:tw-border-primary",
3544
+ "focus-visible:tw-ring-2",
3545
+ "focus-visible:tw-ring-ring/50"
3546
+ ]
3547
+ }
3548
+ }
3549
+ }
3550
+ );
3551
+ var indicatorVariants = classVarianceAuthority.cva(["tw-group", "tw-flex", "tw-items-center"], {
3552
+ defaultVariants: {
3553
+ variant: "default"
3554
+ },
3555
+ variants: {
3556
+ variant: {
3557
+ default: [
3558
+ "data-[state=checked]:tw-text-primary-foreground",
3559
+ "data-[state=indeterminate]:tw-text-neutral-200"
3560
+ ],
3561
+ argo: ["tw-text-primary-foreground"]
3562
+ }
3563
+ }
3564
+ });
3565
+ function Checkbox({
3566
+ className,
3567
+ id: idProp,
3568
+ children,
3569
+ description,
3570
+ variant,
3571
+ position,
3572
+ tooltip,
3573
+ tooltipPlacement = "top",
3574
+ ...rest
3575
+ }) {
3576
+ const fallbackId = React26.useId();
3577
+ const id = idProp?.toString() ?? fallbackId;
3578
+ const styleVariant = useArgoDesign() ? "argo" : "default";
3579
+ const checkboxElement = /* @__PURE__ */ jsxRuntime.jsx(reactCheckbox.Root, { id, ...rest, className: cn(rootVariants({ variant: styleVariant, className })), children: /* @__PURE__ */ jsxRuntime.jsxs(reactCheckbox.Indicator, { className: cn(indicatorVariants({ variant: styleVariant })), children: [
3580
+ /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Check, { className: "tw-hidden tw-size-3 tw-stroke-[4px] group-data-[state=checked]:tw-block" }),
3581
+ /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Minus, { className: "tw-hidden tw-size-3 tw-stroke-[4px] group-data-[state=indeterminate]:tw-block" })
3582
+ ] }) });
3583
+ const rendered = !children ? checkboxElement : /* @__PURE__ */ jsxRuntime.jsxs(FieldBox, { htmlFor: id, variant, position, control: checkboxElement, children: [
3584
+ /* @__PURE__ */ jsxRuntime.jsx(FieldBox.Title, { children }),
3585
+ description && /* @__PURE__ */ jsxRuntime.jsx(FieldBox.Description, { children: description })
3586
+ ] });
3587
+ if (!tooltip) return rendered;
3588
+ return /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { tooltip, placement: tooltipPlacement, triggerAsChild: !!children, children: rendered });
3398
3589
  }
3590
+ var CheckboxWidget = ({
3591
+ id,
3592
+ value,
3593
+ onChange,
3594
+ disabled,
3595
+ readonly,
3596
+ label,
3597
+ hideLabel
3598
+ }) => {
3599
+ const checked = !!value;
3600
+ return /* @__PURE__ */ jsxRuntime.jsx(Checkbox, { id, checked, onCheckedChange: onChange, disabled: disabled || readonly, children: hideLabel ? void 0 : label });
3601
+ };
3399
3602
 
3400
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addYears.js
3401
- function addYears(date, amount, options) {
3402
- return addMonths(date, amount * 12, options);
3603
+ // ../../node_modules/.pnpm/@date-fns+tz@1.4.1/node_modules/@date-fns/tz/tzName/index.js
3604
+ function tzName(timeZone, date, format2 = "long") {
3605
+ return new Intl.DateTimeFormat("en-US", {
3606
+ // Enforces engine to render the time. Without the option JavaScriptCore omits it.
3607
+ hour: "numeric",
3608
+ timeZone,
3609
+ timeZoneName: format2
3610
+ }).format(date).split(/\s/g).slice(2).join(" ");
3403
3611
  }
3404
3612
 
3405
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/max.js
3406
- function max(dates, options) {
3407
- let result;
3408
- let context = options?.in;
3409
- dates.forEach((date) => {
3410
- if (!context && typeof date === "object")
3411
- context = constructFrom.bind(null, date);
3412
- const date_ = toDate(date, context);
3413
- if (!result || result < date_ || isNaN(+date_)) result = date_;
3414
- });
3415
- return constructFrom(context, result || NaN);
3613
+ // ../../node_modules/.pnpm/@date-fns+tz@1.4.1/node_modules/@date-fns/tz/tzOffset/index.js
3614
+ var offsetFormatCache = {};
3615
+ var offsetCache = {};
3616
+ function tzOffset(timeZone, date) {
3617
+ try {
3618
+ const format2 = offsetFormatCache[timeZone] ||= new Intl.DateTimeFormat("en-US", {
3619
+ timeZone,
3620
+ timeZoneName: "longOffset"
3621
+ }).format;
3622
+ const offsetStr = format2(date).split("GMT")[1];
3623
+ if (offsetStr in offsetCache) return offsetCache[offsetStr];
3624
+ return calcOffset(offsetStr, offsetStr.split(":"));
3625
+ } catch {
3626
+ if (timeZone in offsetCache) return offsetCache[timeZone];
3627
+ const captures = timeZone?.match(offsetRe);
3628
+ if (captures) return calcOffset(timeZone, captures.slice(1));
3629
+ return NaN;
3630
+ }
3416
3631
  }
3417
-
3418
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/min.js
3419
- function min(dates, options) {
3420
- let result;
3421
- let context = options?.in;
3422
- dates.forEach((date) => {
3423
- if (!context && typeof date === "object")
3424
- context = constructFrom.bind(null, date);
3425
- const date_ = toDate(date, context);
3426
- if (!result || result > date_ || isNaN(+date_)) result = date_;
3427
- });
3428
- return constructFrom(context, result || NaN);
3632
+ var offsetRe = /([+-]\d\d):?(\d\d)?/;
3633
+ function calcOffset(cacheStr, values) {
3634
+ const hours = +(values[0] || 0);
3635
+ const minutes = +(values[1] || 0);
3636
+ const seconds = +(values[2] || 0) / 60;
3637
+ return offsetCache[cacheStr] = hours * 60 + minutes > 0 ? hours * 60 + minutes + seconds : hours * 60 - minutes - seconds;
3429
3638
  }
3430
3639
 
3431
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameDay.js
3432
- function isSameDay(laterDate, earlierDate, options) {
3433
- const [dateLeft_, dateRight_] = normalizeDates(
3434
- options?.in,
3435
- laterDate,
3436
- earlierDate
3437
- );
3438
- return +startOfDay(dateLeft_) === +startOfDay(dateRight_);
3439
- }
3440
-
3441
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isDate.js
3442
- function isDate(value) {
3443
- return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
3640
+ // ../../node_modules/.pnpm/@date-fns+tz@1.4.1/node_modules/@date-fns/tz/date/mini.js
3641
+ var TZDateMini = class _TZDateMini extends Date {
3642
+ //#region static
3643
+ constructor(...args) {
3644
+ super();
3645
+ if (args.length > 1 && typeof args[args.length - 1] === "string") {
3646
+ this.timeZone = args.pop();
3647
+ }
3648
+ this.internal = /* @__PURE__ */ new Date();
3649
+ if (isNaN(tzOffset(this.timeZone, this))) {
3650
+ this.setTime(NaN);
3651
+ } else {
3652
+ if (!args.length) {
3653
+ this.setTime(Date.now());
3654
+ } else if (typeof args[0] === "number" && (args.length === 1 || args.length === 2 && typeof args[1] !== "number")) {
3655
+ this.setTime(args[0]);
3656
+ } else if (typeof args[0] === "string") {
3657
+ this.setTime(+new Date(args[0]));
3658
+ } else if (args[0] instanceof Date) {
3659
+ this.setTime(+args[0]);
3660
+ } else {
3661
+ this.setTime(+new Date(...args));
3662
+ adjustToSystemTZ(this);
3663
+ syncToInternal(this);
3664
+ }
3665
+ }
3666
+ }
3667
+ static tz(tz, ...args) {
3668
+ return args.length ? new _TZDateMini(...args, tz) : new _TZDateMini(Date.now(), tz);
3669
+ }
3670
+ //#endregion
3671
+ //#region time zone
3672
+ withTimeZone(timeZone) {
3673
+ return new _TZDateMini(+this, timeZone);
3674
+ }
3675
+ getTimezoneOffset() {
3676
+ const offset = -tzOffset(this.timeZone, this);
3677
+ return offset > 0 ? Math.floor(offset) : Math.ceil(offset);
3678
+ }
3679
+ //#endregion
3680
+ //#region time
3681
+ setTime(time) {
3682
+ Date.prototype.setTime.apply(this, arguments);
3683
+ syncToInternal(this);
3684
+ return +this;
3685
+ }
3686
+ //#endregion
3687
+ //#region date-fns integration
3688
+ [/* @__PURE__ */ Symbol.for("constructDateFrom")](date) {
3689
+ return new _TZDateMini(+new Date(date), this.timeZone);
3690
+ }
3691
+ //#endregion
3692
+ };
3693
+ var re = /^(get|set)(?!UTC)/;
3694
+ Object.getOwnPropertyNames(Date.prototype).forEach((method) => {
3695
+ if (!re.test(method)) return;
3696
+ const utcMethod = method.replace(re, "$1UTC");
3697
+ if (!TZDateMini.prototype[utcMethod]) return;
3698
+ if (method.startsWith("get")) {
3699
+ TZDateMini.prototype[method] = function() {
3700
+ return this.internal[utcMethod]();
3701
+ };
3702
+ } else {
3703
+ TZDateMini.prototype[method] = function() {
3704
+ Date.prototype[utcMethod].apply(this.internal, arguments);
3705
+ syncFromInternal(this);
3706
+ return +this;
3707
+ };
3708
+ TZDateMini.prototype[utcMethod] = function() {
3709
+ Date.prototype[utcMethod].apply(this, arguments);
3710
+ syncToInternal(this);
3711
+ return +this;
3712
+ };
3713
+ }
3714
+ });
3715
+ function syncToInternal(date) {
3716
+ date.internal.setTime(+date);
3717
+ date.internal.setUTCSeconds(date.internal.getUTCSeconds() - Math.round(-tzOffset(date.timeZone, date) * 60));
3444
3718
  }
3445
-
3446
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isValid.js
3447
- function isValid(date) {
3448
- return !(!isDate(date) && typeof date !== "number" || isNaN(+toDate(date)));
3719
+ function syncFromInternal(date) {
3720
+ Date.prototype.setFullYear.call(date, date.internal.getUTCFullYear(), date.internal.getUTCMonth(), date.internal.getUTCDate());
3721
+ Date.prototype.setHours.call(date, date.internal.getUTCHours(), date.internal.getUTCMinutes(), date.internal.getUTCSeconds(), date.internal.getUTCMilliseconds());
3722
+ adjustToSystemTZ(date);
3449
3723
  }
3450
-
3451
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarMonths.js
3452
- function differenceInCalendarMonths(laterDate, earlierDate, options) {
3453
- const [laterDate_, earlierDate_] = normalizeDates(
3454
- options?.in,
3455
- laterDate,
3456
- earlierDate
3457
- );
3458
- const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();
3459
- const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();
3460
- return yearsDiff * 12 + monthsDiff;
3724
+ function adjustToSystemTZ(date) {
3725
+ const baseOffset = tzOffset(date.timeZone, date);
3726
+ const offset = baseOffset > 0 ? Math.floor(baseOffset) : Math.ceil(baseOffset);
3727
+ const prevHour = /* @__PURE__ */ new Date(+date);
3728
+ prevHour.setUTCHours(prevHour.getUTCHours() - 1);
3729
+ const systemOffset = -(/* @__PURE__ */ new Date(+date)).getTimezoneOffset();
3730
+ const prevHourSystemOffset = -(/* @__PURE__ */ new Date(+prevHour)).getTimezoneOffset();
3731
+ const systemDSTChange = systemOffset - prevHourSystemOffset;
3732
+ const dstShift = Date.prototype.getHours.apply(date) !== date.internal.getUTCHours();
3733
+ if (systemDSTChange && dstShift) date.internal.setUTCMinutes(date.internal.getUTCMinutes() + systemDSTChange);
3734
+ const offsetDiff = systemOffset - offset;
3735
+ if (offsetDiff) Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetDiff);
3736
+ const systemDate = /* @__PURE__ */ new Date(+date);
3737
+ systemDate.setUTCSeconds(0);
3738
+ const systemSecondsOffset = systemOffset > 0 ? systemDate.getSeconds() : (systemDate.getSeconds() - 60) % 60;
3739
+ const secondsOffset = Math.round(-(tzOffset(date.timeZone, date) * 60)) % 60;
3740
+ if (secondsOffset || systemSecondsOffset) {
3741
+ date.internal.setUTCSeconds(date.internal.getUTCSeconds() + secondsOffset);
3742
+ Date.prototype.setUTCSeconds.call(date, Date.prototype.getUTCSeconds.call(date) + secondsOffset + systemSecondsOffset);
3743
+ }
3744
+ const postBaseOffset = tzOffset(date.timeZone, date);
3745
+ const postOffset = postBaseOffset > 0 ? Math.floor(postBaseOffset) : Math.ceil(postBaseOffset);
3746
+ const postSystemOffset = -(/* @__PURE__ */ new Date(+date)).getTimezoneOffset();
3747
+ const postOffsetDiff = postSystemOffset - postOffset;
3748
+ const offsetChanged = postOffset !== offset;
3749
+ const postDiff = postOffsetDiff - offsetDiff;
3750
+ if (offsetChanged && postDiff) {
3751
+ Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + postDiff);
3752
+ const newBaseOffset = tzOffset(date.timeZone, date);
3753
+ const newOffset = newBaseOffset > 0 ? Math.floor(newBaseOffset) : Math.ceil(newBaseOffset);
3754
+ const offsetChange = postOffset - newOffset;
3755
+ if (offsetChange) {
3756
+ date.internal.setUTCMinutes(date.internal.getUTCMinutes() + offsetChange);
3757
+ Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetChange);
3758
+ }
3759
+ }
3461
3760
  }
3462
3761
 
3463
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfMonth.js
3464
- function endOfMonth(date, options) {
3465
- const _date = toDate(date, options?.in);
3466
- const month = _date.getMonth();
3467
- _date.setFullYear(_date.getFullYear(), month + 1, 0);
3468
- _date.setHours(23, 59, 59, 999);
3469
- return _date;
3470
- }
3762
+ // ../../node_modules/.pnpm/@date-fns+tz@1.4.1/node_modules/@date-fns/tz/date/index.js
3763
+ var TZDate = class _TZDate extends TZDateMini {
3764
+ //#region static
3765
+ static tz(tz, ...args) {
3766
+ return args.length ? new _TZDate(...args, tz) : new _TZDate(Date.now(), tz);
3767
+ }
3768
+ //#endregion
3769
+ //#region representation
3770
+ toISOString() {
3771
+ const [sign, hours, minutes] = this.tzComponents();
3772
+ const tz = `${sign}${hours}:${minutes}`;
3773
+ return this.internal.toISOString().slice(0, -1) + tz;
3774
+ }
3775
+ toString() {
3776
+ return `${this.toDateString()} ${this.toTimeString()}`;
3777
+ }
3778
+ toDateString() {
3779
+ const [day, date, month, year] = this.internal.toUTCString().split(" ");
3780
+ return `${day?.slice(0, -1)} ${month} ${date} ${year}`;
3781
+ }
3782
+ toTimeString() {
3783
+ const time = this.internal.toUTCString().split(" ")[4];
3784
+ const [sign, hours, minutes] = this.tzComponents();
3785
+ return `${time} GMT${sign}${hours}${minutes} (${tzName(this.timeZone, this)})`;
3786
+ }
3787
+ toLocaleString(locales, options) {
3788
+ return Date.prototype.toLocaleString.call(this, locales, {
3789
+ ...options,
3790
+ timeZone: options?.timeZone || this.timeZone
3791
+ });
3792
+ }
3793
+ toLocaleDateString(locales, options) {
3794
+ return Date.prototype.toLocaleDateString.call(this, locales, {
3795
+ ...options,
3796
+ timeZone: options?.timeZone || this.timeZone
3797
+ });
3798
+ }
3799
+ toLocaleTimeString(locales, options) {
3800
+ return Date.prototype.toLocaleTimeString.call(this, locales, {
3801
+ ...options,
3802
+ timeZone: options?.timeZone || this.timeZone
3803
+ });
3804
+ }
3805
+ //#endregion
3806
+ //#region private
3807
+ tzComponents() {
3808
+ const offset = this.getTimezoneOffset();
3809
+ const sign = offset > 0 ? "-" : "+";
3810
+ const hours = String(Math.floor(Math.abs(offset) / 60)).padStart(2, "0");
3811
+ const minutes = String(Math.abs(offset) % 60).padStart(2, "0");
3812
+ return [sign, hours, minutes];
3813
+ }
3814
+ //#endregion
3815
+ withTimeZone(timeZone) {
3816
+ return new _TZDate(+this, timeZone);
3817
+ }
3818
+ //#region date-fns integration
3819
+ [/* @__PURE__ */ Symbol.for("constructDateFrom")](date) {
3820
+ return new _TZDate(+new Date(date), this.timeZone);
3821
+ }
3822
+ //#endregion
3823
+ };
3824
+ var millisecondsInWeek = 6048e5;
3825
+ var millisecondsInDay = 864e5;
3826
+ var constructFromSymbol = /* @__PURE__ */ Symbol.for("constructDateFrom");
3471
3827
 
3472
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/normalizeInterval.js
3473
- function normalizeInterval(context, interval) {
3474
- const [start, end] = normalizeDates(context, interval.start, interval.end);
3475
- return { start, end };
3828
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constructFrom.js
3829
+ function constructFrom(date, value) {
3830
+ if (typeof date === "function") return date(value);
3831
+ if (date && typeof date === "object" && constructFromSymbol in date)
3832
+ return date[constructFromSymbol](value);
3833
+ if (date instanceof Date) return new date.constructor(value);
3834
+ return new Date(value);
3476
3835
  }
3477
3836
 
3478
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachMonthOfInterval.js
3479
- function eachMonthOfInterval(interval, options) {
3480
- const { start, end } = normalizeInterval(options?.in, interval);
3481
- let reversed = +start > +end;
3482
- const endTime = reversed ? +start : +end;
3483
- const date = reversed ? end : start;
3484
- date.setHours(0, 0, 0, 0);
3485
- date.setDate(1);
3486
- let step = 1;
3487
- const dates = [];
3488
- while (+date <= endTime) {
3489
- dates.push(constructFrom(start, date));
3490
- date.setMonth(date.getMonth() + step);
3491
- }
3492
- return reversed ? dates.reverse() : dates;
3837
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/toDate.js
3838
+ function toDate(argument, context) {
3839
+ return constructFrom(context || argument, argument);
3493
3840
  }
3494
3841
 
3495
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfMonth.js
3496
- function startOfMonth(date, options) {
3842
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addDays.js
3843
+ function addDays(date, amount, options) {
3497
3844
  const _date = toDate(date, options?.in);
3498
- _date.setDate(1);
3499
- _date.setHours(0, 0, 0, 0);
3845
+ if (isNaN(amount)) return constructFrom(date, NaN);
3846
+ if (!amount) return _date;
3847
+ _date.setDate(_date.getDate() + amount);
3500
3848
  return _date;
3501
3849
  }
3502
3850
 
3503
- // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfYear.js
3504
- function endOfYear(date, options) {
3851
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addMonths.js
3852
+ function addMonths(date, amount, options) {
3853
+ const _date = toDate(date, options?.in);
3854
+ if (isNaN(amount)) return constructFrom(date, NaN);
3855
+ if (!amount) {
3856
+ return _date;
3857
+ }
3858
+ const dayOfMonth = _date.getDate();
3859
+ const endOfDesiredMonth = constructFrom(date, _date.getTime());
3860
+ endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
3861
+ const daysInMonth = endOfDesiredMonth.getDate();
3862
+ if (dayOfMonth >= daysInMonth) {
3863
+ return endOfDesiredMonth;
3864
+ } else {
3865
+ _date.setFullYear(
3866
+ endOfDesiredMonth.getFullYear(),
3867
+ endOfDesiredMonth.getMonth(),
3868
+ dayOfMonth
3869
+ );
3870
+ return _date;
3871
+ }
3872
+ }
3873
+
3874
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/defaultOptions.js
3875
+ var defaultOptions = {};
3876
+ function getDefaultOptions() {
3877
+ return defaultOptions;
3878
+ }
3879
+
3880
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfWeek.js
3881
+ function startOfWeek(date, options) {
3882
+ const defaultOptions2 = getDefaultOptions();
3883
+ const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
3884
+ const _date = toDate(date, options?.in);
3885
+ const day = _date.getDay();
3886
+ const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
3887
+ _date.setDate(_date.getDate() - diff);
3888
+ _date.setHours(0, 0, 0, 0);
3889
+ return _date;
3890
+ }
3891
+
3892
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfISOWeek.js
3893
+ function startOfISOWeek(date, options) {
3894
+ return startOfWeek(date, { ...options, weekStartsOn: 1 });
3895
+ }
3896
+
3897
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISOWeekYear.js
3898
+ function getISOWeekYear(date, options) {
3899
+ const _date = toDate(date, options?.in);
3900
+ const year = _date.getFullYear();
3901
+ const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
3902
+ fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
3903
+ fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
3904
+ const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
3905
+ const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
3906
+ fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
3907
+ fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
3908
+ const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
3909
+ if (_date.getTime() >= startOfNextYear.getTime()) {
3910
+ return year + 1;
3911
+ } else if (_date.getTime() >= startOfThisYear.getTime()) {
3912
+ return year;
3913
+ } else {
3914
+ return year - 1;
3915
+ }
3916
+ }
3917
+
3918
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
3919
+ function getTimezoneOffsetInMilliseconds(date) {
3920
+ const _date = toDate(date);
3921
+ const utcDate = new Date(
3922
+ Date.UTC(
3923
+ _date.getFullYear(),
3924
+ _date.getMonth(),
3925
+ _date.getDate(),
3926
+ _date.getHours(),
3927
+ _date.getMinutes(),
3928
+ _date.getSeconds(),
3929
+ _date.getMilliseconds()
3930
+ )
3931
+ );
3932
+ utcDate.setUTCFullYear(_date.getFullYear());
3933
+ return +date - +utcDate;
3934
+ }
3935
+
3936
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/normalizeDates.js
3937
+ function normalizeDates(context, ...dates) {
3938
+ const normalize = constructFrom.bind(
3939
+ null,
3940
+ dates.find((date) => typeof date === "object")
3941
+ );
3942
+ return dates.map(normalize);
3943
+ }
3944
+
3945
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfDay.js
3946
+ function startOfDay(date, options) {
3947
+ const _date = toDate(date, options?.in);
3948
+ _date.setHours(0, 0, 0, 0);
3949
+ return _date;
3950
+ }
3951
+
3952
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarDays.js
3953
+ function differenceInCalendarDays(laterDate, earlierDate, options) {
3954
+ const [laterDate_, earlierDate_] = normalizeDates(
3955
+ options?.in,
3956
+ laterDate,
3957
+ earlierDate
3958
+ );
3959
+ const laterStartOfDay = startOfDay(laterDate_);
3960
+ const earlierStartOfDay = startOfDay(earlierDate_);
3961
+ const laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);
3962
+ const earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
3963
+ return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
3964
+ }
3965
+
3966
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfISOWeekYear.js
3967
+ function startOfISOWeekYear(date, options) {
3968
+ const year = getISOWeekYear(date, options);
3969
+ const fourthOfJanuary = constructFrom(date, 0);
3970
+ fourthOfJanuary.setFullYear(year, 0, 4);
3971
+ fourthOfJanuary.setHours(0, 0, 0, 0);
3972
+ return startOfISOWeek(fourthOfJanuary);
3973
+ }
3974
+
3975
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addWeeks.js
3976
+ function addWeeks(date, amount, options) {
3977
+ return addDays(date, amount * 7, options);
3978
+ }
3979
+
3980
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addYears.js
3981
+ function addYears(date, amount, options) {
3982
+ return addMonths(date, amount * 12, options);
3983
+ }
3984
+
3985
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/max.js
3986
+ function max(dates, options) {
3987
+ let result;
3988
+ let context = options?.in;
3989
+ dates.forEach((date) => {
3990
+ if (!context && typeof date === "object")
3991
+ context = constructFrom.bind(null, date);
3992
+ const date_ = toDate(date, context);
3993
+ if (!result || result < date_ || isNaN(+date_)) result = date_;
3994
+ });
3995
+ return constructFrom(context, result || NaN);
3996
+ }
3997
+
3998
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/min.js
3999
+ function min(dates, options) {
4000
+ let result;
4001
+ let context = options?.in;
4002
+ dates.forEach((date) => {
4003
+ if (!context && typeof date === "object")
4004
+ context = constructFrom.bind(null, date);
4005
+ const date_ = toDate(date, context);
4006
+ if (!result || result > date_ || isNaN(+date_)) result = date_;
4007
+ });
4008
+ return constructFrom(context, result || NaN);
4009
+ }
4010
+
4011
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameDay.js
4012
+ function isSameDay(laterDate, earlierDate, options) {
4013
+ const [dateLeft_, dateRight_] = normalizeDates(
4014
+ options?.in,
4015
+ laterDate,
4016
+ earlierDate
4017
+ );
4018
+ return +startOfDay(dateLeft_) === +startOfDay(dateRight_);
4019
+ }
4020
+
4021
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isDate.js
4022
+ function isDate(value) {
4023
+ return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
4024
+ }
4025
+
4026
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isValid.js
4027
+ function isValid(date) {
4028
+ return !(!isDate(date) && typeof date !== "number" || isNaN(+toDate(date)));
4029
+ }
4030
+
4031
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarMonths.js
4032
+ function differenceInCalendarMonths(laterDate, earlierDate, options) {
4033
+ const [laterDate_, earlierDate_] = normalizeDates(
4034
+ options?.in,
4035
+ laterDate,
4036
+ earlierDate
4037
+ );
4038
+ const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();
4039
+ const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();
4040
+ return yearsDiff * 12 + monthsDiff;
4041
+ }
4042
+
4043
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfMonth.js
4044
+ function endOfMonth(date, options) {
4045
+ const _date = toDate(date, options?.in);
4046
+ const month = _date.getMonth();
4047
+ _date.setFullYear(_date.getFullYear(), month + 1, 0);
4048
+ _date.setHours(23, 59, 59, 999);
4049
+ return _date;
4050
+ }
4051
+
4052
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/normalizeInterval.js
4053
+ function normalizeInterval(context, interval) {
4054
+ const [start, end] = normalizeDates(context, interval.start, interval.end);
4055
+ return { start, end };
4056
+ }
4057
+
4058
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/eachMonthOfInterval.js
4059
+ function eachMonthOfInterval(interval, options) {
4060
+ const { start, end } = normalizeInterval(options?.in, interval);
4061
+ let reversed = +start > +end;
4062
+ const endTime = reversed ? +start : +end;
4063
+ const date = reversed ? end : start;
4064
+ date.setHours(0, 0, 0, 0);
4065
+ date.setDate(1);
4066
+ let step = 1;
4067
+ const dates = [];
4068
+ while (+date <= endTime) {
4069
+ dates.push(constructFrom(start, date));
4070
+ date.setMonth(date.getMonth() + step);
4071
+ }
4072
+ return reversed ? dates.reverse() : dates;
4073
+ }
4074
+
4075
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfMonth.js
4076
+ function startOfMonth(date, options) {
4077
+ const _date = toDate(date, options?.in);
4078
+ _date.setDate(1);
4079
+ _date.setHours(0, 0, 0, 0);
4080
+ return _date;
4081
+ }
4082
+
4083
+ // ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/endOfYear.js
4084
+ function endOfYear(date, options) {
3505
4085
  const _date = toDate(date, options?.in);
3506
4086
  const year = _date.getFullYear();
3507
4087
  _date.setFullYear(year + 1, 0, 0);
@@ -5435,7 +6015,7 @@ __export(custom_components_exports, {
5435
6015
  NextMonthButton: () => NextMonthButton,
5436
6016
  Option: () => Option,
5437
6017
  PreviousMonthButton: () => PreviousMonthButton,
5438
- Root: () => Root6,
6018
+ Root: () => Root8,
5439
6019
  Select: () => Select,
5440
6020
  Week: () => Week,
5441
6021
  WeekNumber: () => WeekNumber,
@@ -5615,7 +6195,7 @@ function Option(props) {
5615
6195
  function PreviousMonthButton(props) {
5616
6196
  return React26__default.default.createElement("button", { ...props });
5617
6197
  }
5618
- function Root6(props) {
6198
+ function Root8(props) {
5619
6199
  const { rootRef, ...rest } = props;
5620
6200
  return React26__default.default.createElement("div", { ...rest, ref: rootRef });
5621
6201
  }
@@ -7302,948 +7882,392 @@ function DayPicker(initialProps) {
7302
7882
  (() => {
7303
7883
  const monthControl = captionLayout === "dropdown" || captionLayout === "dropdown-months" ? React26__default.default.createElement(components.MonthsDropdown, { key: "month", className: classNames[UI.MonthsDropdown], "aria-label": labelMonthDropdown2(), disabled: Boolean(props.disableNavigation), onChange: handleMonthChange(calendarMonth.date, monthOffset), options: getMonthOptions(calendarMonth.date, navStart, navEnd, formatters2, dateLib), style: getDropdownStyle(UI.MonthsDropdown), value: dateLib.getMonth(calendarMonth.date) }) : React26__default.default.createElement("span", { key: "month" }, formatMonthDropdown2(calendarMonth.date, dateLib));
7304
7884
  const yearControl = captionLayout === "dropdown" || captionLayout === "dropdown-years" ? React26__default.default.createElement(components.YearsDropdown, { key: "year", className: classNames[UI.YearsDropdown], "aria-label": labelYearDropdown2(dateLib.options), disabled: Boolean(props.disableNavigation), onChange: handleYearChange(calendarMonth.date, monthOffset), options: getYearOptions(navStart, navEnd, formatters2, dateLib, Boolean(props.reverseYears)), style: getDropdownStyle(UI.YearsDropdown), value: dateLib.getYear(calendarMonth.date) }) : React26__default.default.createElement("span", { key: "year" }, formatYearDropdown2(calendarMonth.date, dateLib));
7305
- const controls = dateLib.getMonthYearOrder() === "year-first" ? [yearControl, monthControl] : [monthControl, yearControl];
7306
- return controls;
7307
- })(),
7308
- React26__default.default.createElement("span", { role: "status", "aria-live": "polite", style: {
7309
- border: 0,
7310
- clip: "rect(0 0 0 0)",
7311
- height: "1px",
7312
- margin: "-1px",
7313
- overflow: "hidden",
7314
- padding: 0,
7315
- position: "absolute",
7316
- width: "1px",
7317
- whiteSpace: "nowrap",
7318
- wordWrap: "normal"
7319
- } }, formatCaption2(calendarMonth.date, dateLib.options, dateLib))
7320
- ) : React26__default.default.createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], style: styles?.[UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption2(calendarMonth.date, dateLib.options, dateLib))),
7321
- navLayout === "around" && !props.hideNavigation && displayIndex === numberOfMonths - 1 && React26__default.default.createElement(
7322
- components.NextMonthButton,
7323
- { type: "button", className: classNames[UI.NextMonthButton], style: styles?.[UI.NextMonthButton], tabIndex: nextMonth ? void 0 : -1, "aria-disabled": nextMonth ? void 0 : true, "aria-label": labelNext2(nextMonth), onClick: handleNextClick, "data-animated-button": props.animate ? "true" : void 0 },
7324
- React26__default.default.createElement(components.Chevron, { disabled: nextMonth ? void 0 : true, className: classNames[UI.Chevron], style: styles?.[UI.Chevron], orientation: props.dir === "rtl" ? "left" : "right" })
7325
- ),
7326
- displayIndex === numberOfMonths - 1 && navLayout === "after" && !props.hideNavigation && React26__default.default.createElement(components.Nav, { "data-animated-nav": props.animate ? "true" : void 0, className: classNames[UI.Nav], style: styles?.[UI.Nav], "aria-label": labelNav2(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth, nextMonth }),
7327
- React26__default.default.createElement(
7328
- components.MonthGrid,
7329
- { role: "grid", "aria-multiselectable": mode === "multiple" || mode === "range", "aria-label": labelGrid2(calendarMonth.date, dateLib.options, dateLib) || void 0, className: classNames[UI.MonthGrid], style: styles?.[UI.MonthGrid] },
7330
- !props.hideWeekdays && React26__default.default.createElement(
7331
- components.Weekdays,
7332
- { "data-animated-weekdays": props.animate ? "true" : void 0, className: classNames[UI.Weekdays], style: styles?.[UI.Weekdays] },
7333
- showWeekNumber && React26__default.default.createElement(components.WeekNumberHeader, { "aria-label": labelWeekNumberHeader2(dateLib.options), className: classNames[UI.WeekNumberHeader], style: styles?.[UI.WeekNumberHeader], scope: "col" }, formatWeekNumberHeader2()),
7334
- weekdays.map((weekday) => React26__default.default.createElement(components.Weekday, { "aria-label": labelWeekday2(weekday, dateLib.options, dateLib), className: classNames[UI.Weekday], key: String(weekday), style: styles?.[UI.Weekday], scope: "col" }, formatWeekdayName2(weekday, dateLib.options, dateLib)))
7335
- ),
7336
- React26__default.default.createElement(components.Weeks, { "data-animated-weeks": props.animate ? "true" : void 0, className: classNames[UI.Weeks], style: styles?.[UI.Weeks] }, calendarMonth.weeks.map((week) => {
7337
- return React26__default.default.createElement(
7338
- components.Week,
7339
- { className: classNames[UI.Week], key: week.weekNumber, style: styles?.[UI.Week], week },
7340
- showWeekNumber && React26__default.default.createElement(components.WeekNumber, { week, style: styles?.[UI.WeekNumber], "aria-label": labelWeekNumber2(week.weekNumber, {
7341
- locale
7342
- }), className: classNames[UI.WeekNumber], scope: "row", role: "rowheader" }, formatWeekNumber2(week.weekNumber, dateLib)),
7343
- week.days.map((day) => {
7344
- const { date } = day;
7345
- const modifiers = getModifiers(day);
7346
- modifiers[DayFlag.focused] = !modifiers.hidden && Boolean(focused?.isEqualTo(day));
7347
- modifiers[SelectionState.selected] = isSelected?.(date) || modifiers.selected;
7348
- if (isDateRange(selectedValue)) {
7349
- const { from, to } = selectedValue;
7350
- modifiers[SelectionState.range_start] = Boolean(from && to && dateLib.isSameDay(date, from));
7351
- modifiers[SelectionState.range_end] = Boolean(from && to && dateLib.isSameDay(date, to));
7352
- modifiers[SelectionState.range_middle] = rangeIncludesDate(selectedValue, date, true, dateLib);
7353
- }
7354
- const style2 = getStyleForModifiers(modifiers, styles, props.modifiersStyles);
7355
- const className2 = getClassNamesForModifiers(modifiers, classNames, props.modifiersClassNames);
7356
- const ariaLabel = !isInteractive && !modifiers.hidden ? labelGridcell2(date, modifiers, dateLib.options, dateLib) : void 0;
7357
- return React26__default.default.createElement(components.Day, { key: `${day.isoDate}_${day.displayMonthId}`, day, modifiers, className: className2.join(" "), style: style2, role: "gridcell", "aria-selected": modifiers.selected || void 0, "aria-label": ariaLabel, "data-day": day.isoDate, "data-month": day.outside ? day.dateMonthId : void 0, "data-selected": modifiers.selected || void 0, "data-disabled": modifiers.disabled || void 0, "data-hidden": modifiers.hidden || void 0, "data-outside": day.outside || void 0, "data-focused": modifiers.focused || void 0, "data-today": modifiers.today || void 0 }, !modifiers.hidden && isInteractive ? React26__default.default.createElement(components.DayButton, { className: classNames[UI.DayButton], style: styles?.[UI.DayButton], type: "button", day, modifiers, disabled: !modifiers.focused && modifiers.disabled || void 0, "aria-disabled": modifiers.focused && modifiers.disabled || void 0, tabIndex: isFocusTarget(day) ? 0 : -1, "aria-label": labelDayButton2(date, modifiers, dateLib.options, dateLib), onClick: handleDayClick(day, modifiers), onBlur: handleDayBlur(day, modifiers), onFocus: handleDayFocus(day, modifiers), onKeyDown: handleDayKeyDown(day, modifiers), onMouseEnter: handleDayMouseEnter(day, modifiers), onMouseLeave: handleDayMouseLeave(day, modifiers) }, formatDay2(date, dateLib.options, dateLib)) : !modifiers.hidden && formatDay2(day.date, dateLib.options, dateLib));
7358
- })
7359
- );
7360
- }))
7361
- )
7362
- );
7363
- })
7364
- ),
7365
- props.footer && React26__default.default.createElement(components.Footer, { className: classNames[UI.Footer], style: styles?.[UI.Footer], role: "status", "aria-live": "polite" }, props.footer)
7366
- )
7367
- );
7368
- }
7369
- var dayPickerClassNames = {
7370
- selected: `tw-bg-primary tw-border-primary tw-font-medium hover:tw-bg-primary/90 hover:tw-border-primary/90 tw-text-primary-foreground tw-rounded`
7371
- };
7372
- var rangePickerClassNames = {
7373
- range_start: `tw-bg-primary tw-rounded-r-none tw-font-medium tw-border-primary hover:tw-bg-primary/90 hover:tw-border-primary/90 tw-text-primary-foreground`,
7374
- range_end: `tw-bg-primary tw-rounded-l-none tw-font-medium tw-border-primary hover:tw-bg-primary/90 hover:tw-border-primary/90 tw-text-primary-foreground`,
7375
- selected: `tw-font-medium tw-rounded`,
7376
- range_middle: `tw-bg-accent tw-border-accent tw-text-accent-foreground tw-rounded-none tw-font-medium`
7377
- };
7378
- var Calendar = ({ className, classNames, ...props }) => {
7379
- const defaultClassNames = getDefaultClassNames();
7380
- return /* @__PURE__ */ jsxRuntime.jsx(
7381
- DayPicker,
7382
- {
7383
- ...props,
7384
- captionLayout: "dropdown",
7385
- className: cn(className, "tw-p-3"),
7386
- classNames: {
7387
- chevron: `${defaultClassNames.chevron} tw-fill-foreground`,
7388
- day: `${defaultClassNames.day} hover:tw-bg-accent tw-rounded`,
7389
- day_button: `${defaultClassNames.day_button} tw-rounded`,
7390
- today: `tw-bg-accent tw-text-accent-foreground tw-font-medium`,
7391
- ...dayPickerClassNames,
7392
- ...rangePickerClassNames,
7393
- selected: `${props.mode === "range" ? rangePickerClassNames.selected : dayPickerClassNames.selected}`,
7394
- ...classNames
7395
- },
7396
- required: false
7397
- }
7398
- );
7399
- };
7400
- Calendar.displayName = "Calendar";
7401
- var variants2 = classVarianceAuthority.cva(
7402
- [
7403
- "tailwindcss-preflight",
7404
- "tw-group/popover-content",
7405
- "tw-z-[1055]",
7406
- "focus-visible:tw-outline-none",
7407
- // sizing
7408
- "tw-min-w-32",
7409
- "tw-max-h-[var(--radix-popover-content-available-height)]",
7410
- "tw-origin-[--radix-popover-content-transform-origin]",
7411
- // layout
7412
- "tw-flex",
7413
- "tw-flex-col",
7414
- "tw-overflow-y-auto",
7415
- // border
7416
- "tw-box-border",
7417
- "tw-border",
7418
- "tw-border-solid",
7419
- "tw-shadow-lg",
7420
- // open animation
7421
- "data-[state=open]:tw-animate-in",
7422
- "data-[state=open]:tw-fade-in-0",
7423
- "data-[state=open]:tw-zoom-in-95",
7424
- // closed animation
7425
- "data-[state=closed]:tw-animate-out",
7426
- "data-[state=closed]:tw-fade-out-0",
7427
- "data-[state=closed]:tw-zoom-out-95",
7428
- // position animation
7429
- "data-[side=bottom]:tw-slide-in-from-top-2",
7430
- "data-[side=left]:tw-slide-in-from-right-2",
7431
- "data-[side=right]:tw-slide-in-from-left-2",
7432
- "data-[side=top]:tw-slide-in-from-bottom-2",
7433
- // Default size for nested Lucide icons; callers can override on the icon.
7434
- "[&_svg.lucide:not([class*='tw-size-'])]:tw-size-4",
7435
- "[&_svg]:tw-shrink-0"
7436
- ],
7437
- {
7438
- defaultVariants: {
7439
- matchTriggerWidth: false,
7440
- variant: "default"
7441
- },
7442
- variants: {
7443
- variant: {
7444
- // Legacy surface — fixed white panel.
7445
- default: ["tw-rounded-md", "tw-border-neutral-100", "tw-bg-white", "tw-text-neutral-800"],
7446
- // Argo surface — semantic popover tokens (brand + dark aware).
7447
- argo: ["tw-rounded-2xl", "tw-border-border", "tw-bg-popover", "tw-text-popover-foreground"]
7448
- },
7449
- matchTriggerWidth: {
7450
- true: ["tw-w-[var(--radix-popover-trigger-width)]"],
7451
- false: []
7452
- }
7453
- }
7454
- }
7455
- );
7456
- var PopoverContent = ({
7457
- ref,
7458
- className,
7459
- align = "center",
7460
- sideOffset = 4,
7461
- matchTriggerWidth = false,
7462
- children,
7463
- onEscapeKeyDown,
7464
- ...props
7465
- }) => {
7466
- const effectiveVariant = useArgoDesign() ? "argo" : "default";
7467
- return /* @__PURE__ */ jsxRuntime.jsx(reactPopover.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
7468
- reactPopover.Content,
7469
- {
7470
- ref,
7471
- align: matchTriggerWidth ? "start" : align,
7472
- sideOffset,
7473
- className: cn(variants2({ className, matchTriggerWidth, variant: effectiveVariant })),
7474
- onEscapeKeyDown: (event) => {
7475
- event.stopPropagation();
7476
- onEscapeKeyDown?.(event);
7477
- },
7478
- ...props,
7479
- children
7480
- }
7481
- ) });
7482
- };
7483
- var Popover = (props) => /* @__PURE__ */ jsxRuntime.jsx(reactPopover.Root, { ...props });
7484
- Popover.Content = PopoverContent;
7485
- Popover.Trigger = reactPopover.Trigger;
7486
- Popover.Close = reactPopover.Close;
7487
- var DatePicker = ({
7488
- align = "end",
7489
- alignOffset = -18,
7490
- children,
7491
- defaultOpen,
7492
- onOpenChange,
7493
- open,
7494
- sideOffset = 12,
7495
- ...calendarProps
7496
- }) => /* @__PURE__ */ jsxRuntime.jsxs(Popover, { defaultOpen, open, onOpenChange, children: [
7497
- /* @__PURE__ */ jsxRuntime.jsx(Popover.Trigger, { asChild: true, children }),
7498
- /* @__PURE__ */ jsxRuntime.jsx(
7499
- Popover.Content,
7500
- {
7501
- align,
7502
- alignOffset,
7503
- className: "tw-w-auto tw-p-0",
7504
- sideOffset,
7505
- children: /* @__PURE__ */ jsxRuntime.jsx(Calendar, { ...calendarProps })
7506
- }
7507
- )
7508
- ] });
7509
- DatePicker.displayName = "DatePicker";
7510
-
7511
- // src/components/Input/utils.ts
7512
- var genInputTestId = (prefix = "") => {
7513
- const ps = createPrefixedString(prefix);
7514
- return {
7515
- toString: () => prefix,
7516
- inputWrapper: ps`input-wrapper`,
7517
- input: ps`input`,
7518
- clearButton: ps`clear-button`
7519
- };
7520
- };
7521
- var Input = ({
7522
- ref: forwardedRef,
7523
- state = "default",
7524
- sizing = "default",
7525
- className,
7526
- prefix = null,
7527
- rightSuffix = null,
7528
- rightSuffixVariant = "default",
7529
- leftSuffix = null,
7530
- allowClear = false,
7531
- onClear,
7532
- disabled = false,
7533
- testId: prefixTestId = "",
7534
- autoFocus = false,
7535
- id,
7536
- name,
7537
- variant,
7538
- readOnly,
7539
- type = "text",
7540
- focusVariant = "default",
7541
- onChange,
7542
- onBlur,
7543
- value,
7544
- defaultValue,
7545
- ...inputProps
7546
- }) => {
7547
- const [hasUncontrolledValue, setHasUncontrolledValue] = React26.useState(() => !!defaultValue);
7548
- const hasValue = !!value || hasUncontrolledValue;
7549
- const inputRef = React26.useRef(null);
7550
- const testId = genInputTestId(prefixTestId);
7551
- const isClearButtonVisible = hasValue && !disabled && !readOnly || !!onClear;
7552
- const handleChange = (event) => {
7553
- const val = event.target.value;
7554
- setHasUncontrolledValue(val !== "");
7555
- onChange?.(event);
7556
- };
7557
- const handleBlur = (event) => {
7558
- const val = event.target.value;
7559
- setHasUncontrolledValue(val !== "");
7560
- onBlur?.(event);
7561
- };
7562
- const handleClear = () => {
7563
- if (inputRef.current === null) return;
7564
- inputRef.current.value = "";
7565
- inputRef.current.focus();
7566
- onClear?.();
7567
- setHasUncontrolledValue(false);
7568
- onChange?.(createChangeInputEvent(inputRef.current));
7569
- };
7570
- const isControlled = value !== void 0;
7571
- const valueProp = isControlled ? { value: value ?? "" } : { defaultValue: defaultValue ?? "" };
7572
- return /* @__PURE__ */ jsxRuntime.jsxs(
7573
- InputGroup,
7574
- {
7575
- state,
7576
- variant,
7577
- sizing,
7578
- focusVariant,
7579
- className,
7580
- "data-testid": testId.inputWrapper,
7581
- children: [
7582
- prefix && /* @__PURE__ */ jsxRuntime.jsx(InputGroup.Addon, { align: "inline-start", children: prefix }),
7583
- /* @__PURE__ */ jsxRuntime.jsx(
7584
- InputGroup.Input,
7585
- {
7586
- ...inputProps,
7587
- ...valueProp,
7588
- autoFocus,
7589
- type,
7590
- onChange: handleChange,
7591
- onBlur: handleBlur,
7592
- ref: mergeRefs(forwardedRef ?? null, inputRef),
7593
- disabled,
7594
- id,
7595
- name,
7596
- readOnly,
7597
- "data-testid": testId.input
7598
- }
7599
- ),
7600
- (leftSuffix || allowClear || rightSuffix) && /* @__PURE__ */ jsxRuntime.jsxs(InputGroup.Addon, { align: "inline-end", children: [
7601
- leftSuffix,
7602
- allowClear && isClearButtonVisible && /* @__PURE__ */ jsxRuntime.jsx(
7603
- InputGroup.Button,
7604
- {
7605
- "aria-label": "Clear",
7606
- onMouseDown: (e) => e.preventDefault(),
7607
- onClick: handleClear,
7608
- "data-testid": testId.clearButton,
7609
- children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.X, { className: "tw-size-4" })
7610
- }
7611
- ),
7612
- rightSuffix && /* @__PURE__ */ jsxRuntime.jsx(
7613
- "div",
7614
- {
7615
- className: cn({
7616
- "tw-whitespace-nowrap tw-bg-muted tw-px-4 -tw-mr-4 tw-py-2.5": rightSuffixVariant === "addon"
7617
- }),
7618
- children: rightSuffix
7619
- }
7620
- )
7621
- ] })
7622
- ]
7623
- }
7624
- );
7625
- };
7626
-
7627
- // src/components/Input/DateInput/helpers.ts
7628
- var formatDate = (date, inputValue) => {
7629
- if (!date) {
7630
- return inputValue;
7631
- }
7632
- return date.toLocaleDateString();
7633
- };
7634
- var datePartOrder = new Intl.DateTimeFormat().formatToParts(new Date(2e3, 0, 2)).filter(
7635
- (p) => p.type === "day" || p.type === "month" || p.type === "year"
7636
- ).map((p) => p.type);
7637
- var parseDate = (value) => {
7638
- if (!value.trim()) return null;
7639
- const nums = value.match(/\d+/g)?.map(Number);
7640
- if (nums && nums.length >= 3) {
7641
- const parts = Object.fromEntries(datePartOrder.map((type, i) => [type, nums[i]]));
7642
- const year = parts.year;
7643
- const month = parts.month;
7644
- const day = parts.day;
7645
- if (year != null && month != null && day != null && month >= 1 && month <= 12 && day >= 1 && day <= 31) {
7646
- const date = new Date(year, month - 1, day);
7647
- if (date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day) {
7648
- return date;
7649
- }
7650
- }
7651
- }
7652
- const isoMatch = value.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);
7653
- if (isoMatch) {
7654
- const y = Number(isoMatch[1]);
7655
- const m = Number(isoMatch[2]) - 1;
7656
- const d = Number(isoMatch[3]);
7657
- const date = new Date(y, m, d);
7658
- if (date.getFullYear() === y && date.getMonth() === m && date.getDate() === d) {
7659
- return date;
7660
- }
7661
- return null;
7662
- }
7663
- const fallback = new Date(value);
7664
- return isNaN(fallback.getTime()) ? null : fallback;
7665
- };
7666
- var DateInput = ({
7667
- ref,
7668
- defaultValue,
7669
- disabled,
7670
- disabledDays,
7671
- endMonth,
7672
- onBlur,
7673
- onChange,
7674
- onValueBlur,
7675
- onValueChange,
7676
- placeholder = "Select a date",
7677
- readOnly,
7678
- startMonth,
7679
- value,
7680
- variant,
7681
- ...props
7682
- }) => {
7683
- const [inputValue, setInputValue] = React26.useState("");
7684
- const [hasFocus, setHasFocus] = React26.useState(false);
7685
- const [isOpen, setIsOpen] = React26.useState(false);
7686
- const [internalValue, setInternalValue] = React26.useState(defaultValue ?? null);
7687
- const [month, setMonth2] = React26.useState(/* @__PURE__ */ new Date());
7688
- const isControlled = value !== void 0;
7689
- const currentValue = isControlled ? value : internalValue;
7690
- const handleChange = (event) => {
7691
- const newValue = event.target.value;
7692
- setInputValue(newValue);
7693
- onChange?.(event);
7694
- const parsedDate = parseDate(newValue);
7695
- if (parsedDate !== null || !newValue.trim()) {
7696
- onValueChange?.(parsedDate);
7697
- }
7698
- };
7699
- const handleFocus = (event) => {
7700
- const formatted = formatDate(currentValue, "");
7701
- setInputValue(formatted);
7702
- setHasFocus(true);
7703
- props.onFocus?.(event);
7704
- };
7705
- const handleBlur = (event) => {
7706
- setHasFocus(false);
7707
- onBlur?.(event);
7708
- const parsedDate = parseDate(event.target.value);
7709
- onValueBlur?.(parsedDate);
7710
- if (!isControlled) {
7711
- setInternalValue(parsedDate);
7712
- }
7713
- };
7714
- const handleDatePickerChange = (newValue) => {
7715
- const dateValue = newValue ?? null;
7716
- if (isControlled) {
7717
- onValueChange?.(dateValue);
7718
- } else {
7719
- setInternalValue(dateValue);
7720
- onValueChange?.(dateValue);
7721
- }
7722
- setHasFocus(false);
7723
- setIsOpen(false);
7724
- };
7725
- const handleClear = () => {
7726
- setInputValue("");
7727
- setInternalValue(null);
7728
- onValueChange?.(null);
7729
- };
7730
- const handleOpenChange = (open) => {
7731
- if (open) {
7732
- setMonth2(currentValue ?? /* @__PURE__ */ new Date());
7733
- }
7734
- setIsOpen(open);
7735
- };
7736
- const displayValue = hasFocus ? inputValue : formatDate(currentValue, "");
7737
- return /* @__PURE__ */ jsxRuntime.jsx(
7738
- Input,
7739
- {
7740
- ...props,
7741
- disabled,
7742
- onBlur: handleBlur,
7743
- onChange: handleChange,
7744
- onClear: handleClear,
7745
- onFocus: handleFocus,
7746
- placeholder,
7747
- readOnly,
7748
- ref,
7749
- value: displayValue,
7750
- variant,
7751
- rightSuffix: !disabled && !readOnly ? /* @__PURE__ */ jsxRuntime.jsx(
7752
- DatePicker,
7753
- {
7754
- disabled: disabledDays,
7755
- endMonth,
7756
- mode: "single",
7757
- month,
7758
- onMonthChange: setMonth2,
7759
- onOpenChange: handleOpenChange,
7760
- onSelect: handleDatePickerChange,
7761
- open: isOpen,
7762
- selected: currentValue ?? void 0,
7763
- startMonth,
7764
- children: /* @__PURE__ */ jsxRuntime.jsx(Button, { "aria-label": "Select Date", variant: "inline", size: "icon-3xs", children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Calendar, { className: "tw-size-4" }) })
7765
- }
7766
- ) : void 0,
7767
- type: "text"
7768
- }
7769
- );
7770
- };
7771
- var sanitizeTextInputValue = (value) => {
7772
- if (typeof value === "string" && value.trim() === "") return "";
7773
- return value;
7774
- };
7775
- var TextInput = ({
7776
- ref,
7777
- value,
7778
- defaultValue,
7779
- type = "text",
7780
- variant,
7781
- onValueChange,
7782
- onChange,
7783
- onValueBlur,
7784
- onBlur,
7785
- ...props
7786
- }) => {
7787
- const handleChange = (event) => {
7788
- onValueChange?.(event.target.value);
7789
- onChange?.(event);
7790
- };
7791
- const handleBlur = (event) => {
7792
- onValueBlur?.(event.target.value);
7793
- onBlur?.(event);
7794
- };
7795
- return /* @__PURE__ */ jsxRuntime.jsx(
7796
- Input,
7797
- {
7798
- ...props,
7799
- ref,
7800
- onChange: handleChange,
7801
- onBlur: handleBlur,
7802
- type,
7803
- variant,
7804
- value: sanitizeTextInputValue(value),
7805
- defaultValue: sanitizeTextInputValue(defaultValue)
7806
- }
7807
- );
7808
- };
7809
- var FormGroupTextInput = ({
7810
- ref,
7811
- ...props
7812
- }) => {
7813
- const { state } = useFormGroupContext();
7814
- return /* @__PURE__ */ jsxRuntime.jsx(TextInput, { state, ...props, ref });
7815
- };
7816
- var FormGroup = ({ className, children, state, ...rest }) => {
7817
- return /* @__PURE__ */ jsxRuntime.jsx(FormGroupProvider, { value: { state }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ...rest, className: cn("tw-flex tw-flex-col tw-gap-1", className), children }) });
7818
- };
7819
- FormGroup.Help = FormGroupHelp;
7820
- FormGroup.Error = FormGroupError;
7821
- FormGroup.TextInput = FormGroupTextInput;
7822
- FormGroup.NumberInput = FormGroupNumberInput;
7823
- FormGroup.ColorInput = FormGroupColorInput;
7824
- FormGroup.Textarea = FormGroupTextarea;
7825
- var Optional = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("span", { ...props, "aria-hidden": true, className: cn("tw-ml-0.5", "tw-text-muted-foreground", className), children: "(optional)" });
7826
- var Required = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("span", { ...props, "aria-hidden": true, className: cn("tw-ml-0.5", "tw-text-primary", className), children: "*" });
7827
- var Label = ({ className, children, id, htmlFor, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(
7828
- RLabel__namespace.Root,
7829
- {
7830
- ...rest,
7831
- id: id?.toString(),
7832
- htmlFor: htmlFor?.toString(),
7833
- className: cn(
7834
- "tw-m-0 tw-text-foreground tw-font-normal peer-disabled:tw-opacity-50",
7835
- className
7836
- ),
7837
- children
7838
- }
7839
- );
7840
- Label.Optional = Optional;
7841
- Label.Required = Required;
7842
- var Link = ({
7843
- ref,
7844
- children,
7845
- target = "_blank",
7846
- rel = "noopener noreferrer",
7847
- onClick,
7848
- className,
7849
- ...rest
7850
- }) => {
7851
- const handleOnClick = (event) => {
7852
- event.stopPropagation();
7853
- onClick?.(event);
7854
- };
7855
- return (
7856
- // oxlint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
7857
- /* @__PURE__ */ jsxRuntime.jsx(
7858
- "a",
7859
- {
7860
- ...rest,
7861
- ref,
7862
- target,
7863
- rel,
7864
- onClick: handleOnClick,
7865
- className: cn(
7866
- "tw-text-primary tw-underline hover:tw-text-primary/90 hover:tw-no-underline",
7867
- className
7868
- ),
7869
- children
7870
- }
7871
- )
7872
- );
7873
- };
7874
- var RootFormDataContext = React26.createContext({});
7875
- var RootFormDataProvider = RootFormDataContext;
7876
- var useRootFormData = () => React26.use(RootFormDataContext);
7877
- var resolveByPath2 = (parts, data) => {
7878
- let current = data;
7879
- for (const part of parts) {
7880
- if (current == null || typeof current !== "object") return void 0;
7881
- current = current[part];
7882
- }
7883
- return current;
7884
- };
7885
- var resolveDependencyValue = (path, formData, parentPath) => {
7886
- if (path.startsWith("root.")) {
7887
- return resolveByPath2(path.replace(/^root\./, "").split("."), formData);
7888
- }
7889
- const parent = resolveByPath2(parentPath.map(String), formData);
7890
- if (parent && typeof parent === "object") {
7891
- const sibling = resolveByPath2(path.split("."), parent);
7892
- if (sibling !== void 0) return sibling;
7893
- }
7894
- return resolveByPath2(path.split("."), formData);
7895
- };
7896
- var evaluateDependencies = (dependencies, formData, parentPath) => {
7897
- for (const [path, expected] of Object.entries(dependencies)) {
7898
- const actual = resolveDependencyValue(path, formData, parentPath);
7899
- if (Array.isArray(expected)) {
7900
- if (!expected.includes(actual)) return false;
7901
- } else if (expected === "") {
7902
- if (actual !== "" && actual !== void 0 && actual !== null) return false;
7903
- } else {
7904
- if (actual !== expected) return false;
7905
- }
7906
- }
7907
- return true;
7908
- };
7909
- var DocumentationLinkIcon = ({
7910
- documentation
7911
- }) => /* @__PURE__ */ jsxRuntime.jsx(
7912
- Tooltip,
7913
- {
7914
- placement: "top",
7915
- variant: "explanatory",
7916
- tooltip: documentation.tooltip ?? "Open documentation",
7917
- triggerAsChild: true,
7918
- children: /* @__PURE__ */ jsxRuntime.jsx(Link, { href: documentation.link, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw-cursor-pointer tw-text-neutral-400 hover:tw-text-neutral-600", children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.BookOpen, { className: "tw-size-4" }) }) })
7919
- }
7920
- );
7921
- var FieldTemplateBody = ({
7922
- id,
7923
- label,
7924
- rawHelp,
7925
- rawDescription,
7926
- rawErrors,
7927
- children,
7928
- schema,
7929
- uiSchema,
7930
- displayLabel
7931
- }) => {
7932
- const widget = uiSchema?.["ui:widget"];
7933
- if (widget === "test-connection" || widget === "sync-action") {
7934
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
7935
- }
7936
- if (schema.type === "object") {
7937
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
7938
- }
7939
- if (schema.type === "array" && !uiSchema?.["ui:widget"]) {
7940
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
7941
- }
7942
- const uiOptions = uiSchema?.["ui:options"];
7943
- const documentation = uiOptions?.documentation;
7944
- const hasErrors = rawErrors && rawErrors.length > 0;
7945
- const isCheckbox = schema.type === "boolean" && uiSchema?.["ui:widget"] !== "select";
7946
- const showLabel = displayLabel && label && !isCheckbox;
7947
- const hasHelpIcons = Boolean(rawHelp || documentation);
7948
- const helpIcons = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7949
- rawHelp && /* @__PURE__ */ jsxRuntime.jsx(TooltipIcon, { rawHelp }),
7950
- documentation && /* @__PURE__ */ jsxRuntime.jsx(DocumentationLinkIcon, { documentation })
7951
- ] });
7952
- return /* @__PURE__ */ jsxRuntime.jsxs(FormGroup, { state: hasErrors ? "error" : "default", children: [
7953
- showLabel && /* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: id, children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "tw-inline-flex tw-items-center tw-gap-1", children: [
7954
- label,
7955
- helpIcons
7956
- ] }) }),
7957
- !showLabel && !isCheckbox && hasHelpIcons && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw-flex tw-items-center tw-gap-1", children: helpIcons }),
7958
- isCheckbox && hasHelpIcons ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tw-flex tw-items-center tw-gap-1", children: [
7959
- children,
7960
- helpIcons
7961
- ] }) : children,
7962
- rawDescription && /* @__PURE__ */ jsxRuntime.jsx(FormGroup.Help, { children: /* @__PURE__ */ jsxRuntime.jsx("span", { dangerouslySetInnerHTML: { __html: DOMPurify__default.default.sanitize(rawDescription) } }) }),
7963
- hasErrors && /* @__PURE__ */ jsxRuntime.jsx(FormGroup.Help, { children: rawErrors.join(". ") })
7964
- ] });
7965
- };
7966
- var FieldTemplateWithDependencies = ({
7967
- dependencies,
7968
- ...props
7969
- }) => {
7970
- const rootFormData = useRootFormData();
7971
- const parentPath = props.fieldPathId.path.slice(0, -1);
7972
- if (!evaluateDependencies(dependencies, rootFormData, parentPath)) {
7973
- return null;
7974
- }
7975
- return /* @__PURE__ */ jsxRuntime.jsx(FieldTemplateBody, { ...props });
7976
- };
7977
- var FieldTemplate = (props) => {
7978
- if (props.hidden) return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw-hidden", children: props.children });
7979
- if (props.uiSchema?.["ui:widget"] === "template-watch") {
7980
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw-hidden", children: props.children });
7981
- }
7982
- const uiOptions = props.uiSchema?.["ui:options"];
7983
- const dependencies = uiOptions?.dependencies;
7984
- if (dependencies) {
7985
- return /* @__PURE__ */ jsxRuntime.jsx(FieldTemplateWithDependencies, { dependencies, ...props });
7986
- }
7987
- return /* @__PURE__ */ jsxRuntime.jsx(FieldTemplateBody, { ...props });
7988
- };
7989
- var ObjectFieldTemplate = ({
7990
- title,
7991
- description,
7992
- properties,
7993
- formData,
7994
- uiSchema,
7995
- schema,
7996
- fieldPathId
7997
- }) => {
7998
- const isRoot = !fieldPathId?.path?.length;
7999
- const uiOptions = uiSchema?.["ui:options"];
8000
- const hasCollapsed = uiOptions?.collapsed !== void 0;
8001
- const collapsed = !!uiOptions?.collapsed;
8002
- const disableCollapse = !!uiOptions?.disableCollapse;
8003
- const lastPathSegment = fieldPathId?.path?.at(-1);
8004
- const isArrayItem = typeof lastPathSegment === "number";
8005
- const childSchemas = schema.properties;
8006
- const isContainerSchema = (s) => {
8007
- if (!s) return false;
8008
- if (s.properties || s.items) return true;
8009
- if (Array.isArray(s.type)) return s.type.includes("object") || s.type.includes("array");
8010
- return s.type === "object" || s.type === "array";
8011
- };
8012
- const visibleProperties = properties.filter((prop) => {
8013
- const childUi = uiSchema?.[prop.name];
8014
- if (childUi?.["ui:widget"] !== "hidden") return true;
8015
- return !isContainerSchema(childSchemas?.[prop.name]);
8016
- });
8017
- const isHiddenMount = (name) => {
8018
- const w = uiSchema?.[name]?.["ui:widget"];
8019
- return w === "hidden" || w === "template-watch";
8020
- };
8021
- const renderChildren = (props) => props.map((prop) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: isHiddenMount(prop.name) ? "tw-hidden" : void 0, children: prop.content }, prop.name));
8022
- if (isRoot) {
8023
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw-flex tw-flex-col tw-gap-4 [&>div:empty]:tw-hidden", children: renderChildren(visibleProperties) });
8024
- }
8025
- const childrenContent = renderChildren(visibleProperties);
8026
- if (hasCollapsed && !disableCollapse) {
8027
- const data = formData ?? {};
8028
- const hasValues = Object.values(data).some(
8029
- (v) => v !== void 0 && v !== null && v !== "" && v !== false
8030
- );
8031
- const defaultExpanded = hasValues ? !collapsed : true;
8032
- return /* @__PURE__ */ jsxRuntime.jsxs(
8033
- CollapsiblePanel,
8034
- {
8035
- className: "tw-rounded-lg",
8036
- headerClassName: "tw-rounded-lg",
8037
- header: title || "Settings",
8038
- defaultExpanded,
8039
- bodyClassName: "tw-flex tw-flex-col tw-gap-4 [&>div:empty]:tw-hidden",
8040
- children: [
8041
- description,
8042
- childrenContent
8043
- ]
8044
- }
8045
- );
8046
- }
8047
- if (isArrayItem) {
8048
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw-flex tw-flex-col tw-gap-4 [&>div:empty]:tw-hidden", children: childrenContent });
8049
- }
8050
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tw-rounded-lg tw-border tw-border-solid tw-border-neutral-200 tw-bg-white tw-p-4", children: [
8051
- title && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "tw-mb-2 tw-text-base tw-font-medium tw-text-neutral-800", children: title }),
8052
- description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "tw-mb-3 tw-text-xs tw-text-neutral-400", children: description }),
8053
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tw-flex tw-flex-col tw-gap-4 [&>div:empty]:tw-hidden", children: childrenContent })
8054
- ] });
8055
- };
8056
- var FieldBoxDescription = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
8057
- "span",
8058
- {
8059
- ...props,
8060
- "data-slot": "field-box-description",
8061
- className: cn(
8062
- "tw-text-xs",
8063
- "tw-text-muted-foreground",
8064
- "group-has-[:disabled]/field-box:tw-opacity-50",
8065
- className
8066
- )
8067
- }
8068
- );
8069
- var FieldBoxTitle = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
8070
- "span",
8071
- {
8072
- ...props,
8073
- "data-slot": "field-box-title",
8074
- className: cn(
8075
- "tw-text-sm",
8076
- "tw-font-medium",
8077
- "tw-text-foreground",
8078
- "group-has-[:disabled]/field-box:tw-cursor-not-allowed",
8079
- "group-has-[:disabled]/field-box:tw-opacity-50",
8080
- className
7885
+ const controls = dateLib.getMonthYearOrder() === "year-first" ? [yearControl, monthControl] : [monthControl, yearControl];
7886
+ return controls;
7887
+ })(),
7888
+ React26__default.default.createElement("span", { role: "status", "aria-live": "polite", style: {
7889
+ border: 0,
7890
+ clip: "rect(0 0 0 0)",
7891
+ height: "1px",
7892
+ margin: "-1px",
7893
+ overflow: "hidden",
7894
+ padding: 0,
7895
+ position: "absolute",
7896
+ width: "1px",
7897
+ whiteSpace: "nowrap",
7898
+ wordWrap: "normal"
7899
+ } }, formatCaption2(calendarMonth.date, dateLib.options, dateLib))
7900
+ ) : React26__default.default.createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], style: styles?.[UI.CaptionLabel], role: "status", "aria-live": "polite" }, formatCaption2(calendarMonth.date, dateLib.options, dateLib))),
7901
+ navLayout === "around" && !props.hideNavigation && displayIndex === numberOfMonths - 1 && React26__default.default.createElement(
7902
+ components.NextMonthButton,
7903
+ { type: "button", className: classNames[UI.NextMonthButton], style: styles?.[UI.NextMonthButton], tabIndex: nextMonth ? void 0 : -1, "aria-disabled": nextMonth ? void 0 : true, "aria-label": labelNext2(nextMonth), onClick: handleNextClick, "data-animated-button": props.animate ? "true" : void 0 },
7904
+ React26__default.default.createElement(components.Chevron, { disabled: nextMonth ? void 0 : true, className: classNames[UI.Chevron], style: styles?.[UI.Chevron], orientation: props.dir === "rtl" ? "left" : "right" })
7905
+ ),
7906
+ displayIndex === numberOfMonths - 1 && navLayout === "after" && !props.hideNavigation && React26__default.default.createElement(components.Nav, { "data-animated-nav": props.animate ? "true" : void 0, className: classNames[UI.Nav], style: styles?.[UI.Nav], "aria-label": labelNav2(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth, nextMonth }),
7907
+ React26__default.default.createElement(
7908
+ components.MonthGrid,
7909
+ { role: "grid", "aria-multiselectable": mode === "multiple" || mode === "range", "aria-label": labelGrid2(calendarMonth.date, dateLib.options, dateLib) || void 0, className: classNames[UI.MonthGrid], style: styles?.[UI.MonthGrid] },
7910
+ !props.hideWeekdays && React26__default.default.createElement(
7911
+ components.Weekdays,
7912
+ { "data-animated-weekdays": props.animate ? "true" : void 0, className: classNames[UI.Weekdays], style: styles?.[UI.Weekdays] },
7913
+ showWeekNumber && React26__default.default.createElement(components.WeekNumberHeader, { "aria-label": labelWeekNumberHeader2(dateLib.options), className: classNames[UI.WeekNumberHeader], style: styles?.[UI.WeekNumberHeader], scope: "col" }, formatWeekNumberHeader2()),
7914
+ weekdays.map((weekday) => React26__default.default.createElement(components.Weekday, { "aria-label": labelWeekday2(weekday, dateLib.options, dateLib), className: classNames[UI.Weekday], key: String(weekday), style: styles?.[UI.Weekday], scope: "col" }, formatWeekdayName2(weekday, dateLib.options, dateLib)))
7915
+ ),
7916
+ React26__default.default.createElement(components.Weeks, { "data-animated-weeks": props.animate ? "true" : void 0, className: classNames[UI.Weeks], style: styles?.[UI.Weeks] }, calendarMonth.weeks.map((week) => {
7917
+ return React26__default.default.createElement(
7918
+ components.Week,
7919
+ { className: classNames[UI.Week], key: week.weekNumber, style: styles?.[UI.Week], week },
7920
+ showWeekNumber && React26__default.default.createElement(components.WeekNumber, { week, style: styles?.[UI.WeekNumber], "aria-label": labelWeekNumber2(week.weekNumber, {
7921
+ locale
7922
+ }), className: classNames[UI.WeekNumber], scope: "row", role: "rowheader" }, formatWeekNumber2(week.weekNumber, dateLib)),
7923
+ week.days.map((day) => {
7924
+ const { date } = day;
7925
+ const modifiers = getModifiers(day);
7926
+ modifiers[DayFlag.focused] = !modifiers.hidden && Boolean(focused?.isEqualTo(day));
7927
+ modifiers[SelectionState.selected] = isSelected?.(date) || modifiers.selected;
7928
+ if (isDateRange(selectedValue)) {
7929
+ const { from, to } = selectedValue;
7930
+ modifiers[SelectionState.range_start] = Boolean(from && to && dateLib.isSameDay(date, from));
7931
+ modifiers[SelectionState.range_end] = Boolean(from && to && dateLib.isSameDay(date, to));
7932
+ modifiers[SelectionState.range_middle] = rangeIncludesDate(selectedValue, date, true, dateLib);
7933
+ }
7934
+ const style2 = getStyleForModifiers(modifiers, styles, props.modifiersStyles);
7935
+ const className2 = getClassNamesForModifiers(modifiers, classNames, props.modifiersClassNames);
7936
+ const ariaLabel = !isInteractive && !modifiers.hidden ? labelGridcell2(date, modifiers, dateLib.options, dateLib) : void 0;
7937
+ return React26__default.default.createElement(components.Day, { key: `${day.isoDate}_${day.displayMonthId}`, day, modifiers, className: className2.join(" "), style: style2, role: "gridcell", "aria-selected": modifiers.selected || void 0, "aria-label": ariaLabel, "data-day": day.isoDate, "data-month": day.outside ? day.dateMonthId : void 0, "data-selected": modifiers.selected || void 0, "data-disabled": modifiers.disabled || void 0, "data-hidden": modifiers.hidden || void 0, "data-outside": day.outside || void 0, "data-focused": modifiers.focused || void 0, "data-today": modifiers.today || void 0 }, !modifiers.hidden && isInteractive ? React26__default.default.createElement(components.DayButton, { className: classNames[UI.DayButton], style: styles?.[UI.DayButton], type: "button", day, modifiers, disabled: !modifiers.focused && modifiers.disabled || void 0, "aria-disabled": modifiers.focused && modifiers.disabled || void 0, tabIndex: isFocusTarget(day) ? 0 : -1, "aria-label": labelDayButton2(date, modifiers, dateLib.options, dateLib), onClick: handleDayClick(day, modifiers), onBlur: handleDayBlur(day, modifiers), onFocus: handleDayFocus(day, modifiers), onKeyDown: handleDayKeyDown(day, modifiers), onMouseEnter: handleDayMouseEnter(day, modifiers), onMouseLeave: handleDayMouseLeave(day, modifiers) }, formatDay2(date, dateLib.options, dateLib)) : !modifiers.hidden && formatDay2(day.date, dateLib.options, dateLib));
7938
+ })
7939
+ );
7940
+ }))
7941
+ )
7942
+ );
7943
+ })
7944
+ ),
7945
+ props.footer && React26__default.default.createElement(components.Footer, { className: classNames[UI.Footer], style: styles?.[UI.Footer], role: "status", "aria-live": "polite" }, props.footer)
8081
7946
  )
8082
- }
8083
- );
8084
- var fieldBoxVariants = classVarianceAuthority.cva(
8085
- [
8086
- "tw-group/field-box",
8087
- "tw-m-0",
8088
- "tw-inline-flex",
8089
- "tw-gap-3",
8090
- "tw-items-center",
8091
- "has-[[data-slot=field-box-description]]:tw-items-start",
8092
- "tw-cursor-pointer",
8093
- "tw-select-none",
8094
- "has-[:disabled]:tw-cursor-not-allowed"
8095
- ],
8096
- {
8097
- variants: {
8098
- variant: {
8099
- default: [],
8100
- boxed: [
8101
- "tw-rounded-lg",
8102
- "tw-border",
8103
- "tw-border-solid",
8104
- "tw-border-border",
8105
- "tw-p-3",
8106
- "tw-transition-colors",
8107
- "has-[[data-state=checked]]:tw-border-primary",
8108
- "has-[[data-state=checked]]:tw-bg-accent",
8109
- "has-[[data-state=indeterminate]]:tw-border-primary",
8110
- "has-[[data-state=indeterminate]]:tw-bg-accent"
8111
- ]
8112
- }
8113
- },
8114
- defaultVariants: {
8115
- variant: "default"
7947
+ );
7948
+ }
7949
+ var dayPickerClassNames = {
7950
+ selected: `tw-bg-primary tw-border-primary tw-font-medium hover:tw-bg-primary/90 hover:tw-border-primary/90 tw-text-primary-foreground tw-rounded`
7951
+ };
7952
+ var rangePickerClassNames = {
7953
+ range_start: `tw-bg-primary tw-rounded-r-none tw-font-medium tw-border-primary hover:tw-bg-primary/90 hover:tw-border-primary/90 tw-text-primary-foreground`,
7954
+ range_end: `tw-bg-primary tw-rounded-l-none tw-font-medium tw-border-primary hover:tw-bg-primary/90 hover:tw-border-primary/90 tw-text-primary-foreground`,
7955
+ selected: `tw-font-medium tw-rounded`,
7956
+ range_middle: `tw-bg-accent tw-border-accent tw-text-accent-foreground tw-rounded-none tw-font-medium`
7957
+ };
7958
+ var Calendar = ({ className, classNames, ...props }) => {
7959
+ const defaultClassNames = getDefaultClassNames();
7960
+ return /* @__PURE__ */ jsxRuntime.jsx(
7961
+ DayPicker,
7962
+ {
7963
+ ...props,
7964
+ captionLayout: "dropdown",
7965
+ className: cn(className, "tw-p-3"),
7966
+ classNames: {
7967
+ chevron: `${defaultClassNames.chevron} tw-fill-foreground`,
7968
+ day: `${defaultClassNames.day} hover:tw-bg-accent tw-rounded`,
7969
+ day_button: `${defaultClassNames.day_button} tw-rounded`,
7970
+ today: `tw-bg-accent tw-text-accent-foreground tw-font-medium`,
7971
+ ...dayPickerClassNames,
7972
+ ...rangePickerClassNames,
7973
+ selected: `${props.mode === "range" ? rangePickerClassNames.selected : dayPickerClassNames.selected}`,
7974
+ ...classNames
7975
+ },
7976
+ required: false
8116
7977
  }
8117
- }
8118
- );
8119
- var FieldBoxRoot = ({
8120
- ref,
8121
- className,
8122
- variant,
8123
- position = "start",
8124
- control,
8125
- children,
8126
- ...rest
8127
- }) => /* @__PURE__ */ jsxRuntime.jsxs(
8128
- "label",
8129
- {
8130
- ...rest,
8131
- ref,
8132
- className: cn(
8133
- fieldBoxVariants({ variant, className }),
8134
- position === "end" && "tw-flex-row-reverse"
8135
- ),
8136
- children: [
8137
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw-inline-flex tw-min-h-5 tw-shrink-0 tw-items-center", children: control }),
8138
- children != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tw-flex tw-flex-1 tw-flex-col tw-gap-0.5", children })
8139
- ]
8140
- }
8141
- );
8142
- var FieldBox = Object.assign(FieldBoxRoot, {
8143
- Title: FieldBoxTitle,
8144
- Description: FieldBoxDescription
8145
- });
8146
- var rootVariants = classVarianceAuthority.cva(
7978
+ );
7979
+ };
7980
+ Calendar.displayName = "Calendar";
7981
+ var variants2 = classVarianceAuthority.cva(
8147
7982
  [
8148
- // reset
8149
7983
  "tailwindcss-preflight",
8150
- // position
7984
+ "tw-group/popover-content",
7985
+ "tw-z-[1055]",
7986
+ "focus-visible:tw-outline-none",
7987
+ // An open Radix Dialog locks `pointer-events: none` on <body>. Popover content
7988
+ // is portalled to <body> as a sibling of the dialog, so it inherits the lock
7989
+ // and clicks fall through — re-enable pointer events on the content itself
7990
+ // (dismiss-on-outside-click still works, it listens on document).
7991
+ "tw-pointer-events-auto",
7992
+ // sizing
7993
+ "tw-min-w-32",
7994
+ "tw-max-h-[var(--radix-popover-content-available-height)]",
7995
+ "tw-origin-[--radix-popover-content-transform-origin]",
7996
+ // layout
8151
7997
  "tw-flex",
8152
- "tw-items-center",
8153
- "tw-justify-center",
8154
- "tw-peer",
8155
- "tw-size-4",
8156
- "tw-shrink-0",
8157
- "tw-cursor-pointer",
7998
+ "tw-flex-col",
7999
+ "tw-overflow-y-auto",
8158
8000
  // border
8001
+ "tw-box-border",
8159
8002
  "tw-border",
8160
8003
  "tw-border-solid",
8161
- // disabled
8162
- "disabled:tw-opacity-50",
8163
- "disabled:tw-cursor-not-allowed"
8004
+ "tw-shadow-lg",
8005
+ // open animation
8006
+ "data-[state=open]:tw-animate-in",
8007
+ "data-[state=open]:tw-fade-in-0",
8008
+ "data-[state=open]:tw-zoom-in-95",
8009
+ // closed animation
8010
+ "data-[state=closed]:tw-animate-out",
8011
+ "data-[state=closed]:tw-fade-out-0",
8012
+ "data-[state=closed]:tw-zoom-out-95",
8013
+ // position animation
8014
+ "data-[side=bottom]:tw-slide-in-from-top-2",
8015
+ "data-[side=left]:tw-slide-in-from-right-2",
8016
+ "data-[side=right]:tw-slide-in-from-left-2",
8017
+ "data-[side=top]:tw-slide-in-from-bottom-2",
8018
+ // Default size for nested Lucide icons; callers can override on the icon.
8019
+ "[&_svg.lucide:not([class*='tw-size-'])]:tw-size-4",
8020
+ "[&_svg]:tw-shrink-0"
8164
8021
  ],
8165
8022
  {
8166
8023
  defaultVariants: {
8024
+ matchTriggerWidth: false,
8167
8025
  variant: "default"
8168
8026
  },
8169
8027
  variants: {
8170
8028
  variant: {
8171
- default: [
8172
- "tw-rounded",
8173
- "tw-border-neutral-200",
8174
- "data-[state=checked]:tw-bg-primary",
8175
- "data-[state=checked]:tw-border-primary",
8176
- "data-[state=indeterminate]:tw-bg-white",
8177
- "data-[state=indeterminate]:tw-border-neutral-200"
8178
- ],
8179
- argo: [
8180
- "tw-rounded",
8181
- "tw-border-input",
8182
- "tw-transition-colors",
8183
- "data-[state=checked]:tw-bg-primary",
8184
- "data-[state=checked]:tw-border-primary",
8185
- "data-[state=indeterminate]:tw-bg-primary",
8186
- "data-[state=indeterminate]:tw-border-primary",
8187
- // focus
8188
- "focus-visible:tw-outline-none",
8189
- "focus-visible:tw-border-primary",
8190
- "focus-visible:tw-ring-2",
8191
- "focus-visible:tw-ring-ring/50"
8192
- ]
8029
+ // Legacy surface — fixed white panel.
8030
+ default: ["tw-rounded-md", "tw-border-neutral-100", "tw-bg-white", "tw-text-neutral-800"],
8031
+ // Argo surface — semantic popover tokens (brand + dark aware).
8032
+ argo: ["tw-rounded-2xl", "tw-border-border", "tw-bg-popover", "tw-text-popover-foreground"]
8033
+ },
8034
+ matchTriggerWidth: {
8035
+ true: ["tw-w-[var(--radix-popover-trigger-width)]"],
8036
+ false: []
8037
+ }
8038
+ }
8039
+ }
8040
+ );
8041
+ var PopoverContent = ({
8042
+ ref,
8043
+ className,
8044
+ align = "center",
8045
+ sideOffset = 4,
8046
+ matchTriggerWidth = false,
8047
+ children,
8048
+ onEscapeKeyDown,
8049
+ ...props
8050
+ }) => {
8051
+ const effectiveVariant = useArgoDesign() ? "argo" : "default";
8052
+ return /* @__PURE__ */ jsxRuntime.jsx(reactPopover.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
8053
+ reactPopover.Content,
8054
+ {
8055
+ ref,
8056
+ align: matchTriggerWidth ? "start" : align,
8057
+ sideOffset,
8058
+ className: cn(variants2({ className, matchTriggerWidth, variant: effectiveVariant })),
8059
+ onEscapeKeyDown: (event) => {
8060
+ event.stopPropagation();
8061
+ onEscapeKeyDown?.(event);
8062
+ },
8063
+ ...props,
8064
+ children
8065
+ }
8066
+ ) });
8067
+ };
8068
+ var Popover = (props) => /* @__PURE__ */ jsxRuntime.jsx(reactPopover.Root, { ...props });
8069
+ Popover.Content = PopoverContent;
8070
+ Popover.Trigger = reactPopover.Trigger;
8071
+ Popover.Close = reactPopover.Close;
8072
+ var DatePicker = ({
8073
+ align = "end",
8074
+ alignOffset = -18,
8075
+ children,
8076
+ defaultOpen,
8077
+ onOpenChange,
8078
+ open,
8079
+ sideOffset = 12,
8080
+ ...calendarProps
8081
+ }) => /* @__PURE__ */ jsxRuntime.jsxs(Popover, { defaultOpen, open, onOpenChange, children: [
8082
+ /* @__PURE__ */ jsxRuntime.jsx(Popover.Trigger, { asChild: true, children }),
8083
+ /* @__PURE__ */ jsxRuntime.jsx(
8084
+ Popover.Content,
8085
+ {
8086
+ align,
8087
+ alignOffset,
8088
+ className: "tw-w-auto tw-p-0",
8089
+ sideOffset,
8090
+ children: /* @__PURE__ */ jsxRuntime.jsx(Calendar, { ...calendarProps })
8091
+ }
8092
+ )
8093
+ ] });
8094
+ DatePicker.displayName = "DatePicker";
8095
+
8096
+ // src/blocks/DateInput/helpers.ts
8097
+ var formatDate = (date, inputValue) => {
8098
+ if (!date) {
8099
+ return inputValue;
8100
+ }
8101
+ return date.toLocaleDateString();
8102
+ };
8103
+ var datePartOrder = new Intl.DateTimeFormat().formatToParts(new Date(2e3, 0, 2)).filter(
8104
+ (p) => p.type === "day" || p.type === "month" || p.type === "year"
8105
+ ).map((p) => p.type);
8106
+ var parseDate = (value) => {
8107
+ if (!value.trim()) return null;
8108
+ const nums = value.match(/\d+/g)?.map(Number);
8109
+ if (nums && nums.length >= 3) {
8110
+ const parts = Object.fromEntries(datePartOrder.map((type, i) => [type, nums[i]]));
8111
+ const year = parts.year;
8112
+ const month = parts.month;
8113
+ const day = parts.day;
8114
+ if (year != null && month != null && day != null && month >= 1 && month <= 12 && day >= 1 && day <= 31) {
8115
+ const date = new Date(year, month - 1, day);
8116
+ if (date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day) {
8117
+ return date;
8193
8118
  }
8194
8119
  }
8195
8120
  }
8196
- );
8197
- var indicatorVariants = classVarianceAuthority.cva(["tw-group", "tw-flex", "tw-items-center"], {
8198
- defaultVariants: {
8199
- variant: "default"
8200
- },
8201
- variants: {
8202
- variant: {
8203
- default: [
8204
- "data-[state=checked]:tw-text-primary-foreground",
8205
- "data-[state=indeterminate]:tw-text-neutral-200"
8206
- ],
8207
- argo: ["tw-text-primary-foreground"]
8121
+ const isoMatch = value.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);
8122
+ if (isoMatch) {
8123
+ const y = Number(isoMatch[1]);
8124
+ const m = Number(isoMatch[2]) - 1;
8125
+ const d = Number(isoMatch[3]);
8126
+ const date = new Date(y, m, d);
8127
+ if (date.getFullYear() === y && date.getMonth() === m && date.getDate() === d) {
8128
+ return date;
8208
8129
  }
8130
+ return null;
8209
8131
  }
8210
- });
8211
- function Checkbox({
8212
- className,
8213
- id: idProp,
8214
- children,
8215
- description,
8132
+ const fallback = new Date(value);
8133
+ return isNaN(fallback.getTime()) ? null : fallback;
8134
+ };
8135
+ var DateInput = ({
8136
+ ref,
8137
+ // group props
8138
+ state,
8216
8139
  variant,
8217
- position,
8218
- tooltip,
8219
- tooltipPlacement = "top",
8220
- ...rest
8221
- }) {
8222
- const fallbackId = React26.useId();
8223
- const id = idProp?.toString() ?? fallbackId;
8224
- const styleVariant = useArgoDesign() ? "argo" : "default";
8225
- const checkboxElement = /* @__PURE__ */ jsxRuntime.jsx(reactCheckbox.Root, { id, ...rest, className: cn(rootVariants({ variant: styleVariant, className })), children: /* @__PURE__ */ jsxRuntime.jsxs(reactCheckbox.Indicator, { className: cn(indicatorVariants({ variant: styleVariant })), children: [
8226
- /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Check, { className: "tw-hidden tw-size-3 tw-stroke-[4px] group-data-[state=checked]:tw-block" }),
8227
- /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Minus, { className: "tw-hidden tw-size-3 tw-stroke-[4px] group-data-[state=indeterminate]:tw-block" })
8228
- ] }) });
8229
- const rendered = !children ? checkboxElement : /* @__PURE__ */ jsxRuntime.jsxs(FieldBox, { htmlFor: id, variant, position, control: checkboxElement, children: [
8230
- /* @__PURE__ */ jsxRuntime.jsx(FieldBox.Title, { children }),
8231
- description && /* @__PURE__ */ jsxRuntime.jsx(FieldBox.Description, { children: description })
8232
- ] });
8233
- if (!tooltip) return rendered;
8234
- return /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { tooltip, placement: tooltipPlacement, triggerAsChild: !!children, children: rendered });
8235
- }
8236
- var CheckboxWidget = ({
8237
- id,
8140
+ focusVariant,
8141
+ sizing,
8142
+ className,
8143
+ // own props
8238
8144
  value,
8145
+ defaultValue,
8146
+ onValueChange,
8147
+ onValueBlur,
8239
8148
  onChange,
8149
+ onBlur,
8150
+ onFocus,
8151
+ allowClear = false,
8152
+ disabledDays,
8153
+ endMonth,
8154
+ startMonth,
8155
+ // input props
8240
8156
  disabled,
8241
- readonly,
8242
- label,
8243
- hideLabel
8157
+ readOnly,
8158
+ placeholder = "Select a date",
8159
+ ...restInputProps
8244
8160
  }) => {
8245
- const checked = !!value;
8246
- return /* @__PURE__ */ jsxRuntime.jsx(Checkbox, { id, checked, onCheckedChange: onChange, disabled: disabled || readonly, children: hideLabel ? void 0 : label });
8161
+ const inputRef = React26.useRef(null);
8162
+ const [inputValue, setInputValue] = React26.useState("");
8163
+ const [hasFocus, setHasFocus] = React26.useState(false);
8164
+ const [isOpen, setIsOpen] = React26.useState(false);
8165
+ const [month, setMonth2] = React26.useState(/* @__PURE__ */ new Date());
8166
+ const [currentValue, setCurrentValue] = useControllableState({
8167
+ prop: value,
8168
+ defaultProp: defaultValue ?? null
8169
+ });
8170
+ const canClear = allowClear && !!currentValue && !disabled && !readOnly;
8171
+ const showPicker2 = !disabled && !readOnly;
8172
+ const handleChange = (event) => {
8173
+ const newValue = event.target.value;
8174
+ setInputValue(newValue);
8175
+ onChange?.(event);
8176
+ const parsedDate = parseDate(newValue);
8177
+ if (parsedDate !== null || !newValue.trim()) {
8178
+ onValueChange?.(parsedDate);
8179
+ }
8180
+ };
8181
+ const handleFocus = (event) => {
8182
+ const formatted = formatDate(currentValue, "");
8183
+ setInputValue(formatted);
8184
+ setHasFocus(true);
8185
+ onFocus?.(event);
8186
+ };
8187
+ const handleBlur = (event) => {
8188
+ setHasFocus(false);
8189
+ onBlur?.(event);
8190
+ const text = event.target.value;
8191
+ const parsedDate = text === formatDate(currentValue, "") ? currentValue : parseDate(text);
8192
+ onValueBlur?.(parsedDate);
8193
+ setCurrentValue(parsedDate);
8194
+ };
8195
+ const handleDatePickerChange = (newValue) => {
8196
+ const dateValue = newValue ?? null;
8197
+ setCurrentValue(dateValue);
8198
+ onValueChange?.(dateValue);
8199
+ setHasFocus(false);
8200
+ setIsOpen(false);
8201
+ };
8202
+ const handleClear = () => {
8203
+ if (!inputRef.current) return;
8204
+ inputRef.current.value = "";
8205
+ setInputValue("");
8206
+ setCurrentValue(null);
8207
+ onValueChange?.(null);
8208
+ onChange?.(createChangeInputEvent(inputRef.current));
8209
+ };
8210
+ const handleOpenChange = (open) => {
8211
+ if (open) {
8212
+ setMonth2(currentValue ?? /* @__PURE__ */ new Date());
8213
+ }
8214
+ setIsOpen(open);
8215
+ };
8216
+ const displayValue = hasFocus ? inputValue : formatDate(currentValue, "");
8217
+ return /* @__PURE__ */ jsxRuntime.jsxs(
8218
+ InputGroup,
8219
+ {
8220
+ state,
8221
+ variant,
8222
+ sizing,
8223
+ focusVariant,
8224
+ className,
8225
+ children: [
8226
+ /* @__PURE__ */ jsxRuntime.jsx(
8227
+ InputGroup.Input,
8228
+ {
8229
+ ...restInputProps,
8230
+ ref: mergeRefs(ref ?? null, inputRef),
8231
+ type: "text",
8232
+ value: displayValue,
8233
+ placeholder,
8234
+ onChange: handleChange,
8235
+ onFocus: handleFocus,
8236
+ onBlur: handleBlur,
8237
+ disabled,
8238
+ readOnly
8239
+ }
8240
+ ),
8241
+ (canClear || showPicker2) && /* @__PURE__ */ jsxRuntime.jsxs(InputGroup.Addon, { align: "inline-end", children: [
8242
+ canClear && /* @__PURE__ */ jsxRuntime.jsx(
8243
+ InputGroup.Button,
8244
+ {
8245
+ "aria-label": "Clear date",
8246
+ onMouseDown: (event) => event.preventDefault(),
8247
+ onClick: handleClear,
8248
+ children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.X, { className: "tw-size-4" })
8249
+ }
8250
+ ),
8251
+ showPicker2 && /* @__PURE__ */ jsxRuntime.jsx(
8252
+ DatePicker,
8253
+ {
8254
+ disabled: disabledDays,
8255
+ endMonth,
8256
+ mode: "single",
8257
+ month,
8258
+ onMonthChange: setMonth2,
8259
+ onOpenChange: handleOpenChange,
8260
+ onSelect: handleDatePickerChange,
8261
+ open: isOpen,
8262
+ selected: currentValue ?? void 0,
8263
+ startMonth,
8264
+ children: /* @__PURE__ */ jsxRuntime.jsx(InputGroup.Button, { "aria-label": "Select Date", children: /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Calendar, { className: "tw-size-4" }) })
8265
+ }
8266
+ )
8267
+ ] })
8268
+ ]
8269
+ }
8270
+ );
8247
8271
  };
8248
8272
  var DateWidget = ({
8249
8273
  id,
@@ -8344,13 +8368,7 @@ var BadgeAddon = ({
8344
8368
  className: cn(addonVariants2({ align, variant, className }))
8345
8369
  }
8346
8370
  );
8347
- var BadgeButton = ({
8348
- ref,
8349
- className,
8350
- type = "button",
8351
- children,
8352
- ...rest
8353
- }) => /* @__PURE__ */ jsxRuntime.jsx(
8371
+ var BadgeButton = ({ ref, className, type = "button", children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(
8354
8372
  "button",
8355
8373
  {
8356
8374
  ...rest,
@@ -8375,12 +8393,7 @@ var BadgeButton = ({
8375
8393
  children
8376
8394
  }
8377
8395
  );
8378
- var BadgeLabel = ({
8379
- ref,
8380
- className,
8381
- asChild = false,
8382
- ...rest
8383
- }) => {
8396
+ var BadgeLabel = ({ ref, className, asChild = false, ...rest }) => {
8384
8397
  const Comp = asChild ? reactSlot.Slot : "span";
8385
8398
  return /* @__PURE__ */ jsxRuntime.jsx(
8386
8399
  Comp,
@@ -8406,7 +8419,7 @@ var BadgeLabel = ({
8406
8419
  var badgeColors = {
8407
8420
  gray: "tw-bg-neutral-400 tw-text-white tw-decoration-neutral-400",
8408
8421
  "gray-darker": "tw-bg-neutral-500 tw-text-white tw-decoration-neutral-500",
8409
- "gray-inverse": "tw-bg-neutral-100 tw-text-neutral-500 tw-decoration-neutral-100 [[data-theme=dark]_&]:tw-bg-neutral-800 [[data-theme=dark]_&]:tw-text-neutral-300 [[data-theme=dark]_&]:tw-decoration-neutral-800",
8422
+ "gray-inverse": "tw-bg-neutral-100 tw-text-neutral-500 tw-decoration-neutral-100 [[data-theme=dark]_&]:tw-bg-neutral-700 [[data-theme=dark]_&]:tw-text-neutral-300 [[data-theme=dark]_&]:tw-decoration-neutral-700",
8410
8423
  green: "tw-bg-green-500 tw-text-white tw-decoration-green-500",
8411
8424
  "green-darker": "tw-bg-green-600 tw-text-white tw-decoration-green-600",
8412
8425
  "green-inverse": "tw-bg-green-100 tw-text-green-900 tw-decoration-green-100 [[data-theme=dark]_&]:tw-bg-green-900 [[data-theme=dark]_&]:tw-text-green-200 [[data-theme=dark]_&]:tw-decoration-green-900",
@@ -8474,14 +8487,7 @@ var badgeRootVariants = classVarianceAuthority.cva(
8474
8487
  }
8475
8488
  }
8476
8489
  );
8477
- var BadgeRoot = ({
8478
- ref,
8479
- variant,
8480
- color,
8481
- className,
8482
- children,
8483
- ...rest
8484
- }) => /* @__PURE__ */ jsxRuntime.jsx(
8490
+ var BadgeRoot = ({ ref, variant, color, className, children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(
8485
8491
  "div",
8486
8492
  {
8487
8493
  ...rest,
@@ -8684,11 +8690,7 @@ var ComboboxContent = ({
8684
8690
  }
8685
8691
  ) });
8686
8692
  };
8687
- var ComboboxEmpty = ({
8688
- ref,
8689
- className,
8690
- ...props
8691
- }) => /* @__PURE__ */ jsxRuntime.jsx(
8693
+ var ComboboxEmpty = ({ ref, className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
8692
8694
  combobox.Combobox.Empty,
8693
8695
  {
8694
8696
  ref,
@@ -8732,12 +8734,7 @@ var ComboboxInputGroup = ({
8732
8734
  )
8733
8735
  }
8734
8736
  );
8735
- var ComboboxItemIndicator = ({
8736
- ref,
8737
- className,
8738
- variant = "check",
8739
- ...props
8740
- }) => {
8737
+ var ComboboxItemIndicator = ({ ref, className, variant = "check", ...props }) => {
8741
8738
  if (variant === "checkbox") {
8742
8739
  return /* @__PURE__ */ jsxRuntime.jsx(
8743
8740
  combobox.Combobox.ItemIndicator,
@@ -8850,11 +8847,7 @@ var ComboboxItem = ({
8850
8847
  ]
8851
8848
  }
8852
8849
  );
8853
- var ComboboxList = ({
8854
- ref,
8855
- className,
8856
- ...props
8857
- }) => /* @__PURE__ */ jsxRuntime.jsx(
8850
+ var ComboboxList = ({ ref, className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
8858
8851
  combobox.Combobox.List,
8859
8852
  {
8860
8853
  ref,
@@ -8874,11 +8867,7 @@ var ComboboxList = ({
8874
8867
  }
8875
8868
  );
8876
8869
  var ComboboxRoot = (props) => /* @__PURE__ */ jsxRuntime.jsx(combobox.Combobox.Root, { ...props });
8877
- var ComboboxSeparator = ({
8878
- ref,
8879
- className,
8880
- ...props
8881
- }) => /* @__PURE__ */ jsxRuntime.jsx(
8870
+ var ComboboxSeparator = ({ ref, className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
8882
8871
  combobox.Combobox.Separator,
8883
8872
  {
8884
8873
  ref,
@@ -8886,12 +8875,7 @@ var ComboboxSeparator = ({
8886
8875
  ...props
8887
8876
  }
8888
8877
  );
8889
- var ComboboxGroup = ({
8890
- ref,
8891
- className,
8892
- children,
8893
- ...props
8894
- }) => /* @__PURE__ */ jsxRuntime.jsx(
8878
+ var ComboboxGroup = ({ ref, className, children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
8895
8879
  combobox.Combobox.Group,
8896
8880
  {
8897
8881
  ref,
@@ -8900,11 +8884,7 @@ var ComboboxGroup = ({
8900
8884
  children
8901
8885
  }
8902
8886
  );
8903
- var ComboboxGroupLabel = ({
8904
- ref,
8905
- className,
8906
- ...props
8907
- }) => /* @__PURE__ */ jsxRuntime.jsx(
8887
+ var ComboboxGroupLabel = ({ ref, className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
8908
8888
  combobox.Combobox.GroupLabel,
8909
8889
  {
8910
8890
  ...props,
@@ -9198,6 +9178,7 @@ var PasswordInput = ({
9198
9178
  onMouseDown,
9199
9179
  allowClear = false,
9200
9180
  allowPasswordToggle = false,
9181
+ passwordToggleLabel,
9201
9182
  autoComplete = "new-password",
9202
9183
  defaultPasswordVisibility = false,
9203
9184
  // input props
@@ -9206,13 +9187,12 @@ var PasswordInput = ({
9206
9187
  ...restInputProps
9207
9188
  }) => {
9208
9189
  const inputRef = React26.useRef(null);
9209
- const [internalValue, setInternalValue] = React26.useState(defaultValue ?? "");
9210
- const isControlled = valueProp !== void 0;
9211
- const value = isControlled ? valueProp ?? "" : internalValue;
9212
- const setValue = (next) => {
9213
- if (!isControlled) setInternalValue(next);
9214
- onValueChange?.(next);
9215
- };
9190
+ const [value, setValue] = useControllableState({
9191
+ // A `null` controlled value stays controlled (coerced to ''); `undefined` is uncontrolled.
9192
+ prop: valueProp === null ? "" : valueProp,
9193
+ defaultProp: defaultValue ?? "",
9194
+ onChange: onValueChange
9195
+ });
9216
9196
  const [capsLock, setCapsLock] = React26.useState(false);
9217
9197
  const [isPasswordVisible, setIsPasswordVisible] = React26.useState(defaultPasswordVisibility);
9218
9198
  const canClear = allowClear && !!value && !disabled && !readOnly;
@@ -9289,7 +9269,7 @@ var PasswordInput = ({
9289
9269
  allowPasswordToggle && /* @__PURE__ */ jsxRuntime.jsx(
9290
9270
  InputGroup.Button,
9291
9271
  {
9292
- "aria-label": isPasswordVisible ? "Hide password" : "Show password",
9272
+ "aria-label": `${isPasswordVisible ? "Hide password" : "Show password"}${passwordToggleLabel ? `: ${passwordToggleLabel}` : ""}`,
9293
9273
  onMouseDown: (event) => event.preventDefault(),
9294
9274
  onClick: handleTogglePasswordVisibility,
9295
9275
  children: isPasswordVisible ? /* @__PURE__ */ jsxRuntime.jsx(icons_exports.EyeOff, { className: "tw-size-4" }) : /* @__PURE__ */ jsxRuntime.jsx(icons_exports.Eye, { className: "tw-size-4" })
@@ -10036,6 +10016,10 @@ var generateUiSchema = (schema, readOnly = false, definitions, globalConfig, has
10036
10016
  ...arrayOpts
10037
10017
  };
10038
10018
  }
10019
+ const itemsEnumTitles = propSchema.items?.options?.enum_titles;
10020
+ if (Array.isArray(itemsEnumTitles)) {
10021
+ fieldUi.items = { "ui:options": { enumNames: itemsEnumTitles } };
10022
+ }
10039
10023
  }
10040
10024
  if (type === "object" && propSchema.properties) {
10041
10025
  const nestedGlobal = globalValue && typeof globalValue === "object" && !Array.isArray(globalValue) ? globalValue : void 0;