@flodesk/grain 10.17.2 → 10.17.4

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 (82) hide show
  1. package/es/components/arrange.js +34 -74
  2. package/es/components/autocomplete.js +28 -132
  3. package/es/components/badge.js +8 -7
  4. package/es/components/box.js +14 -85
  5. package/es/components/button.js +26 -8
  6. package/es/components/checkbox.js +18 -12
  7. package/es/components/dropdown.js +28 -81
  8. package/es/components/flex.js +36 -72
  9. package/es/components/index.js +1 -5
  10. package/es/components/link.js +16 -27
  11. package/es/components/modal.js +68 -89
  12. package/es/components/nav.js +19 -9
  13. package/es/components/pagination.js +4 -4
  14. package/es/components/popover.js +11 -29
  15. package/es/components/select.js +10 -12
  16. package/es/components/slider.js +17 -6
  17. package/es/components/spinner.js +14 -4
  18. package/es/components/stack.js +4 -5
  19. package/es/components/switch.js +17 -5
  20. package/es/components/tab.js +1 -1
  21. package/es/components/text-button.js +12 -13
  22. package/es/components/text.js +28 -84
  23. package/es/components/textarea.js +20 -34
  24. package/es/components/toast.js +52 -16
  25. package/es/components/tooltip.js +4 -4
  26. package/es/foundational/field.js +28 -52
  27. package/es/foundational/menu.js +60 -138
  28. package/es/foundational/styles.js +11 -11
  29. package/es/hooks/index.js +1 -2
  30. package/es/hooks/useOnClickOutside.js +6 -7
  31. package/es/icons/index.js +1 -18
  32. package/es/index.js +1 -2
  33. package/es/styles/base.css +53 -0
  34. package/es/styles/colors/core.css +74 -0
  35. package/es/styles/colors/experimental.css +3 -0
  36. package/es/styles/colors/theme.css +92 -0
  37. package/es/styles/shadows.css +60 -0
  38. package/es/styles/variables.css +66 -0
  39. package/es/types.js +7 -18
  40. package/es/utilities/helpers.js +1 -13
  41. package/es/utilities/index.js +1 -3
  42. package/es/utilities/responsive.js +0 -3
  43. package/es/utilities/styles.js +2 -14
  44. package/es/variables/colors.js +1 -2
  45. package/es/variables/index.js +1 -2
  46. package/es/variables/vars.js +0 -3
  47. package/package.json +1 -1
  48. package/es/components/autocomplete2.js +0 -359
  49. package/es/components/box2.js +0 -223
  50. package/es/components/provider.js +0 -14
  51. package/es/components/text2/index.js +0 -100
  52. package/es/components/text2/styles.module.css +0 -22
  53. package/es/hooks/usePrev.js +0 -8
  54. package/es/icons/icon-archive.js +0 -21
  55. package/es/icons/icon-at.js +0 -21
  56. package/es/icons/icon-bold.js +0 -28
  57. package/es/icons/icon-bullet-list.js +0 -21
  58. package/es/icons/icon-column-and-rows.js +0 -21
  59. package/es/icons/icon-columns-and-row.js +0 -21
  60. package/es/icons/icon-columns.js +0 -21
  61. package/es/icons/icon-folder-move.js +0 -21
  62. package/es/icons/icon-folder-remove.js +0 -21
  63. package/es/icons/icon-italic.js +0 -28
  64. package/es/icons/icon-number-list.js +0 -21
  65. package/es/icons/icon-row-and-columns.js +0 -21
  66. package/es/icons/icon-rows-and-column.js +0 -21
  67. package/es/icons/icon-rows.js +0 -21
  68. package/es/icons/icon-strike.js +0 -28
  69. package/es/icons/icon-text-justify.js +0 -21
  70. package/es/icons/icon-underline.js +0 -28
  71. package/es/styles/base.js +0 -2
  72. package/es/styles/colors/core.js +0 -2
  73. package/es/styles/colors/experimental.js +0 -2
  74. package/es/styles/colors/index.js +0 -4
  75. package/es/styles/colors/theme.js +0 -2
  76. package/es/styles/index.js +0 -6
  77. package/es/styles/shadows.js +0 -2
  78. package/es/styles/utilities.js +0 -108
  79. package/es/styles/variables.js +0 -2
  80. package/es/utilities/attributes.js +0 -66
  81. package/es/utilities/style-config.js +0 -442
  82. package/es/variables/breakpoints.js +0 -9
@@ -1,442 +0,0 @@
1
- import "core-js/modules/es.array.concat.js";
2
- import "core-js/modules/es.object.keys.js";
3
- import "core-js/modules/es.array.map.js";
4
- import "core-js/modules/es.array.includes.js";
5
- import "core-js/modules/es.string.includes.js";
6
- import "core-js/modules/es.array.find.js";
7
- import "core-js/modules/es.object.to-string.js";
8
- import "core-js/modules/es.object.values.js";
9
- import "core-js/modules/es.symbol.js";
10
- import "core-js/modules/es.symbol.description.js";
11
- import "core-js/modules/es.symbol.iterator.js";
12
- import "core-js/modules/es.array.iterator.js";
13
- import "core-js/modules/es.string.iterator.js";
14
- import "core-js/modules/web.dom-collections.iterator.js";
15
- import "core-js/modules/es.array.from.js";
16
- import "core-js/modules/es.array.slice.js";
17
- import "core-js/modules/es.regexp.exec.js";
18
-
19
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
20
-
21
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
22
-
23
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
24
-
25
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
26
-
27
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
28
-
29
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
30
-
31
- import { alignSelfs, borderWidths, cursors, overflows, positions, sides, textAlignments, textDisplays, textTransforms } from '../types';
32
- import { vars } from '../variables';
33
- import { getDimension, getSpace, getTextSize, isSpaceVar } from './responsive';
34
- import { getColor, getRadius, getShadow, getTransition, getWeight, isColorVar, isRadiusVar, isShadowVar, isTrasitionVar } from './styles';
35
- var spaces = [].concat(_toConsumableArray(Object.keys(vars.spaces)), _toConsumableArray(Object.keys(vars.spaceUtils)));
36
- var colors = [].concat(_toConsumableArray(Object.keys(vars.colors)), _toConsumableArray(Object.keys(vars.colorUtils)));
37
- var shadows = Object.keys(vars.shadows);
38
- var radii = Object.keys(vars.radii);
39
- var transitions = [].concat(_toConsumableArray(Object.keys(vars.transitions)), _toConsumableArray(Object.keys(vars.transitionUtils)));
40
- var sizes = Object.keys(vars.texts);
41
- var weights = Object.keys(vars.weights);
42
-
43
- var borderSideToStyle = function borderSideToStyle(side) {
44
- if (side === 'all') return 'solid';
45
- var borderConfig = {
46
- top: ['top'],
47
- right: ['right'],
48
- bottom: ['bottom'],
49
- left: ['left'],
50
- y: ['top', 'bottom'],
51
- x: ['right', 'left']
52
- };
53
- var borderStyles = ['top', 'right', 'bottom', 'left'].map(function (s) {
54
- return borderConfig[side].includes(s) ? 'solid' : 'none';
55
- });
56
- return borderStyles.join(' ');
57
- };
58
-
59
- export var styleConfig = {
60
- spaceProps: {
61
- props: [{
62
- propName: 'padding',
63
- property: 'padding',
64
- short: 'p'
65
- }, {
66
- propName: 'paddingTop',
67
- property: 'padding-top',
68
- short: 'pt'
69
- }, {
70
- propName: 'paddingBottom',
71
- property: 'padding-bottom',
72
- short: 'pb'
73
- }, {
74
- propName: 'paddingLeft',
75
- property: 'padding-left',
76
- short: 'pl'
77
- }, {
78
- propName: 'paddingRight',
79
- property: 'padding-right',
80
- short: 'pr'
81
- }, {
82
- propName: 'paddingX',
83
- property: 'padding-inline',
84
- short: 'px'
85
- }, {
86
- propName: 'paddingY',
87
- property: 'padding-block',
88
- short: 'py'
89
- }, {
90
- propName: 'margin',
91
- property: 'margin',
92
- short: 'm'
93
- }, {
94
- propName: 'marginTop',
95
- property: 'margin-top',
96
- short: 'mt'
97
- }, {
98
- propName: 'marginBottom',
99
- property: 'margin-bottom',
100
- short: 'mb'
101
- }, {
102
- propName: 'marginLeft',
103
- property: 'margin-left',
104
- short: 'ml'
105
- }, {
106
- propName: 'marginRight',
107
- property: 'margin-right',
108
- short: 'mr'
109
- }, {
110
- propName: 'marginX',
111
- property: 'margin-inline',
112
- short: 'mx'
113
- }, {
114
- propName: 'marginY',
115
- property: 'margin-block',
116
- short: 'my'
117
- }, {
118
- propName: 'top',
119
- property: 'top',
120
- short: 't'
121
- }, {
122
- propName: 'bottom',
123
- property: 'bottom',
124
- short: 'b'
125
- }, {
126
- propName: 'left',
127
- property: 'left',
128
- short: 'l'
129
- }, {
130
- propName: 'right',
131
- property: 'right',
132
- short: 'r'
133
- }],
134
- valueTransformer: getSpace,
135
- variableChecker: isSpaceVar,
136
- variables: spaces,
137
- isResponsive: true
138
- },
139
- dimensionProps: {
140
- props: [{
141
- propName: 'width',
142
- property: 'width',
143
- short: 'w'
144
- }, {
145
- propName: 'minWidth',
146
- property: 'min-width',
147
- short: 'min-w'
148
- }, {
149
- propName: 'maxWidth',
150
- property: 'max-width',
151
- short: 'max-w'
152
- }, {
153
- propName: 'height',
154
- property: 'height',
155
- short: 'h'
156
- }, {
157
- propName: 'minHeight',
158
- property: 'min-height',
159
- short: 'min-h'
160
- }, {
161
- propName: 'maxHeight',
162
- property: 'max-height',
163
- short: 'max-h'
164
- }],
165
- valueTransformer: getDimension,
166
- isResponsive: true
167
- },
168
- colorProps: {
169
- props: [{
170
- propName: 'color',
171
- property: 'color',
172
- short: 'c'
173
- }, {
174
- propName: 'colorHover',
175
- property: 'color',
176
- short: 'c-h'
177
- }, {
178
- propName: 'backgroundColor',
179
- property: 'background-color',
180
- short: 'bgc'
181
- }, {
182
- propName: 'backgroundColorHover',
183
- property: 'background-color',
184
- short: 'bgc-h'
185
- }],
186
- valueTransformer: getColor,
187
- variableChecker: isColorVar,
188
- variables: colors
189
- },
190
- shadowProps: {
191
- props: [{
192
- propName: 'shadow',
193
- property: 'box-shadow',
194
- short: 'sh'
195
- }, {
196
- propName: 'shadowHover',
197
- property: 'box-shadow',
198
- short: 'sh-h'
199
- }],
200
- valueTransformer: getShadow,
201
- variableChecker: isShadowVar,
202
- variables: shadows
203
- },
204
- radiusProps: {
205
- props: [{
206
- propName: 'radius',
207
- property: 'border-radius',
208
- short: 'rad'
209
- }],
210
- valueTransformer: getRadius,
211
- variableChecker: isRadiusVar,
212
- variables: radii
213
- },
214
- orderProps: {
215
- props: [{
216
- propName: 'order',
217
- property: 'order',
218
- short: 'ord'
219
- }]
220
- },
221
- flexProps: {
222
- props: [{
223
- propName: 'flex',
224
- property: 'flex',
225
- short: 'flx'
226
- }],
227
- isResponsive: true
228
- },
229
- zIndexProps: {
230
- props: [{
231
- propName: 'zIndex',
232
- property: 'z-index',
233
- short: 'z'
234
- }]
235
- },
236
- positionProps: {
237
- props: [{
238
- propName: 'position',
239
- property: 'position',
240
- short: 'pos'
241
- }],
242
- variableChecker: function variableChecker(value) {
243
- return positions.includes(value);
244
- },
245
- variables: positions
246
- },
247
- overflowProps: {
248
- props: [{
249
- propName: 'overflow',
250
- property: 'overflow',
251
- short: 'of'
252
- }, {
253
- propName: 'overflowX',
254
- property: 'overflow-x',
255
- short: 'of-x'
256
- }, {
257
- propName: 'overflowY',
258
- property: 'overflow-y',
259
- short: 'of-y'
260
- }],
261
- variableChecker: function variableChecker(value) {
262
- return overflows.includes(value);
263
- },
264
- variables: overflows
265
- },
266
- transitionProps: {
267
- props: [{
268
- propName: 'transition',
269
- property: 'transition',
270
- short: 'tr'
271
- }, {
272
- propName: 'transitionHover',
273
- property: 'transition',
274
- short: 'tr-h'
275
- }],
276
- valueTransformer: getTransition,
277
- variableChecker: isTrasitionVar,
278
- variables: transitions
279
- },
280
- cursorProps: {
281
- props: [{
282
- propName: 'cursor',
283
- property: 'cursor',
284
- short: 'cur'
285
- }],
286
- variableChecker: function variableChecker(value) {
287
- return cursors.includes(value);
288
- },
289
- variables: cursors
290
- },
291
- aspectRatioProps: {
292
- props: [{
293
- propName: 'aspectRatio',
294
- property: 'aspect-ratio',
295
- short: 'ar'
296
- }]
297
- },
298
- sizeProps: {
299
- props: [{
300
- propName: 'size',
301
- property: 'font-size',
302
- short: 'txt'
303
- }],
304
- isResponsive: true,
305
- variables: sizes,
306
- valueTransformer: getTextSize,
307
- variableChecker: function variableChecker(value) {
308
- return sizes.includes(value);
309
- }
310
- },
311
- opacityProps: {
312
- props: [{
313
- propName: 'opacity',
314
- property: 'opacity',
315
- short: 'op'
316
- }, {
317
- propName: 'opacityHover',
318
- property: 'opacity',
319
- short: 'op-h'
320
- }]
321
- },
322
- alignSelfProps: {
323
- props: [{
324
- propName: 'alignSelf',
325
- property: 'align-self',
326
- short: 'als'
327
- }],
328
- variables: alignSelfs,
329
- variableChecker: function variableChecker(value) {
330
- return alignSelfs.includes(value);
331
- }
332
- },
333
- borderColorProps: {
334
- props: [{
335
- propName: 'borderColor',
336
- property: 'border-color',
337
- short: 'bdc'
338
- }, {
339
- propName: 'borderColorHover',
340
- property: 'border-color',
341
- short: 'bdc-h'
342
- }],
343
- valueTransformer: getColor,
344
- variableChecker: isColorVar,
345
- variables: colors
346
- },
347
- borderWidthProps: {
348
- props: [{
349
- propName: 'borderWidth',
350
- property: 'border-width',
351
- short: 'bdw'
352
- }],
353
- valueTransformer: function valueTransformer(borderWidth) {
354
- return borderWidth;
355
- },
356
- variables: borderWidths,
357
- variableChecker: function variableChecker(value) {
358
- return borderWidths.includes(value);
359
- }
360
- },
361
- borderSideProps: {
362
- props: [{
363
- propName: 'borderSide',
364
- property: 'border-style',
365
- short: 'bds'
366
- }],
367
- valueTransformer: borderSideToStyle,
368
- variables: sides,
369
- variableChecker: function variableChecker(value) {
370
- return sides.includes(value);
371
- }
372
- },
373
- alignProps: {
374
- props: [{
375
- propName: 'align',
376
- property: 'text-align',
377
- short: 'al'
378
- }],
379
- variables: textAlignments,
380
- variableChecker: function variableChecker(value) {
381
- return textAlignments.includes(value);
382
- },
383
- isResponsive: true
384
- },
385
- weightProps: {
386
- props: [{
387
- propName: 'weight',
388
- property: 'font-weight',
389
- short: 'w'
390
- }],
391
- variables: weights,
392
- variableChecker: function variableChecker(value) {
393
- return weights.includes(value);
394
- },
395
- valueTransformer: getWeight
396
- },
397
- textDisplayProps: {
398
- props: [{
399
- propName: 'display',
400
- property: 'display',
401
- short: 'ds' // instead of 'd' to avoid conflict with _display.scss in frontend
402
-
403
- }],
404
- variables: textDisplays,
405
- variableChecker: function variableChecker(value) {
406
- return textDisplays.includes(value);
407
- }
408
- },
409
- letterSpacingProps: {
410
- props: [{
411
- propName: 'letterSpacing',
412
- property: 'letter-spacing',
413
- short: 'ls'
414
- }]
415
- },
416
- textTransformProps: {
417
- props: [{
418
- propName: 'textTransform',
419
- property: 'text-transform',
420
- short: 'tt'
421
- }],
422
- variables: textTransforms,
423
- variableChecker: function variableChecker(value) {
424
- return textTransforms.includes(value);
425
- }
426
- }
427
- };
428
- export var propNameToShort = function propNameToShort(propName) {
429
- var _prop$props$find;
430
-
431
- var prop = Object.values(styleConfig).find(function (_ref) {
432
- var props = _ref.props;
433
- return props.find(function (_ref2) {
434
- var prop = _ref2.propName;
435
- return prop === propName;
436
- });
437
- });
438
- return prop === null || prop === void 0 ? void 0 : (_prop$props$find = prop.props.find(function (_ref3) {
439
- var prop = _ref3.propName;
440
- return prop === propName;
441
- })) === null || _prop$props$find === void 0 ? void 0 : _prop$props$find.short;
442
- };
@@ -1,9 +0,0 @@
1
- export var breakpoints = {
2
- tablet: 1169,
3
- mobile: 767
4
- };
5
- export var deviceShort = {
6
- default: 'def',
7
- mobile: 'mob',
8
- tablet: 'tab'
9
- };