@sproutsocial/racine 12.24.0 → 13.1.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 +65 -0
- package/__flow__/Avatar/index.flow.js +16 -0
- package/__flow__/Avatar/index.js +33 -77
- package/__flow__/Badge/constants.js +9 -15
- package/__flow__/Badge/index.flow.js +17 -0
- package/__flow__/Badge/index.js +12 -53
- package/__flow__/Badge/styles.js +17 -27
- package/__flow__/Banner/index.flow.js +9 -0
- package/__flow__/Banner/index.js +16 -42
- package/__flow__/Banner/styles.js +8 -14
- package/__flow__/Box/index.flow.js +7 -0
- package/__flow__/Box/index.js +7 -9
- package/__flow__/Box/styles.js +9 -25
- package/__flow__/Breadcrumb/index.flow.js +15 -0
- package/__flow__/Breadcrumb/index.js +35 -60
- package/__flow__/Breadcrumb/styles.js +11 -14
- package/__flow__/Button/index.flow.js +26 -0
- package/__flow__/Button/index.js +9 -75
- package/__flow__/Button/styles.js +27 -47
- package/__flow__/Card/index.flow.js +19 -0
- package/__flow__/Card/index.js +8 -37
- package/__flow__/Card/styles.js +8 -11
- package/__flow__/CharacterCounter/index.flow.js +10 -0
- package/__flow__/CharacterCounter/index.js +13 -15
- package/__flow__/CharacterCounter/styles.js +9 -17
- package/__flow__/ChartLegend/index.flow.js +14 -0
- package/__flow__/ChartLegend/index.js +16 -31
- package/__flow__/ChartLegend/styles.js +10 -18
- package/__flow__/Checkbox/index.flow.js +22 -0
- package/__flow__/Checkbox/index.js +16 -93
- package/__flow__/Checkbox/styles.js +48 -101
- package/__flow__/Collapsible/index.flow.js +11 -0
- package/__flow__/Collapsible/index.js +45 -72
- package/__flow__/Collapsible/styles.js +11 -12
- package/__flow__/DatePicker/DateRangePicker.flow.js +15 -0
- package/__flow__/DatePicker/DateRangePicker.js +17 -32
- package/__flow__/DatePicker/SingleDatePicker.flow.js +12 -0
- package/__flow__/DatePicker/SingleDatePicker.js +17 -26
- package/__flow__/DatePicker/StatefulDateRangePicker.js +19 -33
- package/__flow__/DatePicker/StatefulSingleDatePicker.js +10 -16
- package/__flow__/DatePicker/common.flow.js +20 -0
- package/__flow__/DatePicker/common.js +19 -41
- package/__flow__/DatePicker/index.js +3 -4
- package/__flow__/DatePicker/styles.js +87 -72
- package/__flow__/Drawer/SlideTransition.js +22 -14
- package/__flow__/Drawer/index.flow.js +38 -0
- package/__flow__/Drawer/index.js +72 -184
- package/__flow__/Drawer/styles.js +9 -13
- package/__flow__/EmptyState/index.flow.js +15 -0
- package/__flow__/EmptyState/index.js +18 -46
- package/__flow__/EnumIconNames.js +1 -1
- package/__flow__/EnumIllustrationNames.js +1 -1
- package/__flow__/EnumLogoNames.js +1 -1
- package/__flow__/Fieldset/index.flow.js +10 -0
- package/__flow__/Fieldset/index.js +23 -54
- package/__flow__/Fieldset/styles.js +6 -12
- package/__flow__/FormField/index.flow.js +28 -0
- package/__flow__/FormField/index.js +28 -72
- package/__flow__/Icon/deprecatedIcons.js +4 -3
- package/__flow__/Icon/index.flow.js +34 -0
- package/__flow__/Icon/index.js +21 -80
- package/__flow__/Icon/styles.js +9 -15
- package/__flow__/IconViewBoxes.js +378 -1
- package/__flow__/IllustrationViewBoxes.js +121 -1
- package/__flow__/Image/index.flow.js +15 -0
- package/__flow__/Image/index.js +24 -52
- package/__flow__/Image/styles.js +6 -11
- package/__flow__/Indicator/index.flow.js +6 -0
- package/__flow__/Indicator/index.js +16 -20
- package/__flow__/Indicator/styles.js +9 -12
- package/__flow__/Input/index.flow.js +60 -0
- package/__flow__/Input/index.js +50 -188
- package/__flow__/Input/styles.js +49 -70
- package/__flow__/KeyboardKey/index.flow.js +7 -0
- package/__flow__/KeyboardKey/index.js +14 -14
- package/__flow__/KeyboardKey/styles.js +10 -13
- package/__flow__/Label/index.flow.js +14 -0
- package/__flow__/Label/index.js +12 -30
- package/__flow__/Link/constants.js +4 -7
- package/__flow__/Link/index.flow.js +18 -0
- package/__flow__/Link/index.js +11 -44
- package/__flow__/Link/styles.js +15 -22
- package/__flow__/Listbox/index.flow.js +20 -0
- package/__flow__/Listbox/index.js +51 -70
- package/__flow__/Loader/index.flow.js +12 -0
- package/__flow__/Loader/index.js +19 -26
- package/__flow__/Loader/styles.js +13 -28
- package/__flow__/LoaderButton/index.flow.js +7 -0
- package/__flow__/LoaderButton/index.js +19 -47
- package/__flow__/LogoViewBoxes.js +94 -1
- package/__flow__/Menu/constants.js +3 -4
- package/__flow__/Menu/descendants.js +140 -240
- package/__flow__/Menu/hooks.js +86 -115
- package/__flow__/Menu/index.flow.js +23 -31
- package/__flow__/Menu/index.js +146 -340
- package/__flow__/Menu/names.js +1 -4947
- package/__flow__/Menu/styles.js +31 -51
- package/__flow__/Message/constants.js +9 -0
- package/__flow__/Message/index.flow.js +17 -0
- package/__flow__/Message/index.js +69 -115
- package/__flow__/Message/styles.js +62 -76
- package/__flow__/Modal/index.flow.js +46 -0
- package/__flow__/Modal/index.js +55 -129
- package/__flow__/Modal/styles.js +39 -62
- package/__flow__/Numeral/constants.js +3 -3
- package/__flow__/Numeral/index.flow.js +19 -0
- package/__flow__/Numeral/index.js +53 -71
- package/__flow__/Numeral/styles.js +4 -7
- package/__flow__/Numeral/tests/testNumeral.js +22 -30
- package/__flow__/OverflowList/index.flow.js +6 -8
- package/__flow__/OverflowList/index.js +52 -89
- package/__flow__/OverflowList/styles.js +8 -18
- package/__flow__/PartnerLogo/TypePartnerNames.js +1 -38
- package/__flow__/PartnerLogo/index.flow.js +19 -0
- package/__flow__/PartnerLogo/index.js +18 -37
- package/__flow__/PartnerLogo/styles.js +8 -12
- package/__flow__/Popout/index.flow.js +89 -0
- package/__flow__/Popout/index.js +114 -274
- package/__flow__/Popout/styles.js +4 -6
- package/__flow__/Portal/index.flow.js +10 -0
- package/__flow__/Portal/index.js +18 -25
- package/__flow__/Radio/index.flow.js +19 -0
- package/__flow__/Radio/index.js +10 -42
- package/__flow__/Radio/styles.js +27 -43
- package/__flow__/SegmentedControl/index.flow.js +20 -0
- package/__flow__/SegmentedControl/index.js +24 -73
- package/__flow__/SegmentedControl/styles.js +26 -36
- package/__flow__/Select/index.flow.js +25 -0
- package/__flow__/Select/index.js +14 -55
- package/__flow__/Select/styles.js +53 -62
- package/__flow__/Skeleton/index.js +6 -10
- package/__flow__/SpotIllustration/illustrationNames.js +1 -121
- package/__flow__/SpotIllustration/index.flow.js +9 -0
- package/__flow__/SpotIllustration/index.js +24 -41
- package/__flow__/Stack/index.flow.js +24 -0
- package/__flow__/Stack/index.js +57 -81
- package/__flow__/Switch/index.flow.js +16 -0
- package/__flow__/Switch/index.js +21 -34
- package/__flow__/Switch/styles.js +28 -34
- package/__flow__/Table/index.flow.js +30 -0
- package/__flow__/Table/index.js +44 -85
- package/__flow__/Table/styles.js +5 -8
- package/__flow__/TableCell/index.flow.js +19 -0
- package/__flow__/TableCell/index.js +18 -31
- package/__flow__/TableCell/styles.js +11 -12
- package/__flow__/TableHeaderCell/constants.js +6 -0
- package/__flow__/TableHeaderCell/index.flow.js +24 -0
- package/__flow__/TableHeaderCell/index.js +32 -59
- package/__flow__/TableHeaderCell/styles.js +10 -16
- package/__flow__/TableRowAccordion/index.flow.js +13 -0
- package/__flow__/TableRowAccordion/index.js +26 -44
- package/__flow__/TableRowAccordion/styles.js +9 -17
- package/__flow__/Tabs/index.flow.js +20 -0
- package/__flow__/Tabs/index.js +48 -78
- package/__flow__/Tabs/styles.js +21 -40
- package/__flow__/Text/index.flow.js +13 -0
- package/__flow__/Text/index.js +38 -65
- package/__flow__/Text/styles.js +8 -15
- package/__flow__/Textarea/index.flow.js +48 -0
- package/__flow__/Textarea/index.js +12 -96
- package/__flow__/Textarea/styles.js +27 -46
- package/__flow__/ThemeProvider/index.js +5 -11
- package/__flow__/Toast/index.flow.js +20 -0
- package/__flow__/Toast/index.js +45 -99
- package/__flow__/Toast/styles.js +14 -20
- package/__flow__/ToggleHint/index.flow.js +13 -0
- package/__flow__/ToggleHint/index.js +17 -31
- package/__flow__/ToggleHint/styles.js +10 -18
- package/__flow__/Token/index.flow.js +15 -0
- package/__flow__/Token/index.js +15 -44
- package/__flow__/Token/styles.js +25 -22
- package/__flow__/TokenInput/index.flow.js +67 -2
- package/__flow__/TokenInput/index.js +108 -221
- package/__flow__/TokenInput/styles.js +36 -54
- package/__flow__/TokenInput/util.js +6 -11
- package/__flow__/Tooltip/index.flow.js +22 -0
- package/__flow__/Tooltip/index.js +38 -126
- package/__flow__/Tooltip/styles.js +6 -8
- package/__flow__/VisuallyHidden/index.js +4 -6
- package/__flow__/dataviz/index.js +6 -9
- package/__flow__/index.js +152 -76
- package/__flow__/systemProps/background.js +4 -15
- package/__flow__/systemProps/border.js +4 -35
- package/__flow__/systemProps/color.js +5 -15
- package/__flow__/systemProps/custom.js +7 -14
- package/__flow__/systemProps/flexbox.js +4 -21
- package/__flow__/systemProps/grid.js +4 -22
- package/__flow__/systemProps/index.js +14 -15
- package/__flow__/systemProps/layout.js +4 -22
- package/__flow__/systemProps/position.js +4 -16
- package/__flow__/systemProps/shadow.js +4 -9
- package/__flow__/systemProps/space.js +4 -25
- package/__flow__/systemProps/systemProps.js +15 -40
- package/__flow__/systemProps/tests/types.flow.js +2 -6
- package/__flow__/systemProps/types.flow.js +6 -14
- package/__flow__/systemProps/typography.js +5 -18
- package/__flow__/systemProps/variant.js +8 -12
- package/__flow__/themes/dark/dataviz-palette.js +4 -26
- package/__flow__/themes/dark/decorative-palettes.js +12 -23
- package/__flow__/themes/dark/theme.js +60 -74
- package/__flow__/themes/extendedThemes/sproutTheme/dark/theme.js +65 -70
- package/__flow__/themes/extendedThemes/sproutTheme/index.js +2 -2
- package/__flow__/themes/extendedThemes/sproutTheme/light/theme.js +65 -70
- package/__flow__/themes/light/dataviz-palette.js +4 -26
- package/__flow__/themes/light/decorative-palettes.js +12 -23
- package/__flow__/themes/light/literal-colors.js +13 -15
- package/__flow__/themes/light/theme.js +71 -107
- package/__flow__/types/styled-components.flow.js +1 -1
- package/__flow__/types/system-props.flow.js +5 -25
- package/__flow__/types/theme.colors.flow.js +32 -46
- package/__flow__/types/theme.flow.js +7 -25
- package/__flow__/utils/a11yTest.js +2 -3
- package/__flow__/utils/chartColors.js +6 -71
- package/__flow__/utils/constants.js +1 -1
- package/__flow__/utils/dataQaLabelQueries.js +14 -37
- package/__flow__/utils/hooks.js +77 -114
- package/__flow__/utils/index.js +6 -12
- package/__flow__/utils/innerText.js +3 -15
- package/__flow__/utils/mixins.js +5 -14
- package/__flow__/utils/react-testing-library.js +15 -42
- package/__flow__/utils/responsiveProps/index.js +6 -19
- package/__flow__/utils/system-props.js +11 -77
- package/__flow__/utils/useInteractiveColor.js +4 -7
- package/commonjs/{Stack/TypeSpaceLiterals.js → Avatar/index.flow.js} +0 -0
- package/commonjs/Avatar/index.js +31 -28
- package/commonjs/Badge/index.flow.js +6 -0
- package/commonjs/Badge/index.js +1 -1
- package/commonjs/Badge/styles.js +1 -1
- package/commonjs/Banner/index.flow.js +6 -0
- package/commonjs/Banner/index.js +15 -17
- package/commonjs/Box/index.flow.js +8 -0
- package/commonjs/Breadcrumb/index.flow.js +8 -0
- package/commonjs/Breadcrumb/index.js +21 -19
- package/commonjs/Button/index.flow.js +6 -0
- package/commonjs/Button/index.js +1 -7
- package/commonjs/Button/styles.js +1 -1
- package/commonjs/Card/index.flow.js +7 -0
- package/commonjs/Card/styles.js +1 -1
- package/commonjs/CharacterCounter/index.flow.js +1 -0
- package/commonjs/ChartLegend/index.flow.js +1 -0
- package/commonjs/ChartLegend/index.js +10 -6
- package/commonjs/Checkbox/index.flow.js +1 -0
- package/commonjs/Checkbox/index.js +27 -24
- package/commonjs/Checkbox/styles.js +1 -1
- package/commonjs/Collapsible/index.flow.js +6 -0
- package/commonjs/Collapsible/index.js +1 -1
- package/commonjs/DatePicker/DateRangePicker.flow.js +1 -0
- package/commonjs/DatePicker/SingleDatePicker.flow.js +1 -0
- package/commonjs/DatePicker/StatefulDateRangePicker.js +10 -7
- package/commonjs/DatePicker/StatefulSingleDatePicker.js +7 -4
- package/commonjs/DatePicker/common.flow.js +1 -0
- package/commonjs/DatePicker/common.js +1 -1
- package/commonjs/DatePicker/styles.js +1 -1
- package/commonjs/Drawer/index.flow.js +6 -0
- package/commonjs/Drawer/index.js +24 -20
- package/commonjs/EmptyState/index.flow.js +6 -0
- package/commonjs/EmptyState/index.js +1 -1
- package/commonjs/Fieldset/index.flow.js +6 -0
- package/commonjs/FormField/index.flow.js +9 -0
- package/commonjs/FormField/index.js +1 -1
- package/commonjs/Icon/deprecatedIcons.js +2 -2
- package/commonjs/Icon/index.flow.js +4 -0
- package/commonjs/Icon/index.js +19 -15
- package/commonjs/Icon/styles.js +1 -1
- package/commonjs/IconViewBoxes.js +3 -0
- package/commonjs/Image/index.flow.js +1 -0
- package/commonjs/Image/index.js +18 -14
- package/commonjs/Indicator/index.flow.js +1 -0
- package/commonjs/Indicator/index.js +12 -9
- package/commonjs/Indicator/styles.js +1 -1
- package/commonjs/Input/index.flow.js +6 -0
- package/commonjs/Input/index.js +52 -49
- package/commonjs/Input/styles.js +1 -1
- package/commonjs/KeyboardKey/index.flow.js +1 -0
- package/commonjs/Label/index.flow.js +8 -0
- package/commonjs/Label/index.js +9 -6
- package/commonjs/Link/index.flow.js +6 -0
- package/commonjs/Link/styles.js +1 -1
- package/commonjs/Listbox/index.flow.js +9 -0
- package/commonjs/Listbox/index.js +2 -2
- package/commonjs/Loader/index.flow.js +1 -0
- package/commonjs/Loader/index.js +13 -9
- package/commonjs/Loader/styles.js +2 -2
- package/commonjs/LoaderButton/index.flow.js +1 -0
- package/commonjs/LoaderButton/index.js +2 -6
- package/commonjs/LogoViewBoxes.js +4 -0
- package/commonjs/Menu/index.js +28 -29
- package/commonjs/Menu/styles.js +1 -1
- package/commonjs/Message/constants.js +15 -0
- package/commonjs/Message/index.flow.js +7 -0
- package/commonjs/Message/index.js +12 -17
- package/commonjs/Message/styles.js +14 -14
- package/commonjs/Modal/index.flow.js +8 -0
- package/commonjs/Modal/index.js +31 -29
- package/commonjs/Modal/styles.js +9 -6
- package/commonjs/Numeral/index.flow.js +1 -0
- package/commonjs/Numeral/index.js +9 -10
- package/commonjs/Numeral/tests/testNumeral.js +12 -14
- package/commonjs/OverflowList/index.js +2 -2
- package/commonjs/OverflowList/styles.js +1 -1
- package/commonjs/PartnerLogo/index.flow.js +1 -0
- package/commonjs/PartnerLogo/index.js +18 -15
- package/commonjs/PartnerLogo/styles.js +1 -1
- package/commonjs/Popout/index.flow.js +6 -0
- package/commonjs/Popout/index.js +25 -23
- package/commonjs/Portal/index.flow.js +6 -0
- package/commonjs/Radio/index.flow.js +1 -0
- package/commonjs/Radio/styles.js +2 -2
- package/commonjs/SegmentedControl/index.flow.js +6 -0
- package/commonjs/SegmentedControl/index.js +21 -19
- package/commonjs/SegmentedControl/styles.js +1 -1
- package/commonjs/Select/index.flow.js +6 -0
- package/commonjs/Select/index.js +1 -1
- package/commonjs/Select/styles.js +1 -1
- package/commonjs/Skeleton/index.js +1 -1
- package/commonjs/SpotIllustration/illustrationNames.js +1 -1
- package/commonjs/SpotIllustration/index.flow.js +1 -0
- package/commonjs/SpotIllustration/index.js +1 -1
- package/commonjs/Stack/index.flow.js +6 -0
- package/commonjs/Stack/index.js +1 -1
- package/commonjs/Switch/index.flow.js +1 -0
- package/commonjs/Switch/index.js +19 -15
- package/commonjs/Switch/styles.js +1 -1
- package/commonjs/Table/index.flow.js +6 -0
- package/commonjs/TableCell/index.flow.js +6 -0
- package/commonjs/TableHeaderCell/constants.js +12 -0
- package/commonjs/TableHeaderCell/index.flow.js +3 -0
- package/commonjs/TableHeaderCell/index.js +17 -9
- package/commonjs/TableRowAccordion/index.flow.js +6 -0
- package/commonjs/TableRowAccordion/index.js +1 -1
- package/commonjs/Tabs/index.flow.js +6 -0
- package/commonjs/Tabs/index.js +1 -2
- package/commonjs/Text/index.flow.js +6 -0
- package/commonjs/Text/index.js +1 -1
- package/commonjs/Textarea/index.flow.js +6 -0
- package/commonjs/Textarea/index.js +42 -38
- package/commonjs/Textarea/styles.js +1 -1
- package/commonjs/Toast/index.flow.js +6 -0
- package/commonjs/Toast/index.js +2 -2
- package/commonjs/Toast/styles.js +2 -1
- package/commonjs/ToggleHint/index.flow.js +1 -0
- package/commonjs/ToggleHint/index.js +8 -5
- package/commonjs/ToggleHint/styles.js +1 -1
- package/commonjs/Token/index.flow.js +6 -0
- package/commonjs/Token/index.js +28 -24
- package/commonjs/Token/styles.js +1 -1
- package/commonjs/TokenInput/index.flow.js +6 -1
- package/commonjs/TokenInput/index.js +42 -39
- package/commonjs/TokenInput/styles.js +1 -1
- package/commonjs/Tooltip/index.flow.js +6 -0
- package/commonjs/Tooltip/index.js +19 -15
- package/commonjs/VisuallyHidden/index.js +1 -1
- package/commonjs/dataviz/index.js +1 -1
- package/commonjs/index.js +113 -97
- package/commonjs/themes/dark/theme.js +1 -1
- package/commonjs/themes/light/theme.js +4 -9
- package/commonjs/utils/hooks.js +2 -2
- package/commonjs/utils/mixins.js +1 -1
- package/commonjs/utils/react-testing-library.js +9 -12
- package/dist/icon.svg +1 -1
- package/dist/iconList.js +1 -1
- package/dist/logo.svg +1 -1
- package/dist/logoList.js +1 -1
- package/lib/{Stack/TypeSpaceLiterals.js → Avatar/index.flow.js} +0 -0
- package/lib/Avatar/index.js +31 -28
- package/lib/Badge/index.flow.js +2 -0
- package/lib/Badge/index.js +1 -1
- package/lib/Badge/styles.js +1 -1
- package/lib/Banner/index.flow.js +2 -0
- package/lib/Banner/index.js +15 -23
- package/lib/Box/index.flow.js +3 -0
- package/lib/Breadcrumb/index.flow.js +3 -0
- package/lib/Breadcrumb/index.js +22 -21
- package/lib/Button/index.flow.js +2 -0
- package/lib/Button/index.js +1 -13
- package/lib/Button/styles.js +1 -1
- package/lib/Card/index.flow.js +3 -0
- package/lib/Card/styles.js +1 -1
- package/lib/CharacterCounter/index.flow.js +0 -0
- package/lib/ChartLegend/index.flow.js +0 -0
- package/lib/ChartLegend/index.js +10 -6
- package/lib/Checkbox/index.flow.js +0 -0
- package/lib/Checkbox/index.js +27 -24
- package/lib/Checkbox/styles.js +1 -1
- package/lib/Collapsible/index.flow.js +2 -0
- package/lib/Collapsible/index.js +1 -1
- package/lib/DatePicker/DateRangePicker.flow.js +0 -0
- package/lib/DatePicker/SingleDatePicker.flow.js +0 -0
- package/lib/DatePicker/StatefulDateRangePicker.js +10 -7
- package/lib/DatePicker/StatefulSingleDatePicker.js +7 -4
- package/lib/DatePicker/common.flow.js +0 -0
- package/lib/DatePicker/common.js +1 -1
- package/lib/DatePicker/styles.js +2 -1
- package/lib/Drawer/index.flow.js +2 -0
- package/lib/Drawer/index.js +24 -21
- package/lib/EmptyState/index.flow.js +2 -0
- package/lib/EmptyState/index.js +1 -1
- package/lib/Fieldset/index.flow.js +2 -0
- package/lib/FormField/index.flow.js +4 -0
- package/lib/FormField/index.js +1 -3
- package/lib/Icon/deprecatedIcons.js +3 -2
- package/lib/Icon/index.flow.js +3 -0
- package/lib/Icon/index.js +19 -15
- package/lib/Icon/styles.js +1 -1
- package/lib/IconViewBoxes.js +3 -0
- package/lib/Image/index.flow.js +0 -0
- package/lib/Image/index.js +18 -14
- package/lib/Indicator/index.flow.js +0 -0
- package/lib/Indicator/index.js +12 -9
- package/lib/Indicator/styles.js +1 -1
- package/lib/Input/index.flow.js +2 -0
- package/lib/Input/index.js +52 -49
- package/lib/Input/styles.js +1 -1
- package/lib/KeyboardKey/index.flow.js +0 -0
- package/lib/Label/index.flow.js +3 -0
- package/lib/Label/index.js +9 -6
- package/lib/Link/index.flow.js +2 -0
- package/lib/Link/styles.js +1 -1
- package/lib/Listbox/index.flow.js +4 -0
- package/lib/Listbox/index.js +2 -2
- package/lib/Loader/index.flow.js +0 -0
- package/lib/Loader/index.js +13 -9
- package/lib/Loader/styles.js +2 -2
- package/lib/LoaderButton/index.flow.js +0 -0
- package/lib/LoaderButton/index.js +3 -8
- package/lib/LogoViewBoxes.js +4 -0
- package/lib/Menu/index.js +29 -30
- package/lib/Menu/styles.js +1 -1
- package/lib/Message/constants.js +9 -0
- package/lib/Message/index.flow.js +3 -0
- package/lib/Message/index.js +5 -10
- package/lib/Message/styles.js +2 -2
- package/lib/Modal/index.flow.js +3 -0
- package/lib/Modal/index.js +31 -29
- package/lib/Modal/styles.js +9 -6
- package/lib/Numeral/constants.js +1 -0
- package/lib/Numeral/index.flow.js +0 -0
- package/lib/Numeral/index.js +2 -3
- package/lib/Numeral/tests/testNumeral.js +11 -13
- package/lib/OverflowList/index.js +1 -1
- package/lib/OverflowList/styles.js +1 -1
- package/lib/PartnerLogo/index.flow.js +0 -0
- package/lib/PartnerLogo/index.js +18 -15
- package/lib/PartnerLogo/styles.js +1 -1
- package/lib/Popout/index.flow.js +2 -0
- package/lib/Popout/index.js +25 -24
- package/lib/Portal/index.flow.js +2 -0
- package/lib/Radio/index.flow.js +0 -0
- package/lib/Radio/styles.js +2 -2
- package/lib/SegmentedControl/index.flow.js +2 -0
- package/lib/SegmentedControl/index.js +21 -19
- package/lib/SegmentedControl/styles.js +1 -1
- package/lib/Select/index.flow.js +2 -0
- package/lib/Select/index.js +1 -1
- package/lib/Select/styles.js +1 -1
- package/lib/Skeleton/index.js +1 -1
- package/lib/SpotIllustration/illustrationNames.js +1 -1
- package/lib/SpotIllustration/index.flow.js +0 -0
- package/lib/SpotIllustration/index.js +1 -1
- package/lib/Stack/index.flow.js +2 -0
- package/lib/Stack/index.js +1 -1
- package/lib/Switch/index.flow.js +0 -0
- package/lib/Switch/index.js +19 -15
- package/lib/Switch/styles.js +1 -1
- package/lib/Table/index.flow.js +2 -0
- package/lib/TableCell/index.flow.js +2 -0
- package/lib/TableHeaderCell/constants.js +6 -0
- package/lib/TableHeaderCell/index.flow.js +3 -0
- package/lib/TableHeaderCell/index.js +7 -5
- package/lib/TableRowAccordion/index.flow.js +2 -0
- package/lib/TableRowAccordion/index.js +1 -1
- package/lib/Tabs/index.flow.js +2 -0
- package/lib/Tabs/index.js +1 -2
- package/lib/Text/index.flow.js +2 -0
- package/lib/Text/index.js +1 -1
- package/lib/Textarea/index.flow.js +2 -0
- package/lib/Textarea/index.js +42 -38
- package/lib/Textarea/styles.js +1 -1
- package/lib/Toast/index.flow.js +2 -0
- package/lib/Toast/index.js +2 -2
- package/lib/Toast/styles.js +2 -3
- package/lib/ToggleHint/index.flow.js +0 -0
- package/lib/ToggleHint/index.js +8 -5
- package/lib/ToggleHint/styles.js +1 -1
- package/lib/Token/index.flow.js +2 -0
- package/lib/Token/index.js +28 -24
- package/lib/Token/styles.js +1 -1
- package/lib/TokenInput/index.flow.js +2 -0
- package/lib/TokenInput/index.js +41 -39
- package/lib/TokenInput/styles.js +1 -1
- package/lib/Tooltip/index.flow.js +2 -0
- package/lib/Tooltip/index.js +19 -15
- package/lib/VisuallyHidden/index.js +1 -1
- package/lib/dataviz/index.js +1 -1
- package/lib/index.js +74 -47
- package/lib/themes/dark/theme.js +4 -2
- package/lib/themes/extendedThemes/sproutTheme/dark/theme.js +3 -0
- package/lib/themes/extendedThemes/sproutTheme/light/theme.js +3 -0
- package/lib/themes/light/theme.js +4 -10
- package/lib/utils/hooks.js +1 -1
- package/lib/utils/mixins.js +1 -1
- package/lib/utils/react-testing-library.js +8 -6
- package/package.json +14 -6
- package/__flow__/Avatar/__tests__/features.test.js +0 -98
- package/__flow__/Avatar/index.stories.js +0 -62
- package/__flow__/Badge/index.stories.js +0 -49
- package/__flow__/Badge/index.test.js +0 -67
- package/__flow__/Banner/index.stories.js +0 -108
- package/__flow__/Banner/index.test.js +0 -68
- package/__flow__/Box/index.stories.js +0 -135
- package/__flow__/Box/index.test.js +0 -12
- package/__flow__/Breadcrumb/index.stories.js +0 -76
- package/__flow__/Breadcrumb/index.test.js +0 -62
- package/__flow__/Button/index.stories.js +0 -153
- package/__flow__/Card/index.stories.js +0 -67
- package/__flow__/CharacterCounter/index.stories.js +0 -42
- package/__flow__/CharacterCounter/index.test.js +0 -24
- package/__flow__/ChartLegend/index.stories.js +0 -66
- package/__flow__/ChartLegend/index.test.js +0 -55
- package/__flow__/Checkbox/index.stories.js +0 -137
- package/__flow__/Checkbox/index.test.js +0 -91
- package/__flow__/Collapsible/index.stories.js +0 -182
- package/__flow__/Collapsible/index.test.js +0 -68
- package/__flow__/DatePicker/DateRangePicker.stories.js +0 -101
- package/__flow__/DatePicker/DateRangePicker.test.js +0 -123
- package/__flow__/DatePicker/SingleDatePicker.stories.js +0 -64
- package/__flow__/DatePicker/SingleDatePicker.test.js +0 -89
- package/__flow__/Drawer/index.stories.js +0 -336
- package/__flow__/Drawer/index.test.js +0 -158
- package/__flow__/EmptyState/index.stories.js +0 -108
- package/__flow__/EmptyState/index.test.js +0 -124
- package/__flow__/Fieldset/index.stories.js +0 -135
- package/__flow__/Fieldset/index.test.js +0 -34
- package/__flow__/FormField/index.stories.js +0 -116
- package/__flow__/FormField/index.test.js +0 -71
- package/__flow__/Icon/index.stories.js +0 -175
- package/__flow__/Icon/index.test.js +0 -25
- package/__flow__/Image/index.stories.js +0 -30
- package/__flow__/Image/index.test.js +0 -86
- package/__flow__/Indicator/index.stories.js +0 -16
- package/__flow__/Indicator/index.test.js +0 -11
- package/__flow__/Input/index.stories.js +0 -216
- package/__flow__/Input/index.test.js +0 -405
- package/__flow__/KeyboardKey/index.stories.js +0 -25
- package/__flow__/KeyboardKey/index.test.js +0 -12
- package/__flow__/Label/index.stories.js +0 -15
- package/__flow__/Label/index.test.js +0 -16
- package/__flow__/Link/index.stories.js +0 -115
- package/__flow__/Link/index.test.js +0 -110
- package/__flow__/Listbox/index.stories.js +0 -238
- package/__flow__/Listbox/index.test.js +0 -291
- package/__flow__/Loader/index.stories.js +0 -40
- package/__flow__/Loader/index.test.js +0 -26
- package/__flow__/LoaderButton/index.stories.js +0 -84
- package/__flow__/LoaderButton/index.test.js +0 -35
- package/__flow__/Menu/__snapshots__/index.test.js.snap +0 -115
- package/__flow__/Menu/index.stories.js +0 -261
- package/__flow__/Menu/index.test.js +0 -103
- package/__flow__/Message/index.stories.js +0 -73
- package/__flow__/Message/index.test.js +0 -12
- package/__flow__/Modal/index.stories.js +0 -409
- package/__flow__/Modal/index.test.js +0 -129
- package/__flow__/Numeral/index.stories.js +0 -183
- package/__flow__/Numeral/tests/A11y.test.js +0 -12
- package/__flow__/Numeral/tests/abbreviate.test.js +0 -72
- package/__flow__/Numeral/tests/currency.test.js +0 -40
- package/__flow__/Numeral/tests/defaults.test.js +0 -33
- package/__flow__/Numeral/tests/invalid.test.js +0 -12
- package/__flow__/Numeral/tests/locale.test.js +0 -83
- package/__flow__/Numeral/tests/precision.test.js +0 -126
- package/__flow__/Numeral/tests/zero.test.js +0 -11
- package/__flow__/OverflowList/index.stories.js +0 -69
- package/__flow__/OverflowList/index.test.js +0 -79
- package/__flow__/PartnerLogo/index.stories.js +0 -124
- package/__flow__/PartnerLogo/partnerLogos/bigcommerce-dark.svg +0 -5
- package/__flow__/PartnerLogo/partnerLogos/bigcommerce-lockup-dark.svg +0 -14
- package/__flow__/PartnerLogo/partnerLogos/bigcommerce-lockup.svg +0 -14
- package/__flow__/PartnerLogo/partnerLogos/bigcommerce.svg +0 -5
- package/__flow__/PartnerLogo/partnerLogos/bitly-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/bitly.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/canva-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/canva.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/dropbox-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/dropbox-lockup-dark.svg +0 -7
- package/__flow__/PartnerLogo/partnerLogos/dropbox-lockup.svg +0 -7
- package/__flow__/PartnerLogo/partnerLogos/dropbox-wordmark-dark.svg +0 -3
- package/__flow__/PartnerLogo/partnerLogos/dropbox-wordmark.svg +0 -3
- package/__flow__/PartnerLogo/partnerLogos/dropbox.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/facebook-audience-network-dark.svg +0 -3
- package/__flow__/PartnerLogo/partnerLogos/facebook-audience-network.svg +0 -3
- package/__flow__/PartnerLogo/partnerLogos/facebook-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/facebook-groups-dark.svg +0 -3
- package/__flow__/PartnerLogo/partnerLogos/facebook-groups.svg +0 -3
- package/__flow__/PartnerLogo/partnerLogos/facebook-shops-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/facebook-shops.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/facebook.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/feedly-dark.svg +0 -3
- package/__flow__/PartnerLogo/partnerLogos/feedly.svg +0 -3
- package/__flow__/PartnerLogo/partnerLogos/glassdoor-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/glassdoor.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/google-analytics-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/google-analytics.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/google-business-messages-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/google-business-messages.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/google-drive-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/google-drive.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/google-my-business-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/google-my-business.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/hubspot-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/hubspot.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/instagram-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/instagram.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/linkedin-audience-network-dark.svg +0 -3
- package/__flow__/PartnerLogo/partnerLogos/linkedin-audience-network.svg +0 -3
- package/__flow__/PartnerLogo/partnerLogos/linkedin-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/linkedin.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/marketo-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/marketo.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/messenger-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/messenger.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/microsoft-dynamics-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/microsoft-dynamics.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/pinterest-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/pinterest.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/reddit-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/reddit.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/salesforce-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/salesforce.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/shopify-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/shopify.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/slack-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/slack.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/sproutsocial-dark.svg +0 -7
- package/__flow__/PartnerLogo/partnerLogos/sproutsocial-lockup-dark.svg +0 -19
- package/__flow__/PartnerLogo/partnerLogos/sproutsocial-lockup.svg +0 -19
- package/__flow__/PartnerLogo/partnerLogos/sproutsocial-wordmark-dark.svg +0 -14
- package/__flow__/PartnerLogo/partnerLogos/sproutsocial-wordmark.svg +0 -14
- package/__flow__/PartnerLogo/partnerLogos/sproutsocial.svg +0 -7
- package/__flow__/PartnerLogo/partnerLogos/tiktok-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/tiktok.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/tripadvisor-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/tripadvisor.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/tumblr-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/tumblr.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/twitter-audience-network-dark.svg +0 -3
- package/__flow__/PartnerLogo/partnerLogos/twitter-audience-network.svg +0 -3
- package/__flow__/PartnerLogo/partnerLogos/twitter-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/twitter.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/whatsapp-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/whatsapp.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/woocommerce-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/woocommerce.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/yelp-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/yelp.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/youtube-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/youtube.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/zendesk-dark.svg +0 -1
- package/__flow__/PartnerLogo/partnerLogos/zendesk-lockup-dark.svg +0 -28
- package/__flow__/PartnerLogo/partnerLogos/zendesk-lockup.svg +0 -28
- package/__flow__/PartnerLogo/partnerLogos/zendesk-wordmark-dark.svg +0 -9
- package/__flow__/PartnerLogo/partnerLogos/zendesk-wordmark.svg +0 -9
- package/__flow__/PartnerLogo/partnerLogos/zendesk.svg +0 -1
- package/__flow__/Popout/__snapshots__/index.test.js.snap +0 -121
- package/__flow__/Popout/index.stories.js +0 -471
- package/__flow__/Popout/index.test.js +0 -179
- package/__flow__/Portal/index.stories.js +0 -42
- package/__flow__/Radio/index.stories.js +0 -75
- package/__flow__/Radio/index.test.js +0 -47
- package/__flow__/SegmentedControl/index.stories.js +0 -44
- package/__flow__/SegmentedControl/index.test.js +0 -74
- package/__flow__/Select/index.stories.js +0 -42
- package/__flow__/Select/index.test.js +0 -44
- package/__flow__/Skeleton/index.stories.js +0 -31
- package/__flow__/SpotIllustration/index.stories.js +0 -135
- package/__flow__/SpotIllustration/spotIllustrations/abacus.svg +0 -21
- package/__flow__/SpotIllustration/spotIllustrations/analytics-offering.svg +0 -11
- package/__flow__/SpotIllustration/spotIllustrations/asset-cards.svg +0 -16
- package/__flow__/SpotIllustration/spotIllustrations/astronaut.svg +0 -15
- package/__flow__/SpotIllustration/spotIllustrations/binoculars.svg +0 -11
- package/__flow__/SpotIllustration/spotIllustrations/brand-keyword.svg +0 -10
- package/__flow__/SpotIllustration/spotIllustrations/browser-doc.svg +0 -10
- package/__flow__/SpotIllustration/spotIllustrations/business.svg +0 -23
- package/__flow__/SpotIllustration/spotIllustrations/calendar-event.svg +0 -11
- package/__flow__/SpotIllustration/spotIllustrations/calendar-reporting.svg +0 -13
- package/__flow__/SpotIllustration/spotIllustrations/cat-error.svg +0 -4
- package/__flow__/SpotIllustration/spotIllustrations/cat-no-access.svg +0 -13
- package/__flow__/SpotIllustration/spotIllustrations/cat.svg +0 -4
- package/__flow__/SpotIllustration/spotIllustrations/checkbox-alert.svg +0 -11
- package/__flow__/SpotIllustration/spotIllustrations/coffee-cup.svg +0 -11
- package/__flow__/SpotIllustration/spotIllustrations/competitors.svg +0 -29
- package/__flow__/SpotIllustration/spotIllustrations/compose-window.svg +0 -21
- package/__flow__/SpotIllustration/spotIllustrations/compose.svg +0 -5
- package/__flow__/SpotIllustration/spotIllustrations/computer-error.svg +0 -15
- package/__flow__/SpotIllustration/spotIllustrations/connect.svg +0 -11
- package/__flow__/SpotIllustration/spotIllustrations/contact.svg +0 -87
- package/__flow__/SpotIllustration/spotIllustrations/conversation.svg +0 -15
- package/__flow__/SpotIllustration/spotIllustrations/custom-branding.svg +0 -7
- package/__flow__/SpotIllustration/spotIllustrations/customer-service.svg +0 -13
- package/__flow__/SpotIllustration/spotIllustrations/dashboard.svg +0 -13
- package/__flow__/SpotIllustration/spotIllustrations/exclamation-mark.svg +0 -11
- package/__flow__/SpotIllustration/spotIllustrations/face-happy.svg +0 -10
- package/__flow__/SpotIllustration/spotIllustrations/find-bookmark.svg +0 -12
- package/__flow__/SpotIllustration/spotIllustrations/flask.svg +0 -10
- package/__flow__/SpotIllustration/spotIllustrations/general-topic.svg +0 -9
- package/__flow__/SpotIllustration/spotIllustrations/global-features.svg +0 -17
- package/__flow__/SpotIllustration/spotIllustrations/global-trend.svg +0 -5
- package/__flow__/SpotIllustration/spotIllustrations/grow-large.svg +0 -12
- package/__flow__/SpotIllustration/spotIllustrations/grow.svg +0 -5
- package/__flow__/SpotIllustration/spotIllustrations/hands-raised.svg +0 -8
- package/__flow__/SpotIllustration/spotIllustrations/headset.svg +0 -8
- package/__flow__/SpotIllustration/spotIllustrations/heartbeat-connection.svg +0 -14
- package/__flow__/SpotIllustration/spotIllustrations/instagram-links.svg +0 -28
- package/__flow__/SpotIllustration/spotIllustrations/invoice.svg +0 -13
- package/__flow__/SpotIllustration/spotIllustrations/jewel.svg +0 -11
- package/__flow__/SpotIllustration/spotIllustrations/keyword-tracking.svg +0 -26
- package/__flow__/SpotIllustration/spotIllustrations/lightbulb-alt.svg +0 -5
- package/__flow__/SpotIllustration/spotIllustrations/lightbulb.svg +0 -4
- package/__flow__/SpotIllustration/spotIllustrations/like-conversation.svg +0 -11
- package/__flow__/SpotIllustration/spotIllustrations/link-broken.svg +0 -18
- package/__flow__/SpotIllustration/spotIllustrations/link-messages.svg +0 -10
- package/__flow__/SpotIllustration/spotIllustrations/link-sections.svg +0 -13
- package/__flow__/SpotIllustration/spotIllustrations/link-upload.svg +0 -12
- package/__flow__/SpotIllustration/spotIllustrations/listening-pendo.svg +0 -14
- package/__flow__/SpotIllustration/spotIllustrations/listening-sentiment.svg +0 -27
- package/__flow__/SpotIllustration/spotIllustrations/listening-topic-templates.svg +0 -26
- package/__flow__/SpotIllustration/spotIllustrations/listening-tour.svg +0 -18
- package/__flow__/SpotIllustration/spotIllustrations/listening.svg +0 -9
- package/__flow__/SpotIllustration/spotIllustrations/loading.svg +0 -4
- package/__flow__/SpotIllustration/spotIllustrations/mailbox-empty.svg +0 -18
- package/__flow__/SpotIllustration/spotIllustrations/mailbox-full.svg +0 -8
- package/__flow__/SpotIllustration/spotIllustrations/megaphone.svg +0 -7
- package/__flow__/SpotIllustration/spotIllustrations/message.svg +0 -6
- package/__flow__/SpotIllustration/spotIllustrations/molecule.svg +0 -14
- package/__flow__/SpotIllustration/spotIllustrations/network-data.svg +0 -25
- package/__flow__/SpotIllustration/spotIllustrations/no-messages-found.svg +0 -20
- package/__flow__/SpotIllustration/spotIllustrations/no-notifications.svg +0 -4
- package/__flow__/SpotIllustration/spotIllustrations/note.svg +0 -6
- package/__flow__/SpotIllustration/spotIllustrations/notification.svg +0 -10
- package/__flow__/SpotIllustration/spotIllustrations/notifications-onboarding.svg +0 -23
- package/__flow__/SpotIllustration/spotIllustrations/organize-message.svg +0 -64
- package/__flow__/SpotIllustration/spotIllustrations/outbox-queue.svg +0 -12
- package/__flow__/SpotIllustration/spotIllustrations/outbox-reviews.svg +0 -10
- package/__flow__/SpotIllustration/spotIllustrations/pdf.svg +0 -5
- package/__flow__/SpotIllustration/spotIllustrations/planning.svg +0 -28
- package/__flow__/SpotIllustration/spotIllustrations/podium.svg +0 -13
- package/__flow__/SpotIllustration/spotIllustrations/pointer.svg +0 -4
- package/__flow__/SpotIllustration/spotIllustrations/publish-assets.svg +0 -15
- package/__flow__/SpotIllustration/spotIllustrations/publish-links.svg +0 -11
- package/__flow__/SpotIllustration/spotIllustrations/publishing.svg +0 -29
- package/__flow__/SpotIllustration/spotIllustrations/puzzle-piece.svg +0 -4
- package/__flow__/SpotIllustration/spotIllustrations/question-mark.svg +0 -11
- package/__flow__/SpotIllustration/spotIllustrations/reporting-folder.svg +0 -13
- package/__flow__/SpotIllustration/spotIllustrations/reporting.svg +0 -12
- package/__flow__/SpotIllustration/spotIllustrations/review-location.svg +0 -11
- package/__flow__/SpotIllustration/spotIllustrations/review.svg +0 -10
- package/__flow__/SpotIllustration/spotIllustrations/robot-assembly.svg +0 -12
- package/__flow__/SpotIllustration/spotIllustrations/robot-error.svg +0 -19
- package/__flow__/SpotIllustration/spotIllustrations/robot-happy.svg +0 -13
- package/__flow__/SpotIllustration/spotIllustrations/rocket.svg +0 -9
- package/__flow__/SpotIllustration/spotIllustrations/schedule-date.svg +0 -11
- package/__flow__/SpotIllustration/spotIllustrations/schedule-messages.svg +0 -10
- package/__flow__/SpotIllustration/spotIllustrations/search-keywords.svg +0 -9
- package/__flow__/SpotIllustration/spotIllustrations/search-success.svg +0 -8
- package/__flow__/SpotIllustration/spotIllustrations/search-trends.svg +0 -23
- package/__flow__/SpotIllustration/spotIllustrations/search.svg +0 -86
- package/__flow__/SpotIllustration/spotIllustrations/security.svg +0 -12
- package/__flow__/SpotIllustration/spotIllustrations/sentiment.svg +0 -12
- package/__flow__/SpotIllustration/spotIllustrations/shopping-bag.svg +0 -4
- package/__flow__/SpotIllustration/spotIllustrations/spark-line.svg +0 -11
- package/__flow__/SpotIllustration/spotIllustrations/stamp.svg +0 -9
- package/__flow__/SpotIllustration/spotIllustrations/storefront.svg +0 -10
- package/__flow__/SpotIllustration/spotIllustrations/success.svg +0 -9
- package/__flow__/SpotIllustration/spotIllustrations/tag-message.svg +0 -15
- package/__flow__/SpotIllustration/spotIllustrations/tag.svg +0 -6
- package/__flow__/SpotIllustration/spotIllustrations/team-roles.svg +0 -17
- package/__flow__/SpotIllustration/spotIllustrations/team.svg +0 -16
- package/__flow__/SpotIllustration/spotIllustrations/telescope.svg +0 -15
- package/__flow__/SpotIllustration/spotIllustrations/tha-mel.svg +0 -15
- package/__flow__/SpotIllustration/spotIllustrations/thumbs-up.svg +0 -11
- package/__flow__/SpotIllustration/spotIllustrations/toggle-switch.svg +0 -11
- package/__flow__/SpotIllustration/spotIllustrations/toolset-strength.svg +0 -13
- package/__flow__/SpotIllustration/spotIllustrations/tracking-time.svg +0 -6
- package/__flow__/SpotIllustration/spotIllustrations/twitter-messages.svg +0 -11
- package/__flow__/SpotIllustration/spotIllustrations/twitter-profiles.svg +0 -12
- package/__flow__/SpotIllustration/spotIllustrations/under-construction.svg +0 -12
- package/__flow__/SpotIllustration/spotIllustrations/unsubscribe.svg +0 -10
- package/__flow__/SpotIllustration/spotIllustrations/upward-trend.svg +0 -4
- package/__flow__/SpotIllustration/spotIllustrations/user-task.svg +0 -58
- package/__flow__/SpotIllustration/spotIllustrations/view-connections.svg +0 -13
- package/__flow__/SpotIllustration/spotIllustrations/vip-list.svg +0 -13
- package/__flow__/SpotIllustration/spotIllustrations/warning.svg +0 -4
- package/__flow__/SpotIllustration/spotIllustrations/wifi.svg +0 -6
- package/__flow__/SpotIllustration/spotIllustrations/workflow-steps.svg +0 -28
- package/__flow__/Stack/TypeSpaceLiterals.js +0 -13
- package/__flow__/Stack/index.stories.js +0 -91
- package/__flow__/Stack/index.test.js +0 -22
- package/__flow__/Switch/index.stories.js +0 -42
- package/__flow__/Switch/index.test.js +0 -44
- package/__flow__/Table/index.stories.js +0 -293
- package/__flow__/Table/index.test.js +0 -91
- package/__flow__/TableCell/index.stories.js +0 -33
- package/__flow__/TableCell/index.test.js +0 -20
- package/__flow__/TableHeaderCell/index.stories.js +0 -54
- package/__flow__/TableHeaderCell/index.test.js +0 -28
- package/__flow__/TableRowAccordion/index.stories.js +0 -129
- package/__flow__/TableRowAccordion/index.test.js +0 -82
- package/__flow__/Tabs/index.stories.js +0 -84
- package/__flow__/Tabs/index.test.js +0 -242
- package/__flow__/Text/index.stories.js +0 -132
- package/__flow__/Text/index.test.js +0 -49
- package/__flow__/Textarea/index.stories.js +0 -90
- package/__flow__/Textarea/index.test.js +0 -86
- package/__flow__/Toast/index.stories.js +0 -118
- package/__flow__/ToggleHint/index.test.js +0 -16
- package/__flow__/Token/index.stories.js +0 -89
- package/__flow__/Token/index.test.js +0 -75
- package/__flow__/TokenInput/index.stories.js +0 -242
- package/__flow__/TokenInput/tests/default/clicking.test.js +0 -38
- package/__flow__/TokenInput/tests/default/deleting.test.js +0 -101
- package/__flow__/TokenInput/tests/default/focusing.test.js +0 -39
- package/__flow__/TokenInput/tests/default/inputting.test.js +0 -57
- package/__flow__/TokenInput/tests/default/pasting.test.js +0 -216
- package/__flow__/TokenInput/tests/default/rendering.test.js +0 -140
- package/__flow__/Tooltip/index.stories.js +0 -175
- package/__flow__/Tooltip/index.test.js +0 -182
- package/__flow__/building-stories.stories.mdx +0 -121
- package/__flow__/code-guidelines.mdx +0 -244
- package/__flow__/dataviz/dataviz.stories.js +0 -13
- package/__flow__/overview.stories.js +0 -60
- package/__flow__/setupTests.js +0 -22
- package/__flow__/systemProps/tests/__snapshots__/background.test.js.snap +0 -96
- package/__flow__/systemProps/tests/__snapshots__/border.test.js.snap +0 -469
- package/__flow__/systemProps/tests/__snapshots__/color.test.js.snap +0 -55
- package/__flow__/systemProps/tests/__snapshots__/custom.test.js.snap +0 -36
- package/__flow__/systemProps/tests/__snapshots__/flexbox.test.js.snap +0 -239
- package/__flow__/systemProps/tests/__snapshots__/grid.test.js.snap +0 -166
- package/__flow__/systemProps/tests/__snapshots__/layout.test.js.snap +0 -204
- package/__flow__/systemProps/tests/__snapshots__/position.test.js.snap +0 -115
- package/__flow__/systemProps/tests/__snapshots__/shadow.test.js.snap +0 -25
- package/__flow__/systemProps/tests/__snapshots__/space.test.js.snap +0 -39
- package/__flow__/systemProps/tests/__snapshots__/typography.test.js.snap +0 -166
- package/__flow__/systemProps/tests/__snapshots__/variant.test.js.snap +0 -17
- package/__flow__/systemProps/tests/background.test.js +0 -90
- package/__flow__/systemProps/tests/border.test.js +0 -299
- package/__flow__/systemProps/tests/color.test.js +0 -49
- package/__flow__/systemProps/tests/custom.test.js +0 -38
- package/__flow__/systemProps/tests/flexbox.test.js +0 -150
- package/__flow__/systemProps/tests/grid.test.js +0 -123
- package/__flow__/systemProps/tests/layout.test.js +0 -126
- package/__flow__/systemProps/tests/position.test.js +0 -78
- package/__flow__/systemProps/tests/shadow.test.js +0 -30
- package/__flow__/systemProps/tests/space.test.js +0 -32
- package/__flow__/systemProps/tests/typography.test.js +0 -93
- package/__flow__/systemProps/tests/variant.test.js +0 -25
- package/__flow__/themes/extendedThemes/README.md +0 -6
- package/__flow__/themes/utils/_themed.scss +0 -119
- package/__flow__/utils/responsiveProps/index.test.js +0 -31
- package/__flow__/writing-good-stories.stories.mdx +0 -3
package/__flow__/Popout/index.js
CHANGED
|
@@ -1,162 +1,64 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {useState, useEffect, useRef, useCallback, useMemo} from 'react';
|
|
4
|
-
import {useTransition, animated} from 'react-spring';
|
|
5
|
-
|
|
6
|
-
import {MOTION_DURATION_FAST} from '@sproutsocial/seeds-motion/dist/seeds-motion-unitless';
|
|
7
|
-
import {TargetWrapper} from './styles';
|
|
8
|
-
import Portal from '../Portal';
|
|
9
|
-
import Box from '../Box';
|
|
10
|
-
import {Popper, type PopperProps} from 'react-popper';
|
|
11
|
-
import {useMutationObserver} from '../utils/hooks';
|
|
3
|
+
import { useState, useEffect, useRef, useCallback, useMemo } from 'react';
|
|
4
|
+
import { useTransition, animated } from 'react-spring';
|
|
12
5
|
import FocusLock from 'react-focus-lock';
|
|
13
|
-
|
|
6
|
+
import { Popper } from 'react-popper';
|
|
7
|
+
import { MOTION_DURATION_FAST } from '@sproutsocial/seeds-motion/dist/seeds-motion-unitless';
|
|
8
|
+
import { useMutationObserver } from "../utils/hooks";
|
|
9
|
+
import Portal from "../Portal";
|
|
10
|
+
import Box from "../Box";
|
|
11
|
+
import { TargetWrapper } from "./styles";
|
|
12
|
+
import type { EnumPlacements as EnumPlacements2, TypeFocusLockProps as TypeFocusLockProps2, TypePopoutProps } from "./index.flow";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Use EnumPlacements from root instead
|
|
16
|
+
*/
|
|
17
|
+
export type EnumPlacements = EnumPlacements2;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Use TypeFocusLockProps from root instead
|
|
21
|
+
*/
|
|
22
|
+
export type TypeFocusLockProps = TypeFocusLockProps2;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Use TypePopoutProps from root instead
|
|
26
|
+
*/
|
|
27
|
+
export type TypeProps = TypePopoutProps;
|
|
14
28
|
export const placements = {
|
|
15
29
|
auto: 'auto',
|
|
16
|
-
|
|
17
30
|
top: 'top',
|
|
18
31
|
right: 'right',
|
|
19
32
|
bottom: 'bottom',
|
|
20
33
|
left: 'left',
|
|
21
|
-
|
|
22
34
|
'top-start': 'top-start',
|
|
23
35
|
'right-start': 'right-start',
|
|
24
36
|
'bottom-start': 'bottom-start',
|
|
25
37
|
'left-start': 'left-start',
|
|
26
|
-
|
|
27
38
|
'top-end': 'top-end',
|
|
28
39
|
'right-end': 'right-end',
|
|
29
40
|
'bottom-end': 'bottom-end',
|
|
30
|
-
'left-end': 'left-end'
|
|
31
|
-
};
|
|
32
|
-
// Seeds docs can't parse $Keys<typeof placements> yet
|
|
33
|
-
export type EnumPlacements =
|
|
34
|
-
| 'auto'
|
|
35
|
-
| 'top'
|
|
36
|
-
| 'right'
|
|
37
|
-
| 'bottom'
|
|
38
|
-
| 'left'
|
|
39
|
-
| 'top-start'
|
|
40
|
-
| 'right-start'
|
|
41
|
-
| 'bottom-start'
|
|
42
|
-
| 'left-start'
|
|
43
|
-
| 'top-end'
|
|
44
|
-
| 'right-end'
|
|
45
|
-
| 'bottom-end'
|
|
46
|
-
| 'left-end';
|
|
47
|
-
|
|
48
|
-
export type TypeFocusLockProps = {|
|
|
49
|
-
disabled?: boolean,
|
|
50
|
-
returnFocus?:
|
|
51
|
-
| boolean
|
|
52
|
-
| {|
|
|
53
|
-
preventScroll?: boolean,
|
|
54
|
-
|},
|
|
55
|
-
persistentFocus?: boolean,
|
|
56
|
-
autoFocus?: boolean,
|
|
57
|
-
noFocusGuards?: boolean | 'tail',
|
|
58
|
-
group?: string,
|
|
59
|
-
className?: string,
|
|
60
|
-
onActivation?: (node: HTMLElement) => void,
|
|
61
|
-
onDeactivation?: (node: HTMLElement) => void,
|
|
62
|
-
as?: string | React.Element<any>,
|
|
63
|
-
lockProps?: any,
|
|
64
|
-
ref?: any,
|
|
65
|
-
whiteList?: (activeElement: HTMLElement) => boolean,
|
|
66
|
-
shards?: Array<any>,
|
|
67
|
-
children?: React.Node,
|
|
68
|
-
|};
|
|
69
|
-
|
|
70
|
-
export type TypeProps = {
|
|
71
|
-
/**
|
|
72
|
-
* Is the popout open? This prop is optional. By using it, you will lose some automatic handling of the logic for opening and closing the popout.
|
|
73
|
-
*/
|
|
74
|
-
isOpen?: boolean,
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* If you use the isOpen prop you will need to pass a handler to change the state of the popout
|
|
78
|
-
*/
|
|
79
|
-
setIsOpen?: (isOpen: boolean, event?: MouseEvent | KeyboardEvent) => void,
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* The content to be shown in the popout. If there is no content, just the children are rendered
|
|
83
|
-
*/
|
|
84
|
-
content:
|
|
85
|
-
| ?React.Element<any>
|
|
86
|
-
| ?((opts: {hide: () => void}) => React.Element<any>),
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* The content that the popout should be attached to
|
|
90
|
-
*/
|
|
91
|
-
children:
|
|
92
|
-
| React.Element<any>
|
|
93
|
-
| ((opts: {
|
|
94
|
-
ref: (React.ElementRef<any> | HTMLElement) => void,
|
|
95
|
-
toggle: () => void,
|
|
96
|
-
show: () => void,
|
|
97
|
-
hide: () => void,
|
|
98
|
-
ariaProps: Object,
|
|
99
|
-
}) => React.Node),
|
|
100
|
-
|
|
101
|
-
/** How the popped-out content should be placed, in relationship to the children */
|
|
102
|
-
placement?: EnumPlacements,
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Should the popped-out content inherit its width from the children?
|
|
106
|
-
* This is useful for typeaheads and other places where a popout needs to match the width of a given element.
|
|
107
|
-
*/
|
|
108
|
-
fullWidth?: boolean,
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* When the popout has opened, should we focus on its content?
|
|
112
|
-
* Focus will be brought inside by looking for elements with [autofocus] first, [tabindex] second and buttons/links/other natively-focusable elements last.
|
|
113
|
-
* Upon closing the popout, focus will be returned to the popout's target.
|
|
114
|
-
* If nothing within your popout's content is focusable, this prop will do nothing.
|
|
115
|
-
*/
|
|
116
|
-
focusOnContent?: boolean,
|
|
117
|
-
qa?: {[string]: string},
|
|
118
|
-
zIndex?: number,
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Override react-popper per the API documentation here: https://github.com/FezVrasta/react-popper#api-documentation
|
|
122
|
-
*/
|
|
123
|
-
popperProps?: $Shape<PopperProps>,
|
|
124
|
-
onClose?: () => void,
|
|
125
|
-
onOpen?: () => void,
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* And optional callback to receive the scheduleUpdate function.
|
|
129
|
-
* Use the function to recalculate the popout position in relation to the contents.
|
|
130
|
-
*/
|
|
131
|
-
scheduleUpdateRef?: (() => void) => void,
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Mount the popout at the bottom of the DOM (using React.Portal) instead of inside the current DOM tree
|
|
135
|
-
*/
|
|
136
|
-
appendToBody?: boolean,
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Override `FocusLock` props, see the API documentation for more details: https://github.com/theKashey/react-focus-lock#api
|
|
140
|
-
*/
|
|
141
|
-
focusLockProps?: TypeFocusLockProps,
|
|
41
|
+
'left-end': 'left-end'
|
|
142
42
|
};
|
|
143
|
-
|
|
144
43
|
const doesRefContainEventTarget = (ref, event) => {
|
|
145
|
-
return (
|
|
146
|
-
ref.current &&
|
|
147
|
-
event.target instanceof Node &&
|
|
148
|
-
ref.current.contains(event.target)
|
|
149
|
-
);
|
|
44
|
+
return ref.current && event.target instanceof Node && ref.current.contains(event.target);
|
|
150
45
|
};
|
|
151
46
|
|
|
152
47
|
// Transition definitions for fading in and out
|
|
153
48
|
const transitionConfig = {
|
|
154
|
-
from: {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
49
|
+
from: {
|
|
50
|
+
opacity: 0
|
|
51
|
+
},
|
|
52
|
+
enter: {
|
|
53
|
+
opacity: 1
|
|
54
|
+
},
|
|
55
|
+
leave: {
|
|
56
|
+
opacity: 0
|
|
57
|
+
},
|
|
58
|
+
config: {
|
|
59
|
+
duration: MOTION_DURATION_FAST * 1000
|
|
60
|
+
}
|
|
158
61
|
};
|
|
159
|
-
|
|
160
62
|
export default function Popout({
|
|
161
63
|
isOpen,
|
|
162
64
|
setIsOpen,
|
|
@@ -174,32 +76,22 @@ export default function Popout({
|
|
|
174
76
|
appendToBody = true,
|
|
175
77
|
focusLockProps = {},
|
|
176
78
|
...rest
|
|
177
|
-
}:
|
|
79
|
+
}: TypePopoutProps) {
|
|
178
80
|
const PopoutComponentWrapper = appendToBody ? Portal : React.Fragment;
|
|
179
81
|
const [isInternalShown, setIsInternalShown] = useState<boolean>(false);
|
|
180
82
|
const isControlled = typeof isOpen === 'boolean';
|
|
181
83
|
const isShown = isControlled ? isOpen : isInternalShown;
|
|
182
|
-
const setIsShown = useMemo(
|
|
183
|
-
() =>
|
|
184
|
-
isControlled && setIsOpen
|
|
185
|
-
? setIsOpen
|
|
186
|
-
: (nextIsShown, e) => setIsInternalShown(nextIsShown),
|
|
187
|
-
[isControlled, setIsOpen]
|
|
188
|
-
);
|
|
84
|
+
const setIsShown = useMemo(() => isControlled && setIsOpen ? setIsOpen : (nextIsShown, e) => setIsInternalShown(nextIsShown), [isControlled, setIsOpen]);
|
|
189
85
|
const targetRef = useRef();
|
|
190
86
|
const popoutRef = useRef();
|
|
191
87
|
const isFirstRender = useRef(true);
|
|
192
88
|
// This callback will automatically trigger a recalculation of the popout position if the content is changed
|
|
193
89
|
const scheduleUpdateCallback = useRef(() => {});
|
|
194
|
-
useMutationObserver(
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
subtree: true,
|
|
200
|
-
},
|
|
201
|
-
scheduleUpdateCallback.current
|
|
202
|
-
);
|
|
90
|
+
useMutationObserver(popoutRef.current, {
|
|
91
|
+
childList: true,
|
|
92
|
+
characterData: true,
|
|
93
|
+
subtree: true
|
|
94
|
+
}, scheduleUpdateCallback.current);
|
|
203
95
|
const {
|
|
204
96
|
autoFocus = true,
|
|
205
97
|
returnFocus = true,
|
|
@@ -212,20 +104,15 @@ export default function Popout({
|
|
|
212
104
|
const show = useCallback(() => setIsShown(true), [setIsShown]);
|
|
213
105
|
const hide = useCallback(() => setIsShown(false), [setIsShown]);
|
|
214
106
|
const toggle = useCallback(() => setIsShown(!isShown), [isShown, setIsShown]);
|
|
215
|
-
|
|
216
107
|
useEffect(() => {
|
|
217
108
|
const documentBody = document.body;
|
|
218
109
|
if (isShown && documentBody) {
|
|
219
110
|
// Callback passed to a click handler attached to document.body,
|
|
220
111
|
// allowing user to close the popout by clicking outside
|
|
221
112
|
const bodyClick = (e: MouseEvent): void => {
|
|
222
|
-
if (
|
|
223
|
-
doesRefContainEventTarget(targetRef, e) ||
|
|
224
|
-
doesRefContainEventTarget(popoutRef, e)
|
|
225
|
-
) {
|
|
113
|
+
if (doesRefContainEventTarget(targetRef, e) || doesRefContainEventTarget(popoutRef, e)) {
|
|
226
114
|
return;
|
|
227
115
|
}
|
|
228
|
-
|
|
229
116
|
setIsShown(false, e);
|
|
230
117
|
};
|
|
231
118
|
|
|
@@ -239,10 +126,8 @@ export default function Popout({
|
|
|
239
126
|
setIsShown(false, e);
|
|
240
127
|
}
|
|
241
128
|
};
|
|
242
|
-
|
|
243
129
|
documentBody.addEventListener('click', bodyClick, false);
|
|
244
130
|
documentBody.addEventListener('keydown', onEsc, false);
|
|
245
|
-
|
|
246
131
|
return () => {
|
|
247
132
|
documentBody.removeEventListener('click', bodyClick, false);
|
|
248
133
|
documentBody.removeEventListener('keydown', onEsc, false);
|
|
@@ -260,148 +145,103 @@ export default function Popout({
|
|
|
260
145
|
if (!onOpen && !onClose) {
|
|
261
146
|
return;
|
|
262
147
|
}
|
|
263
|
-
|
|
264
148
|
if (isShown && onOpen) {
|
|
265
149
|
onOpen();
|
|
266
150
|
}
|
|
267
|
-
|
|
268
151
|
if (!isShown && onClose) {
|
|
269
152
|
onClose();
|
|
270
153
|
}
|
|
271
154
|
// eslint-disable-next-line
|
|
272
155
|
}, [isShown]);
|
|
273
|
-
|
|
274
156
|
const transitions = useTransition(isShown, null, transitionConfig);
|
|
275
157
|
|
|
276
158
|
// WAI-Aria properties for the popout trigger
|
|
277
|
-
const ariaProps = useMemo(
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}),
|
|
282
|
-
[isShown]
|
|
283
|
-
);
|
|
159
|
+
const ariaProps = useMemo(() => ({
|
|
160
|
+
'aria-expanded': isShown,
|
|
161
|
+
'aria-haspopup': true
|
|
162
|
+
}), [isShown]);
|
|
284
163
|
|
|
285
164
|
// In cases where a controlled popout is used (e.g. props.isOpen is true), we need
|
|
286
165
|
// to wait for the targetRef to receive a value before rendering the popout. Otherwise,
|
|
287
166
|
// the Popout component renders, but doesn't know how to position itself due the
|
|
288
167
|
// `refereElement` property being undefined.
|
|
289
168
|
const [shouldRenderPopout, setShouldRenderPopout] = useState<boolean>(
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
const childrenRef = (el) => {
|
|
169
|
+
// Only trigger this shouldRenderPopout logic when using a controlled component.
|
|
170
|
+
// The reason for that is because controlled components may render the popout
|
|
171
|
+
// immediately before the targetRef has a value set to it.
|
|
172
|
+
!isControlled);
|
|
173
|
+
const childrenRef = el => {
|
|
296
174
|
targetRef.current = el;
|
|
297
175
|
if (targetRef.current) {
|
|
298
176
|
setShouldRenderPopout(true);
|
|
299
177
|
}
|
|
300
178
|
};
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
hide,
|
|
310
|
-
ariaProps,
|
|
311
|
-
})
|
|
312
|
-
) : (
|
|
313
|
-
<TargetWrapper {...qa} {...rest} ref={childrenRef}>
|
|
179
|
+
return <React.Fragment>
|
|
180
|
+
{typeof children === 'function' ? children({
|
|
181
|
+
ref: childrenRef,
|
|
182
|
+
toggle,
|
|
183
|
+
show,
|
|
184
|
+
hide,
|
|
185
|
+
ariaProps
|
|
186
|
+
}) : <TargetWrapper {...qa} {...rest} ref={childrenRef}>
|
|
314
187
|
{React.cloneElement(children, {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
)}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
<Popper
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
}}
|
|
332
|
-
{...popperProps}
|
|
333
|
-
>
|
|
188
|
+
...ariaProps,
|
|
189
|
+
...(!isControlled ? {
|
|
190
|
+
onClick: toggle
|
|
191
|
+
} : undefined)
|
|
192
|
+
})}
|
|
193
|
+
</TargetWrapper>}
|
|
194
|
+
{shouldRenderPopout && !isInvalidContent && transitions.map(({
|
|
195
|
+
item,
|
|
196
|
+
key,
|
|
197
|
+
props
|
|
198
|
+
}) => item && <PopoutComponentWrapper key={key}>
|
|
199
|
+
<Popper referenceElement={targetRef.current} placement={placement} modifiers={{
|
|
200
|
+
preventOverflow: {
|
|
201
|
+
boundariesElement: 'viewport'
|
|
202
|
+
}
|
|
203
|
+
}} {...popperProps}>
|
|
334
204
|
{({
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
data-placement={placement}
|
|
360
|
-
data-qa-popout=""
|
|
361
|
-
data-qa-popout-isopen={isOpen === true}
|
|
362
|
-
// $FlowIssue - upgrade v0.112.0
|
|
363
|
-
{...rest}
|
|
364
|
-
>
|
|
365
|
-
{item && !outOfBoundaries && (
|
|
366
|
-
<animated.div style={props}>
|
|
367
|
-
<FocusLock
|
|
368
|
-
autoFocus={autoFocus}
|
|
369
|
-
returnFocus={returnFocus}
|
|
370
|
-
disabled={!focusOnContent}
|
|
371
|
-
{...restFocusLockProps}
|
|
372
|
-
>
|
|
373
|
-
{typeof content === 'function' && content({hide})}
|
|
205
|
+
ref,
|
|
206
|
+
style,
|
|
207
|
+
placement,
|
|
208
|
+
outOfBoundaries,
|
|
209
|
+
scheduleUpdate
|
|
210
|
+
}) => {
|
|
211
|
+
const interceptRef = el => {
|
|
212
|
+
popoutRef.current = el;
|
|
213
|
+
ref(el);
|
|
214
|
+
};
|
|
215
|
+
scheduleUpdateCallback.current = scheduleUpdate;
|
|
216
|
+
scheduleUpdateRef(scheduleUpdate);
|
|
217
|
+
return (
|
|
218
|
+
// $FlowIssue - upgrade v0.112.0
|
|
219
|
+
<div ref={interceptRef} style={{
|
|
220
|
+
...style,
|
|
221
|
+
zIndex,
|
|
222
|
+
width: fullWidth && targetRef.current ? targetRef.current.offsetWidth : 'initial'
|
|
223
|
+
}} data-placement={placement} data-qa-popout="" data-qa-popout-isopen={isOpen === true} {...rest}>
|
|
224
|
+
{item && !outOfBoundaries && <animated.div style={props}>
|
|
225
|
+
<FocusLock autoFocus={autoFocus} returnFocus={returnFocus} disabled={!focusOnContent} {...restFocusLockProps}>
|
|
226
|
+
{typeof content === 'function' && content({
|
|
227
|
+
hide
|
|
228
|
+
})}
|
|
374
229
|
{typeof content !== 'function' && content}
|
|
375
230
|
</FocusLock>
|
|
376
|
-
</animated.div>
|
|
377
|
-
)}
|
|
231
|
+
</animated.div>}
|
|
378
232
|
</div>
|
|
379
|
-
|
|
380
|
-
|
|
233
|
+
);
|
|
234
|
+
}}
|
|
381
235
|
</Popper>
|
|
382
|
-
</PopoutComponentWrapper>
|
|
383
|
-
|
|
384
|
-
)}
|
|
385
|
-
</React.Fragment>
|
|
386
|
-
);
|
|
236
|
+
</PopoutComponentWrapper>)}
|
|
237
|
+
</React.Fragment>;
|
|
387
238
|
}
|
|
388
|
-
|
|
389
239
|
type TypePopoutContentProps = React.ElementConfig<typeof Box>;
|
|
390
|
-
const PopoutContent = ({
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
border={500}
|
|
395
|
-
borderColor="container.border.base"
|
|
396
|
-
borderRadius="outer"
|
|
397
|
-
boxShadow="medium"
|
|
398
|
-
p={400}
|
|
399
|
-
m={300}
|
|
400
|
-
{...rest}
|
|
401
|
-
>
|
|
240
|
+
const PopoutContent = ({
|
|
241
|
+
children,
|
|
242
|
+
...rest
|
|
243
|
+
}: TypePopoutContentProps) => <Box bg="container.background.base" color="text.body" border={500} borderColor="container.border.base" borderRadius="outer" boxShadow="medium" p={400} m={300} {...rest}>
|
|
402
244
|
{children}
|
|
403
|
-
</Box
|
|
404
|
-
);
|
|
405
|
-
|
|
245
|
+
</Box>;
|
|
406
246
|
Popout.Content = PopoutContent;
|
|
407
|
-
Popout.Content.displayName = 'Popout.Content';
|
|
247
|
+
Popout.Content.displayName = 'Popout.Content';
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
//@flow
|
|
2
|
-
import styled, {type StyledComponent} from 'styled-components';
|
|
3
|
-
import {COMMON, LAYOUT} from
|
|
4
|
-
|
|
5
|
-
import type {TypeTheme} from '../types/theme.flow';
|
|
6
|
-
|
|
2
|
+
import styled, { type StyledComponent } from 'styled-components';
|
|
3
|
+
import { COMMON, LAYOUT } from "../utils/system-props";
|
|
4
|
+
import type { TypeTheme } from "../types/theme.flow";
|
|
7
5
|
export const TargetWrapper: StyledComponent<{...}, TypeTheme, *> = styled.div`
|
|
8
6
|
display: inline-block;
|
|
9
7
|
${COMMON}
|
|
10
8
|
${LAYOUT}
|
|
11
|
-
`;
|
|
9
|
+
`;
|
package/__flow__/Portal/index.js
CHANGED
|
@@ -1,29 +1,22 @@
|
|
|
1
1
|
// @flow strict-local
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {createPortal} from 'react-dom';
|
|
4
|
-
import {canUseDOM} from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
as: string,
|
|
8
|
-
container?: HTMLElement,
|
|
9
|
-
children: React.Node,
|
|
10
|
-
el?: HTMLElement,
|
|
11
|
-
id: string,
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export default class Portal extends React.Component<TypeProps> {
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
|
+
import { canUseDOM } from "../utils";
|
|
5
|
+
import type { TypePortalProps } from "./index.flow";
|
|
6
|
+
export default class Portal extends React.Component<TypePortalProps> {
|
|
15
7
|
el: ?HTMLElement = null;
|
|
16
|
-
|
|
17
8
|
static defaultProps = {
|
|
18
9
|
as: 'div',
|
|
19
|
-
id: ''
|
|
10
|
+
id: ''
|
|
20
11
|
};
|
|
21
|
-
|
|
22
|
-
constructor(props: TypeProps) {
|
|
12
|
+
constructor(props: TypePortalProps) {
|
|
23
13
|
super(props);
|
|
24
|
-
|
|
25
14
|
if (canUseDOM()) {
|
|
26
|
-
const {
|
|
15
|
+
const {
|
|
16
|
+
as,
|
|
17
|
+
el,
|
|
18
|
+
id
|
|
19
|
+
} = props;
|
|
27
20
|
if (el) {
|
|
28
21
|
this.el = el;
|
|
29
22
|
} else {
|
|
@@ -32,32 +25,32 @@ export default class Portal extends React.Component<TypeProps> {
|
|
|
32
25
|
}
|
|
33
26
|
}
|
|
34
27
|
}
|
|
35
|
-
|
|
36
28
|
componentDidMount() {
|
|
37
29
|
if (canUseDOM() && this.el) {
|
|
38
|
-
const {
|
|
30
|
+
const {
|
|
31
|
+
container = document.body
|
|
32
|
+
} = this.props;
|
|
39
33
|
if (container) {
|
|
40
34
|
// for flow
|
|
41
35
|
container.appendChild(this.el);
|
|
42
36
|
}
|
|
43
37
|
}
|
|
44
38
|
}
|
|
45
|
-
|
|
46
39
|
componentWillUnmount() {
|
|
47
40
|
if (canUseDOM() && this.el) {
|
|
48
|
-
const {
|
|
41
|
+
const {
|
|
42
|
+
container = document.body
|
|
43
|
+
} = this.props;
|
|
49
44
|
if (container) {
|
|
50
45
|
// for flow
|
|
51
46
|
container.removeChild(this.el);
|
|
52
47
|
}
|
|
53
48
|
}
|
|
54
49
|
}
|
|
55
|
-
|
|
56
50
|
render() {
|
|
57
51
|
if (this.el) {
|
|
58
52
|
return createPortal(this.props.children, this.el);
|
|
59
53
|
}
|
|
60
|
-
|
|
61
54
|
return this.props.children;
|
|
62
55
|
}
|
|
63
|
-
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
|
|
3
|
+
export type TypeRadioProps = {
|
|
4
|
+
/** ID of the form element, should match the "for" value of the associated label */
|
|
5
|
+
id: string,
|
|
6
|
+
name: string,
|
|
7
|
+
/** Label text to display next to the radio input */
|
|
8
|
+
label?: string,
|
|
9
|
+
/** Label used to describe the input if not used with an accompanying visual label */
|
|
10
|
+
ariaLabel?: string,
|
|
11
|
+
value?: string,
|
|
12
|
+
checked?: boolean,
|
|
13
|
+
disabled?: boolean,
|
|
14
|
+
qa?: Object,
|
|
15
|
+
onChange?: (e: SyntheticInputEvent<HTMLInputElement>) => void,
|
|
16
|
+
onFocus?: (e: SyntheticFocusEvent<HTMLInputElement>) => void,
|
|
17
|
+
onBlur?: (e: SyntheticFocusEvent<HTMLInputElement>) => void,
|
|
18
|
+
...
|
|
19
|
+
};
|