@starci/grammar 0.13.0 → 0.14.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/README.md +26 -0
- package/dist/.build-stamp.json +4 -4
- package/dist/common/components-forms.css +27 -43
- package/dist/common/components-list-panel.css +8 -0
- package/dist/common/components-navigation.css +163 -6
- package/dist/common/components-overlays.css +41 -2
- package/dist/common/registry.d.ts +24 -21
- package/dist/common/registry.d.ts.map +1 -1
- package/dist/common/registry.js +4 -4
- package/dist/common/registry.js.map +1 -1
- package/dist/common/renderers-forms.d.ts +11 -11
- package/dist/common/renderers-navigation.d.ts +5 -5
- package/dist/common/renderers-navigation.d.ts.map +1 -1
- package/dist/common/renderers-navigation.js +1 -1
- package/dist/common/renderers-navigation.js.map +1 -1
- package/dist/common/renderers-overlays.d.ts +2 -2
- package/dist/common/renderers-overlays.d.ts.map +1 -1
- package/dist/common/renderers-overlays.js.map +1 -1
- package/dist/common/renderers.d.ts +4 -1
- package/dist/common/renderers.d.ts.map +1 -1
- package/dist/common/renderers.js +3 -0
- package/dist/common/renderers.js.map +1 -1
- package/dist/common/styles.css +229 -46
- package/dist/core/branch/ComboBox/index.d.ts +5 -5
- package/dist/core/branch/ComboBox/index.d.ts.map +1 -1
- package/dist/core/branch/ComboBox/index.js +9 -2
- package/dist/core/branch/ComboBox/index.js.map +1 -1
- package/dist/core/branch/DataTable/index.d.ts +20 -3
- package/dist/core/branch/DataTable/index.d.ts.map +1 -1
- package/dist/core/branch/DataTable/index.js +45 -8
- package/dist/core/branch/DataTable/index.js.map +1 -1
- package/dist/core/branch/FlowGraph/index.d.ts +26 -7
- package/dist/core/branch/FlowGraph/index.d.ts.map +1 -1
- package/dist/core/branch/FlowGraph/index.js +132 -30
- package/dist/core/branch/FlowGraph/index.js.map +1 -1
- package/dist/core/branch/FlowGraph/layout.d.ts +34 -1
- package/dist/core/branch/FlowGraph/layout.d.ts.map +1 -1
- package/dist/core/branch/FlowGraph/layout.js +82 -0
- package/dist/core/branch/FlowGraph/layout.js.map +1 -1
- package/dist/core/branch/FlowGraph/types.d.ts +13 -1
- package/dist/core/branch/FlowGraph/types.d.ts.map +1 -1
- package/dist/core/branch/ListBox/index.d.ts +4 -2
- package/dist/core/branch/ListBox/index.d.ts.map +1 -1
- package/dist/core/branch/ListBox/index.js +2 -2
- package/dist/core/branch/ListBox/index.js.map +1 -1
- package/dist/core/branch/MarkdownArticle/index.d.ts +7 -1
- package/dist/core/branch/MarkdownArticle/index.d.ts.map +1 -1
- package/dist/core/branch/MarkdownArticle/index.js +5 -2
- package/dist/core/branch/MarkdownArticle/index.js.map +1 -1
- package/dist/core/branch/Select/index.d.ts +6 -8
- package/dist/core/branch/Select/index.d.ts.map +1 -1
- package/dist/core/branch/Select/index.js +9 -5
- package/dist/core/branch/Select/index.js.map +1 -1
- package/dist/core/branch/SurfaceCard/index.d.ts +9 -0
- package/dist/core/branch/SurfaceCard/index.d.ts.map +1 -1
- package/dist/core/branch/SurfaceCard/index.js +3 -2
- package/dist/core/branch/SurfaceCard/index.js.map +1 -1
- package/dist/core/branch/Tabs/index.d.ts.map +1 -1
- package/dist/core/branch/Tabs/index.js +17 -0
- package/dist/core/branch/Tabs/index.js.map +1 -1
- package/dist/core/branch/Tooltip/index.d.ts +9 -1
- package/dist/core/branch/Tooltip/index.d.ts.map +1 -1
- package/dist/core/branch/Tooltip/index.js +2 -2
- package/dist/core/branch/Tooltip/index.js.map +1 -1
- package/dist/core/collectionItem.d.ts +3 -3
- package/dist/core/collectionItem.d.ts.map +1 -1
- package/dist/core/composite/Alert/index.d.ts +5 -0
- package/dist/core/composite/Alert/index.d.ts.map +1 -1
- package/dist/core/composite/Alert/index.js +7 -2
- package/dist/core/composite/Alert/index.js.map +1 -1
- package/dist/core/composite/CheckboxGroup/index.d.ts +6 -5
- package/dist/core/composite/CheckboxGroup/index.d.ts.map +1 -1
- package/dist/core/composite/CheckboxGroup/index.js +10 -3
- package/dist/core/composite/CheckboxGroup/index.js.map +1 -1
- package/dist/core/composite/DescriptionList/index.d.ts +3 -2
- package/dist/core/composite/DescriptionList/index.d.ts.map +1 -1
- package/dist/core/composite/DescriptionList/index.js +5 -4
- package/dist/core/composite/DescriptionList/index.js.map +1 -1
- package/dist/core/composite/RadioGroup/index.d.ts +5 -3
- package/dist/core/composite/RadioGroup/index.d.ts.map +1 -1
- package/dist/core/composite/RadioGroup/index.js +9 -2
- package/dist/core/composite/RadioGroup/index.js.map +1 -1
- package/dist/core/composite/SegmentedControl/index.d.ts +6 -6
- package/dist/core/composite/SegmentedControl/index.d.ts.map +1 -1
- package/dist/core/composite/SegmentedControl/index.js +9 -5
- package/dist/core/composite/SegmentedControl/index.js.map +1 -1
- package/dist/core/composite/TagGroup/index.d.ts +27 -4
- package/dist/core/composite/TagGroup/index.d.ts.map +1 -1
- package/dist/core/composite/TagGroup/index.js +132 -2
- package/dist/core/composite/TagGroup/index.js.map +1 -1
- package/dist/core/composite/Timeline/index.d.ts +5 -0
- package/dist/core/composite/Timeline/index.d.ts.map +1 -1
- package/dist/core/composite/Timeline/index.js +1 -1
- package/dist/core/composite/Timeline/index.js.map +1 -1
- package/dist/core/composition/Sidebar/index.d.ts +4 -0
- package/dist/core/composition/Sidebar/index.d.ts.map +1 -1
- package/dist/core/composition/Sidebar/index.js +4 -2
- package/dist/core/composition/Sidebar/index.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/primitive/Avatar/index.d.ts +1 -1
- package/dist/core/primitive/Badge/index.d.ts +8 -5
- package/dist/core/primitive/Badge/index.d.ts.map +1 -1
- package/dist/core/primitive/Badge/index.js +14 -5
- package/dist/core/primitive/Badge/index.js.map +1 -1
- package/dist/core/primitive/Button/index.d.ts +10 -2
- package/dist/core/primitive/Button/index.d.ts.map +1 -1
- package/dist/core/primitive/Button/index.js +15 -4
- package/dist/core/primitive/Button/index.js.map +1 -1
- package/dist/core/primitive/Checkbox/index.d.ts +5 -3
- package/dist/core/primitive/Checkbox/index.d.ts.map +1 -1
- package/dist/core/primitive/Checkbox/index.js +9 -2
- package/dist/core/primitive/Checkbox/index.js.map +1 -1
- package/dist/core/primitive/Code/index.d.ts +10 -0
- package/dist/core/primitive/Code/index.d.ts.map +1 -0
- package/dist/core/primitive/Code/index.js +5 -0
- package/dist/core/primitive/Code/index.js.map +1 -0
- package/dist/core/primitive/Field/index.d.ts +12 -25
- package/dist/core/primitive/Field/index.d.ts.map +1 -1
- package/dist/core/primitive/Field/index.js +13 -14
- package/dist/core/primitive/Field/index.js.map +1 -1
- package/dist/core/primitive/GrammarRoot/index.d.ts +8 -1
- package/dist/core/primitive/GrammarRoot/index.d.ts.map +1 -1
- package/dist/core/primitive/GrammarRoot/index.js +5 -1
- package/dist/core/primitive/GrammarRoot/index.js.map +1 -1
- package/dist/core/primitive/Icon/index.d.ts.map +1 -1
- package/dist/core/primitive/Icon/index.js +3 -2
- package/dist/core/primitive/Icon/index.js.map +1 -1
- package/dist/core/primitive/Input/index.d.ts +9 -4
- package/dist/core/primitive/Input/index.d.ts.map +1 -1
- package/dist/core/primitive/Input/index.js +13 -8
- package/dist/core/primitive/Input/index.js.map +1 -1
- package/dist/core/primitive/Meter/index.d.ts +4 -1
- package/dist/core/primitive/Meter/index.d.ts.map +1 -1
- package/dist/core/primitive/Meter/index.js +3 -3
- package/dist/core/primitive/Meter/index.js.map +1 -1
- package/dist/core/primitive/NumberField/index.d.ts +6 -5
- package/dist/core/primitive/NumberField/index.d.ts.map +1 -1
- package/dist/core/primitive/NumberField/index.js +10 -3
- package/dist/core/primitive/NumberField/index.js.map +1 -1
- package/dist/core/primitive/PinnedActionBar/index.d.ts +25 -6
- package/dist/core/primitive/PinnedActionBar/index.d.ts.map +1 -1
- package/dist/core/primitive/PinnedActionBar/index.js +9 -4
- package/dist/core/primitive/PinnedActionBar/index.js.map +1 -1
- package/dist/core/primitive/SearchField/index.d.ts +6 -5
- package/dist/core/primitive/SearchField/index.d.ts.map +1 -1
- package/dist/core/primitive/SearchField/index.js +10 -3
- package/dist/core/primitive/SearchField/index.js.map +1 -1
- package/dist/core/primitive/SectionHeader/index.d.ts +3 -3
- package/dist/core/primitive/SectionHeader/index.js +2 -2
- package/dist/core/primitive/SectionHeader/index.js.map +1 -1
- package/dist/core/primitive/Skeleton/index.d.ts +11 -0
- package/dist/core/primitive/Skeleton/index.d.ts.map +1 -1
- package/dist/core/primitive/Skeleton/index.js +12 -1
- package/dist/core/primitive/Skeleton/index.js.map +1 -1
- package/dist/core/primitive/StatusDot/index.d.ts +61 -0
- package/dist/core/primitive/StatusDot/index.d.ts.map +1 -0
- package/dist/core/primitive/StatusDot/index.js +55 -0
- package/dist/core/primitive/StatusDot/index.js.map +1 -0
- package/dist/core/primitive/Switch/index.d.ts +4 -3
- package/dist/core/primitive/Switch/index.d.ts.map +1 -1
- package/dist/core/primitive/Switch/index.js +5 -2
- package/dist/core/primitive/Switch/index.js.map +1 -1
- package/dist/core/primitive/Terminal/index.d.ts +20 -0
- package/dist/core/primitive/Terminal/index.d.ts.map +1 -0
- package/dist/core/primitive/Terminal/index.js +29 -0
- package/dist/core/primitive/Terminal/index.js.map +1 -0
- package/dist/core/primitive/Text/index.d.ts +5 -1
- package/dist/core/primitive/Text/index.d.ts.map +1 -1
- package/dist/core/primitive/Text/index.js +12 -7
- package/dist/core/primitive/Text/index.js.map +1 -1
- package/dist/core/primitive/TextAction/index.d.ts.map +1 -1
- package/dist/core/primitive/TextAction/index.js +9 -4
- package/dist/core/primitive/TextAction/index.js.map +1 -1
- package/dist/core/primitive/Textarea/index.d.ts +8 -4
- package/dist/core/primitive/Textarea/index.d.ts.map +1 -1
- package/dist/core/primitive/Textarea/index.js +9 -5
- package/dist/core/primitive/Textarea/index.js.map +1 -1
- package/dist/core/styles.css +17 -5
- package/dist/offset-pop/components-forms.css +0 -17
- package/dist/offset-pop/components-navigation.css +30 -4
- package/dist/offset-pop/components-overlays.css +5 -0
- package/dist/offset-pop/index.d.ts +1 -1
- package/dist/offset-pop/index.d.ts.map +1 -1
- package/dist/offset-pop/styles.css +44 -0
- package/package.json +1 -1
|
@@ -17,14 +17,15 @@ export type CheckboxGroupProps = FieldControlProps & {
|
|
|
17
17
|
/** Defaults to `secondary` inside a Grammar surface and `primary` outside (ANATOMY-2 case-1). */
|
|
18
18
|
readonly variant?: "primary" | "secondary";
|
|
19
19
|
/**
|
|
20
|
-
* Initial unresolved content (knowledge STATE-8): the
|
|
21
|
-
*
|
|
20
|
+
* Initial unresolved content (knowledge STATE-8), with skeleton parity: the ready anatomy at the same props (label,
|
|
21
|
+
* description, control box, options) inside an inert, `aria-busy` scope, its control box painted as a Skeleton and its
|
|
22
|
+
* value or mark not drawn, so the loading field keeps the ready box. Nothing is invalid or pending while it loads.
|
|
22
23
|
*/
|
|
23
24
|
readonly isSkeleton?: boolean;
|
|
24
25
|
};
|
|
25
26
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
27
|
+
* Skeleton parity (knowledge STATE-8): `isSkeleton` renders the ready anatomy at the same props inside
|
|
28
|
+
* `FieldSkeletonScope` (inert, `aria-busy`, control box painted as a Skeleton), so the loading field keeps the ready box.
|
|
28
29
|
*/
|
|
29
|
-
export declare const CheckboxGroup: ({
|
|
30
|
+
export declare const CheckboxGroup: ({ isSkeleton, ...props }: CheckboxGroupProps) => import("react").JSX.Element;
|
|
30
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/composite/CheckboxGroup/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/composite/CheckboxGroup/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAQH,KAAK,iBAAiB,EACzB,MAAM,gCAAgC,CAAA;AAGvC,oCAAoC;AACpC,MAAM,MAAM,YAAY,GAAG;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAA;IAChC,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,YAAY,CAAA;AAEzD,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,GAAG;IACjD,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,CAAA;IAC7C,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IACtC,QAAQ,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAC7C,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI,CAAA;IACvD,QAAQ,CAAC,WAAW,CAAC,EAAE,iBAAiB,CAAA;IACxC,iGAAiG;IACjG,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAA;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAChC,CAAA;AAcD;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,0BAAkC,kBAAkB,gCAEzC,CAAA"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useFieldVariant } from "../../surfaceContext.js";
|
|
4
4
|
import { Checkbox as HeroCheckbox, CheckboxGroup as HeroCheckboxGroup } from "@heroui/react";
|
|
5
|
-
import { FieldDescription, FieldErrorText, FieldLabel,
|
|
5
|
+
import { FieldDescription, FieldErrorText, FieldLabel, FieldSkeletonScope, loadingFieldProps, fieldVariantAttributes, vendorFieldProps, } from "../../primitive/Field/index.js";
|
|
6
6
|
import { CheckboxItem } from "../../primitive/Checkbox/index.js";
|
|
7
7
|
/*
|
|
8
8
|
* Consumer hook: `starci-core-choice-group` names this control's root for a consumer or family
|
|
@@ -14,12 +14,19 @@ import { CheckboxItem } from "../../primitive/Checkbox/index.js";
|
|
|
14
14
|
* stylesheet. No shipped sheet paints it: the root is drawn as a whole by `.starci-core-choice`, so
|
|
15
15
|
* a rule on the hook adds to the shared anatomy and never has to replace it.
|
|
16
16
|
*/
|
|
17
|
+
/**
|
|
18
|
+
* Skeleton parity (knowledge STATE-8): `isSkeleton` renders the ready anatomy at the same props inside
|
|
19
|
+
* `FieldSkeletonScope` (inert, `aria-busy`, control box painted as a Skeleton), so the loading field keeps the ready box.
|
|
20
|
+
*/
|
|
21
|
+
export const CheckboxGroup = ({ isSkeleton = false, ...props }) => isSkeleton
|
|
22
|
+
? _jsx(FieldSkeletonScope, { component: "CheckboxGroup", children: _jsx(CheckboxGroupControl, { ...loadingFieldProps(props) }) })
|
|
23
|
+
: _jsx(CheckboxGroupControl, { ...props });
|
|
17
24
|
/**
|
|
18
25
|
* Several independent choices under one group name (`role="group"`, labelled by the group label).
|
|
19
26
|
* Required means "at least one", validated by the vendor; the group owns the one error slot.
|
|
20
27
|
*/
|
|
21
|
-
|
|
28
|
+
const CheckboxGroupControl = ({ options, value, defaultValue, onValueChange, orientation = "vertical", variant: requestedVariant, ...field }) => {
|
|
22
29
|
const variant = useFieldVariant(requestedVariant);
|
|
23
|
-
return
|
|
30
|
+
return (_jsxs(HeroCheckboxGroup, { "data-tier": "composite", "data-component": "CheckboxGroup", "data-contract": "A11Y-1 FEEDBACK-1 STATE-1", "data-grammar-orientation": orientation, className: "starci-core-field starci-core-choice-group", variant: variant, ...fieldVariantAttributes(variant), ...vendorFieldProps(field), isReadOnly: field.isReadOnly === true, ...(value === undefined ? defaultValue === undefined ? {} : { defaultValue: [...defaultValue] } : { value: [...value] }), ...(onValueChange === undefined ? {} : { onChange: onValueChange }), children: [_jsx(FieldLabel, { isHidden: field.isLabelHidden, isRequired: field.isRequired, children: field.label }), _jsx(FieldDescription, { children: field.description }), _jsx("div", { className: "starci-core-choice-group-options", "data-grammar-field-control": "true", children: options.map((option) => (_jsx(HeroCheckbox, { value: option.value, isDisabled: option.isDisabled === true, className: "starci-core-choice starci-core-checkbox", variant: variant, "data-grammar-option": "true", children: _jsx(CheckboxItem, { label: option.label, description: option.description, isStandalone: false }) }, option.value))) }), _jsx(FieldErrorText, { children: field.errorMessage })] }));
|
|
24
31
|
};
|
|
25
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/composite/CheckboxGroup/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAE5F,OAAO,EACH,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/composite/CheckboxGroup/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAE5F,OAAO,EACH,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,GAEnB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AA4BhE;;;;GAIG;AAEH;;;;GAIG;AAEH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AK,CAAC,KAAK,GAAc,EACnG,KAAC,gBAAgB,cAAE,KAAK,CAAC,WAAW,GAAoB,EACxD,cAAK,SAAS,EAAC,kCAAkC,gCAA4B,MAAM,YAC9E,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACrB,KAAC,YAAY,IAET,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,UAAU,EAAE,MAAM,CAAC,UAAU,KAAK,IAAI,EACtC,SAAS,EAAC,yCAAyC,EACnD,OAAO,EAAE,OAAO,yBACI,MAAM,YAE1B,KAAC,YAAY,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,YAAY,EAAE,KAAK,GAAI,IAPtF,MAAM,CAAC,KAAK,CAQN,CAClB,CAAC,GACA,EACN,KAAC,cAAc,cAAE,KAAK,CAAC,YAAY,GAAkB,IACrC,CACvB,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -36,8 +36,9 @@ export type DescriptionListProps = (PairLayout | StatStripLayout) & {
|
|
|
36
36
|
/** Draw a separator between pairs (between cells, for `stat-strip`). */
|
|
37
37
|
readonly isDivided?: boolean;
|
|
38
38
|
/**
|
|
39
|
-
* Unresolved values (knowledge STATE-8): every `term` stays real text
|
|
40
|
-
*
|
|
39
|
+
* Unresolved values (knowledge STATE-8): every `term` stays real text; each `description` (and a stat item meta) is
|
|
40
|
+
* laid out unseen under a shimmer bar, and a stat `unit` keeps its place unseen, so every cell keeps its ready size
|
|
41
|
+
* (skeleton parity). The list is `aria-busy`.
|
|
41
42
|
*/
|
|
42
43
|
readonly isLoading?: boolean;
|
|
43
44
|
readonly className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/composite/DescriptionList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,E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letonPlaceholder } from "../../primitive/Skeleton/index.js";
|
|
4
4
|
import { IconTile } from "../../primitive/IconTile/index.js";
|
|
5
5
|
/**
|
|
6
6
|
* Term/value pairs (details, metadata, settings summaries) as a real `<dl>`.
|
|
@@ -10,10 +10,11 @@ import { IconTile } from "../../primitive/IconTile/index.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export const DescriptionList = (props) => {
|
|
12
12
|
const { isDivided = true, isLoading = false, className } = props;
|
|
13
|
-
|
|
13
|
+
// Skeleton parity: a loading value is laid out unseen under the shimmer, so the cell keeps the ready value's box.
|
|
14
|
+
const pending = (value) => _jsx(SkeletonPlaceholder, { children: value });
|
|
14
15
|
const layout = props.layout ?? "columns";
|
|
15
16
|
return (_jsx("dl", { className: navigationClassName("starci-core-description-list", className), "data-component": "DescriptionList", "data-contract": "HIERARCHY-3 TRUTH-1", "data-tier": "composite", ...(isLoading ? { "aria-busy": true, "data-loading": "true" } : {}), "data-grammar-description-layout": layout, "data-grammar-description-divided": isDivided ? "true" : "false", children: props.layout === "stat-strip"
|
|
16
|
-
? props.items.map((item) => (_jsxs("div", { className: "starci-core-description-pair", "data-grammar-description-pair": "true", children: [_jsxs("dt", { className: "starci-core-description-term starci-core-description-stat-term", children: [item.icon === undefined ? null : _jsx(IconTile, { source: item.icon, size: "sm", tone: "neutral" }), _jsx("span", { children: item.term })] }), _jsxs("dd", { className: "starci-core-description-value starci-core-description-figure", "data-contract": "FONT-5", children: [_jsx("span", { className: "starci-core-description-figure-value", children: isLoading ? pending : item.description }), item.unit === undefined
|
|
17
|
-
: props.items.map((item) => (_jsxs("div", { className: "starci-core-description-pair", "data-grammar-description-pair": "true", children: [_jsx("dt", { className: "starci-core-description-term", children: item.term }), _jsx("dd", { className: "starci-core-description-value", children: isLoading ? pending : item.description })] }, item.id))) }));
|
|
17
|
+
? props.items.map((item) => (_jsxs("div", { className: "starci-core-description-pair", "data-grammar-description-pair": "true", children: [_jsxs("dt", { className: "starci-core-description-term starci-core-description-stat-term", children: [item.icon === undefined ? null : _jsx(IconTile, { source: item.icon, size: "sm", tone: "neutral" }), _jsx("span", { children: item.term })] }), _jsxs("dd", { className: "starci-core-description-value starci-core-description-figure", "data-contract": "FONT-5", children: [_jsx("span", { className: "starci-core-description-figure-value", children: isLoading ? pending(item.description) : item.description }), item.unit === undefined ? null : _jsx("span", { className: "starci-core-description-unit", children: item.unit })] }), item.meta === undefined ? null : (_jsx("dd", { className: "starci-core-description-meta", "data-contract": "FONT-2", children: isLoading ? pending(item.meta) : item.meta }))] }, item.id)))
|
|
18
|
+
: props.items.map((item) => (_jsxs("div", { className: "starci-core-description-pair", "data-grammar-description-pair": "true", children: [_jsx("dt", { className: "starci-core-description-term", children: item.term }), _jsx("dd", { className: "starci-core-description-value", children: isLoading ? pending(item.description) : item.description })] }, item.id))) }));
|
|
18
19
|
};
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/composite/DescriptionList/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AAEnE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/composite/DescriptionList/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AAEnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAA;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AAmD5D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAA2B,EAAE,EAAE;IAC3D,MAAM,EAAE,SAAS,GAAG,IAAI,EAAE,SAAS,GAAG,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,CAAA;IAChE,kHAAkH;IAClH,MAAM,OAAO,GAAG,CAAC,KAAgB,EAAE,EAAE,CAAC,KA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AI,CAAC,CAAC,CAAC,CAC9B,aAAI,SAAS,EAAC,8BAA8B,mBAAe,QAAQ,YAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,GAAM,CACxH,KAXK,IAAI,CAAC,EAAE,CAYX,CACT,CAAC;YACF,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACxB,eAAmB,SAAS,EAAC,8BAA8B,mCAA+B,MAAM,aAC5F,aAAI,SAAS,EAAC,8BAA8B,YAAE,IAAI,CAAC,IAAI,GAAM,EAC7D,aAAI,SAAS,EAAC,+BAA+B,YAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,GAAM,KAFvG,IAAI,CAAC,EAAE,CAGX,CACT,CAAC,GACL,CACR,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -8,10 +8,12 @@ export type RadioGroupProps = FieldControlProps & {
|
|
|
8
8
|
readonly orientation?: ChoiceOrientation;
|
|
9
9
|
/** Defaults to `secondary` inside a Grammar surface and `primary` outside (ANATOMY-2 case-1). */
|
|
10
10
|
readonly variant?: "primary" | "secondary";
|
|
11
|
+
/** Initial unresolved content (knowledge STATE-8): the same anatomy, inert, its control painted as a Skeleton. */
|
|
12
|
+
readonly isSkeleton?: boolean;
|
|
11
13
|
};
|
|
12
14
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
+
* Skeleton parity (knowledge STATE-8): `isSkeleton` renders the ready anatomy at the same props inside
|
|
16
|
+
* `FieldSkeletonScope` (inert, `aria-busy`, control box painted as a Skeleton), so the loading field keeps the ready box.
|
|
15
17
|
*/
|
|
16
|
-
export declare const RadioGroup: ({
|
|
18
|
+
export declare const RadioGroup: ({ isSkeleton, ...props }: RadioGroupProps) => import("react").JSX.Element;
|
|
17
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/composite/RadioGroup/index.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/composite/RadioGroup/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAQH,KAAK,iBAAiB,EACzB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAEhF,MAAM,MAAM,eAAe,GAAG,iBAAiB,GAAG;IAC9C,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,CAAA;IAC7C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAChD,QAAQ,CAAC,WAAW,CAAC,EAAE,iBAAiB,CAAA;IACxC,iGAAiG;IACjG,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAA;IAC1C,kHAAkH;IAClH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAChC,CAAA;AAcD;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,0BAAkC,eAAe,gCAEtC,CAAA"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useFieldVariant } from "../../surfaceContext.js";
|
|
4
4
|
import { Radio as HeroRadio, RadioGroup as HeroRadioGroup } from "@heroui/react";
|
|
5
|
-
import { FieldDescription, FieldErrorText, FieldLabel, fieldVariantAttributes, vendorFieldProps, } from "../../primitive/Field/index.js";
|
|
5
|
+
import { FieldDescription, FieldErrorText, FieldLabel, FieldSkeletonScope, loadingFieldProps, fieldVariantAttributes, vendorFieldProps, } from "../../primitive/Field/index.js";
|
|
6
6
|
/*
|
|
7
7
|
* Consumer hook: `starci-core-choice-group` names this control's root for a consumer or family
|
|
8
8
|
* stylesheet. No shipped sheet paints it: the root is drawn as a whole by `.starci-core-field`, so
|
|
@@ -13,11 +13,18 @@ import { FieldDescription, FieldErrorText, FieldLabel, fieldVariantAttributes, v
|
|
|
13
13
|
* No shipped sheet paints it: the root is drawn as a whole by `.starci-core-choice`, so a rule on
|
|
14
14
|
* the hook adds to the shared anatomy and never has to replace it.
|
|
15
15
|
*/
|
|
16
|
+
/**
|
|
17
|
+
* Skeleton parity (knowledge STATE-8): `isSkeleton` renders the ready anatomy at the same props inside
|
|
18
|
+
* `FieldSkeletonScope` (inert, `aria-busy`, control box painted as a Skeleton), so the loading field keeps the ready box.
|
|
19
|
+
*/
|
|
20
|
+
export const RadioGroup = ({ isSkeleton = false, ...props }) => isSkeleton
|
|
21
|
+
? _jsx(FieldSkeletonScope, { component: "RadioGroup", children: _jsx(RadioGroupControl, { ...loadingFieldProps(props) }) })
|
|
22
|
+
: _jsx(RadioGroupControl, { ...props });
|
|
16
23
|
/**
|
|
17
24
|
* Exactly one of a few visible choices (`role="radiogroup"`). Arrow keys move and select within the
|
|
18
25
|
* group, Tab leaves it - roving focus is the vendor's.
|
|
19
26
|
*/
|
|
20
|
-
|
|
27
|
+
const RadioGroupControl = ({ options, value, defaultValue, onValueChange, orientation = "vertical", variant: requestedVariant, ...field }) => {
|
|
21
28
|
const variant = useFieldVariant(requestedVariant);
|
|
22
29
|
return (_jsxs(HeroRadioGroup, { "data-tier": "composite", "data-component": "RadioGroup", "data-contract": "A11Y-1 STATE-6 FOCUS-2", "data-grammar-orientation": orientation, className: "starci-core-field starci-core-choice-group", orientation: orientation, variant: variant, ...fieldVariantAttributes(variant), ...vendorFieldProps(field), isReadOnly: field.isReadOnly === true, ...(value === undefined ? defaultValue === undefined ? {} : { defaultValue } : { value }), ...(onValueChange === undefined ? {} : { onChange: onValueChange }), children: [_jsx(FieldLabel, { isHidden: field.isLabelHidden, isRequired: field.isRequired, children: field.label }), _jsx(FieldDescription, { children: field.description }), _jsx("div", { className: "starci-core-choice-group-options", "data-grammar-field-control": "true", children: options.map((option) => (_jsxs(HeroRadio, { value: option.value, isDisabled: option.isDisabled === true, className: "starci-core-choice starci-core-radio", "data-grammar-option": "true", children: [_jsxs(HeroRadio.Content, { className: "starci-core-choice-content", "data-grammar-choice-target": "true", children: [_jsx(HeroRadio.Control, { className: "starci-core-choice-control", "data-grammar-choice-control": "radio", children: _jsx(HeroRadio.Indicator, {}) }), _jsx(FieldLabel, { children: option.label })] }), _jsx(FieldDescription, { children: option.description })] }, option.value))) }), _jsx(FieldErrorText, { children: field.errorMessage })] }));
|
|
23
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/composite/RadioGroup/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,eAAe,CAAA;AAChF,OAAO,EACH,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,sBAAsB,EACtB,gBAAgB,GAEnB,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/composite/RadioGroup/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,eAAe,CAAA;AAChF,OAAO,EACH,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,k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,EAAE,KAAK,CAAC,aAAa,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,YAAG,KAAK,CAAC,KAAK,GAAc,EACnG,KAAC,gBAAgB,cAAE,KAAK,CAAC,WAAW,GAAoB,EACxD,cAAK,SAAS,EAAC,kCAAkC,gCAA4B,MAAM,YAC9E,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACrB,MAAC,SAAS,IAEN,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,UAAU,EAAE,MAAM,CAAC,UAAU,KAAK,IAAI,EACtC,SAAS,EAAC,sCAAsC,yBAC5B,MAAM,aAE1B,MAAC,SAAS,CAAC,OAAO,IAAC,SAAS,EAAC,4BAA4B,gCAA4B,MAAM,aACvF,KAAC,SAAS,CAAC,OAAO,IAAC,SAAS,EAAC,4BAA4B,iCAA6B,OAAO,YACzF,KAAC,SAAS,CAAC,SAAS,KAAG,GACP,EACpB,KAAC,UAAU,cAAE,MAAM,CAAC,KAAK,GAAc,IACvB,EACpB,KAAC,gBAAgB,cAAE,MAAM,CAAC,WAAW,GAAoB,KAZpD,MAAM,CAAC,KAAK,CAaT,CACf,CAAC,GACA,EACN,KAAC,cAAc,cAAE,KAAK,CAAC,YAAY,GAAkB,IACxC,CACpB,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -21,15 +21,15 @@ export type SegmentedControlProps = FieldControlProps & {
|
|
|
21
21
|
*/
|
|
22
22
|
readonly size?: SegmentedControlSize;
|
|
23
23
|
/**
|
|
24
|
-
* Initial unresolved content (knowledge STATE-8)
|
|
25
|
-
*
|
|
24
|
+
* Initial unresolved content (knowledge STATE-8), with skeleton parity: the ready anatomy at the same props (label,
|
|
25
|
+
* description, control box, options) inside an inert, `aria-busy` scope, its control box painted as a Skeleton and its
|
|
26
|
+
* value or mark not drawn, so the loading field keeps the ready box. Nothing is invalid or pending while it loads.
|
|
26
27
|
*/
|
|
27
28
|
readonly isSkeleton?: boolean;
|
|
28
29
|
};
|
|
29
30
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* the selected value is submitted through a hidden input so it works inside a Form.
|
|
31
|
+
* Skeleton parity (knowledge STATE-8): `isSkeleton` renders the ready anatomy at the same props inside
|
|
32
|
+
* `FieldSkeletonScope` (inert, `aria-busy`, control box painted as a Skeleton), so the loading field keeps the ready box.
|
|
33
33
|
*/
|
|
34
|
-
export declare const SegmentedControl: ({
|
|
34
|
+
export declare const SegmentedControl: ({ isSkeleton, ...props }: SegmentedControlProps) => import("react").JSX.Element;
|
|
35
35
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/composite/SegmentedControl/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACvD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/composite/SegmentedControl/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACvD,OAAO,EAAiG,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEtK,MAAM,MAAM,aAAa,GAAG;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;IACzB,6CAA6C;IAC7C,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAA;AAE1D,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,GAAG;IACpD,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,aAAa,CAAC,CAAA;IAC9C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAChD,uDAAuD;IACvD,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;IACnC;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,oBAAoB,CAAA;IACpC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAChC,CAAA;AAOD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,0BAAkC,qBAAqB,gCAE5C,CAAA"}
|
|
@@ -2,17 +2,24 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { ToggleButton as HeroToggleButton, ToggleButtonGroup as HeroToggleButtonGroup } from "@heroui/react";
|
|
4
4
|
import { useId, useState } from "react";
|
|
5
|
-
import { fieldStateAttributes, StaticFieldError,
|
|
5
|
+
import { fieldStateAttributes, StaticFieldError, FieldSkeletonScope, loadingFieldProps, isFieldInvalid } from "../../primitive/Field/index.js";
|
|
6
6
|
const firstKey = (keys) => {
|
|
7
7
|
const first = keys[Symbol.iterator]().next();
|
|
8
8
|
return first.done ? undefined : String(first.value);
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* Skeleton parity (knowledge STATE-8): `isSkeleton` renders the ready anatomy at the same props inside
|
|
12
|
+
* `FieldSkeletonScope` (inert, `aria-busy`, control box painted as a Skeleton), so the loading field keeps the ready box.
|
|
13
|
+
*/
|
|
14
|
+
export const SegmentedControl = ({ isSkeleton = false, ...props }) => isSkeleton
|
|
15
|
+
? _jsx(FieldSkeletonScope, { component: "SegmentedControl", children: _jsx(SegmentedControlControl, { ...loadingFieldProps(props) }) })
|
|
16
|
+
: _jsx(SegmentedControlControl, { ...props });
|
|
10
17
|
/**
|
|
11
18
|
* One-of-few choice drawn as joined segments (a toggle-button group in single-selection mode, so it
|
|
12
19
|
* is announced as a radio group). A segment is never deselected by pressing it again. With `name`,
|
|
13
20
|
* the selected value is submitted through a hidden input so it works inside a Form.
|
|
14
21
|
*/
|
|
15
|
-
|
|
22
|
+
const SegmentedControlControl = ({ options, value, defaultValue, onValueChange, width = "content", size = "md", label, isLabelHidden, description, errorMessage, isInvalid, isRequired, isDisabled, isReadOnly, name, }) => {
|
|
16
23
|
const id = useId().replaceAll(":", "");
|
|
17
24
|
const [held, setHeld] = useState(value ?? defaultValue ?? options[0]?.value);
|
|
18
25
|
const selected = value ?? held;
|
|
@@ -21,9 +28,6 @@ export const SegmentedControl = ({ options, value, defaultValue, onValueChange,
|
|
|
21
28
|
const descriptionId = description == null ? undefined : `segmented${id}-description`;
|
|
22
29
|
const errorId = invalid && errorMessage != null ? `segmented${id}-error` : undefined;
|
|
23
30
|
const describedBy = [descriptionId, errorId].filter((part) => part !== undefined).join(" ");
|
|
24
|
-
if (isSkeleton) {
|
|
25
|
-
return _jsx(FieldSkeleton, { component: "SegmentedControl", tier: "composite", label: label, isLabelHidden: isLabelHidden, isRequired: isRequired, kind: "segmented", count: options.length, fill: width === "fill", segmentedSize: size, className: "starci-core-segmented-control" });
|
|
26
|
-
}
|
|
27
31
|
return (_jsxs("div", { "data-tier": "composite", "data-component": "SegmentedControl", "data-contract": "A11Y-1 FEEDBACK-1", "data-width": width, "data-grammar-segmented-size": size, className: "starci-core-field starci-core-segmented-control", ...fieldStateAttributes({ isInvalid: invalid, isDisabled, isReadOnly, isRequired }), children: [_jsx("span", { id: labelId, className: isLabelHidden === true ? "starci-core-field-label starci-core-form-label--screen-reader" : "starci-core-field-label", "data-grammar-field-label": "true", children: label }), _jsx(HeroToggleButtonGroup, { "aria-labelledby": labelId, ...(describedBy === "" ? {} : { "aria-describedby": describedBy }), selectionMode: "single", disallowEmptySelection: true, fullWidth: width === "fill", size: size === "control" ? "lg" : size, ...(isDisabled === true ? { isDisabled: true } : {}), selectedKeys: selected === undefined ? [] : [selected], onSelectionChange: (keys) => {
|
|
28
32
|
const next = firstKey(keys);
|
|
29
33
|
if (isReadOnly === true || next === undefined)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/composite/SegmentedControl/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAE,iBAAiB,IAAI,qBAAqB,EAAY,MAAM,eAAe,CAAA;AACtH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/composite/SegmentedControl/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAE,iBAAiB,IAAI,qBAAqB,EAAY,MAAM,eAAe,CAAA;AACtH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,cAAc,EAA0B,MAAM,gCAAgC,CAAA;AAgCtK,MAAM,QAAQ,GAAG,CAAC,IAAmB,EAAsB,EAAE;IACzD,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;IAC5C,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;AACvD,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,UAAU,GAAG,KAAK,EAAE,GAAG,KAAK,EAAyB,EAAE,EAAE,CAAC,UAAU;IAC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E,CAAC,CACrB,KAAC,gBAAgB,IAEb,EAAE,EAAE,MAAM,CAAC,KAAK,EAChB,UAAU,EAAE,MAAM,CAAC,UAAU,KAAK,IAAI,EACtC,SAAS,EAAC,qBAAqB,yBACX,MAAM,KACtB,CAAC,MAAM,CAAC,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,MAAM,CAAC,eAAe,EAAE,CAAC,YAEzF,MAAM,CAAC,KAAK,IAPR,MAAM,CAAC,KAAK,CAQF,CACtB,CAAC,GACkB,EACvB,IAAI,KAAK,SAAS,IAAI,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAO,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,GAAI,EAC1G,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAClC,eAAM,EAAE,EAAE,aAAa,EAAE,SAAS,EAAC,+BAA+B,oCAAgC,MAAM,YAAE,WAAW,GAAQ,CAChI,EACA,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAC5B,KAAC,gBAAgB,IAAC,EAAE,EAAE,OAAO,YAAG,YAAY,GAAoB,CACnE,IACC,CACT,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
export type TagGroupItem = {
|
|
3
3
|
readonly id: string;
|
|
4
4
|
readonly label: string;
|
|
@@ -25,7 +25,22 @@ type TagGroupRemoval = {
|
|
|
25
25
|
readonly onRemove?: undefined;
|
|
26
26
|
readonly removeLabel?: undefined;
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
type TagGroupReorder = {
|
|
29
|
+
/**
|
|
30
|
+
* Makes the tags reorderable: drag a tag onto another, or hold Alt and press an arrow key (Home and End go to the
|
|
31
|
+
* ends) on a focused tag. Receives every id in the new order. The app owns the order; render `items` in it.
|
|
32
|
+
*/
|
|
33
|
+
readonly onReorder: (ids: ReadonlyArray<string>) => void;
|
|
34
|
+
/** App-owned instruction read with the group, e.g. "Hold Alt and press an arrow key to move a tag". */
|
|
35
|
+
readonly reorderInstructions: string;
|
|
36
|
+
/** App-owned announcement after a move, e.g. "Design moved to position 2 of 5". */
|
|
37
|
+
readonly reorderAnnouncement: (label: string, position: number, total: number) => string;
|
|
38
|
+
} | {
|
|
39
|
+
readonly onReorder?: undefined;
|
|
40
|
+
readonly reorderInstructions?: undefined;
|
|
41
|
+
readonly reorderAnnouncement?: undefined;
|
|
42
|
+
};
|
|
43
|
+
export type TagGroupProps = TagGroupRemoval & TagGroupReorder & {
|
|
29
44
|
/** Names the set of tags/chips, e.g. "Filters". */
|
|
30
45
|
readonly label: string;
|
|
31
46
|
readonly items: ReadonlyArray<TagGroupItem>;
|
|
@@ -38,15 +53,23 @@ export type TagGroupProps = TagGroupRemoval & {
|
|
|
38
53
|
readonly emptyContent?: ReactNode;
|
|
39
54
|
readonly size?: "sm" | "md" | "lg";
|
|
40
55
|
readonly className?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Unresolved tags (knowledge STATE-8): the same tags at the same size, inert, each painted as a Skeleton with its
|
|
58
|
+
* label laid out unseen, so the group keeps its ready box (skeleton parity); the root is `aria-busy`.
|
|
59
|
+
*/
|
|
60
|
+
readonly isSkeleton?: boolean;
|
|
41
61
|
};
|
|
42
62
|
/**
|
|
43
|
-
* Chips/tags: static labels, selectable filters, or
|
|
63
|
+
* Chips/tags: static labels, selectable filters, removable tokens, or a reorderable set.
|
|
44
64
|
*
|
|
45
65
|
* Built on the vendor TagGroup, so arrow keys move between chips, Space/Enter toggle selection
|
|
46
66
|
* and Delete/Backspace remove. Each chip exposes `data-grammar-selected`; chips wrap onto new lines
|
|
47
67
|
* at narrow widths instead of overflowing.
|
|
68
|
+
* Reordering (`onReorder`) is Grammar's own layer: the vendor TagGroup has no drag-and-drop collection hooks, so the group
|
|
69
|
+
* wires native drag events for pointer users and Alt+arrow keys for keyboard users on top of the vendor tags, and announces
|
|
70
|
+
* each move through a live region.
|
|
48
71
|
* Contract: root STATE-1, list FOCUS-2, chip FOCUS-1, remove A11Y-2, empty STATE-3.
|
|
49
72
|
*/
|
|
50
|
-
export declare const TagGroup: (
|
|
73
|
+
export declare const TagGroup: (props: TagGroupProps) => import("react").JSX.Element;
|
|
51
74
|
export {};
|
|
52
75
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/composite/TagGroup/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/composite/TagGroup/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA0E,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAI9G,MAAM,MAAM,YAAY,GAAG;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAA;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;IACxB;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAA;AAED,KAAK,eAAe,GAAG;IACnB,4FAA4F;IAC5F,QAAQ,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,aAAa,CAAC,MAAM,CAAC,KAAK,IAAI,CAAA;IACvD,iFAAiF;IACjF,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;CAClD,GAAG;IACA,QAAQ,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G,IAAI,CAAA;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAChC,CAAA;AAqBD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,gCAET,CAAA"}
|
|
@@ -1,17 +1,147 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { Tag as HeroTag, TagGroup as HeroTagGroup } from "@heroui/react";
|
|
4
|
+
import { useEffect, useId, useRef, useState } from "react";
|
|
5
|
+
import { FieldSkeletonScope } from "../../primitive/Field/index.js";
|
|
4
6
|
import { navigationClassName } from "../../navigationClassNames.js";
|
|
5
7
|
const toIds = (selection, items) => selection === "all"
|
|
6
8
|
? items.map((item) => item.id)
|
|
7
9
|
: [...selection].map(String);
|
|
10
|
+
const moveId = (ids, id, targetIndex) => {
|
|
11
|
+
const from = ids.indexOf(id);
|
|
12
|
+
const to = Math.min(ids.length - 1, Math.max(0, targetIndex));
|
|
13
|
+
if (from === -1 || from === to)
|
|
14
|
+
return ids;
|
|
15
|
+
const next = ids.filter((candidate) => candidate !== id);
|
|
16
|
+
next.splice(to, 0, id);
|
|
17
|
+
return next;
|
|
18
|
+
};
|
|
19
|
+
const tagIdOf = (target, root) => {
|
|
20
|
+
if (!(target instanceof Element))
|
|
21
|
+
return undefined;
|
|
22
|
+
const tag = target.closest("[data-grammar-tag-id]");
|
|
23
|
+
return tag !== null && root.contains(tag) ? tag.dataset.grammarTagId : undefined;
|
|
24
|
+
};
|
|
8
25
|
/**
|
|
9
|
-
* Chips/tags: static labels, selectable filters, or
|
|
26
|
+
* Chips/tags: static labels, selectable filters, removable tokens, or a reorderable set.
|
|
10
27
|
*
|
|
11
28
|
* Built on the vendor TagGroup, so arrow keys move between chips, Space/Enter toggle selection
|
|
12
29
|
* and Delete/Backspace remove. Each chip exposes `data-grammar-selected`; chips wrap onto new lines
|
|
13
30
|
* at narrow widths instead of overflowing.
|
|
31
|
+
* Reordering (`onReorder`) is Grammar's own layer: the vendor TagGroup has no drag-and-drop collection hooks, so the group
|
|
32
|
+
* wires native drag events for pointer users and Alt+arrow keys for keyboard users on top of the vendor tags, and announces
|
|
33
|
+
* each move through a live region.
|
|
14
34
|
* Contract: root STATE-1, list FOCUS-2, chip FOCUS-1, remove A11Y-2, empty STATE-3.
|
|
15
35
|
*/
|
|
16
|
-
export const TagGroup = (
|
|
36
|
+
export const TagGroup = (props) => props.isSkeleton === true
|
|
37
|
+
? _jsx(FieldSkeletonScope, { component: "TagGroup", children: _jsx(TagGroupControl, { ...props }) })
|
|
38
|
+
: _jsx(TagGroupControl, { ...props });
|
|
39
|
+
const TagGroupControl = ({ label, items, selectionMode = "none", selectedIds, defaultSelectedIds, onSelectionChange, onRemove, removeLabel, onReorder, reorderInstructions, reorderAnnouncement, emptyContent, size = "md", className, }) => {
|
|
40
|
+
const rootRef = useRef(null);
|
|
41
|
+
const instructionsId = useId();
|
|
42
|
+
const [announcement, setAnnouncement] = useState("");
|
|
43
|
+
const [draggingId, setDraggingId] = useState(undefined);
|
|
44
|
+
const [dropTargetId, setDropTargetId] = useState(undefined);
|
|
45
|
+
const ids = items.map((item) => item.id);
|
|
46
|
+
const reorderable = onReorder !== undefined;
|
|
47
|
+
// The vendor tag does not forward `draggable`, and the vendor group drops `aria-describedby`, so the group marks each
|
|
48
|
+
// enabled tag draggable and points the grid at the reorder instructions. The vendor collection renders its tags after
|
|
49
|
+
// this component's effects have run, so the marking also runs whenever the tags' DOM changes.
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
const root = rootRef.current;
|
|
52
|
+
if (root === null || !reorderable)
|
|
53
|
+
return;
|
|
54
|
+
const mark = () => {
|
|
55
|
+
root.querySelectorAll("[data-grammar-tag-id]").forEach((tag) => {
|
|
56
|
+
const draggable = tag.getAttribute("aria-disabled") !== "true";
|
|
57
|
+
if (tag.draggable !== draggable)
|
|
58
|
+
tag.draggable = draggable;
|
|
59
|
+
});
|
|
60
|
+
const grid = root.querySelector("[role='grid']");
|
|
61
|
+
if (grid === null || reorderInstructions === undefined)
|
|
62
|
+
return;
|
|
63
|
+
const described = (grid.getAttribute("aria-describedby") ?? "").split(" ").filter((id) => id !== "");
|
|
64
|
+
if (!described.includes(instructionsId))
|
|
65
|
+
grid.setAttribute("aria-describedby", [...described, instructionsId].join(" "));
|
|
66
|
+
};
|
|
67
|
+
mark();
|
|
68
|
+
const observer = new MutationObserver(mark);
|
|
69
|
+
observer.observe(root, { childList: true, subtree: true, attributeFilter: ["aria-disabled", "aria-describedby"] });
|
|
70
|
+
return () => observer.disconnect();
|
|
71
|
+
}, [reorderable, reorderInstructions, instructionsId]);
|
|
72
|
+
const commit = (id, targetIndex) => {
|
|
73
|
+
if (onReorder === undefined || reorderAnnouncement === undefined)
|
|
74
|
+
return;
|
|
75
|
+
const next = moveId(ids, id, targetIndex);
|
|
76
|
+
if (next === ids)
|
|
77
|
+
return;
|
|
78
|
+
onReorder(next);
|
|
79
|
+
const item = items.find((candidate) => candidate.id === id);
|
|
80
|
+
setAnnouncement(reorderAnnouncement(item?.label ?? id, next.indexOf(id) + 1, next.length));
|
|
81
|
+
requestAnimationFrame(() => {
|
|
82
|
+
rootRef.current?.querySelector(`[data-grammar-tag-id="${CSS.escape(id)}"]`)?.focus();
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
const onKeyDown = (event) => {
|
|
86
|
+
const root = rootRef.current;
|
|
87
|
+
if (!reorderable || root === null || !event.altKey || event.ctrlKey || event.metaKey)
|
|
88
|
+
return;
|
|
89
|
+
const id = tagIdOf(event.target, root);
|
|
90
|
+
if (id === undefined || event.target !== root.querySelector(`[data-grammar-tag-id="${CSS.escape(id)}"]`))
|
|
91
|
+
return;
|
|
92
|
+
const rtl = getComputedStyle(root).direction === "rtl";
|
|
93
|
+
const index = ids.indexOf(id);
|
|
94
|
+
const target = event.key === "ArrowLeft" ? index + (rtl ? 1 : -1)
|
|
95
|
+
: event.key === "ArrowRight" ? index + (rtl ? -1 : 1)
|
|
96
|
+
: event.key === "ArrowUp" ? index - 1
|
|
97
|
+
: event.key === "ArrowDown" ? index + 1
|
|
98
|
+
: event.key === "Home" ? 0
|
|
99
|
+
: event.key === "End" ? ids.length - 1
|
|
100
|
+
: undefined;
|
|
101
|
+
if (target === undefined)
|
|
102
|
+
return;
|
|
103
|
+
event.preventDefault();
|
|
104
|
+
event.stopPropagation();
|
|
105
|
+
commit(id, target);
|
|
106
|
+
};
|
|
107
|
+
const onDragStart = (event) => {
|
|
108
|
+
const root = rootRef.current;
|
|
109
|
+
const id = root === null ? undefined : tagIdOf(event.target, root);
|
|
110
|
+
if (id === undefined)
|
|
111
|
+
return;
|
|
112
|
+
event.dataTransfer.effectAllowed = "move";
|
|
113
|
+
event.dataTransfer.setData("text/plain", id);
|
|
114
|
+
setDraggingId(id);
|
|
115
|
+
};
|
|
116
|
+
const onDragOver = (event) => {
|
|
117
|
+
const root = rootRef.current;
|
|
118
|
+
const id = root === null ? undefined : tagIdOf(event.target, root);
|
|
119
|
+
if (draggingId === undefined || id === undefined)
|
|
120
|
+
return;
|
|
121
|
+
event.preventDefault();
|
|
122
|
+
event.dataTransfer.dropEffect = "move";
|
|
123
|
+
setDropTargetId(id);
|
|
124
|
+
};
|
|
125
|
+
const onDrop = (event) => {
|
|
126
|
+
const root = rootRef.current;
|
|
127
|
+
const id = root === null ? undefined : tagIdOf(event.target, root);
|
|
128
|
+
if (draggingId === undefined)
|
|
129
|
+
return;
|
|
130
|
+
event.preventDefault();
|
|
131
|
+
if (id !== undefined)
|
|
132
|
+
commit(draggingId, ids.indexOf(id));
|
|
133
|
+
setDraggingId(undefined);
|
|
134
|
+
setDropTargetId(undefined);
|
|
135
|
+
};
|
|
136
|
+
const onDragEnd = () => {
|
|
137
|
+
setDraggingId(undefined);
|
|
138
|
+
setDropTargetId(undefined);
|
|
139
|
+
};
|
|
140
|
+
const tags = (_jsx(HeroTagGroup, { "aria-label": label, ...(reorderable ? { "data-grammar-tag-reorderable": "true" } : {}), className: navigationClassName("starci-core-tag-group", className), "data-component": "TagGroup", "data-contract": "STATE-1", "data-tier": "composite", "data-grammar-tag-selection": selectionMode, "data-grammar-tag-removable": onRemove === undefined ? "false" : "true", selectionMode: selectionMode, size: size, ...(selectedIds === undefined ? {} : { selectedKeys: new Set(selectedIds) }), ...(defaultSelectedIds === undefined ? {} : { defaultSelectedKeys: new Set(defaultSelectedIds) }), ...(onSelectionChange === undefined ? {} : { onSelectionChange: (selection) => onSelectionChange(toIds(selection, items)) }), ...(onRemove === undefined ? {} : { onRemove: (keys) => onRemove([...keys].map(String)) }), children: _jsx(HeroTagGroup.List, { className: "starci-core-tag-list", "data-contract": "FOCUS-2", ...(emptyContent === undefined ? {} : { renderEmptyState: () => _jsx("span", { className: "starci-core-tag-empty", "data-contract": "STATE-3", "data-grammar-tag-empty": "true", children: emptyContent }) }), children: items.map((item) => (_jsx(HeroTag, { id: item.id, className: "starci-core-tag", "data-contract": "FOCUS-1", "data-grammar-tag": "true", "data-grammar-tag-id": item.id, ...(reorderable ? { "data-grammar-tag-dragging": draggingId === item.id ? "true" : "false", "data-grammar-tag-drop-target": dropTargetId === item.id && draggingId !== item.id ? "true" : "false" } : {}), textValue: item.isOff === true && item.offLabel !== undefined ? `${item.label}, ${item.offLabel}` : item.label, "data-grammar-tag-state": item.isOff === true ? "off" : "on", ...(item.isOff === true ? { variant: "surface" } : {}), ...(item.isDisabled === undefined ? {} : { isDisabled: item.isDisabled }), children: ({ isSelected, allowsRemoving }) => _jsxs(_Fragment, { children: [_jsxs("span", { className: "starci-core-tag-label", "data-grammar-tag-label": "true", "data-grammar-selected": isSelected ? "true" : "false", children: [item.leading === undefined ? null : _jsx("span", { "aria-hidden": "true", className: "starci-core-tag-leading", "data-contract": "A11Y-2", children: item.leading }), item.label, item.isOff === true && item.offLabel !== undefined ? _jsx("span", { className: "starci-core-visually-hidden", "data-grammar-tag-off-label": "true", children: `, ${item.offLabel}` }) : null] }), allowsRemoving ? _jsx(HeroTag.RemoveButton, { "aria-label": removeLabel?.(item.label) ?? item.label, className: "starci-core-tag-remove", "data-contract": "A11Y-2", "data-grammar-tag-remove": "true" }) : null] }) }, item.id))) }) }));
|
|
141
|
+
if (!reorderable)
|
|
142
|
+
return tags;
|
|
143
|
+
// The vendor group forwards neither a ref nor key-capture and drag handlers, so the reorder layer listens on a
|
|
144
|
+
// wrapper of its own that lays out as if absent (`display: contents`).
|
|
145
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { ref: rootRef, className: "starci-core-tag-group-reorder", "data-grammar-tag-reorder": "true", onKeyDownCapture: onKeyDown, onDragStart: onDragStart, onDragOver: onDragOver, onDrop: onDrop, onDragEnd: onDragEnd, children: tags }), _jsx("span", { id: instructionsId, className: "starci-core-visually-hidden", hidden: true, children: reorderInstructions }), _jsx("span", { "aria-live": "polite", role: "status", className: "starci-core-visually-hidden", "data-grammar-tag-announcement": "true", children: announcement })] }));
|
|
146
|
+
};
|
|
17
147
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/composite/TagGroup/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAkB,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/composite/TagGroup/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAkB,MAAM,eAAe,CAAA;AACxF,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAsD,MAAM,OAAO,CAAA;AAC9G,OAA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,EAAE,SAAS,EAAC,6BAA6B,EAAC,MAAM,kBAAE,mBAAmB,GAAQ,EACrG,4BAAgB,QAAQ,EAAC,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,6BAA6B,mCAA+B,MAAM,YAAE,YAAY,GAAQ,IAC1I,CACN,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -10,6 +10,11 @@ export type TimelineItem = {
|
|
|
10
10
|
readonly state?: PresentationState;
|
|
11
11
|
/** The entry the reader is at now (`aria-current="step"`). */
|
|
12
12
|
readonly isCurrent?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* The entry needs the reader (a failed step, a pending approval): the whole row takes a tone background, not just
|
|
15
|
+
* the marker. The tone follows `state` (negative danger, affirmative success, informative accent, otherwise warning).
|
|
16
|
+
*/
|
|
17
|
+
readonly isAttention?: boolean;
|
|
13
18
|
/** App-owned marker glyph; defaults to a dot. */
|
|
14
19
|
readonly marker?: ReactNode;
|
|
15
20
|
};
|