@sproutsocial/racine 22.5.1 → 23.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +3 -3
- package/__flow__/Toast/Toast.flow.js +4 -0
- package/commonjs/Avatar/Avatar.js +24 -16
- package/commonjs/Badge/Badge.js +20 -13
- package/commonjs/Banner/Banner.js +35 -25
- package/commonjs/Box/Box.js +7 -2
- package/commonjs/Breadcrumb/Breadcrumb.js +36 -23
- package/commonjs/Button/Button.js +11 -3
- package/commonjs/Card/Card.js +25 -18
- package/commonjs/Card/subComponents.js +32 -15
- package/commonjs/CharacterCounter/CharacterCounter.js +7 -3
- package/commonjs/ChartLegend/ChartLegend.js +10 -3
- package/commonjs/ChartLegend/useChartLabels.js +12 -10
- package/commonjs/Checkbox/Checkbox.js +55 -45
- package/commonjs/Checkbox/styles.js +20 -17
- package/commonjs/Collapsible/Collapsible.js +22 -16
- package/commonjs/DatePicker/DateRangePicker/DateRangePicker.js +26 -16
- package/commonjs/DatePicker/DateRangePicker/StatefulDateRangePicker.js +7 -2
- package/commonjs/DatePicker/SingleDatePicker/SingleDatePicker.js +24 -14
- package/commonjs/DatePicker/SingleDatePicker/StatefulSingleDatePicker.js +7 -2
- package/commonjs/DatePicker/common.js +8 -6
- package/commonjs/Drawer/Drawer.js +160 -113
- package/commonjs/EmptyState/EmptyState.js +44 -31
- package/commonjs/Fieldset/Fieldset.js +31 -14
- package/commonjs/FormField/FormField.js +37 -31
- package/commonjs/Icon/Icon.js +35 -30
- package/commonjs/Image/Image.js +5 -3
- package/commonjs/Indicator/Indicator.js +12 -6
- package/commonjs/Input/Input.js +57 -51
- package/commonjs/KeyboardKey/KeyboardKey.js +12 -3
- package/commonjs/Label/Label.js +15 -9
- package/commonjs/Link/Link.js +10 -3
- package/commonjs/Listbox/Listbox.js +16 -13
- package/commonjs/Loader/Loader.js +9 -3
- package/commonjs/LoaderButton/LoaderButton.js +28 -18
- package/commonjs/Menu/Menu.js +128 -107
- package/commonjs/Menu/utils/descendants.js +6 -6
- package/commonjs/Message/Message.js +79 -59
- package/commonjs/Modal/Modal.js +54 -31
- package/commonjs/Modal/styles.js +8 -4
- package/commonjs/Numeral/Numeral.js +46 -13
- package/commonjs/Numeral/index.js +12 -3
- package/commonjs/PartnerLogo/PartnerLogo.js +22 -12
- package/commonjs/Radio/Radio.js +28 -22
- package/commonjs/SegmentedControl/SegmentedControl.js +38 -24
- package/commonjs/Select/Select.js +32 -25
- package/commonjs/SpotIllustration/SpotIllustration.js +13 -5
- package/commonjs/Stack/Stack.js +15 -8
- package/commonjs/Switch/Switch.js +14 -7
- package/commonjs/Table/Table.js +65 -45
- package/commonjs/TableCell/TableCell.js +6 -3
- package/commonjs/TableHeaderCell/TableHeaderCell.js +20 -12
- package/commonjs/TableRowAccordion/TableRowAccordion.js +35 -29
- package/commonjs/Tabs/Tabs.js +37 -30
- package/commonjs/Text/Text.js +10 -3
- package/commonjs/Textarea/Textarea.js +37 -32
- package/commonjs/ThemeProvider/index.js +8 -5
- package/commonjs/Toast/Toast.js +127 -91
- package/commonjs/Toast/index.js +15 -15
- package/commonjs/Toast/styles.js +56 -30
- package/commonjs/ToggleHint/ToggleHint.js +11 -5
- package/commonjs/Token/Token.js +39 -25
- package/commonjs/TokenInput/TokenInput.js +55 -47
- package/commonjs/TokenInput/TokenScreenReaderStatus.js +5 -3
- package/commonjs/Tooltip/Tooltip.js +34 -27
- package/dist/types/Avatar/Avatar.d.ts.map +1 -1
- package/dist/types/Badge/BadgeTypes.d.ts +0 -1
- package/dist/types/Badge/BadgeTypes.d.ts.map +1 -1
- package/dist/types/Badge/styles.d.ts +1 -1
- package/dist/types/Badge/styles.d.ts.map +1 -1
- package/dist/types/Box/BoxTypes.d.ts +0 -1
- package/dist/types/Box/BoxTypes.d.ts.map +1 -1
- package/dist/types/Box/styles.d.ts +1 -1
- package/dist/types/Box/styles.d.ts.map +1 -1
- package/dist/types/Button/Button.d.ts +1 -1
- package/dist/types/Button/Button.d.ts.map +1 -1
- package/dist/types/Card/subComponents.d.ts.map +1 -1
- package/dist/types/Card/utils.d.ts +0 -2
- package/dist/types/Card/utils.d.ts.map +1 -1
- package/dist/types/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/types/Collapsible/styles.d.ts +2 -3
- package/dist/types/Collapsible/styles.d.ts.map +1 -1
- package/dist/types/DatePicker/DateRangePicker/DateRangePickerTypes.d.ts +0 -1
- package/dist/types/DatePicker/DateRangePicker/DateRangePickerTypes.d.ts.map +1 -1
- package/dist/types/DatePicker/SingleDatePicker/SingleDatePickerTypes.d.ts +0 -1
- package/dist/types/DatePicker/SingleDatePicker/SingleDatePickerTypes.d.ts.map +1 -1
- package/dist/types/DatePicker/common.d.ts.map +1 -1
- package/dist/types/DatePicker/styles.d.ts +0 -1
- package/dist/types/DatePicker/styles.d.ts.map +1 -1
- package/dist/types/Drawer/Drawer.d.ts.map +1 -1
- package/dist/types/Drawer/DrawerTypes.d.ts +6 -3
- package/dist/types/Drawer/DrawerTypes.d.ts.map +1 -1
- package/dist/types/Drawer/styles.d.ts +0 -1
- package/dist/types/Drawer/styles.d.ts.map +1 -1
- package/dist/types/Fieldset/styles.d.ts +0 -1
- package/dist/types/Fieldset/styles.d.ts.map +1 -1
- package/dist/types/Icon/styles.d.ts +1 -1
- package/dist/types/Icon/styles.d.ts.map +1 -1
- package/dist/types/Image/Image.d.ts.map +1 -1
- package/dist/types/Input/Input.d.ts.map +1 -1
- package/dist/types/Input/styles.d.ts +3 -3
- package/dist/types/Input/styles.d.ts.map +1 -1
- package/dist/types/Listbox/ListboxTypes.d.ts +1 -1
- package/dist/types/Listbox/ListboxTypes.d.ts.map +1 -1
- package/dist/types/Loader/LoaderTypes.d.ts +0 -1
- package/dist/types/Loader/LoaderTypes.d.ts.map +1 -1
- package/dist/types/Menu/MenuTypes.d.ts +4 -4
- package/dist/types/Menu/MenuTypes.d.ts.map +1 -1
- package/dist/types/Menu/styles.d.ts +0 -1
- package/dist/types/Menu/styles.d.ts.map +1 -1
- package/dist/types/Menu/utils/descendants.d.ts.map +1 -1
- package/dist/types/Menu/utils/hooks.d.ts +0 -2
- package/dist/types/Menu/utils/hooks.d.ts.map +1 -1
- package/dist/types/Message/Message.d.ts +1 -1
- package/dist/types/Message/Message.d.ts.map +1 -1
- package/dist/types/Message/styles.d.ts +0 -2
- package/dist/types/Message/styles.d.ts.map +1 -1
- package/dist/types/Modal/styles.d.ts +3 -3
- package/dist/types/Modal/styles.d.ts.map +1 -1
- package/dist/types/Numeral/Numeral.d.ts +3 -1
- package/dist/types/Numeral/Numeral.d.ts.map +1 -1
- package/dist/types/Numeral/__tests__/features/testNumeral.d.ts.map +1 -1
- package/dist/types/Numeral/index.d.ts +2 -1
- package/dist/types/Numeral/index.d.ts.map +1 -1
- package/dist/types/Radio/Radio.d.ts.map +1 -1
- package/dist/types/Radio/styles.d.ts +3 -3
- package/dist/types/Radio/styles.d.ts.map +1 -1
- package/dist/types/SegmentedControl/styles.d.ts +0 -1
- package/dist/types/SegmentedControl/styles.d.ts.map +1 -1
- package/dist/types/Select/Select.d.ts.map +1 -1
- package/dist/types/Skeleton/Skeleton.d.ts +0 -1
- package/dist/types/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/types/StatefulStory.d.ts +0 -1
- package/dist/types/StatefulStory.d.ts.map +1 -1
- package/dist/types/TableHeaderCell/TableHeaderCell.d.ts.map +1 -1
- package/dist/types/TableHeaderCell/styles.d.ts +1 -1
- package/dist/types/TableHeaderCell/styles.d.ts.map +1 -1
- package/dist/types/Tabs/Tabs.d.ts.map +1 -1
- package/dist/types/Textarea/Textarea.d.ts.map +1 -1
- package/dist/types/ThemeProvider/index.d.ts +1 -1
- package/dist/types/ThemeProvider/index.d.ts.map +1 -1
- package/dist/types/Toast/Toast.d.ts +22 -2
- package/dist/types/Toast/Toast.d.ts.map +1 -1
- package/dist/types/Toast/ToastTypes.d.ts +27 -13
- package/dist/types/Toast/ToastTypes.d.ts.map +1 -1
- package/dist/types/Toast/index.d.ts +2 -4
- package/dist/types/Toast/index.d.ts.map +1 -1
- package/dist/types/Toast/styles.d.ts +10 -16
- package/dist/types/Toast/styles.d.ts.map +1 -1
- package/dist/types/TokenInput/TokenInput.d.ts +1 -1
- package/dist/types/TokenInput/TokenInput.d.ts.map +1 -1
- package/dist/types/Tooltip/TooltipTypes.d.ts +2 -2
- package/dist/types/Tooltip/TooltipTypes.d.ts.map +1 -1
- package/dist/types/Tooltip/styles.d.ts +0 -1
- package/dist/types/Tooltip/styles.d.ts.map +1 -1
- package/dist/types/themes/dark/theme.d.ts +2 -2
- package/dist/types/themes/dark/theme.d.ts.map +1 -1
- package/dist/types/utils/hooks.d.ts.map +1 -1
- package/dist/types/utils/react-testing-library.d.ts +109 -169
- package/dist/types/utils/react-testing-library.d.ts.map +1 -1
- package/dist/types/utils/responsiveProps/index.d.ts.map +1 -1
- package/lib/Avatar/Avatar.js +25 -16
- package/lib/Badge/Badge.js +22 -13
- package/lib/Banner/Banner.js +37 -25
- package/lib/Box/Box.js +8 -2
- package/lib/Breadcrumb/Breadcrumb.js +37 -23
- package/lib/Button/Button.js +11 -3
- package/lib/Card/Card.js +17 -8
- package/lib/Card/subComponents.js +35 -15
- package/lib/CharacterCounter/CharacterCounter.js +7 -3
- package/lib/ChartLegend/ChartLegend.js +11 -3
- package/lib/ChartLegend/useChartLabels.js +13 -10
- package/lib/Checkbox/Checkbox.js +56 -45
- package/lib/Checkbox/styles.js +20 -17
- package/lib/Collapsible/Collapsible.js +22 -16
- package/lib/DatePicker/DateRangePicker/DateRangePicker.js +29 -16
- package/lib/DatePicker/DateRangePicker/StatefulDateRangePicker.js +8 -2
- package/lib/DatePicker/SingleDatePicker/SingleDatePicker.js +27 -14
- package/lib/DatePicker/SingleDatePicker/StatefulSingleDatePicker.js +8 -2
- package/lib/DatePicker/common.js +8 -6
- package/lib/Drawer/Drawer.js +159 -111
- package/lib/EmptyState/EmptyState.js +46 -31
- package/lib/Fieldset/Fieldset.js +33 -14
- package/lib/FormField/FormField.js +38 -31
- package/lib/Icon/Icon.js +36 -30
- package/lib/Image/Image.js +5 -3
- package/lib/Indicator/Indicator.js +13 -6
- package/lib/Input/Input.js +57 -49
- package/lib/KeyboardKey/KeyboardKey.js +12 -3
- package/lib/Label/Label.js +16 -9
- package/lib/Link/Link.js +11 -3
- package/lib/Listbox/Listbox.js +17 -13
- package/lib/Loader/Loader.js +9 -3
- package/lib/LoaderButton/LoaderButton.js +30 -18
- package/lib/Menu/Menu.js +128 -104
- package/lib/Menu/utils/descendants.js +5 -4
- package/lib/Message/Message.js +80 -59
- package/lib/Modal/Modal.js +56 -31
- package/lib/Modal/styles.js +8 -2
- package/lib/Numeral/Numeral.js +48 -12
- package/lib/Numeral/index.js +2 -1
- package/lib/PartnerLogo/PartnerLogo.js +22 -12
- package/lib/Radio/Radio.js +29 -22
- package/lib/SegmentedControl/SegmentedControl.js +40 -24
- package/lib/Select/Select.js +33 -25
- package/lib/SpotIllustration/SpotIllustration.js +13 -5
- package/lib/Stack/Stack.js +17 -8
- package/lib/Switch/Switch.js +15 -7
- package/lib/Table/Table.js +65 -43
- package/lib/TableCell/TableCell.js +5 -2
- package/lib/TableHeaderCell/TableHeaderCell.js +20 -11
- package/lib/TableRowAccordion/TableRowAccordion.js +35 -28
- package/lib/Tabs/Tabs.js +37 -30
- package/lib/Text/Text.js +11 -3
- package/lib/Textarea/Textarea.js +37 -30
- package/lib/ThemeProvider/index.js +8 -3
- package/lib/Toast/Toast.js +130 -90
- package/lib/Toast/index.js +3 -5
- package/lib/Toast/styles.js +55 -26
- package/lib/ToggleHint/ToggleHint.js +12 -5
- package/lib/Token/Token.js +42 -25
- package/lib/TokenInput/TokenInput.js +56 -47
- package/lib/TokenInput/TokenScreenReaderStatus.js +5 -3
- package/lib/Tooltip/Tooltip.js +34 -27
- package/package.json +40 -36
- package/commonjs/Drawer/SlideTransition.js +0 -47
- package/commonjs/Popout/Popout.js +0 -313
- package/commonjs/Popout/PopoutTypes.js +0 -5
- package/commonjs/Popout/index.js +0 -30
- package/commonjs/Popout/styles.js +0 -13
- package/dist/types/Drawer/SlideTransition.d.ts +0 -15
- package/dist/types/Drawer/SlideTransition.d.ts.map +0 -1
- package/dist/types/Popout/Popout.d.ts +0 -14
- package/dist/types/Popout/Popout.d.ts.map +0 -1
- package/dist/types/Popout/PopoutTypes.d.ts +0 -90
- package/dist/types/Popout/PopoutTypes.d.ts.map +0 -1
- package/dist/types/Popout/index.d.ts +0 -5
- package/dist/types/Popout/index.d.ts.map +0 -1
- package/dist/types/Popout/styles.d.ts +0 -2
- package/dist/types/Popout/styles.d.ts.map +0 -1
- package/lib/Drawer/SlideTransition.js +0 -38
- package/lib/Popout/Popout.js +0 -303
- package/lib/Popout/PopoutTypes.js +0 -1
- package/lib/Popout/index.js +0 -4
- package/lib/Popout/styles.js +0 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sproutsocial/racine",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "23.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18"
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
"format:check": "prettier -c .",
|
|
43
43
|
"lint": "eslint --max-warnings=0 --fix .",
|
|
44
44
|
"lint:check": "eslint --max-warnings=0 --ext .ts,.tsx,.js .",
|
|
45
|
-
"jest": "jest
|
|
45
|
+
"jest": "node node_modules/.bin/jest",
|
|
46
46
|
"jest:watch": "jest --watch",
|
|
47
47
|
"typecheck:ts": "tsc --noEmit",
|
|
48
48
|
"typecheck": "npm-run-all typecheck:ts",
|
|
49
|
-
"test": "yarn jest",
|
|
49
|
+
"test": "yarn jest --ci",
|
|
50
50
|
"test:visual-regression": "yarn backstop test --config='backstop.config.js' --docker",
|
|
51
|
-
"backstop
|
|
52
|
-
"backstop
|
|
51
|
+
"backstop:reference": "yarn backstop reference --config='backstop.config.js' --docker",
|
|
52
|
+
"backstop:approve": "yarn backstop approve --config='backstop.config.js' --docker",
|
|
53
53
|
"new": "node ./bin/scaffold.js",
|
|
54
54
|
"playground": "node ./bin/scaffold-playground.js && yarn start",
|
|
55
55
|
"release": "yarn build && yarn test && yarn changeset publish",
|
|
@@ -59,27 +59,27 @@
|
|
|
59
59
|
"ts-to-flow": "flowgen $FILE -o $OUTPUT --add-flow-header --no-module-exports"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
+
"@react-spring/web": "^9.0.0",
|
|
62
63
|
"@sproutsocial/seeds-react-box": "^1.0.0",
|
|
63
|
-
"@sproutsocial/seeds-react-checkbox": "^1.0.0",
|
|
64
|
-
"@sproutsocial/seeds-react-input": "^1.0.0",
|
|
65
|
-
"@sproutsocial/seeds-react-text": "^1.0.0",
|
|
66
|
-
"@sproutsocial/seeds-react-radio": "^1.0.0",
|
|
67
64
|
"@sproutsocial/seeds-react-button": "^1.0.0",
|
|
68
|
-
"@sproutsocial/seeds-react-
|
|
65
|
+
"@sproutsocial/seeds-react-checkbox": "^1.0.0",
|
|
69
66
|
"@sproutsocial/seeds-react-hooks": "^2.0.0",
|
|
70
67
|
"@sproutsocial/seeds-react-icon": "^1.0.0",
|
|
68
|
+
"@sproutsocial/seeds-react-input": "^1.0.0",
|
|
71
69
|
"@sproutsocial/seeds-react-mixins": "^2.0.0",
|
|
72
70
|
"@sproutsocial/seeds-react-partner-logo": "^1.0.0",
|
|
73
71
|
"@sproutsocial/seeds-react-popout": "^1.0.0",
|
|
74
72
|
"@sproutsocial/seeds-react-portal": "^1.0.0",
|
|
73
|
+
"@sproutsocial/seeds-react-radio": "^1.0.0",
|
|
74
|
+
"@sproutsocial/seeds-react-switch": "^1.0.0",
|
|
75
75
|
"@sproutsocial/seeds-react-system-props": "^2.2.0",
|
|
76
|
-
"@sproutsocial/seeds-react-
|
|
76
|
+
"@sproutsocial/seeds-react-text": "^1.0.0",
|
|
77
77
|
"@sproutsocial/seeds-react-theme": "^1.0.0",
|
|
78
|
+
"@sproutsocial/seeds-react-theme-provider": "^1.0.0",
|
|
78
79
|
"@sproutsocial/seeds-react-utilities": "^3.0.0",
|
|
79
80
|
"@styled-system/theme-get": "^5.1.2",
|
|
80
81
|
"classnames": "^2.2.6",
|
|
81
82
|
"default-browser-id": "^3.0.0",
|
|
82
|
-
"flowgen": "^1.21.0",
|
|
83
83
|
"lodash.curry": "^4.1.1",
|
|
84
84
|
"lodash.uniqueid": "^4.0.1",
|
|
85
85
|
"lru-memoize": "~1.0.2",
|
|
@@ -89,8 +89,6 @@
|
|
|
89
89
|
"react-focus-lock": "^2.0.3",
|
|
90
90
|
"react-modal": "^3.16.1",
|
|
91
91
|
"react-popper": "^1.3.11",
|
|
92
|
-
"react-spring": "^8.0.25",
|
|
93
|
-
"react-toastify": "^6.0.5",
|
|
94
92
|
"regenerator-runtime": "^0.14.0",
|
|
95
93
|
"scroll-into-view-if-needed": "^2.2.20",
|
|
96
94
|
"styled-system": "^5.1.5",
|
|
@@ -108,7 +106,6 @@
|
|
|
108
106
|
"@babel/preset-typescript": "^7.22.5",
|
|
109
107
|
"@khanacademy/flow-to-ts": "^0.5.2",
|
|
110
108
|
"@sproutsocial/eslint-config-seeds": "*",
|
|
111
|
-
"@sproutsocial/seeds-typography": "*",
|
|
112
109
|
"@sproutsocial/seeds-border": "*",
|
|
113
110
|
"@sproutsocial/seeds-color": "*",
|
|
114
111
|
"@sproutsocial/seeds-depth": "*",
|
|
@@ -117,26 +114,29 @@
|
|
|
117
114
|
"@sproutsocial/seeds-motion": "*",
|
|
118
115
|
"@sproutsocial/seeds-networkcolor": "*",
|
|
119
116
|
"@sproutsocial/seeds-partner-logos": "*",
|
|
117
|
+
"@sproutsocial/seeds-react-checkbox": "*",
|
|
120
118
|
"@sproutsocial/seeds-react-testing-library": "*",
|
|
119
|
+
"@sproutsocial/seeds-react-theme": "*",
|
|
121
120
|
"@sproutsocial/seeds-space": "*",
|
|
122
121
|
"@sproutsocial/seeds-tsconfig": "*",
|
|
123
|
-
"@
|
|
124
|
-
"@storybook/addon-
|
|
125
|
-
"@storybook/addon-
|
|
126
|
-
"@storybook/addon-
|
|
127
|
-
"@storybook/addon-
|
|
128
|
-
"@storybook/
|
|
129
|
-
"@storybook/
|
|
130
|
-
"@storybook/
|
|
131
|
-
"@storybook/
|
|
132
|
-
"@storybook/react
|
|
133
|
-
"@storybook/
|
|
122
|
+
"@sproutsocial/seeds-typography": "*",
|
|
123
|
+
"@storybook/addon-a11y": "^7.6.20",
|
|
124
|
+
"@storybook/addon-actions": "^7.6.20",
|
|
125
|
+
"@storybook/addon-essentials": "^7.6.20",
|
|
126
|
+
"@storybook/addon-storysource": "^7.6.20",
|
|
127
|
+
"@storybook/addon-viewport": "^7.6.20",
|
|
128
|
+
"@storybook/addons": "^7.6.20",
|
|
129
|
+
"@storybook/cli": "^7.6.20",
|
|
130
|
+
"@storybook/client-api": "^7.6.20",
|
|
131
|
+
"@storybook/react": "^7.6.20",
|
|
132
|
+
"@storybook/react-webpack5": "^7.6.20",
|
|
133
|
+
"@storybook/theming": "^7.6.20",
|
|
134
134
|
"@testing-library/jest-dom": "^5.16.4",
|
|
135
135
|
"@testing-library/react": "^14.0.0",
|
|
136
136
|
"@testing-library/user-event": "^13.0.0",
|
|
137
|
-
"@types/jest": "^
|
|
137
|
+
"@types/jest": "^29.0.0",
|
|
138
138
|
"@types/jest-axe": "^3.5.5",
|
|
139
|
-
"@types/node": "^
|
|
139
|
+
"@types/node": "^20.0.0",
|
|
140
140
|
"@types/react": "^18.0.0",
|
|
141
141
|
"@types/react-dates": "^21.8.3",
|
|
142
142
|
"@types/react-dom": "^18.0.0",
|
|
@@ -146,14 +146,13 @@
|
|
|
146
146
|
"@typescript-eslint/eslint-plugin": "^6.3.0",
|
|
147
147
|
"@typescript-eslint/parser": "^6.3.0",
|
|
148
148
|
"babel-eslint": "^10.1.0",
|
|
149
|
-
"babel-jest": "29.
|
|
149
|
+
"babel-jest": "^29.7.0",
|
|
150
150
|
"babel-loader": "^9.1.3",
|
|
151
151
|
"babel-plugin-inline-import": "^3.0.0",
|
|
152
152
|
"babel-plugin-module-resolver": "^5.0.0",
|
|
153
153
|
"babel-plugin-polished": "^1.1.0",
|
|
154
154
|
"babel-plugin-styled-components": "^2.0.7",
|
|
155
|
-
"
|
|
156
|
-
"backstopjs": "6.3.3",
|
|
155
|
+
"backstopjs": "^6.3.23",
|
|
157
156
|
"chalk": "^2.3.2",
|
|
158
157
|
"chokidar": "^3.0.2",
|
|
159
158
|
"csstype": "^3.1.1",
|
|
@@ -168,14 +167,15 @@
|
|
|
168
167
|
"identity-obj-proxy": "^3.0.0",
|
|
169
168
|
"inquirer": "^6.4.1",
|
|
170
169
|
"is-glob": "^4.0.1",
|
|
171
|
-
"jest": "
|
|
170
|
+
"jest": "^29.7.0",
|
|
172
171
|
"jest-axe": "^6.0.0",
|
|
172
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
173
173
|
"jest-styled-components": "7.1.1",
|
|
174
174
|
"jscodeshift": "^0.13.0",
|
|
175
175
|
"jsdom": "^22.1.0",
|
|
176
176
|
"json-to-scss": "^1.6.2",
|
|
177
|
-
"moment": "^2.29.4",
|
|
178
177
|
"mkdirp": "1.0.4",
|
|
178
|
+
"moment": "^2.29.4",
|
|
179
179
|
"npm-run-all": "^4.1.2",
|
|
180
180
|
"outdent": "^0.7.0",
|
|
181
181
|
"pify": "^4.0.1",
|
|
@@ -185,19 +185,19 @@
|
|
|
185
185
|
"react-dates": "^21.8.0",
|
|
186
186
|
"react-docgen-typescript-plugin": "^1.0.5",
|
|
187
187
|
"react-dom": "^18.0.0",
|
|
188
|
+
"react-toastify": "^10.0.0",
|
|
188
189
|
"rimraf": "^2.6.3",
|
|
189
|
-
"storybook": "^7.
|
|
190
|
+
"storybook": "^7.6.20",
|
|
190
191
|
"storybook-dark-mode": "^3.0.1",
|
|
191
192
|
"styled-components": "^5.2.3",
|
|
192
193
|
"tsc-alias": "^1.8.2",
|
|
193
|
-
"typescript": "^5.
|
|
194
|
+
"typescript": "^5.6.2",
|
|
194
195
|
"webpack": "^5.88.2",
|
|
195
196
|
"webpack-cli": "^5.1.4",
|
|
196
197
|
"webpack-dev-server": "^5.0.4",
|
|
197
198
|
"ws": "^8.13.0"
|
|
198
199
|
},
|
|
199
200
|
"peerDependencies": {
|
|
200
|
-
"@sproutsocial/seeds-typography": "*",
|
|
201
201
|
"@sproutsocial/seeds-border": "*",
|
|
202
202
|
"@sproutsocial/seeds-color": "*",
|
|
203
203
|
"@sproutsocial/seeds-depth": "*",
|
|
@@ -206,12 +206,16 @@
|
|
|
206
206
|
"@sproutsocial/seeds-motion": "*",
|
|
207
207
|
"@sproutsocial/seeds-networkcolor": "*",
|
|
208
208
|
"@sproutsocial/seeds-partner-logos": "*",
|
|
209
|
+
"@sproutsocial/seeds-react-checkbox": "*",
|
|
210
|
+
"@sproutsocial/seeds-react-theme": "*",
|
|
209
211
|
"@sproutsocial/seeds-space": "*",
|
|
212
|
+
"@sproutsocial/seeds-typography": "*",
|
|
210
213
|
"moment": "^2.29.4",
|
|
211
214
|
"prop-types": "^15.0.0",
|
|
212
215
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
213
216
|
"react-dates": "^21.8.0",
|
|
214
217
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
218
|
+
"react-toastify": "^9.0.0 || ^10.0.0",
|
|
215
219
|
"styled-components": "^5.2.3"
|
|
216
220
|
},
|
|
217
221
|
"resolutions": {
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
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
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.SlideTransition = void 0;
|
|
8
|
-
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _reactSpring = require("react-spring");
|
|
10
|
-
var _seedsMotionUnitless = require("@sproutsocial/seeds-motion/dist/seeds-motion-unitless");
|
|
11
|
-
var _excluded = ["isVisible", "children", "width", "direction"];
|
|
12
|
-
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); }
|
|
13
|
-
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; }
|
|
14
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
15
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
16
|
-
var SlideTransition = exports.SlideTransition = function SlideTransition(_ref) {
|
|
17
|
-
var isVisible = _ref.isVisible,
|
|
18
|
-
children = _ref.children,
|
|
19
|
-
width = _ref.width,
|
|
20
|
-
direction = _ref.direction,
|
|
21
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
-
var offset = width * (direction === "left" ? -1 : 1);
|
|
23
|
-
var transitions = (0, _reactSpring.useTransition)(isVisible, null, {
|
|
24
|
-
from: {
|
|
25
|
-
transform: "translateX(".concat(offset, "px)")
|
|
26
|
-
},
|
|
27
|
-
enter: {
|
|
28
|
-
transform: "translateX(0)"
|
|
29
|
-
},
|
|
30
|
-
leave: {
|
|
31
|
-
transform: "translateX(".concat(offset, "px)")
|
|
32
|
-
},
|
|
33
|
-
config: {
|
|
34
|
-
duration: _seedsMotionUnitless.MOTION_DURATION_MEDIUM * 1000
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, transitions.map(function (_ref2) {
|
|
38
|
-
var key = _ref2.key,
|
|
39
|
-
item = _ref2.item,
|
|
40
|
-
props = _ref2.props;
|
|
41
|
-
return children({
|
|
42
|
-
key: key,
|
|
43
|
-
isVisible: item,
|
|
44
|
-
style: props
|
|
45
|
-
});
|
|
46
|
-
}));
|
|
47
|
-
};
|
|
@@ -1,313 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
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
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.Popout = Popout;
|
|
8
|
-
exports.placements = exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var React = _react;
|
|
11
|
-
var _reactSpring = require("react-spring");
|
|
12
|
-
var _reactFocusLock = _interopRequireDefault(require("react-focus-lock"));
|
|
13
|
-
var _reactPopper = require("react-popper");
|
|
14
|
-
var _seedsMotionUnitless = require("@sproutsocial/seeds-motion/dist/seeds-motion-unitless");
|
|
15
|
-
var _seedsReactHooks = require("@sproutsocial/seeds-react-hooks");
|
|
16
|
-
var _Portal = _interopRequireDefault(require("../Portal"));
|
|
17
|
-
var _Box = _interopRequireDefault(require("../Box"));
|
|
18
|
-
var _styles = require("./styles");
|
|
19
|
-
var _excluded = ["isOpen", "setIsOpen", "content", "children", "placement", "fullWidth", "zIndex", "focusOnContent", "onOpen", "onClose", "qa", "popperProps", "scheduleUpdateRef", "appendToBody", "focusLockProps", "color", "aria-haspopup", "disableWrapperAria", "id"],
|
|
20
|
-
_excluded2 = ["autoFocus", "returnFocus"],
|
|
21
|
-
_excluded3 = ["children"];
|
|
22
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
-
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); }
|
|
24
|
-
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; }
|
|
25
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
26
|
-
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; }
|
|
27
|
-
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; }
|
|
28
|
-
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; }
|
|
29
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
30
|
-
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); }
|
|
31
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
32
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
33
|
-
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); }
|
|
34
|
-
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; }
|
|
35
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
36
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
38
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
39
|
-
var placements = exports.placements = {
|
|
40
|
-
auto: "auto",
|
|
41
|
-
top: "top",
|
|
42
|
-
right: "right",
|
|
43
|
-
bottom: "bottom",
|
|
44
|
-
left: "left",
|
|
45
|
-
"top-start": "top-start",
|
|
46
|
-
"right-start": "right-start",
|
|
47
|
-
"bottom-start": "bottom-start",
|
|
48
|
-
"left-start": "left-start",
|
|
49
|
-
"top-end": "top-end",
|
|
50
|
-
"right-end": "right-end",
|
|
51
|
-
"bottom-end": "bottom-end",
|
|
52
|
-
"left-end": "left-end"
|
|
53
|
-
};
|
|
54
|
-
var doesRefContainEventTarget = function doesRefContainEventTarget(ref, event) {
|
|
55
|
-
return ref.current && event.target instanceof Node && ref.current.contains(event.target);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
// Transition definitions for fading in and out
|
|
59
|
-
var transitionConfig = {
|
|
60
|
-
from: {
|
|
61
|
-
opacity: 0
|
|
62
|
-
},
|
|
63
|
-
enter: {
|
|
64
|
-
opacity: 1
|
|
65
|
-
},
|
|
66
|
-
leave: {
|
|
67
|
-
opacity: 0
|
|
68
|
-
},
|
|
69
|
-
config: {
|
|
70
|
-
duration: _seedsMotionUnitless.MOTION_DURATION_FAST * 1000
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
function Popout(_ref) {
|
|
74
|
-
var _popoutRef$current;
|
|
75
|
-
var isOpen = _ref.isOpen,
|
|
76
|
-
setIsOpen = _ref.setIsOpen,
|
|
77
|
-
content = _ref.content,
|
|
78
|
-
children = _ref.children,
|
|
79
|
-
_ref$placement = _ref.placement,
|
|
80
|
-
placement = _ref$placement === void 0 ? "auto" : _ref$placement,
|
|
81
|
-
_ref$fullWidth = _ref.fullWidth,
|
|
82
|
-
fullWidth = _ref$fullWidth === void 0 ? false : _ref$fullWidth,
|
|
83
|
-
_ref$zIndex = _ref.zIndex,
|
|
84
|
-
zIndex = _ref$zIndex === void 0 ? 7 : _ref$zIndex,
|
|
85
|
-
_ref$focusOnContent = _ref.focusOnContent,
|
|
86
|
-
focusOnContent = _ref$focusOnContent === void 0 ? true : _ref$focusOnContent,
|
|
87
|
-
onOpen = _ref.onOpen,
|
|
88
|
-
onClose = _ref.onClose,
|
|
89
|
-
_ref$qa = _ref.qa,
|
|
90
|
-
qa = _ref$qa === void 0 ? {} : _ref$qa,
|
|
91
|
-
popperProps = _ref.popperProps,
|
|
92
|
-
_ref$scheduleUpdateRe = _ref.scheduleUpdateRef,
|
|
93
|
-
scheduleUpdateRef = _ref$scheduleUpdateRe === void 0 ? function () {} : _ref$scheduleUpdateRe,
|
|
94
|
-
_ref$appendToBody = _ref.appendToBody,
|
|
95
|
-
appendToBody = _ref$appendToBody === void 0 ? true : _ref$appendToBody,
|
|
96
|
-
_ref$focusLockProps = _ref.focusLockProps,
|
|
97
|
-
focusLockProps = _ref$focusLockProps === void 0 ? {} : _ref$focusLockProps,
|
|
98
|
-
color = _ref.color,
|
|
99
|
-
ariaHasPopup = _ref["aria-haspopup"],
|
|
100
|
-
_ref$disableWrapperAr = _ref.disableWrapperAria,
|
|
101
|
-
disableWrapperAria = _ref$disableWrapperAr === void 0 ? false : _ref$disableWrapperAr,
|
|
102
|
-
id = _ref.id,
|
|
103
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
104
|
-
var PopoutComponentWrapper = appendToBody ? _Portal.default : React.Fragment;
|
|
105
|
-
var _useState = (0, _react.useState)(false),
|
|
106
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
107
|
-
isInternalShown = _useState2[0],
|
|
108
|
-
setIsInternalShown = _useState2[1];
|
|
109
|
-
var isControlled = typeof isOpen === "boolean";
|
|
110
|
-
var isShown = isControlled ? isOpen : isInternalShown;
|
|
111
|
-
var setIsShown = (0, _react.useMemo)(function () {
|
|
112
|
-
return isControlled && setIsOpen ? setIsOpen : function (nextIsShown) {
|
|
113
|
-
return setIsInternalShown(nextIsShown);
|
|
114
|
-
};
|
|
115
|
-
}, [isControlled, setIsOpen]);
|
|
116
|
-
var targetRef = (0, _react.useRef)();
|
|
117
|
-
var popoutRef = (0, _react.useRef)();
|
|
118
|
-
var isFirstRender = (0, _react.useRef)(true);
|
|
119
|
-
|
|
120
|
-
// This callback will automatically trigger a recalculation of the popout position if the content is changed
|
|
121
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
122
|
-
var scheduleUpdateCallback = (0, _react.useRef)(function () {});
|
|
123
|
-
(0, _seedsReactHooks.useMutationObserver)((_popoutRef$current = popoutRef.current) !== null && _popoutRef$current !== void 0 ? _popoutRef$current : null, {
|
|
124
|
-
childList: true,
|
|
125
|
-
characterData: true,
|
|
126
|
-
subtree: true
|
|
127
|
-
}, scheduleUpdateCallback.current);
|
|
128
|
-
var _focusLockProps$autoF = focusLockProps.autoFocus,
|
|
129
|
-
autoFocus = _focusLockProps$autoF === void 0 ? true : _focusLockProps$autoF,
|
|
130
|
-
_focusLockProps$retur = focusLockProps.returnFocus,
|
|
131
|
-
returnFocus = _focusLockProps$retur === void 0 ? true : _focusLockProps$retur,
|
|
132
|
-
restFocusLockProps = _objectWithoutProperties(focusLockProps, _excluded2);
|
|
133
|
-
var isInvalidContent = content === null || content === undefined;
|
|
134
|
-
|
|
135
|
-
// Callbacks for showing, hiding, and toggling visibility of the popout
|
|
136
|
-
// (Not used when isOpen is passed explicitly)
|
|
137
|
-
var show = (0, _react.useCallback)(function () {
|
|
138
|
-
return setIsShown(true);
|
|
139
|
-
}, [setIsShown]);
|
|
140
|
-
var hide = (0, _react.useCallback)(function () {
|
|
141
|
-
return setIsShown(false);
|
|
142
|
-
}, [setIsShown]);
|
|
143
|
-
var toggle = (0, _react.useCallback)(function () {
|
|
144
|
-
return setIsShown(!isShown);
|
|
145
|
-
}, [isShown, setIsShown]);
|
|
146
|
-
(0, _react.useEffect)(function () {
|
|
147
|
-
var documentBody = document.body;
|
|
148
|
-
if (isShown && documentBody) {
|
|
149
|
-
// Callback passed to a click handler attached to document.body,
|
|
150
|
-
// allowing user to close the popout by clicking outside
|
|
151
|
-
var bodyClick = function bodyClick(e) {
|
|
152
|
-
if (doesRefContainEventTarget(targetRef, e) || doesRefContainEventTarget(popoutRef, e)) {
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
setIsShown(false, e);
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
// Callback for allowing user to close by keying "esc"
|
|
159
|
-
var onEsc = function onEsc(e) {
|
|
160
|
-
// older browsers use "Esc"
|
|
161
|
-
if (["Escape", "Esc"].includes(e.key)) {
|
|
162
|
-
// stop propagation to avoid interacting with other components when popout is shown
|
|
163
|
-
// ie if we have a popout shown in a modal and hit esc, we don't want to close both the popout and modal
|
|
164
|
-
e.stopPropagation();
|
|
165
|
-
setIsShown(false, e);
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
documentBody.addEventListener("click", bodyClick, {
|
|
169
|
-
capture: true
|
|
170
|
-
});
|
|
171
|
-
documentBody.addEventListener("keydown", onEsc, {
|
|
172
|
-
capture: true
|
|
173
|
-
});
|
|
174
|
-
return function () {
|
|
175
|
-
documentBody.removeEventListener("click", bodyClick, {
|
|
176
|
-
capture: true
|
|
177
|
-
});
|
|
178
|
-
documentBody.removeEventListener("keydown", onEsc, {
|
|
179
|
-
capture: true
|
|
180
|
-
});
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
}, [isShown, setIsShown]);
|
|
184
|
-
|
|
185
|
-
// Manage onOpen and onClose callbacks
|
|
186
|
-
(0, _react.useEffect)(function () {
|
|
187
|
-
// Don't fire onClose on the first render
|
|
188
|
-
if (isFirstRender.current) {
|
|
189
|
-
isFirstRender.current = false;
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
if (!onOpen && !onClose) {
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
if (isShown && onOpen) {
|
|
196
|
-
onOpen();
|
|
197
|
-
}
|
|
198
|
-
if (!isShown && onClose) {
|
|
199
|
-
onClose();
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
// eslint-disable-next-line
|
|
203
|
-
[isShown]);
|
|
204
|
-
var transitions = (0, _reactSpring.useTransition)(isShown, null, transitionConfig);
|
|
205
|
-
// WAI-Aria properties for the popout trigger, disabled if necessary
|
|
206
|
-
var ariaProps = (0, _react.useMemo)(function () {
|
|
207
|
-
return disableWrapperAria ? {} : {
|
|
208
|
-
"aria-expanded": isShown,
|
|
209
|
-
"aria-haspopup": ariaHasPopup ? ariaHasPopup : true
|
|
210
|
-
};
|
|
211
|
-
}, [isShown, ariaHasPopup, disableWrapperAria]);
|
|
212
|
-
|
|
213
|
-
// In cases where a controlled popout is used (e.g. props.isOpen is true), we need
|
|
214
|
-
// to wait for the targetRef to receive a value before rendering the popout. Otherwise,
|
|
215
|
-
// the Popout component renders, but doesn't know how to position itself due the
|
|
216
|
-
// `refereElement` property being undefined.
|
|
217
|
-
var _useState3 = (0, _react.useState)(
|
|
218
|
-
// Only trigger this shouldRenderPopout logic when using a controlled component.
|
|
219
|
-
// The reason for that is because controlled components may render the popout
|
|
220
|
-
// immediately before the targetRef has a value set to it.
|
|
221
|
-
!isControlled),
|
|
222
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
223
|
-
shouldRenderPopout = _useState4[0],
|
|
224
|
-
setShouldRenderPopout = _useState4[1];
|
|
225
|
-
var childrenRef = function childrenRef(el) {
|
|
226
|
-
targetRef.current = el;
|
|
227
|
-
if (targetRef.current) {
|
|
228
|
-
setShouldRenderPopout(true);
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, typeof children === "function" ? children({
|
|
232
|
-
ref: childrenRef,
|
|
233
|
-
toggle: toggle,
|
|
234
|
-
show: show,
|
|
235
|
-
hide: hide,
|
|
236
|
-
ariaProps: ariaProps
|
|
237
|
-
}) : /*#__PURE__*/React.createElement(_styles.TargetWrapper, _extends({}, qa, {
|
|
238
|
-
id: id
|
|
239
|
-
}, rest, {
|
|
240
|
-
ref: childrenRef
|
|
241
|
-
}), /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, ariaProps), !isControlled ? {
|
|
242
|
-
onClick: toggle
|
|
243
|
-
} : undefined))), shouldRenderPopout && !isInvalidContent && transitions.map(function (_ref2) {
|
|
244
|
-
var item = _ref2.item,
|
|
245
|
-
key = _ref2.key,
|
|
246
|
-
props = _ref2.props;
|
|
247
|
-
return item && /*#__PURE__*/React.createElement(PopoutComponentWrapper, {
|
|
248
|
-
key: key
|
|
249
|
-
}, /*#__PURE__*/React.createElement(_reactPopper.Popper, _extends({
|
|
250
|
-
referenceElement: targetRef.current,
|
|
251
|
-
placement: placement,
|
|
252
|
-
modifiers: {
|
|
253
|
-
preventOverflow: {
|
|
254
|
-
boundariesElement: "viewport"
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}, popperProps), function (_ref3) {
|
|
258
|
-
var ref = _ref3.ref,
|
|
259
|
-
style = _ref3.style,
|
|
260
|
-
placement = _ref3.placement,
|
|
261
|
-
outOfBoundaries = _ref3.outOfBoundaries,
|
|
262
|
-
scheduleUpdate = _ref3.scheduleUpdate;
|
|
263
|
-
var interceptRef = function interceptRef(el) {
|
|
264
|
-
popoutRef.current = el;
|
|
265
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
266
|
-
// @ts-ignore
|
|
267
|
-
ref(el);
|
|
268
|
-
};
|
|
269
|
-
scheduleUpdateCallback.current = scheduleUpdate;
|
|
270
|
-
scheduleUpdateRef(scheduleUpdate);
|
|
271
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
272
|
-
ref: interceptRef,
|
|
273
|
-
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
274
|
-
zIndex: zIndex,
|
|
275
|
-
width: fullWidth && targetRef.current ? targetRef.current.offsetWidth : "initial"
|
|
276
|
-
}),
|
|
277
|
-
"data-placement": placement,
|
|
278
|
-
"data-qa-popout": "",
|
|
279
|
-
"data-qa-popout-isopen": isOpen === true
|
|
280
|
-
// TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.
|
|
281
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
282
|
-
// @ts-ignore
|
|
283
|
-
,
|
|
284
|
-
color: color
|
|
285
|
-
}, rest), item && !outOfBoundaries && /*#__PURE__*/React.createElement(_reactSpring.animated.div, {
|
|
286
|
-
style: props
|
|
287
|
-
}, /*#__PURE__*/React.createElement(_reactFocusLock.default, _extends({
|
|
288
|
-
autoFocus: autoFocus,
|
|
289
|
-
returnFocus: returnFocus,
|
|
290
|
-
disabled: !focusOnContent
|
|
291
|
-
}, restFocusLockProps), typeof content === "function" && content({
|
|
292
|
-
hide: hide
|
|
293
|
-
}), typeof content !== "function" && content)));
|
|
294
|
-
}));
|
|
295
|
-
}));
|
|
296
|
-
}
|
|
297
|
-
var PopoutContent = function PopoutContent(_ref4) {
|
|
298
|
-
var children = _ref4.children,
|
|
299
|
-
rest = _objectWithoutProperties(_ref4, _excluded3);
|
|
300
|
-
return /*#__PURE__*/React.createElement(_Box.default, _extends({
|
|
301
|
-
bg: "container.background.base",
|
|
302
|
-
color: "text.body",
|
|
303
|
-
border: 500,
|
|
304
|
-
borderColor: "container.border.base",
|
|
305
|
-
borderRadius: "outer",
|
|
306
|
-
boxShadow: "medium",
|
|
307
|
-
p: 400,
|
|
308
|
-
m: 300
|
|
309
|
-
}, rest), children);
|
|
310
|
-
};
|
|
311
|
-
PopoutContent.displayName = "Popout.Content";
|
|
312
|
-
Popout.Content = PopoutContent;
|
|
313
|
-
var _default = exports.default = Popout;
|
package/commonjs/Popout/index.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _exportNames = {
|
|
7
|
-
Popout: true
|
|
8
|
-
};
|
|
9
|
-
Object.defineProperty(exports, "Popout", {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function get() {
|
|
12
|
-
return _Popout.default;
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
exports.default = void 0;
|
|
16
|
-
var _Popout = _interopRequireDefault(require("./Popout"));
|
|
17
|
-
var _PopoutTypes = require("./PopoutTypes");
|
|
18
|
-
Object.keys(_PopoutTypes).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
21
|
-
if (key in exports && exports[key] === _PopoutTypes[key]) return;
|
|
22
|
-
Object.defineProperty(exports, key, {
|
|
23
|
-
enumerable: true,
|
|
24
|
-
get: function get() {
|
|
25
|
-
return _PopoutTypes[key];
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
30
|
-
var _default = exports.default = _Popout.default;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.TargetWrapper = void 0;
|
|
7
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
-
var _seedsReactSystemProps = require("@sproutsocial/seeds-react-system-props");
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
var TargetWrapper = exports.TargetWrapper = _styledComponents.default.div.withConfig({
|
|
11
|
-
displayName: "styles__TargetWrapper",
|
|
12
|
-
componentId: "sc-pftzv7-0"
|
|
13
|
-
})(["display:inline-block;", " ", ""], _seedsReactSystemProps.COMMON, _seedsReactSystemProps.LAYOUT);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { AnimatedValue, ForwardedProps } from "react-spring";
|
|
3
|
-
type TypeProps = {
|
|
4
|
-
children: (arg0: {
|
|
5
|
-
style: AnimatedValue<ForwardedProps<ForwardedProps<React.CSSProperties>>>;
|
|
6
|
-
key: number | string;
|
|
7
|
-
isVisible: boolean;
|
|
8
|
-
}) => React.ReactNode;
|
|
9
|
-
isVisible: boolean;
|
|
10
|
-
width: number;
|
|
11
|
-
direction: "left" | "right";
|
|
12
|
-
};
|
|
13
|
-
export declare const SlideTransition: ({ isVisible, children, width, direction, ...rest }: TypeProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=SlideTransition.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SlideTransition.d.ts","sourceRoot":"","sources":["../../../src/Drawer/SlideTransition.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAiB,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG5E,KAAK,SAAS,GAAG;IACf,QAAQ,EAAE,CAAC,IAAI,EAAE;QACf,KAAK,EAAE,aAAa,CAAC,cAAc,CAAC,cAAc,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QAC1E,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;QACrB,SAAS,EAAE,OAAO,CAAC;KACpB,KAAK,KAAK,CAAC,SAAS,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,eAAe,uDAOzB,SAAS,4CA4BX,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { TypeBoxProps } from "../Box";
|
|
2
|
-
import type { TypePopoutProps, EnumPlacements } from "./PopoutTypes";
|
|
3
|
-
export declare const placements: {
|
|
4
|
-
[key: string]: EnumPlacements;
|
|
5
|
-
};
|
|
6
|
-
export declare function Popout({ isOpen, setIsOpen, content, children, placement, fullWidth, zIndex, focusOnContent, onOpen, onClose, qa, popperProps, scheduleUpdateRef, appendToBody, focusLockProps, color, "aria-haspopup": ariaHasPopup, disableWrapperAria, id, ...rest }: TypePopoutProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export declare namespace Popout {
|
|
8
|
-
var Content: {
|
|
9
|
-
({ children, ...rest }: TypeBoxProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
displayName: string;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
export default Popout;
|
|
14
|
-
//# sourceMappingURL=Popout.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Popout.d.ts","sourceRoot":"","sources":["../../../src/Popout/Popout.tsx"],"names":[],"mappings":"AAQA,OAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAErE,eAAO,MAAM,UAAU,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;CAiBvD,CAAC;AA0BF,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,SAAS,EACT,OAAO,EACP,QAAQ,EACR,SAAkB,EAClB,SAAiB,EACjB,MAAU,EACV,cAAqB,EACrB,MAAM,EACN,OAAO,EACP,EAAO,EACP,WAAW,EAEX,iBAA4B,EAC5B,YAAmB,EACnB,cAAmB,EACnB,KAAK,EACL,eAAe,EAAE,YAAY,EAC7B,kBAA0B,EAC1B,EAAE,EACF,GAAG,IAAI,EACR,EAAE,eAAe,2CA+OjB;yBArQe,MAAM;;;;;;AA0RtB,eAAe,MAAM,CAAC"}
|