@okta/odyssey-react-mui 1.27.1 → 1.29.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 +25 -0
- package/dist/Breadcrumbs.js +1 -0
- package/dist/Breadcrumbs.js.map +1 -1
- package/dist/{Button.js → Buttons/BaseButton.js} +11 -10
- package/dist/Buttons/BaseButton.js.map +1 -0
- package/dist/{MenuButton.js → Buttons/BaseMenuButton.js} +30 -10
- package/dist/Buttons/BaseMenuButton.js.map +1 -0
- package/dist/Buttons/Button.js +24 -0
- package/dist/Buttons/Button.js.map +1 -0
- package/dist/Buttons/ButtonContext.js.map +1 -0
- package/dist/Buttons/MenuButton.js +25 -0
- package/dist/Buttons/MenuButton.js.map +1 -0
- package/dist/Buttons/MenuContext.js.map +1 -0
- package/dist/{MenuItem.js → Buttons/MenuItem.js} +1 -0
- package/dist/Buttons/MenuItem.js.map +1 -0
- package/dist/Buttons/index.js +18 -0
- package/dist/{labs/UiShell → Buttons}/index.js.map +1 -1
- package/dist/Card.js +1 -2
- package/dist/Card.js.map +1 -1
- package/dist/Checkbox.js +62 -35
- package/dist/Checkbox.js.map +1 -1
- package/dist/DataTable/DataTable.js +1 -2
- package/dist/DataTable/DataTable.js.map +1 -1
- package/dist/DataTable/DataTableRowActions.js +1 -2
- package/dist/DataTable/DataTableRowActions.js.map +1 -1
- package/dist/DataTable/DataTableSettings.js +1 -2
- package/dist/DataTable/DataTableSettings.js.map +1 -1
- package/dist/DataTable/reorderDataRowsLocally.js.map +1 -1
- package/dist/DataTable/useRowReordering.js.map +1 -1
- package/dist/Dialog.js +1 -1
- package/dist/Dialog.js.map +1 -1
- package/dist/Drawer.js +1 -1
- package/dist/Drawer.js.map +1 -1
- package/dist/FileUploader/FileUploader.js +1 -1
- package/dist/FileUploader/FileUploader.js.map +1 -1
- package/dist/Form.js.map +1 -1
- package/dist/HtmlProps.js.map +1 -1
- package/dist/Pagination/Pagination.js +3 -2
- package/dist/Pagination/Pagination.js.map +1 -1
- package/dist/Radio.js +65 -38
- package/dist/Radio.js.map +1 -1
- package/dist/Toast.js +1 -1
- package/dist/Toast.js.map +1 -1
- package/dist/Typography.js +20 -0
- package/dist/Typography.js.map +1 -1
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/index.scss +1 -1
- package/dist/labs/AppSwitcher/AppSwitcher.js +76 -0
- package/dist/labs/AppSwitcher/AppSwitcher.js.map +1 -0
- package/dist/labs/AppSwitcher/AppSwitcherApp.js +112 -0
- package/dist/labs/AppSwitcher/AppSwitcherApp.js.map +1 -0
- package/dist/labs/{SideNav → AppSwitcher}/OktaAura.js +16 -3
- package/dist/labs/AppSwitcher/OktaAura.js.map +1 -0
- package/dist/{src/labs/UiShell/useHasUiShell.d.ts → labs/AppSwitcher/index.js} +2 -2
- package/dist/labs/AppSwitcher/index.js.map +1 -0
- package/dist/labs/AppTile.js +102 -65
- package/dist/labs/AppTile.js.map +1 -1
- package/dist/labs/DataFilters.js +10 -6
- package/dist/labs/DataFilters.js.map +1 -1
- package/dist/labs/DataTable.js +7 -7
- package/dist/labs/DataTable.js.map +1 -1
- package/dist/labs/DataTablePagination.js +1 -1
- package/dist/labs/DataTablePagination.js.map +1 -1
- package/dist/labs/DataView/BulkActionsMenu.js +1 -2
- package/dist/labs/DataView/BulkActionsMenu.js.map +1 -1
- package/dist/labs/DataView/CardLayoutContent.js +6 -5
- package/dist/labs/DataView/CardLayoutContent.js.map +1 -1
- package/dist/labs/DataView/DataCard.js +54 -42
- package/dist/labs/DataView/DataCard.js.map +1 -1
- package/dist/labs/DataView/DataTable.js.map +1 -1
- package/dist/labs/DataView/DataView.js +3 -3
- package/dist/labs/DataView/DataView.js.map +1 -1
- package/dist/labs/DataView/DetailPanel.js.map +1 -1
- package/dist/labs/DataView/LayoutSwitcher.js +1 -2
- package/dist/labs/DataView/LayoutSwitcher.js.map +1 -1
- package/dist/labs/DataView/RowActions.js +1 -1
- package/dist/labs/DataView/RowActions.js.map +1 -1
- package/dist/labs/DataView/TableLayoutContent.js +2 -3
- package/dist/labs/DataView/TableLayoutContent.js.map +1 -1
- package/dist/labs/DataView/TableSettings.js +1 -2
- package/dist/labs/DataView/TableSettings.js.map +1 -1
- package/dist/labs/DataView/componentTypes.js.map +1 -1
- package/dist/labs/DataView/dataTypes.js.map +1 -1
- package/dist/labs/DataView/fetchData.js.map +1 -1
- package/dist/labs/DataView/testSupportData.js +201 -0
- package/dist/labs/DataView/testSupportData.js.map +1 -0
- package/dist/labs/DataView/useFilterConversion.js.map +1 -1
- package/dist/labs/{DateField.js → DatePickers/DateField.js} +1 -1
- package/dist/labs/DatePickers/DateField.js.map +1 -0
- package/dist/labs/DatePickers/DateFieldActionBar.js +56 -0
- package/dist/labs/DatePickers/DateFieldActionBar.js.map +1 -0
- package/dist/labs/DatePickers/DateFieldLocalizationProvider.js +32 -0
- package/dist/labs/DatePickers/DateFieldLocalizationProvider.js.map +1 -0
- package/dist/labs/{DatePicker.js → DatePickers/DatePicker.js} +30 -73
- package/dist/labs/DatePickers/DatePicker.js.map +1 -0
- package/dist/labs/DatePickers/DatePicker.types.d.js.map +1 -0
- package/dist/labs/DatePickers/DateTimeField.js +166 -0
- package/dist/labs/DatePickers/DateTimeField.js.map +1 -0
- package/dist/labs/DatePickers/DateTimePicker.js +233 -0
- package/dist/labs/DatePickers/DateTimePicker.js.map +1 -0
- package/dist/labs/{datePickerTheme.js → DatePickers/datePickerTheme.js} +2 -2
- package/dist/labs/DatePickers/datePickerTheme.js.map +1 -0
- package/dist/labs/DatePickers/dateTimePickerTheme.js +230 -0
- package/dist/labs/DatePickers/dateTimePickerTheme.js.map +1 -0
- package/dist/labs/DatePickers/index.js +15 -0
- package/dist/labs/DatePickers/index.js.map +1 -0
- package/dist/labs/DatePickers/useDateFieldsTranslations.js.map +1 -0
- package/dist/labs/{useOdysseyDateFields.js → DatePickers/useOdysseyDateFields.js} +36 -3
- package/dist/labs/DatePickers/useOdysseyDateFields.js.map +1 -0
- package/dist/labs/PageTemplate.js +1 -1
- package/dist/labs/PageTemplate.js.map +1 -1
- package/dist/labs/SideNav/SideNav.js +45 -38
- package/dist/labs/SideNav/SideNav.js.map +1 -1
- package/dist/labs/SideNav/SideNavHeader.js +6 -4
- package/dist/labs/SideNav/SideNavHeader.js.map +1 -1
- package/dist/labs/SideNav/SideNavItemContent.js +11 -11
- package/dist/labs/SideNav/SideNavItemContent.js.map +1 -1
- package/dist/labs/SideNav/SideNavToggleButton.js +1 -1
- package/dist/labs/SideNav/SideNavToggleButton.js.map +1 -1
- package/dist/labs/SideNav/types.js.map +1 -1
- package/dist/labs/TimeZonePicker.js.map +1 -1
- package/dist/labs/TopNav/UserProfile.js +16 -3
- package/dist/labs/TopNav/UserProfile.js.map +1 -1
- package/dist/labs/TopNav/UserProfileMenuButton.js +41 -0
- package/dist/labs/TopNav/UserProfileMenuButton.js.map +1 -0
- package/dist/labs/TopNav/index.js +1 -0
- package/dist/labs/TopNav/index.js.map +1 -1
- package/dist/labs/index.js +2 -3
- package/dist/labs/index.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/Breadcrumbs.d.ts.map +1 -1
- package/dist/src/{Button.d.ts → Buttons/BaseButton.d.ts} +12 -34
- package/dist/src/Buttons/BaseButton.d.ts.map +1 -0
- package/dist/src/{MenuButton.d.ts → Buttons/BaseMenuButton.d.ts} +37 -14
- package/dist/src/Buttons/BaseMenuButton.d.ts.map +1 -0
- package/dist/src/Buttons/Button.d.ts +16 -0
- package/dist/src/Buttons/Button.d.ts.map +1 -0
- package/dist/src/Buttons/ButtonContext.d.ts.map +1 -0
- package/dist/src/Buttons/MenuButton.d.ts +17 -0
- package/dist/src/Buttons/MenuButton.d.ts.map +1 -0
- package/dist/src/Buttons/MenuContext.d.ts.map +1 -0
- package/dist/src/{MenuItem.d.ts → Buttons/MenuItem.d.ts} +1 -1
- package/dist/src/Buttons/MenuItem.d.ts.map +1 -0
- package/dist/src/Buttons/index.d.ts +18 -0
- package/dist/src/Buttons/index.d.ts.map +1 -0
- package/dist/src/Card.d.ts +1 -2
- package/dist/src/Card.d.ts.map +1 -1
- package/dist/src/Checkbox.d.ts.map +1 -1
- package/dist/src/DataTable/DataTable.d.ts +1 -1
- package/dist/src/DataTable/DataTable.d.ts.map +1 -1
- package/dist/src/DataTable/DataTableRowActions.d.ts +1 -2
- package/dist/src/DataTable/DataTableRowActions.d.ts.map +1 -1
- package/dist/src/DataTable/DataTableSettings.d.ts.map +1 -1
- package/dist/src/DataTable/reorderDataRowsLocally.d.ts +3 -3
- package/dist/src/DataTable/reorderDataRowsLocally.d.ts.map +1 -1
- package/dist/src/DataTable/useRowReordering.d.ts +10 -10
- package/dist/src/DataTable/useRowReordering.d.ts.map +1 -1
- package/dist/src/Dialog.d.ts +1 -1
- package/dist/src/Dialog.d.ts.map +1 -1
- package/dist/src/Drawer.d.ts +1 -1
- package/dist/src/Drawer.d.ts.map +1 -1
- package/dist/src/Form.d.ts +1 -1
- package/dist/src/Form.d.ts.map +1 -1
- package/dist/src/HtmlProps.d.ts +27 -0
- package/dist/src/HtmlProps.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/Radio.d.ts +1 -1
- package/dist/src/Radio.d.ts.map +1 -1
- package/dist/src/Typography.d.ts +11 -11
- package/dist/src/Typography.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/labs/AppSwitcher/AppSwitcher.d.ts +20 -0
- package/dist/src/labs/AppSwitcher/AppSwitcher.d.ts.map +1 -0
- package/dist/src/labs/AppSwitcher/AppSwitcherApp.d.ts +24 -0
- package/dist/src/labs/AppSwitcher/AppSwitcherApp.d.ts.map +1 -0
- package/dist/src/labs/AppSwitcher/OktaAura.d.ts.map +1 -0
- package/dist/src/labs/AppSwitcher/index.d.ts +13 -0
- package/dist/src/labs/AppSwitcher/index.d.ts.map +1 -0
- package/dist/src/labs/AppTile.d.ts +6 -4
- package/dist/src/labs/AppTile.d.ts.map +1 -1
- package/dist/src/labs/DataFilters.d.ts.map +1 -1
- package/dist/src/labs/DataTable.d.ts +12 -12
- package/dist/src/labs/DataTable.d.ts.map +1 -1
- package/dist/src/labs/DataView/BulkActionsMenu.d.ts +3 -3
- package/dist/src/labs/DataView/BulkActionsMenu.d.ts.map +1 -1
- package/dist/src/labs/DataView/CardLayoutContent.d.ts +18 -15
- package/dist/src/labs/DataView/CardLayoutContent.d.ts.map +1 -1
- package/dist/src/labs/DataView/DataCard.d.ts +8 -6
- package/dist/src/labs/DataView/DataCard.d.ts.map +1 -1
- package/dist/src/labs/DataView/DataTable.d.ts +6 -2
- package/dist/src/labs/DataView/DataTable.d.ts.map +1 -1
- package/dist/src/labs/DataView/DataView.d.ts +6 -2
- package/dist/src/labs/DataView/DataView.d.ts.map +1 -1
- package/dist/src/labs/DataView/DetailPanel.d.ts +5 -5
- package/dist/src/labs/DataView/DetailPanel.d.ts.map +1 -1
- package/dist/src/labs/DataView/LayoutSwitcher.d.ts.map +1 -1
- package/dist/src/labs/DataView/RowActions.d.ts +4 -5
- package/dist/src/labs/DataView/RowActions.d.ts.map +1 -1
- package/dist/src/labs/DataView/TableLayoutContent.d.ts +18 -15
- package/dist/src/labs/DataView/TableLayoutContent.d.ts.map +1 -1
- package/dist/src/labs/DataView/TableSettings.d.ts +7 -3
- package/dist/src/labs/DataView/TableSettings.d.ts.map +1 -1
- package/dist/src/labs/DataView/componentTypes.d.ts +17 -17
- package/dist/src/labs/DataView/componentTypes.d.ts.map +1 -1
- package/dist/src/labs/DataView/dataTypes.d.ts +6 -6
- package/dist/src/labs/DataView/dataTypes.d.ts.map +1 -1
- package/dist/src/labs/DataView/fetchData.d.ts +6 -6
- package/dist/src/labs/DataView/fetchData.d.ts.map +1 -1
- package/dist/src/labs/DataView/testSupportData.d.ts +33 -0
- package/dist/src/labs/DataView/testSupportData.d.ts.map +1 -0
- package/dist/src/labs/DataView/useFilterConversion.d.ts +5 -4
- package/dist/src/labs/DataView/useFilterConversion.d.ts.map +1 -1
- package/dist/src/labs/{DateField.d.ts → DatePickers/DateField.d.ts} +1 -1
- package/dist/src/labs/DatePickers/DateField.d.ts.map +1 -0
- package/dist/src/labs/DatePickers/DateFieldActionBar.d.ts +15 -0
- package/dist/src/labs/DatePickers/DateFieldActionBar.d.ts.map +1 -0
- package/dist/src/labs/DatePickers/DateFieldLocalizationProvider.d.ts +20 -0
- package/dist/src/labs/DatePickers/DateFieldLocalizationProvider.d.ts.map +1 -0
- package/dist/src/labs/DatePickers/DatePicker.d.ts +17 -0
- package/dist/src/labs/DatePickers/DatePicker.d.ts.map +1 -0
- package/dist/src/labs/DatePickers/DateTimeField.d.ts +20 -0
- package/dist/src/labs/DatePickers/DateTimeField.d.ts.map +1 -0
- package/dist/src/labs/DatePickers/DateTimePicker.d.ts +17 -0
- package/dist/src/labs/DatePickers/DateTimePicker.d.ts.map +1 -0
- package/dist/src/labs/DatePickers/datePickerTheme.d.ts +22 -0
- package/dist/src/labs/DatePickers/datePickerTheme.d.ts.map +1 -0
- package/dist/src/labs/{datePickerTheme.d.ts → DatePickers/dateTimePickerTheme.d.ts} +2 -2
- package/dist/src/labs/DatePickers/dateTimePickerTheme.d.ts.map +1 -0
- package/dist/src/labs/DatePickers/index.d.ts +15 -0
- package/dist/src/labs/DatePickers/index.d.ts.map +1 -0
- package/dist/src/labs/DatePickers/useDateFieldsTranslations.d.ts.map +1 -0
- package/dist/src/labs/{useOdysseyDateFields.d.ts → DatePickers/useOdysseyDateFields.d.ts} +49 -6
- package/dist/src/labs/DatePickers/useOdysseyDateFields.d.ts.map +1 -0
- package/dist/src/labs/SideNav/SideNav.d.ts.map +1 -1
- package/dist/src/labs/SideNav/SideNavHeader.d.ts.map +1 -1
- package/dist/src/labs/SideNav/SideNavItemContent.d.ts +1 -1
- package/dist/src/labs/SideNav/SideNavItemContent.d.ts.map +1 -1
- package/dist/src/labs/SideNav/types.d.ts +2 -2
- package/dist/src/labs/SideNav/types.d.ts.map +1 -1
- package/dist/src/labs/TimeZonePicker.d.ts +4 -1
- package/dist/src/labs/TimeZonePicker.d.ts.map +1 -1
- package/dist/src/labs/TopNav/UserProfile.d.ts +5 -1
- package/dist/src/labs/TopNav/UserProfile.d.ts.map +1 -1
- package/dist/src/labs/TopNav/UserProfileMenuButton.d.ts +17 -0
- package/dist/src/labs/TopNav/UserProfileMenuButton.d.ts.map +1 -0
- package/dist/src/labs/TopNav/index.d.ts +1 -0
- package/dist/src/labs/TopNav/index.d.ts.map +1 -1
- package/dist/src/labs/index.d.ts +2 -3
- package/dist/src/labs/index.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.map +1 -1
- package/dist/src/theme/mixins.d.ts.map +1 -1
- package/dist/src/theme/mixins.types.d.ts +2 -0
- package/dist/src/theme/mixins.types.d.ts.map +1 -1
- package/dist/src/{labs → ui-shell}/UiShell/UiShell.d.ts +2 -2
- package/dist/src/ui-shell/UiShell/UiShell.d.ts.map +1 -0
- package/dist/src/ui-shell/UiShell/UiShellContent.d.ts +68 -0
- package/dist/src/ui-shell/UiShell/UiShellContent.d.ts.map +1 -0
- package/dist/src/ui-shell/UiShell/bufferLatest.d.ts.map +1 -0
- package/dist/src/ui-shell/UiShell/createMessageBus.d.ts.map +1 -0
- package/dist/src/ui-shell/UiShell/createStore.d.ts.map +1 -0
- package/dist/src/ui-shell/UiShell/index.d.ts.map +1 -0
- package/dist/src/{labs → ui-shell}/UiShell/renderUiShell.d.ts +3 -4
- package/dist/src/ui-shell/UiShell/renderUiShell.d.ts.map +1 -0
- package/dist/src/ui-shell/UiShell/useHasUiShell.d.ts +14 -0
- package/dist/src/ui-shell/UiShell/useHasUiShell.d.ts.map +1 -0
- package/dist/src/ui-shell/UiShell/useScrollState.d.ts.map +1 -0
- package/dist/src/ui-shell/index.d.ts +14 -0
- package/dist/src/ui-shell/index.d.ts.map +1 -0
- package/dist/src/{web-component → ui-shell}/renderReactInWebComponent.d.ts +1 -21
- package/dist/src/ui-shell/renderReactInWebComponent.d.ts.map +1 -0
- package/dist/src/web-component/index.d.ts +0 -1
- package/dist/src/web-component/index.d.ts.map +1 -1
- package/dist/src/web-component/shadow-dom.d.ts +23 -2
- package/dist/src/web-component/shadow-dom.d.ts.map +1 -1
- package/dist/theme/components.js +62 -30
- package/dist/theme/components.js.map +1 -1
- package/dist/theme/mixins.js +2 -1
- package/dist/theme/mixins.js.map +1 -1
- package/dist/theme/mixins.types.js.map +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/dist/{labs → ui-shell}/UiShell/UiShell.js +8 -5
- package/dist/ui-shell/UiShell/UiShell.js.map +1 -0
- package/dist/{labs → ui-shell}/UiShell/UiShellContent.js +64 -16
- package/dist/ui-shell/UiShell/UiShellContent.js.map +1 -0
- package/dist/ui-shell/UiShell/bufferLatest.js.map +1 -0
- package/dist/ui-shell/UiShell/createMessageBus.js.map +1 -0
- package/dist/ui-shell/UiShell/createStore.js.map +1 -0
- package/dist/ui-shell/UiShell/index.js.map +1 -0
- package/dist/{labs → ui-shell}/UiShell/renderUiShell.js +8 -2
- package/dist/ui-shell/UiShell/renderUiShell.js.map +1 -0
- package/dist/{labs → ui-shell}/UiShell/useHasUiShell.js +1 -1
- package/dist/ui-shell/UiShell/useHasUiShell.js.map +1 -0
- package/dist/ui-shell/UiShell/useScrollState.js.map +1 -0
- package/dist/ui-shell/index.js +14 -0
- package/dist/ui-shell/index.js.map +1 -0
- package/dist/{web-component → ui-shell}/renderReactInWebComponent.js +1 -12
- package/dist/ui-shell/renderReactInWebComponent.js.map +1 -0
- package/dist/web-component/index.js +0 -1
- package/dist/web-component/index.js.map +1 -1
- package/dist/web-component/shadow-dom.js +12 -2
- package/dist/web-component/shadow-dom.js.map +1 -1
- package/package.json +10 -3
- package/src/Breadcrumbs.tsx +5 -1
- package/src/{Button.tsx → Buttons/BaseButton.tsx} +48 -68
- package/src/{MenuButton.tsx → Buttons/BaseMenuButton.tsx} +94 -32
- package/src/Buttons/Button.tsx +30 -0
- package/src/Buttons/MenuButton.tsx +35 -0
- package/src/{MenuItem.tsx → Buttons/MenuItem.tsx} +2 -1
- package/src/Buttons/index.ts +22 -0
- package/src/Card.tsx +1 -3
- package/src/Checkbox.tsx +86 -44
- package/src/DataTable/DataTable.tsx +1 -2
- package/src/DataTable/DataTableRowActions.tsx +1 -3
- package/src/DataTable/DataTableSettings.tsx +1 -2
- package/src/DataTable/reorderDataRowsLocally.tsx +3 -3
- package/src/DataTable/useRowReordering.tsx +16 -23
- package/src/Dialog.tsx +1 -1
- package/src/Drawer.tsx +1 -1
- package/src/FileUploader/FileUploader.tsx +1 -1
- package/src/Form.tsx +1 -1
- package/src/HtmlProps.ts +27 -0
- package/src/Pagination/Pagination.test.tsx +58 -36
- package/src/Pagination/Pagination.tsx +3 -3
- package/src/Radio.tsx +78 -39
- package/src/Toast.tsx +1 -1
- package/src/Typography.tsx +26 -1
- package/src/index.ts +1 -3
- package/src/labs/AppSwitcher/AppSwitcher.tsx +94 -0
- package/src/labs/AppSwitcher/AppSwitcherApp.tsx +146 -0
- package/src/labs/{SideNav → AppSwitcher}/OktaAura.tsx +19 -4
- package/src/labs/AppSwitcher/index.ts +13 -0
- package/src/labs/AppTile.tsx +171 -85
- package/src/labs/DataFilters.tsx +8 -4
- package/src/labs/DataTable.tsx +42 -34
- package/src/labs/DataTablePagination.tsx +1 -1
- package/src/labs/DataView/BulkActionsMenu.tsx +5 -6
- package/src/labs/DataView/CardLayoutContent.tsx +34 -28
- package/src/labs/DataView/DataCard.tsx +69 -37
- package/src/labs/DataView/DataTable.tsx +11 -4
- package/src/labs/DataView/DataView.test.tsx +1012 -87
- package/src/labs/DataView/DataView.tsx +19 -12
- package/src/labs/DataView/DetailPanel.tsx +4 -4
- package/src/labs/DataView/LayoutSwitcher.tsx +1 -2
- package/src/labs/DataView/RowActions.tsx +5 -7
- package/src/labs/DataView/TableLayoutContent.tsx +31 -26
- package/src/labs/DataView/TableSettings.tsx +13 -8
- package/src/labs/DataView/componentTypes.ts +17 -17
- package/src/labs/DataView/dataTypes.ts +14 -8
- package/src/labs/DataView/fetchData.ts +9 -7
- package/src/labs/DataView/testSupportData.tsx +301 -0
- package/src/labs/DataView/useFilterConversion.ts +8 -8
- package/src/labs/{DateField.tsx → DatePickers/DateField.tsx} +2 -2
- package/src/labs/DatePickers/DateFieldActionBar.tsx +65 -0
- package/src/labs/DatePickers/DateFieldLocalizationProvider.tsx +46 -0
- package/src/labs/{DatePicker.tsx → DatePickers/DatePicker.tsx} +31 -136
- package/src/labs/DatePickers/DateTimeField.tsx +271 -0
- package/src/labs/DatePickers/DateTimePicker.test.tsx +66 -0
- package/src/labs/DatePickers/DateTimePicker.tsx +303 -0
- package/src/labs/{datePickerTheme.tsx → DatePickers/datePickerTheme.tsx} +2 -2
- package/src/labs/DatePickers/dateTimePickerTheme.ts +213 -0
- package/src/labs/DatePickers/index.ts +15 -0
- package/src/labs/{useOdysseyDateFields.ts → DatePickers/useOdysseyDateFields.ts} +112 -10
- package/src/labs/PageTemplate.tsx +1 -1
- package/src/labs/SideNav/SideNav.tsx +48 -43
- package/src/labs/SideNav/SideNavHeader.tsx +6 -4
- package/src/labs/SideNav/SideNavItemContent.tsx +21 -18
- package/src/labs/SideNav/SideNavToggleButton.tsx +1 -1
- package/src/labs/SideNav/types.ts +2 -2
- package/src/labs/TimeZonePicker.tsx +5 -1
- package/src/labs/TopNav/UserProfile.tsx +26 -2
- package/src/labs/TopNav/UserProfileMenuButton.tsx +57 -0
- package/src/labs/TopNav/index.ts +1 -0
- package/src/labs/index.ts +3 -3
- 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 -31
- package/src/theme/mixins.ts +1 -0
- package/src/theme/mixins.types.ts +2 -0
- package/src/{labs → ui-shell}/UiShell/UiShell.test.tsx +23 -38
- package/src/{labs → ui-shell}/UiShell/UiShell.tsx +17 -6
- package/src/ui-shell/UiShell/UiShellContent.tsx +268 -0
- package/src/{labs → ui-shell}/UiShell/renderUiShell.test.tsx +1 -1
- package/src/{labs → ui-shell}/UiShell/renderUiShell.tsx +14 -4
- package/src/{labs → ui-shell}/UiShell/useHasUiShell.ts +1 -1
- package/src/ui-shell/index.ts +14 -0
- package/src/{web-component → ui-shell}/renderReactInWebComponent.test.tsx +1 -1
- package/src/{web-component → ui-shell}/renderReactInWebComponent.ts +4 -35
- package/src/web-component/index.ts +0 -1
- package/src/web-component/shadow-dom.ts +36 -3
- package/dist/Button.js.map +0 -1
- package/dist/ButtonContext.js.map +0 -1
- package/dist/MenuButton.js.map +0 -1
- package/dist/MenuContext.js.map +0 -1
- package/dist/MenuItem.js.map +0 -1
- package/dist/labs/DateField.js.map +0 -1
- package/dist/labs/DatePicker.js.map +0 -1
- package/dist/labs/DatePicker.types.d.js.map +0 -1
- package/dist/labs/SideNav/OktaAura.js.map +0 -1
- package/dist/labs/UiShell/UiShell.js.map +0 -1
- package/dist/labs/UiShell/UiShellContent.js.map +0 -1
- package/dist/labs/UiShell/bufferLatest.js.map +0 -1
- package/dist/labs/UiShell/createMessageBus.js.map +0 -1
- package/dist/labs/UiShell/createStore.js.map +0 -1
- package/dist/labs/UiShell/renderUiShell.js.map +0 -1
- package/dist/labs/UiShell/useHasUiShell.js.map +0 -1
- package/dist/labs/UiShell/useScrollState.js.map +0 -1
- package/dist/labs/datePickerTheme.js.map +0 -1
- package/dist/labs/useDateFieldsTranslations.js.map +0 -1
- package/dist/labs/useOdysseyDateFields.js.map +0 -1
- package/dist/src/Button.d.ts.map +0 -1
- package/dist/src/ButtonContext.d.ts.map +0 -1
- package/dist/src/MenuButton.d.ts.map +0 -1
- package/dist/src/MenuContext.d.ts.map +0 -1
- package/dist/src/MenuItem.d.ts.map +0 -1
- package/dist/src/labs/DateField.d.ts.map +0 -1
- package/dist/src/labs/DatePicker.d.ts +0 -47
- package/dist/src/labs/DatePicker.d.ts.map +0 -1
- package/dist/src/labs/SideNav/OktaAura.d.ts.map +0 -1
- package/dist/src/labs/UiShell/UiShell.d.ts.map +0 -1
- package/dist/src/labs/UiShell/UiShellContent.d.ts +0 -47
- package/dist/src/labs/UiShell/UiShellContent.d.ts.map +0 -1
- package/dist/src/labs/UiShell/bufferLatest.d.ts.map +0 -1
- package/dist/src/labs/UiShell/createMessageBus.d.ts.map +0 -1
- package/dist/src/labs/UiShell/createStore.d.ts.map +0 -1
- package/dist/src/labs/UiShell/index.d.ts.map +0 -1
- package/dist/src/labs/UiShell/renderUiShell.d.ts.map +0 -1
- package/dist/src/labs/UiShell/useHasUiShell.d.ts.map +0 -1
- package/dist/src/labs/UiShell/useScrollState.d.ts.map +0 -1
- package/dist/src/labs/datePickerTheme.d.ts.map +0 -1
- package/dist/src/labs/useDateFieldsTranslations.d.ts.map +0 -1
- package/dist/src/labs/useOdysseyDateFields.d.ts.map +0 -1
- package/dist/src/web-component/renderReactInWebComponent.d.ts.map +0 -1
- package/dist/web-component/renderReactInWebComponent.js.map +0 -1
- package/src/labs/UiShell/UiShellContent.tsx +0 -170
- /package/dist/{ButtonContext.js → Buttons/ButtonContext.js} +0 -0
- /package/dist/{MenuContext.js → Buttons/MenuContext.js} +0 -0
- /package/dist/labs/{DatePicker.types.d.js → DatePickers/DatePicker.types.d.js} +0 -0
- /package/dist/labs/{useDateFieldsTranslations.js → DatePickers/useDateFieldsTranslations.js} +0 -0
- /package/dist/src/{ButtonContext.d.ts → Buttons/ButtonContext.d.ts} +0 -0
- /package/dist/src/{MenuContext.d.ts → Buttons/MenuContext.d.ts} +0 -0
- /package/dist/src/labs/{SideNav → AppSwitcher}/OktaAura.d.ts +0 -0
- /package/dist/src/labs/{useDateFieldsTranslations.d.ts → DatePickers/useDateFieldsTranslations.d.ts} +0 -0
- /package/dist/src/{labs → ui-shell}/UiShell/bufferLatest.d.ts +0 -0
- /package/dist/src/{labs → ui-shell}/UiShell/createMessageBus.d.ts +0 -0
- /package/dist/src/{labs → ui-shell}/UiShell/createStore.d.ts +0 -0
- /package/dist/src/{labs → ui-shell}/UiShell/index.d.ts +0 -0
- /package/dist/src/{labs → ui-shell}/UiShell/useScrollState.d.ts +0 -0
- /package/dist/{labs → ui-shell}/UiShell/bufferLatest.js +0 -0
- /package/dist/{labs → ui-shell}/UiShell/createMessageBus.js +0 -0
- /package/dist/{labs → ui-shell}/UiShell/createStore.js +0 -0
- /package/dist/{labs → ui-shell}/UiShell/index.js +0 -0
- /package/dist/{labs → ui-shell}/UiShell/useScrollState.js +0 -0
- /package/src/{ButtonContext.tsx → Buttons/ButtonContext.tsx} +0 -0
- /package/src/{MenuContext.ts → Buttons/MenuContext.ts} +0 -0
- /package/src/labs/{DatePicker.types.d.ts → DatePickers/DatePicker.types.d.ts} +0 -0
- /package/src/labs/{useDateFieldsTranslations.ts → DatePickers/useDateFieldsTranslations.ts} +0 -0
- /package/src/{labs → ui-shell}/UiShell/bufferLatest.test.ts +0 -0
- /package/src/{labs → ui-shell}/UiShell/bufferLatest.ts +0 -0
- /package/src/{labs → ui-shell}/UiShell/createMessageBus.test.ts +0 -0
- /package/src/{labs → ui-shell}/UiShell/createMessageBus.ts +0 -0
- /package/src/{labs → ui-shell}/UiShell/createStore.test.ts +0 -0
- /package/src/{labs → ui-shell}/UiShell/createStore.ts +0 -0
- /package/src/{labs → ui-shell}/UiShell/index.ts +0 -0
- /package/src/{labs → ui-shell}/UiShell/useScrollState.ts +0 -0
package/src/Checkbox.tsx
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
FormControlLabelProps as MuiFormControlLabelProps,
|
|
20
20
|
FormHelperText,
|
|
21
21
|
} from "@mui/material";
|
|
22
|
+
import styled from "@emotion/styled";
|
|
22
23
|
|
|
23
24
|
import { CheckedFieldProps } from "./FormCheckedProps";
|
|
24
25
|
import type { HtmlProps } from "./HtmlProps";
|
|
@@ -28,10 +29,28 @@ import {
|
|
|
28
29
|
getControlState,
|
|
29
30
|
} from "./inputUtils";
|
|
30
31
|
import { FieldComponentProps } from "./FieldComponentProps";
|
|
32
|
+
import {
|
|
33
|
+
useOdysseyDesignTokens,
|
|
34
|
+
DesignTokens,
|
|
35
|
+
} from "./OdysseyDesignTokensContext";
|
|
31
36
|
import { Typography } from "./Typography";
|
|
37
|
+
import { useUniqueId } from "./useUniqueId";
|
|
32
38
|
|
|
33
39
|
export const checkboxValidityValues = ["valid", "invalid", "inherit"] as const;
|
|
34
40
|
|
|
41
|
+
const HintContainerWithInlineStartSpacing = styled.div<{
|
|
42
|
+
odysseyDesignTokens: DesignTokens;
|
|
43
|
+
}>(({ odysseyDesignTokens }) => ({
|
|
44
|
+
paddingInlineStart: `calc(${odysseyDesignTokens.TypographyLineHeightUi}em + ${odysseyDesignTokens.Spacing2})`,
|
|
45
|
+
marginBlockEnd: odysseyDesignTokens.Spacing2,
|
|
46
|
+
|
|
47
|
+
// MUI applies the '.Mui-error' class to this hint text when the checkbox is invalid which turns the copy red
|
|
48
|
+
// We want to keep the hint text gray in the error state
|
|
49
|
+
".Mui-error": {
|
|
50
|
+
color: odysseyDesignTokens.TypographyColorSubordinate,
|
|
51
|
+
},
|
|
52
|
+
}));
|
|
53
|
+
|
|
35
54
|
export type CheckboxProps = {
|
|
36
55
|
/**
|
|
37
56
|
* The ref forwarded to the Checkbox
|
|
@@ -90,6 +109,10 @@ const Checkbox = ({
|
|
|
90
109
|
value,
|
|
91
110
|
}: CheckboxProps) => {
|
|
92
111
|
const { t } = useTranslation();
|
|
112
|
+
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
113
|
+
const id = useUniqueId(idOverride);
|
|
114
|
+
const hintId = hint ? `${id}-hint` : undefined;
|
|
115
|
+
|
|
93
116
|
const controlledStateRef = useRef(
|
|
94
117
|
getControlState({
|
|
95
118
|
controlledValue: isChecked,
|
|
@@ -126,10 +149,9 @@ const Checkbox = ({
|
|
|
126
149
|
</Typography>
|
|
127
150
|
</>
|
|
128
151
|
)}
|
|
129
|
-
{hint && <FormHelperText translate={translate}>{hint}</FormHelperText>}
|
|
130
152
|
</>
|
|
131
153
|
);
|
|
132
|
-
}, [isRequired, labelProp,
|
|
154
|
+
}, [isRequired, labelProp, t, translate]);
|
|
133
155
|
|
|
134
156
|
const onChange = useCallback<NonNullable<MuiCheckboxProps["onChange"]>>(
|
|
135
157
|
(event, checked) => {
|
|
@@ -158,58 +180,78 @@ const Checkbox = ({
|
|
|
158
180
|
const checkboxStyles = useMemo(
|
|
159
181
|
() => ({
|
|
160
182
|
alignItems: "flex-start",
|
|
183
|
+
|
|
161
184
|
...(isReadOnly && {
|
|
162
185
|
cursor: "default",
|
|
163
186
|
"& .MuiTypography-root": {
|
|
164
187
|
cursor: "default",
|
|
165
188
|
},
|
|
166
189
|
}),
|
|
190
|
+
|
|
191
|
+
...(hint && {
|
|
192
|
+
// needed to override specific :not(:last-child) selector
|
|
193
|
+
":not(:last-child)": {
|
|
194
|
+
marginBlockEnd: 0,
|
|
195
|
+
},
|
|
196
|
+
}),
|
|
167
197
|
}),
|
|
168
|
-
[isReadOnly],
|
|
198
|
+
[hint, isReadOnly],
|
|
169
199
|
);
|
|
170
200
|
|
|
171
201
|
return (
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
onClick
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
202
|
+
<>
|
|
203
|
+
<FormControlLabel
|
|
204
|
+
sx={checkboxStyles}
|
|
205
|
+
aria-label={ariaLabel}
|
|
206
|
+
aria-labelledby={ariaLabelledBy}
|
|
207
|
+
className={
|
|
208
|
+
validity === "invalid"
|
|
209
|
+
? "Mui-error"
|
|
210
|
+
: validity === "valid"
|
|
211
|
+
? "Mui-valid"
|
|
212
|
+
: ""
|
|
213
|
+
}
|
|
214
|
+
control={
|
|
215
|
+
<MuiCheckbox
|
|
216
|
+
{...inputValues}
|
|
217
|
+
indeterminate={isIndeterminate}
|
|
218
|
+
onChange={onChange}
|
|
219
|
+
onClick={
|
|
220
|
+
onClick as unknown as React.MouseEventHandler<HTMLButtonElement>
|
|
221
|
+
}
|
|
222
|
+
required={isRequired}
|
|
223
|
+
inputProps={{
|
|
224
|
+
"aria-describedby": hintId,
|
|
225
|
+
"aria-readonly": isReadOnly,
|
|
226
|
+
"data-se": testId,
|
|
227
|
+
readOnly: isReadOnly,
|
|
228
|
+
}}
|
|
229
|
+
disabled={isDisabled}
|
|
230
|
+
inputRef={localInputRef}
|
|
231
|
+
sx={{
|
|
232
|
+
marginBlockStart: "2px",
|
|
233
|
+
}}
|
|
234
|
+
/>
|
|
235
|
+
}
|
|
236
|
+
disabled={isDisabled}
|
|
237
|
+
id={idOverride}
|
|
238
|
+
label={label}
|
|
239
|
+
name={nameOverride ?? idOverride}
|
|
240
|
+
value={value}
|
|
241
|
+
required={isRequired}
|
|
242
|
+
onBlur={onBlur}
|
|
243
|
+
translate={translate}
|
|
244
|
+
/>
|
|
245
|
+
{hint && (
|
|
246
|
+
<HintContainerWithInlineStartSpacing
|
|
247
|
+
odysseyDesignTokens={odysseyDesignTokens}
|
|
248
|
+
>
|
|
249
|
+
<FormHelperText id={hintId} translate={translate}>
|
|
250
|
+
{hint}
|
|
251
|
+
</FormHelperText>
|
|
252
|
+
</HintContainerWithInlineStartSpacing>
|
|
253
|
+
)}
|
|
254
|
+
</>
|
|
213
255
|
);
|
|
214
256
|
};
|
|
215
257
|
|
|
@@ -51,7 +51,6 @@ import {
|
|
|
51
51
|
} from "./DataTableRowActions";
|
|
52
52
|
import { useRowReordering } from "./useRowReordering";
|
|
53
53
|
import { DataTableSettings } from "./DataTableSettings";
|
|
54
|
-
import { MenuButton, MenuButtonProps } from "../MenuButton";
|
|
55
54
|
import { Box } from "../Box";
|
|
56
55
|
import { DataTableRowSelectionState, DataTableRowData } from ".";
|
|
57
56
|
import {
|
|
@@ -61,7 +60,7 @@ import {
|
|
|
61
60
|
import { useScrollIndication } from "./useScrollIndication";
|
|
62
61
|
import styled from "@emotion/styled";
|
|
63
62
|
import { EmptyState } from "../EmptyState";
|
|
64
|
-
import { Button } from "../
|
|
63
|
+
import { Button, MenuButton, MenuButtonProps } from "../Buttons";
|
|
65
64
|
import { Callout } from "../Callout";
|
|
66
65
|
|
|
67
66
|
export type DataTableColumn<T extends DataTableRowData> = MRT_ColumnDef<T> & {
|
|
@@ -12,10 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
import { MRT_Row, MRT_RowData } from "material-react-table";
|
|
14
14
|
import { Fragment, ReactElement, memo, useCallback } from "react";
|
|
15
|
-
import { Button } from "../
|
|
16
|
-
import { MenuItem } from "../MenuItem";
|
|
15
|
+
import { Button, MenuButton, MenuButtonProps, MenuItem } from "../Buttons";
|
|
17
16
|
import { Box as MuiBox } from "@mui/material";
|
|
18
|
-
import { MenuButton, MenuButtonProps } from "../MenuButton";
|
|
19
17
|
import {
|
|
20
18
|
ArrowBottomIcon,
|
|
21
19
|
ArrowDownIcon,
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import { Dispatch, SetStateAction, memo, useCallback, useMemo } from "react";
|
|
14
14
|
import { Checkbox as MuiCheckbox } from "@mui/material";
|
|
15
|
-
import { MenuButton } from "../
|
|
16
|
-
import { MenuItem } from "../MenuItem";
|
|
15
|
+
import { MenuButton, MenuItem } from "../Buttons";
|
|
17
16
|
import { ListIcon, ShowIcon } from "../icons.generated";
|
|
18
17
|
import { densityValues } from "./constants";
|
|
19
18
|
import { DataTableProps } from "./DataTable";
|
|
@@ -20,15 +20,15 @@ import { MRT_RowData } from "material-react-table";
|
|
|
20
20
|
* @param newIndex - The new index to move the row to.
|
|
21
21
|
* @returns A new array of data with the row moved to the specified index.
|
|
22
22
|
*/
|
|
23
|
-
export const reorderDataRowsLocally = ({
|
|
23
|
+
export const reorderDataRowsLocally = <TData extends MRT_RowData>({
|
|
24
24
|
currentData,
|
|
25
25
|
rowId,
|
|
26
26
|
newRowIndex,
|
|
27
27
|
}: {
|
|
28
|
-
currentData:
|
|
28
|
+
currentData: TData[];
|
|
29
29
|
rowId: string;
|
|
30
30
|
newRowIndex: number;
|
|
31
|
-
}):
|
|
31
|
+
}): TData[] => {
|
|
32
32
|
const updatedData = [...currentData];
|
|
33
33
|
const rowIndex = updatedData.findIndex((row) => row.id === rowId);
|
|
34
34
|
|
|
@@ -16,7 +16,7 @@ import { reorderDataRowsLocally } from "./reorderDataRowsLocally";
|
|
|
16
16
|
import { useOdysseyDesignTokens } from "../OdysseyDesignTokensContext";
|
|
17
17
|
import { MRT_Row, MRT_RowData, MRT_TableInstance } from "material-react-table";
|
|
18
18
|
|
|
19
|
-
export const useRowReordering = ({
|
|
19
|
+
export const useRowReordering = <TData extends MRT_RowData>({
|
|
20
20
|
totalRows,
|
|
21
21
|
onReorderRows,
|
|
22
22
|
data,
|
|
@@ -28,12 +28,10 @@ export const useRowReordering = ({
|
|
|
28
28
|
}: {
|
|
29
29
|
totalRows: DataTableProps["totalRows"];
|
|
30
30
|
onReorderRows: DataTableProps["onReorderRows"];
|
|
31
|
-
data:
|
|
32
|
-
setData: Dispatch<SetStateAction<
|
|
33
|
-
draggingRow?: MRT_Row<
|
|
34
|
-
setDraggingRow: Dispatch<
|
|
35
|
-
SetStateAction<MRT_Row<MRT_RowData> | null | undefined>
|
|
36
|
-
>;
|
|
31
|
+
data: TData[];
|
|
32
|
+
setData: Dispatch<SetStateAction<TData[]>>;
|
|
33
|
+
draggingRow?: MRT_Row<TData> | null;
|
|
34
|
+
setDraggingRow: Dispatch<SetStateAction<MRT_Row<TData> | null | undefined>>;
|
|
37
35
|
resultsPerPage: number;
|
|
38
36
|
page: number;
|
|
39
37
|
}) => {
|
|
@@ -68,7 +66,6 @@ export const useRowReordering = ({
|
|
|
68
66
|
const dragHandleStyles = {
|
|
69
67
|
padding: odysseyDesignTokens.Spacing1,
|
|
70
68
|
borderRadius: odysseyDesignTokens.BorderRadiusMain,
|
|
71
|
-
|
|
72
69
|
"&:focus-visible": {
|
|
73
70
|
boxShadow: `0 0 0 2px ${odysseyDesignTokens.HueNeutralWhite}, 0 0 0 4px ${odysseyDesignTokens.PalettePrimaryMain}`,
|
|
74
71
|
outline: "2px solid transparent",
|
|
@@ -106,12 +103,12 @@ export const useRowReordering = ({
|
|
|
106
103
|
return undefined;
|
|
107
104
|
};
|
|
108
105
|
|
|
109
|
-
const setHoveredRow = (
|
|
110
|
-
table: MRT_TableInstance<MRT_RowData>,
|
|
111
|
-
id: MRT_RowData["id"],
|
|
112
|
-
) => {
|
|
106
|
+
const setHoveredRow = (table: MRT_TableInstance<TData>, id: TData["id"]) => {
|
|
113
107
|
if (id) {
|
|
114
|
-
|
|
108
|
+
// The `as MRT_Row<TData>` is necessary here to overcome some type/generic
|
|
109
|
+
// issues with the type of `setHoveredRow` defined by MRT. It's not ideal code,
|
|
110
|
+
// but it's the only way that works without a much larger rewrite.
|
|
111
|
+
const nextRow = table.getRow(id) as MRT_Row<TData>;
|
|
115
112
|
|
|
116
113
|
if (nextRow) {
|
|
117
114
|
table.setHoveredRow(nextRow);
|
|
@@ -120,8 +117,8 @@ export const useRowReordering = ({
|
|
|
120
117
|
};
|
|
121
118
|
|
|
122
119
|
type HandleDragHandleKeyDownArgs = {
|
|
123
|
-
table: MRT_TableInstance<
|
|
124
|
-
row: MRT_Row<
|
|
120
|
+
table: MRT_TableInstance<TData>;
|
|
121
|
+
row: MRT_Row<TData>;
|
|
125
122
|
event: KeyboardEvent<HTMLButtonElement>;
|
|
126
123
|
};
|
|
127
124
|
|
|
@@ -192,7 +189,7 @@ export const useRowReordering = ({
|
|
|
192
189
|
}
|
|
193
190
|
};
|
|
194
191
|
|
|
195
|
-
const handleDragHandleOnDragEnd = (table: MRT_TableInstance<
|
|
192
|
+
const handleDragHandleOnDragEnd = (table: MRT_TableInstance<TData>) => {
|
|
196
193
|
const cols = table.getAllColumns();
|
|
197
194
|
cols[0].toggleVisibility();
|
|
198
195
|
|
|
@@ -200,24 +197,20 @@ export const useRowReordering = ({
|
|
|
200
197
|
if (draggingRow) {
|
|
201
198
|
updateRowOrder({
|
|
202
199
|
rowId: draggingRow.id,
|
|
203
|
-
newRowIndex: (hoveredRow as
|
|
200
|
+
newRowIndex: (hoveredRow as TData).index,
|
|
204
201
|
});
|
|
205
202
|
}
|
|
206
203
|
|
|
207
204
|
setDraggingRow(null);
|
|
208
205
|
};
|
|
209
206
|
|
|
210
|
-
const handleDragHandleOnDragCapture = (
|
|
211
|
-
table: MRT_TableInstance<MRT_RowData>,
|
|
212
|
-
) => {
|
|
207
|
+
const handleDragHandleOnDragCapture = (table: MRT_TableInstance<TData>) => {
|
|
213
208
|
if (!draggingRow && table.getState().draggingRow?.id) {
|
|
214
209
|
setDraggingRow(table.getState().draggingRow);
|
|
215
210
|
}
|
|
216
211
|
};
|
|
217
212
|
|
|
218
|
-
const resetDraggingAndHoveredRow = (
|
|
219
|
-
table: MRT_TableInstance<MRT_RowData>,
|
|
220
|
-
) => {
|
|
213
|
+
const resetDraggingAndHoveredRow = (table: MRT_TableInstance<TData>) => {
|
|
221
214
|
setDraggingRow(null);
|
|
222
215
|
table.setHoveredRow(null);
|
|
223
216
|
};
|
package/src/Dialog.tsx
CHANGED
package/src/Drawer.tsx
CHANGED
|
@@ -24,7 +24,7 @@ import { Drawer as MuiDrawer } from "@mui/material";
|
|
|
24
24
|
import styled from "@emotion/styled";
|
|
25
25
|
import { useTranslation } from "react-i18next";
|
|
26
26
|
|
|
27
|
-
import { Button } from "./
|
|
27
|
+
import { Button } from "./Buttons";
|
|
28
28
|
import { CloseIcon } from "./icons.generated";
|
|
29
29
|
import {
|
|
30
30
|
DesignTokens,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
import styled from "@emotion/styled";
|
|
22
22
|
import { useTranslation } from "react-i18next";
|
|
23
23
|
|
|
24
|
-
import { Button } from "../
|
|
24
|
+
import { Button } from "../Buttons";
|
|
25
25
|
import { UploadIcon } from "../icons.generated";
|
|
26
26
|
import { Field, RenderFieldComponentProps } from "../Field";
|
|
27
27
|
import { FieldComponentProps } from "../FieldComponentProps";
|
package/src/Form.tsx
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { FormEventHandler, memo, ReactElement } from "react";
|
|
14
14
|
import styled from "@emotion/styled";
|
|
15
15
|
|
|
16
|
-
import { Button } from "./
|
|
16
|
+
import { Button } from "./Buttons";
|
|
17
17
|
import { Callout } from "./Callout";
|
|
18
18
|
import { FieldComponentProps } from "./FieldComponentProps";
|
|
19
19
|
import type { HtmlProps } from "./HtmlProps";
|
package/src/HtmlProps.ts
CHANGED
|
@@ -29,6 +29,33 @@ export type HtmlProps = {
|
|
|
29
29
|
* Value: A space-separated list of one or more ID values referencing the elements being controlled by the current element
|
|
30
30
|
*/
|
|
31
31
|
ariaControls?: HTMLAttributes<HTMLElement>["aria-controls"];
|
|
32
|
+
/**
|
|
33
|
+
* A non-null aria-current state on an element indicates that this element represents the current item within a container or set of related elements.
|
|
34
|
+
*
|
|
35
|
+
* Value:
|
|
36
|
+
*
|
|
37
|
+
* `page`
|
|
38
|
+
Represents the current page within a set of pages such as the link to the current document in a breadcrumb.
|
|
39
|
+
|
|
40
|
+
`step`
|
|
41
|
+
Represents the current step within a process such as the current step in an enumerated multi step checkout flow.
|
|
42
|
+
|
|
43
|
+
`location`
|
|
44
|
+
Represents the current location within an environment or context such as the image that is visually highlighted as the current component of a flow chart.
|
|
45
|
+
|
|
46
|
+
`date`
|
|
47
|
+
Represents the current date within a collection of dates such as the current date within a calendar.
|
|
48
|
+
|
|
49
|
+
`time`
|
|
50
|
+
Represents the current time within a set of times such as the current time within a timetable.
|
|
51
|
+
|
|
52
|
+
`true`
|
|
53
|
+
Represents the current item within a set.
|
|
54
|
+
|
|
55
|
+
`false` (default)
|
|
56
|
+
Does not represent the current item within a set.
|
|
57
|
+
*/
|
|
58
|
+
ariaCurrent?: HTMLAttributes<HTMLElement>["aria-current"];
|
|
32
59
|
/**
|
|
33
60
|
* The global `aria-describedby` attribute identifies the element (or elements) that describes the element on which the attribute is set.
|
|
34
61
|
*
|
|
@@ -10,13 +10,15 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { render, waitFor, within } from "@testing-library/react";
|
|
14
|
+
import { userEvent } from "@testing-library/user-event";
|
|
14
15
|
import { Pagination } from "./Pagination";
|
|
15
16
|
|
|
16
17
|
describe("Pagination", () => {
|
|
17
18
|
it("renders the expected controls in 'paged' variant", () => {
|
|
18
19
|
const onPaginationChange = jest.fn();
|
|
19
|
-
|
|
20
|
+
|
|
21
|
+
const { container } = render(
|
|
20
22
|
<Pagination
|
|
21
23
|
currentPageLabel="Page"
|
|
22
24
|
nextLabel="Next page"
|
|
@@ -32,19 +34,24 @@ describe("Pagination", () => {
|
|
|
32
34
|
/>,
|
|
33
35
|
);
|
|
34
36
|
|
|
35
|
-
expect(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
expect(
|
|
37
|
+
expect(
|
|
38
|
+
within(container).getByLabelText("Rows per page"),
|
|
39
|
+
).toBeInTheDocument();
|
|
40
|
+
expect(within(container).getByLabelText("Page")).toBeInTheDocument();
|
|
41
|
+
expect(
|
|
42
|
+
within(container).getByLabelText("Previous page"),
|
|
43
|
+
).toBeInTheDocument();
|
|
44
|
+
expect(within(container).getByLabelText("Next page")).toBeInTheDocument();
|
|
39
45
|
// Temporarily disabled while we figure out why i18n string interpolation
|
|
40
46
|
// isn't playing nicely with testing-library. Can confirm this works properly
|
|
41
47
|
// via VRT results
|
|
42
|
-
// expect(
|
|
48
|
+
// expect(within(container).getByText("1-10 of 100")).toBeInTheDocument();
|
|
43
49
|
});
|
|
44
50
|
|
|
45
51
|
it("calls onPaginationChange with correct pageIndex when clicking next", async () => {
|
|
46
52
|
const onPaginationChange = jest.fn();
|
|
47
|
-
|
|
53
|
+
|
|
54
|
+
const { container } = render(
|
|
48
55
|
<Pagination
|
|
49
56
|
currentPageLabel="Page"
|
|
50
57
|
nextLabel="Next page"
|
|
@@ -60,7 +67,7 @@ describe("Pagination", () => {
|
|
|
60
67
|
/>,
|
|
61
68
|
);
|
|
62
69
|
|
|
63
|
-
|
|
70
|
+
await userEvent.click(within(container).getByLabelText("Next page"));
|
|
64
71
|
|
|
65
72
|
await waitFor(() => {
|
|
66
73
|
expect(onPaginationChange).toHaveBeenCalledWith({
|
|
@@ -72,7 +79,8 @@ describe("Pagination", () => {
|
|
|
72
79
|
|
|
73
80
|
it("calls onPaginationChange with correct pageIndex when clicking previous", async () => {
|
|
74
81
|
const onPaginationChange = jest.fn();
|
|
75
|
-
|
|
82
|
+
|
|
83
|
+
const { container } = render(
|
|
76
84
|
<Pagination
|
|
77
85
|
currentPageLabel="Page"
|
|
78
86
|
nextLabel="Next page"
|
|
@@ -88,7 +96,7 @@ describe("Pagination", () => {
|
|
|
88
96
|
/>,
|
|
89
97
|
);
|
|
90
98
|
|
|
91
|
-
|
|
99
|
+
await userEvent.click(within(container).getByLabelText("Previous page"));
|
|
92
100
|
|
|
93
101
|
await waitFor(() => {
|
|
94
102
|
expect(onPaginationChange).toHaveBeenCalledWith({
|
|
@@ -100,7 +108,8 @@ describe("Pagination", () => {
|
|
|
100
108
|
|
|
101
109
|
it("disables previous button on first page", () => {
|
|
102
110
|
const onPaginationChange = jest.fn();
|
|
103
|
-
|
|
111
|
+
|
|
112
|
+
const { container } = render(
|
|
104
113
|
<Pagination
|
|
105
114
|
currentPageLabel="Page"
|
|
106
115
|
nextLabel="Next page"
|
|
@@ -116,12 +125,13 @@ describe("Pagination", () => {
|
|
|
116
125
|
/>,
|
|
117
126
|
);
|
|
118
127
|
|
|
119
|
-
expect(
|
|
128
|
+
expect(within(container).getByLabelText("Previous page")).toBeDisabled();
|
|
120
129
|
});
|
|
121
130
|
|
|
122
131
|
it("disables next button on last page", () => {
|
|
123
132
|
const onPaginationChange = jest.fn();
|
|
124
|
-
|
|
133
|
+
|
|
134
|
+
const { container } = render(
|
|
125
135
|
<Pagination
|
|
126
136
|
currentPageLabel="Page"
|
|
127
137
|
nextLabel="Next page"
|
|
@@ -137,12 +147,13 @@ describe("Pagination", () => {
|
|
|
137
147
|
/>,
|
|
138
148
|
);
|
|
139
149
|
|
|
140
|
-
expect(
|
|
150
|
+
expect(within(container).getByLabelText("Next page")).toBeDisabled();
|
|
141
151
|
});
|
|
142
152
|
|
|
143
153
|
it("updates pageIndex when entering a new page number", async () => {
|
|
144
154
|
const onPaginationChange = jest.fn();
|
|
145
|
-
|
|
155
|
+
|
|
156
|
+
const { container } = render(
|
|
146
157
|
<Pagination
|
|
147
158
|
currentPageLabel="Page"
|
|
148
159
|
nextLabel="Next page"
|
|
@@ -158,9 +169,11 @@ describe("Pagination", () => {
|
|
|
158
169
|
/>,
|
|
159
170
|
);
|
|
160
171
|
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
|
|
172
|
+
const pageElement = await within(container).findByLabelText("Page");
|
|
173
|
+
|
|
174
|
+
await userEvent.tripleClick(pageElement);
|
|
175
|
+
await userEvent.keyboard("5");
|
|
176
|
+
await userEvent.click(document.body);
|
|
164
177
|
|
|
165
178
|
await waitFor(() => {
|
|
166
179
|
expect(onPaginationChange).toHaveBeenCalledWith({
|
|
@@ -172,7 +185,8 @@ describe("Pagination", () => {
|
|
|
172
185
|
|
|
173
186
|
it("updates pageSize when entering a new rows per page value", async () => {
|
|
174
187
|
const onPaginationChange = jest.fn();
|
|
175
|
-
|
|
188
|
+
|
|
189
|
+
const { container } = render(
|
|
176
190
|
<Pagination
|
|
177
191
|
currentPageLabel="Page"
|
|
178
192
|
nextLabel="Next page"
|
|
@@ -188,9 +202,12 @@ describe("Pagination", () => {
|
|
|
188
202
|
/>,
|
|
189
203
|
);
|
|
190
204
|
|
|
191
|
-
const rowsPerPageInput =
|
|
192
|
-
|
|
193
|
-
|
|
205
|
+
const rowsPerPageInput =
|
|
206
|
+
await within(container).findByLabelText("Rows per page");
|
|
207
|
+
|
|
208
|
+
await userEvent.tripleClick(rowsPerPageInput);
|
|
209
|
+
await userEvent.keyboard("20");
|
|
210
|
+
await userEvent.click(document.body);
|
|
194
211
|
|
|
195
212
|
await waitFor(() => {
|
|
196
213
|
expect(onPaginationChange).toHaveBeenCalledWith({
|
|
@@ -202,7 +219,8 @@ describe("Pagination", () => {
|
|
|
202
219
|
|
|
203
220
|
it("renders 'Load more' button in 'loadMore' variant", () => {
|
|
204
221
|
const onPaginationChange = jest.fn();
|
|
205
|
-
|
|
222
|
+
|
|
223
|
+
const { container } = render(
|
|
206
224
|
<Pagination
|
|
207
225
|
loadMoreLabel="Load more"
|
|
208
226
|
onPaginationChange={onPaginationChange}
|
|
@@ -213,12 +231,13 @@ describe("Pagination", () => {
|
|
|
213
231
|
/>,
|
|
214
232
|
);
|
|
215
233
|
|
|
216
|
-
expect(
|
|
234
|
+
expect(within(container).getByText("Load more")).toBeInTheDocument();
|
|
217
235
|
});
|
|
218
236
|
|
|
219
237
|
it("calls onPaginationChange with increased pageSize when clicking 'Load more'", async () => {
|
|
220
238
|
const onPaginationChange = jest.fn();
|
|
221
|
-
|
|
239
|
+
|
|
240
|
+
const { container } = render(
|
|
222
241
|
<Pagination
|
|
223
242
|
loadMoreLabel="Load more"
|
|
224
243
|
onPaginationChange={onPaginationChange}
|
|
@@ -229,7 +248,7 @@ describe("Pagination", () => {
|
|
|
229
248
|
/>,
|
|
230
249
|
);
|
|
231
250
|
|
|
232
|
-
|
|
251
|
+
await userEvent.click(within(container).getByText("Load more"));
|
|
233
252
|
|
|
234
253
|
await waitFor(() => {
|
|
235
254
|
expect(onPaginationChange).toHaveBeenCalledWith({
|
|
@@ -241,7 +260,8 @@ describe("Pagination", () => {
|
|
|
241
260
|
|
|
242
261
|
it("disables 'Load more' button when isMoreDisabled is true", () => {
|
|
243
262
|
const onPaginationChange = jest.fn();
|
|
244
|
-
|
|
263
|
+
|
|
264
|
+
const { container } = render(
|
|
245
265
|
<Pagination
|
|
246
266
|
loadMoreLabel="Load more"
|
|
247
267
|
onPaginationChange={onPaginationChange}
|
|
@@ -253,12 +273,13 @@ describe("Pagination", () => {
|
|
|
253
273
|
/>,
|
|
254
274
|
);
|
|
255
275
|
|
|
256
|
-
expect(
|
|
276
|
+
expect(within(container).getByText("Load more")).toBeDisabled();
|
|
257
277
|
});
|
|
258
278
|
|
|
259
279
|
it("disables 'Next page' button when isMoreDisabled is true", () => {
|
|
260
280
|
const onPaginationChange = jest.fn();
|
|
261
|
-
|
|
281
|
+
|
|
282
|
+
const { container } = render(
|
|
262
283
|
<Pagination
|
|
263
284
|
currentPageLabel="Page"
|
|
264
285
|
nextLabel="Next page"
|
|
@@ -275,12 +296,13 @@ describe("Pagination", () => {
|
|
|
275
296
|
/>,
|
|
276
297
|
);
|
|
277
298
|
|
|
278
|
-
expect(
|
|
299
|
+
expect(within(container).getByLabelText("Next page")).toBeDisabled();
|
|
279
300
|
});
|
|
280
301
|
|
|
281
302
|
it("disables all controls when isDisabled is true", () => {
|
|
282
303
|
const onPaginationChange = jest.fn();
|
|
283
|
-
|
|
304
|
+
|
|
305
|
+
const { container } = render(
|
|
284
306
|
<Pagination
|
|
285
307
|
currentPageLabel="Page"
|
|
286
308
|
nextLabel="Next page"
|
|
@@ -297,9 +319,9 @@ describe("Pagination", () => {
|
|
|
297
319
|
/>,
|
|
298
320
|
);
|
|
299
321
|
|
|
300
|
-
expect(
|
|
301
|
-
expect(
|
|
302
|
-
expect(
|
|
303
|
-
expect(
|
|
322
|
+
expect(within(container).getByLabelText("Rows per page")).toBeDisabled();
|
|
323
|
+
expect(within(container).getByLabelText("Page")).toBeDisabled();
|
|
324
|
+
expect(within(container).getByLabelText("Previous page")).toBeDisabled();
|
|
325
|
+
expect(within(container).getByLabelText("Next page")).toBeDisabled();
|
|
304
326
|
});
|
|
305
327
|
});
|