@sqrzro/admin 1.0.0-beta.7 → 2.0.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/.eslintrc +5 -1
- package/.storybook/main.js +6 -34
- package/.storybook/preview-head.html +3 -0
- package/.storybook/preview.js +1 -11
- package/.turbo/turbo-docs.log +0 -0
- package/.turbo/turbo-lint.log +112 -0
- package/.turbo/turbo-prettier.log +215 -0
- package/.turbo/turbo-test.log +6 -0
- package/LICENSE +1 -1
- package/dist/{types/components → components}/Alert/index.d.ts +4 -4
- package/dist/components/Alert/index.js +15 -0
- package/dist/{types/components → components}/Allow/index.d.ts +20 -13
- package/dist/components/Allow/index.js +29 -0
- package/dist/components/AppLayout/AppLayout.stories.d.ts +5 -0
- package/dist/components/AppLayout/AppLayout.stories.js +11 -0
- package/dist/components/AppLayout/index.d.ts +6 -0
- package/dist/components/AppLayout/index.js +18 -0
- package/dist/{types/components → components}/AutoSuggest/index.d.ts +74 -60
- package/dist/components/AutoSuggest/index.js +143 -0
- package/dist/components/Button/Button.stories.d.ts +11 -0
- package/{src/components/Button/Button.story.tsx → dist/components/Button/Button.stories.js} +16 -14
- package/dist/{types/components → components}/Button/index.d.ts +49 -36
- package/dist/components/Button/index.js +50 -0
- package/dist/components/CalendarInput/index.d.ts +24 -0
- package/dist/components/CalendarInput/index.js +54 -0
- package/dist/{types/components → components}/CheckboxList/index.d.ts +17 -17
- package/dist/components/CheckboxList/index.js +25 -0
- package/dist/components/CodeInput/index.d.ts +9 -0
- package/dist/components/CodeInput/index.js +51 -0
- package/dist/{types/components → components}/ConnectedDropdown/index.d.ts +14 -14
- package/dist/components/ConnectedDropdown/index.js +36 -0
- package/dist/{types/components → components}/ConnectedList/index.d.ts +5 -5
- package/dist/components/ConnectedList/index.js +7 -0
- package/dist/{types/components → components}/ConnectedTable/index.d.ts +5 -5
- package/dist/components/ConnectedTable/index.js +7 -0
- package/dist/{types/components → components}/ContentBlock/index.d.ts +16 -16
- package/dist/components/ContentBlock/index.js +13 -0
- package/dist/components/DataPanel/index.d.ts +8 -0
- package/dist/components/DataPanel/index.js +8 -0
- package/dist/components/DateInput/index.d.ts +18 -0
- package/dist/components/DateInput/index.js +81 -0
- package/dist/{types/components → components}/Dropdown/index.d.ts +36 -36
- package/dist/components/Dropdown/index.js +122 -0
- package/dist/components/ErrorMessage/index.d.ts +16 -0
- package/dist/components/ErrorMessage/index.js +17 -0
- package/dist/components/Fieldset/index.d.ts +18 -0
- package/dist/components/Fieldset/index.js +19 -0
- package/dist/{types/components → components}/FileInput/index.d.ts +10 -10
- package/dist/components/FileInput/index.js +26 -0
- package/dist/components/FilterLink/index.d.ts +14 -0
- package/dist/components/FilterLink/index.js +15 -0
- package/dist/components/Form/index.d.ts +14 -0
- package/dist/components/Form/index.js +15 -0
- package/dist/components/FormActions/index.d.ts +18 -0
- package/dist/components/FormActions/index.js +14 -0
- package/dist/{types/components → components}/FormField/index.d.ts +14 -14
- package/dist/components/FormField/index.js +40 -0
- package/dist/components/FormRepeater/index.d.ts +18 -0
- package/dist/components/FormRepeater/index.js +65 -0
- package/dist/{types/components → components}/ImageInput/index.d.ts +13 -13
- package/dist/components/ImageInput/index.js +45 -0
- package/dist/components/InfoPanel/index.d.ts +14 -0
- package/dist/components/InfoPanel/index.js +11 -0
- package/dist/{types/components → components}/Link/__mocks__/index.d.ts +6 -6
- package/dist/components/Link/__mocks__/index.js +12 -0
- package/dist/components/Link/index.d.ts +23 -0
- package/dist/components/Link/index.js +21 -0
- package/dist/{types/components → components}/List/index.d.ts +36 -36
- package/dist/components/List/index.js +46 -0
- package/dist/components/ListActions/index.d.ts +18 -0
- package/dist/components/ListActions/index.js +14 -0
- package/dist/components/LoginForm/index.d.ts +3 -0
- package/dist/components/LoginForm/index.js +47 -0
- package/dist/components/Message/index.d.ts +14 -0
- package/dist/components/Message/index.js +14 -0
- package/dist/{types/components → components}/Modal/index.d.ts +4 -4
- package/dist/components/Modal/index.js +18 -0
- package/dist/components/ModalActions/index.d.ts +21 -0
- package/dist/components/ModalActions/index.js +18 -0
- package/dist/{types/components → components}/MoneyInput/index.d.ts +10 -10
- package/dist/components/MoneyInput/index.js +13 -0
- package/dist/components/PasswordForm/index.d.ts +35 -0
- package/dist/components/PasswordForm/index.js +21 -0
- package/dist/components/PasswordInput/index.d.ts +4 -0
- package/dist/components/PasswordInput/index.js +12 -0
- package/dist/{types/components → components}/RadioList/index.d.ts +9 -9
- package/dist/components/RadioList/index.js +7 -0
- package/dist/components/RootLayout/index.d.ts +6 -0
- package/dist/components/RootLayout/index.js +7 -0
- package/dist/components/SummaryList/index.d.ts +18 -0
- package/dist/components/SummaryList/index.js +15 -0
- package/dist/components/Switch/index.d.ts +21 -0
- package/dist/components/Switch/index.js +31 -0
- package/dist/{types/components → components}/Table/index.d.ts +28 -28
- package/dist/components/Table/index.js +55 -0
- package/dist/components/Tag/index.d.ts +15 -0
- package/dist/components/Tag/index.js +13 -0
- package/dist/components/TextArea/index.d.ts +18 -0
- package/dist/components/TextArea/index.js +26 -0
- package/dist/{types/components → components}/TextInput/index.d.ts +14 -14
- package/dist/components/TextInput/index.js +27 -0
- package/dist/{types/components → components}/WebsiteInput/index.d.ts +10 -10
- package/dist/components/WebsiteInput/index.js +13 -0
- package/dist/components/WeekCalendar/index.d.ts +24 -0
- package/dist/components/WeekCalendar/index.js +48 -0
- package/dist/{types/core → core}/AlertComponent/index.d.ts +26 -26
- package/dist/core/AlertComponent/index.js +35 -0
- package/dist/{types/core → core}/AppHeader/index.d.ts +3 -3
- package/dist/core/AppHeader/index.js +17 -0
- package/dist/core/AppLogo/index.d.ts +12 -0
- package/dist/core/AppLogo/index.js +16 -0
- package/dist/{types/core → core}/AppLogoImage/index.d.ts +3 -3
- package/dist/core/AppLogoImage/index.js +11 -0
- package/dist/{types/core → core}/AppLogoPlaceholder/index.d.ts +3 -3
- package/dist/core/AppLogoPlaceholder/index.js +10 -0
- package/dist/core/Assistive/index.d.ts +12 -0
- package/dist/core/Assistive/index.js +9 -0
- package/dist/core/AuthForm/index.d.ts +10 -0
- package/dist/core/AuthForm/index.js +13 -0
- package/dist/{types/core → core}/Banner/index.d.ts +3 -3
- package/dist/core/Banner/index.js +14 -0
- package/dist/core/Calendar/index.d.ts +21 -0
- package/dist/core/Calendar/index.js +69 -0
- package/dist/core/CalendarDay/index.d.ts +30 -0
- package/dist/core/CalendarDay/index.js +30 -0
- package/dist/core/CalendarMonth/index.d.ts +23 -0
- package/dist/core/CalendarMonth/index.js +45 -0
- package/dist/core/CalendarNavigation/index.d.ts +17 -0
- package/dist/core/CalendarNavigation/index.js +24 -0
- package/dist/core/CalendarWeek/index.d.ts +28 -0
- package/dist/core/CalendarWeek/index.js +46 -0
- package/dist/core/ChkRad/index.d.ts +26 -0
- package/dist/core/ChkRad/index.js +33 -0
- package/dist/core/ChkRadIcon/index.d.ts +14 -0
- package/dist/core/ChkRadIcon/index.js +12 -0
- package/dist/{types/core → core}/ChkRadList/index.d.ts +32 -32
- package/dist/core/ChkRadList/index.js +37 -0
- package/dist/core/CloseButton/index.d.ts +17 -0
- package/dist/core/CloseButton/index.js +12 -0
- package/dist/{types/core → core}/ConfirmModal/index.d.ts +3 -3
- package/dist/core/ConfirmModal/index.js +38 -0
- package/dist/{types/core → core}/ConnectedRepeater/index.d.ts +50 -50
- package/dist/core/ConnectedRepeater/index.js +154 -0
- package/dist/{types/core → core}/ConnectedRepeaterComponent/index.d.ts +24 -24
- package/dist/core/ConnectedRepeaterComponent/index.js +25 -0
- package/dist/core/Container/index.d.ts +14 -0
- package/dist/core/Container/index.js +12 -0
- package/dist/core/DataPanelItem/index.d.ts +8 -0
- package/dist/core/DataPanelItem/index.js +7 -0
- package/dist/core/DropdownPanel/index.d.ts +31 -0
- package/dist/core/DropdownPanel/index.js +32 -0
- package/dist/{types/core → core}/EmptyMessage/index.d.ts +21 -14
- package/dist/core/EmptyMessage/index.js +21 -0
- package/dist/core/FilterItem/index.d.ts +25 -0
- package/dist/core/FilterItem/index.js +82 -0
- package/dist/core/Filters/index.d.ts +31 -0
- package/dist/core/Filters/index.js +85 -0
- package/dist/{types/core → core}/FixedActions/index.d.ts +24 -24
- package/dist/core/FixedActions/index.js +22 -0
- package/dist/core/FormError/index.d.ts +12 -0
- package/dist/core/FormError/index.js +9 -0
- package/dist/core/FormLabel/index.d.ts +16 -0
- package/dist/core/FormLabel/index.js +13 -0
- package/dist/core/FormLegend/index.d.ts +12 -0
- package/dist/core/FormLegend/index.js +9 -0
- package/dist/core/Header/Header.stories.d.ts +5 -0
- package/dist/core/Header/Header.stories.js +11 -0
- package/dist/core/Header/index.d.ts +14 -0
- package/dist/core/Header/index.js +12 -0
- package/dist/core/Icon/index.d.ts +14 -0
- package/dist/core/Icon/index.js +32 -0
- package/dist/core/IconButton/index.d.ts +22 -0
- package/dist/core/IconButton/index.js +20 -0
- package/dist/core/InputPanel/index.d.ts +16 -0
- package/dist/core/InputPanel/index.js +11 -0
- package/dist/{types/core → core}/ListItem/index.d.ts +39 -38
- package/dist/core/ListItem/index.js +44 -0
- package/dist/core/ListItemAction/index.d.ts +11 -0
- package/dist/core/ListItemAction/index.js +13 -0
- package/dist/{types/core → core}/ListItemActions/index.d.ts +8 -8
- package/dist/core/ListItemActions/index.js +16 -0
- package/dist/core/ListItemMetaItem/index.d.ts +19 -0
- package/dist/core/ListItemMetaItem/index.js +29 -0
- package/dist/core/ListItemTitle/index.d.ts +19 -0
- package/dist/core/ListItemTitle/index.js +44 -0
- package/dist/core/Loader/index.d.ts +15 -0
- package/dist/core/Loader/index.js +16 -0
- package/dist/core/MeActions/index.d.ts +3 -0
- package/dist/core/MeActions/index.js +48 -0
- package/dist/{types/core → core}/MePanel/index.d.ts +19 -19
- package/dist/core/MePanel/index.js +29 -0
- package/dist/core/ModalComponent/index.d.ts +22 -0
- package/dist/core/ModalComponent/index.js +29 -0
- package/dist/{types/core → core}/Navigation/index.d.ts +3 -3
- package/dist/core/Navigation/index.js +33 -0
- package/dist/{types/core → core}/NavigationDivider/index.d.ts +3 -3
- package/dist/core/NavigationDivider/index.js +8 -0
- package/dist/core/NavigationItem/index.d.ts +16 -0
- package/dist/core/NavigationItem/index.js +21 -0
- package/dist/core/Pagination/index.d.ts +15 -0
- package/{src/core/Pagination/index.tsx → dist/core/Pagination/index.js} +10 -46
- package/dist/core/PaginationItem/index.d.ts +10 -0
- package/dist/core/PaginationItem/index.js +17 -0
- package/dist/core/Panel/index.d.ts +17 -0
- package/dist/core/Panel/index.js +13 -0
- package/dist/{types/core → core}/PasswordForgotForm/index.d.ts +7 -7
- package/dist/core/PasswordForgotForm/index.js +40 -0
- package/dist/{types/core → core}/PasswordResetForm/index.d.ts +7 -7
- package/dist/core/PasswordResetForm/index.js +34 -0
- package/dist/core/RadialProgress/index.d.ts +16 -0
- package/dist/core/RadialProgress/index.js +23 -0
- package/dist/core/SettingsForm/index.d.ts +3 -0
- package/dist/core/SettingsForm/index.js +14 -0
- package/dist/core/StaticTextInput/index.d.ts +29 -0
- package/dist/core/StaticTextInput/index.js +39 -0
- package/dist/{types/core → core}/Styled/index.d.ts +6 -6
- package/{src/core/Styled/index.tsx → dist/core/Styled/index.js} +7 -30
- package/dist/core/SummaryListItem/index.d.ts +23 -0
- package/dist/core/SummaryListItem/index.js +31 -0
- package/dist/core/TabItem/index.d.ts +4 -0
- package/dist/core/TabItem/index.js +13 -0
- package/dist/{types/core → core}/TableActionsCell/index.d.ts +8 -8
- package/dist/core/TableActionsCell/index.js +8 -0
- package/dist/core/TableCell/index.d.ts +15 -0
- package/dist/core/TableCell/index.js +20 -0
- package/dist/core/TableHead/index.d.ts +18 -0
- package/dist/core/TableHead/index.js +18 -0
- package/dist/{types/core → core}/TableRow/index.d.ts +13 -13
- package/dist/core/TableRow/index.js +18 -0
- package/dist/core/Tabs/index.d.ts +7 -0
- package/dist/core/Tabs/index.js +13 -0
- package/dist/core/TextInputAncillary/index.d.ts +29 -0
- package/dist/core/TextInputAncillary/index.js +31 -0
- package/dist/{types/core → core}/Toast/index.d.ts +3 -3
- package/dist/core/Toast/index.js +47 -0
- package/dist/core/TwoFactor/index.d.ts +13 -0
- package/dist/core/TwoFactor/index.js +49 -0
- package/dist/{types/core/LoginFormAuthenticator → core/TwoFactorAuthenticator}/index.d.ts +10 -10
- package/dist/core/TwoFactorAuthenticator/index.js +9 -0
- package/dist/core/TwoFactorMethodList/index.d.ts +10 -0
- package/dist/core/TwoFactorMethodList/index.js +22 -0
- package/dist/core/TwoFactorSetup/index.d.ts +12 -0
- package/dist/core/TwoFactorSetup/index.js +43 -0
- package/dist/core/TwoFactorSetupAuthenticator/index.d.ts +20 -0
- package/dist/core/TwoFactorSetupAuthenticator/index.js +42 -0
- package/dist/core/TwoFactorSetupYubikey/index.d.ts +16 -0
- package/dist/core/TwoFactorSetupYubikey/index.js +14 -0
- package/dist/{types/core/LoginFormYubikey → core/TwoFactorYubikey}/index.d.ts +9 -9
- package/dist/core/TwoFactorYubikey/index.js +14 -0
- package/dist/core/WeekCalendarDay/index.d.ts +27 -0
- package/dist/core/WeekCalendarDay/index.js +35 -0
- package/dist/core/YubikeyInput/index.d.ts +4 -0
- package/dist/core/YubikeyInput/index.js +14 -0
- package/dist/filters/BooleanFilter/index.d.ts +14 -0
- package/dist/filters/BooleanFilter/index.js +35 -0
- package/dist/filters/DateFilter/index.d.ts +5 -0
- package/dist/filters/DateFilter/index.js +24 -0
- package/dist/filters/DropdownFilter/index.d.ts +17 -0
- package/dist/filters/DropdownFilter/index.js +32 -0
- package/dist/filters/QuickDateFilter/index.d.ts +13 -0
- package/dist/filters/QuickDateFilter/index.js +40 -0
- package/dist/{types/filters → filters}/interfaces.d.ts +35 -35
- package/dist/filters/interfaces.js +1 -0
- package/dist/{types/hooks → hooks}/useAlert.d.ts +12 -12
- package/dist/hooks/useAlert.js +18 -0
- package/dist/hooks/useAppConfig.d.ts +3 -0
- package/dist/hooks/useAppConfig.js +5 -0
- package/dist/{types/hooks → hooks}/useConnectedList.d.ts +7 -7
- package/dist/hooks/useConnectedList.js +6 -0
- package/dist/{types/hooks → hooks}/useConnectedRepeater.d.ts +7 -7
- package/dist/hooks/useConnectedRepeater.js +14 -0
- package/dist/{types/hooks → hooks}/useConnectedTable.d.ts +7 -7
- package/dist/hooks/useConnectedTable.js +6 -0
- package/dist/hooks/useFilters.d.ts +9 -0
- package/dist/hooks/useFilters.js +24 -0
- package/dist/{types/hooks → hooks}/useLayout.d.ts +7 -7
- package/dist/hooks/useLayout.js +10 -0
- package/dist/hooks/useLayout.spec.d.ts +1 -0
- package/dist/hooks/useLayout.spec.js +24 -0
- package/dist/{types/hooks → hooks}/useModal.d.ts +12 -12
- package/dist/hooks/useModal.js +39 -0
- package/dist/hooks/useModalOffset.d.ts +2 -0
- package/dist/hooks/useModalOffset.js +16 -0
- package/dist/hooks/useModalOffset.spec.d.ts +1 -0
- package/dist/hooks/useModalOffset.spec.js +19 -0
- package/dist/hooks/useNavigation.d.ts +7 -0
- package/dist/hooks/useNavigation.js +113 -0
- package/dist/hooks/useRemote.d.ts +7 -0
- package/dist/hooks/useRemote.js +29 -0
- package/dist/hooks/useVariant.d.ts +9 -0
- package/dist/hooks/useVariant.js +14 -0
- package/dist/{types/index.d.ts → index.d.ts} +209 -203
- package/dist/index.js +213 -5459
- package/dist/{types/scenes → scenes}/Error404Scene.d.ts +3 -3
- package/dist/scenes/Error404Scene.js +5 -0
- package/dist/services/AppService.d.ts +5 -0
- package/dist/services/AppService.js +11 -0
- package/dist/services/ConfigService.d.ts +42 -0
- package/dist/services/ConfigService.js +52 -0
- package/dist/{types/services → services}/ConfirmService.d.ts +12 -12
- package/dist/services/ConfirmService.js +10 -0
- package/dist/services/DateService.d.ts +26 -0
- package/dist/services/DateService.js +132 -0
- package/dist/services/DateService.spec.d.ts +1 -0
- package/dist/services/DateService.spec.js +83 -0
- package/dist/services/DownloadService.d.ts +7 -0
- package/dist/services/DownloadService.js +16 -0
- package/dist/services/DownloadService.spec.d.ts +1 -0
- package/dist/services/DownloadService.spec.js +18 -0
- package/dist/{types/services → services}/FilterComponentService.d.ts +25 -25
- package/dist/services/FilterComponentService.js +54 -0
- package/dist/services/FilterService.d.ts +34 -0
- package/dist/services/FilterService.js +58 -0
- package/dist/services/FilterService.spec.d.ts +1 -0
- package/dist/services/FilterService.spec.js +67 -0
- package/dist/services/FormatService.d.ts +11 -0
- package/dist/services/FormatService.js +45 -0
- package/dist/services/FormatService.spec.d.ts +1 -0
- package/dist/services/FormatService.spec.js +66 -0
- package/dist/services/ToastService.d.ts +7 -0
- package/dist/services/ToastService.js +17 -0
- package/dist/services/ToastService.spec.d.ts +1 -0
- package/dist/services/ToastService.spec.js +34 -0
- package/dist/styles.css +984 -0
- package/dist/utility/MockRouter/index.d.ts +2 -0
- package/dist/utility/MockRouter/index.js +37 -0
- package/dist/utility/StorybookPanel/index.d.ts +14 -0
- package/dist/utility/StorybookPanel/index.js +12 -0
- package/dist/utility/TestChangeHandler/index.d.ts +15 -0
- package/dist/utility/TestChangeHandler/index.js +30 -0
- package/dist/utility/icons.d.ts +3 -0
- package/dist/utility/icons.js +12 -0
- package/dist/{types/utility → utility}/interfaces.d.ts +79 -69
- package/dist/utility/interfaces.js +18 -0
- package/dist/utility/middleware.d.ts +4 -0
- package/dist/utility/middleware.js +9 -0
- package/dist/{types/utility → utility}/prop-types.d.ts +57 -55
- package/dist/utility/prop-types.js +77 -0
- package/dist/utility/register.d.ts +3 -0
- package/dist/utility/register.js +9 -0
- package/package.json +53 -88
- package/postcss.config.js +1 -1
- package/prettier.config.js +1 -0
- package/src/components/Alert/index.tsx +103 -13
- package/src/components/Allow/Allow.spec.tsx +2 -2
- package/src/components/Allow/index.tsx +8 -8
- package/src/components/AppLayout/AppLayout.stories.tsx +20 -0
- package/src/components/AppLayout/index.tsx +22 -0
- package/src/components/AutoSuggest/AutoSuggest.spec.tsx +38 -18
- package/src/components/AutoSuggest/AutoSuggest.story.tsx +8 -6
- package/src/components/AutoSuggest/index.tsx +30 -30
- package/src/components/Button/Button.spec.tsx +8 -0
- package/src/components/Button/Button.stories.tsx +62 -0
- package/src/components/Button/index.tsx +9 -93
- package/src/components/CalendarInput/CalendarInput.spec.tsx +38 -22
- package/src/components/CalendarInput/CalendarInput.story.tsx +2 -2
- package/src/components/CalendarInput/index.tsx +23 -19
- package/src/components/CheckboxList/CheckboxList.spec.tsx +20 -10
- package/src/components/CheckboxList/index.tsx +9 -12
- package/src/components/ConnectedDropdown/index.tsx +7 -5
- package/src/components/ConnectedList/index.tsx +13 -11
- package/src/components/ConnectedTable/index.tsx +15 -13
- package/src/components/ContentBlock/index.tsx +10 -8
- package/src/components/DataPanel/index.tsx +25 -0
- package/src/components/DateInput/DateInput.spec.tsx +10 -6
- package/src/components/DateInput/index.tsx +11 -12
- package/src/components/ErrorMessage/index.tsx +18 -20
- package/src/components/Fieldset/Fieldset.story.tsx +17 -13
- package/src/components/Fieldset/index.tsx +12 -10
- package/src/components/FileInput/FileInput.spec.tsx +9 -5
- package/src/components/FileInput/FileInput.story.tsx +3 -1
- package/src/components/FileInput/index.tsx +12 -10
- package/src/components/FilterLink/FilterLink.spec.tsx +18 -4
- package/src/components/FilterLink/index.tsx +19 -14
- package/src/components/Form/Form.spec.tsx +7 -5
- package/src/components/Form/index.tsx +5 -3
- package/src/components/FormActions/FormActions.story.tsx +19 -15
- package/src/components/FormActions/index.tsx +11 -7
- package/src/components/FormField/FormField.spec.tsx +28 -39
- package/src/components/FormField/FormField.stories.tsx +44 -0
- package/src/components/FormField/index.tsx +8 -103
- package/src/components/FormRepeater/FormRepeater.spec.tsx +26 -14
- package/src/components/FormRepeater/index.tsx +9 -7
- package/src/components/ImageInput/ImageInput.spec.tsx +3 -1
- package/src/components/ImageInput/ImageInput.story.tsx +3 -1
- package/src/components/ImageInput/index.tsx +16 -14
- package/src/components/InfoPanel/index.tsx +7 -7
- package/src/components/Link/Link.spec.tsx +4 -2
- package/src/components/Link/__mocks__/index.tsx +3 -3
- package/src/components/Link/index.tsx +6 -6
- package/src/components/List/List.spec.tsx +57 -20
- package/src/components/List/List.story.tsx +21 -2
- package/src/components/List/index.tsx +13 -13
- package/src/components/ListActions/ListActions.story.tsx +3 -1
- package/src/components/ListActions/index.tsx +10 -11
- package/src/components/LoginForm/LoginForm.spec.tsx +19 -7
- package/src/components/LoginForm/LoginForm.story.tsx +25 -0
- package/src/components/LoginForm/index.tsx +72 -171
- package/src/components/Message/index.tsx +12 -10
- package/src/components/Modal/index.tsx +18 -12
- package/src/components/ModalActions/ModalActions.spec.tsx +4 -2
- package/src/components/ModalActions/ModalActions.story.tsx +3 -1
- package/src/components/ModalActions/index.tsx +22 -18
- package/src/components/MoneyInput/MoneyInput.story.tsx +3 -1
- package/src/components/MoneyInput/index.tsx +7 -5
- package/src/components/PasswordForm/index.tsx +12 -24
- package/src/components/RadioList/RadioList.spec.tsx +4 -2
- package/src/components/RadioList/index.tsx +8 -6
- package/src/components/RootLayout/index.tsx +45 -0
- package/src/components/SummaryList/SummaryList.module.css +19 -4
- package/src/components/SummaryList/SummaryList.spec.tsx +14 -2
- package/src/components/SummaryList/SummaryList.story.tsx +3 -1
- package/src/components/SummaryList/index.tsx +16 -14
- package/src/components/Switch/Switch.spec.tsx +8 -4
- package/src/components/Switch/index.tsx +16 -14
- package/src/components/Table/Table.spec.tsx +11 -7
- package/src/components/Table/Table.story.tsx +3 -3
- package/src/components/Table/index.tsx +20 -22
- package/src/components/TextArea/TextArea.spec.tsx +12 -6
- package/src/components/TextArea/index.tsx +10 -8
- package/src/components/TextInput/TextInput.module.css +1 -0
- package/src/components/TextInput/TextInput.spec.tsx +12 -6
- package/src/components/TextInput/TextInput.stories.tsx +46 -0
- package/src/components/TextInput/index.tsx +6 -99
- package/src/components/WebsiteInput/index.tsx +7 -5
- package/src/components/WeekCalendar/index.tsx +8 -8
- package/src/core/AlertComponent/AlertComponent.spec.tsx +17 -4
- package/src/core/AlertComponent/AlertComponent.story.tsx +19 -15
- package/src/core/AlertComponent/index.tsx +30 -25
- package/src/core/AppHeader/index.tsx +5 -3
- package/src/core/AppLogo/index.tsx +9 -7
- package/src/core/AppLogoImage/index.tsx +6 -6
- package/src/core/AppLogoPlaceholder/index.tsx +28 -22
- package/src/core/Assistive/index.tsx +1 -18
- package/src/{components/LoginForm/LoginForm.module.css → core/AuthForm/AuthForm.module.css} +4 -0
- package/src/core/AuthForm/AuthForm.spec.tsx +72 -0
- package/src/core/AuthForm/index.tsx +63 -0
- package/src/core/Banner/index.tsx +11 -11
- package/src/core/Calendar/index.tsx +9 -7
- package/src/core/CalendarDay/index.tsx +12 -12
- package/src/core/CalendarMonth/index.tsx +14 -12
- package/src/core/CalendarNavigation/index.tsx +14 -14
- package/src/core/CalendarWeek/index.tsx +21 -19
- package/src/core/ChkRadList/index.tsx +25 -23
- package/src/core/CloseButton/CloseButton.spec.tsx +4 -2
- package/src/core/CloseButton/index.tsx +10 -8
- package/src/core/ConfirmModal/ConfirmModal.spec.tsx +10 -4
- package/src/core/ConfirmModal/index.tsx +9 -7
- package/src/core/ConnectedRepeater/index.tsx +46 -19
- package/src/core/ConnectedRepeaterComponent/index.tsx +13 -9
- package/src/core/Container/index.tsx +6 -12
- package/src/core/DataPanelItem/index.tsx +19 -0
- package/src/core/EmptyMessage/EmptyMessage.stories.tsx +33 -0
- package/src/core/EmptyMessage/index.tsx +9 -42
- package/src/core/FilterItem/index.tsx +41 -33
- package/src/core/Filters/Filters.spec.tsx +103 -69
- package/src/core/Filters/index.tsx +39 -31
- package/src/core/FixedActions/FixedActions.module.css +6 -0
- package/src/core/FixedActions/FixedActions.spec.tsx +8 -3
- package/src/core/FixedActions/index.tsx +9 -9
- package/src/core/FormLegend/index.tsx +4 -4
- package/src/core/Header/Header.stories.tsx +20 -0
- package/src/core/Header/index.tsx +8 -13
- package/src/core/Icon/Icon.spec.tsx +1 -3
- package/src/core/Icon/index.tsx +14 -10
- package/src/core/IconButton/index.tsx +18 -20
- package/src/core/ListItem/ListItem.story.tsx +23 -19
- package/src/core/ListItem/index.tsx +46 -37
- package/src/core/ListItemAction/index.tsx +7 -14
- package/src/core/ListItemActions/index.tsx +13 -12
- package/src/core/ListItemMetaItem/index.tsx +8 -8
- package/src/core/ListItemTitle/ListItemTitle.module.css +9 -1
- package/src/core/ListItemTitle/ListItemTitle.spec.tsx +24 -2
- package/src/core/ListItemTitle/index.tsx +20 -10
- package/src/core/Loader/Loader.module.css +3 -3
- package/src/core/Loader/Loader.stories.tsx +22 -0
- package/src/core/Loader/index.tsx +2 -27
- package/src/core/MeActions/index.tsx +28 -18
- package/src/core/MePanel/index.tsx +10 -10
- package/src/core/ModalComponent/ModalComponent.spec.tsx +8 -4
- package/src/core/ModalComponent/index.tsx +13 -13
- package/src/core/Navigation/Navigation.spec.tsx +47 -36
- package/src/core/Navigation/index.tsx +18 -58
- package/src/core/NavigationDivider/index.tsx +6 -6
- package/src/core/NavigationItem/index.tsx +12 -21
- package/src/core/Panel/Panel.module.css +11 -0
- package/src/core/Panel/Panel.spec.tsx +16 -0
- package/src/core/Panel/index.tsx +17 -13
- package/src/core/PasswordForgotForm/index.tsx +15 -12
- package/src/core/PasswordResetForm/index.tsx +15 -12
- package/src/core/RadialProgress/index.tsx +11 -14
- package/src/core/SettingsForm/index.tsx +9 -8
- package/src/core/SummaryListItem/SummaryListItem.module.css +3 -11
- package/src/core/SummaryListItem/index.tsx +19 -14
- package/src/core/TabItem/TabItem.module.css +28 -0
- package/src/core/TabItem/index.tsx +42 -0
- package/src/core/Tabs/Tabs.module.css +0 -24
- package/src/core/Tabs/Tabs.spec.tsx +30 -0
- package/src/core/Tabs/index.tsx +18 -76
- package/src/core/Toast/Toast.spec.tsx +4 -2
- package/src/core/Toast/index.tsx +16 -18
- package/src/core/TwoFactor/TwoFactor.spec.tsx +183 -0
- package/src/core/TwoFactor/index.tsx +102 -0
- package/src/core/TwoFactorAuthenticator/index.tsx +39 -0
- package/src/core/{LoginFormTwoFactor/LoginFormTwoFactor.module.css → TwoFactorMethodList/TwoFactorMethodList.module.css} +1 -1
- package/src/core/TwoFactorMethodList/index.tsx +49 -0
- package/src/core/TwoFactorSetup/index.tsx +91 -0
- package/src/core/TwoFactorSetupAuthenticator/TwoFactorSetupAuthenticator.module.css +6 -0
- package/src/core/TwoFactorSetupAuthenticator/index.tsx +100 -0
- package/src/core/TwoFactorSetupYubikey/index.tsx +49 -0
- package/src/core/TwoFactorYubikey/index.tsx +41 -0
- package/src/core/WeekCalendarDay/index.tsx +7 -7
- package/src/core/{LoginFormYubikey/LoginFormYubikey.module.css → YubikeyInput/YubikeyInput.module.css} +5 -0
- package/src/core/YubikeyInput/YubikeyInput.spec.tsx +77 -0
- package/src/core/YubikeyInput/index.tsx +76 -0
- package/src/filters/BooleanFilter/index.tsx +13 -12
- package/src/filters/DateFilter/index.tsx +8 -8
- package/src/filters/DropdownFilter/index.tsx +19 -17
- package/src/filters/QuickDateFilter/index.tsx +12 -12
- package/src/filters/interfaces.ts +2 -2
- package/src/hooks/useAlert.spec.tsx +72 -0
- package/src/hooks/useAlert.ts +7 -5
- package/src/hooks/useConfig.ts +31 -0
- package/src/hooks/useConnectedList.ts +4 -4
- package/src/hooks/useConnectedRepeater.ts +8 -6
- package/src/hooks/useConnectedTable.ts +4 -4
- package/src/hooks/useFilters.ts +21 -13
- package/src/hooks/useLayout.spec.ts +3 -11
- package/src/hooks/useLayout.ts +8 -7
- package/src/hooks/useModal.spec.tsx +23 -15
- package/src/hooks/useModal.ts +17 -17
- package/src/hooks/useModalOffset.ts +4 -2
- package/src/hooks/useNavigation.ts +160 -0
- package/src/hooks/useRemote.ts +43 -0
- package/src/index.ts +31 -26
- package/src/scenes/Error404Scene.tsx +3 -1
- package/src/services/AppService.ts +16 -0
- package/src/services/ConfigService.ts +93 -0
- package/src/services/ConfirmService.ts +7 -2
- package/src/services/DateService.ts +48 -32
- package/src/services/DownloadService.spec.ts +4 -10
- package/src/services/DownloadService.ts +16 -9
- package/src/services/FilterComponentService.tsx +9 -5
- package/src/services/FilterService.spec.ts +57 -39
- package/src/services/FilterService.ts +62 -40
- package/src/services/FormatService.spec.ts +2 -0
- package/src/services/FormatService.ts +13 -8
- package/src/services/ToastService.ts +9 -4
- package/src/styles/tailwind.css +57 -0
- package/src/typings.d.ts +2 -2
- package/src/utility/MockRouter/index.ts +1 -0
- package/src/utility/icons.tsx +46 -30
- package/src/utility/interfaces.ts +39 -21
- package/src/utility/middleware.ts +10 -0
- package/src/utility/prop-types.ts +6 -2
- package/src/utility/register.tsx +11 -0
- package/tailwind.config.js +11 -0
- package/tsconfig.eslint.json +4 -0
- package/tsconfig.json +7 -15
- package/.gitattributes +0 -1
- package/.github/workflows/development.yml +0 -47
- package/.prettierrc +0 -9
- package/.storybook/manager.js +0 -4
- package/.storybook/postcss.config.js +0 -3
- package/.storybook/theme.js +0 -7
- package/.stylelintrc +0 -9
- package/__mocks__/@sqrzro/utility.ts +0 -43
- package/assets/logo-horizontal-dark.svg +0 -21
- package/assets/logo-horizontal-white.svg +0 -21
- package/assets/logo-vertical-dark.svg +0 -21
- package/assets/logo-vertical-white.svg +0 -21
- package/dist/index.css +0 -3812
- package/dist/index.js.map +0 -1
- package/dist/types/components/App/index.d.ts +0 -18
- package/dist/types/components/CalendarInput/index.d.ts +0 -10
- package/dist/types/components/CodeInput/index.d.ts +0 -9
- package/dist/types/components/ConnectedListScene/index.d.ts +0 -7
- package/dist/types/components/ConnectedScene/index.d.ts +0 -11
- package/dist/types/components/DateInput/index.d.ts +0 -7
- package/dist/types/components/Document/index.d.ts +0 -3
- package/dist/types/components/ErrorMessage/index.d.ts +0 -8
- package/dist/types/components/Fieldset/index.d.ts +0 -11
- package/dist/types/components/FilterLink/index.d.ts +0 -7
- package/dist/types/components/Form/index.d.ts +0 -14
- package/dist/types/components/FormActions/index.d.ts +0 -9
- package/dist/types/components/FormRepeater/index.d.ts +0 -9
- package/dist/types/components/InfoPanel/index.d.ts +0 -8
- package/dist/types/components/Link/index.d.ts +0 -13
- package/dist/types/components/ListActions/index.d.ts +0 -9
- package/dist/types/components/LoginForm/index.d.ts +0 -3
- package/dist/types/components/Message/index.d.ts +0 -7
- package/dist/types/components/ModalActions/index.d.ts +0 -11
- package/dist/types/components/PasswordForm/index.d.ts +0 -3
- package/dist/types/components/PasswordInput/index.d.ts +0 -4
- package/dist/types/components/Scene/index.d.ts +0 -10
- package/dist/types/components/SummaryList/index.d.ts +0 -8
- package/dist/types/components/Switch/index.d.ts +0 -9
- package/dist/types/components/Tag/index.d.ts +0 -8
- package/dist/types/components/TextArea/index.d.ts +0 -4
- package/dist/types/components/WeekCalendar/index.d.ts +0 -12
- package/dist/types/core/App/index.d.ts +0 -19
- package/dist/types/core/AppLogo/index.d.ts +0 -6
- package/dist/types/core/Assistive/index.d.ts +0 -6
- package/dist/types/core/BuildModal/index.d.ts +0 -3
- package/dist/types/core/Calendar/index.d.ts +0 -11
- package/dist/types/core/CalendarDay/index.d.ts +0 -16
- package/dist/types/core/CalendarMonth/index.d.ts +0 -12
- package/dist/types/core/CalendarNavigation/index.d.ts +0 -9
- package/dist/types/core/CalendarWeek/index.d.ts +0 -14
- package/dist/types/core/ChkRad/index.d.ts +0 -13
- package/dist/types/core/ChkRadIcon/index.d.ts +0 -7
- package/dist/types/core/CloseButton/index.d.ts +0 -9
- package/dist/types/core/ConnectedList/index.d.ts +0 -4
- package/dist/types/core/ConnectedTable/index.d.ts +0 -4
- package/dist/types/core/Container/index.d.ts +0 -7
- package/dist/types/core/DropdownPanel/index.d.ts +0 -18
- package/dist/types/core/ErrorBoundary/index.d.ts +0 -15
- package/dist/types/core/ErrorMessage/index.d.ts +0 -8
- package/dist/types/core/FilterItem/index.d.ts +0 -10
- package/dist/types/core/Filters/index.d.ts +0 -15
- package/dist/types/core/Form/index.d.ts +0 -12
- package/dist/types/core/FormError/index.d.ts +0 -6
- package/dist/types/core/FormLabel/index.d.ts +0 -8
- package/dist/types/core/FormLegend/index.d.ts +0 -6
- package/dist/types/core/Header/index.d.ts +0 -8
- package/dist/types/core/Icon/index.d.ts +0 -7
- package/dist/types/core/IconButton/Icon/index.d.ts +0 -7
- package/dist/types/core/IconButton/index.d.ts +0 -11
- package/dist/types/core/InputPanel/index.d.ts +0 -8
- package/dist/types/core/ListItemAction/index.d.ts +0 -4
- package/dist/types/core/ListItemMetaItem/index.d.ts +0 -10
- package/dist/types/core/ListItemTitle/index.d.ts +0 -9
- package/dist/types/core/Loader/index.d.ts +0 -6
- package/dist/types/core/LoginFormTwoFactor/index.d.ts +0 -13
- package/dist/types/core/MeActions/index.d.ts +0 -3
- package/dist/types/core/Modal/index.d.ts +0 -12
- package/dist/types/core/ModalComponent/index.d.ts +0 -12
- package/dist/types/core/NavigationItem/index.d.ts +0 -7
- package/dist/types/core/Pagination/index.d.ts +0 -7
- package/dist/types/core/PaginationItem/index.d.ts +0 -7
- package/dist/types/core/Panel/index.d.ts +0 -8
- package/dist/types/core/RadialProgress/index.d.ts +0 -8
- package/dist/types/core/SettingsForm/index.d.ts +0 -3
- package/dist/types/core/StaticTextInput/index.d.ts +0 -13
- package/dist/types/core/SummaryListItem/index.d.ts +0 -15
- package/dist/types/core/TableCell/index.d.ts +0 -8
- package/dist/types/core/TableHead/index.d.ts +0 -8
- package/dist/types/core/Tabs/index.d.ts +0 -11
- package/dist/types/core/TextInputAncillary/index.d.ts +0 -12
- package/dist/types/core/WeekCalendarDay/index.d.ts +0 -14
- package/dist/types/filters/BooleanFilter/index.d.ts +0 -5
- package/dist/types/filters/DateFilter/index.d.ts +0 -5
- package/dist/types/filters/DropdownFilter/index.d.ts +0 -17
- package/dist/types/filters/QuickDateFilter/index.d.ts +0 -5
- package/dist/types/hooks/useAccessiblePanel.d.ts +0 -13
- package/dist/types/hooks/useAppContext.d.ts +0 -55
- package/dist/types/hooks/useClickOutside.d.ts +0 -3
- package/dist/types/hooks/useComponentId.d.ts +0 -2
- package/dist/types/hooks/useFilters.d.ts +0 -3
- package/dist/types/hooks/useForm.d.ts +0 -41
- package/dist/types/hooks/useFormData.d.ts +0 -12
- package/dist/types/hooks/useModalOffset.d.ts +0 -2
- package/dist/types/hooks/useVariant.d.ts +0 -6
- package/dist/types/services/BuildService.d.ts +0 -5
- package/dist/types/services/DateService.d.ts +0 -17
- package/dist/types/services/DownloadService.d.ts +0 -5
- package/dist/types/services/FilterService.d.ts +0 -13
- package/dist/types/services/FormatService.d.ts +0 -7
- package/dist/types/services/OLD_ApiService.d.ts +0 -19
- package/dist/types/services/ToastService.d.ts +0 -5
- package/dist/types/utility/MockRouter/index.d.ts +0 -2
- package/dist/types/utility/StorybookPanel/index.d.ts +0 -7
- package/dist/types/utility/TestChangeHandler/index.d.ts +0 -15
- package/dist/types/utility/create-app.d.ts +0 -4
- package/dist/types/utility/icons.d.ts +0 -3
- package/docs/guides/01-installation.story.mdx +0 -33
- package/docs/guides/02-configuration.story.mdx +0 -80
- package/docs/guides/03-pages.story.mdx +0 -18
- package/docs/guides/04-integration.story.mdx +0 -33
- package/docs/guides/a11y.story.mdx +0 -7
- package/docs/guides/theming.story.mdx +0 -7
- package/docs/introduction.story.mdx +0 -17
- package/jest.config.js +0 -19
- package/rollup.config.js +0 -36
- package/scripts/create-exports.js +0 -74
- package/scripts/update-license.js +0 -8
- package/squarezero.config.js +0 -5
- package/src/components/Button/Button.module.css +0 -100
- package/src/components/CodeInput/CodeInput.module.css +0 -33
- package/src/components/CodeInput/CodeInput.spec.tsx +0 -180
- package/src/components/CodeInput/index.tsx +0 -138
- package/src/components/ConnectedScene/index.tsx +0 -96
- package/src/components/Document/index.tsx +0 -14
- package/src/components/Dropdown/Dropdown.module.css +0 -8
- package/src/components/Dropdown/Dropdown.spec.tsx +0 -304
- package/src/components/Dropdown/Dropdown.story.tsx +0 -53
- package/src/components/Dropdown/index.tsx +0 -228
- package/src/components/FormField/FormField.story.tsx +0 -29
- package/src/components/PasswordForm/PasswordForm.module.css +0 -21
- package/src/components/PasswordInput/PasswordInput.module.css +0 -23
- package/src/components/PasswordInput/PasswordInput.spec.tsx +0 -28
- package/src/components/PasswordInput/PasswordInput.story.tsx +0 -16
- package/src/components/PasswordInput/index.tsx +0 -23
- package/src/components/Scene/Scene.spec.tsx +0 -123
- package/src/components/Scene/Scene.story.tsx +0 -6
- package/src/components/Scene/index.tsx +0 -58
- package/src/components/Tag/Tag.module.css +0 -37
- package/src/components/Tag/Tag.spec.tsx +0 -10
- package/src/components/Tag/Tag.story.tsx +0 -55
- package/src/components/Tag/index.tsx +0 -27
- package/src/components/TextInput/TextInput.story.tsx +0 -24
- package/src/core/App/App.module.css +0 -24
- package/src/core/App/App.spec.tsx +0 -265
- package/src/core/App/index.tsx +0 -115
- package/src/core/Assistive/Assistive.module.css +0 -10
- package/src/core/ChkRad/ChkRad.module.css +0 -31
- package/src/core/ChkRad/ChkRad.spec.tsx +0 -79
- package/src/core/ChkRad/index.tsx +0 -75
- package/src/core/ChkRadIcon/ChkRadIcon.module.css +0 -29
- package/src/core/ChkRadIcon/index.tsx +0 -33
- package/src/core/DropdownPanel/DropdownPanel.module.css +0 -68
- package/src/core/DropdownPanel/index.tsx +0 -93
- package/src/core/ErrorBoundary/ErrorBoundary.spec.tsx +0 -33
- package/src/core/ErrorBoundary/index.tsx +0 -42
- package/src/core/FormError/FormError.module.css +0 -7
- package/src/core/FormError/index.tsx +0 -18
- package/src/core/FormLabel/FormLabel.module.css +0 -15
- package/src/core/FormLabel/index.tsx +0 -25
- package/src/core/Header/Header.module.css +0 -28
- package/src/core/InputPanel/InputPanel.module.css +0 -70
- package/src/core/InputPanel/index.tsx +0 -28
- package/src/core/Loader/Loader.story.tsx +0 -8
- package/src/core/LoginFormAuthenticator/index.tsx +0 -36
- package/src/core/LoginFormTwoFactor/index.tsx +0 -133
- package/src/core/LoginFormYubikey/index.tsx +0 -59
- package/src/core/Pagination/Pagination.module.css +0 -15
- package/src/core/PaginationItem/PaginationItem.module.css +0 -33
- package/src/core/PaginationItem/index.tsx +0 -46
- package/src/core/StaticTextInput/StaticTextInput.module.css +0 -79
- package/src/core/StaticTextInput/StaticTextInput.spec.tsx +0 -126
- package/src/core/StaticTextInput/index.tsx +0 -112
- package/src/core/Styled/Styled.spec.tsx +0 -32
- package/src/core/Styled/Styled.story.tsx +0 -10
- package/src/core/TableActionsCell/TableActionsCell.module.css +0 -3
- package/src/core/TableActionsCell/index.tsx +0 -26
- package/src/core/TableCell/TableCell.module.css +0 -16
- package/src/core/TableCell/index.tsx +0 -39
- package/src/core/TableHead/TableHead.module.css +0 -12
- package/src/core/TableHead/index.tsx +0 -48
- package/src/core/TableRow/index.tsx +0 -49
- package/src/core/TextInputAncillary/TextInputAncillary.module.css +0 -69
- package/src/core/TextInputAncillary/index.tsx +0 -84
- package/src/hooks/useAccessiblePanel.spec.tsx +0 -88
- package/src/hooks/useAccessiblePanel.ts +0 -74
- package/src/hooks/useAppContext.spec.ts +0 -38
- package/src/hooks/useAppContext.ts +0 -110
- package/src/hooks/useClickOutside.ts +0 -49
- package/src/hooks/useComponentId.spec.ts +0 -19
- package/src/hooks/useComponentId.ts +0 -16
- package/src/hooks/useForm.spec.ts +0 -251
- package/src/hooks/useForm.ts +0 -179
- package/src/hooks/useVariant.spec.ts +0 -14
- package/src/hooks/useVariant.ts +0 -34
- package/src/styles/layout.css +0 -64
- package/src/styles/variables.css +0 -85
- package/src/utility/StorybookPanel/StorybookPanel.module.css +0 -9
- package/src/utility/StorybookPanel/index.tsx +0 -25
- package/src/utility/TestChangeHandler/TestChangeHandler.module.css +0 -7
- package/src/utility/TestChangeHandler/TestChangeHandler.spec.tsx +0 -24
- package/src/utility/TestChangeHandler/index.tsx +0 -51
- package/src/utility/create-app.tsx +0 -28
- package/tests/setupFilesAfterEnv.js +0 -16
- package/tsconfig.types.json +0 -9
|
@@ -1,213 +1,114 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import React, { Fragment } from 'react';
|
|
2
4
|
import Head from 'next/head';
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import { ApiError, ApiService, AuthService } from '@sqrzro/utility';
|
|
6
|
-
|
|
7
|
-
import Alert from '@components/Alert';
|
|
8
|
-
import Button from '@components/Button';
|
|
9
|
-
import Form from '@components/Form';
|
|
10
|
-
import FormField from '@components/FormField';
|
|
11
|
-
import Link from '@components/Link';
|
|
12
|
-
import PasswordInput from '@components/PasswordInput';
|
|
13
|
-
import TextInput from '@components/TextInput';
|
|
14
|
-
|
|
15
|
-
import AppLogo from '@core/AppLogo';
|
|
16
|
-
import LoginFormTwoFactor from '@core/LoginFormTwoFactor';
|
|
17
|
-
import Panel from '@core/Panel';
|
|
18
|
-
|
|
19
|
-
import useAlert from '@hooks/useAlert';
|
|
20
|
-
import useAppContext from '@hooks/useAppContext';
|
|
21
|
-
import type { AuthObject } from '@hooks/useAppContext';
|
|
22
|
-
import useForm from '@hooks/useForm';
|
|
23
|
-
import type { UseFormReturn } from '@hooks/useForm';
|
|
24
|
-
|
|
25
|
-
import ToastService from '@services/ToastService';
|
|
26
|
-
|
|
27
|
-
import type { SceneComponentType } from '@utility/interfaces';
|
|
28
|
-
import { NextRouterPropType } from '@utility/prop-types';
|
|
29
|
-
|
|
30
|
-
import styles from './LoginForm.module.css';
|
|
31
|
-
|
|
32
|
-
interface LoginResponse {
|
|
33
|
-
token: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
interface LoginFormFields {
|
|
37
|
-
identifier: string;
|
|
38
|
-
password: string;
|
|
39
|
-
provider: string;
|
|
40
|
-
twofactor_code: string; // eslint-disable-line @typescript-eslint/naming-convention
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const UNAUTH_CODE = 401;
|
|
44
|
-
const BAD_REQUEST_CODE = 400;
|
|
45
|
-
|
|
46
|
-
const useLoginForm = (
|
|
47
|
-
auth: AuthObject,
|
|
48
|
-
openAlert: () => void,
|
|
49
|
-
router: Omit<NextRouter, 'events'>
|
|
50
|
-
): UseFormReturn<LoginFormFields> =>
|
|
51
|
-
useForm<LoginFormFields, LoginResponse>({
|
|
52
|
-
defaults: {
|
|
53
|
-
identifier: router.query[auth.identifier]?.toString() || '',
|
|
54
|
-
password: '',
|
|
55
|
-
provider: '',
|
|
56
|
-
twofactor_code: '', // eslint-disable-line @typescript-eslint/naming-convention, camelcase
|
|
57
|
-
},
|
|
58
|
-
errorMessage: false,
|
|
59
|
-
hasFieldErrors: false,
|
|
60
|
-
method: 'post',
|
|
61
|
-
successMessage: false,
|
|
62
|
-
url: auth.loginUrl,
|
|
63
|
-
onSubmitError: (error: unknown, data, setData): void => {
|
|
64
|
-
const identifierErrorMessage = `Incorrect ${auth.identifier} or password. Please try again.`;
|
|
65
|
-
|
|
66
|
-
/*
|
|
67
|
-
* Situation: identifier and password are provided, but incorrect
|
|
68
|
-
* If the error is a 401, assume the identifier/password is wrong.
|
|
69
|
-
*/
|
|
70
|
-
if (error instanceof ApiError && error.response.status === UNAUTH_CODE) {
|
|
71
|
-
ToastService.error(identifierErrorMessage);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/*
|
|
76
|
-
* Situation: twofactor_code is provided, but incorrect
|
|
77
|
-
* If the error is a 400, assume the two factor code is wrong.
|
|
78
|
-
*/
|
|
79
|
-
if (error instanceof ApiError && error.response.status === BAD_REQUEST_CODE) {
|
|
80
|
-
if (setData) {
|
|
81
|
-
setData('twofactor_code', '');
|
|
82
|
-
}
|
|
83
|
-
ToastService.error('Incorrect authentication code. Please try again.');
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
5
|
+
import { useLoginForm } from '@sqrzro/hooks';
|
|
86
6
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
error.messages.twofactor_code &&
|
|
94
|
-
/required/u.exec(error.messages.twofactor_code)
|
|
95
|
-
) {
|
|
96
|
-
openAlert();
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
7
|
+
import Alert from '../Alert';
|
|
8
|
+
import Button from '../Button';
|
|
9
|
+
import FormField from '../FormField';
|
|
10
|
+
import Link from '../Link';
|
|
11
|
+
import PasswordInput from '../PasswordInput';
|
|
12
|
+
import TextInput from '../TextInput';
|
|
99
13
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
14
|
+
import AuthForm from '../../core/AuthForm';
|
|
15
|
+
import TwoFactor from '../../core/TwoFactor';
|
|
16
|
+
import TwoFactorSetup from '../../core/TwoFactorSetup';
|
|
105
17
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
* If the error isn't an instance of ApiValidationError, then just provide a generic
|
|
109
|
-
* error message.
|
|
110
|
-
*/
|
|
111
|
-
ToastService.error("Something's gone wrong. Please try again.");
|
|
112
|
-
},
|
|
113
|
-
onSubmitSuccess: (response) => AuthService.login(response.data.token),
|
|
114
|
-
transformErrors: (errors) => ({
|
|
115
|
-
...errors,
|
|
116
|
-
identifier: errors[auth.identifier],
|
|
117
|
-
}),
|
|
118
|
-
transformRequest: (data) => ({
|
|
119
|
-
...data,
|
|
120
|
-
[auth.identifier]: data.identifier,
|
|
121
|
-
}),
|
|
122
|
-
});
|
|
18
|
+
import useAlert from '../../hooks/useAlert';
|
|
19
|
+
import useConfig from '../../hooks/useConfig';
|
|
123
20
|
|
|
124
|
-
|
|
21
|
+
function LoginForm(): React.ReactElement {
|
|
125
22
|
const { alertProps, openAlert, closeAlert } = useAlert();
|
|
126
|
-
const {
|
|
23
|
+
const {
|
|
24
|
+
alertProps: setupAlertProps,
|
|
25
|
+
openAlert: openSetupAlert,
|
|
26
|
+
closeAlert: closeSetupAlert,
|
|
27
|
+
} = useAlert();
|
|
28
|
+
|
|
29
|
+
const { auth, name } = useConfig();
|
|
127
30
|
|
|
128
31
|
const { fieldProps, formData, formProps, handleSubmit, isLoading, setFormData } = useLoginForm(
|
|
129
32
|
auth,
|
|
130
33
|
openAlert,
|
|
131
|
-
|
|
34
|
+
openSetupAlert
|
|
132
35
|
);
|
|
133
36
|
|
|
134
|
-
|
|
37
|
+
function handleKeyDown(event: React.KeyboardEvent): void {
|
|
135
38
|
if (event.key === 'Enter') {
|
|
136
39
|
handleSubmit();
|
|
137
40
|
}
|
|
138
|
-
}
|
|
41
|
+
}
|
|
139
42
|
|
|
140
|
-
|
|
43
|
+
function handleAlertClose(): void {
|
|
141
44
|
setFormData('provider', '');
|
|
142
|
-
setFormData('
|
|
45
|
+
setFormData('two_factor_code', '');
|
|
143
46
|
closeAlert();
|
|
144
|
-
|
|
47
|
+
closeSetupAlert();
|
|
48
|
+
}
|
|
145
49
|
|
|
146
50
|
return (
|
|
147
51
|
<Fragment>
|
|
148
52
|
<Head>
|
|
149
53
|
<title>Login | {name}</title>
|
|
150
54
|
</Head>
|
|
151
|
-
<
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}`}
|
|
182
|
-
>
|
|
183
|
-
Forgot Password?
|
|
184
|
-
</Link>
|
|
185
|
-
</div>
|
|
186
|
-
</Panel>
|
|
187
|
-
</div>
|
|
55
|
+
<AuthForm
|
|
56
|
+
{...formProps}
|
|
57
|
+
footer={
|
|
58
|
+
<Link
|
|
59
|
+
to={`/auth/password${
|
|
60
|
+
formData.identifier ? `?${auth.identifier}=${formData.identifier}` : ''
|
|
61
|
+
}`}
|
|
62
|
+
>
|
|
63
|
+
Forgot Password?
|
|
64
|
+
</Link>
|
|
65
|
+
}
|
|
66
|
+
>
|
|
67
|
+
<FormField
|
|
68
|
+
{...fieldProps('identifier')}
|
|
69
|
+
label={auth.identifierLabel}
|
|
70
|
+
onKeyDown={handleKeyDown}
|
|
71
|
+
render={TextInput}
|
|
72
|
+
isAutoFocus
|
|
73
|
+
/>
|
|
74
|
+
<FormField
|
|
75
|
+
{...fieldProps('password')}
|
|
76
|
+
label="Password"
|
|
77
|
+
onKeyDown={handleKeyDown}
|
|
78
|
+
render={PasswordInput}
|
|
79
|
+
/>
|
|
80
|
+
<hr />
|
|
81
|
+
<Button isDisabled={isLoading} type="submit" isFullWidth>
|
|
82
|
+
{isLoading ? 'Loading...' : 'Log In'}
|
|
83
|
+
</Button>
|
|
84
|
+
</AuthForm>
|
|
188
85
|
<Alert
|
|
189
86
|
{...alertProps}
|
|
190
87
|
icon="lockClosed"
|
|
191
88
|
onClose={handleAlertClose}
|
|
192
|
-
title="2-Step
|
|
89
|
+
title="2-Step Authentication"
|
|
193
90
|
variant="warning"
|
|
194
91
|
width="sm"
|
|
195
92
|
>
|
|
196
|
-
<
|
|
93
|
+
<TwoFactor
|
|
197
94
|
formData={formData}
|
|
198
95
|
isLoading={isLoading}
|
|
199
96
|
onSubmit={handleSubmit}
|
|
200
97
|
setFormData={setFormData}
|
|
201
98
|
/>
|
|
202
99
|
</Alert>
|
|
100
|
+
<Alert
|
|
101
|
+
{...setupAlertProps}
|
|
102
|
+
icon="lockClosed"
|
|
103
|
+
onClose={handleAlertClose}
|
|
104
|
+
title="Setup 2-Step Authentication"
|
|
105
|
+
variant="warning"
|
|
106
|
+
width="sm"
|
|
107
|
+
>
|
|
108
|
+
<TwoFactorSetup data={formData} />
|
|
109
|
+
</Alert>
|
|
203
110
|
</Fragment>
|
|
204
111
|
);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
LoginForm.hasLayout = false;
|
|
208
|
-
|
|
209
|
-
LoginForm.propTypes = {
|
|
210
|
-
router: NextRouterPropType.isRequired,
|
|
211
|
-
};
|
|
112
|
+
}
|
|
212
113
|
|
|
213
114
|
export default LoginForm;
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
|
-
import Panel from '
|
|
4
|
+
import Panel from '../../core/Panel';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// Import styles from './Message.module.css';
|
|
7
7
|
|
|
8
8
|
interface MessageProps {
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
title?: string | null;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
function Message({ children, title }: MessageProps): React.ReactElement {
|
|
14
|
+
return (
|
|
15
|
+
<Panel isPadded isSpaced>
|
|
16
|
+
<div className="/*styles.root*/">
|
|
17
|
+
{title ? <h3 className="/*styles.title*/">{title}</h3> : null}
|
|
18
|
+
{children}
|
|
19
|
+
</div>
|
|
20
|
+
</Panel>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
21
23
|
|
|
22
24
|
Message.propTypes = {
|
|
23
25
|
children: PropTypes.node.isRequired,
|
|
@@ -1,21 +1,27 @@
|
|
|
1
|
+
/* istanbul ignore file */
|
|
2
|
+
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import { createPortal } from 'react-dom';
|
|
3
5
|
|
|
4
|
-
import ModalComponent from '
|
|
5
|
-
import type { ModalComponentProps } from '
|
|
6
|
+
import ModalComponent from '../../core/ModalComponent';
|
|
7
|
+
import type { ModalComponentProps } from '../../core/ModalComponent';
|
|
8
|
+
|
|
9
|
+
import { ifWindow } from '@sqrzro/utility';
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
function Modal(props: ModalComponentProps): React.ReactElement | null {
|
|
12
|
+
return ifWindow(() => {
|
|
13
|
+
if (typeof window === 'undefined') {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
11
16
|
|
|
12
|
-
|
|
17
|
+
const portalElement = document.getElementById('modal-portal');
|
|
13
18
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
if (!portalElement) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
17
22
|
|
|
18
|
-
|
|
19
|
-
};
|
|
23
|
+
return createPortal(<ModalComponent {...props} />, portalElement);
|
|
24
|
+
}, null);
|
|
25
|
+
}
|
|
20
26
|
|
|
21
27
|
export default Modal;
|
|
@@ -34,14 +34,16 @@ describe('ModalActions', () => {
|
|
|
34
34
|
expect(screen.getByRole('button')).toHaveTextContent(/^Saving\.\.\.$/u);
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
it('should handle onclick', () => {
|
|
37
|
+
it('should handle onclick', async () => {
|
|
38
|
+
const user = userEvent.setup();
|
|
39
|
+
|
|
38
40
|
const mockFn = jest.fn();
|
|
39
41
|
render(<ModalActions label="Lorem" onClick={mockFn} />);
|
|
40
42
|
|
|
41
43
|
expect(screen.getByRole('button')).toHaveAttribute('type', 'button');
|
|
42
44
|
|
|
43
45
|
expect(mockFn).toHaveBeenCalledTimes(0);
|
|
44
|
-
|
|
46
|
+
await user.click(screen.getByRole('button'));
|
|
45
47
|
expect(mockFn).toHaveBeenCalledTimes(1);
|
|
46
48
|
});
|
|
47
49
|
});
|
|
@@ -3,4 +3,6 @@ import ModalActions from './index';
|
|
|
3
3
|
|
|
4
4
|
export default { title: 'Components/ModalActions', component: ModalActions };
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export function Default(): React.ReactElement {
|
|
7
|
+
return <ModalActions label="Lorem Ipsum" />;
|
|
8
|
+
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import PropTypes from 'prop-types';
|
|
3
5
|
|
|
4
|
-
import Button from '
|
|
5
|
-
import type { ButtonVariant } from '
|
|
6
|
-
import { ButtonVariantPropType } from '
|
|
6
|
+
import Button from '../Button';
|
|
7
|
+
import type { ButtonVariant } from '../../utility/interfaces';
|
|
8
|
+
import { ButtonVariantPropType } from '../../utility/prop-types';
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
// Import styles from './ModalActions.module.css';
|
|
9
11
|
|
|
10
12
|
interface ModalActionsProps {
|
|
11
13
|
isDisabled?: boolean;
|
|
@@ -15,26 +17,28 @@ interface ModalActionsProps {
|
|
|
15
17
|
variant?: ButtonVariant | ButtonVariant[];
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
function ModalActions({
|
|
19
21
|
label,
|
|
20
22
|
isDisabled,
|
|
21
23
|
isLoading,
|
|
22
24
|
onClick,
|
|
23
25
|
variant,
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
<div>
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
}: ModalActionsProps): React.ReactElement {
|
|
27
|
+
return (
|
|
28
|
+
<div className="/*styles.root*/">
|
|
29
|
+
<div>
|
|
30
|
+
<Button
|
|
31
|
+
isDisabled={isDisabled || isLoading}
|
|
32
|
+
onClick={onClick}
|
|
33
|
+
type={onClick ? 'button' : 'submit'}
|
|
34
|
+
variant={variant}
|
|
35
|
+
>
|
|
36
|
+
{isLoading ? 'Saving...' : label}
|
|
37
|
+
</Button>
|
|
38
|
+
</div>
|
|
35
39
|
</div>
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
);
|
|
41
|
+
}
|
|
38
42
|
|
|
39
43
|
ModalActions.propTypes = {
|
|
40
44
|
label: PropTypes.string.isRequired,
|
|
@@ -3,4 +3,6 @@ import MoneyInput from './index';
|
|
|
3
3
|
|
|
4
4
|
export default { title: 'Components/MoneyInput', component: MoneyInput };
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export function Default(): React.ReactElement {
|
|
7
|
+
return <MoneyInput name="lorem" />;
|
|
8
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import React from 'react';
|
|
2
4
|
|
|
3
|
-
import TextInput from '
|
|
4
|
-
import type { TextInputProps } from '
|
|
5
|
+
import TextInput from '../TextInput';
|
|
6
|
+
import type { TextInputProps } from '../TextInput';
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* A `TextInput` component with a pre-defined `prefix` prop set to a pound sign. All other props are
|
|
@@ -9,8 +11,8 @@ import type { TextInputProps } from '@components/TextInput';
|
|
|
9
11
|
* prefix can be overridden or removed all together. If this is the case, the component is no
|
|
10
12
|
* different to a `TextInput`.
|
|
11
13
|
*/
|
|
12
|
-
|
|
13
|
-
<TextInput prefix="£" {...props}
|
|
14
|
-
|
|
14
|
+
function MoneyInput(props: TextInputProps): React.ReactElement {
|
|
15
|
+
return <TextInput prefix="£" {...props} />;
|
|
16
|
+
}
|
|
15
17
|
|
|
16
18
|
export default MoneyInput;
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import React, { Fragment } from 'react';
|
|
2
2
|
import Head from 'next/head';
|
|
3
|
+
import type { NextRouter } from 'next/router';
|
|
3
4
|
|
|
4
|
-
import
|
|
5
|
-
import
|
|
5
|
+
import PasswordForgotForm from '../../core/PasswordForgotForm';
|
|
6
|
+
import PasswordResetForm from '../../core/PasswordResetForm';
|
|
6
7
|
|
|
7
|
-
import
|
|
8
|
-
import PasswordResetForm from '@core/PasswordResetForm';
|
|
8
|
+
import useConfig from '../../hooks/useConfig';
|
|
9
9
|
|
|
10
|
-
import
|
|
10
|
+
import { NextRouterPropType } from '../../utility/prop-types';
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
interface PasswordFormProps {
|
|
13
|
+
router: Omit<NextRouter, 'events'>;
|
|
14
|
+
}
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const PasswordForm: SceneComponentType = ({ router }) => {
|
|
18
|
-
const { name } = useAppContext();
|
|
16
|
+
function PasswordForm({ router }: PasswordFormProps): React.ReactElement {
|
|
17
|
+
const { name } = useConfig();
|
|
19
18
|
const { token } = router.query;
|
|
20
19
|
|
|
21
20
|
return (
|
|
@@ -23,21 +22,10 @@ const PasswordForm: SceneComponentType = ({ router }) => {
|
|
|
23
22
|
<Head>
|
|
24
23
|
<title>Reset Password | {name}</title>
|
|
25
24
|
</Head>
|
|
26
|
-
<
|
|
27
|
-
<Panel isPadded>
|
|
28
|
-
<div className={styles.logo}>
|
|
29
|
-
<AppLogo />
|
|
30
|
-
</div>
|
|
31
|
-
{token ? (
|
|
32
|
-
<PasswordResetForm router={router} />
|
|
33
|
-
) : (
|
|
34
|
-
<PasswordForgotForm router={router} />
|
|
35
|
-
)}
|
|
36
|
-
</Panel>
|
|
37
|
-
</div>
|
|
25
|
+
{token ? <PasswordResetForm router={router} /> : <PasswordForgotForm router={router} />}
|
|
38
26
|
</Fragment>
|
|
39
27
|
);
|
|
40
|
-
}
|
|
28
|
+
}
|
|
41
29
|
|
|
42
30
|
PasswordForm.hasLayout = false;
|
|
43
31
|
|
|
@@ -30,12 +30,14 @@ describe('RadioList', () => {
|
|
|
30
30
|
expect(screen.getAllByRole('radio')[0]).toHaveAttribute('checked');
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
it('should handle onchange', () => {
|
|
33
|
+
it('should handle onchange', async () => {
|
|
34
|
+
const user = userEvent.setup();
|
|
35
|
+
|
|
34
36
|
const mockFn = jest.fn();
|
|
35
37
|
render(<RadioList data={mockData} name="lorem" onChange={mockFn} />);
|
|
36
38
|
|
|
37
39
|
expect(mockFn).toHaveBeenCalledTimes(0);
|
|
38
|
-
|
|
40
|
+
await user.click(screen.getAllByRole('radio')[0]);
|
|
39
41
|
expect(mockFn).toHaveBeenCalledTimes(1);
|
|
40
42
|
expect(mockFn).toHaveBeenLastCalledWith({
|
|
41
43
|
item: { id: '1', name: 'Lorem' },
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import React from 'react';
|
|
2
4
|
|
|
3
|
-
import ChkRadList from '
|
|
4
|
-
import type { ChkRadDataItem } from '
|
|
5
|
+
import ChkRadList from '../../core/ChkRadList';
|
|
6
|
+
import type { ChkRadDataItem } from '../../core/ChkRadList';
|
|
5
7
|
|
|
6
|
-
import type { InputProps } from '
|
|
8
|
+
import type { InputProps } from '../../utility/interfaces';
|
|
7
9
|
|
|
8
10
|
interface RadioListProps extends InputProps<string> {
|
|
9
11
|
columns?: number;
|
|
10
12
|
data: ChkRadDataItem[];
|
|
11
13
|
}
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
<ChkRadList {...props} type="radio"
|
|
15
|
-
|
|
15
|
+
function RadioList(props: RadioListProps): React.ReactElement {
|
|
16
|
+
return <ChkRadList {...props} type="radio" />;
|
|
17
|
+
}
|
|
16
18
|
|
|
17
19
|
export default RadioList;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { TestService } from '@sqrzro/utility';
|
|
4
|
+
|
|
5
|
+
import ConfirmModal from '../../core/ConfirmModal';
|
|
6
|
+
import Toast from '../../core/Toast';
|
|
7
|
+
|
|
8
|
+
import { ConfigProvider } from '../../hooks/useConfig';
|
|
9
|
+
|
|
10
|
+
import type { Config } from '../../services/ConfigService';
|
|
11
|
+
|
|
12
|
+
import register from '../../utility/register';
|
|
13
|
+
|
|
14
|
+
interface RootLayoutProps {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
config: Config;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function RootLayout({ children, config }: RootLayoutProps): React.ReactElement {
|
|
20
|
+
register(config);
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<html>
|
|
24
|
+
<head>
|
|
25
|
+
<link href="https://fonts.googleapis.com" rel="preconnect" />
|
|
26
|
+
<link crossOrigin="" href="https://fonts.gstatic.com" rel="preconnect" />
|
|
27
|
+
<link
|
|
28
|
+
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap"
|
|
29
|
+
rel="stylesheet"
|
|
30
|
+
/>
|
|
31
|
+
</head>
|
|
32
|
+
<body className="bg-slate-50">
|
|
33
|
+
<ConfigProvider value={config}>
|
|
34
|
+
{children}
|
|
35
|
+
<div id="alert-portal" />
|
|
36
|
+
<div id="modal-portal" />
|
|
37
|
+
<ConfirmModal />
|
|
38
|
+
<Toast />
|
|
39
|
+
</ConfigProvider>
|
|
40
|
+
</body>
|
|
41
|
+
</html>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default RootLayout;
|
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
.root {
|
|
2
|
+
display: grid;
|
|
3
|
+
gap: 1rem;
|
|
2
4
|
margin-bottom: 3rem;
|
|
3
5
|
|
|
4
6
|
@media (--media-sml) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
grid-template-columns: repeat(2, 1fr);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.rootHas4 {
|
|
12
|
+
@media (--media-med) {
|
|
13
|
+
grid-template-columns: repeat(4, 1fr);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.rootHas6 {
|
|
18
|
+
@media (--media-med) {
|
|
19
|
+
grid-template-columns: repeat(3, 1fr);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@media (--media-xlrg) {
|
|
23
|
+
grid-template-columns: repeat(6, 1fr);
|
|
9
24
|
}
|
|
10
25
|
}
|
|
11
26
|
|