@sproutsocial/racine 24.1.0 → 25.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/codemods/__tests__/icon-library.test.js +5 -11
- package/commonjs/Avatar/Avatar.js +3 -2
- package/commonjs/Duration/Duration.js +31 -49
- package/commonjs/Duration/constants.js +21 -2
- package/commonjs/Duration/index.js +9 -1
- package/commonjs/Duration/utils.js +76 -0
- package/dist/types/Avatar/Avatar.d.ts.map +1 -1
- package/dist/types/Duration/Duration.d.ts.map +1 -1
- package/dist/types/Duration/DurationTypes.d.ts +16 -4
- package/dist/types/Duration/DurationTypes.d.ts.map +1 -1
- package/dist/types/Duration/constants.d.ts +18 -1
- package/dist/types/Duration/constants.d.ts.map +1 -1
- package/dist/types/Duration/index.d.ts +3 -0
- package/dist/types/Duration/index.d.ts.map +1 -1
- package/dist/types/Duration/utils.d.ts +16 -0
- package/dist/types/Duration/utils.d.ts.map +1 -0
- package/lib/Avatar/Avatar.js +3 -2
- package/lib/Duration/Duration.js +30 -48
- package/lib/Duration/constants.js +20 -1
- package/lib/Duration/index.js +2 -0
- package/lib/Duration/utils.js +70 -0
- package/package.json +2 -9
- package/__flow__/Avatar/Avatar.flow.js +0 -17
- package/__flow__/Avatar/constants.flow.js +0 -11
- package/__flow__/Avatar/index.flow.js +0 -3
- package/__flow__/Badge/Badge.flow.js +0 -21
- package/__flow__/Badge/constants.flow.js +0 -28
- package/__flow__/Badge/index.flow.js +0 -3
- package/__flow__/Banner/Banner.flow.js +0 -22
- package/__flow__/Banner/index.flow.js +0 -2
- package/__flow__/Box/Box.flow.js +0 -22
- package/__flow__/Box/index.flow.js +0 -2
- package/__flow__/Breadcrumb/Breadcrumb.flow.js +0 -22
- package/__flow__/Breadcrumb/index.flow.js +0 -2
- package/__flow__/Button/Button.flow.js +0 -36
- package/__flow__/Button/index.flow.js +0 -2
- package/__flow__/Card/Card.flow.js +0 -9
- package/__flow__/Card/CardTypes.flow.js +0 -73
- package/__flow__/Card/index.flow.js +0 -3
- package/__flow__/CharacterCounter/CharacterCounter.flow.js +0 -12
- package/__flow__/CharacterCounter/index.flow.js +0 -2
- package/__flow__/ChartLegend/ChartLegend.flow.js +0 -18
- package/__flow__/ChartLegend/index.flow.js +0 -2
- package/__flow__/Checkbox/Checkbox.flow.js +0 -24
- package/__flow__/Checkbox/index.flow.js +0 -2
- package/__flow__/Collapsible/Collapsible.flow.js +0 -19
- package/__flow__/Collapsible/index.flow.js +0 -2
- package/__flow__/DatePicker/DateRangePicker/DateRangePicker.flow.js +0 -19
- package/__flow__/DatePicker/DateRangePicker/StatefulDateRangePicker.flow.js +0 -11
- package/__flow__/DatePicker/DateRangePicker/index.flow.js +0 -3
- package/__flow__/DatePicker/SingleDatePicker/SingleDatePicker.flow.js +0 -17
- package/__flow__/DatePicker/SingleDatePicker/StatefulSingleDatePicker.flow.js +0 -9
- package/__flow__/DatePicker/SingleDatePicker/index.flow.js +0 -3
- package/__flow__/DatePicker/common.flow.js +0 -21
- package/__flow__/DatePicker/index.flow.js +0 -6
- package/__flow__/Drawer/Drawer.flow.js +0 -49
- package/__flow__/Drawer/index.flow.js +0 -2
- package/__flow__/EmptyState/EmptyState.flow.js +0 -17
- package/__flow__/EmptyState/index.flow.js +0 -2
- package/__flow__/Fieldset/Fieldset.flow.js +0 -16
- package/__flow__/Fieldset/index.flow.js +0 -2
- package/__flow__/FormField/FormField.flow.js +0 -32
- package/__flow__/FormField/index.flow.js +0 -2
- package/__flow__/Icon/Icon.flow.js +0 -50
- package/__flow__/Icon/index.flow.js +0 -4
- package/__flow__/Image/Image.flow.js +0 -25
- package/__flow__/Image/index.flow.js +0 -2
- package/__flow__/Indicator/Indicator.flow.js +0 -11
- package/__flow__/Indicator/index.flow.js +0 -2
- package/__flow__/Input/Input.flow.js +0 -65
- package/__flow__/Input/index.flow.js +0 -2
- package/__flow__/KeyboardKey/KeyboardKey.flow.js +0 -9
- package/__flow__/KeyboardKey/index.flow.js +0 -2
- package/__flow__/Label/Label.flow.js +0 -16
- package/__flow__/Label/index.flow.js +0 -2
- package/__flow__/Link/Link.flow.js +0 -20
- package/__flow__/Link/index.flow.js +0 -2
- package/__flow__/Listbox/Listbox.flow.js +0 -33
- package/__flow__/Listbox/index.flow.js +0 -2
- package/__flow__/Loader/Loader.flow.js +0 -14
- package/__flow__/Loader/index.flow.js +0 -2
- package/__flow__/LoaderButton/LoaderButton.flow.js +0 -11
- package/__flow__/LoaderButton/index.flow.js +0 -2
- package/__flow__/Menu/Menu.flow.js +0 -142
- package/__flow__/Menu/index.flow.js +0 -3
- package/__flow__/Menu/utils/constants.flow.js +0 -16
- package/__flow__/Message/Message.flow.js +0 -48
- package/__flow__/Message/index.flow.js +0 -2
- package/__flow__/Modal/Modal.flow.js +0 -59
- package/__flow__/Modal/index.flow.js +0 -2
- package/__flow__/Numeral/Numeral.flow.js +0 -23
- package/__flow__/Numeral/index.flow.js +0 -2
- package/__flow__/PartnerLogo/PartnerLogo.flow.js +0 -27
- package/__flow__/PartnerLogo/index.flow.js +0 -2
- package/__flow__/Popout/Popout.flow.js +0 -103
- package/__flow__/Popout/index.flow.js +0 -2
- package/__flow__/Portal/Portal.flow.js +0 -17
- package/__flow__/Portal/index.flow.js +0 -2
- package/__flow__/Radio/Radio.flow.js +0 -21
- package/__flow__/Radio/index.flow.js +0 -2
- package/__flow__/SegmentedControl/SegmentedControl.flow.js +0 -27
- package/__flow__/SegmentedControl/index.flow.js +0 -2
- package/__flow__/Select/Select.flow.js +0 -27
- package/__flow__/Select/index.flow.js +0 -2
- package/__flow__/Skeleton/Skeleton.flow.js +0 -6
- package/__flow__/Skeleton/index.flow.js +0 -2
- package/__flow__/SpotIllustration/SpotIllustration.flow.js +0 -12
- package/__flow__/SpotIllustration/index.flow.js +0 -2
- package/__flow__/Stack/Stack.flow.js +0 -26
- package/__flow__/Stack/index.flow.js +0 -2
- package/__flow__/Switch/Switch.flow.js +0 -5
- package/__flow__/Switch/SwitchTypes.flow.js +0 -16
- package/__flow__/Switch/index.flow.js +0 -3
- package/__flow__/Table/Table.flow.js +0 -48
- package/__flow__/Table/index.flow.js +0 -2
- package/__flow__/TableCell/TableCell.flow.js +0 -28
- package/__flow__/TableCell/index.flow.js +0 -2
- package/__flow__/TableHeaderCell/TableHeaderCell.flow.js +0 -30
- package/__flow__/TableHeaderCell/index.flow.js +0 -2
- package/__flow__/TableRowAccordion/TableRowAccordion.flow.js +0 -15
- package/__flow__/TableRowAccordion/index.flow.js +0 -2
- package/__flow__/Tabs/Tabs.flow.js +0 -26
- package/__flow__/Tabs/index.flow.js +0 -2
- package/__flow__/Text/Text.flow.js +0 -27
- package/__flow__/Text/index.flow.js +0 -2
- package/__flow__/Textarea/Textarea.flow.js +0 -59
- package/__flow__/Textarea/index.flow.js +0 -2
- package/__flow__/ThemeProvider/index.flow.js +0 -12
- package/__flow__/Toast/Toast.flow.js +0 -27
- package/__flow__/Toast/index.flow.js +0 -2
- package/__flow__/ToggleHint/ToggleHint.flow.js +0 -21
- package/__flow__/ToggleHint/index.flow.js +0 -2
- package/__flow__/Token/Token.flow.js +0 -17
- package/__flow__/Token/index.flow.js +0 -2
- package/__flow__/TokenInput/TokenInput.flow.js +0 -79
- package/__flow__/TokenInput/TokenScreenReaderStatus.js +0 -32
- package/__flow__/TokenInput/index.flow.js +0 -2
- package/__flow__/Tooltip/Tooltip.flow.js +0 -24
- package/__flow__/Tooltip/index.flow.js +0 -2
- package/__flow__/VisuallyHidden/VisuallyHidden.flow.js +0 -3
- package/__flow__/VisuallyHidden/index.flow.js +0 -2
- package/__flow__/index.flow.js +0 -136
- package/__flow__/index.js +0 -2
- package/__flow__/systemProps/background.flow.js +0 -17
- package/__flow__/systemProps/border.flow.js +0 -46
- package/__flow__/systemProps/color.flow.js +0 -16
- package/__flow__/systemProps/custom.flow.js +0 -16
- package/__flow__/systemProps/flexbox.flow.js +0 -28
- package/__flow__/systemProps/grid.flow.js +0 -26
- package/__flow__/systemProps/index.flow.js +0 -16
- package/__flow__/systemProps/layout.flow.js +0 -25
- package/__flow__/systemProps/position.flow.js +0 -17
- package/__flow__/systemProps/shadow.flow.js +0 -13
- package/__flow__/systemProps/space.flow.js +0 -71
- package/__flow__/systemProps/systemProps.flow.js +0 -30
- package/__flow__/systemProps/tests/types.flow.js +0 -51
- package/__flow__/systemProps/types.flow.js +0 -12
- package/__flow__/systemProps/typography.flow.js +0 -21
- package/__flow__/systemProps/variant.flow.js +0 -14
- package/__flow__/themes/dark/dataviz-palette.flow.js +0 -3
- package/__flow__/themes/dark/decorative-palettes.flow.js +0 -13
- package/__flow__/themes/dark/theme.flow.js +0 -5
- package/__flow__/themes/extendedThemes/sproutTheme/dark/theme.flow.js +0 -10
- package/__flow__/themes/extendedThemes/sproutTheme/index.flow.js +0 -3
- package/__flow__/themes/extendedThemes/sproutTheme/light/theme.flow.js +0 -10
- package/__flow__/themes/light/dataviz-palette.flow.js +0 -29
- package/__flow__/themes/light/decorative-palettes.flow.js +0 -17
- package/__flow__/themes/light/literal-colors.flow.js +0 -31
- package/__flow__/themes/light/theme.flow.js +0 -16
- package/__flow__/types/index.flow.js +0 -7
- package/__flow__/types/shared.flow.js +0 -9
- package/__flow__/types/styled-components.flow.js +0 -8
- package/__flow__/types/system-props.flow.js +0 -136
- package/__flow__/types/theme.colors.flow.js +0 -364
- package/__flow__/types/theme.flow.js +0 -373
- package/__flow__/utils/a11yTest.flow.js +0 -5
- package/__flow__/utils/chartColors.flow.js +0 -11
- package/__flow__/utils/constants.flow.js +0 -3
- package/__flow__/utils/dataQaLabelQueries.flow.js +0 -20
- package/__flow__/utils/hooks.flow.js +0 -66
- package/__flow__/utils/index.flow.js +0 -11
- package/__flow__/utils/innerText.flow.js +0 -4
- package/__flow__/utils/mixins.flow.js +0 -7
- package/__flow__/utils/react-testing-library.flow.js +0 -14
- package/__flow__/utils/responsiveProps/index.flow.js +0 -3
- package/__flow__/utils/responsiveProps/index.test.flow.js +0 -22
- package/__flow__/utils/system-props.flow.js +0 -9
- package/__flow__/utils/useInteractiveColor.flow.js +0 -3
- package/commonjs/Avatar/Avatar.flow.js +0 -6
- package/commonjs/Avatar/constants.flow.js +0 -16
- package/commonjs/Avatar/index.flow.js +0 -27
- package/commonjs/Badge/Badge.flow.js +0 -7
- package/commonjs/Badge/constants.flow.js +0 -19
- package/commonjs/Badge/index.flow.js +0 -27
- package/commonjs/Banner/Banner.flow.js +0 -6
- package/commonjs/Banner/index.flow.js +0 -16
- package/commonjs/Box/Box.flow.js +0 -6
- package/commonjs/Box/index.flow.js +0 -16
- package/commonjs/Breadcrumb/Breadcrumb.flow.js +0 -6
- package/commonjs/Breadcrumb/index.flow.js +0 -16
- package/commonjs/Button/Button.flow.js +0 -6
- package/commonjs/Button/index.flow.js +0 -16
- package/commonjs/Card/Card.flow.js +0 -6
- package/commonjs/Card/CardTypes.flow.js +0 -6
- package/commonjs/Card/index.flow.js +0 -27
- package/commonjs/CharacterCounter/CharacterCounter.flow.js +0 -6
- package/commonjs/CharacterCounter/index.flow.js +0 -16
- package/commonjs/ChartLegend/ChartLegend.flow.js +0 -6
- package/commonjs/ChartLegend/index.flow.js +0 -16
- package/commonjs/Checkbox/Checkbox.flow.js +0 -6
- package/commonjs/Checkbox/index.flow.js +0 -16
- package/commonjs/Collapsible/Collapsible.flow.js +0 -6
- package/commonjs/Collapsible/index.flow.js +0 -16
- package/commonjs/DatePicker/DateRangePicker/DateRangePicker.flow.js +0 -6
- package/commonjs/DatePicker/DateRangePicker/StatefulDateRangePicker.flow.js +0 -6
- package/commonjs/DatePicker/DateRangePicker/index.flow.js +0 -27
- package/commonjs/DatePicker/SingleDatePicker/SingleDatePicker.flow.js +0 -6
- package/commonjs/DatePicker/SingleDatePicker/StatefulSingleDatePicker.flow.js +0 -6
- package/commonjs/DatePicker/SingleDatePicker/index.flow.js +0 -27
- package/commonjs/DatePicker/common.flow.js +0 -1
- package/commonjs/DatePicker/index.flow.js +0 -60
- package/commonjs/Drawer/Drawer.flow.js +0 -6
- package/commonjs/Drawer/index.flow.js +0 -16
- package/commonjs/EmptyState/EmptyState.flow.js +0 -6
- package/commonjs/EmptyState/index.flow.js +0 -16
- package/commonjs/Fieldset/Fieldset.flow.js +0 -6
- package/commonjs/Fieldset/index.flow.js +0 -16
- package/commonjs/FormField/FormField.flow.js +0 -6
- package/commonjs/FormField/index.flow.js +0 -16
- package/commonjs/Icon/Icon.flow.js +0 -6
- package/commonjs/Icon/index.flow.js +0 -29
- package/commonjs/Image/Image.flow.js +0 -6
- package/commonjs/Image/index.flow.js +0 -16
- package/commonjs/Indicator/Indicator.flow.js +0 -6
- package/commonjs/Indicator/index.flow.js +0 -16
- package/commonjs/Input/Input.flow.js +0 -6
- package/commonjs/Input/index.flow.js +0 -16
- package/commonjs/KeyboardKey/KeyboardKey.flow.js +0 -6
- package/commonjs/KeyboardKey/index.flow.js +0 -16
- package/commonjs/Label/Label.flow.js +0 -8
- package/commonjs/Label/index.flow.js +0 -16
- package/commonjs/Link/Link.flow.js +0 -6
- package/commonjs/Link/index.flow.js +0 -16
- package/commonjs/Listbox/Listbox.flow.js +0 -10
- package/commonjs/Listbox/index.flow.js +0 -16
- package/commonjs/Loader/Loader.flow.js +0 -6
- package/commonjs/Loader/index.flow.js +0 -16
- package/commonjs/LoaderButton/LoaderButton.flow.js +0 -6
- package/commonjs/LoaderButton/index.flow.js +0 -16
- package/commonjs/Menu/Menu.flow.js +0 -11
- package/commonjs/Menu/index.flow.js +0 -27
- package/commonjs/Menu/utils/constants.flow.js +0 -18
- package/commonjs/Message/Message.flow.js +0 -20
- package/commonjs/Message/index.flow.js +0 -16
- package/commonjs/Modal/Modal.flow.js +0 -8
- package/commonjs/Modal/index.flow.js +0 -16
- package/commonjs/Numeral/Numeral.flow.js +0 -6
- package/commonjs/Numeral/index.flow.js +0 -16
- package/commonjs/PartnerLogo/PartnerLogo.flow.js +0 -6
- package/commonjs/PartnerLogo/index.flow.js +0 -16
- package/commonjs/Popout/Popout.flow.js +0 -6
- package/commonjs/Popout/index.flow.js +0 -16
- package/commonjs/Portal/Portal.flow.js +0 -6
- package/commonjs/Portal/index.flow.js +0 -16
- package/commonjs/Radio/Radio.flow.js +0 -6
- package/commonjs/Radio/index.flow.js +0 -16
- package/commonjs/SegmentedControl/SegmentedControl.flow.js +0 -6
- package/commonjs/SegmentedControl/index.flow.js +0 -16
- package/commonjs/Select/Select.flow.js +0 -6
- package/commonjs/Select/index.flow.js +0 -16
- package/commonjs/Skeleton/Skeleton.flow.js +0 -4
- package/commonjs/Skeleton/index.flow.js +0 -16
- package/commonjs/SpotIllustration/SpotIllustration.flow.js +0 -6
- package/commonjs/SpotIllustration/index.flow.js +0 -16
- package/commonjs/Stack/Stack.flow.js +0 -6
- package/commonjs/Stack/index.flow.js +0 -16
- package/commonjs/Switch/Switch.flow.js +0 -6
- package/commonjs/Switch/SwitchTypes.flow.js +0 -1
- package/commonjs/Switch/index.flow.js +0 -27
- package/commonjs/Table/Table.flow.js +0 -9
- package/commonjs/Table/index.flow.js +0 -16
- package/commonjs/TableCell/TableCell.flow.js +0 -6
- package/commonjs/TableCell/index.flow.js +0 -16
- package/commonjs/TableHeaderCell/TableHeaderCell.flow.js +0 -14
- package/commonjs/TableHeaderCell/index.flow.js +0 -16
- package/commonjs/TableRowAccordion/TableRowAccordion.flow.js +0 -6
- package/commonjs/TableRowAccordion/index.flow.js +0 -16
- package/commonjs/Tabs/Tabs.flow.js +0 -6
- package/commonjs/Tabs/index.flow.js +0 -16
- package/commonjs/Text/Text.flow.js +0 -6
- package/commonjs/Text/index.flow.js +0 -16
- package/commonjs/Textarea/Textarea.flow.js +0 -6
- package/commonjs/Textarea/index.flow.js +0 -16
- package/commonjs/ThemeProvider/index.flow.js +0 -6
- package/commonjs/Toast/Toast.flow.js +0 -6
- package/commonjs/Toast/index.flow.js +0 -16
- package/commonjs/ToggleHint/ToggleHint.flow.js +0 -6
- package/commonjs/ToggleHint/index.flow.js +0 -16
- package/commonjs/Token/Token.flow.js +0 -6
- package/commonjs/Token/index.flow.js +0 -16
- package/commonjs/TokenInput/TokenInput.flow.js +0 -6
- package/commonjs/TokenInput/index.flow.js +0 -16
- package/commonjs/Tooltip/Tooltip.flow.js +0 -6
- package/commonjs/Tooltip/index.flow.js +0 -16
- package/commonjs/VisuallyHidden/VisuallyHidden.flow.js +0 -6
- package/commonjs/VisuallyHidden/index.flow.js +0 -16
- package/commonjs/index.flow.js +0 -594
- package/commonjs/index.js.flow +0 -2
- package/commonjs/systemProps/background.flow.js +0 -9
- package/commonjs/systemProps/border.flow.js +0 -9
- package/commonjs/systemProps/color.flow.js +0 -9
- package/commonjs/systemProps/custom.flow.js +0 -12
- package/commonjs/systemProps/flexbox.flow.js +0 -9
- package/commonjs/systemProps/grid.flow.js +0 -9
- package/commonjs/systemProps/index.flow.js +0 -159
- package/commonjs/systemProps/layout.flow.js +0 -9
- package/commonjs/systemProps/position.flow.js +0 -9
- package/commonjs/systemProps/shadow.flow.js +0 -9
- package/commonjs/systemProps/space.flow.js +0 -23
- package/commonjs/systemProps/systemProps.flow.js +0 -20
- package/commonjs/systemProps/tests/types.flow.js +0 -48
- package/commonjs/systemProps/types.flow.js +0 -1
- package/commonjs/systemProps/typography.flow.js +0 -9
- package/commonjs/systemProps/variant.flow.js +0 -12
- package/commonjs/themes/dark/dataviz-palette.flow.js +0 -1
- package/commonjs/themes/dark/decorative-palettes.flow.js +0 -1
- package/commonjs/themes/dark/theme.flow.js +0 -1
- package/commonjs/themes/extendedThemes/sproutTheme/dark/theme.flow.js +0 -7
- package/commonjs/themes/extendedThemes/sproutTheme/index.flow.js +0 -20
- package/commonjs/themes/extendedThemes/sproutTheme/light/theme.flow.js +0 -1
- package/commonjs/themes/light/dataviz-palette.flow.js +0 -1
- package/commonjs/themes/light/decorative-palettes.flow.js +0 -1
- package/commonjs/themes/light/literal-colors.flow.js +0 -1
- package/commonjs/themes/light/theme.flow.js +0 -1
- package/commonjs/types/index.flow.js +0 -60
- package/commonjs/types/shared.flow.js +0 -6
- package/commonjs/types/styled-components.flow.js +0 -6
- package/commonjs/types/system-props.flow.js +0 -2
- package/commonjs/types/theme.colors.flow.js +0 -1
- package/commonjs/types/theme.flow.js +0 -1
- package/commonjs/utils/a11yTest.flow.js +0 -1
- package/commonjs/utils/chartColors.flow.js +0 -1
- package/commonjs/utils/constants.flow.js +0 -1
- package/commonjs/utils/dataQaLabelQueries.flow.js +0 -1
- package/commonjs/utils/hooks.flow.js +0 -28
- package/commonjs/utils/index.flow.js +0 -1
- package/commonjs/utils/innerText.flow.js +0 -6
- package/commonjs/utils/mixins.flow.js +0 -1
- package/commonjs/utils/react-testing-library.flow.js +0 -9
- package/commonjs/utils/responsiveProps/index.flow.js +0 -1
- package/commonjs/utils/responsiveProps/index.test.flow.js +0 -23
- package/commonjs/utils/system-props.flow.js +0 -1
- package/commonjs/utils/useInteractiveColor.flow.js +0 -1
- package/lib/Avatar/Avatar.flow.js +0 -1
- package/lib/Avatar/constants.flow.js +0 -10
- package/lib/Avatar/index.flow.js +0 -2
- package/lib/Badge/Badge.flow.js +0 -2
- package/lib/Badge/constants.flow.js +0 -13
- package/lib/Badge/index.flow.js +0 -2
- package/lib/Banner/Banner.flow.js +0 -1
- package/lib/Banner/index.flow.js +0 -1
- package/lib/Box/Box.flow.js +0 -1
- package/lib/Box/index.flow.js +0 -1
- package/lib/Breadcrumb/Breadcrumb.flow.js +0 -1
- package/lib/Breadcrumb/index.flow.js +0 -1
- package/lib/Button/Button.flow.js +0 -1
- package/lib/Button/index.flow.js +0 -1
- package/lib/Card/Card.flow.js +0 -1
- package/lib/Card/CardTypes.flow.js +0 -1
- package/lib/Card/index.flow.js +0 -2
- package/lib/CharacterCounter/CharacterCounter.flow.js +0 -1
- package/lib/CharacterCounter/index.flow.js +0 -1
- package/lib/ChartLegend/ChartLegend.flow.js +0 -1
- package/lib/ChartLegend/index.flow.js +0 -1
- package/lib/Checkbox/Checkbox.flow.js +0 -1
- package/lib/Checkbox/index.flow.js +0 -1
- package/lib/Collapsible/Collapsible.flow.js +0 -1
- package/lib/Collapsible/index.flow.js +0 -1
- package/lib/DatePicker/DateRangePicker/DateRangePicker.flow.js +0 -1
- package/lib/DatePicker/DateRangePicker/StatefulDateRangePicker.flow.js +0 -1
- package/lib/DatePicker/DateRangePicker/index.flow.js +0 -2
- package/lib/DatePicker/SingleDatePicker/SingleDatePicker.flow.js +0 -1
- package/lib/DatePicker/SingleDatePicker/StatefulSingleDatePicker.flow.js +0 -1
- package/lib/DatePicker/SingleDatePicker/index.flow.js +0 -2
- package/lib/DatePicker/common.flow.js +0 -0
- package/lib/DatePicker/index.flow.js +0 -5
- package/lib/Drawer/Drawer.flow.js +0 -1
- package/lib/Drawer/index.flow.js +0 -1
- package/lib/EmptyState/EmptyState.flow.js +0 -1
- package/lib/EmptyState/index.flow.js +0 -1
- package/lib/Fieldset/Fieldset.flow.js +0 -1
- package/lib/Fieldset/index.flow.js +0 -1
- package/lib/FormField/FormField.flow.js +0 -1
- package/lib/FormField/index.flow.js +0 -1
- package/lib/Icon/Icon.flow.js +0 -3
- package/lib/Icon/index.flow.js +0 -3
- package/lib/Image/Image.flow.js +0 -2
- package/lib/Image/index.flow.js +0 -1
- package/lib/Indicator/Indicator.flow.js +0 -1
- package/lib/Indicator/index.flow.js +0 -1
- package/lib/Input/Input.flow.js +0 -1
- package/lib/Input/index.flow.js +0 -1
- package/lib/KeyboardKey/KeyboardKey.flow.js +0 -1
- package/lib/KeyboardKey/index.flow.js +0 -1
- package/lib/Label/Label.flow.js +0 -2
- package/lib/Label/index.flow.js +0 -1
- package/lib/Link/Link.flow.js +0 -1
- package/lib/Link/index.flow.js +0 -1
- package/lib/Listbox/Listbox.flow.js +0 -4
- package/lib/Listbox/index.flow.js +0 -1
- package/lib/Loader/Loader.flow.js +0 -1
- package/lib/Loader/index.flow.js +0 -1
- package/lib/LoaderButton/LoaderButton.flow.js +0 -1
- package/lib/LoaderButton/index.flow.js +0 -1
- package/lib/Menu/Menu.flow.js +0 -5
- package/lib/Menu/index.flow.js +0 -2
- package/lib/Menu/utils/constants.flow.js +0 -12
- package/lib/Message/Message.flow.js +0 -11
- package/lib/Message/index.flow.js +0 -1
- package/lib/Modal/Modal.flow.js +0 -2
- package/lib/Modal/index.flow.js +0 -1
- package/lib/Numeral/Numeral.flow.js +0 -1
- package/lib/Numeral/index.flow.js +0 -1
- package/lib/PartnerLogo/PartnerLogo.flow.js +0 -5
- package/lib/PartnerLogo/index.flow.js +0 -1
- package/lib/Popout/Popout.flow.js +0 -3
- package/lib/Popout/index.flow.js +0 -1
- package/lib/Portal/Portal.flow.js +0 -1
- package/lib/Portal/index.flow.js +0 -1
- package/lib/Radio/Radio.flow.js +0 -1
- package/lib/Radio/index.flow.js +0 -1
- package/lib/SegmentedControl/SegmentedControl.flow.js +0 -1
- package/lib/SegmentedControl/index.flow.js +0 -1
- package/lib/Select/Select.flow.js +0 -1
- package/lib/Select/index.flow.js +0 -1
- package/lib/Skeleton/Skeleton.flow.js +0 -1
- package/lib/Skeleton/index.flow.js +0 -1
- package/lib/SpotIllustration/SpotIllustration.flow.js +0 -1
- package/lib/SpotIllustration/index.flow.js +0 -1
- package/lib/Stack/Stack.flow.js +0 -1
- package/lib/Stack/index.flow.js +0 -1
- package/lib/Switch/Switch.flow.js +0 -1
- package/lib/Switch/SwitchTypes.flow.js +0 -0
- package/lib/Switch/index.flow.js +0 -2
- package/lib/Table/Table.flow.js +0 -3
- package/lib/Table/index.flow.js +0 -1
- package/lib/TableCell/TableCell.flow.js +0 -5
- package/lib/TableCell/index.flow.js +0 -1
- package/lib/TableHeaderCell/TableHeaderCell.flow.js +0 -5
- package/lib/TableHeaderCell/index.flow.js +0 -1
- package/lib/TableRowAccordion/TableRowAccordion.flow.js +0 -1
- package/lib/TableRowAccordion/index.flow.js +0 -1
- package/lib/Tabs/Tabs.flow.js +0 -1
- package/lib/Tabs/index.flow.js +0 -1
- package/lib/Text/Text.flow.js +0 -1
- package/lib/Text/index.flow.js +0 -1
- package/lib/Textarea/Textarea.flow.js +0 -1
- package/lib/Textarea/index.flow.js +0 -1
- package/lib/ThemeProvider/index.flow.js +0 -3
- package/lib/Toast/Toast.flow.js +0 -1
- package/lib/Toast/index.flow.js +0 -1
- package/lib/ToggleHint/ToggleHint.flow.js +0 -1
- package/lib/ToggleHint/index.flow.js +0 -1
- package/lib/Token/Token.flow.js +0 -1
- package/lib/Token/index.flow.js +0 -1
- package/lib/TokenInput/TokenInput.flow.js +0 -1
- package/lib/TokenInput/index.flow.js +0 -1
- package/lib/Tooltip/Tooltip.flow.js +0 -1
- package/lib/Tooltip/index.flow.js +0 -1
- package/lib/VisuallyHidden/VisuallyHidden.flow.js +0 -1
- package/lib/VisuallyHidden/index.flow.js +0 -1
- package/lib/index.flow.js +0 -79
- package/lib/index.js.flow +0 -2
- package/lib/systemProps/background.flow.js +0 -5
- package/lib/systemProps/border.flow.js +0 -5
- package/lib/systemProps/color.flow.js +0 -5
- package/lib/systemProps/custom.flow.js +0 -8
- package/lib/systemProps/flexbox.flow.js +0 -5
- package/lib/systemProps/grid.flow.js +0 -5
- package/lib/systemProps/index.flow.js +0 -14
- package/lib/systemProps/layout.flow.js +0 -5
- package/lib/systemProps/position.flow.js +0 -5
- package/lib/systemProps/shadow.flow.js +0 -5
- package/lib/systemProps/space.flow.js +0 -32
- package/lib/systemProps/systemProps.flow.js +0 -14
- package/lib/systemProps/tests/types.flow.js +0 -46
- package/lib/systemProps/types.flow.js +0 -0
- package/lib/systemProps/typography.flow.js +0 -5
- package/lib/systemProps/variant.flow.js +0 -8
- package/lib/themes/dark/dataviz-palette.flow.js +0 -0
- package/lib/themes/dark/decorative-palettes.flow.js +0 -0
- package/lib/themes/dark/theme.flow.js +0 -0
- package/lib/themes/extendedThemes/sproutTheme/dark/theme.flow.js +0 -1
- package/lib/themes/extendedThemes/sproutTheme/index.flow.js +0 -2
- package/lib/themes/extendedThemes/sproutTheme/light/theme.flow.js +0 -0
- package/lib/themes/light/dataviz-palette.flow.js +0 -0
- package/lib/themes/light/decorative-palettes.flow.js +0 -0
- package/lib/themes/light/literal-colors.flow.js +0 -0
- package/lib/themes/light/theme.flow.js +0 -0
- package/lib/types/index.flow.js +0 -5
- package/lib/types/shared.flow.js +0 -1
- package/lib/types/styled-components.flow.js +0 -1
- package/lib/types/system-props.flow.js +0 -1
- package/lib/types/theme.colors.flow.js +0 -0
- package/lib/types/theme.flow.js +0 -0
- package/lib/utils/a11yTest.flow.js +0 -0
- package/lib/utils/chartColors.flow.js +0 -0
- package/lib/utils/constants.flow.js +0 -0
- package/lib/utils/dataQaLabelQueries.flow.js +0 -0
- package/lib/utils/hooks.flow.js +0 -27
- package/lib/utils/index.flow.js +0 -0
- package/lib/utils/innerText.flow.js +0 -1
- package/lib/utils/mixins.flow.js +0 -0
- package/lib/utils/react-testing-library.flow.js +0 -3
- package/lib/utils/responsiveProps/index.flow.js +0 -0
- package/lib/utils/responsiveProps/index.test.flow.js +0 -21
- package/lib/utils/system-props.flow.js +0 -0
- package/lib/utils/useInteractiveColor.flow.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 25.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 8f63add: Discontinuation of Flow Type System
|
|
8
|
+
|
|
9
|
+
We have officially discontinued the use of the Flow type system in `@sproutsocial/racine`. All Flow types have been removed from the codebase as part of this major release.
|
|
10
|
+
|
|
11
|
+
To continue using `@sproutsocial/racine`, please ensure your projects have migrated away from Flow and are now using TypeScript.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- bd717d0: # Allows overrides to Avatar border prop
|
|
16
|
+
- Before this change, Avatar component accepted a `border` prop as one of its system props, however it did not have any effect due to a default border style in the component.
|
|
17
|
+
- With this change, Avatar now allows `border` prop overrides.
|
|
18
|
+
- The `border` prop accepts system values `500`, `600`, and `700` for `1px solid`, `2px solid`, and `3px solid`, respectively. Valid strings such as `'1px dashed'` or `'4px solid'` are also accepted.
|
|
19
|
+
- 63beb74: Update displayUnits prop on Duration component to account for partial durations with missing display units
|
|
20
|
+
- Updated dependencies [8f63add]
|
|
21
|
+
- Updated dependencies [15009dd]
|
|
22
|
+
- @sproutsocial/seeds-react-system-props@3.0.0
|
|
23
|
+
- @sproutsocial/seeds-react-utilities@4.0.0
|
|
24
|
+
- @sproutsocial/seeds-react-mixins@3.0.0
|
|
25
|
+
- @sproutsocial/seeds-react-hooks@3.0.0
|
|
26
|
+
- @sproutsocial/seeds-react-theme@2.0.0
|
|
27
|
+
- @sproutsocial/seeds-border@1.6.1
|
|
28
|
+
|
|
29
|
+
## 24.2.0
|
|
30
|
+
|
|
31
|
+
### Minor Changes
|
|
32
|
+
|
|
33
|
+
- 538d167: - Added `displayUnits` prop to the Duration component to give users manual control over which time units are displayed
|
|
34
|
+
- `display` prop on the Duration component now defaults to "narrow" instead of "long"
|
|
35
|
+
- Exporting a new helper function for Duration named `getDurationMaxDisplayUnits` that gets the largest number of display units based on the milliseconds value
|
|
36
|
+
|
|
3
37
|
## 24.1.0
|
|
4
38
|
|
|
5
39
|
### Minor Changes
|
|
@@ -4,13 +4,7 @@ const transform = require("../icon-library");
|
|
|
4
4
|
|
|
5
5
|
describe("icon-library codemod", () => {
|
|
6
6
|
function createTest(testName, input, output, options = {}) {
|
|
7
|
-
return defineInlineTest(
|
|
8
|
-
transform,
|
|
9
|
-
{ parser: "flow", ...options },
|
|
10
|
-
input,
|
|
11
|
-
output,
|
|
12
|
-
testName
|
|
13
|
-
);
|
|
7
|
+
return defineInlineTest(transform, { ...options }, input, output, testName);
|
|
14
8
|
}
|
|
15
9
|
|
|
16
10
|
createTest(
|
|
@@ -173,11 +167,11 @@ const iconType = typeof Icon;
|
|
|
173
167
|
|
|
174
168
|
createTest(
|
|
175
169
|
"Retain first comments when Icon import is removed",
|
|
176
|
-
|
|
170
|
+
`
|
|
177
171
|
import { Icon } from '@sproutsocial/racine';
|
|
178
172
|
|
|
179
173
|
<Icon name={iconName} />`,
|
|
180
|
-
|
|
174
|
+
`
|
|
181
175
|
import { IconShim } from 'script/core/react/IconShim';
|
|
182
176
|
|
|
183
177
|
<IconShim name={iconName} />
|
|
@@ -190,7 +184,7 @@ import { IconShim } from 'script/core/react/IconShim';
|
|
|
190
184
|
|
|
191
185
|
createTest(
|
|
192
186
|
"Retain first comments and add new comments",
|
|
193
|
-
`//
|
|
187
|
+
`//
|
|
194
188
|
import { Badge, Icon } from '@sproutsocial/racine';
|
|
195
189
|
|
|
196
190
|
<>
|
|
@@ -198,7 +192,7 @@ import { Badge, Icon } from '@sproutsocial/racine';
|
|
|
198
192
|
<Icon name='not-a-real-name' />
|
|
199
193
|
<Badge iconName={iconName} />
|
|
200
194
|
</>`,
|
|
201
|
-
`//
|
|
195
|
+
`//
|
|
202
196
|
/*TODO (icon-library codemod): Please manually migrate icon names passed to 2 component(s) in this file.
|
|
203
197
|
Look for usages of these components: Icon, Badge*/
|
|
204
198
|
import { Badge, Icon } from '@sproutsocial/racine';
|
|
@@ -11,6 +11,7 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
11
11
|
var _Box = _interopRequireDefault(require("../Box"));
|
|
12
12
|
var _Image = _interopRequireDefault(require("../Image"));
|
|
13
13
|
var _Text = _interopRequireDefault(require("../Text"));
|
|
14
|
+
var _seedsReactSystemProps = require("@sproutsocial/seeds-react-system-props");
|
|
14
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
16
|
var _excluded = ["fontSize"],
|
|
16
17
|
_excluded2 = ["appearance", "name", "src", "type", "size", "bg", "color", "initials"];
|
|
@@ -51,14 +52,14 @@ var AvatarText = (0, _styledComponents.default)(function (_ref) {
|
|
|
51
52
|
var Container = (0, _styledComponents.default)(_Box.default).withConfig({
|
|
52
53
|
displayName: "Avatar__Container",
|
|
53
54
|
componentId: "sc-1ffu253-1"
|
|
54
|
-
})(["", ""], function (_ref3) {
|
|
55
|
+
})(["", " ", ""], function (_ref3) {
|
|
55
56
|
var theme = _ref3.theme,
|
|
56
57
|
$type = _ref3.$type,
|
|
57
58
|
bg = _ref3.bg,
|
|
58
59
|
borderColor = _ref3.borderColor,
|
|
59
60
|
$displayFallback = _ref3.$displayFallback;
|
|
60
61
|
return (0, _styledComponents.css)(["background:", ";border:", ";border-color:", ";color:", ";"], $displayFallback ? bg ? bg : theme.colors.container.background.decorative[$type] : "none", $displayFallback ? "1px solid" : "none", borderColor ? borderColor : theme.colors.container.border.decorative[$type], theme.colors.text.decorative[$type]);
|
|
61
|
-
});
|
|
62
|
+
}, _seedsReactSystemProps.BORDER);
|
|
62
63
|
var getInitials = function getInitials(name) {
|
|
63
64
|
var fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "?";
|
|
64
65
|
if (!name || typeof name !== "string") return fallback;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -11,25 +10,18 @@ var _constants = require("../utils/constants");
|
|
|
11
10
|
var _VisuallyHidden = require("../VisuallyHidden");
|
|
12
11
|
var _constants2 = require("./constants");
|
|
13
12
|
var _styles = require("./styles");
|
|
13
|
+
var _utils = require("./utils");
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
18
19
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19
20
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20
21
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
22
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
22
23
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
23
|
-
|
|
24
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
25
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
26
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
27
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
28
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
29
|
-
var getDivisionAndRemainder = function getDivisionAndRemainder(numerator, denominator) {
|
|
30
|
-
return [Math.floor(numerator / denominator), numerator % denominator];
|
|
31
|
-
};
|
|
32
|
-
var _createDurationFormatter = function _createDurationFormatter(locale, unitDisplay) {
|
|
24
|
+
var _createDurationFormatter = function _createDurationFormatter(locale, unitDisplay, displayUnits) {
|
|
33
25
|
var timeUnitFormatter = function timeUnitFormatter(locale, unit, unitDisplay) {
|
|
34
26
|
return Intl.NumberFormat(locale, {
|
|
35
27
|
style: "unit",
|
|
@@ -37,41 +29,31 @@ var _createDurationFormatter = function _createDurationFormatter(locale, unitDis
|
|
|
37
29
|
unitDisplay: unitDisplay
|
|
38
30
|
}).format;
|
|
39
31
|
};
|
|
40
|
-
var
|
|
41
|
-
var formatHours = timeUnitFormatter(locale, "hour", unitDisplay);
|
|
42
|
-
var formatMinutes = timeUnitFormatter(locale, "minute", unitDisplay);
|
|
43
|
-
var formatSeconds = timeUnitFormatter(locale, "second", unitDisplay);
|
|
44
|
-
var formatMilliseconds = timeUnitFormatter(locale, "millisecond", unitDisplay);
|
|
32
|
+
var formatterByUnit = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, _constants2.UNITS.days, timeUnitFormatter(locale, "day", unitDisplay)), _constants2.UNITS.hours, timeUnitFormatter(locale, "hour", unitDisplay)), _constants2.UNITS.minutes, timeUnitFormatter(locale, "minute", unitDisplay)), _constants2.UNITS.seconds, timeUnitFormatter(locale, "second", unitDisplay)), _constants2.UNITS.milliseconds, timeUnitFormatter(locale, "millisecond", unitDisplay));
|
|
45
33
|
var formatList = new Intl.ListFormat(locale, {
|
|
46
34
|
style: "narrow",
|
|
47
35
|
type: "unit"
|
|
48
36
|
});
|
|
49
|
-
return function (
|
|
50
|
-
|
|
51
|
-
|
|
37
|
+
return function (value) {
|
|
38
|
+
var lowestUnit = (0, _utils.getLowestUnit)(displayUnits);
|
|
39
|
+
|
|
40
|
+
// if the value is zero or negative, we just want to return 0 for the lowest unit (ex "0 minutes")
|
|
41
|
+
if (value <= 0) {
|
|
42
|
+
return formatterByUnit[lowestUnit](0);
|
|
52
43
|
}
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
var _getDivisionAndRemain6 = _slicedToArray(_getDivisionAndRemain5, 2);
|
|
67
|
-
minutes = _getDivisionAndRemain6[0];
|
|
68
|
-
milliseconds = _getDivisionAndRemain6[1];
|
|
69
|
-
var _getDivisionAndRemain7 = getDivisionAndRemainder(milliseconds, 1000);
|
|
70
|
-
var _getDivisionAndRemain8 = _slicedToArray(_getDivisionAndRemain7, 2);
|
|
71
|
-
seconds = _getDivisionAndRemain8[0];
|
|
72
|
-
milliseconds = _getDivisionAndRemain8[1];
|
|
73
|
-
var list = [days ? formatDays(days) : null, hours ? formatHours(hours) : null, minutes ? formatMinutes(minutes) : null, seconds ? formatSeconds(seconds) : null, milliseconds ? formatMilliseconds(milliseconds) : null].filter(function (listItem) {
|
|
74
|
-
return listItem !== null;
|
|
44
|
+
var millisecondsByUnit = (0, _utils.splitMillisecondsIntoUnits)(value, displayUnits);
|
|
45
|
+
var list = [];
|
|
46
|
+
_constants2.ORDERED_UNITS.forEach(function (unit) {
|
|
47
|
+
if (unit in millisecondsByUnit) {
|
|
48
|
+
var unitValue = millisecondsByUnit[unit];
|
|
49
|
+
|
|
50
|
+
// we want to add to the list if one of two conditions are met:
|
|
51
|
+
// 1) the unit has a value greater than 0 OR
|
|
52
|
+
// 2) the unit has value 0 AND the unit is the lowest unit AND the list is already empty
|
|
53
|
+
if (unitValue !== 0 || unitValue === 0 && unit === lowestUnit && list.length === 0) {
|
|
54
|
+
list.push(formatterByUnit[unit](millisecondsByUnit[unit]));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
75
57
|
});
|
|
76
58
|
return formatList.format(list);
|
|
77
59
|
};
|
|
@@ -80,22 +62,21 @@ var _createDurationFormatter = function _createDurationFormatter(locale, unitDis
|
|
|
80
62
|
// Memoize to reduce the energy of creating new instances of Intl.NumberFormat
|
|
81
63
|
var memoizer = (0, _lruMemoize.default)(_constants2.MEMO_CACHE_SIZE, _constants2.COMPARE_OBJECTS);
|
|
82
64
|
var createDurationFormatter = memoizer(_createDurationFormatter);
|
|
83
|
-
var isValidNumber = function isValidNumber(value) {
|
|
84
|
-
return typeof value === "number" && isFinite(value);
|
|
85
|
-
};
|
|
86
65
|
var getDuration = function getDuration(_ref) {
|
|
87
66
|
var returnType = _ref.returnType,
|
|
88
67
|
props = _ref.props;
|
|
89
68
|
var _props$display = props.display,
|
|
90
|
-
display = _props$display === void 0 ?
|
|
69
|
+
display = _props$display === void 0 ? _constants2.DEFAULT_DISPLAY : _props$display,
|
|
70
|
+
_props$displayUnits = props.displayUnits,
|
|
71
|
+
displayUnits = _props$displayUnits === void 0 ? _constants2.DEFAULT_DISPLAY_UNITS : _props$displayUnits,
|
|
91
72
|
invalidMillisecondsLabel = props.invalidMillisecondsLabel,
|
|
92
73
|
_props$locale = props.locale,
|
|
93
|
-
locale = _props$locale === void 0 ?
|
|
74
|
+
locale = _props$locale === void 0 ? _constants2.DEFAULT_LOCALE : _props$locale,
|
|
94
75
|
_props$milliseconds = props.milliseconds,
|
|
95
|
-
milliseconds = _props$milliseconds === void 0 ?
|
|
76
|
+
milliseconds = _props$milliseconds === void 0 ? _constants2.DEFAULT_MILLISECONDS : _props$milliseconds,
|
|
96
77
|
qa = props.qa;
|
|
97
78
|
var isReturnTypeString = returnType === "string";
|
|
98
|
-
if (!isValidNumber(milliseconds)) {
|
|
79
|
+
if (!(0, _utils.isValidNumber)(milliseconds)) {
|
|
99
80
|
return isReturnTypeString ? _constants.EM_DASH : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
100
81
|
children: [invalidMillisecondsLabel ?
|
|
101
82
|
/*#__PURE__*/
|
|
@@ -109,7 +90,8 @@ var getDuration = function getDuration(_ref) {
|
|
|
109
90
|
}))]
|
|
110
91
|
});
|
|
111
92
|
}
|
|
112
|
-
var
|
|
93
|
+
var validatedDisplayUnits = Object.keys(displayUnits).length === 0 ? _constants2.DEFAULT_DISPLAY_UNITS : displayUnits;
|
|
94
|
+
var fullText = createDurationFormatter(locale, display, validatedDisplayUnits)(milliseconds);
|
|
113
95
|
return isReturnTypeString ? fullText : /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, _objectSpread(_objectSpread({}, qa), {}, {
|
|
114
96
|
children: fullText
|
|
115
97
|
}));
|
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.MEMO_CACHE_SIZE = exports.COMPARE_OBJECTS = void 0;
|
|
6
|
+
exports.UNITS = exports.ORDERED_UNITS = exports.MILLISECONDS_IN = exports.MEMO_CACHE_SIZE = exports.DEFAULT_MILLISECONDS = exports.DEFAULT_LOCALE = exports.DEFAULT_DISPLAY_UNITS = exports.DEFAULT_DISPLAY = exports.COMPARE_OBJECTS = void 0;
|
|
7
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
8
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
10
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
11
|
+
var COMPARE_OBJECTS = exports.COMPARE_OBJECTS = true;
|
|
7
12
|
var MEMO_CACHE_SIZE = exports.MEMO_CACHE_SIZE = 10;
|
|
8
|
-
var
|
|
13
|
+
var UNITS = exports.UNITS = {
|
|
14
|
+
days: "days",
|
|
15
|
+
hours: "hours",
|
|
16
|
+
minutes: "minutes",
|
|
17
|
+
seconds: "seconds",
|
|
18
|
+
milliseconds: "milliseconds"
|
|
19
|
+
};
|
|
20
|
+
var MILLISECONDS_IN = exports.MILLISECONDS_IN = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, UNITS.days, 1 * 1000 * 60 * 60 * 24), UNITS.hours, 1 * 1000 * 60 * 60), UNITS.minutes, 1 * 1000 * 60), UNITS.seconds, 1 * 1000), UNITS.milliseconds, 1);
|
|
21
|
+
var ORDERED_UNITS = exports.ORDERED_UNITS = [UNITS.days, UNITS.hours, UNITS.minutes, UNITS.seconds, UNITS.milliseconds];
|
|
22
|
+
|
|
23
|
+
// Duration props defaults
|
|
24
|
+
var DEFAULT_DISPLAY = exports.DEFAULT_DISPLAY = "narrow";
|
|
25
|
+
var DEFAULT_DISPLAY_UNITS = exports.DEFAULT_DISPLAY_UNITS = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, UNITS.days, true), UNITS.hours, true), UNITS.minutes, true), UNITS.seconds, true), UNITS.milliseconds, false);
|
|
26
|
+
var DEFAULT_LOCALE = exports.DEFAULT_LOCALE = "en-US";
|
|
27
|
+
var DEFAULT_MILLISECONDS = exports.DEFAULT_MILLISECONDS = null;
|
|
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
var _exportNames = {
|
|
8
8
|
Duration: true,
|
|
9
|
-
formatDuration: true
|
|
9
|
+
formatDuration: true,
|
|
10
|
+
getDurationMaxDisplayUnits: true
|
|
10
11
|
};
|
|
11
12
|
Object.defineProperty(exports, "Duration", {
|
|
12
13
|
enumerable: true,
|
|
@@ -21,7 +22,14 @@ Object.defineProperty(exports, "formatDuration", {
|
|
|
21
22
|
return _Duration.formatDuration;
|
|
22
23
|
}
|
|
23
24
|
});
|
|
25
|
+
Object.defineProperty(exports, "getDurationMaxDisplayUnits", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function get() {
|
|
28
|
+
return _utils.getDurationMaxDisplayUnits;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
24
31
|
var _Duration = _interopRequireWildcard(require("./Duration"));
|
|
32
|
+
var _utils = require("./utils");
|
|
25
33
|
var _DurationTypes = require("./DurationTypes");
|
|
26
34
|
Object.keys(_DurationTypes).forEach(function (key) {
|
|
27
35
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.splitMillisecondsIntoUnits = exports.isValidNumber = exports.getLowestUnit = exports.getDurationMaxDisplayUnits = void 0;
|
|
7
|
+
var _constants = require("./constants");
|
|
8
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
9
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
10
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
11
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
12
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
13
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
14
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
15
|
+
var getLowestUnit = exports.getLowestUnit = function getLowestUnit(displayUnits) {
|
|
16
|
+
return _toConsumableArray(_constants.ORDERED_UNITS).reverse().find(function (unit) {
|
|
17
|
+
return displayUnits[unit];
|
|
18
|
+
}) || _constants.UNITS.milliseconds;
|
|
19
|
+
};
|
|
20
|
+
var splitMillisecondsIntoUnits = exports.splitMillisecondsIntoUnits = function splitMillisecondsIntoUnits(milliseconds, displayUnits) {
|
|
21
|
+
var lowestUnit = getLowestUnit(displayUnits);
|
|
22
|
+
var remainder = milliseconds % _constants.MILLISECONDS_IN[lowestUnit];
|
|
23
|
+
if (2 * remainder >= _constants.MILLISECONDS_IN[lowestUnit]) {
|
|
24
|
+
// if the remainder is large, add enough seconds to increse the lowest unit
|
|
25
|
+
milliseconds += _constants.MILLISECONDS_IN[lowestUnit] - remainder;
|
|
26
|
+
}
|
|
27
|
+
var units = {};
|
|
28
|
+
_constants.ORDERED_UNITS.forEach(function (unit) {
|
|
29
|
+
if (displayUnits[unit]) {
|
|
30
|
+
units[unit] = Math.floor(milliseconds / _constants.MILLISECONDS_IN[unit]);
|
|
31
|
+
milliseconds -= units[unit] * _constants.MILLISECONDS_IN[unit];
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return units;
|
|
35
|
+
};
|
|
36
|
+
var isValidNumber = exports.isValidNumber = function isValidNumber(value) {
|
|
37
|
+
return typeof value === "number" && isFinite(value);
|
|
38
|
+
};
|
|
39
|
+
var getDurationMaxDisplayUnits = exports.getDurationMaxDisplayUnits = function getDurationMaxDisplayUnits(_ref) {
|
|
40
|
+
var milliseconds = _ref.milliseconds,
|
|
41
|
+
_ref$maxDisplayUnits = _ref.maxDisplayUnits,
|
|
42
|
+
maxDisplayUnits = _ref$maxDisplayUnits === void 0 ? _constants.ORDERED_UNITS.length : _ref$maxDisplayUnits;
|
|
43
|
+
var displayUnits = {};
|
|
44
|
+
if (!isValidNumber(milliseconds)) {
|
|
45
|
+
return displayUnits;
|
|
46
|
+
}
|
|
47
|
+
var _iterator = _createForOfIteratorHelper(_constants.ORDERED_UNITS),
|
|
48
|
+
_step;
|
|
49
|
+
try {
|
|
50
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
51
|
+
var unit = _step.value;
|
|
52
|
+
if (Object.keys(displayUnits).length >= maxDisplayUnits) {
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// @ts-expect-error - stupid typescript isn't smart enough to check the isValidNumber check above ¯\_(ツ)_/¯
|
|
57
|
+
var millisecondsByUnit = splitMillisecondsIntoUnits(milliseconds, {
|
|
58
|
+
days: true,
|
|
59
|
+
hours: true,
|
|
60
|
+
minutes: true,
|
|
61
|
+
seconds: true,
|
|
62
|
+
milliseconds: true
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// @ts-expect-error - stupid typescript isn't smart enough to check the isValidNumber check above ¯\_(ツ)_/¯
|
|
66
|
+
if (milliseconds > _constants.MILLISECONDS_IN[unit] && millisecondsByUnit[unit] > 0) {
|
|
67
|
+
displayUnits[unit] = true;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
} catch (err) {
|
|
71
|
+
_iterator.e(err);
|
|
72
|
+
} finally {
|
|
73
|
+
_iterator.f();
|
|
74
|
+
}
|
|
75
|
+
return displayUnits;
|
|
76
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/Avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EACV,eAAe,EAEf,cAAc,EACf,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/Avatar/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EACV,eAAe,EAEf,cAAc,EACf,MAAM,eAAe,CAAC;AAwCvB,eAAO,MAAM,cAAc,SACnB,MAAM,QACN,cAAc,KACnB,cAuBF,CAAC;AAEF,eAAO,MAAM,MAAM,wEAUhB,eAAe,4CAqDjB,CAAC;wHArDC,eAAe;AAsDlB,wBAA4B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Duration.d.ts","sourceRoot":"","sources":["../../../src/Duration/Duration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Duration.d.ts","sourceRoot":"","sources":["../../../src/Duration/Duration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B,OAAO,KAAK,EACV,iBAAiB,EAIlB,MAAM,iBAAiB,CAAC;AAqHzB,eAAO,MAAM,cAAc,UAAW,iBAAiB,KAAG,MAEzD,CAAC;AAEF,QAAA,MAAM,QAAQ,UAAW,iBAAiB,oBAEzC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
import { TypeTextProps } from "@sproutsocial/seeds-react-text";
|
|
2
2
|
import { TypeQaProps } from "../types/shared";
|
|
3
|
+
export type TypeDurationMilliseconds = number | null;
|
|
4
|
+
export type TypeDurationLocale = Intl.LocalesArgument;
|
|
5
|
+
export type TypeDurationDisplay = "long" | "narrow";
|
|
6
|
+
export interface TypeDurationDisplayUnits {
|
|
7
|
+
days?: boolean;
|
|
8
|
+
hours?: boolean;
|
|
9
|
+
minutes?: boolean;
|
|
10
|
+
seconds?: boolean;
|
|
11
|
+
milliseconds?: boolean;
|
|
12
|
+
}
|
|
3
13
|
export interface TypeDurationProps extends Omit<TypeTextProps, "children"> {
|
|
4
|
-
/** The
|
|
5
|
-
milliseconds:
|
|
14
|
+
/** The milliseconds to be formatted */
|
|
15
|
+
milliseconds: TypeDurationMilliseconds;
|
|
6
16
|
/** Locale to format. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument */
|
|
7
|
-
locale?:
|
|
17
|
+
locale?: TypeDurationLocale;
|
|
8
18
|
/** The style of the formatted duration */
|
|
9
|
-
display?:
|
|
19
|
+
display?: TypeDurationDisplay;
|
|
20
|
+
/** The units of the duration to render */
|
|
21
|
+
displayUnits?: TypeDurationDisplayUnits;
|
|
10
22
|
/** Text to be read off by screen readers for invalid values (i.e., any value rendered as '—' (em dash)) */
|
|
11
23
|
invalidMillisecondsLabel?: string;
|
|
12
24
|
qa?: TypeQaProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DurationTypes.d.ts","sourceRoot":"","sources":["../../../src/Duration/DurationTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC;IACxE,
|
|
1
|
+
{"version":3,"file":"DurationTypes.d.ts","sourceRoot":"","sources":["../../../src/Duration/DurationTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG,IAAI,CAAC;AAErD,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,eAAe,CAAC;AAEtD,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEpD,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC;IACxE,uCAAuC;IACvC,YAAY,EAAE,wBAAwB,CAAC;IAEvC,mIAAmI;IACnI,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAE5B,0CAA0C;IAC1C,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAE9B,0CAA0C;IAC1C,YAAY,CAAC,EAAE,wBAAwB,CAAC;IAExC,2GAA2G;IAC3G,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAElC,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB"}
|
|
@@ -1,3 +1,20 @@
|
|
|
1
|
-
export declare const MEMO_CACHE_SIZE = 10;
|
|
2
1
|
export declare const COMPARE_OBJECTS = true;
|
|
2
|
+
export declare const MEMO_CACHE_SIZE = 10;
|
|
3
|
+
export declare const UNITS: {
|
|
4
|
+
days: string;
|
|
5
|
+
hours: string;
|
|
6
|
+
minutes: string;
|
|
7
|
+
seconds: string;
|
|
8
|
+
milliseconds: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const MILLISECONDS_IN: {
|
|
11
|
+
[x: string]: number;
|
|
12
|
+
};
|
|
13
|
+
export declare const ORDERED_UNITS: string[];
|
|
14
|
+
export declare const DEFAULT_DISPLAY = "narrow";
|
|
15
|
+
export declare const DEFAULT_DISPLAY_UNITS: {
|
|
16
|
+
[x: string]: boolean;
|
|
17
|
+
};
|
|
18
|
+
export declare const DEFAULT_LOCALE = "en-US";
|
|
19
|
+
export declare const DEFAULT_MILLISECONDS: null;
|
|
3
20
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/Duration/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/Duration/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,OAAO,CAAC;AACpC,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,KAAK;;;;;;CAMjB,CAAC;AACF,eAAO,MAAM,eAAe;;CAM3B,CAAC;AACF,eAAO,MAAM,aAAa,UAMzB,CAAC;AAGF,eAAO,MAAM,eAAe,WAAW,CAAC;AACxC,eAAO,MAAM,qBAAqB;;CAMjC,CAAC;AACF,eAAO,MAAM,cAAc,UAAU,CAAC;AACtC,eAAO,MAAM,oBAAoB,MAAO,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import Duration, { formatDuration } from "./Duration";
|
|
2
|
+
import { getDurationMaxDisplayUnits, type TypeGetDurationMaxDisplayUnitsProps } from "./utils";
|
|
2
3
|
export default Duration;
|
|
3
4
|
export { Duration };
|
|
4
5
|
export { formatDuration };
|
|
6
|
+
export { getDurationMaxDisplayUnits };
|
|
7
|
+
export type { TypeGetDurationMaxDisplayUnitsProps };
|
|
5
8
|
export * from "./DurationTypes";
|
|
6
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Duration/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,EAAE,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Duration/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,EAAE,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EACL,0BAA0B,EAC1B,KAAK,mCAAmC,EACzC,MAAM,SAAS,CAAC;AAEjB,eAAe,QAAQ,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,OAAO,EAAE,0BAA0B,EAAE,CAAC;AACtC,YAAY,EAAE,mCAAmC,EAAE,CAAC;AACpD,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TypeDurationDisplayUnits, TypeDurationMilliseconds } from "./DurationTypes";
|
|
2
|
+
export declare const getLowestUnit: (displayUnits: TypeDurationDisplayUnits) => string;
|
|
3
|
+
export declare const splitMillisecondsIntoUnits: (milliseconds: number, displayUnits: TypeDurationDisplayUnits) => {
|
|
4
|
+
days?: number;
|
|
5
|
+
hours?: number;
|
|
6
|
+
minutes?: number;
|
|
7
|
+
seconds?: number;
|
|
8
|
+
milliseconds?: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const isValidNumber: (value: unknown) => boolean;
|
|
11
|
+
export interface TypeGetDurationMaxDisplayUnitsProps {
|
|
12
|
+
milliseconds: TypeDurationMilliseconds;
|
|
13
|
+
maxDisplayUnits: number;
|
|
14
|
+
}
|
|
15
|
+
export declare const getDurationMaxDisplayUnits: ({ milliseconds, maxDisplayUnits, }: TypeGetDurationMaxDisplayUnitsProps) => TypeDurationDisplayUnits;
|
|
16
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/Duration/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,iBAAiB,CAAC;AAGzB,eAAO,MAAM,aAAa,iBAAkB,wBAAwB,WAEhD,CAAC;AAErB,eAAO,MAAM,0BAA0B,iBACvB,MAAM,gBACN,wBAAwB,KACrC;IACD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;CAoBvB,CAAC;AAEF,eAAO,MAAM,aAAa,UAAW,OAAO,KAAG,OACD,CAAC;AAE/C,MAAM,WAAW,mCAAmC;IAClD,YAAY,EAAE,wBAAwB,CAAC;IACvC,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,0BAA0B,uCAGpC,mCAAmC,KAAG,wBA4BxC,CAAC"}
|
package/lib/Avatar/Avatar.js
CHANGED
|
@@ -20,6 +20,7 @@ import styled, { css } from "styled-components";
|
|
|
20
20
|
import Box from "../Box";
|
|
21
21
|
import Image from "../Image";
|
|
22
22
|
import Text from "../Text";
|
|
23
|
+
import { BORDER } from "@sproutsocial/seeds-react-system-props";
|
|
23
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
25
|
var defaultType = "neutral";
|
|
25
26
|
|
|
@@ -42,14 +43,14 @@ var AvatarText = styled(function (_ref) {
|
|
|
42
43
|
var Container = styled(Box).withConfig({
|
|
43
44
|
displayName: "Avatar__Container",
|
|
44
45
|
componentId: "sc-1ffu253-1"
|
|
45
|
-
})(["", ""], function (_ref3) {
|
|
46
|
+
})(["", " ", ""], function (_ref3) {
|
|
46
47
|
var theme = _ref3.theme,
|
|
47
48
|
$type = _ref3.$type,
|
|
48
49
|
bg = _ref3.bg,
|
|
49
50
|
borderColor = _ref3.borderColor,
|
|
50
51
|
$displayFallback = _ref3.$displayFallback;
|
|
51
52
|
return css(["background:", ";border:", ";border-color:", ";color:", ";"], $displayFallback ? bg ? bg : theme.colors.container.background.decorative[$type] : "none", $displayFallback ? "1px solid" : "none", borderColor ? borderColor : theme.colors.container.border.decorative[$type], theme.colors.text.decorative[$type]);
|
|
52
|
-
});
|
|
53
|
+
}, BORDER);
|
|
53
54
|
var getInitials = function getInitials(name) {
|
|
54
55
|
var fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "?";
|
|
55
56
|
if (!name || typeof name !== "string") return fallback;
|