grommet 2.56.0 → 2.56.1
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/COPYRIGHT.md +3 -1
- package/components/Calendar/Calendar.js +2 -1
- package/components/Cards/Cards.js +1 -2
- package/components/DateTimeInput/DateTimeInput.js +1093 -0
- package/components/DateTimeInput/README.md +2 -0
- package/components/DateTimeInput/StyledDateTimeInput.js +74 -0
- package/components/DateTimeInput/index.d.ts +47 -0
- package/components/DateTimeInput/index.js +6 -0
- package/components/DateTimeInput/propTypes.js +42 -0
- package/components/DateTimeInput/stories/CustomThemed/Custom.stories.tsx +53 -0
- package/components/DateTimeInput/stories/Form.stories.tsx +44 -0
- package/components/DateTimeInput/stories/Inline.stories.tsx +45 -0
- package/components/DateTimeInput/stories/Locale.stories.tsx +59 -0
- package/components/DateTimeInput/stories/Simple.stories.tsx +23 -0
- package/components/Form/Form.js +7 -4
- package/components/Form/index.d.ts +3 -0
- package/components/Form/stories/AggregateValidation.stories.js +6 -8
- package/components/FormField/FormField.js +164 -91
- package/components/Stepper/StepConnector.js +19 -49
- package/components/Stepper/Stepper.js +5 -11
- package/components/Stepper/StepperStep.js +14 -4
- package/components/Stepper/StyledStepper.js +59 -21
- package/components/TimeInput/TimeInput.js +50 -47
- package/components/TimeInput/TimeInputPopup.js +172 -76
- package/components/TimeInput/index.d.ts +3 -0
- package/components/TimeInput/propTypes.js +4 -0
- package/components/TimeInput/useSectionedTimeField.js +33 -34
- package/components/TimeInput/utils.js +31 -26
- package/components/Wizard/StyledWizard.js +16 -0
- package/components/Wizard/Wizard.js +770 -0
- package/components/Wizard/WizardContent.js +90 -0
- package/components/Wizard/WizardContext.js +35 -0
- package/components/Wizard/WizardFooter.js +123 -0
- package/components/Wizard/WizardHeader.js +63 -0
- package/components/Wizard/WizardProgress.js +84 -0
- package/components/Wizard/WizardStepHeader.js +55 -0
- package/components/Wizard/index.d.ts +171 -0
- package/components/Wizard/index.js +19 -0
- package/components/Wizard/propTypes.js +56 -0
- package/components/Wizard/stories/BasicLinear.stories.js +71 -0
- package/components/Wizard/stories/Branching.stories.js +96 -0
- package/components/Wizard/stories/Composable.stories.js +75 -0
- package/components/Wizard/stories/Controlled.stories.js +136 -0
- package/components/Wizard/stories/LongContent.stories.js +118 -0
- package/components/Wizard/stories/Modal.stories.js +143 -0
- package/components/Wizard/stories/NestedSubSteps.stories.js +79 -0
- package/components/Wizard/stories/Validation.stories.js +123 -0
- package/components/index.d.ts +4 -0
- package/components/index.js +12 -0
- package/es6/components/Calendar/Calendar.js +2 -0
- package/es6/components/Cards/Cards.js +1 -2
- package/es6/components/DateTimeInput/DateTimeInput.js +1090 -0
- package/es6/components/DateTimeInput/README.md +2 -0
- package/es6/components/DateTimeInput/StyledDateTimeInput.js +68 -0
- package/es6/components/DateTimeInput/index.d.ts +47 -0
- package/es6/components/DateTimeInput/index.js +3 -0
- package/es6/components/DateTimeInput/propTypes.js +36 -0
- package/es6/components/DateTimeInput/stories/CustomThemed/Custom.stories.tsx +53 -0
- package/es6/components/DateTimeInput/stories/Form.stories.tsx +44 -0
- package/es6/components/DateTimeInput/stories/Inline.stories.tsx +45 -0
- package/es6/components/DateTimeInput/stories/Locale.stories.tsx +59 -0
- package/es6/components/DateTimeInput/stories/Simple.stories.tsx +23 -0
- package/es6/components/Form/Form.js +7 -3
- package/es6/components/Form/index.d.ts +3 -0
- package/es6/components/Form/stories/AggregateValidation.stories.js +6 -9
- package/es6/components/FormField/FormField.js +165 -91
- package/es6/components/Stepper/StepConnector.js +18 -48
- package/es6/components/Stepper/Stepper.js +5 -10
- package/es6/components/Stepper/StepperStep.js +15 -4
- package/es6/components/Stepper/StyledStepper.js +57 -21
- package/es6/components/TimeInput/TimeInput.js +50 -46
- package/es6/components/TimeInput/TimeInputPopup.js +172 -76
- package/es6/components/TimeInput/index.d.ts +3 -0
- package/es6/components/TimeInput/propTypes.js +3 -0
- package/es6/components/TimeInput/useSectionedTimeField.js +34 -35
- package/es6/components/TimeInput/utils.js +25 -21
- package/es6/components/Wizard/StyledWizard.js +11 -0
- package/es6/components/Wizard/Wizard.js +768 -0
- package/es6/components/Wizard/WizardContent.js +87 -0
- package/es6/components/Wizard/WizardContext.js +31 -0
- package/es6/components/Wizard/WizardFooter.js +120 -0
- package/es6/components/Wizard/WizardHeader.js +60 -0
- package/es6/components/Wizard/WizardProgress.js +80 -0
- package/es6/components/Wizard/WizardStepHeader.js +51 -0
- package/es6/components/Wizard/index.d.ts +171 -0
- package/es6/components/Wizard/index.js +7 -0
- package/es6/components/Wizard/propTypes.js +51 -0
- package/es6/components/Wizard/stories/BasicLinear.stories.js +67 -0
- package/es6/components/Wizard/stories/Branching.stories.js +93 -0
- package/es6/components/Wizard/stories/Composable.stories.js +72 -0
- package/es6/components/Wizard/stories/Controlled.stories.js +133 -0
- package/es6/components/Wizard/stories/LongContent.stories.js +115 -0
- package/es6/components/Wizard/stories/Modal.stories.js +141 -0
- package/es6/components/Wizard/stories/NestedSubSteps.stories.js +76 -0
- package/es6/components/Wizard/stories/Validation.stories.js +118 -0
- package/es6/components/index.d.ts +4 -0
- package/es6/components/index.js +4 -0
- package/es6/index.d.ts +4 -0
- package/es6/languages/default.json +28 -0
- package/es6/themes/base.d.ts +115 -0
- package/es6/themes/base.js +158 -0
- package/es6/utils/DOM.js +11 -2
- package/es6/utils/dates.js +10 -0
- package/es6/utils/sectionHelpers.js +57 -0
- package/es6/utils/useSectionedField.js +45 -0
- package/grommet.min.js +2 -1
- package/grommet.min.js.LICENSE.txt +1 -0
- package/grommet.min.js.map +1 -1
- package/index.d.ts +4 -0
- package/languages/default.json +28 -0
- package/package.json +35 -31
- package/themes/base.d.ts +115 -0
- package/themes/base.js +158 -1
- package/tools/license-header.js +2 -0
- package/utils/DOM.js +11 -2
- package/utils/dates.js +11 -1
- package/utils/sectionHelpers.js +61 -0
- package/utils/useSectionedField.js +50 -0
package/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1
3
|
export * from './components/Accordion';
|
|
2
4
|
export * from './components/AccordionPanel';
|
|
3
5
|
export * from './components/Anchor';
|
|
@@ -28,6 +30,7 @@ export * from './components/DataTableColumns';
|
|
|
28
30
|
export * from './components/DataTableGroupBy';
|
|
29
31
|
export * from './components/DataView';
|
|
30
32
|
export * from './components/DateInput';
|
|
33
|
+
export * from './components/DateTimeInput';
|
|
31
34
|
export * from './components/Diagram';
|
|
32
35
|
export * from './components/Distribution';
|
|
33
36
|
export * from './components/Drop';
|
|
@@ -94,6 +97,7 @@ export * from './components/Tip';
|
|
|
94
97
|
export * from './components/ToggleGroup';
|
|
95
98
|
export * from './components/Toolbar';
|
|
96
99
|
export * from './components/Video';
|
|
100
|
+
export * from './components/Wizard';
|
|
97
101
|
export * from './components/WorldMap';
|
|
98
102
|
export * from './contexts/AnnounceContext';
|
|
99
103
|
export * from './contexts/ContainerTargetContext';
|
package/languages/default.json
CHANGED
|
@@ -25,6 +25,21 @@
|
|
|
25
25
|
"exitCalendar": "Exited calendar dialog",
|
|
26
26
|
"outOfBounds": "Date is out of the allowed range. Enter a date between {start} and {end}."
|
|
27
27
|
},
|
|
28
|
+
"dateTimeInput": {
|
|
29
|
+
"inputLabel": "Date and time input",
|
|
30
|
+
"chooseDateTime": "Open date and time picker",
|
|
31
|
+
"openDrop": "Press space to open date and time picker",
|
|
32
|
+
"invalidDateTime": "Invalid date or time value",
|
|
33
|
+
"activeSection": "{section} selected",
|
|
34
|
+
"activeSectionValue": "{value}",
|
|
35
|
+
"sectionDay": "day",
|
|
36
|
+
"sectionMonth": "month",
|
|
37
|
+
"sectionYear": "year",
|
|
38
|
+
"sectionHours": "hours",
|
|
39
|
+
"sectionMinutes": "minutes",
|
|
40
|
+
"sectionSeconds": "seconds",
|
|
41
|
+
"sectionMeridiem": "meridiem"
|
|
42
|
+
},
|
|
28
43
|
"dataChart": {
|
|
29
44
|
"detailTitle": "Data chart",
|
|
30
45
|
"detailFocus": "Use the left and right arrow keys to navigate the chart data."
|
|
@@ -245,5 +260,18 @@
|
|
|
245
260
|
"playButton": "play",
|
|
246
261
|
"volumeDown": "volume down",
|
|
247
262
|
"volumeUp": "volume up"
|
|
263
|
+
},
|
|
264
|
+
"wizard": {
|
|
265
|
+
"previous": "Previous",
|
|
266
|
+
"next": "Next",
|
|
267
|
+
"skip": "Skip",
|
|
268
|
+
"cancel": "Cancel",
|
|
269
|
+
"close": "Close",
|
|
270
|
+
"complete": "Complete",
|
|
271
|
+
"stepHeader": {
|
|
272
|
+
"counter": "Step {step} of {total}"
|
|
273
|
+
},
|
|
274
|
+
"progress": "Wizard progress",
|
|
275
|
+
"validationError": "Please complete required fields."
|
|
248
276
|
}
|
|
249
277
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "grommet",
|
|
3
|
-
"version": "2.56.
|
|
3
|
+
"version": "2.56.1",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"module": "es6/index.js",
|
|
6
6
|
"jsnext:main": "es6/index.js",
|
|
@@ -32,6 +32,9 @@
|
|
|
32
32
|
"release-styled-components-beta-stable": "babel-node ./tools/release-styled-components-beta-stable",
|
|
33
33
|
"lint": "eslint src",
|
|
34
34
|
"lint-fix": "eslint src --fix",
|
|
35
|
+
"license": "node ./tools/license-header.js",
|
|
36
|
+
"license-check": "node ./tools/license-header.js --check",
|
|
37
|
+
"license-staged": "node ./tools/license-header.js --staged",
|
|
35
38
|
"test": "jest --runInBand && yarn test-timezones",
|
|
36
39
|
"test-simple": "jest --runInBand",
|
|
37
40
|
"test-update": "jest --updateSnapshot && yarn test-timezones",
|
|
@@ -76,23 +79,23 @@
|
|
|
76
79
|
"@babel/preset-react": "^7.29.7",
|
|
77
80
|
"@chromatic-com/storybook": "^5.2.1",
|
|
78
81
|
"@eslint/compat": "^2.1.0",
|
|
79
|
-
"@eslint/eslintrc": "^3.3.
|
|
82
|
+
"@eslint/eslintrc": "^3.3.6",
|
|
80
83
|
"@eslint/js": "^10.0.1",
|
|
81
|
-
"@storybook/addon-a11y": "^10.
|
|
82
|
-
"@storybook/addon-docs": "^10.
|
|
84
|
+
"@storybook/addon-a11y": "^10.5.6",
|
|
85
|
+
"@storybook/addon-docs": "^10.5.6",
|
|
83
86
|
"@storybook/addon-webpack5-compiler-babel": "^4.0.1",
|
|
84
|
-
"@storybook/react": "^10.
|
|
85
|
-
"@storybook/react-webpack5": "^10.
|
|
87
|
+
"@storybook/react": "^10.5.6",
|
|
88
|
+
"@storybook/react-webpack5": "^10.5.6",
|
|
86
89
|
"@testing-library/dom": "^10.4.1",
|
|
87
90
|
"@testing-library/jest-dom": "^6.9.1",
|
|
88
91
|
"@testing-library/react": "^16.3.2",
|
|
89
92
|
"@testing-library/testcafe": "^5.0.1",
|
|
90
|
-
"@testing-library/user-event": "^14.6.
|
|
93
|
+
"@testing-library/user-event": "^14.6.3",
|
|
91
94
|
"@types/jest": "^30.0.0",
|
|
92
95
|
"@types/jest-axe": "^3.5.9",
|
|
93
|
-
"@types/node": "^25.9.
|
|
94
|
-
"@types/react": "^19.2.
|
|
95
|
-
"@types/react-dom": "^19.2.
|
|
96
|
+
"@types/node": "^25.9.5",
|
|
97
|
+
"@types/react": "^19.2.18",
|
|
98
|
+
"@types/react-dom": "^19.2.4",
|
|
96
99
|
"@types/styled-components": "^5.1.36",
|
|
97
100
|
"babel-core": "^7.0.0-bridge.0",
|
|
98
101
|
"babel-jest": "^30.4.1",
|
|
@@ -100,56 +103,56 @@
|
|
|
100
103
|
"babel-plugin-styled-components": "^2.3.0",
|
|
101
104
|
"babel-plugin-transform-imports": "^2.0.0",
|
|
102
105
|
"bundlesize2": "^0.0.35",
|
|
103
|
-
"chromatic": "^17.
|
|
106
|
+
"chromatic": "^17.8.0",
|
|
104
107
|
"clean-webpack-plugin": "^4.0.0",
|
|
105
108
|
"copy-webpack-plugin": "^14.0.0",
|
|
106
109
|
"copyfiles": "^2.4.1",
|
|
107
|
-
"core-js": "^3.
|
|
110
|
+
"core-js": "^3.50.0",
|
|
108
111
|
"cross-env": "^10.1.0",
|
|
109
112
|
"del": "^6.1.1",
|
|
110
|
-
"eslint": "^9.39.
|
|
113
|
+
"eslint": "^9.39.5",
|
|
111
114
|
"eslint-config-airbnb": "^19.0.4",
|
|
112
115
|
"eslint-config-prettier": "^10.1.8",
|
|
113
116
|
"eslint-plugin-babel": "^5.3.1",
|
|
114
117
|
"eslint-plugin-import": "^2.32.0",
|
|
115
118
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
116
|
-
"eslint-plugin-prettier": "^5.5.
|
|
119
|
+
"eslint-plugin-prettier": "^5.5.6",
|
|
117
120
|
"eslint-plugin-react": "^7.37.5",
|
|
118
|
-
"eslint-plugin-react-hooks": "^7.
|
|
121
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
119
122
|
"eslint-plugin-testing-library": "^7.16.2",
|
|
120
|
-
"fs-extra": "^11.
|
|
121
|
-
"globals": "^17.
|
|
123
|
+
"fs-extra": "^11.4.0",
|
|
124
|
+
"globals": "^17.9.0",
|
|
122
125
|
"grommet-theme-hpe": "^8.1.4",
|
|
123
126
|
"jest": "^30.4.2",
|
|
124
127
|
"jest-axe": "^10.0.0",
|
|
125
|
-
"jest-cli": "^30.
|
|
128
|
+
"jest-cli": "^30.4.2",
|
|
126
129
|
"jest-environment-jsdom": "^30.4.1",
|
|
127
130
|
"jest-styled-components": "7.0.5",
|
|
128
|
-
"jsdom": "^29.
|
|
129
|
-
"postcss": "^8.5.
|
|
131
|
+
"jsdom": "^29.1.1",
|
|
132
|
+
"postcss": "^8.5.25",
|
|
130
133
|
"pre-commit": "^2.0.0",
|
|
131
134
|
"prettier": "^2.8.8",
|
|
132
135
|
"pretty-quick": "^4.2.2",
|
|
133
|
-
"react": "^19.2.
|
|
136
|
+
"react": "^19.2.8",
|
|
134
137
|
"react-dev-utils": "^12.0.1",
|
|
135
|
-
"react-dom": "^19.2.
|
|
136
|
-
"react-is": "^19.2.
|
|
138
|
+
"react-dom": "^19.2.8",
|
|
139
|
+
"react-is": "^19.2.8",
|
|
137
140
|
"react-shadow": "^20.6.0",
|
|
138
141
|
"regenerator-runtime": "^0.14.1",
|
|
139
142
|
"simple-git": "^3.36.0",
|
|
140
|
-
"storybook": "^10.
|
|
143
|
+
"storybook": "^10.5.6",
|
|
141
144
|
"storybook-dark-mode": "^5.0.0",
|
|
142
|
-
"styled-components": "^6.
|
|
145
|
+
"styled-components": "^6.5.0",
|
|
143
146
|
"tarball-extract": "^0.0.6",
|
|
144
|
-
"testcafe": "^3.7.
|
|
147
|
+
"testcafe": "^3.7.6",
|
|
145
148
|
"testcafe-react-selectors": "^5.0.3",
|
|
146
149
|
"testcafe-reporter-xunit": "^2.2.3",
|
|
147
|
-
"ts-jest": "^29.4.
|
|
148
|
-
"ts-loader": "^9.6.
|
|
150
|
+
"ts-jest": "^29.4.12",
|
|
151
|
+
"ts-loader": "^9.6.2",
|
|
149
152
|
"typescript": "^5.9.3",
|
|
150
|
-
"webpack": "^5.
|
|
153
|
+
"webpack": "^5.109.2",
|
|
151
154
|
"webpack-cli": "^6.0.1",
|
|
152
|
-
"webpack-dev-server": "^5.2.
|
|
155
|
+
"webpack-dev-server": "^5.2.6"
|
|
153
156
|
},
|
|
154
157
|
"jest": {
|
|
155
158
|
"transform": {
|
|
@@ -204,6 +207,7 @@
|
|
|
204
207
|
]
|
|
205
208
|
},
|
|
206
209
|
"pre-commit": [
|
|
210
|
+
"license-staged",
|
|
207
211
|
"lint-fix",
|
|
208
212
|
"prettier",
|
|
209
213
|
"test"
|
|
@@ -211,7 +215,7 @@
|
|
|
211
215
|
"bundlesize": [
|
|
212
216
|
{
|
|
213
217
|
"path": "./dist/grommet.min.js",
|
|
214
|
-
"maxSize": "
|
|
218
|
+
"maxSize": "215 kB"
|
|
215
219
|
}
|
|
216
220
|
],
|
|
217
221
|
"keywords": [
|
package/themes/base.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1
3
|
import {
|
|
2
4
|
FlattenInterpolation,
|
|
3
5
|
FlattenSimpleInterpolation,
|
|
@@ -1025,6 +1027,36 @@ export interface ThemeType {
|
|
|
1025
1027
|
size?: string;
|
|
1026
1028
|
};
|
|
1027
1029
|
};
|
|
1030
|
+
dateTimeInput?: {
|
|
1031
|
+
button?: {
|
|
1032
|
+
margin?: string | object;
|
|
1033
|
+
};
|
|
1034
|
+
container?: {
|
|
1035
|
+
round?: RoundType;
|
|
1036
|
+
};
|
|
1037
|
+
active?: {
|
|
1038
|
+
background?: ColorType;
|
|
1039
|
+
pad?: string;
|
|
1040
|
+
indicator?: {
|
|
1041
|
+
color?: ColorType;
|
|
1042
|
+
size?: string;
|
|
1043
|
+
};
|
|
1044
|
+
};
|
|
1045
|
+
drop?: {
|
|
1046
|
+
pad?: PadType;
|
|
1047
|
+
gap?: GapType;
|
|
1048
|
+
border?: {
|
|
1049
|
+
color?: ColorType;
|
|
1050
|
+
size?: string;
|
|
1051
|
+
};
|
|
1052
|
+
};
|
|
1053
|
+
icon?: {
|
|
1054
|
+
calendar?: React.ReactNode | Icon;
|
|
1055
|
+
};
|
|
1056
|
+
separator?: {
|
|
1057
|
+
pad?: GapType;
|
|
1058
|
+
};
|
|
1059
|
+
};
|
|
1028
1060
|
dataTable?: {
|
|
1029
1061
|
body?: {
|
|
1030
1062
|
extend?: ExtendType;
|
|
@@ -2161,6 +2193,22 @@ export interface ThemeType {
|
|
|
2161
2193
|
size?: string;
|
|
2162
2194
|
color?: ColorType;
|
|
2163
2195
|
};
|
|
2196
|
+
button?: {
|
|
2197
|
+
pad?: EdgeSizeType;
|
|
2198
|
+
};
|
|
2199
|
+
horizontal?: {
|
|
2200
|
+
connector?: {
|
|
2201
|
+
margin?: EdgeSizeType;
|
|
2202
|
+
};
|
|
2203
|
+
button?: {
|
|
2204
|
+
gap?: GapType;
|
|
2205
|
+
};
|
|
2206
|
+
};
|
|
2207
|
+
vertical?: {
|
|
2208
|
+
button?: {
|
|
2209
|
+
gap?: GapType;
|
|
2210
|
+
};
|
|
2211
|
+
};
|
|
2164
2212
|
hover?: {
|
|
2165
2213
|
background?: BackgroundType;
|
|
2166
2214
|
border?: ColorType;
|
|
@@ -2436,6 +2484,73 @@ export interface ThemeType {
|
|
|
2436
2484
|
};
|
|
2437
2485
|
};
|
|
2438
2486
|
};
|
|
2487
|
+
wizard?: {
|
|
2488
|
+
container?: {
|
|
2489
|
+
gap?: GapType;
|
|
2490
|
+
background?: BackgroundType;
|
|
2491
|
+
};
|
|
2492
|
+
body?: {
|
|
2493
|
+
pad?: PadType;
|
|
2494
|
+
gap?: GridGapType;
|
|
2495
|
+
};
|
|
2496
|
+
header?: {
|
|
2497
|
+
pad?: PadType;
|
|
2498
|
+
background?: BackgroundType;
|
|
2499
|
+
title?: {
|
|
2500
|
+
size?: string;
|
|
2501
|
+
};
|
|
2502
|
+
close?: {
|
|
2503
|
+
icon?: React.ReactNode | Icon;
|
|
2504
|
+
};
|
|
2505
|
+
};
|
|
2506
|
+
progress?: {
|
|
2507
|
+
horizontal?: {
|
|
2508
|
+
pad?: PadType;
|
|
2509
|
+
};
|
|
2510
|
+
vertical?: {
|
|
2511
|
+
width?: string;
|
|
2512
|
+
pad?: PadType;
|
|
2513
|
+
};
|
|
2514
|
+
};
|
|
2515
|
+
stepHeader?: {
|
|
2516
|
+
pad?: PadType;
|
|
2517
|
+
gap?: GapType;
|
|
2518
|
+
counter?: {
|
|
2519
|
+
size?: string;
|
|
2520
|
+
color?: ColorType;
|
|
2521
|
+
};
|
|
2522
|
+
title?: {
|
|
2523
|
+
size?: string;
|
|
2524
|
+
margin?: MarginType;
|
|
2525
|
+
};
|
|
2526
|
+
description?: {
|
|
2527
|
+
size?: string;
|
|
2528
|
+
color?: ColorType;
|
|
2529
|
+
margin?: MarginType;
|
|
2530
|
+
};
|
|
2531
|
+
};
|
|
2532
|
+
content?: {
|
|
2533
|
+
pad?: PadType;
|
|
2534
|
+
gap?: GapType;
|
|
2535
|
+
background?: BackgroundType;
|
|
2536
|
+
round?: RoundType;
|
|
2537
|
+
margin?: MarginType;
|
|
2538
|
+
};
|
|
2539
|
+
footer?: {
|
|
2540
|
+
background?: BackgroundType;
|
|
2541
|
+
border?: BorderType;
|
|
2542
|
+
gap?: GridGapType;
|
|
2543
|
+
pad?: PadType;
|
|
2544
|
+
justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'stretch';
|
|
2545
|
+
button?: {
|
|
2546
|
+
next?: { icon?: React.ReactNode | Icon };
|
|
2547
|
+
complete?: { icon?: React.ReactNode | Icon };
|
|
2548
|
+
previous?: { icon?: React.ReactNode | Icon };
|
|
2549
|
+
cancel?: { icon?: React.ReactNode | Icon };
|
|
2550
|
+
skip?: { icon?: React.ReactNode | Icon };
|
|
2551
|
+
};
|
|
2552
|
+
};
|
|
2553
|
+
};
|
|
2439
2554
|
worldMap?: {
|
|
2440
2555
|
color?: ColorType;
|
|
2441
2556
|
continent?: {
|
package/themes/base.js
CHANGED
|
@@ -28,7 +28,8 @@ var _VolumeLow = require("grommet-icons/icons/VolumeLow");
|
|
|
28
28
|
var _base = require("grommet-icons/themes/base");
|
|
29
29
|
var _object = require("../utils/object");
|
|
30
30
|
var _mixins = require("../utils/mixins");
|
|
31
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
31
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } // SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
|
|
32
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
32
33
|
var brandColor = '#7D4CDB';
|
|
33
34
|
var accentColors = ['#6FFFB0', '#FD6FFF', '#81FCED', '#FFCA58'];
|
|
34
35
|
var neutralColors = ['#00873D', '#3D138D', '#00739D', '#A2423D'];
|
|
@@ -1128,6 +1129,41 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
1128
1129
|
size: 'medium'
|
|
1129
1130
|
}
|
|
1130
1131
|
},
|
|
1132
|
+
dateTimeInput: {
|
|
1133
|
+
button: {
|
|
1134
|
+
margin: {
|
|
1135
|
+
right: 'small'
|
|
1136
|
+
}
|
|
1137
|
+
},
|
|
1138
|
+
container: {
|
|
1139
|
+
round: 'xxsmall'
|
|
1140
|
+
},
|
|
1141
|
+
active: {
|
|
1142
|
+
background: 'active-background',
|
|
1143
|
+
pad: 'xxsmall',
|
|
1144
|
+
indicator: {
|
|
1145
|
+
color: {
|
|
1146
|
+
dark: 'white',
|
|
1147
|
+
light: 'black'
|
|
1148
|
+
},
|
|
1149
|
+
size: 'small'
|
|
1150
|
+
}
|
|
1151
|
+
},
|
|
1152
|
+
drop: {
|
|
1153
|
+
pad: 'small',
|
|
1154
|
+
gap: 'small',
|
|
1155
|
+
border: {
|
|
1156
|
+
color: 'border',
|
|
1157
|
+
size: 'xsmall'
|
|
1158
|
+
}
|
|
1159
|
+
},
|
|
1160
|
+
icon: {
|
|
1161
|
+
calendar: undefined
|
|
1162
|
+
},
|
|
1163
|
+
separator: {
|
|
1164
|
+
pad: 'xxsmall'
|
|
1165
|
+
}
|
|
1166
|
+
},
|
|
1131
1167
|
dataSearch: {
|
|
1132
1168
|
// icons: {
|
|
1133
1169
|
// search: undefined,
|
|
@@ -2512,6 +2548,22 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
2512
2548
|
size: 'xsmall',
|
|
2513
2549
|
color: 'text-weak'
|
|
2514
2550
|
},
|
|
2551
|
+
button: {
|
|
2552
|
+
pad: 'xxsmall'
|
|
2553
|
+
},
|
|
2554
|
+
horizontal: {
|
|
2555
|
+
connector: {
|
|
2556
|
+
margin: 'xxsmall'
|
|
2557
|
+
},
|
|
2558
|
+
button: {
|
|
2559
|
+
gap: 'xsmall'
|
|
2560
|
+
}
|
|
2561
|
+
},
|
|
2562
|
+
vertical: {
|
|
2563
|
+
button: {
|
|
2564
|
+
gap: 'small'
|
|
2565
|
+
}
|
|
2566
|
+
},
|
|
2515
2567
|
// States: [component].[state].[element].[property]
|
|
2516
2568
|
pending: {
|
|
2517
2569
|
indicator: {
|
|
@@ -2850,6 +2902,9 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
2850
2902
|
selected: {
|
|
2851
2903
|
background: 'selected',
|
|
2852
2904
|
color: 'white',
|
|
2905
|
+
text: {
|
|
2906
|
+
weight: 'medium'
|
|
2907
|
+
},
|
|
2853
2908
|
hover: {
|
|
2854
2909
|
// background: undefined,
|
|
2855
2910
|
}
|
|
@@ -2942,6 +2997,108 @@ var generate = exports.generate = function generate(baseSpacing, scale) {
|
|
|
2942
2997
|
}
|
|
2943
2998
|
}
|
|
2944
2999
|
},
|
|
3000
|
+
wizard: {
|
|
3001
|
+
container: {
|
|
3002
|
+
gap: 'none',
|
|
3003
|
+
background: 'background-back'
|
|
3004
|
+
},
|
|
3005
|
+
body: {
|
|
3006
|
+
pad: {
|
|
3007
|
+
horizontal: 'large',
|
|
3008
|
+
vertical: 'large'
|
|
3009
|
+
},
|
|
3010
|
+
gap: {
|
|
3011
|
+
row: 'none',
|
|
3012
|
+
column: 'medium'
|
|
3013
|
+
}
|
|
3014
|
+
},
|
|
3015
|
+
header: {
|
|
3016
|
+
pad: {
|
|
3017
|
+
horizontal: 'large',
|
|
3018
|
+
vertical: 'small'
|
|
3019
|
+
},
|
|
3020
|
+
background: 'background-front',
|
|
3021
|
+
title: {
|
|
3022
|
+
size: 'small'
|
|
3023
|
+
},
|
|
3024
|
+
close: {
|
|
3025
|
+
icon: _FormClose.FormClose
|
|
3026
|
+
}
|
|
3027
|
+
},
|
|
3028
|
+
progress: {
|
|
3029
|
+
horizontal: {
|
|
3030
|
+
pad: {
|
|
3031
|
+
horizontal: 'none',
|
|
3032
|
+
vertical: 'none'
|
|
3033
|
+
}
|
|
3034
|
+
},
|
|
3035
|
+
vertical: {
|
|
3036
|
+
// Fixed rail width so the column doesn't collapse to label text.
|
|
3037
|
+
width: 'small'
|
|
3038
|
+
// pad: undefined,
|
|
3039
|
+
}
|
|
3040
|
+
},
|
|
3041
|
+
stepHeader: {
|
|
3042
|
+
pad: {
|
|
3043
|
+
horizontal: 'none',
|
|
3044
|
+
vertical: 'none'
|
|
3045
|
+
},
|
|
3046
|
+
counter: {
|
|
3047
|
+
size: 'small',
|
|
3048
|
+
color: 'text'
|
|
3049
|
+
},
|
|
3050
|
+
title: {
|
|
3051
|
+
size: 'large',
|
|
3052
|
+
margin: 'none'
|
|
3053
|
+
},
|
|
3054
|
+
description: {
|
|
3055
|
+
size: 'medium',
|
|
3056
|
+
color: 'text-weak',
|
|
3057
|
+
margin: {
|
|
3058
|
+
top: 'xsmall',
|
|
3059
|
+
bottom: 'none'
|
|
3060
|
+
}
|
|
3061
|
+
}
|
|
3062
|
+
},
|
|
3063
|
+
content: {
|
|
3064
|
+
pad: 'medium',
|
|
3065
|
+
gap: 'medium',
|
|
3066
|
+
background: 'background-front',
|
|
3067
|
+
round: 'small',
|
|
3068
|
+
margin: {
|
|
3069
|
+
top: 'medium'
|
|
3070
|
+
}
|
|
3071
|
+
},
|
|
3072
|
+
footer: {
|
|
3073
|
+
pad: {
|
|
3074
|
+
horizontal: 'large',
|
|
3075
|
+
vertical: 'small'
|
|
3076
|
+
},
|
|
3077
|
+
gap: {
|
|
3078
|
+
row: 'xsmall',
|
|
3079
|
+
column: 'small'
|
|
3080
|
+
},
|
|
3081
|
+
background: 'background-front',
|
|
3082
|
+
justify: 'end',
|
|
3083
|
+
button: {
|
|
3084
|
+
next: {
|
|
3085
|
+
icon: _FormNext.FormNext
|
|
3086
|
+
},
|
|
3087
|
+
complete: {
|
|
3088
|
+
icon: undefined
|
|
3089
|
+
},
|
|
3090
|
+
previous: {
|
|
3091
|
+
icon: _FormPrevious.FormPrevious
|
|
3092
|
+
},
|
|
3093
|
+
cancel: {
|
|
3094
|
+
icon: undefined
|
|
3095
|
+
},
|
|
3096
|
+
skip: {
|
|
3097
|
+
icon: _FormNext.FormNext
|
|
3098
|
+
}
|
|
3099
|
+
}
|
|
3100
|
+
}
|
|
3101
|
+
},
|
|
2945
3102
|
worldMap: {
|
|
2946
3103
|
color: 'light-3',
|
|
2947
3104
|
continent: {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const fs=require("fs"),path=require("path"),{execFileSync}=require("child_process"),HEADER="// SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP\n// SPDX-License-Identifier: Apache-2.0\n",ROOTS=["src","e2e","storybook","tools"],EXTENSIONS=new Set([".js",".jsx",".ts",".tsx",".mjs",".cjs"]),EXCLUDED_DIRS=new Set(["node_modules","dist","coverage",".git",".yarn","storybook-static","__snapshots__"]);function isIncluded(e){return!e.endsWith(".snap")&&EXTENSIONS.has(path.extname(e))}function collectStagedFiles(){return execFileSync("git",["diff","--cached","--name-only","--diff-filter=ACMR"],{encoding:"utf8"}).split("\n").map((e=>e.trim())).filter(Boolean).filter((e=>ROOTS.some((t=>e===t||e.startsWith(`${t}/`))))).filter((e=>isIncluded(e))).filter((e=>fs.existsSync(e)))}function collectFiles(e,t){if(!fs.existsSync(e))return;const s=fs.statSync(e);s.isDirectory()?fs.readdirSync(e,{withFileTypes:!0}).forEach((s=>{s.isDirectory()&&EXCLUDED_DIRS.has(s.name)||collectFiles(path.join(e,s.name),t)})):s.isFile()&&isIncluded(e)&&t.push(e)}function buildExpected(e){let t="",s=e;if(e.startsWith("#!")){const i=e.indexOf("\n");t=-1===i?`${e}\n`:e.slice(0,i+1),s=-1===i?"":e.slice(i+1)}const i=s.split("\n");let n=0;for(;n<i.length&&/^\/\/\s*SPDX-/i.test(i[n]);)n+=1;n>0&&""===i[n]?.trim()&&(n+=1);const c=i.slice(n),l=/^\s*(['"])use [\w-]+\1;?\s*$/.test(c[0]??"");return`${t}${HEADER}${l?"\n":""}${c.join("\n")}`}function main(){const e=process.argv.slice(2),t=e.includes("--check"),s=e.includes("--staged"),i=e.filter((e=>!e.startsWith("--")));let n;if(s)n=collectStagedFiles();else{const e=i.length>0?i:ROOTS;n=[],e.forEach((e=>collectFiles(e,n)))}const c=[];if(n.forEach((e=>{const s=fs.readFileSync(e,"utf8"),i=buildExpected(s);i!==s&&(c.push(e),t||fs.writeFileSync(e,i))})),s&&!t&&c.length>0&&execFileSync("git",["add","--",...c]),t)return c.length>0&&(console.error(`License header check failed: ${c.length} file(s) missing or with an incorrect SPDX header.`),c.forEach((e=>console.error(` ${e}`))),console.error('\nRun "yarn license" to fix the headers.'),process.exit(1)),void console.log(`License header check passed (${n.length} file(s)).`);c.length>0?console.log(`Updated SPDX header in ${c.length} file(s).`):console.log(`All ${n.length} file(s) already compliant.`)}main();
|
package/utils/DOM.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.withinDropPortal = exports.shouldKeepFocus = exports.setFocusWithoutScroll = exports.makeNodeUnfocusable = exports.makeNodeFocusable = exports.isNodeBeforeScroll = exports.isNodeAfterScroll = exports.isFocusable = exports.getNewContainer = exports.getFirstFocusableDescendant = exports.findVisibleParent = exports.findScrollParents = exports.findScrollParent = exports.findButtonParent = exports.containsFocus = void 0;
|
|
5
|
+
// SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
|
|
6
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
7
|
var findScrollParent = exports.findScrollParent = function findScrollParent(element, horizontal) {
|
|
6
8
|
var result;
|
|
7
9
|
if (element) {
|
|
@@ -80,10 +82,17 @@ var withinDropPortal = exports.withinDropPortal = function withinDropPortal(node
|
|
|
80
82
|
return true;
|
|
81
83
|
};
|
|
82
84
|
|
|
83
|
-
// Check if
|
|
85
|
+
// Check if an element can receive focus: native form inputs, or non-native
|
|
86
|
+
// interactive elements with an explicit tabIndex attribute
|
|
87
|
+
// (e.g. span[role="spinbutton"]). Excludes native interactive elements
|
|
88
|
+
// (button, a) so they don't trigger FormField focus state.
|
|
84
89
|
var isFocusable = exports.isFocusable = function isFocusable(element) {
|
|
90
|
+
if (!element || element.disabled) return false;
|
|
85
91
|
var tagName = element.tagName.toLowerCase();
|
|
86
|
-
|
|
92
|
+
if (tagName === 'input' || tagName === 'select' || tagName === 'textarea') return true;
|
|
93
|
+
// Only non-native-interactive elements with an explicit tabindex attribute
|
|
94
|
+
var isNativeInteractive = tagName === 'button' || tagName === 'a';
|
|
95
|
+
return !isNativeInteractive && element.tabIndex >= 0 && element.hasAttribute('tabindex');
|
|
87
96
|
};
|
|
88
97
|
|
|
89
98
|
// Get the first element that can receive focus
|
package/utils/dates.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.setHoursWithOffset = void 0;
|
|
4
|
+
exports.setHoursWithOffset = exports.pad = exports.normalizeStep = void 0;
|
|
5
|
+
// SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
|
|
6
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
7
|
var setHoursWithOffset = exports.setHoursWithOffset = function setHoursWithOffset(date) {
|
|
6
8
|
var newDate = new Date(date);
|
|
7
9
|
if ((date == null ? void 0 : date.indexOf('T')) === -1) {
|
|
@@ -10,4 +12,12 @@ var setHoursWithOffset = exports.setHoursWithOffset = function setHoursWithOffse
|
|
|
10
12
|
newDate.setHours(hour, offset < 0 ? -offset : offset);
|
|
11
13
|
}
|
|
12
14
|
return newDate;
|
|
15
|
+
};
|
|
16
|
+
var pad = exports.pad = function pad(value) {
|
|
17
|
+
return String(value).padStart(2, '0');
|
|
18
|
+
};
|
|
19
|
+
var normalizeStep = exports.normalizeStep = function normalizeStep(step) {
|
|
20
|
+
var parsed = Number(step);
|
|
21
|
+
if (!Number.isFinite(parsed) || parsed <= 0) return 1;
|
|
22
|
+
return Math.max(1, Math.floor(parsed));
|
|
13
23
|
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.getSectionTokenFromType = exports.getSectionNameFromType = exports.getSectionKeyFromType = void 0;
|
|
5
|
+
// SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
|
|
6
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
7
|
+
var sectionKeyByType = {
|
|
8
|
+
day: 'day',
|
|
9
|
+
month: 'month',
|
|
10
|
+
year: 'year',
|
|
11
|
+
hours: 'hour',
|
|
12
|
+
minutes: 'minute',
|
|
13
|
+
seconds: 'second',
|
|
14
|
+
meridiem: 'period'
|
|
15
|
+
};
|
|
16
|
+
var sectionTokenByType = {
|
|
17
|
+
day: 'dd',
|
|
18
|
+
month: 'mm',
|
|
19
|
+
year: 'yyyy',
|
|
20
|
+
hours: 'hh',
|
|
21
|
+
minutes: 'mm',
|
|
22
|
+
seconds: 'ss',
|
|
23
|
+
meridiem: 'aa'
|
|
24
|
+
};
|
|
25
|
+
var sectionMessageSuffixByType = {
|
|
26
|
+
day: 'sectionDay',
|
|
27
|
+
month: 'sectionMonth',
|
|
28
|
+
year: 'sectionYear',
|
|
29
|
+
hours: 'sectionHours',
|
|
30
|
+
minutes: 'sectionMinutes',
|
|
31
|
+
seconds: 'sectionSeconds',
|
|
32
|
+
meridiem: 'sectionMeridiem'
|
|
33
|
+
};
|
|
34
|
+
var defaultSectionNameByType = {
|
|
35
|
+
day: 'day',
|
|
36
|
+
month: 'month',
|
|
37
|
+
year: 'year',
|
|
38
|
+
hours: 'hours',
|
|
39
|
+
minutes: 'minutes',
|
|
40
|
+
seconds: 'seconds',
|
|
41
|
+
meridiem: 'meridiem'
|
|
42
|
+
};
|
|
43
|
+
var getSectionKeyFromType = exports.getSectionKeyFromType = function getSectionKeyFromType(sectionType) {
|
|
44
|
+
return sectionKeyByType[sectionType];
|
|
45
|
+
};
|
|
46
|
+
var getSectionTokenFromType = exports.getSectionTokenFromType = function getSectionTokenFromType(sectionType) {
|
|
47
|
+
return sectionTokenByType[sectionType];
|
|
48
|
+
};
|
|
49
|
+
var getSectionNameFromType = exports.getSectionNameFromType = function getSectionNameFromType(_ref) {
|
|
50
|
+
var sectionType = _ref.sectionType,
|
|
51
|
+
messagePrefix = _ref.messagePrefix,
|
|
52
|
+
formatMessage = _ref.formatMessage,
|
|
53
|
+
messages = _ref.messages;
|
|
54
|
+
if (formatMessage) {
|
|
55
|
+
return formatMessage({
|
|
56
|
+
id: messagePrefix + "." + sectionMessageSuffixByType[sectionType],
|
|
57
|
+
messages: messages
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return defaultSectionNameByType[sectionType];
|
|
61
|
+
};
|