@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,76 +0,0 @@
|
|
|
1
|
-
import { StyledProps } from "components/StyledProps.type"
|
|
2
|
-
import { Nullable } from "global"
|
|
3
|
-
|
|
4
|
-
export type ContainerStyles = {
|
|
5
|
-
background?: string,
|
|
6
|
-
borderRadius?: string,
|
|
7
|
-
height?: string,
|
|
8
|
-
margin?: string,
|
|
9
|
-
padding?: string,
|
|
10
|
-
shadow?: string,
|
|
11
|
-
zIndex?: number,
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export type Styles = {
|
|
15
|
-
appBar: ContainerStyles,
|
|
16
|
-
border: {
|
|
17
|
-
color: string,
|
|
18
|
-
},
|
|
19
|
-
buttons: {
|
|
20
|
-
textTransform: Nullable<string>,
|
|
21
|
-
},
|
|
22
|
-
colorAccent: string,
|
|
23
|
-
colorSecondary: string,
|
|
24
|
-
colorPrimary: string,
|
|
25
|
-
colorPrimaryDark: string,
|
|
26
|
-
colorWarning: string,
|
|
27
|
-
colorDanger: string,
|
|
28
|
-
colorSuccess: string,
|
|
29
|
-
container: { horizontalPadding: string },
|
|
30
|
-
footer: {
|
|
31
|
-
background: string
|
|
32
|
-
},
|
|
33
|
-
infoPanel: {
|
|
34
|
-
background: string,
|
|
35
|
-
},
|
|
36
|
-
modal: {
|
|
37
|
-
backdrop: {
|
|
38
|
-
background: string,
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
nav: {
|
|
42
|
-
linkColor: string,
|
|
43
|
-
},
|
|
44
|
-
notifications: {
|
|
45
|
-
zIndex: number,
|
|
46
|
-
},
|
|
47
|
-
overlayBackground: string,
|
|
48
|
-
pageBackground: string,
|
|
49
|
-
scrollbar: {
|
|
50
|
-
thumbColor: string,
|
|
51
|
-
trackColor: string,
|
|
52
|
-
},
|
|
53
|
-
scrollbarColor: string,
|
|
54
|
-
section: ContainerStyles,
|
|
55
|
-
sidebar: {
|
|
56
|
-
background: string,
|
|
57
|
-
boxShadow: string,
|
|
58
|
-
zIndex: number
|
|
59
|
-
},
|
|
60
|
-
table: { borderSize: string, },
|
|
61
|
-
textColorDark: string,
|
|
62
|
-
textColorLight: string,
|
|
63
|
-
textColorOverPrimaryBg: string,
|
|
64
|
-
textColorPrimary: string,
|
|
65
|
-
textColorSecondary: string,
|
|
66
|
-
tooltip: {
|
|
67
|
-
darkBackground: string,
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
getTextColorForBackground: (p: StyledProps<{ color: string }>) => string
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export type Theme = {
|
|
74
|
-
isDark: boolean,
|
|
75
|
-
styles: Styles,
|
|
76
|
-
}
|
package/src/styles/theme/base.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { COLORS, hasGoodContrast } from "styles/colors"
|
|
2
|
-
import { SPACINGS } from "styles/spacings"
|
|
3
|
-
import { Styles } from "styles/theme/Theme.type"
|
|
4
|
-
|
|
5
|
-
export const base: Partial<Styles> = {
|
|
6
|
-
appBar: {
|
|
7
|
-
height: "80px",
|
|
8
|
-
shadow: "unset",
|
|
9
|
-
zIndex: 399,
|
|
10
|
-
}, // modal backdrop zindex is 400
|
|
11
|
-
border: {
|
|
12
|
-
color: "rgb(233, 235, 237)",
|
|
13
|
-
},
|
|
14
|
-
buttons: { textTransform: null },
|
|
15
|
-
colorAccent: COLORS.BLUE,
|
|
16
|
-
colorPrimary: COLORS.HUB_SPOT_ORANGE,
|
|
17
|
-
colorDanger: COLORS.RED,
|
|
18
|
-
colorWarning: COLORS.YELLOW,
|
|
19
|
-
colorSuccess: COLORS.GREEN,
|
|
20
|
-
container: { horizontalPadding: "1rem" },
|
|
21
|
-
modal: {
|
|
22
|
-
backdrop: {
|
|
23
|
-
background: "rgba(47, 57, 65, 0.85)",
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
notifications: {
|
|
27
|
-
zIndex: 401,
|
|
28
|
-
},
|
|
29
|
-
section: {
|
|
30
|
-
background: "transparent",
|
|
31
|
-
padding: `${SPACINGS.XXXL} 0`,
|
|
32
|
-
},
|
|
33
|
-
sidebar: {
|
|
34
|
-
background: "unset",
|
|
35
|
-
zIndex: 10000,
|
|
36
|
-
boxShadow: "rgb(47 57 65 / 35%)",
|
|
37
|
-
},
|
|
38
|
-
table: { borderSize: "1rem" },
|
|
39
|
-
tooltip: { darkBackground: "#747183" },
|
|
40
|
-
|
|
41
|
-
getTextColorForBackground: ({ color, theme }) => {
|
|
42
|
-
if (hasGoodContrast(color, theme.styles.textColorLight)) {
|
|
43
|
-
return theme.styles.textColorLight
|
|
44
|
-
}
|
|
45
|
-
return theme.styles.textColorDark
|
|
46
|
-
},
|
|
47
|
-
}
|
package/src/styles/theme/dark.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { COLORS, fade, light, lighter } from "styles/colors"
|
|
2
|
-
import { base } from "styles/theme/base"
|
|
3
|
-
import { Theme } from "styles/theme/Theme.type"
|
|
4
|
-
|
|
5
|
-
const textColorPrimary = COLORS.LIGHT_GREY
|
|
6
|
-
|
|
7
|
-
export const dark: Theme = {
|
|
8
|
-
isDark: true,
|
|
9
|
-
styles: {
|
|
10
|
-
...base,
|
|
11
|
-
// deprecated
|
|
12
|
-
// @ts-ignore
|
|
13
|
-
navBackground: "#1d1e21",
|
|
14
|
-
nav: {
|
|
15
|
-
linkColor: light(COLORS.GREY),
|
|
16
|
-
},
|
|
17
|
-
footer: {
|
|
18
|
-
background: lighter(COLORS.MIDNIGHT_BLUE),
|
|
19
|
-
},
|
|
20
|
-
overlayBackground: fade(COLORS.LIGHT_GREY, .9),
|
|
21
|
-
pageBackground: COLORS.MIDNIGHT_BLUE,
|
|
22
|
-
scrollbar: {
|
|
23
|
-
thumbColor: "#ffffff55",
|
|
24
|
-
trackColor: "#ffffff33",
|
|
25
|
-
},
|
|
26
|
-
sidebar: {
|
|
27
|
-
...base.sidebar!!,
|
|
28
|
-
background: COLORS.MIDNIGHT_BLUE,
|
|
29
|
-
},
|
|
30
|
-
textColorDark: COLORS.MIDNIGHT_PURPLE,
|
|
31
|
-
textColorLight: textColorPrimary,
|
|
32
|
-
textColorOverPrimaryBg: COLORS.WHITE,
|
|
33
|
-
textColorPrimary,
|
|
34
|
-
textColorSecondary: COLORS.GREY_NOT_QUITE_BLUE,
|
|
35
|
-
},
|
|
36
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { COLORS, fade } from "styles/colors"
|
|
2
|
-
import { base } from "styles/theme/base"
|
|
3
|
-
import { Theme } from "styles/theme/Theme.type"
|
|
4
|
-
|
|
5
|
-
const textColorPrimary = COLORS.JAZZ_MAN_BLUE
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export const light: Theme = {
|
|
9
|
-
isDark: false,
|
|
10
|
-
styles: {
|
|
11
|
-
...base,
|
|
12
|
-
appBar: {
|
|
13
|
-
...base.appBar,
|
|
14
|
-
background: "transparent",
|
|
15
|
-
},
|
|
16
|
-
// deprecated
|
|
17
|
-
// @ts-ignore
|
|
18
|
-
navBackground: COLORS.GREY_NOT_QUITE_BLUE,
|
|
19
|
-
nav: {
|
|
20
|
-
linkColor: COLORS.MIDNIGHT_PURPLE,
|
|
21
|
-
},
|
|
22
|
-
footer: {
|
|
23
|
-
background: COLORS.MIDNIGHT_BLUE,
|
|
24
|
-
},
|
|
25
|
-
infoPanel: {
|
|
26
|
-
background: COLORS.VERY_LIGHT_GREY,
|
|
27
|
-
},
|
|
28
|
-
pageBackground: COLORS.WHITE,
|
|
29
|
-
overlayBackground: fade(COLORS.LIGHT_GREY),
|
|
30
|
-
scrollbar: {
|
|
31
|
-
thumbColor: "#00000033",
|
|
32
|
-
trackColor: "#00000022",
|
|
33
|
-
},
|
|
34
|
-
sidebar: {
|
|
35
|
-
...base.sidebar!!,
|
|
36
|
-
background: COLORS.WHITE,
|
|
37
|
-
},
|
|
38
|
-
textColorDark: textColorPrimary,
|
|
39
|
-
textColorLight: COLORS.WHITE,
|
|
40
|
-
textColorOverPrimaryBg: COLORS.WHITE,
|
|
41
|
-
textColorPrimary,
|
|
42
|
-
textColorSecondary: COLORS.GREY_NOT_QUITE_BLUE,
|
|
43
|
-
},
|
|
44
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import clone from "lodash/cloneDeep"
|
|
2
|
-
import { Theme } from "styles/theme/Theme.type"
|
|
3
|
-
import { light } from "styles/theme/light"
|
|
4
|
-
import { SPACINGS } from "styles/spacings"
|
|
5
|
-
|
|
6
|
-
export const light2: Theme = clone<Theme>(light)
|
|
7
|
-
light2.styles = {
|
|
8
|
-
...light2.styles,
|
|
9
|
-
appBar: {
|
|
10
|
-
...light2.styles.appBar,
|
|
11
|
-
shadow: "#0000000d 0 0 15px 0",
|
|
12
|
-
},
|
|
13
|
-
pageBackground: "#f7f7f7",
|
|
14
|
-
section: {
|
|
15
|
-
...light2.styles.section,
|
|
16
|
-
background: "#fff",
|
|
17
|
-
borderRadius: "3px",
|
|
18
|
-
margin: `${SPACINGS.XXXL} 0`,
|
|
19
|
-
padding: "2rem",
|
|
20
|
-
shadow: "#00000014 0 6px 14px 0",
|
|
21
|
-
},
|
|
22
|
-
}
|
package/src/styles/types.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export type ColorProps = {
|
|
2
|
-
accent? :boolean,
|
|
3
|
-
color? :string,
|
|
4
|
-
danger? :boolean,
|
|
5
|
-
neutral? :boolean,
|
|
6
|
-
primary? :boolean,
|
|
7
|
-
// deprecated
|
|
8
|
-
secondary? :boolean,
|
|
9
|
-
success? :boolean,
|
|
10
|
-
warning? :boolean,
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export type ContainerProps = {
|
|
14
|
-
color? :string,
|
|
15
|
-
compact? :boolean,
|
|
16
|
-
fluid? :boolean,
|
|
17
|
-
className? :any,
|
|
18
|
-
}
|
package/src/styles/typography.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { ValueOf } from "utils/types"
|
|
2
|
-
|
|
3
|
-
const XXS = ".8rem"
|
|
4
|
-
const XS = ".9rem"
|
|
5
|
-
const SM = "1rem"
|
|
6
|
-
const MD = "1.3rem"
|
|
7
|
-
const LG = "1.7rem"
|
|
8
|
-
const XL = "2.3rem"
|
|
9
|
-
const XXL = "3.3rem" // h1
|
|
10
|
-
const XXXL = "4rem"
|
|
11
|
-
const XXXXL = "5rem"
|
|
12
|
-
const XXXXXL = "6rem"
|
|
13
|
-
|
|
14
|
-
const THIN = "100"
|
|
15
|
-
const LIGHT = "300"
|
|
16
|
-
const REGULAR = "400"
|
|
17
|
-
const MEDIUM = "500"
|
|
18
|
-
const BOLD = "700"
|
|
19
|
-
const BLACK = "800"
|
|
20
|
-
|
|
21
|
-
const H1 = "h1"
|
|
22
|
-
const H2 = "h2"
|
|
23
|
-
const H3 = "h3"
|
|
24
|
-
const H4 = "h4"
|
|
25
|
-
const H5 = "h5"
|
|
26
|
-
const H6 = "h6"
|
|
27
|
-
const P = "p"
|
|
28
|
-
const SPAN = "span"
|
|
29
|
-
const DIV = "div"
|
|
30
|
-
|
|
31
|
-
export const FONT_TAGS = {
|
|
32
|
-
H1, H2, H3, H4, H5, H6, P, SPAN, DIV,
|
|
33
|
-
} as const
|
|
34
|
-
|
|
35
|
-
export const FONT_SIZES = {
|
|
36
|
-
XXS, XS, SM, MD, LG, XL, XXL, XXXL, XXXXL, XXXXXL,
|
|
37
|
-
} as const
|
|
38
|
-
|
|
39
|
-
export const FONT_SIZES_EM = Object.freeze({
|
|
40
|
-
XXS: XXS.replace("r", ""),
|
|
41
|
-
XS: XS.replace("r", ""),
|
|
42
|
-
SM: SM.replace("r", ""),
|
|
43
|
-
MD: MD.replace("r", ""),
|
|
44
|
-
LG: LG.replace("r", ""),
|
|
45
|
-
XL: XL.replace("r", ""),
|
|
46
|
-
XXL: XXL.replace("r", ""),
|
|
47
|
-
XXXL: XXXL.replace("r", ""),
|
|
48
|
-
XXXXL: XXXXL.replace("r", ""),
|
|
49
|
-
XXXXXL: XXXXXL.replace("r", ""),
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
export const FONT_WEIGHTS = {
|
|
53
|
-
THIN, LIGHT, REGULAR, MEDIUM, BOLD, BLACK,
|
|
54
|
-
} as const
|
|
55
|
-
|
|
56
|
-
export type FontSize = ValueOf<typeof FONT_SIZES>
|
|
57
|
-
export type FontWeight = ValueOf<typeof FONT_WEIGHTS>
|
|
58
|
-
export type FontTag = ValueOf<typeof FONT_TAGS>
|
|
59
|
-
export type TextAlignment = "center" | "left" | "right"
|
|
60
|
-
|
|
61
|
-
export type TextProps = {
|
|
62
|
-
align?: TextAlignment,
|
|
63
|
-
as?: FontTag,
|
|
64
|
-
hasSubText?: boolean,
|
|
65
|
-
size?: FontSize,
|
|
66
|
-
weight?: FontWeight,
|
|
67
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { Logger } from "utils/logging/Logger"
|
|
5
|
-
|
|
6
|
-
export type ScrollPassedNavBarListener = (b :boolean) => void
|
|
7
|
-
|
|
8
|
-
const listeners = new Set<ScrollPassedNavBarListener>()
|
|
9
|
-
let navBar :HTMLDivElement
|
|
10
|
-
let scrolledPassedNavBar :boolean
|
|
11
|
-
const logger = new Logger("NavBarScrollWatcher")
|
|
12
|
-
|
|
13
|
-
const checkNavPosition = () => {
|
|
14
|
-
if (!navBar) return
|
|
15
|
-
|
|
16
|
-
const { height: bottomPixel } = navBar.getBoundingClientRect()
|
|
17
|
-
const isCurrentlyPassedBar = window.scrollY > bottomPixel
|
|
18
|
-
|
|
19
|
-
logger.writeInfo(
|
|
20
|
-
"window.scrollY",
|
|
21
|
-
window.scrollY,
|
|
22
|
-
"bottomPixel",
|
|
23
|
-
bottomPixel,
|
|
24
|
-
"scrolledPassedNavBar",
|
|
25
|
-
scrolledPassedNavBar,
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
if ((scrolledPassedNavBar == null) ||
|
|
29
|
-
(!scrolledPassedNavBar && isCurrentlyPassedBar) ||
|
|
30
|
-
(scrolledPassedNavBar && !isCurrentlyPassedBar)) {
|
|
31
|
-
notifyListeners(isCurrentlyPassedBar)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
scrolledPassedNavBar = isCurrentlyPassedBar
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const notifyListeners = (b :boolean) => {
|
|
38
|
-
listeners.forEach((f :ScrollPassedNavBarListener) => { f(b) })
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export class NavBarScrollWatcher {
|
|
42
|
-
static onScrollPassedNavBar = (f :ScrollPassedNavBarListener) => {
|
|
43
|
-
listeners.add(f)
|
|
44
|
-
if (listeners.size === 1) {
|
|
45
|
-
window.addEventListener("scroll", checkNavPosition)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return () => {
|
|
49
|
-
listeners.delete(f)
|
|
50
|
-
if (listeners.size === 0) {
|
|
51
|
-
window.removeEventListener("scroll", checkNavPosition)
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
static setNavBar = (n :HTMLDivElement) => { navBar = n }
|
|
57
|
-
|
|
58
|
-
static setInitialState = () => { checkNavPosition() }
|
|
59
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { flatten as ldFlatten } from "lodash"
|
|
2
|
-
|
|
3
|
-
type IndexedMap<T> = ({ [key in string | number]: T })
|
|
4
|
-
export type Matrix<T> = Array<Array<T>>
|
|
5
|
-
export type NullableArray<T = any> = ArrayLike<T> | null | undefined
|
|
6
|
-
type ObjectWithProperty<Prop extends string> = { [key in Prop]: any }
|
|
7
|
-
|
|
8
|
-
export const arrayOfSizeN = (n: number): Array<any> => {
|
|
9
|
-
// return Array.from({length: n})
|
|
10
|
-
const arr: 0[] = []
|
|
11
|
-
for (let i = 0; i < n; i++) {
|
|
12
|
-
arr.push(0)
|
|
13
|
-
}
|
|
14
|
-
return arr
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const excludeBlanks = <T = any>(a: T[]): NonNullable<T>[] => (
|
|
18
|
-
a.filter((o: T) => o != null) as NonNullable<T>[]
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
export const flatten = <T>(m: Matrix<T>): Array<T> => ldFlatten(m)
|
|
22
|
-
|
|
23
|
-
export const indexBy = <FieldName extends string, T extends ObjectWithProperty<FieldName>>(
|
|
24
|
-
a: T[],
|
|
25
|
-
fieldName: FieldName
|
|
26
|
-
): IndexedMap<T> => {
|
|
27
|
-
const index: IndexedMap<T> = {}
|
|
28
|
-
|
|
29
|
-
a.forEach((item) => {
|
|
30
|
-
const key = item[fieldName]
|
|
31
|
-
index[key] = item
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
return index
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export const isEmpty = (a: NullableArray): boolean => (!a?.length)
|
|
38
|
-
export const isLastIndex = (a: any[], i: number) => i === a.length - 1
|
|
39
|
-
export const isLastItem = <E>(a: ArrayLike<E>, item: E): boolean =>
|
|
40
|
-
(lastItem(a) === item)
|
|
41
|
-
export const isNotEmpty = (a: NullableArray): boolean => !isEmpty(a)
|
|
42
|
-
export const isNotLastIndex = (a: any[], i: number) => !isLastIndex(a, i)
|
|
43
|
-
export const isNotLastItem = <E>(a: ArrayLike<E>, item: E): boolean =>
|
|
44
|
-
(!isLastItem(a, item))
|
|
45
|
-
export const lastItem = <E>(a: ArrayLike<E>): E => a[a.length - 1]
|
|
46
|
-
|
|
47
|
-
export const splitArray = (arr: any[], index: number,): any[][] => {
|
|
48
|
-
const preSplit = [...arr]
|
|
49
|
-
const postSplit = preSplit.splice(index)
|
|
50
|
-
return [preSplit, postSplit]
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export const takeOutItem = <T>(arr: Array<T>, index: number): Array<T> => {
|
|
54
|
-
const [preSplit, [, ...postSplit]] = splitArray(arr, index)
|
|
55
|
-
return [...preSplit, ...postSplit]
|
|
56
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export const MONTH_MAP = {
|
|
2
|
-
JANUARY : 0,
|
|
3
|
-
FEBRUARY : 1,
|
|
4
|
-
MARCH : 2,
|
|
5
|
-
APRIL : 3,
|
|
6
|
-
MAY : 4,
|
|
7
|
-
JUNE : 5,
|
|
8
|
-
JULY : 6,
|
|
9
|
-
AUGUST : 7,
|
|
10
|
-
SEPTEMBER: 8,
|
|
11
|
-
OCTOBER : 9,
|
|
12
|
-
NOVEMBER : 10,
|
|
13
|
-
DECEMBER : 11,
|
|
14
|
-
} as const
|
|
15
|
-
|
|
16
|
-
export type Month = keyof typeof MONTH_MAP
|
|
17
|
-
|
|
18
|
-
export const getNextMonth = (currMon :number) :number => (
|
|
19
|
-
currMon === MONTH_MAP.DECEMBER ? MONTH_MAP.JANUARY : currMon + 1
|
|
20
|
-
)
|
|
21
|
-
export const getPrevMonth = (currMon :number) :number => (
|
|
22
|
-
currMon === MONTH_MAP.JANUARY ? MONTH_MAP.DECEMBER : currMon - 1
|
|
23
|
-
)
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import moment, { Moment } from "moment"
|
|
2
|
-
import { PromiseFunc } from "utils/function.types"
|
|
3
|
-
|
|
4
|
-
let defaultLocale = new Intl.DateTimeFormat().resolvedOptions().locale
|
|
5
|
-
|
|
6
|
-
export const formatMonthDate = (m: Moment): string => m.format("MMM D")
|
|
7
|
-
export const formatDayDate = (m: Moment): string => m.format("ddd, ll")
|
|
8
|
-
export const formatMonthDateYear = (m: Moment): string => m.format("MMM DD YYYY")
|
|
9
|
-
export const setDefaultLocale = (locale: string) => {
|
|
10
|
-
defaultLocale =
|
|
11
|
-
locale
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
type FormatOptions = {
|
|
15
|
-
locale?: string,
|
|
16
|
-
iso8601Format?: boolean,
|
|
17
|
-
timeZone?: string,
|
|
18
|
-
}
|
|
19
|
-
export const formatDate = (
|
|
20
|
-
d: Date,
|
|
21
|
-
{
|
|
22
|
-
locale = defaultLocale,
|
|
23
|
-
iso8601Format = false,
|
|
24
|
-
...options
|
|
25
|
-
}: FormatOptions = {},
|
|
26
|
-
): string => {
|
|
27
|
-
const formatter = new Intl.DateTimeFormat(locale, options)
|
|
28
|
-
|
|
29
|
-
try {
|
|
30
|
-
if (iso8601Format) {
|
|
31
|
-
const parts = formatter.formatToParts(d)
|
|
32
|
-
return ["year", "month", "day"].map((part: string) => {
|
|
33
|
-
return parts?.find((p) => p.type === part)?.value
|
|
34
|
-
}).join("-")
|
|
35
|
-
}
|
|
36
|
-
} catch (e) {}
|
|
37
|
-
|
|
38
|
-
const formatted = formatter.format(d)
|
|
39
|
-
return locale.includes("en") ? formatted.replace(/\//g, "-") : formatted
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export const formatDateTime = (
|
|
43
|
-
d: Date,
|
|
44
|
-
{
|
|
45
|
-
locale = defaultLocale,
|
|
46
|
-
...options
|
|
47
|
-
}: FormatOptions = {},
|
|
48
|
-
): string => {
|
|
49
|
-
const formattedDate = formatDate(
|
|
50
|
-
d,
|
|
51
|
-
{ locale, iso8601Format: true, ...options }
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
return `${formattedDate} ${moment(d).format("LTS")}`
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export const returnAfterMinimum = async (
|
|
58
|
-
millisecs: number,
|
|
59
|
-
f: PromiseFunc,
|
|
60
|
-
...fArgs: any
|
|
61
|
-
) => {
|
|
62
|
-
const start: Moment = moment()
|
|
63
|
-
const val = await f(...fArgs)
|
|
64
|
-
const end: Moment = moment()
|
|
65
|
-
const diff = end.diff(start, "milliseconds")
|
|
66
|
-
|
|
67
|
-
if (diff < millisecs) {
|
|
68
|
-
await new Promise((resolve) => {
|
|
69
|
-
setTimeout(resolve, millisecs - diff)
|
|
70
|
-
})
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return val
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export const momentListToDateList = (l: Moment[]): Date[] => (
|
|
77
|
-
l.map((m: Moment) => m.toDate())
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
export const minDateBetween = (a: Moment, b: Moment): Moment => (
|
|
81
|
-
a.isBefore(b) ? a : b
|
|
82
|
-
)
|
|
83
|
-
export const maxDateBetween = (a: Moment, b: Moment): Moment => (
|
|
84
|
-
a.isAfter(b) ? a : b
|
|
85
|
-
)
|
|
86
|
-
|
|
87
|
-
export const addNDaysFromDate = (n: number, d = new Date()): Date =>
|
|
88
|
-
momentArithmetic(d, "add", n, "days")
|
|
89
|
-
export const addNWeeksFromDate = (n: number, d = new Date()): Date =>
|
|
90
|
-
momentArithmetic(d, "add", n, "weeks")
|
|
91
|
-
export const subtractNDaysFromDate = (n: number, d = new Date()): Date =>
|
|
92
|
-
momentArithmetic(d, "subtract", n, "days")
|
|
93
|
-
export const subtractNWeeksFromDate = (n: number, d = new Date()): Date =>
|
|
94
|
-
momentArithmetic(d, "subtract", n, "weeks")
|
|
95
|
-
|
|
96
|
-
const momentArithmetic = (
|
|
97
|
-
d: Date,
|
|
98
|
-
func: string,
|
|
99
|
-
n: number,
|
|
100
|
-
unit: string
|
|
101
|
-
): Date => {
|
|
102
|
-
// @ts-ignore
|
|
103
|
-
const newDate = (moment(d)[func] as Function)(n, unit) as Moment
|
|
104
|
-
return newDate.toDate()
|
|
105
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type PromiseFunc<T = any, Rtn = any> = ((...o: T[]) => Promise<Rtn>)
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { isNotLastIndex } from "utils/arrayHelpers"
|
|
2
|
-
import { PromiseFunc } from "utils/function.types"
|
|
3
|
-
|
|
4
|
-
type MaybePromiseFunc = PromiseFunc | ((...o: any) => any)
|
|
5
|
-
|
|
6
|
-
export const DO_NOTHING = function(...args :any) {}
|
|
7
|
-
|
|
8
|
-
export const flowInOrderAsync = (...funcs: MaybePromiseFunc[]): PromiseFunc => {
|
|
9
|
-
const wrappedFuncs = funcs.map((func, i: number) => {
|
|
10
|
-
return async (promises: PromiseFunc[], ...args: any) => {
|
|
11
|
-
const nextFunc = isNotLastIndex(funcs, i) ? promises[i + 1] : null
|
|
12
|
-
|
|
13
|
-
const val = await func(...args)
|
|
14
|
-
return !!nextFunc ? nextFunc(promises, val) : val
|
|
15
|
-
}
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
return async (...args) => wrappedFuncs[0](wrappedFuncs, ...args)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const parseNumberAndCall = (action :(n :number) => void) => (s :string) => {
|
|
22
|
-
action(Number(s))
|
|
23
|
-
}
|
package/src/utils/idGenerator.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { LoggerI } from "utils/logging/Logger.type"
|
|
2
|
-
|
|
3
|
-
const LEVEL_STYLES = {
|
|
4
|
-
info: "background: #499cc8; color: white;",
|
|
5
|
-
error: "background: #c14a4f; color: white;",
|
|
6
|
-
warn: "background: #e0a270; color: black;",
|
|
7
|
-
} as const
|
|
8
|
-
|
|
9
|
-
export class Logger implements LoggerI {
|
|
10
|
-
moduleName: string
|
|
11
|
-
|
|
12
|
-
constructor(moduleName: string) {
|
|
13
|
-
this.moduleName = moduleName
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
log = (level: keyof typeof LEVEL_STYLES) => (...args: any) => {
|
|
17
|
-
if (typeof window === "undefined" ||
|
|
18
|
-
!window.DEBUG_MODULES.has(this.moduleName)) return
|
|
19
|
-
|
|
20
|
-
console[level](
|
|
21
|
-
`%c${this.moduleName}`,
|
|
22
|
-
`${LEVEL_STYLES[level]} padding: 2px 6px;`,
|
|
23
|
-
...args,
|
|
24
|
-
)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
writeInfo = this.log("info")
|
|
28
|
-
writeError = this.log("error")
|
|
29
|
-
writeWarning = this.log("warn")
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (typeof window !== `undefined`) {
|
|
33
|
-
window.DEBUG_MODULES = new Set()
|
|
34
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React, { ComponentType as RComponentType } from "react"
|
|
2
|
-
import { LoggerI } from "utils/logging/Logger.type"
|
|
3
|
-
import { withModuleLogging } from "utils/logging/with_module_logging"
|
|
4
|
-
|
|
5
|
-
type ComponentType<T> = RComponentType<T> & {
|
|
6
|
-
COMPONENT_NAME: string
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const loggable = <T, >(C: ComponentType<T>): ComponentType<T> => (
|
|
10
|
-
withModuleLogging(C.COMPONENT_NAME, (logger: LoggerI) => (
|
|
11
|
-
class Loggable extends React.Component<T> {
|
|
12
|
-
render() {
|
|
13
|
-
return <C {...this.props} logger={logger} />
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
))
|
|
17
|
-
)
|