grommet 2.57.0 → 2.58.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/Box/StyledBox.js +1 -1
- package/components/Box/stories/ColorContrast.stories.js +36 -0
- package/components/Button/BusyAnimation.js +7 -1
- package/components/Button/Button.js +12 -3
- package/components/DataTable/StyledDataTable.js +1 -1
- package/components/DateInput/DateInput.js +3 -3
- package/components/DateTimeInput/DateTimeInput.js +17 -11
- package/components/FocusedContainer.js +2 -1
- package/components/FormField/FormField.js +31 -10
- package/components/FormField/FormFieldContext.js +12 -0
- package/components/Grommet/Grommet.js +4 -1
- package/components/Grommet/StyledGrommet.js +3 -3
- package/components/Grommet/index.d.ts +6 -0
- package/components/Grommet/propTypes.js +2 -0
- package/components/Menu/Menu.js +1 -1
- package/components/Select/SelectContainer.js +2 -2
- package/components/Select/StyledSelect.js +3 -1
- package/components/TextArea/StyledTextArea.js +3 -1
- package/components/TextInput/CopyButton.js +23 -6
- package/components/TextInput/StyledTextInput.js +19 -25
- package/components/TextInput/TextInput.js +75 -28
- package/components/TextInput/index.d.ts +12 -3
- package/components/TextInput/propTypes.js +2 -0
- package/components/TextInput/stories/Copy.stories.tsx +42 -0
- package/components/TextInput/stories/CopySecret.stories.tsx +44 -0
- package/components/TimeInput/README.md +24 -1
- package/components/TimeInput/StyledTimeInput.js +91 -27
- package/components/TimeInput/TimeInput.js +185 -120
- package/components/TimeInput/TimeInputPopup.js +114 -117
- package/components/TimeInput/index.d.ts +2 -0
- package/components/TimeInput/propTypes.js +2 -0
- package/components/TimeInput/stories/Controlled.stories.tsx +2 -2
- package/components/TimeInput/stories/CustomThemed.stories.tsx +79 -0
- package/components/TimeInput/stories/CustomThemedHpe.stories.tsx +115 -0
- package/components/TimeInput/stories/Form.stories.tsx +1 -0
- package/components/TimeInput/stories/ShowSeconds.stories.tsx +28 -0
- package/components/TimeInput/useSectionedTimeField.js +2 -2
- package/components/TimeInput/utils.js +13 -62
- package/components/Wizard/Wizard.js +396 -210
- package/components/Wizard/WizardContent.js +61 -35
- package/components/Wizard/WizardContext.js +3 -0
- package/components/Wizard/WizardFooter.js +14 -15
- package/components/Wizard/WizardHeader.js +12 -7
- package/components/Wizard/WizardProgress.js +27 -2
- package/components/Wizard/index.d.ts +35 -4
- package/components/Wizard/propTypes.js +6 -1
- package/components/Wizard/stories/BasicLinear.stories.js +12 -10
- package/components/Wizard/stories/ClickableSteps.stories.js +104 -0
- package/components/Wizard/stories/ExternalForm.stories.js +114 -0
- package/components/Wizard/stories/NonClosableHeader.stories.js +68 -0
- package/components/Wizard/stories/Validation.stories.js +18 -8
- package/es6/components/Box/StyledBox.js +1 -1
- package/es6/components/Box/stories/ColorContrast.stories.js +31 -0
- package/es6/components/Button/BusyAnimation.js +7 -1
- package/es6/components/Button/Button.js +12 -3
- package/es6/components/DataTable/StyledDataTable.js +2 -2
- package/es6/components/DateInput/DateInput.js +3 -3
- package/es6/components/DateTimeInput/DateTimeInput.js +17 -11
- package/es6/components/FocusedContainer.js +2 -1
- package/es6/components/FormField/FormField.js +31 -10
- package/es6/components/FormField/FormFieldContext.js +7 -0
- package/es6/components/Grommet/Grommet.js +4 -1
- package/es6/components/Grommet/StyledGrommet.js +4 -4
- package/es6/components/Grommet/index.d.ts +6 -0
- package/es6/components/Grommet/propTypes.js +2 -0
- package/es6/components/Menu/Menu.js +1 -1
- package/es6/components/Select/SelectContainer.js +2 -2
- package/es6/components/Select/StyledSelect.js +4 -2
- package/es6/components/TextArea/StyledTextArea.js +4 -2
- package/es6/components/TextInput/CopyButton.js +22 -6
- package/es6/components/TextInput/StyledTextInput.js +20 -26
- package/es6/components/TextInput/TextInput.js +76 -29
- package/es6/components/TextInput/index.d.ts +12 -3
- package/es6/components/TextInput/propTypes.js +2 -0
- package/es6/components/TextInput/stories/Copy.stories.tsx +42 -0
- package/es6/components/TextInput/stories/CopySecret.stories.tsx +44 -0
- package/es6/components/TimeInput/README.md +24 -1
- package/es6/components/TimeInput/StyledTimeInput.js +92 -28
- package/es6/components/TimeInput/TimeInput.js +187 -122
- package/es6/components/TimeInput/TimeInputPopup.js +115 -118
- package/es6/components/TimeInput/index.d.ts +2 -0
- package/es6/components/TimeInput/propTypes.js +2 -0
- package/es6/components/TimeInput/stories/Controlled.stories.tsx +2 -2
- package/es6/components/TimeInput/stories/CustomThemed.stories.tsx +79 -0
- package/es6/components/TimeInput/stories/CustomThemedHpe.stories.tsx +115 -0
- package/es6/components/TimeInput/stories/Form.stories.tsx +1 -0
- package/es6/components/TimeInput/stories/ShowSeconds.stories.tsx +28 -0
- package/es6/components/TimeInput/useSectionedTimeField.js +2 -2
- package/es6/components/TimeInput/utils.js +12 -61
- package/es6/components/Wizard/Wizard.js +397 -211
- package/es6/components/Wizard/WizardContent.js +62 -36
- package/es6/components/Wizard/WizardContext.js +3 -0
- package/es6/components/Wizard/WizardFooter.js +14 -15
- package/es6/components/Wizard/WizardHeader.js +12 -7
- package/es6/components/Wizard/WizardProgress.js +27 -2
- package/es6/components/Wizard/index.d.ts +35 -4
- package/es6/components/Wizard/propTypes.js +6 -1
- package/es6/components/Wizard/stories/BasicLinear.stories.js +11 -11
- package/es6/components/Wizard/stories/ClickableSteps.stories.js +99 -0
- package/es6/components/Wizard/stories/ExternalForm.stories.js +111 -0
- package/es6/components/Wizard/stories/NonClosableHeader.stories.js +63 -0
- package/es6/components/Wizard/stories/Validation.stories.js +18 -9
- package/es6/languages/default.json +2 -0
- package/es6/themes/base.d.ts +79 -59
- package/es6/themes/base.js +65 -34
- package/es6/utils/DOM.js +10 -7
- package/es6/utils/background.js +9 -7
- package/es6/utils/colors.js +84 -12
- package/es6/utils/legacyColorIsDark.js +17 -0
- package/es6/utils/styles.js +13 -5
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/languages/default.json +2 -0
- package/package.json +3 -3
- package/themes/base.d.ts +79 -59
- package/themes/base.js +65 -34
- package/tools/draft-release-version-pr.js +1 -0
- package/tools/generate-release-notes.js +1 -1
- package/tools/release-notes-utils.js +1 -0
- package/utils/DOM.js +10 -7
- package/utils/background.js +9 -7
- package/utils/colors.js +84 -12
- package/utils/legacyColorIsDark.js +21 -0
- package/utils/styles.js +14 -6
|
@@ -17,7 +17,7 @@ var StyledTimeInputContainer = exports.StyledTimeInputContainer = (0, _styledCom
|
|
|
17
17
|
}).withConfig({
|
|
18
18
|
displayName: "StyledTimeInput__StyledTimeInputContainer",
|
|
19
19
|
componentId: "sc-xktdr3-0"
|
|
20
|
-
})(["", " ", " ", ""], function (props) {
|
|
20
|
+
})(["position:relative;", " ", " ", ""], function (props) {
|
|
21
21
|
return props.disabled && (0, _utils.disabledStyle)();
|
|
22
22
|
}, function (props) {
|
|
23
23
|
return props.readOnlyProp && (0, _utils.readOnlyStyle)(props.theme);
|
|
@@ -32,45 +32,109 @@ var StyledTimeInputField = exports.StyledTimeInputField = _styledComponents["def
|
|
|
32
32
|
displayName: "StyledTimeInput__StyledTimeInputField",
|
|
33
33
|
componentId: "sc-xktdr3-2"
|
|
34
34
|
})(["position:relative;flex:1 1 auto;min-width:0;"]);
|
|
35
|
-
var StyledTimeInputDisplay = exports.StyledTimeInputDisplay = _styledComponents["default"]
|
|
35
|
+
var StyledTimeInputDisplay = exports.StyledTimeInputDisplay = (0, _styledComponents["default"])(_Box.Box).withConfig({
|
|
36
36
|
displayName: "StyledTimeInput__StyledTimeInputDisplay",
|
|
37
37
|
componentId: "sc-xktdr3-3"
|
|
38
|
-
})(["position:absolute;inset:0;
|
|
39
|
-
|
|
38
|
+
})(["position:absolute;inset:0;overflow:hidden;", ""], function (props) {
|
|
39
|
+
var _props$theme$timeInpu;
|
|
40
|
+
var valuePad = (_props$theme$timeInpu = props.theme.timeInput) == null || (_props$theme$timeInpu = _props$theme$timeInpu.value) == null ? void 0 : _props$theme$timeInpu.pad;
|
|
41
|
+
if (valuePad !== undefined) {
|
|
42
|
+
return (0, _utils.edgeStyle)('padding', valuePad, props.responsive, props.theme.box.responsiveBreakpoint, props.theme);
|
|
43
|
+
}
|
|
44
|
+
var inputPadding = props.theme.global.input.padding;
|
|
45
|
+
if (!inputPadding) return undefined;
|
|
46
|
+
if (typeof inputPadding !== 'object') return "padding: " + ((0, _utils.parseMetricToNum)(props.theme.global.edgeSize[inputPadding] || inputPadding) - (0, _utils.parseMetricToNum)(props.theme.global.control.border.width)) + "px;";
|
|
47
|
+
return (0, _utils.edgeStyle)('padding', inputPadding, props.responsive, props.theme.box.responsiveBreakpoint, props.theme);
|
|
40
48
|
});
|
|
41
49
|
var StyledTimeInputSeparator = exports.StyledTimeInputSeparator = _styledComponents["default"].span.withConfig(_utils.styledComponentsConfig).withConfig({
|
|
42
50
|
displayName: "StyledTimeInput__StyledTimeInputSeparator",
|
|
43
51
|
componentId: "sc-xktdr3-4"
|
|
44
|
-
})(["display:inline-flex;align-items:center;
|
|
45
|
-
|
|
52
|
+
})(["display:inline-flex;line-height:inherit;align-items:center;color:", ";", " ", ""], function (props) {
|
|
53
|
+
var _props$theme$timeInpu2, _props$theme$timeInpu3;
|
|
54
|
+
return (0, _utils.normalizeColor)(props.$filled ? ((_props$theme$timeInpu2 = props.theme.timeInput) == null || (_props$theme$timeInpu2 = _props$theme$timeInpu2.segment) == null ? void 0 : _props$theme$timeInpu2.color) || 'text' : ((_props$theme$timeInpu3 = props.theme.timeInput) == null || (_props$theme$timeInpu3 = _props$theme$timeInpu3.segment) == null || (_props$theme$timeInpu3 = _props$theme$timeInpu3.placeholder) == null ? void 0 : _props$theme$timeInpu3.color) || props.theme.global.colors.placeholder, props.theme);
|
|
55
|
+
}, function (props) {
|
|
56
|
+
var _props$theme$text;
|
|
57
|
+
var _ref = props.theme.timeInput || {},
|
|
58
|
+
segment = _ref.segment;
|
|
59
|
+
var weight = (segment == null ? void 0 : segment.weight) || props.theme.global.input.weight || props.theme.global.input.font.weight;
|
|
60
|
+
var size = (segment == null ? void 0 : segment.size) || props.theme.global.input.font.size;
|
|
61
|
+
var fontSize = ((_props$theme$text = props.theme.text) == null || (_props$theme$text = _props$theme$text[size]) == null ? void 0 : _props$theme$text.size) || size;
|
|
62
|
+
return (0, _styledComponents.css)(["", " ", ""], weight && "font-weight: " + weight + ";", fontSize && "font-size: " + fontSize + ";");
|
|
46
63
|
}, function (props) {
|
|
47
|
-
var
|
|
48
|
-
|
|
64
|
+
var _props$theme$timeInpu4, _props$theme$text2;
|
|
65
|
+
var placeholder = (_props$theme$timeInpu4 = props.theme.timeInput) == null || (_props$theme$timeInpu4 = _props$theme$timeInpu4.segment) == null ? void 0 : _props$theme$timeInpu4.placeholder;
|
|
66
|
+
if (props.$filled || !placeholder) return '';
|
|
67
|
+
var fontSize = ((_props$theme$text2 = props.theme.text) == null || (_props$theme$text2 = _props$theme$text2[placeholder.size]) == null ? void 0 : _props$theme$text2.size) || placeholder.size;
|
|
68
|
+
return (0, _styledComponents.css)(["", " ", ""], placeholder.weight !== undefined && "font-weight: " + placeholder.weight + ";", fontSize && "font-size: " + fontSize + ";");
|
|
49
69
|
});
|
|
50
70
|
var StyledTimeInputSegment = exports.StyledTimeInputSegment = _styledComponents["default"].span.withConfig(_utils.styledComponentsConfig).withConfig({
|
|
51
71
|
displayName: "StyledTimeInput__StyledTimeInputSegment",
|
|
52
72
|
componentId: "sc-xktdr3-5"
|
|
53
|
-
})(["&:focus{outline:none;}display:inline-flex;align-items:center;position:relative;line-height:inherit;
|
|
54
|
-
var _props$theme$
|
|
55
|
-
var
|
|
56
|
-
|
|
73
|
+
})(["&:focus{outline:none;}display:inline-flex;align-items:center;position:relative;line-height:inherit;", ";color:", ";", " ", " ", " ", ""], function (props) {
|
|
74
|
+
var _props$theme$timeInpu5;
|
|
75
|
+
var segment = (_props$theme$timeInpu5 = props.theme.timeInput) == null ? void 0 : _props$theme$timeInpu5.segment;
|
|
76
|
+
var responsive = props.responsive === undefined ? true : props.responsive;
|
|
77
|
+
var styles = [];
|
|
78
|
+
if ((segment == null ? void 0 : segment.background) !== undefined) styles.push((0, _utils.backgroundStyle)(segment.background, props.theme));
|
|
79
|
+
if (segment != null && segment.border) styles.push((0, _utils.borderStyle)(segment.border, responsive, props.theme));
|
|
80
|
+
if (segment != null && segment.elevation) styles.push((0, _utils.elevationStyle)(segment.elevation));
|
|
81
|
+
if (segment != null && segment.height) styles.push((0, _utils.heightStyle)(segment.height, props.theme));
|
|
82
|
+
if (segment != null && segment.margin) styles.push((0, _utils.edgeStyle)('margin', segment.margin, responsive, props.theme.box.responsiveBreakpoint, props.theme));
|
|
83
|
+
if (segment != null && segment.pad) styles.push((0, _utils.edgeStyle)('padding', segment.pad, responsive, props.theme.box.responsiveBreakpoint, props.theme));
|
|
84
|
+
if ((segment == null ? void 0 : segment.round) !== undefined) {
|
|
85
|
+
styles.push(segment.round === false ? 'border-radius: 0;' : (0, _utils.roundStyle)(segment.round, responsive, props.theme));
|
|
86
|
+
}
|
|
87
|
+
if (segment != null && segment.width) styles.push((0, _utils.widthStyle)(segment.width, props.theme));
|
|
88
|
+
return styles;
|
|
57
89
|
}, function (props) {
|
|
58
|
-
|
|
90
|
+
var _props$theme$timeInpu6, _props$theme$timeInpu7;
|
|
91
|
+
return (0, _utils.normalizeColor)(props.$filled ? ((_props$theme$timeInpu6 = props.theme.timeInput) == null || (_props$theme$timeInpu6 = _props$theme$timeInpu6.segment) == null ? void 0 : _props$theme$timeInpu6.color) || 'text' : ((_props$theme$timeInpu7 = props.theme.timeInput) == null || (_props$theme$timeInpu7 = _props$theme$timeInpu7.segment) == null || (_props$theme$timeInpu7 = _props$theme$timeInpu7.placeholder) == null ? void 0 : _props$theme$timeInpu7.color) || props.theme.global.colors.placeholder, props.theme);
|
|
59
92
|
}, function (props) {
|
|
60
|
-
var
|
|
61
|
-
|
|
93
|
+
var _props$theme$text3;
|
|
94
|
+
var _ref2 = props.theme.timeInput || {},
|
|
95
|
+
segment = _ref2.segment;
|
|
96
|
+
var weight = (segment == null ? void 0 : segment.weight) || props.theme.global.input.weight || props.theme.global.input.font.weight;
|
|
97
|
+
var size = (segment == null ? void 0 : segment.size) || props.theme.global.input.font.size;
|
|
98
|
+
var fontSize = ((_props$theme$text3 = props.theme.text) == null || (_props$theme$text3 = _props$theme$text3[size]) == null ? void 0 : _props$theme$text3.size) || size;
|
|
99
|
+
return (0, _styledComponents.css)(["", " ", ""], weight && "font-weight: " + weight + ";", fontSize && "font-size: " + fontSize + ";");
|
|
62
100
|
}, function (props) {
|
|
63
|
-
var _props$theme$
|
|
101
|
+
var _props$theme$timeInpu8, _props$theme$text4;
|
|
102
|
+
var placeholder = (_props$theme$timeInpu8 = props.theme.timeInput) == null || (_props$theme$timeInpu8 = _props$theme$timeInpu8.segment) == null ? void 0 : _props$theme$timeInpu8.placeholder;
|
|
103
|
+
if (props.$filled || !placeholder) return '';
|
|
104
|
+
var fontSize = ((_props$theme$text4 = props.theme.text) == null || (_props$theme$text4 = _props$theme$text4[placeholder.size]) == null ? void 0 : _props$theme$text4.size) || placeholder.size;
|
|
105
|
+
return (0, _styledComponents.css)(["", " ", ""], placeholder.weight !== undefined && "font-weight: " + placeholder.weight + ";", fontSize && "font-size: " + fontSize + ";");
|
|
106
|
+
}, function (props) {
|
|
107
|
+
var _props$theme$timeInpu9;
|
|
64
108
|
if (!props.$active) return '';
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
109
|
+
var _ref3 = ((_props$theme$timeInpu9 = props.theme.timeInput) == null ? void 0 : _props$theme$timeInpu9.segment) || {},
|
|
110
|
+
active = _ref3.active;
|
|
111
|
+
if (!active) return '';
|
|
112
|
+
var responsive = props.responsive === undefined ? true : props.responsive;
|
|
113
|
+
var styles = [];
|
|
114
|
+
if (active.elevation !== undefined) styles.push((0, _utils.elevationStyle)(active.elevation));
|
|
115
|
+
if (active.pad !== undefined) styles.push((0, _utils.edgeStyle)('padding', active.pad, responsive, props.theme.box.responsiveBreakpoint, props.theme));
|
|
116
|
+
if (active.round !== undefined) {
|
|
117
|
+
styles.push(active.round === false ? 'border-radius: 0;' : (0, _utils.roundStyle)(active.round, responsive, props.theme));
|
|
118
|
+
}
|
|
119
|
+
if (active.color !== undefined) styles.push("color: " + (0, _utils.normalizeColor)(active.color, props.theme) + ";");
|
|
120
|
+
if (active.size !== undefined) {
|
|
121
|
+
var _props$theme$text5;
|
|
122
|
+
var size = active.size;
|
|
123
|
+
styles.push("font-size: " + (((_props$theme$text5 = props.theme.text) == null || (_props$theme$text5 = _props$theme$text5[size]) == null ? void 0 : _props$theme$text5.size) || size) + ";");
|
|
124
|
+
}
|
|
125
|
+
if (active.weight !== undefined) styles.push("font-weight: " + active.weight + ";");
|
|
126
|
+
return styles;
|
|
127
|
+
}, function (props) {
|
|
128
|
+
var _props$theme$timeInpu0, _active$round, _props$theme$global$e;
|
|
129
|
+
if (!props.$active) return '';
|
|
130
|
+
var _ref4 = ((_props$theme$timeInpu0 = props.theme.timeInput) == null ? void 0 : _props$theme$timeInpu0.segment) || {},
|
|
131
|
+
active = _ref4.active,
|
|
132
|
+
segmentRound = _ref4.round;
|
|
133
|
+
var responsive = props.responsive === undefined ? true : props.responsive;
|
|
134
|
+
var activeRound = (_active$round = active == null ? void 0 : active.round) != null ? _active$round : segmentRound;
|
|
135
|
+
var activeRoundStyle = activeRound && (0, _utils.roundStyle)(activeRound, responsive, props.theme);
|
|
136
|
+
var activeRoundValue = activeRound === false ? '0' : (_props$theme$global$e = props.theme.global.edgeSize) == null ? void 0 : _props$theme$global$e.hair;
|
|
137
|
+
var underlineBorder = active == null ? void 0 : active.border;
|
|
138
|
+
var underlineBorderStyle = underlineBorder === false || Array.isArray(underlineBorder) && underlineBorder.length === 0 ? 'border: none;' : (0, _utils.borderStyle)(underlineBorder, responsive, props.theme);
|
|
139
|
+
return (0, _styledComponents.css)(["&::before{content:'';position:absolute;inset:0;", " ", "}&::after{content:'';position:absolute;inset:0;", " ", "}"], (active == null ? void 0 : active.background) !== undefined ? (0, _utils.backgroundStyle)(active.background, props.theme, false) : '', activeRoundStyle || (0, _styledComponents.css)(["border-top-left-radius:", ";border-top-right-radius:", ";border-bottom-left-radius:", ";border-bottom-right-radius:", ";"], activeRoundValue, activeRoundValue, activeRoundValue, activeRoundValue), underlineBorderStyle, activeRoundStyle || (0, _styledComponents.css)(["border-bottom-left-radius:", ";border-bottom-right-radius:", ";"], activeRoundValue, activeRoundValue));
|
|
76
140
|
});
|