@elliemae/ds-form-toggle 3.80.0-next.72 → 3.80.0-next.76
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/config/useDSControlledToggle.js +3 -2
- package/dist/cjs/config/useDSControlledToggle.js.map +2 -2
- package/dist/cjs/config/useGetButtonProps.js +49 -11
- package/dist/cjs/config/useGetButtonProps.js.map +2 -2
- package/dist/cjs/constants/index.js +1 -0
- package/dist/cjs/constants/index.js.map +2 -2
- package/dist/cjs/parts/Button.js +3 -2
- package/dist/cjs/parts/Button.js.map +2 -2
- package/dist/cjs/parts/Container.js +32 -4
- package/dist/cjs/parts/Container.js.map +2 -2
- package/dist/cjs/parts/styles/styles.js +29 -24
- package/dist/cjs/parts/styles/styles.js.map +2 -2
- package/dist/cjs/parts/wcagViolation/Button.wcagViolationLabels.js +12 -2
- package/dist/cjs/parts/wcagViolation/Button.wcagViolationLabels.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +15 -3
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/typescript-testing/form-toggle-typescript-valid.js +24 -1
- package/dist/cjs/typescript-testing/form-toggle-typescript-valid.js.map +3 -3
- package/dist/cjs/typescript-testing/slot-props.js +2 -0
- package/dist/cjs/typescript-testing/slot-props.js.map +2 -2
- package/dist/esm/config/useDSControlledToggle.js +3 -2
- package/dist/esm/config/useDSControlledToggle.js.map +2 -2
- package/dist/esm/config/useGetButtonProps.js +49 -11
- package/dist/esm/config/useGetButtonProps.js.map +2 -2
- package/dist/esm/constants/index.js +1 -0
- package/dist/esm/constants/index.js.map +2 -2
- package/dist/esm/parts/Button.js +3 -2
- package/dist/esm/parts/Button.js.map +2 -2
- package/dist/esm/parts/Container.js +34 -6
- package/dist/esm/parts/Container.js.map +2 -2
- package/dist/esm/parts/styles/styles.js +30 -25
- package/dist/esm/parts/styles/styles.js.map +2 -2
- package/dist/esm/parts/wcagViolation/Button.wcagViolationLabels.js +12 -2
- package/dist/esm/parts/wcagViolation/Button.wcagViolationLabels.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +15 -3
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/typescript-testing/form-toggle-typescript-valid.js +24 -1
- package/dist/esm/typescript-testing/form-toggle-typescript-valid.js.map +3 -3
- package/dist/esm/typescript-testing/slot-props.js +2 -0
- package/dist/esm/typescript-testing/slot-props.js.map +2 -2
- package/dist/types/constants/index.d.ts +2 -0
- package/dist/types/parts/styles/styles.d.ts +4 -0
- package/dist/types/react-desc-prop-types.d.ts +4 -0
- package/package.json +8 -8
|
@@ -41,15 +41,16 @@ var import_useValidateProps = require("./useValidateProps.js");
|
|
|
41
41
|
const useDSControlledToggle = (propsFromUser) => {
|
|
42
42
|
const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(propsFromUser, import_react_desc_prop_types.defaultProps);
|
|
43
43
|
(0, import_useValidateProps.useValidateProps)(propsWithDefault, import_react_desc_prop_types.DSControlledTogglePropTypes);
|
|
44
|
-
const { disabled, applyAriaDisabled, readOnly, onChange } = propsWithDefault;
|
|
44
|
+
const { disabled, applyAriaDisabled, readOnly, onChange, onValueChange, checked } = propsWithDefault;
|
|
45
45
|
const handleOnClick = (0, import_react.useCallback)(
|
|
46
46
|
(e) => {
|
|
47
47
|
if (disabled || applyAriaDisabled || readOnly) return;
|
|
48
48
|
if (onChange) {
|
|
49
49
|
onChange(e);
|
|
50
50
|
}
|
|
51
|
+
onValueChange?.(!checked, e);
|
|
51
52
|
},
|
|
52
|
-
[disabled, applyAriaDisabled, readOnly, onChange]
|
|
53
|
+
[disabled, applyAriaDisabled, readOnly, onChange, onValueChange, checked]
|
|
53
54
|
);
|
|
54
55
|
const globalProps = (0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefault, {
|
|
55
56
|
onClick: handleOnClick
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useDSControlledToggle.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport React, { useCallback } from 'react';\nimport { uid } from 'uid';\nimport { type DSControlledToggleT, DSControlledTogglePropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useGetButtonProps } from './useGetButtonProps.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface ControlledToggleCTX {\n propsWithDefault: DSControlledToggleT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n buttonProps: ReturnType<typeof useGetButtonProps>;\n handleOnClick: (e: React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n}\n\nexport const useDSControlledToggle = (propsFromUser: DSControlledToggleT.Props): ControlledToggleCTX => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSControlledToggleT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSControlledTogglePropTypes);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n const { disabled, applyAriaDisabled, readOnly, onChange } = propsWithDefault;\n const handleOnClick = useCallback(\n (e: React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n if (disabled || applyAriaDisabled || readOnly) return;\n if (onChange) {\n onChange(e);\n }\n },\n [disabled, applyAriaDisabled, readOnly, onChange],\n );\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = useGetGlobalAttributes<DSControlledToggleT.InternalProps>(propsWithDefault, {\n onClick: handleOnClick,\n });\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n const { id } = propsWithDefault;\n const instanceUid = React.useMemo(() => id || `ds-form-toggle-${uid(5)}`, [id]);\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n const buttonProps = useGetButtonProps({\n handleOnClick,\n globalProps,\n instanceUid,\n propsWithDefault,\n });\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n buttonProps,\n handleOnClick,\n }),\n [propsWithDefault, globalProps, buttonProps, xstyledProps, instanceUid, handleOnClick],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAAyF;AACzF,mBAAmC;AACnC,iBAAoB;AACpB,mCAAoF;AACpF,+BAAkC;AAClC,8BAAiC;AAW1B,MAAM,wBAAwB,CAAC,kBAAkE;AAItG,QAAM,uBAAmB,sDAAgE,eAAe,yCAAY;AACpH,gDAAiB,kBAAkB,wDAA2B;AAI9D,QAAM,EAAE,UAAU,mBAAmB,UAAU,
|
|
4
|
+
"sourcesContent": ["import { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport React, { useCallback } from 'react';\nimport { uid } from 'uid';\nimport { type DSControlledToggleT, DSControlledTogglePropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useGetButtonProps } from './useGetButtonProps.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface ControlledToggleCTX {\n propsWithDefault: DSControlledToggleT.InternalProps;\n globalProps: ReturnType<typeof useGetGlobalAttributes>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n buttonProps: ReturnType<typeof useGetButtonProps>;\n handleOnClick: (e: React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n}\n\nexport const useDSControlledToggle = (propsFromUser: DSControlledToggleT.Props): ControlledToggleCTX => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSControlledToggleT.InternalProps>(propsFromUser, defaultProps);\n useValidateProps(propsWithDefault, DSControlledTogglePropTypes);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n const { disabled, applyAriaDisabled, readOnly, onChange, onValueChange, checked } = propsWithDefault;\n const handleOnClick = useCallback(\n (e: React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n if (disabled || applyAriaDisabled || readOnly) return;\n if (onChange) {\n onChange(e);\n }\n // the toggle is controlled: the new state is always the opposite of the current `checked`\n onValueChange?.(!checked, e);\n },\n [disabled, applyAriaDisabled, readOnly, onChange, onValueChange, checked],\n );\n // =============================================================================\n // GLOBAL ATTRIBUTES & XSTYLED PROPS\n // =============================================================================\n const globalProps = useGetGlobalAttributes<DSControlledToggleT.InternalProps>(propsWithDefault, {\n onClick: handleOnClick,\n });\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n const { id } = propsWithDefault;\n const instanceUid = React.useMemo(() => id || `ds-form-toggle-${uid(5)}`, [id]);\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n const buttonProps = useGetButtonProps({\n handleOnClick,\n globalProps,\n instanceUid,\n propsWithDefault,\n });\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n globalProps,\n xstyledProps,\n instanceUid,\n buttonProps,\n handleOnClick,\n }),\n [propsWithDefault, globalProps, buttonProps, xstyledProps, instanceUid, handleOnClick],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAAyF;AACzF,mBAAmC;AACnC,iBAAoB;AACpB,mCAAoF;AACpF,+BAAkC;AAClC,8BAAiC;AAW1B,MAAM,wBAAwB,CAAC,kBAAkE;AAItG,QAAM,uBAAmB,sDAAgE,eAAe,yCAAY;AACpH,gDAAiB,kBAAkB,wDAA2B;AAI9D,QAAM,EAAE,UAAU,mBAAmB,UAAU,UAAU,eAAe,QAAQ,IAAI;AACpF,QAAM,oBAAgB;AAAA,IACpB,CAAC,MAAgG;AAC/F,UAAI,YAAY,qBAAqB,SAAU;AAC/C,UAAI,UAAU;AACZ,iBAAS,CAAC;AAAA,MACZ;AAEA,sBAAgB,CAAC,SAAS,CAAC;AAAA,IAC7B;AAAA,IACA,CAAC,UAAU,mBAAmB,UAAU,UAAU,eAAe,OAAO;AAAA,EAC1E;AAIA,QAAM,kBAAc,gDAA0D,kBAAkB;AAAA,IAC9F,SAAS;AAAA,EACX,CAAC;AACD,QAAM,mBAAe,4CAAmB,gBAAgB;AACxD,QAAM,EAAE,GAAG,IAAI;AACf,QAAM,cAAc,aAAAA,QAAM,QAAQ,MAAM,MAAM,sBAAkB,gBAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;AAI9E,QAAM,kBAAc,4CAAkB;AAAA,IACpC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,aAAa,aAAa,cAAc,aAAa,aAAa;AAAA,EACvF;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -32,30 +32,68 @@ __export(useGetButtonProps_exports, {
|
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(useGetButtonProps_exports);
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
35
36
|
var import_react = require("react");
|
|
36
37
|
var import_constants = require("../constants/index.js");
|
|
37
38
|
const useGetButtonProps = (config) => {
|
|
38
39
|
const { globalProps, instanceUid, handleOnClick, propsWithDefault } = config;
|
|
39
|
-
const { checked, disabled, applyAriaDisabled, readOnly } = propsWithDefault;
|
|
40
|
-
const {
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
const { checked, disabled, applyAriaDisabled, readOnly, hasError, makeSubmittable } = propsWithDefault;
|
|
41
|
+
const {
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
43
|
+
size: _sizeCleanFromRest,
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
45
|
+
shape: _shapeCleanFromRest,
|
|
46
|
+
"aria-describedby": consumerAriaDescribedBy,
|
|
47
|
+
...restGlobalProps
|
|
48
|
+
} = globalProps;
|
|
49
|
+
const baseAriaDescribedBy = consumerAriaDescribedBy ?? `${instanceUid}_feedback_message ${instanceUid}_error_message`;
|
|
50
|
+
const ariaDescribedBy = readOnly ? `${baseAriaDescribedBy} ${instanceUid}-read-only-helper-msg` : baseAriaDescribedBy;
|
|
51
|
+
const buttonProps = (0, import_react.useMemo)(() => {
|
|
52
|
+
const buttonGlobalProps = { ...restGlobalProps };
|
|
53
|
+
if (makeSubmittable) {
|
|
54
|
+
delete buttonGlobalProps.name;
|
|
55
|
+
delete buttonGlobalProps.value;
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
43
58
|
role: "switch",
|
|
44
59
|
"data-testid": import_constants.CONTROLLED_TOGGLE_DATA_TESTID.TOGGLE_CHECKBOX,
|
|
45
60
|
id: instanceUid,
|
|
46
|
-
"aria-readonly
|
|
47
|
-
"
|
|
61
|
+
// readOnly and applyAriaDisabled are synonyms here: both emit aria-disabled="true", never aria-readonly.
|
|
62
|
+
// "disabled" stays native only (no aria-disabled).
|
|
48
63
|
"aria-checked": checked,
|
|
49
|
-
"aria-describedby":
|
|
64
|
+
"aria-describedby": ariaDescribedBy,
|
|
65
|
+
// only present when there is an error, so the markup of toggles without error does not change
|
|
66
|
+
...hasError ? { "aria-invalid": true } : {},
|
|
50
67
|
readOnly,
|
|
51
68
|
disabled,
|
|
52
|
-
|
|
69
|
+
// passed to DSButton so its own gate covers the consumer pointer/key handlers spread through restGlobalProps
|
|
70
|
+
applyAriaDisabled,
|
|
71
|
+
...buttonGlobalProps,
|
|
72
|
+
// after the spread: a soft lock prints "true" whatever the consumer passes, a natively disabled toggle prints none of
|
|
73
|
+
// its own, otherwise the consumer's own aria-disabled passes through (inversion of control)
|
|
74
|
+
// The key is always present (even when undefined) so it overrides DSButton's own aria-disabled.
|
|
75
|
+
"aria-disabled": (0, import_ds_props_helpers.resolveAriaDisabled)({
|
|
76
|
+
disabled,
|
|
77
|
+
softLocked: applyAriaDisabled || readOnly,
|
|
78
|
+
consumerValue: restGlobalProps["aria-disabled"]
|
|
79
|
+
}),
|
|
53
80
|
type: "button",
|
|
54
81
|
buttonType: "raw",
|
|
82
|
+
// replaces the consumer onClick (pre-existing: it is never called); handleOnClick gates onChange on all three props
|
|
55
83
|
onClick: handleOnClick
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
84
|
+
};
|
|
85
|
+
}, [
|
|
86
|
+
instanceUid,
|
|
87
|
+
readOnly,
|
|
88
|
+
disabled,
|
|
89
|
+
applyAriaDisabled,
|
|
90
|
+
checked,
|
|
91
|
+
hasError,
|
|
92
|
+
makeSubmittable,
|
|
93
|
+
restGlobalProps,
|
|
94
|
+
ariaDescribedBy,
|
|
95
|
+
handleOnClick
|
|
96
|
+
]);
|
|
59
97
|
return buttonProps;
|
|
60
98
|
};
|
|
61
99
|
//# sourceMappingURL=useGetButtonProps.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useGetButtonProps.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type { GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport { useMemo } from 'react';\nimport { CONTROLLED_TOGGLE_DATA_TESTID } from '../constants/index.js';\nimport { type DSControlledToggleT } from '../react-desc-prop-types.js';\n\ninterface UseGetButtonPropsConfigT {\n handleOnClick: (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;\n globalProps: GlobalAttributesT<HTMLButtonElement>;\n propsWithDefault: DSControlledToggleT.InternalProps;\n instanceUid: string;\n}\nexport const useGetButtonProps = (config: UseGetButtonPropsConfigT): DSControlledToggleT.ButtonV3InherithedProps => {\n const { globalProps, instanceUid, handleOnClick, propsWithDefault } = config;\n const { checked, disabled, applyAriaDisabled, readOnly } = propsWithDefault;\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAwB;AACxB,uBAA8C;AASvC,MAAM,oBAAoB,CAAC,WAAkF;AAClH,QAAM,EAAE,aAAa,aAAa,eAAe,iBAAiB,IAAI;AACtE,QAAM,EAAE,SAAS,UAAU,mBAAmB,
|
|
4
|
+
"sourcesContent": ["import type { GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport { resolveAriaDisabled } from '@elliemae/ds-props-helpers';\nimport { useMemo } from 'react';\nimport { CONTROLLED_TOGGLE_DATA_TESTID } from '../constants/index.js';\nimport { type DSControlledToggleT } from '../react-desc-prop-types.js';\n\ninterface UseGetButtonPropsConfigT {\n handleOnClick: (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;\n globalProps: GlobalAttributesT<HTMLButtonElement>;\n propsWithDefault: DSControlledToggleT.InternalProps;\n instanceUid: string;\n}\nexport const useGetButtonProps = (config: UseGetButtonPropsConfigT): DSControlledToggleT.ButtonV3InherithedProps => {\n const { globalProps, instanceUid, handleOnClick, propsWithDefault } = config;\n const { checked, disabled, applyAriaDisabled, readOnly, hasError, makeSubmittable } = propsWithDefault;\n\n const {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n size: _sizeCleanFromRest,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n shape: _shapeCleanFromRest,\n 'aria-describedby': consumerAriaDescribedBy,\n ...restGlobalProps\n } = globalProps;\n // CONVENTION (not a bug): `${instanceUid}_feedback_message` and `${instanceUid}_error_message` are NOT rendered by the\n // toggle. They are the ids DSFormLayoutBlockItem always renders from its `inputID` prop (a StyledMessage /\n // StyledErrorMessage when there is a feedback / validation message, an empty ScreenReaderOnly otherwise, see\n // ds-form-layout-blocks DSFormLayoutBlockItem.tsx). When the toggle sits in a block item whose `inputID` equals the\n // toggle `id`, these references resolve to the block item's messages; outside a block item they have no element to\n // point at and are simply skipped when the description is computed. DSInputText follows the same convention.\n // A consumer aria-describedby replaces those ids (unchanged behaviour); readOnly appends the \"Read only\" helper\n // rendered by Container, so both the consumer ids and the helper are announced.\n const baseAriaDescribedBy = consumerAriaDescribedBy ?? `${instanceUid}_feedback_message ${instanceUid}_error_message`;\n const ariaDescribedBy = readOnly ? `${baseAriaDescribedBy} ${instanceUid}-read-only-helper-msg` : baseAriaDescribedBy;\n const buttonProps: DSControlledToggleT.ButtonV3InherithedProps = useMemo(() => {\n // when the toggle is submittable the hidden input is the one that carries name and value, the button must not\n const buttonGlobalProps = { ...restGlobalProps };\n if (makeSubmittable) {\n delete buttonGlobalProps.name;\n delete buttonGlobalProps.value;\n }\n return {\n role: 'switch',\n 'data-testid': CONTROLLED_TOGGLE_DATA_TESTID.TOGGLE_CHECKBOX,\n id: instanceUid,\n // readOnly and applyAriaDisabled are synonyms here: both emit aria-disabled=\"true\", never aria-readonly.\n // \"disabled\" stays native only (no aria-disabled).\n 'aria-checked': checked,\n 'aria-describedby': ariaDescribedBy,\n // only present when there is an error, so the markup of toggles without error does not change\n ...(hasError ? { 'aria-invalid': true } : {}),\n readOnly,\n disabled,\n // passed to DSButton so its own gate covers the consumer pointer/key handlers spread through restGlobalProps\n applyAriaDisabled,\n ...buttonGlobalProps,\n // after the spread: a soft lock prints \"true\" whatever the consumer passes, a natively disabled toggle prints none of\n // its own, otherwise the consumer's own aria-disabled passes through (inversion of control)\n // The key is always present (even when undefined) so it overrides DSButton's own aria-disabled.\n 'aria-disabled': resolveAriaDisabled({\n disabled,\n softLocked: applyAriaDisabled || readOnly,\n consumerValue: restGlobalProps['aria-disabled'],\n }),\n type: 'button',\n buttonType: 'raw',\n // replaces the consumer onClick (pre-existing: it is never called); handleOnClick gates onChange on all three props\n onClick: handleOnClick,\n };\n }, [\n instanceUid,\n readOnly,\n disabled,\n applyAriaDisabled,\n checked,\n hasError,\n makeSubmittable,\n restGlobalProps,\n ariaDescribedBy,\n handleOnClick,\n ]);\n return buttonProps;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BAAoC;AACpC,mBAAwB;AACxB,uBAA8C;AASvC,MAAM,oBAAoB,CAAC,WAAkF;AAClH,QAAM,EAAE,aAAa,aAAa,eAAe,iBAAiB,IAAI;AACtE,QAAM,EAAE,SAAS,UAAU,mBAAmB,UAAU,UAAU,gBAAgB,IAAI;AAEtF,QAAM;AAAA;AAAA,IAEJ,MAAM;AAAA;AAAA,IAEN,OAAO;AAAA,IACP,oBAAoB;AAAA,IACpB,GAAG;AAAA,EACL,IAAI;AASJ,QAAM,sBAAsB,2BAA2B,GAAG,WAAW,qBAAqB,WAAW;AACrG,QAAM,kBAAkB,WAAW,GAAG,mBAAmB,IAAI,WAAW,0BAA0B;AAClG,QAAM,kBAA2D,sBAAQ,MAAM;AAE7E,UAAM,oBAAoB,EAAE,GAAG,gBAAgB;AAC/C,QAAI,iBAAiB;AACnB,aAAO,kBAAkB;AACzB,aAAO,kBAAkB;AAAA,IAC3B;AACA,WAAO;AAAA,MACL,MAAM;AAAA,MACN,eAAe,+CAA8B;AAAA,MAC7C,IAAI;AAAA;AAAA;AAAA,MAGJ,gBAAgB;AAAA,MAChB,oBAAoB;AAAA;AAAA,MAEpB,GAAI,WAAW,EAAE,gBAAgB,KAAK,IAAI,CAAC;AAAA,MAC3C;AAAA,MACA;AAAA;AAAA,MAEA;AAAA,MACA,GAAG;AAAA;AAAA;AAAA;AAAA,MAIH,qBAAiB,6CAAoB;AAAA,QACnC;AAAA,QACA,YAAY,qBAAqB;AAAA,QACjC,eAAe,gBAAgB,eAAe;AAAA,MAChD,CAAC;AAAA,MACD,MAAM;AAAA,MACN,YAAY;AAAA;AAAA,MAEZ,SAAS;AAAA,IACX;AAAA,EACF,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -41,6 +41,7 @@ const CONTROLLED_TOGGLE_SLOTS = {
|
|
|
41
41
|
BUTTON_CONTENT_WRAPPER: "button-content-wrapper",
|
|
42
42
|
CIRCLE: "circle",
|
|
43
43
|
TEXT_WRAPPER: "text-wrapper",
|
|
44
|
+
HIDDEN_INPUT: "hidden-input",
|
|
44
45
|
// legacy ones...
|
|
45
46
|
CONTROLLED_CONTAINER: "controlled-container",
|
|
46
47
|
// in other components this is the ROOT
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/constants/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSControlledToggleName = 'DSFormtoggle';\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const CONTROLLED_TOGGLE_SLOTS = {\n BUTTON_CONTENT_WRAPPER: 'button-content-wrapper',\n CIRCLE: 'circle',\n TEXT_WRAPPER: 'text-wrapper',\n // legacy ones...\n CONTROLLED_CONTAINER: 'controlled-container', // in other components this is the ROOT\n TOGGLE_CHECKBOX: 'toggle-checkbox',\n} as const;\n\n// we are giving \"component_name_data_testid\" to avoid errors on duplicate exports variables in aggregators\nexport const CONTROLLED_TOGGLE_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSControlledToggleName, CONTROLLED_TOGGLE_SLOTS),\n CONTROLLED_CONTAINER: 'ds-controlled-toggle', // in other components this is the ROOT\n TOGGLE_CHECKBOX: 'ds-controlled-toggle-checkbox',\n};\n\n// Specific of the toggle component\n\nexport const TOGGLE_SIZES = {\n SMALL: 's',\n MEDIUM: 'm',\n LARGE: 'l',\n} as const;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,yBAAyB;AAG/B,MAAM,0BAA0B;AAAA,EACrC,wBAAwB;AAAA,EACxB,QAAQ;AAAA,EACR,cAAc;AAAA;AAAA,EAEd,sBAAsB;AAAA;AAAA,EACtB,iBAAiB;AACnB;AAGO,MAAM,gCAAgC;AAAA,EAC3C,OAAG,0CAAwB,wBAAwB,uBAAuB;AAAA,EAC1E,sBAAsB;AAAA;AAAA,EACtB,iBAAiB;AACnB;AAIO,MAAM,eAAe;AAAA,EAC1B,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AACT;",
|
|
4
|
+
"sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSControlledToggleName = 'DSFormtoggle';\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const CONTROLLED_TOGGLE_SLOTS = {\n BUTTON_CONTENT_WRAPPER: 'button-content-wrapper',\n CIRCLE: 'circle',\n TEXT_WRAPPER: 'text-wrapper',\n HIDDEN_INPUT: 'hidden-input',\n // legacy ones...\n CONTROLLED_CONTAINER: 'controlled-container', // in other components this is the ROOT\n TOGGLE_CHECKBOX: 'toggle-checkbox',\n} as const;\n\n// we are giving \"component_name_data_testid\" to avoid errors on duplicate exports variables in aggregators\nexport const CONTROLLED_TOGGLE_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSControlledToggleName, CONTROLLED_TOGGLE_SLOTS),\n CONTROLLED_CONTAINER: 'ds-controlled-toggle', // in other components this is the ROOT\n TOGGLE_CHECKBOX: 'ds-controlled-toggle-checkbox',\n};\n\n// Specific of the toggle component\n\nexport const TOGGLE_SIZES = {\n SMALL: 's',\n MEDIUM: 'm',\n LARGE: 'l',\n} as const;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,yBAAyB;AAG/B,MAAM,0BAA0B;AAAA,EACrC,wBAAwB;AAAA,EACxB,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,cAAc;AAAA;AAAA,EAEd,sBAAsB;AAAA;AAAA,EACtB,iBAAiB;AACnB;AAGO,MAAM,gCAAgC;AAAA,EAC3C,OAAG,0CAAwB,wBAAwB,uBAAuB;AAAA,EAC1E,sBAAsB;AAAA;AAAA,EACtB,iBAAiB;AACnB;AAIO,MAAM,eAAe;AAAA,EAC1B,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/parts/Button.js
CHANGED
|
@@ -45,18 +45,18 @@ const widthSizeMap = {
|
|
|
45
45
|
};
|
|
46
46
|
const Button = () => {
|
|
47
47
|
const { propsWithDefault, buttonProps } = import_react.default.useContext(import_DSControlledToggleCTX.ControlledToggleContext);
|
|
48
|
-
const { checked, size, disabled, applyAriaDisabled, readOnly, innerRef } = propsWithDefault;
|
|
48
|
+
const { checked, size, disabled, applyAriaDisabled, readOnly, hasError, innerRef } = propsWithDefault;
|
|
49
49
|
const { getOwnerProps, getOwnerPropsArguments } = (0, import_ds_props_helpers.useOwnerProps)(propsWithDefault);
|
|
50
50
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51
51
|
import_styles.StyledButton,
|
|
52
52
|
{
|
|
53
|
-
...readOnly ? { "aria-readonly": "true" } : {},
|
|
54
53
|
...buttonProps,
|
|
55
54
|
innerRef,
|
|
56
55
|
$checked: checked,
|
|
57
56
|
$readOnly: readOnly,
|
|
58
57
|
$disabled: disabled,
|
|
59
58
|
$applyAriaDisabled: applyAriaDisabled,
|
|
59
|
+
$hasError: hasError,
|
|
60
60
|
getOwnerProps,
|
|
61
61
|
getOwnerPropsArguments,
|
|
62
62
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
@@ -75,6 +75,7 @@ const Button = () => {
|
|
|
75
75
|
$disabled: disabled,
|
|
76
76
|
$readOnly: readOnly,
|
|
77
77
|
$applyAriaDisabled: applyAriaDisabled,
|
|
78
|
+
$hasError: hasError,
|
|
78
79
|
getOwnerProps,
|
|
79
80
|
getOwnerPropsArguments
|
|
80
81
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/parts/Button.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { TYPOGRAPHY_VARIANTS } from '@elliemae/ds-typography';\nimport React from 'react';\nimport { ControlledToggleContext } from '../DSControlledToggleCTX.js';\nimport { type DSControlledToggleT } from '../react-desc-prop-types.js';\nimport { StyledButton, StyledButtonContentWrapper, StyledCircle, StyledTextWrapper } from './styles/styles.js';\n\n// What is this about?\n// Currently the way the code is written for this component and the way this component UI/UX specs are handled\n// there is no defiend \"dynamic\" and \"responsive\" sizes also, the font-size are hardcoded and not aligned with typography in the different \"size\" variants.\n// In the past we accepted \"whatever\" labels for the toggle,\n// it was discarded as non compliant for the semantic of the component that only announces and accepts the \"on\" and \"off\" meaning,\n// as of today, wcag compliant way has an hardcoded \"ON\" and \"OFF\"/\n// The previous implementation was relying on a dynamic calculation of the width to keep the size of the toggle button,\n// it had it's own set of issues and was creating extra renders (see PUI-18655).\n\n// This constant is just the pre-calculated values to avoid extra javascript logic and extra renderes.\n\n// What does this means long term?\n// - When the font-size is aligned, the component specs are made responsive and the component will support \"text resize/reflow\",\n// - When the px will change to rem\n// - When the component will be updated to support \"tokens\"\n// - When/if the component will be i18n compliant and support different languages labels that are the other language version of \"on\" and \"off\" (like \"activ\u00E9\" and \"d\u00E9sactiv\u00E9\" in french)\n\n// The whole size calcualtion logic of the component needs to be reviewed and updated to not need a constant \"width\" to guarante the width to be \"the biggest of the two labels\".\n\n// The most reasonable implementation would be to:\n// - simply render both \"on\" and \"off\" in the DOM at the same time\n// - make the not active version influence the size but not visible (e.g. height:0, overflow:hidden)\n// - have the width be automatically calculated by the browser to fit the longest.\n\n// I can't implement this as part of the current ticket(PUI-16323) as that would be a visual breaking change and need coordination with QA and UX.\n\n// So, short term solution:\n// - Not responsive (in the rem, text resize WCAG sense, still is in the \"zoom\" sense as before)\n// - Not i18n compliant\n// - Not theming ready\n// Exactly as we never wrote the component to be, but at least it won't:\n// - flicker\n// - pay the cost of the WCAG non-compliant labels\n// - hide the pending issues with aproximation that \"happens to kinda fix it\"\n// Important note -> I changed the \"width\" to \"min-width\" to keep some amount of resize/reflow WCAG compliant (zoom will keep working, font size changes won't like before),\n// but true wcag compliance requires the component to use typography, be designed accordingly, written accordingly and rely on rem.\nconst widthSizeMap = {\n s: 18,\n m: 26,\n l: 36,\n} as const;\n\nexport const Button: React.ComponentType<DSControlledToggleT.Props> = () => {\n const { propsWithDefault, buttonProps } = React.useContext(ControlledToggleContext);\n const { checked, size, disabled, applyAriaDisabled, readOnly, innerRef } = propsWithDefault;\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(propsWithDefault);\n\n return (\n <StyledButton\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { TYPOGRAPHY_VARIANTS } from '@elliemae/ds-typography';\nimport React from 'react';\nimport { ControlledToggleContext } from '../DSControlledToggleCTX.js';\nimport { type DSControlledToggleT } from '../react-desc-prop-types.js';\nimport { StyledButton, StyledButtonContentWrapper, StyledCircle, StyledTextWrapper } from './styles/styles.js';\n\n// What is this about?\n// Currently the way the code is written for this component and the way this component UI/UX specs are handled\n// there is no defiend \"dynamic\" and \"responsive\" sizes also, the font-size are hardcoded and not aligned with typography in the different \"size\" variants.\n// In the past we accepted \"whatever\" labels for the toggle,\n// it was discarded as non compliant for the semantic of the component that only announces and accepts the \"on\" and \"off\" meaning,\n// as of today, wcag compliant way has an hardcoded \"ON\" and \"OFF\"/\n// The previous implementation was relying on a dynamic calculation of the width to keep the size of the toggle button,\n// it had it's own set of issues and was creating extra renders (see PUI-18655).\n\n// This constant is just the pre-calculated values to avoid extra javascript logic and extra renderes.\n\n// What does this means long term?\n// - When the font-size is aligned, the component specs are made responsive and the component will support \"text resize/reflow\",\n// - When the px will change to rem\n// - When the component will be updated to support \"tokens\"\n// - When/if the component will be i18n compliant and support different languages labels that are the other language version of \"on\" and \"off\" (like \"activ\u00E9\" and \"d\u00E9sactiv\u00E9\" in french)\n\n// The whole size calcualtion logic of the component needs to be reviewed and updated to not need a constant \"width\" to guarante the width to be \"the biggest of the two labels\".\n\n// The most reasonable implementation would be to:\n// - simply render both \"on\" and \"off\" in the DOM at the same time\n// - make the not active version influence the size but not visible (e.g. height:0, overflow:hidden)\n// - have the width be automatically calculated by the browser to fit the longest.\n\n// I can't implement this as part of the current ticket(PUI-16323) as that would be a visual breaking change and need coordination with QA and UX.\n\n// So, short term solution:\n// - Not responsive (in the rem, text resize WCAG sense, still is in the \"zoom\" sense as before)\n// - Not i18n compliant\n// - Not theming ready\n// Exactly as we never wrote the component to be, but at least it won't:\n// - flicker\n// - pay the cost of the WCAG non-compliant labels\n// - hide the pending issues with aproximation that \"happens to kinda fix it\"\n// Important note -> I changed the \"width\" to \"min-width\" to keep some amount of resize/reflow WCAG compliant (zoom will keep working, font size changes won't like before),\n// but true wcag compliance requires the component to use typography, be designed accordingly, written accordingly and rely on rem.\nconst widthSizeMap = {\n s: 18,\n m: 26,\n l: 36,\n} as const;\n\nexport const Button: React.ComponentType<DSControlledToggleT.Props> = () => {\n const { propsWithDefault, buttonProps } = React.useContext(ControlledToggleContext);\n const { checked, size, disabled, applyAriaDisabled, readOnly, hasError, innerRef } = propsWithDefault;\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(propsWithDefault);\n\n return (\n <StyledButton\n {...buttonProps}\n /**\n * PUI-14730\n * innerRef is not a global attribute, so it is not carried by buttonProps; forward it\n * explicitly to reach the underlying <button> DOM node (parity with radio/checkbox)\n */\n innerRef={innerRef}\n $checked={checked}\n $readOnly={readOnly}\n $disabled={disabled}\n $applyAriaDisabled={applyAriaDisabled}\n $hasError={hasError}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledButtonContentWrapper\n $width={widthSizeMap[size]}\n $checked={checked}\n $size={size}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledCircle\n $size={size}\n $disabled={disabled}\n $readOnly={readOnly}\n $applyAriaDisabled={applyAriaDisabled}\n $hasError={hasError}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n <StyledTextWrapper\n $size={size}\n $disabled={disabled}\n $readOnly={readOnly}\n $applyAriaDisabled={applyAriaDisabled}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n variant={TYPOGRAPHY_VARIANTS.B2}\n // this is \"okay\" in this version but not in the WCAGViolation code\n // the reason being that a role switch with proper \"aria-checked\" already announces \"on\" and \"off\" to screen readers\n // so this is just a visual representation of the state, not a semantic one\n // the WCAGViolation code is violating this contract with custom labels and they need to be announced, so they can't be hidden from screen readers\n // and they can't be considered \"presentational\" as they are meaning bearing for scenario with custom texts (which is exactly WHY role switch is wrong in that case)\n // confirmed with Juan, this avoids the \"double announcement\" issue that was happening with the previous implementation of the component\n role=\"presentation\"\n aria-hidden=\"true\"\n >\n {checked ? 'ON' : 'OFF'}\n </StyledTextWrapper>\n </StyledButtonContentWrapper>\n </StyledButton>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADuEjB;AAvEN,8BAA8B;AAC9B,2BAAoC;AACpC,mBAAkB;AAClB,mCAAwC;AAExC,oBAA0F;AAsC1F,MAAM,eAAe;AAAA,EACnB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEO,MAAM,SAAyD,MAAM;AAC1E,QAAM,EAAE,kBAAkB,YAAY,IAAI,aAAAA,QAAM,WAAW,oDAAuB;AAClF,QAAM,EAAE,SAAS,MAAM,UAAU,mBAAmB,UAAU,UAAU,SAAS,IAAI;AACrF,QAAM,EAAE,eAAe,uBAAuB,QAAI,uCAAc,gBAAgB;AAEhF,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MAMJ;AAAA,MACA,UAAU;AAAA,MACV,WAAW;AAAA,MACX,WAAW;AAAA,MACX,oBAAoB;AAAA,MACpB,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,QAAQ,aAAa,IAAI;AAAA,UACzB,UAAU;AAAA,UACV,OAAO;AAAA,UACP;AAAA,UACA;AAAA,UAEA;AAAA;AAAA,cAAC;AAAA;AAAA,gBACC,OAAO;AAAA,gBACP,WAAW;AAAA,gBACX,WAAW;AAAA,gBACX,oBAAoB;AAAA,gBACpB,WAAW;AAAA,gBACX;AAAA,gBACA;AAAA;AAAA,YACF;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACC,OAAO;AAAA,gBACP,WAAW;AAAA,gBACX,WAAW;AAAA,gBACX,oBAAoB;AAAA,gBACpB;AAAA,gBACA;AAAA,gBACA,SAAS,yCAAoB;AAAA,gBAO7B,MAAK;AAAA,gBACL,eAAY;AAAA,gBAEX,oBAAU,OAAO;AAAA;AAAA,YACpB;AAAA;AAAA;AAAA,MACF;AAAA;AAAA,EACF;AAEJ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -41,20 +41,48 @@ var import_Button = require("./Button.js");
|
|
|
41
41
|
var import_Button_wcagViolationLabels = require("./wcagViolation/Button.wcagViolationLabels.js");
|
|
42
42
|
var import_styles = require("./styles/styles.js");
|
|
43
43
|
const Container = () => {
|
|
44
|
-
const { propsWithDefault, xstyledProps } = import_react.default.useContext(import_DSControlledToggleCTX.ControlledToggleContext);
|
|
45
|
-
const {
|
|
44
|
+
const { propsWithDefault, xstyledProps, instanceUid } = import_react.default.useContext(import_DSControlledToggleCTX.ControlledToggleContext);
|
|
45
|
+
const {
|
|
46
|
+
wcagViolationLabelOn,
|
|
47
|
+
wcagViolationLabelOff,
|
|
48
|
+
size,
|
|
49
|
+
containerProps,
|
|
50
|
+
makeSubmittable,
|
|
51
|
+
checked,
|
|
52
|
+
disabled,
|
|
53
|
+
readOnly,
|
|
54
|
+
name,
|
|
55
|
+
value
|
|
56
|
+
} = propsWithDefault;
|
|
46
57
|
const { getOwnerProps, getOwnerPropsArguments } = (0, import_ds_props_helpers.useOwnerProps)(propsWithDefault);
|
|
47
58
|
const isViolationVersion = wcagViolationLabelOn || wcagViolationLabelOff;
|
|
48
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
59
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
49
60
|
import_styles.StyledContainer,
|
|
50
61
|
{
|
|
51
62
|
$size: size,
|
|
63
|
+
$disabled: Boolean(disabled),
|
|
52
64
|
"data-testid": import_constants.CONTROLLED_TOGGLE_DATA_TESTID.CONTROLLED_CONTAINER,
|
|
53
65
|
...containerProps,
|
|
54
66
|
...xstyledProps,
|
|
55
67
|
getOwnerProps,
|
|
56
68
|
getOwnerPropsArguments,
|
|
57
|
-
children:
|
|
69
|
+
children: [
|
|
70
|
+
isViolationVersion ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button_wcagViolationLabels.ButtonWCAGViolation, { ...propsWithDefault }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.Button, { ...propsWithDefault }),
|
|
71
|
+
readOnly ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { hidden: true, id: `${instanceUid}-read-only-helper-msg`, children: "Read only" }) : null,
|
|
72
|
+
makeSubmittable ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
73
|
+
import_styles.StyledHiddenInput,
|
|
74
|
+
{
|
|
75
|
+
type: "checkbox",
|
|
76
|
+
checked,
|
|
77
|
+
readOnly: true,
|
|
78
|
+
disabled,
|
|
79
|
+
name,
|
|
80
|
+
value,
|
|
81
|
+
getOwnerProps,
|
|
82
|
+
getOwnerPropsArguments
|
|
83
|
+
}
|
|
84
|
+
) : null
|
|
85
|
+
]
|
|
58
86
|
}
|
|
59
87
|
);
|
|
60
88
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/parts/Container.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport React from 'react';\nimport { CONTROLLED_TOGGLE_DATA_TESTID } from '../constants/index.js';\nimport { ControlledToggleContext } from '../DSControlledToggleCTX.js';\nimport { Button } from './Button.js';\nimport { ButtonWCAGViolation } from './wcagViolation/Button.wcagViolationLabels.js';\nimport { StyledContainer } from './styles/styles.js';\n\nexport const Container = () => {\n const { propsWithDefault, xstyledProps } = React.useContext(ControlledToggleContext);\n const {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport React from 'react';\nimport { CONTROLLED_TOGGLE_DATA_TESTID } from '../constants/index.js';\nimport { ControlledToggleContext } from '../DSControlledToggleCTX.js';\nimport { Button } from './Button.js';\nimport { ButtonWCAGViolation } from './wcagViolation/Button.wcagViolationLabels.js';\nimport { StyledContainer, StyledHiddenInput } from './styles/styles.js';\n\nexport const Container = () => {\n const { propsWithDefault, xstyledProps, instanceUid } = React.useContext(ControlledToggleContext);\n const {\n wcagViolationLabelOn,\n wcagViolationLabelOff,\n size,\n containerProps,\n makeSubmittable,\n checked,\n disabled,\n readOnly,\n name,\n value,\n } = propsWithDefault;\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(propsWithDefault);\n\n const isViolationVersion = wcagViolationLabelOn || wcagViolationLabelOff;\n\n return (\n <StyledContainer\n $size={size}\n $disabled={Boolean(disabled)}\n data-testid={CONTROLLED_TOGGLE_DATA_TESTID.CONTROLLED_CONTAINER}\n {...containerProps}\n {...xstyledProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {isViolationVersion ? <ButtonWCAGViolation {...propsWithDefault} /> : <Button {...propsWithDefault} />}\n {/* READ-ONLY helper: hidden, referenced by the button's aria-describedby. Plain element, not a slot. */}\n {readOnly ? (\n <p hidden id={`${instanceUid}-read-only-helper-msg`}>\n Read only\n </p>\n ) : null}\n {makeSubmittable ? (\n <StyledHiddenInput\n type=\"checkbox\"\n // the hidden input mirrors the toggle: the user can't interact with it, the toggle is the source of truth\n checked={checked}\n readOnly\n disabled={disabled}\n name={name}\n value={value}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n ) : null}\n </StyledContainer>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2BnB;AA3BJ,8BAA8B;AAC9B,mBAAkB;AAClB,uBAA8C;AAC9C,mCAAwC;AACxC,oBAAuB;AACvB,wCAAoC;AACpC,oBAAmD;AAE5C,MAAM,YAAY,MAAM;AAC7B,QAAM,EAAE,kBAAkB,cAAc,YAAY,IAAI,aAAAA,QAAM,WAAW,oDAAuB;AAChG,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,EAAE,eAAe,uBAAuB,QAAI,uCAAc,gBAAgB;AAEhF,QAAM,qBAAqB,wBAAwB;AAEnD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAAA,MACP,WAAW,QAAQ,QAAQ;AAAA,MAC3B,eAAa,+CAA8B;AAAA,MAC1C,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MAEC;AAAA,6BAAqB,4CAAC,yDAAqB,GAAG,kBAAkB,IAAK,4CAAC,wBAAQ,GAAG,kBAAkB;AAAA,QAEnG,WACC,4CAAC,OAAE,QAAM,MAAC,IAAI,GAAG,WAAW,yBAAyB,uBAErD,IACE;AAAA,QACH,kBACC;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YAEL;AAAA,YACA,UAAQ;AAAA,YACR;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QACF,IACE;AAAA;AAAA;AAAA,EACN;AAEJ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -33,6 +33,7 @@ __export(styles_exports, {
|
|
|
33
33
|
StyledButtonContentWrapper: () => StyledButtonContentWrapper,
|
|
34
34
|
StyledCircle: () => StyledCircle,
|
|
35
35
|
StyledContainer: () => StyledContainer,
|
|
36
|
+
StyledHiddenInput: () => StyledHiddenInput,
|
|
36
37
|
StyledTextWrapper: () => StyledTextWrapper
|
|
37
38
|
});
|
|
38
39
|
module.exports = __toCommonJS(styles_exports);
|
|
@@ -63,7 +64,7 @@ const StyledContainer = (0, import_ds_system.styled)("div", {
|
|
|
63
64
|
${import_ds_system.xStyledCommonProps}
|
|
64
65
|
`;
|
|
65
66
|
const SwitchButtonStateColors = import_ds_system.css`
|
|
66
|
-
${({ $disabled, $readOnly, $applyAriaDisabled, $checked, theme }) => {
|
|
67
|
+
${({ $disabled, $readOnly, $applyAriaDisabled, $checked, $hasError, theme }) => {
|
|
67
68
|
if ($disabled)
|
|
68
69
|
return `
|
|
69
70
|
background-color: ${theme.colors.neutral["080"]};
|
|
@@ -71,49 +72,38 @@ const SwitchButtonStateColors = import_ds_system.css`
|
|
|
71
72
|
`;
|
|
72
73
|
if ($readOnly || $applyAriaDisabled)
|
|
73
74
|
return `
|
|
74
|
-
background-color: ${theme.colors.neutral["050"]};
|
|
75
|
-
border: 2px solid ${theme.colors.neutral["400"]};
|
|
75
|
+
background-color: ${$checked ? theme.colors.neutral["000"] : theme.colors.neutral["050"]};
|
|
76
|
+
border: 2px solid ${$hasError ? theme.colors.danger["900"] : theme.colors.neutral["400"]};
|
|
76
77
|
`;
|
|
77
78
|
if ($checked)
|
|
78
79
|
return `
|
|
79
80
|
background-color: ${theme.colors.brand["600"]};
|
|
80
|
-
border: 2px solid ${theme.colors.brand["700"]};
|
|
81
|
+
border: 2px solid ${$hasError ? theme.colors.danger["900"] : theme.colors.brand["700"]};
|
|
81
82
|
`;
|
|
82
83
|
return `
|
|
83
84
|
background-color: ${theme.colors.neutral["500"]};
|
|
84
|
-
border: 2px solid ${theme.colors.neutral["600"]};
|
|
85
|
+
border: 2px solid ${$hasError ? theme.colors.danger["900"] : theme.colors.neutral["600"]};
|
|
85
86
|
`;
|
|
86
87
|
}}
|
|
87
88
|
`;
|
|
88
|
-
const SwitchCursors = import_ds_system.css`
|
|
89
|
-
${({ $disabled, $readOnly, $applyAriaDisabled }) => {
|
|
90
|
-
if ($disabled || $readOnly || $applyAriaDisabled)
|
|
91
|
-
return `
|
|
92
|
-
cursor: not-allowed;
|
|
93
|
-
`;
|
|
94
|
-
return `
|
|
95
|
-
cursor: pointer;
|
|
96
|
-
`;
|
|
97
|
-
}}
|
|
98
|
-
`;
|
|
99
89
|
const SwitchHoverColors = import_ds_system.css`
|
|
100
|
-
${({ $disabled, $readOnly, $applyAriaDisabled, $checked, theme }) => {
|
|
90
|
+
${({ $disabled, $readOnly, $applyAriaDisabled, $checked, $hasError, theme }) => {
|
|
101
91
|
if ($disabled)
|
|
102
92
|
return `
|
|
103
93
|
background-color: ${theme.colors.neutral["080"]};
|
|
104
94
|
`;
|
|
105
95
|
if ($readOnly || $applyAriaDisabled)
|
|
106
96
|
return `
|
|
107
|
-
background-color: ${theme.colors.neutral["050"]};
|
|
97
|
+
background-color: ${$checked ? theme.colors.neutral["000"] : theme.colors.neutral["050"]};
|
|
108
98
|
`;
|
|
109
99
|
if ($checked)
|
|
110
100
|
return `
|
|
111
101
|
background-color: ${theme.colors.brand["700"]};
|
|
112
|
-
border-color: ${theme.colors.brand["800"]};
|
|
102
|
+
border-color: ${$hasError ? theme.colors.danger["900"] : theme.colors.brand["800"]};
|
|
113
103
|
`;
|
|
114
104
|
return `
|
|
115
105
|
background-color: ${theme.colors.neutral["600"]};
|
|
116
|
-
border-color: ${theme.colors.neutral["700"]};
|
|
106
|
+
border-color: ${$hasError ? theme.colors.danger["900"] : theme.colors.neutral["700"]};
|
|
117
107
|
`;
|
|
118
108
|
}}
|
|
119
109
|
`;
|
|
@@ -130,10 +120,14 @@ const StyledButton = (0, import_ds_system.styled)(import_ds_button_v2.DSButtonV3
|
|
|
130
120
|
outline: 2px solid ${({ theme }) => theme.colors.brand["700"]};
|
|
131
121
|
outline-offset: 1px;
|
|
132
122
|
}
|
|
123
|
+
cursor: pointer;
|
|
133
124
|
&:hover {
|
|
134
|
-
${SwitchCursors}
|
|
135
125
|
${SwitchHoverColors}
|
|
136
126
|
}
|
|
127
|
+
/* not-allowed for disabled, applyAriaDisabled and readOnly comes from lockedStateInteractionCss.
|
|
128
|
+
The UX spec says "arrow" for readOnly/aria-disabled; not-allowed ships consistent with other Dimsum
|
|
129
|
+
components until UX confirms. */
|
|
130
|
+
${import_ds_system.lockedStateInteractionCss}
|
|
137
131
|
`;
|
|
138
132
|
const labelHeight = {
|
|
139
133
|
s: "16px",
|
|
@@ -160,7 +154,7 @@ const StyledButtonContentWrapper = (0, import_ds_system.styled)("div", {
|
|
|
160
154
|
border-radius: 20px;
|
|
161
155
|
`;
|
|
162
156
|
const CircleColors = import_ds_system.css`
|
|
163
|
-
${({ theme, $disabled, $readOnly, $applyAriaDisabled }) => {
|
|
157
|
+
${({ theme, $disabled, $readOnly, $applyAriaDisabled, $hasError }) => {
|
|
164
158
|
if ($disabled) {
|
|
165
159
|
return `
|
|
166
160
|
background-color: ${theme.colors.neutral["080"]};
|
|
@@ -170,7 +164,7 @@ const CircleColors = import_ds_system.css`
|
|
|
170
164
|
if ($readOnly || $applyAriaDisabled) {
|
|
171
165
|
return `
|
|
172
166
|
background-color: ${theme.colors.neutral["000"]};
|
|
173
|
-
outline: 2px solid ${theme.colors.neutral["400"]};
|
|
167
|
+
outline: 2px solid ${$hasError ? theme.colors.danger["900"] : theme.colors.neutral["400"]};
|
|
174
168
|
`;
|
|
175
169
|
}
|
|
176
170
|
return `
|
|
@@ -194,11 +188,16 @@ const StyledCircle = (0, import_ds_system.styled)("div", {
|
|
|
194
188
|
`;
|
|
195
189
|
const TextWrapperColors = import_ds_system.css`
|
|
196
190
|
${({ theme, $disabled, $applyAriaDisabled, $readOnly }) => {
|
|
197
|
-
if ($disabled
|
|
191
|
+
if ($disabled) {
|
|
198
192
|
return `
|
|
199
193
|
color: ${theme.colors.neutral["600"]};
|
|
200
194
|
`;
|
|
201
195
|
}
|
|
196
|
+
if ($applyAriaDisabled || $readOnly) {
|
|
197
|
+
return `
|
|
198
|
+
color: ${theme.colors.neutral["700"]};
|
|
199
|
+
`;
|
|
200
|
+
}
|
|
202
201
|
return `
|
|
203
202
|
color: ${theme.colors.neutral["000"]};
|
|
204
203
|
`;
|
|
@@ -243,4 +242,10 @@ const StyledTextWrapper = (0, import_ds_system.styled)(import_ds_typography.DSTy
|
|
|
243
242
|
${RemBasedFontProperties}
|
|
244
243
|
${TextWrapperColors}
|
|
245
244
|
`;
|
|
245
|
+
const StyledHiddenInput = (0, import_ds_system.styled)("input", {
|
|
246
|
+
name: import_constants.DSControlledToggleName,
|
|
247
|
+
slot: import_constants.CONTROLLED_TOGGLE_SLOTS.HIDDEN_INPUT
|
|
248
|
+
})`
|
|
249
|
+
display: none;
|
|
250
|
+
`;
|
|
246
251
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/styles/styles.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport { DSButtonV3 } from '@elliemae/ds-button-v2';\nimport { css, styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport { DSTypography, type DSTypographyT } from '@elliemae/ds-typography';\nimport { CONTROLLED_TOGGLE_SLOTS, DSControlledToggleName } from '../../constants/index.js';\nimport type { DSControlledToggleT } from '../../react-desc-prop-types.js';\n\ninterface StyledContainerT {\n $size: DSControlledToggleT.ToggleSize;\n}\nconst containerHeight = {\n s: '20px',\n m: '28px',\n l: '36px',\n};\nexport const StyledContainer = styled('div', {\n name: DSControlledToggleName,\n slot: CONTROLLED_TOGGLE_SLOTS.CONTROLLED_CONTAINER,\n})<StyledContainerT>`\n display: inline-flex;\n width: fit-content;\n justify-content: center;\n align-items: center;\n height: ${({ $size }) => containerHeight[$size]};\n padding: 2px;\n border-radius: 20px;\n :focus-within {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n ${xStyledCommonProps}\n`;\ninterface StyledButtonT {\n $checked: boolean;\n $disabled: boolean;\n $applyAriaDisabled: boolean;\n $readOnly: boolean;\n}\nconst SwitchButtonStateColors = css<StyledButtonT>`\n ${({ $disabled, $readOnly, $applyAriaDisabled, $checked, theme }) => {\n // 1. disabled (standard HTML attribute)\n if ($disabled)\n return `\n background-color: ${theme.colors.neutral['080']};\n border: 2px solid ${theme.colors.neutral['400']};\n `;\n // 2. Aria-Read-Only / Aria-Disabled\n if ($readOnly || $applyAriaDisabled)\n return `\n background-color: ${theme.colors.neutral['050']};\n border: 2px solid ${theme.colors.neutral['400']};\n `;\n // 3. Enabled\n // a. Checked\n if ($checked)\n return `\n background-color: ${theme.colors.brand['600']};\n border: 2px solid ${theme.colors.brand['700']};\n `;\n // b. Not checked\n return `\n background-color: ${theme.colors.neutral['500']};\n border: 2px solid ${theme.colors.neutral['600']};\n `;\n }}\n`;\nconst
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAA2B;AAC3B,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport { DSButtonV3 } from '@elliemae/ds-button-v2';\nimport { css, styled, xStyledCommonProps, lockedStateInteractionCss } from '@elliemae/ds-system';\nimport { DSTypography, type DSTypographyT } from '@elliemae/ds-typography';\nimport { CONTROLLED_TOGGLE_SLOTS, DSControlledToggleName } from '../../constants/index.js';\nimport type { DSControlledToggleT } from '../../react-desc-prop-types.js';\n\ninterface StyledContainerT {\n $size: DSControlledToggleT.ToggleSize;\n $disabled?: boolean;\n}\nconst containerHeight = {\n s: '20px',\n m: '28px',\n l: '36px',\n};\nexport const StyledContainer = styled('div', {\n name: DSControlledToggleName,\n slot: CONTROLLED_TOGGLE_SLOTS.CONTROLLED_CONTAINER,\n})<StyledContainerT>`\n display: inline-flex;\n width: fit-content;\n justify-content: center;\n align-items: center;\n height: ${({ $size }) => containerHeight[$size]};\n padding: 2px;\n border-radius: 20px;\n :focus-within {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n ${xStyledCommonProps}\n`;\ninterface StyledButtonT {\n $checked: boolean;\n $disabled: boolean;\n $applyAriaDisabled: boolean;\n $readOnly: boolean;\n $hasError?: boolean;\n}\n// the error state only changes the border color, as the other dimsum form elements do (danger-900).\n// disabled keeps its own colors, same precedence as ds-form-input-text (disabled > error > readOnly/applyAriaDisabled)\nconst SwitchButtonStateColors = css<StyledButtonT>`\n ${({ $disabled, $readOnly, $applyAriaDisabled, $checked, $hasError, theme }) => {\n // 1. disabled (standard HTML attribute)\n if ($disabled)\n return `\n background-color: ${theme.colors.neutral['080']};\n border: 2px solid ${theme.colors.neutral['400']};\n `;\n // 2. Aria-Read-Only / Aria-Disabled\n if ($readOnly || $applyAriaDisabled)\n return `\n background-color: ${$checked ? theme.colors.neutral['000'] : theme.colors.neutral['050']};\n border: 2px solid ${$hasError ? theme.colors.danger['900'] : theme.colors.neutral['400']};\n `;\n // 3. Enabled\n // a. Checked\n if ($checked)\n return `\n background-color: ${theme.colors.brand['600']};\n border: 2px solid ${$hasError ? theme.colors.danger['900'] : theme.colors.brand['700']};\n `;\n // b. Not checked\n return `\n background-color: ${theme.colors.neutral['500']};\n border: 2px solid ${$hasError ? theme.colors.danger['900'] : theme.colors.neutral['600']};\n `;\n }}\n`;\nconst SwitchHoverColors = css<StyledButtonT>`\n ${({ $disabled, $readOnly, $applyAriaDisabled, $checked, $hasError, theme }) => {\n // the button \"on hover\" overrides with background: transparent\n // disabled keeps the same color as before, no hover effect, but we compensate the transparent effect inherithed from the button hover.\n // 1. disabled (standard HTML attribute)\n if ($disabled)\n return `\n background-color: ${theme.colors.neutral['080']};\n `;\n // 2. Aria-Read-Only / Aria-Disabled\n // the button \"on hover\" overrides with background: transparent\n // disabled keeps the same color as before, no hover effect, but we compensate the transparent effect inherithed from the button hover.\n if ($readOnly || $applyAriaDisabled)\n return `\n background-color: ${$checked ? theme.colors.neutral['000'] : theme.colors.neutral['050']};\n `;\n // 2. Enabled\n // a. Checked\n if ($checked)\n return `\n background-color: ${theme.colors.brand['700']};\n border-color: ${$hasError ? theme.colors.danger['900'] : theme.colors.brand['800']};\n `;\n // b. Not checked\n return `\n background-color: ${theme.colors.neutral['600']};\n border-color: ${$hasError ? theme.colors.danger['900'] : theme.colors.neutral['700']};\n `;\n }}\n`;\nexport const StyledButton = styled(DSButtonV3, {\n name: DSControlledToggleName,\n slot: CONTROLLED_TOGGLE_SLOTS.TOGGLE_CHECKBOX,\n})<StyledButtonT>`\n margin: 0;\n padding: 0;\n border-radius: 20px;\n ${SwitchButtonStateColors}\n transition: background-color 0.2s;\n :focus {\n outline: 2px solid ${({ theme }) => theme.colors.brand['700']};\n outline-offset: 1px;\n }\n cursor: pointer;\n &:hover {\n ${SwitchHoverColors}\n }\n /* not-allowed for disabled, applyAriaDisabled and readOnly comes from lockedStateInteractionCss.\n The UX spec says \"arrow\" for readOnly/aria-disabled; not-allowed ships consistent with other Dimsum\n components until UX confirms. */\n ${lockedStateInteractionCss}\n`;\ninterface StyledButtonContentWrapperT {\n $size: DSControlledToggleT.ToggleSize;\n $width: number;\n $checked: boolean;\n}\nconst labelHeight = {\n s: '16px',\n m: '24px',\n l: '32px',\n};\nconst margin = {\n s: '26px',\n m: '34px',\n l: '42px',\n};\nexport const StyledButtonContentWrapper = styled('div', {\n name: DSControlledToggleName,\n slot: CONTROLLED_TOGGLE_SLOTS.BUTTON_CONTENT_WRAPPER,\n})<StyledButtonContentWrapperT>`\n min-width: ${({ $width, $size }) => `calc(${$width}px + ${margin[$size]})`};\n height: ${({ $size }) => labelHeight[$size]};\n display: flex;\n margin: 0;\n padding: 0;\n align-items: center;\n height: 100%;\n flex-direction: ${({ $checked }) => ($checked ? 'row-reverse' : 'row')};\n border-radius: 20px;\n`;\ninterface StyledCircleT {\n $size: DSControlledToggleT.ToggleSize;\n $disabled: boolean;\n $readOnly: boolean;\n $applyAriaDisabled: boolean;\n $hasError?: boolean;\n}\nconst CircleColors = css<StyledCircleT>`\n ${({ theme, $disabled, $readOnly, $applyAriaDisabled, $hasError }) => {\n // 1. Truly disabled (standard HTML attribute)\n if ($disabled) {\n return `\n background-color: ${theme.colors.neutral['080']};\n outline: 2px solid ${theme.colors.neutral['400']};\n `;\n }\n\n // 2. Aria-disabled (readOnly or applyAriaDisabled)\n if ($readOnly || $applyAriaDisabled) {\n return `\n background-color: ${theme.colors.neutral['000']};\n outline: 2px solid ${$hasError ? theme.colors.danger['900'] : theme.colors.neutral['400']};\n `;\n }\n\n // 3. Enabled\n return `\n background-color: ${theme.colors.neutral['000']};\n `;\n }}\n`;\nconst circleValues = {\n s: '14px',\n m: '20px',\n l: '28px',\n};\nexport const StyledCircle = styled('div', {\n name: DSControlledToggleName,\n slot: CONTROLLED_TOGGLE_SLOTS.CIRCLE,\n})<StyledCircleT>`\n height: ${({ $size }) => circleValues[$size]};\n width: ${({ $size }) => circleValues[$size]};\n border-radius: 50%;\n ${CircleColors}\n`;\ninterface StyledTextWrapperT extends DSTypographyT.Props {\n $size: DSControlledToggleT.ToggleSize;\n $disabled: boolean;\n $applyAriaDisabled: boolean;\n $readOnly: boolean;\n}\nconst TextWrapperColors = css<StyledTextWrapperT>`\n ${({ theme, $disabled, $applyAriaDisabled, $readOnly }) => {\n // 1. Truly disabled\n if ($disabled) {\n return `\n color: ${theme.colors.neutral['600']};\n `;\n }\n // 2. applyAriaDisabled, readOnly\n if ($applyAriaDisabled || $readOnly) {\n return `\n color: ${theme.colors.neutral['700']};\n `;\n }\n // 3. Enabled\n return `\n color: ${theme.colors.neutral['000']};\n `;\n }}\n`;\nexport const RemBasedFontProperties = css<{ $size: DSControlledToggleT.ToggleSize }>`\n ${({ theme, $size }) => {\n if ($size === 's')\n return `\n font-size: 0.6875rem; // 11px -> 11/16 = 0.6875rem\n line-height: 0.6875rem; // 11px -> 11/16 = 0.6875rem\n @media (min-width: ${theme.breakpoints.small}) {\n font-size: 0.84615rem; // 11px -> 11/13 = 0.84615rem\n line-height: 0.84615rem; // 11px -> 11/13 = 0.84615rem\n }\n `;\n if ($size === 'l')\n return `\n font-size: 1.25rem; // 20px -> 20/16 = 1.25rem\n line-height: 1.25rem; // 20px -> 20/16 = 1.25rem\n @media (min-width: ${theme.breakpoints.small}) {\n font-size: 1.53846rem; // 20px -> 20/13 = 1.53846rem\n line-height: 1.53846rem; // 20px -> 20/13 = 1.53846rem\n }\n `;\n return `\n font-size: 0.9375rem; // 15px -> 15/16 = 0.9375rem\n line-height: 0.9375rem; // 15px -> 15/16 = 0.9375rem\n @media (min-width: ${theme.breakpoints.small}) {\n font-size: 1.15385rem; // 15px -> 15/13 = 1.15385rem\n line-height: 1.15385rem; // 15px -> 15/13 = 1.15385rem\n }\n `;\n }}\n`;\nexport const StyledTextWrapper = styled(DSTypography, {\n name: DSControlledToggleName,\n slot: CONTROLLED_TOGGLE_SLOTS.TEXT_WRAPPER,\n})<StyledTextWrapperT>`\n flex-grow: 1;\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n ${RemBasedFontProperties}\n ${TextWrapperColors}\n`;\n\n// Only rendered when makeSubmittable is true. It is not visible and not reachable by keyboard or assistive technology,\n// it only exists so a native form can submit the toggle (name and value) the way it would submit a checkbox.\nexport const StyledHiddenInput = styled('input', {\n name: DSControlledToggleName,\n slot: CONTROLLED_TOGGLE_SLOTS.HIDDEN_INPUT,\n})`\n display: none;\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AA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;AAExC,CAAC;AAAA;AAEI,MAAM,yBAAyB;AAAA,IAClC,CAAC,EAAE,OAAO,MAAM,MAAM;AACtB,MAAI,UAAU;AACZ,WAAO;AAAA;AAAA;AAAA,6BAGgB,MAAM,YAAY,KAAK;AAAA;AAAA;AAAA;AAAA;AAKhD,MAAI,UAAU;AACZ,WAAO;AAAA;AAAA;AAAA,6BAGgB,MAAM,YAAY,KAAK;AAAA;AAAA;AAAA;AAAA;AAKhD,SAAO;AAAA;AAAA;AAAA,2BAGgB,MAAM,YAAY,KAAK;AAAA;AAAA;AAAA;AAAA;AAKhD,CAAC;AAAA;AAEI,MAAM,wBAAoB,yBAAO,mCAAc;AAAA,EACpD,MAAM;AAAA,EACN,MAAM,yCAAwB;AAChC,CAAC;AAAA;AAAA,iBAEgB,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY,QAAQ;AAAA,IACtD,sBAAsB;AAAA,IACtB,iBAAiB;AAAA;AAKd,MAAM,wBAAoB,yBAAO,SAAS;AAAA,EAC/C,MAAM;AAAA,EACN,MAAM,yCAAwB;AAChC,CAAC;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -50,18 +50,27 @@ const SetLabelWidth = import_ds_system.styled.div`
|
|
|
50
50
|
`;
|
|
51
51
|
const ButtonWCAGViolation = () => {
|
|
52
52
|
const { propsWithDefault, buttonProps } = import_react.default.useContext(import_DSControlledToggleCTX.ControlledToggleContext);
|
|
53
|
-
const {
|
|
53
|
+
const {
|
|
54
|
+
wcagViolationLabelOn,
|
|
55
|
+
wcagViolationLabelOff,
|
|
56
|
+
checked,
|
|
57
|
+
size,
|
|
58
|
+
disabled,
|
|
59
|
+
applyAriaDisabled,
|
|
60
|
+
readOnly,
|
|
61
|
+
hasError
|
|
62
|
+
} = propsWithDefault;
|
|
54
63
|
const { getOwnerProps, getOwnerPropsArguments } = (0, import_ds_props_helpers.useOwnerProps)(propsWithDefault);
|
|
55
64
|
const { width, handleRefOnLabelWidth, handleRefOffLabelWidth } = (0, import_useGetWidestLabelWidth.useGetWidestLabelWidth)();
|
|
56
65
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
57
66
|
import_styles.StyledButton,
|
|
58
67
|
{
|
|
59
|
-
...readOnly ? { "aria-readonly": "true" } : {},
|
|
60
68
|
...buttonProps,
|
|
61
69
|
$checked: checked,
|
|
62
70
|
$readOnly: readOnly,
|
|
63
71
|
$disabled: disabled,
|
|
64
72
|
$applyAriaDisabled: applyAriaDisabled,
|
|
73
|
+
$hasError: hasError,
|
|
65
74
|
getOwnerProps,
|
|
66
75
|
getOwnerPropsArguments,
|
|
67
76
|
children: [
|
|
@@ -81,6 +90,7 @@ const ButtonWCAGViolation = () => {
|
|
|
81
90
|
$disabled: disabled,
|
|
82
91
|
$readOnly: readOnly,
|
|
83
92
|
$applyAriaDisabled: applyAriaDisabled,
|
|
93
|
+
$hasError: hasError,
|
|
84
94
|
getOwnerProps,
|
|
85
95
|
getOwnerPropsArguments
|
|
86
96
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/wcagViolation/Button.wcagViolationLabels.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { TYPOGRAPHY_VARIANTS } from '@elliemae/ds-typography';\nimport { styled } from '@elliemae/ds-system';\nimport React from 'react';\nimport { ControlledToggleContext } from '../../DSControlledToggleCTX.js';\nimport type { DSControlledToggleT } from '../../react-desc-prop-types.js';\nimport {\n RemBasedFontProperties,\n StyledButton,\n StyledButtonContentWrapper,\n StyledCircle,\n StyledTextWrapper,\n} from '../styles/styles.js';\nimport { useGetWidestLabelWidth } from './useGetWidestLabelWidth.js';\n\n/**\n * we are doing this to keep the wcagViolationLabelOn/wcagViolationLabelOff working\n * this calculates the width of the widest custom label and sets the width of both labels to that width to avoid layout shift on toggle\n *\n * ---\n *\n * this can be safely removed in favor of a sensible default min-width for the accessible ON/OFF labels when we can actually kill the wcagViolationLabelOn/wcagViolationLabelOff props\n */\nconst SetLabelWidth = styled.div<{ $size: DSControlledToggleT.ToggleSize }>`\n ${RemBasedFontProperties}\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n width: auto;\n position: absolute;\n white-space: nowrap;\n visibility: hidden;\n`;\n\nexport const ButtonWCAGViolation: React.ComponentType<DSControlledToggleT.Props> = () => {\n const { propsWithDefault, buttonProps } = React.useContext(ControlledToggleContext);\n const {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { TYPOGRAPHY_VARIANTS } from '@elliemae/ds-typography';\nimport { styled } from '@elliemae/ds-system';\nimport React from 'react';\nimport { ControlledToggleContext } from '../../DSControlledToggleCTX.js';\nimport type { DSControlledToggleT } from '../../react-desc-prop-types.js';\nimport {\n RemBasedFontProperties,\n StyledButton,\n StyledButtonContentWrapper,\n StyledCircle,\n StyledTextWrapper,\n} from '../styles/styles.js';\nimport { useGetWidestLabelWidth } from './useGetWidestLabelWidth.js';\n\n/**\n * we are doing this to keep the wcagViolationLabelOn/wcagViolationLabelOff working\n * this calculates the width of the widest custom label and sets the width of both labels to that width to avoid layout shift on toggle\n *\n * ---\n *\n * this can be safely removed in favor of a sensible default min-width for the accessible ON/OFF labels when we can actually kill the wcagViolationLabelOn/wcagViolationLabelOff props\n */\nconst SetLabelWidth = styled.div<{ $size: DSControlledToggleT.ToggleSize }>`\n ${RemBasedFontProperties}\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n width: auto;\n position: absolute;\n white-space: nowrap;\n visibility: hidden;\n`;\n\nexport const ButtonWCAGViolation: React.ComponentType<DSControlledToggleT.Props> = () => {\n const { propsWithDefault, buttonProps } = React.useContext(ControlledToggleContext);\n const {\n wcagViolationLabelOn,\n wcagViolationLabelOff,\n checked,\n size,\n disabled,\n applyAriaDisabled,\n readOnly,\n hasError,\n } = propsWithDefault;\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(propsWithDefault);\n const { width, handleRefOnLabelWidth, handleRefOffLabelWidth } = useGetWidestLabelWidth();\n\n return (\n <StyledButton\n {...buttonProps}\n $checked={checked}\n $readOnly={readOnly}\n $disabled={disabled}\n $applyAriaDisabled={applyAriaDisabled}\n $hasError={hasError}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledButtonContentWrapper\n $width={width}\n $checked={checked}\n $size={size}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledCircle\n $size={size}\n $disabled={disabled}\n $readOnly={readOnly}\n $applyAriaDisabled={applyAriaDisabled}\n $hasError={hasError}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n <StyledTextWrapper\n $size={size}\n $disabled={disabled}\n $readOnly={readOnly}\n $applyAriaDisabled={applyAriaDisabled}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n variant={TYPOGRAPHY_VARIANTS.B2}\n >\n {checked ? (wcagViolationLabelOn ?? 'ON') : (wcagViolationLabelOff ?? 'OFF')}\n </StyledTextWrapper>\n </StyledButtonContentWrapper>\n <SetLabelWidth $size={size} innerRef={handleRefOnLabelWidth} aria-hidden=\"true\">\n {wcagViolationLabelOn ?? 'ON'}\n </SetLabelWidth>\n <SetLabelWidth $size={size} innerRef={handleRefOffLabelWidth} aria-hidden=\"true\">\n {wcagViolationLabelOff ?? 'OFF'}\n </SetLabelWidth>\n </StyledButton>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAA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