@okta/odyssey-react-mui 1.9.9 → 1.9.11
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/CHANGELOG.md +8 -0
- package/dist/@types/react-augment.d.js.map +1 -1
- package/dist/Button.js +12 -1
- package/dist/Button.js.map +1 -1
- package/dist/Checkbox.js +12 -1
- package/dist/Checkbox.js.map +1 -1
- package/dist/Link.js +12 -1
- package/dist/Link.js.map +1 -1
- package/dist/PasswordField.js +12 -1
- package/dist/PasswordField.js.map +1 -1
- package/dist/Radio.js +12 -1
- package/dist/Radio.js.map +1 -1
- package/dist/Select.js +12 -1
- package/dist/Select.js.map +1 -1
- package/dist/TextField.js +12 -1
- package/dist/TextField.js.map +1 -1
- package/dist/Typography.js +13 -1
- package/dist/Typography.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/labs/Switch.js +157 -0
- package/dist/labs/Switch.js.map +1 -0
- package/dist/labs/index.js +1 -0
- package/dist/labs/index.js.map +1 -1
- package/dist/src/Button.d.ts +6 -1
- package/dist/src/Button.d.ts.map +1 -1
- package/dist/src/Checkbox.d.ts +6 -1
- package/dist/src/Checkbox.d.ts.map +1 -1
- package/dist/src/Link.d.ts +6 -1
- package/dist/src/Link.d.ts.map +1 -1
- package/dist/src/PasswordField.d.ts +9 -0
- package/dist/src/PasswordField.d.ts.map +1 -1
- package/dist/src/Radio.d.ts +6 -1
- package/dist/src/Radio.d.ts.map +1 -1
- package/dist/src/Select.d.ts +6 -1
- package/dist/src/Select.d.ts.map +1 -1
- package/dist/src/TextField.d.ts +9 -0
- package/dist/src/TextField.d.ts.map +1 -1
- package/dist/src/Typography.d.ts +6 -1
- package/dist/src/Typography.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/labs/Switch.d.ts +41 -0
- package/dist/src/labs/Switch.d.ts.map +1 -0
- package/dist/src/labs/index.d.ts +1 -0
- package/dist/src/labs/index.d.ts.map +1 -1
- package/dist/src/theme/components.d.ts.map +1 -1
- package/dist/theme/components.js +87 -28
- package/dist/theme/components.js.map +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/@types/react-augment.d.ts +4 -0
- package/src/Button.tsx +28 -1
- package/src/Checkbox.tsx +22 -1
- package/src/Link.tsx +42 -19
- package/src/PasswordField.tsx +22 -0
- package/src/Radio.tsx +22 -2
- package/src/Select.tsx +30 -1
- package/src/TextField.tsx +22 -0
- package/src/Typography.tsx +30 -1
- package/src/index.ts +1 -0
- package/src/labs/Switch.tsx +246 -0
- package/src/labs/index.ts +2 -0
- package/src/theme/components.tsx +56 -0
package/dist/TextField.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.js","names":["forwardRef","memo","useCallback","useRef","Field","useInputValues","getControlState","jsx","_jsx","textFieldTypeValues","TextField","_ref","ref","autoCompleteType","defaultValue","hasInitialFocus","endAdornment","errorMessage","hint","HintLinkComponent","id","idOverride","isDisabled","isFullWidth","isMultiline","isOptional","isReadOnly","label","name","nameOverride","onBlur","onChange","onChangeProp","onFocus","placeholder","startAdornment","testId","type","value","controlledStateRef","controlledValue","uncontrolledValue","inputValues","controlState","current","event","renderFieldComponent","_ref2","ariaDescribedBy","errorMessageElementId","labelElementId","_InputBase","inputProps","autoComplete","autoFocus","_InputAdornment","position","children","multiline","readOnly","required","fieldType","hasVisibleLabel","MemoizedTextField","displayName"],"sources":["../src/TextField.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n InputHTMLAttributes,\n memo,\n ReactElement,\n useCallback,\n useRef,\n} from \"react\";\nimport { InputAdornment, InputBase } from \"@mui/material\";\n\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport { Field } from \"./Field\";\nimport { SeleniumProps } from \"./SeleniumProps\";\nimport { useInputValues, getControlState } from \"./inputUtils\";\n\nexport const textFieldTypeValues = [\n \"email\",\n \"number\",\n \"tel\",\n \"text\",\n \"url\",\n] as const;\n\nexport type TextFieldProps = {\n /**\n * This prop helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).\n */\n autoCompleteType?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: string;\n /**\n * End `InputAdornment` for this component.\n */\n endAdornment?: string | ReactElement;\n /**\n * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * If `true`, a [TextareaAutosize](/material-ui/react-textarea-autosize/) element is rendered.\n */\n isMultiline?: boolean;\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * Callback fired when the `input` element loses focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * Callback fired when the value is changed.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;\n /**\n * Callback fired when the `input` element get focus.\n */\n onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * Start `InputAdornment` for this component.\n */\n startAdornment?: string | ReactElement;\n /**\n * Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).\n */\n type?: (typeof textFieldTypeValues)[number];\n /**\n * The value of the `input` element, required for a controlled component.\n */\n value?: string;\n} & FieldComponentProps &\n SeleniumProps;\n\nconst TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n autoCompleteType,\n defaultValue,\n hasInitialFocus,\n endAdornment,\n errorMessage,\n hint,\n HintLinkComponent,\n id: idOverride,\n isDisabled = false,\n isFullWidth = false,\n isMultiline = false,\n isOptional = false,\n isReadOnly,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onFocus,\n placeholder,\n startAdornment,\n testId,\n type = \"text\",\n value: value,\n },\n ref\n ) => {\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n })\n );\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const onChange = useCallback<\n NonNullable<ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>>\n >(\n (event) => {\n onChangeProp?.(event);\n },\n [onChangeProp]\n );\n\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy, errorMessageElementId, id, labelElementId }) => (\n <InputBase\n {...inputValues}\n inputProps={{\n \"aria-errormessage\": errorMessageElementId,\n \"aria-labelledby\": labelElementId,\n }}\n aria-describedby={ariaDescribedBy}\n autoComplete={autoCompleteType}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n data-se={testId}\n endAdornment={\n endAdornment && (\n <InputAdornment position=\"end\">{endAdornment}</InputAdornment>\n )\n }\n id={id}\n multiline={isMultiline}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n placeholder={placeholder}\n readOnly={isReadOnly}\n ref={ref}\n required={!isOptional}\n startAdornment={\n startAdornment && (\n <InputAdornment position=\"start\">{startAdornment}</InputAdornment>\n )\n }\n type={type}\n />\n ),\n [\n autoCompleteType,\n inputValues,\n hasInitialFocus,\n endAdornment,\n isMultiline,\n nameOverride,\n onBlur,\n onChange,\n onFocus,\n placeholder,\n isOptional,\n isReadOnly,\n ref,\n startAdornment,\n testId,\n type,\n ]\n );\n\n return (\n <Field\n errorMessage={errorMessage}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n }\n);\n\nconst MemoizedTextField = memo(TextField);\nMemoizedTextField.displayName = \"TextField\";\n\nexport { MemoizedTextField as TextField };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAGEA,UAAU,EAEVC,IAAI,EAEJC,WAAW,EACXC,MAAM,QACD,OAAO;AAAC,SAINC,KAAK;AAAA,SAELC,cAAc,EAAEC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAExC,OAAO,MAAMC,mBAAmB,GAAG,CACjC,OAAO,EACP,QAAQ,EACR,KAAK,EACL,MAAM,EACN,KAAK,CACG;AA4DV,MAAMC,SAAS,GAAGV,UAAU,CAC1B,CAAAW,IAAA,EA0BEC,GAAG,KACA;EAAA,IA1BH;IACEC,gBAAgB;IAChBC,YAAY;IACZC,eAAe;IACfC,YAAY;IACZC,YAAY;IACZC,IAAI;IACJC,iBAAiB;IACjBC,EAAE,EAAEC,UAAU;IACdC,UAAU,GAAG,KAAK;IAClBC,WAAW,GAAG,KAAK;IACnBC,WAAW,GAAG,KAAK;IACnBC,UAAU,GAAG,KAAK;IAClBC,UAAU;IACVC,KAAK;IACLC,IAAI,EAAEC,YAAY;IAClBC,MAAM;IACNC,QAAQ,EAAEC,YAAY;IACtBC,OAAO;IACPC,WAAW;IACXC,cAAc;IACdC,MAAM;IACNC,IAAI,GAAG,MAAM;IACbC,KAAK,EAAEA;EACT,CAAC,GAAA3B,IAAA;EAGD,MAAM4B,kBAAkB,GAAGpC,MAAM,CAC/BG,eA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,CAEpE;MACDE,IAAI,EAAEA;IAAK,CACZ,CAAC;EAAA,CACH,EACD,CACExB,gBAAgB,EAChB6B,WAAW,EACX3B,eAAe,EACfC,YAAY,EACZQ,WAAW,EACXK,YAAY,EACZC,MAAM,EACNC,QAAQ,EACRE,OAAO,EACPC,WAAW,EACXT,UAAU,EACVC,UAAU,EACVd,GAAG,EACHuB,cAAc,EACdC,MAAM,EACNC,IAAI,CAER,CAAC;EAED,OACE7B,IAAA,CAACJ,KAAK;IACJa,YAAY,EAAEA,YAAa;IAC3B4C,SAAS,EAAC,QAAQ;IAClBC,eAAe;IACf5C,IAAI,EAAEA,IAAK;IACXC,iBAAiB,EAAEA,iBAAkB;IACrCC,EAAE,EAAEC,UAAW;IACfC,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBE,UAAU,EAAEA,UAAW;IACvBE,KAAK,EAAEA,KAAM;IACbmB,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CACF,CAAC;AAED,MAAMiB,iBAAiB,GAAG9D,IAAI,CAACS,SAAS,CAAC;AACzCqD,iBAAiB,CAACC,WAAW,GAAG,WAAW;AAE3C,SAASD,iBAAiB,IAAIrD,SAAS"}
|
|
1
|
+
{"version":3,"file":"TextField.js","names":["forwardRef","memo","useCallback","useImperativeHandle","useRef","Field","useInputValues","getControlState","jsx","_jsx","textFieldTypeValues","TextField","_ref","ref","autoCompleteType","defaultValue","hasInitialFocus","endAdornment","errorMessage","hint","HintLinkComponent","id","idOverride","inputFocusRef","isDisabled","isFullWidth","isMultiline","isOptional","isReadOnly","label","name","nameOverride","onBlur","onChange","onChangeProp","onFocus","placeholder","startAdornment","testId","type","value","controlledStateRef","controlledValue","uncontrolledValue","inputValues","controlState","current","inputRef","element","focus","event","renderFieldComponent","_ref2","ariaDescribedBy","errorMessageElementId","labelElementId","_InputBase","inputProps","autoComplete","autoFocus","_InputAdornment","position","children","multiline","readOnly","required","fieldType","hasVisibleLabel","MemoizedTextField","displayName"],"sources":["../src/TextField.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n InputHTMLAttributes,\n memo,\n ReactElement,\n useCallback,\n useImperativeHandle,\n useRef,\n} from \"react\";\nimport { InputAdornment, InputBase } from \"@mui/material\";\n\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport { Field } from \"./Field\";\nimport { SeleniumProps } from \"./SeleniumProps\";\nimport { useInputValues, getControlState } from \"./inputUtils\";\nimport { FocusHandle } from \"./@types/react-augment\";\n\nexport const textFieldTypeValues = [\n \"email\",\n \"number\",\n \"tel\",\n \"text\",\n \"url\",\n] as const;\n\nexport type TextFieldProps = {\n /**\n * This prop helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).\n */\n autoCompleteType?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: string;\n /**\n * End `InputAdornment` for this component.\n */\n endAdornment?: string | ReactElement;\n /**\n * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * The ref forwarded to the TextField to expose focus()\n */\n inputFocusRef?: React.RefObject<FocusHandle>;\n /**\n * If `true`, a [TextareaAutosize](/material-ui/react-textarea-autosize/) element is rendered.\n */\n isMultiline?: boolean;\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * Callback fired when the `input` element loses focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * Callback fired when the value is changed.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;\n /**\n * Callback fired when the `input` element get focus.\n */\n onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * Start `InputAdornment` for this component.\n */\n startAdornment?: string | ReactElement;\n /**\n * Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).\n */\n type?: (typeof textFieldTypeValues)[number];\n /**\n * The value of the `input` element, required for a controlled component.\n */\n value?: string;\n} & FieldComponentProps &\n SeleniumProps;\n\nconst TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n autoCompleteType,\n defaultValue,\n hasInitialFocus,\n endAdornment,\n errorMessage,\n hint,\n HintLinkComponent,\n id: idOverride,\n inputFocusRef,\n isDisabled = false,\n isFullWidth = false,\n isMultiline = false,\n isOptional = false,\n isReadOnly,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onFocus,\n placeholder,\n startAdornment,\n testId,\n type = \"text\",\n value: value,\n },\n ref\n ) => {\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n })\n );\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const inputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(\n inputFocusRef,\n () => {\n const element = inputRef.current;\n return {\n focus: () => {\n element && element.focus();\n },\n };\n },\n []\n );\n\n const onChange = useCallback<\n NonNullable<ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>>\n >(\n (event) => {\n onChangeProp?.(event);\n },\n [onChangeProp]\n );\n\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy, errorMessageElementId, id, labelElementId }) => (\n <InputBase\n {...inputValues}\n inputProps={{\n \"aria-errormessage\": errorMessageElementId,\n \"aria-labelledby\": labelElementId,\n }}\n aria-describedby={ariaDescribedBy}\n autoComplete={autoCompleteType}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n data-se={testId}\n endAdornment={\n endAdornment && (\n <InputAdornment position=\"end\">{endAdornment}</InputAdornment>\n )\n }\n id={id}\n inputRef={inputRef}\n multiline={isMultiline}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n placeholder={placeholder}\n readOnly={isReadOnly}\n ref={ref}\n required={!isOptional}\n startAdornment={\n startAdornment && (\n <InputAdornment position=\"start\">{startAdornment}</InputAdornment>\n )\n }\n type={type}\n />\n ),\n [\n autoCompleteType,\n inputValues,\n hasInitialFocus,\n endAdornment,\n isMultiline,\n nameOverride,\n onBlur,\n onChange,\n onFocus,\n placeholder,\n isOptional,\n isReadOnly,\n ref,\n startAdornment,\n testId,\n type,\n ]\n );\n\n return (\n <Field\n errorMessage={errorMessage}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n }\n);\n\nconst MemoizedTextField = memo(TextField);\nMemoizedTextField.displayName = \"TextField\";\n\nexport { MemoizedTextField as TextField };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAGEA,UAAU,EAEVC,IAAI,EAEJC,WAAW,EACXC,mBAAmB,EACnBC,MAAM,QACD,OAAO;AAAC,SAINC,KAAK;AAAA,SAELC,cAAc,EAAEC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAGxC,OAAO,MAAMC,mBAAmB,GAAG,CACjC,OAAO,EACP,QAAQ,EACR,KAAK,EACL,MAAM,EACN,KAA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D,SAAS,EAAC,QAAQ;IAClBC,eAAe;IACfhD,IAAI,EAAEA,IAAK;IACXC,iBAAiB,EAAEA,iBAAkB;IACrCC,EAAE,EAAEC,UAAW;IACfE,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBE,UAAU,EAAEA,UAAW;IACvBE,KAAK,EAAEA,KAAM;IACbsB,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CACF,CAAC;AAED,MAAMiB,iBAAiB,GAAGnE,IAAI,CAACU,SAAS,CAAC;AACzCyD,iBAAiB,CAACC,WAAW,GAAG,WAAW;AAE3C,SAASD,iBAAiB,IAAIzD,SAAS"}
|
package/dist/Typography.js
CHANGED
|
@@ -10,7 +10,7 @@ import _Typography from "@mui/material/Typography";
|
|
|
10
10
|
*
|
|
11
11
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
12
12
|
*/
|
|
13
|
-
import { memo, useMemo } from "react";
|
|
13
|
+
import { memo, useMemo, useRef, useImperativeHandle } from "react";
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
15
|
export const typographyVariantMapping = {
|
|
16
16
|
h1: "h1",
|
|
@@ -34,6 +34,7 @@ const Typography = _ref => {
|
|
|
34
34
|
color,
|
|
35
35
|
component: componentProp,
|
|
36
36
|
testId,
|
|
37
|
+
typographyFocusRef,
|
|
37
38
|
variant = "body"
|
|
38
39
|
} = _ref;
|
|
39
40
|
const component = useMemo(() => {
|
|
@@ -48,6 +49,15 @@ const Typography = _ref => {
|
|
|
48
49
|
}
|
|
49
50
|
return componentProp;
|
|
50
51
|
}, [componentProp, variant]);
|
|
52
|
+
const ref = useRef(null);
|
|
53
|
+
useImperativeHandle(typographyFocusRef, () => {
|
|
54
|
+
const element = ref.current;
|
|
55
|
+
return {
|
|
56
|
+
focus: () => {
|
|
57
|
+
element && element.focus();
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}, []);
|
|
51
61
|
return _jsx(_Typography, {
|
|
52
62
|
"aria-describedby": ariaDescribedBy,
|
|
53
63
|
"aria-label": ariaLabel,
|
|
@@ -56,6 +66,8 @@ const Typography = _ref => {
|
|
|
56
66
|
color: color,
|
|
57
67
|
component: component,
|
|
58
68
|
"data-se": testId,
|
|
69
|
+
ref: ref,
|
|
70
|
+
tabIndex: -1,
|
|
59
71
|
variant: typographyVariantMapping[variant]
|
|
60
72
|
});
|
|
61
73
|
};
|
package/dist/Typography.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.js","names":["memo","useMemo","jsx","_jsx","typographyVariantMapping","h1","h2","h3","h4","h5","h6","body","subordinate","support","legend","typographyColorValues","Typography","_ref","ariaDescribedBy","ariaLabel","ariaLabelledBy","children","color","component","componentProp","testId","variant","_Typography","MemoizedTypography","displayName","Heading1","_ref2","MemoizedHeading1","Heading2","_ref3","MemoizedHeading2","Heading3","_ref4","MemoizedHeading3","Heading4","_ref5","MemoizedHeading4","Heading5","_ref6","MemoizedHeading5","Heading6","_ref7","MemoizedHeading6","Paragraph","_ref8","MemoizedParagraph","Subordinate","_ref9","MemoizedSubordinate","Support","_ref10","MemoizedSupport","Legend","_ref11","MemoizedLegend"],"sources":["../src/Typography.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n Typography as MuiTypography,\n TypographyProps as MuiTypographyProps,\n} from \"@mui/material\";\nimport { ElementType, ReactNode, memo, useMemo } from \"react\";\nimport { SeleniumProps } from \"./SeleniumProps\";\n\nexport type TypographyVariantValue =\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"body\"\n | \"subordinate\"\n | \"support\"\n | \"legend\";\n\nexport const typographyVariantMapping: Record<\n TypographyVariantValue,\n MuiTypographyProps[\"variant\"]\n> = {\n h1: \"h1\",\n h2: \"h2\",\n h3: \"h3\",\n h4: \"h4\",\n h5: \"h5\",\n h6: \"h6\",\n body: \"body1\",\n subordinate: \"subtitle1\",\n support: \"subtitle2\",\n legend: \"legend\",\n} as const;\n\nexport const typographyColorValues = [\n \"primary\",\n \"textPrimary\",\n \"secondary\",\n \"textSecondary\",\n \"error\",\n] as const;\n\nexport type TypographyProps = {\n /**\n * The ID of the element that describes the component.\n */\n ariaDescribedBy?: string;\n /**\n * The ARIA label for the component.\n */\n ariaLabel?: string;\n /**\n * The ID of the element that labels the component.\n */\n ariaLabelledBy?: string;\n /**\n * The text content of the component.\n */\n children: ReactNode;\n /**\n * The color of the text.\n */\n color?: (typeof typographyColorValues)[number];\n /**\n * The HTML element the component should render, if different from the default.\n */\n component?: ElementType;\n /**\n * The variant of Typography to render.\n */\n variant?: keyof typeof typographyVariantMapping;\n} & SeleniumProps;\n\nconst Typography = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component: componentProp,\n testId,\n variant = \"body\",\n}: TypographyProps) => {\n const component = useMemo(() => {\n if (!componentProp) {\n if (variant === \"body\") {\n return \"p\";\n } else if (variant === \"subordinate\" || variant === \"support\") {\n return \"p\";\n } else {\n return variant;\n }\n }\n return componentProp;\n }, [componentProp, variant]);\n\n return (\n <MuiTypography\n aria-describedby={ariaDescribedBy}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant={typographyVariantMapping[variant]}\n />\n );\n};\n\nconst MemoizedTypography = memo(Typography);\nMemoizedTypography.displayName = \"Typography\";\n\nconst Heading1 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"h1\"\n />\n);\n\nconst MemoizedHeading1 = memo(Heading1);\nMemoizedHeading1.displayName = \"Heading1\";\n\nconst Heading2 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"h2\"\n />\n);\n\nconst MemoizedHeading2 = memo(Heading2);\nMemoizedHeading2.displayName = \"Heading2\";\n\nconst Heading3 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"h3\"\n />\n);\n\nconst MemoizedHeading3 = memo(Heading3);\nMemoizedHeading3.displayName = \"Heading3\";\n\nconst Heading4 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"h4\"\n />\n);\n\nconst MemoizedHeading4 = memo(Heading4);\nMemoizedHeading4.displayName = \"Heading4\";\n\nconst Heading5 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"h5\"\n />\n);\n\nconst MemoizedHeading5 = memo(Heading5);\nMemoizedHeading5.displayName = \"Heading5\";\n\nconst Heading6 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"h6\"\n />\n);\n\nconst MemoizedHeading6 = memo(Heading6);\nMemoizedHeading6.displayName = \"Heading6\";\n\nconst Paragraph = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"body\"\n />\n);\n\nconst MemoizedParagraph = memo(Paragraph);\nMemoizedParagraph.displayName = \"Paragraph\";\n\nconst Subordinate = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"subordinate\"\n />\n);\n\nconst MemoizedSubordinate = memo(Subordinate);\nMemoizedSubordinate.displayName = \"Subordinate\";\n\nconst Support = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"support\"\n />\n);\n\nconst MemoizedSupport = memo(Support);\nMemoizedSupport.displayName = \"Support\";\n\nconst Legend = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"legend\"\n />\n);\n\nconst MemoizedLegend = memo(Legend);\nMemoizedLegend.displayName = \"Legend\";\n\nexport {\n MemoizedTypography as Typography,\n MemoizedHeading1 as Heading1,\n MemoizedHeading2 as Heading2,\n MemoizedHeading3 as Heading3,\n MemoizedHeading4 as Heading4,\n MemoizedHeading5 as Heading5,\n MemoizedHeading6 as Heading6,\n MemoizedLegend as Legend,\n MemoizedParagraph as Paragraph,\n MemoizedSubordinate as Subordinate,\n MemoizedSupport as Support,\n};\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA,SAAiCA,IAAI,EAAEC,OAAO,QAAQ,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAe9D,OAAO,MAAMC,wBAGZ,GAAG;EACFC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,IAAI,EAAE,OAAO;EACbC,WAAW,EAAE,WAAW;EACxBC,OAAO,EAAE,WAAW;EACpBC,MAAM,EAAE;AACV,CAAU;AAEV,OAAO,MAAMC,qBAAqB,GAAG,CACnC,SAAS,EACT,aAAa,EACb,WAAW,EACX,eAAe,EACf,OAAO,CACC;AAiCV,MAAMC,UAAU,GAAGC,IAAA,IASI;EAAA,IATH;IAClBC,eAAe;IACfC,SAAS;IACTC,cAAc;IACdC,QAAQ;IACRC,KAAK;IACLC,SAAS,EAAEC,aAAa;IACxBC,MAAM;IACNC,OAAO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
+
{"version":3,"file":"Typography.js","names":["memo","useMemo","useRef","useImperativeHandle","jsx","_jsx","typographyVariantMapping","h1","h2","h3","h4","h5","h6","body","subordinate","support","legend","typographyColorValues","Typography","_ref","ariaDescribedBy","ariaLabel","ariaLabelledBy","children","color","component","componentProp","testId","typographyFocusRef","variant","ref","element","current","focus","_Typography","tabIndex","MemoizedTypography","displayName","Heading1","_ref2","MemoizedHeading1","Heading2","_ref3","MemoizedHeading2","Heading3","_ref4","MemoizedHeading3","Heading4","_ref5","MemoizedHeading4","Heading5","_ref6","MemoizedHeading5","Heading6","_ref7","MemoizedHeading6","Paragraph","_ref8","MemoizedParagraph","Subordinate","_ref9","MemoizedSubordinate","Support","_ref10","MemoizedSupport","Legend","_ref11","MemoizedLegend"],"sources":["../src/Typography.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n Typography as MuiTypography,\n TypographyProps as MuiTypographyProps,\n} from \"@mui/material\";\nimport {\n ElementType,\n ReactNode,\n memo,\n useMemo,\n useRef,\n useImperativeHandle,\n} from \"react\";\nimport { SeleniumProps } from \"./SeleniumProps\";\nimport { FocusHandle } from \"./@types/react-augment\";\n\nexport type TypographyVariantValue =\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"body\"\n | \"subordinate\"\n | \"support\"\n | \"legend\";\n\nexport const typographyVariantMapping: Record<\n TypographyVariantValue,\n MuiTypographyProps[\"variant\"]\n> = {\n h1: \"h1\",\n h2: \"h2\",\n h3: \"h3\",\n h4: \"h4\",\n h5: \"h5\",\n h6: \"h6\",\n body: \"body1\",\n subordinate: \"subtitle1\",\n support: \"subtitle2\",\n legend: \"legend\",\n} as const;\n\nexport const typographyColorValues = [\n \"primary\",\n \"textPrimary\",\n \"secondary\",\n \"textSecondary\",\n \"error\",\n] as const;\n\nexport type TypographyProps = {\n /**\n * The ID of the element that describes the component.\n */\n ariaDescribedBy?: string;\n /**\n * The ARIA label for the component.\n */\n ariaLabel?: string;\n /**\n * The ID of the element that labels the component.\n */\n ariaLabelledBy?: string;\n /**\n * The text content of the component.\n */\n children: ReactNode;\n /**\n * The color of the text.\n */\n color?: (typeof typographyColorValues)[number];\n /**\n * The HTML element the component should render, if different from the default.\n */\n component?: ElementType;\n /**\n * The ref forwarded to the Typography to expose focus()\n */\n typographyFocusRef?: React.RefObject<FocusHandle>;\n /**\n * The variant of Typography to render.\n */\n variant?: keyof typeof typographyVariantMapping;\n} & SeleniumProps;\n\nconst Typography = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component: componentProp,\n testId,\n typographyFocusRef,\n variant = \"body\",\n}: TypographyProps) => {\n const component = useMemo(() => {\n if (!componentProp) {\n if (variant === \"body\") {\n return \"p\";\n } else if (variant === \"subordinate\" || variant === \"support\") {\n return \"p\";\n } else {\n return variant;\n }\n }\n return componentProp;\n }, [componentProp, variant]);\n\n const ref = useRef<HTMLElement>(null);\n useImperativeHandle(\n typographyFocusRef,\n () => {\n const element = ref.current;\n return {\n focus: () => {\n element && element.focus();\n },\n };\n },\n []\n );\n\n return (\n <MuiTypography\n aria-describedby={ariaDescribedBy}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n ref={ref}\n tabIndex={-1}\n variant={typographyVariantMapping[variant]}\n />\n );\n};\n\nconst MemoizedTypography = memo(Typography);\nMemoizedTypography.displayName = \"Typography\";\n\nconst Heading1 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"h1\"\n />\n);\n\nconst MemoizedHeading1 = memo(Heading1);\nMemoizedHeading1.displayName = \"Heading1\";\n\nconst Heading2 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"h2\"\n />\n);\n\nconst MemoizedHeading2 = memo(Heading2);\nMemoizedHeading2.displayName = \"Heading2\";\n\nconst Heading3 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"h3\"\n />\n);\n\nconst MemoizedHeading3 = memo(Heading3);\nMemoizedHeading3.displayName = \"Heading3\";\n\nconst Heading4 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"h4\"\n />\n);\n\nconst MemoizedHeading4 = memo(Heading4);\nMemoizedHeading4.displayName = \"Heading4\";\n\nconst Heading5 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"h5\"\n />\n);\n\nconst MemoizedHeading5 = memo(Heading5);\nMemoizedHeading5.displayName = \"Heading5\";\n\nconst Heading6 = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"h6\"\n />\n);\n\nconst MemoizedHeading6 = memo(Heading6);\nMemoizedHeading6.displayName = \"Heading6\";\n\nconst Paragraph = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"body\"\n />\n);\n\nconst MemoizedParagraph = memo(Paragraph);\nMemoizedParagraph.displayName = \"Paragraph\";\n\nconst Subordinate = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"subordinate\"\n />\n);\n\nconst MemoizedSubordinate = memo(Subordinate);\nMemoizedSubordinate.displayName = \"Subordinate\";\n\nconst Support = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"support\"\n />\n);\n\nconst MemoizedSupport = memo(Support);\nMemoizedSupport.displayName = \"Support\";\n\nconst Legend = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n children,\n color,\n component,\n testId,\n}: TypographyProps) => (\n <Typography\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n children={children}\n color={color}\n component={component}\n data-se={testId}\n variant=\"legend\"\n />\n);\n\nconst MemoizedLegend = memo(Legend);\nMemoizedLegend.displayName = \"Legend\";\n\nexport {\n MemoizedTypography as Typography,\n MemoizedHeading1 as Heading1,\n MemoizedHeading2 as Heading2,\n MemoizedHeading3 as Heading3,\n MemoizedHeading4 as Heading4,\n MemoizedHeading5 as Heading5,\n MemoizedHeading6 as Heading6,\n MemoizedLegend as Legend,\n MemoizedParagraph as Paragraph,\n MemoizedSubordinate as Subordinate,\n MemoizedSupport as Support,\n};\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA,SAGEA,IAAI,EACJC,OAAO,EACPC,MAAM,EACNC,mBAAmB,QACd,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAgBf,OAAO,MAAMC,wBAGZ,GAAG;EACFC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE,IAAI;EACRC,IAAI,EAAE,OAAO;EACbC,WAAW,EAAE,WAAW;EACxBC,OAAO,EAAE,WAAW;EACpBC,MAAM,EAAE;AACV,CAAU;AAEV,OAAO,MAAMC,qBAAqB,GAAG,CACnC,SAAS,EACT,aAAa,EACb,WAAW,EACX,eAAe,EACf,OAAO,CACC;AAqCV,MAAMC,UAAU,GAAGC,IAAA,IAUI;EAAA,IAVH;IAClBC,eAAe;IACfC,SAAS;IACTC,cAAc;IACdC,QAAQ;IACRC,KAAK;IACLC,SAAS,EAAE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AC;AACnCE,cAAc,CAAC9B,WAAW,GAAG,QAAQ;AAErC,SACED,kBAAkB,IAAIlB,UAAU,EAChCsB,gBAAgB,IAAIF,QAAQ,EAC5BK,gBAAgB,IAAIF,QAAQ,EAC5BK,gBAAgB,IAAIF,QAAQ,EAC5BK,gBAAgB,IAAIF,QAAQ,EAC5BK,gBAAgB,IAAIF,QAAQ,EAC5BK,gBAAgB,IAAIF,QAAQ,EAC5Bc,cAAc,IAAIF,MAAM,EACxBP,iBAAiB,IAAIF,SAAS,EAC9BK,mBAAmB,IAAIF,WAAW,EAClCK,eAAe,IAAIF,OAAO"}
|
package/dist/index.js
CHANGED
|
@@ -55,6 +55,7 @@ export * from "./TextField.js";
|
|
|
55
55
|
export * from "./theme/index.js";
|
|
56
56
|
export * from "./Toast.js";
|
|
57
57
|
export * from "./ToastStack.js";
|
|
58
|
+
export * from "./labs/Switch.js";
|
|
58
59
|
export * from "./Tooltip.js";
|
|
59
60
|
export * from "./Typography.js";
|
|
60
61
|
export * from "./useUniqueId.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["deepmerge","visuallyHidden","createTheme","DialogContentText","Divider","InputAdornment","InputBase","ListItemIcon","ListItemText","ListSubheader","MenuList","Paper","ScopedCssBaseline","ThemeProvider","useOdysseyDesignTokens","odysseyTranslate"],"sources":["../src/index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport { deepmerge, visuallyHidden } from \"@mui/utils\";\n\nexport {\n createTheme,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n DialogContentText,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n Divider,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n InputAdornment,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n InputBase,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListItemIcon,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListItemText,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListSubheader,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n MenuList,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n Paper,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ScopedCssBaseline,\n ThemeProvider,\n} from \"@mui/material\";\n\nexport type {\n CssBaselineProps,\n DialogContentTextProps,\n DividerProps,\n InputAdornmentProps,\n InputBaseProps,\n ListItemIconProps,\n ListItemTextProps,\n ListSubheaderProps,\n MenuListProps,\n PaperProps,\n ScopedCssBaselineProps,\n ThemeOptions,\n} from \"@mui/material\";\n\nexport { useOdysseyDesignTokens } from \"./OdysseyDesignTokensContext\";\n\nexport * from \"./Accordion\";\nexport * from \"./Autocomplete\";\nexport * from \"./Banner\";\nexport * from \"./Box\";\nexport * from \"./Breadcrumbs\";\nexport * from \"./Button\";\nexport * from \"./Callout\";\nexport * from \"./Checkbox\";\nexport * from \"./CheckboxGroup\";\nexport * from \"./CircularProgress\";\nexport * from \"./CssBaseline\";\nexport * from \"./createShadowRootElement\";\nexport * from \"./createUniqueId\";\nexport * from \"./Dialog\";\nexport * from \"./Fieldset\";\nexport * from \"./FieldComponentProps\";\nexport * from \"./Form\";\nexport * from \"./HintLink\";\nexport * from \"./Link\";\nexport * from \"./MenuButton\";\nexport * from \"./MenuItem\";\nexport * from \"./NativeSelect\";\nexport * from \"./NullElement\";\nexport * from \"./OdysseyCacheProvider\";\nexport { odysseyTranslate } from \"./i18n\";\nexport * from \"./OdysseyProvider\";\nexport * from \"./OdysseyThemeProvider\";\nexport * from \"./OdysseyTranslationProvider\";\nexport * from \"./PasswordField\";\nexport * from \"./Radio\";\nexport * from \"./RadioGroup\";\nexport * from \"./ScreenReaderText\";\nexport * from \"./SearchField\";\nexport * from \"./Select\";\nexport * from \"./Status\";\nexport * from \"./Tabs\";\nexport * from \"./Tag\";\nexport * from \"./TagList\";\nexport * from \"./TextField\";\nexport * from \"./theme\";\nexport * from \"./Toast\";\nexport * from \"./ToastStack\";\nexport * from \"./Tooltip\";\nexport * from \"./Typography\";\nexport * from \"./useUniqueId\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,cAAc,QAAQ,YAAY;AAEtD,SACEC,WAAW,EAEXC,iBAAiB,EAEjBC,OAAO,EAEPC,cAAc,EAEdC,SAAS,EAETC,YAAY,EAEZC,YAAY,EAEZC,aAAa,EAEbC,QAAQ,EAERC,KAAK,EAELC,iBAAiB,EACjBC,aAAa,QACR,eAAe;AAAC,SAiBdC,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SA0BtBC,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["deepmerge","visuallyHidden","createTheme","DialogContentText","Divider","InputAdornment","InputBase","ListItemIcon","ListItemText","ListSubheader","MenuList","Paper","ScopedCssBaseline","ThemeProvider","useOdysseyDesignTokens","odysseyTranslate"],"sources":["../src/index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport { deepmerge, visuallyHidden } from \"@mui/utils\";\n\nexport {\n createTheme,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n DialogContentText,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n Divider,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n InputAdornment,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n InputBase,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListItemIcon,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListItemText,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListSubheader,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n MenuList,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n Paper,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ScopedCssBaseline,\n ThemeProvider,\n} from \"@mui/material\";\n\nexport type {\n CssBaselineProps,\n DialogContentTextProps,\n DividerProps,\n InputAdornmentProps,\n InputBaseProps,\n ListItemIconProps,\n ListItemTextProps,\n ListSubheaderProps,\n MenuListProps,\n PaperProps,\n ScopedCssBaselineProps,\n ThemeOptions,\n} from \"@mui/material\";\n\nexport { useOdysseyDesignTokens } from \"./OdysseyDesignTokensContext\";\n\nexport * from \"./Accordion\";\nexport * from \"./Autocomplete\";\nexport * from \"./Banner\";\nexport * from \"./Box\";\nexport * from \"./Breadcrumbs\";\nexport * from \"./Button\";\nexport * from \"./Callout\";\nexport * from \"./Checkbox\";\nexport * from \"./CheckboxGroup\";\nexport * from \"./CircularProgress\";\nexport * from \"./CssBaseline\";\nexport * from \"./createShadowRootElement\";\nexport * from \"./createUniqueId\";\nexport * from \"./Dialog\";\nexport * from \"./Fieldset\";\nexport * from \"./FieldComponentProps\";\nexport * from \"./Form\";\nexport * from \"./HintLink\";\nexport * from \"./Link\";\nexport * from \"./MenuButton\";\nexport * from \"./MenuItem\";\nexport * from \"./NativeSelect\";\nexport * from \"./NullElement\";\nexport * from \"./OdysseyCacheProvider\";\nexport { odysseyTranslate } from \"./i18n\";\nexport * from \"./OdysseyProvider\";\nexport * from \"./OdysseyThemeProvider\";\nexport * from \"./OdysseyTranslationProvider\";\nexport * from \"./PasswordField\";\nexport * from \"./Radio\";\nexport * from \"./RadioGroup\";\nexport * from \"./ScreenReaderText\";\nexport * from \"./SearchField\";\nexport * from \"./Select\";\nexport * from \"./Status\";\nexport * from \"./Tabs\";\nexport * from \"./Tag\";\nexport * from \"./TagList\";\nexport * from \"./TextField\";\nexport * from \"./theme\";\nexport * from \"./Toast\";\nexport * from \"./ToastStack\";\nexport * from \"./labs/Switch\";\nexport * from \"./Tooltip\";\nexport * from \"./Typography\";\nexport * from \"./useUniqueId\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,cAAc,QAAQ,YAAY;AAEtD,SACEC,WAAW,EAEXC,iBAAiB,EAEjBC,OAAO,EAEPC,cAAc,EAEdC,SAAS,EAETC,YAAY,EAEZC,YAAY,EAEZC,aAAa,EAEbC,QAAQ,EAERC,KAAK,EAELC,iBAAiB,EACjBC,aAAa,QACR,eAAe;AAAC,SAiBdC,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SA0BtBC,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import _FormControlLabel from "@mui/material/FormControlLabel";
|
|
2
|
+
import _Switch from "@mui/material/Switch";
|
|
3
|
+
/*!
|
|
4
|
+
* Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
5
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
6
|
+
*
|
|
7
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
8
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
10
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
*
|
|
12
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
16
|
+
const {
|
|
17
|
+
CONTROLLED
|
|
18
|
+
} = ComponentControlledState;
|
|
19
|
+
import { useOdysseyDesignTokens } from "../OdysseyDesignTokensContext.js";
|
|
20
|
+
import { Box } from "../Box.js";
|
|
21
|
+
import { FieldHint } from "../FieldHint.js";
|
|
22
|
+
import { useUniqueId } from "../useUniqueId.js";
|
|
23
|
+
import { ComponentControlledState, getControlState } from "../inputUtils.js";
|
|
24
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
27
|
+
const SwitchLabel = _ref => {
|
|
28
|
+
let {
|
|
29
|
+
checked,
|
|
30
|
+
hint,
|
|
31
|
+
hintId,
|
|
32
|
+
isFullWidth,
|
|
33
|
+
label
|
|
34
|
+
} = _ref;
|
|
35
|
+
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
36
|
+
return _jsxs(_Fragment, {
|
|
37
|
+
children: [_jsxs(Box, {
|
|
38
|
+
sx: {
|
|
39
|
+
display: "flex",
|
|
40
|
+
alignItems: "center",
|
|
41
|
+
flexWrap: "wrap",
|
|
42
|
+
gap: odysseyDesignTokens.Spacing1,
|
|
43
|
+
margin: 0,
|
|
44
|
+
maxWidth: isFullWidth ? "100%" : odysseyDesignTokens.TypographyLineLengthMax,
|
|
45
|
+
fontWeight: odysseyDesignTokens.TypographyWeightBodyBold
|
|
46
|
+
},
|
|
47
|
+
children: [label, _jsx(Box, {
|
|
48
|
+
sx: {
|
|
49
|
+
padding: "2px 4px",
|
|
50
|
+
backgroundColor: checked ? odysseyDesignTokens.PaletteSuccessLighter : odysseyDesignTokens.HueNeutral100,
|
|
51
|
+
borderRadius: odysseyDesignTokens.BorderRadiusMain,
|
|
52
|
+
color: checked ? odysseyDesignTokens.PaletteSuccessText : odysseyDesignTokens.HueNeutral700,
|
|
53
|
+
fontWeight: odysseyDesignTokens.TypographyWeightBodyBold,
|
|
54
|
+
fontSize: odysseyDesignTokens.TypographyScale0,
|
|
55
|
+
lineHeight: odysseyDesignTokens.TypographyLineHeightOverline,
|
|
56
|
+
transitionProperty: "background-color, color",
|
|
57
|
+
transitionDuration: odysseyDesignTokens.TransitionDurationMain
|
|
58
|
+
},
|
|
59
|
+
children: checked ? "Active" : "Inactive"
|
|
60
|
+
})]
|
|
61
|
+
}), hint && _jsx(FieldHint, {
|
|
62
|
+
id: hintId,
|
|
63
|
+
text: hint
|
|
64
|
+
})]
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
const Switch = _ref2 => {
|
|
68
|
+
let {
|
|
69
|
+
hint,
|
|
70
|
+
id: _id,
|
|
71
|
+
isChecked,
|
|
72
|
+
isDefaultChecked,
|
|
73
|
+
isDisabled,
|
|
74
|
+
isFullWidth = false,
|
|
75
|
+
label,
|
|
76
|
+
name: _name,
|
|
77
|
+
onChange,
|
|
78
|
+
testId,
|
|
79
|
+
value = "Something"
|
|
80
|
+
} = _ref2;
|
|
81
|
+
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
82
|
+
const controlledStateRef = useRef(getControlState({
|
|
83
|
+
controlledValue: isChecked,
|
|
84
|
+
uncontrolledValue: isDefaultChecked
|
|
85
|
+
}));
|
|
86
|
+
const inputValues = useMemo(() => {
|
|
87
|
+
if (controlledStateRef.current === CONTROLLED) {
|
|
88
|
+
return {
|
|
89
|
+
checked: isChecked
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
defaultChecked: isDefaultChecked
|
|
94
|
+
};
|
|
95
|
+
}, [isDefaultChecked, isChecked]);
|
|
96
|
+
const [internalSwitchChecked, setInternalSwitchChecked] = useState(controlledStateRef.current === CONTROLLED ? Boolean(isChecked) : Boolean(isDefaultChecked));
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
if (controlledStateRef.current === CONTROLLED) {
|
|
99
|
+
setInternalSwitchChecked(Boolean(isChecked));
|
|
100
|
+
}
|
|
101
|
+
}, [isChecked]);
|
|
102
|
+
const id = useUniqueId(_id);
|
|
103
|
+
const hintId = hint ? `${id}-hint` : undefined;
|
|
104
|
+
const labelElementId = `${id}-label`;
|
|
105
|
+
const handleOnChange = useCallback((_, checked) => {
|
|
106
|
+
setInternalSwitchChecked(checked);
|
|
107
|
+
onChange?.({
|
|
108
|
+
checked,
|
|
109
|
+
value
|
|
110
|
+
});
|
|
111
|
+
}, [onChange, setInternalSwitchChecked, value]);
|
|
112
|
+
const renderSwitchComponent = useMemo(() => _jsx(_Switch, {
|
|
113
|
+
...inputValues,
|
|
114
|
+
disabled: isDisabled,
|
|
115
|
+
disableRipple: true,
|
|
116
|
+
inputProps: {
|
|
117
|
+
"aria-checked": internalSwitchChecked,
|
|
118
|
+
"aria-describedby": hintId,
|
|
119
|
+
"aria-label": label,
|
|
120
|
+
"aria-labelledby": labelElementId
|
|
121
|
+
},
|
|
122
|
+
name: _name ?? id,
|
|
123
|
+
onChange: handleOnChange
|
|
124
|
+
}), [handleOnChange, hintId, inputValues, internalSwitchChecked, id, isDisabled, label, labelElementId, _name]);
|
|
125
|
+
return _jsx(Box, {
|
|
126
|
+
sx: {
|
|
127
|
+
marginBlockEnd: odysseyDesignTokens.Spacing2
|
|
128
|
+
},
|
|
129
|
+
children: _jsx(_FormControlLabel, {
|
|
130
|
+
checked: internalSwitchChecked,
|
|
131
|
+
control: renderSwitchComponent,
|
|
132
|
+
"data-se": testId,
|
|
133
|
+
disabled: isDisabled,
|
|
134
|
+
id: labelElementId,
|
|
135
|
+
label: _jsx(SwitchLabel, {
|
|
136
|
+
checked: internalSwitchChecked,
|
|
137
|
+
hint: hint,
|
|
138
|
+
hintId: hintId,
|
|
139
|
+
isFullWidth: isFullWidth,
|
|
140
|
+
label: label
|
|
141
|
+
}),
|
|
142
|
+
labelPlacement: "start",
|
|
143
|
+
sx: {
|
|
144
|
+
justifyContent: "space-between",
|
|
145
|
+
alignItems: "flex-start",
|
|
146
|
+
gap: odysseyDesignTokens.Spacing4,
|
|
147
|
+
width: "100%",
|
|
148
|
+
maxWidth: isFullWidth ? "100%" : odysseyDesignTokens.TypographyLineLengthMax
|
|
149
|
+
},
|
|
150
|
+
value: value
|
|
151
|
+
})
|
|
152
|
+
});
|
|
153
|
+
};
|
|
154
|
+
const MemoizedSwitch = memo(Switch);
|
|
155
|
+
MemoizedSwitch.displayName = "Switch";
|
|
156
|
+
export { MemoizedSwitch as Switch };
|
|
157
|
+
//# sourceMappingURL=Switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.js","names":["memo","useCallback","useEffect","useMemo","useRef","useState","CONTROLLED","ComponentControlledState","useOdysseyDesignTokens","Box","FieldHint","useUniqueId","getControlState","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","SwitchLabel","_ref","checked","hint","hintId","isFullWidth","label","odysseyDesignTokens","children","sx","display","alignItems","flexWrap","gap","Spacing1","margin","maxWidth","TypographyLineLengthMax","fontWeight","TypographyWeightBodyBold","padding","backgroundColor","PaletteSuccessLighter","HueNeutral100","borderRadius","BorderRadiusMain","color","PaletteSuccessText","HueNeutral700","fontSize","TypographyScale0","lineHeight","TypographyLineHeightOverline","transitionProperty","transitionDuration","TransitionDurationMain","id","text","Switch","_ref2","_id","isChecked","isDefaultChecked","isDisabled","name","_name","onChange","testId","value","controlledStateRef","controlledValue","uncontrolledValue","inputValues","current","defaultChecked","internalSwitchChecked","setInternalSwitchChecked","Boolean","undefined","labelElementId","handleOnChange","_","renderSwitchComponent","_Switch","disabled","disableRipple","inputProps","marginBlockEnd","Spacing2","_FormControlLabel","control","labelPlacement","justifyContent","Spacing4","width","MemoizedSwitch","displayName"],"sources":["../../src/labs/Switch.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n memo,\n SyntheticEvent,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport {\n Switch as MuiSwitch,\n SwitchProps as MuiSwitchProps,\n FormControlLabel,\n} from \"@mui/material\";\n\nconst { CONTROLLED } = ComponentControlledState;\nimport { useOdysseyDesignTokens } from \"../OdysseyDesignTokensContext\";\nimport { Box } from \"../Box\";\nimport { FieldComponentProps } from \"../FieldComponentProps\";\nimport { FieldHint } from \"../FieldHint\";\nimport type { SeleniumProps } from \"../SeleniumProps\";\nimport { useUniqueId } from \"../useUniqueId\";\nimport { ComponentControlledState, getControlState } from \"../inputUtils\";\nimport { CheckedFieldProps } from \"../FormCheckedProps\";\n\ntype OnChangeCallbackArguments = {\n checked: boolean;\n value: string;\n};\n\nexport type SwitchProps = {\n /**\n * if `true`, the label and switch span entire containing element's width\n */\n isFullWidth?: boolean;\n /**\n * The label text for the Switch\n */\n label: string;\n /**\n * The change event handler for the Switch\n */\n onChange?: ({ checked, value }: OnChangeCallbackArguments) => void;\n /**\n * The value attribute of the Switch\n */\n value: string;\n} & Pick<\n FieldComponentProps,\n \"hint\" | \"id\" | \"isFullWidth\" | \"isDisabled\" | \"name\"\n> &\n CheckedFieldProps<MuiSwitchProps> &\n SeleniumProps;\n\ntype SwitchLabelProps = {\n checked: boolean;\n hint: SwitchProps[\"hint\"];\n hintId?: string;\n isFullWidth: SwitchProps[\"isFullWidth\"];\n label: SwitchProps[\"label\"];\n};\n\nconst SwitchLabel = ({\n checked,\n hint,\n hintId,\n isFullWidth,\n label,\n}: SwitchLabelProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n return (\n <>\n <Box\n sx={{\n display: \"flex\",\n alignItems: \"center\",\n flexWrap: \"wrap\",\n gap: odysseyDesignTokens.Spacing1,\n margin: 0,\n maxWidth: isFullWidth\n ? \"100%\"\n : odysseyDesignTokens.TypographyLineLengthMax,\n fontWeight: odysseyDesignTokens.TypographyWeightBodyBold,\n }}\n >\n {label}\n <Box\n sx={{\n padding: \"2px 4px\",\n backgroundColor: checked\n ? odysseyDesignTokens.PaletteSuccessLighter\n : odysseyDesignTokens.HueNeutral100,\n borderRadius: odysseyDesignTokens.BorderRadiusMain,\n color: checked\n ? odysseyDesignTokens.PaletteSuccessText\n : odysseyDesignTokens.HueNeutral700,\n fontWeight: odysseyDesignTokens.TypographyWeightBodyBold,\n fontSize: odysseyDesignTokens.TypographyScale0,\n lineHeight: odysseyDesignTokens.TypographyLineHeightOverline,\n transitionProperty: \"background-color, color\",\n transitionDuration: odysseyDesignTokens.TransitionDurationMain,\n }}\n >\n {checked ? \"Active\" : \"Inactive\"}\n </Box>\n </Box>\n {hint && <FieldHint id={hintId} text={hint} />}\n </>\n );\n};\n\nconst Switch = ({\n hint,\n id: _id,\n isChecked,\n isDefaultChecked,\n isDisabled,\n isFullWidth = false,\n label,\n name: _name,\n onChange,\n testId,\n value = \"Something\",\n}: SwitchProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: isChecked,\n uncontrolledValue: isDefaultChecked,\n })\n );\n const inputValues = useMemo(() => {\n if (controlledStateRef.current === CONTROLLED) {\n return { checked: isChecked };\n }\n return { defaultChecked: isDefaultChecked };\n }, [isDefaultChecked, isChecked]);\n\n const [internalSwitchChecked, setInternalSwitchChecked] = useState(\n controlledStateRef.current === CONTROLLED\n ? Boolean(isChecked)\n : Boolean(isDefaultChecked)\n );\n\n useEffect(() => {\n if (controlledStateRef.current === CONTROLLED) {\n setInternalSwitchChecked(Boolean(isChecked));\n }\n }, [isChecked]);\n\n const id = useUniqueId(_id);\n\n const hintId = hint ? `${id}-hint` : undefined;\n const labelElementId = `${id}-label`;\n\n const handleOnChange = useCallback(\n (_: SyntheticEvent<Element, Event>, checked: boolean) => {\n setInternalSwitchChecked(checked);\n onChange?.({ checked, value });\n },\n [onChange, setInternalSwitchChecked, value]\n );\n\n const renderSwitchComponent = useMemo(\n () => (\n <MuiSwitch\n {...inputValues}\n disabled={isDisabled}\n disableRipple\n inputProps={{\n \"aria-checked\": internalSwitchChecked,\n \"aria-describedby\": hintId,\n \"aria-label\": label,\n \"aria-labelledby\": labelElementId,\n }}\n name={_name ?? id}\n onChange={handleOnChange}\n />\n ),\n [\n handleOnChange,\n hintId,\n inputValues,\n internalSwitchChecked,\n id,\n isDisabled,\n label,\n labelElementId,\n _name,\n ]\n );\n\n return (\n <Box\n sx={{\n marginBlockEnd: odysseyDesignTokens.Spacing2,\n }}\n >\n <FormControlLabel\n checked={internalSwitchChecked}\n control={renderSwitchComponent}\n data-se={testId}\n disabled={isDisabled}\n id={labelElementId}\n label={\n <SwitchLabel\n checked={internalSwitchChecked}\n hint={hint}\n hintId={hintId}\n isFullWidth={isFullWidth}\n label={label}\n />\n }\n labelPlacement=\"start\"\n sx={{\n justifyContent: \"space-between\",\n alignItems: \"flex-start\",\n gap: odysseyDesignTokens.Spacing4,\n width: \"100%\",\n maxWidth: isFullWidth\n ? \"100%\"\n : odysseyDesignTokens.TypographyLineLengthMax,\n }}\n value={value}\n />\n </Box>\n );\n};\n\nconst MemoizedSwitch = memo(Switch);\nMemoizedSwitch.displayName = \"Switch\";\n\nexport { MemoizedSwitch as Switch };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,IAAI,EAEJC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AAOd,MAAM;EAAEC;AAAW,CAAC,GAAGC,wBAAwB;AAAC,SACvCC,sBAAsB;AAAA,SACtBC,GAAG;AAAA,SAEHC,SAAS;AAAA,SAETC,WAAW;AAAA,SACXJ,wBAAwB,EAAEK,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAwClD,MAAMC,WAAW,GAAGC,IAAA,IAMI;EAAA,IANH;IACnBC,OAAO;IACPC,IAAI;IACJC,MAAM;IACNC,WAAW;IACXC;EACgB,CAAC,GAAAL,IAAA;EACjB,MAAMM,mBAAmB,GAAGlB,sBAAsB,CAAC,CAAC;EAEpD,OACEQ,KAAA,CAAAE,SAAA;IAAAS,QAAA,GACEX,KAAA,CAACP,GAAG;MACFmB,EAAE,EAAE;QACFC,OAAO,EAAE,MAAM;QACfC,UAAU,EAAE,QAAQ;QACpBC,QAAQ,EAAE,M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IAAI,CAACyD,MAAM,CAAC;AACnCqC,cAAc,CAACC,WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAIrC,MAAM"}
|
package/dist/labs/index.js
CHANGED
package/dist/labs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["AdapterDateFns","LocalizationProvider"],"sources":["../../src/labs/index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport { AdapterDateFns } from \"@mui/x-date-pickers/AdapterDateFns\";\nexport { LocalizationProvider } from \"@mui/x-date-pickers\";\nexport type { LocalizationProviderProps } from \"@mui/x-date-pickers\";\n\nexport * from \"./DatePicker\";\nexport * from \"./datePickerTheme\";\n\nexport * from \"./DataTable\";\nexport * from \"./DataTablePagination\";\nexport * from \"./DataFilters\";\n\nexport * from \"./materialReactTableTypes\";\nexport * from \"./StaticTable\";\nexport * from \"./PaginatedTable\";\n\nexport * from \"./GroupPicker\";\nexport * from \"./VirtualizedAutocomplete\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,cAAc,QAAQ,oCAAoC;AACnE,SAASC,oBAAoB,QAAQ,qBAAqB;AAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["AdapterDateFns","LocalizationProvider"],"sources":["../../src/labs/index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport { AdapterDateFns } from \"@mui/x-date-pickers/AdapterDateFns\";\nexport { LocalizationProvider } from \"@mui/x-date-pickers\";\nexport type { LocalizationProviderProps } from \"@mui/x-date-pickers\";\n\nexport * from \"./DatePicker\";\nexport * from \"./datePickerTheme\";\n\nexport * from \"./DataTable\";\nexport * from \"./DataTablePagination\";\nexport * from \"./DataFilters\";\n\nexport * from \"./materialReactTableTypes\";\nexport * from \"./StaticTable\";\nexport * from \"./PaginatedTable\";\n\nexport * from \"./GroupPicker\";\nexport * from \"./VirtualizedAutocomplete\";\n\nexport * from \"./Switch\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,cAAc,QAAQ,oCAAoC;AACnE,SAASC,oBAAoB,QAAQ,qBAAqB;AAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA"}
|
package/dist/src/Button.d.ts
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import type { ButtonProps as MuiButtonProps } from "@mui/material";
|
|
13
13
|
import { ReactElement } from "react";
|
|
14
14
|
import type { SeleniumProps } from "./SeleniumProps";
|
|
15
|
+
import { FocusHandle } from "./@types/react-augment";
|
|
15
16
|
export declare const buttonSizeValues: readonly ["small", "medium", "large"];
|
|
16
17
|
export declare const buttonTypeValues: readonly ["button", "submit", "reset"];
|
|
17
18
|
export declare const buttonVariantValues: readonly ["primary", "secondary", "tertiary", "danger", "floating"];
|
|
@@ -28,6 +29,10 @@ export type ButtonProps = {
|
|
|
28
29
|
* The ID of the element that describes the Button
|
|
29
30
|
*/
|
|
30
31
|
ariaDescribedBy?: string;
|
|
32
|
+
/**
|
|
33
|
+
* The ref forwarded to the Button to expose focus()
|
|
34
|
+
*/
|
|
35
|
+
buttonFocusRef?: React.RefObject<FocusHandle>;
|
|
31
36
|
/**
|
|
32
37
|
* The icon element to display at the end of the Button
|
|
33
38
|
*/
|
|
@@ -85,6 +90,6 @@ export type ButtonProps = {
|
|
|
85
90
|
label?: "" | undefined;
|
|
86
91
|
startIcon?: ReactElement;
|
|
87
92
|
}) & SeleniumProps;
|
|
88
|
-
declare const MemoizedButton: import("react").MemoExoticComponent<({ ariaDescribedBy, ariaLabel, ariaLabelledBy, endIcon, id, isDisabled, isFullWidth, label, onClick, size, startIcon, testId, tooltipText, type, variant, }: ButtonProps) => JSX.Element>;
|
|
93
|
+
declare const MemoizedButton: import("react").MemoExoticComponent<({ ariaDescribedBy, ariaLabel, ariaLabelledBy, buttonFocusRef, endIcon, id, isDisabled, isFullWidth, label, onClick, size, startIcon, testId, tooltipText, type, variant, }: ButtonProps) => JSX.Element>;
|
|
89
94
|
export { MemoizedButton as Button };
|
|
90
95
|
//# sourceMappingURL=Button.d.ts.map
|
package/dist/src/Button.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,WAAW,IAAI,cAAc,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,WAAW,IAAI,cAAc,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAEL,YAAY,EAIb,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAE,aAAa,EAAE,MA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ACE,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,KAAK,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC;IACvB,SAAS,EAAE,YAAY,CAAC;CACzB,GACD;IACE,OAAO,EAAE,YAAY,CAAC;IACtB,KAAK,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC;IACvB,SAAS,CAAC,EAAE,YAAY,CAAC;CAC1B,CACJ,GACC,aAAa,CAAC;AAyFhB,QAAA,MAAM,cAAc,mNAtEjB,WAAW,iBAsEqB,CAAC;AAGpC,OAAO,EAAE,cAAc,IAAI,MAAM,EAAE,CAAC"}
|
package/dist/src/Checkbox.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { CheckboxProps as MuiCheckboxProps, FormControlLabelProps as MuiFormCont
|
|
|
14
14
|
import { FieldComponentProps } from "./FieldComponentProps";
|
|
15
15
|
import type { SeleniumProps } from "./SeleniumProps";
|
|
16
16
|
import { CheckedFieldProps } from "./FormCheckedProps";
|
|
17
|
+
import { FocusHandle } from "./@types/react-augment";
|
|
17
18
|
export declare const checkboxValidityValues: readonly ["valid", "invalid", "inherit"];
|
|
18
19
|
export type CheckboxProps = {
|
|
19
20
|
/**
|
|
@@ -28,6 +29,10 @@ export type CheckboxProps = {
|
|
|
28
29
|
* The id of the `input` element.
|
|
29
30
|
*/
|
|
30
31
|
id?: string;
|
|
32
|
+
/**
|
|
33
|
+
* The ref forwarded to the Checkbox to expose focus()
|
|
34
|
+
*/
|
|
35
|
+
inputFocusRef?: React.RefObject<FocusHandle>;
|
|
31
36
|
/**
|
|
32
37
|
* Determines whether the Checkbox is disabled
|
|
33
38
|
*/
|
|
@@ -61,6 +66,6 @@ export type CheckboxProps = {
|
|
|
61
66
|
*/
|
|
62
67
|
onBlur?: MuiFormControlLabelProps["onBlur"];
|
|
63
68
|
} & Pick<FieldComponentProps, "id" | "isDisabled" | "name"> & CheckedFieldProps<MuiCheckboxProps> & SeleniumProps;
|
|
64
|
-
declare const MemoizedCheckbox: import("react").MemoExoticComponent<({ ariaLabel, ariaLabelledBy, id: idOverride, isChecked, isDefaultChecked, isDisabled, isIndeterminate, isRequired, label: labelProp, hint, name: nameOverride, onChange: onChangeProp, onBlur: onBlurProp, testId, validity, value, }: CheckboxProps) => JSX.Element>;
|
|
69
|
+
declare const MemoizedCheckbox: import("react").MemoExoticComponent<({ ariaLabel, ariaLabelledBy, id: idOverride, inputFocusRef, isChecked, isDefaultChecked, isDisabled, isIndeterminate, isRequired, label: labelProp, hint, name: nameOverride, onChange: onChangeProp, onBlur: onBlurProp, testId, validity, value, }: CheckboxProps) => JSX.Element>;
|
|
65
70
|
export { MemoizedCheckbox as Checkbox };
|
|
66
71
|
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../src/Checkbox.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;;AAIH,OAAO,EAEL,aAAa,IAAI,gBAAgB,EAEjC,qBAAqB,IAAI,wBAAwB,EAElD,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../src/Checkbox.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;;AAIH,OAAO,EAEL,aAAa,IAAI,gBAAgB,EAEjC,qBAAqB,IAAI,wBAAwB,EAElD,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,eAAO,MAAM,sBAAsB,0CAA2C,CAAC;AAE/E,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAC7C;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;IACnD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,wBAAwB,CAAC,QAAQ,CAAC,CAAC;CAC7C,GAAG,IAAI,CAAC,mBAAmB,EAAE,IAAI,GAAG,YAAY,GAAG,MAAM,CAAC,GACzD,iBAAiB,CAAC,gBAAgB,CAAC,GACnC,aAAa,CAAC;AAoHhB,QAAA,MAAM,gBAAgB,6RAhGnB,aAAa,iBAgGuB,CAAC;AAGxC,OAAO,EAAE,gBAAgB,IAAI,QAAQ,EAAE,CAAC"}
|
package/dist/src/Link.d.ts
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import { ReactElement } from "react";
|
|
13
13
|
import type { SeleniumProps } from "./SeleniumProps";
|
|
14
14
|
import { LinkProps as MuiLinkProps } from "@mui/material";
|
|
15
|
+
import { FocusHandle } from "./@types/react-augment";
|
|
15
16
|
export declare const linkVariantValues: readonly ["default", "monochrome"];
|
|
16
17
|
export type LinkProps = {
|
|
17
18
|
/**
|
|
@@ -26,6 +27,10 @@ export type LinkProps = {
|
|
|
26
27
|
* An optional Icon component at the start of the Link
|
|
27
28
|
*/
|
|
28
29
|
icon?: ReactElement;
|
|
30
|
+
/**
|
|
31
|
+
* The ref forwarded to the TextField to expose focus()
|
|
32
|
+
*/
|
|
33
|
+
linkFocusRef?: React.RefObject<FocusHandle>;
|
|
29
34
|
/**
|
|
30
35
|
* The click event handler for the Link
|
|
31
36
|
*/
|
|
@@ -43,6 +48,6 @@ export type LinkProps = {
|
|
|
43
48
|
*/
|
|
44
49
|
variant?: (typeof linkVariantValues)[number];
|
|
45
50
|
} & SeleniumProps;
|
|
46
|
-
declare const MemoizedLink: import("react").MemoExoticComponent<({ children, href, icon, rel, target, testId, variant, onClick, }: LinkProps) => JSX.Element>;
|
|
51
|
+
declare const MemoizedLink: import("react").MemoExoticComponent<({ children, href, icon, linkFocusRef, rel, target, testId, variant, onClick, }: LinkProps) => JSX.Element>;
|
|
47
52
|
export { MemoizedLink as Link };
|
|
48
53
|
//# sourceMappingURL=Link.d.ts.map
|
package/dist/src/Link.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/Link.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAQ,YAAY,
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/Link.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAQ,YAAY,EAA+B,MAAM,OAAO,CAAC;AAExE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,EAAmB,SAAS,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,eAAO,MAAM,iBAAiB,oCAAqC,CAAC;AAEpE,MAAM,MAAM,SAAS,GAAG;IACtB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAC5C;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IAClC;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,MAAM,CAAC,EACH,OAAO,GACP,QAAQ,GACR,SAAS,GACT,MAAM,GACN,CAAC,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;IACpC;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;CAC9C,GAAG,aAAa,CAAC;AAkDlB,QAAA,MAAM,YAAY,uHAtCf,SAAS,iBAsCmB,CAAC;AAIhC,OAAO,EAAE,YAAY,IAAI,IAAI,EAAE,CAAC"}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import { ChangeEventHandler, FocusEventHandler } from "react";
|
|
13
13
|
import { FieldComponentProps } from "./FieldComponentProps";
|
|
14
14
|
import type { SeleniumProps } from "./SeleniumProps";
|
|
15
|
+
import { FocusHandle } from "./@types/react-augment";
|
|
15
16
|
export type PasswordFieldProps = {
|
|
16
17
|
/**
|
|
17
18
|
* This prop helps users to fill forms faster, especially on mobile devices.
|
|
@@ -31,6 +32,10 @@ export type PasswordFieldProps = {
|
|
|
31
32
|
* If `true`, the show/hide icon is not shown to the user
|
|
32
33
|
*/
|
|
33
34
|
hasShowPassword?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* The ref forwarded to the TextField to expose focus()
|
|
37
|
+
*/
|
|
38
|
+
inputFocusRef?: React.RefObject<FocusHandle>;
|
|
34
39
|
/**
|
|
35
40
|
* The label for the `input` element.
|
|
36
41
|
*/
|
|
@@ -75,6 +80,10 @@ declare const MemoizedPasswordField: import("react").MemoExoticComponent<import(
|
|
|
75
80
|
* If `true`, the show/hide icon is not shown to the user
|
|
76
81
|
*/
|
|
77
82
|
hasShowPassword?: boolean | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* The ref forwarded to the TextField to expose focus()
|
|
85
|
+
*/
|
|
86
|
+
inputFocusRef?: import("react").RefObject<FocusHandle> | undefined;
|
|
78
87
|
/**
|
|
79
88
|
* The label for the `input` element.
|
|
80
89
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordField.d.ts","sourceRoot":"","sources":["../../src/PasswordField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EACL,kBAAkB,EAClB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"PasswordField.d.ts","sourceRoot":"","sources":["../../src/PasswordField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,kBAAkB,GAAG,cAAc,CAAC;IACvD;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IAC7C;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,CAAC;IACnE;;OAEG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAAC;IACtE;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,CAAC;IACpE;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,mBAAmB,GACrB,aAAa,CAAC;AAyJhB,QAAA,MAAM,qBAAqB;IAxMzB;;;;OAIG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;WACI,MAAM;IACb;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;2FA4J4C,CAAC;AAGlD,OAAO,EAAE,qBAAqB,IAAI,aAAa,EAAE,CAAC"}
|
package/dist/src/Radio.d.ts
CHANGED
|
@@ -13,7 +13,12 @@
|
|
|
13
13
|
import { FormControlLabelProps as MuiFormControlLabelProps, RadioProps as MuiRadioProps } from "@mui/material";
|
|
14
14
|
import { FieldComponentProps } from "./FieldComponentProps";
|
|
15
15
|
import type { SeleniumProps } from "./SeleniumProps";
|
|
16
|
+
import { FocusHandle } from "./@types/react-augment";
|
|
16
17
|
export type RadioProps = {
|
|
18
|
+
/**
|
|
19
|
+
* The ref forwarded to the Radio to expose focus()
|
|
20
|
+
*/
|
|
21
|
+
inputFocusRef?: React.RefObject<FocusHandle>;
|
|
17
22
|
/**
|
|
18
23
|
* If `true`, the Radio is selected
|
|
19
24
|
*/
|
|
@@ -39,6 +44,6 @@ export type RadioProps = {
|
|
|
39
44
|
*/
|
|
40
45
|
onBlur?: MuiFormControlLabelProps["onBlur"];
|
|
41
46
|
} & Pick<FieldComponentProps, "isDisabled" | "name"> & SeleniumProps;
|
|
42
|
-
declare const MemoizedRadio: import("react").MemoExoticComponent<({ isChecked, isDisabled, isInvalid, label, name, testId, value, onChange: onChangeProp, onBlur: onBlurProp, }: RadioProps) => JSX.Element>;
|
|
47
|
+
declare const MemoizedRadio: import("react").MemoExoticComponent<({ inputFocusRef, isChecked, isDisabled, isInvalid, label, name, testId, value, onChange: onChangeProp, onBlur: onBlurProp, }: RadioProps) => JSX.Element>;
|
|
43
48
|
export { MemoizedRadio as Radio };
|
|
44
49
|
//# sourceMappingURL=Radio.d.ts.map
|
package/dist/src/Radio.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../src/Radio.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;;AAEH,OAAO,EAEL,qBAAqB,IAAI,wBAAwB,EAEjD,UAAU,IAAI,aAAa,EAC5B,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IACrC;;OAEG;IACH,MAAM,CAAC,EAAE,wBAAwB,CAAC,QAAQ,CAAC,CAAC;CAC7C,GAAG,IAAI,CAAC,mBAAmB,EAAE,YAAY,GAAG,MAAM,CAAC,GAClD,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../src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