@bspk/ui 1.1.13 → 1.1.15
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/Checkbox.d.ts +1 -1
- package/dist/Checkbox.js +2 -2
- package/dist/Checkbox.js.map +1 -1
- package/dist/CheckboxOption.d.ts +2 -1
- package/dist/Dropdown.d.ts +3 -3
- package/dist/Dropdown.js +2 -1
- package/dist/Dropdown.js.map +1 -1
- package/dist/FormField.d.ts +5 -4
- package/dist/FormField.js +3 -3
- package/dist/FormField.js.map +1 -1
- package/dist/InlineAlert.js +1 -1
- package/dist/Link.d.ts +2 -1
- package/dist/Link.js.map +1 -1
- package/dist/ListItem.d.ts +1 -1
- package/dist/ListItem.js +2 -2
- package/dist/ListItem.js.map +1 -1
- package/dist/NumberField.d.ts +2 -1
- package/dist/NumberInput.d.ts +23 -13
- package/dist/NumberInput.js +15 -4
- package/dist/NumberInput.js.map +1 -1
- package/dist/Radio.d.ts +2 -2
- package/dist/Radio.js.map +1 -1
- package/dist/RadioOption.d.ts +2 -1
- package/dist/RadioOption.js.map +1 -1
- package/dist/SegmentedControl.d.ts +11 -7
- package/dist/SegmentedControl.js +7 -6
- package/dist/SegmentedControl.js.map +1 -1
- package/dist/StylesProviderAnywhere.js +1 -1
- package/dist/StylesProviderBetterHomesGardens.js +1 -1
- package/dist/StylesProviderCartus.js +1 -1
- package/dist/StylesProviderCentury21.js +1 -1
- package/dist/StylesProviderColdwellBanker.js +1 -1
- package/dist/StylesProviderCorcoran.js +1 -1
- package/dist/StylesProviderDenaliBoss.js +1 -1
- package/dist/StylesProviderEra.js +1 -1
- package/dist/StylesProviderSothebys.js +1 -1
- package/dist/TabGroup.d.ts +15 -6
- package/dist/TabGroup.js +13 -5
- package/dist/TabGroup.js.map +1 -1
- package/dist/TextField.d.ts +2 -1
- package/dist/TextField.js.map +1 -1
- package/dist/TextInput.d.ts +3 -3
- package/dist/TextInput.js +2 -2
- package/dist/TextInput.js.map +1 -1
- package/dist/Textarea.d.ts +20 -10
- package/dist/Textarea.js +15 -8
- package/dist/Textarea.js.map +1 -1
- package/dist/base.css +1 -1
- package/dist/form-field.css +1 -1
- package/dist/hooks/useFloatingMenu.d.ts +3 -2
- package/dist/hooks/useFloatingMenu.js +1 -0
- package/dist/hooks/useFloatingMenu.js.map +1 -1
- package/dist/hooks/{useNavOptions.d.ts → useOptionIconsInvalid.d.ts} +4 -5
- package/dist/hooks/useOptionIconsInvalid.js +21 -0
- package/dist/hooks/useOptionIconsInvalid.js.map +1 -0
- package/dist/index.d.ts +22 -13
- package/dist/index.js.map +1 -1
- package/dist/inline-alert.css +1 -1
- package/dist/number-input.css +1 -1
- package/dist/textarea.css +1 -1
- package/package.json +2 -2
- package/src/Checkbox.tsx +3 -0
- package/src/CheckboxOption.tsx +4 -4
- package/src/Dropdown.tsx +5 -2
- package/src/FormField.tsx +35 -24
- package/src/Link.tsx +28 -25
- package/src/ListItem.tsx +2 -0
- package/src/NumberField.tsx +5 -5
- package/src/NumberInput.tsx +51 -30
- package/src/Radio.tsx +3 -5
- package/src/RadioOption.tsx +4 -1
- package/src/SegmentedControl.tsx +18 -13
- package/src/TabGroup.tsx +33 -12
- package/src/TextField.tsx +19 -17
- package/src/TextInput.tsx +33 -30
- package/src/Textarea.tsx +72 -56
- package/src/base.scss +4 -3
- package/src/form-field.scss +2 -1
- package/src/hooks/useFloatingMenu.ts +4 -2
- package/src/hooks/useOptionIconsInvalid.ts +49 -0
- package/src/index.ts +24 -13
- package/src/inline-alert.scss +1 -1
- package/src/number-input.scss +6 -3
- package/src/textarea.scss +5 -2
- package/dist/hooks/useNavOptions.js +0 -43
- package/dist/hooks/useNavOptions.js.map +0 -1
- package/src/hooks/useNavOptions.ts +0 -76
package/dist/Checkbox.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type CheckboxProps = ToggleControlProps<HTMLInputElement> & {
|
|
|
18
18
|
*
|
|
19
19
|
* @name Checkbox
|
|
20
20
|
*/
|
|
21
|
-
declare function Checkbox({ checked: checkedProp, indeterminate: indeterminateProp, invalid, disabled, ...props }: ElementProps<CheckboxProps, 'input'>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare function Checkbox({ checked: checkedProp, indeterminate: indeterminateProp, invalid, disabled, errorMessage, ...props }: ElementProps<CheckboxProps, 'input'>): import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
declare namespace Checkbox {
|
|
23
23
|
var bspkName: string;
|
|
24
24
|
}
|
package/dist/Checkbox.js
CHANGED
|
@@ -11,7 +11,7 @@ import { useEffect, useRef } from 'react';
|
|
|
11
11
|
*
|
|
12
12
|
* @name Checkbox
|
|
13
13
|
*/
|
|
14
|
-
function Checkbox({ checked: checkedProp = false, indeterminate: indeterminateProp, invalid, disabled, ...props }) {
|
|
14
|
+
function Checkbox({ checked: checkedProp = false, indeterminate: indeterminateProp, invalid, disabled, errorMessage, ...props }) {
|
|
15
15
|
const indeterminate = !!indeterminateProp;
|
|
16
16
|
const checked = !!checkedProp && !indeterminate;
|
|
17
17
|
const inputRef = useRef();
|
|
@@ -20,7 +20,7 @@ function Checkbox({ checked: checkedProp = false, indeterminate: indeterminatePr
|
|
|
20
20
|
return;
|
|
21
21
|
inputRef.current.indeterminate = indeterminate;
|
|
22
22
|
}, [indeterminate]);
|
|
23
|
-
return (_jsxs("span", { "data-bspk": "checkbox", children: [_jsx("input", { ...props, "aria-invalid": invalid || undefined, checked: checked, disabled: disabled || undefined, onChange: (event) => props.onChange(!!event.target.checked, event), ref: (node) => {
|
|
23
|
+
return (_jsxs("span", { "data-bspk": "checkbox", children: [_jsx("input", { ...props, "aria-errormessage": errorMessage || undefined, "aria-invalid": invalid || undefined, checked: checked, disabled: disabled || undefined, onChange: (event) => props.onChange(!!event.target.checked, event), ref: (node) => {
|
|
24
24
|
if (!node)
|
|
25
25
|
return;
|
|
26
26
|
inputRef.current = node;
|
package/dist/Checkbox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../src/Checkbox.tsx"],"names":[],"mappings":";AAAA,OAAO,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAc1C;;;;;;;;GAQG;AACH,SAAS,QAAQ,CAAC,EACd,OAAO,EAAE,WAAW,GAAG,KAAK,EAC5B,aAAa,EAAE,iBAAiB,EAChC,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EAC2B;IACnC,MAAM,aAAa,GAAG,CAAC,CAAC,iBAAiB,CAAC;IAC1C,MAAM,OAAO,GAAG,CAAC,CAAC,WAAW,IAAI,CAAC,aAAa,CAAC;IAEhD,MAAM,QAAQ,GAAG,MAAM,EAAoB,CAAC;IAE5C,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,CAAC,QAAQ,CAAC,OAAO;YAAE,OAAO;QAC9B,QAAQ,CAAC,OAAO,CAAC,aAAa,GAAG,aAAa,CAAC;IACnD,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,OAAO,CACH,6BAEc,UAAU,aAEpB,mBACQ,KAAK,
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../src/Checkbox.tsx"],"names":[],"mappings":";AAAA,OAAO,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAc1C;;;;;;;;GAQG;AACH,SAAS,QAAQ,CAAC,EACd,OAAO,EAAE,WAAW,GAAG,KAAK,EAC5B,aAAa,EAAE,iBAAiB,EAChC,OAAO,EACP,QAAQ,EACR,YAAY,EAEZ,GAAG,KAAK,EAC2B;IACnC,MAAM,aAAa,GAAG,CAAC,CAAC,iBAAiB,CAAC;IAC1C,MAAM,OAAO,GAAG,CAAC,CAAC,WAAW,IAAI,CAAC,aAAa,CAAC;IAEhD,MAAM,QAAQ,GAAG,MAAM,EAAoB,CAAC;IAE5C,SAAS,CAAC,GAA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
|
|
3
|
+
import { InvalidPropsLibrary } from '.';
|
|
4
|
+
export type CheckboxOptionProps = InvalidPropsLibrary & Pick<CheckboxProps, 'checked' | 'disabled' | 'indeterminate' | 'name' | 'onChange' | 'value'> & Pick<ToggleOptionProps, 'description' | 'label'>;
|
|
4
5
|
/**
|
|
5
6
|
* A control that allows users to choose one or more items from a list or turn an feature on or off.
|
|
6
7
|
*
|
package/dist/Dropdown.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import './dropdown.scss';
|
|
2
2
|
import { MenuProps } from './Menu';
|
|
3
3
|
import { Placement } from './hooks/useFloating';
|
|
4
|
-
import { CommonProps } from './';
|
|
4
|
+
import { CommonProps, InvalidPropsLibrary } from './';
|
|
5
5
|
export type DropdownOption = {
|
|
6
6
|
/** The value of the option. */
|
|
7
7
|
value: string;
|
|
8
8
|
/** The label of the option. This is the text that will be displayed on the option. */
|
|
9
9
|
label: string;
|
|
10
10
|
};
|
|
11
|
-
export type DropdownProps<O extends DropdownOption = DropdownOption> = CommonProps<'aria-label' | 'disabled' | 'id' | '
|
|
11
|
+
export type DropdownProps<O extends DropdownOption = DropdownOption> = CommonProps<'aria-label' | 'disabled' | 'id' | 'name' | 'readOnly' | 'size'> & InvalidPropsLibrary & Pick<MenuProps<O>, 'isMulti' | 'itemCount' | 'onChange' | 'renderListItem'> & {
|
|
12
12
|
/**
|
|
13
13
|
* Array of options to display in the dropdown
|
|
14
14
|
*
|
|
@@ -42,7 +42,7 @@ export type DropdownProps<O extends DropdownOption = DropdownOption> = CommonPro
|
|
|
42
42
|
*
|
|
43
43
|
* @name Dropdown
|
|
44
44
|
*/
|
|
45
|
-
declare function Dropdown<O extends DropdownOption = DropdownOption>({ options, value: selected, onChange, 'aria-label': ariaLabel, placeholder, size, itemCount, disabled, id: propId, invalid, readOnly, placement, name, isMulti, renderListItem, style: styleProp, }: DropdownProps<O>): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
declare function Dropdown<O extends DropdownOption = DropdownOption>({ options, value: selected, onChange, 'aria-label': ariaLabel, placeholder, size, itemCount, disabled, id: propId, invalid, errorMessage, readOnly, placement, name, isMulti, renderListItem, style: styleProp, }: DropdownProps<O>): import("react/jsx-runtime").JSX.Element;
|
|
46
46
|
declare namespace Dropdown {
|
|
47
47
|
var bspkName: string;
|
|
48
48
|
}
|
package/dist/Dropdown.js
CHANGED
|
@@ -12,7 +12,7 @@ import { useId } from './hooks/useId';
|
|
|
12
12
|
*
|
|
13
13
|
* @name Dropdown
|
|
14
14
|
*/
|
|
15
|
-
function Dropdown({ options = [], value: selected, onChange, 'aria-label': ariaLabel, placeholder = 'Select...', size = 'medium', itemCount = 5, disabled, id: propId, invalid, readOnly, placement = 'bottom', name, isMulti, renderListItem, style: styleProp, }) {
|
|
15
|
+
function Dropdown({ options = [], value: selected, onChange, 'aria-label': ariaLabel, placeholder = 'Select...', size = 'medium', itemCount = 5, disabled, id: propId, invalid, errorMessage, readOnly, placement = 'bottom', name, isMulti, renderListItem, style: styleProp, }) {
|
|
16
16
|
const id = useId(propId);
|
|
17
17
|
const { triggerProps, menuProps, closeMenu } = useFloatingMenu({
|
|
18
18
|
placement,
|
|
@@ -20,6 +20,7 @@ function Dropdown({ options = [], value: selected, onChange, 'aria-label': ariaL
|
|
|
20
20
|
disabled,
|
|
21
21
|
invalid,
|
|
22
22
|
readOnly,
|
|
23
|
+
errorMessage,
|
|
23
24
|
},
|
|
24
25
|
});
|
|
25
26
|
const dropdownLabel = isMulti
|
package/dist/Dropdown.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../src/Dropdown.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,IAAI,EAAa,MAAM,QAAQ,CAAC;A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@
|
|
|
1
1
|
import './form-field.scss';
|
|
2
|
-
import { CommonProps } from './';
|
|
2
|
+
import { CommonProps, InvalidPropsLibrary } from './';
|
|
3
3
|
export type FieldControlProps = {
|
|
4
4
|
/**
|
|
5
5
|
* Marks the element as invalid and displays error message.
|
|
@@ -12,7 +12,7 @@ export type FieldControlProps = {
|
|
|
12
12
|
/** The id of the error message */
|
|
13
13
|
'aria-errormessage'?: string;
|
|
14
14
|
};
|
|
15
|
-
export type FormFieldProps = CommonProps<'
|
|
15
|
+
export type FormFieldProps = CommonProps<'required'> & InvalidPropsLibrary & {
|
|
16
16
|
/**
|
|
17
17
|
* The label of the field.
|
|
18
18
|
*
|
|
@@ -22,7 +22,8 @@ export type FormFieldProps = CommonProps<'errorMessage' | 'required'> & {
|
|
|
22
22
|
/** The id of the control. */
|
|
23
23
|
controlId: string;
|
|
24
24
|
/**
|
|
25
|
-
* The children of the form field. This should be a control such as TextInput, Dropdown, DatePicker, or
|
|
25
|
+
* The children of the form field. This should be a control such as TextInput, Dropdown, DatePicker, or
|
|
26
|
+
* TimePicker.
|
|
26
27
|
*
|
|
27
28
|
* @type (childProps: FieldControlProps) => JSX.Element
|
|
28
29
|
* @required
|
|
@@ -40,7 +41,7 @@ export type FormFieldProps = CommonProps<'errorMessage' | 'required'> & {
|
|
|
40
41
|
*
|
|
41
42
|
* @name FormField
|
|
42
43
|
*/
|
|
43
|
-
declare function FormField({ label, errorMessage, helperText, children, labelTrailing, controlId, required }: FormFieldProps): import("react/jsx-runtime").JSX.Element | null;
|
|
44
|
+
declare function FormField({ label, invalid, errorMessage, helperText, children, labelTrailing, controlId, required, }: FormFieldProps): import("react/jsx-runtime").JSX.Element | null;
|
|
44
45
|
declare namespace FormField {
|
|
45
46
|
var bspkName: string;
|
|
46
47
|
}
|
package/dist/FormField.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { styleAdd } from './utils/styleAdd';
|
|
3
|
-
styleAdd(`[data-bspk=form-field]{box-sizing:border-box;width:100%;display:flex;flex-direction:column;gap:var(--spacing-sizing-01)}[data-bspk=form-field] header label{flex-grow:1}`);;
|
|
3
|
+
styleAdd(`[data-bspk=form-field]{box-sizing:border-box;max-width:100%;width:fit-content;display:flex;flex-direction:column;gap:var(--spacing-sizing-01)}[data-bspk=form-field] header label{flex-grow:1}`);;
|
|
4
4
|
import { InlineAlert } from './InlineAlert';
|
|
5
5
|
import { Layout } from './Layout';
|
|
6
6
|
import { Txt } from './Txt';
|
|
@@ -11,12 +11,12 @@ import { Txt } from './Txt';
|
|
|
11
11
|
*
|
|
12
12
|
* @name FormField
|
|
13
13
|
*/
|
|
14
|
-
function FormField({ label, errorMessage, helperText, children, labelTrailing, controlId, required }) {
|
|
14
|
+
function FormField({ label, invalid, errorMessage, helperText, children, labelTrailing, controlId, required, }) {
|
|
15
15
|
const errorMessageId = errorMessage && `${controlId}-error-message`;
|
|
16
16
|
const helperTextId = helperText && `${controlId}-helper-text`;
|
|
17
17
|
if (typeof children !== 'function')
|
|
18
18
|
return null;
|
|
19
|
-
return (_jsxs("div", { "data-bspk": "form-field", children: [_jsxs(Layout, { as: "header", children: [_jsxs("label", { htmlFor: controlId, children: [_jsx(Txt, { as: "span", variant: "labels-small", children: label }), required && (_jsx(Txt, { as: "span", variant: "body-small", children: ' (Required)' }))] }), labelTrailing] }), children({
|
|
19
|
+
return (_jsxs("div", { "data-bspk": "form-field", "data-invalid": invalid || undefined, children: [_jsxs(Layout, { as: "header", children: [_jsxs("label", { htmlFor: controlId, children: [_jsx(Txt, { as: "span", variant: "labels-small", children: label }), required && (_jsx(Txt, { as: "span", variant: "body-small", children: ' (Required)' }))] }), labelTrailing] }), children({
|
|
20
20
|
invalid: !!errorMessage,
|
|
21
21
|
'aria-describedby': helperTextId,
|
|
22
22
|
'aria-errormessage': errorMessageId,
|
package/dist/FormField.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormField.js","sourceRoot":"","sources":["../src/FormField.tsx"],"names":[],"mappings":";AAAA,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FormField.js","sourceRoot":"","sources":["../src/FormField.tsx"],"names":[],"mappings":";AAAA,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAyC5B;;;;;;GAMG;AACH,SAAS,SAAS,CAAC,EACf,KAAK,EACL,OAAO,EACP,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,aAAa,EACb,SAAS,EACT,QAAQ,GACK;IACb,MAAM,cAAc,GAAG,YAAY,IAAI,GAAG,SAAS,gBAAgB,CAAC;IACpE,MAAM,YAAY,GAAG,UAAU,IAAI,GAAG,SAAS,cAAc,CAAC;IAE9D,IAAI,OAAO,QAAQ,KAAK,UAAU;QAAE,OAAO,IAAI,CAAC;IAEhD,OAAO,CACH,4BAAe,YAAY,kBAAe,OAAO,IAAI,SAAS,aAC1D,MAAC,MAAM,IAAC,EAAE,EAAC,QAAQ,aACf,iBAAO,OAAO,EAAE,SAAS,aACrB,KAAC,GAAG,IAAC,EAAE,EAAC,MAAM,EAAC,OAAO,EAAC,cAAc,YAChC,KAAK,GACJ,EACL,QAAQ,IAAI,CACT,KAAC,GAAG,IAAC,EAAE,EAAC,MAAM,EAAC,OAAO,EAAC,YAAY,YAC9B,aAAa,GACZ,CACT,IACG,EACP,aAAa,IACT,EACR,QAAQ,CAAC;gBACN,OAAO,EAAE,CAAC,CAAC,YAAY;gBACvB,kBAAkB,EAAE,YAAY;gBAChC,mBAAmB,EAAE,cAAc;aACtC,CAAC,EACD,YAAY,IAAI,CACb,KAAC,WAAW,IAAC,EAAE,EAAE,cAAc,EAAE,OAAO,EAAC,OAAO,YAC3C,YAAY,GACH,CACjB,EACA,UAAU,IAAI,CACX,KAAC,GAAG,IAAC,EAAE,EAAE,YAAY,EAAE,OAAO,EAAC,YAAY,YACtC,UAAU,GACT,CACT,IACC,CACT,CAAC;AACN,CAAC;AAED,SAAS,CAAC,QAAQ,GAAG,WAAW,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
package/dist/InlineAlert.js
CHANGED
|
@@ -3,7 +3,7 @@ import { SvgCheckCircleFill } from '@bspk/icons/CheckCircleFill';
|
|
|
3
3
|
import { SvgErrorFill } from '@bspk/icons/ErrorFill';
|
|
4
4
|
import { SvgInfoFill } from '@bspk/icons/InfoFill';
|
|
5
5
|
import { styleAdd } from './utils/styleAdd';
|
|
6
|
-
styleAdd(`[data-bspk=inline-alert]{display:flex;align-items:start;justify-content:
|
|
6
|
+
styleAdd(`[data-bspk=inline-alert]{display:flex;align-items:start;justify-content:start;flex-direction:row;gap:var(--spacing-sizing-02)}[data-bspk=inline-alert] [data-txt]{flex:1}[data-bspk=inline-alert][data-variant=error]{color:var(--status-error);--first-tone: var(--status-error);--second-tone: var(--status-on-information)}[data-bspk=inline-alert][data-variant=success]{color:var(--status-success);--first-tone: var(--status-success);--second-tone: var(--status-on-success)}[data-bspk=inline-alert][data-variant=warning]{color:var(--foreground-neutral-on-surface);--first-tone: var(--status-warning);--second-tone: var(--status-on-warning)}[data-bspk=inline-alert][data-variant=informational]{color:var(--status-information);--first-tone: var(--status-information);--second-tone: var(--status-on-information)}[data-bspk=inline-alert] svg{color:var(--first-tone);width:var(--spacing-sizing-05);height:var(--spacing-sizing-05)}[data-bspk=inline-alert] svg [data-second-tone]{fill:var(--second-tone)}`);;
|
|
7
7
|
import { Txt } from './Txt';
|
|
8
8
|
/**
|
|
9
9
|
* Inline alerts provide contextual feedback messages for typical user actions with a handful of available and flexible
|
package/dist/Link.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import './link.scss';
|
|
2
2
|
import { AnchorHTMLAttributes } from 'react';
|
|
3
|
-
|
|
3
|
+
import { CommonPropsLibrary } from '.';
|
|
4
|
+
export type LinkProps = Pick<AnchorHTMLAttributes<unknown>, 'target'> & Pick<CommonPropsLibrary, 'disabled'> & {
|
|
4
5
|
/**
|
|
5
6
|
* The label of the link.
|
|
6
7
|
*
|
package/dist/Link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.js","sourceRoot":"","sources":["../src/Link.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Link.js","sourceRoot":"","sources":["../src/Link.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,aAAa,CAAC;AAgCrB;;;;GAIG;AACH,SAAS,IAAI,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK,EAAa;IACrE,OAAO,CACH,gBACQ,KAAK,eACC,MAAM,eACL,IAAI,iBACF,OAAO,KAAK,QAAQ,IAAI,SAAS,yBACzB,OAAO,KAAK,gBAAgB,IAAI,SAAS,EAC9D,GAAG,EAAC,YAAY,EAChB,MAAM,EAAE,YAAY,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,aAE7D,yBAAO,KAAK,GAAQ,EACnB,YAAY,KAAK,UAAU,IAAI,KAAC,YAAY,KAAG,EAC/C,YAAY,KAAK,SAAS,IAAI,KAAC,eAAe,KAAG,EACjD,YAAY,KAAK,MAAM,IAAI,KAAC,OAAO,KAAG,IACvC,CACP,CAAC;AACN,CAAC;AAED,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC;AAEvB,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
package/dist/ListItem.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ export type ListItemProps<As extends ElementType = 'div'> = CommonProps<'active'
|
|
|
54
54
|
*
|
|
55
55
|
* @name ListItem
|
|
56
56
|
*/
|
|
57
|
-
declare function ListItem<As extends ElementType = 'div'>({ as, disabled, invalid, leading: leadingProp, trailing: trailingProp, label, subText, active, readOnly, ...props }: ElementProps<ListItemProps<As>, As>): import("react/jsx-runtime").JSX.Element | undefined;
|
|
57
|
+
declare function ListItem<As extends ElementType = 'div'>({ as, disabled, invalid, leading: leadingProp, trailing: trailingProp, label, subText, active, readOnly, errorMessage, ...props }: ElementProps<ListItemProps<As>, As>): import("react/jsx-runtime").JSX.Element | undefined;
|
|
58
58
|
declare namespace ListItem {
|
|
59
59
|
var bspkName: string;
|
|
60
60
|
var Button: typeof ListItemButton;
|
package/dist/ListItem.js
CHANGED
|
@@ -32,7 +32,7 @@ export const TRAILING_COMPONENTS = Object.freeze([
|
|
|
32
32
|
*
|
|
33
33
|
* @name ListItem
|
|
34
34
|
*/
|
|
35
|
-
function ListItem({ as, disabled, invalid, leading: leadingProp, trailing: trailingProp, label, subText, active, readOnly, ...props }) {
|
|
35
|
+
function ListItem({ as, disabled, invalid, leading: leadingProp, trailing: trailingProp, label, subText, active, readOnly, errorMessage, ...props }) {
|
|
36
36
|
let As = as || 'div';
|
|
37
37
|
const { logError } = useErrorLogger();
|
|
38
38
|
const { leading, trailing } = useChildren(leadingProp, trailingProp);
|
|
@@ -57,7 +57,7 @@ function ListItem({ as, disabled, invalid, leading: leadingProp, trailing: trail
|
|
|
57
57
|
if (!As && 'onClick' in props)
|
|
58
58
|
As = 'button';
|
|
59
59
|
const actionable = ('onClick' in props || 'href' in props) && !disabled && !readOnly;
|
|
60
|
-
return (_jsx(As, { ...props, "aria-disabled": disabled || undefined, "aria-invalid": invalid || undefined, "data-action": actionable || undefined, "data-active": active || undefined, "data-bspk": "list-item", "data-component": leading?.name || undefined, "data-readonly": readOnly || undefined, role: as !== 'button' && 'onClick' in props ? 'button' : undefined, children: _jsxs("span", { "data-inner": true, children: [leading && (_jsx("span", { "data-component": leading.name, "data-leading": true, children: leading.child })), _jsxs("span", { "data-item-label": true, children: [_jsx("span", { "data-text": true, children: label }), subText && _jsx("span", { "data-sub-text": true, children: subText })] }), trailing && (_jsx("span", { "data-component": trailing.name, "data-trailing": true, children: trailing.child }))] }) }));
|
|
60
|
+
return (_jsx(As, { ...props, "aria-disabled": disabled || undefined, "aria-errormessage": errorMessage || undefined, "aria-invalid": invalid || undefined, "data-action": actionable || undefined, "data-active": active || undefined, "data-bspk": "list-item", "data-component": leading?.name || undefined, "data-readonly": readOnly || undefined, role: as !== 'button' && 'onClick' in props ? 'button' : undefined, children: _jsxs("span", { "data-inner": true, children: [leading && (_jsx("span", { "data-component": leading.name, "data-leading": true, children: leading.child })), _jsxs("span", { "data-item-label": true, children: [_jsx("span", { "data-text": true, children: label }), subText && _jsx("span", { "data-sub-text": true, children: subText })] }), trailing && (_jsx("span", { "data-component": trailing.name, "data-trailing": true, children: trailing.child }))] }) }));
|
|
61
61
|
}
|
|
62
62
|
ListItem.bspkName = 'ListItem';
|
|
63
63
|
/** A button that can be used as a trailing element in a ListItem. */
|
package/dist/ListItem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.js","sourceRoot":"","sources":["../src/ListItem.tsx"],"names":[],"mappings":";AAAA,OAAO,kBAAkB,CAAC;AAG1B,OAAO,EAAe,MAAM,EAAE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MAAM,EAAE,QAAQ,EAAE,GAAG,cAAc,EAAE,CAAC;IAEtC,IAAI,OAAO,GAAwB,mBAAmB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IAE/E,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,YAAY,CAAC,CAAC;IAE3D,IAAI,QAAQ,GAAwB,gBAAgB,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IAEhE,IAAI,OAAO,EAAE,CAAC;QACV,MAAM,KAAK,GAAG,kBAAkB,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACxD,IAAI,CAAC,KAAK;YAAE,OAAO,GAAG,IAAI,CAAC;QAC3B,QAAQ,CACJ,CAAC,KAAK,EACN,uDAAuD,kBAAkB,cAAc,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,CACnH,CAAC;IACN,CAAC;IAED,IAAI,QAAQ,EAAE,CAAC;QACX,MAAM,KAAK,GAAG,mBAAmB,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC1D,IAAI,CAAC,KAAK;YAAE,QAAQ,GAAG,IAAI,CAAC;QAC5B,QAAQ,CACJ,CAAC,KAAK,EACN,wDAAwD,mBAAmB,cAAc,QAAQ,EAAE,IAAI,IAAI,MAAM,EAAE,CACtH,CAAC;IACN,CAAC;IAED,OAAO;QACH,OAAO;QACP,QAAQ;KACX,CAAC;AACN,CAAC"}
|
package/dist/NumberField.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FormFieldProps } from './FormField';
|
|
2
2
|
import { NumberInputProps } from './NumberInput';
|
|
3
|
-
|
|
3
|
+
import { InvalidPropsLibrary } from '.';
|
|
4
|
+
export type NumberFieldProps = InvalidPropsLibrary & Pick<FormFieldProps, 'controlId' | 'errorMessage' | 'helperText' | 'label' | 'labelTrailing' | 'required'> & Pick<NumberInputProps, 'align' | 'disabled' | 'id' | 'name' | 'onChange' | 'readOnly' | 'size' | 'value'>;
|
|
4
5
|
/**
|
|
5
6
|
* A input element that allows users to either input a numerical value or singularly increase or decrease the values by
|
|
6
7
|
* pressing the (+) or (-).
|
package/dist/NumberInput.d.ts
CHANGED
|
@@ -1,32 +1,42 @@
|
|
|
1
1
|
import './number-input.scss';
|
|
2
|
-
import { CommonProps } from '.';
|
|
3
|
-
export type NumberInputProps = CommonProps<'aria-label' | 'disabled' | 'id' | '
|
|
2
|
+
import { CommonProps, InvalidPropsLibrary } from '.';
|
|
3
|
+
export type NumberInputProps = CommonProps<'aria-label' | 'disabled' | 'id' | 'name' | 'readOnly' | 'size'> & InvalidPropsLibrary & {
|
|
4
|
+
/** The value of the control. */
|
|
5
|
+
value?: number;
|
|
6
|
+
/** Callback when the value changes. */
|
|
7
|
+
onChange: (value: number | undefined) => void;
|
|
4
8
|
/**
|
|
5
|
-
* The
|
|
9
|
+
* The alignment of the input box. Centered between the plus and minus buttons or to the left of the buttons.
|
|
6
10
|
*
|
|
7
|
-
* @
|
|
11
|
+
* @default center
|
|
8
12
|
*/
|
|
9
|
-
|
|
10
|
-
/** Callback when the value changes. */
|
|
11
|
-
onChange: (value: number) => void;
|
|
13
|
+
align?: 'center' | 'left';
|
|
12
14
|
/**
|
|
13
|
-
*
|
|
15
|
+
* Defines the [maximum](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/max) value that is
|
|
16
|
+
* accepted.
|
|
14
17
|
*
|
|
15
|
-
* @default
|
|
18
|
+
* @default 99
|
|
19
|
+
* @maximum 99
|
|
20
|
+
* @minimum 1
|
|
16
21
|
*/
|
|
17
|
-
centered?: boolean;
|
|
18
|
-
/** Defines the [maximum](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/max) value that is accepted. */
|
|
19
22
|
max?: number;
|
|
20
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Defines the [minimum](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/min) value that is
|
|
25
|
+
* accepted.
|
|
26
|
+
*
|
|
27
|
+
* @minimum 0
|
|
28
|
+
*/
|
|
21
29
|
min?: number;
|
|
22
30
|
};
|
|
23
31
|
/**
|
|
24
32
|
* A input element that allows users to either input a numerical value or singularly increase or decrease the values by
|
|
25
33
|
* pressing the (+) or (-).
|
|
26
34
|
*
|
|
35
|
+
* The value of the input is a number. The value is clamped to the min and max values if they are provided.
|
|
36
|
+
*
|
|
27
37
|
* @name NumberInput
|
|
28
38
|
*/
|
|
29
|
-
declare function NumberInput({ value, onChange,
|
|
39
|
+
declare function NumberInput({ value, onChange, align, size, disabled, readOnly, name, id: inputIdProp, invalid, 'aria-label': ariaLabel, max: maxProp, min: minProp, }: NumberInputProps): import("react/jsx-runtime").JSX.Element;
|
|
30
40
|
declare namespace NumberInput {
|
|
31
41
|
var bspkName: string;
|
|
32
42
|
}
|
package/dist/NumberInput.js
CHANGED
|
@@ -2,9 +2,15 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { SvgAdd } from '@bspk/icons/Add';
|
|
3
3
|
import { SvgRemove } from '@bspk/icons/Remove';
|
|
4
4
|
import { styleAdd } from './utils/styleAdd';
|
|
5
|
-
styleAdd(`[data-bspk=number-input]{--font: var(--body-base);--height: var(--spacing-sizing-10);--svg-width: var(--spacing-sizing-05);--color: var(--foreground-neutral-on-surface);width:100%;display:flex;flex-flow:row nowrap;font:var(--font);height:var(--height);border:1px solid var(--stroke-neutral-base);border-radius:var(--radius-small);background:var(--surface-neutral-t1-base)}[data-bspk=number-input]:focus-within{border-color:var(--stroke-brand-primary)
|
|
5
|
+
styleAdd(`[data-bspk=number-input]{--font: var(--body-base);--height: var(--spacing-sizing-10);--svg-width: var(--spacing-sizing-05);--color: var(--foreground-neutral-on-surface);width:100%;display:flex;flex-flow:row nowrap;font:var(--font);height:var(--height);border:1px solid var(--stroke-neutral-base);border-radius:var(--radius-small);background:var(--surface-neutral-t1-base);max-width:280px}[data-bspk=number-input]:focus-within{border-color:var(--stroke-brand-primary)}[data-bspk=number-input] [data-divider]{width:4px;border-right:1px solid var(--stroke-neutral-base);height:calc(var(--height) - 8px);margin:3px 0}[data-bspk=number-input] button{width:var(--height);height:var(--height);background:none;border:none;cursor:pointer;font:var(--font);flex-shrink:0;display:flex;justify-content:center;align-items:center;color:var(--color)}[data-bspk=number-input] button svg{width:var(--svg-width)}[data-bspk=number-input] button:disabled{cursor:not-allowed;color:var(--foreground-neutral-disabled-on-surface)}[data-bspk=number-input] input{color:var(--color);min-width:0;display:block;font:var(--font);text-align:center;padding:0 var(--spacing-sizing-03);background:rgba(0,0,0,0);border:none;flex-grow:1}[data-bspk=number-input] input:focus{outline:none}[data-bspk=number-input] input::-webkit-outer-spin-button,[data-bspk=number-input] input::-webkit-inner-spin-button{appearance:none;margin:0}[data-bspk=number-input] input[type=number]{appearance:textfield}[data-bspk=number-input]:not([data-disabled],[data-readonly]) input:hover,[data-bspk=number-input]:not([data-disabled],[data-readonly]) button:not(:disabled):hover{background-color:var(--interactions-hover-opacity)}[data-bspk=number-input]:not([data-disabled],[data-readonly]) input:active,[data-bspk=number-input]:not([data-disabled],[data-readonly]) button:not(:disabled):active{background-color:var(--interactions-press-opacity)}[data-bspk=number-input]:not([data-disabled],[data-readonly])[data-invalid]{border-color:var(--status-error);outline-color:var(--status-error)}[data-bspk=number-input][data-disabled],[data-bspk=number-input][data-readonly]{--color: var(--foreground-neutral-disabled-on-surface);border-color:var(--stroke-neutral-disabled-light);background:linear-gradient(var(--interactions-disabled-opacity), var(--interactions-disabled-opacity)),linear-gradient(var(--surface-neutral-t1-base), var(--surface-neutral-t1-base))}[data-bspk=number-input][data-disabled] [data-divider],[data-bspk=number-input][data-readonly] [data-divider]{border-color:var(--stroke-neutral-disabled-light)}[data-bspk=number-input][data-readonly] input{color:var(--foreground-neutral-on-surface) !important}[data-bspk=number-input][data-size=small]{--font: var(--body-small);--height: var(--spacing-sizing-08)}[data-bspk=number-input][data-size=large]{--font: var(--body-large);--height: var(--spacing-sizing-12);--svg-width: var(--spacing-sizing-06)}`);;
|
|
6
6
|
import { useId } from './hooks/useId';
|
|
7
7
|
import { useLongPress } from './hooks/useLongPress';
|
|
8
|
+
const DEFAULT = {
|
|
9
|
+
align: 'center',
|
|
10
|
+
size: 'medium',
|
|
11
|
+
disabled: false,
|
|
12
|
+
readOnly: false,
|
|
13
|
+
};
|
|
8
14
|
function isNumber(value) {
|
|
9
15
|
if (typeof value === 'number')
|
|
10
16
|
return value;
|
|
@@ -17,15 +23,20 @@ function isNumber(value) {
|
|
|
17
23
|
* A input element that allows users to either input a numerical value or singularly increase or decrease the values by
|
|
18
24
|
* pressing the (+) or (-).
|
|
19
25
|
*
|
|
26
|
+
* The value of the input is a number. The value is clamped to the min and max values if they are provided.
|
|
27
|
+
*
|
|
20
28
|
* @name NumberInput
|
|
21
29
|
*/
|
|
22
|
-
function NumberInput({
|
|
23
|
-
|
|
24
|
-
value = 1, onChange, centered = false, size = 'medium', disabled = false, readOnly = false, name, id: inputIdProp, invalid, 'aria-label': ariaLabel, max: maxProp, min: minProp, }) {
|
|
30
|
+
function NumberInput({ value, onChange, align = DEFAULT.align, size = DEFAULT.size, disabled = DEFAULT.disabled, readOnly = DEFAULT.readOnly, name, id: inputIdProp, invalid, 'aria-label': ariaLabel, max: maxProp, min: minProp, }) {
|
|
31
|
+
const centered = align !== 'left';
|
|
25
32
|
const inputId = useId(inputIdProp);
|
|
26
33
|
const max = isNumber(maxProp);
|
|
27
34
|
const min = isNumber(minProp);
|
|
28
35
|
const fix = (next = value) => {
|
|
36
|
+
if (typeof next !== 'number') {
|
|
37
|
+
onChange(undefined);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
29
40
|
let fixValue = next;
|
|
30
41
|
if (typeof min !== 'undefined' && next < min)
|
|
31
42
|
fixValue = min;
|
package/dist/NumberInput.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.js","sourceRoot":"","sources":["../src/NumberInput.tsx"],"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GAAG,KAAK,WAAW,IAAI,SAAS,GAAG,SAAS,GAAG,GAAG,CAAC,CAAC;IAEhE,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,QAAQ,CAAC,SAAS,GAAG,SAAS,GAAG,YAAY,CAAC,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;IAEnH,OAAO,CACH,+BACgB,GAAG,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,QAAQ,oBACpC,SAAS,EACzB,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAC,QAAQ,KACT,SAAS,CAAC,WAAW,YAExB,GAAG,CAAC,CAAC,CAAC,KAAC,MAAM,KAAG,CAAC,CAAC,CAAC,KAAC,SAAS,KAAG,GAC5B,CACZ,CAAC;AACN,CAAC;AAED,WAAW,CAAC,QAAQ,GAAG,aAAa,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/Radio.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './radio.scss';
|
|
2
|
-
import { ToggleControlProps, ElementProps } from './';
|
|
3
|
-
export type RadioProps = Pick<ToggleControlProps<HTMLInputElement>, 'aria-label' | 'checked' | 'disabled' | '
|
|
2
|
+
import { ToggleControlProps, ElementProps, InvalidPropsLibrary } from './';
|
|
3
|
+
export type RadioProps = InvalidPropsLibrary & Pick<ToggleControlProps<HTMLInputElement>, 'aria-label' | 'checked' | 'disabled' | 'name' | 'onChange' | 'value'>;
|
|
4
4
|
/**
|
|
5
5
|
* A round control that allows user to choose one option from a set. This is the base element and if used directly you
|
|
6
6
|
* must wrap it with a label. This will more often be used in the RadioOption or RadioGroup component.
|
package/dist/Radio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","sourceRoot":"","sources":["../src/Radio.tsx"],"names":[],"mappings":";AAAA,OAAO,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Radio.js","sourceRoot":"","sources":["../src/Radio.tsx"],"names":[],"mappings":";AAAA,OAAO,cAAc,CAAC;AAMtB;;;;;;;GAOG;AACH,SAAS,KAAK,CAAC,KAAwC;IACnD,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IAE9E,OAAO,CACH,6BAAgB,OAAO,aACnB,mBACQ,UAAU,EACd,OAAO,EAAE,CAAC,CAAC,OAAO,kBACJ,OAAO,IAAI,SAAS,EAClC,QAAQ,EAAE,QAAQ,IAAI,SAAS,EAC/B,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,EAC5D,IAAI,EAAC,OAAO,GACd,EACF,qCAAoB,IACjB,CACV,CAAC;AACN,CAAC;AAED,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC;AAEzB,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
package/dist/RadioOption.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RadioProps } from './Radio';
|
|
2
2
|
import { ToggleOptionProps } from './ToggleOption';
|
|
3
|
-
|
|
3
|
+
import { InvalidPropsLibrary } from '.';
|
|
4
|
+
export type RadioOptionProps = InvalidPropsLibrary & Pick<RadioProps, 'checked' | 'disabled' | 'name' | 'onChange' | 'value'> & Pick<ToggleOptionProps, 'description' | 'label'>;
|
|
4
5
|
/**
|
|
5
6
|
* A control that allows users to choose one or more items from a list or turn an feature on or off.
|
|
6
7
|
*
|
package/dist/RadioOption.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioOption.js","sourceRoot":"","sources":["../src/RadioOption.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAc,KAAK,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAqB,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"RadioOption.js","sourceRoot":"","sources":["../src/RadioOption.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAc,KAAK,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAqB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQjE;;;;GAIG;AACH,SAAS,WAAW,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,aAAa,EAAoB;IAC3E,OAAO,CACH,KAAC,YAAY,iBAAW,cAAc,EAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,YACzE,KAAC,KAAK,OAAK,aAAa,gBAAc,KAAK,GAAI,GACpC,CAClB,CAAC;AACN,CAAC;AAED,WAAW,CAAC,QAAQ,GAAG,aAAa,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './segmented-control.scss';
|
|
2
2
|
import { ElementProps } from './';
|
|
3
|
-
export type
|
|
3
|
+
export type SegmentedControlOption = {
|
|
4
4
|
/**
|
|
5
5
|
* The label of the option. This is the text that will be displayed on the option.
|
|
6
6
|
*
|
|
@@ -23,18 +23,22 @@ export type SegmentedControlProps = {
|
|
|
23
23
|
/**
|
|
24
24
|
* The options to display. Each option has a label and an optional leading icon.
|
|
25
25
|
*
|
|
26
|
-
* @type
|
|
26
|
+
* @type SegmentedControlOption[]
|
|
27
27
|
* @required
|
|
28
28
|
*/
|
|
29
|
-
options:
|
|
30
|
-
/**
|
|
31
|
-
|
|
29
|
+
options: SegmentedControlOption[];
|
|
30
|
+
/**
|
|
31
|
+
* The id of the selected option.
|
|
32
|
+
*
|
|
33
|
+
* @required
|
|
34
|
+
*/
|
|
35
|
+
value: SegmentedControlOption['value'];
|
|
32
36
|
/**
|
|
33
37
|
* The function to call when the option is clicked.
|
|
34
38
|
*
|
|
35
39
|
* @required
|
|
36
40
|
*/
|
|
37
|
-
onChange: (value:
|
|
41
|
+
onChange: (value: SegmentedControlOption['value']) => void;
|
|
38
42
|
/**
|
|
39
43
|
* The size of the options.
|
|
40
44
|
*
|
|
@@ -61,7 +65,7 @@ export type SegmentedControlProps = {
|
|
|
61
65
|
*
|
|
62
66
|
* @name SegmentedControl
|
|
63
67
|
*/
|
|
64
|
-
declare function SegmentedControl({ onChange, value, size, options, width, showLabels: showLabelsProp, ...containerProps }: ElementProps<SegmentedControlProps, 'div'>): import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
declare function SegmentedControl({ onChange, value, size, options: optionsProp, width, showLabels: showLabelsProp, ...containerProps }: ElementProps<SegmentedControlProps, 'div'>): import("react/jsx-runtime").JSX.Element;
|
|
65
69
|
declare namespace SegmentedControl {
|
|
66
70
|
var bspkName: string;
|
|
67
71
|
}
|
package/dist/SegmentedControl.js
CHANGED
|
@@ -3,18 +3,19 @@ import { styleAdd } from './utils/styleAdd';
|
|
|
3
3
|
styleAdd(`[data-bspk=segmented-control]{display:flex;flex-direction:row;max-width:100%;--outer-height: var(--spacing-sizing-10);--inner-height: var(--spacing-sizing-08);--svg-width: 20px}[data-bspk=segmented-control][data-width=fill]{align-items:stretch;width:100%;--btn-flex-grow: 1;margin:0 var(--spacing-sizing-04)}[data-bspk=segmented-control][data-width=hug]{width:fit-content;--btn-flex-grow: 0}[data-bspk=segmented-control][data-size=small]{--outer-height: var(--spacing-sizing-08);--inner-height: var(--spacing-sizing-06);--svg-width: 16px}[data-bspk=segmented-control] svg{width:var(--svg-width) !important}[data-bspk=segmented-control] button{border:0;cursor:pointer;color:var(--foreground-neutral-on-surface);flex-grow:var(--btn-flex-grow);font:var(--labels-small);margin:0;height:var(--spacing-sizing-12);background:rgba(0,0,0,0);position:relative}[data-bspk=segmented-control] button [data-focus-ring]{display:none}[data-bspk=segmented-control] button [data-outer]{height:var(--outer-height);background:var(--surface-neutral-t3-low);margin:var(--spacing-sizing-01) 0;padding:var(--spacing-sizing-01) 0;display:block}[data-bspk=segmented-control] button [data-inner]{display:flex;flex-direction:row;align-items:center;height:var(--inner-height);border-bottom:1px solid rgba(0,0,0,0);justify-content:center;gap:var(--spacing-sizing-01);border-radius:var(--radius-small);padding:var(--spacing-sizing-02) var(--spacing-sizing-03)}[data-bspk=segmented-control] button:first-of-type [data-outer]{border-top-left-radius:var(--radius-medium);border-bottom-left-radius:var(--radius-medium);padding-left:var(--spacing-sizing-01)}[data-bspk=segmented-control] button:last-of-type [data-outer]{border-top-right-radius:var(--radius-medium);border-bottom-right-radius:var(--radius-medium);padding-right:var(--spacing-sizing-01)}[data-bspk=segmented-control] button:not(:disabled):hover [data-inner]{background:var(--interactions-neutral-hover-opacity)}[data-bspk=segmented-control] button:not(:disabled):active [data-inner]{background:var(--interactions-neutral-press-opacity)}[data-bspk=segmented-control] button:not(:disabled)[data-selected] [data-inner]{background:var(--surface-neutral-t1-base)}[data-bspk=segmented-control] button:not(:disabled):focus-visible{z-index:2;outline:solid 2px var(--stroke-neutral-focus)}[data-bspk=segmented-control] button:disabled{pointer-events:none;color:var(--foreground-neutral-disabled-on-surface);cursor:not-allowed}`);;
|
|
4
4
|
import { Fragment } from 'react';
|
|
5
5
|
import { Tooltip } from './Tooltip';
|
|
6
|
-
import {
|
|
6
|
+
import { useOptionIconsInvalid } from './hooks/useOptionIconsInvalid';
|
|
7
7
|
/**
|
|
8
8
|
* Navigation tool that organizes content across different screens and views.
|
|
9
9
|
*
|
|
10
10
|
* @name SegmentedControl
|
|
11
11
|
*/
|
|
12
|
-
function SegmentedControl({ onChange, value, size = 'medium', options, width = 'hug', showLabels: showLabelsProp = true, ...containerProps }) {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
function SegmentedControl({ onChange, value, size = 'medium', options: optionsProp, width = 'hug', showLabels: showLabelsProp = true, ...containerProps }) {
|
|
13
|
+
const options = Array.isArray(optionsProp) ? optionsProp : [];
|
|
14
|
+
useOptionIconsInvalid(options);
|
|
15
|
+
const hideLabels = showLabelsProp === false && options.every((item) => item.icon && item.label);
|
|
16
|
+
return (_jsx("div", { ...containerProps, "data-bspk": "segmented-control", "data-size": size, "data-width": width, children: options.map((item, index) => {
|
|
16
17
|
const isActive = item.value === value;
|
|
17
|
-
return (_jsx(Fragment, { children: _jsx(Tooltip, { disabled: !hideLabels, label: item.label, placement: "top", children: _jsx("button", { "aria-label": item.label, "data-first": index === 0 || undefined, "data-last": index ===
|
|
18
|
+
return (_jsx(Fragment, { children: _jsx(Tooltip, { disabled: !hideLabels, label: item.label, placement: "top", children: _jsx("button", { "aria-label": item.label, "data-first": index === 0 || undefined, "data-last": index === options.length - 1 || undefined, "data-selected": isActive || undefined, disabled: item.disabled || undefined, onClick: () => onChange(item.value || item.label), children: _jsx("span", { "data-outer": true, children: _jsxs("span", { "data-inner": true, children: [(isActive && item.iconActive) || item.icon, !hideLabels && item.label] }) }) }) }) }, item.value));
|
|
18
19
|
}) }));
|
|
19
20
|
}
|
|
20
21
|
SegmentedControl.bspkName = 'SegmentedControl';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.js","sourceRoot":"","sources":["../src/SegmentedControl.tsx"],"names":[],"mappings":";AAAA,OAAO,0BAA0B,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SegmentedControl.js","sourceRoot":"","sources":["../src/SegmentedControl.tsx"],"names":[],"mappings":";AAAA,OAAO,0BAA0B,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAkEtE;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,EACtB,QAAQ,EACR,KAAK,EACL,IAAI,GAAG,QAAQ,EACf,OAA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,CACd,CAAC;QACN,CAAC,CAAC,GACA,CACT,CAAC;AACN,CAAC;AAED,gBAAgB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;AAE/C,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import '@bspk/styles/anywhere.css';
|
|
3
3
|
import { styleAdd } from './utils/styleAdd';
|
|
4
|
-
styleAdd(`[data-color=grey]{--foreground: var(--foreground-neutral-on-surface-variant-01);--background: var(--surface-neutral-t2-lowest)}[data-color=white]{--foreground: var(--foreground-neutral-on-surface-variant-01);--background: var(--surface-neutral-t1-base)}[data-color=primary]{--foreground: var(--foreground-brand-primary-depth);--background: var(--surface-brand-primary-highlight)}[data-color=secondary]{--foreground: var(--foreground-brand-secondary-depth);--background: var(--surface-brand-secondary-highlight)}[data-color=blue]{--foreground: var(--foreground-spectrum-blue);--background: var(--surface-spectrum-blue)}[data-color=green]{--foreground: var(--foreground-spectrum-green);--background: var(--surface-spectrum-green)}[data-color=lime]{--foreground: var(--foreground-spectrum-lime);--background: var(--surface-spectrum-lime)}[data-color=magenta]{--foreground: var(--foreground-spectrum-magenta);--background: var(--surface-spectrum-magenta)}[data-color=orange]{--foreground: var(--foreground-spectrum-orange);--background: var(--surface-spectrum-orange)}[data-color=pink]{--foreground: var(--foreground-spectrum-pink);--background: var(--surface-spectrum-pink)}[data-color=purple]{--foreground: var(--foreground-spectrum-purple);--background: var(--surface-spectrum-purple)}[data-color=red]{--foreground: var(--foreground-spectrum-red);--background: var(--surface-spectrum-red)}[data-color=teal]{--foreground: var(--foreground-spectrum-teal);--background: var(--surface-spectrum-teal)}[data-color=yellow]{--foreground: var(--foreground-spectrum-yellow);--background: var(--surface-spectrum-yellow)}:root{--z-index-tooltip-popover: 1100;--z-index-dialog: 1000;--z-index-dropdown: 900;--z-index-fab: 800;--z-index-navbar: 700;--z-index-footer: 600}*,*::before,*::after{box-sizing:border-box}*{margin:0;padding:0}@media(prefers-reduced-motion){[data-animated]{animation:none !important}}body,html{height:100%;scroll-behavior:smooth}body{font:var(--body-base);background-color:var(--background-base);color:var(--foreground-neutral-on-surface)}a{color:var(--foreground-link-text-default)}a:hover{color:var(--foreground-link-text-default-hovered)}a:visited{color:var(--foreground-link-text-default-visited)}a
|
|
4
|
+
styleAdd(`[data-color=grey]{--foreground: var(--foreground-neutral-on-surface-variant-01);--background: var(--surface-neutral-t2-lowest)}[data-color=white]{--foreground: var(--foreground-neutral-on-surface-variant-01);--background: var(--surface-neutral-t1-base)}[data-color=primary]{--foreground: var(--foreground-brand-primary-depth);--background: var(--surface-brand-primary-highlight)}[data-color=secondary]{--foreground: var(--foreground-brand-secondary-depth);--background: var(--surface-brand-secondary-highlight)}[data-color=blue]{--foreground: var(--foreground-spectrum-blue);--background: var(--surface-spectrum-blue)}[data-color=green]{--foreground: var(--foreground-spectrum-green);--background: var(--surface-spectrum-green)}[data-color=lime]{--foreground: var(--foreground-spectrum-lime);--background: var(--surface-spectrum-lime)}[data-color=magenta]{--foreground: var(--foreground-spectrum-magenta);--background: var(--surface-spectrum-magenta)}[data-color=orange]{--foreground: var(--foreground-spectrum-orange);--background: var(--surface-spectrum-orange)}[data-color=pink]{--foreground: var(--foreground-spectrum-pink);--background: var(--surface-spectrum-pink)}[data-color=purple]{--foreground: var(--foreground-spectrum-purple);--background: var(--surface-spectrum-purple)}[data-color=red]{--foreground: var(--foreground-spectrum-red);--background: var(--surface-spectrum-red)}[data-color=teal]{--foreground: var(--foreground-spectrum-teal);--background: var(--surface-spectrum-teal)}[data-color=yellow]{--foreground: var(--foreground-spectrum-yellow);--background: var(--surface-spectrum-yellow)}:root{--z-index-tooltip-popover: 1100;--z-index-dialog: 1000;--z-index-dropdown: 900;--z-index-fab: 800;--z-index-navbar: 700;--z-index-footer: 600}*,*::before,*::after{box-sizing:border-box}*{margin:0;padding:0}@media(prefers-reduced-motion){[data-animated]{animation:none !important}}body,html{height:100%;scroll-behavior:smooth}body{font:var(--body-base);background-color:var(--background-base);color:var(--foreground-neutral-on-surface)}a{color:var(--foreground-link-text-default)}a:not([disabled]):hover{color:var(--foreground-link-text-default-hovered)}a:not([disabled]):visited{color:var(--foreground-link-text-default-visited)}a[disabled]{pointer-events:none;cursor:text;color:var(--foreground-link-text-default-disabled)}a[data-subtle]{color:var(--foreground-neutral-on-surface)}a[data-subtle]:hover{color:var(--foreground-link-text-subtle-hovered)}a[data-subtle]:disabled{pointer-events:none;color:var(--foreground-link-text-subtle-disabled)}a[data-subtle-inverse]{color:var(--foreground-neutral-inverse-on-surface)}a[data-subtle-inverse]:hover{color:var(--foreground-link-text-subtle-inverse-hovered)}a[data-subtle-inverse]:disabled{pointer-events:none;color:var(--foreground-link-text-subtle-inversed-disabled)}input:-internal-autofill-previewed,input:-internal-autofill-selected,textarea:-internal-autofill-previewed,textarea:-internal-autofill-selected,select:-internal-autofill-previewed,select:-internal-autofill-selected{transition:color calc(infinity*1s) step-end,background-color calc(infinity*1s) step-end}[data-sr-only]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}ol{list-style-type:decimal}ol li{list-style-type:decimal;margin-left:var(--spacing-sizing-05)}ul{list-style-type:disc}ul li{list-style-type:disc;margin-left:var(--spacing-sizing-05)}[data-touch-target]{display:none;touch-action:manipulation;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-touch-callout:none;user-select:none;position:absolute;z-index:1;height:100%;width:100%;top:auto;left:auto}[data-touch-target]~*{position:relative;z-index:2}@media(any-pointer: coarse){[data-touch-target]{display:block}}`);;
|
|
5
5
|
/**
|
|
6
6
|
* Utility to provide the Anywhere styles to the application.
|
|
7
7
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import '@bspk/styles/better-homes-gardens.css';
|
|
3
3
|
import { styleAdd } from './utils/styleAdd';
|
|
4
|
-
styleAdd(`[data-color=grey]{--foreground: var(--foreground-neutral-on-surface-variant-01);--background: var(--surface-neutral-t2-lowest)}[data-color=white]{--foreground: var(--foreground-neutral-on-surface-variant-01);--background: var(--surface-neutral-t1-base)}[data-color=primary]{--foreground: var(--foreground-brand-primary-depth);--background: var(--surface-brand-primary-highlight)}[data-color=secondary]{--foreground: var(--foreground-brand-secondary-depth);--background: var(--surface-brand-secondary-highlight)}[data-color=blue]{--foreground: var(--foreground-spectrum-blue);--background: var(--surface-spectrum-blue)}[data-color=green]{--foreground: var(--foreground-spectrum-green);--background: var(--surface-spectrum-green)}[data-color=lime]{--foreground: var(--foreground-spectrum-lime);--background: var(--surface-spectrum-lime)}[data-color=magenta]{--foreground: var(--foreground-spectrum-magenta);--background: var(--surface-spectrum-magenta)}[data-color=orange]{--foreground: var(--foreground-spectrum-orange);--background: var(--surface-spectrum-orange)}[data-color=pink]{--foreground: var(--foreground-spectrum-pink);--background: var(--surface-spectrum-pink)}[data-color=purple]{--foreground: var(--foreground-spectrum-purple);--background: var(--surface-spectrum-purple)}[data-color=red]{--foreground: var(--foreground-spectrum-red);--background: var(--surface-spectrum-red)}[data-color=teal]{--foreground: var(--foreground-spectrum-teal);--background: var(--surface-spectrum-teal)}[data-color=yellow]{--foreground: var(--foreground-spectrum-yellow);--background: var(--surface-spectrum-yellow)}:root{--z-index-tooltip-popover: 1100;--z-index-dialog: 1000;--z-index-dropdown: 900;--z-index-fab: 800;--z-index-navbar: 700;--z-index-footer: 600}*,*::before,*::after{box-sizing:border-box}*{margin:0;padding:0}@media(prefers-reduced-motion){[data-animated]{animation:none !important}}body,html{height:100%;scroll-behavior:smooth}body{font:var(--body-base);background-color:var(--background-base);color:var(--foreground-neutral-on-surface)}a{color:var(--foreground-link-text-default)}a:hover{color:var(--foreground-link-text-default-hovered)}a:visited{color:var(--foreground-link-text-default-visited)}a
|
|
4
|
+
styleAdd(`[data-color=grey]{--foreground: var(--foreground-neutral-on-surface-variant-01);--background: var(--surface-neutral-t2-lowest)}[data-color=white]{--foreground: var(--foreground-neutral-on-surface-variant-01);--background: var(--surface-neutral-t1-base)}[data-color=primary]{--foreground: var(--foreground-brand-primary-depth);--background: var(--surface-brand-primary-highlight)}[data-color=secondary]{--foreground: var(--foreground-brand-secondary-depth);--background: var(--surface-brand-secondary-highlight)}[data-color=blue]{--foreground: var(--foreground-spectrum-blue);--background: var(--surface-spectrum-blue)}[data-color=green]{--foreground: var(--foreground-spectrum-green);--background: var(--surface-spectrum-green)}[data-color=lime]{--foreground: var(--foreground-spectrum-lime);--background: var(--surface-spectrum-lime)}[data-color=magenta]{--foreground: var(--foreground-spectrum-magenta);--background: var(--surface-spectrum-magenta)}[data-color=orange]{--foreground: var(--foreground-spectrum-orange);--background: var(--surface-spectrum-orange)}[data-color=pink]{--foreground: var(--foreground-spectrum-pink);--background: var(--surface-spectrum-pink)}[data-color=purple]{--foreground: var(--foreground-spectrum-purple);--background: var(--surface-spectrum-purple)}[data-color=red]{--foreground: var(--foreground-spectrum-red);--background: var(--surface-spectrum-red)}[data-color=teal]{--foreground: var(--foreground-spectrum-teal);--background: var(--surface-spectrum-teal)}[data-color=yellow]{--foreground: var(--foreground-spectrum-yellow);--background: var(--surface-spectrum-yellow)}:root{--z-index-tooltip-popover: 1100;--z-index-dialog: 1000;--z-index-dropdown: 900;--z-index-fab: 800;--z-index-navbar: 700;--z-index-footer: 600}*,*::before,*::after{box-sizing:border-box}*{margin:0;padding:0}@media(prefers-reduced-motion){[data-animated]{animation:none !important}}body,html{height:100%;scroll-behavior:smooth}body{font:var(--body-base);background-color:var(--background-base);color:var(--foreground-neutral-on-surface)}a{color:var(--foreground-link-text-default)}a:not([disabled]):hover{color:var(--foreground-link-text-default-hovered)}a:not([disabled]):visited{color:var(--foreground-link-text-default-visited)}a[disabled]{pointer-events:none;cursor:text;color:var(--foreground-link-text-default-disabled)}a[data-subtle]{color:var(--foreground-neutral-on-surface)}a[data-subtle]:hover{color:var(--foreground-link-text-subtle-hovered)}a[data-subtle]:disabled{pointer-events:none;color:var(--foreground-link-text-subtle-disabled)}a[data-subtle-inverse]{color:var(--foreground-neutral-inverse-on-surface)}a[data-subtle-inverse]:hover{color:var(--foreground-link-text-subtle-inverse-hovered)}a[data-subtle-inverse]:disabled{pointer-events:none;color:var(--foreground-link-text-subtle-inversed-disabled)}input:-internal-autofill-previewed,input:-internal-autofill-selected,textarea:-internal-autofill-previewed,textarea:-internal-autofill-selected,select:-internal-autofill-previewed,select:-internal-autofill-selected{transition:color calc(infinity*1s) step-end,background-color calc(infinity*1s) step-end}[data-sr-only]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}ol{list-style-type:decimal}ol li{list-style-type:decimal;margin-left:var(--spacing-sizing-05)}ul{list-style-type:disc}ul li{list-style-type:disc;margin-left:var(--spacing-sizing-05)}[data-touch-target]{display:none;touch-action:manipulation;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-touch-callout:none;user-select:none;position:absolute;z-index:1;height:100%;width:100%;top:auto;left:auto}[data-touch-target]~*{position:relative;z-index:2}@media(any-pointer: coarse){[data-touch-target]{display:block}}`);;
|
|
5
5
|
/**
|
|
6
6
|
* Utility to provide the Better Homes & Gardens styles to the application.
|
|
7
7
|
*
|