@okta/odyssey-react-mui 1.13.9 → 1.13.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 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.11](https://github.com/okta/odyssey/compare/v1.13.10...v1.13.11) (2024-02-15)
7
+
8
+ **Note:** Version bump only for package @okta/odyssey-react-mui
9
+
10
+ ## [1.13.10](https://github.com/okta/odyssey/compare/v1.13.9...v1.13.10) (2024-02-14)
11
+
12
+ **Note:** Version bump only for package @okta/odyssey-react-mui
13
+
6
14
  ## [1.13.9](https://github.com/okta/odyssey/compare/v1.13.8...v1.13.9) (2024-02-14)
7
15
 
8
16
  **Note:** Version bump only for package @okta/odyssey-react-mui
package/dist/Button.js CHANGED
@@ -10,9 +10,10 @@ import _Button from "@mui/material/Button";
10
10
  *
11
11
  * See the License for the specific language governing permissions and limitations under the License.
12
12
  */
13
- import { memo, useCallback, useImperativeHandle, useRef } from "react";
13
+ import { memo, useCallback, useImperativeHandle, useMemo, useRef } from "react";
14
14
  import { MuiPropsContext, useMuiProps } from "./MuiPropsContext.js";
15
15
  import { Tooltip } from "./Tooltip.js";
16
+ import { useButton } from "./ButtonContext.js";
16
17
  import { jsx as _jsx } from "react/jsx-runtime";
17
18
  export const buttonSizeValues = ["small", "medium", "large"];
18
19
  export const buttonTypeValues = ["button", "submit", "reset"];
@@ -28,7 +29,7 @@ const Button = ({
28
29
  endIcon,
29
30
  id,
30
31
  isDisabled,
31
- isFullWidth,
32
+ isFullWidth: isFullWidthProp,
32
33
  label = "",
33
34
  onClick,
34
35
  size = "medium",
@@ -43,6 +44,8 @@ const Button = ({
43
44
  const muiProps = useMuiProps();
44
45
  const variant = variantProp === "tertiary" ? "secondary" : variantProp;
45
46
  const localButtonRef = useRef(null);
47
+ const buttonContext = useButton();
48
+ const isFullWidth = useMemo(() => buttonContext.isFullWidth ? buttonContext.isFullWidth : isFullWidthProp, [buttonContext, isFullWidthProp]);
46
49
  useImperativeHandle(buttonRef, () => {
47
50
  return {
48
51
  focus: () => {
@@ -1 +1 @@
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"],"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,YAAY;EACZC,eAAe;EACfC,YAAY;EACZC,YAAY;EACZC,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,GAAG9B,WAAW,CAAC,CAAC;EAI9B,MAAM4B,OAAO,GAAGC,WAAW,KAAK,UAAU,GAAG,WAAW,GAAGA,WAAW;EACtE,MAAME,cAAc,GAAGjC,MAAM,CAAoB,IAAI,CAAC;EAEtDD,mBAAmB,CACjBiB,SAAS,EACT,MAAM;IACJ,OAAO;MACLkB,KAAK,EAAEA,CAAA,KAAM;QACXD,cAAc,CAACE,OAAO,EAAED,KAAK,CAAC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AEd;EAEA,OAAOA,YAAY,CAACJ,QAAQ,CAAC;AAC/B,CAAC;AAED,MAAMc,cAAc,GAAGjD,IAAI,CAACY,MAAM,CAAC;AACnCqC,cAAc,CAACC,WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAIrC,MAAM"}
1
+ {"version":3,"file":"Button.js","names":["memo","useCallback","useImperativeHandle","useMemo","useRef","MuiPropsContext","useMuiProps","Tooltip","useButton","jsx","_jsx","buttonSizeValues","buttonTypeValues","buttonVariantValues","Button","ariaControls","ariaDescribedBy","ariaExpanded","ariaHasPopup","ariaLabel","ariaLabelledBy","buttonRef","endIcon","id","isDisabled","isFullWidth","isFullWidthProp","label","onClick","size","startIcon","tabIndex","testId","tooltipText","translate","type","variant","variantProp","muiProps","localButtonRef","buttonContext","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 useMemo,\n useRef,\n} from \"react\";\n\nimport { MuiPropsContext, useMuiProps } from \"./MuiPropsContext\";\nimport { Tooltip } from \"./Tooltip\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { FocusHandle } from \"./inputUtils\";\nimport { useButton } from \"./ButtonContext\";\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: isFullWidthProp,\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 const buttonContext = useButton();\n const isFullWidth = useMemo(\n () =>\n buttonContext.isFullWidth ? buttonContext.isFullWidth : isFullWidthProp,\n [buttonContext, isFullWidthProp]\n );\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"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA,SAGEA,IAAI,EAEJC,WAAW,EACXC,mBAAmB,EACnBC,OAAO,EACPC,MAAM,QACD,OAAO;AAAC,SAENC,eAAe,EAAEC,WAAW;AAAA,SAC5BC,OAAO;AAAA,SAGPC,SAAS;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAElB,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,YAAY;EACZC,eAAe;EACfC,YAAY;EACZC,YAAY;EACZC,SAAS;EACTC,cAAc;EACdC,SAAS;EACTC,OAAO;EACPC,EAAE;EACFC,UAAU;EACVC,WAAW,EAAEC,eAAe;EAC5BC,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,GAAGhC,WAAW,CAAC,CAA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ACZC,YAAY,EACZC,SAAS,EACTC,cAAc,EACdE,OAAO,EACPC,EAAE,EACFC,UAAU,EACVC,WAAW,EACXE,KAAK,EACLC,OAAO,EACPC,IAAI,EACJC,SAAS,EACTC,QAAQ,EACRC,MAAM,EACNE,SAAS,EACTC,IAAI,EACJC,OAAO,CAEX,CAAC;EAED,IAAIH,WAAW,EAAE;IACf,OACEvB,IAAA,CAACH,OAAO;MAAC0C,QAAQ,EAAC,aAAa;MAACC,SAAS,EAAC,KAAK;MAACC,IAAI,EAAElB,WAAY;MAAAe,QAAA,EAChEtC,IAAA,CAACL,eAAe,CAAC+C,QAAQ;QAAAJ,QAAA,EAAEL;MAAY,CAA2B;IAAC,CAC5D,CAAC;EAEd;EAEA,OAAOA,YAAY,CAACL,QAAQ,CAAC;AAC/B,CAAC;AAED,MAAMe,cAAc,GAAGrD,IAAI,CAACc,MAAM,CAAC;AACnCuC,cAAc,CAACC,WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAIvC,MAAM"}
@@ -0,0 +1,18 @@
1
+ /*!
2
+ * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ import { createContext, useContext } from "react";
14
+ export const ButtonContext = createContext({
15
+ isFullWidth: false
16
+ });
17
+ export const useButton = () => useContext(ButtonContext);
18
+ //# sourceMappingURL=ButtonContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonContext.js","names":["createContext","useContext","ButtonContext","isFullWidth","useButton"],"sources":["../src/ButtonContext.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-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 { createContext, useContext } from \"react\";\n\nexport type ButtonContextValue = {\n isFullWidth: boolean;\n};\n\nexport const ButtonContext = createContext<ButtonContextValue>({\n isFullWidth: false,\n});\n\nexport const useButton = () => useContext(ButtonContext);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,EAAEC,UAAU,QAAQ,OAAO;AAMjD,OAAO,MAAMC,aAAa,GAAGF,aAAa,CAAqB;EAC7DG,WAAW,EAAE;AACf,CAAC,CAAC;AAEF,OAAO,MAAMC,SAAS,GAAGA,CAAA,KAAMH,UAAU,CAACC,aAAa,CAAC"}
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,EACnC,kBAAkB,EAClB,qBAAqB,EACrB,YAAY,CACJ;AACV,OAAO,MAAMC,0BAA0B,GAAG,CAAC,IAAI,EAAE,KAAK,CAAU;AAChE,OAAO,MAAMC,gBAAgB,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAU;AA6DlE,MAAMC,IAAI,GAAGA,CAAC;EACZC,KAAK;EACLC,gBAAgB;EAChBC,QAAQ;EACRC,WAAW;EACXC,YAAY;EACZC,WAAW;EACXC,EAAE,EAAEC,UAAU;EACdC,MAAM;EACNC,IAAI;EACJC,UAAU,GAAG,KAAK;EAClBC,MAAM;EACNC,MAAM;EACNC,KAAK;EACLC;AACS,CAAC,KAAK;EACf,MAAMR,EAAE,GAAGf,WAAW,CAACgB,UAAU,CAAC;EAElC,OACEZ,KAAA,CAAAoB,IAAA;IACEC,YAAY,EAAEf,gBAAiB;IAC/BgB,SAAS,EAAC,MAAM;I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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 Form };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAA2BA,IAAI,QAAsB,OAAO;AAAC,SAOpDC,QAAQ,EAAEC,OAAO;AAAA,SACjBC,WAAW;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEpB,OAAO,MAAMC,sBAAsB,GAAG,CACpC,mCAAmC,EACnC,kBAAkB,EAClB,qBAAqB,EACrB,YAAY,CACJ;AACV,OAAO,MAAMC,0BAA0B,GAAG,CAAC,IAAI,EAAE,KAAK,CAAU;AAChE,OAAO,MAAMC,gBAAgB,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAU;AAkElE,MAAMC,IAAI,GAAGA,CAAC;EACZC,KAAK;EACLC,gBAAgB;EAChBC,QAAQ;EACRC,WAAW;EACXC,YAAY;EACZC,WAAW;EAC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S,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuContext.js","names":["createContext","MenuContext","closeMenu","openMenu","shouldCloseOnSelect"],"sources":["../src/MenuContext.ts"],"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 { createContext, MouseEventHandler } from \"react\";\n\nexport type MenuContextType = {\n closeMenu: () => void;\n openMenu: MouseEventHandler<HTMLElement>;\n shouldCloseOnSelect: boolean;\n};\n\nexport const MenuContext = createContext<MenuContextType>({\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n closeMenu: () => {},\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n openMenu: () => {},\n shouldCloseOnSelect: true,\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,QAA2B,OAAO;AAQxD,OAAO,MAAMC,WAAW,GAAGD,aAAa,CAAkB;EAExDE,SAAS,EAAEA,CAAA,KAAM,CAAC,CAAC;EAEnBC,QAAQ,EAAEA,CAAA,KAAM,CAAC,CAAC;EAClBC,mBAAmB,EAAE;AACvB,CAAC,CAAC"}
1
+ {"version":3,"file":"MenuContext.js","names":["createContext","MenuContext","closeMenu","openMenu","shouldCloseOnSelect"],"sources":["../src/MenuContext.ts"],"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 { MouseEventHandler, createContext } from \"react\";\n\nexport type MenuContextType = {\n closeMenu: () => void;\n openMenu: MouseEventHandler<HTMLElement>;\n shouldCloseOnSelect: boolean;\n};\n\nexport const MenuContext = createContext<MenuContextType>({\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n closeMenu: () => {},\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n openMenu: () => {},\n shouldCloseOnSelect: true,\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAA4BA,aAAa,QAAQ,OAAO;AAQxD,OAAO,MAAMC,WAAW,GAAGD,aAAa,CAAkB;EAExDE,SAAS,EAAEA,CAAA,KAAM,CAAC,CAAC;EAEnBC,QAAQ,EAAEA,CAAA,KAAM,CAAC,CAAC;EAClBC,mBAAmB,EAAE;AACvB,CAAC,CAAC"}
package/dist/Tile.js ADDED
@@ -0,0 +1,94 @@
1
+ import _Card from "@mui/material/Card";
2
+ import _CardActionArea from "@mui/material/CardActionArea";
3
+ import _CardActions from "@mui/material/CardActions";
4
+ /*!
5
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
6
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
7
+ *
8
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ *
13
+ * See the License for the specific language governing permissions and limitations under the License.
14
+ */
15
+
16
+ import { memo, useMemo } from "react";
17
+ import { ButtonContext } from "./ButtonContext.js";
18
+ import { Heading5, Paragraph, Support } from "./Typography.js";
19
+ import { MoreIcon } from "./icons.generated/index.js";
20
+ import styled from "@emotion/styled";
21
+ import { useOdysseyDesignTokens } from "./OdysseyDesignTokensContext.js";
22
+ import { MenuButton } from "./MenuButton.js";
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import { Fragment as _Fragment } from "react/jsx-runtime";
25
+ import { jsxs as _jsxs } from "react/jsx-runtime";
26
+ const ImageContainer = styled.div`
27
+ display: flex;
28
+ align-items: flex-start;
29
+ max-height: 64px;
30
+ margin-block-end: ${props => props.odysseyDesignTokens.Spacing5};
31
+ padding-right: ${props => props.hasMenuItems ? props.odysseyDesignTokens.Spacing5 : 0};
32
+ `;
33
+ const MenuButtonContainer = styled.div`
34
+ position: absolute;
35
+ right: ${props => props.odysseyDesignTokens.Spacing3};
36
+ top: ${props => props.odysseyDesignTokens.Spacing3};
37
+ `;
38
+ const Tile = ({
39
+ button,
40
+ description,
41
+ image,
42
+ menuItems,
43
+ onClick,
44
+ overline,
45
+ title
46
+ }) => {
47
+ const odysseyDesignTokens = useOdysseyDesignTokens();
48
+ const cardContent = useMemo(() => {
49
+ return _jsxs(_Fragment, {
50
+ children: [image && _jsx(ImageContainer, {
51
+ odysseyDesignTokens: odysseyDesignTokens,
52
+ hasMenuItems: Boolean(menuItems),
53
+ children: image
54
+ }), overline && _jsx(Support, {
55
+ component: "div",
56
+ children: overline
57
+ }), title && _jsx(Heading5, {
58
+ component: "div",
59
+ children: title
60
+ }), description && _jsx(Paragraph, {
61
+ color: "textSecondary",
62
+ children: description
63
+ }), button && _jsx(_CardActions, {
64
+ children: _jsx(ButtonContext.Provider, {
65
+ value: {
66
+ isFullWidth: true
67
+ },
68
+ children: button
69
+ })
70
+ })]
71
+ });
72
+ }, [button, description, image, menuItems, overline, title, odysseyDesignTokens]);
73
+ return _jsxs(_Card, {
74
+ className: onClick ? "isClickable" : "",
75
+ children: [onClick && _jsx(_CardActionArea, {
76
+ onClick: onClick,
77
+ children: cardContent
78
+ }), !onClick && cardContent, menuItems && _jsx(MenuButtonContainer, {
79
+ odysseyDesignTokens: odysseyDesignTokens,
80
+ children: _jsx(MenuButton, {
81
+ endIcon: _jsx(MoreIcon, {}),
82
+ ariaLabel: "Tile menu",
83
+ buttonVariant: "floating",
84
+ menuAlignment: "right",
85
+ size: "small",
86
+ children: menuItems
87
+ })
88
+ })]
89
+ });
90
+ };
91
+ const MemoizedTile = memo(Tile);
92
+ MemoizedTile.displayName = "Tile";
93
+ export { MemoizedTile as Tile };
94
+ //# sourceMappingURL=Tile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tile.js","names":["memo","useMemo","ButtonContext","Heading5","Paragraph","Support","MoreIcon","styled","useOdysseyDesignTokens","MenuButton","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ImageContainer","div","props","odysseyDesignTokens","Spacing5","hasMenuItems","MenuButtonContainer","Spacing3","Tile","button","description","image","menuItems","onClick","overline","title","cardContent","children","Boolean","component","color","_CardActions","Provider","value","isFullWidth","_Card","className","_CardActionArea","endIcon","ariaLabel","buttonVariant","menuAlignment","size","MemoizedTile","displayName"],"sources":["../src/Tile.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 { ReactElement, memo, useMemo } from \"react\";\n\nimport { NullElement } from \"./NullElement\";\nimport {\n Card as MuiCard,\n CardActions as MuiCardActions,\n CardActionArea as MuiCardActionArea,\n} from \"@mui/material\";\nimport { Button } from \"./Button\";\nimport { ButtonContext } from \"./ButtonContext\";\nimport { Heading5, Paragraph, Support } from \"./Typography\";\nimport { MoreIcon } from \"./icons.generated\";\nimport { HtmlProps } from \"./HtmlProps\";\nimport styled from \"@emotion/styled\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"./OdysseyDesignTokensContext\";\nimport { MenuButton } from \"./MenuButton\";\n\nexport type TileProps = {\n description?: string;\n image?: ReactElement | NullElement; // Icon or image\n menuItems?: ReactElement;\n overline?: string;\n title?: string;\n} & ( // You can't have actions and onClick at the same time\n | {\n onClick: () => void;\n button?: never;\n menuItems?: never;\n }\n | {\n onClick?: never;\n button?: ReactElement<typeof Button> | NullElement;\n menuItems?: ReactElement;\n }\n) &\n HtmlProps;\n\nconst ImageContainer = styled.div<{\n odysseyDesignTokens: DesignTokens;\n hasMenuItems: boolean;\n}>`\n display: flex;\n align-items: flex-start;\n max-height: 64px;\n margin-block-end: ${(props) => props.odysseyDesignTokens.Spacing5};\n padding-right: ${(props) =>\n props.hasMenuItems ? props.odysseyDesignTokens.Spacing5 : 0};\n`;\n\nconst MenuButtonContainer = styled.div<{ odysseyDesignTokens: DesignTokens }>`\n position: absolute;\n right: ${(props) => props.odysseyDesignTokens.Spacing3};\n top: ${(props) => props.odysseyDesignTokens.Spacing3};\n`;\n\nconst Tile = ({\n button,\n description,\n image,\n menuItems,\n onClick,\n overline,\n title,\n}: TileProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const cardContent = useMemo(() => {\n return (\n <>\n {image && (\n <ImageContainer\n odysseyDesignTokens={odysseyDesignTokens}\n hasMenuItems={Boolean(menuItems)}\n >\n {image}\n </ImageContainer>\n )}\n\n {overline && <Support component=\"div\">{overline}</Support>}\n {title && <Heading5 component=\"div\">{title}</Heading5>}\n {description && (\n <Paragraph color=\"textSecondary\">{description}</Paragraph>\n )}\n\n {button && (\n <MuiCardActions>\n <ButtonContext.Provider value={{ isFullWidth: true }}>\n {button}\n </ButtonContext.Provider>\n </MuiCardActions>\n )}\n </>\n );\n }, [\n button,\n description,\n image,\n menuItems,\n overline,\n title,\n odysseyDesignTokens,\n ]);\n\n return (\n <MuiCard className={onClick ? \"isClickable\" : \"\"}>\n {onClick && (\n <MuiCardActionArea onClick={onClick}>{cardContent}</MuiCardActionArea>\n )}\n\n {!onClick && cardContent}\n\n {menuItems && (\n <MenuButtonContainer odysseyDesignTokens={odysseyDesignTokens}>\n <MenuButton\n endIcon={<MoreIcon />}\n ariaLabel=\"Tile menu\"\n buttonVariant=\"floating\"\n menuAlignment=\"right\"\n size=\"small\"\n >\n {menuItems}\n </MenuButton>\n </MenuButtonContainer>\n )}\n </MuiCard>\n );\n};\n\nconst MemoizedTile = memo(Tile);\nMemoizedTile.displayName = \"Tile\";\n\nexport { MemoizedTile as Tile };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAuBA,IAAI,EAAEC,OAAO,QAAQ,OAAO;AAAC,SAS3CC,aAAa;AAAA,SACbC,QAAQ,EAAEC,SAAS,EAAEC,OAAO;AAAA,SAC5BC,QAAQ;AAEjB,OAAOC,MAAM,MAAM,iBAAiB;AAAC,SAGnCC,sBAAsB;AAAA,SAE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EAAEP;MAAW,CAAY,CAC1D,EAEAD,MAAM,IACLd,IAAA,CAAA0B,YAAA;QAAAJ,QAAA,EACEtB,IAAA,CAACT,aAAa,CAACoC,QAAQ;UAACC,KAAK,EAAE;YAAEC,WAAW,EAAE;UAAK,CAAE;UAAAP,QAAA,EAClDR;QAAM,CACe;MAAC,CACX,CACjB;IAAA,CACD,CAAC;EAEP,CAAC,EAAE,CACDA,MAAM,EACNC,WAAW,EACXC,KAAK,EACLC,SAAS,EACTE,QAAQ,EACRC,KAAK,EACLZ,mBAAmB,CACpB,CAAC;EAEF,OACEJ,KAAA,CAAA0B,KAAA;IAASC,SAAS,EAAEb,OAAO,GAAG,aAAa,GAAG,EAAG;IAAAI,QAAA,GAC9CJ,OAAO,IACNlB,IAAA,CAAAgC,eAAA;MAAmBd,OAAO,EAAEA,OAAQ;MAAAI,QAAA,EAAED;IAAW,CAAoB,CACtE,EAEA,CAACH,OAAO,IAAIG,WAAW,EAEvBJ,SAAS,IACRjB,IAAA,CAACW,mBAAmB;MAACH,mBAAmB,EAAEA,mBAAoB;MAAAc,QAAA,EAC5DtB,IAAA,CAACF,UAAU;QACTmC,OAAO,EAAEjC,IAAA,CAACL,QAAQ,IAAE,CAAE;QACtBuC,SAAS,EAAC,WAAW;QACrBC,aAAa,EAAC,UAAU;QACxBC,aAAa,EAAC,OAAO;QACrBC,IAAI,EAAC,OAAO;QAAAf,QAAA,EAEXL;MAAS,CACA;IAAC,CACM,CACtB;EAAA,CACM,CAAC;AAEd,CAAC;AAED,MAAMqB,YAAY,GAAGjD,IAAI,CAACwB,IAAI,CAAC;AAC/ByB,YAAY,CAACC,WAAW,GAAG,MAAM;AAEjC,SAASD,YAAY,IAAIzB,IAAI"}
package/dist/index.js CHANGED
@@ -19,6 +19,7 @@ export * from "./Banner.js";
19
19
  export * from "./Box.js";
20
20
  export * from "./Breadcrumbs.js";
21
21
  export * from "./Button.js";
22
+ export * from "./Tile.js";
22
23
  export * from "./Callout.js";
23
24
  export * from "./Checkbox.js";
24
25
  export * from "./CheckboxGroup.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 type { FocusHandle } from \"./inputUtils\";\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,SAmBdC,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"}
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 type { FocusHandle } from \"./inputUtils\";\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 \"./Tile\";\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,SAmBdC,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;AAAA,SA2BtBC,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA"}
@@ -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<({ 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>;
108
+ declare const MemoizedButton: import("react").MemoExoticComponent<({ ariaControls, ariaDescribedBy, ariaExpanded, ariaHasPopup, ariaLabel, ariaLabelledBy, buttonRef, endIcon, id, isDisabled, isFullWidth: isFullWidthProp, 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,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACzC;;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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;AAmHZ,QAAA,MAAM,cAAc,2SA3FjB,WAAW,iBA2FqB,CAAC;AAGpC,OAAO,EAAE,cAAc,IAAI,MAAM,EAAE,CAAC"}
@@ -0,0 +1,18 @@
1
+ /*!
2
+ * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+ /// <reference types="react" />
13
+ export type ButtonContextValue = {
14
+ isFullWidth: boolean;
15
+ };
16
+ export declare const ButtonContext: import("react").Context<ButtonContextValue>;
17
+ export declare const useButton: () => ButtonContextValue;
18
+ //# sourceMappingURL=ButtonContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonContext.d.ts","sourceRoot":"","sources":["../../src/ButtonContext.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;;AAIH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,aAAa,6CAExB,CAAC;AAEH,eAAO,MAAM,SAAS,0BAAkC,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,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,eAAO,MAAM,sBAAsB,yGAKzB,CAAC;AACX,eAAO,MAAM,0BAA0B,wBAAyB,CAAC;AACjE,eAAO,MAAM,gBAAgB,oCAAqC,CAAC;AAEnE,MAAM,MAAM,SAAS,GAAG;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC,OAAO,OAAO,CAAC,CAAC;IACrC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;IAC/D;;OAEG;IACH,QAAQ,EAAE,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC;IAC7C;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,OAAO,sBAAsB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CAAC,WAAW,CAAC,CAAC;IACzC,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,WAAW,0CAMtB,CAAC"}
1
+ {"version":3,"file":"MenuContext.d.ts","sourceRoot":"","sources":["../../src/MenuContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,iBAAiB,EAAiB,MAAM,OAAO,CAAC;AAEzD,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC;IACzC,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,WAAW,0CAMtB,CAAC"}
@@ -0,0 +1,33 @@
1
+ /*!
2
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+ import { ReactElement } from "react";
13
+ import { NullElement } from "./NullElement";
14
+ import { Button } from "./Button";
15
+ import { HtmlProps } from "./HtmlProps";
16
+ export type TileProps = {
17
+ description?: string;
18
+ image?: ReactElement | NullElement;
19
+ menuItems?: ReactElement;
20
+ overline?: string;
21
+ title?: string;
22
+ } & ({
23
+ onClick: () => void;
24
+ button?: never;
25
+ menuItems?: never;
26
+ } | {
27
+ onClick?: never;
28
+ button?: ReactElement<typeof Button> | NullElement;
29
+ menuItems?: ReactElement;
30
+ }) & HtmlProps;
31
+ declare const MemoizedTile: import("react").MemoExoticComponent<({ button, description, image, menuItems, onClick, overline, title, }: TileProps) => JSX.Element>;
32
+ export { MemoizedTile as Tile };
33
+ //# sourceMappingURL=Tile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tile.d.ts","sourceRoot":"","sources":["../../src/Tile.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAiB,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAM5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIlC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAQxC,MAAM,MAAM,SAAS,GAAG;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,YAAY,GAAG,WAAW,CAAC;IACnC,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,CACA;IACE,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB,GACD;IACE,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,MAAM,CAAC,EAAE,YAAY,CAAC,OAAO,MAAM,CAAC,GAAG,WAAW,CAAC;IACnD,SAAS,CAAC,EAAE,YAAY,CAAC;CAC1B,CACJ,GACC,SAAS,CAAC;AA6FZ,QAAA,MAAM,YAAY,6GAjEf,SAAS,iBAiEmB,CAAC;AAGhC,OAAO,EAAE,YAAY,IAAI,IAAI,EAAE,CAAC"}
@@ -40,6 +40,7 @@ export * from "./Banner";
40
40
  export * from "./Box";
41
41
  export * from "./Breadcrumbs";
42
42
  export * from "./Button";
43
+ export * from "./Tile";
43
44
  export * from "./Callout";
44
45
  export * from "./Checkbox";
45
46
  export * from "./CheckboxGroup";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","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;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/theme/components.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAqC7C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,eAAO,MAAM,UAAU;mBAIN,YAAY;;MAEzB,YAAY,CAAC,YAAY,CA+mF5B,CAAC"}
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/theme/components.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAqC7C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,eAAO,MAAM,UAAU;mBAIN,YAAY;;MAEzB,YAAY,CAAC,YAAY,CA+qF5B,CAAC"}
@@ -626,6 +626,64 @@ export const components = ({
626
626
  disableRipple: true
627
627
  }
628
628
  },
629
+ MuiCard: {
630
+ styleOverrides: {
631
+ root: () => ({
632
+ backgroundColor: odysseyTokens.HueNeutralWhite,
633
+ borderRadius: odysseyTokens.BorderRadiusOuter,
634
+ boxShadow: odysseyTokens.DepthMedium,
635
+ padding: odysseyTokens.Spacing5,
636
+ position: "relative",
637
+ transition: `all ${odysseyTokens.TransitionDurationMain} ${odysseyTokens.TransitionTimingMain}`,
638
+ "& img": {
639
+ height: "64px"
640
+ },
641
+ "&.isClickable:hover": {
642
+ backgroundColor: odysseyTokens.HueNeutral50,
643
+ boxShadow: odysseyTokens.DepthHigh
644
+ },
645
+ [`& .${typographyClasses.h5}`]: {
646
+ lineHeight: odysseyTokens.TypographyLineHeightHeading5,
647
+ marginBottom: odysseyTokens.Spacing3
648
+ },
649
+ [`& .${typographyClasses.subtitle2}`]: {
650
+ marginBottom: odysseyTokens.Spacing1,
651
+ textTransform: "uppercase",
652
+ fontWeight: odysseyTokens.TypographyWeightBodyBold,
653
+ fontSize: odysseyTokens.TypographySizeOverline,
654
+ lineHeight: odysseyTokens.TypographyLineHeightOverline,
655
+ color: odysseyTokens.TypographyColorSubordinate,
656
+ letterSpacing: 1.3
657
+ },
658
+ [`& .${typographyClasses.body1}`]: {
659
+ fontSize: odysseyTokens.TypographySizeSubordinate,
660
+ lineHeight: odysseyTokens.TypographyLineHeightBody
661
+ }
662
+ })
663
+ }
664
+ },
665
+ MuiCardActionArea: {
666
+ styleOverrides: {
667
+ root: () => ({
668
+ margin: `-${odysseyTokens.Spacing5}`,
669
+ padding: odysseyTokens.Spacing5,
670
+ width: `calc(100% + (${odysseyTokens.Spacing5} * 2))`,
671
+ "&:hover": {
672
+ "& .MuiCardActionArea-focusHighlight": {
673
+ display: "none"
674
+ }
675
+ }
676
+ })
677
+ }
678
+ },
679
+ MuiCardActions: {
680
+ styleOverrides: {
681
+ root: () => ({
682
+ marginBlockStart: odysseyTokens.Spacing5,
683
+ padding: 0
684
+ })
685
+ }
686
+ },
629
687
  MuiCheckbox: {
630
688
  defaultProps: {
631
689
  size: "small",