@okta/odyssey-react-mui 1.13.3 → 1.13.5
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 +18 -19
- 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 +25 -23
- 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/properties/ts/odyssey-react-mui.js +2 -0
- package/dist/properties/ts/odyssey-react-mui.js.map +1 -1
- package/dist/src/OdysseyTranslationProvider.d.ts +1 -1
- package/dist/src/OdysseyTranslationProvider.d.ts.map +1 -1
- package/dist/src/i18n.d.ts +1 -1
- package/dist/src/i18n.d.ts.map +1 -1
- package/dist/src/labs/Switch.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui.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/i18n.ts +1 -1
- package/src/labs/Switch.tsx +3 -1
- package/src/properties/odyssey-react-mui.properties +2 -0
- package/src/properties/ts/odyssey-react-mui.ts +1 -1
package/dist/Tabs.js
CHANGED
|
@@ -19,14 +19,13 @@ import { Box } from "./Box.js";
|
|
|
19
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
20
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
21
21
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
-
const TabLabel =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} = _ref;
|
|
22
|
+
const TabLabel = ({
|
|
23
|
+
label,
|
|
24
|
+
notificationCount,
|
|
25
|
+
notificationCountMax,
|
|
26
|
+
tabState,
|
|
27
|
+
value
|
|
28
|
+
}) => {
|
|
30
29
|
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
31
30
|
return _jsxs(_Fragment, {
|
|
32
31
|
children: [label, notificationCount !== undefined && notificationCount > 0 && _jsx(Box, {
|
|
@@ -41,14 +40,13 @@ const TabLabel = _ref => {
|
|
|
41
40
|
})]
|
|
42
41
|
});
|
|
43
42
|
};
|
|
44
|
-
const Tabs =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
} = _ref2;
|
|
43
|
+
const Tabs = ({
|
|
44
|
+
ariaLabel,
|
|
45
|
+
initialValue,
|
|
46
|
+
tabs,
|
|
47
|
+
value,
|
|
48
|
+
onChange: onChangeProp
|
|
49
|
+
}) => {
|
|
52
50
|
const [tabState, setTabState] = useState(initialValue ?? value ?? "0");
|
|
53
51
|
const onChange = useCallback((event, value) => {
|
|
54
52
|
setTabState(value);
|
package/dist/Tabs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","names":["memo","useCallback","useEffect","useState","TabContext","MuiTabContext","TabList","MuiTabList","TabPanel","MuiTabPanel","useOdysseyDesignTokens","Badge","Box","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","TabLabel","
|
|
1
|
+
{"version":3,"file":"Tabs.js","names":["memo","useCallback","useEffect","useState","TabContext","MuiTabContext","TabList","MuiTabList","TabPanel","MuiTabPanel","useOdysseyDesignTokens","Badge","Box","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","TabLabel","label","notificationCount","notificationCountMax","tabState","value","odysseyDesignTokens","children","undefined","sx","marginInlineStart","Spacing2","badgeContent","badgeContentMax","type","Tabs","ariaLabel","initialValue","tabs","onChange","onChangeProp","setTabState","event","renderTab","tab","index","testId","isDisabled","startIcon","_Tab","disabled","icon","tabIndex","toString","variant","map","MemoizedTabs","displayName"],"sources":["../src/Tabs.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 ReactElement,\n ReactNode,\n memo,\n useCallback,\n useEffect,\n useState,\n} from \"react\";\nimport {\n TabContext as MuiTabContext,\n TabList as MuiTabList,\n TabListProps as MuiTabListProps,\n TabPanel as MuiTabPanel,\n} from \"@mui/lab\";\nimport { Tab as MuiTab } from \"@mui/material\";\n\nimport { useOdysseyDesignTokens } from \"./OdysseyDesignTokensContext\";\nimport { Badge, BadgeProps } from \"./Badge\";\nimport { HtmlProps } from \"./HtmlProps\";\nimport { Box } from \"./Box\";\n\nexport type TabItemProps = {\n /**\n * The content of the Tab itself\n */\n children: ReactNode;\n /**\n * If `true`, the TabItem is disabled\n */\n isDisabled?: boolean;\n /**\n * The label text for the TabItem\n */\n label: string;\n /**\n * An optional icon to display at the start of the TabItem\n */\n startIcon?: ReactElement;\n /**\n * The value associated with the TabItem\n */\n value?: string;\n} & {\n notificationCount?: BadgeProps[\"badgeContent\"];\n notificationCountMax?: BadgeProps[\"badgeContentMax\"];\n} & HtmlProps;\n\nexport type TabsProps = {\n /**\n * The ARIA label for the full Tabs group\n */\n ariaLabel?: string;\n /**\n * @deprecated please use the `value` prop instead\n * When `value` is provided, `initialValue` isn't used.\n */\n initialValue?: string;\n /**\n * The TabItems to be included in the Tabs group\n */\n tabs: TabItemProps[];\n /**\n * Identifier for the selected tab.\n */\n value?: string;\n /**\n * Callback fired when the active tab is changed.\n */\n onChange?: MuiTabListProps[\"onChange\"];\n};\n\nconst TabLabel = ({\n label,\n notificationCount,\n notificationCountMax,\n tabState,\n value,\n}: Pick<\n TabItemProps,\n \"label\" | \"notificationCount\" | \"notificationCountMax\" | \"value\"\n> & {\n tabState: string;\n}) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n return (\n <>\n {label}\n {notificationCount !== undefined && notificationCount > 0 && (\n <Box\n sx={{\n marginInlineStart: notificationCount\n ? odysseyDesignTokens.Spacing2\n : 0,\n }}\n >\n <Badge\n badgeContent={notificationCount}\n badgeContentMax={notificationCountMax}\n type={value === tabState ? \"attention\" : \"default\"}\n />\n </Box>\n )}\n </>\n );\n};\n\nconst Tabs = ({\n ariaLabel,\n initialValue,\n tabs,\n value,\n onChange: onChangeProp,\n}: TabsProps) => {\n const [tabState, setTabState] = useState(initialValue ?? value ?? \"0\");\n\n const onChange = useCallback<NonNullable<MuiTabListProps[\"onChange\"]>>(\n (event, value: string) => {\n setTabState(value);\n onChangeProp?.(event, value);\n },\n [onChangeProp]\n );\n\n useEffect(() => {\n if (value !== undefined) {\n setTabState(value);\n }\n }, [value]);\n\n const renderTab = useCallback(\n (tab, index) => {\n const {\n testId,\n isDisabled,\n label,\n startIcon,\n value,\n notificationCount,\n notificationCountMax,\n } = tab;\n\n return (\n <MuiTab\n data-se={testId}\n disabled={isDisabled}\n icon={startIcon}\n tabIndex={0}\n label={\n <TabLabel\n label={label}\n notificationCount={notificationCount}\n notificationCountMax={notificationCountMax}\n tabState={tabState}\n value={value}\n />\n }\n value={value ? value : index.toString()}\n key={value ? value : index.toString()}\n />\n );\n },\n [tabState]\n );\n\n return (\n <MuiTabContext value={tabState}>\n <MuiTabList\n onChange={onChange}\n aria-label={ariaLabel}\n variant=\"scrollable\"\n >\n {tabs.map((tab, index) => renderTab(tab, index))}\n </MuiTabList>\n {tabs.map((tab, index) => (\n <MuiTabPanel\n value={tab.value ? tab.value : index.toString()}\n key={tab.value ? tab.value : index.toString()}\n >\n {tab.children}\n </MuiTabPanel>\n ))}\n </MuiTabContext>\n );\n};\n\nconst MemoizedTabs = memo(Tabs);\nMemoizedTabs.displayName = \"Tabs\";\n\nexport { MemoizedTabs as Tabs };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAGEA,IAAI,EACJC,WAAW,EACXC,SAAS,EACTC,QAAQ,QACH,OAAO;AACd,SACEC,UAAU,IAAIC,aAAa,EAC3BC,OAAO,IAAIC,UAAU,EAErBC,QAAQ,IAAIC,WAAW,QAClB,UAAU;AAAC,SAGTC,sBAAsB;AAAA,SACtBC,KAAK;AAAA,SAELC,GAAG;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAoDZ,MAAMC,QAAQ,GAAGA,CAAC;EAChBC,KAAK;EACLC,iBAAiB;EACjBC,oBAAoB;EACpBC,QAAQ;EACRC;AAMF,CAAC,KAAK;EACJ,MAAMC,mBAAmB,GAAGf,sBAAsB,CAAC,CAAC;EAEpD,OACEQ,KAAA,CAAAF,SAAA;IAAAU,QAAA,GACGN,KAAK,EACLC,iBAAiB,KAAKM,SAAS,IAAIN,iBAAiB,GAAG,CAAC,IACvDP,IAAA,CAACF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ext } from "react";
|
|
|
14
14
|
import { TagListContext } from "./TagListContext.js";
|
|
15
15
|
import { MuiPropsContext } from "./MuiPropsContext.js";
|
|
16
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
-
const Tag =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} = _ref;
|
|
17
|
+
const Tag = ({
|
|
18
|
+
icon,
|
|
19
|
+
isDisabled,
|
|
20
|
+
label,
|
|
21
|
+
onClick,
|
|
22
|
+
onRemove,
|
|
23
|
+
testId,
|
|
24
|
+
translate
|
|
25
|
+
}) => {
|
|
27
26
|
const {
|
|
28
27
|
chipElementType
|
|
29
28
|
} = useContext(TagListContext);
|
package/dist/Tag.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.js","names":["memo","useCallback","useContext","TagListContext","MuiPropsContext","jsx","_jsx","Tag","
|
|
1
|
+
{"version":3,"file":"Tag.js","names":["memo","useCallback","useContext","TagListContext","MuiPropsContext","jsx","_jsx","Tag","icon","isDisabled","label","onClick","onRemove","testId","translate","chipElementType","renderTag","muiProps","_Chip","clickable","component","disabled","onDelete","Consumer","children","MemoizedTag","displayName"],"sources":["../src/Tag.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 { Chip as MuiChip, ChipProps as MuiChipProps } from \"@mui/material\";\nimport { memo, ReactElement, useCallback, useContext } from \"react\";\nimport { TagListContext } from \"./TagListContext\";\nimport { MuiPropsContext } from \"./MuiPropsContext\";\nimport { HtmlProps } from \"./HtmlProps\";\n\nexport type TagProps = {\n icon?: ReactElement;\n isDisabled?: boolean;\n /**\n * The label text for the Tag\n */\n label: string;\n /**\n * Callback fired when the Tag is clicked\n */\n onClick?: MuiChipProps[\"onClick\"];\n /**\n * Callback fired when the remove button of the Tag is clicked\n */\n onRemove?: MuiChipProps[\"onDelete\"];\n} & HtmlProps;\n\nconst Tag = ({\n icon,\n isDisabled,\n label,\n onClick,\n onRemove,\n testId,\n translate,\n}: TagProps) => {\n const { chipElementType } = useContext(TagListContext);\n\n const renderTag = useCallback(\n (muiProps) => (\n <MuiChip\n {...muiProps}\n aria-disabled={isDisabled}\n clickable={onClick ? true : false}\n component={chipElementType}\n data-se={testId}\n disabled={isDisabled}\n icon={icon}\n label={label}\n onClick={onClick}\n onDelete={onRemove}\n translate={translate}\n />\n ),\n [\n chipElementType,\n icon,\n isDisabled,\n label,\n onClick,\n onRemove,\n testId,\n translate,\n ]\n );\n\n return <MuiPropsContext.Consumer>{renderTag}</MuiPropsContext.Consumer>;\n};\n\nconst MemoizedTag = memo(Tag);\nMemoizedTag.displayName = \"Tag\";\n\nexport { MemoizedTag as Tag };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAI,EAAgBC,WAAW,EAAEC,UAAU,QAAQ,OAAO;AAAC,SAC3DC,cAAc;AAAA,SACdC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAoBxB,MAAMC,GAAG,GAAGA,CAAC;EACXC,IAAI;EACJC,UAAU;EACVC,KAAK;EACLC,OAAO;EACPC,QAAQ;EACRC,MAAM;EACNC;AACQ,CAAC,KAAK;EACd,MAAM;IAAEC;EAAgB,CAAC,GAAGb,UAAU,CAACC,cAAc,CAAC;EAEtD,MAAMa,SAAS,GAAGf,WAAW,CAC1BgB,QAAQ,IACPX,IAAA,CAAAY,KAAA;IAAA,GACMD,QAAQ;IACZ,iBAAeR,UAAW;IAC1BU,SAAS,EAAER,OAAO,GAAG,IAAI,GAAG,KAAM;IAClCS,SAAS,EAAEL,eAAgB;IAC3B,WAASF,MAAO;IAChBQ,QAAQ,EAAEZ,UAAW;IACrBD,IAAI,EAAEA,IAAK;IACXE,KAAK,EAAEA,KAAM;IACbC,OAAO,EAAEA,OAAQ;IACjBW,QAAQ,EAAEV,QAAS;IACnBE,SAAS,EAAEA;EAAU,CACtB,CACF,EACD,CACEC,eAAe,EACfP,IAAI,EACJC,UAAU,EACVC,KAAK,EACLC,OAAO,EACPC,QAAQ,EACRC,MAAM,EACNC,SAAS,CAEb,CAAC;EAED,OAAOR,IAAA,CAACF,eAAe,CAACmB,QAAQ;IAAAC,QAAA,EAAER;EAAS,CAA2B,CAAC;AACzE,CAAC;AAED,MAAMS,WAAW,GAAGzB,IAAI,CAACO,GAAG,CAAC;AAC7BkB,WAAW,CAACC,WAAW,GAAG,KAAK;AAE/B,SAASD,WAAW,IAAIlB,GAAG"}
|
package/dist/TagList.js
CHANGED
|
@@ -13,11 +13,10 @@ import _Stack from "@mui/material/Stack";
|
|
|
13
13
|
import { memo, useMemo } from "react";
|
|
14
14
|
import { TagListContext } from "./TagListContext.js";
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
const TagList =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} = _ref;
|
|
16
|
+
const TagList = ({
|
|
17
|
+
children,
|
|
18
|
+
testId
|
|
19
|
+
}) => {
|
|
21
20
|
const providerValue = useMemo(() => ({
|
|
22
21
|
chipElementType: "li"
|
|
23
22
|
}), []);
|
package/dist/TagList.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagList.js","names":["memo","useMemo","TagListContext","jsx","_jsx","TagList","
|
|
1
|
+
{"version":3,"file":"TagList.js","names":["memo","useMemo","TagListContext","jsx","_jsx","TagList","children","testId","providerValue","chipElementType","_Stack","component","direction","spacing","useFlexGap","flexWrap","Provider","value","MemoizedTagList","displayName"],"sources":["../src/TagList.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 { Tag } from \"./Tag\";\nimport { Stack } from \"@mui/material\";\nimport { memo, ReactElement, useMemo } from \"react\";\nimport { ChipElementType, TagListContext } from \"./TagListContext\";\nimport { HtmlProps } from \"./HtmlProps\";\n\nexport type TagListProps = {\n /**\n * The Tag or array of Tags within the TagList\n */\n children: ReactElement<typeof Tag> | Array<ReactElement<typeof Tag>>;\n} & HtmlProps;\n\nconst TagList = ({ children, testId }: TagListProps) => {\n const providerValue = useMemo<{\n chipElementType: ChipElementType;\n }>(\n () => ({\n chipElementType: \"li\",\n }),\n []\n );\n\n return (\n <Stack\n component=\"ul\"\n data-se={testId}\n direction=\"row\"\n spacing={2}\n useFlexGap\n flexWrap=\"wrap\"\n >\n <TagListContext.Provider value={providerValue}>\n {children}\n </TagListContext.Provider>\n </Stack>\n );\n};\n\nconst MemoizedTagList = memo(TagList);\nMemoizedTagList.displayName = \"TagList\";\n\nexport { MemoizedTagList as TagList };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA,SAASA,IAAI,EAAgBC,OAAO,QAAQ,OAAO;AAAC,SAC1BC,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAUxC,MAAMC,OAAO,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAAqB,CAAC,KAAK;EACtD,MAAMC,aAAa,GAAGP,OAAO,CAG3B,OAAO;IACLQ,eAAe,EAAE;EACnB,CAAC,CAAC,EACF,EACF,CAAC;EAED,OACEL,IAAA,CAAAM,MAAA;IACEC,SAAS,EAAC,IAAI;IACd,WAASJ,MAAO;IAChBK,SAAS,EAAC,KAAK;IACfC,OAAO,EAAE,CAAE;IACXC,UAAU;IACVC,QAAQ,EAAC,MAAM;IAAAT,QAAA,EAEfF,IAAA,CAACF,cAAc,CAACc,QAAQ;MAACC,KAAK,EAAET,aAAc;MAAAF,QAAA,EAC3CA;IAAQ,CACc;EAAC,CACrB,CAAC;AAEZ,CAAC;AAED,MAAMY,eAAe,GAAGlB,IAAI,CAACK,OAAO,CAAC;AACrCa,eAAe,CAACC,WAAW,GAAG,SAAS;AAEvC,SAASD,eAAe,IAAIb,OAAO"}
|
package/dist/TextField.js
CHANGED
|
@@ -17,37 +17,36 @@ import { Field } from "./Field.js";
|
|
|
17
17
|
import { useInputValues, getControlState } from "./inputUtils.js";
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
19
|
export const textFieldTypeValues = ["email", "number", "tel", "text", "url"];
|
|
20
|
-
const TextField = forwardRef((
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
} = _ref;
|
|
20
|
+
const TextField = forwardRef(({
|
|
21
|
+
ariaDescribedBy,
|
|
22
|
+
autoCompleteType,
|
|
23
|
+
defaultValue,
|
|
24
|
+
hasInitialFocus,
|
|
25
|
+
endAdornment,
|
|
26
|
+
errorMessage,
|
|
27
|
+
errorMessageList,
|
|
28
|
+
hint,
|
|
29
|
+
HintLinkComponent,
|
|
30
|
+
id: idOverride,
|
|
31
|
+
inputRef,
|
|
32
|
+
inputMode,
|
|
33
|
+
isDisabled = false,
|
|
34
|
+
isFullWidth = false,
|
|
35
|
+
isMultiline = false,
|
|
36
|
+
isOptional = false,
|
|
37
|
+
isReadOnly,
|
|
38
|
+
label,
|
|
39
|
+
name: nameOverride,
|
|
40
|
+
onBlur,
|
|
41
|
+
onChange: onChangeProp,
|
|
42
|
+
onFocus,
|
|
43
|
+
placeholder,
|
|
44
|
+
startAdornment,
|
|
45
|
+
testId,
|
|
46
|
+
translate,
|
|
47
|
+
type = "text",
|
|
48
|
+
value: value
|
|
49
|
+
}, ref) => {
|
|
51
50
|
const controlledStateRef = useRef(getControlState({
|
|
52
51
|
controlledValue: value,
|
|
53
52
|
uncontrolledValue: defaultValue
|
|
@@ -68,49 +67,46 @@ const TextField = forwardRef((_ref, ref) => {
|
|
|
68
67
|
const onChange = useCallback(event => {
|
|
69
68
|
onChangeProp?.(event);
|
|
70
69
|
}, [onChangeProp]);
|
|
71
|
-
const renderFieldComponent = useCallback(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
translate: translate
|
|
112
|
-
});
|
|
113
|
-
}, [autoCompleteType, inputValues, hasInitialFocus, endAdornment, inputMode, isMultiline, nameOverride, onBlur, onChange, onFocus, placeholder, isOptional, isReadOnly, ref, startAdornment, testId, translate, type]);
|
|
70
|
+
const renderFieldComponent = useCallback(({
|
|
71
|
+
ariaDescribedBy,
|
|
72
|
+
errorMessageElementId,
|
|
73
|
+
id,
|
|
74
|
+
labelElementId
|
|
75
|
+
}) => _jsx(_InputBase, {
|
|
76
|
+
...inputValues,
|
|
77
|
+
"aria-describedby": ariaDescribedBy,
|
|
78
|
+
autoComplete: autoCompleteType,
|
|
79
|
+
autoFocus: hasInitialFocus,
|
|
80
|
+
endAdornment: endAdornment && _jsx(_InputAdornment, {
|
|
81
|
+
position: "end",
|
|
82
|
+
translate: translate,
|
|
83
|
+
children: endAdornment
|
|
84
|
+
}),
|
|
85
|
+
id: id,
|
|
86
|
+
inputProps: {
|
|
87
|
+
"aria-errormessage": errorMessageElementId,
|
|
88
|
+
"aria-labelledby": labelElementId,
|
|
89
|
+
"data-se": testId,
|
|
90
|
+
inputMode
|
|
91
|
+
},
|
|
92
|
+
inputRef: localInputRef,
|
|
93
|
+
multiline: isMultiline,
|
|
94
|
+
name: nameOverride ?? id,
|
|
95
|
+
onBlur: onBlur,
|
|
96
|
+
onChange: onChange,
|
|
97
|
+
onFocus: onFocus,
|
|
98
|
+
placeholder: placeholder,
|
|
99
|
+
readOnly: isReadOnly,
|
|
100
|
+
ref: ref,
|
|
101
|
+
required: !isOptional,
|
|
102
|
+
startAdornment: startAdornment && _jsx(_InputAdornment, {
|
|
103
|
+
position: "start",
|
|
104
|
+
translate: translate,
|
|
105
|
+
children: startAdornment
|
|
106
|
+
}),
|
|
107
|
+
type: type,
|
|
108
|
+
translate: translate
|
|
109
|
+
}), [autoCompleteType, inputValues, hasInitialFocus, endAdornment, inputMode, isMultiline, nameOverride, onBlur, onChange, onFocus, placeholder, isOptional, isReadOnly, ref, startAdornment, testId, translate, type]);
|
|
114
110
|
return _jsx(Field, {
|
|
115
111
|
ariaDescribedBy: ariaDescribedBy,
|
|
116
112
|
errorMessage: errorMessage,
|
package/dist/TextField.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.js","names":["forwardRef","memo","useCallback","useImperativeHandle","useRef","Field","useInputValues","getControlState","jsx","_jsx","textFieldTypeValues","TextField","_ref","ref","ariaDescribedBy","autoCompleteType","defaultValue","hasInitialFocus","endAdornment","errorMessage","errorMessageList","hint","HintLinkComponent","id","idOverride","inputRef","inputMode","isDisabled","isFullWidth","isMultiline","isOptional","isReadOnly","label","name","nameOverride","onBlur","onChange","onChangeProp","onFocus","placeholder","startAdornment","testId","translate","type","value","controlledStateRef","controlledValue","uncontrolledValue","inputValues","controlState","current","localInputRef","focus","event","renderFieldComponent","_ref2","errorMessageElementId","labelElementId","_InputBase","autoComplete","autoFocus","_InputAdornment","position","children","inputProps","multiline","readOnly","required","fieldType","hasVisibleLabel","MemoizedTextField","displayName"],"sources":["../src/TextField.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n InputHTMLAttributes,\n memo,\n ReactElement,\n useCallback,\n useImperativeHandle,\n useRef,\n} from \"react\";\nimport { InputAdornment, InputBase } from \"@mui/material\";\n\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport { Field } from \"./Field\";\nimport { HtmlProps } from \"./HtmlProps\";\nimport { FocusHandle, useInputValues, getControlState } from \"./inputUtils\";\n\nexport const textFieldTypeValues = [\n \"email\",\n \"number\",\n \"tel\",\n \"text\",\n \"url\",\n] as const;\n\nexport type TextFieldProps = {\n /**\n * This prop helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill\n */\n autoCompleteType?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: string;\n /**\n * End `InputAdornment` for this component.\n */\n endAdornment?: string | ReactElement;\n /**\n * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * The ref forwarded to the TextField\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * Hints at the type of data that might be entered by the user while editing the element or its contents\n * @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute\n */\n inputMode?: InputHTMLAttributes<HTMLInputElement>[\"inputMode\"];\n /**\n * If `true`, a [TextareaAutosize](/material-ui/react-textarea-autosize/) element is rendered.\n */\n isMultiline?: boolean;\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * Callback fired when the `input` element loses focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * Callback fired when the value is changed.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;\n /**\n * Callback fired when the `input` element get focus.\n */\n onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * Start `InputAdornment` for this component.\n */\n startAdornment?: string | ReactElement;\n /**\n * Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).\n */\n type?: (typeof textFieldTypeValues)[number];\n /**\n * The value of the `input` element, required for a controlled component.\n */\n value?: string;\n} & FieldComponentProps &\n HtmlProps;\n\nconst TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n ariaDescribedBy,\n autoCompleteType,\n defaultValue,\n hasInitialFocus,\n endAdornment,\n errorMessage,\n errorMessageList,\n hint,\n HintLinkComponent,\n id: idOverride,\n inputRef,\n inputMode,\n isDisabled = false,\n isFullWidth = false,\n isMultiline = false,\n isOptional = false,\n isReadOnly,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onFocus,\n placeholder,\n startAdornment,\n testId,\n translate,\n type = \"text\",\n value: value,\n },\n ref\n ) => {\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n })\n );\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const localInputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(\n inputRef,\n () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\n },\n []\n );\n\n const onChange = useCallback<\n NonNullable<ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>>\n >(\n (event) => {\n onChangeProp?.(event);\n },\n [onChangeProp]\n );\n\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy, errorMessageElementId, id, labelElementId }) => (\n <InputBase\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n autoComplete={autoCompleteType}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n endAdornment={\n endAdornment && (\n <InputAdornment position=\"end\" translate={translate}>\n {endAdornment}\n </InputAdornment>\n )\n }\n id={id}\n inputProps={{\n \"aria-errormessage\": errorMessageElementId,\n \"aria-labelledby\": labelElementId,\n \"data-se\": testId,\n inputMode,\n }}\n inputRef={localInputRef}\n multiline={isMultiline}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n placeholder={placeholder}\n readOnly={isReadOnly}\n ref={ref}\n required={!isOptional}\n startAdornment={\n startAdornment && (\n <InputAdornment position=\"start\" translate={translate}>\n {startAdornment}\n </InputAdornment>\n )\n }\n type={type}\n translate={translate}\n />\n ),\n [\n autoCompleteType,\n inputValues,\n hasInitialFocus,\n endAdornment,\n inputMode,\n isMultiline,\n nameOverride,\n onBlur,\n onChange,\n onFocus,\n placeholder,\n isOptional,\n isReadOnly,\n ref,\n startAdornment,\n testId,\n translate,\n type,\n ]\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n }\n);\n\nconst MemoizedTextField = memo(TextField);\nMemoizedTextField.displayName = \"TextField\";\n\nexport { MemoizedTextField as TextField };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAGEA,UAAU,EAEVC,IAAI,EAEJC,WAAW,EACXC,mBAAmB,EACnBC,MAAM,QACD,OAAO;AAAC,SAINC,KAAK;AAAA,SAEQC,cAAc,EAAEC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAErD,OAAO,MAAMC,mBAAmB,GAAG,CACjC,OAAO,EACP,QAAQ,EACR,KAAK,EACL,MAAM,EACN,KAAK,CACG;AAqEV,MAAMC,SAAS,GAAGX,UAAU,CAC1B,CAAAY,IAAA,EA+BEC,GAAG,KACA;EAAA,IA/BH;IACEC,eAAe;IACfC,gBAAgB;IAChBC,YAAY;IACZC,eAAe;IACfC,YAAY;IACZC,YAAY;IACZC,gBAAgB;IAChBC,IAAI;IACJC,iBAAiB;IACjBC,EAAE,EAAEC,UAAU;IACdC,QAAQ;IACRC,SAAS;IACTC,UAAU,GAAG,KAAK;IAClBC,WAAW,GAAG,KAAK;IACnBC,WAAW,GAAG,KAAK;IACnBC,UAAU,GAAG,KAAK;IAClBC,UA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AAEA,UAAW;IACvBE,KAAK,EAAEA,KAAM;IACbsB,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CACF,CAAC;AAED,MAAMgB,iBAAiB,GAAGrE,IAAI,CAACU,SAAS,CAAC;AACzC2D,iBAAiB,CAACC,WAAW,GAAG,WAAW;AAE3C,SAASD,iBAAiB,IAAI3D,SAAS"}
|
|
1
|
+
{"version":3,"file":"TextField.js","names":["forwardRef","memo","useCallback","useImperativeHandle","useRef","Field","useInputValues","getControlState","jsx","_jsx","textFieldTypeValues","TextField","ariaDescribedBy","autoCompleteType","defaultValue","hasInitialFocus","endAdornment","errorMessage","errorMessageList","hint","HintLinkComponent","id","idOverride","inputRef","inputMode","isDisabled","isFullWidth","isMultiline","isOptional","isReadOnly","label","name","nameOverride","onBlur","onChange","onChangeProp","onFocus","placeholder","startAdornment","testId","translate","type","value","ref","controlledStateRef","controlledValue","uncontrolledValue","inputValues","controlState","current","localInputRef","focus","event","renderFieldComponent","errorMessageElementId","labelElementId","_InputBase","autoComplete","autoFocus","_InputAdornment","position","children","inputProps","multiline","readOnly","required","fieldType","hasVisibleLabel","MemoizedTextField","displayName"],"sources":["../src/TextField.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n InputHTMLAttributes,\n memo,\n ReactElement,\n useCallback,\n useImperativeHandle,\n useRef,\n} from \"react\";\nimport { InputAdornment, InputBase } from \"@mui/material\";\n\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport { Field } from \"./Field\";\nimport { HtmlProps } from \"./HtmlProps\";\nimport { FocusHandle, useInputValues, getControlState } from \"./inputUtils\";\n\nexport const textFieldTypeValues = [\n \"email\",\n \"number\",\n \"tel\",\n \"text\",\n \"url\",\n] as const;\n\nexport type TextFieldProps = {\n /**\n * This prop helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill\n */\n autoCompleteType?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: string;\n /**\n * End `InputAdornment` for this component.\n */\n endAdornment?: string | ReactElement;\n /**\n * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * The ref forwarded to the TextField\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * Hints at the type of data that might be entered by the user while editing the element or its contents\n * @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute\n */\n inputMode?: InputHTMLAttributes<HTMLInputElement>[\"inputMode\"];\n /**\n * If `true`, a [TextareaAutosize](/material-ui/react-textarea-autosize/) element is rendered.\n */\n isMultiline?: boolean;\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * Callback fired when the `input` element loses focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * Callback fired when the value is changed.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;\n /**\n * Callback fired when the `input` element get focus.\n */\n onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * Start `InputAdornment` for this component.\n */\n startAdornment?: string | ReactElement;\n /**\n * Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).\n */\n type?: (typeof textFieldTypeValues)[number];\n /**\n * The value of the `input` element, required for a controlled component.\n */\n value?: string;\n} & FieldComponentProps &\n HtmlProps;\n\nconst TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n ariaDescribedBy,\n autoCompleteType,\n defaultValue,\n hasInitialFocus,\n endAdornment,\n errorMessage,\n errorMessageList,\n hint,\n HintLinkComponent,\n id: idOverride,\n inputRef,\n inputMode,\n isDisabled = false,\n isFullWidth = false,\n isMultiline = false,\n isOptional = false,\n isReadOnly,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onFocus,\n placeholder,\n startAdornment,\n testId,\n translate,\n type = \"text\",\n value: value,\n },\n ref\n ) => {\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n })\n );\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const localInputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(\n inputRef,\n () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\n },\n []\n );\n\n const onChange = useCallback<\n NonNullable<ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>>\n >(\n (event) => {\n onChangeProp?.(event);\n },\n [onChangeProp]\n );\n\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy, errorMessageElementId, id, labelElementId }) => (\n <InputBase\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n autoComplete={autoCompleteType}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n endAdornment={\n endAdornment && (\n <InputAdornment position=\"end\" translate={translate}>\n {endAdornment}\n </InputAdornment>\n )\n }\n id={id}\n inputProps={{\n \"aria-errormessage\": errorMessageElementId,\n \"aria-labelledby\": labelElementId,\n \"data-se\": testId,\n inputMode,\n }}\n inputRef={localInputRef}\n multiline={isMultiline}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n placeholder={placeholder}\n readOnly={isReadOnly}\n ref={ref}\n required={!isOptional}\n startAdornment={\n startAdornment && (\n <InputAdornment position=\"start\" translate={translate}>\n {startAdornment}\n </InputAdornment>\n )\n }\n type={type}\n translate={translate}\n />\n ),\n [\n autoCompleteType,\n inputValues,\n hasInitialFocus,\n endAdornment,\n inputMode,\n isMultiline,\n nameOverride,\n onBlur,\n onChange,\n onFocus,\n placeholder,\n isOptional,\n isReadOnly,\n ref,\n startAdornment,\n testId,\n translate,\n type,\n ]\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n }\n);\n\nconst MemoizedTextField = memo(TextField);\nMemoizedTextField.displayName = \"TextField\";\n\nexport { MemoizedTextField as TextField };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAGEA,UAAU,EAEVC,IAAI,EAEJC,WAAW,EACXC,mBAAmB,EACnBC,MAAM,QACD,OAAO;AAAC,SAINC,KAAK;AAAA,SAEQC,cAAc,EAAEC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAErD,OAAO,MAAMC,mBAAmB,GAAG,CACjC,OAAO,EACP,QAAQ,EACR,KAAK,EACL,MAAM,EACN,KAAK,CACG;AAqEV,MAAMC,SAAS,GAAGX,UAAU,CAC1B,CACE;EACEY,eAAe;EACfC,gBAAgB;EAChBC,YAAY;EACZC,eAAe;EACfC,YAAY;EACZC,YAAY;EACZC,gBAAgB;EAChBC,IAAI;EACJC,iBAAiB;EACjBC,EAAE,EAAEC,UAAU;EACdC,QAAQ;EACRC,SAAS;EACTC,UAAU,GAAG,KAAK;EAClBC,WAAW,GAAG,KAAK;EACnBC,WAAW,GAAG,K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UAAW;IACvBE,KAAK,EAAEA,KAAM;IACbuB,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CACF,CAAC;AAED,MAAMe,iBAAiB,GAAGnE,IAAI,CAACU,SAAS,CAAC;AACzCyD,iBAAiB,CAACC,WAAW,GAAG,WAAW;AAE3C,SAASD,iBAAiB,IAAIzD,SAAS"}
|
package/dist/Toast.js
CHANGED
|
@@ -26,20 +26,19 @@ export const toastSeverityValues = ["success", "info", "warning", "error"];
|
|
|
26
26
|
const ClickAwayListenerProps = {
|
|
27
27
|
onClickAway: () => false
|
|
28
28
|
};
|
|
29
|
-
const Toast =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} = _ref;
|
|
29
|
+
const Toast = ({
|
|
30
|
+
autoHideDuration = 6000,
|
|
31
|
+
isDismissable,
|
|
32
|
+
linkText,
|
|
33
|
+
linkUrl,
|
|
34
|
+
isVisible: isVisibleProp,
|
|
35
|
+
onHide: onHideProp,
|
|
36
|
+
role,
|
|
37
|
+
severity,
|
|
38
|
+
testId,
|
|
39
|
+
text,
|
|
40
|
+
translate
|
|
41
|
+
}) => {
|
|
43
42
|
const {
|
|
44
43
|
t
|
|
45
44
|
} = useTranslation();
|
package/dist/Toast.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.js","names":["useEffect","memo","useState","useCallback","visuallyHidden","Link","CloseIcon","Button","useTranslation","jsx","_jsx","jsxs","_jsxs","toastRoleValues","toastSeverityValues","ClickAwayListenerProps","onClickAway","Toast","
|
|
1
|
+
{"version":3,"file":"Toast.js","names":["useEffect","memo","useState","useCallback","visuallyHidden","Link","CloseIcon","Button","useTranslation","jsx","_jsx","jsxs","_jsxs","toastRoleValues","toastSeverityValues","ClickAwayListenerProps","onClickAway","Toast","autoHideDuration","isDismissable","linkText","linkUrl","isVisible","isVisibleProp","onHide","onHideProp","role","severity","testId","text","translate","t","setIsVisible","_Snackbar","open","undefined","onClose","className","children","_Alert","action","ariaLabel","onClick","size","startIcon","variant","_AlertTitle","style","href","MemoizedToast","displayName"],"sources":["../src/Toast.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 { useEffect, memo, useState, useCallback } from \"react\";\nimport { Alert, AlertTitle, Snackbar } from \"@mui/material\";\nimport { visuallyHidden } from \"@mui/utils\";\nimport { Link } from \"./Link\";\nimport { CloseIcon } from \"./icons.generated\";\nimport { Button } from \"./Button\";\nimport { useTranslation } from \"react-i18next\";\nimport { HtmlProps } from \"./HtmlProps\";\n\nexport const toastRoleValues = [\"status\", \"alert\"] as const;\nexport const toastSeverityValues = [\n \"success\",\n \"info\",\n \"warning\",\n \"error\",\n] as const;\n\nexport type ToastProps = {\n /**\n * If set, this determines how long the Toast should appear before automatically disappearing in milliseconds.\n * It will only take effect if the Toast is not dismissible.\n * If left blank, it defaults to 6000.\n */\n autoHideDuration?: number;\n /**\n * If `true`, the Toast will include a close button.\n */\n isDismissable?: boolean;\n /**\n * If true, the Toast is visible\n */\n isVisible?: boolean;\n /**\n * If linkUrl is not undefined, this is the text of the link.\n * If left blank, it defaults to \"Learn more\".\n * Note that linkText does nothing if linkUrl is not defined\n */\n linkText?: string;\n /**\n * If defined, the Toast will include a link to the URL\n */\n linkUrl?: string;\n /**\n * An optional function to run when the Toast is closed.\n */\n onHide?: () => void;\n /**\n * Sets the ARIA role of the Toast\n * (\"status\" for something that dynamically updates, \"alert\" for errors, null for something\n * unchanging)\n */\n role?: (typeof toastRoleValues)[number];\n /**\n * Determine the color and icon of the Toast\n */\n severity: (typeof toastSeverityValues)[number];\n /**\n * The text content of the Toast\n */\n text: string;\n} & HtmlProps;\n\nconst ClickAwayListenerProps = { onClickAway: () => false };\n\nconst Toast = ({\n autoHideDuration = 6000,\n isDismissable,\n linkText,\n linkUrl,\n isVisible: isVisibleProp,\n onHide: onHideProp,\n role,\n severity,\n testId,\n text,\n translate,\n}: ToastProps) => {\n const { t } = useTranslation();\n\n const [isVisible, setIsVisible] = useState(isVisibleProp);\n\n useEffect(() => {\n setIsVisible(isVisibleProp);\n }, [isVisibleProp]);\n\n const onHide = useCallback(() => {\n setIsVisible(false);\n onHideProp?.();\n }, [onHideProp]);\n\n return (\n <Snackbar\n open={isVisible}\n autoHideDuration={\n isDismissable || autoHideDuration <= 0 ? undefined : autoHideDuration\n }\n onClose={onHide}\n className=\"Toast\"\n ClickAwayListenerProps={ClickAwayListenerProps}\n >\n <Alert\n action={\n isDismissable === true && (\n <Button\n ariaLabel={t(\"close.text\")}\n onClick={onHide}\n size=\"small\"\n startIcon={<CloseIcon />}\n variant=\"floating\"\n />\n )\n }\n data-se={testId}\n role={role}\n severity={severity}\n variant=\"toast\"\n >\n <AlertTitle translate={translate}>\n <span style={visuallyHidden}>{severity}:</span>\n {text}\n </AlertTitle>\n {linkUrl && (\n <Link href={linkUrl} variant=\"monochrome\" translate={translate}>\n {linkText}\n </Link>\n )}\n </Alert>\n </Snackbar>\n );\n};\n\nconst MemoizedToast = memo(Toast);\nMemoizedToast.displayName = \"Toast\";\n\nexport { MemoizedToast as Toast };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,WAAW,QAAQ,OAAO;AAE9D,SAASC,cAAc,QAAQ,YAAY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E/C1B,KAAA,CAAA2B,MAAA;MACEC,MAAM,EACJrB,aAAa,KAAK,IAAI,IACpBT,IAAA,CAACH,MAAM;QACLkC,SAAS,EAAEV,CAAC,CAAC,YAAY,CAAE;QAC3BW,OAAO,EAAElB,MAAO;QAChBmB,IAAI,EAAC,OAAO;QACZC,SAAS,EAAElC,IAAA,CAACJ,SAAS,IAAE,CAAE;QACzBuC,OAAO,EAAC;MAAU,CACnB,CAEJ;MACD,WAASjB,MAAO;MAChBF,IAAI,EAAEA,IAAK;MACXC,QAAQ,EAAEA,QAAS;MACnBkB,OAAO,EAAC,OAAO;MAAAP,QAAA,GAEf1B,KAAA,CAAAkC,WAAA;QAAYhB,SAAS,EAAEA,SAAU;QAAAQ,QAAA,GAC/B1B,KAAA;UAAMmC,KAAK,EAAE3C,cAAe;UAAAkC,QAAA,GAAEX,QAAQ,EAAC,GAAC;QAAA,CAAM,CAAC,EAC9CE,IAAI;MAAA,CACK,CAAC,EACZR,OAAO,IACNX,IAAA,CAACL,IAAI;QAAC2C,IAAI,EAAE3B,OAAQ;QAACwB,OAAO,EAAC,YAAY;QAACf,SAAS,EAAEA,SAAU;QAAAQ,QAAA,EAC5DlB;MAAQ,CACL,CACP;IAAA,CACI;EAAC,CACA,CAAC;AAEf,CAAC;AAED,MAAM6B,aAAa,GAAGhD,IAAI,CAACgB,KAAK,CAAC;AACjCgC,aAAa,CAACC,WAAW,GAAG,OAAO;AAEnC,SAASD,aAAa,IAAIhC,KAAK"}
|
package/dist/ToastStack.js
CHANGED
|
@@ -14,10 +14,9 @@ import _Box from "@mui/material/Box";
|
|
|
14
14
|
|
|
15
15
|
import { memo } from "react";
|
|
16
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
-
const ToastStack =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} = _ref;
|
|
17
|
+
const ToastStack = ({
|
|
18
|
+
children
|
|
19
|
+
}) => {
|
|
21
20
|
return _jsx(_Snackbar, {
|
|
22
21
|
open: true,
|
|
23
22
|
children: _jsx(_Box, {
|
package/dist/ToastStack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastStack.js","names":["memo","jsx","_jsx","ToastStack","
|
|
1
|
+
{"version":3,"file":"ToastStack.js","names":["memo","jsx","_jsx","ToastStack","children","_Snackbar","open","_Box","sx","display","flexDirection","gap","MemoizedToastStack","displayName"],"sources":["../src/ToastStack.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\";\nimport { Box, Snackbar } from \"@mui/material\";\nimport { Toast } from \"./Toast\";\n\nexport type ToastStackProps = {\n /**\n * The Toast or array of Toasts within the ToastStack\n */\n children: ReactElement<typeof Toast> | Array<ReactElement<typeof Toast>>;\n};\n\nconst ToastStack = ({ children }: ToastStackProps) => {\n return (\n <Snackbar open={true}>\n <Box\n sx={{\n display: \"flex\",\n flexDirection: \"column-reverse\",\n gap: 2,\n }}\n >\n {children}\n </Box>\n </Snackbar>\n );\n};\n\nconst MemoizedToastStack = memo(ToastStack);\nMemoizedToastStack.displayName = \"ToastStack\";\n\nexport { MemoizedToastStack as ToastStack };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAsB,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAW3C,MAAMC,UAAU,GAAGA,CAAC;EAAEC;AAA0B,CAAC,KAAK;EACpD,OACEF,IAAA,CAAAG,SAAA;IAAUC,IAAI,EAAE,IAAK;IAAAF,QAAA,EACnBF,IAAA,CAAAK,IAAA;MACEC,EAAE,EAAE;QACFC,OAAO,EAAE,MAAM;QACfC,aAAa,EAAE,gBAAgB;QAC/BC,GAAG,EAAE;MACP,CAAE;MAAAP,QAAA,EAEDA;IAAQ,CACN;EAAC,CACE,CAAC;AAEf,CAAC;AAED,MAAMQ,kBAAkB,GAAGZ,IAAI,CAACG,UAAU,CAAC;AAC3CS,kBAAkB,CAACC,WAAW,GAAG,YAAY;AAE7C,SAASD,kBAAkB,IAAIT,UAAU"}
|
package/dist/Tooltip.js
CHANGED
|
@@ -13,26 +13,23 @@ import _Tooltip from "@mui/material/Tooltip";
|
|
|
13
13
|
import { MuiPropsChild } from "./MuiPropsChild.js";
|
|
14
14
|
import { memo } from "react";
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
const Tooltip =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
})
|
|
34
|
-
});
|
|
35
|
-
};
|
|
16
|
+
const Tooltip = ({
|
|
17
|
+
ariaType,
|
|
18
|
+
children,
|
|
19
|
+
placement = "top",
|
|
20
|
+
testId,
|
|
21
|
+
text,
|
|
22
|
+
translate
|
|
23
|
+
}) => _jsx(_Tooltip, {
|
|
24
|
+
"data-se": testId,
|
|
25
|
+
describeChild: ariaType === "description",
|
|
26
|
+
placement: placement,
|
|
27
|
+
title: text,
|
|
28
|
+
translate: translate,
|
|
29
|
+
children: _jsx(MuiPropsChild, {
|
|
30
|
+
children: children
|
|
31
|
+
})
|
|
32
|
+
});
|
|
36
33
|
const MemoizedTooltip = memo(Tooltip);
|
|
37
34
|
MemoizedTooltip.displayName = "Tooltip";
|
|
38
35
|
export { MemoizedTooltip as Tooltip };
|
package/dist/Tooltip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","names":["MuiPropsChild","memo","jsx","_jsx","Tooltip","
|
|
1
|
+
{"version":3,"file":"Tooltip.js","names":["MuiPropsChild","memo","jsx","_jsx","Tooltip","ariaType","children","placement","testId","text","translate","_Tooltip","describeChild","title","MemoizedTooltip","displayName"],"sources":["../src/Tooltip.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 { Tooltip as MuiTooltip } from \"@mui/material\";\nimport type { TooltipProps as MuiTooltipProps } from \"@mui/material\";\n\nimport { MuiPropsChild } from \"./MuiPropsChild\";\nimport { ReactElement, memo } from \"react\";\nimport { HtmlProps } from \"./HtmlProps\";\n\nexport type TooltipProps = {\n /**\n * The type of ARIA attribute to use\n */\n ariaType: \"description\" | \"label\";\n /**\n * The content that triggers the Tooltip when hovered\n */\n children: ReactElement;\n /**\n * The placement of the Tooltip\n */\n placement?: MuiTooltipProps[\"placement\"];\n /**\n * The text to display in the Tooltip\n */\n text: string;\n} & HtmlProps;\n\nconst Tooltip = ({\n ariaType,\n children,\n placement = \"top\",\n testId,\n text,\n translate,\n}: TooltipProps) => (\n <MuiTooltip\n data-se={testId}\n describeChild={ariaType === \"description\"}\n placement={placement}\n title={text}\n translate={translate}\n >\n <MuiPropsChild>{children}</MuiPropsChild>\n </MuiTooltip>\n);\n\nconst MemoizedTooltip = memo(Tooltip);\nMemoizedTooltip.displayName = \"Tooltip\";\n\nexport { MemoizedTooltip as Tooltip };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAeSA,aAAa;AACtB,SAAuBC,IAAI,QAAQ,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAsB3C,MAAMC,OAAO,GAAGA,CAAC;EACfC,QAAQ;EACRC,QAAQ;EACRC,SAAS,GAAG,KAAK;EACjBC,MAAM;EACNC,IAAI;EACJC;AACY,CAAC,KACbP,IAAA,CAAAQ,QAAA;EACE,WAASH,MAAO;EAChBI,aAAa,EAAEP,QAAQ,KAAK,aAAc;EAC1CE,SAAS,EAAEA,SAAU;EACrBM,KAAK,EAAEJ,IAAK;EACZC,SAAS,EAAEA,SAAU;EAAAJ,QAAA,EAErBH,IAAA,CAACH,aAAa;IAAAM,QAAA,EAAEA;EAAQ,CAAgB;AAAC,CAC/B,CACb;AAED,MAAMQ,eAAe,GAAGb,IAAI,CAACG,OAAO,CAAC;AACrCU,eAAe,CAACC,WAAW,GAAG,SAAS;AAEvC,SAASD,eAAe,IAAIV,OAAO"}
|