@salt-ds/core 1.8.0-rc.0 → 1.8.0-rc.2
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-cjs/card/Card.css.js +1 -1
- package/dist-cjs/checkbox/Checkbox.css.js +1 -1
- package/dist-cjs/checkbox/Checkbox.js +35 -10
- package/dist-cjs/checkbox/Checkbox.js.map +1 -1
- package/dist-cjs/checkbox/CheckboxGroup.css.js +1 -1
- package/dist-cjs/checkbox/CheckboxGroup.js +21 -3
- package/dist-cjs/checkbox/CheckboxGroup.js.map +1 -1
- package/dist-cjs/checkbox/CheckboxIcon.css.js +1 -1
- package/dist-cjs/checkbox/CheckboxIcon.js +7 -5
- package/dist-cjs/checkbox/CheckboxIcon.js.map +1 -1
- package/dist-cjs/checkbox/internal/CheckboxGroupContext.js.map +1 -1
- package/dist-cjs/form-field/FormField.css.js +1 -1
- package/dist-cjs/form-field/FormField.js +4 -2
- package/dist-cjs/form-field/FormField.js.map +1 -1
- package/dist-cjs/form-field/FormFieldHelperText.css.js +1 -1
- package/dist-cjs/form-field/FormFieldLabel.css.js +1 -1
- package/dist-cjs/form-field/FormFieldLabel.js +11 -3
- package/dist-cjs/form-field/FormFieldLabel.js.map +1 -1
- package/dist-cjs/form-field-context/FormFieldContext.js.map +1 -1
- package/dist-cjs/index.js +0 -2
- package/dist-cjs/index.js.map +1 -1
- package/dist-cjs/input/Input.css.js +1 -1
- package/dist-cjs/input/Input.js +22 -6
- package/dist-cjs/input/Input.js.map +1 -1
- package/dist-cjs/radio-button/RadioButton.css.js +1 -1
- package/dist-cjs/radio-button/RadioButton.js +36 -8
- package/dist-cjs/radio-button/RadioButton.js.map +1 -1
- package/dist-cjs/radio-button/RadioButtonGroup.css.js +1 -1
- package/dist-cjs/radio-button/RadioButtonGroup.js +19 -1
- package/dist-cjs/radio-button/RadioButtonGroup.js.map +1 -1
- package/dist-cjs/radio-button/RadioButtonIcon.css.js +1 -1
- package/dist-cjs/radio-button/RadioButtonIcon.js +5 -3
- package/dist-cjs/radio-button/RadioButtonIcon.js.map +1 -1
- package/dist-cjs/radio-button/internal/RadioGroupContext.js.map +1 -1
- package/dist-cjs/status-adornment/StatusAdornment.css.js +1 -1
- package/dist-cjs/status-adornment/StatusAdornment.js.map +1 -1
- package/dist-cjs/tooltip/Tooltip.js +12 -2
- package/dist-cjs/tooltip/Tooltip.js.map +1 -1
- package/dist-cjs/utils/useResponsiveProp.js +7 -5
- package/dist-cjs/utils/useResponsiveProp.js.map +1 -1
- package/dist-es/card/Card.css.js +1 -1
- package/dist-es/checkbox/Checkbox.css.js +1 -1
- package/dist-es/checkbox/Checkbox.js +35 -10
- package/dist-es/checkbox/Checkbox.js.map +1 -1
- package/dist-es/checkbox/CheckboxGroup.css.js +1 -1
- package/dist-es/checkbox/CheckboxGroup.js +21 -3
- package/dist-es/checkbox/CheckboxGroup.js.map +1 -1
- package/dist-es/checkbox/CheckboxIcon.css.js +1 -1
- package/dist-es/checkbox/CheckboxIcon.js +7 -5
- package/dist-es/checkbox/CheckboxIcon.js.map +1 -1
- package/dist-es/checkbox/internal/CheckboxGroupContext.js.map +1 -1
- package/dist-es/form-field/FormField.css.js +1 -1
- package/dist-es/form-field/FormField.js +4 -2
- package/dist-es/form-field/FormField.js.map +1 -1
- package/dist-es/form-field/FormFieldHelperText.css.js +1 -1
- package/dist-es/form-field/FormFieldLabel.css.js +1 -1
- package/dist-es/form-field/FormFieldLabel.js +12 -4
- package/dist-es/form-field/FormFieldLabel.js.map +1 -1
- package/dist-es/form-field-context/FormFieldContext.js.map +1 -1
- package/dist-es/index.js +0 -1
- package/dist-es/index.js.map +1 -1
- package/dist-es/input/Input.css.js +1 -1
- package/dist-es/input/Input.js +22 -6
- package/dist-es/input/Input.js.map +1 -1
- package/dist-es/radio-button/RadioButton.css.js +1 -1
- package/dist-es/radio-button/RadioButton.js +36 -8
- package/dist-es/radio-button/RadioButton.js.map +1 -1
- package/dist-es/radio-button/RadioButtonGroup.css.js +1 -1
- package/dist-es/radio-button/RadioButtonGroup.js +19 -1
- package/dist-es/radio-button/RadioButtonGroup.js.map +1 -1
- package/dist-es/radio-button/RadioButtonIcon.css.js +1 -1
- package/dist-es/radio-button/RadioButtonIcon.js +5 -3
- package/dist-es/radio-button/RadioButtonIcon.js.map +1 -1
- package/dist-es/radio-button/internal/RadioGroupContext.js.map +1 -1
- package/dist-es/status-adornment/StatusAdornment.css.js +1 -1
- package/dist-es/status-adornment/StatusAdornment.js.map +1 -1
- package/dist-es/tooltip/Tooltip.js +12 -2
- package/dist-es/tooltip/Tooltip.js.map +1 -1
- package/dist-es/utils/useResponsiveProp.js +7 -5
- package/dist-es/utils/useResponsiveProp.js.map +1 -1
- package/dist-types/checkbox/Checkbox.d.ts +9 -0
- package/dist-types/checkbox/CheckboxGroup.d.ts +9 -0
- package/dist-types/checkbox/CheckboxIcon.d.ts +3 -1
- package/dist-types/checkbox/internal/CheckboxGroupContext.d.ts +5 -0
- package/dist-types/form-field/FormField.d.ts +5 -1
- package/dist-types/form-field/index.d.ts +0 -1
- package/dist-types/form-field-context/FormFieldContext.d.ts +3 -0
- package/dist-types/input/Input.d.ts +10 -2
- package/dist-types/radio-button/RadioButton.d.ts +9 -0
- package/dist-types/radio-button/RadioButtonGroup.d.ts +8 -0
- package/dist-types/radio-button/RadioButtonIcon.d.ts +3 -1
- package/dist-types/radio-button/internal/RadioGroupContext.d.ts +5 -0
- package/dist-types/status-adornment/StatusAdornment.d.ts +1 -2
- package/package.json +3 -2
- package/dist-cjs/form-field/FormFieldControlWrapper.css.js +0 -6
- package/dist-cjs/form-field/FormFieldControlWrapper.css.js.map +0 -1
- package/dist-cjs/form-field/FormFieldControlWrapper.js +0 -32
- package/dist-cjs/form-field/FormFieldControlWrapper.js.map +0 -1
- package/dist-es/form-field/FormFieldControlWrapper.css.js +0 -4
- package/dist-es/form-field/FormFieldControlWrapper.css.js.map +0 -1
- package/dist-es/form-field/FormFieldControlWrapper.js +0 -28
- package/dist-es/form-field/FormFieldControlWrapper.js.map +0 -1
- package/dist-types/form-field/FormFieldControlWrapper.d.ts +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
3
|
import '../form-field-context/FormFieldContext.js';
|
|
4
4
|
import { useFormFieldProps } from '../form-field-context/useFormFieldProps.js';
|
|
@@ -6,6 +6,7 @@ import '../text/Text.js';
|
|
|
6
6
|
import '../text/Display.js';
|
|
7
7
|
import '../text/Headings.js';
|
|
8
8
|
import { Label } from '../text/Label.js';
|
|
9
|
+
import { capitalize } from '../utils/capitalize.js';
|
|
9
10
|
import 'react';
|
|
10
11
|
import { makePrefixer } from '../utils/makePrefixer.js';
|
|
11
12
|
import '../utils/useFloatingUI.js';
|
|
@@ -22,21 +23,28 @@ const FormFieldLabel = ({
|
|
|
22
23
|
children,
|
|
23
24
|
...restProps
|
|
24
25
|
}) => {
|
|
25
|
-
const { a11yProps, disabled } = useFormFieldProps();
|
|
26
|
+
const { a11yProps, disabled, necessity } = useFormFieldProps();
|
|
26
27
|
const targetWindow = useWindow();
|
|
27
28
|
useComponentCssInjection({
|
|
28
29
|
testId: "salt-form-field-label",
|
|
29
30
|
css: css_248z,
|
|
30
31
|
window: targetWindow
|
|
31
32
|
});
|
|
32
|
-
|
|
33
|
+
const necessityLabel = necessity ? necessity === "asterisk" ? "*" : ` (${capitalize(necessity)})` : void 0;
|
|
34
|
+
return /* @__PURE__ */ jsxs(Label, {
|
|
33
35
|
as: "label",
|
|
34
36
|
className: clsx(withBaseName(), className),
|
|
35
37
|
id: a11yProps == null ? void 0 : a11yProps["aria-labelledby"],
|
|
36
38
|
disabled,
|
|
37
39
|
variant: "secondary",
|
|
38
40
|
...restProps,
|
|
39
|
-
children
|
|
41
|
+
children: [
|
|
42
|
+
children,
|
|
43
|
+
necessityLabel && /* @__PURE__ */ jsx("span", {
|
|
44
|
+
className: withBaseName("necessityLabel"),
|
|
45
|
+
children: necessityLabel
|
|
46
|
+
})
|
|
47
|
+
]
|
|
40
48
|
});
|
|
41
49
|
};
|
|
42
50
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormFieldLabel.js","sources":["../src/form-field/FormFieldLabel.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { useFormFieldProps } from \"../form-field-context\";\nimport { Label, TextProps } from \"../text\";\nimport { makePrefixer } from \"../utils\";\n\nimport { useWindow } from \"@salt-ds/window\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\n\nimport formFieldLabelCss from \"./FormFieldLabel.css\";\n\nconst withBaseName = makePrefixer(\"saltFormFieldLabel\");\n\nexport const FormFieldLabel = ({\n className,\n children,\n ...restProps\n}: Omit<TextProps<\"label\">, \"variant\" | \"styleAs\">) => {\n const { a11yProps, disabled } = useFormFieldProps();\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-form-field-label\",\n css: formFieldLabelCss,\n window: targetWindow,\n });\n\n return (\n <Label\n as=\"label\"\n className={clsx(withBaseName(), className)}\n id={a11yProps?.[\"aria-labelledby\"]}\n disabled={disabled}\n variant=\"secondary\"\n {...restProps}\n >\n {children}\n </Label>\n );\n};\n"],"names":["formFieldLabelCss"],"mappings":"
|
|
1
|
+
{"version":3,"file":"FormFieldLabel.js","sources":["../src/form-field/FormFieldLabel.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { useFormFieldProps } from \"../form-field-context\";\nimport { Label, TextProps } from \"../text\";\nimport { capitalize, makePrefixer } from \"../utils\";\n\nimport { useWindow } from \"@salt-ds/window\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\n\nimport formFieldLabelCss from \"./FormFieldLabel.css\";\n\nconst withBaseName = makePrefixer(\"saltFormFieldLabel\");\n\nexport const FormFieldLabel = ({\n className,\n children,\n ...restProps\n}: Omit<TextProps<\"label\">, \"variant\" | \"styleAs\">) => {\n const { a11yProps, disabled, necessity } = useFormFieldProps();\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-form-field-label\",\n css: formFieldLabelCss,\n window: targetWindow,\n });\n\n const necessityLabel = necessity\n ? necessity === \"asterisk\"\n ? \"*\"\n : ` (${capitalize(necessity)})`\n : undefined;\n\n return (\n <Label\n as=\"label\"\n className={clsx(withBaseName(), className)}\n id={a11yProps?.[\"aria-labelledby\"]}\n disabled={disabled}\n variant=\"secondary\"\n {...restProps}\n >\n {children}\n {necessityLabel && (\n <span className={withBaseName(\"necessityLabel\")}>{necessityLabel}</span>\n )}\n </Label>\n );\n};\n"],"names":["formFieldLabelCss"],"mappings":";;;;;;;;;;;;;;;;;;;AAUA,MAAM,YAAA,GAAe,aAAa,oBAAoB,CAAA,CAAA;AAE/C,MAAM,iBAAiB,CAAC;AAAA,EAC7B,SAAA;AAAA,EACA,QAAA;AAAA,EACG,GAAA,SAAA;AACL,CAAuD,KAAA;AACrD,EAAA,MAAM,EAAE,SAAA,EAAW,QAAU,EAAA,SAAA,KAAc,iBAAkB,EAAA,CAAA;AAC7D,EAAA,MAAM,eAAe,SAAU,EAAA,CAAA;AAC/B,EAAyB,wBAAA,CAAA;AAAA,IACvB,MAAQ,EAAA,uBAAA;AAAA,IACR,GAAK,EAAAA,QAAA;AAAA,IACL,MAAQ,EAAA,YAAA;AAAA,GACT,CAAA,CAAA;AAED,EAAM,MAAA,cAAA,GAAiB,YACnB,SAAc,KAAA,UAAA,GACZ,MACA,CAAK,EAAA,EAAA,UAAA,CAAW,SAAS,CAC3B,CAAA,CAAA,CAAA,GAAA,KAAA,CAAA,CAAA;AAEJ,EAAA,uBACG,IAAA,CAAA,KAAA,EAAA;AAAA,IACC,EAAG,EAAA,OAAA;AAAA,IACH,SAAW,EAAA,IAAA,CAAK,YAAa,EAAA,EAAG,SAAS,CAAA;AAAA,IACzC,IAAI,SAAY,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,SAAA,CAAA,iBAAA,CAAA;AAAA,IAChB,QAAA;AAAA,IACA,OAAQ,EAAA,WAAA;AAAA,IACP,GAAG,SAAA;AAAA,IAEH,QAAA,EAAA;AAAA,MAAA,QAAA;AAAA,MACA,kCACE,GAAA,CAAA,MAAA,EAAA;AAAA,QAAK,SAAA,EAAW,aAAa,gBAAgB,CAAA;AAAA,QAAI,QAAA,EAAA,cAAA;AAAA,OAAe,CAAA;AAAA,KAAA;AAAA,GAErE,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormFieldContext.js","sources":["../src/form-field-context/FormFieldContext.ts"],"sourcesContent":["import { createContext } from \"../utils\";\n\nexport interface A11yValueProps {\n /**\n * id for FormFieldHelperText\n */\n helperTextId?: string;\n /**\n * id for FormFieldLabel\n */\n labelId?: string;\n}\n\nexport interface a11yValueAriaProps {\n \"aria-labelledby\": A11yValueProps[\"labelId\"];\n \"aria-describedby\": A11yValueProps[\"helperTextId\"] | undefined;\n}\n\nexport interface FormFieldContextValue {\n a11yProps: a11yValueAriaProps;\n disabled: boolean;\n readOnly: boolean;\n validationStatus: \"error\" | \"warning\" | \"success\" | undefined;\n}\n\nexport const FormFieldContext = createContext(\n \"FormFieldContext\",\n {} as FormFieldContextValue\n);\n"],"names":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"FormFieldContext.js","sources":["../src/form-field-context/FormFieldContext.ts"],"sourcesContent":["import { createContext } from \"../utils\";\n\nexport interface A11yValueProps {\n /**\n * id for FormFieldHelperText\n */\n helperTextId?: string;\n /**\n * id for FormFieldLabel\n */\n labelId?: string;\n}\n\ntype NecessityType = \"required\" | \"optional\" | \"asterisk\";\n\nexport interface a11yValueAriaProps {\n \"aria-labelledby\": A11yValueProps[\"labelId\"];\n \"aria-describedby\": A11yValueProps[\"helperTextId\"] | undefined;\n}\n\nexport interface FormFieldContextValue {\n a11yProps: a11yValueAriaProps;\n disabled: boolean;\n necessity: NecessityType | undefined;\n readOnly: boolean;\n validationStatus: \"error\" | \"warning\" | \"success\" | undefined;\n}\n\nexport const FormFieldContext = createContext(\n \"FormFieldContext\",\n {} as FormFieldContextValue\n);\n"],"names":[],"mappings":";;;;;;;;AA4BO,MAAM,gBAAmB,GAAA,aAAA;AAAA,EAC9B,kBAAA;AAAA,EACA,EAAC;AACH;;;;"}
|
package/dist-es/index.js
CHANGED
|
@@ -21,7 +21,6 @@ export { FLEX_ITEM_ALIGNMENTS, FlexItem } from './flex-item/FlexItem.js';
|
|
|
21
21
|
export { FLEX_ALIGNMENT_BASE, FLEX_CONTENT_ALIGNMENT_BASE, FlexLayout } from './flex-layout/FlexLayout.js';
|
|
22
22
|
export { FlowLayout } from './flow-layout/FlowLayout.js';
|
|
23
23
|
export { FormField } from './form-field/FormField.js';
|
|
24
|
-
export { FormFieldControlWrapper } from './form-field/FormFieldControlWrapper.js';
|
|
25
24
|
export { FormFieldHelperText } from './form-field/FormFieldHelperText.js';
|
|
26
25
|
export { FormFieldLabel } from './form-field/FormFieldLabel.js';
|
|
27
26
|
export { FormFieldContext } from './form-field-context/FormFieldContext.js';
|
package/dist-es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var css_248z = "/* Style applied to the root element */\n.saltInput {\n --input-borderColor: var(--salt-editable-borderColor);\n --input-borderStyle: var(--salt-editable-borderStyle);\n --input-outlineColor: var(--salt-focused-outlineColor);\n --input-borderWidth: var(--salt-size-border);\n --input-paddingLeft: var(--salt-
|
|
1
|
+
var css_248z = "/* Style applied to the root element */\n.saltInput {\n --input-borderColor: var(--salt-editable-borderColor);\n --input-borderStyle: var(--salt-editable-borderStyle);\n --input-outlineColor: var(--salt-focused-outlineColor);\n --input-borderWidth: var(--salt-size-border);\n --input-paddingLeft: var(--salt-spacing-100);\n\n align-items: center;\n background: var(--saltInput-background, var(--input-background));\n color: var(--saltInput-color, var(--salt-text-primary-foreground));\n display: inline-flex;\n font-family: var(--salt-text-fontFamily);\n font-size: var(--saltInput-fontSize, var(--salt-text-fontSize));\n height: var(--saltInput-height, var(--salt-size-base));\n line-height: var(--saltInput-lineHeight, var(--salt-text-lineHeight));\n min-height: var(--saltInput-minHeight, var(--salt-size-base));\n min-width: var(--saltInput-minWidth, 4em);\n padding-left: var(--saltInput-paddingLeft, var(--input-paddingLeft));\n padding-right: var(--saltInput-paddingRight, var(--salt-spacing-100));\n position: relative;\n width: 100%;\n}\n\n.saltInput:hover {\n --input-borderStyle: var(--salt-editable-borderStyle-hover);\n --input-borderColor: var(--salt-editable-borderColor-hover);\n\n background: var(--saltInput-background-hover, var(--input-background-hover));\n cursor: var(--salt-editable-cursor-hover);\n}\n\n.saltInput:active {\n --input-borderColor: var(--salt-editable-borderColor-active);\n --input-borderStyle: var(--salt-editable-borderStyle-active);\n --input-borderWidth: var(--salt-editable-borderWidth-active);\n\n background: var(--saltInput-background-active, var(--input-background-active));\n cursor: var(--salt-editable-cursor-active);\n}\n\n/* Class applied if `variant=\"primary\"` */\n.saltInput-primary {\n --input-background: var(--salt-editable-primary-background);\n --input-background-active: var(--salt-editable-primary-background-active);\n --input-background-hover: var(--salt-editable-primary-background-hover);\n --input-background-disabled: var(--salt-editable-primary-background-disabled);\n --input-background-readonly: var(--salt-editable-primary-background-readonly);\n}\n\n/* Class applied if `variant=\"secondary\"` */\n.saltInput-secondary {\n --input-background: var(--salt-editable-secondary-background);\n --input-background-active: var(--salt-editable-secondary-background-active);\n --input-background-hover: var(--salt-editable-secondary-background-active);\n --input-background-disabled: var(--salt-editable-secondary-background-disabled);\n --input-background-readonly: var(--salt-editable-secondary-background-readonly);\n}\n\n/* Style applied to input if `validationState=\"error\"` */\n.saltInput-error,\n.saltInput-error:hover {\n --input-background: var(--salt-status-error-background);\n --input-background-active: var(--salt-status-error-background);\n --input-background-hover: var(--salt-status-error-background);\n --input-borderColor: var(--salt-status-error-borderColor);\n --input-outlineColor: var(--salt-status-error-borderColor);\n}\n\n/* Style applied to input if `validationState=\"warning\"` */\n.saltInput-warning,\n.saltInput-warning:hover {\n --input-background: var(--salt-status-warning-background);\n --input-background-active: var(--salt-status-warning-background);\n --input-background-hover: var(--salt-status-warning-background);\n --input-borderColor: var(--salt-status-warning-borderColor);\n --input-outlineColor: var(--salt-status-warning-borderColor);\n}\n\n/* Style applied to input if `validationState=\"success\"` */\n.saltInput-success,\n.saltInput-success:hover {\n --input-background: var(--salt-status-success-background);\n --input-background-active: var(--salt-status-success-background);\n --input-background-hover: var(--salt-status-success-background);\n --input-borderColor: var(--salt-status-success-borderColor);\n --input-outlineColor: var(--salt-status-success-borderColor);\n}\n\n/* Style applied to inner input component */\n.saltInput-input {\n background: none;\n border: none;\n box-sizing: content-box;\n color: inherit;\n cursor: inherit;\n display: block;\n flex: 1;\n font: inherit;\n height: 100%;\n letter-spacing: var(--saltInput-letterSpacing, 0);\n margin: 0;\n min-width: 0;\n overflow: hidden;\n padding: 0;\n text-align: var(--input-textAlign);\n width: 100%;\n}\n\n/* Reset in the class */\n.saltInput-input:focus {\n outline: none;\n}\n\n/* Style applied to selected input */\n.saltInput-input::selection {\n background: var(--salt-text-background-selected);\n}\n\n/* Styling when focused */\n.saltInput-focused {\n --input-borderColor: var(--input-outlineColor);\n --input-borderWidth: var(--salt-editable-borderWidth-active);\n\n outline: var(--saltInput-outline, var(--salt-focused-outlineWidth) var(--salt-focused-outlineStyle) var(--input-outlineColor));\n}\n\n/* Style applied if `readOnly={true}` */\n.saltInput.saltInput-readOnly {\n --input-borderColor: var(--salt-editable-borderColor-readonly);\n --input-borderStyle: var(--salt-editable-borderStyle-readonly);\n --input-paddingLeft: 0;\n\n background: var(--input-background-readonly);\n cursor: var(--salt-editable-cursor-readonly);\n}\n\n/* Styling when focused if `disabled={true}` or `readOnly={true}` */\n.saltInput-focused.saltInput-readOnly,\n.saltInput-focused.saltInput-disabled {\n --input-borderWidth: var(--salt-size-border);\n outline: none;\n}\n\n/* Style applied to selected input if `disabled={true}` */\n.saltInput-disabled .saltInput-input::selection {\n background: none;\n}\n\n/* Style applied to input if `disabled={true}` */\n.saltInput.saltInput-disabled,\n.saltInput.saltInput-disabled:hover,\n.saltInput.saltInput-disabled:active {\n --input-borderColor: var(--salt-editable-borderColor-disabled);\n --input-borderStyle: var(--salt-editable-borderStyle-disabled);\n --input-borderWidth: var(--salt-size-border);\n\n background: var(--input-background-disabled);\n cursor: var(--salt-editable-cursor-disabled);\n color: var(--saltInput-color-disabled, var(--salt-text-primary-foreground-disabled));\n}\n\n.saltInput-activationIndicator {\n left: 0;\n bottom: 0;\n width: 100%;\n position: absolute;\n border-bottom: var(--input-borderWidth) var(--input-borderStyle) var(--input-borderColor);\n}\n\n/* Style applied to start adornments */\n.saltInput-startAdornmentContainer {\n align-items: center;\n display: inline-flex;\n padding-right: var(--salt-spacing-100);\n column-gap: var(--salt-spacing-100);\n}\n\n/* Style applied to end adornments */\n.saltInput-endAdornmentContainer {\n align-items: center;\n display: inline-flex;\n padding-left: var(--salt-spacing-100);\n column-gap: var(--salt-spacing-100);\n}\n\n.saltInput-startAdornmentContainer .saltButton:first-child {\n margin-left: calc(var(--salt-spacing-50) * -1);\n}\n.saltInput-endAdornmentContainer .saltButton:last-child {\n margin-right: calc(var(--salt-spacing-50) * -1);\n}\n\n.saltInput .saltButton {\n --saltButton-padding: 0;\n --saltButton-height: calc(var(--salt-size-base) - var(--salt-spacing-50));\n --saltButton-width: calc(var(--salt-size-base) - var(--salt-spacing-50));\n}\n";
|
|
2
2
|
|
|
3
3
|
export { css_248z as default };
|
|
4
4
|
//# sourceMappingURL=Input.css.js.map
|
package/dist-es/input/Input.js
CHANGED
|
@@ -22,11 +22,14 @@ const Input = forwardRef(function Input2({
|
|
|
22
22
|
className: classNameProp,
|
|
23
23
|
disabled,
|
|
24
24
|
emptyReadOnlyMarker = "\u2014",
|
|
25
|
+
endAdornment,
|
|
25
26
|
id,
|
|
26
27
|
inputProps = {},
|
|
27
28
|
inputRef,
|
|
29
|
+
placeholder,
|
|
28
30
|
readOnly: readOnlyProp,
|
|
29
31
|
role,
|
|
32
|
+
startAdornment,
|
|
30
33
|
style,
|
|
31
34
|
textAlign = "left",
|
|
32
35
|
value: valueProp,
|
|
@@ -48,12 +51,13 @@ const Input = forwardRef(function Input2({
|
|
|
48
51
|
} = {},
|
|
49
52
|
disabled: formFieldDisabled,
|
|
50
53
|
readOnly: formFieldReadOnly,
|
|
54
|
+
necessity: formFieldRequired,
|
|
51
55
|
validationStatus: formFieldValidationStatus
|
|
52
56
|
} = useFormFieldProps();
|
|
53
57
|
const restA11yProps = {
|
|
54
|
-
ariaActiveDescendant,
|
|
55
|
-
ariaExpanded,
|
|
56
|
-
ariaOwns
|
|
58
|
+
"aria-activedescendant": ariaActiveDescendant,
|
|
59
|
+
"aria-expanded": ariaExpanded,
|
|
60
|
+
"aria-owns": ariaOwns
|
|
57
61
|
};
|
|
58
62
|
const isDisabled = disabled || formFieldDisabled;
|
|
59
63
|
const isReadOnly = readOnlyProp || formFieldReadOnly;
|
|
@@ -67,8 +71,10 @@ const Input = forwardRef(function Input2({
|
|
|
67
71
|
onBlur,
|
|
68
72
|
onChange,
|
|
69
73
|
onFocus,
|
|
74
|
+
required: inputPropsRequired,
|
|
70
75
|
...restInputProps
|
|
71
76
|
} = inputProps;
|
|
77
|
+
const isRequired = formFieldRequired ? ["required", "asterisk"].includes(formFieldRequired) : inputPropsRequired;
|
|
72
78
|
const [value, setValue] = useControlled({
|
|
73
79
|
controlled: valueProp,
|
|
74
80
|
default: defaultValue,
|
|
@@ -95,12 +101,12 @@ const Input = forwardRef(function Input2({
|
|
|
95
101
|
return /* @__PURE__ */ jsxs("div", {
|
|
96
102
|
className: clsx(
|
|
97
103
|
withBaseName(),
|
|
104
|
+
withBaseName(variant),
|
|
98
105
|
{
|
|
99
106
|
[withBaseName("focused")]: !isDisabled && focused,
|
|
100
107
|
[withBaseName("disabled")]: isDisabled,
|
|
101
108
|
[withBaseName("readOnly")]: isReadOnly,
|
|
102
|
-
[withBaseName(validationStatus || "")]: validationStatus
|
|
103
|
-
[withBaseName(variant)]: variant
|
|
109
|
+
[withBaseName(validationStatus || "")]: validationStatus
|
|
104
110
|
},
|
|
105
111
|
classNameProp
|
|
106
112
|
),
|
|
@@ -108,6 +114,10 @@ const Input = forwardRef(function Input2({
|
|
|
108
114
|
style: inputStyle,
|
|
109
115
|
...other,
|
|
110
116
|
children: [
|
|
117
|
+
startAdornment && /* @__PURE__ */ jsx("div", {
|
|
118
|
+
className: withBaseName("startAdornmentContainer"),
|
|
119
|
+
children: startAdornment
|
|
120
|
+
}),
|
|
111
121
|
/* @__PURE__ */ jsx("input", {
|
|
112
122
|
"aria-describedby": clsx(formFieldDescribedBy, inputDescribedBy),
|
|
113
123
|
"aria-labelledby": clsx(formFieldLabelledBy, inputLabelledBy),
|
|
@@ -121,13 +131,19 @@ const Input = forwardRef(function Input2({
|
|
|
121
131
|
onBlur: handleBlur,
|
|
122
132
|
onChange: handleChange,
|
|
123
133
|
onFocus: !isDisabled ? handleFocus : void 0,
|
|
134
|
+
placeholder,
|
|
124
135
|
value,
|
|
125
136
|
...restA11yProps,
|
|
126
|
-
...restInputProps
|
|
137
|
+
...restInputProps,
|
|
138
|
+
required: isRequired
|
|
127
139
|
}),
|
|
128
140
|
!isDisabled && !isReadOnly && validationStatus && /* @__PURE__ */ jsx(StatusAdornment, {
|
|
129
141
|
status: validationStatus
|
|
130
142
|
}),
|
|
143
|
+
endAdornment && /* @__PURE__ */ jsx("div", {
|
|
144
|
+
className: withBaseName("endAdornmentContainer"),
|
|
145
|
+
children: endAdornment
|
|
146
|
+
}),
|
|
131
147
|
/* @__PURE__ */ jsx("div", {
|
|
132
148
|
className: withBaseName("activationIndicator")
|
|
133
149
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sources":["../src/input/Input.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport {\n ChangeEvent,\n ComponentPropsWithoutRef,\n FocusEvent,\n forwardRef,\n InputHTMLAttributes,\n Ref,\n useState,\n} from \"react\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { useFormFieldProps } from \"../form-field-context\";\nimport { makePrefixer, useControlled } from \"../utils\";\nimport { StatusAdornment } from \"../status-adornment\";\n\nimport inputCss from \"./Input.css\";\n\nconst withBaseName = makePrefixer(\"saltInput\");\n\nexport interface InputProps\n extends Omit<ComponentPropsWithoutRef<\"div\">, \"defaultValue\">,\n Pick<\n ComponentPropsWithoutRef<\"input\">,\n \"disabled\" | \"value\" | \"defaultValue\"\n > {\n /**\n * The marker to use in an empty read only Input.\n * Use `''` to disable this feature. Defaults to '—'.\n */\n emptyReadOnlyMarker?: string;\n /**\n * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.\n */\n inputProps?: InputHTMLAttributes<HTMLInputElement>;\n /**\n * Optional ref for the input component\n */\n inputRef?: Ref<HTMLInputElement>;\n /**\n * If `true`, the component is read only.\n */\n readOnly?: boolean;\n /**\n * Alignment of text within container. Defaults to \"left\"\n */\n textAlign?: \"left\" | \"center\" | \"right\";\n /**\n * Validation status.\n */\n validationStatus?: \"error\" | \"warning\" | \"success\";\n /**\n * Styling variant. Defaults to \"primary\".\n */\n variant?: \"primary\" | \"secondary\";\n}\n\nexport const Input = forwardRef<HTMLDivElement, InputProps>(function Input(\n {\n \"aria-activedescendant\": ariaActiveDescendant,\n \"aria-expanded\": ariaExpanded,\n \"aria-owns\": ariaOwns,\n className: classNameProp,\n disabled,\n emptyReadOnlyMarker = \"—\",\n id,\n inputProps = {},\n inputRef,\n readOnly: readOnlyProp,\n role,\n style,\n textAlign = \"left\",\n value: valueProp,\n defaultValue: defaultValueProp = valueProp === undefined ? \"\" : undefined,\n validationStatus: validationStatusProp,\n variant = \"primary\",\n ...other\n },\n ref\n) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-input\",\n css: inputCss,\n window: targetWindow,\n });\n\n const {\n a11yProps: {\n \"aria-describedby\": formFieldDescribedBy,\n \"aria-labelledby\": formFieldLabelledBy,\n } = {},\n disabled: formFieldDisabled,\n readOnly: formFieldReadOnly,\n validationStatus: formFieldValidationStatus,\n } = useFormFieldProps();\n\n const restA11yProps = {\n ariaActiveDescendant,\n ariaExpanded,\n ariaOwns,\n };\n\n const isDisabled = disabled || formFieldDisabled;\n const isReadOnly = readOnlyProp || formFieldReadOnly;\n\n const validationStatus = formFieldValidationStatus ?? validationStatusProp;\n\n const [focused, setFocused] = useState(false);\n\n const isEmptyReadOnly = isReadOnly && !defaultValueProp && !valueProp;\n const defaultValue = isEmptyReadOnly ? emptyReadOnlyMarker : defaultValueProp;\n\n const {\n \"aria-describedby\": inputDescribedBy,\n \"aria-labelledby\": inputLabelledBy,\n onBlur,\n onChange,\n onFocus,\n ...restInputProps\n } = inputProps;\n\n const [value, setValue] = useControlled({\n controlled: valueProp,\n default: defaultValue,\n name: \"Input\",\n state: \"value\",\n });\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n const value = event.target.value;\n setValue(value);\n onChange?.(event);\n };\n\n const handleBlur = (event: FocusEvent<HTMLInputElement>) => {\n onBlur?.(event);\n setFocused(false);\n };\n\n const handleFocus = (event: FocusEvent<HTMLInputElement>) => {\n onFocus?.(event);\n setFocused(true);\n };\n\n const inputStyle = {\n \"--input-textAlign\": textAlign,\n ...style,\n };\n\n return (\n <div\n className={clsx(\n withBaseName(),\n {\n [withBaseName(\"focused\")]: !isDisabled && focused,\n [withBaseName(\"disabled\")]: isDisabled,\n [withBaseName(\"readOnly\")]: isReadOnly,\n [withBaseName(validationStatus || \"\")]: validationStatus,\n [withBaseName(variant)]: variant,\n },\n classNameProp\n )}\n ref={ref}\n style={inputStyle}\n {...other}\n >\n <input\n aria-describedby={clsx(formFieldDescribedBy, inputDescribedBy)}\n aria-labelledby={clsx(formFieldLabelledBy, inputLabelledBy)}\n className={clsx(withBaseName(\"input\"), inputProps?.className)}\n disabled={isDisabled}\n id={id}\n readOnly={isReadOnly}\n ref={inputRef}\n role={role}\n tabIndex={isReadOnly || isDisabled ? -1 : 0}\n onBlur={handleBlur}\n onChange={handleChange}\n onFocus={!isDisabled ? handleFocus : undefined}\n value={value}\n {...restA11yProps}\n {...restInputProps}\n />\n {!isDisabled && !isReadOnly && validationStatus && (\n <StatusAdornment status={validationStatus} />\n )}\n <div className={withBaseName(\"activationIndicator\")} />\n </div>\n );\n});\n"],"names":["Input","inputCss","value"],"mappings":";;;;;;;;;;;;;;;;AAkBA,MAAM,YAAA,GAAe,aAAa,WAAW,CAAA,CAAA;AAuChC,MAAA,KAAA,GAAQ,UAAuC,CAAA,SAASA,MACnE,CAAA;AAAA,EACE,uBAAyB,EAAA,oBAAA;AAAA,EACzB,eAAiB,EAAA,YAAA;AAAA,EACjB,WAAa,EAAA,QAAA;AAAA,EACb,SAAW,EAAA,aAAA;AAAA,EACX,QAAA;AAAA,EACA,mBAAsB,GAAA,QAAA;AAAA,EACtB,EAAA;AAAA,EACA,aAAa,EAAC;AAAA,EACd,QAAA;AAAA,EACA,QAAU,EAAA,YAAA;AAAA,EACV,IAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAY,GAAA,MAAA;AAAA,EACZ,KAAO,EAAA,SAAA;AAAA,EACP,YAAc,EAAA,gBAAA,GAAmB,SAAc,KAAA,KAAA,CAAA,GAAY,EAAK,GAAA,KAAA,CAAA;AAAA,EAChE,gBAAkB,EAAA,oBAAA;AAAA,EAClB,OAAU,GAAA,SAAA;AAAA,EACP,GAAA,KAAA;AACL,CAAA,EACA,GACA,EAAA;AACA,EAAA,MAAM,eA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AO,CAAI,GAAA,OAAA;AAAA,OAC3B;AAAA,MACA,aAAA;AAAA,KACF;AAAA,IACA,GAAA;AAAA,IACA,KAAO,EAAA,UAAA;AAAA,IACN,GAAG,KAAA;AAAA,IAEJ,QAAA,EAAA;AAAA,sBAAC,GAAA,CAAA,OAAA,EAAA;AAAA,QACC,kBAAA,EAAkB,IAAK,CAAA,oBAAA,EAAsB,gBAAgB,CAAA;AAAA,QAC7D,iBAAA,EAAiB,IAAK,CAAA,mBAAA,EAAqB,eAAe,CAAA;AAAA,QAC1D,WAAW,IAAK,CAAA,YAAA,CAAa,OAAO,CAAA,EAAG,yCAAY,SAAS,CAAA;AAAA,QAC5D,QAAU,EAAA,UAAA;AAAA,QACV,EAAA;AAAA,QACA,QAAU,EAAA,UAAA;AAAA,QACV,GAAK,EAAA,QAAA;AAAA,QACL,IAAA;AAAA,QACA,QAAA,EAAU,UAAc,IAAA,UAAA,GAAa,CAAK,CAAA,GAAA,CAAA;AAAA,QAC1C,MAAQ,EAAA,UAAA;AAAA,QACR,QAAU,EAAA,YAAA;AAAA,QACV,OAAA,EAAS,CAAC,UAAA,GAAa,WAAc,GAAA,KAAA,CAAA;AAAA,QACrC,KAAA;AAAA,QACC,GAAG,aAAA;AAAA,QACH,GAAG,cAAA;AAAA,OACN,CAAA;AAAA,MACC,CAAC,UAAA,IAAc,CAAC,UAAA,IAAc,oCAC5B,GAAA,CAAA,eAAA,EAAA;AAAA,QAAgB,MAAQ,EAAA,gBAAA;AAAA,OAAkB,CAAA;AAAA,sBAE5C,GAAA,CAAA,KAAA,EAAA;AAAA,QAAI,SAAA,EAAW,aAAa,qBAAqB,CAAA;AAAA,OAAG,CAAA;AAAA,KAAA;AAAA,GACvD,CAAA,CAAA;AAEJ,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"Input.js","sources":["../src/input/Input.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport {\n ChangeEvent,\n ComponentPropsWithoutRef,\n FocusEvent,\n forwardRef,\n InputHTMLAttributes,\n ReactNode,\n Ref,\n useState,\n} from \"react\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { useFormFieldProps } from \"../form-field-context\";\nimport { makePrefixer, useControlled } from \"../utils\";\nimport { StatusAdornment } from \"../status-adornment\";\n\nimport inputCss from \"./Input.css\";\n\nconst withBaseName = makePrefixer(\"saltInput\");\n\nexport interface InputProps\n extends Omit<ComponentPropsWithoutRef<\"div\">, \"defaultValue\">,\n Pick<\n ComponentPropsWithoutRef<\"input\">,\n \"disabled\" | \"value\" | \"defaultValue\" | \"placeholder\"\n > {\n /**\n * The marker to use in an empty read only Input.\n * Use `''` to disable this feature. Defaults to '—'.\n */\n emptyReadOnlyMarker?: string;\n /**\n * End adornment component\n */\n endAdornment?: ReactNode;\n /**\n * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.\n */\n inputProps?: InputHTMLAttributes<HTMLInputElement>;\n /**\n * Optional ref for the input component\n */\n inputRef?: Ref<HTMLInputElement>;\n /**\n * If `true`, the component is read only.\n */\n readOnly?: boolean;\n /**\n * Start adornment component\n */\n startAdornment?: ReactNode;\n /**\n * Alignment of text within container. Defaults to \"left\"\n */\n textAlign?: \"left\" | \"center\" | \"right\";\n /**\n * Validation status.\n */\n validationStatus?: \"error\" | \"warning\" | \"success\";\n /**\n * Styling variant. Defaults to \"primary\".\n */\n variant?: \"primary\" | \"secondary\";\n}\n\nexport const Input = forwardRef<HTMLDivElement, InputProps>(function Input(\n {\n \"aria-activedescendant\": ariaActiveDescendant,\n \"aria-expanded\": ariaExpanded,\n \"aria-owns\": ariaOwns,\n className: classNameProp,\n disabled,\n emptyReadOnlyMarker = \"—\",\n endAdornment,\n id,\n inputProps = {},\n inputRef,\n placeholder,\n readOnly: readOnlyProp,\n role,\n startAdornment,\n style,\n textAlign = \"left\",\n value: valueProp,\n defaultValue: defaultValueProp = valueProp === undefined ? \"\" : undefined,\n validationStatus: validationStatusProp,\n variant = \"primary\",\n ...other\n },\n ref\n) {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-input\",\n css: inputCss,\n window: targetWindow,\n });\n\n const {\n a11yProps: {\n \"aria-describedby\": formFieldDescribedBy,\n \"aria-labelledby\": formFieldLabelledBy,\n } = {},\n disabled: formFieldDisabled,\n readOnly: formFieldReadOnly,\n necessity: formFieldRequired,\n validationStatus: formFieldValidationStatus,\n } = useFormFieldProps();\n\n const restA11yProps = {\n \"aria-activedescendant\": ariaActiveDescendant,\n \"aria-expanded\": ariaExpanded,\n \"aria-owns\": ariaOwns,\n };\n\n const isDisabled = disabled || formFieldDisabled;\n const isReadOnly = readOnlyProp || formFieldReadOnly;\n const validationStatus = formFieldValidationStatus ?? validationStatusProp;\n\n const [focused, setFocused] = useState(false);\n\n const isEmptyReadOnly = isReadOnly && !defaultValueProp && !valueProp;\n const defaultValue = isEmptyReadOnly ? emptyReadOnlyMarker : defaultValueProp;\n\n const {\n \"aria-describedby\": inputDescribedBy,\n \"aria-labelledby\": inputLabelledBy,\n onBlur,\n onChange,\n onFocus,\n required: inputPropsRequired,\n ...restInputProps\n } = inputProps;\n\n const isRequired = formFieldRequired\n ? [\"required\", \"asterisk\"].includes(formFieldRequired)\n : undefined ?? inputPropsRequired;\n\n const [value, setValue] = useControlled({\n controlled: valueProp,\n default: defaultValue,\n name: \"Input\",\n state: \"value\",\n });\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n const value = event.target.value;\n setValue(value);\n onChange?.(event);\n };\n\n const handleBlur = (event: FocusEvent<HTMLInputElement>) => {\n onBlur?.(event);\n setFocused(false);\n };\n\n const handleFocus = (event: FocusEvent<HTMLInputElement>) => {\n onFocus?.(event);\n setFocused(true);\n };\n\n const inputStyle = {\n \"--input-textAlign\": textAlign,\n ...style,\n };\n\n return (\n <div\n className={clsx(\n withBaseName(),\n withBaseName(variant),\n {\n [withBaseName(\"focused\")]: !isDisabled && focused,\n [withBaseName(\"disabled\")]: isDisabled,\n [withBaseName(\"readOnly\")]: isReadOnly,\n [withBaseName(validationStatus || \"\")]: validationStatus,\n },\n classNameProp\n )}\n ref={ref}\n style={inputStyle}\n {...other}\n >\n {startAdornment && (\n <div className={withBaseName(\"startAdornmentContainer\")}>\n {startAdornment}\n </div>\n )}\n <input\n aria-describedby={clsx(formFieldDescribedBy, inputDescribedBy)}\n aria-labelledby={clsx(formFieldLabelledBy, inputLabelledBy)}\n className={clsx(withBaseName(\"input\"), inputProps?.className)}\n disabled={isDisabled}\n id={id}\n readOnly={isReadOnly}\n ref={inputRef}\n role={role}\n tabIndex={isReadOnly || isDisabled ? -1 : 0}\n onBlur={handleBlur}\n onChange={handleChange}\n onFocus={!isDisabled ? handleFocus : undefined}\n placeholder={placeholder}\n value={value}\n {...restA11yProps}\n {...restInputProps}\n required={isRequired}\n />\n {!isDisabled && !isReadOnly && validationStatus && (\n <StatusAdornment status={validationStatus} />\n )}\n {endAdornment && (\n <div className={withBaseName(\"endAdornmentContainer\")}>\n {endAdornment}\n </div>\n )}\n <div className={withBaseName(\"activationIndicator\")} />\n </div>\n );\n});\n"],"names":["Input","inputCss","value"],"mappings":";;;;;;;;;;;;;;;;AAmBA,MAAM,YAAA,GAAe,aAAa,WAAW,CAAA,CAAA;AA+ChC,MAAA,KAAA,GAAQ,UAAuC,CAAA,SAASA,MACnE,CAAA;AAAA,EACE,uBAAyB,EAAA,oBAAA;AAAA,EACzB,eAAiB,EAAA,YAAA;AAAA,EACjB,WAAa,EAAA,QAAA;AAAA,EACb,SAAW,EAAA,aAAA;AAAA,EACX,QAAA;AAAA,EACA,mBAAsB,GAAA,QAAA;AAAA,EACtB,YAAA;AAAA,EACA,EAAA;AAAA,EACA,aAAa,EAAC;AAAA,EACd,QAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAU,EAAA,YAAA;AAAA,EACV,IAAA;AAAA,EACA,cAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAY,GAAA,M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ACR,QAAU,EAAA,YAAA;AAAA,QACV,OAAA,EAAS,CAAC,UAAA,GAAa,WAAc,GAAA,KAAA,CAAA;AAAA,QACrC,WAAA;AAAA,QACA,KAAA;AAAA,QACC,GAAG,aAAA;AAAA,QACH,GAAG,cAAA;AAAA,QACJ,QAAU,EAAA,UAAA;AAAA,OACZ,CAAA;AAAA,MACC,CAAC,UAAA,IAAc,CAAC,UAAA,IAAc,oCAC5B,GAAA,CAAA,eAAA,EAAA;AAAA,QAAgB,MAAQ,EAAA,gBAAA;AAAA,OAAkB,CAAA;AAAA,MAE5C,gCACE,GAAA,CAAA,KAAA,EAAA;AAAA,QAAI,SAAA,EAAW,aAAa,uBAAuB,CAAA;AAAA,QACjD,QAAA,EAAA,YAAA;AAAA,OACH,CAAA;AAAA,sBAED,GAAA,CAAA,KAAA,EAAA;AAAA,QAAI,SAAA,EAAW,aAAa,qBAAqB,CAAA;AAAA,OAAG,CAAA;AAAA,KAAA;AAAA,GACvD,CAAA,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var css_248z = "/* Styles applied to RadioButton container */\n.saltRadioButton {\n display: flex;\n gap: var(--salt-
|
|
1
|
+
var css_248z = "/* Styles applied to RadioButton container */\n.saltRadioButton {\n display: flex;\n gap: var(--salt-spacing-100);\n position: relative;\n user-select: none;\n cursor: pointer;\n}\n\n/* Styles applied when RadioButton is disabled */\n.saltRadioButton-disabled {\n color: var(--salt-text-primary-foreground-disabled);\n cursor: var(--salt-selectable-cursor-disabled);\n pointer-events: visible;\n}\n\n/* Styles applied to input component */\n.saltRadioButton-input {\n cursor: inherit;\n position: absolute;\n opacity: 0;\n top: 0;\n left: 0;\n margin: 0;\n padding: 0;\n z-index: var(--salt-zIndex-default);\n}\n\n/* Styles applied to icon when :focus-visible */\n.saltRadioButton-input:focus-visible + .saltRadioButtonIcon {\n outline: var(--saltRadioButton-outline, var(--salt-focused-outline));\n outline-offset: var(--salt-focused-outlineOffset);\n}\n";
|
|
2
2
|
|
|
3
3
|
export { css_248z as default };
|
|
4
4
|
//# sourceMappingURL=RadioButton.css.js.map
|
|
@@ -12,22 +12,26 @@ import { RadioButtonIcon } from './RadioButtonIcon.js';
|
|
|
12
12
|
import css_248z from './RadioButton.css.js';
|
|
13
13
|
import { useWindow } from '@salt-ds/window';
|
|
14
14
|
import { useComponentCssInjection } from '@salt-ds/styles';
|
|
15
|
+
import '../form-field-context/FormFieldContext.js';
|
|
16
|
+
import { useFormFieldProps } from '../form-field-context/useFormFieldProps.js';
|
|
15
17
|
|
|
16
18
|
const withBaseName = makePrefixer("saltRadioButton");
|
|
17
19
|
const RadioButton = forwardRef(
|
|
18
20
|
function RadioButton2(props, ref) {
|
|
21
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
19
22
|
const {
|
|
20
23
|
checked: checkedProp,
|
|
21
24
|
className,
|
|
22
|
-
disabled,
|
|
25
|
+
disabled: disabledProp,
|
|
23
26
|
error,
|
|
24
|
-
inputProps,
|
|
27
|
+
inputProps = {},
|
|
25
28
|
label,
|
|
26
29
|
name: nameProp,
|
|
27
30
|
onFocus,
|
|
28
31
|
onBlur,
|
|
29
32
|
onChange,
|
|
30
33
|
value,
|
|
34
|
+
validationStatus: validationStatusProp,
|
|
31
35
|
...rest
|
|
32
36
|
} = props;
|
|
33
37
|
const targetWindow = useWindow();
|
|
@@ -36,7 +40,19 @@ const RadioButton = forwardRef(
|
|
|
36
40
|
css: css_248z,
|
|
37
41
|
window: targetWindow
|
|
38
42
|
});
|
|
43
|
+
const {
|
|
44
|
+
a11yProps: formFieldA11yProps,
|
|
45
|
+
disabled: formFieldDisabled,
|
|
46
|
+
validationStatus: formFieldValidationStatus
|
|
47
|
+
} = useFormFieldProps();
|
|
39
48
|
const radioGroup = useRadioGroup();
|
|
49
|
+
const {
|
|
50
|
+
"aria-describedby": inputDescribedBy,
|
|
51
|
+
"aria-labelledby": inputLabelledBy,
|
|
52
|
+
...restInputProps
|
|
53
|
+
} = inputProps;
|
|
54
|
+
const disabled = (_b = (_a = radioGroup.disabled) != null ? _a : formFieldDisabled) != null ? _b : disabledProp;
|
|
55
|
+
const validationStatus = !disabled ? (_d = (_c = radioGroup.validationStatus) != null ? _c : formFieldValidationStatus) != null ? _d : validationStatusProp : void 0;
|
|
40
56
|
const radioGroupChecked = radioGroup.value != null && value != null ? radioGroup.value === value : checkedProp;
|
|
41
57
|
const name = nameProp != null ? nameProp : radioGroup.name;
|
|
42
58
|
const [checked, setCheckedState] = useControlled({
|
|
@@ -46,17 +62,20 @@ const RadioButton = forwardRef(
|
|
|
46
62
|
state: "checked"
|
|
47
63
|
});
|
|
48
64
|
const handleChange = (event) => {
|
|
49
|
-
var
|
|
65
|
+
var _a2;
|
|
50
66
|
const newChecked = event.target.checked;
|
|
51
67
|
setCheckedState(newChecked);
|
|
52
68
|
onChange == null ? void 0 : onChange(event);
|
|
53
|
-
(
|
|
69
|
+
(_a2 = radioGroup.onChange) == null ? void 0 : _a2.call(radioGroup, event);
|
|
54
70
|
};
|
|
55
71
|
return /* @__PURE__ */ jsxs("label", {
|
|
56
72
|
className: clsx(
|
|
57
73
|
withBaseName(),
|
|
58
74
|
{
|
|
59
|
-
[withBaseName("disabled")]: disabled
|
|
75
|
+
[withBaseName("disabled")]: disabled,
|
|
76
|
+
[withBaseName("error")]: error,
|
|
77
|
+
[withBaseName(validationStatus || "")]: validationStatus,
|
|
78
|
+
[withBaseName("error")]: error
|
|
60
79
|
},
|
|
61
80
|
className
|
|
62
81
|
),
|
|
@@ -64,8 +83,16 @@ const RadioButton = forwardRef(
|
|
|
64
83
|
...rest,
|
|
65
84
|
children: [
|
|
66
85
|
/* @__PURE__ */ jsx("input", {
|
|
86
|
+
"aria-describedby": clsx(
|
|
87
|
+
(_f = (_e = radioGroup.a11yProps) == null ? void 0 : _e["aria-describedby"]) != null ? _f : formFieldA11yProps == null ? void 0 : formFieldA11yProps["aria-describedby"],
|
|
88
|
+
inputDescribedBy
|
|
89
|
+
),
|
|
90
|
+
"aria-labelledby": clsx(
|
|
91
|
+
(_h = (_g = radioGroup.a11yProps) == null ? void 0 : _g["aria-labelledby"]) != null ? _h : formFieldA11yProps == null ? void 0 : formFieldA11yProps["aria-labelledby"],
|
|
92
|
+
inputLabelledBy
|
|
93
|
+
),
|
|
67
94
|
className: withBaseName("input"),
|
|
68
|
-
...
|
|
95
|
+
...restInputProps,
|
|
69
96
|
checked,
|
|
70
97
|
disabled,
|
|
71
98
|
name,
|
|
@@ -77,8 +104,9 @@ const RadioButton = forwardRef(
|
|
|
77
104
|
}),
|
|
78
105
|
/* @__PURE__ */ jsx(RadioButtonIcon, {
|
|
79
106
|
checked,
|
|
80
|
-
|
|
81
|
-
|
|
107
|
+
disabled,
|
|
108
|
+
validationStatus,
|
|
109
|
+
error
|
|
82
110
|
}),
|
|
83
111
|
label
|
|
84
112
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioButton.js","sources":["../src/radio-button/RadioButton.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport {\n ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n HTMLAttributes,\n InputHTMLAttributes,\n ReactNode,\n} from \"react\";\nimport { makePrefixer, useControlled } from \"../utils\";\nimport { useRadioGroup } from \"./internal/useRadioGroup\";\nimport { RadioButtonIcon } from \"./RadioButtonIcon\";\n\nimport radioButtonCss from \"./RadioButton.css\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\n\nconst withBaseName = makePrefixer(\"saltRadioButton\");\n\nexport interface RadioButtonProps\n extends Omit<\n HTMLAttributes<HTMLLabelElement>,\n \"onChange\" | \"onBlur\" | \"onFocus\"\n > {\n /**\n * Set the default selected radio button in the group\n */\n checked?: boolean;\n /**\n * Set the disabled state\n */\n disabled?: boolean;\n /**\n * Set the error state\n */\n error?: boolean;\n /**\n * Props to be passed to the radio input\n */\n inputProps?: Partial<InputHTMLAttributes<HTMLInputElement>>;\n /**\n * The label to be shown next to the radio icon\n */\n label?: ReactNode;\n /**\n * Name of the radio group\n */\n name?: string;\n /**\n * Callback for blur event\n */\n onBlur?: FocusEventHandler<HTMLInputElement>;\n /**\n * Callback for change event\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Callback for focus event\n */\n onFocus?: FocusEventHandler<HTMLInputElement>;\n /**\n * Value of radio button\n */\n value?: string;\n}\n\nexport const RadioButton = forwardRef<HTMLLabelElement, RadioButtonProps>(\n function RadioButton(props, ref) {\n const {\n checked: checkedProp,\n className,\n disabled,\n error,\n inputProps,\n label,\n name: nameProp,\n onFocus,\n onBlur,\n onChange,\n value,\n ...rest\n } = props;\n\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-radio-button\",\n css: radioButtonCss,\n window: targetWindow,\n });\n\n const radioGroup = useRadioGroup();\n\n const radioGroupChecked =\n radioGroup.value != null && value != null\n ? radioGroup.value === value\n : checkedProp;\n const name = nameProp ?? radioGroup.name;\n\n const [checked, setCheckedState] = useControlled({\n controlled: radioGroupChecked,\n default: Boolean(checkedProp),\n name: \"RadioBase\",\n state: \"checked\",\n });\n\n const handleChange: ChangeEventHandler<HTMLInputElement> = (event) => {\n const newChecked = event.target.checked;\n setCheckedState(newChecked);\n\n onChange?.(event);\n radioGroup.onChange?.(event);\n };\n\n return (\n <label\n className={clsx(\n withBaseName(),\n {\n [withBaseName(\"disabled\")]: disabled,\n },\n className\n )}\n ref={ref}\n {...rest}\n >\n <input\n className={withBaseName(\"input\")}\n {...
|
|
1
|
+
{"version":3,"file":"RadioButton.js","sources":["../src/radio-button/RadioButton.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport {\n ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n HTMLAttributes,\n InputHTMLAttributes,\n ReactNode,\n} from \"react\";\nimport { makePrefixer, useControlled } from \"../utils\";\nimport { useRadioGroup } from \"./internal/useRadioGroup\";\nimport { RadioButtonIcon } from \"./RadioButtonIcon\";\n\nimport radioButtonCss from \"./RadioButton.css\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useFormFieldProps } from \"../form-field-context\";\nimport { AdornmentValidationStatus } from \"../status-adornment\";\n\nconst withBaseName = makePrefixer(\"saltRadioButton\");\n\nexport interface RadioButtonProps\n extends Omit<\n HTMLAttributes<HTMLLabelElement>,\n \"onChange\" | \"onBlur\" | \"onFocus\"\n > {\n /**\n * Set the default selected radio button in the group\n */\n checked?: boolean;\n /**\n * Set the disabled state\n */\n disabled?: boolean;\n /**\n * **Deprecated**: Use validationStatus instead\n * Set the error state\n */\n error?: boolean;\n /**\n * Props to be passed to the radio input\n */\n inputProps?: Partial<InputHTMLAttributes<HTMLInputElement>>;\n /**\n * The label to be shown next to the radio icon\n */\n label?: ReactNode;\n /**\n * Name of the radio group\n */\n name?: string;\n /**\n * Callback for blur event\n */\n onBlur?: FocusEventHandler<HTMLInputElement>;\n /**\n * Callback for change event\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Callback for focus event\n */\n onFocus?: FocusEventHandler<HTMLInputElement>;\n /**\n * Value of radio button\n */\n value?: string;\n /**\n * Validation status, one of \"warning\" | \"error\" | \"success\"\n *\n * RadioButton has styling variants for \"error\" and \"warning\".\n * No visual styling will be applied on \"success\" variant.\n */\n validationStatus?: AdornmentValidationStatus;\n}\n\nexport const RadioButton = forwardRef<HTMLLabelElement, RadioButtonProps>(\n function RadioButton(props, ref) {\n const {\n checked: checkedProp,\n className,\n disabled: disabledProp,\n error,\n inputProps = {},\n label,\n name: nameProp,\n onFocus,\n onBlur,\n onChange,\n value,\n validationStatus: validationStatusProp,\n ...rest\n } = props;\n\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-radio-button\",\n css: radioButtonCss,\n window: targetWindow,\n });\n\n const {\n a11yProps: formFieldA11yProps,\n disabled: formFieldDisabled,\n validationStatus: formFieldValidationStatus,\n } = useFormFieldProps();\n\n const radioGroup = useRadioGroup();\n\n const {\n \"aria-describedby\": inputDescribedBy,\n \"aria-labelledby\": inputLabelledBy,\n ...restInputProps\n } = inputProps;\n\n const disabled = radioGroup.disabled ?? formFieldDisabled ?? disabledProp;\n const validationStatus = !disabled\n ? radioGroup.validationStatus ??\n formFieldValidationStatus ??\n validationStatusProp\n : undefined;\n\n const radioGroupChecked =\n radioGroup.value != null && value != null\n ? radioGroup.value === value\n : checkedProp;\n const name = nameProp ?? radioGroup.name;\n\n const [checked, setCheckedState] = useControlled({\n controlled: radioGroupChecked,\n default: Boolean(checkedProp),\n name: \"RadioBase\",\n state: \"checked\",\n });\n\n const handleChange: ChangeEventHandler<HTMLInputElement> = (event) => {\n const newChecked = event.target.checked;\n setCheckedState(newChecked);\n\n onChange?.(event);\n radioGroup.onChange?.(event);\n };\n\n return (\n <label\n className={clsx(\n withBaseName(),\n {\n [withBaseName(\"disabled\")]: disabled,\n [withBaseName(\"error\")]: error /* **Deprecated** */,\n [withBaseName(validationStatus || \"\")]: validationStatus,\n [withBaseName(\"error\")]: error,\n },\n className\n )}\n ref={ref}\n {...rest}\n >\n <input\n aria-describedby={clsx(\n radioGroup.a11yProps?.[\"aria-describedby\"] ??\n formFieldA11yProps?.[\"aria-describedby\"],\n inputDescribedBy\n )}\n aria-labelledby={clsx(\n radioGroup.a11yProps?.[\"aria-labelledby\"] ??\n formFieldA11yProps?.[\"aria-labelledby\"],\n inputLabelledBy\n )}\n className={withBaseName(\"input\")}\n {...restInputProps}\n checked={checked}\n disabled={disabled}\n name={name}\n value={value}\n onBlur={onBlur}\n onChange={handleChange}\n onFocus={onFocus}\n type=\"radio\"\n />\n <RadioButtonIcon\n checked={checked}\n disabled={disabled}\n validationStatus={validationStatus}\n error={error}\n />\n {label}\n </label>\n );\n }\n);\n"],"names":["RadioButton","radioButtonCss","_a"],"mappings":";;;;;;;;;;;;;;;;;AAmBA,MAAM,YAAA,GAAe,aAAa,iBAAiB,CAAA,CAAA;AAy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-1,4 +1,4 @@
|
|
|
1
|
-
var css_248z = "/* Styles applied to root element */\n.saltRadioButtonGroup {\n border: none;\n margin: 0;\n padding: 0;\n}\n\n/* Styles applied when direction is vertical */\n.saltRadioButtonGroup-vertical {\n display: flex;\n gap: var(--salt-
|
|
1
|
+
var css_248z = "/* Styles applied to root element */\n.saltRadioButtonGroup {\n border: none;\n margin: 0;\n padding: 0;\n}\n\n/* Styles applied when direction is vertical */\n.saltRadioButtonGroup-vertical {\n display: flex;\n gap: var(--salt-spacing-100);\n flex-direction: column;\n}\n\n/* Styles applied when direction is horizontal */\n.saltRadioButtonGroup-horizontal {\n display: flex;\n gap: var(--salt-spacing-200);\n flex-direction: row;\n flex-wrap: wrap;\n}\n\n.saltRadioButtonGroup-noWrap {\n flex-wrap: nowrap;\n}\n.saltRadioButtonGroup-noWrap .saltRadioButton {\n white-space: break-spaces;\n}\n\n/* Styles applied to radio group's legend */\n.saltRadioButtonGroup-legend {\n display: inline-block;\n font-size: var(--formFieldLegacy-label-fontSize); /* TODO: V2 Form Field work */\n color: var(--salt-text-primary-foreground);\n margin-bottom: var(--salt-spacing-200);\n}\n";
|
|
2
2
|
|
|
3
3
|
export { css_248z as default };
|
|
4
4
|
//# sourceMappingURL=RadioButtonGroup.css.js.map
|
|
@@ -11,6 +11,8 @@ import { RadioGroupContext } from './internal/RadioGroupContext.js';
|
|
|
11
11
|
import css_248z from './RadioButtonGroup.css.js';
|
|
12
12
|
import { useWindow } from '@salt-ds/window';
|
|
13
13
|
import { useComponentCssInjection } from '@salt-ds/styles';
|
|
14
|
+
import '../form-field-context/FormFieldContext.js';
|
|
15
|
+
import { useFormFieldProps } from '../form-field-context/useFormFieldProps.js';
|
|
14
16
|
|
|
15
17
|
const withBaseName = makePrefixer("saltRadioButtonGroup");
|
|
16
18
|
const RadioButtonGroup = forwardRef(function RadioButtonGroup2(props, ref) {
|
|
@@ -19,10 +21,12 @@ const RadioButtonGroup = forwardRef(function RadioButtonGroup2(props, ref) {
|
|
|
19
21
|
className,
|
|
20
22
|
defaultValue,
|
|
21
23
|
direction = "vertical",
|
|
24
|
+
disabled: disabledProp,
|
|
22
25
|
wrap = true,
|
|
23
26
|
name: nameProp,
|
|
24
27
|
onChange,
|
|
25
28
|
value: valueProp,
|
|
29
|
+
validationStatus: validationStatusProp,
|
|
26
30
|
...rest
|
|
27
31
|
} = props;
|
|
28
32
|
const targetWindow = useWindow();
|
|
@@ -31,6 +35,13 @@ const RadioButtonGroup = forwardRef(function RadioButtonGroup2(props, ref) {
|
|
|
31
35
|
css: css_248z,
|
|
32
36
|
window: targetWindow
|
|
33
37
|
});
|
|
38
|
+
const {
|
|
39
|
+
a11yProps,
|
|
40
|
+
disabled: formFieldDisabled,
|
|
41
|
+
validationStatus: formFieldValidationStatus
|
|
42
|
+
} = useFormFieldProps();
|
|
43
|
+
const disabled = formFieldDisabled != null ? formFieldDisabled : disabledProp;
|
|
44
|
+
const validationStatus = formFieldValidationStatus != null ? formFieldValidationStatus : validationStatusProp;
|
|
34
45
|
const [value, setStateValue] = useControlled({
|
|
35
46
|
controlled: valueProp,
|
|
36
47
|
default: defaultValue,
|
|
@@ -55,7 +66,14 @@ const RadioButtonGroup = forwardRef(function RadioButtonGroup2(props, ref) {
|
|
|
55
66
|
ref,
|
|
56
67
|
...rest,
|
|
57
68
|
children: /* @__PURE__ */ jsx(RadioGroupContext.Provider, {
|
|
58
|
-
value: {
|
|
69
|
+
value: {
|
|
70
|
+
a11yProps,
|
|
71
|
+
disabled,
|
|
72
|
+
name,
|
|
73
|
+
onChange: handleChange,
|
|
74
|
+
validationStatus,
|
|
75
|
+
value
|
|
76
|
+
},
|
|
59
77
|
children
|
|
60
78
|
})
|
|
61
79
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioButtonGroup.js","sources":["../src/radio-button/RadioButtonGroup.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport {\n ChangeEventHandler,\n ComponentPropsWithoutRef,\n forwardRef,\n} from \"react\";\nimport { makePrefixer, useControlled, useId } from \"../utils\";\nimport { RadioGroupContext } from \"./internal/RadioGroupContext\";\n\nimport radioButtonGroupCss from \"./RadioButtonGroup.css\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\n\nconst withBaseName = makePrefixer(\"saltRadioButtonGroup\");\n\nexport interface RadioButtonGroupProps\n extends Omit<ComponentPropsWithoutRef<\"fieldset\">, \"onChange\"> {\n /**\n * Set the selected value when initialized.\n */\n defaultValue?: string;\n /**\n * Set the group direction.\n */\n direction?: \"horizontal\" | \"vertical\";\n /**\n * Only for horizontal direction. When `true` the text in radio button label will wrap to fit within the container. Otherwise the radio buttons will wrap onto the next line.\n */\n wrap?: boolean;\n /**\n * The name to be set on each radio button within the group. If not set, then one will be generated for you.\n */\n name?: string;\n /**\n * Callback for change event.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * The value of the radio group, required for a controlled component.\n */\n value?: string;\n}\n\nexport const RadioButtonGroup = forwardRef<\n HTMLFieldSetElement,\n RadioButtonGroupProps\n>(function RadioButtonGroup(props, ref) {\n const {\n children,\n className,\n defaultValue,\n direction = \"vertical\",\n wrap = true,\n name: nameProp,\n onChange,\n value: valueProp,\n ...rest\n } = props;\n\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-radio-button-group\",\n css: radioButtonGroupCss,\n window: targetWindow,\n });\n\n const [value, setStateValue] = useControlled({\n controlled: valueProp,\n default: defaultValue,\n state: \"value\",\n name: \"RadioButtonGroup\",\n });\n\n const handleChange: ChangeEventHandler<HTMLInputElement> = (event) => {\n setStateValue(event.target.value);\n onChange?.(event);\n };\n\n const name = useId(nameProp);\n\n return (\n <fieldset\n className={clsx(\n withBaseName(),\n withBaseName(direction),\n {\n [withBaseName(\"noWrap\")]: !wrap,\n },\n className\n )}\n data-testid=\"radio-button-group\"\n ref={ref}\n {...rest}\n >\n <RadioGroupContext.Provider\n value={{
|
|
1
|
+
{"version":3,"file":"RadioButtonGroup.js","sources":["../src/radio-button/RadioButtonGroup.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport {\n ChangeEventHandler,\n ComponentPropsWithoutRef,\n forwardRef,\n} from \"react\";\nimport { makePrefixer, useControlled, useId } from \"../utils\";\nimport { RadioGroupContext } from \"./internal/RadioGroupContext\";\n\nimport radioButtonGroupCss from \"./RadioButtonGroup.css\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useFormFieldProps } from \"../form-field-context\";\n\nconst withBaseName = makePrefixer(\"saltRadioButtonGroup\");\n\nexport interface RadioButtonGroupProps\n extends Omit<ComponentPropsWithoutRef<\"fieldset\">, \"onChange\"> {\n /**\n * Set the selected value when initialized.\n */\n defaultValue?: string;\n /**\n * Set the group direction.\n */\n direction?: \"horizontal\" | \"vertical\";\n /**\n * Disable the RadioButton group\n */\n disabled?: boolean;\n /**\n * Only for horizontal direction. When `true` the text in radio button label will wrap to fit within the container. Otherwise the radio buttons will wrap onto the next line.\n */\n wrap?: boolean;\n /**\n * The name to be set on each radio button within the group. If not set, then one will be generated for you.\n */\n name?: string;\n /**\n * Callback for change event.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * The value of the radio group, required for a controlled component.\n */\n value?: string;\n /**\n * Validation status.\n */\n validationStatus?: \"error\" | \"warning\";\n}\n\nexport const RadioButtonGroup = forwardRef<\n HTMLFieldSetElement,\n RadioButtonGroupProps\n>(function RadioButtonGroup(props, ref) {\n const {\n children,\n className,\n defaultValue,\n direction = \"vertical\",\n disabled: disabledProp,\n wrap = true,\n name: nameProp,\n onChange,\n value: valueProp,\n validationStatus: validationStatusProp,\n ...rest\n } = props;\n\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-radio-button-group\",\n css: radioButtonGroupCss,\n window: targetWindow,\n });\n\n const {\n a11yProps,\n disabled: formFieldDisabled,\n validationStatus: formFieldValidationStatus,\n } = useFormFieldProps();\n\n const disabled = formFieldDisabled ?? disabledProp;\n const validationStatus = formFieldValidationStatus ?? validationStatusProp;\n\n const [value, setStateValue] = useControlled({\n controlled: valueProp,\n default: defaultValue,\n state: \"value\",\n name: \"RadioButtonGroup\",\n });\n\n const handleChange: ChangeEventHandler<HTMLInputElement> = (event) => {\n setStateValue(event.target.value);\n onChange?.(event);\n };\n\n const name = useId(nameProp);\n\n return (\n <fieldset\n className={clsx(\n withBaseName(),\n withBaseName(direction),\n {\n [withBaseName(\"noWrap\")]: !wrap,\n },\n className\n )}\n data-testid=\"radio-button-group\"\n ref={ref}\n {...rest}\n >\n <RadioGroupContext.Provider\n value={{\n a11yProps,\n disabled,\n name,\n onChange: handleChange,\n validationStatus,\n value,\n }}\n >\n {children}\n </RadioGroupContext.Provider>\n </fieldset>\n );\n});\n"],"names":["RadioButtonGroup","radioButtonGroupCss"],"mappings":";;;;;;;;;;;;;;;;AAcA,MAAM,YAAA,GAAe,aAAa,sBAAsB,CAAA,CAAA;AAsCjD,MAAM,gBAAmB,GAAA,UAAA,CAG9B,SAASA,iBAAAA,CAAiB,OAAO,GAAK,EAAA;AACtC,EAAM,MAAA;AAAA,IACJ,QAAA;AAAA,IACA,SAAA;AAAA,IACA,YAAA;AAAA,IACA,SAAY,GAAA,UAAA;AAAA,IACZ,QAAU,EAAA,YAAA;AAAA,IACV,IAAO,GAAA,IAAA;AAAA,IACP,IAAM,EAAA,QAAA;AAAA,IACN,QAAA;AAAA,IACA,KAAO,EAAA,SAAA;AAAA,IACP,gBAAkB,EAAA,oBAAA;AAAA,IACf,GAAA,IAAA;AAAA,GACD,GAAA,KAAA,CAAA;AAEJ,EAAA,MAAM,eAAe,SAAU,EAAA,CAAA;AAC/B,EAAyB,wBAAA,CAAA;AAAA,IACvB,MAAQ,EAAA,yBAAA;AAAA,IACR,GAAK,EAAAC,QAAA;AAAA,IACL,MAAQ,EAAA,YAAA;AAAA,GACT,CAAA,CAAA;AAED,EAAM,MAAA;AAA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AA,QACA,KAAA;AAAA,OACF;AAAA,MAEC,QAAA;AAAA,KACH,CAAA;AAAA,GACF,CAAA,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var css_248z = "/* Styles applied to radio button icon */\n.saltRadioButtonIcon {\n width: var(--salt-size-selectable);\n height: var(--salt-size-selectable);\n border-radius: 50%;\n flex: none;\n margin-top: var(--salt-size-border);\n}\n\n/* Styles applied to radio button icon circle */\n.saltRadioButtonIcon-circle {\n fill: var(--saltRadioButton-icon-fill, var(--salt-container-primary-background));\n stroke: var(--saltRadioButton-icon-stroke, var(--salt-selectable-foreground));\n stroke-width: var(--salt-size-border);\n}\n\n/* Styles applied to radio button icon on hover */\n.saltRadioButton:hover .saltRadioButtonIcon-circle {\n fill: var(--saltRadioButton-icon-hover-fill, var(--salt-selectable-background-hover));\n stroke: var(--saltRadioButton-icon-stroke-hover, var(--salt-selectable-foreground-hover));\n}\n\n/* Styles applied to radio button icon if checked */\n.saltRadioButtonIcon-checked .saltRadioButtonIcon-circle,\n.saltRadioButton:hover .saltRadioButtonIcon-checked .saltRadioButtonIcon-circle {\n fill: var(--saltRadioButton-icon-checked-fill, var(--salt-selectable-foreground-selected));\n stroke: var(--saltRadioButton-icon-checked-stroke, var(--salt-selectable-foreground-selected));\n}\n\n/* Styles applied to radio button icon if disabled */\n.saltRadioButtonIcon-disabled .saltRadioButtonIcon-circle,\n.saltRadioButton:hover .saltRadioButtonIcon-disabled .saltRadioButtonIcon-circle {\n fill: var(--saltRadioButton-icon-disabled-fill, var(--salt-selectable-background));\n stroke: var(--saltRadioButton-icon-disabled-stroke, var(--salt-selectable-foreground-disabled));\n}\n\n/* Styles applied to radio button icon if checked and disabled */\n.saltRadioButtonIcon-disabled.saltRadioButtonIcon-checked .saltRadioButtonIcon-circle,\n.saltRadioButton:hover .saltRadioButtonIcon-disabled.saltRadioButtonIcon-checked .saltRadioButtonIcon-circle {\n fill: var(--saltRadioButton-icon-checked-disabled-fill, var(--salt-container-primary-background-disabled));\n stroke: var(--saltRadioButton-icon-checked-disabled-stroke, var(--salt-selectable-foreground-selectedDisabled));\n stroke-width: calc(var(--salt-size-border) * 6.5);\n}\n\n/* Styles applied to radio button icon with error */\n.saltRadioButtonIcon-error .saltRadioButtonIcon-circle,\n.saltRadioButton:hover .saltRadioButtonIcon-error .saltRadioButtonIcon-circle {\n stroke: var(--saltRadioButton-icon-error-stroke, var(--salt-status-error-foreground));\n}\n\n.saltRadioButton:hover .saltRadioButtonIcon-error .saltRadioButtonIcon-circle {\n fill: var(--saltRadioButton-icon-error-hover-fill, var(--salt-status-error-background));\n}\n\n/* Styles applied to radio button icon
|
|
1
|
+
var css_248z = "/* Styles applied to radio button icon */\n.saltRadioButtonIcon {\n width: var(--salt-size-selectable);\n height: var(--salt-size-selectable);\n border-radius: 50%;\n flex: none;\n margin-top: var(--salt-size-border);\n}\n\n/* Styles applied to radio button icon circle */\n.saltRadioButtonIcon-circle {\n fill: var(--saltRadioButton-icon-fill, var(--salt-container-primary-background));\n stroke: var(--saltRadioButton-icon-stroke, var(--salt-selectable-foreground));\n stroke-width: var(--salt-size-border);\n}\n\n/* Styles applied to radio button icon on hover */\n.saltRadioButton:hover .saltRadioButtonIcon-circle {\n fill: var(--saltRadioButton-icon-hover-fill, var(--salt-selectable-background-hover));\n stroke: var(--saltRadioButton-icon-stroke-hover, var(--salt-selectable-foreground-hover));\n}\n\n/* Styles applied to radio button icon if checked */\n.saltRadioButtonIcon-checked .saltRadioButtonIcon-circle,\n.saltRadioButton:hover .saltRadioButtonIcon-checked .saltRadioButtonIcon-circle {\n fill: var(--saltRadioButton-icon-checked-fill, var(--salt-selectable-foreground-selected));\n stroke: var(--saltRadioButton-icon-checked-stroke, var(--salt-selectable-foreground-selected));\n}\n\n/* Styles applied to radio button icon if disabled */\n.saltRadioButtonIcon-disabled .saltRadioButtonIcon-circle,\n.saltRadioButton:hover .saltRadioButtonIcon-disabled .saltRadioButtonIcon-circle {\n fill: var(--saltRadioButton-icon-disabled-fill, var(--salt-selectable-background));\n stroke: var(--saltRadioButton-icon-disabled-stroke, var(--salt-selectable-foreground-disabled));\n}\n\n/* Styles applied to radio button icon if checked and disabled */\n.saltRadioButtonIcon-disabled.saltRadioButtonIcon-checked .saltRadioButtonIcon-circle,\n.saltRadioButton:hover .saltRadioButtonIcon-disabled.saltRadioButtonIcon-checked .saltRadioButtonIcon-circle {\n fill: var(--saltRadioButton-icon-checked-disabled-fill, var(--salt-container-primary-background-disabled));\n stroke: var(--saltRadioButton-icon-checked-disabled-stroke, var(--salt-selectable-foreground-selectedDisabled));\n stroke-width: calc(var(--salt-size-border) * 6.5);\n}\n\n/* Styles applied to radio button icon with `validationStatus=\"error\"` */\n.saltRadioButtonIcon-error .saltRadioButtonIcon-circle,\n.saltRadioButton:hover .saltRadioButtonIcon-error .saltRadioButtonIcon-circle {\n stroke: var(--saltRadioButton-icon-error-stroke, var(--salt-status-error-foreground));\n}\n\n.saltRadioButton:hover .saltRadioButtonIcon-error .saltRadioButtonIcon-circle {\n fill: var(--saltRadioButton-icon-error-hover-fill, var(--salt-status-error-background));\n}\n\n/* Styles applied to radio button icon when checked and with `validationStatus=\"error\"` */\n.saltRadioButtonIcon-checked.saltRadioButtonIcon-error .saltRadioButtonIcon-circle,\n.saltRadioButton:hover .saltRadioButtonIcon-checked.saltRadioButtonIcon-error .saltRadioButtonIcon-circle {\n fill: var(--saltRadioButton-icon-error-fill, var(--salt-status-error-foreground));\n stroke: var(--saltRadioButton-icon-error-stroke, var(--salt-status-error-foreground));\n}\n\n/* Styles applied to radio button icon with `validationStatus=\"warning\"` */\n.saltRadioButtonIcon-warning .saltRadioButtonIcon-circle,\n.saltRadioButton:hover .saltRadioButtonIcon-warning .saltRadioButtonIcon-circle {\n stroke: var(--saltRadioButton-icon-warning-stroke, var(--salt-status-warning-foreground));\n}\n\n.saltRadioButton:hover .saltRadioButtonIcon-warning .saltRadioButtonIcon-circle {\n fill: var(--saltRadioButton-icon-warning-hover-fill, var(--salt-status-warning-background));\n}\n\n/* Styles applied to radio button icon when checked and with `validationStatus=\"warning\"` */\n.saltRadioButtonIcon-checked.saltRadioButtonIcon-warning .saltRadioButtonIcon-circle,\n.saltRadioButton:hover .saltRadioButtonIcon-checked.saltRadioButtonIcon-warning .saltRadioButtonIcon-circle {\n fill: var(--saltRadioButton-icon-warning-fill, var(--salt-status-warning-foreground));\n stroke: var(--saltRadioButton-icon-warning-stroke, var(--salt-status-warning-foreground));\n}\n\n/* Styles applied to checked inner circle */\n.saltRadioButtonIcon-checked-circle {\n fill: var(--saltRadioButton-icon-inner-fill, var(--salt-container-primary-background));\n}\n\n/* Styles applied to checked inner circle when disabled */\n.saltRadioButtonIcon-disabled .saltRadioButtonIcon-checked-circle {\n fill: var(--saltRadioButton-icon-inner-disabled-fill, var(--salt-container-primary-background-disabled));\n}\n";
|
|
2
2
|
|
|
3
3
|
export { css_248z as default };
|
|
4
4
|
//# sourceMappingURL=RadioButtonIcon.css.js.map
|
|
@@ -6,15 +6,16 @@ import '../utils/useId.js';
|
|
|
6
6
|
import '../salt-provider/SaltProvider.js';
|
|
7
7
|
import '../viewport/ViewportProvider.js';
|
|
8
8
|
import { clsx } from 'clsx';
|
|
9
|
-
import css_248z from './RadioButtonIcon.css.js';
|
|
10
9
|
import { useComponentCssInjection } from '@salt-ds/styles';
|
|
11
10
|
import { useWindow } from '@salt-ds/window';
|
|
11
|
+
import css_248z from './RadioButtonIcon.css.js';
|
|
12
12
|
|
|
13
13
|
const withBaseName = makePrefixer("saltRadioButtonIcon");
|
|
14
14
|
const RadioButtonIcon = ({
|
|
15
15
|
checked,
|
|
16
16
|
error,
|
|
17
|
-
disabled
|
|
17
|
+
disabled,
|
|
18
|
+
validationStatus
|
|
18
19
|
}) => {
|
|
19
20
|
const targetWindow = useWindow();
|
|
20
21
|
useComponentCssInjection({
|
|
@@ -26,7 +27,8 @@ const RadioButtonIcon = ({
|
|
|
26
27
|
className: clsx(withBaseName(), {
|
|
27
28
|
[withBaseName("checked")]: checked,
|
|
28
29
|
[withBaseName("error")]: error,
|
|
29
|
-
[withBaseName("disabled")]: disabled
|
|
30
|
+
[withBaseName("disabled")]: disabled,
|
|
31
|
+
[withBaseName(validationStatus || "")]: validationStatus
|
|
30
32
|
}),
|
|
31
33
|
height: "14",
|
|
32
34
|
viewBox: "0 0 14 14",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioButtonIcon.js","sources":["../src/radio-button/RadioButtonIcon.tsx"],"sourcesContent":["import { makePrefixer } from \"../utils\";\nimport { clsx } from \"clsx\";\nimport
|
|
1
|
+
{"version":3,"file":"RadioButtonIcon.js","sources":["../src/radio-button/RadioButtonIcon.tsx"],"sourcesContent":["import { makePrefixer } from \"../utils\";\nimport { clsx } from \"clsx\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { AdornmentValidationStatus } from \"../status-adornment\";\nimport radioButtonIconCss from \"./RadioButtonIcon.css\";\n\nconst withBaseName = makePrefixer(\"saltRadioButtonIcon\");\n\nexport interface RadioButtonIconProps {\n checked?: boolean;\n error?: boolean;\n disabled?: boolean;\n validationStatus?: AdornmentValidationStatus;\n}\n\n/**\n * Default radio icon\n */\nexport const RadioButtonIcon = ({\n checked,\n error,\n disabled,\n validationStatus,\n}: RadioButtonIconProps) => {\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-radio-button-icon\",\n css: radioButtonIconCss,\n window: targetWindow,\n });\n return (\n <svg\n className={clsx(withBaseName(), {\n [withBaseName(\"checked\")]: checked,\n [withBaseName(\"error\")]: error,\n [withBaseName(\"disabled\")]: disabled,\n [withBaseName(validationStatus || \"\")]: validationStatus,\n })}\n height=\"14\"\n viewBox=\"0 0 14 14\"\n width=\"14\"\n >\n <circle className={withBaseName(\"circle\")} cx=\"7\" cy=\"7\" r=\"6.5\" />\n {checked && (\n <circle\n className={withBaseName(\"checked-circle\")}\n cx=\"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AAA,GAAA;AAAA,QACH,CAAE,EAAA,KAAA;AAAA,OACJ,CAAA;AAAA,KAAA;AAAA,GAEJ,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroupContext.js","sources":["../src/radio-button/internal/RadioGroupContext.tsx"],"sourcesContent":["import { ChangeEventHandler } from \"react\";\nimport { createContext } from \"../../utils\";\n\nexport interface RadioGroupContextValue {\n name?: string;\n value?: string;\n onChange?: ChangeEventHandler<HTMLElement>;\n}\n\nexport const RadioGroupContext = createContext<RadioGroupContextValue>(\n \"RadioGroupContext\",\n {}\n);\n"],"names":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"RadioGroupContext.js","sources":["../src/radio-button/internal/RadioGroupContext.tsx"],"sourcesContent":["import { ChangeEventHandler } from \"react\";\nimport { a11yValueAriaProps } from \"../../form-field-context\";\nimport { AdornmentValidationStatus } from \"../../status-adornment\";\nimport { createContext } from \"../../utils\";\n\nexport interface RadioGroupContextValue {\n a11yProps?: a11yValueAriaProps;\n disabled?: boolean;\n name?: string;\n value?: string;\n onChange?: ChangeEventHandler<HTMLElement>;\n validationStatus?: AdornmentValidationStatus;\n}\n\nexport const RadioGroupContext = createContext<RadioGroupContextValue>(\n \"RadioGroupContext\",\n {}\n);\n"],"names":[],"mappings":";;;;;;;;AAcO,MAAM,iBAAoB,GAAA,aAAA;AAAA,EAC/B,mBAAA;AAAA,EACA,EAAC;AACH;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var css_248z = ".saltStatusAdornment {\n fill: var(--saltStatusAdornment-color, var(--statusAdornment-color));\n
|
|
1
|
+
var css_248z = ".saltStatusAdornment {\n display: inline-block;\n fill: var(--saltStatusAdornment-color, var(--statusAdornment-color));\n height: var(--salt-icon-size-status-adornment);\n min-height: var(--salt-icon-size-status-adornment);\n padding-left: var(--salt-spacing-100);\n position: relative;\n}\n\n.saltStatusAdornment-error {\n --statusAdornment-color: var(--salt-status-error-foreground);\n}\n\n.saltStatusAdornment-warning {\n --statusAdornment-color: var(--salt-status-warning-foreground);\n}\n\n.saltStatusAdornment-success {\n --statusAdornment-color: var(--salt-status-success-foreground);\n}\n";
|
|
2
2
|
|
|
3
3
|
export { css_248z as default };
|
|
4
4
|
//# sourceMappingURL=StatusAdornment.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusAdornment.js","sources":["../src/status-adornment/StatusAdornment.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { forwardRef } from \"react\";\nimport { IconProps } from \"@salt-ds/icons\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { ValidationStatus } from \"../status-indicator\";\nimport { makePrefixer } from \"../utils\";\nimport { ErrorAdornmentIcon } from \"./ErrorAdornment\";\nimport { SuccessAdornmentIcon } from \"./SuccessAdornment\";\nimport { WarningAdornmentIcon } from \"./WarningAdornment\";\n\nimport statusAdornmentCss from \"./StatusAdornment.css\";\n\nconst icons = {\n error: ErrorAdornmentIcon,\n warning: WarningAdornmentIcon,\n success: SuccessAdornmentIcon,\n};\n\
|
|
1
|
+
{"version":3,"file":"StatusAdornment.js","sources":["../src/status-adornment/StatusAdornment.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { forwardRef } from \"react\";\nimport { IconProps } from \"@salt-ds/icons\";\nimport { useComponentCssInjection } from \"@salt-ds/styles\";\nimport { useWindow } from \"@salt-ds/window\";\nimport { ValidationStatus } from \"../status-indicator\";\nimport { makePrefixer } from \"../utils\";\nimport { ErrorAdornmentIcon } from \"./ErrorAdornment\";\nimport { SuccessAdornmentIcon } from \"./SuccessAdornment\";\nimport { WarningAdornmentIcon } from \"./WarningAdornment\";\n\nimport statusAdornmentCss from \"./StatusAdornment.css\";\n\nconst icons = {\n error: ErrorAdornmentIcon,\n warning: WarningAdornmentIcon,\n success: SuccessAdornmentIcon,\n};\n\nexport type AdornmentValidationStatus = Exclude<ValidationStatus, \"info\">;\n\nexport interface StatusAdornmentProps extends IconProps {\n /**\n * Status adornment to be displayed.\n */\n status: AdornmentValidationStatus;\n}\n\nconst statusToAriaLabelMap: Record<AdornmentValidationStatus, string> = {\n error: \"error\",\n warning: \"warning\",\n success: \"success\",\n};\n\nconst withBaseName = makePrefixer(\"saltStatusAdornment\");\n\nexport const StatusAdornment = forwardRef<SVGSVGElement, StatusAdornmentProps>(\n function StatusAdornment({ className, status, ...restProps }, ref) {\n const AdornmentComponent = icons[status];\n const ariaLabel = statusToAriaLabelMap[status];\n\n const targetWindow = useWindow();\n useComponentCssInjection({\n testId: \"salt-status-adornment\",\n css: statusAdornmentCss,\n window: targetWindow,\n });\n\n return (\n <AdornmentComponent\n className={clsx(withBaseName(), withBaseName(status), className)}\n aria-label={ariaLabel}\n {...restProps}\n ref={ref}\n />\n );\n }\n);\n"],"names":["StatusAdornment","statusAdornmentCss"],"mappings":";;;;;;;;;;;;;;;AAaA,MAAM,KAAQ,GAAA;AAAA,EACZ,KAAO,EAAA,kBAAA;AAAA,EACP,OAAS,EAAA,oBAAA;AAAA,EACT,OAAS,EAAA,oBAAA;AACX,CAAA,CAAA;AAWA,MAAM,oBAAkE,GAAA;AAAA,EACtE,KAAO,EAAA,OAAA;AAAA,EACP,OAAS,EAAA,SAAA;AAAA,EACT,OAAS,EAAA,SAAA;AACX,CAAA,CAAA;AAEA,MAAM,YAAA,GAAe,aAAa,qBAAqB,CAAA,CAAA;AAEhD,MAAM,eAAkB,GAAA,UAAA;AAAA,EAC7B,SAASA,gBAAgB,CAAA,EAAE,WAAW,MAAW,EAAA,GAAA,SAAA,IAAa,GAAK,EAAA;AACjE,IAAA,MAAM,qBAAqB,KAAM,CAAA,MAAA,CAAA,CAAA;AACjC,IAAA,MAAM,YAAY,oBAAqB,CAAA,MAAA,CAAA,CAAA;AAEvC,IAAA,MAAM,eAAe,SAAU,EAAA,CAAA;AAC/B,IAAyB,wBAAA,CAAA;AAAA,MACvB,MAAQ,EAAA,uBAAA;AAAA,MACR,GAAK,EAAAC,QAAA;AAAA,MACL,MAAQ,EAAA,YAAA;AAAA,KACT,CAAA,CAAA;AAED,IAAA,uBACG,GAAA,CAAA,kBAAA,EAAA;AAAA,MACC,WAAW,IAAK,CAAA,YAAA,IAAgB,YAAa,CAAA,MAAM,GAAG,SAAS,CAAA;AAAA,MAC/D,YAAY,EAAA,SAAA;AAAA,MACX,GAAG,SAAA;AAAA,MACJ,GAAA;AAAA,KACF,CAAA,CAAA;AAAA,GAEJ;AACF;;;;"}
|