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.
Files changed (124) hide show
  1. package/components/Box/StyledBox.js +1 -1
  2. package/components/Box/stories/ColorContrast.stories.js +36 -0
  3. package/components/Button/BusyAnimation.js +7 -1
  4. package/components/Button/Button.js +12 -3
  5. package/components/DataTable/StyledDataTable.js +1 -1
  6. package/components/DateInput/DateInput.js +3 -3
  7. package/components/DateTimeInput/DateTimeInput.js +17 -11
  8. package/components/FocusedContainer.js +2 -1
  9. package/components/FormField/FormField.js +31 -10
  10. package/components/FormField/FormFieldContext.js +12 -0
  11. package/components/Grommet/Grommet.js +4 -1
  12. package/components/Grommet/StyledGrommet.js +3 -3
  13. package/components/Grommet/index.d.ts +6 -0
  14. package/components/Grommet/propTypes.js +2 -0
  15. package/components/Menu/Menu.js +1 -1
  16. package/components/Select/SelectContainer.js +2 -2
  17. package/components/Select/StyledSelect.js +3 -1
  18. package/components/TextArea/StyledTextArea.js +3 -1
  19. package/components/TextInput/CopyButton.js +23 -6
  20. package/components/TextInput/StyledTextInput.js +19 -25
  21. package/components/TextInput/TextInput.js +75 -28
  22. package/components/TextInput/index.d.ts +12 -3
  23. package/components/TextInput/propTypes.js +2 -0
  24. package/components/TextInput/stories/Copy.stories.tsx +42 -0
  25. package/components/TextInput/stories/CopySecret.stories.tsx +44 -0
  26. package/components/TimeInput/README.md +24 -1
  27. package/components/TimeInput/StyledTimeInput.js +91 -27
  28. package/components/TimeInput/TimeInput.js +185 -120
  29. package/components/TimeInput/TimeInputPopup.js +114 -117
  30. package/components/TimeInput/index.d.ts +2 -0
  31. package/components/TimeInput/propTypes.js +2 -0
  32. package/components/TimeInput/stories/Controlled.stories.tsx +2 -2
  33. package/components/TimeInput/stories/CustomThemed.stories.tsx +79 -0
  34. package/components/TimeInput/stories/CustomThemedHpe.stories.tsx +115 -0
  35. package/components/TimeInput/stories/Form.stories.tsx +1 -0
  36. package/components/TimeInput/stories/ShowSeconds.stories.tsx +28 -0
  37. package/components/TimeInput/useSectionedTimeField.js +2 -2
  38. package/components/TimeInput/utils.js +13 -62
  39. package/components/Wizard/Wizard.js +396 -210
  40. package/components/Wizard/WizardContent.js +61 -35
  41. package/components/Wizard/WizardContext.js +3 -0
  42. package/components/Wizard/WizardFooter.js +14 -15
  43. package/components/Wizard/WizardHeader.js +12 -7
  44. package/components/Wizard/WizardProgress.js +27 -2
  45. package/components/Wizard/index.d.ts +35 -4
  46. package/components/Wizard/propTypes.js +6 -1
  47. package/components/Wizard/stories/BasicLinear.stories.js +12 -10
  48. package/components/Wizard/stories/ClickableSteps.stories.js +104 -0
  49. package/components/Wizard/stories/ExternalForm.stories.js +114 -0
  50. package/components/Wizard/stories/NonClosableHeader.stories.js +68 -0
  51. package/components/Wizard/stories/Validation.stories.js +18 -8
  52. package/es6/components/Box/StyledBox.js +1 -1
  53. package/es6/components/Box/stories/ColorContrast.stories.js +31 -0
  54. package/es6/components/Button/BusyAnimation.js +7 -1
  55. package/es6/components/Button/Button.js +12 -3
  56. package/es6/components/DataTable/StyledDataTable.js +2 -2
  57. package/es6/components/DateInput/DateInput.js +3 -3
  58. package/es6/components/DateTimeInput/DateTimeInput.js +17 -11
  59. package/es6/components/FocusedContainer.js +2 -1
  60. package/es6/components/FormField/FormField.js +31 -10
  61. package/es6/components/FormField/FormFieldContext.js +7 -0
  62. package/es6/components/Grommet/Grommet.js +4 -1
  63. package/es6/components/Grommet/StyledGrommet.js +4 -4
  64. package/es6/components/Grommet/index.d.ts +6 -0
  65. package/es6/components/Grommet/propTypes.js +2 -0
  66. package/es6/components/Menu/Menu.js +1 -1
  67. package/es6/components/Select/SelectContainer.js +2 -2
  68. package/es6/components/Select/StyledSelect.js +4 -2
  69. package/es6/components/TextArea/StyledTextArea.js +4 -2
  70. package/es6/components/TextInput/CopyButton.js +22 -6
  71. package/es6/components/TextInput/StyledTextInput.js +20 -26
  72. package/es6/components/TextInput/TextInput.js +76 -29
  73. package/es6/components/TextInput/index.d.ts +12 -3
  74. package/es6/components/TextInput/propTypes.js +2 -0
  75. package/es6/components/TextInput/stories/Copy.stories.tsx +42 -0
  76. package/es6/components/TextInput/stories/CopySecret.stories.tsx +44 -0
  77. package/es6/components/TimeInput/README.md +24 -1
  78. package/es6/components/TimeInput/StyledTimeInput.js +92 -28
  79. package/es6/components/TimeInput/TimeInput.js +187 -122
  80. package/es6/components/TimeInput/TimeInputPopup.js +115 -118
  81. package/es6/components/TimeInput/index.d.ts +2 -0
  82. package/es6/components/TimeInput/propTypes.js +2 -0
  83. package/es6/components/TimeInput/stories/Controlled.stories.tsx +2 -2
  84. package/es6/components/TimeInput/stories/CustomThemed.stories.tsx +79 -0
  85. package/es6/components/TimeInput/stories/CustomThemedHpe.stories.tsx +115 -0
  86. package/es6/components/TimeInput/stories/Form.stories.tsx +1 -0
  87. package/es6/components/TimeInput/stories/ShowSeconds.stories.tsx +28 -0
  88. package/es6/components/TimeInput/useSectionedTimeField.js +2 -2
  89. package/es6/components/TimeInput/utils.js +12 -61
  90. package/es6/components/Wizard/Wizard.js +397 -211
  91. package/es6/components/Wizard/WizardContent.js +62 -36
  92. package/es6/components/Wizard/WizardContext.js +3 -0
  93. package/es6/components/Wizard/WizardFooter.js +14 -15
  94. package/es6/components/Wizard/WizardHeader.js +12 -7
  95. package/es6/components/Wizard/WizardProgress.js +27 -2
  96. package/es6/components/Wizard/index.d.ts +35 -4
  97. package/es6/components/Wizard/propTypes.js +6 -1
  98. package/es6/components/Wizard/stories/BasicLinear.stories.js +11 -11
  99. package/es6/components/Wizard/stories/ClickableSteps.stories.js +99 -0
  100. package/es6/components/Wizard/stories/ExternalForm.stories.js +111 -0
  101. package/es6/components/Wizard/stories/NonClosableHeader.stories.js +63 -0
  102. package/es6/components/Wizard/stories/Validation.stories.js +18 -9
  103. package/es6/languages/default.json +2 -0
  104. package/es6/themes/base.d.ts +79 -59
  105. package/es6/themes/base.js +65 -34
  106. package/es6/utils/DOM.js +10 -7
  107. package/es6/utils/background.js +9 -7
  108. package/es6/utils/colors.js +84 -12
  109. package/es6/utils/legacyColorIsDark.js +17 -0
  110. package/es6/utils/styles.js +13 -5
  111. package/grommet.min.js +1 -1
  112. package/grommet.min.js.map +1 -1
  113. package/languages/default.json +2 -0
  114. package/package.json +3 -3
  115. package/themes/base.d.ts +79 -59
  116. package/themes/base.js +65 -34
  117. package/tools/draft-release-version-pr.js +1 -0
  118. package/tools/generate-release-notes.js +1 -1
  119. package/tools/release-notes-utils.js +1 -0
  120. package/utils/DOM.js +10 -7
  121. package/utils/background.js +9 -7
  122. package/utils/colors.js +84 -12
  123. package/utils/legacyColorIsDark.js +21 -0
  124. package/utils/styles.js +14 -6
@@ -0,0 +1,44 @@
1
+ // SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import React from 'react';
4
+
5
+ import { Box, Text, TextInput } from 'grommet';
6
+
7
+ // Stands in for retrieving the real secret from a secure store/API,
8
+ // fetched only at copy time so it never lives in component state or the DOM.
9
+ const fetchSecret = async () => 'secret-value';
10
+
11
+ // Caller-supplied mask; the input never displays or holds the real value.
12
+ const MASK = '••••••••••••';
13
+
14
+ export const CopySecret = () => {
15
+ const [status, setStatus] = React.useState<string>('');
16
+
17
+ return (
18
+ // Uncomment <Grommet> lines when using outside of storybook
19
+ // <Grommet theme={...}>
20
+ <Box fill align="center" justify="start" pad="large" gap="medium">
21
+ <Box width="medium" gap="small">
22
+ <TextInput
23
+ value={MASK}
24
+ copy
25
+ // onClickCopy fetches, copies, and discards the secret itself;
26
+ // the masked value passed by TextInput is ignored.
27
+ onClickCopy={async () => {
28
+ const secret = await fetchSecret();
29
+ await navigator.clipboard.writeText(secret);
30
+ setStatus('Secret copied to clipboard');
31
+ // `secret` falls out of scope here and is not retained.
32
+ }}
33
+ aria-label="Secret"
34
+ />
35
+ {status && <Text>{status}</Text>}
36
+ </Box>
37
+ </Box>
38
+ // </Grommet>
39
+ );
40
+ };
41
+
42
+ export default {
43
+ title: 'Input/TextInput/Copy Secret',
44
+ };
@@ -1,2 +1,25 @@
1
1
  ## TimeInput
2
- Documentation for this component: https://v2.grommet.io/timeinput
2
+ Documentation for this component: https://v2.grommet.io/timeinput
3
+
4
+ ### Theme
5
+
6
+ TimeInput is in beta, so its theme API is subject to breaking changes. The
7
+ theme is organized by the part it styles:
8
+
9
+ | Theme path | Part and supported values |
10
+ | --- | --- |
11
+ | `timeInput.container` | The field frame. Supports Box appearance and sizing values such as `background`, `border`, `margin`, `pad`, and `round`. |
12
+ | `timeInput.value` | The visible value frame. Supports Box-part appearance and sizing values `background`, `border`, `elevation`, `height`, `margin`, `pad`, `round`, and `width`. |
13
+ | `timeInput.segment` | Time sections and separators. Supports Box-part appearance values `background`, `border`, `elevation`, `height`, `margin`, `pad`, `round`, and `width`, plus text `color`, `size`, `weight`, and placeholder `color`, `size`, and `weight`. Its `active` state supports Box-state values `background`, `border`, `elevation`, `pad`, and `round`, plus text `color`, `size`, and `weight`. The active underline is styled through `active.border` (default side: `bottom`). A scalar `pad` applies to all edges; the base theme uses horizontal-only padding to preserve the default appearance. |
14
+ | `timeInput.dropButton` | The popup trigger button. Accepts a named Button kind string, `{ kind, icon }`, or a Button theme object with an optional `icon`. The defaults are the clock icon and `toolbar` kind. |
15
+ | `timeInput.drop` | The popup frame. Supports Box appearance values, `width` (Box `WidthType`), `height` (including `height.min`), and `gap`. The base theme defines the default width; an omitted `width.max` defaults to `100%` to constrain the popup to available space. |
16
+ | `timeInput.drop.column` | Each popup list. Supports Box-part appearance and sizing values (`background`, `border`, `elevation`, `height`, `margin`, `pad`, `round`, and `width`), plus `gap`. When `height` is omitted, the list retains its responsive default max height. |
17
+ | `timeInput.drop.option.container` | The Box-backed option surface. Supports Box-part values `background`, `border`, `elevation`, `height`, `margin`, `pad`, `round`, and `width`. Its `hover`, `selected`, and `selected.hover` states support Box-state values `background`, `border`, `elevation`, `pad`, and `round`. Missing selected values inherit the base container style. |
18
+ | `timeInput.drop.option.text` | Option label text. Supports `color`, `size`, and `weight`; its `selected` state supports the same values and overrides the base text values individually. |
19
+
20
+ TimeInput themes only style the parts above. Option role, selection semantics,
21
+ layout alignment, and interaction behavior remain implementation-owned.
22
+ FormField continues to own its surrounding validation frame; option
23
+ focus-visible and general focus indicators continue to use Grommet's global
24
+ focus theme. Inline TimeInput styling is used
25
+ inside DateTimeInput and shares the popup column and option theme.
@@ -1,7 +1,7 @@
1
1
  // SPDX-FileCopyrightText: © Hewlett Packard Enterprise Development LP
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import styled, { css } from 'styled-components';
4
- import { disabledStyle, edgeStyle, focusStyle, inputStyle, normalizeColor, parseMetricToNum, plainInputStyle, readOnlyStyle, styledComponentsConfig } from '../../utils';
4
+ import { backgroundStyle, borderStyle, disabledStyle, edgeStyle, elevationStyle, focusStyle, heightStyle, inputStyle, normalizeColor, parseMetricToNum, plainInputStyle, readOnlyStyle, roundStyle, styledComponentsConfig, widthStyle } from '../../utils';
5
5
  import { Box } from '../Box';
6
6
  export var StyledTimeInputContainer = styled(Box).withConfig({
7
7
  // Keep Box styling props like border and round flowing into Box.
@@ -11,7 +11,7 @@ export var StyledTimeInputContainer = styled(Box).withConfig({
11
11
  }).withConfig({
12
12
  displayName: "StyledTimeInput__StyledTimeInputContainer",
13
13
  componentId: "sc-xktdr3-0"
14
- })(["", " ", " ", ""], function (props) {
14
+ })(["position:relative;", " ", " ", ""], function (props) {
15
15
  return props.disabled && disabledStyle();
16
16
  }, function (props) {
17
17
  return props.readOnlyProp && readOnlyStyle(props.theme);
@@ -26,45 +26,109 @@ export var StyledTimeInputField = styled.div.withConfig(styledComponentsConfig).
26
26
  displayName: "StyledTimeInput__StyledTimeInputField",
27
27
  componentId: "sc-xktdr3-2"
28
28
  })(["position:relative;flex:1 1 auto;min-width:0;"]);
29
- export var StyledTimeInputDisplay = styled.div.withConfig(styledComponentsConfig).withConfig({
29
+ export var StyledTimeInputDisplay = styled(Box).withConfig({
30
30
  displayName: "StyledTimeInput__StyledTimeInputDisplay",
31
31
  componentId: "sc-xktdr3-3"
32
- })(["position:absolute;inset:0;display:flex;align-items:center;overflow:hidden;", ""], function (props) {
33
- return props.theme.global.input.padding && (typeof props.theme.global.input.padding !== 'object' ? "padding: " + (parseMetricToNum(props.theme.global.edgeSize[props.theme.global.input.padding] || props.theme.global.input.padding) - parseMetricToNum(props.theme.global.control.border.width)) + "px;" : edgeStyle('padding', props.theme.global.input.padding, props.responsive, props.theme.box.responsiveBreakpoint, props.theme));
32
+ })(["position:absolute;inset:0;overflow:hidden;", ""], function (props) {
33
+ var _props$theme$timeInpu;
34
+ var valuePad = (_props$theme$timeInpu = props.theme.timeInput) == null || (_props$theme$timeInpu = _props$theme$timeInpu.value) == null ? void 0 : _props$theme$timeInpu.pad;
35
+ if (valuePad !== undefined) {
36
+ return edgeStyle('padding', valuePad, props.responsive, props.theme.box.responsiveBreakpoint, props.theme);
37
+ }
38
+ var inputPadding = props.theme.global.input.padding;
39
+ if (!inputPadding) return undefined;
40
+ if (typeof inputPadding !== 'object') return "padding: " + (parseMetricToNum(props.theme.global.edgeSize[inputPadding] || inputPadding) - parseMetricToNum(props.theme.global.control.border.width)) + "px;";
41
+ return edgeStyle('padding', inputPadding, props.responsive, props.theme.box.responsiveBreakpoint, props.theme);
34
42
  });
35
43
  export var StyledTimeInputSeparator = styled.span.withConfig(styledComponentsConfig).withConfig({
36
44
  displayName: "StyledTimeInput__StyledTimeInputSeparator",
37
45
  componentId: "sc-xktdr3-4"
38
- })(["display:inline-flex;align-items:center;line-height:inherit;color:", ";", ""], function (props) {
39
- return normalizeColor(props.$filled ? 'text' : props.theme.global.colors.placeholder, props.theme);
46
+ })(["display:inline-flex;line-height:inherit;align-items:center;color:", ";", " ", ""], function (props) {
47
+ var _props$theme$timeInpu2, _props$theme$timeInpu3;
48
+ return 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);
49
+ }, function (props) {
50
+ var _props$theme$text;
51
+ var _ref = props.theme.timeInput || {},
52
+ segment = _ref.segment;
53
+ var weight = (segment == null ? void 0 : segment.weight) || props.theme.global.input.weight || props.theme.global.input.font.weight;
54
+ var size = (segment == null ? void 0 : segment.size) || props.theme.global.input.font.size;
55
+ var fontSize = ((_props$theme$text = props.theme.text) == null || (_props$theme$text = _props$theme$text[size]) == null ? void 0 : _props$theme$text.size) || size;
56
+ return css(["", " ", ""], weight && "font-weight: " + weight + ";", fontSize && "font-size: " + fontSize + ";");
40
57
  }, function (props) {
41
- var weight = props.theme.global.input.weight || props.theme.global.input.font.weight;
42
- return weight && "font-weight: " + weight + ";";
58
+ var _props$theme$timeInpu4, _props$theme$text2;
59
+ var placeholder = (_props$theme$timeInpu4 = props.theme.timeInput) == null || (_props$theme$timeInpu4 = _props$theme$timeInpu4.segment) == null ? void 0 : _props$theme$timeInpu4.placeholder;
60
+ if (props.$filled || !placeholder) return '';
61
+ 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;
62
+ return css(["", " ", ""], placeholder.weight !== undefined && "font-weight: " + placeholder.weight + ";", fontSize && "font-size: " + fontSize + ";");
43
63
  });
44
64
  export var StyledTimeInputSegment = styled.span.withConfig(styledComponentsConfig).withConfig({
45
65
  displayName: "StyledTimeInput__StyledTimeInputSegment",
46
66
  componentId: "sc-xktdr3-5"
47
- })(["&:focus{outline:none;}display:inline-flex;align-items:center;position:relative;line-height:inherit;padding-inline:", ";color:", ";", " ", ""], function (props) {
48
- var _props$theme$timeInpu, _props$theme$global$e;
49
- var padToken = (_props$theme$timeInpu = props.theme.timeInput) == null || (_props$theme$timeInpu = _props$theme$timeInpu.active) == null ? void 0 : _props$theme$timeInpu.pad;
50
- return ((_props$theme$global$e = props.theme.global.edgeSize) == null ? void 0 : _props$theme$global$e[padToken]) || padToken;
67
+ })(["&:focus{outline:none;}display:inline-flex;align-items:center;position:relative;line-height:inherit;", ";color:", ";", " ", " ", " ", ""], function (props) {
68
+ var _props$theme$timeInpu5;
69
+ var segment = (_props$theme$timeInpu5 = props.theme.timeInput) == null ? void 0 : _props$theme$timeInpu5.segment;
70
+ var responsive = props.responsive === undefined ? true : props.responsive;
71
+ var styles = [];
72
+ if ((segment == null ? void 0 : segment.background) !== undefined) styles.push(backgroundStyle(segment.background, props.theme));
73
+ if (segment != null && segment.border) styles.push(borderStyle(segment.border, responsive, props.theme));
74
+ if (segment != null && segment.elevation) styles.push(elevationStyle(segment.elevation));
75
+ if (segment != null && segment.height) styles.push(heightStyle(segment.height, props.theme));
76
+ if (segment != null && segment.margin) styles.push(edgeStyle('margin', segment.margin, responsive, props.theme.box.responsiveBreakpoint, props.theme));
77
+ if (segment != null && segment.pad) styles.push(edgeStyle('padding', segment.pad, responsive, props.theme.box.responsiveBreakpoint, props.theme));
78
+ if ((segment == null ? void 0 : segment.round) !== undefined) {
79
+ styles.push(segment.round === false ? 'border-radius: 0;' : roundStyle(segment.round, responsive, props.theme));
80
+ }
81
+ if (segment != null && segment.width) styles.push(widthStyle(segment.width, props.theme));
82
+ return styles;
83
+ }, function (props) {
84
+ var _props$theme$timeInpu6, _props$theme$timeInpu7;
85
+ return 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);
51
86
  }, function (props) {
52
- return normalizeColor(props.$filled ? 'text' : props.theme.global.colors.placeholder, props.theme);
87
+ var _props$theme$text3;
88
+ var _ref2 = props.theme.timeInput || {},
89
+ segment = _ref2.segment;
90
+ var weight = (segment == null ? void 0 : segment.weight) || props.theme.global.input.weight || props.theme.global.input.font.weight;
91
+ var size = (segment == null ? void 0 : segment.size) || props.theme.global.input.font.size;
92
+ var fontSize = ((_props$theme$text3 = props.theme.text) == null || (_props$theme$text3 = _props$theme$text3[size]) == null ? void 0 : _props$theme$text3.size) || size;
93
+ return css(["", " ", ""], weight && "font-weight: " + weight + ";", fontSize && "font-size: " + fontSize + ";");
53
94
  }, function (props) {
54
- var weight = props.theme.global.input.weight || props.theme.global.input.font.weight;
55
- return weight && "font-weight: " + weight + ";";
95
+ var _props$theme$timeInpu8, _props$theme$text4;
96
+ var placeholder = (_props$theme$timeInpu8 = props.theme.timeInput) == null || (_props$theme$timeInpu8 = _props$theme$timeInpu8.segment) == null ? void 0 : _props$theme$timeInpu8.placeholder;
97
+ if (props.$filled || !placeholder) return '';
98
+ 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;
99
+ return css(["", " ", ""], placeholder.weight !== undefined && "font-weight: " + placeholder.weight + ";", fontSize && "font-size: " + fontSize + ";");
100
+ }, function (props) {
101
+ var _props$theme$timeInpu9;
102
+ if (!props.$active) return '';
103
+ var _ref3 = ((_props$theme$timeInpu9 = props.theme.timeInput) == null ? void 0 : _props$theme$timeInpu9.segment) || {},
104
+ active = _ref3.active;
105
+ if (!active) return '';
106
+ var responsive = props.responsive === undefined ? true : props.responsive;
107
+ var styles = [];
108
+ if (active.elevation !== undefined) styles.push(elevationStyle(active.elevation));
109
+ if (active.pad !== undefined) styles.push(edgeStyle('padding', active.pad, responsive, props.theme.box.responsiveBreakpoint, props.theme));
110
+ if (active.round !== undefined) {
111
+ styles.push(active.round === false ? 'border-radius: 0;' : roundStyle(active.round, responsive, props.theme));
112
+ }
113
+ if (active.color !== undefined) styles.push("color: " + normalizeColor(active.color, props.theme) + ";");
114
+ if (active.size !== undefined) {
115
+ var _props$theme$text5;
116
+ var size = active.size;
117
+ 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) + ";");
118
+ }
119
+ if (active.weight !== undefined) styles.push("font-weight: " + active.weight + ";");
120
+ return styles;
56
121
  }, function (props) {
57
- var _props$theme$global$e2, _props$theme$timeInpu2, _props$theme$global$b, _props$theme$global$e3, _props$theme$timeInpu3, _props$theme$timeInpu4;
122
+ var _props$theme$timeInpu0, _active$round, _props$theme$global$e;
58
123
  if (!props.$active) return '';
59
-
60
- // The active indicator's corner rounding is intentionally a fixed
61
- // "hair" edge size rather than a theme-exposed value we can expose
62
- // theme in future.
63
- var activeRound = (_props$theme$global$e2 = props.theme.global.edgeSize) == null ? void 0 : _props$theme$global$e2.hair;
64
- var activeBorderToken = (_props$theme$timeInpu2 = props.theme.timeInput) == null || (_props$theme$timeInpu2 = _props$theme$timeInpu2.active) == null || (_props$theme$timeInpu2 = _props$theme$timeInpu2.indicator) == null ? void 0 : _props$theme$timeInpu2.size;
65
- var activeBorderSize = ((_props$theme$global$b = props.theme.global.borderSize) == null ? void 0 : _props$theme$global$b[activeBorderToken]) || ((_props$theme$global$e3 = props.theme.global.edgeSize) == null ? void 0 : _props$theme$global$e3[activeBorderToken]) || activeBorderToken || props.theme.global.borderSize.small;
66
- return css(["&::before{content:'';position:absolute;inset:0;background-color:", ";border-top-left-radius:", ";border-top-right-radius:", ";}&::after{content:'';position:absolute;left:0;right:0;bottom:0;height:", ";background-color:", ";border-bottom-left-radius:", ";border-bottom-right-radius:", ";}"], normalizeColor((_props$theme$timeInpu3 = props.theme.timeInput) == null || (_props$theme$timeInpu3 = _props$theme$timeInpu3.active) == null ? void 0 : _props$theme$timeInpu3.background, props.theme), activeRound, activeRound, activeBorderSize, normalizeColor(((_props$theme$timeInpu4 = props.theme.timeInput) == null || (_props$theme$timeInpu4 = _props$theme$timeInpu4.active) == null || (_props$theme$timeInpu4 = _props$theme$timeInpu4.indicator) == null ? void 0 : _props$theme$timeInpu4.color) || {
67
- dark: 'white',
68
- light: 'black'
69
- }, props.theme), activeRound, activeRound);
124
+ var _ref4 = ((_props$theme$timeInpu0 = props.theme.timeInput) == null ? void 0 : _props$theme$timeInpu0.segment) || {},
125
+ active = _ref4.active,
126
+ segmentRound = _ref4.round;
127
+ var responsive = props.responsive === undefined ? true : props.responsive;
128
+ var activeRound = (_active$round = active == null ? void 0 : active.round) != null ? _active$round : segmentRound;
129
+ var activeRoundStyle = activeRound && roundStyle(activeRound, responsive, props.theme);
130
+ var activeRoundValue = activeRound === false ? '0' : (_props$theme$global$e = props.theme.global.edgeSize) == null ? void 0 : _props$theme$global$e.hair;
131
+ var underlineBorder = active == null ? void 0 : active.border;
132
+ var underlineBorderStyle = underlineBorder === false || Array.isArray(underlineBorder) && underlineBorder.length === 0 ? 'border: none;' : borderStyle(underlineBorder, responsive, props.theme);
133
+ return css(["&::before{content:'';position:absolute;inset:0;", " ", "}&::after{content:'';position:absolute;inset:0;", " ", "}"], (active == null ? void 0 : active.background) !== undefined ? backgroundStyle(active.background, props.theme, false) : '', activeRoundStyle || css(["border-top-left-radius:", ";border-top-right-radius:", ";border-bottom-left-radius:", ";border-bottom-right-radius:", ";"], activeRoundValue, activeRoundValue, activeRoundValue, activeRoundValue), underlineBorderStyle, activeRoundStyle || css(["border-bottom-left-radius:", ";border-bottom-right-radius:", ";"], activeRoundValue, activeRoundValue));
70
134
  });