@okta/odyssey-react-mui 1.0.2 → 1.2.0
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 +54 -0
- package/README.md +1 -1
- package/dist/Autocomplete.js +20 -3
- package/dist/Autocomplete.js.map +1 -1
- package/dist/Banner.js +3 -1
- package/dist/Banner.js.map +1 -1
- package/dist/Box.js +8 -4
- package/dist/Box.js.map +1 -1
- package/dist/Button.js +3 -1
- package/dist/Button.js.map +1 -1
- package/dist/Callout.js +2 -0
- package/dist/Callout.js.map +1 -1
- package/dist/Checkbox.js +6 -2
- package/dist/Checkbox.js.map +1 -1
- package/dist/CheckboxGroup.js +5 -7
- package/dist/CheckboxGroup.js.map +1 -1
- package/dist/CircularProgress.js +2 -0
- package/dist/CircularProgress.js.map +1 -1
- package/dist/Dialog.js +2 -0
- package/dist/Dialog.js.map +1 -1
- package/dist/Field.js.map +1 -1
- package/dist/FieldError.js +2 -0
- package/dist/FieldError.js.map +1 -1
- package/dist/FieldHint.js +2 -0
- package/dist/FieldHint.js.map +1 -1
- package/dist/FieldLabel.js +3 -1
- package/dist/FieldLabel.js.map +1 -1
- package/dist/Fieldset.js +3 -1
- package/dist/Fieldset.js.map +1 -1
- package/dist/Form.js +5 -3
- package/dist/Form.js.map +1 -1
- package/dist/Link.js +3 -1
- package/dist/Link.js.map +1 -1
- package/dist/MenuButton.js +8 -2
- package/dist/MenuButton.js.map +1 -1
- package/dist/MenuItem.js +6 -2
- package/dist/MenuItem.js.map +1 -1
- package/dist/NativeSelect.js +3 -1
- package/dist/NativeSelect.js.map +1 -1
- package/dist/OdysseyCacheProvider.js +4 -1
- package/dist/OdysseyCacheProvider.js.map +1 -1
- package/dist/OdysseyProvider.js +12 -5
- package/dist/OdysseyProvider.js.map +1 -1
- package/dist/OdysseyThemeProvider.js +8 -7
- package/dist/OdysseyThemeProvider.js.map +1 -1
- package/dist/OdysseyTranslationProvider.js +1 -1
- package/dist/OdysseyTranslationProvider.js.map +1 -1
- package/dist/OdysseyTranslationProvider.types.js +1 -1
- package/dist/OdysseyTranslationProvider.types.js.map +1 -1
- package/dist/PasswordField.js +18 -9
- package/dist/PasswordField.js.map +1 -1
- package/dist/Radio.js +2 -0
- package/dist/Radio.js.map +1 -1
- package/dist/RadioGroup.js +5 -2
- package/dist/RadioGroup.js.map +1 -1
- package/dist/SearchField.js +11 -10
- package/dist/SearchField.js.map +1 -1
- package/dist/Select.js +39 -35
- package/dist/Select.js.map +1 -1
- package/dist/SeleniumProps.js +2 -0
- package/dist/SeleniumProps.js.map +1 -0
- package/dist/Status.js +4 -2
- package/dist/Status.js.map +1 -1
- package/dist/Tabs.js +11 -4
- package/dist/Tabs.js.map +1 -1
- package/dist/Tag.js +4 -2
- package/dist/Tag.js.map +1 -1
- package/dist/TagList.js +3 -1
- package/dist/TagList.js.map +1 -1
- package/dist/TextField.js +6 -2
- package/dist/TextField.js.map +1 -1
- package/dist/Toast.js +2 -0
- package/dist/Toast.js.map +1 -1
- package/dist/Tooltip.js +2 -0
- package/dist/Tooltip.js.map +1 -1
- package/dist/Typography.js +71 -59
- package/dist/Typography.js.map +1 -1
- package/dist/createShadowDom.js +26 -0
- package/dist/createShadowDom.js.map +1 -0
- package/dist/{OdysseyI18n.js → i18n.js} +5 -2
- package/dist/i18n.js.map +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/labs/DatePicker.js +4 -2
- package/dist/labs/DatePicker.js.map +1 -1
- package/dist/labs/PaginatedTable.js +6 -4
- package/dist/labs/PaginatedTable.js.map +1 -1
- package/dist/labs/StaticTable.js +9 -4
- package/dist/labs/StaticTable.js.map +1 -1
- package/dist/labs/datePickerTheme.js +4 -2
- 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/Autocomplete.d.ts +29 -4
- package/dist/src/Autocomplete.d.ts.map +1 -1
- package/dist/src/Banner.d.ts +3 -2
- package/dist/src/Banner.d.ts.map +1 -1
- package/dist/src/Box.d.ts +9 -2
- package/dist/src/Box.d.ts.map +1 -1
- package/dist/src/Button.d.ts +3 -2
- package/dist/src/Button.d.ts.map +1 -1
- package/dist/src/Callout.d.ts +3 -2
- package/dist/src/Callout.d.ts.map +1 -1
- package/dist/src/Checkbox.d.ts +8 -3
- package/dist/src/Checkbox.d.ts.map +1 -1
- package/dist/src/CheckboxGroup.d.ts +3 -6
- package/dist/src/CheckboxGroup.d.ts.map +1 -1
- package/dist/src/CircularProgress.d.ts +3 -2
- package/dist/src/CircularProgress.d.ts.map +1 -1
- package/dist/src/Dialog.d.ts +3 -2
- package/dist/src/Dialog.d.ts.map +1 -1
- package/dist/src/Field.d.ts +2 -1
- package/dist/src/Field.d.ts.map +1 -1
- package/dist/src/FieldError.d.ts +3 -2
- package/dist/src/FieldError.d.ts.map +1 -1
- package/dist/src/FieldHint.d.ts +3 -2
- package/dist/src/FieldHint.d.ts.map +1 -1
- package/dist/src/FieldLabel.d.ts +3 -2
- package/dist/src/FieldLabel.d.ts.map +1 -1
- package/dist/src/Fieldset.d.ts +3 -2
- package/dist/src/Fieldset.d.ts.map +1 -1
- package/dist/src/Form.d.ts +3 -2
- package/dist/src/Form.d.ts.map +1 -1
- package/dist/src/Link.d.ts +3 -2
- package/dist/src/Link.d.ts.map +1 -1
- package/dist/src/MenuButton.d.ts +12 -3
- package/dist/src/MenuButton.d.ts.map +1 -1
- package/dist/src/MenuItem.d.ts +5 -4
- package/dist/src/MenuItem.d.ts.map +1 -1
- package/dist/src/NativeSelect.d.ts +56 -2
- package/dist/src/NativeSelect.d.ts.map +1 -1
- package/dist/src/OdysseyCacheProvider.d.ts +6 -1
- package/dist/src/OdysseyCacheProvider.d.ts.map +1 -1
- package/dist/src/OdysseyProvider.d.ts +1 -1
- package/dist/src/OdysseyProvider.d.ts.map +1 -1
- package/dist/src/OdysseyThemeProvider.d.ts +2 -1
- package/dist/src/OdysseyThemeProvider.d.ts.map +1 -1
- package/dist/src/OdysseyTranslationProvider.d.ts +1 -1
- package/dist/src/OdysseyTranslationProvider.d.ts.map +1 -1
- package/dist/src/OdysseyTranslationProvider.types.d.ts +1 -1
- package/dist/src/OdysseyTranslationProvider.types.d.ts.map +1 -1
- package/dist/src/PasswordField.d.ts +78 -2
- package/dist/src/PasswordField.d.ts.map +1 -1
- package/dist/src/Radio.d.ts +3 -2
- package/dist/src/Radio.d.ts.map +1 -1
- package/dist/src/RadioGroup.d.ts +8 -3
- package/dist/src/RadioGroup.d.ts.map +1 -1
- package/dist/src/SearchField.d.ts +58 -2
- package/dist/src/SearchField.d.ts.map +1 -1
- package/dist/src/Select.d.ts +7 -2
- package/dist/src/Select.d.ts.map +1 -1
- package/dist/src/SeleniumProps.d.ts +20 -0
- package/dist/src/SeleniumProps.d.ts.map +1 -0
- package/dist/src/Status.d.ts +3 -2
- package/dist/src/Status.d.ts.map +1 -1
- package/dist/src/Tabs.d.ts +9 -3
- package/dist/src/Tabs.d.ts.map +1 -1
- package/dist/src/Tag.d.ts +3 -2
- package/dist/src/Tag.d.ts.map +1 -1
- package/dist/src/TagList.d.ts +3 -2
- package/dist/src/TagList.d.ts.map +1 -1
- package/dist/src/TextField.d.ts +86 -2
- package/dist/src/TextField.d.ts.map +1 -1
- package/dist/src/Toast.d.ts +3 -2
- package/dist/src/Toast.d.ts.map +1 -1
- package/dist/src/Tooltip.d.ts +3 -2
- package/dist/src/Tooltip.d.ts.map +1 -1
- package/dist/src/Typography.d.ts +14 -49
- package/dist/src/Typography.d.ts.map +1 -1
- package/dist/src/createShadowDom.d.ts +16 -0
- package/dist/src/createShadowDom.d.ts.map +1 -0
- package/dist/src/{OdysseyI18n.d.ts → i18n.d.ts} +20 -2
- package/dist/src/i18n.d.ts.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/labs/DatePicker.d.ts +5 -1
- package/dist/src/labs/DatePicker.d.ts.map +1 -1
- package/dist/src/labs/PaginatedTable.d.ts.map +1 -1
- package/dist/src/labs/StaticTable.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/src/theme/components.d.ts +4 -1
- package/dist/src/theme/components.d.ts.map +1 -1
- package/dist/src/theme/createOdysseyMuiTheme.d.ts +23 -0
- package/dist/src/theme/createOdysseyMuiTheme.d.ts.map +1 -0
- package/dist/src/theme/mixins.d.ts +3 -1
- package/dist/src/theme/mixins.d.ts.map +1 -1
- package/dist/src/theme/palette.d.ts +3 -1
- package/dist/src/theme/palette.d.ts.map +1 -1
- package/dist/src/theme/shape.d.ts +3 -1
- package/dist/src/theme/shape.d.ts.map +1 -1
- package/dist/src/theme/spacing.d.ts +3 -1
- package/dist/src/theme/spacing.d.ts.map +1 -1
- package/dist/src/theme/theme.d.ts +1 -8
- package/dist/src/theme/theme.d.ts.map +1 -1
- package/dist/src/theme/typography.d.ts +3 -1
- package/dist/src/theme/typography.d.ts.map +1 -1
- package/dist/theme/components.js +118 -73
- package/dist/theme/components.js.map +1 -1
- package/dist/theme/createOdysseyMuiTheme.js +51 -0
- package/dist/theme/createOdysseyMuiTheme.js.map +1 -0
- package/dist/theme/mixins.js +4 -1
- package/dist/theme/mixins.js.map +1 -1
- package/dist/theme/palette.js +4 -1
- package/dist/theme/palette.js.map +1 -1
- package/dist/theme/shape.js +4 -1
- package/dist/theme/shape.js.map +1 -1
- package/dist/theme/spacing.js +4 -1
- package/dist/theme/spacing.js.map +1 -1
- package/dist/theme/theme.js +1 -20
- package/dist/theme/theme.js.map +1 -1
- package/dist/theme/typography.js +4 -1
- package/dist/theme/typography.js.map +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/package.json +7 -6
- package/src/Autocomplete.tsx +56 -4
- package/src/Banner.tsx +11 -2
- package/src/Box.tsx +11 -5
- package/src/Button.tsx +6 -1
- package/src/Callout.tsx +5 -3
- package/src/Checkbox.tsx +14 -4
- package/src/CheckboxGroup.tsx +6 -10
- package/src/CircularProgress.tsx +5 -1
- package/src/Dialog.tsx +5 -2
- package/src/Field.tsx +2 -0
- package/src/FieldError.tsx +5 -3
- package/src/FieldHint.tsx +9 -3
- package/src/FieldLabel.tsx +5 -3
- package/src/Fieldset.tsx +4 -1
- package/src/Form.tsx +7 -4
- package/src/Link.tsx +18 -3
- package/src/MenuButton.tsx +33 -4
- package/src/MenuItem.tsx +11 -6
- package/src/NativeSelect.tsx +7 -2
- package/src/OdysseyCacheProvider.tsx +9 -1
- package/src/OdysseyProvider.tsx +18 -8
- package/src/OdysseyThemeProvider.tsx +12 -8
- package/src/OdysseyTranslationProvider.test.tsx +2 -2
- package/src/OdysseyTranslationProvider.tsx +1 -1
- package/src/OdysseyTranslationProvider.types.ts +1 -0
- package/src/PasswordField.tsx +37 -13
- package/src/Radio.tsx +5 -1
- package/src/RadioGroup.tsx +12 -4
- package/src/SearchField.tsx +23 -15
- package/src/Select.tsx +154 -149
- package/src/SeleniumProps.ts +20 -0
- package/src/Status.tsx +15 -3
- package/src/Tabs.tsx +18 -4
- package/src/Tag.tsx +12 -3
- package/src/TagList.tsx +4 -2
- package/src/TextField.tsx +14 -2
- package/src/Toast.tsx +4 -1
- package/src/Tooltip.tsx +4 -1
- package/src/Typography.tsx +76 -54
- package/src/createShadowDom.ts +46 -0
- package/src/{OdysseyI18n.ts → i18n.ts} +4 -2
- package/src/index.ts +1 -0
- package/src/labs/DatePicker.tsx +15 -7
- package/src/labs/PaginatedTable.tsx +12 -3
- package/src/labs/README.md +2 -2
- package/src/labs/StaticTable.tsx +13 -3
- package/src/labs/datePickerTheme.tsx +2 -2
- package/src/properties/odyssey-react-mui.properties +2 -0
- package/src/properties/ts/odyssey-react-mui.ts +1 -1
- package/src/theme/components.tsx +69 -18
- package/src/theme/createOdysseyMuiTheme.ts +47 -0
- package/src/theme/mixins.ts +5 -1
- package/src/theme/palette.ts +5 -3
- package/src/theme/shape.ts +5 -1
- package/src/theme/spacing.ts +5 -3
- package/src/theme/theme.ts +1 -26
- package/src/theme/typography.ts +5 -3
- package/dist/OdysseyI18n.js.map +0 -1
- package/dist/src/OdysseyI18n.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,60 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.2.0](https://github.com/okta/odyssey/compare/v1.1.1...v1.2.0) (2023-09-29)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- adds ability to use Shadow DOM with Odyssey ([#1966](https://github.com/okta/odyssey/issues/1966)) ([6b52246](https://github.com/okta/odyssey/commit/6b5224662982d7e214457292d0ab168719dc8c29))
|
|
11
|
+
- hide selected Autocomplete items ([#1984](https://github.com/okta/odyssey/issues/1984)) ([11aa9ee](https://github.com/okta/odyssey/commit/11aa9ee0211e7f5b2c2512d77ee7efd8b4c7426e))
|
|
12
|
+
- **odyssey-react-mui:** adding new prop for PasswordField to control show password button ([58ad6c8](https://github.com/okta/odyssey/commit/58ad6c8027d963a557fc501acba7ebc5724e2410))
|
|
13
|
+
- **odyssey-react-mui:** renamed prop to hasShowPassword and changed default to true ([6c3b8d2](https://github.com/okta/odyssey/commit/6c3b8d2d8486afbee6869a12c5320f2ea152dc5a))
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
- id and name not changing in Storybook ([#1987](https://github.com/okta/odyssey/issues/1987)) ([2f57e15](https://github.com/okta/odyssey/commit/2f57e156f27c64954e8aa39662198d9c04ff9518))
|
|
18
|
+
- **odyssey-react-mui:** add mising prop errorMessage to autocomplete ([1c1360c](https://github.com/okta/odyssey/commit/1c1360cd33f74b5d91f961ed859ab0972633995d))
|
|
19
|
+
- **odyssey-react-mui:** add props onBlur, onFocus, id, name ([66ad838](https://github.com/okta/odyssey/commit/66ad838821ba18c3ee4c24f729b89c76eb62df3e))
|
|
20
|
+
- **odyssey-react-mui:** address PR comments ([f10a903](https://github.com/okta/odyssey/commit/f10a903cece4f873f91a588b3b603d96b6055eb1))
|
|
21
|
+
- **odyssey-react-mui:** fixing issue with t function type by upgrading package ([c0b8343](https://github.com/okta/odyssey/commit/c0b834326afda7e42aacb64af174def159c31e90))
|
|
22
|
+
- **odyssey-react-mui:** fixing tests to use getByRole and canvas ([cd7feed](https://github.com/okta/odyssey/commit/cd7feed17147397e5f79eed31e31d59ee17f562d))
|
|
23
|
+
- **odyssey-react-mui:** localizing the aria-label for the PasswordField component ([e9d332a](https://github.com/okta/odyssey/commit/e9d332a5f691742609533e679bb58d7f910c9a1b))
|
|
24
|
+
- **odyssey-react-mui:** toggle aria label based on password ([405fd71](https://github.com/okta/odyssey/commit/405fd7155d8ac9bb5b697bbb8b4dad3c021a0e63))
|
|
25
|
+
- **odyssey-react-mui:** updating descriptions for props ([12b9587](https://github.com/okta/odyssey/commit/12b9587cda9058ff00180e0cc7b2bcb4debeb27f))
|
|
26
|
+
- removed classes prop from Typography components ([#1989](https://github.com/okta/odyssey/issues/1989)) ([889f369](https://github.com/okta/odyssey/commit/889f3697582da68f71f2db801c1e7702a29fd9f5))
|
|
27
|
+
|
|
28
|
+
## [1.1.1](https://github.com/okta/odyssey/compare/v1.1.0...v1.1.1) (2023-09-15)
|
|
29
|
+
|
|
30
|
+
**Note:** Version bump only for package @okta/odyssey-react-mui
|
|
31
|
+
|
|
32
|
+
## [1.1.0](https://github.com/okta/odyssey/compare/v1.0.5...v1.1.0) (2023-09-14)
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
- enable name in all form fields ([#1969](https://github.com/okta/odyssey/issues/1969)) ([45ae220](https://github.com/okta/odyssey/commit/45ae220ca8a2bce0af484a52001e5477cf253147))
|
|
37
|
+
|
|
38
|
+
### Bug Fixes
|
|
39
|
+
|
|
40
|
+
- add @mui/system as dependency ([8294649](https://github.com/okta/odyssey/commit/8294649debb136a2c92733b8427aedf838200a07))
|
|
41
|
+
- flip ordering of state to allow consumer to override ([4c48230](https://github.com/okta/odyssey/commit/4c482302d8ca74fa8566afcf66989064dd397d8a))
|
|
42
|
+
- html `required` attribute removed when adding `isOptional` prop ([#1965](https://github.com/okta/odyssey/issues/1965)) ([793210d](https://github.com/okta/odyssey/commit/793210d8c3f3aa4aea3df815e30cb1029c71d511))
|
|
43
|
+
- make global + column filtering work ([5df3006](https://github.com/okta/odyssey/commit/5df30067887a456fc3ad373ef8e548e4386590b1))
|
|
44
|
+
- onGlobalFilterChange should fire when string removed ([#1970](https://github.com/okta/odyssey/issues/1970)) ([1c424b9](https://github.com/okta/odyssey/commit/1c424b9ac86547f4fb55b955f240f24fac83cb2b))
|
|
45
|
+
- prettier adjustments ([cd7111c](https://github.com/okta/odyssey/commit/cd7111c9c510591db866831c58db3ed6f8e6466f))
|
|
46
|
+
- static tables to always have virtualization enabled ([#1967](https://github.com/okta/odyssey/issues/1967)) ([f4362ce](https://github.com/okta/odyssey/commit/f4362ce45e7f70aa3667b361f4696af063a78612))
|
|
47
|
+
|
|
48
|
+
## [1.0.5](https://github.com/okta/odyssey/compare/v1.0.4...v1.0.5) (2023-09-11)
|
|
49
|
+
|
|
50
|
+
**Note:** Version bump only for package @okta/odyssey-react-mui
|
|
51
|
+
|
|
52
|
+
## [1.0.4](https://github.com/okta/odyssey/compare/v1.0.3...v1.0.4) (2023-08-29)
|
|
53
|
+
|
|
54
|
+
**Note:** Version bump only for package @okta/odyssey-react-mui
|
|
55
|
+
|
|
56
|
+
## [1.0.3](https://github.com/okta/odyssey/compare/v1.0.2...v1.0.3) (2023-08-28)
|
|
57
|
+
|
|
58
|
+
**Note:** Version bump only for package @okta/odyssey-react-mui
|
|
59
|
+
|
|
6
60
|
## [1.0.2](https://github.com/okta/odyssey/compare/v1.0.1...v1.0.2) (2023-08-04)
|
|
7
61
|
|
|
8
62
|
### Features
|
package/README.md
CHANGED
package/dist/Autocomplete.js
CHANGED
|
@@ -16,17 +16,24 @@ import { Field } from "./Field.js";
|
|
|
16
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
17
|
const Autocomplete = _ref => {
|
|
18
18
|
let {
|
|
19
|
+
errorMessage,
|
|
19
20
|
hasMultipleChoices,
|
|
21
|
+
id: idOverride,
|
|
20
22
|
isCustomValueAllowed,
|
|
21
23
|
isDisabled,
|
|
22
24
|
isLoading,
|
|
25
|
+
isOptional = false,
|
|
23
26
|
isReadOnly,
|
|
24
27
|
hint,
|
|
25
28
|
label,
|
|
29
|
+
name: nameOverride,
|
|
30
|
+
onBlur,
|
|
26
31
|
onChange,
|
|
27
32
|
onInputChange,
|
|
33
|
+
onFocus,
|
|
28
34
|
options,
|
|
29
|
-
value
|
|
35
|
+
value,
|
|
36
|
+
testId
|
|
30
37
|
} = _ref;
|
|
31
38
|
const renderInput = useCallback(_ref2 => {
|
|
32
39
|
let {
|
|
@@ -35,11 +42,13 @@ const Autocomplete = _ref => {
|
|
|
35
42
|
...params
|
|
36
43
|
} = _ref2;
|
|
37
44
|
return _jsx(Field, {
|
|
45
|
+
errorMessage: errorMessage,
|
|
38
46
|
fieldType: "single",
|
|
39
47
|
hasVisibleLabel: true,
|
|
40
48
|
id: InputLabelProps.htmlFor,
|
|
41
49
|
hint: hint,
|
|
42
50
|
label: label,
|
|
51
|
+
isOptional: isOptional,
|
|
43
52
|
renderFieldComponent: _ref3 => {
|
|
44
53
|
let {
|
|
45
54
|
ariaDescribedBy,
|
|
@@ -49,19 +58,27 @@ const Autocomplete = _ref => {
|
|
|
49
58
|
...params,
|
|
50
59
|
...InputProps,
|
|
51
60
|
"aria-describedby": ariaDescribedBy,
|
|
52
|
-
id: id
|
|
61
|
+
id: id,
|
|
62
|
+
name: nameOverride ?? id,
|
|
63
|
+
required: !isOptional
|
|
53
64
|
});
|
|
54
65
|
}
|
|
55
66
|
});
|
|
56
|
-
}, [hint, label]);
|
|
67
|
+
}, [errorMessage, hint, isOptional, label, nameOverride]);
|
|
57
68
|
return _jsx(_Autocomplete, {
|
|
58
69
|
"aria-disabled": isDisabled,
|
|
70
|
+
"data-se": testId,
|
|
71
|
+
disableCloseOnSelect: hasMultipleChoices,
|
|
59
72
|
disabled: isDisabled,
|
|
60
73
|
freeSolo: isCustomValueAllowed,
|
|
74
|
+
filterSelectedOptions: true,
|
|
75
|
+
id: idOverride,
|
|
61
76
|
loading: isLoading,
|
|
62
77
|
multiple: hasMultipleChoices,
|
|
78
|
+
onBlur: onBlur,
|
|
63
79
|
onChange: onChange,
|
|
64
80
|
onInputChange: onInputChange,
|
|
81
|
+
onFocus: onFocus,
|
|
65
82
|
options: options,
|
|
66
83
|
readOnly: isReadOnly,
|
|
67
84
|
renderInput: renderInput,
|
package/dist/Autocomplete.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.js","names":["memo","useCallback","Field","jsx","_jsx","Autocomplete","_ref","hasMultipleChoices","isCustomValueAllowed","isDisabled","isLoading","isReadOnly","hint","label","onChange","onInputChange","options","value","renderInput","_ref2","InputLabelProps","InputProps","params","fieldType","hasVisibleLabel","
|
|
1
|
+
{"version":3,"file":"Autocomplete.js","names":["memo","useCallback","Field","jsx","_jsx","Autocomplete","_ref","errorMessage","hasMultipleChoices","id","idOverride","isCustomValueAllowed","isDisabled","isLoading","isOptional","isReadOnly","hint","label","name","nameOverride","onBlur","onChange","onInputChange","onFocus","options","value","testId","renderInput","_ref2","InputLabelProps","InputProps","params","fieldType","hasVisibleLabel","htmlFor","renderFieldComponent","_ref3","ariaDescribedBy","_InputBase","required","_Autocomplete","disableCloseOnSelect","disabled","freeSolo","filterSelectedOptions","loading","multiple","readOnly","MemoizedAutocomplete"],"sources":["../src/Autocomplete.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n Autocomplete as MuiAutocomplete,\n AutocompleteProps as MuiAutocompleteProps,\n InputBase,\n} from \"@mui/material\";\nimport { memo, useCallback } from \"react\";\n\nimport { Field } from \"./Field\";\nimport type { SeleniumProps } from \"./SeleniumProps\";\n\nexport type AutocompleteProps<\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined\n> = {\n /**\n * The error message for the Select\n */\n errorMessage?: string;\n /**\n * Enables multiple choice selection\n */\n hasMultipleChoices?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"multiple\"];\n /**\n * The hint text for the Autocomplete input\n */\n hint?: string;\n /**\n * The id attribute of the Select\n */\n id?: string;\n /**\n * Allows the input of custom values\n */\n isCustomValueAllowed?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"freeSolo\"];\n /**\n * Disables the Autocomplete input\n */\n isDisabled?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"disabled\"];\n /**\n * Displays a loading indicator\n */\n isLoading?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"loading\"];\n /**\n * If `true`, the `input` element is not required.\n */\n isOptional?: boolean;\n /**\n * Makes the Autocomplete input read-only\n */\n isReadOnly?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"readOnly\"];\n /**\n * The label text for the autocomplete input\n */\n label: string;\n /**\n * The name of the `input` element. Defaults to the `id` if not set.\n */\n name?: string;\n /**\n * Callback fired when the autocomplete loses focus.\n */\n onBlur?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onBlur\"];\n /**\n * Callback fired when a selection is made.\n */\n onChange?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onChange\"];\n /**\n * Callback fired when the textbox receives typed characters.\n */\n onInputChange?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onInputChange\"];\n /**\n * Callback fired when the autocomplete gains focus.\n */\n onFocus?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onFocus\"];\n /**\n * The options for the Autocomplete input\n */\n options: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"options\"];\n /**\n * The value of the Autocomplete input\n */\n value?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"value\"];\n} & SeleniumProps;\n\nconst Autocomplete = <\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined\n>({\n errorMessage,\n hasMultipleChoices,\n id: idOverride,\n isCustomValueAllowed,\n isDisabled,\n isLoading,\n isOptional = false,\n isReadOnly,\n hint,\n label,\n name: nameOverride,\n onBlur,\n onChange,\n onInputChange,\n onFocus,\n options,\n value,\n testId,\n}: AutocompleteProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>) => {\n const renderInput = useCallback(\n ({ InputLabelProps, InputProps, ...params }) => (\n <Field\n errorMessage={errorMessage}\n fieldType=\"single\"\n hasVisibleLabel\n id={InputLabelProps.htmlFor}\n hint={hint}\n label={label}\n isOptional={isOptional}\n renderFieldComponent={({ ariaDescribedBy, id }) => (\n <InputBase\n {...params}\n {...InputProps}\n aria-describedby={ariaDescribedBy}\n id={id}\n name={nameOverride ?? id}\n required={!isOptional}\n />\n )}\n />\n ),\n [errorMessage, hint, isOptional, label, nameOverride]\n );\n\n return (\n <MuiAutocomplete\n // AutoComplete is wrapped in a div within MUI which does not get the disabled attr. So this aria-disabled gets set in the div\n aria-disabled={isDisabled}\n data-se={testId}\n disableCloseOnSelect={hasMultipleChoices}\n disabled={isDisabled}\n freeSolo={isCustomValueAllowed}\n filterSelectedOptions={true}\n id={idOverride}\n loading={isLoading}\n multiple={hasMultipleChoices}\n onBlur={onBlur}\n onChange={onChange}\n onInputChange={onInputChange}\n onFocus={onFocus}\n options={options}\n readOnly={isReadOnly}\n renderInput={renderInput}\n value={value}\n />\n );\n};\n\nconst MemoizedAutocomplete = memo(Autocomplete) as typeof Autocomplete;\n\nexport { MemoizedAutocomplete as Autocomplete };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA,SAASA,IAAI,EAAEC,WAAW,QAAQ,OAAO;AAAC,SAEjCC,KAAK;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAqId,MAAMC,YAAY,GAAGC,IAAA,IAuB0D;EAAA,IAnB7E;IACAC,YAAY;IACZC,kBAAkB;IAClBC,EAAE,EAAEC,UAAU;IACdC,oBAAoB;IACpBC,UAAU;IACVC,SAAS;IACTC,UAAU,GAAG,KAAK;IAClBC,UAAU;IACVC,IAAI;IACJC,KAAK;IACLC,IAAI,EAAEC,YAAY;IAClBC,MAAM;IACNC,QAAQ;IACRC,aAAa;IACbC,OAAO;IACPC,OAAO;IACPC,KAAK;IACLC;EACuE,CAAC,GAAApB,IAAA;EACxE,MAAMqB,WAAW,GAAG1B,WAAW,CAC7B2B,KAAA;IAAA,IAAC;MAAEC,eAAe;MAAEC,UAAU;MAAE,GAAGC;IAAO,CAAC,GAAAH,KAAA;IAAA,OACzCxB,IAAA,CAACF,KAAK;MACJK,YAAY,EAAEA,YAAa;MAC3ByB,SAAS,EAAC,QAAQ;MAClBC,eAAe;MACfxB,EAAE,EAAEoB,eAAe,CAACK,OAAQ;MAC5BlB,IAAI,EAAEA,IAAK;MACXC,KAAK,EAAEA,KAAM;MACbH,UAAU,EAAEA,UAAW;MACvBqB,oBAAoB,EAAEC,KAAA;QAAA,IAAC;UAAEC,eAAe;UAAE5B;QAAG,CAAC,GAAA2B,KAAA;QAAA,OAC5ChC,IAAA,CAAAkC,UAAA;UAAA,GACMP,MAAM;UAAA,GACND,UAAU;UACd,oBAAkBO,eAAgB;UAClC5B,EAAE,EAAEA,EAAG;UACPS,IAAI,EAAEC,YAAY,IAAIV,EAAG;UACzB8B,QAAQ,EAAE,CAACzB;QAAW,CACvB,CAAC;MAAA;IACF,CACH,CAAC;EAAA,CACH,EACD,CAACP,YAAY,EAAES,IAAI,EAAEF,UAAU,EAAEG,KAAK,EAAEE,YAAY,CACtD,CAAC;EAED,OACEf,IAAA,CAAAoC,aAAA;IAEE,iBAAe5B,UAAW;IAC1B,WAASc,MAAO;IAChBe,oBAAoB,EAAEjC,kBAAmB;IACzCkC,QAAQ,EAAE9B,UAAW;IACrB+B,QAAQ,EAAEhC,oBAAqB;IAC/BiC,qBAAqB,EAAE,IAAK;IAC5BnC,EAAE,EAAEC,UAAW;IACfmC,OAAO,EAAEhC,SAAU;IACnBiC,QAAQ,EAAEtC,kBAAmB;IAC7BY,MAAM,EAAEA,MAAO;IACfC,QAAQ,EAAEA,QAAS;IACnBC,aAAa,EAAEA,aAAc;IAC7BC,OAAO,EAAEA,OAAQ;IACjBC,OAAO,EAAEA,OAAQ;IACjBuB,QAAQ,EAAEhC,UAAW;IACrBY,WAAW,EAAEA,WAAY;IACzBF,KAAK,EAAEA;EAAM,CACd,CAAC;AAEN,CAAC;AAED,MAAMuB,oBAAoB,GAAGhD,IAAI,CAACK,YAAY,CAAwB;AAEtE,SAAS2C,oBAAoB,IAAI3C,YAAY"}
|
package/dist/Banner.js
CHANGED
|
@@ -26,12 +26,14 @@ const Banner = _ref => {
|
|
|
26
26
|
onClose,
|
|
27
27
|
role,
|
|
28
28
|
severity,
|
|
29
|
-
text
|
|
29
|
+
text,
|
|
30
|
+
testId
|
|
30
31
|
} = _ref;
|
|
31
32
|
const {
|
|
32
33
|
t
|
|
33
34
|
} = useTranslation();
|
|
34
35
|
return _jsxs(_Alert, {
|
|
36
|
+
"data-se": testId,
|
|
35
37
|
onClose: onClose,
|
|
36
38
|
role: role,
|
|
37
39
|
severity: severity,
|
package/dist/Banner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Banner.js","names":["Link","ScreenReaderText","memo","useTranslation","jsxs","_jsxs","jsx","_jsx","bannerRoleValues","bannerSeverityValues","Banner","_ref","linkUrl","linkText","onClose","role","severity","text","t","_Alert","variant","children","_AlertTitle","href","MemoizedBanner","displayName"],"sources":["../src/Banner.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 { Alert, AlertColor, AlertTitle, AlertProps } from \"@mui/material\";\nimport { Link } from \"./Link\";\nimport { ScreenReaderText } from \"./ScreenReaderText\";\nimport { memo } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nexport const bannerRoleValues = [\"status\", \"alert\"] as const;\nexport const bannerSeverityValues: AlertColor[] = [\n \"success\",\n \"info\",\n \"warning\",\n \"error\",\n];\n\nexport type BannerProps = {\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 alert will include a link to the URL\n */\n linkUrl?: string;\n /**\n * The function that's fired when the user clicks the close button. If undefined,\n * the close button will not be shown.\n */\n onClose?: AlertProps[\"onClose\"];\n /**\n * Sets the ARIA role of the alert\n * (\"status\" for something that dynamically updates, \"alert\" for errors, null for something\n * unchanging)\n */\n role?: (typeof bannerRoleValues)[number];\n /**\n * Determine the color and icon of the alert\n */\n severity: (typeof bannerSeverityValues)[number];\n /**\n * The text content of the alert\n */\n text: string;\n};\n\nconst Banner = ({\n linkUrl,\n linkText,\n onClose,\n role,\n severity,\n text,\n}: BannerProps) => {\n const { t } = useTranslation();\n\n return (\n <Alert
|
|
1
|
+
{"version":3,"file":"Banner.js","names":["Link","ScreenReaderText","memo","useTranslation","jsxs","_jsxs","jsx","_jsx","bannerRoleValues","bannerSeverityValues","Banner","_ref","linkUrl","linkText","onClose","role","severity","text","testId","t","_Alert","variant","children","_AlertTitle","href","MemoizedBanner","displayName"],"sources":["../src/Banner.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 { Alert, AlertColor, AlertTitle, AlertProps } from \"@mui/material\";\nimport { Link } from \"./Link\";\nimport { ScreenReaderText } from \"./ScreenReaderText\";\nimport { memo } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport type { SeleniumProps } from \"./SeleniumProps\";\n\nexport const bannerRoleValues = [\"status\", \"alert\"] as const;\nexport const bannerSeverityValues: AlertColor[] = [\n \"success\",\n \"info\",\n \"warning\",\n \"error\",\n];\n\nexport type BannerProps = {\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 alert will include a link to the URL\n */\n linkUrl?: string;\n /**\n * The function that's fired when the user clicks the close button. If undefined,\n * the close button will not be shown.\n */\n onClose?: AlertProps[\"onClose\"];\n /**\n * Sets the ARIA role of the alert\n * (\"status\" for something that dynamically updates, \"alert\" for errors, null for something\n * unchanging)\n */\n role?: (typeof bannerRoleValues)[number];\n /**\n * Determine the color and icon of the alert\n */\n severity: (typeof bannerSeverityValues)[number];\n /**\n * The text content of the alert\n */\n text: string;\n} & SeleniumProps;\n\nconst Banner = ({\n linkUrl,\n linkText,\n onClose,\n role,\n severity,\n text,\n testId,\n}: BannerProps) => {\n const { t } = useTranslation();\n\n return (\n <Alert\n data-se={testId}\n onClose={onClose}\n role={role}\n severity={severity}\n variant=\"banner\"\n >\n <ScreenReaderText>{t(`severity.${severity}`)}:</ScreenReaderText>\n <AlertTitle>{text}</AlertTitle>\n {linkUrl && (\n <Link href={linkUrl} variant=\"monochrome\">\n {linkText}\n </Link>\n )}\n </Alert>\n );\n};\n\nconst MemoizedBanner = memo(Banner);\nMemoizedBanner.displayName = \"Banner\";\n\nexport { MemoizedBanner as Banner };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAaSA,IAAI;AAAA,SACJC,gBAAgB;AACzB,SAASC,IAAI,QAAQ,OAAO;AAC5B,SAASC,cAAc,QAAQ,eAAe;AAAC,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAI/C,OAAO,MAAMC,gBAAgB,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU;AAC5D,OAAO,MAAMC,oBAAkC,GAAG,CAChD,SAAS,EACT,MAAM,EACN,SAAS,EACT,OAAO,CACR;AAkCD,MAAMC,MAAM,GAAGC,IAAA,IAQI;EAAA,IARH;IACdC,OAAO;IACPC,QAAQ;IACRC,OAAO;IACPC,IAAI;IACJC,QAAQ;IACRC,IAAI;IACJC;EACW,CAAC,GAAAP,IAAA;EACZ,MAAM;IAAEQ;EAAE,CAAC,GAAGhB,cAAc,CAAC,CAAC;EAE9B,OACEE,KAAA,CAAAe,MAAA;IACE,WAASF,MAAO;IAChBJ,OAAO,EAAEA,OAAQ;IACjBC,IAAI,EAAEA,IAAK;IACXC,QAAQ,EAAEA,QAAS;IACnBK,OAAO,EAAC,QAAQ;IAAAC,QAAA,GAEhBjB,KAAA,CAACJ,gBAAgB;MAAAqB,QAAA,GAAEH,CAAC,CAAE,YAAWH,QAAS,EAAC,CAAC,EAAC,GAAC;IAAA,CAAkB,CAAC,EACjET,IAAA,CAAAgB,WAAA;MAAAD,QAAA,EAAaL;IAAI,CAAa,CAAC,EAC9BL,OAAO,IACNL,IAAA,CAACP,IAAI;MAACwB,IAAI,EAAEZ,OAAQ;MAACS,OAAO,EAAC,YAAY;MAAAC,QAAA,EACtCT;IAAQ,CACL,CACP;EAAA,CACI,CAAC;AAEZ,CAAC;AAED,MAAMY,cAAc,GAAGvB,IAAI,CAACQ,MAAM,CAAC;AACnCe,cAAc,CAACC,WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAIf,MAAM"}
|
package/dist/Box.js
CHANGED
|
@@ -10,22 +10,26 @@ import _Box from "@mui/material/Box";
|
|
|
10
10
|
*
|
|
11
11
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
12
12
|
*/
|
|
13
|
-
import { forwardRef } from "react";
|
|
13
|
+
import { forwardRef, memo } from "react";
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
|
|
15
|
+
const Box = forwardRef((_ref, ref) => {
|
|
16
16
|
let {
|
|
17
17
|
children,
|
|
18
18
|
component,
|
|
19
19
|
id,
|
|
20
|
-
sx
|
|
20
|
+
sx,
|
|
21
|
+
testId
|
|
21
22
|
} = _ref;
|
|
22
23
|
return _jsx(_Box, {
|
|
23
24
|
ref: ref,
|
|
24
25
|
children: children,
|
|
25
26
|
component: component,
|
|
27
|
+
"data-se": testId,
|
|
26
28
|
id: id,
|
|
27
29
|
sx: sx
|
|
28
30
|
});
|
|
29
31
|
});
|
|
30
|
-
|
|
32
|
+
const MemoizedBox = memo(Box);
|
|
33
|
+
MemoizedBox.displayName = "Box";
|
|
34
|
+
export { MemoizedBox as Box };
|
|
31
35
|
//# sourceMappingURL=Box.js.map
|
package/dist/Box.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.js","names":["forwardRef","jsx","_jsx","Box","_ref","ref","children","component","id","sx","_Box","displayName"],"sources":["../src/Box.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 { Box as MuiBox, BoxProps as MuiBoxProps } from \"@mui/material\";\nimport { ReactNode, forwardRef } from \"react\";\n\nexport type BoxProps = {\n children?: ReactNode;\n component?: MuiBoxProps[\"component\"];\n id?: MuiBoxProps[\"id\"];\n sx?: MuiBoxProps[\"sx\"];\n};\n\
|
|
1
|
+
{"version":3,"file":"Box.js","names":["forwardRef","memo","jsx","_jsx","Box","_ref","ref","children","component","id","sx","testId","_Box","MemoizedBox","displayName"],"sources":["../src/Box.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 { Box as MuiBox, BoxProps as MuiBoxProps } from \"@mui/material\";\nimport { ReactNode, forwardRef, memo } from \"react\";\n\nimport type { SeleniumProps } from \"./SeleniumProps\";\n\nexport type BoxProps = {\n children?: ReactNode;\n component?: MuiBoxProps[\"component\"];\n id?: MuiBoxProps[\"id\"];\n sx?: MuiBoxProps[\"sx\"];\n} & SeleniumProps;\n\nconst Box = forwardRef<HTMLElement, BoxProps>(\n ({ children, component, id, sx, testId }, ref) => (\n <MuiBox\n ref={ref}\n children={children}\n component={component}\n data-se={testId}\n id={id}\n sx={sx}\n />\n )\n);\n\nconst MemoizedBox = memo(Box);\nMemoizedBox.displayName = \"Box\";\n\nexport { MemoizedBox as Box };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAAoBA,UAAU,EAAEC,IAAI,QAAQ,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAWpD,MAAMC,GAAG,GAAGJ,UAAU,CACpB,CAAAK,IAAA,EAA0CC,GAAG;EAAA,IAA5C;IAAEC,QAAQ;IAAEC,SAAS;IAAEC,EAAE;IAAEC,EAAE;IAAEC;EAAO,CAAC,GAAAN,IAAA;EAAA,OACtCF,IAAA,CAAAS,IAAA;IACEN,GAAG,EAAEA,GAAI;IACTC,QAAQ,EAAEA,QAAS;IACnBC,SAAS,EAAEA,SAAU;IACrB,WAASG,MAAO;IAChBF,EAAE,EAAEA,EAAG;IACPC,EAAE,EAAEA;EAAG,CACR,CAAC;AAAA,CAEN,CAAC;AAED,MAAMG,WAAW,GAAGZ,IAAI,CAACG,GAAG,CAAC;AAC7BS,WAAW,CAACC,WAAW,GAAG,KAAK;AAE/B,SAASD,WAAW,IAAIT,GAAG"}
|
package/dist/Button.js
CHANGED
|
@@ -32,6 +32,7 @@ const Button = _ref => {
|
|
|
32
32
|
onClick,
|
|
33
33
|
size = "medium",
|
|
34
34
|
startIcon,
|
|
35
|
+
testId,
|
|
35
36
|
tooltipText,
|
|
36
37
|
type = "button",
|
|
37
38
|
variant
|
|
@@ -42,6 +43,7 @@ const Button = _ref => {
|
|
|
42
43
|
"aria-label": ariaLabel,
|
|
43
44
|
"aria-labelledby": ariaLabelledBy,
|
|
44
45
|
"aria-describedby": ariaDescribedBy,
|
|
46
|
+
"data-se": testId,
|
|
45
47
|
disabled: isDisabled,
|
|
46
48
|
endIcon: endIcon,
|
|
47
49
|
fullWidth: isFullWidth,
|
|
@@ -52,7 +54,7 @@ const Button = _ref => {
|
|
|
52
54
|
type: type,
|
|
53
55
|
variant: variant,
|
|
54
56
|
children: label
|
|
55
|
-
}), [ariaDescribedBy, ariaLabel, ariaLabelledBy, endIcon, id, isDisabled, isFullWidth, label, onClick, size, startIcon, type, variant]);
|
|
57
|
+
}), [ariaDescribedBy, ariaLabel, ariaLabelledBy, endIcon, id, isDisabled, isFullWidth, label, onClick, size, startIcon, testId, type, variant]);
|
|
56
58
|
return _jsxs(_Fragment, {
|
|
57
59
|
children: [tooltipText && _jsx(Tooltip, {
|
|
58
60
|
ariaType: "description",
|
package/dist/Button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","names":["memo","useCallback","MuiPropsContext","useMuiProps","Tooltip","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","buttonSizeValues","buttonTypeValues","buttonVariantValues","Button","_ref","ariaDescribedBy","ariaLabel","ariaLabelledBy","endIcon","id","isDisabled","isFullWidth","label","onClick","size","startIcon","tooltipText","type","variant","muiProps","renderButton","_Button","disabled","fullWidth","children","ariaType","placement","text","Consumer","MemoizedButton","displayName"],"sources":["../src/Button.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Button as MuiButton } from \"@mui/material\";\nimport type { ButtonProps as MuiButtonProps } from \"@mui/material\";\nimport { memo, ReactElement, useCallback } from \"react\";\n\nimport { MuiPropsContext, useMuiProps } from \"./MuiPropsContext\";\nimport { Tooltip } from \"./Tooltip\";\n\nexport const buttonSizeValues = [\"small\", \"medium\", \"large\"] as const;\nexport const buttonTypeValues = [\"button\", \"submit\", \"reset\"] as const;\nexport const buttonVariantValues = [\n \"primary\",\n \"secondary\",\n \"tertiary\",\n \"danger\",\n \"floating\",\n] as const;\n\nexport type ButtonProps = {\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 icon element to display at the end of the Button\n */\n endIcon?: ReactElement;\n /**\n * The ID of the Button\n */\n id?: string;\n /**\n * Determines whether the Button is disabled\n */\n isDisabled?: boolean;\n /**\n * Determines whether the Button should take up the full available width\n */\n isFullWidth?: boolean;\n /**\n * The text content of the Button\n */\n label?: string;\n /**\n * The click event handler for the Button\n */\n onClick?: MuiButtonProps[\"onClick\"];\n /**\n * The size of the button\n */\n size?: (typeof buttonSizeValues)[number];\n /**\n * The icon element to display at the start of the Button\n */\n startIcon?: ReactElement;\n /**\n * The tooltip text for the Button if it's icon-only\n */\n tooltipText?: string;\n /**\n * The type of the HTML button element\n */\n type?: (typeof buttonTypeValues)[number];\n /**\n * The variant of the Button\n */\n variant: (typeof buttonVariantValues)[number];\n} & (\n | {\n endIcon?: ReactElement;\n label: string;\n startIcon?: ReactElement;\n }\n | {\n endIcon?: ReactElement;\n label?: \"\" | undefined;\n startIcon: ReactElement;\n }\n | {\n endIcon: ReactElement;\n label?: \"\" | undefined;\n startIcon?: ReactElement;\n }\n);\n\nconst Button = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n endIcon,\n id,\n isDisabled,\n isFullWidth,\n label = \"\",\n onClick,\n size = \"medium\",\n startIcon,\n tooltipText,\n type = \"button\",\n variant,\n}: ButtonProps) => {\n const muiProps = useMuiProps();\n\n const renderButton = useCallback(\n (muiProps) => (\n <MuiButton\n {...muiProps}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n disabled={isDisabled}\n endIcon={endIcon}\n fullWidth={isFullWidth}\n id={id}\n onClick={onClick}\n size={size}\n startIcon={startIcon}\n type={type}\n variant={variant}\n >\n {label}\n </MuiButton>\n ),\n [\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n endIcon,\n id,\n isDisabled,\n isFullWidth,\n label,\n onClick,\n size,\n startIcon,\n type,\n variant,\n ]\n );\n\n return (\n <>\n {tooltipText && (\n <Tooltip ariaType=\"description\" placement=\"top\" text={tooltipText}>\n <MuiPropsContext.Consumer>{renderButton}</MuiPropsContext.Consumer>\n </Tooltip>\n )}\n\n {!tooltipText && renderButton(muiProps)}\n </>\n );\n};\n\nconst MemoizedButton = memo(Button);\nMemoizedButton.displayName = \"Button\";\n\nexport { MemoizedButton as Button };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA,SAASA,IAAI,EAAgBC,WAAW,QAAQ,OAAO;AAAC,SAE/CC,eAAe,EAAEC,WAAW;AAAA,SAC5BC,OAAO;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;
|
|
1
|
+
{"version":3,"file":"Button.js","names":["memo","useCallback","MuiPropsContext","useMuiProps","Tooltip","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","buttonSizeValues","buttonTypeValues","buttonVariantValues","Button","_ref","ariaDescribedBy","ariaLabel","ariaLabelledBy","endIcon","id","isDisabled","isFullWidth","label","onClick","size","startIcon","testId","tooltipText","type","variant","muiProps","renderButton","_Button","disabled","fullWidth","children","ariaType","placement","text","Consumer","MemoizedButton","displayName"],"sources":["../src/Button.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Button as MuiButton } from \"@mui/material\";\nimport type { ButtonProps as MuiButtonProps } from \"@mui/material\";\nimport { memo, ReactElement, useCallback } from \"react\";\n\nimport { MuiPropsContext, useMuiProps } from \"./MuiPropsContext\";\nimport { Tooltip } from \"./Tooltip\";\nimport type { SeleniumProps } from \"./SeleniumProps\";\n\nexport const buttonSizeValues = [\"small\", \"medium\", \"large\"] as const;\nexport const buttonTypeValues = [\"button\", \"submit\", \"reset\"] as const;\nexport const buttonVariantValues = [\n \"primary\",\n \"secondary\",\n \"tertiary\",\n \"danger\",\n \"floating\",\n] as const;\n\nexport type ButtonProps = {\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 icon element to display at the end of the Button\n */\n endIcon?: ReactElement;\n /**\n * The ID of the Button\n */\n id?: string;\n /**\n * Determines whether the Button is disabled\n */\n isDisabled?: boolean;\n /**\n * Determines whether the Button should take up the full available width\n */\n isFullWidth?: boolean;\n /**\n * The text content of the Button\n */\n label?: string;\n /**\n * The click event handler for the Button\n */\n onClick?: MuiButtonProps[\"onClick\"];\n /**\n * The size of the button\n */\n size?: (typeof buttonSizeValues)[number];\n /**\n * The icon element to display at the start of the Button\n */\n startIcon?: ReactElement;\n /**\n * The tooltip text for the Button if it's icon-only\n */\n tooltipText?: string;\n /**\n * The type of the HTML button element\n */\n type?: (typeof buttonTypeValues)[number];\n /**\n * The variant of the Button\n */\n variant: (typeof buttonVariantValues)[number];\n} & (\n | {\n endIcon?: ReactElement;\n label: string;\n startIcon?: ReactElement;\n }\n | {\n endIcon?: ReactElement;\n label?: \"\" | undefined;\n startIcon: ReactElement;\n }\n | {\n endIcon: ReactElement;\n label?: \"\" | undefined;\n startIcon?: ReactElement;\n }\n) &\n SeleniumProps;\n\nconst Button = ({\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n endIcon,\n id,\n isDisabled,\n isFullWidth,\n label = \"\",\n onClick,\n size = \"medium\",\n startIcon,\n testId,\n tooltipText,\n type = \"button\",\n variant,\n}: ButtonProps) => {\n const muiProps = useMuiProps();\n\n const renderButton = useCallback(\n (muiProps) => (\n <MuiButton\n {...muiProps}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n data-se={testId}\n disabled={isDisabled}\n endIcon={endIcon}\n fullWidth={isFullWidth}\n id={id}\n onClick={onClick}\n size={size}\n startIcon={startIcon}\n type={type}\n variant={variant}\n >\n {label}\n </MuiButton>\n ),\n [\n ariaDescribedBy,\n ariaLabel,\n ariaLabelledBy,\n endIcon,\n id,\n isDisabled,\n isFullWidth,\n label,\n onClick,\n size,\n startIcon,\n testId,\n type,\n variant,\n ]\n );\n\n return (\n <>\n {tooltipText && (\n <Tooltip ariaType=\"description\" placement=\"top\" text={tooltipText}>\n <MuiPropsContext.Consumer>{renderButton}</MuiPropsContext.Consumer>\n </Tooltip>\n )}\n\n {!tooltipText && renderButton(muiProps)}\n </>\n );\n};\n\nconst MemoizedButton = memo(Button);\nMemoizedButton.displayName = \"Button\";\n\nexport { MemoizedButton as Button };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA,SAASA,IAAI,EAAgBC,WAAW,QAAQ,OAAO;AAAC,SAE/CC,eAAe,EAAEC,WAAW;AAAA,SAC5BC,OAAO;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAGhB,OAAO,MAAMC,gBAAgB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAU;AACrE,OAAO,MAAMC,gBAAgB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAU;AACtE,OAAO,MAAMC,mBAAmB,GAAG,CACjC,SAAS,EACT,WAAW,EACX,UAAU,EACV,QAAQ,EACR,UAAU,CACF;AA8EV,MAAMC,MAAM,GAAGC,IAAA,IAgBI;EAAA,IAhBH;IACdC,eAAe;IACfC,SAAS;IACTC,cAAc;IACdC,OAAO;IACPC,EAAE;IACFC,UAAU;IACVC,WAAW;IACXC,KAAK,GAAG,EAAE;IACVC,OAAO;IACPC,IAAI,GAAG,QAAQ;IACfC,SAAS;IACTC,MAAM;IACNC,WAAW;IACXC,IAAI,GAAG,QAAQ;IACfC;EACW,CAAC,GAAAf,IAAA;EACZ,MAAMgB,QAAQ,GAAG5B,WAAW,CAAC,CAAC;EAE9B,MAAM6B,YAAY,GAAG/B,WAAW,CAC7B8B,QAAQ,IACPzB,IAAA,CAAA2B,OAAA;IAAA,GACMF,QAAQ;IACZ,cAAYd,SAAU;IACtB,mBAAiBC,cAAe;IAChC,oBAAkBF,eAAgB;IAClC,WAASW,MAAO;IAChBO,QAAQ,EAAEb,UAAW;IACrBF,OAAO,EAAEA,OAAQ;IACjBgB,SAAS,EAAEb,WAAY;IACvBF,EAAE,EAAEA,EAAG;IACPI,OAAO,EAAEA,OAAQ;IACjBC,IAAI,EAAEA,IAAK;IACXC,SAAS,EAAEA,SAAU;IACrBG,IAAI,EAAEA,IAAK;IACXC,OAAO,EAAEA,OAAQ;IAAAM,QAAA,EAEhBb;EAAK,CACG,CACZ,EACD,CACEP,eAAe,EACfC,SAAS,EACTC,cAAc,EACdC,OAAO,EACPC,EAAE,EACFC,UAAU,EACVC,WAAW,EACXC,KAAK,EACLC,OAAO,EACPC,IAAI,EACJC,SAAS,EACTC,MAAM,EACNE,IAAI,EACJC,OAAO,CAEX,CAAC;EAED,OACEpB,KAAA,CAAAF,SAAA;IAAA4B,QAAA,GACGR,WAAW,IACVtB,IAAA,CAACF,OAAO;MAACiC,QAAQ,EAAC,aAAa;MAACC,SAAS,EAAC,KAAK;MAACC,IAAI,EAAEX,WAAY;MAAAQ,QAAA,EAChE9B,IAAA,CAACJ,eAAe,CAACsC,QAAQ;QAAAJ,QAAA,EAAEJ;MAAY,CAA2B;IAAC,CAC5D,CACV,EAEA,CAACJ,WAAW,IAAII,YAAY,CAACD,QAAQ,CAAC;EAAA,CACvC,CAAC;AAEP,CAAC;AAED,MAAMU,cAAc,GAAGzC,IAAI,CAACc,MAAM,CAAC;AACnC2B,cAAc,CAACC,WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAI3B,MAAM"}
|
package/dist/Callout.js
CHANGED
|
@@ -25,12 +25,14 @@ const Callout = _ref => {
|
|
|
25
25
|
children,
|
|
26
26
|
role,
|
|
27
27
|
severity,
|
|
28
|
+
testId,
|
|
28
29
|
title
|
|
29
30
|
} = _ref;
|
|
30
31
|
const {
|
|
31
32
|
t
|
|
32
33
|
} = useTranslation();
|
|
33
34
|
return _jsxs(_Alert, {
|
|
35
|
+
"data-se": testId,
|
|
34
36
|
role: role,
|
|
35
37
|
severity: severity,
|
|
36
38
|
variant: "callout",
|
package/dist/Callout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Callout.js","names":["memo","ScreenReaderText","useTranslation","jsxs","_jsxs","jsx","_jsx","calloutRoleValues","calloutSeverityValues","Callout","_ref","children","role","severity","title","t","_Alert","variant","_AlertTitle","_Box","component","MemoizedCallout","displayName"],"sources":["../src/Callout.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, ReactNode } from \"react\";\nimport { Alert, AlertTitle, Box } from \"@mui/material\";\nimport { ScreenReaderText } from \"./ScreenReaderText\";\nimport { useTranslation } from \"react-i18next\";\n\nexport const calloutRoleValues = [\"status\", \"alert\"] as const;\nexport const calloutSeverityValues = [\n \"success\",\n \"info\",\n \"warning\",\n \"error\",\n] as const;\n\nexport type CalloutProps = {\n /**\n * The contents of the Callout\n */\n children: ReactNode;\n /**\n * Sets the ARIA role of the Callout\n * (\"status\" for something that dynamically updates, \"alert\" for errors, null for something\n * unchanging)\n */\n role?: (typeof calloutRoleValues)[number];\n /**\n * Determine the color and icon of the Callout\n */\n severity: (typeof calloutSeverityValues)[number];\n /**\n * The title of the Callout\n */\n title?: string;\n};\n\nconst Callout = ({ children, role, severity, title }: CalloutProps) => {\n const { t } = useTranslation();\n\n return (\n <Alert role={role} severity={severity} variant=\"callout\">\n <ScreenReaderText>{t(`severity.${severity}`)}: </ScreenReaderText>\n {title && <AlertTitle>{title}</AlertTitle>}\n <Box component=\"div\">{children}</Box>\n </Alert>\n );\n};\n\nconst MemoizedCallout = memo(Callout);\nMemoizedCallout.displayName = \"Callout\";\n\nexport { MemoizedCallout as Callout };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAmB,OAAO;AAAC,SAE/BC,gBAAgB;AACzB,SAASC,cAAc,QAAQ,eAAe;AAAC,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,GAAA,IAAAC,IAAA;
|
|
1
|
+
{"version":3,"file":"Callout.js","names":["memo","ScreenReaderText","useTranslation","jsxs","_jsxs","jsx","_jsx","calloutRoleValues","calloutSeverityValues","Callout","_ref","children","role","severity","testId","title","t","_Alert","variant","_AlertTitle","_Box","component","MemoizedCallout","displayName"],"sources":["../src/Callout.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, ReactNode } from \"react\";\nimport { Alert, AlertTitle, Box } from \"@mui/material\";\nimport { ScreenReaderText } from \"./ScreenReaderText\";\nimport { useTranslation } from \"react-i18next\";\n\nimport type { SeleniumProps } from \"./SeleniumProps\";\n\nexport const calloutRoleValues = [\"status\", \"alert\"] as const;\nexport const calloutSeverityValues = [\n \"success\",\n \"info\",\n \"warning\",\n \"error\",\n] as const;\n\nexport type CalloutProps = {\n /**\n * The contents of the Callout\n */\n children: ReactNode;\n /**\n * Sets the ARIA role of the Callout\n * (\"status\" for something that dynamically updates, \"alert\" for errors, null for something\n * unchanging)\n */\n role?: (typeof calloutRoleValues)[number];\n /**\n * Determine the color and icon of the Callout\n */\n severity: (typeof calloutSeverityValues)[number];\n /**\n * The title of the Callout\n */\n title?: string;\n} & SeleniumProps;\n\nconst Callout = ({ children, role, severity, testId, title }: CalloutProps) => {\n const { t } = useTranslation();\n\n return (\n <Alert data-se={testId} role={role} severity={severity} variant=\"callout\">\n <ScreenReaderText>{t(`severity.${severity}`)}: </ScreenReaderText>\n {title && <AlertTitle>{title}</AlertTitle>}\n <Box component=\"div\">{children}</Box>\n </Alert>\n );\n};\n\nconst MemoizedCallout = memo(Callout);\nMemoizedCallout.displayName = \"Callout\";\n\nexport { MemoizedCallout as Callout };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAmB,OAAO;AAAC,SAE/BC,gBAAgB;AACzB,SAASC,cAAc,QAAQ,eAAe;AAAC,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAI/C,OAAO,MAAMC,iBAAiB,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU;AAC7D,OAAO,MAAMC,qBAAqB,GAAG,CACnC,SAAS,EACT,MAAM,EACN,SAAS,EACT,OAAO,CACC;AAuBV,MAAMC,OAAO,GAAGC,IAAA,IAA+D;EAAA,IAA9D;IAAEC,QAAQ;IAAEC,IAAI;IAAEC,QAAQ;IAAEC,MAAM;IAAEC;EAAoB,CAAC,GAAAL,IAAA;EACxE,MAAM;IAAEM;EAAE,CAAC,GAAGd,cAAc,CAAC,CAAC;EAE9B,OACEE,KAAA,CAAAa,MAAA;IAAO,WAASH,MAAO;IAACF,IAAI,EAAEA,IAAK;IAACC,QAAQ,EAAEA,QAAS;IAACK,OAAO,EAAC,SAAS;IAAAP,QAAA,GACvEP,KAAA,CAACH,gBAAgB;MAAAU,QAAA,GAAEK,CAAC,CAAE,YAAWH,QAAS,EAAC,CAAC,EAAC,IAAE;IAAA,CAAkB,CAAC,EACjEE,KAAK,IAAIT,IAAA,CAAAa,WAAA;MAAAR,QAAA,EAAaI;IAAK,CAAa,CAAC,EAC1CT,IAAA,CAAAc,IAAA;MAAKC,SAAS,EAAC,KAAK;MAAAV,QAAA,EAAEA;IAAQ,CAAM,CAAC;EAAA,CAChC,CAAC;AAEZ,CAAC;AAED,MAAMW,eAAe,GAAGtB,IAAI,CAACS,OAAO,CAAC;AACrCa,eAAe,CAACC,WAAW,GAAG,SAAS;AAEvC,SAASD,eAAe,IAAIb,OAAO"}
|
package/dist/Checkbox.js
CHANGED
|
@@ -22,13 +22,15 @@ const Checkbox = _ref => {
|
|
|
22
22
|
let {
|
|
23
23
|
ariaLabel,
|
|
24
24
|
ariaLabelledBy,
|
|
25
|
+
id: idOverride,
|
|
25
26
|
isDefaultChecked = false,
|
|
26
27
|
isDisabled,
|
|
27
28
|
isIndeterminate,
|
|
28
29
|
isRequired,
|
|
29
30
|
label: labelProp,
|
|
30
|
-
name,
|
|
31
|
+
name: nameOverride,
|
|
31
32
|
onChange: onChangeProp,
|
|
33
|
+
testId,
|
|
32
34
|
validity = "inherit",
|
|
33
35
|
value
|
|
34
36
|
} = _ref;
|
|
@@ -64,9 +66,11 @@ const Checkbox = _ref => {
|
|
|
64
66
|
indeterminate: isIndeterminate,
|
|
65
67
|
required: isRequired
|
|
66
68
|
}),
|
|
69
|
+
"data-se": testId,
|
|
67
70
|
disabled: isDisabled,
|
|
71
|
+
id: idOverride,
|
|
68
72
|
label: label,
|
|
69
|
-
name:
|
|
73
|
+
name: nameOverride ?? idOverride,
|
|
70
74
|
onChange: onChange,
|
|
71
75
|
value: value,
|
|
72
76
|
required: isRequired
|
package/dist/Checkbox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","names":["Typography","memo","useCallback","useMemo","useState","useTranslation","jsxs","_jsxs","Fragment","_Fragment","jsx","_jsx","checkboxValidityValues","Checkbox","_ref","ariaLabel","ariaLabelledBy","isDefaultChecked","isDisabled","isIndeterminate","isRequired","label","labelProp","name","onChange","onChangeProp","validity","value","t","isCheckedValue","setIsCheckedValue","children","component","color","event","checked","target","_FormControlLabel","className","control","_Checkbox","indeterminate","required","disabled","MemoizedCheckbox","displayName"],"sources":["../src/Checkbox.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 Checkbox as MuiCheckbox,\n CheckboxProps as MuiCheckboxProps,\n FormControlLabel,\n} from \"@mui/material\";\nimport { Typography } from \"./Typography\";\nimport { memo, useCallback, useMemo, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nexport const checkboxValidityValues = [\"valid\", \"invalid\", \"inherit\"] as const;\n\nexport type CheckboxProps = {\n /**\n * The ARIA label for the Checkbox\n */\n ariaLabel?: string;\n /**\n * The ID of the element that labels the Checkbox\n */\n ariaLabelledBy?: string;\n /**\n * Determines whether the Checkbox is checked\n */\n isDefaultChecked?: boolean;\n /**\n * Determines whether the Checkbox is disabled\n */\n isDisabled?: boolean;\n /**\n * Determines whether the Checkbox is in an indeterminate state\n */\n isIndeterminate?: boolean;\n /**\n * Determines whether the Checkbox is required\n */\n isRequired?: boolean;\n /**\n * The label text for the Checkbox\n */\n label?: string;\n /**\n * The name
|
|
1
|
+
{"version":3,"file":"Checkbox.js","names":["Typography","memo","useCallback","useMemo","useState","useTranslation","jsxs","_jsxs","Fragment","_Fragment","jsx","_jsx","checkboxValidityValues","Checkbox","_ref","ariaLabel","ariaLabelledBy","id","idOverride","isDefaultChecked","isDisabled","isIndeterminate","isRequired","label","labelProp","name","nameOverride","onChange","onChangeProp","testId","validity","value","t","isCheckedValue","setIsCheckedValue","children","component","color","event","checked","target","_FormControlLabel","className","control","_Checkbox","indeterminate","required","disabled","MemoizedCheckbox","displayName"],"sources":["../src/Checkbox.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 Checkbox as MuiCheckbox,\n CheckboxProps as MuiCheckboxProps,\n FormControlLabel,\n} from \"@mui/material\";\nimport { Typography } from \"./Typography\";\nimport { memo, useCallback, useMemo, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport type { SeleniumProps } from \"./SeleniumProps\";\n\nexport const checkboxValidityValues = [\"valid\", \"invalid\", \"inherit\"] as const;\n\nexport type CheckboxProps = {\n /**\n * The ARIA label for the Checkbox\n */\n ariaLabel?: string;\n /**\n * The ID of the element that labels the Checkbox\n */\n ariaLabelledBy?: string;\n /**\n * The id of the `input` element.\n */\n id?: string;\n /**\n * Determines whether the Checkbox is checked\n */\n isDefaultChecked?: boolean;\n /**\n * Determines whether the Checkbox is disabled\n */\n isDisabled?: boolean;\n /**\n * Determines whether the Checkbox is in an indeterminate state\n */\n isIndeterminate?: boolean;\n /**\n * Determines whether the Checkbox is required\n */\n isRequired?: boolean;\n /**\n * The label text for the Checkbox\n */\n label?: string;\n /**\n * The name of the `input` element. Defaults to the `id` if not set.\n */\n name?: string;\n /**\n * The change event handler for the Checkbox\n */\n onChange?: MuiCheckboxProps[\"onChange\"];\n /**\n * The checkbox validity, if different from its enclosing group. Defaults to \"inherit\".\n */\n validity?: (typeof checkboxValidityValues)[number];\n /**\n * The value attribute of the Checkbox\n */\n value?: string;\n} & SeleniumProps;\n\nconst Checkbox = ({\n ariaLabel,\n ariaLabelledBy,\n id: idOverride,\n isDefaultChecked = false,\n isDisabled,\n isIndeterminate,\n isRequired,\n label: labelProp,\n name: nameOverride,\n onChange: onChangeProp,\n testId,\n validity = \"inherit\",\n value,\n}: CheckboxProps) => {\n const { t } = useTranslation();\n const [isCheckedValue, setIsCheckedValue] = useState(isDefaultChecked);\n\n const label = useMemo(() => {\n if (isRequired) {\n return (\n <>\n {labelProp}{\" \"}\n <Typography component=\"span\" color=\"textSecondary\">\n ({t(\"fieldlabel.required.text\")})\n </Typography>\n </>\n );\n } else {\n return <>{labelProp}</>;\n }\n }, [isRequired, labelProp, t]);\n\n const onChange = useCallback(\n (event, checked) => {\n setIsCheckedValue(event.target.checked);\n onChangeProp?.(event, checked);\n },\n [onChangeProp]\n );\n\n return (\n <FormControlLabel\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n checked={isCheckedValue}\n className={\n validity === \"invalid\"\n ? \"Mui-error\"\n : validity === \"valid\"\n ? \"Mui-valid\"\n : \"\"\n }\n control={\n <MuiCheckbox indeterminate={isIndeterminate} required={isRequired} />\n }\n data-se={testId}\n disabled={isDisabled}\n id={idOverride}\n label={label}\n name={nameOverride ?? idOverride}\n onChange={onChange}\n value={value}\n required={isRequired}\n />\n );\n};\n\nconst MemoizedCheckbox = memo(Checkbox);\nMemoizedCheckbox.displayName = \"Checkbox\";\n\nexport { MemoizedCheckbox as Checkbox };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAiBSA,UAAU;AACnB,SAASC,IAAI,EAAEC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAC5D,SAASC,cAAc,QAAQ,eAAe;AAAC,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAI/C,OAAO,MAAMC,sBAAsB,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,CAAU;AAqD9E,MAAMC,QAAQ,GAAGC,IAAA,IAcI;EAAA,IAdH;IAChBC,SAAS;IACTC,cAAc;IACdC,EAAE,EAAEC,UAAU;IACdC,gBAAgB,GAAG,KAAK;IACxBC,UAAU;IACVC,eAAe;IACfC,UAAU;IACVC,KAAK,EAAEC,SAAS;IAChBC,IAAI,EAAEC,YAAY;IAClBC,QAAQ,EAAEC,YAAY;IACtBC,MAAM;IACNC,QAAQ,GAAG,SAAS;IACpBC;EACa,CAAC,GAAAjB,IAAA;EACd,MAAM;IAAEkB;EAAE,CAAC,GAAG3B,cAAc,CAAC,CAAC;EAC9B,MAAM,CAAC4B,cAAc,EAAEC,iBAAiB,CAAC,GAAG9B,QAAQ,CAACe,gBAAgB,CAAC;EAEtE,MAAMI,KAAK,GAAGpB,OAAO,CAAC,MAAM;IAC1B,IAAImB,UAAU,EAAE;MACd,OACEf,KAAA,CAAAE,SAAA;QAAA0B,QAAA,GACGX,SAAS,EAAE,GAAG,EACfjB,KAAA,CAACP,UAAU;UAACoC,SAAS,EAAC,MAAM;UAACC,KAAK,EAAC,eAAe;UAAAF,QAAA,GAAC,GAChD,EAACH,CAAC,CAAC,0BAA0B,CAAC,EAAC,GAClC;QAAA,CAAY,CAAC;MAAA,CACb,CAAC;IAEP,CAAC,MAAM;MACL,OAAOrB,IAAA,CAAAF,SAAA;QAAA0B,QAAA,EAAGX;MAAS,CAAG,CAAC;IACzB;EACF,CAAC,EAAE,CAACF,UAAU,EAAEE,SAAS,EAAEQ,CAAC,CAAC,CAAC;EAE9B,MAAML,QAAQ,GAAGzB,WAAW,CAC1B,CAACoC,KAAK,EAAEC,OAAO,KAAK;IAClBL,iBAAiB,CAACI,KAAK,CAACE,MAAM,CAACD,OAAO,CAAC;IACvCX,YAAY,GAAGU,KAAK,EAAEC,OAAO,CAAC;EAChC,CAAC,EACD,CAACX,YAAY,CACf,CAAC;EAED,OACEjB,IAAA,CAAA8B,iBAAA;IACE,cAAY1B,SAAU;IACtB,mBAAiBC,cAAe;IAChCuB,OAAO,EAAEN,cAAe;IACxBS,SAAS,EACPZ,QAAQ,KAAK,SAAS,GAClB,WAAW,GACXA,QAAQ,KAAK,OAAO,GACpB,WAAW,GACX,EACL;IACDa,OAAO,EACLhC,IAAA,CAAAiC,SAAA;MAAaC,aAAa,EAAExB,eAAgB;MAACyB,QAAQ,EAAExB;IAAW,CAAE,CACrE;IACD,WAASO,MAAO;IAChBkB,QAAQ,EAAE3B,UAAW;IACrBH,EAAE,EAAEC,UAAW;IACfK,KAAK,EAAEA,KAAM;IACbE,IAAI,EAAEC,YAAY,IAAIR,UAAW;IACjCS,QAAQ,EAAEA,QAAS;IACnBI,KAAK,EAAEA,KAAM;IACbe,QAAQ,EAAExB;EAAW,CACtB,CAAC;AAEN,CAAC;AAED,MAAM0B,gBAAgB,GAAG/C,IAAI,CAACY,QAAQ,CAAC;AACvCmC,gBAAgB,CAACC,WAAW,GAAG,UAAU;AAEzC,SAASD,gBAAgB,IAAInC,QAAQ"}
|
package/dist/CheckboxGroup.js
CHANGED
|
@@ -18,28 +18,26 @@ const CheckboxGroup = _ref => {
|
|
|
18
18
|
children,
|
|
19
19
|
errorMessage,
|
|
20
20
|
hint,
|
|
21
|
-
id: idOverride,
|
|
22
21
|
isDisabled,
|
|
23
22
|
isRequired = false,
|
|
24
|
-
label
|
|
23
|
+
label,
|
|
24
|
+
testId
|
|
25
25
|
} = _ref;
|
|
26
26
|
const renderFieldComponent = useCallback(_ref2 => {
|
|
27
27
|
let {
|
|
28
|
-
ariaDescribedBy
|
|
29
|
-
id
|
|
28
|
+
ariaDescribedBy
|
|
30
29
|
} = _ref2;
|
|
31
30
|
return _jsx(_FormGroup, {
|
|
32
31
|
"aria-describedby": ariaDescribedBy,
|
|
33
|
-
|
|
32
|
+
"data-se": testId,
|
|
34
33
|
children: children
|
|
35
34
|
});
|
|
36
|
-
}, [children]);
|
|
35
|
+
}, [children, testId]);
|
|
37
36
|
return _jsx(Field, {
|
|
38
37
|
errorMessage: errorMessage,
|
|
39
38
|
fieldType: "group",
|
|
40
39
|
hasVisibleLabel: true,
|
|
41
40
|
hint: hint,
|
|
42
|
-
id: idOverride,
|
|
43
41
|
isDisabled: isDisabled,
|
|
44
42
|
isOptional: !isRequired,
|
|
45
43
|
label: label,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxGroup.js","names":["memo","useCallback","Field","jsx","_jsx","CheckboxGroup","_ref","children","errorMessage","hint","
|
|
1
|
+
{"version":3,"file":"CheckboxGroup.js","names":["memo","useCallback","Field","jsx","_jsx","CheckboxGroup","_ref","children","errorMessage","hint","isDisabled","isRequired","label","testId","renderFieldComponent","_ref2","ariaDescribedBy","_FormGroup","fieldType","hasVisibleLabel","isOptional","MemoizedCheckboxGroup","displayName"],"sources":["../src/CheckboxGroup.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 { FormGroup as MuiFormGroup } from \"@mui/material\";\nimport { memo, ReactElement, useCallback } from \"react\";\n\nimport { Checkbox } from \"./Checkbox\";\nimport { Field } from \"./Field\";\nimport type { SeleniumProps } from \"./SeleniumProps\";\n\nexport type CheckboxGroupProps = {\n /**\n * A single Checkbox element or an array of Checkbox elements\n */\n children:\n | ReactElement<typeof Checkbox>\n | Array<ReactElement<typeof Checkbox>>;\n /**\n * The error message for the CheckboxGroup\n */\n errorMessage?: string;\n /**\n * The hint text for the CheckboxGroup\n */\n hint?: string;\n /**\n * If `true`, the CheckboxGroup is disabled\n */\n isDisabled?: boolean;\n /**\n * If `true`, the CheckboxGroup is required\n */\n isRequired?: boolean;\n /**\n * The label text for the CheckboxGroup\n */\n label: string;\n} & SeleniumProps;\n\nconst CheckboxGroup = ({\n children,\n errorMessage,\n hint,\n isDisabled,\n isRequired = false,\n label,\n testId,\n}: CheckboxGroupProps) => {\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy }) => (\n <MuiFormGroup aria-describedby={ariaDescribedBy} data-se={testId}>\n {children}\n </MuiFormGroup>\n ),\n [children, testId]\n );\n\n return (\n <Field\n errorMessage={errorMessage}\n fieldType=\"group\"\n hasVisibleLabel={true}\n hint={hint}\n isDisabled={isDisabled}\n isOptional={!isRequired}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n};\n\nconst MemoizedCheckboxGroup = memo(CheckboxGroup);\nMemoizedCheckboxGroup.displayName = \"CheckboxGroup\";\n\nexport { MemoizedCheckboxGroup as CheckboxGroup };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAI,EAAgBC,WAAW,QAAQ,OAAO;AAAC,SAG/CC,KAAK;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAgCd,MAAMC,aAAa,GAAGC,IAAA,IAQI;EAAA,IARH;IACrBC,QAAQ;IACRC,YAAY;IACZC,IAAI;IACJC,UAAU;IACVC,UAAU,GAAG,KAAK;IAClBC,KAAK;IACLC;EACkB,CAAC,GAAAP,IAAA;EACnB,MAAMQ,oBAAoB,GAAGb,WAAW,CACtCc,KAAA;IAAA,IAAC;MAAEC;IAAgB,CAAC,GAAAD,KAAA;IAAA,OAClBX,IAAA,CAAAa,UAAA;MAAc,oBAAkBD,eAAgB;MAAC,WAASH,MAAO;MAAAN,QAAA,EAC9DA;IAAQ,CACG,CAAC;EAAA,CAChB,EACD,CAACA,QAAQ,EAAEM,MAAM,CACnB,CAAC;EAED,OACET,IAAA,CAACF,KAAK;IACJM,YAAY,EAAEA,YAAa;IAC3BU,SAAS,EAAC,OAAO;IACjBC,eAAe,EAAE,IAAK;IACtBV,IAAI,EAAEA,IAAK;IACXC,UAAU,EAAEA,UAAW;IACvBU,UAAU,EAAE,CAACT,UAAW;IACxBC,KAAK,EAAEA,KAAM;IACbE,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CAAC;AAED,MAAMO,qBAAqB,GAAGrB,IAAI,CAACK,aAAa,CAAC;AACjDgB,qBAAqB,CAACC,WAAW,GAAG,eAAe;AAEnD,SAASD,qBAAqB,IAAIhB,aAAa"}
|
package/dist/CircularProgress.js
CHANGED
|
@@ -14,9 +14,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
14
14
|
export const CircularProgress = _ref => {
|
|
15
15
|
let {
|
|
16
16
|
ariaLabel,
|
|
17
|
+
testId,
|
|
17
18
|
value
|
|
18
19
|
} = _ref;
|
|
19
20
|
return _jsx(_CircularProgress, {
|
|
21
|
+
"data-se": testId,
|
|
20
22
|
value: value,
|
|
21
23
|
variant: value ? "determinate" : "indeterminate",
|
|
22
24
|
"aria-label": ariaLabel
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CircularProgress.js","names":["jsx","_jsx","CircularProgress","_ref","ariaLabel","value","_CircularProgress","variant"],"sources":["../src/CircularProgress.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 { CircularProgress as MuiCircularProgress } from \"@mui/material\";\n\nexport type CircularProgressProps = {\n /**\n * The ARIA label for the progress spinner\n */\n ariaLabel?: string;\n /**\n * The percentage filled the spinner should be, as an integer.\n * If undefined, the spinner will spin perpetually.\n */\n value?: number;\n};\n\nexport const CircularProgress = ({\n ariaLabel,\n value,\n}: CircularProgressProps) => (\n <MuiCircularProgress\n value={value}\n variant={value ? \"determinate\" : \"indeterminate\"}\n aria-label={ariaLabel}\n />\n);\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAAAA,GAAA,IAAAC,IAAA;
|
|
1
|
+
{"version":3,"file":"CircularProgress.js","names":["jsx","_jsx","CircularProgress","_ref","ariaLabel","testId","value","_CircularProgress","variant"],"sources":["../src/CircularProgress.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 { CircularProgress as MuiCircularProgress } from \"@mui/material\";\n\nimport type { SeleniumProps } from \"./SeleniumProps\";\n\nexport type CircularProgressProps = {\n /**\n * The ARIA label for the progress spinner\n */\n ariaLabel?: string;\n /**\n * The percentage filled the spinner should be, as an integer.\n * If undefined, the spinner will spin perpetually.\n */\n value?: number;\n} & SeleniumProps;\n\nexport const CircularProgress = ({\n ariaLabel,\n testId,\n value,\n}: CircularProgressProps) => (\n <MuiCircularProgress\n data-se={testId}\n value={value}\n variant={value ? \"determinate\" : \"indeterminate\"}\n aria-label={ariaLabel}\n />\n);\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAAAA,GAAA,IAAAC,IAAA;AA4BA,OAAO,MAAMC,gBAAgB,GAAGC,IAAA;EAAA,IAAC;IAC/BC,SAAS;IACTC,MAAM;IACNC;EACqB,CAAC,GAAAH,IAAA;EAAA,OACtBF,IAAA,CAAAM,iBAAA;IACE,WAASF,MAAO;IAChBC,KAAK,EAAEA,KAAM;IACbE,OAAO,EAAEF,KAAK,GAAG,aAAa,GAAG,eAAgB;IACjD,cAAYF;EAAU,CACvB,CAAC;AAAA,CACH"}
|
package/dist/Dialog.js
CHANGED
|
@@ -27,6 +27,7 @@ const Dialog = _ref => {
|
|
|
27
27
|
children,
|
|
28
28
|
isOpen,
|
|
29
29
|
onClose,
|
|
30
|
+
testId,
|
|
30
31
|
title,
|
|
31
32
|
ariaLabel
|
|
32
33
|
} = _ref;
|
|
@@ -52,6 +53,7 @@ const Dialog = _ref => {
|
|
|
52
53
|
children: children
|
|
53
54
|
}) : children;
|
|
54
55
|
return _jsxs(_Dialog, {
|
|
56
|
+
"data-se": testId,
|
|
55
57
|
open: isOpen,
|
|
56
58
|
onClose: onClose,
|
|
57
59
|
children: [_jsxs(_DialogTitle, {
|
package/dist/Dialog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","names":["Button","CloseIcon","memo","useState","useEffect","useRef","jsx","_jsx","jsxs","_jsxs","Dialog","_ref","callToActionFirstComponent","callToActionSecondComponent","callToActionLastComponent","children","isOpen","onClose","title","ariaLabel","isContentScrollable","setIsContentScrollable","dialogContentRef","frameId","handleContentScroll","dialogContentElement","current","scrollHeight","clientHeight","requestAnimationFrame","cancelAnimationFrame","content","_DialogContentText","_Dialog","open","_DialogTitle","label","onClick","size","startIcon","variant","_DialogContent","dividers","ref","_DialogActions","MemoizedDialog","displayName"],"sources":["../src/Dialog.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 { Dialog as MuiDialog } from \"@mui/material\";\nimport {\n DialogTitle,\n DialogContent,\n DialogContentText,\n DialogActions,\n} from \"@mui/material\";\nimport { Button } from \"./Button\";\nimport { CloseIcon } from \"./icons.generated\";\nimport {\n memo,\n ReactNode,\n useState,\n useEffect,\n useRef,\n ReactElement,\n} from \"react\";\n\nexport type DialogProps = {\n /**\n * An optional Button object to be situated in the Dialog footer. Should almost always be of variant `primary`.\n */\n callToActionFirstComponent?: ReactElement<typeof Button>;\n /**\n * An optional Button object to be situated in the Dialog footer, alongside the `callToActionPrimaryComponent`.\n */\n callToActionSecondComponent?: ReactElement<typeof Button>;\n /**\n * An optional Button object to be situated in the Dialog footer, alongside the other two `callToAction` components.\n */\n callToActionLastComponent?: ReactElement<typeof Button>;\n /**\n * The content of the Dialog. May be a `string` or any other `ReactNode` or array of `ReactNode`s.\n */\n children: ReactNode;\n /**\n * When set to `true`, the Dialog will be visible.\n */\n isOpen: boolean;\n /**\n * Callback that controls what happens when the Dialog is dismissed\n */\n onClose: () => void;\n /**\n * The title of the Dialog\n */\n title: string;\n ariaLabel: string;\n};\n\nconst Dialog = ({\n callToActionFirstComponent,\n callToActionSecondComponent,\n callToActionLastComponent,\n children,\n isOpen,\n onClose,\n title,\n ariaLabel,\n}: DialogProps) => {\n const [isContentScrollable, setIsContentScrollable] = useState(false);\n const dialogContentRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n let frameId: number;\n\n const handleContentScroll = () => {\n const dialogContentElement = dialogContentRef.current;\n if (dialogContentElement) {\n setIsContentScrollable(\n dialogContentElement.scrollHeight > dialogContentElement.clientHeight\n );\n }\n frameId = requestAnimationFrame(handleContentScroll);\n };\n\n if (isOpen) {\n frameId = requestAnimationFrame(handleContentScroll);\n }\n\n return () => {\n cancelAnimationFrame(frameId);\n };\n }, [isOpen]);\n\n const content =\n typeof children === \"string\" ? (\n <DialogContentText>{children}</DialogContentText>\n ) : (\n children\n );\n\n return (\n <MuiDialog open={isOpen} onClose={onClose}>\n <DialogTitle>\n {title}\n <Button\n ariaLabel={ariaLabel}\n label=\"\"\n onClick={onClose}\n size=\"small\"\n startIcon={<CloseIcon />}\n variant=\"floating\"\n />\n </DialogTitle>\n <DialogContent dividers={isContentScrollable} ref={dialogContentRef}>\n {content}\n </DialogContent>\n\n {(callToActionFirstComponent ||\n callToActionSecondComponent ||\n callToActionLastComponent) && (\n <DialogActions>\n {callToActionLastComponent}\n {callToActionSecondComponent}\n {callToActionFirstComponent}\n </DialogActions>\n )}\n </MuiDialog>\n );\n};\n\nconst MemoizedDialog = memo(Dialog);\nMemoizedDialog.displayName = \"Dialog\";\n\nexport { MemoizedDialog as Dialog };\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAmBSA,MAAM;AAAA,SACNC,SAAS;AAClB,SACEC,IAAI,EAEJC,QAAQ,EACRC,SAAS,EACTC,MAAM,QAED,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;
|
|
1
|
+
{"version":3,"file":"Dialog.js","names":["Button","CloseIcon","memo","useState","useEffect","useRef","jsx","_jsx","jsxs","_jsxs","Dialog","_ref","callToActionFirstComponent","callToActionSecondComponent","callToActionLastComponent","children","isOpen","onClose","testId","title","ariaLabel","isContentScrollable","setIsContentScrollable","dialogContentRef","frameId","handleContentScroll","dialogContentElement","current","scrollHeight","clientHeight","requestAnimationFrame","cancelAnimationFrame","content","_DialogContentText","_Dialog","open","_DialogTitle","label","onClick","size","startIcon","variant","_DialogContent","dividers","ref","_DialogActions","MemoizedDialog","displayName"],"sources":["../src/Dialog.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 { Dialog as MuiDialog } from \"@mui/material\";\nimport {\n DialogTitle,\n DialogContent,\n DialogContentText,\n DialogActions,\n} from \"@mui/material\";\nimport { Button } from \"./Button\";\nimport { CloseIcon } from \"./icons.generated\";\nimport {\n memo,\n ReactNode,\n useState,\n useEffect,\n useRef,\n ReactElement,\n} from \"react\";\n\nimport type { SeleniumProps } from \"./SeleniumProps\";\n\nexport type DialogProps = {\n /**\n * An optional Button object to be situated in the Dialog footer. Should almost always be of variant `primary`.\n */\n callToActionFirstComponent?: ReactElement<typeof Button>;\n /**\n * An optional Button object to be situated in the Dialog footer, alongside the `callToActionPrimaryComponent`.\n */\n callToActionSecondComponent?: ReactElement<typeof Button>;\n /**\n * An optional Button object to be situated in the Dialog footer, alongside the other two `callToAction` components.\n */\n callToActionLastComponent?: ReactElement<typeof Button>;\n /**\n * The content of the Dialog. May be a `string` or any other `ReactNode` or array of `ReactNode`s.\n */\n children: ReactNode;\n /**\n * When set to `true`, the Dialog will be visible.\n */\n isOpen: boolean;\n /**\n * Callback that controls what happens when the Dialog is dismissed\n */\n onClose: () => void;\n /**\n * The title of the Dialog\n */\n title: string;\n ariaLabel: string;\n} & SeleniumProps;\n\nconst Dialog = ({\n callToActionFirstComponent,\n callToActionSecondComponent,\n callToActionLastComponent,\n children,\n isOpen,\n onClose,\n testId,\n title,\n ariaLabel,\n}: DialogProps) => {\n const [isContentScrollable, setIsContentScrollable] = useState(false);\n const dialogContentRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n let frameId: number;\n\n const handleContentScroll = () => {\n const dialogContentElement = dialogContentRef.current;\n if (dialogContentElement) {\n setIsContentScrollable(\n dialogContentElement.scrollHeight > dialogContentElement.clientHeight\n );\n }\n frameId = requestAnimationFrame(handleContentScroll);\n };\n\n if (isOpen) {\n frameId = requestAnimationFrame(handleContentScroll);\n }\n\n return () => {\n cancelAnimationFrame(frameId);\n };\n }, [isOpen]);\n\n const content =\n typeof children === \"string\" ? (\n <DialogContentText>{children}</DialogContentText>\n ) : (\n children\n );\n\n return (\n <MuiDialog data-se={testId} open={isOpen} onClose={onClose}>\n <DialogTitle>\n {title}\n <Button\n ariaLabel={ariaLabel}\n label=\"\"\n onClick={onClose}\n size=\"small\"\n startIcon={<CloseIcon />}\n variant=\"floating\"\n />\n </DialogTitle>\n <DialogContent dividers={isContentScrollable} ref={dialogContentRef}>\n {content}\n </DialogContent>\n\n {(callToActionFirstComponent ||\n callToActionSecondComponent ||\n callToActionLastComponent) && (\n <DialogActions>\n {callToActionLastComponent}\n {callToActionSecondComponent}\n {callToActionFirstComponent}\n </DialogActions>\n )}\n </MuiDialog>\n );\n};\n\nconst MemoizedDialog = memo(Dialog);\nMemoizedDialog.displayName = \"Dialog\";\n\nexport { MemoizedDialog as Dialog };\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAmBSA,MAAM;AAAA,SACNC,SAAS;AAClB,SACEC,IAAI,EAEJC,QAAQ,EACRC,SAAS,EACTC,MAAM,QAED,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAoCf,MAAMC,MAAM,GAAGC,IAAA,IAUI;EAAA,IAVH;IACdC,0BAA0B;IAC1BC,2BAA2B;IAC3BC,yBAAyB;IACzBC,QAAQ;IACRC,MAAM;IACNC,OAAO;IACPC,MAAM;IACNC,KAAK;IACLC;EACW,CAAC,GAAAT,IAAA;EACZ,MAAM,CAACU,mBAAmB,EAAEC,sBAAsB,CAAC,GAAGnB,QAAQ,CAAC,KAAK,CAAC;EACrE,MAAMoB,gBAAgB,GAAGlB,MAAM,CAAiB,IAAI,CAAC;EAErDD,SAAS,CAAC,MAAM;IACd,IAAIoB,OAAe;IAEnB,MAAMC,mBAAmB,GAAGA,CAAA,KAAM;MAChC,MAAMC,oBAAoB,GAAGH,gBAAgB,CAACI,OAAO;MACrD,IAAID,oBAAoB,EAAE;QACxBJ,sBAAsB,CACpBI,oBAAoB,CAACE,YAAY,GAAGF,oBAAoB,CAACG,YAC3D,CAAC;MACH;MACAL,OAAO,GAAGM,qBAAqB,CAACL,mBAAmB,CAAC;IACtD,CAAC;IAED,IAAIT,MAAM,EAAE;MACVQ,OAAO,GAAGM,qBAAqB,CAACL,mBAAmB,CAAC;IACtD;IAEA,OAAO,MAAM;MACXM,oBAAoB,CAACP,OAAO,CAAC;IAC/B,CAAC;EACH,CAAC,EAAE,CAACR,MAAM,CAAC,CAAC;EAEZ,MAAMgB,OAAO,GACX,OAAOjB,QAAQ,KAAK,QAAQ,GAC1BR,IAAA,CAAA0B,kBAAA;IAAAlB,QAAA,EAAoBA;EAAQ,CAAoB,CAAC,GAEjDA,QACD;EAEH,OACEN,KAAA,CAAAyB,OAAA;IAAW,WAAShB,MAAO;IAACiB,IAAI,EAAEnB,MAAO;IAACC,OAAO,EAAEA,OAAQ;IAAAF,QAAA,GACzDN,KAAA,CAAA2B,YAAA;MAAArB,QAAA,GACGI,KAAK,EACNZ,IAAA,CAACP,MAAM;QACLoB,SAAS,EAAEA,SAAU;QACrBiB,KAAK,EAAC,EAAE;QACRC,OAAO,EAAErB,OAAQ;QACjBsB,IAAI,EAAC,OAAO;QACZC,SAAS,EAAEjC,IAAA,CAACN,SAAS,IAAE,CAAE;QACzBwC,OAAO,EAAC;MAAU,CACnB,CAAC;IAAA,CACS,CAAC,EACdlC,IAAA,CAAAmC,cAAA;MAAeC,QAAQ,EAAEtB,mBAAoB;MAACuB,GAAG,EAAErB,gBAAiB;MAAAR,QAAA,EACjEiB;IAAO,CACK,CAAC,EAEf,CAACpB,0BAA0B,IAC1BC,2BAA2B,IAC3BC,yBAAyB,KACzBL,KAAA,CAAAoC,cAAA;MAAA9B,QAAA,GACGD,yBAAyB,EACzBD,2BAA2B,EAC3BD,0BAA0B;IAAA,CACd,CAChB;EAAA,CACQ,CAAC;AAEhB,CAAC;AAED,MAAMkC,cAAc,GAAG5C,IAAI,CAACQ,MAAM,CAAC;AACnCoC,cAAc,CAACC,WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAIpC,MAAM"}
|