@sproutsocial/racine 21.0.2 → 22.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/__flow__/TableCell/TableCell.flow.js +2 -0
  3. package/__flow__/types/theme.colors.flow.js +6 -0
  4. package/commonjs/Badge/styles.js +2 -2
  5. package/commonjs/Banner/styles.js +2 -2
  6. package/commonjs/Box/styles.js +2 -2
  7. package/commonjs/Button/styles.js +6 -6
  8. package/commonjs/Card/styles.js +4 -4
  9. package/commonjs/Card/utils.js +2 -2
  10. package/commonjs/CharacterCounter/styles.js +2 -2
  11. package/commonjs/ChartLegend/styles.js +3 -3
  12. package/commonjs/Checkbox/styles.js +7 -6
  13. package/commonjs/Collapsible/Collapsible.js +3 -1
  14. package/commonjs/DatePicker/styles.js +2 -2
  15. package/commonjs/Drawer/styles.js +2 -2
  16. package/commonjs/FormField/FormField.js +3 -3
  17. package/commonjs/Icon/styles.js +2 -2
  18. package/commonjs/Image/styles.js +2 -2
  19. package/commonjs/Indicator/styles.js +3 -3
  20. package/commonjs/Input/Input.js +2 -2
  21. package/commonjs/Input/styles.js +4 -4
  22. package/commonjs/KeyboardKey/styles.js +2 -2
  23. package/commonjs/Link/styles.js +5 -5
  24. package/commonjs/Loader/styles.js +4 -4
  25. package/commonjs/Menu/Menu.js +4 -4
  26. package/commonjs/Menu/styles.js +3 -3
  27. package/commonjs/Message/styles.js +3 -3
  28. package/commonjs/Modal/styles.js +2 -2
  29. package/commonjs/PartnerLogo/styles.js +2 -2
  30. package/commonjs/Popout/Popout.js +2 -2
  31. package/commonjs/Popout/styles.js +2 -2
  32. package/commonjs/Portal/Portal.js +4 -4
  33. package/commonjs/Radio/styles.js +5 -5
  34. package/commonjs/SegmentedControl/styles.js +4 -4
  35. package/commonjs/Select/styles.js +4 -4
  36. package/commonjs/Switch/styles.js +2 -2
  37. package/commonjs/Table/styles.js +2 -2
  38. package/commonjs/TableCell/TableCell.js +5 -1
  39. package/commonjs/TableCell/styles.js +2 -2
  40. package/commonjs/TableHeaderCell/styles.js +2 -2
  41. package/commonjs/TableRowAccordion/styles.js +2 -2
  42. package/commonjs/Tabs/styles.js +2 -2
  43. package/commonjs/Text/styles.js +2 -2
  44. package/commonjs/Textarea/styles.js +4 -4
  45. package/commonjs/ThemeProvider/index.js +2 -3
  46. package/commonjs/ToggleHint/styles.js +4 -4
  47. package/commonjs/Token/Token.js +2 -2
  48. package/commonjs/Token/styles.js +4 -4
  49. package/commonjs/TokenInput/styles.js +4 -4
  50. package/commonjs/VisuallyHidden/VisuallyHidden.js +2 -2
  51. package/commonjs/index.js +37 -68
  52. package/commonjs/themes/light/theme.js +7 -1
  53. package/commonjs/types/index.js +4 -15
  54. package/commonjs/utils/hooks.js +2 -2
  55. package/commonjs/utils/mixins.js +3 -4
  56. package/commonjs/utils/react-testing-library.js +2 -2
  57. package/commonjs/utils/responsiveProps/index.js +2 -3
  58. package/dist/types/Badge/BadgeTypes.d.ts +1 -1
  59. package/dist/types/Badge/BadgeTypes.d.ts.map +1 -1
  60. package/dist/types/Banner/BannerTypes.d.ts +1 -1
  61. package/dist/types/Banner/BannerTypes.d.ts.map +1 -1
  62. package/dist/types/Box/BoxTypes.d.ts +1 -1
  63. package/dist/types/Box/BoxTypes.d.ts.map +1 -1
  64. package/dist/types/Breadcrumb/BreadcrumbTypes.d.ts +1 -1
  65. package/dist/types/Breadcrumb/BreadcrumbTypes.d.ts.map +1 -1
  66. package/dist/types/Button/ButtonTypes.d.ts +1 -1
  67. package/dist/types/Button/ButtonTypes.d.ts.map +1 -1
  68. package/dist/types/CharacterCounter/CharacterCounterTypes.d.ts +1 -1
  69. package/dist/types/CharacterCounter/CharacterCounterTypes.d.ts.map +1 -1
  70. package/dist/types/ChartLegend/ChartLegendTypes.d.ts +1 -1
  71. package/dist/types/ChartLegend/ChartLegendTypes.d.ts.map +1 -1
  72. package/dist/types/ChartLegend/styles.d.ts +1 -1
  73. package/dist/types/ChartLegend/styles.d.ts.map +1 -1
  74. package/dist/types/Checkbox/CheckboxTypes.d.ts +1 -1
  75. package/dist/types/Checkbox/CheckboxTypes.d.ts.map +1 -1
  76. package/dist/types/Checkbox/styles.d.ts.map +1 -1
  77. package/dist/types/Collapsible/Collapsible.d.ts.map +1 -1
  78. package/dist/types/Drawer/DrawerTypes.d.ts +1 -1
  79. package/dist/types/Drawer/DrawerTypes.d.ts.map +1 -1
  80. package/dist/types/Drawer/styles.d.ts +1 -1
  81. package/dist/types/Drawer/styles.d.ts.map +1 -1
  82. package/dist/types/Icon/IconTypes.d.ts +1 -1
  83. package/dist/types/Icon/IconTypes.d.ts.map +1 -1
  84. package/dist/types/Image/ImageTypes.d.ts +1 -1
  85. package/dist/types/Image/ImageTypes.d.ts.map +1 -1
  86. package/dist/types/Indicator/IndicatorTypes.d.ts +1 -1
  87. package/dist/types/Indicator/IndicatorTypes.d.ts.map +1 -1
  88. package/dist/types/Input/InputTypes.d.ts +1 -1
  89. package/dist/types/Input/InputTypes.d.ts.map +1 -1
  90. package/dist/types/KeyboardKey/KeyboardKeyTypes.d.ts +1 -1
  91. package/dist/types/KeyboardKey/KeyboardKeyTypes.d.ts.map +1 -1
  92. package/dist/types/Link/LinkTypes.d.ts +1 -1
  93. package/dist/types/Link/LinkTypes.d.ts.map +1 -1
  94. package/dist/types/Listbox/Listbox.d.ts +1 -1
  95. package/dist/types/Loader/LoaderTypes.d.ts +1 -1
  96. package/dist/types/Loader/LoaderTypes.d.ts.map +1 -1
  97. package/dist/types/PartnerLogo/PartnerLogoTypes.d.ts +1 -1
  98. package/dist/types/PartnerLogo/PartnerLogoTypes.d.ts.map +1 -1
  99. package/dist/types/Popout/PopoutTypes.d.ts +1 -1
  100. package/dist/types/Popout/PopoutTypes.d.ts.map +1 -1
  101. package/dist/types/Radio/RadioTypes.d.ts +1 -1
  102. package/dist/types/Radio/RadioTypes.d.ts.map +1 -1
  103. package/dist/types/Select/SelectTypes.d.ts +2 -2
  104. package/dist/types/Select/SelectTypes.d.ts.map +1 -1
  105. package/dist/types/Stack/StackTypes.d.ts +1 -1
  106. package/dist/types/Stack/StackTypes.d.ts.map +1 -1
  107. package/dist/types/Table/TableTypes.d.ts +1 -1
  108. package/dist/types/Table/TableTypes.d.ts.map +1 -1
  109. package/dist/types/TableCell/TableCell.d.ts.map +1 -1
  110. package/dist/types/TableCell/TableCellTypes.d.ts +3 -1
  111. package/dist/types/TableCell/TableCellTypes.d.ts.map +1 -1
  112. package/dist/types/TableRowAccordion/TableRowAccordionTypes.d.ts +1 -1
  113. package/dist/types/TableRowAccordion/TableRowAccordionTypes.d.ts.map +1 -1
  114. package/dist/types/Tabs/TabsTypes.d.ts +1 -1
  115. package/dist/types/Tabs/TabsTypes.d.ts.map +1 -1
  116. package/dist/types/Text/TextTypes.d.ts +1 -1
  117. package/dist/types/Text/TextTypes.d.ts.map +1 -1
  118. package/dist/types/Textarea/TextareaTypes.d.ts +1 -1
  119. package/dist/types/Textarea/TextareaTypes.d.ts.map +1 -1
  120. package/dist/types/ThemeProvider/index.d.ts +1 -1
  121. package/dist/types/ThemeProvider/index.d.ts.map +1 -1
  122. package/dist/types/Toast/ToastTypes.d.ts +1 -1
  123. package/dist/types/Toast/ToastTypes.d.ts.map +1 -1
  124. package/dist/types/Toast/styles.d.ts +1 -1
  125. package/dist/types/Toast/styles.d.ts.map +1 -1
  126. package/dist/types/ToggleHint/ToggleHintTypes.d.ts +1 -1
  127. package/dist/types/ToggleHint/ToggleHintTypes.d.ts.map +1 -1
  128. package/dist/types/Token/TokenTypes.d.ts +1 -1
  129. package/dist/types/Token/TokenTypes.d.ts.map +1 -1
  130. package/dist/types/TokenInput/TokenInputTypes.d.ts +1 -1
  131. package/dist/types/TokenInput/TokenInputTypes.d.ts.map +1 -1
  132. package/dist/types/index.d.ts +5 -10
  133. package/dist/types/index.d.ts.map +1 -1
  134. package/dist/types/systemProps/index.d.ts +1 -1
  135. package/dist/types/systemProps/index.d.ts.map +1 -1
  136. package/dist/types/themes/dark/theme.d.ts +6 -0
  137. package/dist/types/themes/dark/theme.d.ts.map +1 -1
  138. package/dist/types/themes/light/theme.d.ts +6 -0
  139. package/dist/types/themes/light/theme.d.ts.map +1 -1
  140. package/dist/types/types/index.d.ts +1 -2
  141. package/dist/types/types/index.d.ts.map +1 -1
  142. package/dist/types/types/styled-components.d.ts +1 -1
  143. package/dist/types/types/styled-components.d.ts.map +1 -1
  144. package/dist/types/types/system-props.d.ts +28 -1
  145. package/dist/types/types/system-props.d.ts.map +1 -1
  146. package/dist/types/types/theme.colors.d.ts +6 -0
  147. package/dist/types/types/theme.colors.d.ts.map +1 -1
  148. package/dist/types/utils/responsiveProps/index.d.ts +1 -1
  149. package/dist/types/utils/responsiveProps/index.d.ts.map +1 -1
  150. package/lib/Badge/styles.js +1 -1
  151. package/lib/Banner/styles.js +1 -1
  152. package/lib/Box/styles.js +1 -1
  153. package/lib/Button/styles.js +2 -2
  154. package/lib/Card/styles.js +1 -1
  155. package/lib/Card/utils.js +1 -1
  156. package/lib/CharacterCounter/styles.js +1 -1
  157. package/lib/ChartLegend/styles.js +1 -1
  158. package/lib/Checkbox/styles.js +3 -2
  159. package/lib/Collapsible/Collapsible.js +3 -1
  160. package/lib/DatePicker/styles.js +1 -1
  161. package/lib/Drawer/styles.js +1 -1
  162. package/lib/FormField/FormField.js +1 -1
  163. package/lib/Icon/styles.js +1 -1
  164. package/lib/Image/styles.js +1 -1
  165. package/lib/Indicator/styles.js +2 -2
  166. package/lib/Input/Input.js +1 -1
  167. package/lib/Input/styles.js +2 -2
  168. package/lib/KeyboardKey/styles.js +1 -1
  169. package/lib/Link/styles.js +2 -2
  170. package/lib/Loader/styles.js +2 -2
  171. package/lib/Menu/Menu.js +2 -2
  172. package/lib/Menu/styles.js +1 -1
  173. package/lib/Message/styles.js +1 -1
  174. package/lib/Modal/styles.js +1 -1
  175. package/lib/PartnerLogo/styles.js +1 -1
  176. package/lib/Popout/Popout.js +1 -1
  177. package/lib/Popout/styles.js +1 -1
  178. package/lib/Portal/Portal.js +1 -1
  179. package/lib/Radio/styles.js +2 -2
  180. package/lib/SegmentedControl/styles.js +1 -1
  181. package/lib/Select/styles.js +2 -2
  182. package/lib/Switch/styles.js +1 -1
  183. package/lib/Table/styles.js +1 -1
  184. package/lib/TableCell/TableCell.js +5 -1
  185. package/lib/TableCell/styles.js +1 -1
  186. package/lib/TableHeaderCell/styles.js +1 -1
  187. package/lib/TableRowAccordion/styles.js +1 -1
  188. package/lib/Tabs/styles.js +1 -1
  189. package/lib/Text/styles.js +1 -1
  190. package/lib/Textarea/styles.js +2 -2
  191. package/lib/ThemeProvider/index.js +1 -1
  192. package/lib/ToggleHint/styles.js +2 -2
  193. package/lib/Token/Token.js +1 -1
  194. package/lib/Token/styles.js +2 -2
  195. package/lib/TokenInput/styles.js +2 -2
  196. package/lib/VisuallyHidden/VisuallyHidden.js +1 -1
  197. package/lib/index.js +5 -9
  198. package/lib/themes/light/theme.js +7 -1
  199. package/lib/types/index.js +1 -2
  200. package/lib/utils/hooks.js +1 -1
  201. package/lib/utils/mixins.js +1 -1
  202. package/lib/utils/react-testing-library.js +1 -1
  203. package/lib/utils/responsiveProps/index.js +1 -1
  204. package/package.json +16 -1
  205. package/dist/themes/dark/_themed.scss +0 -119
  206. package/dist/themes/dark/theme.scss +0 -678
  207. package/dist/themes/extendedThemes/sproutTheme/dark/_themed.scss +0 -119
  208. package/dist/themes/extendedThemes/sproutTheme/dark/theme.scss +0 -1091
  209. package/dist/themes/extendedThemes/sproutTheme/light/_themed.scss +0 -119
  210. package/dist/themes/extendedThemes/sproutTheme/light/theme.scss +0 -1091
  211. package/dist/themes/light/_themed.scss +0 -119
  212. package/dist/themes/light/theme.scss +0 -800
@@ -10,7 +10,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
10
10
  import { act, cleanup, createEvent, fireEvent, queries, render, screen as defaultScreen, waitFor, waitForElementToBeRemoved, within } from "@testing-library/react";
11
11
  import userEvent from "@testing-library/user-event";
12
12
  import ThemeProvider from "../ThemeProvider";
13
- import { a11yCheck } from "./a11yTest";
13
+ import { a11yCheck } from "@sproutsocial/seeds-react-utilities";
14
14
  import { dataQaLabelQueries } from "./dataQaLabelQueries";
15
15
  var sproutQueries = _objectSpread(_objectSpread({}, queries), dataQaLabelQueries);
16
16
 
@@ -5,7 +5,7 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
5
5
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
6
  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; }
7
7
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
8
- import theme from "../../themes/light/theme";
8
+ import { theme } from "@sproutsocial/seeds-react-theme";
9
9
  var breakpoints = theme.breakpoints;
10
10
  var LENGTH = breakpoints.length + 1;
11
11
  export var normalizeResponsiveProp = function normalizeResponsiveProp(value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/racine",
3
- "version": "21.0.2",
3
+ "version": "22.0.0",
4
4
  "license": "MIT",
5
5
  "engines": {
6
6
  "node": ">=18"
@@ -100,6 +100,13 @@
100
100
  "@sproutsocial/seeds-space": "*",
101
101
  "@sproutsocial/seeds-tsconfig": "*",
102
102
  "@sproutsocial/seeds-typography": "*",
103
+ "@sproutsocial/seeds-react-box": "*",
104
+ "@sproutsocial/seeds-react-hooks": "*",
105
+ "@sproutsocial/seeds-react-mixins": "*",
106
+ "@sproutsocial/seeds-react-system-props": "*",
107
+ "@sproutsocial/seeds-react-theme-provider": "*",
108
+ "@sproutsocial/seeds-react-theme": "*",
109
+ "@sproutsocial/seeds-react-utilities": "*",
103
110
  "@storybook/addon-a11y": "^7.0.0",
104
111
  "@storybook/addon-actions": "^7.0.0",
105
112
  "@storybook/addon-essentials": "^7.0.0",
@@ -155,6 +162,7 @@
155
162
  "jsdom": "^22.1.0",
156
163
  "json-to-scss": "^1.6.2",
157
164
  "moment": "^2.29.4",
165
+ "mkdirp": "1.0.4",
158
166
  "npm-run-all": "^4.1.2",
159
167
  "outdent": "^0.7.0",
160
168
  "pify": "^4.0.1",
@@ -186,6 +194,13 @@
186
194
  "@sproutsocial/seeds-typography": ">=2.0.0",
187
195
  "@sproutsocial/seeds-partner-logos": ">=1.5.0",
188
196
  "@sproutsocial/seeds-illustrations": ">=1.3.0",
197
+ "@sproutsocial/seeds-react-box": "^1.0.0",
198
+ "@sproutsocial/seeds-react-hooks": "^2.0.0",
199
+ "@sproutsocial/seeds-react-mixins": "^2.0.0",
200
+ "@sproutsocial/seeds-react-system-props": "^2.0.0",
201
+ "@sproutsocial/seeds-react-theme-provider": "^1.0.0",
202
+ "@sproutsocial/seeds-react-theme": "^1.0.0",
203
+ "@sproutsocial/seeds-react-utilities": "^2.0.0",
189
204
  "moment": "^2.29.4",
190
205
  "prop-types": "^15.0.0",
191
206
  "react": "^16.8.0 || ^17.0.0",
@@ -1,119 +0,0 @@
1
- // Inspired by https://medium.com/@katiemctigue/how-to-create-a-dark-mode-in-sass-609f131a3995
2
- // This file is excluded from stylelint, because stylelint is only set up to lint styled-components at the moment.
3
-
4
- // SET-UP
5
- // theme.scss is auto-generated based on the JS theme file, ensuring our SCSS theme variables stay in sync.
6
- // _themed.scss will be copied to each theme folder in /dist, where the theme.scss file for that theme will be.
7
- @import "./theme.scss";
8
-
9
- // In the JS theme file, the theme object is exported as "default" (i.e., using "export default"),
10
- // so we need to map-get "default" to access it.
11
- $theme: map-get($theme, "default");
12
-
13
- // FUNCTIONS
14
- // This function will allow you to get any value from the theme.
15
- // @param {string} $key - the period-separated path to the value in the theme object. e.g., "colors.text.body"
16
- @function t($key) {
17
- $keys: _str-split($key, ".");
18
- @return _map-deep-get($theme, $keys);
19
- }
20
-
21
- // The rest of the functions are convenience methods to get theme values for subsets of the theme.
22
- // @param {string} $key - the period-separated path to the value in the theme object, with "colors." omitted. e.g., "text.body"
23
- @function colors($key) {
24
- $keys: _str-split($key, ".");
25
- @return _map-deep-get($theme, join("colors", $keys));
26
- }
27
-
28
- // @param {string} $key - the period-separated path to the value in the theme object, with "typography." omitted. e.g., "100.fontSize"
29
- @function typography($key) {
30
- $keys: _str-split($key, ".");
31
- @return _map-deep-get($theme, join("typography", $keys));
32
- }
33
-
34
- // @param {string} $key - the period-separated path to the value in the theme object, with "fontWeights." omitted. e.g., "normal"
35
- @function fontWeights($key) {
36
- $keys: _str-split($key, ".");
37
- @return _map-deep-get($theme, join("fontWeights", $keys));
38
- }
39
-
40
- // @param {string} $key - the period-separated path to the value in the theme object, with "space." omitted. e.g., "100"
41
- @function space($key) {
42
- $keys: _str-split($key, ".");
43
- @return _map-deep-get($theme, join("space", $keys));
44
- }
45
-
46
- // @param {string} $key - the period-separated path to the value in the theme object, with "radii." omitted. e.g., "inner"
47
- @function radii($key) {
48
- $keys: _str-split($key, ".");
49
- @return _map-deep-get($theme, join("radii", $keys));
50
- }
51
-
52
- // @param {string} $key - the period-separated path to the value in the theme object, with "borders." omitted. e.g., "500"
53
- @function borders($key) {
54
- $keys: _str-split($key, ".");
55
- @return _map-deep-get($theme, join("borders", $keys));
56
- }
57
-
58
- // @param {string} $key - the period-separated path to the value in the theme object, with "borderWidths." omitted. e.g., "500"
59
- @function borderWidths($key) {
60
- $keys: _str-split($key, ".");
61
- @return _map-deep-get($theme, join("borderWidths", $keys));
62
- }
63
-
64
- // @param {string} $key - the period-separated path to the value in the theme object, with "shadows." omitted. e.g., "low"
65
- @function shadows($key) {
66
- $keys: _str-split($key, ".");
67
- @return _map-deep-get($theme, join("shadows", $keys));
68
- }
69
-
70
- // @param {string} $key - the period-separated path to the value in the theme object, with "easing." omitted. e.g., "ease_in"
71
- @function easing($key) {
72
- $keys: _str-split($key, ".");
73
- @return _map-deep-get($theme, join("easing", $keys));
74
- }
75
-
76
- // @param {string} $key - the period-separated path to the value in the theme object, with "duration." omitted. e.g., "fast"
77
- @function duration($key) {
78
- $keys: _str-split($key, ".");
79
- @return _map-deep-get($theme, join("duration", $keys));
80
- }
81
-
82
- // UTILITIES
83
- // Helper functions that power the functions above. Not relevant to the theme.
84
- // If you import this file with @use, these functions will be excluded because they are private.
85
-
86
- // Via https://stackoverflow.com/a/42295154
87
- // Used to split period-separated object keys, e.g. "colors.text.body" => ["colors", "text", "body"]
88
- // Only works with a single-character separator.
89
- @function _str-split($string, $separator) {
90
- // empty array/list
91
- $split-arr: ();
92
- // first index of separator in string
93
- $index: str-index($string, $separator);
94
- // loop through string
95
- @while $index != null {
96
- // get the substring from the first character to the separator
97
- $item: str-slice($string, 1, $index - 1);
98
- // push item to array
99
- $split-arr: append($split-arr, $item);
100
- // remove item and separator from string
101
- $string: str-slice($string, $index + 1);
102
- // find new index of separator
103
- $index: str-index($string, $separator);
104
- }
105
- // add the remaining string to list (the last item)
106
- $split-arr: append($split-arr, $string);
107
-
108
- @return $split-arr;
109
- }
110
-
111
- // Adapted from https://css-tricks.com/snippets/sass/deep-getset-maps/
112
- // Iterates over a list of keys to read multi-level maps.
113
- // e.g., _map-deep-get((colors: (text: (body: "#364141"))), ["colors", "text", "body"]) => "#364141"
114
- @function _map-deep-get($map, $keys) {
115
- @each $key in $keys {
116
- $map: map-get($map, $key);
117
- }
118
- @return $map;
119
- }