@jcsoftdev/ui 0.3.0 → 0.4.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/CHANGELOG.md +103 -1
- package/README.md +55 -2
- package/bin/ui-theme.mjs +13 -2
- package/dist/atoms/checkbox/checkbox.js +3 -1
- package/dist/atoms/chip/chip.d.ts +11 -3
- package/dist/atoms/chip/chip.js +8 -1
- package/dist/atoms/chip/index.d.ts +1 -1
- package/dist/atoms/chip/index.js +2 -0
- package/dist/atoms/due-chip/due-chip.d.ts +31 -0
- package/dist/atoms/due-chip/due-chip.js +41 -0
- package/dist/atoms/due-chip/index.d.ts +2 -0
- package/dist/atoms/due-chip/index.js +6 -0
- package/dist/atoms/due-chip/model.d.ts +25 -0
- package/dist/atoms/due-chip/model.js +44 -0
- package/dist/atoms/icon-button/icon-button.d.ts +22 -0
- package/dist/atoms/icon-button/icon-button.js +38 -0
- package/dist/atoms/icon-button/index.d.ts +1 -0
- package/dist/atoms/icon-button/index.js +8 -0
- package/dist/atoms/index.d.ts +5 -0
- package/dist/atoms/index.js +5 -0
- package/dist/atoms/internal/hit-area.d.ts +6 -0
- package/dist/atoms/internal/hit-area.js +4 -0
- package/dist/atoms/kbd/index.d.ts +1 -0
- package/dist/atoms/kbd/index.js +4 -0
- package/dist/atoms/kbd/kbd.d.ts +7 -0
- package/dist/atoms/kbd/kbd.js +17 -0
- package/dist/atoms/radio-group/radio-group.js +6 -2
- package/dist/atoms/seal/index.d.ts +1 -0
- package/dist/atoms/seal/index.js +4 -0
- package/dist/atoms/seal/seal.d.ts +30 -0
- package/dist/atoms/seal/seal.js +71 -0
- package/dist/atoms/spinner/index.d.ts +1 -0
- package/dist/atoms/spinner/index.js +5 -0
- package/dist/atoms/spinner/spinner.d.ts +19 -0
- package/dist/atoms/spinner/spinner.js +31 -0
- package/dist/atoms/switch/switch.js +3 -1
- package/dist/calendar/date-calendar/date-calendar.d.ts +32 -0
- package/dist/calendar/date-calendar/date-calendar.js +189 -0
- package/dist/calendar/date-calendar/index.d.ts +1 -0
- package/dist/calendar/date-calendar/index.js +6 -0
- package/dist/calendar/index.d.ts +1 -0
- package/dist/calendar/index.js +1 -0
- package/dist/calendar/internal/date-utils.d.ts +26 -0
- package/dist/calendar/internal/date-utils.js +95 -1
- package/dist/containers/aside/aside.d.ts +14 -0
- package/dist/containers/aside/aside.js +25 -0
- package/dist/containers/aside/index.d.ts +1 -0
- package/dist/containers/aside/index.js +5 -0
- package/dist/containers/banner/banner.d.ts +4 -1
- package/dist/containers/banner/banner.js +9 -1
- package/dist/containers/description-list/description-list.d.ts +29 -6
- package/dist/containers/description-list/description-list.js +47 -6
- package/dist/containers/feed/feed.d.ts +23 -0
- package/dist/containers/feed/feed.js +77 -0
- package/dist/containers/feed/index.d.ts +2 -0
- package/dist/containers/feed/index.js +10 -0
- package/dist/containers/feed/model.d.ts +19 -0
- package/dist/containers/feed/model.js +38 -0
- package/dist/containers/index.d.ts +6 -0
- package/dist/containers/index.js +6 -0
- package/dist/containers/kpi/kpi.d.ts +50 -8
- package/dist/containers/kpi/kpi.js +91 -39
- package/dist/containers/list-detail/index.d.ts +1 -0
- package/dist/containers/list-detail/index.js +20 -0
- package/dist/containers/list-detail/list-detail.d.ts +55 -0
- package/dist/containers/list-detail/list-detail.js +221 -0
- package/dist/containers/note/index.d.ts +1 -0
- package/dist/containers/note/index.js +4 -0
- package/dist/containers/note/note.d.ts +13 -0
- package/dist/containers/note/note.js +27 -0
- package/dist/containers/section/index.d.ts +1 -0
- package/dist/containers/section/index.js +6 -0
- package/dist/containers/section/section.d.ts +68 -0
- package/dist/containers/section/section.js +198 -0
- package/dist/containers/shortcuts/index.d.ts +1 -0
- package/dist/containers/shortcuts/index.js +8 -0
- package/dist/containers/shortcuts/shortcuts.d.ts +18 -0
- package/dist/containers/shortcuts/shortcuts.js +50 -0
- package/dist/containers/table/selection.d.ts +9 -0
- package/dist/containers/table/selection.js +20 -0
- package/dist/containers/table/table.d.ts +66 -4
- package/dist/containers/table/table.js +128 -7
- package/dist/containers/timeline/index.d.ts +1 -1
- package/dist/containers/timeline/index.js +4 -2
- package/dist/containers/timeline/timeline.d.ts +32 -5
- package/dist/containers/timeline/timeline.js +154 -90
- package/dist/forms/chip-group/chip-group.d.ts +54 -0
- package/dist/forms/chip-group/chip-group.js +114 -0
- package/dist/forms/chip-group/index.d.ts +1 -0
- package/dist/forms/chip-group/index.js +6 -0
- package/dist/forms/combobox/combobox.d.ts +60 -0
- package/dist/forms/combobox/combobox.js +281 -0
- package/dist/forms/combobox/index.d.ts +1 -0
- package/dist/forms/combobox/index.js +6 -0
- package/dist/forms/date-picker/date-picker.d.ts +40 -0
- package/dist/forms/date-picker/date-picker.js +183 -0
- package/dist/forms/date-picker/date-time-picker.d.ts +43 -0
- package/dist/forms/date-picker/date-time-picker.js +121 -0
- package/dist/forms/date-picker/index.d.ts +2 -0
- package/dist/forms/date-picker/index.js +10 -0
- package/dist/forms/date-picker/model.d.ts +35 -0
- package/dist/forms/date-picker/model.js +83 -0
- package/dist/forms/dropzone/dropzone.d.ts +30 -2
- package/dist/forms/dropzone/dropzone.js +153 -23
- package/dist/forms/field/field.d.ts +16 -10
- package/dist/forms/field/field.js +41 -5
- package/dist/forms/index.d.ts +4 -0
- package/dist/forms/index.js +4 -0
- package/dist/forms/input/index.d.ts +1 -1
- package/dist/forms/input/index.js +4 -1
- package/dist/forms/input/input.d.ts +21 -5
- package/dist/forms/input/input.js +74 -9
- package/dist/forms/input-icon/input-icon.d.ts +1 -1
- package/dist/forms/internal/listbox-items.d.ts +18 -0
- package/dist/forms/internal/listbox-items.js +88 -0
- package/dist/forms/internal/listbox.d.ts +44 -0
- package/dist/forms/internal/listbox.js +74 -0
- package/dist/forms/number-stepper/model.d.ts +16 -0
- package/dist/forms/number-stepper/model.js +23 -0
- package/dist/forms/number-stepper/number-stepper.d.ts +36 -6
- package/dist/forms/number-stepper/number-stepper.js +86 -37
- package/dist/forms/select-menu/index.d.ts +1 -0
- package/dist/forms/select-menu/index.js +6 -0
- package/dist/forms/select-menu/select-menu.d.ts +35 -0
- package/dist/forms/select-menu/select-menu.js +230 -0
- package/dist/i18n/strings.d.ts +89 -0
- package/dist/i18n/strings.js +54 -2
- package/dist/i18n/ui-strings-provider.d.ts +1 -1
- package/dist/i18n/ui-strings-provider.js +6 -2
- package/dist/navigation/index.d.ts +1 -0
- package/dist/navigation/index.js +1 -0
- package/dist/navigation/stepper/index.d.ts +1 -1
- package/dist/navigation/stepper/index.js +3 -1
- package/dist/navigation/stepper/stepper.d.ts +8 -0
- package/dist/navigation/stepper/stepper.js +68 -45
- package/dist/navigation/tabs/index.d.ts +1 -0
- package/dist/navigation/tabs/index.js +6 -0
- package/dist/navigation/tabs/tabs-nav.d.ts +37 -0
- package/dist/navigation/tabs/tabs-nav.js +57 -0
- package/dist/navigation/wizard/index.d.ts +1 -0
- package/dist/navigation/wizard/index.js +6 -0
- package/dist/navigation/wizard/model.d.ts +33 -0
- package/dist/navigation/wizard/model.js +34 -0
- package/dist/navigation/wizard/wizard.d.ts +45 -0
- package/dist/navigation/wizard/wizard.js +169 -0
- package/dist/overlays/alert-dialog/alert-dialog.d.ts +103 -0
- package/dist/overlays/alert-dialog/alert-dialog.js +342 -0
- package/dist/overlays/alert-dialog/index.d.ts +1 -0
- package/dist/overlays/alert-dialog/index.js +26 -0
- package/dist/overlays/dropdown-menu/dropdown-menu.d.ts +17 -1
- package/dist/overlays/dropdown-menu/dropdown-menu.js +12 -4
- package/dist/overlays/dropdown-menu/index.d.ts +1 -1
- package/dist/overlays/dropdown-menu/index.js +8 -2
- package/dist/overlays/index.d.ts +2 -0
- package/dist/overlays/index.js +2 -0
- package/dist/overlays/testing/index.d.ts +5 -0
- package/dist/overlays/testing/index.js +4 -0
- package/dist/overlays/toaster/index.d.ts +2 -1
- package/dist/overlays/toaster/index.js +4 -2
- package/dist/overlays/toaster/toast-store.d.ts +6 -2
- package/dist/overlays/toaster/toast.d.ts +3 -0
- package/dist/overlays/toaster/toast.js +3 -0
- package/dist/overlays/toaster/toaster.d.ts +3 -0
- package/dist/overlays/toaster/toaster.js +36 -3
- package/dist/overlays/tooltip/index.d.ts +1 -0
- package/dist/overlays/tooltip/index.js +4 -0
- package/dist/overlays/tooltip/model.d.ts +10 -0
- package/dist/overlays/tooltip/model.js +13 -0
- package/dist/overlays/tooltip/tooltip.d.ts +41 -0
- package/dist/overlays/tooltip/tooltip.js +116 -0
- package/dist/primitives/use-dismissable-layer.js +1 -1
- package/dist/states/error-state/error-state.d.ts +6 -1
- package/dist/states/error-state/error-state.js +13 -9
- package/dist/states/skeleton/skeleton.d.ts +8 -2
- package/dist/states/skeleton/skeleton.js +44 -2
- package/package.json +2 -2
- package/scripts/build-theme.mjs +12 -1
- package/src/atoms/checkbox/checkbox.tsx +3 -1
- package/src/atoms/chip/chip.tsx +18 -3
- package/src/atoms/chip/index.ts +2 -0
- package/src/atoms/due-chip/due-chip.tsx +75 -0
- package/src/atoms/due-chip/index.ts +2 -0
- package/src/atoms/due-chip/model.ts +67 -0
- package/src/atoms/icon-button/icon-button.tsx +58 -0
- package/src/atoms/icon-button/index.ts +6 -0
- package/src/atoms/index.ts +5 -0
- package/src/atoms/internal/hit-area.ts +7 -0
- package/src/atoms/kbd/index.ts +1 -0
- package/src/atoms/kbd/kbd.tsx +20 -0
- package/src/atoms/radio-group/radio-group.tsx +8 -2
- package/src/atoms/seal/index.ts +1 -0
- package/src/atoms/seal/seal.tsx +107 -0
- package/src/atoms/spinner/index.ts +1 -0
- package/src/atoms/spinner/spinner.tsx +49 -0
- package/src/atoms/switch/switch.tsx +3 -1
- package/src/calendar/date-calendar/date-calendar.tsx +230 -0
- package/src/calendar/date-calendar/index.ts +5 -0
- package/src/calendar/index.ts +1 -0
- package/src/calendar/internal/date-utils.ts +115 -0
- package/src/containers/aside/aside.tsx +40 -0
- package/src/containers/aside/index.ts +1 -0
- package/src/containers/banner/banner.tsx +18 -1
- package/src/containers/description-list/description-list.tsx +85 -9
- package/src/containers/feed/feed.tsx +99 -0
- package/src/containers/feed/index.ts +8 -0
- package/src/containers/feed/model.ts +54 -0
- package/src/containers/index.ts +6 -0
- package/src/containers/kpi/kpi.tsx +161 -62
- package/src/containers/list-detail/index.ts +15 -0
- package/src/containers/list-detail/list-detail.tsx +293 -0
- package/src/containers/note/index.ts +1 -0
- package/src/containers/note/note.tsx +38 -0
- package/src/containers/section/index.ts +11 -0
- package/src/containers/section/section.tsx +281 -0
- package/src/containers/shortcuts/index.ts +6 -0
- package/src/containers/shortcuts/shortcuts.tsx +92 -0
- package/src/containers/table/selection.ts +26 -0
- package/src/containers/table/table.tsx +215 -13
- package/src/containers/timeline/index.ts +3 -0
- package/src/containers/timeline/timeline.tsx +204 -93
- package/src/forms/chip-group/chip-group.tsx +184 -0
- package/src/forms/chip-group/index.ts +8 -0
- package/src/forms/combobox/combobox.tsx +359 -0
- package/src/forms/combobox/index.ts +7 -0
- package/src/forms/date-picker/date-picker.tsx +239 -0
- package/src/forms/date-picker/date-time-picker.tsx +178 -0
- package/src/forms/date-picker/index.ts +10 -0
- package/src/forms/date-picker/model.ts +108 -0
- package/src/forms/dropzone/dropzone.tsx +217 -35
- package/src/forms/field/field.tsx +72 -7
- package/src/forms/index.ts +4 -0
- package/src/forms/input/index.ts +8 -1
- package/src/forms/input/input.tsx +97 -12
- package/src/forms/input-icon/input-icon.tsx +1 -1
- package/src/forms/internal/listbox-items.tsx +103 -0
- package/src/forms/internal/listbox.ts +124 -0
- package/src/forms/number-stepper/model.ts +35 -0
- package/src/forms/number-stepper/number-stepper.tsx +132 -42
- package/src/forms/select-menu/index.ts +7 -0
- package/src/forms/select-menu/select-menu.tsx +280 -0
- package/src/i18n/strings.ts +89 -0
- package/src/i18n/ui-strings-provider.tsx +15 -4
- package/src/navigation/index.ts +1 -0
- package/src/navigation/stepper/index.ts +7 -1
- package/src/navigation/stepper/stepper.tsx +41 -5
- package/src/navigation/tabs/index.ts +7 -0
- package/src/navigation/tabs/tabs-nav.tsx +131 -0
- package/src/navigation/wizard/index.ts +7 -0
- package/src/navigation/wizard/model.ts +61 -0
- package/src/navigation/wizard/wizard.tsx +222 -0
- package/src/overlays/alert-dialog/alert-dialog.tsx +486 -0
- package/src/overlays/alert-dialog/index.ts +19 -0
- package/src/overlays/dropdown-menu/dropdown-menu.tsx +29 -4
- package/src/overlays/dropdown-menu/index.ts +3 -0
- package/src/overlays/index.ts +2 -0
- package/src/overlays/testing/index.ts +5 -0
- package/src/overlays/toaster/index.ts +2 -0
- package/src/overlays/toaster/toast-store.ts +6 -2
- package/src/overlays/toaster/toast.ts +6 -0
- package/src/overlays/toaster/toaster.tsx +44 -2
- package/src/overlays/tooltip/index.ts +1 -0
- package/src/overlays/tooltip/model.ts +18 -0
- package/src/overlays/tooltip/tooltip.tsx +166 -0
- package/src/primitives/use-dismissable-layer.ts +7 -2
- package/src/states/error-state/error-state.tsx +19 -8
- package/src/states/skeleton/skeleton.tsx +68 -2
- package/styles/tailwind.css +33 -30
- package/styles/theme.css +33 -30
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type ComponentProps } from "react";
|
|
2
|
+
import type { ClassNames } from "../../utils/class-names.js";
|
|
3
|
+
import { type Material } from "../../utils/material.js";
|
|
4
|
+
import { type ListboxGroup, type ListboxOption } from "../internal/listbox.js";
|
|
5
|
+
export type SelectMenuOption = Omit<ListboxOption, "keywords">;
|
|
6
|
+
export type SelectMenuGroup = ListboxGroup<SelectMenuOption>;
|
|
7
|
+
export type SelectMenuPart = "trigger" | "value" | "icon" | "content" | "option" | "group";
|
|
8
|
+
export interface SelectMenuProps extends Omit<ComponentProps<"button">, "value" | "defaultValue" | "onChange" | "children" | "type" | "role" | "size"> {
|
|
9
|
+
/** Options, optionally nested in labelled groups. A `value` of `""` is a real option, not "nothing". */
|
|
10
|
+
options: readonly (SelectMenuOption | SelectMenuGroup)[];
|
|
11
|
+
/** Selected value (controlled). An unknown value or `undefined` shows the placeholder. */
|
|
12
|
+
value?: string;
|
|
13
|
+
defaultValue?: string;
|
|
14
|
+
onValueChange?: (value: string) => void;
|
|
15
|
+
/** Shown while no option is selected. Defaults to the localized "Select…". */
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
/** Submits the value with a surrounding `<form>` through a hidden input. */
|
|
18
|
+
name?: string;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
invalid?: boolean;
|
|
21
|
+
size?: "sm" | "md";
|
|
22
|
+
/** Portal target for the popup. Defaults to `document.body`; pass an element to keep a scoped `data-style`. */
|
|
23
|
+
container?: HTMLElement | null;
|
|
24
|
+
/** Popup surface material; see `PopoverContent`. */
|
|
25
|
+
material?: Material;
|
|
26
|
+
/** Per-part classes merged with `cn`; consumer classes win. `className` still targets the trigger and is merged last. */
|
|
27
|
+
classNames?: ClassNames<SelectMenuPart>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Select with a custom listbox popup, for option lists that need descriptions, groups or a
|
|
31
|
+
* styled popup. Select-only combobox pattern (WAI-ARIA APG): focus stays on the trigger and the
|
|
32
|
+
* highlighted option is announced through `aria-activedescendant`. Use `NativeSelect` when the
|
|
33
|
+
* system picker is preferable (long lists on phones).
|
|
34
|
+
*/
|
|
35
|
+
export declare function SelectMenu({ options, value: valueProp, defaultValue, onValueChange, placeholder, name, required, invalid, size, container, material, disabled, className, classNames, onKeyDown, onKeyUp, onClick, ref, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-invalid": ariaInvalid, ...props }: SelectMenuProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
useEffect,
|
|
5
|
+
useId,
|
|
6
|
+
useMemo,
|
|
7
|
+
useRef,
|
|
8
|
+
useState
|
|
9
|
+
} from "react";
|
|
10
|
+
import { useUiStrings } from "../../i18n/index.js";
|
|
11
|
+
import { ChevronDown } from "../../icons/index.js";
|
|
12
|
+
import * as PopoverPrimitive from "../../primitives/popover/popover.js";
|
|
13
|
+
import { cn } from "../../utils/cn.js";
|
|
14
|
+
import { useComposedRefs } from "../../utils/compose.js";
|
|
15
|
+
import { materialClass } from "../../utils/material.js";
|
|
16
|
+
import { useControllableState } from "../../utils/use-controllable-state.js";
|
|
17
|
+
import {
|
|
18
|
+
flattenItems,
|
|
19
|
+
isTypeaheadKey,
|
|
20
|
+
moveActive,
|
|
21
|
+
nextTypeahead,
|
|
22
|
+
typeaheadIndex
|
|
23
|
+
} from "../internal/listbox.js";
|
|
24
|
+
import { LISTBOX_SURFACE, ListboxItems, optionDomId } from "../internal/listbox-items.js";
|
|
25
|
+
const TYPEAHEAD_MS = 600;
|
|
26
|
+
const OPEN_KEYS = /* @__PURE__ */ new Set(["ArrowDown", "ArrowUp", "Enter", " "]);
|
|
27
|
+
function SelectMenu({
|
|
28
|
+
options,
|
|
29
|
+
value: valueProp,
|
|
30
|
+
defaultValue,
|
|
31
|
+
onValueChange,
|
|
32
|
+
placeholder,
|
|
33
|
+
name,
|
|
34
|
+
required,
|
|
35
|
+
invalid,
|
|
36
|
+
size = "md",
|
|
37
|
+
container,
|
|
38
|
+
material,
|
|
39
|
+
disabled,
|
|
40
|
+
className,
|
|
41
|
+
classNames,
|
|
42
|
+
onKeyDown,
|
|
43
|
+
onKeyUp,
|
|
44
|
+
onClick,
|
|
45
|
+
ref,
|
|
46
|
+
id,
|
|
47
|
+
"aria-label": ariaLabel,
|
|
48
|
+
"aria-labelledby": ariaLabelledBy,
|
|
49
|
+
"aria-invalid": ariaInvalid,
|
|
50
|
+
...props
|
|
51
|
+
}) {
|
|
52
|
+
const strings = useUiStrings();
|
|
53
|
+
const listId = useId();
|
|
54
|
+
const triggerRef = useRef(null);
|
|
55
|
+
const composedRef = useComposedRefs(ref, triggerRef);
|
|
56
|
+
const typeahead = useRef({ buffer: "", at: 0 });
|
|
57
|
+
const [value, setValue] = useControllableState({
|
|
58
|
+
prop: valueProp,
|
|
59
|
+
defaultProp: defaultValue,
|
|
60
|
+
onChange: (next) => {
|
|
61
|
+
if (next !== void 0) onValueChange?.(next);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
const [open, setOpenState] = useState(false);
|
|
65
|
+
const [active, setActive] = useState(-1);
|
|
66
|
+
const [listLabel, setListLabel] = useState();
|
|
67
|
+
const flat = useMemo(() => flattenItems(options), [options]);
|
|
68
|
+
const selectedIndex = flat.findIndex((option) => option.value === value);
|
|
69
|
+
const selected = flat[selectedIndex];
|
|
70
|
+
const isDisabled = Boolean(disabled);
|
|
71
|
+
const setOpen = (next, move) => {
|
|
72
|
+
if (next && isDisabled) return;
|
|
73
|
+
if (next) {
|
|
74
|
+
const preferred = selected && !selected.disabled ? selectedIndex : -1;
|
|
75
|
+
setActive(
|
|
76
|
+
move ? moveActive(flat, move === "last" ? flat.length : -1, move) : preferred >= 0 ? preferred : moveActive(flat, -1, "first")
|
|
77
|
+
);
|
|
78
|
+
setListLabel(triggerRef.current?.labels?.[0]?.textContent?.trim() || void 0);
|
|
79
|
+
}
|
|
80
|
+
setOpenState(next);
|
|
81
|
+
};
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
if (!open || active < 0) return;
|
|
84
|
+
document.getElementById(optionDomId(listId, active))?.scrollIntoView?.({ block: "nearest" });
|
|
85
|
+
}, [open, active, listId]);
|
|
86
|
+
const pick = (index) => {
|
|
87
|
+
const option = flat[index];
|
|
88
|
+
if (!option || option.disabled) return;
|
|
89
|
+
setValue(option.value);
|
|
90
|
+
setOpenState(false);
|
|
91
|
+
};
|
|
92
|
+
const handleKeyDown = (event) => {
|
|
93
|
+
onKeyDown?.(event);
|
|
94
|
+
if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey) return;
|
|
95
|
+
const { key } = event;
|
|
96
|
+
const buffering = typeahead.current.buffer !== "" && Date.now() - typeahead.current.at <= TYPEAHEAD_MS;
|
|
97
|
+
const typing = isTypeaheadKey(event) && !(key === " " && !buffering);
|
|
98
|
+
if (typing) {
|
|
99
|
+
event.preventDefault();
|
|
100
|
+
typeahead.current = nextTypeahead(typeahead.current, key, Date.now());
|
|
101
|
+
const found = typeaheadIndex(flat, typeahead.current.buffer, open ? active : selectedIndex);
|
|
102
|
+
if (found < 0) return;
|
|
103
|
+
if (open) setActive(found);
|
|
104
|
+
else pick(found);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (!open) {
|
|
108
|
+
if (OPEN_KEYS.has(key)) {
|
|
109
|
+
event.preventDefault();
|
|
110
|
+
setOpen(true);
|
|
111
|
+
} else if (key === "Home" || key === "End") {
|
|
112
|
+
event.preventDefault();
|
|
113
|
+
setOpen(true, key === "Home" ? "first" : "last");
|
|
114
|
+
}
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const moves = {
|
|
118
|
+
ArrowDown: "next",
|
|
119
|
+
ArrowUp: "prev",
|
|
120
|
+
Home: "first",
|
|
121
|
+
End: "last"
|
|
122
|
+
};
|
|
123
|
+
const move = moves[key];
|
|
124
|
+
if (move) {
|
|
125
|
+
event.preventDefault();
|
|
126
|
+
setActive((current) => moveActive(flat, current, move));
|
|
127
|
+
} else if (key === "Enter" || key === " ") {
|
|
128
|
+
event.preventDefault();
|
|
129
|
+
pick(active);
|
|
130
|
+
} else if (key === "Tab") {
|
|
131
|
+
setOpenState(false);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
const showPlaceholder = !selected;
|
|
135
|
+
return /* @__PURE__ */ jsxs(PopoverPrimitive.Root, { open, onOpenChange: (next) => setOpen(next), children: [
|
|
136
|
+
/* @__PURE__ */ jsxs(
|
|
137
|
+
PopoverPrimitive.Trigger,
|
|
138
|
+
{
|
|
139
|
+
ref: composedRef,
|
|
140
|
+
id,
|
|
141
|
+
role: "combobox",
|
|
142
|
+
"data-ui-layer": "",
|
|
143
|
+
"aria-haspopup": "listbox",
|
|
144
|
+
"aria-expanded": open,
|
|
145
|
+
"aria-controls": open ? listId : void 0,
|
|
146
|
+
"aria-activedescendant": open && active >= 0 ? optionDomId(listId, active) : void 0,
|
|
147
|
+
"aria-required": required || void 0,
|
|
148
|
+
"aria-invalid": ariaInvalid ?? (invalid || void 0),
|
|
149
|
+
"aria-label": ariaLabel,
|
|
150
|
+
"aria-labelledby": ariaLabelledBy,
|
|
151
|
+
disabled,
|
|
152
|
+
"data-placeholder": showPlaceholder ? "" : void 0,
|
|
153
|
+
...props,
|
|
154
|
+
onClick: (event) => {
|
|
155
|
+
onClick?.(event);
|
|
156
|
+
event.currentTarget.focus({ preventScroll: true });
|
|
157
|
+
},
|
|
158
|
+
onKeyDown: handleKeyDown,
|
|
159
|
+
onKeyUp: (event) => {
|
|
160
|
+
onKeyUp?.(event);
|
|
161
|
+
if (event.key === " ") event.preventDefault();
|
|
162
|
+
},
|
|
163
|
+
className: cn(
|
|
164
|
+
"flex w-full min-w-0 items-center justify-between gap-2 rounded-input border-control bg-surface-control py-0 pr-2.5 pl-3 text-left text-control text-ink focus:border-transparent focus:outline-2 focus:outline-accent-ink focus:-outline-offset-1 disabled:cursor-not-allowed disabled:opacity-50 aria-[invalid=true]:border-danger",
|
|
165
|
+
size === "sm" ? "h-control-sm" : "h-input min-h-(--touch-target)",
|
|
166
|
+
classNames?.trigger,
|
|
167
|
+
className
|
|
168
|
+
),
|
|
169
|
+
children: [
|
|
170
|
+
/* @__PURE__ */ jsx(
|
|
171
|
+
"span",
|
|
172
|
+
{
|
|
173
|
+
className: cn(
|
|
174
|
+
"min-w-0 flex-1 truncate",
|
|
175
|
+
showPlaceholder && "text-ink-3",
|
|
176
|
+
classNames?.value
|
|
177
|
+
),
|
|
178
|
+
children: selected?.label ?? placeholder ?? strings.selectPlaceholder
|
|
179
|
+
}
|
|
180
|
+
),
|
|
181
|
+
/* @__PURE__ */ jsx(
|
|
182
|
+
ChevronDown,
|
|
183
|
+
{
|
|
184
|
+
"aria-hidden": "true",
|
|
185
|
+
className: cn("size-3.5 shrink-0 text-ink-3", classNames?.icon)
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
),
|
|
191
|
+
name ? /* @__PURE__ */ jsx("input", { type: "hidden", name, value: value ?? "", disabled }) : null,
|
|
192
|
+
/* @__PURE__ */ jsx(PopoverPrimitive.Portal, { container, children: /* @__PURE__ */ jsx(
|
|
193
|
+
PopoverPrimitive.Content,
|
|
194
|
+
{
|
|
195
|
+
id: listId,
|
|
196
|
+
role: "listbox",
|
|
197
|
+
"data-ui-layer": "",
|
|
198
|
+
"aria-label": ariaLabelledBy ? void 0 : ariaLabel ?? listLabel ?? placeholder,
|
|
199
|
+
"aria-labelledby": ariaLabelledBy,
|
|
200
|
+
sideOffset: 4,
|
|
201
|
+
collisionPadding: 8,
|
|
202
|
+
align: "start",
|
|
203
|
+
onOpenAutoFocus: (event) => event.preventDefault(),
|
|
204
|
+
onCloseAutoFocus: (event) => event.preventDefault(),
|
|
205
|
+
className: cn(
|
|
206
|
+
LISTBOX_SURFACE,
|
|
207
|
+
materialClass(material, "surface-solid"),
|
|
208
|
+
classNames?.content
|
|
209
|
+
),
|
|
210
|
+
children: /* @__PURE__ */ jsx(
|
|
211
|
+
ListboxItems,
|
|
212
|
+
{
|
|
213
|
+
items: options,
|
|
214
|
+
flat,
|
|
215
|
+
idBase: listId,
|
|
216
|
+
isSelected: (option) => option.value === value,
|
|
217
|
+
activeIndex: active,
|
|
218
|
+
onActivate: setActive,
|
|
219
|
+
onPick: (option) => pick(flat.indexOf(option)),
|
|
220
|
+
optionClassName: classNames?.option,
|
|
221
|
+
groupClassName: classNames?.group
|
|
222
|
+
}
|
|
223
|
+
)
|
|
224
|
+
}
|
|
225
|
+
) })
|
|
226
|
+
] });
|
|
227
|
+
}
|
|
228
|
+
export {
|
|
229
|
+
SelectMenu
|
|
230
|
+
};
|
package/dist/i18n/strings.d.ts
CHANGED
|
@@ -19,6 +19,43 @@ export interface UiStrings {
|
|
|
19
19
|
copied: string;
|
|
20
20
|
more: string;
|
|
21
21
|
remove: string;
|
|
22
|
+
noResults: string;
|
|
23
|
+
clear: string;
|
|
24
|
+
selectPlaceholder: string;
|
|
25
|
+
openCalendar: string;
|
|
26
|
+
calendar: string;
|
|
27
|
+
previousMonth: string;
|
|
28
|
+
nextMonth: string;
|
|
29
|
+
time: string;
|
|
30
|
+
/** BCP 47 locale used for date labels and the typed date format. */
|
|
31
|
+
locale: string;
|
|
32
|
+
dayPlaceholder: string;
|
|
33
|
+
monthPlaceholder: string;
|
|
34
|
+
yearPlaceholder: string;
|
|
35
|
+
back: string;
|
|
36
|
+
next: string;
|
|
37
|
+
finish: string;
|
|
38
|
+
/** Step announcement; `{current}`, `{total}` and `{label}` are replaced. */
|
|
39
|
+
stepOf: string;
|
|
40
|
+
steps: string;
|
|
41
|
+
/** Default accessible name of an `Aside`. */
|
|
42
|
+
aside: string;
|
|
43
|
+
/** Back action of a single-pane `ListDetail`. */
|
|
44
|
+
backToList: string;
|
|
45
|
+
/** Screen-reader state of a `DueChip` past its date. */
|
|
46
|
+
overdue: string;
|
|
47
|
+
/** Screen-reader state of a `DueChip` due within its `soonDays`. */
|
|
48
|
+
dueSoon: string;
|
|
49
|
+
/** Screen-reader state of a completed `Stepper` step. */
|
|
50
|
+
stepDone: string;
|
|
51
|
+
/** Screen-reader state of a `Stepper` step that has an error. */
|
|
52
|
+
stepError: string;
|
|
53
|
+
/** Name of a row checkbox in a `Table`; `{row}` is replaced by the row's label. */
|
|
54
|
+
selectRow: string;
|
|
55
|
+
/** Name of the select-all checkbox of a `Table`. */
|
|
56
|
+
selectAll: string;
|
|
57
|
+
/** Name of the overflow menu trigger of a `TableActionsCell`. */
|
|
58
|
+
rowActions: string;
|
|
22
59
|
}
|
|
23
60
|
export type UiLocale = "en" | "es";
|
|
24
61
|
export declare const uiStrings: {
|
|
@@ -43,6 +80,32 @@ export declare const uiStrings: {
|
|
|
43
80
|
readonly copied: "Copied";
|
|
44
81
|
readonly more: "More";
|
|
45
82
|
readonly remove: "Remove";
|
|
83
|
+
readonly noResults: "No results";
|
|
84
|
+
readonly clear: "Clear";
|
|
85
|
+
readonly selectPlaceholder: "Select…";
|
|
86
|
+
readonly openCalendar: "Open calendar";
|
|
87
|
+
readonly calendar: "Calendar";
|
|
88
|
+
readonly previousMonth: "Previous month";
|
|
89
|
+
readonly nextMonth: "Next month";
|
|
90
|
+
readonly time: "Time";
|
|
91
|
+
readonly locale: "en-US";
|
|
92
|
+
readonly dayPlaceholder: "dd";
|
|
93
|
+
readonly monthPlaceholder: "mm";
|
|
94
|
+
readonly yearPlaceholder: "yyyy";
|
|
95
|
+
readonly back: "Back";
|
|
96
|
+
readonly next: "Next";
|
|
97
|
+
readonly finish: "Finish";
|
|
98
|
+
readonly stepOf: "Step {current} of {total}: {label}";
|
|
99
|
+
readonly steps: "Steps";
|
|
100
|
+
readonly aside: "Related information";
|
|
101
|
+
readonly backToList: "Back to list";
|
|
102
|
+
readonly overdue: "Overdue";
|
|
103
|
+
readonly dueSoon: "Due soon";
|
|
104
|
+
readonly stepDone: "Completed";
|
|
105
|
+
readonly stepError: "Has an error";
|
|
106
|
+
readonly selectRow: "Select {row}";
|
|
107
|
+
readonly selectAll: "Select all rows";
|
|
108
|
+
readonly rowActions: "Row actions";
|
|
46
109
|
};
|
|
47
110
|
readonly es: {
|
|
48
111
|
readonly retry: "Reintentar";
|
|
@@ -65,5 +128,31 @@ export declare const uiStrings: {
|
|
|
65
128
|
readonly copied: "Copiado";
|
|
66
129
|
readonly more: "Más";
|
|
67
130
|
readonly remove: "Quitar";
|
|
131
|
+
readonly noResults: "Sin resultados";
|
|
132
|
+
readonly clear: "Limpiar";
|
|
133
|
+
readonly selectPlaceholder: "Seleccionar…";
|
|
134
|
+
readonly openCalendar: "Abrir calendario";
|
|
135
|
+
readonly calendar: "Calendario";
|
|
136
|
+
readonly previousMonth: "Mes anterior";
|
|
137
|
+
readonly nextMonth: "Mes siguiente";
|
|
138
|
+
readonly time: "Hora";
|
|
139
|
+
readonly locale: "es-PE";
|
|
140
|
+
readonly dayPlaceholder: "dd";
|
|
141
|
+
readonly monthPlaceholder: "mm";
|
|
142
|
+
readonly yearPlaceholder: "aaaa";
|
|
143
|
+
readonly back: "Atrás";
|
|
144
|
+
readonly next: "Siguiente";
|
|
145
|
+
readonly finish: "Finalizar";
|
|
146
|
+
readonly stepOf: "Paso {current} de {total}: {label}";
|
|
147
|
+
readonly steps: "Pasos";
|
|
148
|
+
readonly aside: "Información relacionada";
|
|
149
|
+
readonly backToList: "Volver a la lista";
|
|
150
|
+
readonly overdue: "Vencido";
|
|
151
|
+
readonly dueSoon: "Vence pronto";
|
|
152
|
+
readonly stepDone: "Completado";
|
|
153
|
+
readonly stepError: "Tiene un error";
|
|
154
|
+
readonly selectRow: "Seleccionar {row}";
|
|
155
|
+
readonly selectAll: "Seleccionar todas las filas";
|
|
156
|
+
readonly rowActions: "Acciones de la fila";
|
|
68
157
|
};
|
|
69
158
|
};
|
package/dist/i18n/strings.js
CHANGED
|
@@ -19,7 +19,33 @@ const uiStrings = {
|
|
|
19
19
|
copy: "Copy",
|
|
20
20
|
copied: "Copied",
|
|
21
21
|
more: "More",
|
|
22
|
-
remove: "Remove"
|
|
22
|
+
remove: "Remove",
|
|
23
|
+
noResults: "No results",
|
|
24
|
+
clear: "Clear",
|
|
25
|
+
selectPlaceholder: "Select\u2026",
|
|
26
|
+
openCalendar: "Open calendar",
|
|
27
|
+
calendar: "Calendar",
|
|
28
|
+
previousMonth: "Previous month",
|
|
29
|
+
nextMonth: "Next month",
|
|
30
|
+
time: "Time",
|
|
31
|
+
locale: "en-US",
|
|
32
|
+
dayPlaceholder: "dd",
|
|
33
|
+
monthPlaceholder: "mm",
|
|
34
|
+
yearPlaceholder: "yyyy",
|
|
35
|
+
back: "Back",
|
|
36
|
+
next: "Next",
|
|
37
|
+
finish: "Finish",
|
|
38
|
+
stepOf: "Step {current} of {total}: {label}",
|
|
39
|
+
steps: "Steps",
|
|
40
|
+
aside: "Related information",
|
|
41
|
+
backToList: "Back to list",
|
|
42
|
+
overdue: "Overdue",
|
|
43
|
+
dueSoon: "Due soon",
|
|
44
|
+
stepDone: "Completed",
|
|
45
|
+
stepError: "Has an error",
|
|
46
|
+
selectRow: "Select {row}",
|
|
47
|
+
selectAll: "Select all rows",
|
|
48
|
+
rowActions: "Row actions"
|
|
23
49
|
},
|
|
24
50
|
es: {
|
|
25
51
|
retry: "Reintentar",
|
|
@@ -41,7 +67,33 @@ const uiStrings = {
|
|
|
41
67
|
copy: "Copiar",
|
|
42
68
|
copied: "Copiado",
|
|
43
69
|
more: "M\xE1s",
|
|
44
|
-
remove: "Quitar"
|
|
70
|
+
remove: "Quitar",
|
|
71
|
+
noResults: "Sin resultados",
|
|
72
|
+
clear: "Limpiar",
|
|
73
|
+
selectPlaceholder: "Seleccionar\u2026",
|
|
74
|
+
openCalendar: "Abrir calendario",
|
|
75
|
+
calendar: "Calendario",
|
|
76
|
+
previousMonth: "Mes anterior",
|
|
77
|
+
nextMonth: "Mes siguiente",
|
|
78
|
+
time: "Hora",
|
|
79
|
+
locale: "es-PE",
|
|
80
|
+
dayPlaceholder: "dd",
|
|
81
|
+
monthPlaceholder: "mm",
|
|
82
|
+
yearPlaceholder: "aaaa",
|
|
83
|
+
back: "Atr\xE1s",
|
|
84
|
+
next: "Siguiente",
|
|
85
|
+
finish: "Finalizar",
|
|
86
|
+
stepOf: "Paso {current} de {total}: {label}",
|
|
87
|
+
steps: "Pasos",
|
|
88
|
+
aside: "Informaci\xF3n relacionada",
|
|
89
|
+
backToList: "Volver a la lista",
|
|
90
|
+
overdue: "Vencido",
|
|
91
|
+
dueSoon: "Vence pronto",
|
|
92
|
+
stepDone: "Completado",
|
|
93
|
+
stepError: "Tiene un error",
|
|
94
|
+
selectRow: "Seleccionar {row}",
|
|
95
|
+
selectAll: "Seleccionar todas las filas",
|
|
96
|
+
rowActions: "Acciones de la fila"
|
|
45
97
|
}
|
|
46
98
|
};
|
|
47
99
|
export {
|
|
@@ -3,7 +3,7 @@ import { type UiLocale, type UiStrings } from "./strings.js";
|
|
|
3
3
|
export interface UiStringsProviderProps {
|
|
4
4
|
/** Preset to start from. Without it the provider keeps the strings of its parent (default `en`). */
|
|
5
5
|
locale?: UiLocale;
|
|
6
|
-
/** Overrides applied on top of the preset. */
|
|
6
|
+
/** Overrides applied on top of the preset. Missing or empty entries keep the preset string. */
|
|
7
7
|
strings?: Partial<UiStrings>;
|
|
8
8
|
children: ReactNode;
|
|
9
9
|
}
|
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useContext, useMemo } from "react";
|
|
4
4
|
import { uiStrings } from "./strings.js";
|
|
5
|
-
const
|
|
5
|
+
const registry = /* @__PURE__ */ Symbol.for("@jcsoftdev/ui/i18n/strings");
|
|
6
|
+
const shared = globalThis;
|
|
7
|
+
const UiStringsContext = shared[registry] ?? createContext(uiStrings.en);
|
|
8
|
+
shared[registry] = UiStringsContext;
|
|
9
|
+
const defined = (strings) => Object.fromEntries(Object.entries(strings ?? {}).filter(([, value]) => value));
|
|
6
10
|
function UiStringsProvider({ locale, strings, children }) {
|
|
7
11
|
const parent = useContext(UiStringsContext);
|
|
8
12
|
const value = useMemo(
|
|
9
|
-
() => ({ ...locale ? uiStrings[locale] : parent, ...strings }),
|
|
13
|
+
() => ({ ...locale ? uiStrings[locale] : parent, ...defined(strings) }),
|
|
10
14
|
[locale, strings, parent]
|
|
11
15
|
);
|
|
12
16
|
return /* @__PURE__ */ jsx(UiStringsContext.Provider, { value, children });
|
package/dist/navigation/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { type Step, Stepper, type StepperPart, type StepperProps } from "./stepper.js";
|
|
1
|
+
export { type Step, Stepper, type StepperPart, type StepperProps, type StepStatus, } from "./stepper.js";
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef } from "react";
|
|
2
2
|
import type { ClassNames } from "../../utils/class-names.js";
|
|
3
|
+
export type StepStatus = "done" | "current" | "error" | "pending";
|
|
3
4
|
export interface Step {
|
|
4
5
|
id: string;
|
|
5
6
|
label: string;
|
|
7
|
+
/**
|
|
8
|
+
* Explicit state of the step. Without it the step is `current` when it is `currentStepId` and
|
|
9
|
+
* `pending` otherwise. A `done` step shows a check, an `error` step a cross and both announce
|
|
10
|
+
* their state; neither relies on colour alone. The step named by `currentStepId` keeps
|
|
11
|
+
* `aria-current="step"` whatever its status.
|
|
12
|
+
*/
|
|
13
|
+
status?: StepStatus;
|
|
6
14
|
}
|
|
7
15
|
export type StepperPart = "root" | "step" | "current" | "marker" | "label" | "connector";
|
|
8
16
|
export interface StepperProps extends Omit<ComponentPropsWithRef<"ol">, "children"> {
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useUiStrings } from "../../i18n/index.js";
|
|
3
|
+
import { Check, X } from "../../icons/index.js";
|
|
2
4
|
import { cn } from "../../utils/cn.js";
|
|
5
|
+
const markerStatusClasses = {
|
|
6
|
+
pending: "border-line-strong",
|
|
7
|
+
current: "border-accent-ink text-accent-ink",
|
|
8
|
+
done: "border-success bg-success-soft text-success",
|
|
9
|
+
error: "border-danger bg-danger-soft text-danger"
|
|
10
|
+
};
|
|
3
11
|
function Stepper({ steps, currentStepId, className, classNames, ...props }) {
|
|
12
|
+
const strings = useUiStrings();
|
|
4
13
|
return /* @__PURE__ */ jsx(
|
|
5
14
|
"ol",
|
|
6
15
|
{
|
|
@@ -12,54 +21,68 @@ function Stepper({ steps, currentStepId, className, classNames, ...props }) {
|
|
|
12
21
|
),
|
|
13
22
|
children: steps.map((step, index) => {
|
|
14
23
|
const isCurrent = step.id === currentStepId;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
const status = step.status ?? (isCurrent ? "current" : "pending");
|
|
25
|
+
const emphasised = isCurrent || status === "current" || status === "error";
|
|
26
|
+
return /* @__PURE__ */ jsxs(
|
|
27
|
+
"li",
|
|
28
|
+
{
|
|
29
|
+
"data-status": status,
|
|
30
|
+
className: cn("flex min-w-0 items-center gap-1.5", classNames?.step),
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ jsxs(
|
|
33
|
+
"span",
|
|
34
|
+
{
|
|
35
|
+
"aria-current": isCurrent ? "step" : void 0,
|
|
36
|
+
className: cn(
|
|
37
|
+
"flex items-center gap-1.5",
|
|
38
|
+
emphasised && "text-ink",
|
|
39
|
+
isCurrent && classNames?.current
|
|
40
|
+
),
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
"span",
|
|
44
|
+
{
|
|
45
|
+
className: cn(
|
|
46
|
+
"grid size-4.5 place-items-center rounded-pill border text-count",
|
|
47
|
+
markerStatusClasses[status],
|
|
48
|
+
classNames?.marker
|
|
49
|
+
),
|
|
50
|
+
children: status === "done" ? /* @__PURE__ */ jsx(Check, { "aria-hidden": "true", className: "size-3" }) : status === "error" ? /* @__PURE__ */ jsx(X, { "aria-hidden": "true", className: "size-3" }) : index + 1
|
|
51
|
+
}
|
|
33
52
|
),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
53
|
+
/* @__PURE__ */ jsx(
|
|
54
|
+
"span",
|
|
55
|
+
{
|
|
56
|
+
className: cn(
|
|
57
|
+
"min-w-0 truncate",
|
|
58
|
+
!emphasised && "@max-[420px]/stepper:sr-only",
|
|
59
|
+
isCurrent && "@max-[420px]/stepper:max-w-[40cqw]",
|
|
60
|
+
classNames?.label
|
|
61
|
+
),
|
|
62
|
+
children: step.label
|
|
63
|
+
}
|
|
45
64
|
),
|
|
46
|
-
children:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
65
|
+
status === "done" || status === "error" ? /* @__PURE__ */ jsxs("span", { className: "sr-only", children: [
|
|
66
|
+
", ",
|
|
67
|
+
status === "done" ? strings.stepDone : strings.stepError
|
|
68
|
+
] }) : null
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
index < steps.length - 1 && /* @__PURE__ */ jsx(
|
|
73
|
+
"span",
|
|
74
|
+
{
|
|
75
|
+
"aria-hidden": "true",
|
|
76
|
+
className: cn(
|
|
77
|
+
"h-px w-4.5 bg-line-strong @max-[420px]/stepper:w-2.5",
|
|
78
|
+
classNames?.connector
|
|
79
|
+
)
|
|
80
|
+
}
|
|
59
81
|
)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
step.id
|
|
85
|
+
);
|
|
63
86
|
})
|
|
64
87
|
}
|
|
65
88
|
);
|
|
@@ -1 +1,2 @@
|
|
|
1
1
|
export { Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, } from "./tabs.js";
|
|
2
|
+
export { TabsNav, TabsNavLink, type TabsNavLinkProps, type TabsNavLinkRenderProps, type TabsNavProps, } from "./tabs-nav.js";
|