@keboola/design 4.2.1 → 4.3.1
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/AGENTS.md +1 -1
- package/COMPONENT-API.md +166 -1
- package/dist/editors.cjs +3 -0
- package/dist/editors.cjs.map +1 -1
- package/dist/editors.js +3 -0
- package/dist/editors.js.map +1 -1
- package/dist/index.cjs +239 -196
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +478 -442
- package/dist/index.d.ts +478 -442
- package/dist/index.js +239 -197
- package/dist/index.js.map +1 -1
- package/dist/markdown-editor.cjs +3 -0
- package/dist/markdown-editor.cjs.map +1 -1
- package/dist/markdown-editor.js +3 -0
- package/dist/markdown-editor.js.map +1 -1
- package/dist/mermaid.cjs +3 -0
- package/dist/mermaid.cjs.map +1 -1
- package/dist/mermaid.js +3 -0
- package/dist/mermaid.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/testing.cjs +75 -2
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.js +75 -2
- package/dist/testing.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1618,6 +1618,9 @@ var argoVariants = cva(
|
|
|
1618
1618
|
outline: [
|
|
1619
1619
|
"!tw-border-input",
|
|
1620
1620
|
"tw-bg-background",
|
|
1621
|
+
// Semantic base text color so the label/icon flips in dark mode
|
|
1622
|
+
// (matches `invisible`); previously unset → inherited a fixed dark color.
|
|
1623
|
+
"tw-text-foreground",
|
|
1621
1624
|
"hover:not-disabled:tw-bg-accent",
|
|
1622
1625
|
"hover:not-disabled:tw-text-accent-foreground",
|
|
1623
1626
|
"hover:active:tw-bg-background",
|
|
@@ -9322,198 +9325,6 @@ var TextInput = ({
|
|
|
9322
9325
|
}
|
|
9323
9326
|
);
|
|
9324
9327
|
};
|
|
9325
|
-
var TimePickerButton = ({
|
|
9326
|
-
ref,
|
|
9327
|
-
className,
|
|
9328
|
-
children,
|
|
9329
|
-
...rest
|
|
9330
|
-
}) => /* @__PURE__ */ jsx(
|
|
9331
|
-
"button",
|
|
9332
|
-
{
|
|
9333
|
-
...rest,
|
|
9334
|
-
ref,
|
|
9335
|
-
type: "button",
|
|
9336
|
-
className: cn(
|
|
9337
|
-
"tailwindcss-preflight",
|
|
9338
|
-
"tw-flex",
|
|
9339
|
-
"tw-items-center",
|
|
9340
|
-
"tw-justify-center",
|
|
9341
|
-
"tw-size-10",
|
|
9342
|
-
"tw-rounded",
|
|
9343
|
-
"tw-transition-colors",
|
|
9344
|
-
"tw-select-none",
|
|
9345
|
-
"hover:tw-bg-accent",
|
|
9346
|
-
"focus-visible:tw-outline",
|
|
9347
|
-
"focus-visible:tw-outline-2",
|
|
9348
|
-
"focus-visible:tw-outline-primary",
|
|
9349
|
-
"aria-selected:tw-bg-primary",
|
|
9350
|
-
"aria-selected:tw-text-primary-foreground",
|
|
9351
|
-
className
|
|
9352
|
-
),
|
|
9353
|
-
children
|
|
9354
|
-
}
|
|
9355
|
-
);
|
|
9356
|
-
|
|
9357
|
-
// src/components/TimePicker/utils.ts
|
|
9358
|
-
var pad = (n) => n.toString().padStart(2, "0");
|
|
9359
|
-
var parseTime = (time) => {
|
|
9360
|
-
if (!time) return { hour: null, minute: null };
|
|
9361
|
-
const match2 = /^(\d{1,2}):(\d{1,2})$/.exec(time.trim());
|
|
9362
|
-
if (!match2) return { hour: null, minute: null };
|
|
9363
|
-
const hour = Number(match2[1]);
|
|
9364
|
-
const minute = Number(match2[2]);
|
|
9365
|
-
if (Number.isNaN(hour) || Number.isNaN(minute) || hour < 0 || hour > 23 || minute < 0 || minute > 59)
|
|
9366
|
-
return { hour: null, minute: null };
|
|
9367
|
-
return { hour, minute };
|
|
9368
|
-
};
|
|
9369
|
-
var scrollToSelected = (viewport) => {
|
|
9370
|
-
if (!viewport) return;
|
|
9371
|
-
requestAnimationFrame(() => {
|
|
9372
|
-
const selected = viewport.querySelector('[aria-selected="true"]');
|
|
9373
|
-
selected?.scrollIntoView({ block: "center" });
|
|
9374
|
-
});
|
|
9375
|
-
};
|
|
9376
|
-
var HOURS = Array.from({ length: 24 }, (_, i) => i);
|
|
9377
|
-
var MINUTES = Array.from({ length: 60 }, (_, i) => i);
|
|
9378
|
-
var TimePicker = ({
|
|
9379
|
-
align = "end",
|
|
9380
|
-
alignOffset = -18,
|
|
9381
|
-
children,
|
|
9382
|
-
defaultOpen,
|
|
9383
|
-
defaultSelected,
|
|
9384
|
-
onOpenChange,
|
|
9385
|
-
onSelect,
|
|
9386
|
-
open,
|
|
9387
|
-
selected,
|
|
9388
|
-
sideOffset = 12
|
|
9389
|
-
}) => {
|
|
9390
|
-
const [internalSelected, setInternalSelected] = useState(defaultSelected ?? null);
|
|
9391
|
-
const isControlled = selected !== void 0;
|
|
9392
|
-
const currentValue = isControlled ? selected : internalSelected;
|
|
9393
|
-
const parsed = parseTime(currentValue);
|
|
9394
|
-
const hour = parsed.hour ?? null;
|
|
9395
|
-
const minute = parsed.minute ?? null;
|
|
9396
|
-
const handleSelect = (time) => {
|
|
9397
|
-
if (!isControlled) {
|
|
9398
|
-
setInternalSelected(time);
|
|
9399
|
-
}
|
|
9400
|
-
onSelect?.(time);
|
|
9401
|
-
};
|
|
9402
|
-
const handleHourSelect = (h) => {
|
|
9403
|
-
const m = minute ?? 0;
|
|
9404
|
-
handleSelect(`${pad(h)}:${pad(m)}`);
|
|
9405
|
-
};
|
|
9406
|
-
const handleMinuteSelect = (m) => {
|
|
9407
|
-
const h = hour ?? 0;
|
|
9408
|
-
handleSelect(`${pad(h)}:${pad(m)}`);
|
|
9409
|
-
};
|
|
9410
|
-
return /* @__PURE__ */ jsxs(Popover, { defaultOpen, onOpenChange, open, children: [
|
|
9411
|
-
/* @__PURE__ */ jsx(Popover.Trigger, { asChild: true, children }),
|
|
9412
|
-
/* @__PURE__ */ jsxs(
|
|
9413
|
-
Popover.Content,
|
|
9414
|
-
{
|
|
9415
|
-
align,
|
|
9416
|
-
alignOffset,
|
|
9417
|
-
sideOffset,
|
|
9418
|
-
className: "tw-flex tw-flex-row",
|
|
9419
|
-
children: [
|
|
9420
|
-
/* @__PURE__ */ jsx(ScrollArea, { type: "always", ref: scrollToSelected, viewPortClassName: "tw-h-60 tw-px-3", children: HOURS.map((value) => /* @__PURE__ */ jsx(
|
|
9421
|
-
TimePickerButton,
|
|
9422
|
-
{
|
|
9423
|
-
onClick: () => handleHourSelect(value),
|
|
9424
|
-
"aria-selected": value === hour,
|
|
9425
|
-
children: pad(value)
|
|
9426
|
-
},
|
|
9427
|
-
value
|
|
9428
|
-
)) }),
|
|
9429
|
-
/* @__PURE__ */ jsx(ScrollArea, { type: "always", ref: scrollToSelected, viewPortClassName: "tw-h-60 tw-px-3", children: MINUTES.map((value) => /* @__PURE__ */ jsx(
|
|
9430
|
-
TimePickerButton,
|
|
9431
|
-
{
|
|
9432
|
-
onClick: () => handleMinuteSelect(value),
|
|
9433
|
-
"aria-selected": value === minute,
|
|
9434
|
-
children: pad(value)
|
|
9435
|
-
},
|
|
9436
|
-
value
|
|
9437
|
-
)) })
|
|
9438
|
-
]
|
|
9439
|
-
}
|
|
9440
|
-
)
|
|
9441
|
-
] });
|
|
9442
|
-
};
|
|
9443
|
-
var TimeInput = ({
|
|
9444
|
-
ref,
|
|
9445
|
-
defaultValue,
|
|
9446
|
-
disabled,
|
|
9447
|
-
onBlur,
|
|
9448
|
-
onChange,
|
|
9449
|
-
onValueBlur,
|
|
9450
|
-
onValueChange,
|
|
9451
|
-
placeholder = "Select time",
|
|
9452
|
-
readOnly,
|
|
9453
|
-
value,
|
|
9454
|
-
variant,
|
|
9455
|
-
className,
|
|
9456
|
-
...props
|
|
9457
|
-
}) => {
|
|
9458
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
9459
|
-
const [internalValue, setInternalValue] = useState(defaultValue ?? null);
|
|
9460
|
-
const isControlled = value !== void 0;
|
|
9461
|
-
const currentValue = isControlled ? value : internalValue;
|
|
9462
|
-
const handleChange = (event) => {
|
|
9463
|
-
const newValue = event.target.value || null;
|
|
9464
|
-
onChange?.(event);
|
|
9465
|
-
onValueChange?.(newValue);
|
|
9466
|
-
if (!isControlled) {
|
|
9467
|
-
setInternalValue(newValue);
|
|
9468
|
-
}
|
|
9469
|
-
};
|
|
9470
|
-
const handleBlur = (event) => {
|
|
9471
|
-
const newValue = event.target.value || null;
|
|
9472
|
-
onBlur?.(event);
|
|
9473
|
-
onValueBlur?.(newValue);
|
|
9474
|
-
if (!isControlled) {
|
|
9475
|
-
setInternalValue(newValue);
|
|
9476
|
-
}
|
|
9477
|
-
};
|
|
9478
|
-
const handleTimePickerSelect = (time) => {
|
|
9479
|
-
if (!isControlled) setInternalValue(time);
|
|
9480
|
-
onValueChange?.(time);
|
|
9481
|
-
};
|
|
9482
|
-
const handleClear = () => {
|
|
9483
|
-
if (!isControlled) setInternalValue(null);
|
|
9484
|
-
onValueChange?.(null);
|
|
9485
|
-
};
|
|
9486
|
-
const handleOpenChange = (open) => {
|
|
9487
|
-
setIsOpen(open);
|
|
9488
|
-
};
|
|
9489
|
-
return /* @__PURE__ */ jsx(
|
|
9490
|
-
Input,
|
|
9491
|
-
{
|
|
9492
|
-
...props,
|
|
9493
|
-
ref,
|
|
9494
|
-
type: "time",
|
|
9495
|
-
disabled,
|
|
9496
|
-
readOnly,
|
|
9497
|
-
placeholder,
|
|
9498
|
-
className: cn("[&_input::-webkit-calendar-picker-indicator]:tw-hidden", className),
|
|
9499
|
-
value: currentValue,
|
|
9500
|
-
variant,
|
|
9501
|
-
onChange: handleChange,
|
|
9502
|
-
onBlur: handleBlur,
|
|
9503
|
-
onClear: currentValue ? handleClear : void 0,
|
|
9504
|
-
rightSuffix: !disabled && !readOnly ? /* @__PURE__ */ jsx(
|
|
9505
|
-
TimePicker,
|
|
9506
|
-
{
|
|
9507
|
-
open: isOpen,
|
|
9508
|
-
onOpenChange: handleOpenChange,
|
|
9509
|
-
onSelect: handleTimePickerSelect,
|
|
9510
|
-
selected: currentValue,
|
|
9511
|
-
children: /* @__PURE__ */ jsx(Button, { "aria-label": "Select Time", variant: "inline", size: "icon-3xs", children: /* @__PURE__ */ jsx(icons_exports.Clock, { className: "tw-size-4" }) })
|
|
9512
|
-
}
|
|
9513
|
-
) : void 0
|
|
9514
|
-
}
|
|
9515
|
-
);
|
|
9516
|
-
};
|
|
9517
9328
|
var CommandInput = ({
|
|
9518
9329
|
ref,
|
|
9519
9330
|
className,
|
|
@@ -9772,6 +9583,97 @@ var DateRangePicker = ({
|
|
|
9772
9583
|
] }) })
|
|
9773
9584
|
] });
|
|
9774
9585
|
DateRangePicker.displayName = "DateRangePicker";
|
|
9586
|
+
|
|
9587
|
+
// src/components/TimePicker/utils.ts
|
|
9588
|
+
var pad = (n) => n.toString().padStart(2, "0");
|
|
9589
|
+
var parseTime = (time) => {
|
|
9590
|
+
if (!time) return { hour: null, minute: null };
|
|
9591
|
+
const match2 = /^(\d{1,2}):(\d{1,2})$/.exec(time.trim());
|
|
9592
|
+
if (!match2) return { hour: null, minute: null };
|
|
9593
|
+
const hour = Number(match2[1]);
|
|
9594
|
+
const minute = Number(match2[2]);
|
|
9595
|
+
if (Number.isNaN(hour) || Number.isNaN(minute) || hour < 0 || hour > 23 || minute < 0 || minute > 59)
|
|
9596
|
+
return { hour: null, minute: null };
|
|
9597
|
+
return { hour, minute };
|
|
9598
|
+
};
|
|
9599
|
+
var scrollToSelected = (viewport) => {
|
|
9600
|
+
if (!viewport) return;
|
|
9601
|
+
requestAnimationFrame(() => {
|
|
9602
|
+
const selected = viewport.querySelector('[aria-pressed="true"]');
|
|
9603
|
+
selected?.scrollIntoView({ block: "center" });
|
|
9604
|
+
});
|
|
9605
|
+
};
|
|
9606
|
+
var HOURS = Array.from({ length: 24 }, (_, i) => i);
|
|
9607
|
+
var MINUTES = Array.from({ length: 60 }, (_, i) => i);
|
|
9608
|
+
var TimePicker = ({
|
|
9609
|
+
align = "end",
|
|
9610
|
+
alignOffset = -18,
|
|
9611
|
+
children,
|
|
9612
|
+
defaultOpen,
|
|
9613
|
+
defaultSelected,
|
|
9614
|
+
onOpenChange,
|
|
9615
|
+
onSelect,
|
|
9616
|
+
open,
|
|
9617
|
+
selected,
|
|
9618
|
+
sideOffset = 12
|
|
9619
|
+
}) => {
|
|
9620
|
+
const [internalSelected, setInternalSelected] = useState(defaultSelected ?? null);
|
|
9621
|
+
const isControlled = selected !== void 0;
|
|
9622
|
+
const currentValue = isControlled ? selected : internalSelected;
|
|
9623
|
+
const parsed = parseTime(currentValue);
|
|
9624
|
+
const hour = parsed.hour ?? null;
|
|
9625
|
+
const minute = parsed.minute ?? null;
|
|
9626
|
+
const handleSelect = (time) => {
|
|
9627
|
+
if (!isControlled) {
|
|
9628
|
+
setInternalSelected(time);
|
|
9629
|
+
}
|
|
9630
|
+
onSelect?.(time);
|
|
9631
|
+
};
|
|
9632
|
+
const handleHourSelect = (h) => {
|
|
9633
|
+
const m = minute ?? 0;
|
|
9634
|
+
handleSelect(`${pad(h)}:${pad(m)}`);
|
|
9635
|
+
};
|
|
9636
|
+
const handleMinuteSelect = (m) => {
|
|
9637
|
+
const h = hour ?? 0;
|
|
9638
|
+
handleSelect(`${pad(h)}:${pad(m)}`);
|
|
9639
|
+
};
|
|
9640
|
+
return /* @__PURE__ */ jsxs(Popover, { defaultOpen, onOpenChange, open, children: [
|
|
9641
|
+
/* @__PURE__ */ jsx(Popover.Trigger, { asChild: true, children }),
|
|
9642
|
+
/* @__PURE__ */ jsxs(
|
|
9643
|
+
Popover.Content,
|
|
9644
|
+
{
|
|
9645
|
+
align,
|
|
9646
|
+
alignOffset,
|
|
9647
|
+
sideOffset,
|
|
9648
|
+
className: "tw-flex tw-flex-row",
|
|
9649
|
+
children: [
|
|
9650
|
+
/* @__PURE__ */ jsx(ScrollArea, { type: "always", ref: scrollToSelected, viewPortClassName: "tw-h-60 tw-p-3", children: HOURS.map((value) => /* @__PURE__ */ jsx(
|
|
9651
|
+
Toggle,
|
|
9652
|
+
{
|
|
9653
|
+
variant: "ghost",
|
|
9654
|
+
className: "tw-size-10 tw-p-0",
|
|
9655
|
+
pressed: value === hour,
|
|
9656
|
+
onPressedChange: () => handleHourSelect(value),
|
|
9657
|
+
children: pad(value)
|
|
9658
|
+
},
|
|
9659
|
+
value
|
|
9660
|
+
)) }),
|
|
9661
|
+
/* @__PURE__ */ jsx(ScrollArea, { type: "always", ref: scrollToSelected, viewPortClassName: "tw-h-60 tw-p-3", children: MINUTES.map((value) => /* @__PURE__ */ jsx(
|
|
9662
|
+
Toggle,
|
|
9663
|
+
{
|
|
9664
|
+
variant: "ghost",
|
|
9665
|
+
className: "tw-size-10 tw-p-0",
|
|
9666
|
+
pressed: value === minute,
|
|
9667
|
+
onPressedChange: () => handleMinuteSelect(value),
|
|
9668
|
+
children: pad(value)
|
|
9669
|
+
},
|
|
9670
|
+
value
|
|
9671
|
+
)) })
|
|
9672
|
+
]
|
|
9673
|
+
}
|
|
9674
|
+
)
|
|
9675
|
+
] });
|
|
9676
|
+
};
|
|
9775
9677
|
var Optional = ({ className }) => /* @__PURE__ */ jsx("span", { className: cn("tw-text-muted-foreground", className), children: "(optional)" });
|
|
9776
9678
|
var Label2 = ({ className, children, id, htmlFor, ...rest }) => {
|
|
9777
9679
|
return /* @__PURE__ */ jsx(
|
|
@@ -11093,10 +10995,10 @@ var variants4 = cva(
|
|
|
11093
10995
|
]
|
|
11094
10996
|
},
|
|
11095
10997
|
sizing: {
|
|
11096
|
-
// border-inclusive heights: 40 / 36 /
|
|
10998
|
+
// border-inclusive heights: 40 / 36 / 32 px (small matches Button small)
|
|
11097
10999
|
default: ["tw-px-4", "tw-py-2.5", "tw-text-sm/[18px]", "tw-h-10", "tw-min-h-10"],
|
|
11098
11000
|
medium: ["tw-px-4", "tw-py-2", "tw-text-sm/[18px]", "tw-h-9", "tw-min-h-9"],
|
|
11099
|
-
small: ["tw-px-4", "tw-py-2", "tw-text-sm/[16px]", "tw-h-
|
|
11001
|
+
small: ["tw-px-4", "tw-py-2", "tw-text-sm/[16px]", "tw-h-8", "tw-min-h-8"]
|
|
11100
11002
|
},
|
|
11101
11003
|
state: {
|
|
11102
11004
|
default: [
|
|
@@ -12606,6 +12508,43 @@ var ColorInput = ({
|
|
|
12606
12508
|
}
|
|
12607
12509
|
);
|
|
12608
12510
|
};
|
|
12511
|
+
var OPTIONS = [
|
|
12512
|
+
{ value: "light", label: "Light", icon: icons_exports.Sun },
|
|
12513
|
+
{ value: "dark", label: "Dark", icon: icons_exports.Moon },
|
|
12514
|
+
{ value: "system", label: "System", icon: icons_exports.Monitor }
|
|
12515
|
+
];
|
|
12516
|
+
var triggerSizeMap = { small: "icon-sm", medium: "icon" };
|
|
12517
|
+
var ColorModeSwitch = ({ value, onValueChange, size = "small", className }) => {
|
|
12518
|
+
const active = OPTIONS.find((option) => option.value === value);
|
|
12519
|
+
const ActiveIcon = active?.icon ?? icons_exports.Monitor;
|
|
12520
|
+
const activeLabel = active?.label ?? "System";
|
|
12521
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
12522
|
+
/* @__PURE__ */ jsx(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
12523
|
+
Button,
|
|
12524
|
+
{
|
|
12525
|
+
type: "button",
|
|
12526
|
+
variant: "outline",
|
|
12527
|
+
size: triggerSizeMap[size],
|
|
12528
|
+
"aria-label": `Color mode: ${activeLabel}`,
|
|
12529
|
+
title: `Color mode: ${activeLabel}`,
|
|
12530
|
+
className,
|
|
12531
|
+
children: /* @__PURE__ */ jsx(ActiveIcon, { className: "tw-size-4" })
|
|
12532
|
+
}
|
|
12533
|
+
) }),
|
|
12534
|
+
/* @__PURE__ */ jsx(DropdownMenu.Content, { align: "end", children: /* @__PURE__ */ jsx(DropdownMenu.RadioGroup, { value, onValueChange, children: OPTIONS.map(({ value: option, label, icon: Icon2 }) => /* @__PURE__ */ jsx(
|
|
12535
|
+
DropdownMenu.RadioItem,
|
|
12536
|
+
{
|
|
12537
|
+
value: option,
|
|
12538
|
+
icon: /* @__PURE__ */ jsx(Icon2, {}),
|
|
12539
|
+
indicator: "check",
|
|
12540
|
+
indicatorAlign: "end",
|
|
12541
|
+
closeOnSelect: true,
|
|
12542
|
+
children: label
|
|
12543
|
+
},
|
|
12544
|
+
option
|
|
12545
|
+
)) }) })
|
|
12546
|
+
] });
|
|
12547
|
+
};
|
|
12609
12548
|
var toNumberOrNull = (event) => Number.isNaN(event.target.valueAsNumber) ? null : event.target.valueAsNumber;
|
|
12610
12549
|
var NumberInput = ({
|
|
12611
12550
|
ref,
|
|
@@ -12782,6 +12721,107 @@ var PasswordInput = ({
|
|
|
12782
12721
|
}
|
|
12783
12722
|
);
|
|
12784
12723
|
};
|
|
12724
|
+
var TimeInput = ({
|
|
12725
|
+
ref,
|
|
12726
|
+
// group props
|
|
12727
|
+
state,
|
|
12728
|
+
variant,
|
|
12729
|
+
focusVariant,
|
|
12730
|
+
sizing,
|
|
12731
|
+
className,
|
|
12732
|
+
// own props
|
|
12733
|
+
value: valueProp,
|
|
12734
|
+
defaultValue,
|
|
12735
|
+
onValueChange,
|
|
12736
|
+
onValueBlur,
|
|
12737
|
+
onChange,
|
|
12738
|
+
onBlur,
|
|
12739
|
+
allowClear = false,
|
|
12740
|
+
// input props
|
|
12741
|
+
disabled,
|
|
12742
|
+
readOnly,
|
|
12743
|
+
placeholder = "Select time",
|
|
12744
|
+
...restInputProps
|
|
12745
|
+
}) => {
|
|
12746
|
+
const inputRef = useRef(null);
|
|
12747
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
12748
|
+
const [internalValue, setInternalValue] = useState(defaultValue ?? null);
|
|
12749
|
+
const isControlled = valueProp !== void 0;
|
|
12750
|
+
const value = isControlled ? valueProp ?? null : internalValue;
|
|
12751
|
+
const setValue = (next) => {
|
|
12752
|
+
if (!isControlled) setInternalValue(next);
|
|
12753
|
+
onValueChange?.(next);
|
|
12754
|
+
};
|
|
12755
|
+
const canClear = allowClear && !!value && !disabled && !readOnly;
|
|
12756
|
+
const showPicker2 = !disabled && !readOnly;
|
|
12757
|
+
const handleChange = (event) => {
|
|
12758
|
+
setValue(event.target.value || null);
|
|
12759
|
+
onChange?.(event);
|
|
12760
|
+
};
|
|
12761
|
+
const handleBlur = (event) => {
|
|
12762
|
+
const newValue = event.target.value || null;
|
|
12763
|
+
if (!isControlled) setInternalValue(newValue);
|
|
12764
|
+
onValueBlur?.(newValue);
|
|
12765
|
+
onBlur?.(event);
|
|
12766
|
+
};
|
|
12767
|
+
const handleTimePickerSelect = (time) => {
|
|
12768
|
+
setValue(time);
|
|
12769
|
+
};
|
|
12770
|
+
const handleClear = () => {
|
|
12771
|
+
if (!inputRef.current) return;
|
|
12772
|
+
inputRef.current.value = "";
|
|
12773
|
+
setValue(null);
|
|
12774
|
+
onChange?.(createChangeInputEvent(inputRef.current));
|
|
12775
|
+
};
|
|
12776
|
+
return /* @__PURE__ */ jsxs(
|
|
12777
|
+
InputGroup,
|
|
12778
|
+
{
|
|
12779
|
+
state,
|
|
12780
|
+
variant,
|
|
12781
|
+
sizing,
|
|
12782
|
+
focusVariant,
|
|
12783
|
+
className,
|
|
12784
|
+
children: [
|
|
12785
|
+
/* @__PURE__ */ jsx(
|
|
12786
|
+
InputGroup.Input,
|
|
12787
|
+
{
|
|
12788
|
+
...restInputProps,
|
|
12789
|
+
ref: mergeRefs(ref ?? null, inputRef),
|
|
12790
|
+
type: "time",
|
|
12791
|
+
className: "[&::-webkit-calendar-picker-indicator]:tw-hidden [&::-webkit-datetime-edit-fields-wrapper]:tw-py-0",
|
|
12792
|
+
value: value ?? "",
|
|
12793
|
+
placeholder,
|
|
12794
|
+
onChange: handleChange,
|
|
12795
|
+
onBlur: handleBlur,
|
|
12796
|
+
disabled,
|
|
12797
|
+
readOnly
|
|
12798
|
+
}
|
|
12799
|
+
),
|
|
12800
|
+
(canClear || showPicker2) && /* @__PURE__ */ jsxs(InputGroup.Addon, { align: "inline-end", children: [
|
|
12801
|
+
canClear && /* @__PURE__ */ jsx(
|
|
12802
|
+
InputGroup.Button,
|
|
12803
|
+
{
|
|
12804
|
+
"aria-label": "Clear time",
|
|
12805
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
12806
|
+
onClick: handleClear,
|
|
12807
|
+
children: /* @__PURE__ */ jsx(icons_exports.X, { className: "tw-size-4" })
|
|
12808
|
+
}
|
|
12809
|
+
),
|
|
12810
|
+
showPicker2 && /* @__PURE__ */ jsx(
|
|
12811
|
+
TimePicker,
|
|
12812
|
+
{
|
|
12813
|
+
open: isOpen,
|
|
12814
|
+
onOpenChange: setIsOpen,
|
|
12815
|
+
onSelect: handleTimePickerSelect,
|
|
12816
|
+
selected: value,
|
|
12817
|
+
children: /* @__PURE__ */ jsx(InputGroup.Button, { "aria-label": "Select time", children: /* @__PURE__ */ jsx(icons_exports.Clock, { className: "tw-size-4" }) })
|
|
12818
|
+
}
|
|
12819
|
+
)
|
|
12820
|
+
] })
|
|
12821
|
+
]
|
|
12822
|
+
}
|
|
12823
|
+
);
|
|
12824
|
+
};
|
|
12785
12825
|
var InputOtpVariantContext = createContext({
|
|
12786
12826
|
sizing: "md",
|
|
12787
12827
|
state: "default"
|
|
@@ -17429,7 +17469,7 @@ var ThemeProvider = ({
|
|
|
17429
17469
|
}, [brand, resolvedMode]);
|
|
17430
17470
|
return /* @__PURE__ */ jsxs(ThemeContext, { value: { brand, setBrand, colorScheme, resolvedMode }, children: [
|
|
17431
17471
|
isRoot && /* @__PURE__ */ jsx(AIGradientsSvg, {}),
|
|
17432
|
-
children
|
|
17472
|
+
isRoot ? /* @__PURE__ */ jsx(TooltipProvider, { children }) : children
|
|
17433
17473
|
] });
|
|
17434
17474
|
};
|
|
17435
17475
|
var useTheme = () => {
|
|
@@ -20303,7 +20343,9 @@ var Table = ({
|
|
|
20303
20343
|
"table",
|
|
20304
20344
|
{
|
|
20305
20345
|
className: cn(
|
|
20306
|
-
|
|
20346
|
+
// `tw-text-foreground` (a semantic token) so header + cell text flips
|
|
20347
|
+
// under `[data-theme='dark']` instead of inheriting a fixed dark color.
|
|
20348
|
+
"tw-w-full tw-caption-bottom tw-text-sm tw-text-foreground",
|
|
20307
20349
|
borderCollapsed ? "tw-border-collapse" : "tw-border-separate tw-border-spacing-y-1",
|
|
20308
20350
|
className
|
|
20309
20351
|
),
|
|
@@ -22097,6 +22139,6 @@ object-assign/index.js:
|
|
|
22097
22139
|
*)
|
|
22098
22140
|
*/
|
|
22099
22141
|
|
|
22100
|
-
export { Alert, AlertModal, AnswerSummary, AppShell, AutoSaveTextarea, Avatar, Badge, Breadcrumb, Button, ButtonGroup, ButtonInline, Calendar, Card, Checkbox, Clipboard, ClipboardButton, ClipboardInline, Collapse, Collapsible, CollapsiblePanel, CollapsibleStepHeader, ColorInput, Combobox, Command, CommandGroup, CommandInput, CommandItem, CommandList, ConflictStatusIndicator, DateInput, DatePicker, DateRangeInput, DateRangePicker, DiffType, DiffView, DotsLoader, DropdownMenu, EmptyConfigurationActionCard, EmptySearchContent, EmptyState, ErrorState, FileUpload, FormGroup, FullScreenModal, FullScreenModalBody, FullScreenModalHeader, HelpBlock, HoverCard, InlineStepDetail, InlineStepLabel, InputGroup, InputOtp, Kbd, Label2 as Label, Link, MarkedText, MessageBubble, Modal, MultiActionButtonGroup, MultiCombobox, Navbar, NumberInput, PageHeader, PageLayout, PageToolbar, Pagination, PaneHeader, PanelWithDetails, PasswordInput, PlanApproval, PlanRewritingIndicator, Popconfirm, Popover, Progress, PromptInput, Question, QuestionBlock, RadioGroup2 as RadioGroup, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Search, SearchForm, SearchInput, SearchInputWithNavigation, Select2 as Select, Separator2 as Separator, Sheet, Sidebar, SidebarProvider, Skeleton, SkeletonList, Slider, SplitButton, Stepper, SuggestedPrompt, Switch, Table, Tabs2 as Tabs, TabsContent, Tagger, TextInput, Textarea, ThemeDecorator, ThemeProvider, ThinkingIndicator, TimeInput, TimePicker, Timeline, Toaster, Toggle, ToggleGroup, Tooltip, TooltipProvider, Truncated, UsageStats, UsageStatsRing, ZoomableSvg, argoVariants, cn, computeDiffRows, computeLineInformation, copyToClipboard, isMac, kbdVariants, keys, mergeRefs, resolveStorybookBrand, setServerFieldErrors, themeToolbarBrands, toast, useAppForm, useAutosizeInput, useColorScheme, useInputOtpContext, useIsLegacyBrand, useMergeDiff, useNotification, useScrollbarPosition, useSidebar, useTheme, withForm };
|
|
22142
|
+
export { Alert, AlertModal, AnswerSummary, AppShell, AutoSaveTextarea, Avatar, Badge, Breadcrumb, Button, ButtonGroup, ButtonInline, Calendar, Card, Checkbox, Clipboard, ClipboardButton, ClipboardInline, Collapse, Collapsible, CollapsiblePanel, CollapsibleStepHeader, ColorInput, ColorModeSwitch, Combobox, Command, CommandGroup, CommandInput, CommandItem, CommandList, ConflictStatusIndicator, DateInput, DatePicker, DateRangeInput, DateRangePicker, DiffType, DiffView, DotsLoader, DropdownMenu, EmptyConfigurationActionCard, EmptySearchContent, EmptyState, ErrorState, FileUpload, FormGroup, FullScreenModal, FullScreenModalBody, FullScreenModalHeader, HelpBlock, HoverCard, InlineStepDetail, InlineStepLabel, InputGroup, InputOtp, Kbd, Label2 as Label, Link, MarkedText, MessageBubble, Modal, MultiActionButtonGroup, MultiCombobox, Navbar, NumberInput, PageHeader, PageLayout, PageToolbar, Pagination, PaneHeader, PanelWithDetails, PasswordInput, PlanApproval, PlanRewritingIndicator, Popconfirm, Popover, Progress, PromptInput, Question, QuestionBlock, RadioGroup2 as RadioGroup, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Search, SearchForm, SearchInput, SearchInputWithNavigation, Select2 as Select, Separator2 as Separator, Sheet, Sidebar, SidebarProvider, Skeleton, SkeletonList, Slider, SplitButton, Stepper, SuggestedPrompt, Switch, Table, Tabs2 as Tabs, TabsContent, Tagger, TextInput, Textarea, ThemeDecorator, ThemeProvider, ThinkingIndicator, TimeInput, TimePicker, Timeline, Toaster, Toggle, ToggleGroup, Tooltip, TooltipProvider, Truncated, UsageStats, UsageStatsRing, ZoomableSvg, argoVariants, cn, computeDiffRows, computeLineInformation, copyToClipboard, isMac, kbdVariants, keys, mergeRefs, resolveStorybookBrand, setServerFieldErrors, themeToolbarBrands, toast, useAppForm, useAutosizeInput, useColorScheme, useInputOtpContext, useIsLegacyBrand, useMergeDiff, useNotification, useScrollbarPosition, useSidebar, useTheme, withForm };
|
|
22101
22143
|
//# sourceMappingURL=index.js.map
|
|
22102
22144
|
//# sourceMappingURL=index.js.map
|