@sqrzro/admin 1.0.0-beta.1
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 +4 -0
- package/.gitattributes +1 -0
- package/.prettierrc +9 -0
- package/.storybook/main.js +40 -0
- package/.storybook/manager.js +4 -0
- package/.storybook/postcss.config.js +3 -0
- package/.storybook/preview.js +11 -0
- package/.storybook/theme.js +7 -0
- package/.stylelintrc +9 -0
- package/LICENSE +5 -0
- package/README.md +9 -0
- package/__mocks__/squarezero-utility.ts +40 -0
- package/assets/logo-horizontal-dark.svg +21 -0
- package/assets/logo-horizontal-white.svg +21 -0
- package/assets/logo-vertical-dark.svg +21 -0
- package/assets/logo-vertical-white.svg +21 -0
- package/dist/index.css +3554 -0
- package/dist/index.js +5099 -0
- package/dist/index.js.map +1 -0
- package/dist/types/components/Alert/index.d.ts +10 -0
- package/dist/types/components/Allow/index.d.ts +13 -0
- package/dist/types/components/App/index.d.ts +19 -0
- package/dist/types/components/AutoSuggest/index.d.ts +60 -0
- package/dist/types/components/Button/index.d.ts +36 -0
- package/dist/types/components/CalendarInput/index.d.ts +10 -0
- package/dist/types/components/CheckboxList/index.d.ts +4 -0
- package/dist/types/components/ConnectedDropdown/index.d.ts +8 -0
- package/dist/types/components/ConnectedList/index.d.ts +4 -0
- package/dist/types/components/ConnectedScene/index.d.ts +11 -0
- package/dist/types/components/ConnectedTable/index.d.ts +4 -0
- package/dist/types/components/ContentBlock/index.d.ts +6 -0
- package/dist/types/components/DateInput/index.d.ts +7 -0
- package/dist/types/components/Document/index.d.ts +6 -0
- package/dist/types/components/Dropdown/index.d.ts +14 -0
- package/dist/types/components/Fieldset/index.d.ts +11 -0
- package/dist/types/components/FileInput/index.d.ts +4 -0
- package/dist/types/components/FilterLink/index.d.ts +7 -0
- package/dist/types/components/Form/index.d.ts +11 -0
- package/dist/types/components/FormActions/index.d.ts +9 -0
- package/dist/types/components/FormField/index.d.ts +27 -0
- package/dist/types/components/FormRepeater/index.d.ts +8 -0
- package/dist/types/components/ImageInput/index.d.ts +4 -0
- package/dist/types/components/InfoPanel/index.d.ts +8 -0
- package/dist/types/components/Link/__mocks__/index.d.ts +6 -0
- package/dist/types/components/Link/index.d.ts +13 -0
- package/dist/types/components/List/index.d.ts +23 -0
- package/dist/types/components/ListActions/index.d.ts +9 -0
- package/dist/types/components/LoginForm/index.d.ts +3 -0
- package/dist/types/components/Message/index.d.ts +7 -0
- package/dist/types/components/ModalActions/index.d.ts +11 -0
- package/dist/types/components/MoneyInput/index.d.ts +10 -0
- package/dist/types/components/PasswordForm/index.d.ts +3 -0
- package/dist/types/components/PasswordInput/index.d.ts +8 -0
- package/dist/types/components/RadioList/index.d.ts +4 -0
- package/dist/types/components/Scene/index.d.ts +10 -0
- package/dist/types/components/SummaryList/index.d.ts +8 -0
- package/dist/types/components/Switch/index.d.ts +9 -0
- package/dist/types/components/Table/index.d.ts +13 -0
- package/dist/types/components/Tag/index.d.ts +8 -0
- package/dist/types/components/TextArea/index.d.ts +4 -0
- package/dist/types/components/TextInput/index.d.ts +17 -0
- package/dist/types/components/WebsiteInput/index.d.ts +10 -0
- package/dist/types/components/WeekCalendar/index.d.ts +12 -0
- package/dist/types/core/AppHeader/index.d.ts +3 -0
- package/dist/types/core/AppLogo/index.d.ts +6 -0
- package/dist/types/core/AppLogoImage/index.d.ts +3 -0
- package/dist/types/core/AppLogoPlaceholder/index.d.ts +3 -0
- package/dist/types/core/Assistive/index.d.ts +6 -0
- package/dist/types/core/Banner/index.d.ts +3 -0
- package/dist/types/core/BuildModal/index.d.ts +3 -0
- package/dist/types/core/Calendar/index.d.ts +11 -0
- package/dist/types/core/CalendarDay/index.d.ts +16 -0
- package/dist/types/core/CalendarMonth/index.d.ts +12 -0
- package/dist/types/core/CalendarNavigation/index.d.ts +9 -0
- package/dist/types/core/CalendarWeek/index.d.ts +14 -0
- package/dist/types/core/ChkRad/index.d.ts +10 -0
- package/dist/types/core/ChkRadIcon/index.d.ts +7 -0
- package/dist/types/core/ChkRadList/index.d.ts +15 -0
- package/dist/types/core/CloseButton/index.d.ts +9 -0
- package/dist/types/core/ConfirmModal/index.d.ts +3 -0
- package/dist/types/core/ConnectedRepeater/index.d.ts +26 -0
- package/dist/types/core/ConnectedRepeaterComponent/index.d.ts +24 -0
- package/dist/types/core/Container/index.d.ts +7 -0
- package/dist/types/core/DropdownPanel/index.d.ts +18 -0
- package/dist/types/core/EmptyMessage/index.d.ts +12 -0
- package/dist/types/core/ErrorBoundary/index.d.ts +15 -0
- package/dist/types/core/ErrorMessage/index.d.ts +8 -0
- package/dist/types/core/FilterItem/index.d.ts +10 -0
- package/dist/types/core/Filters/index.d.ts +11 -0
- package/dist/types/core/FixedActions/index.d.ts +12 -0
- package/dist/types/core/FormError/index.d.ts +6 -0
- package/dist/types/core/FormLabel/index.d.ts +8 -0
- package/dist/types/core/FormLegend/index.d.ts +6 -0
- package/dist/types/core/Header/index.d.ts +8 -0
- package/dist/types/core/Icon/index.d.ts +7 -0
- package/dist/types/core/IconButton/Icon/index.d.ts +7 -0
- package/dist/types/core/IconButton/index.d.ts +11 -0
- package/dist/types/core/InputPanel/index.d.ts +8 -0
- package/dist/types/core/ListItem/index.d.ts +16 -0
- package/dist/types/core/ListItemAction/index.d.ts +4 -0
- package/dist/types/core/ListItemActions/index.d.ts +8 -0
- package/dist/types/core/ListItemMetaItem/index.d.ts +10 -0
- package/dist/types/core/ListItemTitle/index.d.ts +9 -0
- package/dist/types/core/Loader/index.d.ts +6 -0
- package/dist/types/core/MeActions/index.d.ts +3 -0
- package/dist/types/core/MePanel/index.d.ts +9 -0
- package/dist/types/core/Modal/index.d.ts +12 -0
- package/dist/types/core/Navigation/index.d.ts +3 -0
- package/dist/types/core/NavigationDivider/index.d.ts +3 -0
- package/dist/types/core/NavigationItem/index.d.ts +7 -0
- package/dist/types/core/Pagination/index.d.ts +7 -0
- package/dist/types/core/PaginationItem/index.d.ts +7 -0
- package/dist/types/core/Panel/index.d.ts +8 -0
- package/dist/types/core/RadialProgress/index.d.ts +8 -0
- package/dist/types/core/StaticTextInput/index.d.ts +12 -0
- package/dist/types/core/Styled/index.d.ts +6 -0
- package/dist/types/core/SummaryListItem/index.d.ts +15 -0
- package/dist/types/core/TableActionsCell/index.d.ts +8 -0
- package/dist/types/core/TableCell/index.d.ts +8 -0
- package/dist/types/core/TableHead/index.d.ts +8 -0
- package/dist/types/core/TableRow/index.d.ts +13 -0
- package/dist/types/core/Tabs/index.d.ts +11 -0
- package/dist/types/core/TextInputAncillary/index.d.ts +11 -0
- package/dist/types/core/Toast/index.d.ts +3 -0
- package/dist/types/core/WeekCalendarDay/index.d.ts +14 -0
- package/dist/types/filters/BooleanFilter/index.d.ts +5 -0
- package/dist/types/filters/DateFilter/index.d.ts +5 -0
- package/dist/types/filters/DropdownFilter/index.d.ts +5 -0
- package/dist/types/filters/QuickDateFilter/index.d.ts +5 -0
- package/dist/types/filters/interfaces.d.ts +36 -0
- package/dist/types/hooks/useAccessiblePanel.d.ts +13 -0
- package/dist/types/hooks/useAppContext.d.ts +37 -0
- package/dist/types/hooks/useClickOutside.d.ts +3 -0
- package/dist/types/hooks/useConnectedList.d.ts +7 -0
- package/dist/types/hooks/useFilters.d.ts +3 -0
- package/dist/types/hooks/useForm.d.ts +26 -0
- package/dist/types/hooks/useFormData.d.ts +9 -0
- package/dist/types/hooks/useLayout.d.ts +6 -0
- package/dist/types/hooks/useModal.d.ts +12 -0
- package/dist/types/hooks/useVariant.d.ts +6 -0
- package/dist/types/index.d.ts +187 -0
- package/dist/types/scenes/Error404Scene.d.ts +3 -0
- package/dist/types/services/BuildService.d.ts +5 -0
- package/dist/types/services/ConfirmService.d.ts +12 -0
- package/dist/types/services/DateService.d.ts +17 -0
- package/dist/types/services/DownloadService.d.ts +5 -0
- package/dist/types/services/FilterComponentService.d.ts +8 -0
- package/dist/types/services/FilterService.d.ts +13 -0
- package/dist/types/services/FormatService.d.ts +7 -0
- package/dist/types/services/ToastService.d.ts +5 -0
- package/dist/types/utility/MockRouter/index.d.ts +2 -0
- package/dist/types/utility/StorybookPanel/index.d.ts +7 -0
- package/dist/types/utility/TestChangeHandler/index.d.ts +8 -0
- package/dist/types/utility/create-app.d.ts +4 -0
- package/dist/types/utility/interfaces.d.ts +72 -0
- package/dist/types/utility/prop-types.d.ts +40 -0
- package/docs/guides/01-installation.story.mdx +33 -0
- package/docs/guides/02-configuration.story.mdx +80 -0
- package/docs/guides/03-pages.story.mdx +18 -0
- package/docs/guides/04-integration.story.mdx +33 -0
- package/docs/guides/a11y.story.mdx +7 -0
- package/docs/guides/theming.story.mdx +7 -0
- package/docs/introduction.story.mdx +17 -0
- package/jest.config.js +19 -0
- package/package.json +101 -0
- package/postcss.config.js +3 -0
- package/rollup.config.js +36 -0
- package/scripts/create-exports.js +74 -0
- package/scripts/update-license.js +8 -0
- package/squarezero.config.js +5 -0
- package/src/components/Alert/Alert.module.css +50 -0
- package/src/components/Alert/Alert.spec.tsx +63 -0
- package/src/components/Alert/Alert.story.tsx +23 -0
- package/src/components/Alert/index.tsx +67 -0
- package/src/components/Allow/Allow.spec.tsx +37 -0
- package/src/components/Allow/index.tsx +42 -0
- package/src/components/App/App.module.css +22 -0
- package/src/components/App/App.spec.tsx +128 -0
- package/src/components/App/index.tsx +108 -0
- package/src/components/AutoSuggest/AutoSuggest.module.css +8 -0
- package/src/components/AutoSuggest/AutoSuggest.spec.tsx +211 -0
- package/src/components/AutoSuggest/AutoSuggest.story.tsx +30 -0
- package/src/components/AutoSuggest/index.tsx +216 -0
- package/src/components/Button/Button.module.css +95 -0
- package/src/components/Button/Button.spec.tsx +69 -0
- package/src/components/Button/Button.story.tsx +39 -0
- package/src/components/Button/index.tsx +99 -0
- package/src/components/CalendarInput/CalendarInput.module.css +8 -0
- package/src/components/CalendarInput/CalendarInput.spec.tsx +206 -0
- package/src/components/CalendarInput/CalendarInput.story.tsx +62 -0
- package/src/components/CalendarInput/index.tsx +122 -0
- package/src/components/CheckboxList/CheckboxList.spec.tsx +83 -0
- package/src/components/CheckboxList/index.tsx +53 -0
- package/src/components/ConnectedDropdown/index.tsx +56 -0
- package/src/components/ConnectedList/index.tsx +15 -0
- package/src/components/ConnectedScene/index.tsx +95 -0
- package/src/components/ConnectedTable/index.tsx +17 -0
- package/src/components/ContentBlock/ContentBlock.module.css +8 -0
- package/src/components/ContentBlock/ContentBlock.spec.tsx +15 -0
- package/src/components/ContentBlock/index.tsx +16 -0
- package/src/components/DateInput/DateInput.module.css +15 -0
- package/src/components/DateInput/DateInput.spec.tsx +91 -0
- package/src/components/DateInput/index.tsx +149 -0
- package/src/components/Document/index.tsx +20 -0
- package/src/components/Dropdown/Dropdown.module.css +8 -0
- package/src/components/Dropdown/Dropdown.spec.tsx +286 -0
- package/src/components/Dropdown/Dropdown.story.tsx +53 -0
- package/src/components/Dropdown/index.tsx +224 -0
- package/src/components/Fieldset/Fieldset.spec.tsx +22 -0
- package/src/components/Fieldset/Fieldset.story.tsx +21 -0
- package/src/components/Fieldset/index.tsx +30 -0
- package/src/components/FileInput/FileInput.module.css +18 -0
- package/src/components/FileInput/FileInput.spec.tsx +42 -0
- package/src/components/FileInput/FileInput.story.tsx +6 -0
- package/src/components/FileInput/index.tsx +72 -0
- package/src/components/FilterLink/FilterLink.module.css +9 -0
- package/src/components/FilterLink/FilterLink.spec.tsx +20 -0
- package/src/components/FilterLink/index.tsx +31 -0
- package/src/components/Form/Form.spec.tsx +68 -0
- package/src/components/Form/index.tsx +87 -0
- package/src/components/FormActions/FormActions.spec.tsx +10 -0
- package/src/components/FormActions/FormActions.story.tsx +23 -0
- package/src/components/FormActions/index.tsx +31 -0
- package/src/components/FormField/FormField.module.css +71 -0
- package/src/components/FormField/FormField.spec.tsx +137 -0
- package/src/components/FormField/FormField.story.tsx +22 -0
- package/src/components/FormField/index.tsx +162 -0
- package/src/components/FormRepeater/FormRepeater.module.css +3 -0
- package/src/components/FormRepeater/FormRepeater.spec.tsx +127 -0
- package/src/components/FormRepeater/index.tsx +118 -0
- package/src/components/ImageInput/ImageInput.module.css +74 -0
- package/src/components/ImageInput/ImageInput.spec.tsx +45 -0
- package/src/components/ImageInput/ImageInput.story.tsx +6 -0
- package/src/components/ImageInput/index.tsx +91 -0
- package/src/components/InfoPanel/InfoPanel.module.css +18 -0
- package/src/components/InfoPanel/InfoPanel.spec.tsx +15 -0
- package/src/components/InfoPanel/InfoPanel.story.tsx +32 -0
- package/src/components/InfoPanel/index.tsx +25 -0
- package/src/components/Link/Link.spec.tsx +62 -0
- package/src/components/Link/__mocks__/index.tsx +24 -0
- package/src/components/Link/index.tsx +51 -0
- package/src/components/List/List.module.css +9 -0
- package/src/components/List/List.spec.tsx +311 -0
- package/src/components/List/List.story.tsx +92 -0
- package/src/components/List/index.tsx +79 -0
- package/src/components/ListActions/ListActions.spec.tsx +10 -0
- package/src/components/ListActions/ListActions.story.tsx +6 -0
- package/src/components/ListActions/index.tsx +31 -0
- package/src/components/LoginForm/LoginForm.module.css +21 -0
- package/src/components/LoginForm/LoginForm.spec.tsx +63 -0
- package/src/components/LoginForm/index.tsx +102 -0
- package/src/components/Message/Message.module.css +14 -0
- package/src/components/Message/Message.spec.tsx +20 -0
- package/src/components/Message/index.tsx +27 -0
- package/src/components/ModalActions/ModalActions.module.css +5 -0
- package/src/components/ModalActions/ModalActions.spec.tsx +53 -0
- package/src/components/ModalActions/ModalActions.story.tsx +6 -0
- package/src/components/ModalActions/index.tsx +47 -0
- package/src/components/MoneyInput/MoneyInput.spec.tsx +17 -0
- package/src/components/MoneyInput/MoneyInput.story.tsx +6 -0
- package/src/components/MoneyInput/index.tsx +16 -0
- package/src/components/PasswordForm/PasswordForm.module.css +21 -0
- package/src/components/PasswordForm/index.tsx +94 -0
- package/src/components/PasswordInput/PasswordInput.module.css +23 -0
- package/src/components/PasswordInput/PasswordInput.spec.tsx +31 -0
- package/src/components/PasswordInput/PasswordInput.story.tsx +16 -0
- package/src/components/PasswordInput/index.tsx +27 -0
- package/src/components/RadioList/RadioList.spec.tsx +45 -0
- package/src/components/RadioList/index.tsx +10 -0
- package/src/components/Scene/Scene.spec.tsx +123 -0
- package/src/components/Scene/Scene.story.tsx +6 -0
- package/src/components/Scene/index.tsx +58 -0
- package/src/components/SummaryList/SummaryList.module.css +16 -0
- package/src/components/SummaryList/SummaryList.spec.tsx +77 -0
- package/src/components/SummaryList/SummaryList.story.tsx +11 -0
- package/src/components/SummaryList/index.tsx +37 -0
- package/src/components/Switch/Switch.module.css +86 -0
- package/src/components/Switch/Switch.spec.tsx +64 -0
- package/src/components/Switch/index.tsx +85 -0
- package/src/components/Table/Table.module.css +14 -0
- package/src/components/Table/Table.spec.tsx +128 -0
- package/src/components/Table/Table.story.tsx +101 -0
- package/src/components/Table/index.tsx +114 -0
- package/src/components/Tag/Tag.module.css +37 -0
- package/src/components/Tag/Tag.spec.tsx +10 -0
- package/src/components/Tag/Tag.story.tsx +55 -0
- package/src/components/Tag/index.tsx +27 -0
- package/src/components/TextArea/TextArea.module.css +23 -0
- package/src/components/TextArea/TextArea.spec.tsx +77 -0
- package/src/components/TextArea/index.tsx +59 -0
- package/src/components/TextInput/TextInput.module.css +57 -0
- package/src/components/TextInput/TextInput.spec.tsx +134 -0
- package/src/components/TextInput/TextInput.story.tsx +24 -0
- package/src/components/TextInput/index.tsx +146 -0
- package/src/components/WebsiteInput/WebsiteInput.spec.tsx +17 -0
- package/src/components/WebsiteInput/index.tsx +16 -0
- package/src/components/WeekCalendar/WeekCalendar.module.css +19 -0
- package/src/components/WeekCalendar/index.tsx +80 -0
- package/src/core/AppHeader/index.tsx +23 -0
- package/src/core/AppLogo/AppLogo.module.css +19 -0
- package/src/core/AppLogo/index.tsx +33 -0
- package/src/core/AppLogoImage/index.tsx +19 -0
- package/src/core/AppLogoPlaceholder/index.tsx +26 -0
- package/src/core/Assistive/Assistive.module.css +10 -0
- package/src/core/Assistive/index.tsx +18 -0
- package/src/core/Banner/Banner.module.css +36 -0
- package/src/core/Banner/index.tsx +25 -0
- package/src/core/BuildModal/index.tsx +119 -0
- package/src/core/Calendar/index.tsx +116 -0
- package/src/core/CalendarDay/CalendarDay.module.css +61 -0
- package/src/core/CalendarDay/index.tsx +82 -0
- package/src/core/CalendarMonth/CalendarMonth.module.css +13 -0
- package/src/core/CalendarMonth/index.tsx +101 -0
- package/src/core/CalendarNavigation/CalendarNavigation.module.css +26 -0
- package/src/core/CalendarNavigation/index.tsx +56 -0
- package/src/core/CalendarWeek/index.tsx +95 -0
- package/src/core/ChkRad/ChkRad.module.css +31 -0
- package/src/core/ChkRad/ChkRad.spec.tsx +72 -0
- package/src/core/ChkRad/index.tsx +80 -0
- package/src/core/ChkRadIcon/ChkRadIcon.module.css +28 -0
- package/src/core/ChkRadIcon/index.tsx +33 -0
- package/src/core/ChkRadList/ChkRadList.module.css +10 -0
- package/src/core/ChkRadList/index.tsx +85 -0
- package/src/core/CloseButton/CloseButton.spec.tsx +36 -0
- package/src/core/CloseButton/index.tsx +31 -0
- package/src/core/ConfirmModal/ConfirmModal.spec.tsx +88 -0
- package/src/core/ConfirmModal/index.tsx +51 -0
- package/src/core/ConnectedRepeater/index.tsx +248 -0
- package/src/core/ConnectedRepeaterComponent/index.tsx +66 -0
- package/src/core/Container/Container.module.css +12 -0
- package/src/core/Container/index.tsx +35 -0
- package/src/core/DropdownPanel/DropdownPanel.module.css +68 -0
- package/src/core/DropdownPanel/index.tsx +92 -0
- package/src/core/EmptyMessage/EmptyMessage.module.css +18 -0
- package/src/core/EmptyMessage/index.tsx +31 -0
- package/src/core/ErrorBoundary/ErrorBoundary.spec.tsx +33 -0
- package/src/core/ErrorBoundary/index.tsx +42 -0
- package/src/core/ErrorMessage/ErrorMessage.module.css +25 -0
- package/src/core/ErrorMessage/ErrorMessage.spec.tsx +31 -0
- package/src/core/ErrorMessage/index.tsx +37 -0
- package/src/core/FilterItem/FilterItem.module.css +104 -0
- package/src/core/FilterItem/index.tsx +164 -0
- package/src/core/Filters/Filters.module.css +86 -0
- package/src/core/Filters/Filters.spec.tsx +533 -0
- package/src/core/Filters/index.tsx +158 -0
- package/src/core/FixedActions/FixedActions.module.css +24 -0
- package/src/core/FixedActions/index.tsx +52 -0
- package/src/core/FormError/FormError.module.css +7 -0
- package/src/core/FormError/index.tsx +18 -0
- package/src/core/FormLabel/FormLabel.module.css +15 -0
- package/src/core/FormLabel/index.tsx +25 -0
- package/src/core/FormLegend/FormLegend.module.css +13 -0
- package/src/core/FormLegend/index.tsx +18 -0
- package/src/core/Header/Header.module.css +35 -0
- package/src/core/Header/index.tsx +37 -0
- package/src/core/Icon/Icon.spec.tsx +31 -0
- package/src/core/Icon/index.tsx +64 -0
- package/src/core/IconButton/Icon/Icon.spec.tsx +31 -0
- package/src/core/IconButton/Icon/index.tsx +64 -0
- package/src/core/IconButton/IconButton.module.css +32 -0
- package/src/core/IconButton/index.tsx +55 -0
- package/src/core/InputPanel/InputPanel.module.css +70 -0
- package/src/core/InputPanel/index.tsx +28 -0
- package/src/core/ListItem/ListItem.module.css +28 -0
- package/src/core/ListItem/ListItem.story.tsx +28 -0
- package/src/core/ListItem/index.tsx +99 -0
- package/src/core/ListItemAction/ListItemAction.module.css +28 -0
- package/src/core/ListItemAction/index.tsx +30 -0
- package/src/core/ListItemActions/ListItemActions.module.css +94 -0
- package/src/core/ListItemActions/index.tsx +55 -0
- package/src/core/ListItemMetaItem/ListItemMetaItem.module.css +18 -0
- package/src/core/ListItemMetaItem/index.tsx +54 -0
- package/src/core/ListItemTitle/ListItemTitle.module.css +14 -0
- package/src/core/ListItemTitle/ListItemTitle.spec.tsx +33 -0
- package/src/core/ListItemTitle/index.tsx +72 -0
- package/src/core/Loader/Loader.module.css +57 -0
- package/src/core/Loader/Loader.story.tsx +8 -0
- package/src/core/Loader/index.tsx +27 -0
- package/src/core/MeActions/MeActions.module.css +45 -0
- package/src/core/MeActions/index.tsx +46 -0
- package/src/core/MePanel/MePanel.module.css +75 -0
- package/src/core/MePanel/index.tsx +45 -0
- package/src/core/Modal/Modal.module.css +84 -0
- package/src/core/Modal/Modal.spec.tsx +51 -0
- package/src/core/Modal/index.tsx +66 -0
- package/src/core/Navigation/Navigation.module.css +83 -0
- package/src/core/Navigation/Navigation.spec.tsx +101 -0
- package/src/core/Navigation/index.tsx +109 -0
- package/src/core/NavigationDivider/NavigationDivider.module.css +18 -0
- package/src/core/NavigationDivider/index.tsx +13 -0
- package/src/core/NavigationItem/NavigationItem.module.css +51 -0
- package/src/core/NavigationItem/index.tsx +59 -0
- package/src/core/Pagination/Pagination.module.css +15 -0
- package/src/core/Pagination/index.tsx +100 -0
- package/src/core/PaginationItem/PaginationItem.module.css +33 -0
- package/src/core/PaginationItem/index.tsx +46 -0
- package/src/core/Panel/Panel.module.css +15 -0
- package/src/core/Panel/index.tsx +31 -0
- package/src/core/RadialProgress/RadialProgress.module.css +78 -0
- package/src/core/RadialProgress/index.tsx +52 -0
- package/src/core/StaticTextInput/StaticTextInput.module.css +79 -0
- package/src/core/StaticTextInput/StaticTextInput.spec.tsx +133 -0
- package/src/core/StaticTextInput/index.tsx +114 -0
- package/src/core/Styled/Styled.spec.tsx +38 -0
- package/src/core/Styled/Styled.story.tsx +10 -0
- package/src/core/Styled/index.tsx +62 -0
- package/src/core/SummaryListItem/SummaryListItem.module.css +28 -0
- package/src/core/SummaryListItem/index.tsx +60 -0
- package/src/core/TableActionsCell/TableActionsCell.module.css +3 -0
- package/src/core/TableActionsCell/index.tsx +37 -0
- package/src/core/TableCell/TableCell.module.css +16 -0
- package/src/core/TableCell/index.tsx +39 -0
- package/src/core/TableHead/TableHead.module.css +12 -0
- package/src/core/TableHead/index.tsx +48 -0
- package/src/core/TableRow/index.tsx +64 -0
- package/src/core/Tabs/Tabs.module.css +50 -0
- package/src/core/Tabs/index.tsx +94 -0
- package/src/core/TextInputAncillary/TextInputAncillary.module.css +64 -0
- package/src/core/TextInputAncillary/index.tsx +72 -0
- package/src/core/Toast/Toast.module.css +55 -0
- package/src/core/Toast/Toast.spec.tsx +78 -0
- package/src/core/Toast/index.tsx +81 -0
- package/src/core/WeekCalendarDay/WeekCalendarDay.module.css +32 -0
- package/src/core/WeekCalendarDay/index.tsx +68 -0
- package/src/filters/BooleanFilter/index.tsx +46 -0
- package/src/filters/DateFilter/index.tsx +36 -0
- package/src/filters/DropdownFilter/index.tsx +53 -0
- package/src/filters/QuickDateFilter/index.tsx +74 -0
- package/src/filters/interfaces.ts +40 -0
- package/src/hooks/useAccessiblePanel.spec.tsx +88 -0
- package/src/hooks/useAccessiblePanel.ts +74 -0
- package/src/hooks/useAppContext.ts +77 -0
- package/src/hooks/useClickOutside.ts +49 -0
- package/src/hooks/useConnectedList.ts +26 -0
- package/src/hooks/useFilters.ts +26 -0
- package/src/hooks/useForm.spec.ts +126 -0
- package/src/hooks/useForm.ts +99 -0
- package/src/hooks/useFormData.spec.ts +40 -0
- package/src/hooks/useFormData.ts +27 -0
- package/src/hooks/useLayout.spec.ts +55 -0
- package/src/hooks/useLayout.ts +29 -0
- package/src/hooks/useModal.spec.tsx +63 -0
- package/src/hooks/useModal.ts +60 -0
- package/src/hooks/useVariant.spec.ts +14 -0
- package/src/hooks/useVariant.ts +34 -0
- package/src/index.ts +194 -0
- package/src/scenes/Error404Scene.tsx +5 -0
- package/src/services/BuildService.spec.ts +56 -0
- package/src/services/BuildService.ts +34 -0
- package/src/services/ConfirmService.ts +21 -0
- package/src/services/DateService.spec.ts +87 -0
- package/src/services/DateService.ts +137 -0
- package/src/services/DownloadService.spec.ts +29 -0
- package/src/services/DownloadService.ts +14 -0
- package/src/services/FilterComponentService.tsx +46 -0
- package/src/services/FilterService.spec.ts +87 -0
- package/src/services/FilterService.ts +58 -0
- package/src/services/FormatService.spec.ts +83 -0
- package/src/services/FormatService.ts +55 -0
- package/src/services/ToastService.spec.ts +44 -0
- package/src/services/ToastService.ts +19 -0
- package/src/styles/layout.css +64 -0
- package/src/styles/variables.css +85 -0
- package/src/typings.d.ts +4 -0
- package/src/utility/MockRouter/index.ts +45 -0
- package/src/utility/StorybookPanel/StorybookPanel.module.css +9 -0
- package/src/utility/StorybookPanel/index.tsx +25 -0
- package/src/utility/TestChangeHandler/TestChangeHandler.module.css +7 -0
- package/src/utility/TestChangeHandler/TestChangeHandler.spec.tsx +24 -0
- package/src/utility/TestChangeHandler/index.tsx +54 -0
- package/src/utility/create-app.tsx +29 -0
- package/src/utility/interfaces.ts +119 -0
- package/src/utility/prop-types.ts +67 -0
- package/tests/setupFilesAfterEnv.js +10 -0
- package/tsconfig.json +26 -0
- package/tsconfig.types.json +9 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
--top: calc((var(--header-height) - var(--input-height)) / 2);
|
|
3
|
+
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: row;
|
|
6
|
+
position: fixed;
|
|
7
|
+
right: clamp(1rem, 2.5vw, 3rem);
|
|
8
|
+
top: var(--top);
|
|
9
|
+
z-index: 4;
|
|
10
|
+
|
|
11
|
+
& > * {
|
|
12
|
+
width: auto;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
& > *:not(:first-child) {
|
|
16
|
+
margin-left: 1rem;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.rootTopbar {
|
|
21
|
+
--top: calc((var(--header-height) - var(--input-height)) / 2);
|
|
22
|
+
|
|
23
|
+
top: calc(var(--banner-height) + var(--top));
|
|
24
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
|
|
5
|
+
import useLayout from '@hooks/useLayout';
|
|
6
|
+
|
|
7
|
+
import Button from '@components/Button';
|
|
8
|
+
|
|
9
|
+
import styles from './FixedActions.module.css';
|
|
10
|
+
|
|
11
|
+
interface FixedActionsProps {
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
isDisabled?: boolean;
|
|
14
|
+
isLoading?: boolean;
|
|
15
|
+
label: string;
|
|
16
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
17
|
+
to?: string;
|
|
18
|
+
type?: 'button' | 'submit';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const FixedActions: React.FunctionComponent<FixedActionsProps> = ({
|
|
22
|
+
children,
|
|
23
|
+
label,
|
|
24
|
+
isDisabled,
|
|
25
|
+
isLoading,
|
|
26
|
+
onClick,
|
|
27
|
+
to,
|
|
28
|
+
type,
|
|
29
|
+
}) => {
|
|
30
|
+
const { applyLayoutClassName } = useLayout();
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div className={classNames(styles.root, applyLayoutClassName(styles))}>
|
|
34
|
+
{children}
|
|
35
|
+
<Button isDisabled={isDisabled || isLoading} onClick={onClick} to={to} type={type}>
|
|
36
|
+
{label}
|
|
37
|
+
</Button>
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
FixedActions.propTypes = {
|
|
43
|
+
label: PropTypes.string.isRequired,
|
|
44
|
+
children: PropTypes.node,
|
|
45
|
+
isDisabled: PropTypes.bool,
|
|
46
|
+
isLoading: PropTypes.bool,
|
|
47
|
+
to: PropTypes.string,
|
|
48
|
+
type: PropTypes.oneOf(['button', 'submit']),
|
|
49
|
+
onClick: PropTypes.func,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export default FixedActions;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
|
|
4
|
+
import styles from './FormError.module.css';
|
|
5
|
+
|
|
6
|
+
interface FormErrorProps {
|
|
7
|
+
message: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const FormError: React.FunctionComponent<FormErrorProps> = ({ message }) => (
|
|
11
|
+
<div className={styles.root}>{message}</div>
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
FormError.propTypes = {
|
|
15
|
+
message: PropTypes.string.isRequired,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default FormError;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
color: var(--clr-grey600);
|
|
3
|
+
display: flex;
|
|
4
|
+
font-size: var(--fs-sml);
|
|
5
|
+
font-weight: var(--fw-semibold);
|
|
6
|
+
line-height: 1;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.optional {
|
|
10
|
+
color: var(--clr-grey500);
|
|
11
|
+
font-size: var(--fs-xsml);
|
|
12
|
+
font-style: italic;
|
|
13
|
+
margin-left: 1rem;
|
|
14
|
+
padding-top: .1rem;
|
|
15
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
|
|
4
|
+
import styles from './FormLabel.module.css';
|
|
5
|
+
|
|
6
|
+
interface FormLabelProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
htmlFor: string;
|
|
9
|
+
isOptional?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const FormLabel: React.FunctionComponent<FormLabelProps> = ({ children, htmlFor, isOptional }) => (
|
|
13
|
+
<label className={styles.root} htmlFor={htmlFor}>
|
|
14
|
+
{children}
|
|
15
|
+
{isOptional && <small className={styles.optional}>(Optional)</small>}
|
|
16
|
+
</label>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
FormLabel.propTypes = {
|
|
20
|
+
children: PropTypes.node.isRequired,
|
|
21
|
+
htmlFor: PropTypes.string.isRequired,
|
|
22
|
+
isOptional: PropTypes.bool,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default FormLabel;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
border-bottom: .1rem var(--clr-grey300) solid;
|
|
3
|
+
color: var(--clr-grey600);
|
|
4
|
+
float: left;
|
|
5
|
+
font-size: var(--fs-lrg);
|
|
6
|
+
font-weight: var(--fw-bold);
|
|
7
|
+
line-height: 1;
|
|
8
|
+
margin-bottom: 3rem;
|
|
9
|
+
margin-left: -.2rem;
|
|
10
|
+
margin-top: -.5rem;
|
|
11
|
+
padding-bottom: 2rem;
|
|
12
|
+
width: 100%;
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
|
|
4
|
+
import styles from './FormLegend.module.css';
|
|
5
|
+
|
|
6
|
+
interface FormLegendProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const FormLegend: React.FunctionComponent<FormLegendProps> = ({ children }) => (
|
|
11
|
+
<legend className={styles.root}>{children}</legend>
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
FormLegend.propTypes = {
|
|
15
|
+
children: PropTypes.node.isRequired,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default FormLegend;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
background-color: var(--clr-white);
|
|
3
|
+
box-shadow: 0 .3rem .3rem rgba(0, 0, 0, .02), 0 1rem 1rem rgba(0, 0, 0, .02);
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
height: 6rem;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
padding: 0 clamp(1rem, 2.5vw, 3rem);
|
|
9
|
+
position: sticky;
|
|
10
|
+
text-align: left;
|
|
11
|
+
top: 0;
|
|
12
|
+
z-index: 2;
|
|
13
|
+
|
|
14
|
+
@media (--media-sml) {
|
|
15
|
+
height: var(--header-height);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.rootTopbar {
|
|
20
|
+
position: relative;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.title {
|
|
24
|
+
color: var(--clr-grey600);
|
|
25
|
+
font-size: var(--fs-lrg);
|
|
26
|
+
font-weight: var(--fw-bold);
|
|
27
|
+
|
|
28
|
+
@media (--media-sml) {
|
|
29
|
+
font-size: var(--fs-xlrg);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.titleDanger {
|
|
34
|
+
color: var(--clr-danger);
|
|
35
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
|
|
5
|
+
import { ucwords } from '@sqrzro/utility';
|
|
6
|
+
|
|
7
|
+
import useLayout from '@hooks/useLayout';
|
|
8
|
+
|
|
9
|
+
import type { StyleVariant } from '@utility/interfaces';
|
|
10
|
+
|
|
11
|
+
import styles from './Header.module.css';
|
|
12
|
+
|
|
13
|
+
interface HeaderProps {
|
|
14
|
+
title?: string | null;
|
|
15
|
+
variant?: StyleVariant;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const Header: React.FunctionComponent<HeaderProps> = ({ title, variant }) => {
|
|
19
|
+
const { applyLayoutClassName } = useLayout();
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<header className={classNames(styles.root, applyLayoutClassName(styles))}>
|
|
23
|
+
<h1
|
|
24
|
+
className={classNames(styles.title, variant && styles[`title${ucwords(variant)}`])}
|
|
25
|
+
data-testid="header-title"
|
|
26
|
+
>
|
|
27
|
+
{title || '•••'}
|
|
28
|
+
</h1>
|
|
29
|
+
</header>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
Header.propTypes = {
|
|
34
|
+
title: PropTypes.string,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default Header;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
|
|
4
|
+
import Icon from './index';
|
|
5
|
+
|
|
6
|
+
describe('Icon', () => {
|
|
7
|
+
it('should render', () => {
|
|
8
|
+
render(<Icon icon="x" />);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('should render defaults', () => {
|
|
12
|
+
render(<Icon icon="x" />);
|
|
13
|
+
|
|
14
|
+
const img = screen.getByRole('img', { hidden: true });
|
|
15
|
+
// eslint-disable-next-line testing-library/no-node-access
|
|
16
|
+
expect(img?.querySelector('path')?.getAttribute('d')?.startsWith('M4.293')).toBe(true);
|
|
17
|
+
expect(img.style).toHaveProperty('width', '20px');
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should render size', () => {
|
|
21
|
+
render(<Icon icon="x" size={16} />);
|
|
22
|
+
|
|
23
|
+
const img = screen.getByRole('img', { hidden: true });
|
|
24
|
+
expect(img.style).toHaveProperty('width', '16px');
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('should render invalid icon', () => {
|
|
28
|
+
render(<Icon icon="UNDEFINED" />);
|
|
29
|
+
expect(screen.queryByTestId('icon-root')).not.toBeInTheDocument();
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/* eslint-disable react/forbid-component-props */
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import {
|
|
5
|
+
ArrowLeftIcon,
|
|
6
|
+
ArrowRightIcon,
|
|
7
|
+
CalendarIcon,
|
|
8
|
+
CheckCircleIcon,
|
|
9
|
+
CheckIcon,
|
|
10
|
+
ChevronDownIcon,
|
|
11
|
+
ExclamationCircleIcon,
|
|
12
|
+
FilterIcon,
|
|
13
|
+
UploadIcon,
|
|
14
|
+
XIcon,
|
|
15
|
+
} from '@heroicons/react/solid';
|
|
16
|
+
import PropTypes from 'prop-types';
|
|
17
|
+
|
|
18
|
+
const DEFAULT_SIZE = 20;
|
|
19
|
+
|
|
20
|
+
interface Props extends React.SVGProps<SVGSVGElement> {
|
|
21
|
+
size?: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const iconMap: Record<string, (props: Props) => JSX.Element> = {
|
|
25
|
+
arrowLeft: ArrowLeftIcon,
|
|
26
|
+
arrowRight: ArrowRightIcon,
|
|
27
|
+
calendar: CalendarIcon,
|
|
28
|
+
checkCircle: CheckCircleIcon,
|
|
29
|
+
check: CheckIcon,
|
|
30
|
+
chevronDown: ChevronDownIcon,
|
|
31
|
+
exclamationCircle: ExclamationCircleIcon,
|
|
32
|
+
filter: FilterIcon,
|
|
33
|
+
upload: UploadIcon,
|
|
34
|
+
x: XIcon, // eslint-disable-line id-length
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
interface IconProps {
|
|
38
|
+
icon: string;
|
|
39
|
+
size?: number;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const Icon: React.FunctionComponent<IconProps> = ({ icon, size }) => {
|
|
43
|
+
const Component = iconMap[icon];
|
|
44
|
+
|
|
45
|
+
return Component ? (
|
|
46
|
+
<Component
|
|
47
|
+
data-testid="icon-root"
|
|
48
|
+
role="img"
|
|
49
|
+
style={{
|
|
50
|
+
display: 'block',
|
|
51
|
+
fill: 'inherit',
|
|
52
|
+
stroke: 'inherit',
|
|
53
|
+
width: `${size || DEFAULT_SIZE}px`,
|
|
54
|
+
}}
|
|
55
|
+
/>
|
|
56
|
+
) : null;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
Icon.propTypes = {
|
|
60
|
+
icon: PropTypes.string.isRequired,
|
|
61
|
+
size: PropTypes.number,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export default Icon;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
|
|
4
|
+
import Icon from './index';
|
|
5
|
+
|
|
6
|
+
describe('Icon', () => {
|
|
7
|
+
it('should render', () => {
|
|
8
|
+
render(<Icon icon="x" />);
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('should render defaults', () => {
|
|
12
|
+
render(<Icon icon="x" />);
|
|
13
|
+
|
|
14
|
+
const img = screen.getByRole('img', { hidden: true });
|
|
15
|
+
// eslint-disable-next-line testing-library/no-node-access
|
|
16
|
+
expect(img?.querySelector('path')?.getAttribute('d')?.startsWith('M4.293')).toBe(true);
|
|
17
|
+
expect(img.style).toHaveProperty('width', '20px');
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should render size', () => {
|
|
21
|
+
render(<Icon icon="x" size={16} />);
|
|
22
|
+
|
|
23
|
+
const img = screen.getByRole('img', { hidden: true });
|
|
24
|
+
expect(img.style).toHaveProperty('width', '16px');
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('should render invalid icon', () => {
|
|
28
|
+
render(<Icon icon="UNDEFINED" />);
|
|
29
|
+
expect(screen.queryByTestId('icon-root')).not.toBeInTheDocument();
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/* eslint-disable react/forbid-component-props */
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import {
|
|
5
|
+
ArrowLeftIcon,
|
|
6
|
+
ArrowRightIcon,
|
|
7
|
+
CalendarIcon,
|
|
8
|
+
CheckCircleIcon,
|
|
9
|
+
CheckIcon,
|
|
10
|
+
ChevronDownIcon,
|
|
11
|
+
ExclamationCircleIcon,
|
|
12
|
+
FilterIcon,
|
|
13
|
+
UploadIcon,
|
|
14
|
+
XIcon,
|
|
15
|
+
} from '@heroicons/react/solid';
|
|
16
|
+
import PropTypes from 'prop-types';
|
|
17
|
+
|
|
18
|
+
const DEFAULT_SIZE = 20;
|
|
19
|
+
|
|
20
|
+
interface Props extends React.SVGProps<SVGSVGElement> {
|
|
21
|
+
size?: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const iconMap: Record<string, (props: Props) => JSX.Element> = {
|
|
25
|
+
arrowLeft: ArrowLeftIcon,
|
|
26
|
+
arrowRight: ArrowRightIcon,
|
|
27
|
+
calendar: CalendarIcon,
|
|
28
|
+
checkCircle: CheckCircleIcon,
|
|
29
|
+
check: CheckIcon,
|
|
30
|
+
chevronDown: ChevronDownIcon,
|
|
31
|
+
exclamationCircle: ExclamationCircleIcon,
|
|
32
|
+
filter: FilterIcon,
|
|
33
|
+
upload: UploadIcon,
|
|
34
|
+
x: XIcon, // eslint-disable-line id-length
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
interface IconProps {
|
|
38
|
+
icon: string;
|
|
39
|
+
size?: number;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const Icon: React.FunctionComponent<IconProps> = ({ icon, size }) => {
|
|
43
|
+
const Component = iconMap[icon];
|
|
44
|
+
|
|
45
|
+
return Component ? (
|
|
46
|
+
<Component
|
|
47
|
+
data-testid="icon-root"
|
|
48
|
+
role="img"
|
|
49
|
+
style={{
|
|
50
|
+
display: 'block',
|
|
51
|
+
fill: 'inherit',
|
|
52
|
+
stroke: 'inherit',
|
|
53
|
+
width: `${size || DEFAULT_SIZE}px`,
|
|
54
|
+
}}
|
|
55
|
+
/>
|
|
56
|
+
) : null;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
Icon.propTypes = {
|
|
60
|
+
icon: PropTypes.string.isRequired,
|
|
61
|
+
size: PropTypes.number,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export default Icon;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
align-items: center;
|
|
3
|
+
background: none;
|
|
4
|
+
border: .1rem transparent solid;
|
|
5
|
+
border-radius: .7rem;
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
display: flex;
|
|
8
|
+
fill: var(--clr-grey600);
|
|
9
|
+
height: 4rem;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
position: relative;
|
|
13
|
+
width: 4rem;
|
|
14
|
+
|
|
15
|
+
&:focus {
|
|
16
|
+
border: .1rem var(--clr-grey400) dashed;
|
|
17
|
+
outline: none;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.rootSm {
|
|
22
|
+
height: 3rem;
|
|
23
|
+
width: 3rem;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.rootWhite {
|
|
27
|
+
fill: var(--clr-white);
|
|
28
|
+
|
|
29
|
+
&:focus {
|
|
30
|
+
border-color: var(--clr-white);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
|
|
5
|
+
import { ucwords } from '@sqrzro/utility';
|
|
6
|
+
|
|
7
|
+
import Assistive from '@core/Assistive';
|
|
8
|
+
import Icon from '@core/Icon';
|
|
9
|
+
|
|
10
|
+
import styles from './IconButton.module.css';
|
|
11
|
+
|
|
12
|
+
const iconSizeMap: Record<string, number> = { sm: 16, md: 24 };
|
|
13
|
+
|
|
14
|
+
interface IconButtonProps {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
icon: string;
|
|
17
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/sort-type-union-intersection-members
|
|
19
|
+
size?: 'sm' | 'md' | 'lg';
|
|
20
|
+
type?: 'button' | 'submit';
|
|
21
|
+
variant?: 'white';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const IconButton: React.FunctionComponent<IconButtonProps> = ({
|
|
25
|
+
children,
|
|
26
|
+
icon,
|
|
27
|
+
onClick,
|
|
28
|
+
size,
|
|
29
|
+
type,
|
|
30
|
+
variant,
|
|
31
|
+
}) => (
|
|
32
|
+
<button
|
|
33
|
+
className={classNames(
|
|
34
|
+
styles.root,
|
|
35
|
+
styles[`root${ucwords(size || 'md')}`],
|
|
36
|
+
variant && styles[`root${ucwords(variant)}`]
|
|
37
|
+
)}
|
|
38
|
+
onClick={onClick}
|
|
39
|
+
type={type === 'submit' ? 'submit' : 'button'}
|
|
40
|
+
>
|
|
41
|
+
<Icon icon={icon} size={iconSizeMap[size || 'md']} />
|
|
42
|
+
<Assistive>{children}</Assistive>
|
|
43
|
+
</button>
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
IconButton.propTypes = {
|
|
47
|
+
children: PropTypes.node.isRequired,
|
|
48
|
+
icon: PropTypes.string.isRequired,
|
|
49
|
+
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
50
|
+
type: PropTypes.oneOf(['button', 'submit']),
|
|
51
|
+
variant: PropTypes.oneOf(['white']),
|
|
52
|
+
onClick: PropTypes.func,
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default IconButton;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
@keyframes enter {
|
|
2
|
+
from {
|
|
3
|
+
opacity: 0;
|
|
4
|
+
transform: translate3d(0, 1rem, 0);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
to {
|
|
8
|
+
opacity: 1;
|
|
9
|
+
transform: translate3d(0, 0, 0);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@keyframes enterReverse {
|
|
14
|
+
from {
|
|
15
|
+
opacity: 0;
|
|
16
|
+
transform: translate3d(0, 1rem, 0);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
to {
|
|
20
|
+
opacity: 1;
|
|
21
|
+
transform: translate3d(0, 0, 0);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.root {
|
|
26
|
+
animation: enter .2s;
|
|
27
|
+
background-color: var(--clr-white);
|
|
28
|
+
border: .1rem var(--clr-grey400) solid;
|
|
29
|
+
border-radius: .3rem;
|
|
30
|
+
box-shadow: 0 .3rem .5rem rgba(0, 0, 0, .05);
|
|
31
|
+
left: 0;
|
|
32
|
+
min-width: 100%;
|
|
33
|
+
position: absolute;
|
|
34
|
+
top: calc(100% + .5rem);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.rootIsReverse {
|
|
38
|
+
animation-name: enterReverse;
|
|
39
|
+
bottom: calc(100% + .5rem);
|
|
40
|
+
top: auto;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.rootMd {
|
|
44
|
+
width: 30rem;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.rootLg {
|
|
48
|
+
width: 50rem;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.inner {
|
|
52
|
+
max-height: 25rem;
|
|
53
|
+
overflow-x: hidden;
|
|
54
|
+
overflow-y: auto;
|
|
55
|
+
scrollbar-arrow-color: var(--clr-grey500);
|
|
56
|
+
scrollbar-base-color: var(--clr-grey500);
|
|
57
|
+
|
|
58
|
+
&::-webkit-scrollbar {
|
|
59
|
+
width: .5rem;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&::-webkit-scrollbar-track {
|
|
63
|
+
background-color: transparent;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&::-webkit-scrollbar-thumb {
|
|
67
|
+
background-color: var(--clr-grey300);
|
|
68
|
+
border-radius: 0;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
|
|
5
|
+
import { ucwords } from '@sqrzro/utility';
|
|
6
|
+
|
|
7
|
+
import styles from './InputPanel.module.css';
|
|
8
|
+
|
|
9
|
+
interface InputPanelProps {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
isScrollable?: boolean;
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/sort-type-union-intersection-members
|
|
13
|
+
size?: 'sm' | 'md' | 'lg';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const InputPanel: React.FunctionComponent<InputPanelProps> = ({ children, isScrollable, size }) => (
|
|
17
|
+
<div className={classNames(styles.root, size && styles[`root${ucwords(size)}`])}>
|
|
18
|
+
{isScrollable ? <div className={styles.inner}>{children}</div> : children}
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
InputPanel.propTypes = {
|
|
23
|
+
children: PropTypes.node.isRequired,
|
|
24
|
+
isScrollable: PropTypes.bool,
|
|
25
|
+
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default InputPanel;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.inner {
|
|
2
|
+
border-bottom: .1rem var(--clr-grey300) solid;
|
|
3
|
+
display: flex;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
margin-bottom: 1.5rem;
|
|
6
|
+
padding-bottom: 1.5rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.content {
|
|
10
|
+
border-bottom: .1rem var(--clr-grey300) solid;
|
|
11
|
+
margin-bottom: 1.5rem;
|
|
12
|
+
padding-bottom: 1.5rem;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.footer {
|
|
16
|
+
display: flex;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
margin-top: 2rem;
|
|
19
|
+
position: relative;
|
|
20
|
+
width: 100%;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.meta {
|
|
24
|
+
color: var(--clr-grey600);
|
|
25
|
+
display: flex;
|
|
26
|
+
font-size: var(--fs-sml);
|
|
27
|
+
line-height: 2rem;
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ListItem from './index';
|
|
3
|
+
|
|
4
|
+
export default { title: 'Core/ListItem', component: ListItem };
|
|
5
|
+
|
|
6
|
+
export const Default = (): React.ReactElement => (
|
|
7
|
+
<ListItem
|
|
8
|
+
$id={1}
|
|
9
|
+
meta={['Dolor', 'Adiscit']}
|
|
10
|
+
secondary={{ title: 'Dolor Adiscit' }}
|
|
11
|
+
title="Lorem Ipsum"
|
|
12
|
+
to="http://example.com"
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export const Basic = (): React.ReactElement => <ListItem $id={1} title="Lorem Ipsum" />;
|
|
17
|
+
|
|
18
|
+
export const WithMeta = (): React.ReactElement => (
|
|
19
|
+
<ListItem $id={1} meta={['Dolor', 'Adiscit']} title="Lorem Ipsum" />
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export const WithSecondary = (): React.ReactElement => (
|
|
23
|
+
<ListItem $id={1} secondary={{ title: 'Dolor Adiscit' }} title="Lorem Ipsum" />
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export const WithTo = (): React.ReactElement => (
|
|
27
|
+
<ListItem $id={1} title="Lorem Ipsum" to="http://example.com" />
|
|
28
|
+
);
|