@sproutsocial/racine 24.2.0 → 25.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/codemods/__tests__/icon-library.test.js +5 -11
- package/commonjs/Avatar/Avatar.js +3 -2
- package/commonjs/Duration/Duration.js +3 -30
- package/commonjs/Duration/utils.js +36 -2
- package/commonjs/themes/light/theme.js +6 -2
- package/dist/types/Avatar/Avatar.d.ts.map +1 -1
- package/dist/types/Duration/Duration.d.ts.map +1 -1
- package/dist/types/Duration/utils.d.ts +8 -0
- package/dist/types/Duration/utils.d.ts.map +1 -1
- package/dist/types/themes/dark/theme.d.ts +4 -0
- package/dist/types/themes/dark/theme.d.ts.map +1 -1
- package/dist/types/themes/light/theme.d.ts +8 -0
- package/dist/types/themes/light/theme.d.ts.map +1 -1
- package/lib/Avatar/Avatar.js +3 -2
- package/lib/Duration/Duration.js +2 -29
- package/lib/Duration/utils.js +36 -2
- package/lib/themes/light/theme.js +6 -2
- package/package.json +19 -26
- 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,51 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 25.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 57648a5: All packages now depend on the latest seed component builds
|
|
8
|
+
- Updated dependencies [57648a5]
|
|
9
|
+
- @sproutsocial/seeds-react-theme-provider@1.1.1
|
|
10
|
+
- @sproutsocial/seeds-react-partner-logo@1.2.1
|
|
11
|
+
- @sproutsocial/seeds-react-system-props@3.0.1
|
|
12
|
+
- @sproutsocial/seeds-react-utilities@4.0.1
|
|
13
|
+
- @sproutsocial/seeds-border@1.6.2
|
|
14
|
+
- @sproutsocial/seeds-react-button@1.1.1
|
|
15
|
+
- @sproutsocial/seeds-react-mixins@3.0.1
|
|
16
|
+
- @sproutsocial/seeds-react-popout@1.2.1
|
|
17
|
+
- @sproutsocial/seeds-react-switch@1.1.1
|
|
18
|
+
- @sproutsocial/seeds-react-hooks@3.0.1
|
|
19
|
+
- @sproutsocial/seeds-react-theme@2.0.1
|
|
20
|
+
- @sproutsocial/seeds-react-icon@1.1.1
|
|
21
|
+
- @sproutsocial/seeds-react-box@1.1.1
|
|
22
|
+
|
|
23
|
+
## 25.0.0
|
|
24
|
+
|
|
25
|
+
### Major Changes
|
|
26
|
+
|
|
27
|
+
- 8f63add: Discontinuation of Flow Type System
|
|
28
|
+
|
|
29
|
+
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.
|
|
30
|
+
|
|
31
|
+
To continue using `@sproutsocial/racine`, please ensure your projects have migrated away from Flow and are now using TypeScript.
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- bd717d0: # Allows overrides to Avatar border prop
|
|
36
|
+
- 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.
|
|
37
|
+
- With this change, Avatar now allows `border` prop overrides.
|
|
38
|
+
- 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.
|
|
39
|
+
- 63beb74: Update displayUnits prop on Duration component to account for partial durations with missing display units
|
|
40
|
+
- Updated dependencies [8f63add]
|
|
41
|
+
- Updated dependencies [15009dd]
|
|
42
|
+
- @sproutsocial/seeds-react-system-props@3.0.0
|
|
43
|
+
- @sproutsocial/seeds-react-utilities@4.0.0
|
|
44
|
+
- @sproutsocial/seeds-react-mixins@3.0.0
|
|
45
|
+
- @sproutsocial/seeds-react-hooks@3.0.0
|
|
46
|
+
- @sproutsocial/seeds-react-theme@2.0.0
|
|
47
|
+
- @sproutsocial/seeds-border@1.6.1
|
|
48
|
+
|
|
3
49
|
## 24.2.0
|
|
4
50
|
|
|
5
51
|
### 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
|
});
|
|
@@ -16,38 +15,12 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
16
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
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); }
|
|
18
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); }
|
|
19
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; }
|
|
20
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; }
|
|
21
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; }
|
|
22
22
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
23
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); }
|
|
24
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
25
|
-
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."); }
|
|
26
|
-
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); }
|
|
27
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
28
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
29
|
-
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; }
|
|
30
|
-
var getLowestUnit = function getLowestUnit(displayUnits) {
|
|
31
|
-
return _toConsumableArray(_constants2.ORDERED_UNITS).reverse().find(function (unit) {
|
|
32
|
-
return displayUnits[unit];
|
|
33
|
-
}) || _constants2.UNITS.milliseconds;
|
|
34
|
-
};
|
|
35
|
-
var splitMillisecondsIntoUnits = function splitMillisecondsIntoUnits(milliseconds, displayUnits) {
|
|
36
|
-
var lowestUnit = getLowestUnit(displayUnits);
|
|
37
|
-
var remainder = milliseconds % _constants2.MILLISECONDS_IN[lowestUnit];
|
|
38
|
-
if (2 * remainder >= _constants2.MILLISECONDS_IN[lowestUnit]) {
|
|
39
|
-
// if the remainder is large, add enough seconds to increse the lowest unit
|
|
40
|
-
milliseconds += _constants2.MILLISECONDS_IN[lowestUnit] - remainder;
|
|
41
|
-
}
|
|
42
|
-
var units = {};
|
|
43
|
-
_constants2.ORDERED_UNITS.forEach(function (unit) {
|
|
44
|
-
if (displayUnits[unit]) {
|
|
45
|
-
units[unit] = Math.floor(milliseconds / _constants2.MILLISECONDS_IN[unit]);
|
|
46
|
-
milliseconds -= units[unit] * _constants2.MILLISECONDS_IN[unit];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
return units;
|
|
50
|
-
};
|
|
51
24
|
var _createDurationFormatter = function _createDurationFormatter(locale, unitDisplay, displayUnits) {
|
|
52
25
|
var timeUnitFormatter = function timeUnitFormatter(locale, unit, unitDisplay) {
|
|
53
26
|
return Intl.NumberFormat(locale, {
|
|
@@ -62,13 +35,13 @@ var _createDurationFormatter = function _createDurationFormatter(locale, unitDis
|
|
|
62
35
|
type: "unit"
|
|
63
36
|
});
|
|
64
37
|
return function (value) {
|
|
65
|
-
var lowestUnit = getLowestUnit(displayUnits);
|
|
38
|
+
var lowestUnit = (0, _utils.getLowestUnit)(displayUnits);
|
|
66
39
|
|
|
67
40
|
// if the value is zero or negative, we just want to return 0 for the lowest unit (ex "0 minutes")
|
|
68
41
|
if (value <= 0) {
|
|
69
42
|
return formatterByUnit[lowestUnit](0);
|
|
70
43
|
}
|
|
71
|
-
var millisecondsByUnit = splitMillisecondsIntoUnits(value, displayUnits);
|
|
44
|
+
var millisecondsByUnit = (0, _utils.splitMillisecondsIntoUnits)(value, displayUnits);
|
|
72
45
|
var list = [];
|
|
73
46
|
_constants2.ORDERED_UNITS.forEach(function (unit) {
|
|
74
47
|
if (unit in millisecondsByUnit) {
|
|
@@ -3,11 +3,36 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.isValidNumber = exports.getDurationMaxDisplayUnits = void 0;
|
|
6
|
+
exports.splitMillisecondsIntoUnits = exports.isValidNumber = exports.getLowestUnit = exports.getDurationMaxDisplayUnits = void 0;
|
|
7
7
|
var _constants = require("./constants");
|
|
8
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."); }
|
|
9
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); }
|
|
10
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
|
+
};
|
|
11
36
|
var isValidNumber = exports.isValidNumber = function isValidNumber(value) {
|
|
12
37
|
return typeof value === "number" && isFinite(value);
|
|
13
38
|
};
|
|
@@ -29,7 +54,16 @@ var getDurationMaxDisplayUnits = exports.getDurationMaxDisplayUnits = function g
|
|
|
29
54
|
}
|
|
30
55
|
|
|
31
56
|
// @ts-expect-error - stupid typescript isn't smart enough to check the isValidNumber check above ¯\_(ツ)_/¯
|
|
32
|
-
|
|
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) {
|
|
33
67
|
displayUnits[unit] = true;
|
|
34
68
|
}
|
|
35
69
|
}
|
|
@@ -369,10 +369,14 @@ var radii = exports.radii = {
|
|
|
369
369
|
pill: _seedsBorder.default.BORDER_RADIUS_1000
|
|
370
370
|
};
|
|
371
371
|
var borders = exports.borders = {
|
|
372
|
-
500: "".concat(_seedsBorder.default.BORDER_WIDTH_500, " solid")
|
|
372
|
+
500: "".concat(_seedsBorder.default.BORDER_WIDTH_500, " solid"),
|
|
373
|
+
600: "".concat(_seedsBorder.default.BORDER_WIDTH_600, " solid"),
|
|
374
|
+
700: "".concat(_seedsBorder.default.BORDER_WIDTH_700, " solid")
|
|
373
375
|
};
|
|
374
376
|
var borderWidths = exports.borderWidths = {
|
|
375
|
-
500: _seedsBorder.default.BORDER_WIDTH_500
|
|
377
|
+
500: _seedsBorder.default.BORDER_WIDTH_500,
|
|
378
|
+
600: _seedsBorder.default.BORDER_WIDTH_600,
|
|
379
|
+
700: _seedsBorder.default.BORDER_WIDTH_700
|
|
376
380
|
};
|
|
377
381
|
var shadows = exports.shadows = {
|
|
378
382
|
low: "".concat(_seedsDepth.default.ELEVATION_LEVEL_100, " ").concat(_seedsColor.default.COLOR_NEUTRAL_900, "3D"),
|
|
@@ -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,4 +1,12 @@
|
|
|
1
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
|
+
};
|
|
2
10
|
export declare const isValidNumber: (value: unknown) => boolean;
|
|
3
11
|
export interface TypeGetDurationMaxDisplayUnitsProps {
|
|
4
12
|
milliseconds: TypeDurationMilliseconds;
|
|
@@ -1 +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,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,
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/themes/dark/theme.ts"],"names":[],"mappings":"AA0BA,eAAO,MAAM,OAAO;;;;CAInB,CAAC;AAgPF,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA7NT,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;gBAyBnD,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA2IrD,mDAAmD
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/themes/dark/theme.ts"],"names":[],"mappings":"AA0BA,eAAO,MAAM,OAAO;;;;CAInB,CAAC;AAgPF,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA7NT,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;gBAyBnD,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA2IrD,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8DtD,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -72,9 +72,13 @@ export declare const radii: {
|
|
|
72
72
|
};
|
|
73
73
|
export declare const borders: {
|
|
74
74
|
500: string;
|
|
75
|
+
600: string;
|
|
76
|
+
700: string;
|
|
75
77
|
};
|
|
76
78
|
export declare const borderWidths: {
|
|
77
79
|
500: string;
|
|
80
|
+
600: string;
|
|
81
|
+
700: string;
|
|
78
82
|
};
|
|
79
83
|
export declare const shadows: {
|
|
80
84
|
low: string;
|
|
@@ -670,9 +674,13 @@ declare const theme: {
|
|
|
670
674
|
};
|
|
671
675
|
borders: {
|
|
672
676
|
500: string;
|
|
677
|
+
600: string;
|
|
678
|
+
700: string;
|
|
673
679
|
};
|
|
674
680
|
borderWidths: {
|
|
675
681
|
500: string;
|
|
682
|
+
600: string;
|
|
683
|
+
700: string;
|
|
676
684
|
};
|
|
677
685
|
shadows: {
|
|
678
686
|
low: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/themes/light/theme.ts"],"names":[],"mappings":"AA6BA,eAAO,MAAM,WAAW,UAA0C,CAAC;AAyRnE,eAAO,MAAM,UAAU;;;;;;;;;;;;;CAatB,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;;;;;;CAarB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;CAavB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAE1C,eAAO,MAAM,UAAU,QAA+B,CAAC;AAEvD,eAAO,MAAM,WAAW;;;;;CAKvB,CAAC;AAEF,eAAO,MAAM,KAAK;;;;;;;;;;CAUjB,CAAC;AAEF,eAAO,MAAM,KAAK;;;;;;;;;CASjB,CAAC;AAEF,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/themes/light/theme.ts"],"names":[],"mappings":"AA6BA,eAAO,MAAM,WAAW,UAA0C,CAAC;AAyRnE,eAAO,MAAM,UAAU;;;;;;;;;;;;;CAatB,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;;;;;;CAarB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;CAavB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAE1C,eAAO,MAAM,UAAU,QAA+B,CAAC;AAEvD,eAAO,MAAM,WAAW;;;;;CAKvB,CAAC;AAEF,eAAO,MAAM,KAAK;;;;;;;;;;CAUjB,CAAC;AAEF,eAAO,MAAM,KAAK;;;;;;;;;CASjB,CAAC;AAEF,eAAO,MAAM,OAAO;;;;CAInB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;CAIxB,CAAC;AAEF,eAAO,MAAM,OAAO;;;;CAInB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;CAIlB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAEF,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAlXL,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;gBAyBnD,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA2IrD,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4OtD,CAAC;AAEF,eAAe,KAAK,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;
|
package/lib/Duration/Duration.js
CHANGED
|
@@ -4,43 +4,16 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
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; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
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); }
|
|
7
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
-
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."); }
|
|
9
|
-
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); }
|
|
10
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
-
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; }
|
|
13
7
|
import * as React from "react";
|
|
14
8
|
import memoize from "lru-memoize";
|
|
15
9
|
import { EM_DASH } from "../utils/constants";
|
|
16
10
|
import { VisuallyHidden } from "../VisuallyHidden";
|
|
17
|
-
import { COMPARE_OBJECTS, DEFAULT_DISPLAY, DEFAULT_DISPLAY_UNITS, DEFAULT_LOCALE, DEFAULT_MILLISECONDS, MEMO_CACHE_SIZE,
|
|
11
|
+
import { COMPARE_OBJECTS, DEFAULT_DISPLAY, DEFAULT_DISPLAY_UNITS, DEFAULT_LOCALE, DEFAULT_MILLISECONDS, MEMO_CACHE_SIZE, ORDERED_UNITS, UNITS } from "./constants";
|
|
18
12
|
import { Container } from "./styles";
|
|
19
|
-
import { isValidNumber } from "./utils";
|
|
13
|
+
import { isValidNumber, getLowestUnit, splitMillisecondsIntoUnits } from "./utils";
|
|
20
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
15
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
22
16
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
|
-
var getLowestUnit = function getLowestUnit(displayUnits) {
|
|
24
|
-
return _toConsumableArray(ORDERED_UNITS).reverse().find(function (unit) {
|
|
25
|
-
return displayUnits[unit];
|
|
26
|
-
}) || UNITS.milliseconds;
|
|
27
|
-
};
|
|
28
|
-
var splitMillisecondsIntoUnits = function splitMillisecondsIntoUnits(milliseconds, displayUnits) {
|
|
29
|
-
var lowestUnit = getLowestUnit(displayUnits);
|
|
30
|
-
var remainder = milliseconds % MILLISECONDS_IN[lowestUnit];
|
|
31
|
-
if (2 * remainder >= MILLISECONDS_IN[lowestUnit]) {
|
|
32
|
-
// if the remainder is large, add enough seconds to increse the lowest unit
|
|
33
|
-
milliseconds += MILLISECONDS_IN[lowestUnit] - remainder;
|
|
34
|
-
}
|
|
35
|
-
var units = {};
|
|
36
|
-
ORDERED_UNITS.forEach(function (unit) {
|
|
37
|
-
if (displayUnits[unit]) {
|
|
38
|
-
units[unit] = Math.floor(milliseconds / MILLISECONDS_IN[unit]);
|
|
39
|
-
milliseconds -= units[unit] * MILLISECONDS_IN[unit];
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
return units;
|
|
43
|
-
};
|
|
44
17
|
var _createDurationFormatter = function _createDurationFormatter(locale, unitDisplay, displayUnits) {
|
|
45
18
|
var timeUnitFormatter = function timeUnitFormatter(locale, unit, unitDisplay) {
|
|
46
19
|
return Intl.NumberFormat(locale, {
|
package/lib/Duration/utils.js
CHANGED
|
@@ -1,7 +1,32 @@
|
|
|
1
1
|
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; } } }; }
|
|
2
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
+
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."); }
|
|
2
4
|
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); }
|
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
3
7
|
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; }
|
|
4
|
-
import { MILLISECONDS_IN, ORDERED_UNITS } from "./constants";
|
|
8
|
+
import { MILLISECONDS_IN, ORDERED_UNITS, UNITS } from "./constants";
|
|
9
|
+
export var getLowestUnit = function getLowestUnit(displayUnits) {
|
|
10
|
+
return _toConsumableArray(ORDERED_UNITS).reverse().find(function (unit) {
|
|
11
|
+
return displayUnits[unit];
|
|
12
|
+
}) || UNITS.milliseconds;
|
|
13
|
+
};
|
|
14
|
+
export var splitMillisecondsIntoUnits = function splitMillisecondsIntoUnits(milliseconds, displayUnits) {
|
|
15
|
+
var lowestUnit = getLowestUnit(displayUnits);
|
|
16
|
+
var remainder = milliseconds % MILLISECONDS_IN[lowestUnit];
|
|
17
|
+
if (2 * remainder >= MILLISECONDS_IN[lowestUnit]) {
|
|
18
|
+
// if the remainder is large, add enough seconds to increse the lowest unit
|
|
19
|
+
milliseconds += MILLISECONDS_IN[lowestUnit] - remainder;
|
|
20
|
+
}
|
|
21
|
+
var units = {};
|
|
22
|
+
ORDERED_UNITS.forEach(function (unit) {
|
|
23
|
+
if (displayUnits[unit]) {
|
|
24
|
+
units[unit] = Math.floor(milliseconds / MILLISECONDS_IN[unit]);
|
|
25
|
+
milliseconds -= units[unit] * MILLISECONDS_IN[unit];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return units;
|
|
29
|
+
};
|
|
5
30
|
export var isValidNumber = function isValidNumber(value) {
|
|
6
31
|
return typeof value === "number" && isFinite(value);
|
|
7
32
|
};
|
|
@@ -23,7 +48,16 @@ export var getDurationMaxDisplayUnits = function getDurationMaxDisplayUnits(_ref
|
|
|
23
48
|
}
|
|
24
49
|
|
|
25
50
|
// @ts-expect-error - stupid typescript isn't smart enough to check the isValidNumber check above ¯\_(ツ)_/¯
|
|
26
|
-
|
|
51
|
+
var millisecondsByUnit = splitMillisecondsIntoUnits(milliseconds, {
|
|
52
|
+
days: true,
|
|
53
|
+
hours: true,
|
|
54
|
+
minutes: true,
|
|
55
|
+
seconds: true,
|
|
56
|
+
milliseconds: true
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// @ts-expect-error - stupid typescript isn't smart enough to check the isValidNumber check above ¯\_(ツ)_/¯
|
|
60
|
+
if (milliseconds > MILLISECONDS_IN[unit] && millisecondsByUnit[unit] > 0) {
|
|
27
61
|
displayUnits[unit] = true;
|
|
28
62
|
}
|
|
29
63
|
}
|
|
@@ -365,10 +365,14 @@ export var radii = {
|
|
|
365
365
|
pill: BORDER.BORDER_RADIUS_1000
|
|
366
366
|
};
|
|
367
367
|
export var borders = {
|
|
368
|
-
500: "".concat(BORDER.BORDER_WIDTH_500, " solid")
|
|
368
|
+
500: "".concat(BORDER.BORDER_WIDTH_500, " solid"),
|
|
369
|
+
600: "".concat(BORDER.BORDER_WIDTH_600, " solid"),
|
|
370
|
+
700: "".concat(BORDER.BORDER_WIDTH_700, " solid")
|
|
369
371
|
};
|
|
370
372
|
export var borderWidths = {
|
|
371
|
-
500: BORDER.BORDER_WIDTH_500
|
|
373
|
+
500: BORDER.BORDER_WIDTH_500,
|
|
374
|
+
600: BORDER.BORDER_WIDTH_600,
|
|
375
|
+
700: BORDER.BORDER_WIDTH_700
|
|
372
376
|
};
|
|
373
377
|
export var shadows = {
|
|
374
378
|
low: "".concat(DEPTH.ELEVATION_LEVEL_100, " ").concat(COLORS.COLOR_NEUTRAL_900, "3D"),
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sproutsocial/racine",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.0.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18"
|
|
7
7
|
},
|
|
8
8
|
"readme": "README.NPM.md",
|
|
9
9
|
"files": [
|
|
10
|
-
"__flow__",
|
|
11
10
|
"commonjs",
|
|
12
11
|
"dist",
|
|
13
12
|
"lib",
|
|
@@ -55,28 +54,27 @@
|
|
|
55
54
|
"release": "yarn build && yarn test && yarn changeset publish",
|
|
56
55
|
"storybook": "rm -rf node_modules/.cache/storybook && storybook dev -c .storybook -p 9999",
|
|
57
56
|
"build-storybook": "storybook build --quiet -c .storybook -o .storybook-dist",
|
|
58
|
-
"build-chromatic": "storybook build --quiet -c .storybook -o .storybook-dist"
|
|
59
|
-
"ts-to-flow": "flowgen $FILE -o $OUTPUT --add-flow-header --no-module-exports"
|
|
57
|
+
"build-chromatic": "storybook build --quiet -c .storybook -o .storybook-dist"
|
|
60
58
|
},
|
|
61
59
|
"dependencies": {
|
|
62
60
|
"@react-spring/web": "^9.0.0",
|
|
63
|
-
"@sproutsocial/seeds-react-box": "
|
|
64
|
-
"@sproutsocial/seeds-react-button": "
|
|
65
|
-
"@sproutsocial/seeds-react-checkbox": "
|
|
66
|
-
"@sproutsocial/seeds-react-hooks": "
|
|
67
|
-
"@sproutsocial/seeds-react-icon": "
|
|
68
|
-
"@sproutsocial/seeds-react-input": "
|
|
69
|
-
"@sproutsocial/seeds-react-mixins": "
|
|
70
|
-
"@sproutsocial/seeds-react-partner-logo": "
|
|
71
|
-
"@sproutsocial/seeds-react-popout": "
|
|
72
|
-
"@sproutsocial/seeds-react-portal": "
|
|
73
|
-
"@sproutsocial/seeds-react-radio": "
|
|
74
|
-
"@sproutsocial/seeds-react-switch": "
|
|
75
|
-
"@sproutsocial/seeds-react-system-props": "
|
|
76
|
-
"@sproutsocial/seeds-react-text": "
|
|
77
|
-
"@sproutsocial/seeds-react-theme": "
|
|
78
|
-
"@sproutsocial/seeds-react-theme-provider": "
|
|
79
|
-
"@sproutsocial/seeds-react-utilities": "
|
|
61
|
+
"@sproutsocial/seeds-react-box": "^*",
|
|
62
|
+
"@sproutsocial/seeds-react-button": "*",
|
|
63
|
+
"@sproutsocial/seeds-react-checkbox": "*",
|
|
64
|
+
"@sproutsocial/seeds-react-hooks": "*",
|
|
65
|
+
"@sproutsocial/seeds-react-icon": "*",
|
|
66
|
+
"@sproutsocial/seeds-react-input": "*",
|
|
67
|
+
"@sproutsocial/seeds-react-mixins": "*",
|
|
68
|
+
"@sproutsocial/seeds-react-partner-logo": "*",
|
|
69
|
+
"@sproutsocial/seeds-react-popout": "*",
|
|
70
|
+
"@sproutsocial/seeds-react-portal": "*",
|
|
71
|
+
"@sproutsocial/seeds-react-radio": "*",
|
|
72
|
+
"@sproutsocial/seeds-react-switch": "*",
|
|
73
|
+
"@sproutsocial/seeds-react-system-props": "*",
|
|
74
|
+
"@sproutsocial/seeds-react-text": "*",
|
|
75
|
+
"@sproutsocial/seeds-react-theme": "*",
|
|
76
|
+
"@sproutsocial/seeds-react-theme-provider": "*",
|
|
77
|
+
"@sproutsocial/seeds-react-utilities": "*",
|
|
80
78
|
"@styled-system/theme-get": "^5.1.2",
|
|
81
79
|
"classnames": "^2.2.6",
|
|
82
80
|
"default-browser-id": "^3.0.0",
|
|
@@ -98,13 +96,10 @@
|
|
|
98
96
|
"@babel/cli": "^7.22.10",
|
|
99
97
|
"@babel/core": "^7.22.10",
|
|
100
98
|
"@babel/eslint-parser": "^7.22.10",
|
|
101
|
-
"@babel/plugin-syntax-flow": "^7.22.5",
|
|
102
99
|
"@babel/plugin-syntax-jsx": "^7.22.5",
|
|
103
100
|
"@babel/preset-env": "^7.22.10",
|
|
104
|
-
"@babel/preset-flow": "^7.0.0",
|
|
105
101
|
"@babel/preset-react": "^7.22.5",
|
|
106
102
|
"@babel/preset-typescript": "^7.22.5",
|
|
107
|
-
"@khanacademy/flow-to-ts": "^0.5.2",
|
|
108
103
|
"@sproutsocial/eslint-config-seeds": "*",
|
|
109
104
|
"@sproutsocial/seeds-border": "*",
|
|
110
105
|
"@sproutsocial/seeds-color": "*",
|
|
@@ -161,8 +156,6 @@
|
|
|
161
156
|
"eslint-import-resolver-babel-module": "^5.3.2",
|
|
162
157
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
163
158
|
"eslint-plugin-jest": "^27.6.3",
|
|
164
|
-
"flow-bin": "0.131.0",
|
|
165
|
-
"flowgen": "^1.21.0",
|
|
166
159
|
"glob": "^7.1.6",
|
|
167
160
|
"identity-obj-proxy": "^3.0.0",
|
|
168
161
|
"inquirer": "^6.4.1",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
export type TypeAvatarProps = {
|
|
4
|
-
/** Circles are used for social profile avatars, leaf is for internal Sprout user avatars */
|
|
5
|
-
appearance?: "circle" | "leaf",
|
|
6
|
-
/** The name of the user that the avatar represents */
|
|
7
|
-
name?: string,
|
|
8
|
-
/** URL of the avatar image. If a URL is not provided, the component will fall back to showing the user's initials */
|
|
9
|
-
src?: string,
|
|
10
|
-
type?: "neutral" | "purple" | "green" | "blue" | "yellow" | "red" | "orange",
|
|
11
|
-
bg?: string,
|
|
12
|
-
color?: string,
|
|
13
|
-
size?: string,
|
|
14
|
-
...
|
|
15
|
-
};
|
|
16
|
-
declare var Avatar: React.StatelessFunctionalComponent<TypeAvatarProps>;
|
|
17
|
-
declare export default typeof Avatar;
|