@rebasepro/ui 0.24.0 → 0.24.1-canary.gcb918fc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Alert.d.ts +6 -0
- package/dist/components/Alert.es.js +82 -0
- package/dist/components/Alert.es.js.map +1 -0
- package/dist/components/Autocomplete.es.js +53 -0
- package/dist/components/Autocomplete.es.js.map +1 -0
- package/dist/components/Avatar.d.ts +3 -1
- package/dist/components/Avatar.es.js +37 -0
- package/dist/components/Avatar.es.js.map +1 -0
- package/dist/components/Badge.es.js +27 -0
- package/dist/components/Badge.es.js.map +1 -0
- package/dist/components/BooleanSwitch.es.js +75 -0
- package/dist/components/BooleanSwitch.es.js.map +1 -0
- package/dist/components/BooleanSwitchWithLabel.es.js +55 -0
- package/dist/components/BooleanSwitchWithLabel.es.js.map +1 -0
- package/dist/components/Button.es.js +58 -0
- package/dist/components/Button.es.js.map +1 -0
- package/dist/components/Card.es.js +26 -0
- package/dist/components/Card.es.js.map +1 -0
- package/dist/components/CenteredView.es.js +23 -0
- package/dist/components/CenteredView.es.js.map +1 -0
- package/dist/components/Checkbox.es.js +62 -0
- package/dist/components/Checkbox.es.js.map +1 -0
- package/dist/components/Chip.es.js +72 -0
- package/dist/components/Chip.es.js.map +1 -0
- package/dist/components/CircularProgress.es.js +28 -0
- package/dist/components/CircularProgress.es.js.map +1 -0
- package/dist/components/CircularProgressCenter.es.js +30 -0
- package/dist/components/CircularProgressCenter.es.js.map +1 -0
- package/dist/components/Collapse.es.js +57 -0
- package/dist/components/Collapse.es.js.map +1 -0
- package/dist/components/ColorPicker.es.js +89 -0
- package/dist/components/ColorPicker.es.js.map +1 -0
- package/dist/components/Container.es.js +31 -0
- package/dist/components/Container.es.js.map +1 -0
- package/dist/components/DateTimeField.d.ts +11 -1
- package/dist/components/DateTimeField.es.js +253 -0
- package/dist/components/DateTimeField.es.js.map +1 -0
- package/dist/components/DebouncedTextField.es.js +93 -0
- package/dist/components/DebouncedTextField.es.js.map +1 -0
- package/dist/components/Dialog.es.js +98 -0
- package/dist/components/Dialog.es.js.map +1 -0
- package/dist/components/DialogActions.es.js +15 -0
- package/dist/components/DialogActions.es.js.map +1 -0
- package/dist/components/DialogContent.es.js +18 -0
- package/dist/components/DialogContent.es.js.map +1 -0
- package/dist/components/DialogTitle.es.js +26 -0
- package/dist/components/DialogTitle.es.js.map +1 -0
- package/dist/components/ErrorBoundary.es.js +158 -0
- package/dist/components/ErrorBoundary.es.js.map +1 -0
- package/dist/components/ExpandablePanel.es.js +91 -0
- package/dist/components/ExpandablePanel.es.js.map +1 -0
- package/dist/components/FileUpload.es.js +58 -0
- package/dist/components/FileUpload.es.js.map +1 -0
- package/dist/components/FilterChip.es.js +31 -0
- package/dist/components/FilterChip.es.js.map +1 -0
- package/dist/components/IconButton.es.js +52 -0
- package/dist/components/IconButton.es.js.map +1 -0
- package/dist/components/InfoLabel.es.js +18 -0
- package/dist/components/InfoLabel.es.js.map +1 -0
- package/dist/components/InputLabel.es.js +27 -0
- package/dist/components/InputLabel.es.js.map +1 -0
- package/dist/components/Label.es.js +18 -0
- package/dist/components/Label.es.js.map +1 -0
- package/dist/components/LoadingButton.es.js +21 -0
- package/dist/components/LoadingButton.es.js.map +1 -0
- package/dist/components/Markdown.es.js +88 -0
- package/dist/components/Markdown.es.js.map +1 -0
- package/dist/components/Menu.es.js +46 -0
- package/dist/components/Menu.es.js.map +1 -0
- package/dist/components/Menubar.es.js +142 -0
- package/dist/components/Menubar.es.js.map +1 -0
- package/dist/components/MultiSelect.d.ts +1 -7
- package/dist/components/MultiSelect.es.js +271 -0
- package/dist/components/MultiSelect.es.js.map +1 -0
- package/dist/components/Paper.es.js +16 -0
- package/dist/components/Paper.es.js.map +1 -0
- package/dist/components/Popover.es.js +113 -0
- package/dist/components/Popover.es.js.map +1 -0
- package/dist/components/RadioGroup.es.js +30 -0
- package/dist/components/RadioGroup.es.js.map +1 -0
- package/dist/components/ResizablePanels.d.ts +3 -1
- package/dist/components/ResizablePanels.es.js +137 -0
- package/dist/components/ResizablePanels.es.js.map +1 -0
- package/dist/components/SearchBar.es.js +82 -0
- package/dist/components/SearchBar.es.js.map +1 -0
- package/dist/components/Select.d.ts +8 -1
- package/dist/components/Select.es.js +300 -0
- package/dist/components/Select.es.js.map +1 -0
- package/dist/components/Separator.es.js +20 -0
- package/dist/components/Separator.es.js.map +1 -0
- package/dist/components/Sheet.es.js +73 -0
- package/dist/components/Sheet.es.js.map +1 -0
- package/dist/components/Skeleton.es.js +33 -0
- package/dist/components/Skeleton.es.js.map +1 -0
- package/dist/components/Slider.es.js +56 -0
- package/dist/components/Slider.es.js.map +1 -0
- package/dist/components/Table.d.ts +18 -3
- package/dist/components/Table.es.js +69 -0
- package/dist/components/Table.es.js.map +1 -0
- package/dist/components/Tabs.es.js +101 -0
- package/dist/components/Tabs.es.js.map +1 -0
- package/dist/components/TextField.d.ts +0 -8
- package/dist/components/TextField.es.js +111 -0
- package/dist/components/TextField.es.js.map +1 -0
- package/dist/components/TextareaAutosize.es.js +187 -0
- package/dist/components/TextareaAutosize.es.js.map +1 -0
- package/dist/components/ToggleButtonGroup.d.ts +6 -1
- package/dist/components/ToggleButtonGroup.es.js +35 -0
- package/dist/components/ToggleButtonGroup.es.js.map +1 -0
- package/dist/components/Tooltip.d.ts +24 -0
- package/dist/components/Tooltip.es.js +165 -0
- package/dist/components/Tooltip.es.js.map +1 -0
- package/dist/components/Typography.es.js +85 -0
- package/dist/components/Typography.es.js.map +1 -0
- package/dist/components/VirtualTable/VirtualTable.es.js +516 -0
- package/dist/components/VirtualTable/VirtualTable.es.js.map +1 -0
- package/dist/components/VirtualTable/VirtualTableCell.d.ts +1 -1
- package/dist/components/VirtualTable/VirtualTableCell.es.js +40 -0
- package/dist/components/VirtualTable/VirtualTableCell.es.js.map +1 -0
- package/dist/components/VirtualTable/VirtualTableHeader.es.js +209 -0
- package/dist/components/VirtualTable/VirtualTableHeader.es.js.map +1 -0
- package/dist/components/VirtualTable/VirtualTableHeaderRow.es.js +166 -0
- package/dist/components/VirtualTable/VirtualTableHeaderRow.es.js.map +1 -0
- package/dist/components/VirtualTable/VirtualTableProps.d.ts +13 -2
- package/dist/components/VirtualTable/VirtualTableRow.d.ts +6 -7
- package/dist/components/VirtualTable/VirtualTableRow.es.js +41 -0
- package/dist/components/VirtualTable/VirtualTableRow.es.js.map +1 -0
- package/dist/components/VirtualTable/fields/VirtualTableDateField.d.ts +2 -1
- package/dist/components/VirtualTable/fields/VirtualTableDateField.es.js +71 -0
- package/dist/components/VirtualTable/fields/VirtualTableDateField.es.js.map +1 -0
- package/dist/components/VirtualTable/fields/VirtualTableInput.es.js +73 -0
- package/dist/components/VirtualTable/fields/VirtualTableInput.es.js.map +1 -0
- package/dist/components/VirtualTable/fields/VirtualTableNumberInput.es.js +47 -0
- package/dist/components/VirtualTable/fields/VirtualTableNumberInput.es.js.map +1 -0
- package/dist/components/VirtualTable/fields/VirtualTableSelect.es.js +83 -0
- package/dist/components/VirtualTable/fields/VirtualTableSelect.es.js.map +1 -0
- package/dist/components/VirtualTable/fields/VirtualTableSwitch.es.js +22 -0
- package/dist/components/VirtualTable/fields/VirtualTableSwitch.es.js.map +1 -0
- package/dist/components/VirtualTable/selection/SelectionContext.es.js +23 -0
- package/dist/components/VirtualTable/selection/SelectionContext.es.js.map +1 -0
- package/dist/components/VirtualTable/selection/SelectionStore.es.js +43 -0
- package/dist/components/VirtualTable/selection/SelectionStore.es.js.map +1 -0
- package/dist/components/VirtualTable/types.d.ts +1 -1
- package/dist/components/common/SelectInputLabel.es.js +28 -0
- package/dist/components/common/SelectInputLabel.es.js.map +1 -0
- package/dist/components/index.es.js +64 -0
- package/dist/hooks/PortalContainerContext.es.js +40 -0
- package/dist/hooks/PortalContainerContext.es.js.map +1 -0
- package/dist/hooks/UiLabelsContext.d.ts +63 -0
- package/dist/hooks/UiLabelsContext.es.js +59 -0
- package/dist/hooks/UiLabelsContext.es.js.map +1 -0
- package/dist/hooks/useDebounceCallback.es.js +15 -0
- package/dist/hooks/useDebounceCallback.es.js.map +1 -0
- package/dist/hooks/useDebounceValue.es.js +19 -0
- package/dist/hooks/useDebounceValue.es.js.map +1 -0
- package/dist/hooks/useDebouncedCallback.es.js +36 -0
- package/dist/hooks/useDebouncedCallback.es.js.map +1 -0
- package/dist/hooks/useInjectStyles.es.js +27 -0
- package/dist/hooks/useInjectStyles.es.js.map +1 -0
- package/dist/hooks/useIsDarkMode.es.js +61 -0
- package/dist/hooks/useIsDarkMode.es.js.map +1 -0
- package/dist/hooks/useModalFocus.es.js +81 -0
- package/dist/hooks/useModalFocus.es.js.map +1 -0
- package/dist/hooks/useOutsideAlerter.es.js +41 -0
- package/dist/hooks/useOutsideAlerter.es.js.map +1 -0
- package/dist/hooks/useRestoreInterruptedFocus.es.js +61 -0
- package/dist/hooks/useRestoreInterruptedFocus.es.js.map +1 -0
- package/dist/icons/GitHubIcon.es.js +23 -0
- package/dist/icons/GitHubIcon.es.js.map +1 -0
- package/dist/icons/HandleIcon.es.js +60 -0
- package/dist/icons/HandleIcon.es.js.map +1 -0
- package/dist/icons/Icon.es.js +25 -0
- package/dist/icons/Icon.es.js.map +1 -0
- package/dist/icons/LucideIconByName.d.ts +12 -9
- package/dist/icons/LucideIconByName.es.js +83 -0
- package/dist/icons/LucideIconByName.es.js.map +1 -0
- package/dist/icons/cool_icon_keys.es.js +55 -0
- package/dist/icons/cool_icon_keys.es.js.map +1 -0
- package/dist/icons/icon_keys.es.js +1941 -0
- package/dist/icons/icon_keys.es.js.map +1 -0
- package/dist/icons/index.d.ts +4 -3
- package/dist/icons/index.es.js +8 -0
- package/dist/icons/lucide_icon_map.d.ts +12 -0
- package/dist/icons/lucide_icon_map.es.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +87 -9563
- package/dist/styles.es.js +158 -0
- package/dist/styles.es.js.map +1 -0
- package/dist/util/chip_colors.es.js +290 -0
- package/dist/util/chip_colors.es.js.map +1 -0
- package/dist/util/cls.es.js +10 -0
- package/dist/util/cls.es.js.map +1 -0
- package/dist/util/debounce.es.js +22 -0
- package/dist/util/debounce.es.js.map +1 -0
- package/dist/util/hash.es.js +16 -0
- package/dist/util/hash.es.js.map +1 -0
- package/dist/util/keys.es.js +37 -0
- package/dist/util/keys.es.js.map +1 -0
- package/dist/util/lazy_chunk.es.js +96 -0
- package/dist/util/lazy_chunk.es.js.map +1 -0
- package/dist/views/CardView.d.ts +26 -2
- package/dist/views/CardView.es.js +435 -0
- package/dist/views/CardView.es.js.map +1 -0
- package/dist/views/CollectionView/CollectionCardView.es.js +179 -0
- package/dist/views/CollectionView/CollectionCardView.es.js.map +1 -0
- package/dist/views/CollectionView/CollectionKanbanView.es.js +172 -0
- package/dist/views/CollectionView/CollectionKanbanView.es.js.map +1 -0
- package/dist/views/CollectionView/CollectionListView.es.js +156 -0
- package/dist/views/CollectionView/CollectionListView.es.js.map +1 -0
- package/dist/views/CollectionView/CollectionTableView.es.js +149 -0
- package/dist/views/CollectionView/CollectionTableView.es.js.map +1 -0
- package/dist/views/CollectionView/CollectionView.es.js +197 -0
- package/dist/views/CollectionView/CollectionView.es.js.map +1 -0
- package/dist/views/CollectionView/CollectionViewToolbar.es.js +155 -0
- package/dist/views/CollectionView/CollectionViewToolbar.es.js.map +1 -0
- package/dist/views/CollectionView/DefaultCellRenderer.es.js +302 -0
- package/dist/views/CollectionView/DefaultCellRenderer.es.js.map +1 -0
- package/dist/views/CollectionView/resolveTitleProperty.es.js +56 -0
- package/dist/views/CollectionView/resolveTitleProperty.es.js.map +1 -0
- package/dist/views/CollectionView/utils.es.js +19 -0
- package/dist/views/CollectionView/utils.es.js.map +1 -0
- package/dist/views/Kanban/Board.es.js +237 -0
- package/dist/views/Kanban/Board.es.js.map +1 -0
- package/dist/views/Kanban/BoardColumn.es.js +81 -0
- package/dist/views/Kanban/BoardColumn.es.js.map +1 -0
- package/dist/views/Kanban/BoardColumnTitle.es.js +27 -0
- package/dist/views/Kanban/BoardColumnTitle.es.js.map +1 -0
- package/dist/views/Kanban/BoardSortableList.es.js +98 -0
- package/dist/views/Kanban/BoardSortableList.es.js.map +1 -0
- package/dist/views/Kanban/placement.es.js +27 -0
- package/dist/views/Kanban/placement.es.js.map +1 -0
- package/dist/views/KanbanView.es.js +11 -0
- package/dist/views/KanbanView.es.js.map +1 -0
- package/dist/views/ListView.d.ts +15 -2
- package/dist/views/ListView.es.js +245 -0
- package/dist/views/ListView.es.js.map +1 -0
- package/dist/views/useScrollParentRestoration.d.ts +8 -1
- package/dist/views/useScrollParentRestoration.es.js +75 -0
- package/dist/views/useScrollParentRestoration.es.js.map +1 -0
- package/package.json +2 -2
- package/dist/index.es.js.map +0 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { cls } from "../util/cls.es.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { CheckIcon, MinusIcon } from "lucide-react";
|
|
5
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
6
|
+
//#region src/components/Checkbox.tsx
|
|
7
|
+
var sizeClasses = {
|
|
8
|
+
large: "w-6 h-6 rounded flex items-center justify-center",
|
|
9
|
+
medium: "w-5 h-5 rounded flex items-center justify-center",
|
|
10
|
+
small: "w-4 h-4 rounded-sm flex items-center justify-center",
|
|
11
|
+
smallest: "w-4 h-4 rounded-sm flex items-center justify-center"
|
|
12
|
+
};
|
|
13
|
+
var outerSizeClasses = {
|
|
14
|
+
medium: "w-10 h-10",
|
|
15
|
+
small: "w-8 h-8",
|
|
16
|
+
large: "w-12 h-12 ",
|
|
17
|
+
smallest: "w-7 h-7"
|
|
18
|
+
};
|
|
19
|
+
var paddingClasses = {
|
|
20
|
+
medium: "p-2",
|
|
21
|
+
small: "p-2",
|
|
22
|
+
large: "p-2",
|
|
23
|
+
smallest: "p-2"
|
|
24
|
+
};
|
|
25
|
+
var colorClasses = {
|
|
26
|
+
primary: "bg-primary",
|
|
27
|
+
secondary: "bg-secondary"
|
|
28
|
+
};
|
|
29
|
+
var Checkbox = React.memo(({ id, checked, indeterminate = false, padding = true, disabled, size = "medium", onCheckedChange, color = "primary", "aria-label": ariaLabel }) => {
|
|
30
|
+
const isChecked = indeterminate ? false : checked;
|
|
31
|
+
const iconSize = size === "medium" ? 20 : size === "small" ? 16 : size === "smallest" ? 14 : 24;
|
|
32
|
+
return /* @__PURE__ */ jsx(CheckboxPrimitive.Root, {
|
|
33
|
+
id,
|
|
34
|
+
checked: indeterminate || isChecked,
|
|
35
|
+
disabled,
|
|
36
|
+
"aria-label": ariaLabel,
|
|
37
|
+
"aria-checked": indeterminate ? "mixed" : isChecked,
|
|
38
|
+
className: "rounded-full focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/50",
|
|
39
|
+
onCheckedChange: disabled ? void 0 : onCheckedChange,
|
|
40
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
41
|
+
className: cls(padding ? paddingClasses[size] : "", padding || onCheckedChange ? outerSizeClasses[size] : "", "inline-flex items-center justify-center text-sm font-medium focus:outline-none transition-colors ease-in-out duration-150", onCheckedChange ? "rounded-full hover:bg-surface-hover" : "", onCheckedChange ? "cursor-pointer" : "cursor-default"),
|
|
42
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
43
|
+
className: cls("border-2 shrink-0 relative transition-colors ease-in-out duration-150", sizeClasses[size], disabled ? "bg-surface-300 dark:bg-surface-600" : indeterminate || isChecked ? colorClasses[color] : "bg-surface-card", indeterminate || isChecked ? "text-surface-accent-100 dark:text-surface-accent-900" : "", disabled ? "border-transparent" : indeterminate || isChecked ? "border-transparent" : "border-surface-accent-800 dark:border-surface-accent-500"),
|
|
44
|
+
children: /* @__PURE__ */ jsx(CheckboxPrimitive.Indicator, {
|
|
45
|
+
asChild: true,
|
|
46
|
+
children: indeterminate ? /* @__PURE__ */ jsx(MinusIcon, {
|
|
47
|
+
size: iconSize,
|
|
48
|
+
className: "absolute"
|
|
49
|
+
}) : /* @__PURE__ */ jsx(CheckIcon, {
|
|
50
|
+
size: iconSize,
|
|
51
|
+
className: "absolute"
|
|
52
|
+
})
|
|
53
|
+
})
|
|
54
|
+
})
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
Checkbox.displayName = "Checkbox";
|
|
59
|
+
//#endregion
|
|
60
|
+
export { Checkbox };
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=Checkbox.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.es.js","names":[],"sources":["../../src/components/Checkbox.tsx"],"sourcesContent":["\nimport React from \"react\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\n\nimport { CheckIcon, MinusIcon } from \"lucide-react\";\nimport { cls } from \"../util\";\n\nexport interface CheckboxProps {\n checked: boolean;\n id?: string;\n disabled?: boolean;\n indeterminate?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n padding?: boolean;\n size?: \"smallest\" | \"small\" | \"medium\" | \"large\";\n color?: \"primary\" | \"secondary\";\n \"aria-label\"?: string;\n}\n\n// Radius steps down with the box. `rounded-md` is 6px — on a 16-20px box that\n// is most of the edge, so the control reads as a squircle rather than a\n// checkbox. Box sizes match the icon glyph scale (16/16/20/24) so a Checkbox\n// sitting beside IconButtons in a table row is the same visual size.\nconst sizeClasses = {\n large: \"w-6 h-6 rounded flex items-center justify-center\",\n medium: \"w-5 h-5 rounded flex items-center justify-center\",\n small: \"w-4 h-4 rounded-sm flex items-center justify-center\",\n smallest: \"w-4 h-4 rounded-sm flex items-center justify-center\"\n};\n\n// Outer box is the hit area and sets the control's rendered height, so it\n// tracks the shared 28/32/40/48 scale. `smallest` used to reuse `small`'s\n// 32px box, which made the two sizes identical.\n//\n// A checkbox with no `onCheckedChange` is not a hit area — it is a tick mark\n// standing in for a value, as in `BooleanPreview`. There the box was 10px of\n// dead space on each side of a `medium` tick: on top of a read-only field's\n// own padding, it started the tick 10px further in than the text of the field\n// beside it. `padding={false}` reads as the request to drop it, and until now\n// did nothing at all, because it only removed `p-2` from a box whose size was\n// fixed regardless. Kept for anything clickable — the same box is the click\n// target for table row selection and for editor task items.\nconst outerSizeClasses = {\n medium: \"w-10 h-10\",\n small: \"w-8 h-8\",\n large: \"w-12 h-12 \",\n smallest: \"w-7 h-7\"\n}\n// Flat p-2, as it always was. `shrink-0` on the box below is what stops it\n// being squashed; changing the padding here only shifts the control's optical\n// weight relative to the icons beside it.\nconst paddingClasses = {\n medium: \"p-2\",\n small: \"p-2\",\n large: \"p-2\",\n smallest: \"p-2\"\n}\n\nconst colorClasses = {\n primary: \"bg-primary\",\n secondary: \"bg-secondary\"\n}\n\nexport const Checkbox = React.memo(({\n id,\n checked,\n indeterminate = false,\n padding = true,\n disabled,\n size = \"medium\",\n onCheckedChange,\n color = \"primary\",\n \"aria-label\": ariaLabel\n }: CheckboxProps) => {\n\n const isChecked = indeterminate ? false : checked;\n\n const iconSize = size === \"medium\"\n ? 20\n : size === \"small\"\n ? 16\n : size === \"smallest\"\n ? 14\n : 24;\n return (\n <CheckboxPrimitive.Root\n id={id}\n checked={indeterminate || isChecked}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-checked={indeterminate ? \"mixed\" : isChecked}\n className=\"rounded-full focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/50\"\n onCheckedChange={disabled ? undefined : onCheckedChange}>\n\n <div className={cls(\n padding ? paddingClasses[size] : \"\",\n padding || onCheckedChange ? outerSizeClasses[size] : \"\",\n \"inline-flex items-center justify-center text-sm font-medium focus:outline-none transition-colors ease-in-out duration-150\",\n onCheckedChange ? \"rounded-full hover:bg-surface-hover\" : \"\",\n onCheckedChange ? \"cursor-pointer\" : \"cursor-default\"\n )}>\n <div\n className={cls(\n \"border-2 shrink-0 relative transition-colors ease-in-out duration-150\",\n sizeClasses[size],\n disabled\n ? \"bg-surface-300 dark:bg-surface-600\"\n : (indeterminate || isChecked ? colorClasses[color] : \"bg-surface-card\"),\n (indeterminate || isChecked) ? \"text-surface-accent-100 dark:text-surface-accent-900\" : \"\",\n disabled\n ? \"border-transparent\"\n : (indeterminate || isChecked ? \"border-transparent\" : \"border-surface-accent-800 dark:border-surface-accent-500\")\n )}>\n <CheckboxPrimitive.Indicator asChild>\n {indeterminate\n ? (\n <MinusIcon size={iconSize} className={\"absolute\"}/>\n )\n : (\n <CheckIcon size={iconSize} className={\"absolute\"}/>\n )}\n </CheckboxPrimitive.Indicator>\n </div>\n </div>\n </CheckboxPrimitive.Root>\n );\n});\n\nCheckbox.displayName = \"Checkbox\";\n"],"mappings":";;;;;;AAuBA,IAAM,cAAc;CAChB,OAAO;CACP,QAAQ;CACR,OAAO;CACP,UAAU;AACd;AAcA,IAAM,mBAAmB;CACrB,QAAQ;CACR,OAAO;CACP,OAAO;CACP,UAAU;AACd;AAIA,IAAM,iBAAiB;CACnB,QAAQ;CACR,OAAO;CACP,OAAO;CACP,UAAU;AACd;AAEA,IAAM,eAAe;CACjB,SAAS;CACT,WAAW;AACf;AAEA,IAAa,WAAW,MAAM,MAAM,EACP,IACA,SACA,gBAAgB,OAChB,UAAU,MACV,UACA,OAAO,UACP,iBACA,QAAQ,WACR,cAAc,gBACG;CAE1C,MAAM,YAAY,gBAAgB,QAAQ;CAE1C,MAAM,WAAW,SAAS,WACpB,KACA,SAAS,UACL,KACA,SAAS,aACL,KACA;CACd,OACI,oBAAC,kBAAkB,MAAnB;EACQ;EACJ,SAAS,iBAAiB;EAChB;EACV,cAAY;EACZ,gBAAc,gBAAgB,UAAU;EACxC,WAAU;EACV,iBAAiB,WAAW,KAAA,IAAY;YAExC,oBAAC,OAAD;GAAK,WAAW,IACZ,UAAU,eAAe,QAAQ,IACjC,WAAW,kBAAkB,iBAAiB,QAAQ,IACtD,6HACA,kBAAkB,wCAAwC,IAC1D,kBAAkB,mBAAmB,gBACzC;aACI,oBAAC,OAAD;IACI,WAAW,IACP,yEACA,YAAY,OACZ,WACM,uCACC,iBAAiB,YAAY,aAAa,SAAS,mBACzD,iBAAiB,YAAa,yDAAyD,IACxF,WACM,uBACC,iBAAiB,YAAY,uBAAuB,0DAC/D;cACA,oBAAC,kBAAkB,WAAnB;KAA6B,SAAA;eACxB,gBAEO,oBAAC,WAAD;MAAW,MAAM;MAAU,WAAW;KAAY,CAAA,IAGlD,oBAAC,WAAD;MAAW,MAAM;MAAU,WAAW;KAAY,CAAA;IAEjC,CAAA;GAC5B,CAAA;EACJ,CAAA;CACe,CAAA;AAEhC,CAAC;AAED,SAAS,cAAc"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { cls } from "../util/cls.es.js";
|
|
2
|
+
import { getColorSchemeForKey } from "../util/chip_colors.es.js";
|
|
3
|
+
import { useIsDarkMode } from "../hooks/useIsDarkMode.es.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/Chip.tsx
|
|
7
|
+
var sizeClassNames = {
|
|
8
|
+
smallest: "px-1.5 py-px text-[10px]",
|
|
9
|
+
small: "px-2 py-0.5 text-xs",
|
|
10
|
+
medium: "px-2.5 py-1 text-xs",
|
|
11
|
+
large: "px-3 py-1.5 text-sm"
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Helper to generate rgba from hex or standard colors.
|
|
15
|
+
*/
|
|
16
|
+
function getRgba(hex, alpha) {
|
|
17
|
+
if (!hex || !hex.startsWith("#")) return hex;
|
|
18
|
+
let color = hex.slice(1);
|
|
19
|
+
if (color.length === 3) color = color[0] + color[0] + color[1] + color[1] + color[2] + color[2];
|
|
20
|
+
return `rgba(${parseInt(color.slice(0, 2), 16)}, ${parseInt(color.slice(2, 4), 16)}, ${parseInt(color.slice(4, 6), 16)}, ${alpha})`;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @group Preview components
|
|
24
|
+
*/
|
|
25
|
+
function Chip({ children, colorScheme, error, outlined, variant = "tinted", onClick, icon, size = "medium", className, style }) {
|
|
26
|
+
const usedColorScheme = typeof colorScheme === "string" ? getColorSchemeForKey(colorScheme) : colorScheme;
|
|
27
|
+
const dark = useIsDarkMode();
|
|
28
|
+
const hasScheme = error || usedColorScheme;
|
|
29
|
+
let textColor = "";
|
|
30
|
+
let bgColor = "";
|
|
31
|
+
let border = "";
|
|
32
|
+
if (error) textColor = dark ? "#f87171" : "#dc2626";
|
|
33
|
+
else if (usedColorScheme) textColor = dark && usedColorScheme.darkText ? usedColorScheme.darkText : usedColorScheme.text;
|
|
34
|
+
if (hasScheme) {
|
|
35
|
+
if (outlined) {
|
|
36
|
+
if (!error && usedColorScheme) {
|
|
37
|
+
const outlineInk = dark ? usedColorScheme.darkOutlineText ?? usedColorScheme.darkText : usedColorScheme.outlineText;
|
|
38
|
+
if (outlineInk) textColor = outlineInk;
|
|
39
|
+
}
|
|
40
|
+
bgColor = getRgba(textColor, dark ? .1 : .06);
|
|
41
|
+
border = `1px solid ${getRgba(textColor, dark ? .2 : .14)}`;
|
|
42
|
+
} else if (error) {
|
|
43
|
+
bgColor = dark ? "rgba(220, 38, 38, 0.15)" : "rgba(239, 68, 68, 0.1)";
|
|
44
|
+
border = `1px solid ${dark ? "rgba(220, 38, 38, 0.3)" : "rgba(239, 68, 68, 0.2)"}`;
|
|
45
|
+
} else if (usedColorScheme) {
|
|
46
|
+
const tintColor = dark ? usedColorScheme.darkTintColor : usedColorScheme.tintColor;
|
|
47
|
+
const tintText = dark ? usedColorScheme.darkTintText : usedColorScheme.tintText;
|
|
48
|
+
if (variant === "tinted" && tintColor && tintText) {
|
|
49
|
+
bgColor = tintColor;
|
|
50
|
+
textColor = tintText;
|
|
51
|
+
} else bgColor = dark && usedColorScheme.darkColor ? usedColorScheme.darkColor : usedColorScheme.color;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
55
|
+
className: cls("rounded-md max-w-full w-max h-fit font-medium inline-flex gap-1", "text-ellipsis", "items-center", "transition-colors duration-150", !hasScheme && "bg-surface-raised text-text-secondary dark:text-text-secondary-dark", !hasScheme && outlined && "bg-transparent border border-hairline-strong", onClick ? "cursor-pointer hover:bg-surface-raised-hover" : "", sizeClassNames[size], className),
|
|
56
|
+
onClick,
|
|
57
|
+
style: {
|
|
58
|
+
...hasScheme ? {
|
|
59
|
+
backgroundColor: bgColor,
|
|
60
|
+
color: textColor,
|
|
61
|
+
border: border || void 0
|
|
62
|
+
} : {},
|
|
63
|
+
overflow: "hidden",
|
|
64
|
+
...style
|
|
65
|
+
},
|
|
66
|
+
children: [icon, children]
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
export { Chip };
|
|
71
|
+
|
|
72
|
+
//# sourceMappingURL=Chip.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chip.es.js","names":[],"sources":["../../src/components/Chip.tsx"],"sourcesContent":["import React from \"react\";\nimport { CHIP_COLORS, cls, getColorSchemeForKey } from \"../util\";\nimport type { ChipColorKey, ChipColorScheme } from \"../util/chip_colors\";\nimport { useIsDarkMode } from \"../hooks/useIsDarkMode\";\n\nexport type { ChipColorKey, ChipColorScheme };\n\nexport interface ChipProps {\n className?: string;\n children: React.ReactNode;\n size?: \"smallest\" | \"small\" | \"medium\" | \"large\";\n colorScheme?: ChipColorScheme | ChipColorKey;\n /**\n * How a coloured chip paints its hue. `tinted` (the default) is the hue at\n * low alpha behind hue-coloured ink: a label, not a block, and the rule the\n * chrome follows for colour everywhere else (a dot, an icon, an outline, a\n * tint — never a fill). `filled` is the palette's solid stop, for the few\n * places that want a swatch: a colour picker, a legend. A custom scheme\n * without tint values falls back to `filled`.\n */\n variant?: \"tinted\" | \"filled\";\n error?: boolean;\n outlined?: boolean;\n onClick?: () => void;\n icon?: React.ReactNode;\n style?: React.CSSProperties;\n}\n\n// `small` and `medium` used to differ only in horizontal padding, so both\n// rendered at the same height and the step was invisible. Vertical rhythm now\n// increases across the whole scale.\nconst sizeClassNames = {\n smallest: \"px-1.5 py-px text-[10px]\",\n small: \"px-2 py-0.5 text-xs\",\n medium: \"px-2.5 py-1 text-xs\",\n large: \"px-3 py-1.5 text-sm\"\n}\n\n/**\n * Helper to generate rgba from hex or standard colors.\n */\nfunction getRgba(hex: string, alpha: number): string {\n if (!hex || !hex.startsWith(\"#\")) return hex;\n let color = hex.slice(1);\n if (color.length === 3) {\n color = color[0] + color[0] + color[1] + color[1] + color[2] + color[2];\n }\n const r = parseInt(color.slice(0, 2), 16);\n const g = parseInt(color.slice(2, 4), 16);\n const b = parseInt(color.slice(4, 6), 16);\n return `rgba(${r}, ${g}, ${b}, ${alpha})`;\n}\n\n/**\n * @group Preview components\n */\nexport function Chip({\n children,\n colorScheme,\n error,\n outlined,\n variant = \"tinted\",\n onClick,\n icon,\n size = \"medium\",\n className,\n style\n }: ChipProps) {\n\n const usedColorScheme = typeof colorScheme === \"string\" ? getColorSchemeForKey(colorScheme) : colorScheme;\n // Live, not read once: the ink is chosen in JS per theme, so a theme switch\n // has to reach every mounted chip (see useIsDarkMode).\n const dark = useIsDarkMode();\n\n const hasScheme = error || usedColorScheme;\n\n let textColor = \"\";\n let bgColor = \"\";\n let border = \"\";\n\n if (error) {\n textColor = dark ? \"#f87171\" : \"#dc2626\";\n } else if (usedColorScheme) {\n textColor = dark && usedColorScheme.darkText ? usedColorScheme.darkText : usedColorScheme.text;\n }\n\n if (hasScheme) {\n if (outlined) {\n // An outlined chip has no fill, so it needs the ink meant for the\n // PAGE, not the ink meant for the fill it just dropped. Those are\n // different colours for most hues — a bright `solid` chip carries\n // dark ink, which on a near-black page would be invisible.\n if (!error && usedColorScheme) {\n const outlineInk = dark\n ? usedColorScheme.darkOutlineText ?? usedColorScheme.darkText\n : usedColorScheme.outlineText;\n if (outlineInk) textColor = outlineInk;\n }\n bgColor = getRgba(textColor, dark ? 0.1 : 0.06);\n border = `1px solid ${getRgba(textColor, dark ? 0.2 : 0.14)}`;\n } else if (error) {\n bgColor = dark ? \"rgba(220, 38, 38, 0.15)\" : \"rgba(239, 68, 68, 0.1)\";\n border = `1px solid ${dark ? \"rgba(220, 38, 38, 0.3)\" : \"rgba(239, 68, 68, 0.2)\"}`;\n } else if (usedColorScheme) {\n const tintColor = dark ? usedColorScheme.darkTintColor : usedColorScheme.tintColor;\n const tintText = dark ? usedColorScheme.darkTintText : usedColorScheme.tintText;\n if (variant === \"tinted\" && tintColor && tintText) {\n bgColor = tintColor;\n textColor = tintText;\n } else {\n bgColor = dark && usedColorScheme.darkColor ? usedColorScheme.darkColor : usedColorScheme.color;\n }\n }\n }\n\n return (\n <div\n // `rounded-md`, not `lg`: a radius is proportional to the thing it\n // rounds. At a chip's 20-24px height the control radius makes a pill,\n // and a pill is a different object (a segment, a search field).\n className={cls(\"rounded-md max-w-full w-max h-fit font-medium inline-flex gap-1\",\n \"text-ellipsis\",\n \"items-center\",\n \"transition-colors duration-150\",\n !hasScheme && \"bg-surface-raised text-text-secondary dark:text-text-secondary-dark\",\n !hasScheme && outlined && \"bg-transparent border border-hairline-strong\",\n onClick ? \"cursor-pointer hover:bg-surface-raised-hover\" : \"\",\n sizeClassNames[size],\n className)}\n onClick={onClick}\n style={{\n ...(hasScheme ? {\n backgroundColor: bgColor,\n color: textColor,\n border: border || undefined,\n } : {}),\n overflow: \"hidden\",\n ...style\n }}\n >\n {icon}\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;AA+BA,IAAM,iBAAiB;CACnB,UAAU;CACV,OAAO;CACP,QAAQ;CACR,OAAO;AACX;;;;AAKA,SAAS,QAAQ,KAAa,OAAuB;CACjD,IAAI,CAAC,OAAO,CAAC,IAAI,WAAW,GAAG,GAAG,OAAO;CACzC,IAAI,QAAQ,IAAI,MAAM,CAAC;CACvB,IAAI,MAAM,WAAW,GACjB,QAAQ,MAAM,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM;CAKzE,OAAO,QAHG,SAAS,MAAM,MAAM,GAAG,CAAC,GAAG,EAGvB,EAAE,IAFP,SAAS,MAAM,MAAM,GAAG,CAAC,GAAG,EAEjB,EAAE,IADb,SAAS,MAAM,MAAM,GAAG,CAAC,GAAG,EACX,EAAE,IAAI,MAAM;AAC3C;;;;AAKA,SAAgB,KAAK,EACI,UACA,aACA,OACA,UACA,UAAU,UACV,SACA,MACA,OAAO,UACP,WACA,SACU;CAE/B,MAAM,kBAAkB,OAAO,gBAAgB,WAAW,qBAAqB,WAAW,IAAI;CAG9F,MAAM,OAAO,cAAc;CAE3B,MAAM,YAAY,SAAS;CAE3B,IAAI,YAAY;CAChB,IAAI,UAAU;CACd,IAAI,SAAS;CAEb,IAAI,OACA,YAAY,OAAO,YAAY;MAC5B,IAAI,iBACP,YAAY,QAAQ,gBAAgB,WAAW,gBAAgB,WAAW,gBAAgB;CAG9F,IAAI;MACI,UAAU;GAKV,IAAI,CAAC,SAAS,iBAAiB;IAC3B,MAAM,aAAa,OACb,gBAAgB,mBAAmB,gBAAgB,WACnD,gBAAgB;IACtB,IAAI,YAAY,YAAY;GAChC;GACA,UAAU,QAAQ,WAAW,OAAO,KAAM,GAAI;GAC9C,SAAS,aAAa,QAAQ,WAAW,OAAO,KAAM,GAAI;EAC9D,OAAO,IAAI,OAAO;GACd,UAAU,OAAO,4BAA4B;GAC7C,SAAS,aAAa,OAAO,2BAA2B;EAC5D,OAAO,IAAI,iBAAiB;GACxB,MAAM,YAAY,OAAO,gBAAgB,gBAAgB,gBAAgB;GACzE,MAAM,WAAW,OAAO,gBAAgB,eAAe,gBAAgB;GACvE,IAAI,YAAY,YAAY,aAAa,UAAU;IAC/C,UAAU;IACV,YAAY;GAChB,OACI,UAAU,QAAQ,gBAAgB,YAAY,gBAAgB,YAAY,gBAAgB;EAElG;;CAGJ,OACI,qBAAC,OAAD;EAII,WAAW,IAAI,mEACX,iBACA,gBACA,kCACA,CAAC,aAAa,uEACd,CAAC,aAAa,YAAY,gDAC1B,UAAU,iDAAiD,IAC3D,eAAe,OACf,SAAS;EACJ;EACT,OAAO;GACH,GAAI,YAAY;IACZ,iBAAiB;IACjB,OAAO;IACP,QAAQ,UAAU,KAAA;GACtB,IAAI,CAAC;GACL,UAAU;GACV,GAAG;EACP;YAtBJ,CAwBK,MACA,QACA;;AAEb"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { cls } from "../util/cls.es.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/CircularProgress.tsx
|
|
5
|
+
function CircularProgress({ size = "medium", className }) {
|
|
6
|
+
let sizeClasses = "";
|
|
7
|
+
if (size === "smallest") sizeClasses = "w-4 h-4";
|
|
8
|
+
else if (size === "small") sizeClasses = "w-6 h-6";
|
|
9
|
+
else if (size === "medium") sizeClasses = "w-8 h-8 m-1";
|
|
10
|
+
else sizeClasses = "w-10 h-10 m-1";
|
|
11
|
+
let borderClasses = "";
|
|
12
|
+
if (size === "smallest") borderClasses = "border-2";
|
|
13
|
+
else if (size === "small") borderClasses = "border-2";
|
|
14
|
+
else if (size === "medium") borderClasses = "border-[3px]";
|
|
15
|
+
else borderClasses = "border-4";
|
|
16
|
+
return /* @__PURE__ */ jsx("div", {
|
|
17
|
+
className: cls(sizeClasses, borderClasses, "inline-block shrink-0 rounded-full border-solid align-[-0.125em]", "animate-[spin_0.7s_linear_infinite] motion-reduce:animate-[spin_1.5s_linear_infinite]", "border-hairline-strong border-t-primary dark:border-t-primary", className),
|
|
18
|
+
role: "status",
|
|
19
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
20
|
+
className: "absolute! -m-px! h-px! w-px! overflow-hidden! whitespace-nowrap! border-0! p-0! [clip:rect(0,0,0,0)]!",
|
|
21
|
+
children: "Loading..."
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { CircularProgress };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=CircularProgress.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CircularProgress.es.js","names":[],"sources":["../../src/components/CircularProgress.tsx"],"sourcesContent":["import React from \"react\";\nimport { cls } from \"../util\";\n\nexport type CircularProgressProps = {\n size?: \"smallest\" | \"small\" | \"medium\" | \"large\",\n className?: string\n}\n\nexport function CircularProgress({\n size = \"medium\",\n className\n }: CircularProgressProps) {\n\n let sizeClasses = \"\";\n if (size === \"smallest\") {\n sizeClasses = \"w-4 h-4\";\n } else if (size === \"small\") {\n sizeClasses = \"w-6 h-6\";\n } else if (size === \"medium\") {\n sizeClasses = \"w-8 h-8 m-1\";\n } else {\n sizeClasses = \"w-10 h-10 m-1\";\n }\n\n let borderClasses = \"\";\n if (size === \"smallest\") {\n borderClasses = \"border-2\";\n } else if (size === \"small\") {\n borderClasses = \"border-2\";\n } else if (size === \"medium\") {\n borderClasses = \"border-[3px]\";\n } else {\n borderClasses = \"border-4\";\n }\n\n return (\n <div\n className={cls(\n sizeClasses,\n borderClasses,\n \"inline-block shrink-0 rounded-full border-solid align-[-0.125em]\",\n \"animate-[spin_0.7s_linear_infinite] motion-reduce:animate-[spin_1.5s_linear_infinite]\",\n \"border-hairline-strong border-t-primary dark:border-t-primary\",\n className)}\n role=\"status\">\n <span\n className=\"absolute! -m-px! h-px! w-px! overflow-hidden! whitespace-nowrap! border-0! p-0! [clip:rect(0,0,0,0)]!\"\n >\n Loading...\n </span>\n </div>\n );\n}\n"],"mappings":";;;;AAQA,SAAgB,iBAAiB,EACI,OAAO,UACP,aACsB;CAEvD,IAAI,cAAc;CAClB,IAAI,SAAS,YACT,cAAc;MACX,IAAI,SAAS,SAChB,cAAc;MACX,IAAI,SAAS,UAChB,cAAc;MAEd,cAAc;CAGlB,IAAI,gBAAgB;CACpB,IAAI,SAAS,YACT,gBAAgB;MACb,IAAI,SAAS,SAChB,gBAAgB;MACb,IAAI,SAAS,UAChB,gBAAgB;MAEhB,gBAAgB;CAGpB,OACI,oBAAC,OAAD;EACI,WAAW,IACP,aACA,eACA,oEACA,yFACA,iEACA,SAAS;EACb,MAAK;YACH,oBAAC,QAAD;GACI,WAAU;aACb;EAEK,CAAA;CACP,CAAA;AAEb"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CircularProgress } from "./CircularProgress.es.js";
|
|
2
|
+
import { Typography } from "./Typography.es.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/CircularProgressCenter.tsx
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param text
|
|
9
|
+
* @param props
|
|
10
|
+
|
|
11
|
+
* @ignore
|
|
12
|
+
*/
|
|
13
|
+
function CircularProgressCenter({ text, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx("div", {
|
|
15
|
+
className: "flex w-full h-screen max-h-full max-w-full gap-4",
|
|
16
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
17
|
+
className: "m-auto flex flex-col gap-2 items-center",
|
|
18
|
+
children: [/* @__PURE__ */ jsx(CircularProgress, { ...props }), text && /* @__PURE__ */ jsx(Typography, {
|
|
19
|
+
color: "secondary",
|
|
20
|
+
variant: "caption",
|
|
21
|
+
className: "text-center",
|
|
22
|
+
children: text
|
|
23
|
+
})]
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { CircularProgressCenter };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=CircularProgressCenter.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CircularProgressCenter.es.js","names":[],"sources":["../../src/components/CircularProgressCenter.tsx"],"sourcesContent":["import React from \"react\";\nimport { CircularProgress, CircularProgressProps } from \"./CircularProgress\";\nimport { Typography } from \"./Typography\";\n\n/**\n *\n * @param text\n * @param props\n\n * @ignore\n */\nexport function CircularProgressCenter({ text, ...props }: CircularProgressProps & {\n text?: string\n}) {\n return (\n <div\n className=\"flex w-full h-screen max-h-full max-w-full gap-4\">\n <div className=\"m-auto flex flex-col gap-2 items-center\">\n <CircularProgress {...props}/>\n {text && <Typography\n color={\"secondary\"}\n variant={\"caption\"}\n className=\"text-center\">{text}</Typography>}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAWA,SAAgB,uBAAuB,EAAE,MAAM,GAAG,SAE/C;CACC,OACI,oBAAC,OAAD;EACI,WAAU;YACV,qBAAC,OAAD;GAAK,WAAU;aAAf,CACI,oBAAC,kBAAD,EAAkB,GAAI,MAAO,CAAA,GAC5B,QAAQ,oBAAC,YAAD;IACL,OAAO;IACP,SAAS;IACT,WAAU;cAAe;GAAiB,CAAA,CAC7C;;CACJ,CAAA;AAEb"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cls } from "../util/cls.es.js";
|
|
3
|
+
import { useInjectStyles } from "../hooks/useInjectStyles.es.js";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import * as Collapsible from "@radix-ui/react-collapsible";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/Collapse.tsx
|
|
8
|
+
var Collapse = React.memo(({ children, className, in: isOpen = false, duration = 220 }) => {
|
|
9
|
+
useInjectStyles(`Collapse-${duration}`, `
|
|
10
|
+
.CollapseContent-${duration} {
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
}
|
|
13
|
+
.CollapseContent-${duration}[data-state='open'] {
|
|
14
|
+
animation: collapseSlideDown ${duration}ms ease-out;
|
|
15
|
+
}
|
|
16
|
+
.CollapseContent-${duration}[data-state='closed'] {
|
|
17
|
+
animation: collapseSlideUp ${duration}ms ease-in;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@keyframes collapseSlideDown {
|
|
21
|
+
from {
|
|
22
|
+
height: 0;
|
|
23
|
+
}
|
|
24
|
+
to {
|
|
25
|
+
height: var(--radix-collapsible-content-height);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@keyframes collapseSlideUp {
|
|
30
|
+
from {
|
|
31
|
+
height: var(--radix-collapsible-content-height);
|
|
32
|
+
}
|
|
33
|
+
to {
|
|
34
|
+
height: 0;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@media (prefers-reduced-motion: reduce) {
|
|
39
|
+
.CollapseContent-${duration}[data-state] {
|
|
40
|
+
animation: none;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
`);
|
|
44
|
+
return /* @__PURE__ */ jsx(Collapsible.Root, {
|
|
45
|
+
open: isOpen,
|
|
46
|
+
className,
|
|
47
|
+
children: /* @__PURE__ */ jsx(Collapsible.Content, {
|
|
48
|
+
className: cls(`CollapseContent-${duration}`),
|
|
49
|
+
children
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
Collapse.displayName = "Collapse";
|
|
54
|
+
//#endregion
|
|
55
|
+
export { Collapse };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=Collapse.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Collapse.es.js","names":[],"sources":["../../src/components/Collapse.tsx"],"sourcesContent":["\"use client\";\nimport React from \"react\";\nimport * as Collapsible from \"@radix-ui/react-collapsible\";\n\nimport { cls } from \"../util\";\nimport { useInjectStyles } from \"../hooks\";\n\ninterface CollapseProps {\n children?: React.ReactNode;\n className?: string;\n in?: boolean;\n duration?: number;\n}\n\nexport const Collapse = React.memo(({\n children,\n className,\n in: isOpen = false,\n duration = 220\n }: CollapseProps) => {\n\n useInjectStyles(`Collapse-${duration}`, `\n.CollapseContent-${duration} {\n overflow: hidden;\n}\n.CollapseContent-${duration}[data-state='open'] {\n animation: collapseSlideDown ${duration}ms ease-out;\n}\n.CollapseContent-${duration}[data-state='closed'] {\n animation: collapseSlideUp ${duration}ms ease-in;\n}\n\n@keyframes collapseSlideDown {\n from {\n height: 0;\n }\n to {\n height: var(--radix-collapsible-content-height);\n }\n}\n\n@keyframes collapseSlideUp {\n from {\n height: var(--radix-collapsible-content-height);\n }\n to {\n height: 0;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .CollapseContent-${duration}[data-state] {\n animation: none;\n }\n}\n`);\n\n return (\n <Collapsible.Root\n open={isOpen}\n className={className}>\n\n <Collapsible.Content\n className={cls(`CollapseContent-${duration}`)}\n >\n {children}\n </Collapsible.Content>\n </Collapsible.Root>\n )\n});\n\nCollapse.displayName = \"Collapse\";\n"],"mappings":";;;;;;;AAcA,IAAa,WAAW,MAAM,MAAM,EACP,UACA,WACA,IAAI,SAAS,OACb,WAAW,UACM;CAE1C,gBAAgB,YAAY,YAAY;mBACzB,SAAS;;;mBAGT,SAAS;iCACK,SAAS;;mBAEvB,SAAS;+BACG,SAAS;;;;;;;;;;;;;;;;;;;;;;qBAsBnB,SAAS;;;;CAI7B;CAEG,OACI,oBAAC,YAAY,MAAb;EACI,MAAM;EACK;YAEX,oBAAC,YAAY,SAAb;GACI,WAAW,IAAI,mBAAmB,UAAU;GAE3C;EACgB,CAAA;CACP,CAAA;AAE1B,CAAC;AAED,SAAS,cAAc"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { cls } from "../util/cls.es.js";
|
|
2
|
+
import { CHIP_COLORS } from "../util/chip_colors.es.js";
|
|
3
|
+
import { Tooltip } from "./Tooltip.es.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { CheckIcon } from "lucide-react";
|
|
7
|
+
//#region src/components/ColorPicker.tsx
|
|
8
|
+
var BASE_COLORS = [
|
|
9
|
+
"blue",
|
|
10
|
+
"indigo",
|
|
11
|
+
"violet",
|
|
12
|
+
"purple",
|
|
13
|
+
"fuchsia",
|
|
14
|
+
"pink",
|
|
15
|
+
"rose",
|
|
16
|
+
"red",
|
|
17
|
+
"orange",
|
|
18
|
+
"yellow",
|
|
19
|
+
"green",
|
|
20
|
+
"emerald",
|
|
21
|
+
"teal",
|
|
22
|
+
"cyan",
|
|
23
|
+
"gray"
|
|
24
|
+
];
|
|
25
|
+
var TONES = [
|
|
26
|
+
"Lighter",
|
|
27
|
+
"Light",
|
|
28
|
+
"Dark",
|
|
29
|
+
"Darker"
|
|
30
|
+
];
|
|
31
|
+
function getColorDisplayName(hue, tone) {
|
|
32
|
+
const hueName = `${hue.charAt(0).toUpperCase()}${hue.slice(1)}`;
|
|
33
|
+
return tone === "Lighter" ? hueName : `${hueName} ${tone.toLowerCase()}`;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A color picker component that displays a grid of predefined CHIP_COLORS.
|
|
37
|
+
* Used for selecting colors for enum values, tags, and other chip-based UI elements.
|
|
38
|
+
*
|
|
39
|
+
* @group Form components
|
|
40
|
+
*/
|
|
41
|
+
function ColorPicker({ value, onChange, size = "medium", allowClear = true, disabled = false }) {
|
|
42
|
+
const swatchSize = size === "small" ? "w-5 h-5" : "w-6 h-6";
|
|
43
|
+
const checkSize = size === "small" ? 12 : 14;
|
|
44
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
45
|
+
className: "flex flex-col gap-2",
|
|
46
|
+
children: [allowClear && /* @__PURE__ */ jsxs("button", {
|
|
47
|
+
type: "button",
|
|
48
|
+
disabled,
|
|
49
|
+
onClick: () => onChange(void 0),
|
|
50
|
+
className: cls("flex items-center gap-2 px-2 py-1 rounded-lg text-sm transition-colors duration-150", "hover:bg-surface-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-primary", disabled && "opacity-50 cursor-not-allowed", !value && "bg-surface-raised font-medium"),
|
|
51
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
52
|
+
className: cls(swatchSize, "rounded-full border-2 border-dashed border-surface-accent-400 dark:border-surface-accent-600", "flex items-center justify-center"),
|
|
53
|
+
children: !value && /* @__PURE__ */ jsx(CheckIcon, { size: checkSize })
|
|
54
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
55
|
+
className: "text-surface-accent-700 dark:text-surface-accent-300",
|
|
56
|
+
children: "Auto (based on ID)"
|
|
57
|
+
})]
|
|
58
|
+
}), TONES.map((tone) => /* @__PURE__ */ jsx("div", {
|
|
59
|
+
className: "flex flex-wrap gap-1.5",
|
|
60
|
+
children: BASE_COLORS.map((base) => {
|
|
61
|
+
const colorKey = tone === "Lighter" ? base : `${base}${tone}`;
|
|
62
|
+
const colorScheme = CHIP_COLORS[colorKey];
|
|
63
|
+
const isSelected = value === colorKey;
|
|
64
|
+
const displayName = getColorDisplayName(base, tone);
|
|
65
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
66
|
+
title: displayName,
|
|
67
|
+
delayDuration: 300,
|
|
68
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
69
|
+
type: "button",
|
|
70
|
+
disabled,
|
|
71
|
+
onClick: () => onChange(colorKey),
|
|
72
|
+
className: cls(swatchSize, "rounded-full transition-all flex items-center justify-center", "hover:scale-110 hover:shadow-md", "focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1", disabled && "opacity-50 cursor-not-allowed hover:scale-100", isSelected && "ring-2 ring-primary ring-offset-1"),
|
|
73
|
+
style: { backgroundColor: colorScheme.color },
|
|
74
|
+
"aria-label": displayName,
|
|
75
|
+
"aria-pressed": isSelected,
|
|
76
|
+
children: isSelected && /* @__PURE__ */ jsx(CheckIcon, {
|
|
77
|
+
size: checkSize,
|
|
78
|
+
style: { color: colorScheme.text }
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
}, colorKey);
|
|
82
|
+
})
|
|
83
|
+
}, tone))]
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
export { ColorPicker };
|
|
88
|
+
|
|
89
|
+
//# sourceMappingURL=ColorPicker.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorPicker.es.js","names":[],"sources":["../../src/components/ColorPicker.tsx"],"sourcesContent":["\nimport React from \"react\";\nimport { CHIP_COLORS, cls } from \"../util\";\nimport { ChipColorKey, ChipColorScheme } from \"./Chip\";\nimport type { ChipTone } from \"../util/chip_colors\";\nimport { CheckIcon } from \"lucide-react\";\nimport { Tooltip } from \"./Tooltip\";\n\nexport interface ColorPickerProps {\n /**\n * Currently selected color key\n */\n value?: ChipColorKey;\n /**\n * Callback when color selection changes. Passes undefined when \"Auto\" is selected.\n */\n onChange: (colorKey: ChipColorKey | undefined) => void;\n /**\n * Size of the color swatches\n */\n size?: \"small\" | \"medium\";\n /**\n * Whether to show the \"Auto\" option that clears the selection\n */\n allowClear?: boolean;\n /**\n * Whether the picker is disabled\n */\n disabled?: boolean;\n}\n\n// Hues across, tones down — the arrangement the palette is built in.\nconst BASE_COLORS = [\"blue\", \"indigo\", \"violet\", \"purple\", \"fuchsia\", \"pink\", \"rose\", \"red\", \"orange\", \"yellow\", \"green\", \"emerald\", \"teal\", \"cyan\", \"gray\"] as const;\n\n// Lightest first, matching how the bare hue name reads.\nconst TONES: ChipTone[] = [\"Lighter\", \"Light\", \"Dark\", \"Darker\"];\n\n// Helper to get readable name from color key\nfunction getColorDisplayName(hue: string, tone: ChipTone): string {\n const hueName = `${hue.charAt(0).toUpperCase()}${hue.slice(1)}`;\n return tone === \"Lighter\" ? hueName : `${hueName} ${tone.toLowerCase()}`;\n}\n\n/**\n * A color picker component that displays a grid of predefined CHIP_COLORS.\n * Used for selecting colors for enum values, tags, and other chip-based UI elements.\n *\n * @group Form components\n */\nexport function ColorPicker({\n value,\n onChange,\n size = \"medium\",\n allowClear = true,\n disabled = false\n}: ColorPickerProps) {\n\n const swatchSize = size === \"small\" ? \"w-5 h-5\" : \"w-6 h-6\";\n const checkSize = size === \"small\" ? 12 : 14;\n\n return (\n <div className=\"flex flex-col gap-2\">\n {allowClear && (\n <button\n type=\"button\"\n disabled={disabled}\n onClick={() => onChange(undefined)}\n className={cls(\n \"flex items-center gap-2 px-2 py-1 rounded-lg text-sm transition-colors duration-150\",\n \"hover:bg-surface-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-primary\",\n disabled && \"opacity-50 cursor-not-allowed\",\n !value && \"bg-surface-raised font-medium\"\n )}\n >\n <div className={cls(\n swatchSize,\n \"rounded-full border-2 border-dashed border-surface-accent-400 dark:border-surface-accent-600\",\n \"flex items-center justify-center\"\n )}>\n {!value && <CheckIcon size={checkSize}/>}\n </div>\n <span className=\"text-surface-accent-700 dark:text-surface-accent-300\">\n Auto (based on ID)\n </span>\n </button>\n )}\n\n {/* One row per tone. Wrapping rather than a fixed 15-column grid:\n the picker also opens inside narrow property panels, where\n fifteen tracks would shrink each swatch to a few pixels. */}\n {TONES.map((tone) => (\n <div key={tone} className=\"flex flex-wrap gap-1.5\">\n {BASE_COLORS.map((base) => {\n // The bare hue and its `Lighter` tone are the same\n // scheme; the picker offers the short name so configs\n // stay readable.\n const colorKey = (tone === \"Lighter\" ? base : `${base}${tone}`) as ChipColorKey;\n const colorScheme = CHIP_COLORS[colorKey] as ChipColorScheme;\n const isSelected = value === colorKey;\n const displayName = getColorDisplayName(base, tone);\n\n return (\n <Tooltip\n key={colorKey}\n title={displayName}\n delayDuration={300}\n >\n <button\n type=\"button\"\n disabled={disabled}\n onClick={() => onChange(colorKey)}\n className={cls(\n swatchSize,\n \"rounded-full transition-all flex items-center justify-center\",\n \"hover:scale-110 hover:shadow-md\",\n \"focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1\",\n disabled && \"opacity-50 cursor-not-allowed hover:scale-100\",\n isSelected && \"ring-2 ring-primary ring-offset-1\"\n )}\n style={{\n backgroundColor: colorScheme.color\n }}\n aria-label={displayName}\n aria-pressed={isSelected}\n >\n {isSelected && (\n <CheckIcon\n size={checkSize}\n style={{ color: colorScheme.text }}\n />\n )}\n </button>\n </Tooltip>\n );\n })}\n </div>\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;;;AAgCA,IAAM,cAAc;CAAC;CAAQ;CAAU;CAAU;CAAU;CAAW;CAAQ;CAAQ;CAAO;CAAU;CAAU;CAAS;CAAW;CAAQ;CAAQ;AAAM;AAG3J,IAAM,QAAoB;CAAC;CAAW;CAAS;CAAQ;AAAQ;AAG/D,SAAS,oBAAoB,KAAa,MAAwB;CAC9D,MAAM,UAAU,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,IAAI,MAAM,CAAC;CAC5D,OAAO,SAAS,YAAY,UAAU,GAAG,QAAQ,GAAG,KAAK,YAAY;AACzE;;;;;;;AAQA,SAAgB,YAAY,EACxB,OACA,UACA,OAAO,UACP,aAAa,MACb,WAAW,SACM;CAEjB,MAAM,aAAa,SAAS,UAAU,YAAY;CAClD,MAAM,YAAY,SAAS,UAAU,KAAK;CAE1C,OACI,qBAAC,OAAD;EAAK,WAAU;YAAf,CACK,cACG,qBAAC,UAAD;GACI,MAAK;GACK;GACV,eAAe,SAAS,KAAA,CAAS;GACjC,WAAW,IACP,uFACA,6FACA,YAAY,iCACZ,CAAC,SAAS,+BACd;aATJ,CAWI,oBAAC,OAAD;IAAK,WAAW,IACZ,YACA,gGACA,kCACJ;cACK,CAAC,SAAS,oBAAC,WAAD,EAAW,MAAM,UAAW,CAAA;GACtC,CAAA,GACL,oBAAC,QAAD;IAAM,WAAU;cAAuD;GAEjE,CAAA,CACF;MAMX,MAAM,KAAK,SACR,oBAAC,OAAD;GAAgB,WAAU;aACrB,YAAY,KAAK,SAAS;IAIvB,MAAM,WAAY,SAAS,YAAY,OAAO,GAAG,OAAO;IACxD,MAAM,cAAc,YAAY;IAChC,MAAM,aAAa,UAAU;IAC7B,MAAM,cAAc,oBAAoB,MAAM,IAAI;IAElD,OACI,oBAAC,SAAD;KAEI,OAAO;KACP,eAAe;eAEf,oBAAC,UAAD;MACI,MAAK;MACK;MACV,eAAe,SAAS,QAAQ;MAChC,WAAW,IACP,YACA,gEACA,mCACA,kGACA,YAAY,iDACZ,cAAc,mCAClB;MACA,OAAO,EACH,iBAAiB,YAAY,MACjC;MACA,cAAY;MACZ,gBAAc;gBAEb,cACG,oBAAC,WAAD;OACI,MAAM;OACN,OAAO,EAAE,OAAO,YAAY,KAAK;MACpC,CAAA;KAED,CAAA;IACH,GA7BA,QA6BA;GAEjB,CAAC;EACA,GA5CK,IA4CL,CACR,CACA;;AAEb"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cls } from "../util/cls.es.js";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/Container.tsx
|
|
6
|
+
var containerMaxWidths = {
|
|
7
|
+
xs: "max-w-xs",
|
|
8
|
+
sm: "max-w-sm",
|
|
9
|
+
md: "max-w-md",
|
|
10
|
+
lg: "max-w-lg",
|
|
11
|
+
xl: "max-w-xl",
|
|
12
|
+
"2xl": "max-w-2xl",
|
|
13
|
+
"3xl": "max-w-3xl",
|
|
14
|
+
"4xl": "max-w-4xl",
|
|
15
|
+
"5xl": "max-w-5xl",
|
|
16
|
+
"6xl": "max-w-6xl",
|
|
17
|
+
"7xl": "max-w-7xl"
|
|
18
|
+
};
|
|
19
|
+
var ContainerInner = ({ children, className, style, maxWidth = "7xl" }, ref) => {
|
|
20
|
+
return /* @__PURE__ */ jsx("div", {
|
|
21
|
+
ref,
|
|
22
|
+
className: cls("mx-auto px-3 md:px-4 lg:px-6", maxWidth ? containerMaxWidths[maxWidth] : "", className),
|
|
23
|
+
style,
|
|
24
|
+
children
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
var Container = React.forwardRef(ContainerInner);
|
|
28
|
+
//#endregion
|
|
29
|
+
export { Container };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=Container.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Container.es.js","names":[],"sources":["../../src/components/Container.tsx"],"sourcesContent":["\"use client\";\nimport React, { ForwardRefRenderFunction } from \"react\";\nimport { cls } from \"../util\";\n\nexport type ContainerProps = {\n children: React.ReactNode;\n style?: React.CSSProperties;\n className?: string;\n maxWidth?: \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\" | \"3xl\" | \"4xl\" | \"5xl\" | \"6xl\" | \"7xl\";\n}\n\nconst containerMaxWidths = {\n xs: \"max-w-xs\",\n sm: \"max-w-sm\",\n md: \"max-w-md\",\n lg: \"max-w-lg\",\n xl: \"max-w-xl\",\n \"2xl\": \"max-w-2xl\",\n \"3xl\": \"max-w-3xl\",\n \"4xl\": \"max-w-4xl\",\n \"5xl\": \"max-w-5xl\",\n \"6xl\": \"max-w-6xl\",\n \"7xl\": \"max-w-7xl\"\n}\n\nconst ContainerInner: ForwardRefRenderFunction<HTMLDivElement, ContainerProps> = (\n {\n children,\n className,\n style,\n maxWidth = \"7xl\"\n },\n ref\n) => {\n\n const classForMaxWidth = maxWidth ? containerMaxWidths[maxWidth] : \"\";\n\n return (\n <div\n ref={ref}\n className={cls(\"mx-auto px-3 md:px-4 lg:px-6\",\n classForMaxWidth,\n className)}\n style={style}>\n {children}\n </div>\n );\n}\n\nexport const Container = React.forwardRef(ContainerInner);\n\n"],"mappings":";;;;;AAWA,IAAM,qBAAqB;CACvB,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,OAAO;CACP,OAAO;CACP,OAAO;CACP,OAAO;CACP,OAAO;CACP,OAAO;AACX;AAEA,IAAM,kBACF,EACI,UACA,WACA,OACA,WAAW,SAEf,QACC;CAID,OACI,oBAAC,OAAD;EACS;EACL,WAAW,IAAI,gCALE,WAAW,mBAAmB,YAAY,IAOvD,SAAS;EACN;EACN;CACA,CAAA;AAEb;AAEA,IAAa,YAAY,MAAM,WAAW,cAAc"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* What the field picks: a day, a day and a time, or a time of day alone. A
|
|
4
|
+
* time of day is a `Date` on 1970-01-01 — how a `time` column travels — read
|
|
5
|
+
* and written in `timezone`.
|
|
6
|
+
*/
|
|
7
|
+
export type DateTimeFieldMode = "date" | "date_time" | "time";
|
|
2
8
|
export type DateTimeFieldProps = {
|
|
3
9
|
value?: Date | null;
|
|
4
10
|
onChange?: (date: Date | null) => void;
|
|
5
|
-
mode?:
|
|
11
|
+
mode?: DateTimeFieldMode;
|
|
6
12
|
disabled?: boolean;
|
|
7
13
|
clearable?: boolean;
|
|
8
14
|
error?: boolean;
|
|
@@ -20,6 +26,10 @@ export type DateTimeFieldProps = {
|
|
|
20
26
|
pickerButton?: boolean;
|
|
21
27
|
/** The native input, for a caller that opens the picker itself (`showPicker()`). */
|
|
22
28
|
inputRef?: React.Ref<HTMLInputElement>;
|
|
29
|
+
/**
|
|
30
|
+
* BCP 47 locale, set as the input's `lang`. The browser still draws a
|
|
31
|
+
* native date input in its own UI language; this is the hint it may use.
|
|
32
|
+
*/
|
|
23
33
|
locale?: string;
|
|
24
34
|
/**
|
|
25
35
|
* IANA timezone string (e.g., "America/New_York", "Europe/London").
|