@okta/odyssey-react-mui 1.13.8 → 1.13.10

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 CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.13.10](https://github.com/okta/odyssey/compare/v1.13.9...v1.13.10) (2024-02-14)
7
+
8
+ **Note:** Version bump only for package @okta/odyssey-react-mui
9
+
10
+ ## [1.13.9](https://github.com/okta/odyssey/compare/v1.13.8...v1.13.9) (2024-02-14)
11
+
12
+ **Note:** Version bump only for package @okta/odyssey-react-mui
13
+
6
14
  ## [1.13.8](https://github.com/okta/odyssey/compare/v1.13.7...v1.13.8) (2024-02-14)
7
15
 
8
16
  **Note:** Version bump only for package @okta/odyssey-react-mui
package/dist/Button.js CHANGED
@@ -18,7 +18,10 @@ export const buttonSizeValues = ["small", "medium", "large"];
18
18
  export const buttonTypeValues = ["button", "submit", "reset"];
19
19
  export const buttonVariantValues = ["primary", "secondary", "danger", "floating"];
20
20
  const Button = ({
21
+ ariaControls,
21
22
  ariaDescribedBy,
23
+ ariaExpanded,
24
+ ariaHasPopup,
22
25
  ariaLabel,
23
26
  ariaLabelledBy,
24
27
  buttonRef,
@@ -51,9 +54,12 @@ const Button = ({
51
54
  muiProps?.ref?.(localButtonRef.current);
52
55
  return _jsx(_Button, {
53
56
  ...muiProps,
57
+ "aria-controls": ariaControls,
58
+ "aria-describedby": ariaDescribedBy,
59
+ "aria-expanded": ariaExpanded,
60
+ "aria-haspopup": ariaHasPopup,
54
61
  "aria-label": ariaLabel,
55
62
  "aria-labelledby": ariaLabelledBy,
56
- "aria-describedby": ariaDescribedBy,
57
63
  "data-se": testId,
58
64
  disabled: isDisabled,
59
65
  endIcon: endIcon,
@@ -69,7 +75,7 @@ const Button = ({
69
75
  variant: variant,
70
76
  children: label
71
77
  });
72
- }, [ariaDescribedBy, ariaLabel, ariaLabelledBy, endIcon, id, isDisabled, isFullWidth, label, onClick, size, startIcon, tabIndex, testId, translate, type, variant]);
78
+ }, [ariaControls, ariaDescribedBy, ariaExpanded, ariaHasPopup, ariaLabel, ariaLabelledBy, endIcon, id, isDisabled, isFullWidth, label, onClick, size, startIcon, tabIndex, testId, translate, type, variant]);
73
79
  if (tooltipText) {
74
80
  return _jsx(Tooltip, {
75
81
  ariaType: "description",
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","names":["memo","useCallback","useImperativeHandle","useRef","MuiPropsContext","useMuiProps","Tooltip","jsx","_jsx","buttonSizeValues","buttonTypeValues","buttonVariantValues","Button","ariaDescribedBy","ariaLabel","ariaLabelledBy","buttonRef","endIcon","id","isDisabled","isFullWidth","label","onClick","size","startIcon","tabIndex","testId","tooltipText","translate","type","variant","variantProp","muiProps","localButtonRef","focus","current","renderButton","ref","_Button","disabled","fullWidth","children","ariaType","placement","text","Consumer","MemoizedButton","displayName"],"sources":["../src/Button.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 { Button as MuiButton } from \"@mui/material\";\nimport type { ButtonProps as MuiButtonProps } from \"@mui/material\";\nimport {\n ComponentProps,\n HTMLAttributes,\n memo,\n ReactElement,\n useCallback,\n useImperativeHandle,\n useRef,\n} from \"react\";\n\nimport { MuiPropsContext, useMuiProps } from \"./MuiPropsContext\";\nimport { Tooltip } from \"./Tooltip\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { FocusHandle } from \"./inputUtils\";\n\nexport const buttonSizeValues = [\"small\", \"medium\", \"large\"] as const;\nexport const buttonTypeValues = [\"button\", \"submit\", \"reset\"] as const;\nexport const buttonVariantValues = [\n \"primary\",\n \"secondary\",\n \"danger\",\n \"floating\",\n] as const;\n\nexport type ButtonProps = {\n /**\n * The global `aria-controls` property identifies the element (or elements) whose contents or presence are controlled by the element on which this attribute is set.\n *\n * value: A space-separated list of one or more ID values referencing the elements being controlled by the current element\n */\n ariaControls?: ComponentProps<\"button\">[\"aria-controls\"];\n /**\n * The `aria-expanded` attribute is set on an element to indicate if a control is expanded or collapsed, and whether or not the controlled elements are displayed or hidden.\n */\n ariaExpanded?: ComponentProps<\"button\">[\"aria-expanded\"];\n /**\n * The `aria-haspopup` attribute indicates the availability and type of interactive popup element that can be triggered by the element on which the attribute is set.\n */\n ariaHasPopup?: ComponentProps<\"button\">[\"aria-haspopup\"];\n /**\n * The ARIA label for the Button\n */\n ariaLabel?: string;\n /**\n * The ID of the element that labels the Button\n */\n ariaLabelledBy?: string;\n /**\n * The ID of the element that describes the Button\n */\n ariaDescribedBy?: string;\n /**\n * The ref forwarded to the Button\n */\n buttonRef?: React.RefObject<FocusHandle>;\n /**\n * The icon element to display at the end of the Button\n */\n endIcon?: ReactElement;\n /**\n * The ID of the Button\n */\n id?: string;\n /**\n * Determines whether the Button is disabled\n */\n isDisabled?: boolean;\n /**\n * Determines whether the Button should take up the full available width\n */\n isFullWidth?: boolean;\n /**\n * The text content of the Button\n */\n label?: string;\n /**\n * The click event handler for the Button\n */\n onClick?: MuiButtonProps[\"onClick\"];\n /**\n * The size of the button\n */\n size?: (typeof buttonSizeValues)[number];\n /**\n * The icon element to display at the start of the Button\n */\n startIcon?: ReactElement;\n tabIndex?: HTMLAttributes<HTMLElement>[\"tabIndex\"];\n /**\n * The tooltip text for the Button if it's icon-only\n */\n tooltipText?: string;\n /**\n * The type of the HTML button element\n */\n type?: (typeof buttonTypeValues)[number];\n /**\n * The variant of the Button\n */\n variant: (typeof buttonVariantValues)[number] | \"tertiary\";\n} & (\n | {\n endIcon?: ReactElement;\n label: string;\n startIcon?: ReactElement;\n }\n | {\n endIcon?: ReactElement;\n label?: \"\" | undefined;\n startIcon: ReactElement;\n }\n | {\n endIcon: ReactElement;\n label?: \"\" | undefined;\n startIcon?: ReactElement;\n }\n) &\n HtmlProps;\n\nconst Button = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n buttonRef,\n endIcon,\n id,\n isDisabled,\n isFullWidth,\n label = \"\",\n onClick,\n size = \"medium\",\n startIcon,\n tabIndex,\n testId,\n tooltipText,\n translate,\n type = \"button\",\n variant: variantProp,\n}: ButtonProps) => {\n const muiProps = useMuiProps();\n\n // We're deprecating the \"tertiary\" variant, so map it to\n // \"secondary\" in lieu of making a breaking change\n const variant = variantProp === \"tertiary\" ? \"secondary\" : variantProp;\n const localButtonRef = useRef<HTMLButtonElement>(null);\n\n useImperativeHandle(\n buttonRef,\n () => {\n return {\n focus: () => {\n localButtonRef.current?.focus();\n },\n };\n },\n []\n );\n\n const renderButton = useCallback(\n (muiProps) => {\n muiProps?.ref?.(localButtonRef.current);\n\n return (\n <MuiButton\n {...muiProps}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n data-se={testId}\n disabled={isDisabled}\n endIcon={endIcon}\n fullWidth={isFullWidth}\n id={id}\n onClick={onClick}\n ref={localButtonRef}\n size={size}\n startIcon={startIcon}\n tabIndex={tabIndex}\n translate={translate}\n type={type}\n variant={variant}\n >\n {label}\n </MuiButton>\n );\n },\n [\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n endIcon,\n id,\n isDisabled,\n isFullWidth,\n label,\n onClick,\n size,\n startIcon,\n tabIndex,\n testId,\n translate,\n type,\n variant,\n ]\n );\n\n if (tooltipText) {\n return (\n <Tooltip ariaType=\"description\" placement=\"top\" text={tooltipText}>\n <MuiPropsContext.Consumer>{renderButton}</MuiPropsContext.Consumer>\n </Tooltip>\n );\n }\n\n return renderButton(muiProps);\n};\n\nconst MemoizedButton = memo(Button);\nMemoizedButton.displayName = \"Button\";\n\nexport { MemoizedButton as Button };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA,SAGEA,IAAI,EAEJC,WAAW,EACXC,mBAAmB,EACnBC,MAAM,QACD,OAAO;AAAC,SAENC,eAAe,EAAEC,WAAW;AAAA,SAC5BC,OAAO;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAIhB,OAAO,MAAMC,gBAAgB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAU;AACrE,OAAO,MAAMC,gBAAgB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAU;AACtE,OAAO,MAAMC,mBAAmB,GAAG,CACjC,SAAS,EACT,WAAW,EACX,QAAQ,EACR,UAAU,CACF;AAiGV,MAAMC,MAAM,GAAGA,CAAC;EACdC,eAAe;EACfC,SAAS;EACTC,cAAc;EACdC,SAAS;EACTC,OAAO;EACPC,EAAE;EACFC,UAAU;EACVC,WAAW;EACXC,KAAK,GAAG,EAAE;EACVC,OAAO;EACPC,IAAI,GAAG,QAAQ;EACfC,SAAS;EACTC,QAAQ;EACRC,MAAM;EACNC,WAAW;EACXC,SAAS;EACTC,IAAI,GAAG,QAAQ;EACfC,OAAO,EAAEC;AACE,CAAC,KAAK;EACjB,MAAMC,QAAQ,GAAG3B,WAAW,CAAC,CAAC;EAI9B,MAAMyB,OAAO,GAAGC,WAAW,KAAK,UAAU,GAAG,WAAW,GAAGA,WAAW;EACtE,MAAME,cAAc,GAAG9B,MAAM,CAAoB,IAAI,CAAC;EAEtDD,mBAAmB,CACjBc,SAAS,EACT,MAAM;IACJ,OAAO;MACLkB,KAAK,EAAEA,CAAA,KAAM;QACXD,cAAc,CAACE,OAAO,EAAED,KAAK,CAAC,CAAC;MACjC;IACF,CAAC;EACH,CAAC,EACD,EACF,CAAC;E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SAASD,cAAc,IAAIlC,MAAM"}
1
+ {"version":3,"file":"Button.js","names":["memo","useCallback","useImperativeHandle","useRef","MuiPropsContext","useMuiProps","Tooltip","jsx","_jsx","buttonSizeValues","buttonTypeValues","buttonVariantValues","Button","ariaControls","ariaDescribedBy","ariaExpanded","ariaHasPopup","ariaLabel","ariaLabelledBy","buttonRef","endIcon","id","isDisabled","isFullWidth","label","onClick","size","startIcon","tabIndex","testId","tooltipText","translate","type","variant","variantProp","muiProps","localButtonRef","focus","current","renderButton","ref","_Button","disabled","fullWidth","children","ariaType","placement","text","Consumer","MemoizedButton","displayName"],"sources":["../src/Button.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 { Button as MuiButton } from \"@mui/material\";\nimport type { ButtonProps as MuiButtonProps } from \"@mui/material\";\nimport {\n ComponentProps,\n HTMLAttributes,\n memo,\n ReactElement,\n useCallback,\n useImperativeHandle,\n useRef,\n} from \"react\";\n\nimport { MuiPropsContext, useMuiProps } from \"./MuiPropsContext\";\nimport { Tooltip } from \"./Tooltip\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { FocusHandle } from \"./inputUtils\";\n\nexport const buttonSizeValues = [\"small\", \"medium\", \"large\"] as const;\nexport const buttonTypeValues = [\"button\", \"submit\", \"reset\"] as const;\nexport const buttonVariantValues = [\n \"primary\",\n \"secondary\",\n \"danger\",\n \"floating\",\n] as const;\n\nexport type ButtonProps = {\n /**\n * The global `aria-controls` property identifies the element (or elements) whose contents or presence are controlled by the element on which this attribute is set.\n *\n * value: A space-separated list of one or more ID values referencing the elements being controlled by the current element\n */\n ariaControls?: ComponentProps<\"button\">[\"aria-controls\"];\n /**\n * The `aria-expanded` attribute is set on an element to indicate if a control is expanded or collapsed, and whether or not the controlled elements are displayed or hidden.\n */\n ariaExpanded?: ComponentProps<\"button\">[\"aria-expanded\"];\n /**\n * The `aria-haspopup` attribute indicates the availability and type of interactive popup element that can be triggered by the element on which the attribute is set.\n */\n ariaHasPopup?: ComponentProps<\"button\">[\"aria-haspopup\"];\n /**\n * The ARIA label for the Button\n */\n ariaLabel?: string;\n /**\n * The ID of the element that labels the Button\n */\n ariaLabelledBy?: string;\n /**\n * The ID of the element that describes the Button\n */\n ariaDescribedBy?: string;\n /**\n * The ref forwarded to the Button\n */\n buttonRef?: React.RefObject<FocusHandle>;\n /**\n * The icon element to display at the end of the Button\n */\n endIcon?: ReactElement;\n /**\n * The ID of the Button\n */\n id?: string;\n /**\n * Determines whether the Button is disabled\n */\n isDisabled?: boolean;\n /**\n * Determines whether the Button should take up the full available width\n */\n isFullWidth?: boolean;\n /**\n * The text content of the Button\n */\n label?: string;\n /**\n * The click event handler for the Button\n */\n onClick?: MuiButtonProps[\"onClick\"];\n /**\n * The size of the button\n */\n size?: (typeof buttonSizeValues)[number];\n /**\n * The icon element to display at the start of the Button\n */\n startIcon?: ReactElement;\n tabIndex?: HTMLAttributes<HTMLElement>[\"tabIndex\"];\n /**\n * The tooltip text for the Button if it's icon-only\n */\n tooltipText?: string;\n /**\n * The type of the HTML button element\n */\n type?: (typeof buttonTypeValues)[number];\n /**\n * The variant of the Button\n */\n variant: (typeof buttonVariantValues)[number] | \"tertiary\";\n} & (\n | {\n endIcon?: ReactElement;\n label: string;\n startIcon?: ReactElement;\n }\n | {\n endIcon?: ReactElement;\n label?: \"\" | undefined;\n startIcon: ReactElement;\n }\n | {\n endIcon: ReactElement;\n label?: \"\" | undefined;\n startIcon?: ReactElement;\n }\n) &\n HtmlProps;\n\nconst Button = ({\n ariaControls,\n ariaDescribedBy,\n ariaExpanded,\n ariaHasPopup,\n ariaLabel,\n ariaLabelledBy,\n buttonRef,\n endIcon,\n id,\n isDisabled,\n isFullWidth,\n label = \"\",\n onClick,\n size = \"medium\",\n startIcon,\n tabIndex,\n testId,\n tooltipText,\n translate,\n type = \"button\",\n variant: variantProp,\n}: ButtonProps) => {\n const muiProps = useMuiProps();\n\n // We're deprecating the \"tertiary\" variant, so map it to\n // \"secondary\" in lieu of making a breaking change\n const variant = variantProp === \"tertiary\" ? \"secondary\" : variantProp;\n const localButtonRef = useRef<HTMLButtonElement>(null);\n\n useImperativeHandle(\n buttonRef,\n () => {\n return {\n focus: () => {\n localButtonRef.current?.focus();\n },\n };\n },\n []\n );\n\n const renderButton = useCallback(\n (muiProps) => {\n muiProps?.ref?.(localButtonRef.current);\n\n return (\n <MuiButton\n {...muiProps}\n aria-controls={ariaControls}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n data-se={testId}\n disabled={isDisabled}\n endIcon={endIcon}\n fullWidth={isFullWidth}\n id={id}\n onClick={onClick}\n ref={localButtonRef}\n size={size}\n startIcon={startIcon}\n tabIndex={tabIndex}\n translate={translate}\n type={type}\n variant={variant}\n >\n {label}\n </MuiButton>\n );\n },\n [\n ariaControls,\n ariaDescribedBy,\n ariaExpanded,\n ariaHasPopup,\n ariaLabel,\n ariaLabelledBy,\n endIcon,\n id,\n isDisabled,\n isFullWidth,\n label,\n onClick,\n size,\n startIcon,\n tabIndex,\n testId,\n translate,\n type,\n variant,\n ]\n );\n\n if (tooltipText) {\n return (\n <Tooltip ariaType=\"description\" placement=\"top\" text={tooltipText}>\n <MuiPropsContext.Consumer>{renderButton}</MuiPropsContext.Consumer>\n </Tooltip>\n );\n }\n\n return renderButton(muiProps);\n};\n\nconst MemoizedButton = memo(Button);\nMemoizedButton.displayName = \"Button\";\n\nexport { MemoizedButton as Button };\n"],"mapp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AAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAIrC,MAAM"}
package/dist/Form.js CHANGED
@@ -27,9 +27,11 @@ const Form = ({
27
27
  encodingType,
28
28
  formActions,
29
29
  id: idOverride,
30
+ isFullWidth,
30
31
  method,
31
32
  name,
32
33
  noValidate = false,
34
+ onSubmit,
33
35
  target,
34
36
  testId,
35
37
  title,
@@ -45,9 +47,10 @@ const Form = ({
45
47
  method: method,
46
48
  name: name,
47
49
  noValidate: noValidate,
50
+ onSubmit: onSubmit,
48
51
  target: target,
49
52
  sx: {
50
- maxWidth: theme => theme.mixins.maxWidth,
53
+ maxWidth: theme => isFullWidth ? "100%" : theme.mixins.maxWidth,
51
54
  margin: theme => theme.spacing(0),
52
55
  padding: theme => theme.spacing(0)
53
56
  },
@@ -71,7 +74,7 @@ const Form = ({
71
74
  component: "div",
72
75
  sx: {
73
76
  display: "flex",
74
- justifyContent: "flex-start",
77
+ justifyContent: "flex-end",
75
78
  gap: theme => theme.spacing(1),
76
79
  marginBlockStart: theme => theme.spacing(7)
77
80
  },
package/dist/Form.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Form.js","names":["memo","Heading4","Support","useUniqueId","jsx","_jsx","jsxs","_jsxs","formEncodingTypeValues","formAutoCompleteTypeValues","formMethodValues","Form","alert","autoCompleteType","children","description","encodingType","formActions","id","idOverride","method","name","noValidate","target","testId","title","translate","_Box","autoComplete","component","encType","sx","maxWidth","theme","mixins","margin","spacing","padding","marginBlockEnd","display","justifyContent","gap","marginBlockStart","MemoizedForm","displayName"],"sources":["../src/Form.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 { memo, ReactElement } from \"react\";\n\nimport { Box } from \"@mui/material\";\nimport { Button } from \"./Button\";\nimport { Callout } from \"./Callout\";\nimport { Heading4, Support } from \"./Typography\";\nimport { useUniqueId } from \"./useUniqueId\";\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport const formEncodingTypeValues = [\n \"application/x-www-form-urlencoded\",\n \"application/json\",\n \"multipart/form-data\",\n \"text/plain\",\n] as const;\nexport const formAutoCompleteTypeValues = [\"on\", \"off\"] as const;\nexport const formMethodValues = [\"post\", \"get\", \"dialog\"] as const;\n\nexport type FormProps = {\n /**\n * A Callout indicating a Form-wide error or status update.\n */\n alert?: ReactElement<typeof Callout>;\n /**\n * Indicates whether input elements can by default have their values automatically completed by the browser.\n * `autocomplete` attributes on form elements override it on <form>\n */\n autoCompleteType?: (typeof formAutoCompleteTypeValues)[number];\n /**\n * The Field or FieldSet components within the Form\n */\n children: ReactElement | Array<ReactElement>;\n /**\n * A supplementary description\n */\n description?: string;\n /**\n * If the value of the method attribute is post, enctype is the MIME type of the form submission.\n * This value can be overridden by formenctype attributes on <button>, <input type=\"submit\">, or <input type=\"image\"> elements.\n */\n encodingType?: (typeof formEncodingTypeValues)[number];\n /**\n * The Field or FieldGroup components within the Form\n */\n formActions?:\n | ReactElement<typeof Button>\n | Array<ReactElement<typeof Button>>;\n /**\n * Defines a unique identifier (ID) which must be unique in the whole document.\n */\n id?: string;\n /**\n * The HTTP method to submit the form with.\n * This value is overridden by formmethod attributes on <button>, <input type=\"submit\">, or <input type=\"image\"> elements.\n */\n method?: (typeof formMethodValues)[number];\n /**\n * The name of the form. The value must not be the empty string, and must be unique among the form elements in the forms collection that it is in, if any.\n */\n name: string;\n /**\n * This Boolean attribute indicates that the form shouldn't be validated when submitted.\n * If this attribute is not set (and therefore the form is validated),\n * it can be overridden by a formnovalidate attribute on a <button>, <input type=\"submit\">, or <input type=\"image\"> element belonging to the form.\n */\n noValidate?: boolean;\n /**\n * Indicates where to display the response after submitting the form. It is a name/keyword for a browsing context (for example, tab, window, or iframe).\n * This value can be overridden by a formtarget attribute on a <button>, <input type=\"submit\">, or <input type=\"image\"> element.\n */\n target?: string;\n /**\n * The title of the Form\n */\n title?: string;\n} & HtmlProps;\n\nconst Form = ({\n alert,\n autoCompleteType,\n children,\n description,\n encodingType,\n formActions,\n id: idOverride,\n method,\n name,\n noValidate = false,\n target,\n testId,\n title,\n translate,\n}: FormProps) => {\n const id = useUniqueId(idOverride);\n\n return (\n <Box\n autoComplete={autoCompleteType}\n component=\"form\"\n data-se={testId}\n encType={encodingType}\n id={id}\n method={method}\n name={name}\n noValidate={noValidate}\n target={target}\n sx={{\n maxWidth: (theme) => theme.mixins.maxWidth,\n margin: (theme) => theme.spacing(0),\n padding: (theme) => theme.spacing(0),\n }}\n >\n <Box\n component=\"div\"\n sx={{\n marginBlockEnd: (theme) => theme.spacing(4),\n }}\n >\n {title && (\n <Heading4 component=\"h1\" translate={translate}>\n {title}\n </Heading4>\n )}\n {description && <Support translate={translate}>{description}</Support>}\n {alert}\n </Box>\n <Box component=\"div\">{children}</Box>\n {formActions && (\n <Box\n component=\"div\"\n sx={{\n display: \"flex\",\n justifyContent: \"flex-start\",\n gap: (theme) => theme.spacing(1),\n marginBlockStart: (theme) => theme.spacing(7),\n }}\n >\n {formActions}\n </Box>\n )}\n </Box>\n );\n};\n\nconst MemoizedForm = memo(Form);\nMemoizedForm.displayName = \"Form\";\n\nexport { MemoizedForm as Form };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAsB,OAAO;AAAC,SAKlCC,QAAQ,EAAEC,OAAO;AAAA,SACjBC,WAAW;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAGpB,OAAO,MAAMC,sBAAsB,GAAG,CACpC,mCAAmC,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AAEA,SAAU;QAAAZ,QAAA,EAC3CW;MAAK,CACE,CACX,EACAV,WAAW,IAAIV,IAAA,CAACH,OAAO;QAACwB,SAAS,EAAEA,SAAU;QAAAZ,QAAA,EAAEC;MAAW,CAAU,CAAC,EACrEH,KAAK;IAAA,CACH,CAAC,EACNP,IAAA,CAAAsB,IAAA;MAAKE,SAAS,EAAC,KAAK;MAAAf,QAAA,EAAEA;IAAQ,CAAM,CAAC,EACpCG,WAAW,IACVZ,IAAA,CAAAsB,IAAA;MACEE,SAAS,EAAC,KAAK;MACfE,EAAE,EAAE;QACFQ,OAAO,EAAE,MAAM;QACfC,cAAc,EAAE,YAAY;QAC5BC,GAAG,EAAGR,KAAK,IAAKA,KAAK,CAACG,OAAO,CAAC,CAAC,CAAC;QAChCM,gBAAgB,EAAGT,KAAK,IAAKA,KAAK,CAACG,OAAO,CAAC,CAAC;MAC9C,CAAE;MAAAtB,QAAA,EAEDG;IAAW,CACT,CACN;EAAA,CACE,CAAC;AAEV,CAAC;AAED,MAAM0B,YAAY,GAAG3C,IAAI,CAACW,IAAI,CAAC;AAC/BgC,YAAY,CAACC,WAAW,GAAG,MAAM;AAEjC,SAASD,YAAY,IAAIhC,IAAI"}
1
+ {"version":3,"file":"Form.js","names":["memo","Heading4","Support","useUniqueId","jsx","_jsx","jsxs","_jsxs","formEncodingTypeValues","formAutoCompleteTypeValues","formMethodValues","Form","alert","autoCompleteType","children","description","encodingType","formActions","id","idOverride","isFullWidth","method","name","noValidate","onSubmit","target","testId","title","translate","_Box","autoComplete","component","encType","sx","maxWidth","theme","mixins","margin","spacing","padding","marginBlockEnd","display","justifyContent","gap","marginBlockStart","MemoizedForm","displayName"],"sources":["../src/Form.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 { FormEventHandler, memo, ReactElement } from \"react\";\nimport { Box } from \"@mui/material\";\n\nimport { Button } from \"./Button\";\nimport { Callout } from \"./Callout\";\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { Heading4, Support } from \"./Typography\";\nimport { useUniqueId } from \"./useUniqueId\";\n\nexport const formEncodingTypeValues = [\n \"application/x-www-form-urlencoded\",\n \"application/json\",\n \"multipart/form-data\",\n \"text/plain\",\n] as const;\nexport const formAutoCompleteTypeValues = [\"on\", \"off\"] as const;\nexport const formMethodValues = [\"post\", \"get\", \"dialog\"] as const;\n\nexport type FormProps = {\n /**\n * A Callout indicating a Form-wide error or status update.\n */\n alert?: ReactElement<typeof Callout>;\n /**\n * Indicates whether input elements can by default have their values automatically completed by the browser.\n * `autocomplete` attributes on form elements override it on <form>\n */\n autoCompleteType?: (typeof formAutoCompleteTypeValues)[number];\n /**\n * The Field or FieldSet components within the Form\n */\n children: ReactElement | Array<ReactElement>;\n /**\n * A supplementary description\n */\n description?: string;\n /**\n * If the value of the method attribute is post, enctype is the MIME type of the form submission.\n * This value can be overridden by formenctype attributes on <button>, <input type=\"submit\">, or <input type=\"image\"> elements.\n */\n encodingType?: (typeof formEncodingTypeValues)[number];\n /**\n * The Field or FieldGroup components within the Form\n */\n formActions?:\n | ReactElement<typeof Button>\n | Array<ReactElement<typeof Button>>;\n /**\n * Defines a unique identifier (ID) which must be unique in the whole document.\n */\n id?: string;\n /**\n * The HTTP method to submit the form with.\n * This value is overridden by formmethod attributes on <button>, <input type=\"submit\">, or <input type=\"image\"> elements.\n */\n method?: (typeof formMethodValues)[number];\n /**\n * The name of the form. The value must not be the empty string, and must be unique among the form elements in the forms collection that it is in, if any.\n */\n name: string;\n /**\n * This Boolean attribute indicates that the form shouldn't be validated when submitted.\n * If this attribute is not set (and therefore the form is validated),\n * it can be overridden by a formnovalidate attribute on a <button>, <input type=\"submit\">, or <input type=\"image\"> element belonging to the form.\n */\n noValidate?: boolean;\n /**\n * Callback that passes the submit event to the consumer\n */\n onSubmit?: FormEventHandler<HTMLFormElement>;\n /**\n * Indicates where to display the response after submitting the form. It is a name/keyword for a browsing context (for example, tab, window, or iframe).\n * This value can be overridden by a formtarget attribute on a <button>, <input type=\"submit\">, or <input type=\"image\"> element.\n */\n target?: string;\n /**\n * The title of the Form\n */\n title?: string;\n} & Pick<FieldComponentProps, \"isFullWidth\"> &\n HtmlProps;\n\nconst Form = ({\n alert,\n autoCompleteType,\n children,\n description,\n encodingType,\n formActions,\n id: idOverride,\n isFullWidth,\n method,\n name,\n noValidate = false,\n onSubmit,\n target,\n testId,\n title,\n translate,\n}: FormProps) => {\n const id = useUniqueId(idOverride);\n\n return (\n <Box\n autoComplete={autoCompleteType}\n component=\"form\"\n data-se={testId}\n encType={encodingType}\n id={id}\n method={method}\n name={name}\n noValidate={noValidate}\n onSubmit={onSubmit}\n target={target}\n sx={{\n maxWidth: (theme) => (isFullWidth ? \"100%\" : theme.mixins.maxWidth),\n margin: (theme) => theme.spacing(0),\n padding: (theme) => theme.spacing(0),\n }}\n >\n <Box\n component=\"div\"\n sx={{\n marginBlockEnd: (theme) => theme.spacing(4),\n }}\n >\n {title && (\n <Heading4 component=\"h1\" translate={translate}>\n {title}\n </Heading4>\n )}\n {description && <Support translate={translate}>{description}</Support>}\n {alert}\n </Box>\n <Box component=\"div\">{children}</Box>\n {formActions && (\n <Box\n component=\"div\"\n sx={{\n display: \"flex\",\n justifyContent: \"flex-end\",\n gap: (theme) => theme.spacing(1),\n marginBlockStart: (theme) => theme.spacing(7),\n }}\n >\n {formActions}\n </Box>\n )}\n </Box>\n );\n};\n\nconst MemoizedForm = memo(Form);\nMemoizedForm.displayName = \"Form\";\n\nexport { MemoizedForm as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CAAC,CAAC,CAAC;MACnCC,OAAO,EAAGJ,KAAK,IAAKA,KAAK,CAACG,OAAO,CAAC,CAAC;IACrC,CAAE;IAAAxB,QAAA,GAEFP,KAAA,CAAAsB,IAAA;MACEE,SAAS,EAAC,KAAK;MACfE,EAAE,EAAE;QACFO,cAAc,EAAGL,KAAK,IAAKA,KAAK,CAACG,OAAO,CAAC,CAAC;MAC5C,CAAE;MAAAxB,QAAA,GAEDa,KAAK,IACJtB,IAAA,CAACJ,QAAQ;QAAC8B,SAAS,EAAC,IAAI;QAACH,SAAS,EAAEA,SAAU;QAAAd,QAAA,EAC3Ca;MAAK,CACE,CACX,EACAZ,WAAW,IAAIV,IAAA,CAACH,OAAO;QAAC0B,SAAS,EAAEA,SAAU;QAAAd,QAAA,EAAEC;MAAW,CAAU,CAAC,EACrEH,KAAK;IAAA,CACH,CAAC,EACNP,IAAA,CAAAwB,IAAA;MAAKE,SAAS,EAAC,KAAK;MAAAjB,QAAA,EAAEA;IAAQ,CAAM,CAAC,EACpCG,WAAW,IACVZ,IAAA,CAAAwB,IAAA;MACEE,SAAS,EAAC,KAAK;MACfE,EAAE,EAAE;QACFQ,OAAO,EAAE,MAAM;QACfC,cAAc,EAAE,UAAU;QAC1BC,GAAG,EAAGR,KAAK,IAAKA,KAAK,CAACG,OAAO,CAAC,CAAC,CAAC;QAChCM,gBAAgB,EAAGT,KAAK,IAAKA,KAAK,CAACG,OAAO,CAAC,CAAC;MAC9C,CAAE;MAAAxB,QAAA,EAEDG;IAAW,CACT,CACN;EAAA,CACE,CAAC;AAEV,CAAC;AAED,MAAM4B,YAAY,GAAG7C,IAAI,CAACW,IAAI,CAAC;AAC/BkC,YAAY,CAACC,WAAW,GAAG,MAAM;AAEjC,SAASD,YAAY,IAAIlC,IAAI"}
@@ -105,6 +105,6 @@ export type ButtonProps = {
105
105
  label?: "" | undefined;
106
106
  startIcon?: ReactElement;
107
107
  }) & HtmlProps;
108
- declare const MemoizedButton: import("react").MemoExoticComponent<({ ariaDescribedBy, ariaLabel, ariaLabelledBy, buttonRef, endIcon, id, isDisabled, isFullWidth, label, onClick, size, startIcon, tabIndex, testId, tooltipText, translate, type, variant: variantProp, }: ButtonProps) => JSX.Element>;
108
+ declare const MemoizedButton: import("react").MemoExoticComponent<({ ariaControls, ariaDescribedBy, ariaExpanded, ariaHasPopup, ariaLabel, ariaLabelledBy, buttonRef, endIcon, id, isDisabled, isFullWidth, label, onClick, size, startIcon, tabIndex, testId, tooltipText, translate, type, variant: variantProp, }: ButtonProps) => JSX.Element>;
109
109
  export { MemoizedButton as Button };
110
110
  //# sourceMappingURL=Button.d.ts.map
@@ -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,EACL,cAAc,EACd,cAAc,EAEd,YAAY,EAIb,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,eAAO,MAAM,gBAAgB,uCAAwC,CAAC;AACtE,eAAO,MAAM,gBAAgB,wCAAyC,CAAC;AACvE,eAAO,MAAM,mBAAmB,yDAKtB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG;IACxB;;;;OAIG;IACH,YAAY,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC,eAAe,CAAC,CAAC;IACzD;;OAEG;IACH,YAAY,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC,eAAe,CAAC,CAAC;IACzD;;OAEG;IACH,YAAY,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC,eAAe,CAAC,CAAC;IACzD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,cAAc,CAAC,EAA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;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACpC;;OAEG;IACH,IAAI,CAAC,EAAE,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;IACzC;;OAEG;IACH,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,QAAQ,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC,UAAU,CAAC,CAAC;IACnD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;IACzC;;OAEG;IACH,OAAO,EAAE,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC;CAC5D,GAAG,CACA;IACE,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,YAAY,CAAC;CAC1B,GACD;IACE,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,SAAS,CAAC;AA6GZ,QAAA,MAAM,cAAc,0RArFjB,WAAW,iBAqFqB,CAAC;AAGpC,OAAO,EAAE,cAAc,IAAI,MAAM,EAAE,CAAC"}
@@ -9,9 +9,10 @@
9
9
  *
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
- import { ReactElement } from "react";
12
+ import { FormEventHandler, ReactElement } from "react";
13
13
  import { Button } from "./Button";
14
14
  import { Callout } from "./Callout";
15
+ import { FieldComponentProps } from "./FieldComponentProps";
15
16
  import type { HtmlProps } from "./HtmlProps";
16
17
  export declare const formEncodingTypeValues: readonly ["application/x-www-form-urlencoded", "application/json", "multipart/form-data", "text/plain"];
17
18
  export declare const formAutoCompleteTypeValues: readonly ["on", "off"];
@@ -62,6 +63,10 @@ export type FormProps = {
62
63
  * it can be overridden by a formnovalidate attribute on a <button>, <input type="submit">, or <input type="image"> element belonging to the form.
63
64
  */
64
65
  noValidate?: boolean;
66
+ /**
67
+ * Callback that passes the submit event to the consumer
68
+ */
69
+ onSubmit?: FormEventHandler<HTMLFormElement>;
65
70
  /**
66
71
  * Indicates where to display the response after submitting the form. It is a name/keyword for a browsing context (for example, tab, window, or iframe).
67
72
  * This value can be overridden by a formtarget attribute on a <button>, <input type="submit">, or <input type="image"> element.
@@ -71,7 +76,7 @@ export type FormProps = {
71
76
  * The title of the Form
72
77
  */
73
78
  title?: string;
74
- } & HtmlProps;
75
- declare const MemoizedForm: import("react").MemoExoticComponent<({ alert, autoCompleteType, children, description, encodingType, formActions, id: idOverride, method, name, noValidate, target, testId, title, translate, }: FormProps) => JSX.Element>;
79
+ } & Pick<FieldComponentProps, "isFullWidth"> & HtmlProps;
80
+ declare const MemoizedForm: import("react").MemoExoticComponent<({ alert, autoCompleteType, children, description, encodingType, formActions, id: idOverride, isFullWidth, method, name, noValidate, onSubmit, target, testId, title, translate, }: FormProps) => JSX.Element>;
76
81
  export { MemoizedForm as Form };
77
82
  //# sourceMappingURL=Form.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../src/Form.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAQ,YAAY,EAAE,MAAM,OAAO,CAAC;AAG3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,O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