@idea-fragments/react-components-zendesk 0.1.1 → 0.1.2
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/dist/alert.js +2701 -3288
- package/dist/alert.js.map +1 -1
- package/dist/index.js +1002 -0
- package/dist/index.js.map +1 -0
- package/dist/types/components/forms/selectors/Dropdown/Item.d.ts +1 -1
- package/dist/types/components/tags/Chip.d.ts +1 -1
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +14 -3
- package/.node-version +0 -1
- package/.storybook/ThemeProvider.tsx +0 -15
- package/.storybook/main.js +0 -13
- package/.storybook/preview.js +0 -20
- package/dist/forms.js +0 -101816
- package/dist/forms.js.map +0 -1
- package/entries/alert.ts +0 -1
- package/entries/forms.ts +0 -46
- package/entries/hooks.ts +0 -3
- package/entries/icon.ts +0 -1
- package/entries/layouts.ts +0 -15
- package/entries/loaders.ts +0 -3
- package/entries/mobx.ts +0 -6
- package/entries/modal.ts +0 -1
- package/entries/navigation.ts +0 -3
- package/entries/notifications.ts +0 -2
- package/entries/styles.ts +0 -16
- package/entries/tables.ts +0 -4
- package/entries/tags.ts +0 -2
- package/entries/text.ts +0 -7
- package/entries/tooltips.ts +0 -2
- package/entries/types.ts +0 -3
- package/entries/utils.ts +0 -4
- package/react_components_zendesk.iml +0 -9
- package/rollup.config.js +0 -40
- package/src/GlobalStyle.js +0 -43
- package/src/calendarCss.js +0 -2
- package/src/components/Alert.tsx +0 -175
- package/src/components/Drawer.tsx +0 -244
- package/src/components/Icon.tsx +0 -43
- package/src/components/Modal.tsx +0 -206
- package/src/components/StyledComponentProps.type.ts +0 -3
- package/src/components/StyledProps.type.ts +0 -4
- package/src/components/calendars/Legendable.type.tsx +0 -4
- package/src/components/calendars/TinyCalendar.tsx +0 -185
- package/src/components/calendars/TinyMonthYearCalendar.tsx +0 -57
- package/src/components/calendars/blocks/Legend.tsx +0 -44
- package/src/components/calendars/blocks/MonthPicker.tsx +0 -54
- package/src/components/calendars/blocks/MonthYearPicker.tsx +0 -101
- package/src/components/calendars/blocks/YearPicker.tsx +0 -44
- package/src/components/forms/Button.tsx +0 -214
- package/src/components/forms/Checkbox.tsx +0 -99
- package/src/components/forms/CycleButton.stories.tsx +0 -23
- package/src/components/forms/CycleButton.tsx +0 -52
- package/src/components/forms/Form.tsx +0 -43
- package/src/components/forms/Hint.tsx +0 -12
- package/src/components/forms/IconButton.tsx +0 -29
- package/src/components/forms/Label.tsx +0 -9
- package/src/components/forms/TaggedToggle.stories.tsx +0 -18
- package/src/components/forms/TaggedToggle.tsx +0 -19
- package/src/components/forms/Toggle.stories.tsx +0 -30
- package/src/components/forms/Toggle.tsx +0 -62
- package/src/components/forms/ValidatedFormProps.type.ts +0 -3
- package/src/components/forms/Validation.type.ts +0 -10
- package/src/components/forms/buttonMixins.ts +0 -74
- package/src/components/forms/formField.types.ts +0 -26
- package/src/components/forms/selectors/BooleanSelector.tsx +0 -71
- package/src/components/forms/selectors/DatePickerSelector.tsx +0 -88
- package/src/components/forms/selectors/Dropdown/Item.tsx +0 -34
- package/src/components/forms/selectors/Dropdown.tsx +0 -410
- package/src/components/forms/selectors/MonthYearSelector.tsx +0 -54
- package/src/components/forms/selectors/MultiSelector.tsx +0 -58
- package/src/components/forms/selectors/SearchableSelector.tsx +0 -120
- package/src/components/forms/selectors/Selector.tsx +0 -55
- package/src/components/forms/selectors/SelectorEmptyState.tsx +0 -5
- package/src/components/forms/selectors/types.ts +0 -43
- package/src/components/forms/textfields/EmailTextField.tsx +0 -7
- package/src/components/forms/textfields/NumberTextField.tsx +0 -17
- package/src/components/forms/textfields/PasswordTextField.tsx +0 -12
- package/src/components/forms/textfields/TextArea.tsx +0 -25
- package/src/components/forms/textfields/TextField.tsx +0 -45
- package/src/components/forms/textfields/TextFieldWrapper.tsx +0 -120
- package/src/components/forms/validationStates.ts +0 -6
- package/src/components/layout/AppBar.tsx +0 -137
- package/src/components/layout/AppBarLayout.tsx +0 -55
- package/src/components/layout/Carousel.tsx +0 -44
- package/src/components/layout/Container.tsx +0 -43
- package/src/components/layout/FlexBlock.tsx +0 -122
- package/src/components/layout/FlexBox.tsx +0 -69
- package/src/components/layout/Grid.tsx +0 -23
- package/src/components/layout/Line.tsx +0 -13
- package/src/components/layout/OpacityTransition.tsx +0 -6
- package/src/components/layout/OverflowMenu.tsx +0 -45
- package/src/components/layout/Section.tsx +0 -41
- package/src/components/layout/Sidebar.tsx +0 -107
- package/src/components/layout/SidebarLayout.tsx +0 -32
- package/src/components/layout/Tabs.tsx +0 -39
- package/src/components/loaders/AsyncLoadable.tsx +0 -57
- package/src/components/loaders/Dots.tsx +0 -16
- package/src/components/loaders/Loadable.tsx +0 -99
- package/src/components/loaders/Loader.tsx +0 -52
- package/src/components/loaders/TranslucentLoader.tsx +0 -49
- package/src/components/mobx/Alert.tsx +0 -33
- package/src/components/mobx/Drawer.tsx +0 -13
- package/src/components/mobx/ErrorBoundary.tsx +0 -56
- package/src/components/mobx/Modal.tsx +0 -44
- package/src/components/navigation/Breadcrumbs.tsx +0 -49
- package/src/components/navigation/ButtonLink.tsx +0 -55
- package/src/components/navigation/InlineButtonLink.tsx +0 -9
- package/src/components/notification/InfoPanel.tsx +0 -70
- package/src/components/notification/Notification.tsx +0 -51
- package/src/components/tables/MobileTable/Row.tsx +0 -147
- package/src/components/tables/MobileTable.tsx +0 -67
- package/src/components/tables/NiceTable.tsx +0 -81
- package/src/components/tables/Row.tsx +0 -84
- package/src/components/tables/SimpleTable.tsx +0 -99
- package/src/components/tables/Table.tsx +0 -153
- package/src/components/tables/blocks/Header.tsx +0 -119
- package/src/components/tables/blocks/HelpText.tsx +0 -9
- package/src/components/tables/blocks/Pagination.tsx +0 -85
- package/src/components/tables/blocks/TableFilter.tsx +0 -56
- package/src/components/tables/blocks/Title.tsx +0 -6
- package/src/components/tables/index.tsx +0 -106
- package/src/components/tables/utils.ts +0 -1
- package/src/components/tags/Chip.tsx +0 -44
- package/src/components/tags/Tag.tsx +0 -23
- package/src/components/text/Header.js +0 -55
- package/src/components/text/Hint.js +0 -25
- package/src/components/text/Label.js +0 -18
- package/src/components/text/Paragraph.js +0 -35
- package/src/components/text/Text.tsx +0 -33
- package/src/components/tooltips/IconTooltip.stories.tsx +0 -20
- package/src/components/tooltips/IconTooltip.tsx +0 -25
- package/src/components/tooltips/Tooltip.tsx +0 -30
- package/src/global.d.ts +0 -29
- package/src/hooks/useIsMounted.ts +0 -11
- package/src/hooks/useLoader.tsx +0 -73
- package/src/hooks/useLoaderV2.tsx +0 -51
- package/src/index.css +0 -34
- package/src/index.js +0 -4
- package/src/stores/useStores.tsx +0 -11
- package/src/stories/Introduction.stories.mdx +0 -211
- package/src/stories/assets/code-brackets.svg +0 -1
- package/src/stories/assets/colors.svg +0 -1
- package/src/stories/assets/comments.svg +0 -1
- package/src/stories/assets/direction.svg +0 -1
- package/src/stories/assets/flow.svg +0 -1
- package/src/stories/assets/plugin.svg +0 -1
- package/src/stories/assets/repo.svg +0 -1
- package/src/stories/assets/stackalt.svg +0 -1
- package/src/styles/DeviceSizeWatcher.ts +0 -113
- package/src/styles/alignments.ts +0 -9
- package/src/styles/colors.ts +0 -51
- package/src/styles/deviceSizes.ts +0 -28
- package/src/styles/mediaQueries.ts +0 -83
- package/src/styles/mixins.ts +0 -23
- package/src/styles/spacings.ts +0 -16
- package/src/styles/theme/Theme.type.ts +0 -76
- package/src/styles/theme/base.ts +0 -47
- package/src/styles/theme/dark.ts +0 -36
- package/src/styles/theme/light.ts +0 -44
- package/src/styles/theme/light2.ts +0 -22
- package/src/styles/theme/useTheme.ts +0 -5
- package/src/styles/types.ts +0 -18
- package/src/styles/typography.ts +0 -67
- package/src/utils/NavBarScrollWatcher.ts +0 -59
- package/src/utils/arrayHelpers.ts +0 -56
- package/src/utils/dateTime/DateRange.type.ts +0 -6
- package/src/utils/dateTime/calendar.ts +0 -23
- package/src/utils/dateTimeHelpers.ts +0 -105
- package/src/utils/function.types.ts +0 -1
- package/src/utils/functionHelpers.ts +0 -23
- package/src/utils/idGenerator.ts +0 -8
- package/src/utils/logging/Logger.ts +0 -34
- package/src/utils/logging/Logger.type.ts +0 -7
- package/src/utils/logging/loggable.tsx +0 -17
- package/src/utils/logging/with_module_logging.ts +0 -8
- package/src/utils/numberHelpers.ts +0 -4
- package/src/utils/typeCheckers.ts +0 -6
- package/src/utils/types.d.ts +0 -1
- package/src/utils/validateFields.ts +0 -14
- package/src/zendeskGardenCss.js +0 -15
- package/tsconfig.json +0 -30
- package/type_defs/GlobalStyle.d.ts +0 -2
- package/type_defs/GlobalStyle.d.ts.map +0 -1
- package/type_defs/calendarCss.d.ts +0 -2
- package/type_defs/calendarCss.d.ts.map +0 -1
- package/type_defs/components/Alert.d.ts +0 -24
- package/type_defs/components/Alert.d.ts.map +0 -1
- package/type_defs/components/Drawer.d.ts +0 -18
- package/type_defs/components/Drawer.d.ts.map +0 -1
- package/type_defs/components/Icon.d.ts +0 -15
- package/type_defs/components/Icon.d.ts.map +0 -1
- package/type_defs/components/Modal.d.ts +0 -31
- package/type_defs/components/Modal.d.ts.map +0 -1
- package/type_defs/components/StyledComponentProps.type.d.ts +0 -4
- package/type_defs/components/StyledComponentProps.type.d.ts.map +0 -1
- package/type_defs/components/StyledProps.type.d.ts +0 -4
- package/type_defs/components/StyledProps.type.d.ts.map +0 -1
- package/type_defs/components/calendars/Legendable.type.d.ts +0 -5
- package/type_defs/components/calendars/Legendable.type.d.ts.map +0 -1
- package/type_defs/components/calendars/TinyCalendar.d.ts +0 -25
- package/type_defs/components/calendars/TinyCalendar.d.ts.map +0 -1
- package/type_defs/components/calendars/TinyMonthYearCalendar.d.ts +0 -11
- package/type_defs/components/calendars/TinyMonthYearCalendar.d.ts.map +0 -1
- package/type_defs/components/calendars/blocks/Legend.d.ts +0 -12
- package/type_defs/components/calendars/blocks/Legend.d.ts.map +0 -1
- package/type_defs/components/calendars/blocks/MonthPicker.d.ts +0 -8
- package/type_defs/components/calendars/blocks/MonthPicker.d.ts.map +0 -1
- package/type_defs/components/calendars/blocks/MonthYearPicker.d.ts +0 -16
- package/type_defs/components/calendars/blocks/MonthYearPicker.d.ts.map +0 -1
- package/type_defs/components/calendars/blocks/YearPicker.d.ts +0 -10
- package/type_defs/components/calendars/blocks/YearPicker.d.ts.map +0 -1
- package/type_defs/components/forms/Button.d.ts +0 -41
- package/type_defs/components/forms/Button.d.ts.map +0 -1
- package/type_defs/components/forms/Checkbox.d.ts +0 -10
- package/type_defs/components/forms/Checkbox.d.ts.map +0 -1
- package/type_defs/components/forms/CycleButton.d.ts +0 -14
- package/type_defs/components/forms/CycleButton.d.ts.map +0 -1
- package/type_defs/components/forms/CycleButton.stories.d.ts +0 -16
- package/type_defs/components/forms/CycleButton.stories.d.ts.map +0 -1
- package/type_defs/components/forms/Form.d.ts +0 -9
- package/type_defs/components/forms/Form.d.ts.map +0 -1
- package/type_defs/components/forms/Hint.d.ts +0 -2
- package/type_defs/components/forms/Hint.d.ts.map +0 -1
- package/type_defs/components/forms/IconButton.d.ts +0 -6
- package/type_defs/components/forms/IconButton.d.ts.map +0 -1
- package/type_defs/components/forms/Label.d.ts +0 -2
- package/type_defs/components/forms/Label.d.ts.map +0 -1
- package/type_defs/components/forms/TaggedToggle.d.ts +0 -8
- package/type_defs/components/forms/TaggedToggle.d.ts.map +0 -1
- package/type_defs/components/forms/TaggedToggle.stories.d.ts +0 -12
- package/type_defs/components/forms/TaggedToggle.stories.d.ts.map +0 -1
- package/type_defs/components/forms/Toggle.d.ts +0 -12
- package/type_defs/components/forms/Toggle.d.ts.map +0 -1
- package/type_defs/components/forms/Toggle.stories.d.ts +0 -18
- package/type_defs/components/forms/Toggle.stories.d.ts.map +0 -1
- package/type_defs/components/forms/ValidatedFormProps.type.d.ts +0 -6
- package/type_defs/components/forms/ValidatedFormProps.type.d.ts.map +0 -1
- package/type_defs/components/forms/Validation.type.d.ts +0 -9
- package/type_defs/components/forms/Validation.type.d.ts.map +0 -1
- package/type_defs/components/forms/buttonMixins.d.ts +0 -23
- package/type_defs/components/forms/buttonMixins.d.ts.map +0 -1
- package/type_defs/components/forms/formField.types.d.ts +0 -23
- package/type_defs/components/forms/formField.types.d.ts.map +0 -1
- package/type_defs/components/forms/selectors/BooleanSelector.d.ts +0 -11
- package/type_defs/components/forms/selectors/BooleanSelector.d.ts.map +0 -1
- package/type_defs/components/forms/selectors/DatePickerSelector.d.ts +0 -19
- package/type_defs/components/forms/selectors/DatePickerSelector.d.ts.map +0 -1
- package/type_defs/components/forms/selectors/Dropdown/Item.d.ts +0 -19
- package/type_defs/components/forms/selectors/Dropdown/Item.d.ts.map +0 -1
- package/type_defs/components/forms/selectors/Dropdown.d.ts +0 -28
- package/type_defs/components/forms/selectors/Dropdown.d.ts.map +0 -1
- package/type_defs/components/forms/selectors/MonthYearSelector.d.ts +0 -9
- package/type_defs/components/forms/selectors/MonthYearSelector.d.ts.map +0 -1
- package/type_defs/components/forms/selectors/MultiSelector.d.ts +0 -9
- package/type_defs/components/forms/selectors/MultiSelector.d.ts.map +0 -1
- package/type_defs/components/forms/selectors/SearchableSelector.d.ts +0 -8
- package/type_defs/components/forms/selectors/SearchableSelector.d.ts.map +0 -1
- package/type_defs/components/forms/selectors/Selector.d.ts +0 -4
- package/type_defs/components/forms/selectors/Selector.d.ts.map +0 -1
- package/type_defs/components/forms/selectors/SelectorEmptyState.d.ts +0 -2
- package/type_defs/components/forms/selectors/SelectorEmptyState.d.ts.map +0 -1
- package/type_defs/components/forms/selectors/types.d.ts +0 -41
- package/type_defs/components/forms/selectors/types.d.ts.map +0 -1
- package/type_defs/components/forms/textfields/EmailTextField.d.ts +0 -4
- package/type_defs/components/forms/textfields/EmailTextField.d.ts.map +0 -1
- package/type_defs/components/forms/textfields/NumberTextField.d.ts +0 -4
- package/type_defs/components/forms/textfields/NumberTextField.d.ts.map +0 -1
- package/type_defs/components/forms/textfields/PasswordTextField.d.ts +0 -8
- package/type_defs/components/forms/textfields/PasswordTextField.d.ts.map +0 -1
- package/type_defs/components/forms/textfields/TextArea.d.ts +0 -9
- package/type_defs/components/forms/textfields/TextArea.d.ts.map +0 -1
- package/type_defs/components/forms/textfields/TextField.d.ts +0 -14
- package/type_defs/components/forms/textfields/TextField.d.ts.map +0 -1
- package/type_defs/components/forms/textfields/TextFieldWrapper.d.ts +0 -13
- package/type_defs/components/forms/textfields/TextFieldWrapper.d.ts.map +0 -1
- package/type_defs/components/forms/validationStates.d.ts +0 -7
- package/type_defs/components/forms/validationStates.d.ts.map +0 -1
- package/type_defs/components/layout/AppBar.d.ts +0 -14
- package/type_defs/components/layout/AppBar.d.ts.map +0 -1
- package/type_defs/components/layout/AppBarLayout.d.ts +0 -15
- package/type_defs/components/layout/AppBarLayout.d.ts.map +0 -1
- package/type_defs/components/layout/Carousel.d.ts +0 -13
- package/type_defs/components/layout/Carousel.d.ts.map +0 -1
- package/type_defs/components/layout/Container.d.ts +0 -4
- package/type_defs/components/layout/Container.d.ts.map +0 -1
- package/type_defs/components/layout/FlexBlock.d.ts +0 -19
- package/type_defs/components/layout/FlexBlock.d.ts.map +0 -1
- package/type_defs/components/layout/FlexBox.d.ts +0 -18
- package/type_defs/components/layout/FlexBox.d.ts.map +0 -1
- package/type_defs/components/layout/Grid.d.ts +0 -4
- package/type_defs/components/layout/Grid.d.ts.map +0 -1
- package/type_defs/components/layout/Line.d.ts +0 -6
- package/type_defs/components/layout/Line.d.ts.map +0 -1
- package/type_defs/components/layout/OpacityTransition.d.ts +0 -4
- package/type_defs/components/layout/OpacityTransition.d.ts.map +0 -1
- package/type_defs/components/layout/OverflowMenu.d.ts +0 -13
- package/type_defs/components/layout/OverflowMenu.d.ts.map +0 -1
- package/type_defs/components/layout/Section.d.ts +0 -6
- package/type_defs/components/layout/Section.d.ts.map +0 -1
- package/type_defs/components/layout/Sidebar.d.ts +0 -12
- package/type_defs/components/layout/Sidebar.d.ts.map +0 -1
- package/type_defs/components/layout/SidebarLayout.d.ts +0 -5
- package/type_defs/components/layout/SidebarLayout.d.ts.map +0 -1
- package/type_defs/components/layout/Tabs.d.ts +0 -3
- package/type_defs/components/layout/Tabs.d.ts.map +0 -1
- package/type_defs/components/loaders/AsyncLoadable.d.ts +0 -13
- package/type_defs/components/loaders/AsyncLoadable.d.ts.map +0 -1
- package/type_defs/components/loaders/Dots.d.ts +0 -9
- package/type_defs/components/loaders/Dots.d.ts.map +0 -1
- package/type_defs/components/loaders/Loadable.d.ts +0 -10
- package/type_defs/components/loaders/Loadable.d.ts.map +0 -1
- package/type_defs/components/loaders/Loader.d.ts +0 -15
- package/type_defs/components/loaders/Loader.d.ts.map +0 -1
- package/type_defs/components/loaders/TranslucentLoader.d.ts +0 -9
- package/type_defs/components/loaders/TranslucentLoader.d.ts.map +0 -1
- package/type_defs/components/mobx/Alert.d.ts +0 -4
- package/type_defs/components/mobx/Alert.d.ts.map +0 -1
- package/type_defs/components/mobx/Drawer.d.ts +0 -5
- package/type_defs/components/mobx/Drawer.d.ts.map +0 -1
- package/type_defs/components/mobx/ErrorBoundary.d.ts +0 -24
- package/type_defs/components/mobx/ErrorBoundary.d.ts.map +0 -1
- package/type_defs/components/mobx/Modal.d.ts +0 -4
- package/type_defs/components/mobx/Modal.d.ts.map +0 -1
- package/type_defs/components/navigation/Breadcrumbs.d.ts +0 -3
- package/type_defs/components/navigation/Breadcrumbs.d.ts.map +0 -1
- package/type_defs/components/navigation/ButtonLink.d.ts +0 -25
- package/type_defs/components/navigation/ButtonLink.d.ts.map +0 -1
- package/type_defs/components/navigation/InlineButtonLink.d.ts +0 -3
- package/type_defs/components/navigation/InlineButtonLink.d.ts.map +0 -1
- package/type_defs/components/notification/InfoPanel.d.ts +0 -18
- package/type_defs/components/notification/InfoPanel.d.ts.map +0 -1
- package/type_defs/components/notification/Notification.d.ts +0 -14
- package/type_defs/components/notification/Notification.d.ts.map +0 -1
- package/type_defs/components/tables/MobileTable/Row.d.ts +0 -14
- package/type_defs/components/tables/MobileTable/Row.d.ts.map +0 -1
- package/type_defs/components/tables/MobileTable.d.ts +0 -9
- package/type_defs/components/tables/MobileTable.d.ts.map +0 -1
- package/type_defs/components/tables/NiceTable.d.ts +0 -12
- package/type_defs/components/tables/NiceTable.d.ts.map +0 -1
- package/type_defs/components/tables/Row.d.ts +0 -19
- package/type_defs/components/tables/Row.d.ts.map +0 -1
- package/type_defs/components/tables/SimpleTable.d.ts +0 -9
- package/type_defs/components/tables/SimpleTable.d.ts.map +0 -1
- package/type_defs/components/tables/Table.d.ts +0 -73
- package/type_defs/components/tables/Table.d.ts.map +0 -1
- package/type_defs/components/tables/blocks/Header.d.ts +0 -17
- package/type_defs/components/tables/blocks/Header.d.ts.map +0 -1
- package/type_defs/components/tables/blocks/HelpText.d.ts +0 -5
- package/type_defs/components/tables/blocks/HelpText.d.ts.map +0 -1
- package/type_defs/components/tables/blocks/Pagination.d.ts +0 -8
- package/type_defs/components/tables/blocks/Pagination.d.ts.map +0 -1
- package/type_defs/components/tables/blocks/TableFilter.d.ts +0 -9
- package/type_defs/components/tables/blocks/TableFilter.d.ts.map +0 -1
- package/type_defs/components/tables/blocks/Title.d.ts +0 -7
- package/type_defs/components/tables/blocks/Title.d.ts.map +0 -1
- package/type_defs/components/tables/index.d.ts +0 -9
- package/type_defs/components/tables/index.d.ts.map +0 -1
- package/type_defs/components/tables/utils.d.ts +0 -2
- package/type_defs/components/tables/utils.d.ts.map +0 -1
- package/type_defs/components/tags/Chip.d.ts +0 -18
- package/type_defs/components/tags/Chip.d.ts.map +0 -1
- package/type_defs/components/tags/Tag.d.ts +0 -8
- package/type_defs/components/tags/Tag.d.ts.map +0 -1
- package/type_defs/components/text/Header.d.ts +0 -31
- package/type_defs/components/text/Header.d.ts.map +0 -1
- package/type_defs/components/text/Hint.d.ts +0 -10
- package/type_defs/components/text/Hint.d.ts.map +0 -1
- package/type_defs/components/text/Label.d.ts +0 -7
- package/type_defs/components/text/Label.d.ts.map +0 -1
- package/type_defs/components/text/Paragraph.d.ts +0 -37
- package/type_defs/components/text/Paragraph.d.ts.map +0 -1
- package/type_defs/components/text/Text.d.ts +0 -7
- package/type_defs/components/text/Text.d.ts.map +0 -1
- package/type_defs/components/tooltips/IconTooltip.d.ts +0 -10
- package/type_defs/components/tooltips/IconTooltip.d.ts.map +0 -1
- package/type_defs/components/tooltips/IconTooltip.stories.d.ts +0 -18
- package/type_defs/components/tooltips/IconTooltip.stories.d.ts.map +0 -1
- package/type_defs/components/tooltips/Tooltip.d.ts +0 -14
- package/type_defs/components/tooltips/Tooltip.d.ts.map +0 -1
- package/type_defs/hooks/useIsMounted.d.ts +0 -2
- package/type_defs/hooks/useIsMounted.d.ts.map +0 -1
- package/type_defs/hooks/useLoader.d.ts +0 -10
- package/type_defs/hooks/useLoader.d.ts.map +0 -1
- package/type_defs/hooks/useLoaderV2.d.ts +0 -15
- package/type_defs/hooks/useLoaderV2.d.ts.map +0 -1
- package/type_defs/index.d.ts +0 -2
- package/type_defs/index.d.ts.map +0 -1
- package/type_defs/stores/useStores.d.ts +0 -5
- package/type_defs/stores/useStores.d.ts.map +0 -1
- package/type_defs/styles/DeviceSizeWatcher.d.ts +0 -21
- package/type_defs/styles/DeviceSizeWatcher.d.ts.map +0 -1
- package/type_defs/styles/alignments.d.ts +0 -8
- package/type_defs/styles/alignments.d.ts.map +0 -1
- package/type_defs/styles/colors.d.ts +0 -35
- package/type_defs/styles/colors.d.ts.map +0 -1
- package/type_defs/styles/deviceSizes.d.ts +0 -9
- package/type_defs/styles/deviceSizes.d.ts.map +0 -1
- package/type_defs/styles/mediaQueries.d.ts +0 -21
- package/type_defs/styles/mediaQueries.d.ts.map +0 -1
- package/type_defs/styles/mixins.d.ts +0 -8
- package/type_defs/styles/mixins.d.ts.map +0 -1
- package/type_defs/styles/spacings.d.ts +0 -15
- package/type_defs/styles/spacings.d.ts.map +0 -1
- package/type_defs/styles/theme/Theme.type.d.ts +0 -79
- package/type_defs/styles/theme/Theme.type.d.ts.map +0 -1
- package/type_defs/styles/theme/base.d.ts +0 -3
- package/type_defs/styles/theme/base.d.ts.map +0 -1
- package/type_defs/styles/theme/dark.d.ts +0 -3
- package/type_defs/styles/theme/dark.d.ts.map +0 -1
- package/type_defs/styles/theme/light.d.ts +0 -3
- package/type_defs/styles/theme/light.d.ts.map +0 -1
- package/type_defs/styles/theme/light2.d.ts +0 -3
- package/type_defs/styles/theme/light2.d.ts.map +0 -1
- package/type_defs/styles/theme/useTheme.d.ts +0 -3
- package/type_defs/styles/theme/useTheme.d.ts.map +0 -1
- package/type_defs/styles/types.d.ts +0 -17
- package/type_defs/styles/types.d.ts.map +0 -1
- package/type_defs/styles/typography.d.ts +0 -56
- package/type_defs/styles/typography.d.ts.map +0 -1
- package/type_defs/utils/NavBarScrollWatcher.d.ts +0 -7
- package/type_defs/utils/NavBarScrollWatcher.d.ts.map +0 -1
- package/type_defs/utils/arrayHelpers.d.ts +0 -23
- package/type_defs/utils/arrayHelpers.d.ts.map +0 -1
- package/type_defs/utils/dateTime/DateRange.type.d.ts +0 -6
- package/type_defs/utils/dateTime/DateRange.type.d.ts.map +0 -1
- package/type_defs/utils/dateTime/calendar.d.ts +0 -18
- package/type_defs/utils/dateTime/calendar.d.ts.map +0 -1
- package/type_defs/utils/dateTimeHelpers.d.ts +0 -23
- package/type_defs/utils/dateTimeHelpers.d.ts.map +0 -1
- package/type_defs/utils/function.types.d.ts +0 -2
- package/type_defs/utils/function.types.d.ts.map +0 -1
- package/type_defs/utils/functionHelpers.d.ts +0 -7
- package/type_defs/utils/functionHelpers.d.ts.map +0 -1
- package/type_defs/utils/idGenerator.d.ts +0 -3
- package/type_defs/utils/idGenerator.d.ts.map +0 -1
- package/type_defs/utils/logging/Logger.d.ts +0 -10
- package/type_defs/utils/logging/Logger.d.ts.map +0 -1
- package/type_defs/utils/logging/Logger.type.d.ts +0 -7
- package/type_defs/utils/logging/Logger.type.d.ts.map +0 -1
- package/type_defs/utils/logging/loggable.d.ts +0 -7
- package/type_defs/utils/logging/loggable.d.ts.map +0 -1
- package/type_defs/utils/logging/with_module_logging.d.ts +0 -3
- package/type_defs/utils/logging/with_module_logging.d.ts.map +0 -1
- package/type_defs/utils/numberHelpers.d.ts +0 -3
- package/type_defs/utils/numberHelpers.d.ts.map +0 -1
- package/type_defs/utils/typeCheckers.d.ts +0 -5
- package/type_defs/utils/typeCheckers.d.ts.map +0 -1
- package/type_defs/utils/validateFields.d.ts +0 -13
- package/type_defs/utils/validateFields.d.ts.map +0 -1
- package/type_defs/zendeskGardenCss.d.ts +0 -2
- package/type_defs/zendeskGardenCss.d.ts.map +0 -1
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import styled, { css } from "styled-components"
|
|
2
|
-
import { MediaQuery } from "styles/mediaQueries"
|
|
3
|
-
import { SPACINGS } from "styles/spacings"
|
|
4
|
-
|
|
5
|
-
export type ResponsiveProps<P> = {
|
|
6
|
-
mediaQueryFunc: MediaQuery,
|
|
7
|
-
props: P
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export type Props = {
|
|
11
|
-
alignItems?: string,
|
|
12
|
-
gap?: string | null | "unset",
|
|
13
|
-
fluid?: boolean,
|
|
14
|
-
inline?: boolean,
|
|
15
|
-
justifyContent?: string,
|
|
16
|
-
responsivePropsList?: ResponsiveProps<Props>[]
|
|
17
|
-
withRows?: boolean,
|
|
18
|
-
wrap?: boolean,
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export type FlexBoxProps = Props
|
|
22
|
-
|
|
23
|
-
const getFlexDirection = ({ withRows }: Props) => withRows ? "column" : "row"
|
|
24
|
-
|
|
25
|
-
export const FlexBox = styled.div<Props>`
|
|
26
|
-
align-items: ${({ alignItems }) => alignItems ? alignItems : "initial"};
|
|
27
|
-
display: ${(p) => p.inline ? "inline-flex" : "flex"};
|
|
28
|
-
flex: ${({ fluid }: Props) => fluid ? 1 : "unset"};
|
|
29
|
-
flex-direction: ${getFlexDirection};
|
|
30
|
-
gap: ${(p) => p.gap ? p.gap : SPACINGS.SM};
|
|
31
|
-
justify-content: ${(p) => p.justifyContent || "initial"};
|
|
32
|
-
${(p: Props) => p.wrap ? wrappedStyling : ""}
|
|
33
|
-
|
|
34
|
-
${(p: Props) => p.responsivePropsList ? responsiveStyles(p) : ""}
|
|
35
|
-
`
|
|
36
|
-
|
|
37
|
-
FlexBox.defaultProps = { withRows: false }
|
|
38
|
-
|
|
39
|
-
const responsiveStyles = ({ responsivePropsList, ...originalProps }: Props) => (
|
|
40
|
-
responsivePropsList?.map(({
|
|
41
|
-
mediaQueryFunc,
|
|
42
|
-
props: rProps,
|
|
43
|
-
}): string => {
|
|
44
|
-
const props = { ...originalProps, ...rProps }
|
|
45
|
-
const {
|
|
46
|
-
alignItems,
|
|
47
|
-
gap,
|
|
48
|
-
inline,
|
|
49
|
-
justifyContent,
|
|
50
|
-
fluid,
|
|
51
|
-
wrap
|
|
52
|
-
} = props
|
|
53
|
-
|
|
54
|
-
return mediaQueryFunc(css`
|
|
55
|
-
align-items: ${alignItems ? alignItems : "initial"};
|
|
56
|
-
display: ${inline ? "inline-flex" : "flex"};
|
|
57
|
-
flex: ${fluid ? 1 : "unset"};
|
|
58
|
-
flex-direction: ${getFlexDirection(props)};
|
|
59
|
-
gap: ${gap ? gap : SPACINGS.SM};
|
|
60
|
-
justify-content: ${justifyContent || "initial"};
|
|
61
|
-
${wrap ? wrappedStyling : ""}
|
|
62
|
-
`).join("")
|
|
63
|
-
})
|
|
64
|
-
)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const wrappedStyling = css`
|
|
68
|
-
flex-wrap: wrap;
|
|
69
|
-
`
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Grid as ZGrid,
|
|
3
|
-
Row as ZRow,
|
|
4
|
-
Col as ZCol,
|
|
5
|
-
/* @ts-ignore */
|
|
6
|
-
} from "@zendeskgarden/react-grid"
|
|
7
|
-
import styled from "styled-components"
|
|
8
|
-
import { SPACINGS } from "styles/spacings"
|
|
9
|
-
|
|
10
|
-
export const Grid = styled(ZGrid)`
|
|
11
|
-
&& {
|
|
12
|
-
padding: 0;
|
|
13
|
-
}
|
|
14
|
-
`
|
|
15
|
-
|
|
16
|
-
export const Row = ZRow
|
|
17
|
-
|
|
18
|
-
export const Col = styled(ZCol)`
|
|
19
|
-
&& {
|
|
20
|
-
margin-top: ${SPACINGS.XS};
|
|
21
|
-
margin-bottom: ${SPACINGS.XS};
|
|
22
|
-
}
|
|
23
|
-
`
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components"
|
|
2
|
-
import { COLORS } from "styles/colors"
|
|
3
|
-
|
|
4
|
-
type Props = {
|
|
5
|
-
color?: string,
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const Line = styled.hr<Props>`
|
|
9
|
-
background: ${({ color }) => color ? color : COLORS.LIGHT_GREY};
|
|
10
|
-
height: 2px;
|
|
11
|
-
border: none;
|
|
12
|
-
margin: unset;
|
|
13
|
-
`
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { mdiDotsVertical } from "@mdi/js"
|
|
2
|
-
import { Button } from "components/forms/Button"
|
|
3
|
-
import { MenuPlacement } from "components/forms/selectors/Dropdown"
|
|
4
|
-
import { Dropdown } from "components/forms/selectors/Dropdown"
|
|
5
|
-
import React from "react"
|
|
6
|
-
import styled from "styled-components"
|
|
7
|
-
import { COLORS, darker } from "styles/colors"
|
|
8
|
-
|
|
9
|
-
const COMPONENT_NAME = "OverflowMenu"
|
|
10
|
-
|
|
11
|
-
export type OverflowMenuItem = {
|
|
12
|
-
label: string,
|
|
13
|
-
action: () => void
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
type Props = {
|
|
17
|
-
placement?: MenuPlacement,
|
|
18
|
-
actions: Array<OverflowMenuItem>
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const OverflowButton = styled(Button).attrs({
|
|
22
|
-
icon: mdiDotsVertical,
|
|
23
|
-
"data-component-name": COMPONENT_NAME,
|
|
24
|
-
color: darker(COLORS.GREY),
|
|
25
|
-
"aria-label": "Row actions",
|
|
26
|
-
inline: true,
|
|
27
|
-
})`
|
|
28
|
-
align-self: flex-start;
|
|
29
|
-
display: flex;
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
justify-content: flex-start;
|
|
32
|
-
`
|
|
33
|
-
|
|
34
|
-
export const OverflowMenu = ({ actions, placement }: Props) => (
|
|
35
|
-
<Dropdown options={actions}
|
|
36
|
-
placement={placement}
|
|
37
|
-
returnItemOnChange
|
|
38
|
-
valueField={"label"}
|
|
39
|
-
keyField={"label"}
|
|
40
|
-
// @ts-ignore
|
|
41
|
-
onChange={({ action }) => { action() }}
|
|
42
|
-
// @ts-ignore
|
|
43
|
-
trigger={<OverflowButton />}
|
|
44
|
-
/>
|
|
45
|
-
)
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import styled, { css } from "styled-components"
|
|
2
|
-
import { textColorForBackground } from "styles/mixins"
|
|
3
|
-
|
|
4
|
-
type Props = {
|
|
5
|
-
titleHidden? :boolean
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const hideTitle = css`
|
|
9
|
-
& > h1,
|
|
10
|
-
& > h2,
|
|
11
|
-
& > h3,
|
|
12
|
-
& > h4,
|
|
13
|
-
& > h5,
|
|
14
|
-
& > h6 {
|
|
15
|
-
display: none;
|
|
16
|
-
}
|
|
17
|
-
`
|
|
18
|
-
|
|
19
|
-
export const Section = styled.section`
|
|
20
|
-
background: ${({ color, theme }) => color ? color : theme.styles.section.background};
|
|
21
|
-
border-radius: ${(p) => p.theme.styles.section.borderRadius};
|
|
22
|
-
box-shadow: ${(p) => p.theme.styles.section.shadow};
|
|
23
|
-
margin: ${(p) => p.theme.styles.section.margin};
|
|
24
|
-
padding: ${(p) => p.theme.styles.section.padding};
|
|
25
|
-
|
|
26
|
-
${({color}) => color ? textColorForBackground : ""}
|
|
27
|
-
${({titleHidden} :Props) => titleHidden ? hideTitle : ""}
|
|
28
|
-
|
|
29
|
-
& > :first-child {
|
|
30
|
-
margin-top: 0;
|
|
31
|
-
padding-top: 0;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
& > section {
|
|
35
|
-
padding-bottom: 0;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
& + section {
|
|
39
|
-
//padding-top: 0;
|
|
40
|
-
}
|
|
41
|
-
`
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
|
-
// import { Button } from "components/forms/Button"
|
|
4
|
-
// import { IconButton } from "components/forms/IconButton"
|
|
5
|
-
// import { FlexBlock } from "components/layout/FlexBlock"
|
|
6
|
-
// import { H3 } from "components/text/Header"
|
|
7
|
-
// import React, { type ElementType } from "react"
|
|
8
|
-
// import styled from "styled-components"
|
|
9
|
-
// import { mdiArrowLeft } from "@mdi/js"
|
|
10
|
-
// import { SPACINGS } from "styles/spacings"
|
|
11
|
-
// import { ContainerProps } from "styles/types"
|
|
12
|
-
import { DO_NOTHING } from "utils/functionHelpers"
|
|
13
|
-
//
|
|
14
|
-
// const Container = styled(FlexBlock)`
|
|
15
|
-
// height: 100%;
|
|
16
|
-
// padding: ${SPACINGS.LG};
|
|
17
|
-
// width: ${({ width }) => width};
|
|
18
|
-
// `
|
|
19
|
-
//
|
|
20
|
-
// const Header = styled(H3)`
|
|
21
|
-
// color: ${({ theme }) => theme.styles.colorPrimary} !important;
|
|
22
|
-
// margin: 0;
|
|
23
|
-
// `
|
|
24
|
-
//
|
|
25
|
-
// const ActionContainer = styled(FlexBlock)`
|
|
26
|
-
// flex: 1;
|
|
27
|
-
// `
|
|
28
|
-
//
|
|
29
|
-
// const ActionItem = styled(Button).attrs({
|
|
30
|
-
// flat: true, fluid: true,
|
|
31
|
-
// })`
|
|
32
|
-
// && {
|
|
33
|
-
// text-align: left;
|
|
34
|
-
// }
|
|
35
|
-
// `
|
|
36
|
-
|
|
37
|
-
// export type Action = {
|
|
38
|
-
// name :string,
|
|
39
|
-
// onClick :() => void,
|
|
40
|
-
// }
|
|
41
|
-
|
|
42
|
-
// type Props = {
|
|
43
|
-
// title :string,
|
|
44
|
-
// actions :Array<Action>,
|
|
45
|
-
// showBackButton :boolean,
|
|
46
|
-
// onBackClicked :() => void,
|
|
47
|
-
// onLogoClicked :() => void,
|
|
48
|
-
// logo? :ElementType,
|
|
49
|
-
// width :string,
|
|
50
|
-
// } & ContainerProps
|
|
51
|
-
|
|
52
|
-
export const Sidebar = () => {
|
|
53
|
-
throw new Error("Not Completed Yet")
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// export const Sidebar = ({
|
|
57
|
-
// title,
|
|
58
|
-
// actions,
|
|
59
|
-
// showBackButton,
|
|
60
|
-
// onBackClicked,
|
|
61
|
-
// onLogoClicked,
|
|
62
|
-
// logo,
|
|
63
|
-
// width,
|
|
64
|
-
// } :Props) => {
|
|
65
|
-
// throw "Not Completed Yet"
|
|
66
|
-
// return <Container
|
|
67
|
-
// data-component-name={Sidebar.COMPONENT_NAME}
|
|
68
|
-
// spacing={SPACINGS.SM}
|
|
69
|
-
// withRows
|
|
70
|
-
// width={width}
|
|
71
|
-
// >
|
|
72
|
-
// <FlexBlock>
|
|
73
|
-
// {
|
|
74
|
-
// showBackButton
|
|
75
|
-
// ? <IconButton icon={mdiArrowLeft}
|
|
76
|
-
// flat
|
|
77
|
-
// onClick={onBackClicked} />
|
|
78
|
-
// : null
|
|
79
|
-
// }
|
|
80
|
-
//
|
|
81
|
-
// <FlexBlock alignItems={"center"}
|
|
82
|
-
// onClick={onLogoClicked}
|
|
83
|
-
// css={`cursor: pointer;`}>
|
|
84
|
-
// {logo ? logo : null}
|
|
85
|
-
// <Header>{title}</Header>
|
|
86
|
-
// </FlexBlock>
|
|
87
|
-
// </FlexBlock>
|
|
88
|
-
//
|
|
89
|
-
// <ActionContainer withRows>
|
|
90
|
-
// {
|
|
91
|
-
// actions.map(({ name, onClick } :Action) => {
|
|
92
|
-
// return <ActionItem onClick={onClick}>{name}</ActionItem>
|
|
93
|
-
// })
|
|
94
|
-
// }
|
|
95
|
-
// </ActionContainer>
|
|
96
|
-
// </Container>
|
|
97
|
-
// }
|
|
98
|
-
|
|
99
|
-
Sidebar.defaultProps = {
|
|
100
|
-
actions : [],
|
|
101
|
-
showBackButton: false,
|
|
102
|
-
onBackClicked : DO_NOTHING,
|
|
103
|
-
onLogoClicked : DO_NOTHING,
|
|
104
|
-
width : "250px",
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
Sidebar.COMPONENT_NAME = "Sidebar"
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
|
-
// import { FlexBlock } from "components/layout/FlexBlock"
|
|
4
|
-
// import * as React from "react"
|
|
5
|
-
|
|
6
|
-
// type Props = {
|
|
7
|
-
// sidebar :React.Node,
|
|
8
|
-
// content :React.Node,
|
|
9
|
-
// className? :string,
|
|
10
|
-
// }
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export const SidebarLayout = () => {
|
|
14
|
-
throw new Error("Not Completed Yet")
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// export const SidebarLayout = ({ className, sidebar, content } :Props) => {
|
|
18
|
-
// return (
|
|
19
|
-
// <FlexBlock data-component-name={SidebarLayout.COMPONENT_NAME}
|
|
20
|
-
// alignSelf={"center"}
|
|
21
|
-
// className={className}>
|
|
22
|
-
// <FlexBlock withRows css={`height: 100vh`}>
|
|
23
|
-
// {sidebar}
|
|
24
|
-
// </FlexBlock>
|
|
25
|
-
// <FlexBlock withRows fluid>
|
|
26
|
-
// {content}
|
|
27
|
-
// </FlexBlock>
|
|
28
|
-
// </FlexBlock>
|
|
29
|
-
// )
|
|
30
|
-
// }
|
|
31
|
-
|
|
32
|
-
SidebarLayout.COMPONENT_NAME = "SidebarLayout"
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
import { TabPanel as ZTabPanel, Tabs as ZTabs } from "@zendeskgarden/react-tabs"
|
|
3
|
-
import styled from "styled-components"
|
|
4
|
-
import { COLORS } from "styles/colors"
|
|
5
|
-
import { FONT_WEIGHTS } from "styles/typography"
|
|
6
|
-
|
|
7
|
-
export const Tabs = styled(ZTabs)`
|
|
8
|
-
&&& {
|
|
9
|
-
//overflow: unset;
|
|
10
|
-
|
|
11
|
-
*[data-garden-id="tabs.tab"], *[data-garden-id="tabs.tablist"] {
|
|
12
|
-
font-size: inherit;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
*[data-garden-id="tabs.tablist"] {
|
|
16
|
-
//border-bottom: none;
|
|
17
|
-
overflow-x: auto;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
*[data-garden-id="tabs.tab"] {
|
|
21
|
-
padding: 10px 15px 6px;
|
|
22
|
-
|
|
23
|
-
&[aria-selected="true"] {
|
|
24
|
-
font-weight: ${FONT_WEIGHTS.BOLD};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
:hover:not(&[aria-selected="true"]) {
|
|
28
|
-
color: ${({ theme }) => theme.styles.textColorPrimary};
|
|
29
|
-
border-bottom: 3px solid ${COLORS.LIGHT_GREY};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
:focus, &[aria-selected="true"] {
|
|
33
|
-
color: ${({ theme }) => theme.styles.colorPrimary} !important;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
`
|
|
38
|
-
|
|
39
|
-
export const TabPanel = ZTabPanel
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
import { Dots } from "@zendeskgarden/react-loaders"
|
|
3
|
-
import { FlexBlock } from "components/layout/FlexBlock"
|
|
4
|
-
import { StyledComponentProps } from "components/StyledComponentProps.type"
|
|
5
|
-
import React, { FC, useContext, useState } from "react"
|
|
6
|
-
import styled, { ThemeContext } from "styled-components"
|
|
7
|
-
import { Theme } from "styles/theme/Theme.type"
|
|
8
|
-
import { FONT_SIZES } from "styles/typography"
|
|
9
|
-
import { returnAfterMinimum } from "utils/dateTimeHelpers"
|
|
10
|
-
import { PromiseFunc } from "utils/function.types"
|
|
11
|
-
|
|
12
|
-
type AsyncLoadFunc = <T>(f: PromiseFunc<any, T>) => Promise<T>
|
|
13
|
-
export type RenderProp = { withLoading: AsyncLoadFunc }
|
|
14
|
-
|
|
15
|
-
type Props = {
|
|
16
|
-
children: (p: RenderProp) => JSX.Element
|
|
17
|
-
} & StyledComponentProps
|
|
18
|
-
|
|
19
|
-
export let AsyncLoadable: FC<Props> = ({ children, className }) => {
|
|
20
|
-
const theme = useContext<Theme>(ThemeContext)
|
|
21
|
-
const [isLoading, setLoadingState] = useState<boolean>(false)
|
|
22
|
-
|
|
23
|
-
const withLoading = async <T, >(f: PromiseFunc<any, T>): Promise<T> => {
|
|
24
|
-
setLoadingState(true)
|
|
25
|
-
|
|
26
|
-
let val: Promise<any>
|
|
27
|
-
try {
|
|
28
|
-
val = await returnAfterMinimum(500, f)
|
|
29
|
-
} finally {
|
|
30
|
-
setLoadingState(false)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return val
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (isLoading) {
|
|
37
|
-
return <Container justify={"center"}
|
|
38
|
-
className={className}
|
|
39
|
-
alignItems={"center"}>
|
|
40
|
-
<Dots color={theme.styles.colorPrimary}
|
|
41
|
-
size={FONT_SIZES.XXL}
|
|
42
|
-
delayMS={100}
|
|
43
|
-
velocity={-.25} />
|
|
44
|
-
</Container>
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return children({ withLoading })
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
AsyncLoadable = styled(AsyncLoadable)``
|
|
51
|
-
|
|
52
|
-
const Container = styled(FlexBlock)`
|
|
53
|
-
height: 100%;
|
|
54
|
-
width: 100%;
|
|
55
|
-
min-width: 200px;
|
|
56
|
-
min-height: 200px;
|
|
57
|
-
`
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
import { Dots as ZDots } from "@zendeskgarden/react-loaders"
|
|
3
|
-
import React, { FC } from "react"
|
|
4
|
-
import { FONT_SIZES, FontSize } from "styles/typography"
|
|
5
|
-
|
|
6
|
-
type Props = {
|
|
7
|
-
color?: string,
|
|
8
|
-
size?: FontSize
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const Dots: FC<Props> = ({ color, size = FONT_SIZES.XXL }) => {
|
|
12
|
-
return <ZDots color={color}
|
|
13
|
-
size={size}
|
|
14
|
-
delayMS={100}
|
|
15
|
-
velocity={-.25} />
|
|
16
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
import { Dots } from "@zendeskgarden/react-loaders"
|
|
3
|
-
import { FlexBox } from "components/layout/FlexBox"
|
|
4
|
-
import { useIsMounted } from "hooks/useIsMounted"
|
|
5
|
-
import React, {
|
|
6
|
-
FC,
|
|
7
|
-
|
|
8
|
-
PropsWithChildren,
|
|
9
|
-
useContext,
|
|
10
|
-
useEffect,
|
|
11
|
-
useState
|
|
12
|
-
} from "react"
|
|
13
|
-
import styled, { ThemeContext } from "styled-components"
|
|
14
|
-
import { Theme } from "styles/theme/Theme.type"
|
|
15
|
-
import { FONT_SIZES } from "styles/typography"
|
|
16
|
-
import { Logger } from "utils/logging/Logger"
|
|
17
|
-
|
|
18
|
-
const logger = new Logger("Loadable")
|
|
19
|
-
|
|
20
|
-
const Container = styled(FlexBox)`
|
|
21
|
-
//height: 100%;
|
|
22
|
-
width: 100%;
|
|
23
|
-
position: relative;
|
|
24
|
-
`
|
|
25
|
-
|
|
26
|
-
const LoaderContainer = styled(FlexBox)<{ showSpinner :boolean }>`
|
|
27
|
-
height: 100%;
|
|
28
|
-
width: 100%;
|
|
29
|
-
position: absolute;
|
|
30
|
-
`
|
|
31
|
-
|
|
32
|
-
const ChildrenContainer = styled(FlexBox)<{
|
|
33
|
-
showSpinner :boolean, opaqueSpinner :boolean,
|
|
34
|
-
}>`
|
|
35
|
-
width: 100%;
|
|
36
|
-
opacity: ${({ showSpinner, opaqueSpinner }) => {
|
|
37
|
-
if (!showSpinner) return "1"
|
|
38
|
-
return opaqueSpinner ? "0" : ".3"
|
|
39
|
-
}};
|
|
40
|
-
`
|
|
41
|
-
|
|
42
|
-
type Props = {
|
|
43
|
-
className?: string,
|
|
44
|
-
debugId?: number,
|
|
45
|
-
opaqueSpinner?: boolean,
|
|
46
|
-
showSpinner: boolean,
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export let Loadable: FC<PropsWithChildren<Props>> = ({
|
|
50
|
-
children,
|
|
51
|
-
className,
|
|
52
|
-
debugId,
|
|
53
|
-
opaqueSpinner = false,
|
|
54
|
-
showSpinner = false,
|
|
55
|
-
}) => {
|
|
56
|
-
logger.writeInfo("Rendering id:", debugId, "showSpinner", showSpinner)
|
|
57
|
-
const isMounted = useIsMounted()
|
|
58
|
-
const theme = useContext<Theme>(ThemeContext)
|
|
59
|
-
const [canHideSpinner, setCanHideSpinner] = useState<boolean>(true)
|
|
60
|
-
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
if (!showSpinner) return
|
|
63
|
-
setCanHideSpinner(false)
|
|
64
|
-
setTimeout(() => {
|
|
65
|
-
logger.writeInfo("setting setCanHideSpinner true id:", debugId)
|
|
66
|
-
if (isMounted()) setCanHideSpinner(true)
|
|
67
|
-
}, 500)
|
|
68
|
-
}, [debugId, isMounted, showSpinner])
|
|
69
|
-
|
|
70
|
-
const showingSpinner = showSpinner || !canHideSpinner
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return <Container justifyContent={"center"}
|
|
75
|
-
gap={"unset"}
|
|
76
|
-
alignItems={"center"}>
|
|
77
|
-
<ChildrenContainer gap={"unset"}
|
|
78
|
-
className={className}
|
|
79
|
-
opaqueSpinner={opaqueSpinner}
|
|
80
|
-
showSpinner={showingSpinner}
|
|
81
|
-
withRows
|
|
82
|
-
>
|
|
83
|
-
{children}
|
|
84
|
-
</ChildrenContainer>
|
|
85
|
-
|
|
86
|
-
{showingSpinner
|
|
87
|
-
? <LoaderContainer justifyContent={"center"}
|
|
88
|
-
alignItems={"center"}
|
|
89
|
-
showSpinner={showingSpinner}>
|
|
90
|
-
<Dots color={theme.styles.colorPrimary}
|
|
91
|
-
size={FONT_SIZES.XXL}
|
|
92
|
-
delayMS={100}
|
|
93
|
-
velocity={-.25} />
|
|
94
|
-
</LoaderContainer>
|
|
95
|
-
: null}
|
|
96
|
-
</Container>
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
Loadable = styled(Loadable)``
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { FlexBlock } from "components/layout/FlexBlock"
|
|
2
|
-
import { useContext } from "react"
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { useObserver } from "mobx-react"
|
|
5
|
-
// @ts-ignore
|
|
6
|
-
import { Dots } from "@zendeskgarden/react-loaders"
|
|
7
|
-
import { useStores } from "stores/useStores"
|
|
8
|
-
import { Theme } from "styles/theme/Theme.type"
|
|
9
|
-
import { FONT_SIZES } from "styles/typography"
|
|
10
|
-
import styled, { ThemeContext } from "styled-components"
|
|
11
|
-
|
|
12
|
-
type Props = {
|
|
13
|
-
forceVisibility :boolean,
|
|
14
|
-
delay :number,
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const Container = styled(FlexBlock)`
|
|
18
|
-
background: ${({ theme }) => theme.styles.pageBackground}B3;
|
|
19
|
-
position: fixed;
|
|
20
|
-
top: 0;
|
|
21
|
-
left: 0;
|
|
22
|
-
height: 100%;
|
|
23
|
-
width: 100%;
|
|
24
|
-
`
|
|
25
|
-
|
|
26
|
-
export const Loader = ({ forceVisibility, delay } :Props) => {
|
|
27
|
-
const { ui } = useStores()
|
|
28
|
-
const theme = useContext<Theme>(ThemeContext)
|
|
29
|
-
|
|
30
|
-
return useObserver(() => {
|
|
31
|
-
if (!ui.isLoaderVisible && !forceVisibility) {
|
|
32
|
-
return null
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<Container justify={"center"}
|
|
37
|
-
alignItems={"center"}>
|
|
38
|
-
<Dots data-component-name={`${Loader.COMPONENT_NAME}`}
|
|
39
|
-
color={theme.styles.colorPrimary}
|
|
40
|
-
size={FONT_SIZES.XXL}
|
|
41
|
-
delayMS={delay}
|
|
42
|
-
velocity={-.25} />
|
|
43
|
-
</Container>
|
|
44
|
-
)
|
|
45
|
-
})
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
Loader.defaultProps = {
|
|
49
|
-
forceVisibility: false,
|
|
50
|
-
delay : 100,
|
|
51
|
-
}
|
|
52
|
-
Loader.COMPONENT_NAME = "Loader"
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { FlexBox } from "components/layout/FlexBox"
|
|
2
|
-
import { Dots } from "components/loaders/Dots"
|
|
3
|
-
import React, { ComponentType, PropsWithChildren, useContext } from "react"
|
|
4
|
-
import styled, { ThemeContext } from "styled-components"
|
|
5
|
-
import { Theme } from "styles/theme/Theme.type"
|
|
6
|
-
|
|
7
|
-
type Props = {
|
|
8
|
-
className?: string,
|
|
9
|
-
innerAs?: ComponentType<any>,
|
|
10
|
-
isLoading: boolean,
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export let TranslucentLoader = ({
|
|
14
|
-
children,
|
|
15
|
-
className,
|
|
16
|
-
innerAs,
|
|
17
|
-
isLoading = true
|
|
18
|
-
}: PropsWithChildren<Props>) => {
|
|
19
|
-
const theme = useContext<Theme>(ThemeContext)
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<Container as={innerAs} className={className}>
|
|
23
|
-
{children}
|
|
24
|
-
{
|
|
25
|
-
isLoading
|
|
26
|
-
? <FlexBox alignItems={"center"}
|
|
27
|
-
justifyContent={"center"}
|
|
28
|
-
css={`
|
|
29
|
-
background: white;
|
|
30
|
-
opacity: .7;
|
|
31
|
-
top: 0;
|
|
32
|
-
left: 0;
|
|
33
|
-
position: absolute;
|
|
34
|
-
height: 100%;
|
|
35
|
-
width: 100%;
|
|
36
|
-
`}>
|
|
37
|
-
<Dots color={theme.styles.colorPrimary} />
|
|
38
|
-
</FlexBox>
|
|
39
|
-
: null
|
|
40
|
-
}
|
|
41
|
-
</Container>
|
|
42
|
-
)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
TranslucentLoader = styled(TranslucentLoader)<Props>``
|
|
46
|
-
|
|
47
|
-
const Container = styled.div`
|
|
48
|
-
position: relative;
|
|
49
|
-
`
|