@starci/grammar 0.6.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.build-stamp.json +4 -4
- package/dist/common/registry.d.ts +12 -12
- package/dist/common/renderers-forms.d.ts +13 -13
- package/dist/common/renderers-forms.d.ts.map +1 -1
- package/dist/common/renderers-forms.js +1 -1
- package/dist/common/renderers-forms.js.map +1 -1
- package/dist/common/styles.css +37 -21
- package/dist/core/branch/ComboBox/index.d.ts +3 -1
- package/dist/core/branch/ComboBox/index.d.ts.map +1 -1
- package/dist/core/branch/ComboBox/index.js +3 -3
- package/dist/core/branch/ComboBox/index.js.map +1 -1
- package/dist/core/branch/DatePicker/index.d.ts +3 -1
- package/dist/core/branch/DatePicker/index.d.ts.map +1 -1
- package/dist/core/branch/DatePicker/index.js +3 -3
- package/dist/core/branch/DatePicker/index.js.map +1 -1
- package/dist/core/branch/DateRangePicker/index.d.ts +3 -1
- package/dist/core/branch/DateRangePicker/index.d.ts.map +1 -1
- package/dist/core/branch/DateRangePicker/index.js +3 -3
- package/dist/core/branch/DateRangePicker/index.js.map +1 -1
- package/dist/core/branch/Select/index.d.ts +3 -1
- package/dist/core/branch/Select/index.d.ts.map +1 -1
- package/dist/core/branch/Select/index.js +3 -3
- package/dist/core/branch/Select/index.js.map +1 -1
- package/dist/core/composite/CheckboxGroup/index.d.ts +3 -1
- package/dist/core/composite/CheckboxGroup/index.d.ts.map +1 -1
- package/dist/core/composite/CheckboxGroup/index.js +2 -2
- package/dist/core/composite/CheckboxGroup/index.js.map +1 -1
- package/dist/core/composite/RadioGroup/index.d.ts +3 -1
- package/dist/core/composite/RadioGroup/index.d.ts.map +1 -1
- package/dist/core/composite/RadioGroup/index.js +2 -2
- package/dist/core/composite/RadioGroup/index.js.map +1 -1
- package/dist/core/index.d.ts +0 -108
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +0 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/primitive/Checkbox/index.d.ts +3 -1
- package/dist/core/primitive/Checkbox/index.d.ts.map +1 -1
- package/dist/core/primitive/Checkbox/index.js +2 -2
- package/dist/core/primitive/Checkbox/index.js.map +1 -1
- package/dist/core/primitive/DateField/index.d.ts +6 -3
- package/dist/core/primitive/DateField/index.d.ts.map +1 -1
- package/dist/core/primitive/DateField/index.js +4 -4
- package/dist/core/primitive/DateField/index.js.map +1 -1
- package/dist/core/primitive/Field/index.d.ts +12 -0
- package/dist/core/primitive/Field/index.d.ts.map +1 -1
- package/dist/core/primitive/Field/index.js +2 -0
- package/dist/core/primitive/Field/index.js.map +1 -1
- package/dist/core/primitive/Input/index.d.ts.map +1 -1
- package/dist/core/primitive/Input/index.js +1 -1
- package/dist/core/primitive/Input/index.js.map +1 -1
- package/dist/core/primitive/NumberField/index.d.ts +3 -1
- package/dist/core/primitive/NumberField/index.d.ts.map +1 -1
- package/dist/core/primitive/NumberField/index.js +2 -2
- package/dist/core/primitive/NumberField/index.js.map +1 -1
- package/dist/core/primitive/SearchField/index.d.ts +3 -1
- package/dist/core/primitive/SearchField/index.d.ts.map +1 -1
- package/dist/core/primitive/SearchField/index.js +2 -2
- package/dist/core/primitive/SearchField/index.js.map +1 -1
- package/dist/core/primitive/Textarea/index.d.ts +3 -1
- package/dist/core/primitive/Textarea/index.d.ts.map +1 -1
- package/dist/core/primitive/Textarea/index.js +3 -3
- package/dist/core/primitive/Textarea/index.js.map +1 -1
- package/dist/core/primitive/TimeField/index.d.ts +3 -1
- package/dist/core/primitive/TimeField/index.d.ts.map +1 -1
- package/dist/core/primitive/TimeField/index.js +2 -2
- package/dist/core/primitive/TimeField/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { ListBox as HeroListBox, Select as HeroSelect, Spinner as HeroSpinner, } from "@heroui/react";
|
|
4
4
|
import { useState } from "react";
|
|
5
|
-
import { FieldDescription, FieldErrorText, FieldLabel, useGrammarPortal, vendorFieldProps, } from "../../primitive/Field/index.js";
|
|
5
|
+
import { FieldDescription, FieldErrorText, FieldLabel, fieldVariantAttributes, useGrammarPortal, vendorFieldProps, } from "../../primitive/Field/index.js";
|
|
6
6
|
const toValue = (key) => (key === null ? null : String(key));
|
|
7
7
|
/** Renders the options as vendor list-box items with the selected-state indicator. */
|
|
8
8
|
export const ListOptions = ({ options }) => (_jsx(_Fragment, { children: options.map((option) => (_jsxs(HeroListBox.Item, { id: option.id, textValue: option.label, isDisabled: option.isDisabled === true, className: "starci-core-list-option", "data-grammar-option": "true", children: [_jsxs("span", { className: "starci-core-list-option-copy", children: [_jsx("span", { className: "starci-core-list-option-label", children: option.label }), option.description == null ? null : (_jsx("span", { className: "starci-core-list-option-description", children: option.description }))] }), _jsx(HeroListBox.ItemIndicator, {})] }, option.id))) }));
|
|
@@ -24,14 +24,14 @@ export const ListOptions = ({ options }) => (_jsx(_Fragment, { children: options
|
|
|
24
24
|
* trigger focusable and announced but holds the value and never opens the list; the vendor select
|
|
25
25
|
* has no read-only mode of its own.
|
|
26
26
|
*/
|
|
27
|
-
export const Select = ({ options, placeholder, value, defaultValue, onValueChange, isPending = false, ...field }) => {
|
|
27
|
+
export const Select = ({ options, placeholder, value, defaultValue, onValueChange, isPending = false, variant = "primary", ...field }) => {
|
|
28
28
|
const [heldValue] = useState(value ?? defaultValue ?? null);
|
|
29
29
|
const { anchor, portalProps } = useGrammarPortal();
|
|
30
30
|
const readOnly = field.isReadOnly === true;
|
|
31
31
|
const selection = readOnly
|
|
32
32
|
? { value: value === undefined ? heldValue : value }
|
|
33
33
|
: value === undefined ? defaultValue === undefined ? {} : { defaultValue } : { value };
|
|
34
|
-
return (_jsxs(HeroSelect, { "data-tier": "branch", "data-component": "Select", "data-contract": "A11Y-1 FIELD-3 STATE-6 CONTROL-STATE-2", className: "starci-core-field starci-core-select", fullWidth: true, ...vendorFieldProps({ ...field, isPending }), ...(placeholder === undefined ? {} : { placeholder }), ...selection, ...(readOnly ? { isOpen: false } : {}), onChange: (key) => {
|
|
34
|
+
return (_jsxs(HeroSelect, { "data-tier": "branch", "data-component": "Select", "data-contract": "A11Y-1 FIELD-3 STATE-6 CONTROL-STATE-2", className: "starci-core-field starci-core-select", fullWidth: true, variant: variant, ...fieldVariantAttributes(variant), ...vendorFieldProps({ ...field, isPending }), ...(placeholder === undefined ? {} : { placeholder }), ...selection, ...(readOnly ? { isOpen: false } : {}), onChange: (key) => {
|
|
35
35
|
if (!readOnly)
|
|
36
36
|
onValueChange?.(toValue(key));
|
|
37
37
|
}, children: [anchor, _jsx(FieldLabel, { isHidden: field.isLabelHidden, isRequired: field.isRequired, children: field.label }), _jsxs(HeroSelect.Trigger, { className: "starci-core-select-trigger", "data-grammar-field-control": "true", isPending: isPending, children: [_jsx(HeroSelect.Value, { className: "starci-core-select-value" }), isPending
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/branch/Select/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EACH,OAAO,IAAI,WAAW,EACtB,MAAM,IAAI,UAAU,EACpB,OAAO,IAAI,WAAW,GAEzB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AAChD,OAAO,EACH,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,gBAAgB,GAEnB,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/branch/Select/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EACH,OAAO,IAAI,WAAW,EACtB,MAAM,IAAI,UAAU,EACpB,OAAO,IAAI,WAAW,GAEzB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAA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AAU,CAAC,OAAO,IACf,SAAS,EAAC,4BAA4B,gCACX,MAAM,EACjC,SAAS,EAAE,SAAS,aAEpB,KAAC,UAAU,CAAC,KAAK,IAAC,SAAS,EAAC,0BAA0B,GAAG,EACxD,SAAS;wBACN,CAAC,CAAC,KAAC,WAAW,IAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAC,SAAS,iBAAa,MAAM,EAAC,SAAS,EAAC,2BAA2B,GAAG;wBACpG,CAAC,CAAC,KAAC,UAAU,CAAC,SAAS,IAAC,SAAS,EAAC,8BAA8B,GAAG,IACtD,EACrB,KAAC,gBAAgB,cAAE,KAAK,CAAC,WAAW,GAAoB,EACxD,KAAC,cAAc,cAAE,KAAK,CAAC,YAAY,GAAkB,EACrD,KAAC,UAAU,CAAC,OAAO,IAAC,SAAS,EAAC,0BAA0B,0BAAsB,QAAQ,mBAAe,UAAU,KAAK,WAAW,YAC3H,KAAC,WAAW,IAAC,SAAS,EAAC,kBAAkB,YACrC,KAAC,WAAW,IAAC,OAAO,EAAE,OAAO,GAAI,GACvB,GACG,IACZ,CAChB,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -14,10 +14,12 @@ export type CheckboxGroupProps = FieldControlProps & {
|
|
|
14
14
|
readonly defaultValue?: ReadonlyArray<string>;
|
|
15
15
|
readonly onValueChange?: (value: Array<string>) => void;
|
|
16
16
|
readonly orientation?: ChoiceOrientation;
|
|
17
|
+
/** Layer variant: `secondary` when the control sits on a surface (ANATOMY-2 case-1). */
|
|
18
|
+
readonly variant?: "primary" | "secondary";
|
|
17
19
|
};
|
|
18
20
|
/**
|
|
19
21
|
* Several independent choices under one group name (`role="group"`, labelled by the group label).
|
|
20
22
|
* Required means "at least one", validated by the vendor; the group owns the one error slot.
|
|
21
23
|
*/
|
|
22
|
-
export declare const CheckboxGroup: ({ options, value, defaultValue, onValueChange, orientation, ...field }: CheckboxGroupProps) => import("react").JSX.Element;
|
|
24
|
+
export declare const CheckboxGroup: ({ options, value, defaultValue, onValueChange, orientation, variant, ...field }: CheckboxGroupProps) => import("react").JSX.Element;
|
|
23
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/composite/CheckboxGroup/index.tsx"],"names":[],"mappings":"AAGA,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":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAMH,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,wFAAwF;IACxF,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAA;CAC7C,CAAA;AAcD;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,iFAQ3B,kBAAkB,gCAgCpB,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Checkbox as HeroCheckbox, CheckboxGroup as HeroCheckboxGroup } from "@heroui/react";
|
|
4
|
-
import { FieldDescription, FieldErrorText, FieldLabel, vendorFieldProps, } from "../../primitive/Field/index.js";
|
|
4
|
+
import { FieldDescription, FieldErrorText, FieldLabel, fieldVariantAttributes, vendorFieldProps, } from "../../primitive/Field/index.js";
|
|
5
5
|
import { CheckboxItem } from "../../primitive/Checkbox/index.js";
|
|
6
6
|
/*
|
|
7
7
|
* Consumer hook: `starci-core-choice-group` names this control's root for a consumer or family
|
|
@@ -17,5 +17,5 @@ import { CheckboxItem } from "../../primitive/Checkbox/index.js";
|
|
|
17
17
|
* Several independent choices under one group name (`role="group"`, labelled by the group label).
|
|
18
18
|
* Required means "at least one", validated by the vendor; the group owns the one error slot.
|
|
19
19
|
*/
|
|
20
|
-
export const CheckboxGroup = ({ options, value, defaultValue, onValueChange, orientation = "vertical", ...field }) => (_jsxs(HeroCheckboxGroup, { "data-tier": "composite", "data-component": "CheckboxGroup", "data-contract": "A11Y-1 FIELD-1 FIELD-2 CONTROL-STATE-3", "data-grammar-orientation": orientation, className: "starci-core-field starci-core-choice-group", ...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", "data-grammar-option": "true", children: _jsx(CheckboxItem, { label: option.label, description: option.description, isStandalone: false }) }, option.value))) }), _jsx(FieldErrorText, { children: field.errorMessage })] }));
|
|
20
|
+
export const CheckboxGroup = ({ options, value, defaultValue, onValueChange, orientation = "vertical", variant = "primary", ...field }) => (_jsxs(HeroCheckboxGroup, { "data-tier": "composite", "data-component": "CheckboxGroup", "data-contract": "A11Y-1 FIELD-1 FIELD-2 CONTROL-STATE-3", "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 })] }));
|
|
21
21
|
//# 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,QAAQ,IAAI,YAAY,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAE5F,OAAO,EACH,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,gBAAgB,GAEnB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;
|
|
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,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,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"}
|
|
@@ -6,10 +6,12 @@ export type RadioGroupProps = FieldControlProps & {
|
|
|
6
6
|
readonly defaultValue?: string | null;
|
|
7
7
|
readonly onValueChange?: (value: string) => void;
|
|
8
8
|
readonly orientation?: ChoiceOrientation;
|
|
9
|
+
/** Layer variant: `secondary` when the control sits on a surface (ANATOMY-2 case-1). */
|
|
10
|
+
readonly variant?: "primary" | "secondary";
|
|
9
11
|
};
|
|
10
12
|
/**
|
|
11
13
|
* Exactly one of a few visible choices (`role="radiogroup"`). Arrow keys move and select within the
|
|
12
14
|
* group, Tab leaves it - roving focus is the vendor's.
|
|
13
15
|
*/
|
|
14
|
-
export declare const RadioGroup: ({ options, value, defaultValue, onValueChange, orientation, ...field }: RadioGroupProps) => import("react").JSX.Element;
|
|
16
|
+
export declare const RadioGroup: ({ options, value, defaultValue, onValueChange, orientation, variant, ...field }: RadioGroupProps) => import("react").JSX.Element;
|
|
15
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/composite/RadioGroup/index.tsx"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/composite/RadioGroup/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAMH,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,wFAAwF;IACxF,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAA;CAC7C,CAAA;AAcD;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,iFAQxB,eAAe,gCAsCjB,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Radio as HeroRadio, RadioGroup as HeroRadioGroup } from "@heroui/react";
|
|
4
|
-
import { FieldDescription, FieldErrorText, FieldLabel, vendorFieldProps, } from "../../primitive/Field/index.js";
|
|
4
|
+
import { FieldDescription, FieldErrorText, FieldLabel, fieldVariantAttributes, vendorFieldProps, } from "../../primitive/Field/index.js";
|
|
5
5
|
/*
|
|
6
6
|
* Consumer hook: `starci-core-choice-group` names this control's root for a consumer or family
|
|
7
7
|
* stylesheet. No shipped sheet paints it: the root is drawn as a whole by `.starci-core-field`, so
|
|
@@ -16,5 +16,5 @@ import { FieldDescription, FieldErrorText, FieldLabel, vendorFieldProps, } from
|
|
|
16
16
|
* Exactly one of a few visible choices (`role="radiogroup"`). Arrow keys move and select within the
|
|
17
17
|
* group, Tab leaves it - roving focus is the vendor's.
|
|
18
18
|
*/
|
|
19
|
-
export const RadioGroup = ({ options, value, defaultValue, onValueChange, orientation = "vertical", ...field }) => (_jsxs(HeroRadioGroup, { "data-tier": "composite", "data-component": "RadioGroup", "data-contract": "A11Y-1 FIELD-1 STATE-6 FOCUS-2", "data-grammar-orientation": orientation, className: "starci-core-field starci-core-choice-group", orientation: orientation, ...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 })] }));
|
|
19
|
+
export const RadioGroup = ({ options, value, defaultValue, onValueChange, orientation = "vertical", variant = "primary", ...field }) => (_jsxs(HeroRadioGroup, { "data-tier": "composite", "data-component": "RadioGroup", "data-contract": "A11Y-1 FIELD-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 })] }));
|
|
20
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/composite/RadioGroup/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,eAAe,CAAA;AAChF,OAAO,EACH,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,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,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,C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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"}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -2,114 +2,6 @@ import { defineGrammarFamily, type GrammarRootProps } from "../common/index.js";
|
|
|
2
2
|
export * from "../common/index.js";
|
|
3
3
|
export type { PresentationState } from "./state.js";
|
|
4
4
|
export { STARCI_CORE_BAND_TOKEN_NAMES, STARCI_CORE_DARK_TOKEN_DEFAULTS, STARCI_CORE_DNA, STARCI_CORE_SPACING_SCALE, STARCI_CORE_TOKEN_DEFAULTS, STARCI_CORE_TOKEN_NAMES, type StarCiCoreBandTokenName, type StarCiCoreDna, type StarCiCoreSpacingStep, type StarCiCoreSpacingValue, type StarCiCoreTokenDefaults, type StarCiCoreTokenName, } from "./dna.js";
|
|
5
|
-
/** @deprecated Use COMMON_GRAMMAR_COMPONENTS from `@starci/grammar/common`. */
|
|
6
|
-
export declare const CORE_GRAMMAR_COMPONENTS: Readonly<{
|
|
7
|
-
readonly Accordion: ({ label, items, expandedIds, defaultExpandedIds, onExpandedChange, allowsMultipleExpanded, headingLevel, className, }: import("./index.js").AccordionProps) => import("react").JSX.Element;
|
|
8
|
-
readonly Avatar: ({ name, src, fallback, size, isDecorative, isCurrent, className }: import("./index.js").AvatarProps) => import("react").JSX.Element;
|
|
9
|
-
readonly AvatarGroup: ({ label, items, max, size, overflowLabel, className }: import("./index.js").AvatarGroupProps) => import("react").JSX.Element;
|
|
10
|
-
readonly BottomNav: ({ label, items, currentId, onSelect, position, visibility, className }: import("./index.js").BottomNavProps) => import("react").JSX.Element;
|
|
11
|
-
readonly Breadcrumbs: ({ label, items, separator, onAction, className }: import("./index.js").BreadcrumbsProps) => import("react").JSX.Element;
|
|
12
|
-
readonly Calendar: ({ label, value, defaultValue, onChange, minValue, maxValue, isDateUnavailable, isDisabled, isReadOnly, previousLabel, nextLabel, className, }: import("./index.js").CalendarProps) => import("react").JSX.Element;
|
|
13
|
-
readonly DataTable: <Row extends import("./index.js").DataTableRow>({ label, columns, rows, renderCell, sort, onSortChange, selectionMode, selectedIds, defaultSelectedIds, onSelectionChange, selectAllLabel, selectRowLabel, isLoading, loadingContent, emptyContent, stickyHeader, maxBlockSize, onRowAction, className, }: import("./index.js").DataTableProps<Row>) => import("react").JSX.Element;
|
|
14
|
-
readonly DescriptionList: (props: import("./index.js").DescriptionListProps) => import("react").JSX.Element;
|
|
15
|
-
readonly Disclosure: ({ title, children, isExpanded, defaultExpanded, onExpandedChange, isDisabled, headingLevel, className, }: import("./index.js").DisclosureProps) => import("react").JSX.Element;
|
|
16
|
-
readonly Footer: ({ label, brand, groups, legal, externalHint, children, className }: import("./index.js").FooterProps) => import("react").JSX.Element;
|
|
17
|
-
readonly Image: ({ src, alt, aspect, fit, fallback, loading, srcSet, sizes, width, height, onLoadStateChange, className, ...assetSlot }: import("./index.js").ImageProps) => import("react").JSX.Element;
|
|
18
|
-
readonly Link: ({ children, href, kind, isCurrent, visited, externalHint, externalIcon, isDisabled, onFollow, className, }: import("./index.js").LinkProps) => import("react").JSX.Element;
|
|
19
|
-
readonly ListBox: ({ label, items, selectionMode, selectedIds, defaultSelectedIds, onSelectionChange, onAction, emptyContent, className, }: import("./index.js").ListBoxProps) => import("react").JSX.Element;
|
|
20
|
-
readonly Pagination: ({ label, page, pageCount, onPageChange, siblingCount, previousLabel, nextLabel, pageLabel, summary, className, }: import("./index.js").PaginationProps) => import("react").JSX.Element;
|
|
21
|
-
readonly Rating: ({ label, value, defaultValue, onChange, max, isReadOnly, isDisabled, valueLabel, icon, name, className, }: import("./index.js").RatingProps) => import("react").JSX.Element;
|
|
22
|
-
readonly Stepper: ({ label, steps, currentStepId, orientation, onStepSelect, stateLabel, renderMarker, className, }: import("./index.js").StepperProps) => import("react").JSX.Element;
|
|
23
|
-
readonly TagGroup: ({ label, items, selectionMode, selectedIds, defaultSelectedIds, onSelectionChange, onRemove, removeLabel, emptyContent, size, className, }: import("./index.js").TagGroupProps) => import("react").JSX.Element;
|
|
24
|
-
readonly Timeline: ({ label, items, className }: import("./index.js").TimelineProps) => import("react").JSX.Element;
|
|
25
|
-
readonly TopBar: ({ brand, navigation, actions, menu, position, className, ...headerProps }: import("./index.js").TopBarProps) => import("react").JSX.Element;
|
|
26
|
-
readonly Alert: (props: import("./index.js").AlertProps) => import("react").JSX.Element | null;
|
|
27
|
-
readonly AlertDialog: ({ title, description, children, tone, confirmLabel, cancelLabel, onConfirm, onCancel, isConfirmPending, trigger, isKeyboardDismissDisabled, ...openState }: import("./index.js").AlertDialogProps) => import("react").JSX.Element;
|
|
28
|
-
readonly CloseButton: ({ label, onPress, isDisabled, size }: import("./index.js").CloseButtonProps) => import("react").JSX.Element;
|
|
29
|
-
readonly Dialog: ({ title, description, children, footer, trigger, closeLabel, size, isDismissable, isKeyboardDismissDisabled, ...openState }: import("./index.js").DialogProps) => import("react").JSX.Element;
|
|
30
|
-
readonly Drawer: ({ title, description, children, footer, trigger, closeLabel, placement, showHandle, isDismissable, isKeyboardDismissDisabled, ...openState }: import("./index.js").DrawerProps) => import("react").JSX.Element;
|
|
31
|
-
readonly DropdownMenu: ({ trigger, entries, onAction, placement, ...openState }: import("./index.js").DropdownMenuProps) => import("react").JSX.Element;
|
|
32
|
-
readonly Kbd: ({ keys }: import("./index.js").KbdProps) => import("react").JSX.Element;
|
|
33
|
-
readonly Meter: ({ label, value, minValue, maxValue, valueLabel, tone, isLabelHidden, segments, }: import("./index.js").MeterProps) => import("react").JSX.Element;
|
|
34
|
-
readonly Popover: ({ trigger, children, placement, showArrow, title, label, ...openState }: import("./index.js").PopoverProps) => import("react").JSX.Element;
|
|
35
|
-
readonly ProgressCircle: ({ label, value, isIndeterminate, size }: import("./index.js").ProgressCircleProps) => import("react").JSX.Element;
|
|
36
|
-
readonly Skeleton: ({ shape, lines, ratio, size }: import("./index.js").SkeletonProps) => import("react").JSX.Element;
|
|
37
|
-
readonly Spinner: ({ label, size, tone }: import("./index.js").SpinnerProps) => import("react").JSX.Element;
|
|
38
|
-
readonly Toast: ({ toast, dismissLabel, onDismiss, isPaused }: import("./index.js").ToastProps) => import("react").JSX.Element;
|
|
39
|
-
readonly Toaster: ({ label, dismissLabel, queue, placement, maxVisible }: import("./index.js").ToasterProps) => import("react").JSX.Element;
|
|
40
|
-
readonly ButtonGroup: ({ label, children, orientation, isDisabled, width }: import("./index.js").ButtonGroupProps) => import("react").JSX.Element;
|
|
41
|
-
readonly Checkbox: ({ value, isSelected, defaultSelected, onSelectedChange, isIndeterminate, ...field }: import("./index.js").CheckboxProps) => import("react").JSX.Element;
|
|
42
|
-
readonly CheckboxGroup: ({ options, value, defaultValue, onValueChange, orientation, ...field }: import("./index.js").CheckboxGroupProps) => import("react").JSX.Element;
|
|
43
|
-
readonly ComboBox: ({ id, options, placeholder, value, defaultValue, onValueChange, inputValue, defaultInputValue, onInputChange, allowsCustomValue, emptyState, isPending, menuTrigger, ...field }: import("./index.js").ComboBoxProps) => import("react").JSX.Element;
|
|
44
|
-
readonly DateField: ({ value, defaultValue, onValueChange, minValue, maxValue, granularity, ...field }: import("./index.js").DateFieldProps) => import("react").JSX.Element;
|
|
45
|
-
readonly DatePicker: ({ value, defaultValue, onValueChange, minValue, maxValue, isDateUnavailable, granularity, ...field }: import("./index.js").DatePickerProps) => import("react").JSX.Element;
|
|
46
|
-
readonly DateRangePicker: ({ value, defaultValue, onValueChange, minValue, maxValue, isDateUnavailable, allowsNonContiguousRanges, granularity, startName, endName, ...field }: import("./index.js").DateRangePickerProps) => import("react").JSX.Element;
|
|
47
|
-
readonly Field: ({ id: idProp, label, isLabelHidden, description, errorMessage, isInvalid, isRequired, isDisabled, isReadOnly, name, children, }: import("./index.js").FieldProps) => import("react").JSX.Element;
|
|
48
|
-
readonly Fieldset: ({ legend, isLegendHidden, description, errorMessage, children, actions, isDisabled }: import("./index.js").FieldsetProps) => import("react").JSX.Element;
|
|
49
|
-
readonly FileDropzone: ({ id: idProp, accept, multiple, onFilesChange, prompt, icon, hideFileList, label, isLabelHidden, description, errorMessage, isInvalid, isRequired, isDisabled, isReadOnly, name, }: import("./index.js").FileDropzoneProps) => import("react").JSX.Element;
|
|
50
|
-
readonly Form: ({ children, label, id, onSubmit, onReset, action, method, validationErrors, validationBehavior, isPending, }: import("./index.js").FormProps) => import("react").JSX.Element;
|
|
51
|
-
readonly NumberField: ({ id, placeholder, value, defaultValue, onValueChange, minValue, maxValue, step, formatOptions, hideSteppers, ...field }: import("./index.js").NumberFieldProps) => import("react").JSX.Element;
|
|
52
|
-
readonly RadioGroup: ({ options, value, defaultValue, onValueChange, orientation, ...field }: import("./index.js").RadioGroupProps) => import("react").JSX.Element;
|
|
53
|
-
readonly SearchField: ({ id, placeholder, value, defaultValue, onValueChange, onSubmit, onClear, isPending, clearLabel, ...field }: import("./index.js").SearchFieldProps) => import("react").JSX.Element;
|
|
54
|
-
readonly SegmentedControl: ({ options, value, defaultValue, onValueChange, width, label, isLabelHidden, description, errorMessage, isInvalid, isRequired, isDisabled, isReadOnly, name, }: import("./index.js").SegmentedControlProps) => import("react").JSX.Element;
|
|
55
|
-
readonly Select: ({ options, placeholder, value, defaultValue, onValueChange, isPending, ...field }: import("./index.js").SelectProps) => import("react").JSX.Element;
|
|
56
|
-
readonly Slider: ({ value, defaultValue, onValueChange, onValueCommit, minValue, maxValue, step, formatOptions, thumbLabels, orientation, label, isLabelHidden, description, errorMessage, isInvalid, isRequired, isDisabled, isReadOnly, name, }: import("./index.js").SliderProps) => import("react").JSX.Element;
|
|
57
|
-
readonly Switch: ({ value, isSelected, defaultSelected, onSelectedChange, ...field }: import("./index.js").SwitchProps) => import("react").JSX.Element;
|
|
58
|
-
readonly Textarea: ({ id, placeholder, value, defaultValue, rows, maxLength, minLength, onValueChange, ...field }: import("./index.js").TextareaProps) => import("react").JSX.Element;
|
|
59
|
-
readonly TimeField: ({ value, defaultValue, onValueChange, minValue, maxValue, granularity, hourCycle, ...field }: import("./index.js").TimeFieldProps) => import("react").JSX.Element;
|
|
60
|
-
readonly Badge: ({ children, startContent, tone, isDot, isSkeleton }: import("./index.js").BadgeProps) => import("react").JSX.Element;
|
|
61
|
-
readonly Button: (props: import("./index.js").ButtonProps) => import("react").JSX.Element;
|
|
62
|
-
readonly ChatWorkspace: (props: import("./index.js").ChatWorkspaceProps) => import("react").JSX.Element;
|
|
63
|
-
readonly Divider: (props: import("./index.js").DividerProps) => import("react").JSX.Element;
|
|
64
|
-
readonly EmptyNotice: ({ message, description, iconSource, actionLabel, actionStartContent, actionVariant, isActionPending, onAction, }: import("./index.js").EmptyNoticeProps) => import("react").JSX.Element;
|
|
65
|
-
readonly FencedCodeBlock: (props: import("./index.js").FencedCodeBlockProps) => import("react").JSX.Element;
|
|
66
|
-
readonly GrammarRoot: ({ className, theme, ...props }: GrammarRootProps) => import("react").JSX.Element;
|
|
67
|
-
readonly Heading: ({ children, level, scale, isSkeleton, isVisuallyHidden, }: import("./index.js").HeadingProps) => import("react").JSX.Element;
|
|
68
|
-
readonly HorizontalScrollRegion: import("react").ForwardRefExoticComponent<Omit<import("./index.js").HorizontalScrollRegionProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
69
|
-
readonly Icon: ({ source: Source, usage, ariaLabel, isSkeleton }: import("./index.js").IconProps) => import("react").JSX.Element;
|
|
70
|
-
readonly IconButton: ({ source, label, variant, isActive, isDisabled, isSkeleton, onPress, }: import("./index.js").IconButtonProps) => import("react").JSX.Element;
|
|
71
|
-
readonly IconTile: ({ source, artwork, ariaLabel, tone, size, isSkeleton, }: import("./index.js").IconTileProps) => import("react").JSX.Element;
|
|
72
|
-
readonly IncludedMark: ({ className, label, ...props }: import("./index.js").IncludedMarkProps) => import("react").JSX.Element;
|
|
73
|
-
readonly Input: ({ id, name, label, kind: kindName, variant, placeholder, defaultValue, value, hint, errorMessage, isError, isDisabled, isRequired, isSkeleton, revealLabel, hideLabel, revealIcon: RevealIcon, hideIcon: HideIcon, onValueChange, }: import("./index.js").InputProps) => import("react").JSX.Element;
|
|
74
|
-
readonly Label: ({ id, children, depth, as }: import("./index.js").LabelProps) => import("react").DetailedReactHTMLElement<{
|
|
75
|
-
readonly id: string | undefined;
|
|
76
|
-
readonly className: string;
|
|
77
|
-
readonly "data-grammar-label": "true";
|
|
78
|
-
readonly "data-component": "Label";
|
|
79
|
-
readonly "data-tier": "atom";
|
|
80
|
-
readonly "data-grammar-label-depth": "top" | "nested";
|
|
81
|
-
readonly "data-contract": "FONT-1 MARGIN-0" | "FONT-2 MARGIN-0";
|
|
82
|
-
}, HTMLElement>;
|
|
83
|
-
readonly LeadingNumber: (props: import("./LeadingNumber.js").LeadingNumberProps) => import("react").JSX.Element;
|
|
84
|
-
readonly MarkdownArticle: (props: import("./index.js").MarkdownArticleProps) => import("react").JSX.Element;
|
|
85
|
-
readonly MarkdownTableFrame: (props: import("./index.js").MarkdownTableFrameProps) => import("react").JSX.Element;
|
|
86
|
-
readonly MediaFrame: ({ children, caption, aspect, fit, treatment, className, ...assetSlot }: import("./index.js").MediaFrameProps) => import("react").JSX.Element;
|
|
87
|
-
readonly NavigationFeatureNav: ({ identity, navigation, navigationLabel, compactNavigationTrigger, compactNavigationTriggerLabel, actions, actionsLabel, featureNavigation, featureNavigationLabel, measure, position, className, ...headerProps }: import("./index.js").NavigationFeatureNavProps) => import("react").JSX.Element;
|
|
88
|
-
readonly OtpInput: (props: import("./OtpInput.js").OtpInputProps) => import("react").JSX.Element;
|
|
89
|
-
readonly PageContainer: ({ className, measure, ...props }: import("./index.js").PageContainerProps) => import("react").JSX.Element;
|
|
90
|
-
readonly PinnedActionBar: ({ children, label, visibility }: import("./index.js").PinnedActionBarProps) => import("react").JSX.Element;
|
|
91
|
-
readonly PressableField: ({ label, placeholder, source, shortcut, isDisabled, onPress }: import("./index.js").PressableFieldProps) => import("react").JSX.Element;
|
|
92
|
-
readonly PrimaryRailLayout: ({ primary, rail, railWidth, align, collapsedOrder, className, }: import("./index.js").PrimaryRailLayoutProps) => import("react").JSX.Element;
|
|
93
|
-
readonly Progress: ({ label, value, isSkeleton }: import("./index.js").ProgressProps) => import("react").JSX.Element;
|
|
94
|
-
readonly Rail: (props: import("./index.js").RailProps) => import("react").JSX.Element;
|
|
95
|
-
readonly RankArtwork: ({ className, kind, label, ...props }: import("./index.js").RankArtworkProps) => import("react").JSX.Element;
|
|
96
|
-
readonly SectionHeader: ({ title, description, eyebrow, action, count, meta, level, className, id, composition, }: import("./index.js").SectionHeaderProps) => import("react").JSX.Element;
|
|
97
|
-
readonly Sidebar: ({ label, groups, selectedKey, presentation, isCollapsed, collapseLabel, expandLabel, toggleSource, header, footer, onAction, onCollapsedChange, }: import("./index.js").SidebarProps) => import("react").JSX.Element;
|
|
98
|
-
readonly StateMark: (props: import("./StateMark.js").StateMarkProps) => import("react").JSX.Element | null;
|
|
99
|
-
readonly StaticStateRow: (props: import("./index.js").StaticStateRowProps) => import("react").JSX.Element;
|
|
100
|
-
readonly Subnav: ({ label, title, leading, menuIcon, openMenuLabel, closeMenuLabel, isMenuOpen, onMenuOpenChange, position, visibility, className, ...navProps }: import("./index.js").SubnavProps) => import("react").JSX.Element;
|
|
101
|
-
readonly SurfaceAccordionCard: <Summary, Body>(props: import("./index.js").SurfaceAccordionCardProps<Summary, Body>) => import("react").JSX.Element;
|
|
102
|
-
readonly SurfaceCard: (props: import("./index.js").SurfaceCardProps) => import("react").JSX.Element;
|
|
103
|
-
readonly SurfaceCopyGroup: ({ className, density, ...props }: import("./index.js").SurfaceCopyGroupProps) => import("react").JSX.Element;
|
|
104
|
-
readonly SurfaceListCard: (props: import("./index.js").SurfaceListCardProps) => import("react").JSX.Element;
|
|
105
|
-
readonly Tabs: (props: import("./index.js").TabsProps) => import("react").JSX.Element;
|
|
106
|
-
readonly Text: ({ as: Element, id, children, startContent, size, tone, weight, live, overflow, isSkeleton, isSuperseded, parentEmphasis, }: import("./index.js").TextProps) => import("react").JSX.Element;
|
|
107
|
-
readonly TextAction: (props: import("./index.js").TextActionProps) => import("react").JSX.Element;
|
|
108
|
-
readonly Tooltip: ({ content, children, placement, }: import("./index.js").TooltipProps) => import("react").JSX.Element;
|
|
109
|
-
readonly VerticalScrollRegion: (props: import("./index.js").VerticalScrollRegionProps) => import("react").JSX.Element;
|
|
110
|
-
readonly WorkspaceShell: (props: import("./index.js").WorkspaceShellProps) => import("react").JSX.Element;
|
|
111
|
-
}>;
|
|
112
|
-
export type CoreGrammarComponentName = keyof typeof CORE_GRAMMAR_COMPONENTS;
|
|
113
5
|
export declare const coreGrammar: import("./index.js").GrammarFamilyContract<"core", {}>;
|
|
114
6
|
export declare const CoreGrammarRoot: ({ className, theme, ...props }: GrammarRootProps) => import("react").JSX.Element;
|
|
115
7
|
export declare const coreRuleConformance: Readonly<{
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAGH,mBAAmB,EAGnB,KAAK,gBAAgB,EACxB,MAAM,oBAAoB,CAAA;AAM3B,cAAc,oBAAoB,CAAA;AAElC,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,EACH,4BAA4B,EAC5B,+BAA+B,EAC/B,eAAe,EACf,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,GAC3B,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAGH,mBAAmB,EAGnB,KAAK,gBAAgB,EACxB,MAAM,oBAAoB,CAAA;AAM3B,cAAc,oBAAoB,CAAA;AAElC,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,EACH,4BAA4B,EAC5B,+BAA+B,EAC/B,eAAe,EACf,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,GAC3B,MAAM,UAAU,CAAA;AAQjB,eAAO,MAAM,WAAW,wDAOtB,CAAA;AAEF,eAAO,MAAM,eAAe,mFAAqC,CAAA;AAEjE,eAAO,MAAM,mBAAmB;;;;;;EAI9B,CAAA;AAGF,OAAO,EAAE,mBAAmB,EAAE,CAAA;AAC9B,YAAY,EACR,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,GACtB,MAAM,oBAAoB,CAAA"}
|
package/dist/core/index.js
CHANGED
|
@@ -6,8 +6,6 @@ import { createElement } from "react";
|
|
|
6
6
|
// @starci/grammar/common; both name the same Common components.
|
|
7
7
|
export * from "../common/index.js";
|
|
8
8
|
export { STARCI_CORE_BAND_TOKEN_NAMES, STARCI_CORE_DARK_TOKEN_DEFAULTS, STARCI_CORE_DNA, STARCI_CORE_SPACING_SCALE, STARCI_CORE_TOKEN_DEFAULTS, STARCI_CORE_TOKEN_NAMES, } from "./dna.js";
|
|
9
|
-
/** @deprecated Use COMMON_GRAMMAR_COMPONENTS from `@starci/grammar/common`. */
|
|
10
|
-
export const CORE_GRAMMAR_COMPONENTS = COMMON_GRAMMAR_COMPONENTS;
|
|
11
9
|
/** StarCi Core is one visual family implementing the Common contract. */
|
|
12
10
|
const CoreGrammarRootRenderer = (props) => {
|
|
13
11
|
const CommonGrammarRoot = COMMON_GRAMMAR_COMPONENTS.GrammarRoot;
|
package/dist/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EACH,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,4BAA4B,GAG/B,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,4GAA4G;AAC5G,2GAA2G;AAC3G,gEAAgE;AAChE,cAAc,oBAAoB,CAAA;AAGlC,OAAO,EACH,4BAA4B,EAC5B,+BAA+B,EAC/B,eAAe,EACf,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,GAO1B,MAAM,UAAU,CAAA;AAEjB
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EACH,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,4BAA4B,GAG/B,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,4GAA4G;AAC5G,2GAA2G;AAC3G,gEAAgE;AAChE,cAAc,oBAAoB,CAAA;AAGlC,OAAO,EACH,4BAA4B,EAC5B,+BAA+B,EAC/B,eAAe,EACf,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,GAO1B,MAAM,UAAU,CAAA;AAEjB,yEAAyE;AACzE,MAAM,uBAAuB,GAA+C,CAAC,KAAK,EAAE,EAAE;IAClF,MAAM,iBAAiB,GAAG,yBAAyB,CAAC,WAAW,CAAA;IAC/D,OAAO,aAAa,CAAC,iBAAiB,EAAE,EAAE,GAAG,KAAK,EAAE,qBAAqB,EAAE,MAAM,EAAE,CAAC,CAAA;AACxF,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,mBAAmB,CAAC;IAC3C,EAAE,EAAE,MAAM;IACV,MAAM,EAAE;QACJ,UAAU,EAAE,iCAAiC;QAC7C,KAAK,EAAE,EAAE,SAAS,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,EAAE;KAC7D;IACD,UAAU,EAAE,EAAE,YAAY,EAAE,EAAE,WAAW,EAAE,uBAAuB,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;CACzF,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC,UAAU,CAAC,WAAW,CAAA;AAEjE,MAAM,CAAC,MAAM,mBAAmB,GAAG,4BAA4B,CAAC;IAC5D,QAAQ,EAAE,MAAM;IAChB,oBAAoB,EAAE,kBAAkB;IACxC,cAAc,EAAE,EAAE;CACrB,CAAC,CAAA;AAEF,2EAA2E;AAC3E,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -8,6 +8,8 @@ export type CheckboxProps = Omit<FieldControlProps, "isLabelHidden"> & {
|
|
|
8
8
|
readonly onSelectedChange?: (isSelected: boolean) => void;
|
|
9
9
|
/** Mixed state for a parent of partially selected children. */
|
|
10
10
|
readonly isIndeterminate?: boolean;
|
|
11
|
+
/** Layer variant: `secondary` when the control sits on a surface (ANATOMY-2 case-1). */
|
|
12
|
+
readonly variant?: "primary" | "secondary";
|
|
11
13
|
};
|
|
12
14
|
/** Shared checkbox anatomy. Also rendered by CheckboxGroup for each of its options. */
|
|
13
15
|
export declare const CheckboxItem: ({ label, description, errorMessage, isStandalone }: {
|
|
@@ -21,5 +23,5 @@ export declare const CheckboxItem: ({ label, description, errorMessage, isStanda
|
|
|
21
23
|
* One on/off choice with its label as part of the hit area. Space toggles; the vendor supplies the
|
|
22
24
|
* native checkbox input, `aria-checked="mixed"` for indeterminate, and required/invalid wiring.
|
|
23
25
|
*/
|
|
24
|
-
export declare const Checkbox: ({ value, isSelected, defaultSelected, onSelectedChange, isIndeterminate, ...field }: CheckboxProps) => import("react").JSX.Element;
|
|
26
|
+
export declare const Checkbox: ({ value, isSelected, defaultSelected, onSelectedChange, isIndeterminate, variant, ...field }: CheckboxProps) => import("react").JSX.Element;
|
|
25
27
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/primitive/Checkbox/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/primitive/Checkbox/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAMH,KAAK,iBAAiB,EACzB,MAAM,mBAAmB,CAAA;AAE1B,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,iBAAiB,EAAE,eAAe,CAAC,GAAG;IACnE,mEAAmE;IACnE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;IAC7B,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAA;IAClC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAA;IACzD,+DAA+D;IAC/D,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAA;IAClC,wFAAwF;IACxF,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAA;CAC7C,CAAA;AAED,uFAAuF;AACvF,eAAO,MAAM,YAAY,GAAI,oDAAoD;IAC7E,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAA;IAChC,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,CAAA;IACjC,mFAAmF;IACnF,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAA;CACjC,gCAWA,CAAA;AAQD;;;GAGG;AACH,eAAO,MAAM,QAAQ,GAAI,8FAQtB,aAAa,gCAiBf,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { Checkbox as HeroCheckbox } from "@heroui/react";
|
|
4
|
-
import { FieldDescription, FieldErrorText, FieldLabel, vendorFieldProps, } from "../Field/index.js";
|
|
4
|
+
import { FieldDescription, FieldErrorText, FieldLabel, fieldVariantAttributes, vendorFieldProps, } from "../Field/index.js";
|
|
5
5
|
/** Shared checkbox anatomy. Also rendered by CheckboxGroup for each of its options. */
|
|
6
6
|
export const CheckboxItem = ({ label, description, errorMessage, isStandalone }) => (_jsxs(_Fragment, { children: [_jsxs(HeroCheckbox.Content, { className: "starci-core-choice-content", "data-grammar-choice-target": "true", children: [_jsx(HeroCheckbox.Control, { className: "starci-core-choice-control", "data-grammar-choice-control": "checkbox", children: _jsx(HeroCheckbox.Indicator, {}) }), _jsx(FieldLabel, { children: label })] }), _jsx(FieldDescription, { children: description }), isStandalone ? _jsx(FieldErrorText, { children: errorMessage }) : null] }));
|
|
7
7
|
/*
|
|
@@ -13,5 +13,5 @@ export const CheckboxItem = ({ label, description, errorMessage, isStandalone })
|
|
|
13
13
|
* One on/off choice with its label as part of the hit area. Space toggles; the vendor supplies the
|
|
14
14
|
* native checkbox input, `aria-checked="mixed"` for indeterminate, and required/invalid wiring.
|
|
15
15
|
*/
|
|
16
|
-
export const Checkbox = ({ value, isSelected, defaultSelected, onSelectedChange, isIndeterminate = false, ...field }) => (_jsx(HeroCheckbox, { "data-tier": "atom", "data-component": "Checkbox", "data-contract": "A11Y-1 FIELD-1 CONTROL-STATE-3", className: "starci-core-choice starci-core-checkbox", ...vendorFieldProps(field), isReadOnly: field.isReadOnly === true, isIndeterminate: isIndeterminate, ...(value === undefined ? {} : { value }), ...(isSelected === undefined ? defaultSelected === undefined ? {} : { defaultSelected } : { isSelected }), ...(onSelectedChange === undefined ? {} : { onChange: onSelectedChange }), children: _jsx(CheckboxItem, { label: field.label, description: field.description, errorMessage: field.errorMessage, isStandalone: true }) }));
|
|
16
|
+
export const Checkbox = ({ value, isSelected, defaultSelected, onSelectedChange, isIndeterminate = false, variant = "primary", ...field }) => (_jsx(HeroCheckbox, { "data-tier": "atom", "data-component": "Checkbox", "data-contract": "A11Y-1 FIELD-1 CONTROL-STATE-3", className: "starci-core-choice starci-core-checkbox", variant: variant, ...fieldVariantAttributes(variant), ...vendorFieldProps(field), isReadOnly: field.isReadOnly === true, isIndeterminate: isIndeterminate, ...(value === undefined ? {} : { value }), ...(isSelected === undefined ? defaultSelected === undefined ? {} : { defaultSelected } : { isSelected }), ...(onSelectedChange === undefined ? {} : { onChange: onSelectedChange }), children: _jsx(CheckboxItem, { label: field.label, description: field.description, errorMessage: field.errorMessage, isStandalone: true }) }));
|
|
17
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/primitive/Checkbox/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,eAAe,CAAA;AAExD,OAAO,EACH,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,gBAAgB,GAEnB,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/primitive/Checkbox/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,eAAe,CAAA;AAExD,OAAO,EACH,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,sBAAsB,EACtB,gBAAgB,GAEnB,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,EAAE,CAAC,KACtG,CAAC,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC,YAE1E,KAAC,YAAY,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,YAAY,SAAG,GACxG,CAClB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type DateValue } from "@heroui/react";
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
|
-
import { type FieldControlProps } from "../Field/index.js";
|
|
3
|
+
import { type FieldControlProps, type FieldVariant } from "../Field/index.js";
|
|
4
4
|
export type DateGranularity = "day" | "hour" | "minute" | "second";
|
|
5
5
|
export type DateFieldProps = FieldControlProps & {
|
|
6
6
|
readonly value?: DateValue | null;
|
|
@@ -10,6 +10,8 @@ export type DateFieldProps = FieldControlProps & {
|
|
|
10
10
|
readonly maxValue?: DateValue;
|
|
11
11
|
/** Smallest editable unit. `day` is a date; finer units add a time. */
|
|
12
12
|
readonly granularity?: DateGranularity;
|
|
13
|
+
/** Layer variant: `secondary` when the control sits on a surface (ANATOMY-2 case-1). */
|
|
14
|
+
readonly variant?: "primary" | "secondary";
|
|
13
15
|
};
|
|
14
16
|
/** The segmented date input (each part a spinbutton) shared by DateField, TimeField and the pickers. */
|
|
15
17
|
export declare const DateSegments: ({ slot }: {
|
|
@@ -20,14 +22,15 @@ export declare const DateSegments: ({ slot }: {
|
|
|
20
22
|
* paint, NOT the vendor `Group`: the date input already renders the one labelled `role="group"`,
|
|
21
23
|
* and a second vendor Group would take the same id and name from the field context.
|
|
22
24
|
*/
|
|
23
|
-
export declare const DateFieldBox: ({ children, isInvalid, isDisabled }: {
|
|
25
|
+
export declare const DateFieldBox: ({ children, isInvalid, isDisabled, variant }: {
|
|
24
26
|
readonly children: ReactNode;
|
|
25
27
|
readonly isInvalid: boolean;
|
|
26
28
|
readonly isDisabled: boolean;
|
|
29
|
+
readonly variant?: FieldVariant;
|
|
27
30
|
}) => import("react").JSX.Element;
|
|
28
31
|
/**
|
|
29
32
|
* A typed date: locale-ordered segments that each take digits and arrow keys, the vendor's. Values
|
|
30
33
|
* are `@internationalized/date` objects (the vendor's `DateValue`), never ambiguous strings.
|
|
31
34
|
*/
|
|
32
|
-
export declare const DateField: ({ value, defaultValue, onValueChange, minValue, maxValue, granularity, ...field }: DateFieldProps) => import("react").JSX.Element;
|
|
35
|
+
export declare const DateField: ({ value, defaultValue, onValueChange, minValue, maxValue, granularity, variant, ...field }: DateFieldProps) => import("react").JSX.Element;
|
|
33
36
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/primitive/DateField/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA8B,KAAK,SAAS,EAAE,MAAM,eAAe,CAAA;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/primitive/DateField/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA8B,KAAK,SAAS,EAAE,MAAM,eAAe,CAAA;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAOH,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACpB,MAAM,mBAAmB,CAAA;AAE1B,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAElE,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAAG;IAC7C,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;IACjC,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;IACxC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,KAAK,IAAI,CAAA;IAC1D,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;IAC7B,uEAAuE;IACvE,QAAQ,CAAC,WAAW,CAAC,EAAE,eAAe,CAAA;IACtC,wFAAwF;IACxF,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAA;CAC7C,CAAA;AAQD,wGAAwG;AACxG,eAAO,MAAM,YAAY,GAAI,UAAU;IAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;CAAE,gCAIzE,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,8CAA0D;IACnF,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAA;CAClC,gCAUA,CAAA;AAcD;;;GAGG;AACH,eAAO,MAAM,SAAS,GAAI,4FASvB,cAAc,gCAuBhB,CAAA"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { DateField as HeroDateField } from "@heroui/react";
|
|
4
|
-
import { FieldDescription, FieldErrorText, FieldLabel, isFieldInvalid, vendorFieldProps, } from "../Field/index.js";
|
|
4
|
+
import { FieldDescription, FieldErrorText, FieldLabel, fieldVariantAttributes, isFieldInvalid, vendorFieldProps, } from "../Field/index.js";
|
|
5
5
|
// The vendor's own date-group slot classes. `DateField.Group` would stamp them from its context; the
|
|
6
6
|
// standalone box below renders without that Group (see DateFieldBox), so it names them itself.
|
|
7
|
-
const
|
|
7
|
+
const dateGroupClass = (variant) => `date-input-group date-input-group--${variant} date-input-group--full-width starci-core-date-group`;
|
|
8
8
|
const DATE_INPUT_CLASS = "date-input-group__input starci-core-date-input";
|
|
9
9
|
const DATE_SEGMENT_CLASS = "date-input-group__segment starci-core-date-segment";
|
|
10
10
|
/** The segmented date input (each part a spinbutton) shared by DateField, TimeField and the pickers. */
|
|
@@ -14,7 +14,7 @@ export const DateSegments = ({ slot }) => (_jsx(HeroDateField.Input, { className
|
|
|
14
14
|
* paint, NOT the vendor `Group`: the date input already renders the one labelled `role="group"`,
|
|
15
15
|
* and a second vendor Group would take the same id and name from the field context.
|
|
16
16
|
*/
|
|
17
|
-
export const DateFieldBox = ({ children, isInvalid, isDisabled }) => (_jsx("div", { className:
|
|
17
|
+
export const DateFieldBox = ({ children, isInvalid, isDisabled, variant = "primary" }) => (_jsx("div", { className: dateGroupClass(variant), "data-slot": "date-input-group", "data-grammar-field-control": "true", ...(isInvalid ? { "data-invalid": "true" } : {}), ...(isDisabled ? { "data-disabled": "true" } : {}), children: children }));
|
|
18
18
|
/*
|
|
19
19
|
* Consumer hook: `starci-core-date-field` names this control's root for a consumer or family
|
|
20
20
|
* stylesheet. No shipped sheet paints it: the root is drawn as a whole by `.starci-core-field`, so
|
|
@@ -29,5 +29,5 @@ export const DateFieldBox = ({ children, isInvalid, isDisabled }) => (_jsx("div"
|
|
|
29
29
|
* A typed date: locale-ordered segments that each take digits and arrow keys, the vendor's. Values
|
|
30
30
|
* are `@internationalized/date` objects (the vendor's `DateValue`), never ambiguous strings.
|
|
31
31
|
*/
|
|
32
|
-
export const DateField = ({ value, defaultValue, onValueChange, minValue, maxValue, granularity = "day", ...field }) => (_jsxs(HeroDateField, { "data-tier": "atom", "data-component": "DateField", "data-contract": "A11Y-1 FIELD-1 FIELD-2 FIELD-3", className: "starci-core-field starci-core-date-field", fullWidth: true, ...vendorFieldProps(field), isReadOnly: field.isReadOnly === true, granularity: granularity, ...(value === undefined ? defaultValue === undefined ? {} : { defaultValue } : { value }), ...(onValueChange === undefined ? {} : { onChange: onValueChange }), ...(minValue === undefined ? {} : { minValue }), ...(maxValue === undefined ? {} : { maxValue }), children: [_jsx(FieldLabel, { isHidden: field.isLabelHidden, isRequired: field.isRequired, children: field.label }), _jsx(DateFieldBox, { isInvalid: isFieldInvalid(field), isDisabled: field.isDisabled === true, children: _jsx(DateSegments, {}) }), _jsx(FieldDescription, { children: field.description }), _jsx(FieldErrorText, { children: field.errorMessage })] }));
|
|
32
|
+
export const DateField = ({ value, defaultValue, onValueChange, minValue, maxValue, granularity = "day", variant = "primary", ...field }) => (_jsxs(HeroDateField, { "data-tier": "atom", "data-component": "DateField", "data-contract": "A11Y-1 FIELD-1 FIELD-2 FIELD-3", className: "starci-core-field starci-core-date-field", fullWidth: true, ...fieldVariantAttributes(variant), ...vendorFieldProps(field), isReadOnly: field.isReadOnly === true, granularity: granularity, ...(value === undefined ? defaultValue === undefined ? {} : { defaultValue } : { value }), ...(onValueChange === undefined ? {} : { onChange: onValueChange }), ...(minValue === undefined ? {} : { minValue }), ...(maxValue === undefined ? {} : { maxValue }), children: [_jsx(FieldLabel, { isHidden: field.isLabelHidden, isRequired: field.isRequired, children: field.label }), _jsx(DateFieldBox, { isInvalid: isFieldInvalid(field), isDisabled: field.isDisabled === true, variant: variant, children: _jsx(DateSegments, {}) }), _jsx(FieldDescription, { children: field.description }), _jsx(FieldErrorText, { children: field.errorMessage })] }));
|
|
33
33
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/primitive/DateField/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,SAAS,IAAI,aAAa,EAAkB,MAAM,eAAe,CAAA;AAE1E,OAAO,EACH,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,cAAc,EACd,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources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nG,KAAC,YAAY,KAAG,GACL,EACf,KAAC,gBAAgB,cAAE,KAAK,CAAC,WAAW,GAAoB,EACxD,KAAC,cAAc,cAAE,KAAK,CAAC,YAAY,GAAkB,IACzC,CACnB,CAAA"}
|
|
@@ -25,6 +25,18 @@ export type FieldControlProps = {
|
|
|
25
25
|
/** The form field name submitted with the value. */
|
|
26
26
|
readonly name?: string;
|
|
27
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* HeroUI v3's layer variant of a form control. `primary` sits on the page background; `secondary` is the
|
|
30
|
+
* nested treatment for a control placed ON a surface (a SurfaceCard, a card, a dialog or drawer panel),
|
|
31
|
+
* so the field keeps its contrast against the surface it stands on (knowledge ANATOMY-2 case-1: page
|
|
32
|
+
* background -> surface -> nested control). Every control whose vendor anatomy has the variant takes it;
|
|
33
|
+
* Switch, Slider and a single Radio have none (a Radio follows its RadioGroup).
|
|
34
|
+
*/
|
|
35
|
+
export type FieldVariant = "primary" | "secondary";
|
|
36
|
+
/** The hook a rendered control carries so a gate reads its layer variant without vendor class names. */
|
|
37
|
+
export declare const fieldVariantAttributes: (variant: FieldVariant) => {
|
|
38
|
+
readonly "data-grammar-variant": FieldVariant;
|
|
39
|
+
};
|
|
28
40
|
export type FieldStateInput = {
|
|
29
41
|
readonly isInvalid?: boolean | undefined;
|
|
30
42
|
readonly isDisabled?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/primitive/Field/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAEjE;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC5B,4EAA4E;IAC5E,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;IACzB,+FAA+F;IAC/F,QAAQ,CAAC,aAAa,CAAC,E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ED,sGAAsG;AACtG,MAAM,MAAM,sBAAsB,GAAG;IACjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IACpC,QAAQ,CAAC,cAAc,CAAC,EAAE,IAAI,CAAA;IAC9B,QAAQ,CAAC,eAAe,CAAC,EAAE,IAAI,CAAA;IAC/B,QAAQ,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAA;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAA;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,iBAAiB,GAAG;IACzC,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAA;IACpB,sGAAsG;IACtG,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,sBAAsB,KAAK,SAAS,CAAA;CACpE,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAAI,iIAYnB,UAAU,gCAgDZ,CAAA"}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Description as HeroDescription, FieldError as HeroFieldError, Label as HeroLabel, } from "@heroui/react";
|
|
4
4
|
import { useCallback, useId, useState } from "react";
|
|
5
|
+
/** The hook a rendered control carries so a gate reads its layer variant without vendor class names. */
|
|
6
|
+
export const fieldVariantAttributes = (variant) => ({ "data-grammar-variant": variant });
|
|
5
7
|
/** Folds the control's state into the render-neutral presentation vocabulary. */
|
|
6
8
|
export const fieldPresentationState = ({ isInvalid, isDisabled, isPending }) => {
|
|
7
9
|
if (isDisabled === true)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/primitive/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B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAA;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAA;IAC/B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAA;IACzB,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,CAAA;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,CAAA;IAC/B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;IAC7B,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACnD,CAAA;AAUD,uFAAuF;AACvF,eAAO,MAAM,KAAK,GAAI,qOAoBnB,UAAU,gCA+DZ,CAAA"}
|
|
@@ -20,7 +20,7 @@ export const Input = ({ id, name, label, kind: kindName = "text", variant = "pri
|
|
|
20
20
|
if (isSkeleton) {
|
|
21
21
|
return (_jsxs("div", { "data-tier": "atom", "data-component": "Input", "data-state": "skeleton", "data-contract": "GAP-2", className: "starci-core-input", children: [_jsx(HeroSkeleton, { className: "starci-core-input-resting-label" }), _jsx(HeroSkeleton, { className: "starci-core-input-resting-control" })] }));
|
|
22
22
|
}
|
|
23
|
-
return (_jsxs(HeroTextField, { "data-tier": "atom", "data-component": "Input", fullWidth: true, variant: variant, isInvalid: invalid, isDisabled: isDisabled, isRequired: isRequired, "data-contract": "GAP-2", className: "starci-core-input", children: [_jsx(HeroLabel, { children: label }), hint == null ? null : _jsx(HeroDescription, { children: hint }), _jsxs("div", { className: "starci-core-input-control", "data-reveal": isSecret && toggleLabel !== undefined ? "true" : "false", children: [_jsx(HeroInput, { id: id, name: name, type: isSecret && isRevealed ? "text" : kind.type, autoComplete: kind.autoComplete, inputMode: kind.inputMode, ...(placeholder === undefined ? {} : { placeholder }), ...(value === undefined
|
|
23
|
+
return (_jsxs(HeroTextField, { "data-tier": "atom", "data-component": "Input", fullWidth: true, variant: variant, "data-grammar-variant": variant, isInvalid: invalid, isDisabled: isDisabled, isRequired: isRequired, "data-contract": "GAP-2", className: "starci-core-input", children: [_jsx(HeroLabel, { children: label }), hint == null ? null : _jsx(HeroDescription, { children: hint }), _jsxs("div", { className: "starci-core-input-control", "data-reveal": isSecret && toggleLabel !== undefined ? "true" : "false", children: [_jsx(HeroInput, { id: id, name: name, type: isSecret && isRevealed ? "text" : kind.type, autoComplete: kind.autoComplete, inputMode: kind.inputMode, ...(placeholder === undefined ? {} : { placeholder }), ...(value === undefined
|
|
24
24
|
? defaultValue === undefined ? {} : { defaultValue }
|
|
25
25
|
: { value }), fullWidth: true, className: "starci-core-input-field", onChange: (event) => onValueChange?.(event.target.value) }), !isSecret || toggleLabel === undefined ? null : (_jsx("button", { type: "button", "aria-label": toggleLabel, disabled: isDisabled, "data-contract": "TONE-2", className: "starci-core-input-reveal", onClick: () => setIsRevealed((current) => !current), children: ToggleIcon === undefined ? _jsx("span", { "data-contract": "FONT-1", className: "starci-core-input-reveal-label", children: toggleLabel }) : _jsx(ToggleIcon, { className: "starci-core-input-reveal-icon" }) }))] }), errorMessage == null ? null : _jsx(HeroErrorMessage, { children: errorMessage })] }));
|
|
26
26
|
};
|