grommet 2.29.1 → 2.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Anchor/Anchor.js +9 -3
- package/components/Anchor/StyledAnchor.js +6 -3
- package/components/Button/Button.js +6 -2
- package/components/Button/StyledButtonKind.js +20 -6
- package/components/Calendar/Calendar.js +14 -6
- package/components/Data/DataForm.js +75 -10
- package/components/Data/stories/Cards.js +1 -1
- package/components/Data/stories/Complex.js +84 -0
- package/components/Data/stories/Controlled.js +1 -1
- package/components/Data/stories/DataTable.js +11 -4
- package/components/Data/stories/Infinite.js +1 -1
- package/components/Data/stories/Inline.js +7 -2
- package/components/Data/stories/List.js +1 -1
- package/components/Data/stories/Simple.js +1 -1
- package/components/Data/stories/SpaceX.js +1 -1
- package/components/Data/stories/StarWars.js +18 -24
- package/components/Data/stories/Views.js +1 -1
- package/components/DataFilter/DataFilter.js +32 -42
- package/components/DataFilter/stories/Simple.js +7 -4
- package/components/DataFilters/DataFilters.js +76 -32
- package/components/DataFilters/index.d.ts +1 -0
- package/components/DataFilters/propTypes.js +2 -1
- package/components/DataFilters/stories/Drop.js +7 -4
- package/components/DataFilters/stories/Inline.js +24 -6
- package/components/DataFilters/stories/Layer.js +46 -0
- package/components/DataFilters/stories/Simple.js +7 -4
- package/components/DataSearch/DataSearch.js +57 -9
- package/components/DataSearch/index.d.ts +10 -1
- package/components/DataSearch/propTypes.js +6 -1
- package/components/DataSearch/stories/Drop.js +42 -0
- package/components/DataSearch/stories/Responsive.js +42 -0
- package/components/DataSearch/stories/Simple.js +5 -2
- package/components/DataSort/DataSort.js +61 -12
- package/components/DataSort/index.d.ts +4 -8
- package/components/DataSort/propTypes.js +9 -2
- package/components/DataSort/stories/Drop.js +41 -0
- package/components/DataSort/stories/Simple.js +9 -5
- package/components/DataSummary/stories/Simple.js +7 -4
- package/components/DataTable/GroupedBody.js +1 -0
- package/components/DataTable/StyledDataTable.js +2 -2
- package/components/DataTableColumns/DataTableColumns.js +2 -1
- package/components/DataTableColumns/stories/Simple.js +9 -5
- package/components/DataView/DataView.js +21 -6
- package/components/DataView/stories/Simple.js +8 -5
- package/components/Distribution/Distribution.js +1 -1
- package/components/Drop/DropContainer.js +32 -79
- package/components/Drop/stories/Overflow.js +1 -0
- package/components/DropButton/DropButton.js +1 -1
- package/components/Form/stories/Controlled.js +11 -2
- package/components/Form/stories/ControlledInput.js +13 -2
- package/components/Form/stories/ControlledInputLazy.js +13 -2
- package/components/Form/stories/ControlledLazy.js +13 -2
- package/components/Form/stories/FieldWithChildren.js +13 -2
- package/components/Form/stories/FieldWithComponentProp.js +17 -1
- package/components/Form/stories/Uncontrolled.js +15 -2
- package/components/Form/stories/ValidateOnChange.js +6 -0
- package/components/Form/stories/ValidateOnMount.js +4 -0
- package/components/Form/stories/typescript/TypedForm.tsx +25 -3
- package/components/FormField/FormField.js +1 -0
- package/components/Layer/LayerContainer.js +1 -1
- package/components/Layer/StyledLayer.js +3 -1
- package/components/Pagination/Pagination.js +8 -0
- package/components/Paragraph/Paragraph.js +18 -6
- package/components/Tabs/Tabs.js +2 -1
- package/components/Text/Text.js +9 -1
- package/components/Text/TextContext.js +8 -0
- package/components/TextInput/StyledTextInput.js +3 -1
- package/components/TextInput/TextInput.js +4 -2
- package/components/TextInput/index.d.ts +3 -1
- package/components/TextInput/propTypes.js +3 -1
- package/components/Toolbar/stories/Simple.js +1 -1
- package/components/WorldMap/WorldMap.js +17 -14
- package/es6/components/Anchor/Anchor.js +9 -3
- package/es6/components/Anchor/StyledAnchor.js +6 -3
- package/es6/components/Button/Button.js +6 -2
- package/es6/components/Button/StyledButtonKind.js +20 -6
- package/es6/components/Calendar/Calendar.js +14 -6
- package/es6/components/Data/DataForm.js +75 -10
- package/es6/components/Data/stories/Cards.js +1 -1
- package/es6/components/Data/stories/Complex.js +78 -0
- package/es6/components/Data/stories/Controlled.js +1 -1
- package/es6/components/Data/stories/DataTable.js +12 -5
- package/es6/components/Data/stories/Infinite.js +1 -1
- package/es6/components/Data/stories/Inline.js +7 -2
- package/es6/components/Data/stories/List.js +1 -1
- package/es6/components/Data/stories/Simple.js +1 -1
- package/es6/components/Data/stories/SpaceX.js +1 -1
- package/es6/components/Data/stories/StarWars.js +18 -24
- package/es6/components/Data/stories/Views.js +1 -1
- package/es6/components/DataFilter/DataFilter.js +32 -42
- package/es6/components/DataFilter/stories/Simple.js +8 -5
- package/es6/components/DataFilters/DataFilters.js +76 -32
- package/es6/components/DataFilters/index.d.ts +1 -0
- package/es6/components/DataFilters/propTypes.js +2 -1
- package/es6/components/DataFilters/stories/Drop.js +8 -5
- package/es6/components/DataFilters/stories/Inline.js +25 -7
- package/es6/components/DataFilters/stories/Layer.js +40 -0
- package/es6/components/DataFilters/stories/Simple.js +8 -5
- package/es6/components/DataSearch/DataSearch.js +58 -10
- package/es6/components/DataSearch/index.d.ts +10 -1
- package/es6/components/DataSearch/propTypes.js +5 -1
- package/es6/components/DataSearch/stories/Drop.js +36 -0
- package/es6/components/DataSearch/stories/Responsive.js +36 -0
- package/es6/components/DataSearch/stories/Simple.js +6 -3
- package/es6/components/DataSort/DataSort.js +62 -13
- package/es6/components/DataSort/index.d.ts +4 -8
- package/es6/components/DataSort/propTypes.js +8 -2
- package/es6/components/DataSort/stories/Drop.js +35 -0
- package/es6/components/DataSort/stories/Simple.js +10 -6
- package/es6/components/DataSummary/stories/Simple.js +8 -5
- package/es6/components/DataTable/GroupedBody.js +1 -0
- package/es6/components/DataTable/StyledDataTable.js +2 -2
- package/es6/components/DataTableColumns/DataTableColumns.js +2 -1
- package/es6/components/DataTableColumns/stories/Simple.js +10 -6
- package/es6/components/DataView/DataView.js +21 -6
- package/es6/components/DataView/stories/Simple.js +9 -6
- package/es6/components/Distribution/Distribution.js +1 -1
- package/es6/components/Drop/DropContainer.js +34 -81
- package/es6/components/Drop/stories/Overflow.js +1 -0
- package/es6/components/DropButton/DropButton.js +1 -1
- package/es6/components/Form/stories/Controlled.js +11 -2
- package/es6/components/Form/stories/ControlledInput.js +13 -2
- package/es6/components/Form/stories/ControlledInputLazy.js +13 -2
- package/es6/components/Form/stories/ControlledLazy.js +13 -2
- package/es6/components/Form/stories/FieldWithChildren.js +13 -2
- package/es6/components/Form/stories/FieldWithComponentProp.js +17 -1
- package/es6/components/Form/stories/Uncontrolled.js +15 -2
- package/es6/components/Form/stories/ValidateOnChange.js +6 -0
- package/es6/components/Form/stories/ValidateOnMount.js +4 -0
- package/es6/components/Form/stories/typescript/TypedForm.tsx +25 -3
- package/es6/components/FormField/FormField.js +1 -0
- package/es6/components/Layer/LayerContainer.js +1 -1
- package/es6/components/Layer/StyledLayer.js +3 -1
- package/es6/components/Pagination/Pagination.js +8 -0
- package/es6/components/Paragraph/Paragraph.js +19 -7
- package/es6/components/Tabs/Tabs.js +2 -1
- package/es6/components/Text/Text.js +10 -2
- package/es6/components/Text/TextContext.js +2 -0
- package/es6/components/TextInput/StyledTextInput.js +4 -2
- package/es6/components/TextInput/TextInput.js +4 -2
- package/es6/components/TextInput/index.d.ts +3 -1
- package/es6/components/TextInput/propTypes.js +3 -1
- package/es6/components/Toolbar/stories/Simple.js +1 -1
- package/es6/components/WorldMap/WorldMap.js +17 -14
- package/es6/languages/default.json +7 -2
- package/es6/themes/base.d.ts +31 -0
- package/es6/themes/base.js +31 -1
- package/es6/utils/DOM.js +1 -1
- package/es6/utils/background.js +9 -1
- package/es6/utils/colors.js +2 -2
- package/es6/utils/general-prop-types.js +1 -1
- package/es6/utils/index.d.ts +7 -1
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/languages/default.json +7 -2
- package/package.json +13 -11
- package/themes/base.d.ts +31 -0
- package/themes/base.js +31 -1
- package/utils/DOM.js +1 -1
- package/utils/background.js +8 -0
- package/utils/colors.js +3 -1
- package/utils/general-prop-types.js +1 -1
- package/utils/index.d.ts +7 -1
package/languages/default.json
CHANGED
|
@@ -25,13 +25,15 @@
|
|
|
25
25
|
"submit": "Apply filters"
|
|
26
26
|
},
|
|
27
27
|
"dataSearch": {
|
|
28
|
-
"label": "Search
|
|
28
|
+
"label": "Search",
|
|
29
|
+
"open": "Open search"
|
|
29
30
|
},
|
|
30
31
|
"dataSort": {
|
|
31
32
|
"ascending": "Ascending",
|
|
32
33
|
"by": "Sort by",
|
|
33
34
|
"descending": "Descending",
|
|
34
|
-
"direction": "Sort direction"
|
|
35
|
+
"direction": "Sort direction",
|
|
36
|
+
"open": "Open sort"
|
|
35
37
|
},
|
|
36
38
|
"dataSummary": {
|
|
37
39
|
"filtered": "{filteredTotal} results of {total} items",
|
|
@@ -43,6 +45,9 @@
|
|
|
43
45
|
"order": "Order columns",
|
|
44
46
|
"select": "Select columns"
|
|
45
47
|
},
|
|
48
|
+
"dataView": {
|
|
49
|
+
"label": "View"
|
|
50
|
+
},
|
|
46
51
|
"fileInput": {
|
|
47
52
|
"browse": "browse",
|
|
48
53
|
"dropPrompt": "Drop file here or",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grommet",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.30.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"module": "es6/index.js",
|
|
6
6
|
"jsnext:main": "es6/index.js",
|
|
@@ -43,9 +43,10 @@
|
|
|
43
43
|
"storybook": "cross-env NODE_ENV=development start-storybook -p 9001 -c storybook",
|
|
44
44
|
"start": "webpack serve --config ./e2e/webpack.config.js --mode development",
|
|
45
45
|
"test-e2e": "testcafe chrome:headless e2e/tests",
|
|
46
|
+
"test-e2e-ci": "testcafe chrome:headless e2e/tests -r xunit:/tmp/test-results/testcafe/results.xml",
|
|
46
47
|
"build-storybook": "build-storybook -c storybook -o storybook-static",
|
|
47
48
|
"prettier": "pretty-quick --staged",
|
|
48
|
-
"chromatic": "chromatic -t
|
|
49
|
+
"chromatic": "chromatic -t f1924d8a65df"
|
|
49
50
|
},
|
|
50
51
|
"peerDependencies": {
|
|
51
52
|
"react": "^16.6.1 || ^17.0.0 || ^18.0.0",
|
|
@@ -72,14 +73,14 @@
|
|
|
72
73
|
"@babel/plugin-proposal-pipeline-operator": "^7.18.9",
|
|
73
74
|
"@babel/preset-env": "^7.20.2",
|
|
74
75
|
"@babel/preset-react": "^7.18.6",
|
|
75
|
-
"@storybook/addon-a11y": "6.5.
|
|
76
|
-
"@storybook/addon-storysource": "6.5.
|
|
77
|
-
"@storybook/addon-toolbars": "6.5.
|
|
78
|
-
"@storybook/addons": "6.5.
|
|
79
|
-
"@storybook/builder-webpack5": "6.5.
|
|
80
|
-
"@storybook/manager-webpack5": "6.5.
|
|
81
|
-
"@storybook/react": "6.5.
|
|
82
|
-
"@storybook/source-loader": "6.5.
|
|
76
|
+
"@storybook/addon-a11y": "6.5.15",
|
|
77
|
+
"@storybook/addon-storysource": "6.5.15",
|
|
78
|
+
"@storybook/addon-toolbars": "6.5.15",
|
|
79
|
+
"@storybook/addons": "6.5.15",
|
|
80
|
+
"@storybook/builder-webpack5": "6.5.15",
|
|
81
|
+
"@storybook/manager-webpack5": "6.5.15",
|
|
82
|
+
"@storybook/react": "6.5.15",
|
|
83
|
+
"@storybook/source-loader": "6.5.15",
|
|
83
84
|
"@testing-library/dom": "^8.19.1",
|
|
84
85
|
"@testing-library/jest-dom": "^5.16.5",
|
|
85
86
|
"@testing-library/react": "^13.4.0",
|
|
@@ -141,6 +142,7 @@
|
|
|
141
142
|
"tarball-extract": "^0.0.6",
|
|
142
143
|
"testcafe": "^2.2.0",
|
|
143
144
|
"testcafe-react-selectors": "^5.0.2",
|
|
145
|
+
"testcafe-reporter-xunit": "^2.2.2",
|
|
144
146
|
"ts-jest": "^29.0.4",
|
|
145
147
|
"ts-loader": "^9.4.2",
|
|
146
148
|
"typescript": "^4.9.4",
|
|
@@ -205,7 +207,7 @@
|
|
|
205
207
|
"bundlesize": [
|
|
206
208
|
{
|
|
207
209
|
"path": "./dist/grommet.min.js",
|
|
208
|
-
"maxSize": "
|
|
210
|
+
"maxSize": "157 kB"
|
|
209
211
|
}
|
|
210
212
|
],
|
|
211
213
|
"keywords": [
|
package/themes/base.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
PropsOf,
|
|
26
26
|
AlignContentType,
|
|
27
27
|
SkeletonColorsType,
|
|
28
|
+
AlignSelfType,
|
|
28
29
|
} from '../utils';
|
|
29
30
|
|
|
30
31
|
import { AnchorProps } from '../components/Anchor/index';
|
|
@@ -147,7 +148,9 @@ interface ButtonKindType {
|
|
|
147
148
|
}
|
|
148
149
|
| boolean;
|
|
149
150
|
color?: ColorType;
|
|
151
|
+
direction?: DirectionType;
|
|
150
152
|
font?: {
|
|
153
|
+
size?: string;
|
|
151
154
|
weight?: number | string;
|
|
152
155
|
};
|
|
153
156
|
icon?: React.ReactNode | Icon;
|
|
@@ -223,6 +226,9 @@ interface ButtonType {
|
|
|
223
226
|
vertical?: string;
|
|
224
227
|
horizontal?: string;
|
|
225
228
|
};
|
|
229
|
+
iconOnly?: {
|
|
230
|
+
pad?: string | { horizontal?: string; vertical?: string };
|
|
231
|
+
};
|
|
226
232
|
};
|
|
227
233
|
medium?: {
|
|
228
234
|
border?: {
|
|
@@ -232,6 +238,9 @@ interface ButtonType {
|
|
|
232
238
|
vertical?: string;
|
|
233
239
|
horizontal?: string;
|
|
234
240
|
};
|
|
241
|
+
iconOnly?: {
|
|
242
|
+
pad?: string | { horizontal?: string; vertical?: string };
|
|
243
|
+
};
|
|
235
244
|
};
|
|
236
245
|
large?: {
|
|
237
246
|
border?: {
|
|
@@ -241,6 +250,9 @@ interface ButtonType {
|
|
|
241
250
|
vertical?: string;
|
|
242
251
|
horizontal?: string;
|
|
243
252
|
};
|
|
253
|
+
iconOnly?: {
|
|
254
|
+
pad?: string | { horizontal?: string; vertical?: string };
|
|
255
|
+
};
|
|
244
256
|
};
|
|
245
257
|
};
|
|
246
258
|
skeleton?: SkeletonProps;
|
|
@@ -480,6 +492,20 @@ export interface ThemeType {
|
|
|
480
492
|
textDecoration?: string;
|
|
481
493
|
};
|
|
482
494
|
textDecoration?: string;
|
|
495
|
+
size?: {
|
|
496
|
+
medium?: {
|
|
497
|
+
color?: ColorType;
|
|
498
|
+
fontWeight?: number;
|
|
499
|
+
textDecoration?: string;
|
|
500
|
+
};
|
|
501
|
+
[x: string]:
|
|
502
|
+
| {
|
|
503
|
+
color?: ColorType;
|
|
504
|
+
fontWeight?: number;
|
|
505
|
+
textDecoration?: string;
|
|
506
|
+
}
|
|
507
|
+
| undefined;
|
|
508
|
+
};
|
|
483
509
|
};
|
|
484
510
|
avatar?: {
|
|
485
511
|
size?: {
|
|
@@ -515,18 +541,21 @@ export interface ThemeType {
|
|
|
515
541
|
};
|
|
516
542
|
extend?: ExtendType;
|
|
517
543
|
small?: {
|
|
544
|
+
title?: TextProps;
|
|
518
545
|
fontSize?: string;
|
|
519
546
|
lineHeight?: number;
|
|
520
547
|
daySize?: string;
|
|
521
548
|
slideDuration?: string;
|
|
522
549
|
};
|
|
523
550
|
medium?: {
|
|
551
|
+
title?: TextProps;
|
|
524
552
|
fontSize?: string;
|
|
525
553
|
lineHeight?: number;
|
|
526
554
|
daySize?: string;
|
|
527
555
|
slideDuration?: string;
|
|
528
556
|
};
|
|
529
557
|
large?: {
|
|
558
|
+
title?: TextProps;
|
|
530
559
|
fontSize?: string;
|
|
531
560
|
lineHeight?: number;
|
|
532
561
|
daySize?: string;
|
|
@@ -1021,6 +1050,7 @@ export interface ThemeType {
|
|
|
1021
1050
|
extend?: ExtendType;
|
|
1022
1051
|
overlay?: {
|
|
1023
1052
|
background?: BackgroundType;
|
|
1053
|
+
backdropFilter?: string;
|
|
1024
1054
|
};
|
|
1025
1055
|
responsiveBreakpoint?: string;
|
|
1026
1056
|
zIndex?: string;
|
|
@@ -1483,6 +1513,7 @@ export interface ThemeType {
|
|
|
1483
1513
|
extend?: ExtendType;
|
|
1484
1514
|
gap?: GapType;
|
|
1485
1515
|
header?: {
|
|
1516
|
+
alignSelf?: AlignSelfType;
|
|
1486
1517
|
background?: BackgroundType;
|
|
1487
1518
|
border?: {
|
|
1488
1519
|
side?: string;
|
package/themes/base.js
CHANGED
|
@@ -406,6 +406,13 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
406
406
|
// fontWeight: undefined,
|
|
407
407
|
// extend: undefined,
|
|
408
408
|
}
|
|
409
|
+
// size: {
|
|
410
|
+
// medium: {
|
|
411
|
+
// color: undefined,
|
|
412
|
+
// fontWeight: undefined,
|
|
413
|
+
// textDecoration: undefined,
|
|
414
|
+
// },
|
|
415
|
+
// },
|
|
409
416
|
// extend: undefined,
|
|
410
417
|
},
|
|
411
418
|
|
|
@@ -491,6 +498,9 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
491
498
|
// 4px
|
|
492
499
|
horizontal: baseSpacing - borderWidth * 2 + "px" // 20px,
|
|
493
500
|
}
|
|
501
|
+
// iconOnly: {
|
|
502
|
+
// pad: undefined,
|
|
503
|
+
// },
|
|
494
504
|
},
|
|
495
505
|
|
|
496
506
|
medium: {
|
|
@@ -503,6 +513,9 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
503
513
|
// 4px
|
|
504
514
|
horizontal: baseSpacing - borderWidth + "px" // 22px
|
|
505
515
|
}
|
|
516
|
+
// iconOnly: {
|
|
517
|
+
// pad: undefined,
|
|
518
|
+
// },
|
|
506
519
|
},
|
|
507
520
|
|
|
508
521
|
large: {
|
|
@@ -515,6 +528,9 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
515
528
|
// 8px
|
|
516
529
|
horizontal: baseSpacing + borderWidth * 4 + "px" // 32px,
|
|
517
530
|
}
|
|
531
|
+
// iconOnly: {
|
|
532
|
+
// pad: undefined,
|
|
533
|
+
// },
|
|
518
534
|
}
|
|
519
535
|
},
|
|
520
536
|
|
|
@@ -528,7 +544,9 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
528
544
|
// background: undefined,
|
|
529
545
|
// border: undefined,
|
|
530
546
|
// color: undefined,
|
|
547
|
+
// direction: undefined,
|
|
531
548
|
// font: {
|
|
549
|
+
// size: undefined,
|
|
532
550
|
// weight: undefined,
|
|
533
551
|
// },
|
|
534
552
|
// icon: undefined,
|
|
@@ -541,11 +559,13 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
541
559
|
// },
|
|
542
560
|
// primary: {
|
|
543
561
|
// font: {
|
|
562
|
+
// size: undefined,
|
|
544
563
|
// weight: undefined,
|
|
545
564
|
// },
|
|
546
565
|
// background: undefined,
|
|
547
566
|
// border: undefined,
|
|
548
567
|
// color: undefined,
|
|
568
|
+
// direction: undefined,
|
|
549
569
|
// icon: undefined,
|
|
550
570
|
// padding: {
|
|
551
571
|
// vertical: undefined,
|
|
@@ -556,11 +576,13 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
556
576
|
// },
|
|
557
577
|
// secondary: {
|
|
558
578
|
// font: {
|
|
579
|
+
// size: undefined,
|
|
559
580
|
// weight: undefined,
|
|
560
581
|
// },
|
|
561
582
|
// background: undefined,
|
|
562
583
|
// border: undefined,
|
|
563
584
|
// color: undefined,
|
|
585
|
+
// direction: undefined,
|
|
564
586
|
// icon: undefined,
|
|
565
587
|
// padding: {
|
|
566
588
|
// vertical: undefined,
|
|
@@ -573,6 +595,7 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
573
595
|
// background: undefined,
|
|
574
596
|
// border: undefined,
|
|
575
597
|
// color: undefined,
|
|
598
|
+
// direction: undefined,
|
|
576
599
|
// icon: undefined,
|
|
577
600
|
// padding: {
|
|
578
601
|
// vertical: undefined,
|
|
@@ -629,18 +652,21 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
629
652
|
calendar: {
|
|
630
653
|
// daySize must align with global.size
|
|
631
654
|
small: {
|
|
655
|
+
// title: {},
|
|
632
656
|
fontSize: baseFontSize - fontScale + "px",
|
|
633
657
|
lineHeight: 1.375,
|
|
634
658
|
daySize: baseSpacing * 8 / 7 + "px",
|
|
635
659
|
slideDuration: '0.2s'
|
|
636
660
|
},
|
|
637
661
|
medium: {
|
|
662
|
+
// title: {},
|
|
638
663
|
fontSize: baseFontSize + "px",
|
|
639
664
|
lineHeight: 1.45,
|
|
640
665
|
daySize: baseSpacing * 16 / 7 + "px",
|
|
641
666
|
slideDuration: '0.5s'
|
|
642
667
|
},
|
|
643
668
|
large: {
|
|
669
|
+
// title: {},
|
|
644
670
|
fontSize: baseFontSize + 3 * fontScale + "px",
|
|
645
671
|
lineHeight: 1.11,
|
|
646
672
|
daySize: baseSpacing * 32 / 7 + "px",
|
|
@@ -1165,7 +1191,8 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
1165
1191
|
weight: 600,
|
|
1166
1192
|
skeleton: {
|
|
1167
1193
|
width: {
|
|
1168
|
-
min: '
|
|
1194
|
+
min: '150px',
|
|
1195
|
+
max: '200px'
|
|
1169
1196
|
}
|
|
1170
1197
|
}
|
|
1171
1198
|
},
|
|
@@ -1186,7 +1213,9 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
1186
1213
|
// extend: undefined,
|
|
1187
1214
|
overlay: {
|
|
1188
1215
|
background: 'rgba(0, 0, 0, 0.5)'
|
|
1216
|
+
// backdropFilter: undefined,
|
|
1189
1217
|
},
|
|
1218
|
+
|
|
1190
1219
|
responsiveBreakpoint: 'small',
|
|
1191
1220
|
// when Layer takes over the full screen
|
|
1192
1221
|
zIndex: '20'
|
|
@@ -1930,6 +1959,7 @@ var generate = function generate(baseSpacing, scale) {
|
|
|
1930
1959
|
// extend: undefined,
|
|
1931
1960
|
// gap: undefined,
|
|
1932
1961
|
header: {
|
|
1962
|
+
// alignSelf: undefined,
|
|
1933
1963
|
// background: undefined,
|
|
1934
1964
|
// border: {
|
|
1935
1965
|
// side: undefined,
|
package/utils/DOM.js
CHANGED
|
@@ -66,7 +66,7 @@ var containsFocus = function containsFocus(node) {
|
|
|
66
66
|
};
|
|
67
67
|
exports.containsFocus = containsFocus;
|
|
68
68
|
var withinDropPortal = function withinDropPortal(node, portalContext) {
|
|
69
|
-
var root = node.getRootNode();
|
|
69
|
+
var root = node == null ? void 0 : node.getRootNode();
|
|
70
70
|
var element = node;
|
|
71
71
|
var portalId;
|
|
72
72
|
while (element && element !== root) {
|
package/utils/background.js
CHANGED
|
@@ -128,8 +128,16 @@ var backgroundAndTextColors = function backgroundAndTextColors(backgroundArg, te
|
|
|
128
128
|
} else {
|
|
129
129
|
backgroundColor = normalizeBackgroundColor(background, theme);
|
|
130
130
|
var _shade = darkContext(backgroundColor, theme);
|
|
131
|
+
var transparent;
|
|
132
|
+
if (backgroundColor && (0, _colors.canExtractRGBArray)(backgroundColor)) {
|
|
133
|
+
var colorArray = (0, _colors.getRGBArray)(backgroundColor);
|
|
134
|
+
// check if the alpha value is less than 0.5
|
|
135
|
+
if (colorArray[3] < 0.5) transparent = true;
|
|
136
|
+
}
|
|
131
137
|
if (_shade) {
|
|
132
138
|
textColor = (0, _colors.normalizeColor)(text[_shade] || text, theme, _shade === 'dark');
|
|
139
|
+
} else if (transparent && text) {
|
|
140
|
+
textColor = (0, _colors.normalizeColor)(text, theme);
|
|
133
141
|
} else {
|
|
134
142
|
// If we can't determine the shade, we assume this isn't a simple color.
|
|
135
143
|
// It could be a gradient. backgroundStyle() will take care of that case.
|
package/utils/colors.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.normalizeColor = exports.getRGBA = exports.colorIsDark = void 0;
|
|
4
|
+
exports.normalizeColor = exports.getRGBArray = exports.getRGBA = exports.colorIsDark = exports.canExtractRGBArray = void 0;
|
|
5
5
|
// Returns the specific color that should be used according to the theme.
|
|
6
6
|
// If 'dark' is supplied, it takes precedence over 'theme.dark'.
|
|
7
7
|
// Can return undefined.
|
|
@@ -76,6 +76,7 @@ var hslExp = /^hsla?\(\s?([0-9]*)\s?,\s?([0-9]*)%?\s?,\s?([0-9]*)%?\s?.*?\)/;
|
|
|
76
76
|
var canExtractRGBArray = function canExtractRGBArray(color) {
|
|
77
77
|
return hexExp.test(color) || rgbExp.test(color) || rgbaExp.test(color) || hslExp.test(color);
|
|
78
78
|
};
|
|
79
|
+
exports.canExtractRGBArray = canExtractRGBArray;
|
|
79
80
|
var getRGBArray = function getRGBArray(color) {
|
|
80
81
|
if (hexExp.test(color)) {
|
|
81
82
|
var _parseHexToRGB = parseHexToRGB(color),
|
|
@@ -109,6 +110,7 @@ var getRGBArray = function getRGBArray(color) {
|
|
|
109
110
|
}
|
|
110
111
|
return color;
|
|
111
112
|
};
|
|
113
|
+
exports.getRGBArray = getRGBArray;
|
|
112
114
|
var colorIsDark = function colorIsDark(color) {
|
|
113
115
|
if (color && canExtractRGBArray(color)) {
|
|
114
116
|
var _getRGBArray = getRGBArray(color),
|
|
@@ -96,7 +96,7 @@ var skeletonPropType = _propTypes["default"].oneOfType([_propTypes["default"].bo
|
|
|
96
96
|
depth: _propTypes["default"].number,
|
|
97
97
|
message: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].shape({
|
|
98
98
|
start: _propTypes["default"].string,
|
|
99
|
-
end: _propTypes["default"].
|
|
99
|
+
end: _propTypes["default"].string
|
|
100
100
|
})])
|
|
101
101
|
})]);
|
|
102
102
|
exports.skeletonPropType = skeletonPropType;
|
package/utils/index.d.ts
CHANGED
|
@@ -128,7 +128,13 @@ export type AlignContentType =
|
|
|
128
128
|
| 'start'
|
|
129
129
|
| 'stretch'
|
|
130
130
|
| string;
|
|
131
|
-
export type AlignSelfType =
|
|
131
|
+
export type AlignSelfType =
|
|
132
|
+
| 'start'
|
|
133
|
+
| 'center'
|
|
134
|
+
| 'end'
|
|
135
|
+
| 'stretch'
|
|
136
|
+
| 'baseline'
|
|
137
|
+
| string;
|
|
132
138
|
export type AnimateType = boolean;
|
|
133
139
|
export interface BackgroundObject {
|
|
134
140
|
color?: ColorType;
|