@okta/odyssey-react-mui 1.13.4 → 1.13.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/Accordion.js +11 -12
- package/dist/Accordion.js.map +1 -1
- package/dist/Autocomplete.js +63 -70
- package/dist/Autocomplete.js.map +1 -1
- package/dist/Badge.js +7 -8
- package/dist/Badge.js.map +1 -1
- package/dist/Banner.js +10 -11
- package/dist/Banner.js.map +1 -1
- package/dist/Box.js +16 -19
- package/dist/Box.js.map +1 -1
- package/dist/Breadcrumbs.js +12 -14
- package/dist/Breadcrumbs.js.map +1 -1
- package/dist/Button.js +20 -21
- package/dist/Button.js.map +1 -1
- package/dist/Callout.js +11 -12
- package/dist/Callout.js.map +1 -1
- package/dist/Checkbox.js +20 -21
- package/dist/Checkbox.js.map +1 -1
- package/dist/CheckboxGroup.js +27 -31
- package/dist/CheckboxGroup.js.map +1 -1
- package/dist/CircularProgress.js +10 -13
- package/dist/CircularProgress.js.map +1 -1
- package/dist/Dialog.js +11 -12
- package/dist/Dialog.js.map +1 -1
- package/dist/ErrorMessageList.js +3 -4
- package/dist/ErrorMessageList.js.map +1 -1
- package/dist/Field.js +16 -17
- package/dist/Field.js.map +1 -1
- package/dist/FieldError.js +7 -8
- package/dist/FieldError.js.map +1 -1
- package/dist/FieldHint.js +7 -8
- package/dist/FieldHint.js.map +1 -1
- package/dist/FieldLabel.js +9 -10
- package/dist/FieldLabel.js.map +1 -1
- package/dist/Fieldset.js +11 -12
- package/dist/Fieldset.js.map +1 -1
- package/dist/Form.js +16 -17
- package/dist/Form.js.map +1 -1
- package/dist/Link.js +13 -14
- package/dist/Link.js.map +1 -1
- package/dist/MenuButton.js +21 -22
- package/dist/MenuButton.js.map +1 -1
- package/dist/MenuItem.js +10 -11
- package/dist/MenuItem.js.map +1 -1
- package/dist/MuiPropsChild.js +4 -5
- package/dist/MuiPropsChild.js.map +1 -1
- package/dist/NativeSelect.js +49 -53
- package/dist/NativeSelect.js.map +1 -1
- package/dist/OdysseyCacheProvider.js +6 -7
- package/dist/OdysseyCacheProvider.js.map +1 -1
- package/dist/OdysseyProvider.js +26 -29
- package/dist/OdysseyProvider.js.map +1 -1
- package/dist/OdysseyThemeProvider.js +8 -9
- package/dist/OdysseyThemeProvider.js.map +1 -1
- package/dist/OdysseyTranslationProvider.js +5 -6
- package/dist/OdysseyTranslationProvider.js.map +1 -1
- package/dist/PasswordField.js +64 -68
- package/dist/PasswordField.js.map +1 -1
- package/dist/Radio.js +13 -14
- package/dist/Radio.js.map +1 -1
- package/dist/RadioGroup.js +34 -38
- package/dist/RadioGroup.js.map +1 -1
- package/dist/ScreenReaderText.js +9 -12
- package/dist/ScreenReaderText.js.map +1 -1
- package/dist/SearchField.js +56 -60
- package/dist/SearchField.js.map +1 -1
- package/dist/Select.js +50 -54
- package/dist/Select.js.map +1 -1
- package/dist/Status.js +6 -7
- package/dist/Status.js.map +1 -1
- package/dist/Tabs.js +14 -16
- package/dist/Tabs.js.map +1 -1
- package/dist/Tag.js +9 -10
- package/dist/Tag.js.map +1 -1
- package/dist/TagList.js +4 -5
- package/dist/TagList.js.map +1 -1
- package/dist/TextField.js +70 -74
- package/dist/TextField.js.map +1 -1
- package/dist/Toast.js +13 -14
- package/dist/Toast.js.map +1 -1
- package/dist/ToastStack.js +3 -4
- package/dist/ToastStack.js.map +1 -1
- package/dist/Tooltip.js +17 -20
- package/dist/Tooltip.js.map +1 -1
- package/dist/Typography.js +212 -243
- package/dist/Typography.js.map +1 -1
- package/dist/i18n.js +1 -2
- package/dist/i18n.js.map +1 -1
- package/dist/inputUtils.js +9 -11
- package/dist/inputUtils.js.map +1 -1
- package/dist/labs/DataFilters.js +18 -22
- package/dist/labs/DataFilters.js.map +1 -1
- package/dist/labs/DataTable.js +78 -92
- package/dist/labs/DataTable.js.map +1 -1
- package/dist/labs/DataTablePagination.js +9 -10
- package/dist/labs/DataTablePagination.js.map +1 -1
- package/dist/labs/DatePicker.js +10 -12
- package/dist/labs/DatePicker.js.map +1 -1
- package/dist/labs/GroupPicker.js +37 -44
- package/dist/labs/GroupPicker.js.map +1 -1
- package/dist/labs/PaginatedTable.js +23 -27
- package/dist/labs/PaginatedTable.js.map +1 -1
- package/dist/labs/StaticTable.js +17 -21
- package/dist/labs/StaticTable.js.map +1 -1
- package/dist/labs/Switch.js +20 -22
- package/dist/labs/Switch.js.map +1 -1
- package/dist/labs/VirtualizedAutocomplete.js +61 -68
- package/dist/labs/VirtualizedAutocomplete.js.map +1 -1
- package/dist/labs/datePickerTheme.js +266 -350
- package/dist/labs/datePickerTheme.js.map +1 -1
- package/dist/src/Button.d.ts +15 -1
- package/dist/src/Button.d.ts.map +1 -1
- package/dist/theme/components.js +1104 -1198
- package/dist/theme/components.js.map +1 -1
- package/dist/theme/createOdysseyMuiTheme.js +22 -25
- package/dist/theme/createOdysseyMuiTheme.js.map +1 -1
- package/dist/theme/mixins.js +3 -4
- package/dist/theme/mixins.js.map +1 -1
- package/dist/theme/palette.js +3 -4
- package/dist/theme/palette.js.map +1 -1
- package/dist/theme/shape.js +3 -4
- package/dist/theme/shape.js.map +1 -1
- package/dist/theme/spacing.js +3 -4
- package/dist/theme/spacing.js.map +1 -1
- package/dist/theme/typography.js +3 -4
- package/dist/theme/typography.js.map +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/dist/useNormalizedKey.js +1 -4
- package/dist/useNormalizedKey.js.map +1 -1
- package/package.json +3 -3
- package/src/Button.tsx +15 -0
- package/src/MenuButton.tsx +3 -3
package/dist/FieldHint.js
CHANGED
|
@@ -15,14 +15,13 @@ import { memo } from "react";
|
|
|
15
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
-
const FieldHint =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} = _ref;
|
|
18
|
+
const FieldHint = ({
|
|
19
|
+
id,
|
|
20
|
+
LinkComponent,
|
|
21
|
+
testId,
|
|
22
|
+
text,
|
|
23
|
+
translate
|
|
24
|
+
}) => {
|
|
26
25
|
return _jsxs(_FormHelperText, {
|
|
27
26
|
"data-se": testId,
|
|
28
27
|
id: id,
|
package/dist/FieldHint.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldHint.js","names":["memo","jsxs","_jsxs","Fragment","_Fragment","jsx","_jsx","FieldHint","
|
|
1
|
+
{"version":3,"file":"FieldHint.js","names":["memo","jsxs","_jsxs","Fragment","_Fragment","jsx","_jsx","FieldHint","id","LinkComponent","testId","text","translate","_FormHelperText","children","MemoizedFieldHint","displayName"],"sources":["../src/FieldHint.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo } from \"react\";\n\nimport { FormHelperText } from \"@mui/material\";\n\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport type FieldHintProps = {\n LinkComponent?: FieldComponentProps[\"HintLinkComponent\"];\n id?: string;\n text: string;\n} & HtmlProps;\n\nconst FieldHint = ({\n id,\n LinkComponent,\n testId,\n text,\n translate,\n}: FieldHintProps) => {\n return (\n <FormHelperText data-se={testId} id={id} translate={translate}>\n {text}\n {LinkComponent && (\n <>\n <span> {LinkComponent}</span>\n </>\n )}\n </FormHelperText>\n );\n};\n\nconst MemoizedFieldHint = memo(FieldHint);\nMemoizedFieldHint.displayName = \"FieldHint\";\n\nexport { MemoizedFieldHint as FieldHint };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAQ,OAAO;AAAC,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAa7B,MAAMC,SAAS,GAAGA,CAAC;EACjBC,EAAE;EACFC,aAAa;EACbC,MAAM;EACNC,IAAI;EACJC;AACc,CAAC,KAAK;EACpB,OACEV,KAAA,CAAAW,eAAA;IAAgB,WAASH,MAAO;IAACF,EAAE,EAAEA,EAAG;IAACI,SAAS,EAAEA,SAAU;IAAAE,QAAA,GAC3DH,IAAI,EACJF,aAAa,IACZH,IAAA,CAAAF,SAAA;MAAAU,QAAA,EACEZ,KAAA;QAAAY,QAAA,GAAM,MAAM,EAACL,aAAa;MAAA,CAAO;IAAC,CAClC,CACH;EAAA,CACa,CAAC;AAErB,CAAC;AAED,MAAMM,iBAAiB,GAAGf,IAAI,CAACO,SAAS,CAAC;AACzCQ,iBAAiB,CAACC,WAAW,GAAG,WAAW;AAE3C,SAASD,iBAAiB,IAAIR,SAAS"}
|
package/dist/FieldLabel.js
CHANGED
|
@@ -16,16 +16,15 @@ import { ScreenReaderText } from "./ScreenReaderText.js";
|
|
|
16
16
|
import { Subordinate } from "./Typography.js";
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
18
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
-
const FieldLabel =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} = _ref;
|
|
19
|
+
const FieldLabel = ({
|
|
20
|
+
hasVisibleLabel,
|
|
21
|
+
id,
|
|
22
|
+
inputId,
|
|
23
|
+
isOptional,
|
|
24
|
+
testId,
|
|
25
|
+
translate,
|
|
26
|
+
text
|
|
27
|
+
}) => {
|
|
29
28
|
const {
|
|
30
29
|
t
|
|
31
30
|
} = useTranslation();
|
package/dist/FieldLabel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldLabel.js","names":["memo","useMemo","useTranslation","ScreenReaderText","Subordinate","jsx","_jsx","jsxs","_jsxs","FieldLabel","
|
|
1
|
+
{"version":3,"file":"FieldLabel.js","names":["memo","useMemo","useTranslation","ScreenReaderText","Subordinate","jsx","_jsx","jsxs","_jsxs","FieldLabel","hasVisibleLabel","id","inputId","isOptional","testId","translate","text","t","inputLabel","_InputLabel","htmlFor","children","MemoizedFieldLabel","displayName"],"sources":["../src/FieldLabel.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { InputLabel as MuiInputLabel } from \"@mui/material\";\nimport { memo, useMemo } from \"react\";\n\nimport { useTranslation } from \"react-i18next\";\nimport { ScreenReaderText } from \"./ScreenReaderText\";\nimport { Subordinate } from \"./Typography\";\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport type FieldLabelProps = {\n hasVisibleLabel: boolean;\n id: string;\n inputId: string;\n isOptional: boolean;\n text: string;\n} & HtmlProps;\n\nconst FieldLabel = ({\n hasVisibleLabel,\n id,\n inputId,\n isOptional,\n testId,\n translate,\n text,\n}: FieldLabelProps) => {\n const { t } = useTranslation();\n\n const inputLabel = useMemo(\n () => (\n <MuiInputLabel\n data-se={testId}\n htmlFor={inputId}\n id={id}\n translate={translate}\n >\n <span>{text}</span>\n {isOptional && (\n <Subordinate>{t(\"fieldlabel.optional.text\")}</Subordinate>\n )}\n </MuiInputLabel>\n ),\n [id, inputId, isOptional, testId, translate, text, t]\n );\n\n return hasVisibleLabel ? (\n inputLabel\n ) : (\n <ScreenReaderText translate={translate}>{inputLabel}</ScreenReaderText>\n );\n};\n\nconst MemoizedFieldLabel = memo(FieldLabel);\nMemoizedFieldLabel.displayName = \"FieldLabel\";\n\nexport { MemoizedFieldLabel as FieldLabel };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAI,EAAEC,OAAO,QAAQ,OAAO;AAErC,SAASC,cAAc,QAAQ,eAAe;AAAC,SACtCC,gBAAgB;AAAA,SAChBC,WAAW;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAWpB,MAAMC,UAAU,GAAGA,CAAC;EAClBC,eAAe;EACfC,EAAE;EACFC,OAAO;EACPC,UAAU;EACVC,MAAM;EACNC,SAAS;EACTC;AACe,CAAC,KAAK;EACrB,MAAM;IAAEC;EAAE,CAAC,GAAGf,cAAc,CAAC,CAAC;EAE9B,MAAMgB,UAAU,GAAGjB,OAAO,CACxB,MACEO,KAAA,CAAAW,WAAA;IACE,WAASL,MAAO;IAChBM,OAAO,EAAER,OAAQ;IACjBD,EAAE,EAAEA,EAAG;IACPI,SAAS,EAAEA,SAAU;IAAAM,QAAA,GAErBf,IAAA;MAAAe,QAAA,EAAOL;IAAI,CAAO,CAAC,EAClBH,UAAU,IACTP,IAAA,CAACF,WAAW;MAAAiB,QAAA,EAAEJ,CAAC,CAAC,0BAA0B;IAAC,CAAc,CAC1D;EAAA,CACY,CAChB,EACD,CAACN,EAAE,EAAEC,OAAO,EAAEC,UAAU,EAAEC,MAAM,EAAEC,SAAS,EAAEC,IAAI,EAAEC,CAAC,CACtD,CAAC;EAED,OAAOP,eAAe,GACpBQ,UAAU,GAEVZ,IAAA,CAACH,gBAAgB;IAACY,SAAS,EAAEA,SAAU;IAAAM,QAAA,EAAEH;EAAU,CAAmB,CACvE;AACH,CAAC;AAED,MAAMI,kBAAkB,GAAGtB,IAAI,CAACS,UAAU,CAAC;AAC3Ca,kBAAkB,CAACC,WAAW,GAAG,YAAY;AAE7C,SAASD,kBAAkB,IAAIb,UAAU"}
|
package/dist/Fieldset.js
CHANGED
|
@@ -17,18 +17,17 @@ import { useOdysseyDesignTokens } from "./OdysseyDesignTokensContext.js";
|
|
|
17
17
|
import { useUniqueId } from "./useUniqueId.js";
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
19
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
-
const Fieldset =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} = _ref;
|
|
20
|
+
const Fieldset = ({
|
|
21
|
+
alert,
|
|
22
|
+
children,
|
|
23
|
+
description,
|
|
24
|
+
id: idOverride,
|
|
25
|
+
isDisabled = false,
|
|
26
|
+
legend,
|
|
27
|
+
name,
|
|
28
|
+
testId,
|
|
29
|
+
translate
|
|
30
|
+
}) => {
|
|
32
31
|
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
33
32
|
const id = useUniqueId(idOverride);
|
|
34
33
|
const fieldsetContextValue = useMemo(() => ({
|
package/dist/Fieldset.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fieldset.js","names":["memo","useMemo","FieldsetContext","Legend","Support","useOdysseyDesignTokens","useUniqueId","jsx","_jsx","jsxs","_jsxs","Fieldset","
|
|
1
|
+
{"version":3,"file":"Fieldset.js","names":["memo","useMemo","FieldsetContext","Legend","Support","useOdysseyDesignTokens","useUniqueId","jsx","_jsx","jsxs","_jsxs","Fieldset","alert","children","description","id","idOverride","isDisabled","legend","name","testId","translate","odysseyDesignTokens","fieldsetContextValue","_Box","component","disabled","sx","border","margin","Spacing0","marginBlockEnd","Spacing6","maxWidth","TypographyLineLengthMax","padding","Provider","value","MemoizedFieldset","displayName"],"sources":["../src/Fieldset.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 { Box } from \"@mui/material\";\nimport { memo, ReactElement, useMemo } from \"react\";\n\nimport { Callout } from \"./Callout\";\nimport { FieldsetContext } from \"./FieldsetContext\";\nimport { Legend, Support } from \"./Typography\";\nimport { useOdysseyDesignTokens } from \"./OdysseyDesignTokensContext\";\nimport { useUniqueId } from \"./useUniqueId\";\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport type FieldsetProps = {\n /**\n * A Callout indicating a Fieldset-wide error or status update.\n */\n alert?: ReactElement<typeof Callout>;\n /**\n * The Field components within the Fieldset\n */\n children: ReactElement | Array<ReactElement>;\n /**\n * A supplementary description\n */\n description?: string;\n /**\n * Defines a unique identifier (ID) which must be unique in the whole document.\n */\n id?: string;\n /**\n * Disables the component and any wrapped input fields.\n */\n isDisabled?: boolean;\n /**\n * The title of the Fieldset\n */\n legend: string;\n /**\n * The name associated with the group.\n */\n name?: string;\n} & HtmlProps;\n\nconst Fieldset = ({\n alert,\n children,\n description,\n id: idOverride,\n isDisabled = false,\n legend,\n name,\n testId,\n translate,\n}: FieldsetProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const id = useUniqueId(idOverride);\n\n const fieldsetContextValue = useMemo(\n () => ({\n isDisabled,\n }),\n [isDisabled]\n );\n\n return (\n <Box\n component=\"fieldset\"\n data-se={testId}\n disabled={isDisabled}\n name={name}\n id={id}\n sx={{\n border: \"0\",\n margin: odysseyDesignTokens.Spacing0,\n marginBlockEnd: odysseyDesignTokens.Spacing6,\n maxWidth: odysseyDesignTokens.TypographyLineLengthMax,\n padding: odysseyDesignTokens.Spacing0,\n\n \"&:last-child\": {\n marginBlockEnd: odysseyDesignTokens.Spacing0,\n },\n }}\n >\n <Legend translate={translate}>{legend}</Legend>\n\n {description && <Support translate={translate}>{description}</Support>}\n\n {alert}\n\n <FieldsetContext.Provider value={fieldsetContextValue}>\n {children}\n </FieldsetContext.Provider>\n </Box>\n );\n};\n\nconst MemoizedFieldset = memo(Fieldset);\nMemoizedFieldset.displayName = \"Fieldset\";\n\nexport { MemoizedFieldset as Fieldset };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAI,EAAgBC,OAAO,QAAQ,OAAO;AAAC,SAG3CC,eAAe;AAAA,SACfC,MAAM,EAAEC,OAAO;AAAA,SACfC,sBAAsB;AAAA,SACtBC,WAAW;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAkCpB,MAAMC,QAAQ,GAAGA,CAAC;EAChBC,KAAK;EACLC,QAAQ;EACRC,WAAW;EACXC,EAAE,EAAEC,UAAU;EACdC,UAAU,GAAG,KAAK;EAClBC,MAAM;EACNC,IAAI;EACJC,MAAM;EACNC;AACa,CAAC,KAAK;EACnB,MAAMC,mBAAmB,GAAGjB,sBAAsB,CAAC,CAAC;EACpD,MAAMU,EAAE,GAAGT,WAAW,CAACU,UAAU,CAAC;EAElC,MAAMO,oBAAoB,GAAGtB,OAAO,CAClC,OAAO;IACLgB;EACF,CAAC,CAAC,EACF,CAACA,UAAU,CACb,CAAC;EAED,OACEP,KAAA,CAAAc,IAAA;IACEC,SAAS,EAAC,UAAU;IACpB,WAASL,MAAO;IAChBM,QAAQ,EAAET,UAAW;IACrBE,IAAI,EAAEA,IAAK;IACXJ,EAAE,EAAEA,EAAG;IACPY,EAAE,EAAE;MACFC,MAAM,EAAE,GAAG;MACXC,MAAM,EAAEP,mBAAmB,CAACQ,QAAQ;MACpCC,cAAc,EAAET,mBAAmB,CAACU,QAAQ;MAC5CC,QAAQ,EAAEX,mBAAmB,CAACY,uBAAuB;MACrDC,OAAO,EAAEb,mBAAmB,CAACQ,QAAQ;MAErC,cAAc,EAAE;QACdC,cAAc,EAAET,mBAAmB,CAACQ;MACtC;IACF,CAAE;IAAAjB,QAAA,GAEFL,IAAA,CAACL,MAAM;MAACkB,SAAS,EAAEA,SAAU;MAAAR,QAAA,EAAEK;IAAM,CAAS,CAAC,EAE9CJ,WAAW,IAAIN,IAAA,CAACJ,OAAO;MAACiB,SAAS,EAAEA,SAAU;MAAAR,QAAA,EAAEC;IAAW,CAAU,CAAC,EAErEF,KAAK,EAENJ,IAAA,CAACN,eAAe,CAACkC,QAAQ;MAACC,KAAK,EAAEd,oBAAqB;MAAAV,QAAA,EACnDA;IAAQ,CACe,CAAC;EAAA,CACxB,CAAC;AAEV,CAAC;AAED,MAAMyB,gBAAgB,GAAGtC,IAAI,CAACW,QAAQ,CAAC;AACvC2B,gBAAgB,CAACC,WAAW,GAAG,UAAU;AAEzC,SAASD,gBAAgB,IAAI3B,QAAQ"}
|
package/dist/Form.js
CHANGED
|
@@ -19,23 +19,22 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
19
19
|
export const formEncodingTypeValues = ["application/x-www-form-urlencoded", "application/json", "multipart/form-data", "text/plain"];
|
|
20
20
|
export const formAutoCompleteTypeValues = ["on", "off"];
|
|
21
21
|
export const formMethodValues = ["post", "get", "dialog"];
|
|
22
|
-
const Form =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} = _ref;
|
|
22
|
+
const Form = ({
|
|
23
|
+
alert,
|
|
24
|
+
autoCompleteType,
|
|
25
|
+
children,
|
|
26
|
+
description,
|
|
27
|
+
encodingType,
|
|
28
|
+
formActions,
|
|
29
|
+
id: idOverride,
|
|
30
|
+
method,
|
|
31
|
+
name,
|
|
32
|
+
noValidate = false,
|
|
33
|
+
target,
|
|
34
|
+
testId,
|
|
35
|
+
title,
|
|
36
|
+
translate
|
|
37
|
+
}) => {
|
|
39
38
|
const id = useUniqueId(idOverride);
|
|
40
39
|
return _jsxs(_Box, {
|
|
41
40
|
autoComplete: autoCompleteType,
|
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","
|
|
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;IAChB,WAASL,MAAO;IAChBM,OAAO,EAAEd,YAAa;IACtBE,EAAE,EAAEA,EAAG;IACPE,MAAM,EAAEA,MAAO;IACfC,IAAI,EAAEA,IAAK;IACXC,UAAU,EAAEA,UAAW;IACvBC,MAAM,EAAEA,MAAO;IACfQ,EAAE,EAAE;MACFC,QAAQ,EAAGC,KAAK,IAAKA,KAAK,CAACC,MAAM,CAACF,QAAQ;MAC1CG,MAAM,EAAGF,KAAK,IAAKA,KAAK,CAACG,OAAO,CAAC,CAAC,CAAC;MACnCC,OAAO,EAAGJ,KAAK,IAAKA,KAAK,CAACG,OAAO,CAAC,CAAC;IACrC,CAAE;IAAAtB,QAAA,GAEFP,KAAA,CAAAoB,IAAA;MACEE,SAAS,EAAC,KAAK;MACfE,EAAE,EAAE;QACFO,cAAc,EAAGL,KAAK,IAAKA,KAAK,CAACG,OAAO,CAAC,CAAC;MAC5C,CAAE;MAAAtB,QAAA,GAEDW,KAAK,IACJpB,IAAA,CAACJ,QAAQ;QAAC4B,SAAS,EAAC,IAAI;QAACH,SAAS,EAAEA,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"}
|
package/dist/Link.js
CHANGED
|
@@ -16,20 +16,19 @@ import { ExternalLinkIcon } from "./icons.generated/index.js";
|
|
|
16
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
18
|
export const linkVariantValues = ["default", "monochrome"];
|
|
19
|
-
const Link =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} = _ref;
|
|
19
|
+
const Link = ({
|
|
20
|
+
ariaLabel,
|
|
21
|
+
children,
|
|
22
|
+
href,
|
|
23
|
+
icon,
|
|
24
|
+
linkRef,
|
|
25
|
+
rel,
|
|
26
|
+
target,
|
|
27
|
+
testId,
|
|
28
|
+
translate,
|
|
29
|
+
variant,
|
|
30
|
+
onClick
|
|
31
|
+
}) => {
|
|
33
32
|
const localLinkRef = useRef(null);
|
|
34
33
|
useImperativeHandle(linkRef, () => {
|
|
35
34
|
return {
|
package/dist/Link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.js","names":["memo","useImperativeHandle","useRef","ExternalLinkIcon","jsx","_jsx","jsxs","_jsxs","linkVariantValues","Link","
|
|
1
|
+
{"version":3,"file":"Link.js","names":["memo","useImperativeHandle","useRef","ExternalLinkIcon","jsx","_jsx","jsxs","_jsxs","linkVariantValues","Link","ariaLabel","children","href","icon","linkRef","rel","target","testId","translate","variant","onClick","localLinkRef","focus","current","_Link","ref","className","role","MemoizedLink","displayName"],"sources":["../src/Link.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, useImperativeHandle, useRef } from \"react\";\nimport { ExternalLinkIcon } from \"./icons.generated\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { FocusHandle } from \"./inputUtils\";\n\nimport { Link as MuiLink, LinkProps as MuiLinkProps } from \"@mui/material\";\n\nexport const linkVariantValues = [\"default\", \"monochrome\"] as const;\n\nexport type LinkProps = {\n /**\n * The ARIA label for the Link\n */\n ariaLabel?: string;\n /**\n * The content within the Link\n */\n children: React.ReactNode;\n /**\n * The Link destination\n */\n href: string;\n /**\n * An optional Icon component at the start of the Link\n */\n icon?: ReactElement;\n /**\n * The ref forwarded to the TextField\n */\n linkRef?: React.RefObject<FocusHandle>;\n /**\n * The click event handler for the Link\n */\n onClick?: MuiLinkProps[\"onClick\"];\n /**\n * The HTML `rel` attribute for the Link\n */\n rel?: string;\n /**\n * The HTML `target` attribute for the Link\n */\n target?:\n | \"_self\"\n | \"_blank\"\n | \"_parent\"\n | \"_top\"\n | (string & NonNullable<unknown>);\n /**\n * The visual presentation of the Link (default or monochrome)\n */\n variant?: (typeof linkVariantValues)[number];\n} & HtmlProps;\n\nconst Link = ({\n ariaLabel,\n children,\n href,\n icon,\n linkRef,\n rel,\n target,\n testId,\n translate,\n variant,\n onClick,\n}: LinkProps) => {\n const localLinkRef = useRef<HTMLAnchorElement>(null);\n useImperativeHandle(\n linkRef,\n () => {\n return {\n focus: () => {\n localLinkRef.current?.focus();\n },\n };\n },\n []\n );\n\n return (\n <MuiLink\n aria-label={ariaLabel}\n data-se={testId}\n href={href}\n ref={localLinkRef}\n rel={rel}\n target={target}\n translate={translate}\n variant={variant}\n onClick={onClick}\n >\n {icon && <span className=\"Link-icon\">{icon}</span>}\n\n {children}\n\n {target === \"_blank\" && (\n <span className=\"Link-indicator\" role=\"presentation\">\n <ExternalLinkIcon />\n </span>\n )}\n </MuiLink>\n );\n};\n\nconst MemoizedLink = memo(Link);\n\nMemoizedLink.displayName = \"Link\";\n\nexport { MemoizedLink as Link };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAgBC,mBAAmB,EAAEC,MAAM,QAAQ,OAAO;AAAC,SAC/DC,gBAAgB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAMzB,OAAO,MAAMC,iBAAiB,GAAG,CAAC,SAAS,EAAE,YAAY,CAAU;AA8CnE,MAAMC,IAAI,GAAGA,CAAC;EACZC,SAAS;EACTC,QAAQ;EACRC,IAAI;EACJC,IAAI;EACJC,OAAO;EACPC,GAAG;EACHC,MAAM;EACNC,MAAM;EACNC,SAAS;EACTC,OAAO;EACPC;AACS,CAAC,KAAK;EACf,MAAMC,YAAY,GAAGnB,MAAM,CAAoB,IAAI,CAAC;EACpDD,mBAAmB,CACjBa,OAAO,EACP,MAAM;IACJ,OAAO;MACLQ,KAAK,EAAEA,CAAA,KAAM;QACXD,YAAY,CAACE,OAAO,EAAED,KAAK,CAAC,CAAC;MAC/B;IACF,CAAC;EACH,CAAC,EACD,EACF,CAAC;EAED,OACEf,KAAA,CAAAiB,KAAA;IACE,cAAYd,SAAU;IACtB,WAASO,MAAO;IAChBL,IAAI,EAAEA,IAAK;IACXa,GAAG,EAAEJ,YAAa;IAClBN,GAAG,EAAEA,GAAI;IACTC,MAAM,EAAEA,MAAO;IACfE,SAAS,EAAEA,SAAU;IACrBC,OAAO,EAAEA,OAAQ;IACjBC,OAAO,EAAEA,OAAQ;IAAAT,QAAA,GAEhBE,IAAI,IAAIR,IAAA;MAAMqB,SAAS,EAAC,WAAW;MAAAf,QAAA,EAAEE;IAAI,CAAO,CAAC,EAEjDF,QAAQ,EAERK,MAAM,KAAK,QAAQ,IAClBX,IAAA;MAAMqB,SAAS,EAAC,gBAAgB;MAACC,IAAI,EAAC,cAAc;MAAAhB,QAAA,EAClDN,IAAA,CAACF,gBAAgB,IAAE;IAAC,CAChB,CACP;EAAA,CACM,CAAC;AAEd,CAAC;AAED,MAAMyB,YAAY,GAAG5B,IAAI,CAACS,IAAI,CAAC;AAE/BmB,YAAY,CAACC,WAAW,GAAG,MAAM;AAEjC,SAASD,YAAY,IAAInB,IAAI"}
|
package/dist/MenuButton.js
CHANGED
|
@@ -18,25 +18,24 @@ import { MenuContext } from "./MenuContext.js";
|
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
19
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
20
|
export const menuAlignmentValues = ["left", "right"];
|
|
21
|
-
const MenuButton =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} = _ref;
|
|
21
|
+
const MenuButton = ({
|
|
22
|
+
ariaLabel,
|
|
23
|
+
ariaLabelledBy,
|
|
24
|
+
ariaDescribedBy,
|
|
25
|
+
buttonLabel = "",
|
|
26
|
+
buttonVariant = "secondary",
|
|
27
|
+
children,
|
|
28
|
+
shouldCloseOnSelect = true,
|
|
29
|
+
endIcon: endIconProp,
|
|
30
|
+
id: idOverride,
|
|
31
|
+
isDisabled,
|
|
32
|
+
isOverflow,
|
|
33
|
+
menuAlignment = "left",
|
|
34
|
+
size,
|
|
35
|
+
testId,
|
|
36
|
+
tooltipText,
|
|
37
|
+
translate
|
|
38
|
+
}) => {
|
|
40
39
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
41
40
|
const isOpen = Boolean(anchorEl);
|
|
42
41
|
const closeMenu = useCallback(() => {
|
|
@@ -65,9 +64,9 @@ const MenuButton = _ref => {
|
|
|
65
64
|
}), [menuAlignment]);
|
|
66
65
|
return _jsxs("div", {
|
|
67
66
|
children: [_jsx(Button, {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
ariaControls: isOpen ? `${uniqueId}-menu` : undefined,
|
|
68
|
+
ariaExpanded: isOpen ? "true" : undefined,
|
|
69
|
+
ariaHasPopup: "true",
|
|
71
70
|
ariaDescribedBy: ariaDescribedBy,
|
|
72
71
|
ariaLabel: ariaLabel,
|
|
73
72
|
ariaLabelledBy: ariaLabelledBy,
|
package/dist/MenuButton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuButton.js","names":["memo","useCallback","useMemo","useState","Button","useUniqueId","ChevronDownIcon","MoreIcon","MenuContext","jsx","_jsx","jsxs","_jsxs","menuAlignmentValues","MenuButton","
|
|
1
|
+
{"version":3,"file":"MenuButton.js","names":["memo","useCallback","useMemo","useState","Button","useUniqueId","ChevronDownIcon","MoreIcon","MenuContext","jsx","_jsx","jsxs","_jsxs","menuAlignmentValues","MenuButton","ariaLabel","ariaLabelledBy","ariaDescribedBy","buttonLabel","buttonVariant","children","shouldCloseOnSelect","endIcon","endIconProp","id","idOverride","isDisabled","isOverflow","menuAlignment","size","testId","tooltipText","translate","anchorEl","setAnchorEl","isOpen","Boolean","closeMenu","openMenu","event","currentTarget","uniqueId","menuListProps","providerValue","anchorOrigin","horizontal","vertical","transformOrigin","ariaControls","undefined","ariaExpanded","ariaHasPopup","label","onClick","variant","_Menu","MenuListProps","onClose","open","Provider","value","MemoizedMenuButton","displayName"],"sources":["../src/MenuButton.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, type ReactElement, useCallback, useMemo, useState } from \"react\";\nimport {\n Divider,\n ListSubheader,\n Menu as MuiMenu,\n PopoverOrigin,\n} from \"@mui/material\";\n\nimport {\n Button,\n buttonSizeValues,\n buttonVariantValues,\n MenuItem,\n useUniqueId,\n} from \"./\";\nimport { ChevronDownIcon, MoreIcon } from \"./icons.generated\";\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport { MenuContext, MenuContextType } from \"./MenuContext\";\nimport { NullElement } from \"./NullElement\";\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport const menuAlignmentValues = [\"left\", \"right\"] as const;\n\nexport type MenuButtonProps = {\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 label on the triggering Button\n */\n buttonLabel?: string;\n /**\n * The variant of the triggering Button\n */\n buttonVariant?: (typeof buttonVariantValues)[number];\n /**\n * The <MenuItem> components within the Menu.\n */\n children:\n | ReactElement<typeof MenuItem | typeof Divider | typeof ListSubheader>\n | Array<\n | ReactElement<typeof MenuItem | typeof Divider | typeof ListSubheader>\n | NullElement\n >\n | NullElement;\n /**\n * The end Icon on the trigggering Button\n */\n endIcon?: ReactElement;\n /**\n * The id of the Button\n */\n id?: string;\n /**\n * If the MenuButton is an overflow menu or standard menu.\n */\n isOverflow?: boolean;\n /**\n * The horizontal alignment of the menu.\n */\n menuAlignment?: (typeof menuAlignmentValues)[number];\n /**\n * If true (the default), the menu will close when a child MenuItem is clicked.\n * Otherwise, it will remain open.\n */\n shouldCloseOnSelect?: boolean;\n /**\n * The size of the button\n */\n size?: (typeof buttonSizeValues)[number];\n /**\n * The tooltip text for the Button if it's icon-only\n */\n tooltipText?: string;\n} & (\n | {\n ariaLabel?: string;\n ariaLabelledBy?: string;\n buttonLabel: string;\n }\n | {\n ariaLabel: string;\n ariaLabelledBy?: string;\n buttonLabel?: undefined | \"\";\n }\n | {\n ariaLabel?: string;\n ariaLabelledBy: string;\n buttonLabel?: undefined | \"\";\n }\n) &\n Pick<FieldComponentProps, \"isDisabled\"> &\n HtmlProps;\n\nconst MenuButton = ({\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy,\n buttonLabel = \"\",\n buttonVariant = \"secondary\",\n children,\n shouldCloseOnSelect = true,\n endIcon: endIconProp,\n id: idOverride,\n isDisabled,\n isOverflow,\n menuAlignment = \"left\",\n size,\n testId,\n tooltipText,\n translate,\n}: MenuButtonProps) => {\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\n\n const isOpen = Boolean(anchorEl);\n\n const closeMenu = useCallback(() => {\n setAnchorEl(null);\n }, []);\n\n const openMenu = useCallback<MenuContextType[\"openMenu\"]>((event) => {\n setAnchorEl(event.currentTarget);\n }, []);\n\n const uniqueId = useUniqueId(idOverride);\n\n const menuListProps = useMemo(\n () => ({ \"aria-labelledby\": `${uniqueId}-button` }),\n [uniqueId]\n );\n\n const providerValue = useMemo<MenuContextType>(\n () => ({\n closeMenu,\n openMenu,\n shouldCloseOnSelect,\n }),\n [closeMenu, openMenu, shouldCloseOnSelect]\n );\n\n const endIcon = endIconProp ? (\n endIconProp\n ) : isOverflow ? (\n <MoreIcon />\n ) : (\n <ChevronDownIcon />\n );\n\n const anchorOrigin = useMemo(\n () =>\n ({\n horizontal: menuAlignment,\n vertical: \"bottom\",\n } as PopoverOrigin),\n [menuAlignment]\n );\n\n const transformOrigin = useMemo(\n () =>\n ({\n horizontal: menuAlignment,\n vertical: \"top\",\n } as PopoverOrigin),\n [menuAlignment]\n );\n\n return (\n <div>\n <Button\n ariaControls={isOpen ? `${uniqueId}-menu` : undefined}\n ariaExpanded={isOpen ? \"true\" : undefined}\n ariaHasPopup=\"true\"\n ariaDescribedBy={ariaDescribedBy}\n ariaLabel={ariaLabel}\n ariaLabelledBy={ariaLabelledBy}\n data-se={testId}\n endIcon={endIcon}\n id={`${uniqueId}-button`}\n isDisabled={isDisabled}\n label={buttonLabel}\n onClick={openMenu}\n size={size}\n tooltipText={tooltipText}\n translate={translate}\n variant={buttonVariant}\n />\n\n <MuiMenu\n anchorOrigin={anchorOrigin}\n transformOrigin={transformOrigin}\n anchorEl={anchorEl}\n id={`${uniqueId}-menu`}\n MenuListProps={menuListProps}\n onClose={closeMenu}\n open={isOpen}\n >\n <MenuContext.Provider value={providerValue}>\n {children}\n </MenuContext.Provider>\n </MuiMenu>\n </div>\n );\n};\n\nconst MemoizedMenuButton = memo(MenuButton);\nMemoizedMenuButton.displayName = \"MenuButton\";\n\nexport { MemoizedMenuButton as MenuButton };\n"],"mappings":"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"}
|
package/dist/MenuItem.js
CHANGED
|
@@ -14,17 +14,16 @@ import { menuItemClasses } from "@mui/material/MenuItem";
|
|
|
14
14
|
import { memo, useCallback, useContext } from "react";
|
|
15
15
|
import { MenuContext } from "./MenuContext.js";
|
|
16
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
-
const MenuItem =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
} = _ref;
|
|
17
|
+
const MenuItem = ({
|
|
18
|
+
children,
|
|
19
|
+
hasInitialFocus,
|
|
20
|
+
isSelected,
|
|
21
|
+
isDisabled,
|
|
22
|
+
onClick: onClickProp,
|
|
23
|
+
testId,
|
|
24
|
+
value,
|
|
25
|
+
variant = "default"
|
|
26
|
+
}) => {
|
|
28
27
|
const {
|
|
29
28
|
closeMenu,
|
|
30
29
|
shouldCloseOnSelect
|
package/dist/MenuItem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.js","names":["menuItemClasses","memo","useCallback","useContext","MenuContext","jsx","_jsx","MenuItem","
|
|
1
|
+
{"version":3,"file":"MenuItem.js","names":["menuItemClasses","memo","useCallback","useContext","MenuContext","jsx","_jsx","MenuItem","children","hasInitialFocus","isSelected","isDisabled","onClick","onClickProp","testId","value","variant","closeMenu","shouldCloseOnSelect","event","_MenuItem","autoFocus","className","root","undefined","disabled","selected","MemoizedMenuItem","displayName"],"sources":["../src/MenuItem.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n MenuItem as MuiMenuItem,\n MenuItemProps as MuiMenuItemProps,\n} from \"@mui/material\";\nimport { menuItemClasses } from \"@mui/material/MenuItem\";\nimport { memo, useCallback, useContext, type ReactNode } from \"react\";\n\nimport { MenuContext } from \"./MenuContext\";\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport type MenuItemProps = {\n /**\n * The content of the menu item.\n */\n children: ReactNode;\n /**\n * If `true`, the menu item will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * If `true`, the menu item will be visually marked as selected.\n */\n isSelected?: boolean;\n /**\n * If `true`, the menu item will be visually marked as disabled.\n */\n isDisabled?: boolean;\n /**\n * Callback fired when the menu item is clicked.\n */\n onClick?: MuiMenuItemProps[\"onClick\"];\n /**\n * The value associated with the menu item.\n */\n value?: string;\n /**\n * The variant of the menu item.\n * - \"default\": The default variant.\n * - \"destructive\": A variant indicating a destructive action.\n */\n variant?: \"default\" | \"destructive\";\n} & HtmlProps;\n\nconst MenuItem = ({\n children,\n hasInitialFocus,\n isSelected,\n isDisabled,\n onClick: onClickProp,\n testId,\n value,\n variant = \"default\",\n}: MenuItemProps) => {\n const { closeMenu, shouldCloseOnSelect } = useContext(MenuContext);\n\n const onClick = useCallback<NonNullable<MuiMenuItemProps[\"onClick\"]>>(\n (event) => {\n onClickProp?.(event);\n if (shouldCloseOnSelect) {\n closeMenu();\n }\n },\n [onClickProp, closeMenu, shouldCloseOnSelect]\n );\n\n return (\n <MuiMenuItem\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n className={\n variant === \"destructive\"\n ? `${menuItemClasses.root}-destructive`\n : undefined\n }\n data-se={testId}\n disabled={isDisabled}\n onClick={onClick}\n selected={isSelected}\n value={value}\n >\n {children}\n </MuiMenuItem>\n );\n};\n\nconst MemoizedMenuItem = memo(MenuItem);\nMemoizedMenuItem.displayName = \"MenuItem\";\n\nexport { MemoizedMenuItem as MenuItem };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA,SAASA,eAAe,QAAQ,wBAAwB;AACxD,SAASC,IAAI,EAAEC,WAAW,EAAEC,UAAU,QAAwB,OAAO;AAAC,SAE7DC,WAAW;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAoCpB,MAAMC,QAAQ,GAAGA,CAAC;EAChBC,QAAQ;EACRC,eAAe;EACfC,UAAU;EACVC,UAAU;EACVC,OAAO,EAAEC,WAAW;EACpBC,MAAM;EACNC,KAAK;EACLC,OAAO,GAAG;AACG,CAAC,KAAK;EACnB,MAAM;IAAEC,SAAS;IAAEC;EAAoB,CAAC,GAAGf,UAAU,CAACC,WAAW,CAAC;EAElE,MAAMQ,OAAO,GAAGV,WAAW,CACxBiB,KAAK,IAAK;IACTN,WAAW,GAAGM,KAAK,CAAC;IACpB,IAAID,mBAAmB,EAAE;MACvBD,SAAS,CAAC,CAAC;IACb;EACF,CAAC,EACD,CAACJ,WAAW,EAAEI,SAAS,EAAEC,mBAAmB,CAC9C,CAAC;EAED,OACEZ,IAAA,CAAAc,SAAA;IAEEC,SAAS,EAAEZ,eAAgB;IAC3Ba,SAAS,EACPN,OAAO,KAAK,aAAa,GACpB,GAAEhB,eAAe,CAACuB,IAAK,cAAa,GACrCC,SACL;IACD,WAASV,MAAO;IAChBW,QAAQ,EAAEd,UAAW;IACrBC,OAAO,EAAEA,OAAQ;IACjBc,QAAQ,EAAEhB,UAAW;IACrBK,KAAK,EAAEA,KAAM;IAAAP,QAAA,EAEZA;EAAQ,CACE,CAAC;AAElB,CAAC;AAED,MAAMmB,gBAAgB,GAAG1B,IAAI,CAACM,QAAQ,CAAC;AACvCoB,gBAAgB,CAACC,WAAW,GAAG,UAAU;AAEzC,SAASD,gBAAgB,IAAIpB,QAAQ"}
|
package/dist/MuiPropsChild.js
CHANGED
|
@@ -13,11 +13,10 @@
|
|
|
13
13
|
import { forwardRef, memo, useMemo } from "react";
|
|
14
14
|
import { MuiPropsContext } from "./MuiPropsContext.js";
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
const MuiPropsChild = forwardRef((
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} = _ref;
|
|
16
|
+
const MuiPropsChild = forwardRef(({
|
|
17
|
+
children,
|
|
18
|
+
...muiProps
|
|
19
|
+
}, ref) => {
|
|
21
20
|
const providerValue = useMemo(() => ({
|
|
22
21
|
...muiProps,
|
|
23
22
|
ref
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MuiPropsChild.js","names":["forwardRef","memo","useMemo","MuiPropsContext","jsx","_jsx","MuiPropsChild","
|
|
1
|
+
{"version":3,"file":"MuiPropsChild.js","names":["forwardRef","memo","useMemo","MuiPropsContext","jsx","_jsx","MuiPropsChild","children","muiProps","ref","providerValue","Provider","value","MemoizedMuiPropsChild","displayName"],"sources":["../src/MuiPropsChild.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { forwardRef, memo, ReactNode, useMemo } from \"react\";\n\nimport { MuiPropsContext, MuiPropsContextType } from \"./MuiPropsContext\";\n\nexport type MuiPropsChildProps = {\n children: ReactNode;\n};\n\nconst MuiPropsChild = forwardRef<HTMLElement, MuiPropsChildProps>(\n ({ children, ...muiProps }, ref) => {\n const providerValue = useMemo<MuiPropsContextType>(\n () => ({\n ...muiProps,\n ref,\n }),\n [muiProps, ref]\n );\n\n return (\n <MuiPropsContext.Provider value={providerValue}>\n {children}\n </MuiPropsContext.Provider>\n );\n }\n);\n\nconst MemoizedMuiPropsChild = memo(MuiPropsChild);\nMemoizedMuiPropsChild.displayName = \"MuiPropsChild\";\n\nexport { MemoizedMuiPropsChild as MuiPropsChild };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,IAAI,EAAaC,OAAO,QAAQ,OAAO;AAAC,SAEpDC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAMxB,MAAMC,aAAa,GAAGN,UAAU,CAC9B,CAAC;EAAEO,QAAQ;EAAE,GAAGC;AAAS,CAAC,EAAEC,GAAG,KAAK;EAClC,MAAMC,aAAa,GAAGR,OAAO,CAC3B,OAAO;IACL,GAAGM,QAAQ;IACXC;EACF,CAAC,CAAC,EACF,CAACD,QAAQ,EAAEC,GAAG,CAChB,CAAC;EAED,OACEJ,IAAA,CAACF,eAAe,CAACQ,QAAQ;IAACC,KAAK,EAAEF,aAAc;IAAAH,QAAA,EAC5CA;EAAQ,CACe,CAAC;AAE/B,CACF,CAAC;AAED,MAAMM,qBAAqB,GAAGZ,IAAI,CAACK,aAAa,CAAC;AACjDO,qBAAqB,CAACC,WAAW,GAAG,eAAe;AAEnD,SAASD,qBAAqB,IAAIP,aAAa"}
|
package/dist/NativeSelect.js
CHANGED
|
@@ -15,31 +15,30 @@ import React, { forwardRef, memo, useCallback, useImperativeHandle, useMemo, use
|
|
|
15
15
|
import { Field } from "./Field.js";
|
|
16
16
|
import { getControlState, useInputValues } from "./inputUtils.js";
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
-
const NativeSelect = forwardRef((
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} = _ref;
|
|
18
|
+
const NativeSelect = forwardRef(({
|
|
19
|
+
ariaDescribedBy,
|
|
20
|
+
autoCompleteType,
|
|
21
|
+
defaultValue,
|
|
22
|
+
errorMessage,
|
|
23
|
+
errorMessageList,
|
|
24
|
+
hasMultipleChoices: hasMultipleChoicesProp,
|
|
25
|
+
hint,
|
|
26
|
+
HintLinkComponent,
|
|
27
|
+
id: idOverride,
|
|
28
|
+
inputRef,
|
|
29
|
+
isDisabled = false,
|
|
30
|
+
isFullWidth = false,
|
|
31
|
+
isMultiSelect,
|
|
32
|
+
isOptional = false,
|
|
33
|
+
label,
|
|
34
|
+
onBlur,
|
|
35
|
+
onChange: onChangeProp,
|
|
36
|
+
onFocus,
|
|
37
|
+
testId,
|
|
38
|
+
translate,
|
|
39
|
+
value,
|
|
40
|
+
children
|
|
41
|
+
}, ref) => {
|
|
43
42
|
const controlledStateRef = useRef(getControlState({
|
|
44
43
|
controlledValue: value,
|
|
45
44
|
uncontrolledValue: defaultValue
|
|
@@ -61,34 +60,31 @@ const NativeSelect = forwardRef((_ref, ref) => {
|
|
|
61
60
|
onChangeProp?.(event, child);
|
|
62
61
|
}, [onChangeProp]);
|
|
63
62
|
const hasMultipleChoices = useMemo(() => hasMultipleChoicesProp === undefined ? isMultiSelect : hasMultipleChoicesProp, [hasMultipleChoicesProp, isMultiSelect]);
|
|
64
|
-
const renderFieldComponent = useCallback(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
translate: translate
|
|
90
|
-
});
|
|
91
|
-
}, [autoCompleteType, children, idOverride, inputValues, hasMultipleChoices, onBlur, onChange, onFocus, ref, testId, translate]);
|
|
63
|
+
const renderFieldComponent = useCallback(({
|
|
64
|
+
ariaDescribedBy,
|
|
65
|
+
errorMessageElementId,
|
|
66
|
+
labelElementId
|
|
67
|
+
}) => _jsx(_Select, {
|
|
68
|
+
...inputValues,
|
|
69
|
+
"aria-describedby": ariaDescribedBy,
|
|
70
|
+
autoComplete: autoCompleteType,
|
|
71
|
+
children: children,
|
|
72
|
+
id: idOverride,
|
|
73
|
+
inputProps: {
|
|
74
|
+
"aria-errormessage": errorMessageElementId,
|
|
75
|
+
"aria-labelledby": labelElementId,
|
|
76
|
+
"data-se": testId
|
|
77
|
+
},
|
|
78
|
+
inputRef: localInputRef,
|
|
79
|
+
name: idOverride,
|
|
80
|
+
multiple: hasMultipleChoices,
|
|
81
|
+
native: true,
|
|
82
|
+
onBlur: onBlur,
|
|
83
|
+
onChange: onChange,
|
|
84
|
+
onFocus: onFocus,
|
|
85
|
+
ref: ref,
|
|
86
|
+
translate: translate
|
|
87
|
+
}), [autoCompleteType, children, idOverride, inputValues, hasMultipleChoices, onBlur, onChange, onFocus, ref, testId, translate]);
|
|
92
88
|
return _jsx(Field, {
|
|
93
89
|
ariaDescribedBy: ariaDescribedBy,
|
|
94
90
|
errorMessage: errorMessage,
|