@wix/editor-react-components 1.2330.0 → 1.2332.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.
@@ -1,5 +1,5 @@
1
1
  import { I as INTERACTIONS, D as DATA, C as CSS_PROPERTIES, b as DISPLAY_GROUPS, N as NativeStateType, L as LAYOUT, A as Archetype } from "../chunks/chunk-JPMZBG44.js";
2
- import { D as DisplayNames, a as DesignStates, s as selectors } from "../chunks/constants3.js";
2
+ import { D as DesignStates, a as DisplayNames, s as selectors } from "../chunks/constants3.js";
3
3
  import { w as withSpec, g as getSelector } from "../chunks/manifest.js";
4
4
  import { I as IS_SUPPORT_DESIGN_STATE_SPEC } from "../chunks/specs.js";
5
5
  import { m as manifestFocusable, b as manifestInputable, a as manifestChangeable } from "../chunks/manifestSdkMixins.js";
@@ -27,11 +27,6 @@ export type TimePickerProps = Omit<SdkFunctionChangeableProps, 'onChange'> & Sdk
27
27
  value: string;
28
28
  /** Optional text label rendered above the field. */
29
29
  label: string;
30
- /**
31
- * ISO `HH:MM` time that seeds the empty field (React Aria `placeholderValue`
32
- * — e.g. which hour the segments start at).
33
- */
34
- placeholder: string;
35
30
  /** Site-facing helper text rendered under the field. */
36
31
  description?: string;
37
32
  /** Hint text revealed from an info icon next to the label. */
@@ -140,11 +140,6 @@ function TimePicker(props) {
140
140
  const tooltip2 = readString(props.tooltip);
141
141
  const isDisabled = readBool(props.isDisabled, false);
142
142
  const isRequired = readBool(props.required, defaultValues.required);
143
- const placeholderStr = readString(props.placeholder);
144
- const placeholderValue = useMemo(
145
- () => toTimeValue(placeholderStr) ?? void 0,
146
- [placeholderStr]
147
- );
148
143
  const { timeValue, handleChange, hasValue } = useTimePickerValue({
149
144
  value: props.value,
150
145
  onChange,
@@ -202,7 +197,6 @@ function TimePicker(props) {
202
197
  shouldForceLeadingZeros: shouldForceLeadingZeros || void 0,
203
198
  minValue,
204
199
  maxValue,
205
- placeholderValue,
206
200
  isDisabled,
207
201
  isReadOnly: readOnly,
208
202
  isRequired,
@@ -22,7 +22,6 @@ export declare const DisplayNames: {
22
22
  shouldForceLeadingZeros: string;
23
23
  tooltip: string;
24
24
  label: string;
25
- placeholder: string;
26
25
  description: string;
27
26
  minTime: string;
28
27
  maxTime: string;
@@ -31,6 +30,11 @@ export declare const DisplayNames: {
31
30
  disabled: string;
32
31
  clearable: string;
33
32
  };
33
+ designStates: {
34
+ hover: string;
35
+ focus: string;
36
+ disabled: string;
37
+ };
34
38
  elements: {
35
39
  label: string;
36
40
  timeInput: string;
@@ -48,7 +52,6 @@ export declare const defaultValues: {
48
52
  readonly shouldForceLeadingZeros: false;
49
53
  readonly tooltip: "";
50
54
  readonly label: "";
51
- readonly placeholder: "";
52
55
  readonly description: "";
53
56
  readonly required: false;
54
57
  readonly readOnly: false;
@@ -67,6 +70,22 @@ export declare const enum HourCycleValues {
67
70
  H12 = "12",
68
71
  H24 = "24"
69
72
  }
73
+ export declare const DesignStates: {
74
+ timeInput: {
75
+ hover: {
76
+ displayName: string;
77
+ className: string;
78
+ };
79
+ focus: {
80
+ displayName: string;
81
+ className: string;
82
+ };
83
+ disabled: {
84
+ displayName: string;
85
+ className: string;
86
+ };
87
+ };
88
+ };
70
89
  /** The value that represents "no time selected". */
71
90
  export declare const EMPTY_VALUE = "";
72
91
  export declare const TRANSLATIONS_NAMESPACE = "timePicker";
@@ -9,13 +9,7 @@
9
9
  );
10
10
  --label-text-color: var(--wst-paragraph-2-color, #2b2b2b);
11
11
 
12
- --field-background-color: var(--wst-primary-background-color, #ffffff);
13
12
  --borderColor: var(--wst-system-line-1-color, #dfe5eb);
14
- --borderWidth: 1px;
15
- --borderStartStartRadius: 6px;
16
- --borderStartEndRadius: 6px;
17
- --borderEndStartRadius: 6px;
18
- --borderEndEndRadius: 6px;
19
13
 
20
14
  --label-spacing: 6px;
21
15
 
@@ -48,17 +42,23 @@
48
42
  .timePicker__j78My {
49
43
  display: flex;
50
44
  flex-direction: column;
45
+ row-gap: var(--label-spacing, 6px);
51
46
  }
52
47
  .labelRow__qoC8g {
53
48
  display: flex;
54
- align-items: center;
49
+ align-items: flex-start;
55
50
  gap: 6px;
56
- margin: 0 0 var(--label-spacing);
51
+ margin: 0;
52
+ min-width: 0;
57
53
  }
58
54
  .label__THO5j {
59
55
  margin: 0;
56
+ min-width: 0;
57
+ max-width: 100%;
60
58
  font: var(--labelFont);
61
59
  color: var(--label-text-color);
60
+ overflow-wrap: break-word;
61
+ word-break: break-word;
62
62
  }
63
63
  .tooltipButton__ISWIR {
64
64
  flex: none;
@@ -100,29 +100,34 @@
100
100
  box-sizing: border-box;
101
101
  display: flex;
102
102
  align-items: center;
103
- gap: 8px;
104
103
  width: 100%;
105
- padding: 8px 12px;
104
+ column-gap: 8px;
105
+ padding-top: 8px;
106
+ padding-bottom: 8px;
107
+ padding-inline-start: 12px;
108
+ padding-inline-end: 12px;
106
109
  font: inherit;
107
110
  color: inherit;
108
- background: var(--field-background-color);
109
- border-style: solid;
110
- border-width: var(--borderWidth);
111
- border-color: var(--borderColor);
112
- border-start-start-radius: var(--borderStartStartRadius);
113
- border-start-end-radius: var(--borderStartEndRadius);
114
- border-end-start-radius: var(--borderEndStartRadius);
115
- border-end-end-radius: var(--borderEndEndRadius);
111
+ background: var(--wst-primary-background-color, #ffffff);
112
+ box-shadow: none;
113
+ border-top: 1px solid var(--borderColor);
114
+ border-bottom: 1px solid var(--borderColor);
115
+ border-inline-start: 1px solid var(--borderColor);
116
+ border-inline-end: 1px solid var(--borderColor);
117
+ border-start-start-radius: 6px;
118
+ border-start-end-radius: 6px;
119
+ border-end-start-radius: 6px;
120
+ border-end-end-radius: 6px;
116
121
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
117
122
  }
118
- .group__6HZy7:focus-within {
123
+ .group__6HZy7:focus-within, .group__6HZy7.timePicker__group--focus {
119
124
  border-color: var(--accent-color);
120
125
  box-shadow: 0 0 0 1px var(--accent-color);
121
126
  }
122
- .group__6HZy7:hover:not(:focus-within) {
127
+ .group__6HZy7:hover:not(:focus-within), .group__6HZy7.timePicker__group--hover {
123
128
  border-color: color-mix(in srgb, var(--accent-color) 45%, transparent);
124
129
  }
125
- .timePicker__j78My[data-disabled] {
130
+ .group__6HZy7[data-disabled], .group__6HZy7.timePicker__group--disabled {
126
131
  opacity: 0.55;
127
132
  cursor: not-allowed;
128
133
  }
@@ -136,7 +141,6 @@
136
141
  white-space: nowrap;
137
142
  }
138
143
  .description__ePprf {
139
- margin-top: 4px;
140
144
  font-size: 12px;
141
145
  opacity: 0.7;
142
146
  }
@@ -155,8 +159,8 @@
155
159
  color: color-mix(in srgb, currentColor 45%, transparent);
156
160
  }
157
161
  .segment__OtazP[data-focused] {
158
- background: var(--accent-color);
159
- color: var(--segment-focus-text-color);
162
+ background: var(--segment-focus-background-color, #116dff);
163
+ color: var(--segment-focus-text-color, #ffffff);
160
164
  }
161
165
  .clearButton__Bto7s {
162
166
  flex: none;
@@ -1,14 +1,22 @@
1
1
  import { C as CSS_PROPERTIES, b as DISPLAY_GROUPS, D as DATA, E as ELEMENTS, L as LAYOUT, A as Archetype } from "../chunks/chunk-JPMZBG44.js";
2
- import { c as DisplayNames, d as defaultValues, s as selectors } from "../chunks/constants2.js";
3
- import { g as getSelector } from "../chunks/manifest.js";
2
+ import { c as DisplayNames, d as defaultValues, e as DesignStates, s as selectors } from "../chunks/constants2.js";
3
+ import { w as withSpec, g as getSelector } from "../chunks/manifest.js";
4
+ import { I as IS_SUPPORT_DESIGN_STATE_SPEC } from "../chunks/specs.js";
4
5
  import { m as manifestFocusable, a as manifestChangeable } from "../chunks/manifestSdkMixins.js";
5
6
  const cssProperties = {
6
7
  font: {},
7
8
  color: {},
8
9
  textAlign: {}
9
10
  };
11
+ const designState = (s) => withSpec({
12
+ spec: IS_SUPPORT_DESIGN_STATE_SPEC,
13
+ displayName: s.displayName,
14
+ className: s.className
15
+ });
10
16
  const cssCustomProperties = {
11
17
  "segment-focus-background-color": {
18
+ // Keep `color` (not `backgroundColor`): Dev Center enrichment rejects
19
+ // changing a released cssCustomProperty's type (this was published as color).
12
20
  cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.color,
13
21
  displayName: DisplayNames.root.cssCustomProperties.segmentFocusBackgroundColor
14
22
  },
@@ -22,21 +30,22 @@ const cssCustomProperties = {
22
30
  defaultValue: "6px"
23
31
  }
24
32
  };
25
- const boxBorder = {
26
- borderTop: {},
27
- borderBottom: {},
28
- borderInlineStart: {},
29
- borderInlineEnd: {},
30
- borderStartStartRadius: {},
31
- borderStartEndRadius: {},
32
- borderEndStartRadius: {},
33
- borderEndEndRadius: {}
34
- };
35
- const boxPadding = {
36
- paddingTop: {},
37
- paddingBottom: {},
38
- paddingInlineStart: {},
39
- paddingInlineEnd: {}
33
+ const fieldBorder = "1px solid var(--wst-system-line-1-color, #dfe5eb)";
34
+ const timeInputCssProperties = {
35
+ background: { defaultValue: "var(--wst-primary-background-color, #ffffff)" },
36
+ boxShadow: { defaultValue: "none" },
37
+ borderTop: { defaultValue: fieldBorder },
38
+ borderBottom: { defaultValue: fieldBorder },
39
+ borderInlineStart: { defaultValue: fieldBorder },
40
+ borderInlineEnd: { defaultValue: fieldBorder },
41
+ borderStartStartRadius: { defaultValue: "6px" },
42
+ borderStartEndRadius: { defaultValue: "6px" },
43
+ borderEndStartRadius: { defaultValue: "6px" },
44
+ borderEndEndRadius: { defaultValue: "6px" },
45
+ paddingTop: { defaultValue: "8px" },
46
+ paddingBottom: { defaultValue: "8px" },
47
+ paddingInlineStart: { defaultValue: "12px" },
48
+ paddingInlineEnd: { defaultValue: "12px" }
40
49
  };
41
50
  const manifest = {
42
51
  id: "eb293641-a409-4f13-b122-57534b6abdab",
@@ -78,11 +87,11 @@ const manifest = {
78
87
  displayName: DisplayNames.root.elements.timeInput,
79
88
  selector: getSelector(selectors.group),
80
89
  behaviors: { selectable: false },
81
- cssProperties: {
82
- background: {},
83
- columnGap: {},
84
- ...boxBorder,
85
- ...boxPadding
90
+ cssProperties: timeInputCssProperties,
91
+ states: {
92
+ hover: designState(DesignStates.timeInput.hover),
93
+ focus: designState(DesignStates.timeInput.focus),
94
+ disabled: designState(DesignStates.timeInput.disabled)
86
95
  }
87
96
  }
88
97
  }
@@ -149,10 +158,6 @@ const manifest = {
149
158
  displayName: DisplayNames.root.data.tooltip,
150
159
  defaultValue: defaultValues.tooltip
151
160
  },
152
- placeholder: {
153
- dataType: DATA.DATA_TYPE.localTime,
154
- displayName: DisplayNames.root.data.placeholder
155
- },
156
161
  description: {
157
162
  dataType: DATA.DATA_TYPE.text,
158
163
  displayName: DisplayNames.root.data.description,
@@ -217,7 +222,6 @@ const manifest = {
217
222
  "shouldForceLeadingZeros",
218
223
  "label",
219
224
  "tooltip",
220
- "placeholder",
221
225
  "description",
222
226
  "minTime",
223
227
  "maxTime"
@@ -22,7 +22,6 @@ const DisplayNames = {
22
22
  shouldForceLeadingZeros: "Always show leading zeros",
23
23
  tooltip: "Tooltip",
24
24
  label: "Label",
25
- placeholder: "Placeholder time (HH:MM)",
26
25
  description: "Helper text",
27
26
  minTime: "Earliest time (HH:MM)",
28
27
  maxTime: "Latest time (HH:MM)",
@@ -31,6 +30,11 @@ const DisplayNames = {
31
30
  disabled: "Disabled",
32
31
  clearable: "Show clear button"
33
32
  },
33
+ designStates: {
34
+ hover: "Hover",
35
+ focus: "Focus",
36
+ disabled: "Disabled"
37
+ },
34
38
  elements: {
35
39
  label: "Label",
36
40
  timeInput: "Time input"
@@ -60,6 +64,22 @@ var HourCycleValues = /* @__PURE__ */ ((HourCycleValues2) => {
60
64
  HourCycleValues2["H24"] = "24";
61
65
  return HourCycleValues2;
62
66
  })(HourCycleValues || {});
67
+ const DesignStates = {
68
+ timeInput: {
69
+ hover: {
70
+ displayName: DisplayNames.root.designStates.hover,
71
+ className: "timePicker__group--hover"
72
+ },
73
+ focus: {
74
+ displayName: DisplayNames.root.designStates.focus,
75
+ className: "timePicker__group--focus"
76
+ },
77
+ disabled: {
78
+ displayName: DisplayNames.root.designStates.disabled,
79
+ className: "timePicker__group--disabled"
80
+ }
81
+ }
82
+ };
63
83
  const EMPTY_VALUE = "";
64
84
  const TRANSLATIONS_NAMESPACE = "timePicker";
65
85
  const TranslationKeys = {
@@ -91,5 +111,6 @@ export {
91
111
  TranslationKeys as b,
92
112
  DisplayNames as c,
93
113
  defaultValues as d,
114
+ DesignStates as e,
94
115
  selectors as s
95
116
  };
@@ -67,7 +67,7 @@ const DisplayNames = {
67
67
  }
68
68
  };
69
69
  export {
70
- DisplayNames as D,
71
- DesignStates as a,
70
+ DesignStates as D,
71
+ DisplayNames as a,
72
72
  selectors as s
73
73
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/editor-react-components",
3
- "version": "1.2330.0",
3
+ "version": "1.2332.0",
4
4
  "description": "React components for the Wix Editor",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -66,7 +66,7 @@
66
66
  "format:check": "yarn run -T format:package:check"
67
67
  },
68
68
  "peerDependencies": {
69
- "@wix/editor-react-types": "^1.0.65",
69
+ "@wix/editor-react-types": "^1.0.67",
70
70
  "react": "^18.2.0",
71
71
  "react-dom": "^18.2.0"
72
72
  },
@@ -78,7 +78,7 @@
78
78
  "@wix/ambassador-devcenter-v1-component-type-data": "^1.0.436",
79
79
  "@wix/sdk": "^1.21.13",
80
80
  "@wix/services-manager-react": "^0.1.27",
81
- "@wix/site-ui": "1.155.0",
81
+ "@wix/site-ui": "1.156.0",
82
82
  "@wix/video": "^1.85.0",
83
83
  "@wix/viewer-service-consent-policy": "^1.0.100",
84
84
  "@wix/web-bi-logger": "^2.1.26",
@@ -108,7 +108,7 @@
108
108
  "@types/react-dom": "^18.2.17",
109
109
  "@uiw/react-codemirror": "^4.24.1",
110
110
  "@vitejs/plugin-react": "^4.3.4",
111
- "@wix/a11y-audit-tool-plugin": "^0.333.0",
111
+ "@wix/a11y-audit-tool-plugin": "^0.334.0",
112
112
  "@wix/astro": "^2.63.0",
113
113
  "@wix/business-tools": "^1.0.225",
114
114
  "@wix/cli": "^1.1.226",
@@ -119,7 +119,7 @@
119
119
  "@wix/editor": "^1.586.0",
120
120
  "@wix/editor-elements-scripts": "^1.0.0",
121
121
  "@wix/editor-elements-test-utils": "^1.0.0",
122
- "@wix/editor-react-types": "^1.0.65",
122
+ "@wix/editor-react-types": "^1.0.67",
123
123
  "@wix/essentials": "^0.1.28",
124
124
  "@wix/fed-cli-sled": "1.0.25",
125
125
  "@wix/image": "^1.437.0",
@@ -197,5 +197,5 @@
197
197
  "registry": "https://registry.npmjs.org/",
198
198
  "access": "public"
199
199
  },
200
- "falconPackageHash": "b489940c16a72f772c508a71aa8d6f8b54151fc805cc3aad4e516cdc"
200
+ "falconPackageHash": "fe06943bccda40d9f359f1458ee99bd92b7ef0ee0462cfa55b5ed597"
201
201
  }