@sproutsocial/seeds-react-menu 0.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.
Files changed (91) hide show
  1. package/.eslintrc.js +4 -0
  2. package/.turbo/turbo-build.log +21 -0
  3. package/CHANGELOG.md +46 -0
  4. package/dist/esm/index.js +2651 -0
  5. package/dist/esm/index.js.map +1 -0
  6. package/dist/index.d.mts +197 -0
  7. package/dist/index.d.ts +197 -0
  8. package/dist/index.js +2670 -0
  9. package/dist/index.js.map +1 -0
  10. package/jest.config.js +12 -0
  11. package/package.json +50 -0
  12. package/src/ActionMenu/ActionMenu.feature +20 -0
  13. package/src/ActionMenu/ActionMenu.tsx +113 -0
  14. package/src/ActionMenu/__tests__/ActionMenu.test.tsx +99 -0
  15. package/src/ActionMenu/__tests__/ActionMenu.typetest.tsx +73 -0
  16. package/src/ActionMenu/index.ts +1 -0
  17. package/src/ComboBox/ComboBox.feature +96 -0
  18. package/src/ComboBox/TokenInput.feature +84 -0
  19. package/src/MenuContent/MenuContent.tsx +28 -0
  20. package/src/MenuContent/MenuContentTypes.ts +7 -0
  21. package/src/MenuContent/__tests__/MenuContent.test.tsx +59 -0
  22. package/src/MenuContent/__tests__/MenuContent.typetest.tsx +18 -0
  23. package/src/MenuContent/index.tsx +2 -0
  24. package/src/MenuContent/styles.tsx +10 -0
  25. package/src/MenuContext.tsx +116 -0
  26. package/src/MenuFooter/MenuFooter.feature +30 -0
  27. package/src/MenuFooter/MenuFooter.tsx +7 -0
  28. package/src/MenuFooter/MenuFooterTypes.ts +1 -0
  29. package/src/MenuFooter/__tests__/MenuFooter.test.tsx +76 -0
  30. package/src/MenuFooter/__tests__/MenuFooter.typetest.tsx +20 -0
  31. package/src/MenuFooter/index.ts +2 -0
  32. package/src/MenuFooter/styles.tsx +7 -0
  33. package/src/MenuGroup/MenuGroup.feature +114 -0
  34. package/src/MenuGroup/MenuGroup.tsx +33 -0
  35. package/src/MenuGroup/MenuGroupTypes.ts +29 -0
  36. package/src/MenuGroup/__tests__/MenuGroup.test.tsx +95 -0
  37. package/src/MenuGroup/__tests__/MenuGroup.typetest.tsx +45 -0
  38. package/src/MenuGroup/index.tsx +8 -0
  39. package/src/MenuGroup/styles.tsx +37 -0
  40. package/src/MenuHeader/MenuHeader.feature +59 -0
  41. package/src/MenuHeader/MenuHeader.tsx +30 -0
  42. package/src/MenuHeader/MenuHeaderTypes.ts +26 -0
  43. package/src/MenuHeader/__tests__/MenuHeader.test.tsx +67 -0
  44. package/src/MenuHeader/__tests__/MenuHeader.typetest.tsx +27 -0
  45. package/src/MenuHeader/index.ts +2 -0
  46. package/src/MenuHeader/styles.tsx +75 -0
  47. package/src/MenuItem/MenuItem.feature +88 -0
  48. package/src/MenuItem/MenuItem.tsx +44 -0
  49. package/src/MenuItem/MenuItemTypes.ts +37 -0
  50. package/src/MenuItem/__tests__/MenuItem.test.tsx +228 -0
  51. package/src/MenuItem/__tests__/MenuItem.typetest.tsx +41 -0
  52. package/src/MenuItem/index.ts +5 -0
  53. package/src/MenuItem/styles.tsx +71 -0
  54. package/src/MenuItemSelectable/MenuItemSelectable.feature +99 -0
  55. package/src/MenuItemSelectable/MenuItemSelectable.tsx +136 -0
  56. package/src/MenuItemSelectable/MenuItemSelectableTypes.ts +15 -0
  57. package/src/MenuItemSelectable/__tests__/MenuItemSelectable.test.tsx +303 -0
  58. package/src/MenuItemSelectable/__tests__/MenuItemSelectable.typetest.tsx +56 -0
  59. package/src/MenuItemSelectable/index.ts +5 -0
  60. package/src/MenuItemSelectable/styles.tsx +21 -0
  61. package/src/MenuLabel.tsx +12 -0
  62. package/src/MenuRoot/MenuRoot.feature +93 -0
  63. package/src/MenuRoot/MenuRoot.tsx +70 -0
  64. package/src/MenuRoot/__tests__/MenuRoot.test.tsx +197 -0
  65. package/src/MenuRoot/__tests__/MenuRoot.typetest.tsx +76 -0
  66. package/src/MenuRoot/index.ts +1 -0
  67. package/src/MenuToggleButton.tsx +29 -0
  68. package/src/MultiSelectMenu/MultiSelectMenu.feature +70 -0
  69. package/src/MultiSelectMenu/MultiSelectMenu.tsx +133 -0
  70. package/src/MultiSelectMenu/MultiSelectMenuTypes.ts +8 -0
  71. package/src/MultiSelectMenu/__tests__/MultiSelectMenu.test.tsx +349 -0
  72. package/src/MultiSelectMenu/__tests__/MultiSelectMenu.typetest.tsx +78 -0
  73. package/src/MultiSelectMenu/index.ts +1 -0
  74. package/src/SingleSelectMenu/SingleSelectMenu.feature +23 -0
  75. package/src/SingleSelectMenu/SingleSelectMenu.tsx +56 -0
  76. package/src/SingleSelectMenu/SingleSelectMenuTypes.ts +9 -0
  77. package/src/SingleSelectMenu/__tests__/SingleSelectMenu.test.tsx +167 -0
  78. package/src/SingleSelectMenu/__tests__/SingleSelectMenu.typetest.tsx +95 -0
  79. package/src/SingleSelectMenu/index.ts +3 -0
  80. package/src/__tests__/Menu.test.tsx +423 -0
  81. package/src/constants.ts +17 -0
  82. package/src/hooks/useItemsFromChildren.tsx +81 -0
  83. package/src/index.ts +20 -0
  84. package/src/menuTestingUtils.tsx +72 -0
  85. package/src/reducers/__tests__/useSelectStateReducer.test.tsx +37 -0
  86. package/src/reducers/useSelectStateReducer.tsx +27 -0
  87. package/src/styled.d.ts +7 -0
  88. package/src/types.ts +16 -0
  89. package/src/utils/itemToString.ts +5 -0
  90. package/tsconfig.json +12 -0
  91. package/tsup.config.ts +11 -0
@@ -0,0 +1,2651 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
+ // If the importer is in node compatibility mode or this is not an ESM
20
+ // file that has been converted to a CommonJS file using a Babel-
21
+ // compatible transform (i.e. "__esModule" has not been set), then set
22
+ // "default" to the CommonJS "module.exports" for node compatibility.
23
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
+ mod
25
+ ));
26
+
27
+ // ../../node_modules/object-assign/index.js
28
+ var require_object_assign = __commonJS({
29
+ "../../node_modules/object-assign/index.js"(exports, module) {
30
+ "use strict";
31
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
32
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
33
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
34
+ function toObject(val) {
35
+ if (val === null || val === void 0) {
36
+ throw new TypeError("Object.assign cannot be called with null or undefined");
37
+ }
38
+ return Object(val);
39
+ }
40
+ function shouldUseNative() {
41
+ try {
42
+ if (!Object.assign) {
43
+ return false;
44
+ }
45
+ var test1 = new String("abc");
46
+ test1[5] = "de";
47
+ if (Object.getOwnPropertyNames(test1)[0] === "5") {
48
+ return false;
49
+ }
50
+ var test2 = {};
51
+ for (var i = 0; i < 10; i++) {
52
+ test2["_" + String.fromCharCode(i)] = i;
53
+ }
54
+ var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
55
+ return test2[n];
56
+ });
57
+ if (order2.join("") !== "0123456789") {
58
+ return false;
59
+ }
60
+ var test3 = {};
61
+ "abcdefghijklmnopqrst".split("").forEach(function(letter) {
62
+ test3[letter] = letter;
63
+ });
64
+ if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
65
+ return false;
66
+ }
67
+ return true;
68
+ } catch (err) {
69
+ return false;
70
+ }
71
+ }
72
+ module.exports = shouldUseNative() ? Object.assign : function(target, source) {
73
+ var from;
74
+ var to = toObject(target);
75
+ var symbols;
76
+ for (var s = 1; s < arguments.length; s++) {
77
+ from = Object(arguments[s]);
78
+ for (var key in from) {
79
+ if (hasOwnProperty.call(from, key)) {
80
+ to[key] = from[key];
81
+ }
82
+ }
83
+ if (getOwnPropertySymbols) {
84
+ symbols = getOwnPropertySymbols(from);
85
+ for (var i = 0; i < symbols.length; i++) {
86
+ if (propIsEnumerable.call(from, symbols[i])) {
87
+ to[symbols[i]] = from[symbols[i]];
88
+ }
89
+ }
90
+ }
91
+ }
92
+ return to;
93
+ };
94
+ }
95
+ });
96
+
97
+ // src/MenuItem/MenuItem.tsx
98
+ import { useContext as useContext2 } from "react";
99
+
100
+ // src/MenuContext.tsx
101
+ import {
102
+ createContext,
103
+ useMemo,
104
+ useContext
105
+ } from "react";
106
+ import { jsx } from "react/jsx-runtime";
107
+ var defaultMenuContext = {
108
+ items: [],
109
+ itemsMap: {}
110
+ };
111
+ var useMenu = ({
112
+ items = [],
113
+ isListbox = false,
114
+ isOpen = false,
115
+ ...rest
116
+ } = {}) => {
117
+ const menuProps = useMemo(() => ({ ...rest }), [rest]);
118
+ const itemsMap = useMemo(
119
+ () => items.reduce((map, item) => {
120
+ map[`${item.id}`] = item;
121
+ return map;
122
+ }, {}),
123
+ [items]
124
+ );
125
+ return {
126
+ isOpen,
127
+ isListbox,
128
+ items,
129
+ itemsMap,
130
+ ...menuProps
131
+ };
132
+ };
133
+ var MenuContext = createContext(defaultMenuContext);
134
+ var MenuProvider = ({
135
+ children,
136
+ ...overrides
137
+ }) => {
138
+ const filterContext = useMenu(overrides);
139
+ return /* @__PURE__ */ jsx(MenuContext.Provider, { value: { ...filterContext }, children });
140
+ };
141
+ var useMenuContext = () => {
142
+ const menuContextValue = useContext(MenuContext);
143
+ if (menuContextValue === null) {
144
+ throw new Error(
145
+ "useMenuContext must be used within a <MenuContext.Provider />"
146
+ );
147
+ }
148
+ return menuContextValue;
149
+ };
150
+
151
+ // src/constants.ts
152
+ var MENU_ITEM_ROLES = {
153
+ MENUITEM: "menuitem",
154
+ LISTITEM: "listitem",
155
+ OPTION: "option",
156
+ RADIO: "menuitemradio",
157
+ CHECKBOX: "menuitemcheckbox"
158
+ };
159
+
160
+ // src/MenuItem/styles.tsx
161
+ import styled, { css as css4 } from "styled-components";
162
+
163
+ // ../../node_modules/@babel/runtime/helpers/esm/extends.js
164
+ function _extends() {
165
+ _extends = Object.assign ? Object.assign.bind() : function(target) {
166
+ for (var i = 1; i < arguments.length; i++) {
167
+ var source = arguments[i];
168
+ for (var key in source) {
169
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
170
+ target[key] = source[key];
171
+ }
172
+ }
173
+ }
174
+ return target;
175
+ };
176
+ return _extends.apply(this, arguments);
177
+ }
178
+
179
+ // ../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
180
+ function _assertThisInitialized(self) {
181
+ if (self === void 0) {
182
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
183
+ }
184
+ return self;
185
+ }
186
+
187
+ // ../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
188
+ function _setPrototypeOf(o, p) {
189
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
190
+ o2.__proto__ = p2;
191
+ return o2;
192
+ };
193
+ return _setPrototypeOf(o, p);
194
+ }
195
+
196
+ // ../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
197
+ function _inheritsLoose(subClass, superClass) {
198
+ subClass.prototype = Object.create(superClass.prototype);
199
+ subClass.prototype.constructor = subClass;
200
+ _setPrototypeOf(subClass, superClass);
201
+ }
202
+
203
+ // ../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
204
+ function _getPrototypeOf(o) {
205
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf2(o2) {
206
+ return o2.__proto__ || Object.getPrototypeOf(o2);
207
+ };
208
+ return _getPrototypeOf(o);
209
+ }
210
+
211
+ // ../../node_modules/@babel/runtime/helpers/esm/isNativeFunction.js
212
+ function _isNativeFunction(fn) {
213
+ try {
214
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
215
+ } catch (e) {
216
+ return typeof fn === "function";
217
+ }
218
+ }
219
+
220
+ // ../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
221
+ function _isNativeReflectConstruct() {
222
+ try {
223
+ var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
224
+ }));
225
+ } catch (t2) {
226
+ }
227
+ return (_isNativeReflectConstruct = function _isNativeReflectConstruct2() {
228
+ return !!t;
229
+ })();
230
+ }
231
+
232
+ // ../../node_modules/@babel/runtime/helpers/esm/construct.js
233
+ function _construct(t, e, r) {
234
+ if (_isNativeReflectConstruct())
235
+ return Reflect.construct.apply(null, arguments);
236
+ var o = [null];
237
+ o.push.apply(o, e);
238
+ var p = new (t.bind.apply(t, o))();
239
+ return r && _setPrototypeOf(p, r.prototype), p;
240
+ }
241
+
242
+ // ../../node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js
243
+ function _wrapNativeSuper(Class) {
244
+ var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
245
+ _wrapNativeSuper = function _wrapNativeSuper2(Class2) {
246
+ if (Class2 === null || !_isNativeFunction(Class2))
247
+ return Class2;
248
+ if (typeof Class2 !== "function") {
249
+ throw new TypeError("Super expression must either be null or a function");
250
+ }
251
+ if (typeof _cache !== "undefined") {
252
+ if (_cache.has(Class2))
253
+ return _cache.get(Class2);
254
+ _cache.set(Class2, Wrapper);
255
+ }
256
+ function Wrapper() {
257
+ return _construct(Class2, arguments, _getPrototypeOf(this).constructor);
258
+ }
259
+ Wrapper.prototype = Object.create(Class2.prototype, {
260
+ constructor: {
261
+ value: Wrapper,
262
+ enumerable: false,
263
+ writable: true,
264
+ configurable: true
265
+ }
266
+ });
267
+ return _setPrototypeOf(Wrapper, Class2);
268
+ };
269
+ return _wrapNativeSuper(Class);
270
+ }
271
+
272
+ // ../../node_modules/polished/dist/polished.esm.js
273
+ var ERRORS = {
274
+ "1": "Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",
275
+ "2": "Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",
276
+ "3": "Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",
277
+ "4": "Couldn't generate valid rgb string from %s, it returned %s.\n\n",
278
+ "5": "Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",
279
+ "6": "Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",
280
+ "7": "Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",
281
+ "8": "Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",
282
+ "9": "Please provide a number of steps to the modularScale helper.\n\n",
283
+ "10": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",
284
+ "11": 'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',
285
+ "12": 'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',
286
+ "13": 'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',
287
+ "14": 'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',
288
+ "15": 'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',
289
+ "16": "You must provide a template to this method.\n\n",
290
+ "17": "You passed an unsupported selector state to this method.\n\n",
291
+ "18": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",
292
+ "19": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n",
293
+ "20": "expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",
294
+ "21": "expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
295
+ "22": "expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
296
+ "23": "fontFace expects a name of a font-family.\n\n",
297
+ "24": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",
298
+ "25": "fontFace expects localFonts to be an array.\n\n",
299
+ "26": "fontFace expects fileFormats to be an array.\n\n",
300
+ "27": "radialGradient requries at least 2 color-stops to properly render.\n\n",
301
+ "28": "Please supply a filename to retinaImage() as the first argument.\n\n",
302
+ "29": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",
303
+ "30": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
304
+ "31": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",
305
+ "32": "To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",
306
+ "33": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",
307
+ "34": "borderRadius expects a radius value as a string or number as the second argument.\n\n",
308
+ "35": 'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',
309
+ "36": "Property must be a string value.\n\n",
310
+ "37": "Syntax Error at %s.\n\n",
311
+ "38": "Formula contains a function that needs parentheses at %s.\n\n",
312
+ "39": "Formula is missing closing parenthesis at %s.\n\n",
313
+ "40": "Formula has too many closing parentheses at %s.\n\n",
314
+ "41": "All values in a formula must have the same unit or be unitless.\n\n",
315
+ "42": "Please provide a number of steps to the modularScale helper.\n\n",
316
+ "43": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",
317
+ "44": "Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",
318
+ "45": "Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",
319
+ "46": "Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",
320
+ "47": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",
321
+ "48": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n",
322
+ "49": "Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",
323
+ "50": "Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",
324
+ "51": "Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",
325
+ "52": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",
326
+ "53": "fontFace expects localFonts to be an array.\n\n",
327
+ "54": "fontFace expects fileFormats to be an array.\n\n",
328
+ "55": "fontFace expects a name of a font-family.\n\n",
329
+ "56": "linearGradient requries at least 2 color-stops to properly render.\n\n",
330
+ "57": "radialGradient requries at least 2 color-stops to properly render.\n\n",
331
+ "58": "Please supply a filename to retinaImage() as the first argument.\n\n",
332
+ "59": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",
333
+ "60": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
334
+ "61": "Property must be a string value.\n\n",
335
+ "62": "borderRadius expects a radius value as a string or number as the second argument.\n\n",
336
+ "63": 'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',
337
+ "64": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",
338
+ "65": "To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",
339
+ "66": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",
340
+ "67": "You must provide a template to this method.\n\n",
341
+ "68": "You passed an unsupported selector state to this method.\n\n",
342
+ "69": 'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',
343
+ "70": 'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',
344
+ "71": 'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',
345
+ "72": 'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',
346
+ "73": "Please provide a valid CSS variable.\n\n",
347
+ "74": "CSS variable not found.\n\n",
348
+ "75": "fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n"
349
+ };
350
+ function format() {
351
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
352
+ args[_key] = arguments[_key];
353
+ }
354
+ var a = args[0];
355
+ var b = [];
356
+ var c;
357
+ for (c = 1; c < args.length; c += 1) {
358
+ b.push(args[c]);
359
+ }
360
+ b.forEach(function(d) {
361
+ a = a.replace(/%[a-z]/, d);
362
+ });
363
+ return a;
364
+ }
365
+ var PolishedError = /* @__PURE__ */ function(_Error) {
366
+ _inheritsLoose(PolishedError2, _Error);
367
+ function PolishedError2(code) {
368
+ var _this;
369
+ if (process.env.NODE_ENV === "production") {
370
+ _this = _Error.call(this, "An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#" + code + " for more information.") || this;
371
+ } else {
372
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
373
+ args[_key2 - 1] = arguments[_key2];
374
+ }
375
+ _this = _Error.call(this, format.apply(void 0, [ERRORS[code]].concat(args))) || this;
376
+ }
377
+ return _assertThisInitialized(_this);
378
+ }
379
+ return PolishedError2;
380
+ }(/* @__PURE__ */ _wrapNativeSuper(Error));
381
+ function colorToInt(color2) {
382
+ return Math.round(color2 * 255);
383
+ }
384
+ function convertToInt(red, green, blue) {
385
+ return colorToInt(red) + "," + colorToInt(green) + "," + colorToInt(blue);
386
+ }
387
+ function hslToRgb(hue, saturation, lightness, convert) {
388
+ if (convert === void 0) {
389
+ convert = convertToInt;
390
+ }
391
+ if (saturation === 0) {
392
+ return convert(lightness, lightness, lightness);
393
+ }
394
+ var huePrime = (hue % 360 + 360) % 360 / 60;
395
+ var chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;
396
+ var secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
397
+ var red = 0;
398
+ var green = 0;
399
+ var blue = 0;
400
+ if (huePrime >= 0 && huePrime < 1) {
401
+ red = chroma;
402
+ green = secondComponent;
403
+ } else if (huePrime >= 1 && huePrime < 2) {
404
+ red = secondComponent;
405
+ green = chroma;
406
+ } else if (huePrime >= 2 && huePrime < 3) {
407
+ green = chroma;
408
+ blue = secondComponent;
409
+ } else if (huePrime >= 3 && huePrime < 4) {
410
+ green = secondComponent;
411
+ blue = chroma;
412
+ } else if (huePrime >= 4 && huePrime < 5) {
413
+ red = secondComponent;
414
+ blue = chroma;
415
+ } else if (huePrime >= 5 && huePrime < 6) {
416
+ red = chroma;
417
+ blue = secondComponent;
418
+ }
419
+ var lightnessModification = lightness - chroma / 2;
420
+ var finalRed = red + lightnessModification;
421
+ var finalGreen = green + lightnessModification;
422
+ var finalBlue = blue + lightnessModification;
423
+ return convert(finalRed, finalGreen, finalBlue);
424
+ }
425
+ var namedColorMap = {
426
+ aliceblue: "f0f8ff",
427
+ antiquewhite: "faebd7",
428
+ aqua: "00ffff",
429
+ aquamarine: "7fffd4",
430
+ azure: "f0ffff",
431
+ beige: "f5f5dc",
432
+ bisque: "ffe4c4",
433
+ black: "000",
434
+ blanchedalmond: "ffebcd",
435
+ blue: "0000ff",
436
+ blueviolet: "8a2be2",
437
+ brown: "a52a2a",
438
+ burlywood: "deb887",
439
+ cadetblue: "5f9ea0",
440
+ chartreuse: "7fff00",
441
+ chocolate: "d2691e",
442
+ coral: "ff7f50",
443
+ cornflowerblue: "6495ed",
444
+ cornsilk: "fff8dc",
445
+ crimson: "dc143c",
446
+ cyan: "00ffff",
447
+ darkblue: "00008b",
448
+ darkcyan: "008b8b",
449
+ darkgoldenrod: "b8860b",
450
+ darkgray: "a9a9a9",
451
+ darkgreen: "006400",
452
+ darkgrey: "a9a9a9",
453
+ darkkhaki: "bdb76b",
454
+ darkmagenta: "8b008b",
455
+ darkolivegreen: "556b2f",
456
+ darkorange: "ff8c00",
457
+ darkorchid: "9932cc",
458
+ darkred: "8b0000",
459
+ darksalmon: "e9967a",
460
+ darkseagreen: "8fbc8f",
461
+ darkslateblue: "483d8b",
462
+ darkslategray: "2f4f4f",
463
+ darkslategrey: "2f4f4f",
464
+ darkturquoise: "00ced1",
465
+ darkviolet: "9400d3",
466
+ deeppink: "ff1493",
467
+ deepskyblue: "00bfff",
468
+ dimgray: "696969",
469
+ dimgrey: "696969",
470
+ dodgerblue: "1e90ff",
471
+ firebrick: "b22222",
472
+ floralwhite: "fffaf0",
473
+ forestgreen: "228b22",
474
+ fuchsia: "ff00ff",
475
+ gainsboro: "dcdcdc",
476
+ ghostwhite: "f8f8ff",
477
+ gold: "ffd700",
478
+ goldenrod: "daa520",
479
+ gray: "808080",
480
+ green: "008000",
481
+ greenyellow: "adff2f",
482
+ grey: "808080",
483
+ honeydew: "f0fff0",
484
+ hotpink: "ff69b4",
485
+ indianred: "cd5c5c",
486
+ indigo: "4b0082",
487
+ ivory: "fffff0",
488
+ khaki: "f0e68c",
489
+ lavender: "e6e6fa",
490
+ lavenderblush: "fff0f5",
491
+ lawngreen: "7cfc00",
492
+ lemonchiffon: "fffacd",
493
+ lightblue: "add8e6",
494
+ lightcoral: "f08080",
495
+ lightcyan: "e0ffff",
496
+ lightgoldenrodyellow: "fafad2",
497
+ lightgray: "d3d3d3",
498
+ lightgreen: "90ee90",
499
+ lightgrey: "d3d3d3",
500
+ lightpink: "ffb6c1",
501
+ lightsalmon: "ffa07a",
502
+ lightseagreen: "20b2aa",
503
+ lightskyblue: "87cefa",
504
+ lightslategray: "789",
505
+ lightslategrey: "789",
506
+ lightsteelblue: "b0c4de",
507
+ lightyellow: "ffffe0",
508
+ lime: "0f0",
509
+ limegreen: "32cd32",
510
+ linen: "faf0e6",
511
+ magenta: "f0f",
512
+ maroon: "800000",
513
+ mediumaquamarine: "66cdaa",
514
+ mediumblue: "0000cd",
515
+ mediumorchid: "ba55d3",
516
+ mediumpurple: "9370db",
517
+ mediumseagreen: "3cb371",
518
+ mediumslateblue: "7b68ee",
519
+ mediumspringgreen: "00fa9a",
520
+ mediumturquoise: "48d1cc",
521
+ mediumvioletred: "c71585",
522
+ midnightblue: "191970",
523
+ mintcream: "f5fffa",
524
+ mistyrose: "ffe4e1",
525
+ moccasin: "ffe4b5",
526
+ navajowhite: "ffdead",
527
+ navy: "000080",
528
+ oldlace: "fdf5e6",
529
+ olive: "808000",
530
+ olivedrab: "6b8e23",
531
+ orange: "ffa500",
532
+ orangered: "ff4500",
533
+ orchid: "da70d6",
534
+ palegoldenrod: "eee8aa",
535
+ palegreen: "98fb98",
536
+ paleturquoise: "afeeee",
537
+ palevioletred: "db7093",
538
+ papayawhip: "ffefd5",
539
+ peachpuff: "ffdab9",
540
+ peru: "cd853f",
541
+ pink: "ffc0cb",
542
+ plum: "dda0dd",
543
+ powderblue: "b0e0e6",
544
+ purple: "800080",
545
+ rebeccapurple: "639",
546
+ red: "f00",
547
+ rosybrown: "bc8f8f",
548
+ royalblue: "4169e1",
549
+ saddlebrown: "8b4513",
550
+ salmon: "fa8072",
551
+ sandybrown: "f4a460",
552
+ seagreen: "2e8b57",
553
+ seashell: "fff5ee",
554
+ sienna: "a0522d",
555
+ silver: "c0c0c0",
556
+ skyblue: "87ceeb",
557
+ slateblue: "6a5acd",
558
+ slategray: "708090",
559
+ slategrey: "708090",
560
+ snow: "fffafa",
561
+ springgreen: "00ff7f",
562
+ steelblue: "4682b4",
563
+ tan: "d2b48c",
564
+ teal: "008080",
565
+ thistle: "d8bfd8",
566
+ tomato: "ff6347",
567
+ turquoise: "40e0d0",
568
+ violet: "ee82ee",
569
+ wheat: "f5deb3",
570
+ white: "fff",
571
+ whitesmoke: "f5f5f5",
572
+ yellow: "ff0",
573
+ yellowgreen: "9acd32"
574
+ };
575
+ function nameToHex(color2) {
576
+ if (typeof color2 !== "string")
577
+ return color2;
578
+ var normalizedColorName = color2.toLowerCase();
579
+ return namedColorMap[normalizedColorName] ? "#" + namedColorMap[normalizedColorName] : color2;
580
+ }
581
+ var hexRegex = /^#[a-fA-F0-9]{6}$/;
582
+ var hexRgbaRegex = /^#[a-fA-F0-9]{8}$/;
583
+ var reducedHexRegex = /^#[a-fA-F0-9]{3}$/;
584
+ var reducedRgbaHexRegex = /^#[a-fA-F0-9]{4}$/;
585
+ var rgbRegex = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i;
586
+ var rgbaRegex = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i;
587
+ var hslRegex = /^hsl\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i;
588
+ var hslaRegex = /^hsla\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i;
589
+ function parseToRgb(color2) {
590
+ if (typeof color2 !== "string") {
591
+ throw new PolishedError(3);
592
+ }
593
+ var normalizedColor = nameToHex(color2);
594
+ if (normalizedColor.match(hexRegex)) {
595
+ return {
596
+ red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
597
+ green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
598
+ blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16)
599
+ };
600
+ }
601
+ if (normalizedColor.match(hexRgbaRegex)) {
602
+ var alpha = parseFloat((parseInt("" + normalizedColor[7] + normalizedColor[8], 16) / 255).toFixed(2));
603
+ return {
604
+ red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
605
+ green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
606
+ blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16),
607
+ alpha
608
+ };
609
+ }
610
+ if (normalizedColor.match(reducedHexRegex)) {
611
+ return {
612
+ red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
613
+ green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
614
+ blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16)
615
+ };
616
+ }
617
+ if (normalizedColor.match(reducedRgbaHexRegex)) {
618
+ var _alpha = parseFloat((parseInt("" + normalizedColor[4] + normalizedColor[4], 16) / 255).toFixed(2));
619
+ return {
620
+ red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
621
+ green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
622
+ blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16),
623
+ alpha: _alpha
624
+ };
625
+ }
626
+ var rgbMatched = rgbRegex.exec(normalizedColor);
627
+ if (rgbMatched) {
628
+ return {
629
+ red: parseInt("" + rgbMatched[1], 10),
630
+ green: parseInt("" + rgbMatched[2], 10),
631
+ blue: parseInt("" + rgbMatched[3], 10)
632
+ };
633
+ }
634
+ var rgbaMatched = rgbaRegex.exec(normalizedColor.substring(0, 50));
635
+ if (rgbaMatched) {
636
+ return {
637
+ red: parseInt("" + rgbaMatched[1], 10),
638
+ green: parseInt("" + rgbaMatched[2], 10),
639
+ blue: parseInt("" + rgbaMatched[3], 10),
640
+ alpha: parseFloat("" + rgbaMatched[4])
641
+ };
642
+ }
643
+ var hslMatched = hslRegex.exec(normalizedColor);
644
+ if (hslMatched) {
645
+ var hue = parseInt("" + hslMatched[1], 10);
646
+ var saturation = parseInt("" + hslMatched[2], 10) / 100;
647
+ var lightness = parseInt("" + hslMatched[3], 10) / 100;
648
+ var rgbColorString = "rgb(" + hslToRgb(hue, saturation, lightness) + ")";
649
+ var hslRgbMatched = rgbRegex.exec(rgbColorString);
650
+ if (!hslRgbMatched) {
651
+ throw new PolishedError(4, normalizedColor, rgbColorString);
652
+ }
653
+ return {
654
+ red: parseInt("" + hslRgbMatched[1], 10),
655
+ green: parseInt("" + hslRgbMatched[2], 10),
656
+ blue: parseInt("" + hslRgbMatched[3], 10)
657
+ };
658
+ }
659
+ var hslaMatched = hslaRegex.exec(normalizedColor.substring(0, 50));
660
+ if (hslaMatched) {
661
+ var _hue = parseInt("" + hslaMatched[1], 10);
662
+ var _saturation = parseInt("" + hslaMatched[2], 10) / 100;
663
+ var _lightness = parseInt("" + hslaMatched[3], 10) / 100;
664
+ var _rgbColorString = "rgb(" + hslToRgb(_hue, _saturation, _lightness) + ")";
665
+ var _hslRgbMatched = rgbRegex.exec(_rgbColorString);
666
+ if (!_hslRgbMatched) {
667
+ throw new PolishedError(4, normalizedColor, _rgbColorString);
668
+ }
669
+ return {
670
+ red: parseInt("" + _hslRgbMatched[1], 10),
671
+ green: parseInt("" + _hslRgbMatched[2], 10),
672
+ blue: parseInt("" + _hslRgbMatched[3], 10),
673
+ alpha: parseFloat("" + hslaMatched[4])
674
+ };
675
+ }
676
+ throw new PolishedError(5);
677
+ }
678
+ var reduceHexValue = function reduceHexValue2(value) {
679
+ if (value.length === 7 && value[1] === value[2] && value[3] === value[4] && value[5] === value[6]) {
680
+ return "#" + value[1] + value[3] + value[5];
681
+ }
682
+ return value;
683
+ };
684
+ function numberToHex(value) {
685
+ var hex = value.toString(16);
686
+ return hex.length === 1 ? "0" + hex : hex;
687
+ }
688
+ function rgb(value, green, blue) {
689
+ if (typeof value === "number" && typeof green === "number" && typeof blue === "number") {
690
+ return reduceHexValue("#" + numberToHex(value) + numberToHex(green) + numberToHex(blue));
691
+ } else if (typeof value === "object" && green === void 0 && blue === void 0) {
692
+ return reduceHexValue("#" + numberToHex(value.red) + numberToHex(value.green) + numberToHex(value.blue));
693
+ }
694
+ throw new PolishedError(6);
695
+ }
696
+ function rgba(firstValue, secondValue, thirdValue, fourthValue) {
697
+ if (typeof firstValue === "string" && typeof secondValue === "number") {
698
+ var rgbValue = parseToRgb(firstValue);
699
+ return "rgba(" + rgbValue.red + "," + rgbValue.green + "," + rgbValue.blue + "," + secondValue + ")";
700
+ } else if (typeof firstValue === "number" && typeof secondValue === "number" && typeof thirdValue === "number" && typeof fourthValue === "number") {
701
+ return fourthValue >= 1 ? rgb(firstValue, secondValue, thirdValue) : "rgba(" + firstValue + "," + secondValue + "," + thirdValue + "," + fourthValue + ")";
702
+ } else if (typeof firstValue === "object" && secondValue === void 0 && thirdValue === void 0 && fourthValue === void 0) {
703
+ return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")";
704
+ }
705
+ throw new PolishedError(7);
706
+ }
707
+ function curried(f, length, acc) {
708
+ return function fn() {
709
+ var combined = acc.concat(Array.prototype.slice.call(arguments));
710
+ return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined);
711
+ };
712
+ }
713
+ function curry(f) {
714
+ return curried(f, f.length, []);
715
+ }
716
+ function guard(lowerBoundary, upperBoundary, value) {
717
+ return Math.max(lowerBoundary, Math.min(upperBoundary, value));
718
+ }
719
+ function transparentize(amount, color2) {
720
+ if (color2 === "transparent")
721
+ return color2;
722
+ var parsedColor = parseToRgb(color2);
723
+ var alpha = typeof parsedColor.alpha === "number" ? parsedColor.alpha : 1;
724
+ var colorWithAlpha = _extends({}, parsedColor, {
725
+ alpha: guard(0, 1, +(alpha * 100 - parseFloat(amount) * 100).toFixed(2) / 100)
726
+ });
727
+ return rgba(colorWithAlpha);
728
+ }
729
+ var curriedTransparentize = /* @__PURE__ */ curry(transparentize);
730
+
731
+ // ../seeds-react-mixins/src/index.ts
732
+ import { css } from "styled-components";
733
+ import { theme } from "@sproutsocial/seeds-react-theme";
734
+ var visuallyHidden = css`
735
+ position: absolute;
736
+ width: 1px;
737
+ height: 1px;
738
+ padding: 0;
739
+ margin: -1px;
740
+ overflow: hidden;
741
+ clip: rect(0 0 0 0);
742
+ border: 0;
743
+ `;
744
+ var focusRing = css`
745
+ box-shadow: 0 0 0 1px ${theme.colors.button.primary.background.base},
746
+ 0 0px 0px 4px
747
+ ${curriedTransparentize(0.7, theme.colors.button.primary.background.base)};
748
+ outline: none;
749
+
750
+ &::-moz-focus-inner {
751
+ border: 0;
752
+ }
753
+ `;
754
+ var pill = css`
755
+ min-width: ${theme.space[600]};
756
+ min-height: ${theme.space[600]};
757
+ padding: ${theme.space[300]};
758
+ border-radius: ${theme.radii.pill};
759
+ `;
760
+ var disabled = css`
761
+ opacity: 0.4;
762
+ pointer-events: none;
763
+ `;
764
+
765
+ // ../../node_modules/@styled-system/core/dist/index.esm.js
766
+ var import_object_assign = __toESM(require_object_assign());
767
+ var merge = function merge2(a, b) {
768
+ var result = (0, import_object_assign.default)({}, a, b);
769
+ for (var key in a) {
770
+ var _assign;
771
+ if (!a[key] || typeof b[key] !== "object")
772
+ continue;
773
+ (0, import_object_assign.default)(result, (_assign = {}, _assign[key] = (0, import_object_assign.default)(a[key], b[key]), _assign));
774
+ }
775
+ return result;
776
+ };
777
+ var sort = function sort2(obj) {
778
+ var next = {};
779
+ Object.keys(obj).sort(function(a, b) {
780
+ return a.localeCompare(b, void 0, {
781
+ numeric: true,
782
+ sensitivity: "base"
783
+ });
784
+ }).forEach(function(key) {
785
+ next[key] = obj[key];
786
+ });
787
+ return next;
788
+ };
789
+ var defaults = {
790
+ breakpoints: [40, 52, 64].map(function(n) {
791
+ return n + "em";
792
+ })
793
+ };
794
+ var createMediaQuery = function createMediaQuery2(n) {
795
+ return "@media screen and (min-width: " + n + ")";
796
+ };
797
+ var getValue = function getValue2(n, scale) {
798
+ return get(scale, n, n);
799
+ };
800
+ var get = function get2(obj, key, def, p, undef) {
801
+ key = key && key.split ? key.split(".") : [key];
802
+ for (p = 0; p < key.length; p++) {
803
+ obj = obj ? obj[key[p]] : undef;
804
+ }
805
+ return obj === undef ? def : obj;
806
+ };
807
+ var createParser = function createParser2(config9) {
808
+ var cache = {};
809
+ var parse = function parse2(props) {
810
+ var styles = {};
811
+ var shouldSort = false;
812
+ var isCacheDisabled = props.theme && props.theme.disableStyledSystemCache;
813
+ for (var key in props) {
814
+ if (!config9[key])
815
+ continue;
816
+ var sx = config9[key];
817
+ var raw = props[key];
818
+ var scale = get(props.theme, sx.scale, sx.defaults);
819
+ if (typeof raw === "object") {
820
+ cache.breakpoints = !isCacheDisabled && cache.breakpoints || get(props.theme, "breakpoints", defaults.breakpoints);
821
+ if (Array.isArray(raw)) {
822
+ cache.media = !isCacheDisabled && cache.media || [null].concat(cache.breakpoints.map(createMediaQuery));
823
+ styles = merge(styles, parseResponsiveStyle(cache.media, sx, scale, raw, props));
824
+ continue;
825
+ }
826
+ if (raw !== null) {
827
+ styles = merge(styles, parseResponsiveObject(cache.breakpoints, sx, scale, raw, props));
828
+ shouldSort = true;
829
+ }
830
+ continue;
831
+ }
832
+ (0, import_object_assign.default)(styles, sx(raw, scale, props));
833
+ }
834
+ if (shouldSort) {
835
+ styles = sort(styles);
836
+ }
837
+ return styles;
838
+ };
839
+ parse.config = config9;
840
+ parse.propNames = Object.keys(config9);
841
+ parse.cache = cache;
842
+ var keys = Object.keys(config9).filter(function(k) {
843
+ return k !== "config";
844
+ });
845
+ if (keys.length > 1) {
846
+ keys.forEach(function(key) {
847
+ var _createParser;
848
+ parse[key] = createParser2((_createParser = {}, _createParser[key] = config9[key], _createParser));
849
+ });
850
+ }
851
+ return parse;
852
+ };
853
+ var parseResponsiveStyle = function parseResponsiveStyle2(mediaQueries, sx, scale, raw, _props) {
854
+ var styles = {};
855
+ raw.slice(0, mediaQueries.length).forEach(function(value, i) {
856
+ var media = mediaQueries[i];
857
+ var style = sx(value, scale, _props);
858
+ if (!media) {
859
+ (0, import_object_assign.default)(styles, style);
860
+ } else {
861
+ var _assign2;
862
+ (0, import_object_assign.default)(styles, (_assign2 = {}, _assign2[media] = (0, import_object_assign.default)({}, styles[media], style), _assign2));
863
+ }
864
+ });
865
+ return styles;
866
+ };
867
+ var parseResponsiveObject = function parseResponsiveObject2(breakpoints, sx, scale, raw, _props) {
868
+ var styles = {};
869
+ for (var key in raw) {
870
+ var breakpoint = breakpoints[key];
871
+ var value = raw[key];
872
+ var style = sx(value, scale, _props);
873
+ if (!breakpoint) {
874
+ (0, import_object_assign.default)(styles, style);
875
+ } else {
876
+ var _assign3;
877
+ var media = createMediaQuery(breakpoint);
878
+ (0, import_object_assign.default)(styles, (_assign3 = {}, _assign3[media] = (0, import_object_assign.default)({}, styles[media], style), _assign3));
879
+ }
880
+ }
881
+ return styles;
882
+ };
883
+ var createStyleFunction = function createStyleFunction2(_ref) {
884
+ var properties = _ref.properties, property = _ref.property, scale = _ref.scale, _ref$transform = _ref.transform, transform = _ref$transform === void 0 ? getValue : _ref$transform, defaultScale = _ref.defaultScale;
885
+ properties = properties || [property];
886
+ var sx = function sx2(value, scale2, _props) {
887
+ var result = {};
888
+ var n = transform(value, scale2, _props);
889
+ if (n === null)
890
+ return;
891
+ properties.forEach(function(prop) {
892
+ result[prop] = n;
893
+ });
894
+ return result;
895
+ };
896
+ sx.scale = scale;
897
+ sx.defaults = defaultScale;
898
+ return sx;
899
+ };
900
+ var system = function system2(args) {
901
+ if (args === void 0) {
902
+ args = {};
903
+ }
904
+ var config9 = {};
905
+ Object.keys(args).forEach(function(key) {
906
+ var conf = args[key];
907
+ if (conf === true) {
908
+ config9[key] = createStyleFunction({
909
+ property: key,
910
+ scale: key
911
+ });
912
+ return;
913
+ }
914
+ if (typeof conf === "function") {
915
+ config9[key] = conf;
916
+ return;
917
+ }
918
+ config9[key] = createStyleFunction(conf);
919
+ });
920
+ var parser = createParser(config9);
921
+ return parser;
922
+ };
923
+ var compose = function compose2() {
924
+ var config9 = {};
925
+ for (var _len = arguments.length, parsers = new Array(_len), _key = 0; _key < _len; _key++) {
926
+ parsers[_key] = arguments[_key];
927
+ }
928
+ parsers.forEach(function(parser2) {
929
+ if (!parser2 || !parser2.config)
930
+ return;
931
+ (0, import_object_assign.default)(config9, parser2.config);
932
+ });
933
+ var parser = createParser(config9);
934
+ return parser;
935
+ };
936
+
937
+ // ../../node_modules/@styled-system/layout/dist/index.esm.js
938
+ var isNumber = function isNumber2(n) {
939
+ return typeof n === "number" && !isNaN(n);
940
+ };
941
+ var getWidth = function getWidth2(n, scale) {
942
+ return get(scale, n, !isNumber(n) || n > 1 ? n : n * 100 + "%");
943
+ };
944
+ var config = {
945
+ width: {
946
+ property: "width",
947
+ scale: "sizes",
948
+ transform: getWidth
949
+ },
950
+ height: {
951
+ property: "height",
952
+ scale: "sizes"
953
+ },
954
+ minWidth: {
955
+ property: "minWidth",
956
+ scale: "sizes"
957
+ },
958
+ minHeight: {
959
+ property: "minHeight",
960
+ scale: "sizes"
961
+ },
962
+ maxWidth: {
963
+ property: "maxWidth",
964
+ scale: "sizes"
965
+ },
966
+ maxHeight: {
967
+ property: "maxHeight",
968
+ scale: "sizes"
969
+ },
970
+ size: {
971
+ properties: ["width", "height"],
972
+ scale: "sizes"
973
+ },
974
+ overflow: true,
975
+ overflowX: true,
976
+ overflowY: true,
977
+ display: true,
978
+ verticalAlign: true
979
+ };
980
+ var layout = system(config);
981
+ var index_esm_default = layout;
982
+
983
+ // ../../node_modules/@styled-system/color/dist/index.esm.js
984
+ var config2 = {
985
+ color: {
986
+ property: "color",
987
+ scale: "colors"
988
+ },
989
+ backgroundColor: {
990
+ property: "backgroundColor",
991
+ scale: "colors"
992
+ },
993
+ opacity: true
994
+ };
995
+ config2.bg = config2.backgroundColor;
996
+ var color = system(config2);
997
+ var index_esm_default2 = color;
998
+
999
+ // ../../node_modules/@styled-system/typography/dist/index.esm.js
1000
+ var defaults2 = {
1001
+ fontSizes: [12, 14, 16, 20, 24, 32, 48, 64, 72]
1002
+ };
1003
+ var config3 = {
1004
+ fontFamily: {
1005
+ property: "fontFamily",
1006
+ scale: "fonts"
1007
+ },
1008
+ fontSize: {
1009
+ property: "fontSize",
1010
+ scale: "fontSizes",
1011
+ defaultScale: defaults2.fontSizes
1012
+ },
1013
+ fontWeight: {
1014
+ property: "fontWeight",
1015
+ scale: "fontWeights"
1016
+ },
1017
+ lineHeight: {
1018
+ property: "lineHeight",
1019
+ scale: "lineHeights"
1020
+ },
1021
+ letterSpacing: {
1022
+ property: "letterSpacing",
1023
+ scale: "letterSpacings"
1024
+ },
1025
+ textAlign: true,
1026
+ fontStyle: true
1027
+ };
1028
+ var typography = system(config3);
1029
+ var index_esm_default3 = typography;
1030
+
1031
+ // ../../node_modules/@styled-system/flexbox/dist/index.esm.js
1032
+ var config4 = {
1033
+ alignItems: true,
1034
+ alignContent: true,
1035
+ justifyItems: true,
1036
+ justifyContent: true,
1037
+ flexWrap: true,
1038
+ flexDirection: true,
1039
+ // item
1040
+ flex: true,
1041
+ flexGrow: true,
1042
+ flexShrink: true,
1043
+ flexBasis: true,
1044
+ justifySelf: true,
1045
+ alignSelf: true,
1046
+ order: true
1047
+ };
1048
+ var flexbox = system(config4);
1049
+ var index_esm_default4 = flexbox;
1050
+
1051
+ // ../../node_modules/@styled-system/grid/dist/index.esm.js
1052
+ var defaults3 = {
1053
+ space: [0, 4, 8, 16, 32, 64, 128, 256, 512]
1054
+ };
1055
+ var config5 = {
1056
+ gridGap: {
1057
+ property: "gridGap",
1058
+ scale: "space",
1059
+ defaultScale: defaults3.space
1060
+ },
1061
+ gridColumnGap: {
1062
+ property: "gridColumnGap",
1063
+ scale: "space",
1064
+ defaultScale: defaults3.space
1065
+ },
1066
+ gridRowGap: {
1067
+ property: "gridRowGap",
1068
+ scale: "space",
1069
+ defaultScale: defaults3.space
1070
+ },
1071
+ gridColumn: true,
1072
+ gridRow: true,
1073
+ gridAutoFlow: true,
1074
+ gridAutoColumns: true,
1075
+ gridAutoRows: true,
1076
+ gridTemplateColumns: true,
1077
+ gridTemplateRows: true,
1078
+ gridTemplateAreas: true,
1079
+ gridArea: true
1080
+ };
1081
+ var grid = system(config5);
1082
+ var index_esm_default5 = grid;
1083
+
1084
+ // ../../node_modules/@styled-system/border/dist/index.esm.js
1085
+ var config6 = {
1086
+ border: {
1087
+ property: "border",
1088
+ scale: "borders"
1089
+ },
1090
+ borderWidth: {
1091
+ property: "borderWidth",
1092
+ scale: "borderWidths"
1093
+ },
1094
+ borderStyle: {
1095
+ property: "borderStyle",
1096
+ scale: "borderStyles"
1097
+ },
1098
+ borderColor: {
1099
+ property: "borderColor",
1100
+ scale: "colors"
1101
+ },
1102
+ borderRadius: {
1103
+ property: "borderRadius",
1104
+ scale: "radii"
1105
+ },
1106
+ borderTop: {
1107
+ property: "borderTop",
1108
+ scale: "borders"
1109
+ },
1110
+ borderTopLeftRadius: {
1111
+ property: "borderTopLeftRadius",
1112
+ scale: "radii"
1113
+ },
1114
+ borderTopRightRadius: {
1115
+ property: "borderTopRightRadius",
1116
+ scale: "radii"
1117
+ },
1118
+ borderRight: {
1119
+ property: "borderRight",
1120
+ scale: "borders"
1121
+ },
1122
+ borderBottom: {
1123
+ property: "borderBottom",
1124
+ scale: "borders"
1125
+ },
1126
+ borderBottomLeftRadius: {
1127
+ property: "borderBottomLeftRadius",
1128
+ scale: "radii"
1129
+ },
1130
+ borderBottomRightRadius: {
1131
+ property: "borderBottomRightRadius",
1132
+ scale: "radii"
1133
+ },
1134
+ borderLeft: {
1135
+ property: "borderLeft",
1136
+ scale: "borders"
1137
+ },
1138
+ borderX: {
1139
+ properties: ["borderLeft", "borderRight"],
1140
+ scale: "borders"
1141
+ },
1142
+ borderY: {
1143
+ properties: ["borderTop", "borderBottom"],
1144
+ scale: "borders"
1145
+ }
1146
+ };
1147
+ config6.borderTopWidth = {
1148
+ property: "borderTopWidth",
1149
+ scale: "borderWidths"
1150
+ };
1151
+ config6.borderTopColor = {
1152
+ property: "borderTopColor",
1153
+ scale: "colors"
1154
+ };
1155
+ config6.borderTopStyle = {
1156
+ property: "borderTopStyle",
1157
+ scale: "borderStyles"
1158
+ };
1159
+ config6.borderTopLeftRadius = {
1160
+ property: "borderTopLeftRadius",
1161
+ scale: "radii"
1162
+ };
1163
+ config6.borderTopRightRadius = {
1164
+ property: "borderTopRightRadius",
1165
+ scale: "radii"
1166
+ };
1167
+ config6.borderBottomWidth = {
1168
+ property: "borderBottomWidth",
1169
+ scale: "borderWidths"
1170
+ };
1171
+ config6.borderBottomColor = {
1172
+ property: "borderBottomColor",
1173
+ scale: "colors"
1174
+ };
1175
+ config6.borderBottomStyle = {
1176
+ property: "borderBottomStyle",
1177
+ scale: "borderStyles"
1178
+ };
1179
+ config6.borderBottomLeftRadius = {
1180
+ property: "borderBottomLeftRadius",
1181
+ scale: "radii"
1182
+ };
1183
+ config6.borderBottomRightRadius = {
1184
+ property: "borderBottomRightRadius",
1185
+ scale: "radii"
1186
+ };
1187
+ config6.borderLeftWidth = {
1188
+ property: "borderLeftWidth",
1189
+ scale: "borderWidths"
1190
+ };
1191
+ config6.borderLeftColor = {
1192
+ property: "borderLeftColor",
1193
+ scale: "colors"
1194
+ };
1195
+ config6.borderLeftStyle = {
1196
+ property: "borderLeftStyle",
1197
+ scale: "borderStyles"
1198
+ };
1199
+ config6.borderRightWidth = {
1200
+ property: "borderRightWidth",
1201
+ scale: "borderWidths"
1202
+ };
1203
+ config6.borderRightColor = {
1204
+ property: "borderRightColor",
1205
+ scale: "colors"
1206
+ };
1207
+ config6.borderRightStyle = {
1208
+ property: "borderRightStyle",
1209
+ scale: "borderStyles"
1210
+ };
1211
+ var border = system(config6);
1212
+ var index_esm_default6 = border;
1213
+
1214
+ // ../../node_modules/@styled-system/background/dist/index.esm.js
1215
+ var config7 = {
1216
+ background: true,
1217
+ backgroundImage: true,
1218
+ backgroundSize: true,
1219
+ backgroundPosition: true,
1220
+ backgroundRepeat: true
1221
+ };
1222
+ config7.bgImage = config7.backgroundImage;
1223
+ config7.bgSize = config7.backgroundSize;
1224
+ config7.bgPosition = config7.backgroundPosition;
1225
+ config7.bgRepeat = config7.backgroundRepeat;
1226
+ var background = system(config7);
1227
+ var index_esm_default7 = background;
1228
+
1229
+ // ../../node_modules/@styled-system/position/dist/index.esm.js
1230
+ var defaults4 = {
1231
+ space: [0, 4, 8, 16, 32, 64, 128, 256, 512]
1232
+ };
1233
+ var config8 = {
1234
+ position: true,
1235
+ zIndex: {
1236
+ property: "zIndex",
1237
+ scale: "zIndices"
1238
+ },
1239
+ top: {
1240
+ property: "top",
1241
+ scale: "space",
1242
+ defaultScale: defaults4.space
1243
+ },
1244
+ right: {
1245
+ property: "right",
1246
+ scale: "space",
1247
+ defaultScale: defaults4.space
1248
+ },
1249
+ bottom: {
1250
+ property: "bottom",
1251
+ scale: "space",
1252
+ defaultScale: defaults4.space
1253
+ },
1254
+ left: {
1255
+ property: "left",
1256
+ scale: "space",
1257
+ defaultScale: defaults4.space
1258
+ }
1259
+ };
1260
+ var position = system(config8);
1261
+ var index_esm_default8 = position;
1262
+
1263
+ // ../../node_modules/@styled-system/space/dist/index.esm.js
1264
+ var defaults5 = {
1265
+ space: [0, 4, 8, 16, 32, 64, 128, 256, 512]
1266
+ };
1267
+ var isNumber3 = function isNumber4(n) {
1268
+ return typeof n === "number" && !isNaN(n);
1269
+ };
1270
+ var getMargin = function getMargin2(n, scale) {
1271
+ if (!isNumber3(n)) {
1272
+ return get(scale, n, n);
1273
+ }
1274
+ var isNegative = n < 0;
1275
+ var absolute = Math.abs(n);
1276
+ var value = get(scale, absolute, absolute);
1277
+ if (!isNumber3(value)) {
1278
+ return isNegative ? "-" + value : value;
1279
+ }
1280
+ return value * (isNegative ? -1 : 1);
1281
+ };
1282
+ var configs = {};
1283
+ configs.margin = {
1284
+ margin: {
1285
+ property: "margin",
1286
+ scale: "space",
1287
+ transform: getMargin,
1288
+ defaultScale: defaults5.space
1289
+ },
1290
+ marginTop: {
1291
+ property: "marginTop",
1292
+ scale: "space",
1293
+ transform: getMargin,
1294
+ defaultScale: defaults5.space
1295
+ },
1296
+ marginRight: {
1297
+ property: "marginRight",
1298
+ scale: "space",
1299
+ transform: getMargin,
1300
+ defaultScale: defaults5.space
1301
+ },
1302
+ marginBottom: {
1303
+ property: "marginBottom",
1304
+ scale: "space",
1305
+ transform: getMargin,
1306
+ defaultScale: defaults5.space
1307
+ },
1308
+ marginLeft: {
1309
+ property: "marginLeft",
1310
+ scale: "space",
1311
+ transform: getMargin,
1312
+ defaultScale: defaults5.space
1313
+ },
1314
+ marginX: {
1315
+ properties: ["marginLeft", "marginRight"],
1316
+ scale: "space",
1317
+ transform: getMargin,
1318
+ defaultScale: defaults5.space
1319
+ },
1320
+ marginY: {
1321
+ properties: ["marginTop", "marginBottom"],
1322
+ scale: "space",
1323
+ transform: getMargin,
1324
+ defaultScale: defaults5.space
1325
+ }
1326
+ };
1327
+ configs.margin.m = configs.margin.margin;
1328
+ configs.margin.mt = configs.margin.marginTop;
1329
+ configs.margin.mr = configs.margin.marginRight;
1330
+ configs.margin.mb = configs.margin.marginBottom;
1331
+ configs.margin.ml = configs.margin.marginLeft;
1332
+ configs.margin.mx = configs.margin.marginX;
1333
+ configs.margin.my = configs.margin.marginY;
1334
+ configs.padding = {
1335
+ padding: {
1336
+ property: "padding",
1337
+ scale: "space",
1338
+ defaultScale: defaults5.space
1339
+ },
1340
+ paddingTop: {
1341
+ property: "paddingTop",
1342
+ scale: "space",
1343
+ defaultScale: defaults5.space
1344
+ },
1345
+ paddingRight: {
1346
+ property: "paddingRight",
1347
+ scale: "space",
1348
+ defaultScale: defaults5.space
1349
+ },
1350
+ paddingBottom: {
1351
+ property: "paddingBottom",
1352
+ scale: "space",
1353
+ defaultScale: defaults5.space
1354
+ },
1355
+ paddingLeft: {
1356
+ property: "paddingLeft",
1357
+ scale: "space",
1358
+ defaultScale: defaults5.space
1359
+ },
1360
+ paddingX: {
1361
+ properties: ["paddingLeft", "paddingRight"],
1362
+ scale: "space",
1363
+ defaultScale: defaults5.space
1364
+ },
1365
+ paddingY: {
1366
+ properties: ["paddingTop", "paddingBottom"],
1367
+ scale: "space",
1368
+ defaultScale: defaults5.space
1369
+ }
1370
+ };
1371
+ configs.padding.p = configs.padding.padding;
1372
+ configs.padding.pt = configs.padding.paddingTop;
1373
+ configs.padding.pr = configs.padding.paddingRight;
1374
+ configs.padding.pb = configs.padding.paddingBottom;
1375
+ configs.padding.pl = configs.padding.paddingLeft;
1376
+ configs.padding.px = configs.padding.paddingX;
1377
+ configs.padding.py = configs.padding.paddingY;
1378
+ var margin = system(configs.margin);
1379
+ var padding = system(configs.padding);
1380
+ var space = compose(margin, padding);
1381
+
1382
+ // ../../node_modules/@styled-system/shadow/dist/index.esm.js
1383
+ var shadow = system({
1384
+ boxShadow: {
1385
+ property: "boxShadow",
1386
+ scale: "shadows"
1387
+ },
1388
+ textShadow: {
1389
+ property: "textShadow",
1390
+ scale: "shadows"
1391
+ }
1392
+ });
1393
+
1394
+ // ../../node_modules/@styled-system/css/dist/index.esm.js
1395
+ function _extends2() {
1396
+ _extends2 = Object.assign || function(target) {
1397
+ for (var i = 1; i < arguments.length; i++) {
1398
+ var source = arguments[i];
1399
+ for (var key in source) {
1400
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1401
+ target[key] = source[key];
1402
+ }
1403
+ }
1404
+ }
1405
+ return target;
1406
+ };
1407
+ return _extends2.apply(this, arguments);
1408
+ }
1409
+ var get3 = function get4(obj, key, def, p, undef) {
1410
+ key = key && key.split ? key.split(".") : [key];
1411
+ for (p = 0; p < key.length; p++) {
1412
+ obj = obj ? obj[key[p]] : undef;
1413
+ }
1414
+ return obj === undef ? def : obj;
1415
+ };
1416
+ var defaultBreakpoints = [40, 52, 64].map(function(n) {
1417
+ return n + "em";
1418
+ });
1419
+ var defaultTheme = {
1420
+ space: [0, 4, 8, 16, 32, 64, 128, 256, 512],
1421
+ fontSizes: [12, 14, 16, 20, 24, 32, 48, 64, 72]
1422
+ };
1423
+ var aliases = {
1424
+ bg: "backgroundColor",
1425
+ m: "margin",
1426
+ mt: "marginTop",
1427
+ mr: "marginRight",
1428
+ mb: "marginBottom",
1429
+ ml: "marginLeft",
1430
+ mx: "marginX",
1431
+ my: "marginY",
1432
+ p: "padding",
1433
+ pt: "paddingTop",
1434
+ pr: "paddingRight",
1435
+ pb: "paddingBottom",
1436
+ pl: "paddingLeft",
1437
+ px: "paddingX",
1438
+ py: "paddingY"
1439
+ };
1440
+ var multiples = {
1441
+ marginX: ["marginLeft", "marginRight"],
1442
+ marginY: ["marginTop", "marginBottom"],
1443
+ paddingX: ["paddingLeft", "paddingRight"],
1444
+ paddingY: ["paddingTop", "paddingBottom"],
1445
+ size: ["width", "height"]
1446
+ };
1447
+ var scales = {
1448
+ color: "colors",
1449
+ backgroundColor: "colors",
1450
+ borderColor: "colors",
1451
+ margin: "space",
1452
+ marginTop: "space",
1453
+ marginRight: "space",
1454
+ marginBottom: "space",
1455
+ marginLeft: "space",
1456
+ marginX: "space",
1457
+ marginY: "space",
1458
+ padding: "space",
1459
+ paddingTop: "space",
1460
+ paddingRight: "space",
1461
+ paddingBottom: "space",
1462
+ paddingLeft: "space",
1463
+ paddingX: "space",
1464
+ paddingY: "space",
1465
+ top: "space",
1466
+ right: "space",
1467
+ bottom: "space",
1468
+ left: "space",
1469
+ gridGap: "space",
1470
+ gridColumnGap: "space",
1471
+ gridRowGap: "space",
1472
+ gap: "space",
1473
+ columnGap: "space",
1474
+ rowGap: "space",
1475
+ fontFamily: "fonts",
1476
+ fontSize: "fontSizes",
1477
+ fontWeight: "fontWeights",
1478
+ lineHeight: "lineHeights",
1479
+ letterSpacing: "letterSpacings",
1480
+ border: "borders",
1481
+ borderTop: "borders",
1482
+ borderRight: "borders",
1483
+ borderBottom: "borders",
1484
+ borderLeft: "borders",
1485
+ borderWidth: "borderWidths",
1486
+ borderStyle: "borderStyles",
1487
+ borderRadius: "radii",
1488
+ borderTopRightRadius: "radii",
1489
+ borderTopLeftRadius: "radii",
1490
+ borderBottomRightRadius: "radii",
1491
+ borderBottomLeftRadius: "radii",
1492
+ borderTopWidth: "borderWidths",
1493
+ borderTopColor: "colors",
1494
+ borderTopStyle: "borderStyles",
1495
+ borderBottomWidth: "borderWidths",
1496
+ borderBottomColor: "colors",
1497
+ borderBottomStyle: "borderStyles",
1498
+ borderLeftWidth: "borderWidths",
1499
+ borderLeftColor: "colors",
1500
+ borderLeftStyle: "borderStyles",
1501
+ borderRightWidth: "borderWidths",
1502
+ borderRightColor: "colors",
1503
+ borderRightStyle: "borderStyles",
1504
+ outlineColor: "colors",
1505
+ boxShadow: "shadows",
1506
+ textShadow: "shadows",
1507
+ zIndex: "zIndices",
1508
+ width: "sizes",
1509
+ minWidth: "sizes",
1510
+ maxWidth: "sizes",
1511
+ height: "sizes",
1512
+ minHeight: "sizes",
1513
+ maxHeight: "sizes",
1514
+ flexBasis: "sizes",
1515
+ size: "sizes",
1516
+ // svg
1517
+ fill: "colors",
1518
+ stroke: "colors"
1519
+ };
1520
+ var positiveOrNegative = function positiveOrNegative2(scale, value) {
1521
+ if (typeof value !== "number" || value >= 0) {
1522
+ return get3(scale, value, value);
1523
+ }
1524
+ var absolute = Math.abs(value);
1525
+ var n = get3(scale, absolute, absolute);
1526
+ if (typeof n === "string")
1527
+ return "-" + n;
1528
+ return n * -1;
1529
+ };
1530
+ var transforms = ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "marginX", "marginY", "top", "bottom", "left", "right"].reduce(function(acc, curr) {
1531
+ var _extends22;
1532
+ return _extends2({}, acc, (_extends22 = {}, _extends22[curr] = positiveOrNegative, _extends22));
1533
+ }, {});
1534
+ var responsive = function responsive2(styles) {
1535
+ return function(theme2) {
1536
+ var next = {};
1537
+ var breakpoints = get3(theme2, "breakpoints", defaultBreakpoints);
1538
+ var mediaQueries = [null].concat(breakpoints.map(function(n) {
1539
+ return "@media screen and (min-width: " + n + ")";
1540
+ }));
1541
+ for (var key in styles) {
1542
+ var value = typeof styles[key] === "function" ? styles[key](theme2) : styles[key];
1543
+ if (value == null)
1544
+ continue;
1545
+ if (!Array.isArray(value)) {
1546
+ next[key] = value;
1547
+ continue;
1548
+ }
1549
+ for (var i = 0; i < value.slice(0, mediaQueries.length).length; i++) {
1550
+ var media = mediaQueries[i];
1551
+ if (!media) {
1552
+ next[key] = value[i];
1553
+ continue;
1554
+ }
1555
+ next[media] = next[media] || {};
1556
+ if (value[i] == null)
1557
+ continue;
1558
+ next[media][key] = value[i];
1559
+ }
1560
+ }
1561
+ return next;
1562
+ };
1563
+ };
1564
+ var css2 = function css3(args) {
1565
+ return function(props) {
1566
+ if (props === void 0) {
1567
+ props = {};
1568
+ }
1569
+ var theme2 = _extends2({}, defaultTheme, {}, props.theme || props);
1570
+ var result = {};
1571
+ var obj = typeof args === "function" ? args(theme2) : args;
1572
+ var styles = responsive(obj)(theme2);
1573
+ for (var key in styles) {
1574
+ var x = styles[key];
1575
+ var val = typeof x === "function" ? x(theme2) : x;
1576
+ if (key === "variant") {
1577
+ var variant3 = css3(get3(theme2, val))(theme2);
1578
+ result = _extends2({}, result, {}, variant3);
1579
+ continue;
1580
+ }
1581
+ if (val && typeof val === "object") {
1582
+ result[key] = css3(val)(theme2);
1583
+ continue;
1584
+ }
1585
+ var prop = get3(aliases, key, key);
1586
+ var scaleName = get3(scales, prop);
1587
+ var scale = get3(theme2, scaleName, get3(theme2, prop, {}));
1588
+ var transform = get3(transforms, prop, get3);
1589
+ var value = transform(scale, val, val);
1590
+ if (multiples[prop]) {
1591
+ var dirs = multiples[prop];
1592
+ for (var i = 0; i < dirs.length; i++) {
1593
+ result[dirs[i]] = value;
1594
+ }
1595
+ } else {
1596
+ result[prop] = value;
1597
+ }
1598
+ }
1599
+ return result;
1600
+ };
1601
+ };
1602
+ var index_esm_default9 = css2;
1603
+
1604
+ // ../../node_modules/@styled-system/variant/dist/index.esm.js
1605
+ var variant = function variant2(_ref) {
1606
+ var _config;
1607
+ var scale = _ref.scale, _ref$prop = _ref.prop, prop = _ref$prop === void 0 ? "variant" : _ref$prop, _ref$variants = _ref.variants, variants = _ref$variants === void 0 ? {} : _ref$variants, key = _ref.key;
1608
+ var sx;
1609
+ if (Object.keys(variants).length) {
1610
+ sx = function sx2(value, scale2, props) {
1611
+ return index_esm_default9(get(scale2, value, null))(props.theme);
1612
+ };
1613
+ } else {
1614
+ sx = function sx2(value, scale2) {
1615
+ return get(scale2, value, null);
1616
+ };
1617
+ }
1618
+ sx.scale = scale || key;
1619
+ sx.defaults = variants;
1620
+ var config9 = (_config = {}, _config[prop] = sx, _config);
1621
+ var parser = createParser(config9);
1622
+ return parser;
1623
+ };
1624
+ var buttonStyle = variant({
1625
+ key: "buttons"
1626
+ });
1627
+ var textStyle = variant({
1628
+ key: "textStyles",
1629
+ prop: "textStyle"
1630
+ });
1631
+ var colorStyle = variant({
1632
+ key: "colorStyles",
1633
+ prop: "colors"
1634
+ });
1635
+
1636
+ // ../../node_modules/styled-system/dist/index.esm.js
1637
+ var width = index_esm_default.width;
1638
+ var height = index_esm_default.height;
1639
+ var minWidth = index_esm_default.minWidth;
1640
+ var minHeight = index_esm_default.minHeight;
1641
+ var maxWidth = index_esm_default.maxWidth;
1642
+ var maxHeight = index_esm_default.maxHeight;
1643
+ var size = index_esm_default.size;
1644
+ var verticalAlign = index_esm_default.verticalAlign;
1645
+ var display = index_esm_default.display;
1646
+ var overflow = index_esm_default.overflow;
1647
+ var overflowX = index_esm_default.overflowX;
1648
+ var overflowY = index_esm_default.overflowY;
1649
+ var opacity = index_esm_default2.opacity;
1650
+ var fontSize = index_esm_default3.fontSize;
1651
+ var fontFamily = index_esm_default3.fontFamily;
1652
+ var fontWeight = index_esm_default3.fontWeight;
1653
+ var lineHeight = index_esm_default3.lineHeight;
1654
+ var textAlign = index_esm_default3.textAlign;
1655
+ var fontStyle = index_esm_default3.fontStyle;
1656
+ var letterSpacing = index_esm_default3.letterSpacing;
1657
+ var alignItems = index_esm_default4.alignItems;
1658
+ var alignContent = index_esm_default4.alignContent;
1659
+ var justifyItems = index_esm_default4.justifyItems;
1660
+ var justifyContent = index_esm_default4.justifyContent;
1661
+ var flexWrap = index_esm_default4.flexWrap;
1662
+ var flexDirection = index_esm_default4.flexDirection;
1663
+ var flex = index_esm_default4.flex;
1664
+ var flexGrow = index_esm_default4.flexGrow;
1665
+ var flexShrink = index_esm_default4.flexShrink;
1666
+ var flexBasis = index_esm_default4.flexBasis;
1667
+ var justifySelf = index_esm_default4.justifySelf;
1668
+ var alignSelf = index_esm_default4.alignSelf;
1669
+ var order = index_esm_default4.order;
1670
+ var gridGap = index_esm_default5.gridGap;
1671
+ var gridColumnGap = index_esm_default5.gridColumnGap;
1672
+ var gridRowGap = index_esm_default5.gridRowGap;
1673
+ var gridColumn = index_esm_default5.gridColumn;
1674
+ var gridRow = index_esm_default5.gridRow;
1675
+ var gridAutoFlow = index_esm_default5.gridAutoFlow;
1676
+ var gridAutoColumns = index_esm_default5.gridAutoColumns;
1677
+ var gridAutoRows = index_esm_default5.gridAutoRows;
1678
+ var gridTemplateColumns = index_esm_default5.gridTemplateColumns;
1679
+ var gridTemplateRows = index_esm_default5.gridTemplateRows;
1680
+ var gridTemplateAreas = index_esm_default5.gridTemplateAreas;
1681
+ var gridArea = index_esm_default5.gridArea;
1682
+ var borderWidth = index_esm_default6.borderWidth;
1683
+ var borderStyle = index_esm_default6.borderStyle;
1684
+ var borderColor = index_esm_default6.borderColor;
1685
+ var borderTop = index_esm_default6.borderTop;
1686
+ var borderRight = index_esm_default6.borderRight;
1687
+ var borderBottom = index_esm_default6.borderBottom;
1688
+ var borderLeft = index_esm_default6.borderLeft;
1689
+ var borderRadius = index_esm_default6.borderRadius;
1690
+ var backgroundImage = index_esm_default7.backgroundImage;
1691
+ var backgroundSize = index_esm_default7.backgroundSize;
1692
+ var backgroundPosition = index_esm_default7.backgroundPosition;
1693
+ var backgroundRepeat = index_esm_default7.backgroundRepeat;
1694
+ var zIndex = index_esm_default8.zIndex;
1695
+ var top = index_esm_default8.top;
1696
+ var right = index_esm_default8.right;
1697
+ var bottom = index_esm_default8.bottom;
1698
+ var left = index_esm_default8.left;
1699
+
1700
+ // src/MenuItem/styles.tsx
1701
+ import {
1702
+ CheckboxContainer,
1703
+ InputWrapper,
1704
+ PillInput,
1705
+ checkboxContainerHoverStyles,
1706
+ inputWrapperHoverStyles,
1707
+ pillInputHoverStyles
1708
+ } from "@sproutsocial/seeds-react-checkbox";
1709
+ var highlightedStyles = css4`
1710
+ cursor: pointer;
1711
+ border: 1px solid ${({ theme: theme2 }) => theme2.colors.listItem.border.base};
1712
+ background-color: ${({ theme: theme2 }) => theme2.colors.listItem.background.hover};
1713
+ `;
1714
+ var MenuItemContainer = styled.li`
1715
+ border-radius: ${({ theme: theme2 }) => theme2.radii[500]};
1716
+ background-color: ${({ theme: theme2 }) => theme2.colors.listItem.background.base};
1717
+ border: 1px solid ${({ theme: theme2 }) => theme2.colors.listItem.background.base};
1718
+ color: ${({ theme: theme2 }) => theme2.colors.text.body};
1719
+ font-family: ${({ theme: theme2 }) => theme2.fontFamily};
1720
+ font-weight: ${({ theme: theme2 }) => theme2.fontWeights.normal};
1721
+ padding: ${({ theme: theme2 }) => theme2.space[300]};
1722
+ list-style-type: none;
1723
+ outline: 0;
1724
+ ${({ theme: theme2 }) => theme2.typography[200]};
1725
+ transition: all ${({ theme: theme2 }) => theme2.duration["fast"]};
1726
+
1727
+ /* Highlighted */
1728
+ ${({ $highlighted }) => $highlighted && highlightedStyles}
1729
+
1730
+ /* Hovered, but not focused */
1731
+ &:hover {
1732
+ ${highlightedStyles}
1733
+ ${CheckboxContainer} {
1734
+ ${checkboxContainerHoverStyles}
1735
+ }
1736
+ ${InputWrapper} {
1737
+ ${inputWrapperHoverStyles}
1738
+ }
1739
+ ${PillInput} {
1740
+ ${pillInputHoverStyles}
1741
+ }
1742
+ }
1743
+
1744
+ /* focused */
1745
+ &:focus {
1746
+ ${focusRing}
1747
+ }
1748
+
1749
+ /* Pressed state*/
1750
+ &:active {
1751
+ background-color: ${({ theme: theme2 }) => theme2.colors.listItem.background.active};
1752
+ color: ${({ theme: theme2 }) => theme2.colors.text.inverse};
1753
+ }
1754
+
1755
+ &[aria-disabled="true"] {
1756
+ cursor: not-allowed;
1757
+ ${disabled}
1758
+ }
1759
+
1760
+ ${border}
1761
+ ${color}
1762
+ ${flexbox}
1763
+ ${grid}
1764
+ ${layout}
1765
+ ${space}
1766
+ `;
1767
+
1768
+ // src/MenuItem/MenuItem.tsx
1769
+ import { jsx as jsx2 } from "react/jsx-runtime";
1770
+ var MenuItem = ({
1771
+ id,
1772
+ children,
1773
+ role = "menuitem",
1774
+ label,
1775
+ onClick,
1776
+ onKeyDown,
1777
+ disabled: disabled2 = false,
1778
+ ref,
1779
+ color: color2,
1780
+ ...props
1781
+ }) => {
1782
+ const { getItemProps, itemsMap, highlightedIndex, isListbox } = useContext2(MenuContext);
1783
+ const item = itemsMap[id] || { index: 0, id };
1784
+ const highlighted = highlightedIndex === item?.index;
1785
+ return /* @__PURE__ */ jsx2(
1786
+ MenuItemContainer,
1787
+ {
1788
+ id,
1789
+ tabIndex: role !== MENU_ITEM_ROLES.LISTITEM && !disabled2 ? -1 : void 0,
1790
+ $highlighted: highlighted,
1791
+ ...getItemProps?.({
1792
+ ...isListbox ? {} : { role: "menuitem" },
1793
+ item,
1794
+ index: item.index,
1795
+ // This prop no longer supported in downshift
1796
+ // disabled,
1797
+ onClick,
1798
+ onKeyDown
1799
+ }),
1800
+ ...props,
1801
+ children
1802
+ }
1803
+ );
1804
+ };
1805
+
1806
+ // src/MenuItemSelectable/MenuItemSelectable.tsx
1807
+ import { useContext as useContext3, useMemo as useMemo2 } from "react";
1808
+ import { Icon } from "@sproutsocial/seeds-react-icon";
1809
+ import { Checkbox } from "@sproutsocial/seeds-react-checkbox";
1810
+ import { Switch } from "@sproutsocial/seeds-react-switch";
1811
+ import { Radio } from "@sproutsocial/seeds-react-radio";
1812
+ import { useTheme } from "styled-components";
1813
+ import { Box } from "@sproutsocial/seeds-react-box";
1814
+
1815
+ // src/MenuItemSelectable/styles.tsx
1816
+ import styled2 from "styled-components";
1817
+ var MenuItemSelectableRow = styled2.div`
1818
+ display: flex;
1819
+ align-items: center;
1820
+ pointer-events: none;
1821
+ `;
1822
+ var MenuItemSelectableAction = styled2.div`
1823
+ margin-right: ${({ theme: theme2 }) => theme2.space[300]};
1824
+ display: flex;
1825
+ align-items: center;
1826
+ justify-content: center;
1827
+ flex-shrink: 0;
1828
+ `;
1829
+ var MenuItemSelectableText = styled2.div`
1830
+ word-break: break-word;
1831
+ flex-grow: 1;
1832
+ min-width: 0;
1833
+ `;
1834
+
1835
+ // src/MenuItemSelectable/MenuItemSelectable.tsx
1836
+ import { jsx as jsx3, jsxs } from "react/jsx-runtime";
1837
+ var SelectionIndicator = ({
1838
+ id,
1839
+ inputType = "icon",
1840
+ "aria-labelledby": labeledBy,
1841
+ selected
1842
+ }) => {
1843
+ const { space: space2 } = useTheme();
1844
+ const inputStub = (e) => {
1845
+ e.stopPropagation();
1846
+ };
1847
+ switch (inputType) {
1848
+ case "checkbox":
1849
+ return /* @__PURE__ */ jsx3(
1850
+ Checkbox,
1851
+ {
1852
+ onChange: () => {
1853
+ },
1854
+ checked: selected,
1855
+ "aria-labelledby": labeledBy,
1856
+ id: `MenuItemSelectable-${inputType}-${id}`
1857
+ }
1858
+ );
1859
+ case "switch":
1860
+ return /* @__PURE__ */ jsx3(
1861
+ Switch,
1862
+ {
1863
+ onClick: inputStub,
1864
+ checked: !!selected,
1865
+ "aria-labelledby": labeledBy,
1866
+ id: `MenuItemSelectable-${inputType}-${id}`
1867
+ }
1868
+ );
1869
+ case "radio":
1870
+ return /* @__PURE__ */ jsx3(
1871
+ Radio,
1872
+ {
1873
+ checked: selected,
1874
+ id: `MenuItemSelectable-${inputType}-${id}`,
1875
+ name: `MenuItemSelectable-${inputType}`,
1876
+ "aria-labelledby": labeledBy
1877
+ }
1878
+ );
1879
+ case "icon":
1880
+ if (selected) {
1881
+ return /* @__PURE__ */ jsx3(Icon, { name: "check-solid", "aria-hidden": true, size: "small" });
1882
+ } else {
1883
+ return /* @__PURE__ */ jsx3(Box, { width: space2["400"] });
1884
+ }
1885
+ default:
1886
+ return null;
1887
+ }
1888
+ };
1889
+ var MenuItemSelectable = ({
1890
+ id,
1891
+ children,
1892
+ inputType = "icon",
1893
+ inputLabel,
1894
+ ...props
1895
+ }) => {
1896
+ const { selectedItem, selectedItems, isListbox } = useContext3(MenuContext);
1897
+ const selected = useMemo2(
1898
+ () => selectedItem?.id === id || !!selectedItems?.find((item) => item?.id === id),
1899
+ [selectedItem, selectedItems]
1900
+ );
1901
+ if (isListbox === false) {
1902
+ console.warn(
1903
+ "MenuItemSelectable is invalid when isListbox is false (Menu)"
1904
+ );
1905
+ }
1906
+ const label = inputLabel || `menu-item-child-${id}`;
1907
+ return /* @__PURE__ */ jsx3(
1908
+ MenuItem,
1909
+ {
1910
+ active: selected,
1911
+ id,
1912
+ "aria-selected": selected,
1913
+ ...props,
1914
+ children: /* @__PURE__ */ jsxs(MenuItemSelectableRow, { children: [
1915
+ /* @__PURE__ */ jsx3(MenuItemSelectableAction, { children: /* @__PURE__ */ jsx3(
1916
+ SelectionIndicator,
1917
+ {
1918
+ id,
1919
+ "aria-labelledby": label,
1920
+ inputType,
1921
+ selected: !!selected
1922
+ }
1923
+ ) }),
1924
+ /* @__PURE__ */ jsx3(MenuItemSelectableText, { id: label, children })
1925
+ ] })
1926
+ }
1927
+ );
1928
+ };
1929
+
1930
+ // src/MenuItemSelectable/MenuItemSelectableTypes.ts
1931
+ var INPUT_TYPES = {
1932
+ CHECKBOX: "checkbox",
1933
+ RADIO: "radio",
1934
+ SWITCH: "switch",
1935
+ ICON: "icon"
1936
+ };
1937
+
1938
+ // src/MenuHeader/MenuHeader.tsx
1939
+ import "react";
1940
+
1941
+ // src/MenuHeader/styles.tsx
1942
+ import styled3 from "styled-components";
1943
+ var MenuHeaderContainer = styled3.div`
1944
+ border-color: ${({ theme: theme2 }) => theme2.colors.container.border.base};
1945
+ border-bottom-width: 1px;
1946
+ border-bottom-style: solid;
1947
+ box-sizing: border-box;
1948
+ width: 100%;
1949
+ font-size: ${({ theme: theme2 }) => theme2.typography[200].fontSize};
1950
+ display: flex;
1951
+ padding: ${({ theme: theme2 }) => theme2.space[350]} ${({ theme: theme2 }) => theme2.space[400]};
1952
+
1953
+ > a {
1954
+ white-space: nowrap;
1955
+ }
1956
+
1957
+ &:first-child {
1958
+ flex-grow: 1;
1959
+ justify-self: start;
1960
+ }
1961
+
1962
+ &:last-child {
1963
+ flex-grow: 1;
1964
+ justify-self: end;
1965
+ }
1966
+
1967
+ ${({ $leftAction, theme: theme2 }) => $leftAction && `
1968
+ padding-left: ${theme2.space[350]};
1969
+ `}
1970
+
1971
+ ${border}
1972
+ ${color}
1973
+ ${flexbox}
1974
+ ${grid}
1975
+ ${layout}
1976
+ ${space}
1977
+ ${position}
1978
+ `;
1979
+ var MenuTitleText = styled3.h3`
1980
+ color: ${({ theme: theme2 }) => theme2.colors.text.headline};
1981
+ font-weight: ${({ theme: theme2 }) => theme2.fontWeights.bold};
1982
+ margin: 0px;
1983
+ flex-grow: 2;
1984
+ justify-self: start;
1985
+
1986
+ ${({ $leftAction, theme: theme2 }) => $leftAction && `
1987
+ padding-left: ${theme2.space[350]};
1988
+ `}
1989
+
1990
+ ${({ theme: theme2 }) => theme2.typography[200]}
1991
+ `;
1992
+ var MenuChildrenContainer = styled3.div`
1993
+ grid-column: 1 / -1;
1994
+ margin-top: ${({ theme: theme2 }) => theme2.space[300]};
1995
+ `;
1996
+
1997
+ // src/MenuHeader/MenuHeader.tsx
1998
+ import { Fragment, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
1999
+ var MenuHeader = ({
2000
+ children,
2001
+ title,
2002
+ leftAction,
2003
+ rightAction,
2004
+ ...rest
2005
+ }) => {
2006
+ return /* @__PURE__ */ jsx4(Fragment, { children: /* @__PURE__ */ jsxs2(MenuHeaderContainer, { $leftAction: !!leftAction, ...rest, children: [
2007
+ leftAction && leftAction,
2008
+ title && /* @__PURE__ */ jsx4(MenuTitleText, { $leftAction: !!leftAction, children: title }),
2009
+ rightAction && rightAction,
2010
+ children && /* @__PURE__ */ jsx4(MenuChildrenContainer, { children })
2011
+ ] }) });
2012
+ };
2013
+
2014
+ // src/MenuContent/styles.tsx
2015
+ import styled4 from "styled-components";
2016
+ var StyledMenuContent = styled4.ul`
2017
+ margin: 0;
2018
+ padding: ${({ theme: theme2 }) => theme2.space[300]} 0;
2019
+ &:focus {
2020
+ ${focusRing}
2021
+ }
2022
+ `;
2023
+
2024
+ // src/MenuContent/MenuContent.tsx
2025
+ import { jsx as jsx5 } from "react/jsx-runtime";
2026
+ var MenuContent = ({
2027
+ id = "menu_content",
2028
+ children,
2029
+ ...rest
2030
+ }) => {
2031
+ const { getToggleButtonProps } = useMenuContext();
2032
+ return /* @__PURE__ */ jsx5(
2033
+ StyledMenuContent,
2034
+ {
2035
+ autoFocus: true,
2036
+ id,
2037
+ tabIndex: 0,
2038
+ onKeyDown: getToggleButtonProps?.().onKeyDown,
2039
+ "aria-activedescendant": getToggleButtonProps?.()["aria-activedescendant"],
2040
+ ...rest,
2041
+ children
2042
+ }
2043
+ );
2044
+ };
2045
+
2046
+ // src/MenuFooter/MenuFooter.tsx
2047
+ import "react";
2048
+
2049
+ // src/MenuFooter/styles.tsx
2050
+ import styled5 from "styled-components";
2051
+ import { Box as Box2 } from "@sproutsocial/seeds-react-box";
2052
+ var StyledMenuFooterBox = styled5(Box2)`
2053
+ padding: ${(p) => p.theme.space[350]};
2054
+ border-top: 1px solid ${(p) => p.theme.colors.container.border.base};
2055
+ `;
2056
+
2057
+ // src/MenuFooter/MenuFooter.tsx
2058
+ import { jsx as jsx6 } from "react/jsx-runtime";
2059
+ var MenuFooter = ({ children, ...rest }) => {
2060
+ return /* @__PURE__ */ jsx6(StyledMenuFooterBox, { ...rest, children });
2061
+ };
2062
+
2063
+ // src/MenuGroup/MenuGroup.tsx
2064
+ import "react";
2065
+
2066
+ // src/MenuGroup/styles.tsx
2067
+ import styled7 from "styled-components";
2068
+
2069
+ // ../seeds-react-text/dist/esm/index.js
2070
+ import "react";
2071
+ import styled22 from "styled-components";
2072
+ import styled6, { css as css5 } from "styled-components";
2073
+ import {
2074
+ COMMON,
2075
+ LAYOUT,
2076
+ FLEXBOX,
2077
+ GRID,
2078
+ TYPOGRAPHY
2079
+ } from "@sproutsocial/seeds-react-system-props";
2080
+ import { jsx as jsx7 } from "react/jsx-runtime";
2081
+ import "react";
2082
+ var Container = styled6.span`
2083
+ margin: 0;
2084
+ padding-left: 0;
2085
+ padding-right: 0;
2086
+ font-family: ${(props) => props.theme.fontFamily};
2087
+ font-style: ${(props) => {
2088
+ return props.isItalicized && "italic";
2089
+ }};
2090
+
2091
+ ${(props) => props.truncated && css5`
2092
+ display: block;
2093
+ overflow: hidden;
2094
+ white-space: nowrap;
2095
+ text-overflow: ellipsis;
2096
+ `}
2097
+
2098
+ ${(props) => props.breakWord && css5`
2099
+ word-break: break-word;
2100
+ hyphens: auto;
2101
+ `}
2102
+
2103
+ ${COMMON}
2104
+ ${LAYOUT}
2105
+ ${FLEXBOX}
2106
+ ${GRID}
2107
+ ${TYPOGRAPHY}
2108
+ `;
2109
+ var styles_default = Container;
2110
+ var Headline = styled22(styles_default)`
2111
+ color: ${(props) => props.theme.colors.text.headline};
2112
+ font-weight: ${(props) => props.theme.fontWeights.bold};
2113
+ ${(props) => props.theme.typography[400]}
2114
+ `;
2115
+ var SubHeadline = styled22(styles_default)`
2116
+ color: ${(props) => props.theme.colors.text.headline};
2117
+ font-weight: ${(props) => props.theme.fontWeights.bold};
2118
+ ${(props) => props.theme.typography[300]}
2119
+ `;
2120
+ var SmallSubHeadline = styled22(styles_default)`
2121
+ color: ${(props) => props.theme.colors.text.headline};
2122
+ font-weight: ${(props) => props.theme.fontWeights.bold};
2123
+ ${(props) => props.theme.typography[200]}
2124
+ `;
2125
+ var Byline = styled22(styles_default)`
2126
+ color: ${(props) => props.theme.colors.text.subtext};
2127
+ ${(props) => props.theme.typography[200]}
2128
+ `;
2129
+ var SmallByline = styled22(styles_default)`
2130
+ color: ${(props) => props.theme.colors.text.subtext};
2131
+ ${(props) => props.theme.typography[100]}
2132
+ `;
2133
+ var BodyCopy = styled22(styles_default)`
2134
+ color: ${(props) => props.theme.colors.text.body};
2135
+ ${(props) => props.theme.typography[300]}
2136
+ `;
2137
+ var SmallBodyCopy = styled22(styles_default)`
2138
+ color: ${(props) => props.theme.colors.text.body};
2139
+ ${(props) => props.theme.typography[200]}
2140
+ `;
2141
+ var Text = ({ fontSize: fontSize2, children, qa, color: color2, ...rest }) => {
2142
+ const qaText = typeof children === "string" ? children : void 0;
2143
+ return /* @__PURE__ */ jsx7(
2144
+ styles_default,
2145
+ {
2146
+ typeScale: fontSize2,
2147
+ "data-qa-text": qaText,
2148
+ color: color2,
2149
+ ...qa,
2150
+ ...rest,
2151
+ children
2152
+ }
2153
+ );
2154
+ };
2155
+ Headline.displayName = "Text.Headline";
2156
+ SubHeadline.displayName = "Text.SubHeadline";
2157
+ SmallSubHeadline.displayName = "Text.SmallSubHeadline";
2158
+ Byline.displayName = "Text.Byline";
2159
+ SmallByline.displayName = "Text.SmallByline";
2160
+ BodyCopy.displayName = "Text.BodyCopy";
2161
+ SmallBodyCopy.displayName = "Text.SmallBodyCopy";
2162
+ Text.Headline = Headline;
2163
+ Text.SubHeadline = SubHeadline;
2164
+ Text.SmallSubHeadline = SmallSubHeadline;
2165
+ Text.Byline = Byline;
2166
+ Text.SmallByline = SmallByline;
2167
+ Text.BodyCopy = BodyCopy;
2168
+ Text.SmallBodyCopy = SmallBodyCopy;
2169
+ var Text_default = Text;
2170
+ var src_default = Text_default;
2171
+
2172
+ // src/MenuGroup/styles.tsx
2173
+ var StyledMenuGroup = styled7.li`
2174
+ &:not(:last-child) {
2175
+ border-bottom: 1px solid
2176
+ ${({ theme: theme2 }) => theme2.colors.container.border.base};
2177
+ }
2178
+ list-style: none;
2179
+ margin: 0;
2180
+ ${border}
2181
+ ${position}
2182
+ ${color}
2183
+ ${flexbox}
2184
+ ${grid}
2185
+ ${layout}
2186
+ ${space}
2187
+ `;
2188
+ var StyledTitle = styled7(src_default.SmallSubHeadline)`
2189
+ margin: ${({ theme: theme2 }) => theme2.space[200]} 0px
2190
+ ${({ theme: theme2 }) => theme2.space[300]} ${({ theme: theme2 }) => theme2.space[300]};
2191
+ `;
2192
+ var StyledMenuGroupUl = styled7.ul`
2193
+ margin: 0;
2194
+ padding: ${({ theme: theme2 }) => theme2.space[300]};
2195
+ `;
2196
+
2197
+ // src/MenuGroup/MenuGroup.tsx
2198
+ import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
2199
+ var MenuGroup = ({
2200
+ titleAs = "h3",
2201
+ children,
2202
+ title,
2203
+ color: color2,
2204
+ ...rest
2205
+ }) => {
2206
+ const titleId = `menu-group-title-${Math.random().toString(36).slice(2, 11)}`;
2207
+ return /* @__PURE__ */ jsxs3(
2208
+ StyledMenuGroup,
2209
+ {
2210
+ role: "group",
2211
+ "aria-labelledby": title ? titleId : void 0,
2212
+ color: color2,
2213
+ ...rest,
2214
+ children: [
2215
+ title && /* @__PURE__ */ jsx8(StyledTitle, { as: titleAs, id: titleId, children: title }),
2216
+ /* @__PURE__ */ jsx8(StyledMenuGroupUl, { children })
2217
+ ]
2218
+ }
2219
+ );
2220
+ };
2221
+
2222
+ // src/MenuRoot/MenuRoot.tsx
2223
+ import { useCallback } from "react";
2224
+ import styled8 from "styled-components";
2225
+ import { Popout } from "@sproutsocial/seeds-react-popout";
2226
+ import { jsx as jsx9 } from "react/jsx-runtime";
2227
+ var CustomPopoutContent = styled8(Popout.Content)`
2228
+ padding: 0;
2229
+ margin-left: 0;
2230
+ margin-right: 0;
2231
+ `;
2232
+ var MenuRoot = ({
2233
+ children,
2234
+ triggerElement,
2235
+ popoutProps,
2236
+ width: width2 = "300px",
2237
+ ...contextProps
2238
+ }) => {
2239
+ const { isListbox, isOpen, openMenu, closeMenu, getMenuProps } = contextProps;
2240
+ const setIsOpen = useCallback(
2241
+ (newIsOpen) => {
2242
+ newIsOpen ? openMenu?.() : closeMenu?.();
2243
+ },
2244
+ [openMenu, closeMenu]
2245
+ );
2246
+ return /* @__PURE__ */ jsx9(MenuProvider, { ...contextProps, children: /* @__PURE__ */ jsx9(
2247
+ Popout,
2248
+ {
2249
+ isOpen: !!isOpen,
2250
+ setIsOpen,
2251
+ content: /* @__PURE__ */ jsx9(CustomPopoutContent, { width: width2, children: /* @__PURE__ */ jsx9(
2252
+ "div",
2253
+ {
2254
+ ...getMenuProps?.(
2255
+ {
2256
+ ...isListbox ? {} : { role: "menu" }
2257
+ },
2258
+ // Suppress ref error for now
2259
+ { suppressRefError: true }
2260
+ ),
2261
+ children
2262
+ }
2263
+ ) }),
2264
+ focusLockProps: {
2265
+ // correct jerking motion when scrolling while the Popout is open
2266
+ // returnFocus: false,
2267
+ crossFrame: false
2268
+ },
2269
+ disableWrapperAria: true,
2270
+ ...popoutProps,
2271
+ children: triggerElement
2272
+ }
2273
+ ) });
2274
+ };
2275
+
2276
+ // src/MenuLabel.tsx
2277
+ import "react";
2278
+ import { jsx as jsx10 } from "react/jsx-runtime";
2279
+ var MenuLabel = ({ children, ...rest }) => {
2280
+ const { getLabelProps } = useMenuContext();
2281
+ return /* @__PURE__ */ jsx10(Text_default, { as: "label", color: "text.body", ...getLabelProps?.(), ...rest, children });
2282
+ };
2283
+
2284
+ // src/MenuToggleButton.tsx
2285
+ import { useContext as useContext4 } from "react";
2286
+ import { Button } from "@sproutsocial/seeds-react-button";
2287
+ import { jsx as jsx11 } from "react/jsx-runtime";
2288
+ var MenuToggleButton = ({
2289
+ children,
2290
+ ...rest
2291
+ }) => {
2292
+ const { getToggleButtonProps, isListbox, getDropdownProps } = useContext4(MenuContext);
2293
+ return /* @__PURE__ */ jsx11(
2294
+ Button,
2295
+ {
2296
+ appearance: "secondary",
2297
+ ...getToggleButtonProps?.({
2298
+ // Decide if we want the preventKeyAction stuff. Maybe create a prop to allow for this to be overriden.
2299
+ ...getDropdownProps?.({ preventKeyAction: true }),
2300
+ refKey: "innerRef",
2301
+ ...isListbox ? {} : { role: "button", "aria-haspopup": "menu" }
2302
+ }),
2303
+ ...rest,
2304
+ children
2305
+ }
2306
+ );
2307
+ };
2308
+
2309
+ // src/ActionMenu/ActionMenu.tsx
2310
+ import "react";
2311
+ import {
2312
+ useSelect as useSelect2
2313
+ } from "downshift";
2314
+
2315
+ // src/hooks/useItemsFromChildren.tsx
2316
+ import React10, { useMemo as useMemo3 } from "react";
2317
+ var walkAllChildren = (children, callback) => {
2318
+ const walk = (element, parents2) => {
2319
+ if (element === null || element === void 0)
2320
+ return;
2321
+ callback(element, parents2);
2322
+ const newParents = [...parents2, element];
2323
+ const children2 = element.props?.children;
2324
+ React10.Children.toArray(children2).forEach((child) => {
2325
+ walk(child, newParents);
2326
+ });
2327
+ };
2328
+ const parents = [];
2329
+ React10.Children.toArray(children).forEach((child) => {
2330
+ walk(child, parents);
2331
+ });
2332
+ };
2333
+ var checkIfIsElement = (element, name) => {
2334
+ return !!(element && typeof element === "object" && "type" in element && typeof element.type !== "string" && typeof element.type.name === "string" && element.type.name === name);
2335
+ };
2336
+ var getAllMenuItems = (children) => {
2337
+ const allMenuItems = [];
2338
+ walkAllChildren(children, (element, parents) => {
2339
+ if (checkIfIsElement(element, "MenuItem") || checkIfIsElement(element, "MenuItemSelectable")) {
2340
+ allMenuItems.push({
2341
+ element,
2342
+ parents
2343
+ });
2344
+ }
2345
+ });
2346
+ return allMenuItems;
2347
+ };
2348
+ var useItemsFromChildren = ({
2349
+ children
2350
+ }) => {
2351
+ const { allMenuItems, menuItemsMap } = useMemo3(() => {
2352
+ const allMenuItemElements = getAllMenuItems(children);
2353
+ const menuItemsMap2 = {};
2354
+ const allMenuItems2 = allMenuItemElements.map(
2355
+ ({ element, parents }, index) => {
2356
+ const item = {
2357
+ id: element.props.id,
2358
+ disabled: element.props.disabled,
2359
+ index,
2360
+ element,
2361
+ parents
2362
+ };
2363
+ menuItemsMap2[`${item.id}`] = item;
2364
+ return item;
2365
+ }
2366
+ );
2367
+ return { allMenuItems: allMenuItems2, menuItemsMap: menuItemsMap2 };
2368
+ }, [children]);
2369
+ return { allMenuItems, menuItemsMap };
2370
+ };
2371
+
2372
+ // src/reducers/useSelectStateReducer.tsx
2373
+ import { useSelect } from "downshift";
2374
+ var useSelectStateReducer = (state, actionAndChanges) => {
2375
+ const { type, changes } = actionAndChanges;
2376
+ switch (type) {
2377
+ case useSelect.stateChangeTypes.ToggleButtonBlur:
2378
+ return {
2379
+ ...changes,
2380
+ // keep menu open on blur
2381
+ isOpen: true
2382
+ };
2383
+ default:
2384
+ return changes;
2385
+ }
2386
+ };
2387
+ var defaultUseSelectProps = {
2388
+ stateReducer: useSelectStateReducer,
2389
+ isItemDisabled: (item) => !!item.disabled
2390
+ };
2391
+
2392
+ // src/utils/itemToString.ts
2393
+ var itemToString = (item) => {
2394
+ return item ? item.id : "";
2395
+ };
2396
+
2397
+ // src/ActionMenu/ActionMenu.tsx
2398
+ import { jsx as jsx12 } from "react/jsx-runtime";
2399
+ var ActionMenu = ({
2400
+ children,
2401
+ stateReducer: externalStateReducer,
2402
+ ...useSelectProps
2403
+ }) => {
2404
+ const { allMenuItems, menuItemsMap } = useItemsFromChildren({ children });
2405
+ const handleStateChange = (changes) => {
2406
+ const { selectedItem } = changes;
2407
+ if (selectedItem.element?.props?.disabled) {
2408
+ return;
2409
+ }
2410
+ if (changes.type === useSelect2.stateChangeTypes.ToggleButtonKeyDownEnter || changes.type === useSelect2.stateChangeTypes.ToggleButtonKeyDownSpaceButton) {
2411
+ const isEnterKeyDown = changes.type === useSelect2.stateChangeTypes.ToggleButtonKeyDownEnter;
2412
+ const selectedItemProps = selectedItem.element?.props;
2413
+ const syntheticKeyboardEvent = new KeyboardEvent("keydown", {
2414
+ key: isEnterKeyDown ? "Enter" : " ",
2415
+ code: isEnterKeyDown ? "Enter" : "Space",
2416
+ bubbles: true,
2417
+ cancelable: true,
2418
+ view: window
2419
+ });
2420
+ selectedItemProps?.onClick?.(
2421
+ syntheticKeyboardEvent
2422
+ );
2423
+ }
2424
+ };
2425
+ const { isOpen, ...useSelectReturnProps } = useSelect2({
2426
+ ...defaultUseSelectProps,
2427
+ items: allMenuItems,
2428
+ itemToString,
2429
+ onSelectedItemChange: handleStateChange,
2430
+ stateReducer: (state, actionAndChanges) => {
2431
+ let newState;
2432
+ newState = useSelectStateReducer(state, actionAndChanges);
2433
+ return externalStateReducer ? externalStateReducer(state, {
2434
+ ...actionAndChanges,
2435
+ changes: newState
2436
+ }) : newState;
2437
+ },
2438
+ ...useSelectProps
2439
+ });
2440
+ return /* @__PURE__ */ jsx12(
2441
+ MenuRoot,
2442
+ {
2443
+ ...{
2444
+ isListbox: false,
2445
+ items: allMenuItems,
2446
+ itemsMap: menuItemsMap,
2447
+ itemToString,
2448
+ isOpen,
2449
+ ...useSelectProps,
2450
+ ...useSelectReturnProps
2451
+ },
2452
+ children
2453
+ }
2454
+ );
2455
+ };
2456
+
2457
+ // src/SingleSelectMenu/SingleSelectMenu.tsx
2458
+ import "react";
2459
+ import { useSelect as useSelect3 } from "downshift";
2460
+ import { jsx as jsx13 } from "react/jsx-runtime";
2461
+ var SingleSelectMenu = ({
2462
+ children,
2463
+ stateReducer: externalStateReducer,
2464
+ ...useSelectProps
2465
+ }) => {
2466
+ const { allMenuItems, menuItemsMap } = useItemsFromChildren({ children });
2467
+ const { isOpen, ...useSelectReturnProps } = useSelect3({
2468
+ ...defaultUseSelectProps,
2469
+ items: allMenuItems,
2470
+ itemToString,
2471
+ stateReducer: (state, actionAndChanges) => {
2472
+ let newState;
2473
+ newState = useSelectStateReducer(state, actionAndChanges);
2474
+ return externalStateReducer ? externalStateReducer(state, {
2475
+ ...actionAndChanges,
2476
+ changes: newState
2477
+ }) : newState;
2478
+ },
2479
+ ...useSelectProps
2480
+ });
2481
+ return /* @__PURE__ */ jsx13(
2482
+ MenuRoot,
2483
+ {
2484
+ ...{
2485
+ isListbox: true,
2486
+ items: allMenuItems,
2487
+ itemsMap: menuItemsMap,
2488
+ itemToString,
2489
+ isOpen,
2490
+ ...useSelectProps,
2491
+ ...useSelectReturnProps
2492
+ },
2493
+ children
2494
+ }
2495
+ );
2496
+ };
2497
+
2498
+ // src/MultiSelectMenu/MultiSelectMenu.tsx
2499
+ import "react";
2500
+ import {
2501
+ useSelect as useSelect4,
2502
+ useMultipleSelection
2503
+ } from "downshift";
2504
+ import { jsx as jsx14 } from "react/jsx-runtime";
2505
+ var selectReducerForMultiSelect = (state, actionAndChanges) => {
2506
+ const { changes, type } = actionAndChanges;
2507
+ switch (type) {
2508
+ case useSelect4.stateChangeTypes.ToggleButtonKeyDownEnter:
2509
+ case useSelect4.stateChangeTypes.ToggleButtonKeyDownSpaceButton:
2510
+ case useSelect4.stateChangeTypes.ItemClick:
2511
+ return {
2512
+ ...changes,
2513
+ isOpen: true,
2514
+ // keep the menu open after selection.
2515
+ // TODO: Confirm that keeping highlightedIndex the same is the desired UX
2516
+ // highlightedIndex: 0, // with the first option highlighted.
2517
+ highlightedIndex: state.highlightedIndex
2518
+ // keep highlightedIndex the same instead of returning to 0
2519
+ };
2520
+ }
2521
+ return changes;
2522
+ };
2523
+ var MultiSelectMenu = ({
2524
+ children,
2525
+ stateReducer: externalStateReducer,
2526
+ getA11yMultiStatusMessage,
2527
+ onMultiSelectStateChange,
2528
+ multiSelectStateReducer,
2529
+ ...useSelectProps
2530
+ }) => {
2531
+ const { allMenuItems, menuItemsMap } = useItemsFromChildren({ children });
2532
+ const multiSelectOverrides = Object.entries({
2533
+ ...useSelectProps,
2534
+ getA11yStatusMessage: getA11yMultiStatusMessage,
2535
+ onStateChange: onMultiSelectStateChange,
2536
+ stateReducer: multiSelectStateReducer
2537
+ }).reduce(
2538
+ (a, [k, v]) => v ? (a[k] = v, a) : a,
2539
+ {}
2540
+ );
2541
+ const {
2542
+ getSelectedItemProps,
2543
+ addSelectedItem,
2544
+ removeSelectedItem,
2545
+ selectedItems,
2546
+ getDropdownProps,
2547
+ ...useMultipleSelectionReturnProps
2548
+ } = useMultipleSelection(multiSelectOverrides);
2549
+ const { isOpen, ...useSelectReturnProps } = useSelect4({
2550
+ ...defaultUseSelectProps,
2551
+ items: allMenuItems,
2552
+ itemToString,
2553
+ selectedItem: null,
2554
+ defaultHighlightedIndex: 0,
2555
+ stateReducer: (state, actionAndChanges) => {
2556
+ let newState;
2557
+ newState = useSelectStateReducer(state, actionAndChanges);
2558
+ newState = selectReducerForMultiSelect(state, {
2559
+ ...actionAndChanges,
2560
+ changes: newState
2561
+ });
2562
+ return externalStateReducer ? externalStateReducer(state, {
2563
+ ...actionAndChanges,
2564
+ changes: newState
2565
+ }) : newState;
2566
+ },
2567
+ onStateChange: ({ type, selectedItem: newSelectedItem }) => {
2568
+ switch (type) {
2569
+ case useSelect4.stateChangeTypes.ToggleButtonKeyDownEnter:
2570
+ case useSelect4.stateChangeTypes.ToggleButtonKeyDownSpaceButton:
2571
+ case useSelect4.stateChangeTypes.ItemClick:
2572
+ case useSelect4.stateChangeTypes.ToggleButtonBlur:
2573
+ if (!newSelectedItem)
2574
+ break;
2575
+ if (selectedItems?.find((item) => item?.id === newSelectedItem.id)) {
2576
+ removeSelectedItem(newSelectedItem);
2577
+ } else {
2578
+ addSelectedItem(newSelectedItem);
2579
+ }
2580
+ break;
2581
+ default:
2582
+ break;
2583
+ }
2584
+ },
2585
+ ...useSelectProps
2586
+ });
2587
+ return /* @__PURE__ */ jsx14(
2588
+ MenuRoot,
2589
+ {
2590
+ ...{
2591
+ isListbox: true,
2592
+ items: allMenuItems,
2593
+ itemsMap: menuItemsMap,
2594
+ itemToString,
2595
+ isOpen,
2596
+ getSelectedItemProps,
2597
+ addSelectedItem,
2598
+ removeSelectedItem,
2599
+ selectedItems,
2600
+ getDropdownProps,
2601
+ getA11yMultiStatusMessage,
2602
+ onMultiSelectStateChange,
2603
+ multiSelectStateReducer,
2604
+ ...useSelectProps,
2605
+ ...useSelectReturnProps,
2606
+ ...useMultipleSelectionReturnProps
2607
+ },
2608
+ children
2609
+ }
2610
+ );
2611
+ };
2612
+ export {
2613
+ ActionMenu,
2614
+ INPUT_TYPES,
2615
+ MenuContent,
2616
+ MenuContext,
2617
+ MenuFooter,
2618
+ MenuGroup,
2619
+ MenuHeader,
2620
+ MenuItem,
2621
+ MenuItemContainer,
2622
+ MenuItemSelectable,
2623
+ MenuItemSelectableAction,
2624
+ MenuItemSelectableRow,
2625
+ MenuItemSelectableText,
2626
+ MenuLabel,
2627
+ MenuProvider,
2628
+ MenuRoot,
2629
+ MenuToggleButton,
2630
+ MultiSelectMenu,
2631
+ SelectionIndicator,
2632
+ SingleSelectMenu,
2633
+ StyledMenuGroup,
2634
+ StyledMenuGroupUl,
2635
+ StyledTitle,
2636
+ defaultUseSelectProps,
2637
+ useItemsFromChildren,
2638
+ useMenu,
2639
+ useMenuContext,
2640
+ useSelectStateReducer
2641
+ };
2642
+ /*! Bundled license information:
2643
+
2644
+ object-assign/index.js:
2645
+ (*
2646
+ object-assign
2647
+ (c) Sindre Sorhus
2648
+ @license MIT
2649
+ *)
2650
+ */
2651
+ //# sourceMappingURL=index.js.map