@wix/editor-react-components 1.2482.0 → 1.2483.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,3 +1,4 @@
1
+ import { Direction } from '@wix/editor-react-types';
1
2
  import { CorvidTypes } from '../../../types/vendored/editor-elements-types-corvid';
2
3
  import { DefaultCompPlatformProps } from '../../../types/vendored/editor-elements-types-thunderbolt';
3
4
  import { IReadOnlyPropSDK } from '../../../common/sdk/props-factories/readOnlyPropsSDKFactory';
@@ -79,6 +80,10 @@ export type ITextInputMapperProps = {
79
80
  label?: string;
80
81
  placeholder?: string;
81
82
  tooltip?: string;
83
+ description?: string;
84
+ direction?: Direction;
85
+ labelDirection?: Direction;
86
+ inputDirection?: Direction;
82
87
  readOnly: boolean;
83
88
  required: boolean;
84
89
  isDisabled: boolean;
@@ -6,6 +6,7 @@ import { E as EnvironmentDefinition } from "../chunks/index2.js";
6
6
  import { b as getAccessibilityAttributes, H as HAS_CUSTOM_FOCUS_CLASSNAME } from "../chunks/a11y.js";
7
7
  import { a as getDataAttributes } from "../chunks/dataUtils.js";
8
8
  import { u as useValidatedField, R as RequiredIndicator } from "../chunks/RequiredIndicator.js";
9
+ import { d as directionStyles } from "../chunks/direction.module.js";
9
10
  import { s as selectors, T as TestIds, V as VALUE_MISSING_MESSAGE } from "../chunks/constants3.js";
10
11
  import { useService } from "@wix/services-manager-react";
11
12
  import { T as TranslationsDefinition } from "../chunks/index6.js";
@@ -475,6 +476,7 @@ const input = "input__fyTfx";
475
476
  const hideNumberSpinner = "hideNumberSpinner__nYhia";
476
477
  const hasPrefix = "hasPrefix__RXMKp";
477
478
  const validationIndication = "validationIndication__GE20D";
479
+ const helperText = "helperText__SfMAH";
478
480
  const label = "label__mbGIM";
479
481
  const labelRow = "labelRow__tN4T-";
480
482
  const tooltipButton = "tooltipButton__7D4vU";
@@ -490,6 +492,7 @@ const style = {
490
492
  hideNumberSpinner,
491
493
  hasPrefix,
492
494
  validationIndication,
495
+ helperText,
493
496
  label,
494
497
  labelRow,
495
498
  tooltipButton,
@@ -589,6 +592,10 @@ const TextInput = (props, ref) => {
589
592
  label: label2,
590
593
  tooltip: tooltip2,
591
594
  placeholder,
595
+ description,
596
+ direction,
597
+ labelDirection,
598
+ inputDirection,
592
599
  readOnly,
593
600
  required,
594
601
  isDisabled,
@@ -647,6 +654,13 @@ const TextInput = (props, ref) => {
647
654
  setSdkValue(boundValue);
648
655
  }
649
656
  }, [boundValue]);
657
+ const defaultValue = props.defaultValue;
658
+ React.useEffect(() => {
659
+ if (boundValue === void 0 && defaultValue !== void 0) {
660
+ setValue(defaultValue);
661
+ setSdkValue(defaultValue);
662
+ }
663
+ }, [defaultValue]);
650
664
  const isTextInputAutoFillFixExperimentEnabled = isExperimentOpen(
651
665
  "specs.thunderbolt.TextInputAutoFillFix"
652
666
  );
@@ -814,10 +828,16 @@ const TextInput = (props, ref) => {
814
828
  onMouseLeave(event);
815
829
  }
816
830
  };
817
- const containerClasses = clsx(style.root, selectors.root, className, {
818
- [style.hasLabel]: !!label2,
819
- [style.validationIndication]: showErrorIndication
820
- });
831
+ const containerClasses = clsx(
832
+ style.root,
833
+ selectors.root,
834
+ className,
835
+ !direction && directionStyles.fallbackDirection,
836
+ {
837
+ [style.hasLabel]: !!label2,
838
+ [style.validationIndication]: showErrorIndication
839
+ }
840
+ );
821
841
  const getMaxLength = () => {
822
842
  let updatedMaxLength = maxLength === null ? void 0 : maxLength;
823
843
  if (activePhoneFormat) {
@@ -830,11 +850,17 @@ const TextInput = (props, ref) => {
830
850
  ariaAttributes: { "aria-label": ariaLabel, ...restAriaAttributes }
831
851
  } = getAccessibilityAttributes({ ariaAttributes });
832
852
  const hasFocus = () => !!inputRef.current && inputRef.current === document.activeElement;
833
- const inputClasses = clsx(style.input, HAS_CUSTOM_FOCUS_CLASSNAME, {
834
- [style.hideNumberSpinner]: numberSpinnerHidden,
835
- [style.hasPrefix]: !!prefix2
836
- });
837
- const labelClasses = clsx(style.label);
853
+ const descriptionId = description ? `description_${id}` : void 0;
854
+ const inputClasses = clsx(
855
+ style.input,
856
+ selectors.input,
857
+ HAS_CUSTOM_FOCUS_CLASSNAME,
858
+ {
859
+ [style.hideNumberSpinner]: numberSpinnerHidden,
860
+ [style.hasPrefix]: !!prefix2
861
+ }
862
+ );
863
+ const labelClasses = clsx(style.label, selectors.label);
838
864
  const textFieldProps = {
839
865
  value: formattedValue,
840
866
  onChange: getOnChangeFn({
@@ -863,13 +889,20 @@ const TextInput = (props, ref) => {
863
889
  max: max === null ? void 0 : max,
864
890
  className: inputClasses,
865
891
  id: `input_${id}`,
892
+ dir: inputDirection || void 0,
866
893
  onFocus,
867
894
  onKeyDown: onKeyPress,
868
895
  onBlur: _onBlur,
869
896
  "aria-invalid": isInvalid,
870
897
  ...ariaLabel && { "aria-label": ariaLabel },
871
898
  ...!required && { "aria-required": false },
872
- ...restAriaAttributes
899
+ ...restAriaAttributes,
900
+ ...descriptionId || restAriaAttributes["aria-describedby"] ? {
901
+ "aria-describedby": [
902
+ restAriaAttributes["aria-describedby"],
903
+ descriptionId
904
+ ].filter(Boolean).join(" ")
905
+ } : {}
873
906
  };
874
907
  return /* @__PURE__ */ jsx(
875
908
  "div",
@@ -878,6 +911,7 @@ const TextInput = (props, ref) => {
878
911
  ...getDataAttributes(props),
879
912
  ref: contentRef,
880
913
  className: containerClasses,
914
+ dir: direction || void 0,
881
915
  "data-testid": dataTestId,
882
916
  onClick: _onClick,
883
917
  onDoubleClick: _onDblClick,
@@ -886,19 +920,27 @@ const TextInput = (props, ref) => {
886
920
  lang: language,
887
921
  children: /* @__PURE__ */ jsxs($bcdf0525bf22703d$export$2c73285ae9390cec, { ...textFieldProps, children: [
888
922
  (label2 || tooltip2) && /* @__PURE__ */ jsxs("div", { className: style.labelRow, children: [
889
- label2 && /* @__PURE__ */ jsxs($01b77f81d0f07f68$export$b04be29aa201d4f5, { className: labelClasses, htmlFor: `input_${id}`, children: [
890
- label2,
891
- required && /* @__PURE__ */ jsx(
892
- RequiredIndicator,
893
- {
894
- className: clsx(
895
- style.requiredIndicator,
896
- selectors.requiredIndicator
897
- ),
898
- "data-testid": TestIds.requiredIndicator
899
- }
900
- )
901
- ] }),
923
+ label2 && /* @__PURE__ */ jsxs(
924
+ $01b77f81d0f07f68$export$b04be29aa201d4f5,
925
+ {
926
+ className: labelClasses,
927
+ htmlFor: `input_${id}`,
928
+ dir: labelDirection || void 0,
929
+ children: [
930
+ label2,
931
+ required && /* @__PURE__ */ jsx(
932
+ RequiredIndicator,
933
+ {
934
+ className: clsx(
935
+ style.requiredIndicator,
936
+ selectors.requiredIndicator
937
+ ),
938
+ "data-testid": TestIds.requiredIndicator
939
+ }
940
+ )
941
+ ]
942
+ }
943
+ ),
902
944
  tooltip2 && /* @__PURE__ */ jsxs($4e3b923658d69c60$export$8c610744efcf8a1d, { delay: 0, children: [
903
945
  /* @__PURE__ */ jsx(
904
946
  $d2b4bc8c273e7be6$export$353f5b6fc5456de1,
@@ -913,9 +955,25 @@ const TextInput = (props, ref) => {
913
955
  ] })
914
956
  ] }),
915
957
  /* @__PURE__ */ jsxs("div", { className: style.inputWrapper, children: [
916
- prefix2 && /* @__PURE__ */ jsx("div", { className: style.prefix, "data-testid": "prefix", children: prefix2 }),
958
+ prefix2 && /* @__PURE__ */ jsx(
959
+ "div",
960
+ {
961
+ className: clsx(style.prefix, selectors.prefix),
962
+ "data-testid": "prefix",
963
+ children: prefix2
964
+ }
965
+ ),
917
966
  /* @__PURE__ */ jsx($3985021b0ad6602f$export$f5b8910cec6cf069, { ...inputProps })
918
967
  ] }),
968
+ description && /* @__PURE__ */ jsx(
969
+ "p",
970
+ {
971
+ id: descriptionId,
972
+ className: clsx(style.helperText, selectors.helperText),
973
+ "data-testid": "helper-text",
974
+ children: description
975
+ }
976
+ ),
919
977
  /* @__PURE__ */ jsx(
920
978
  InlineErrorMessage,
921
979
  {
@@ -1,5 +1,9 @@
1
1
  export declare const selectors: {
2
2
  readonly root: "textInput";
3
+ readonly label: "textInput__label";
4
+ readonly input: "textInput__input";
5
+ readonly prefix: "textInput__prefix";
6
+ readonly helperText: "textInput__helper";
3
7
  readonly requiredIndicator: "textInput__required-indicator";
4
8
  };
5
9
  export declare const TestIds: {
@@ -14,30 +18,38 @@ export declare const TestIds: {
14
18
  */
15
19
  export declare const VALUE_MISSING_MESSAGE = "This field is required";
16
20
  export declare const DesignStates: {
17
- readonly root: {
21
+ readonly input: {
18
22
  readonly hover: {
19
23
  readonly displayName: "Hover";
20
- readonly className: "textInput--hover";
24
+ readonly className: "textInput__input--hover";
21
25
  };
22
26
  readonly focus: {
23
27
  readonly displayName: "Focus";
24
- readonly className: "textInput--focus";
28
+ readonly className: "textInput__input--focus";
25
29
  };
26
30
  readonly error: {
27
31
  readonly displayName: "Error";
28
- readonly className: "textInput--error";
32
+ readonly className: "textInput__input--error";
29
33
  };
30
34
  readonly disabled: {
31
35
  readonly displayName: "Disabled";
32
- readonly className: "textInput--disabled";
36
+ readonly className: "textInput__input--disabled";
33
37
  };
34
38
  };
35
39
  };
36
40
  export declare const DisplayNames: {
37
41
  root: {
38
42
  elementDisplayName: string;
43
+ elements: {
44
+ label: string;
45
+ input: string;
46
+ prefix: string;
47
+ helperText: string;
48
+ };
39
49
  };
40
50
  cssCustomProperties: {
51
+ helperFont: string;
52
+ helperColor: string;
41
53
  textColor: string;
42
54
  placeholderTextColor: string;
43
55
  requiredTextColor: string;
@@ -47,7 +59,6 @@ export declare const DisplayNames: {
47
59
  labelMarginBottom: string;
48
60
  labelPaddingInlineStart: string;
49
61
  labelPaddingInlineEnd: string;
50
- align: string;
51
62
  labelAlign: string;
52
63
  inputAlign: string;
53
64
  };
@@ -70,6 +81,7 @@ export declare const DisplayNames: {
70
81
  label: string;
71
82
  placeholder: string;
72
83
  tooltip: string;
84
+ description: string;
73
85
  autoComplete: string;
74
86
  readOnly: string;
75
87
  required: string;
@@ -28,7 +28,7 @@
28
28
  --textPaddingInlineStart: 0.75rem;
29
29
  --textPaddingInlineEnd: 0.75rem;
30
30
  --textPaddingTop: 0.5rem;
31
- --inputAlign: inherit;
31
+ --inputAlign: left;
32
32
  --labelBottomMargin: 0.5rem;
33
33
  --labelPaddingInlineStart: 0;
34
34
  --labelPaddingInlineEnd: 0;
@@ -49,7 +49,12 @@
49
49
  normal normal normal 14px/1.6em madefor-text, helveticaneuew01-45ligh,
50
50
  helveticaneuew02-45ligh, helveticaneuew10-45ligh, sans-serif;
51
51
  --labelTextColor: #222222;
52
+ --helperFont:
53
+ normal normal normal 14px/1.4em madefor-text, helveticaneuew01-45ligh,
54
+ helveticaneuew02-45ligh, helveticaneuew10-45ligh, sans-serif;
55
+ --helperColor: #868686;
52
56
  --prefixWidth: 50px;
57
+ --inputHeight: 42px;
53
58
  display: flex;
54
59
  flex-direction: column;
55
60
  text-align: var(--align, start);
@@ -87,7 +92,7 @@
87
92
  flex: 1;
88
93
  text-overflow: ellipsis;
89
94
  text-align: var(--inputAlign, "inherit");
90
- min-height: 100%;
95
+ min-height: var(--inputHeight, 42px);
91
96
  border-radius: var(--borderRadius);
92
97
  background: var(--background);
93
98
  color: var(--textColor);
@@ -132,22 +137,22 @@
132
137
  border-color: var(--focusBorderColor, #a3d9f6);
133
138
  border-width: var(--focusBorderWidth, 1px);
134
139
  }
135
- .root__zQlRz.textInput--hover .input__fyTfx {
140
+ .root__zQlRz .input__fyTfx.textInput__input--hover {
136
141
  background-color: var(--hoverBackground, #ffffff);
137
142
  border-color: var(--hoverBorderColor, #a3d9f6);
138
143
  border-width: var(--hoverBorderWidth, 1px);
139
144
  }
140
- .root__zQlRz.textInput--focus .input__fyTfx {
145
+ .root__zQlRz .input__fyTfx.textInput__input--focus {
141
146
  background-color: var(--focusBackground, #ffffff);
142
147
  border-color: var(--focusBorderColor, #a3d9f6);
143
148
  border-width: var(--focusBorderWidth, 1px);
144
149
  }
145
- .root__zQlRz.textInput--error .input__fyTfx {
150
+ .root__zQlRz .input__fyTfx.textInput__input--error {
146
151
  background-color: var(--errorBackground, #ffffff);
147
152
  border-color: var(--errorBorderColor, #e3e3e3);
148
153
  border-width: var(--errorBorderWidth, 1px);
149
154
  }
150
- .root__zQlRz.textInput--disabled .input__fyTfx {
155
+ .root__zQlRz .input__fyTfx.textInput__input--disabled {
151
156
  background-color: var(--disabledBackground, #f5f5f5);
152
157
  color: var(--disabledTextColor, #999);
153
158
  border-color: var(--disabledBorderColor, #e3e3e3);
@@ -165,6 +170,12 @@
165
170
  border-color: #a3d9f6;
166
171
  border-width: 1px;
167
172
  }
173
+ .root__zQlRz .helperText__SfMAH {
174
+ margin: 0.25rem 0 0;
175
+ font: var(--helperFont);
176
+ color: var(--helperColor);
177
+ text-align: var(--align, start);
178
+ }
168
179
  .root__zQlRz .label__mbGIM {
169
180
  display: none;
170
181
  }
@@ -231,4 +242,7 @@
231
242
  margin-inline-start: 0.2em;
232
243
  vertical-align: super;
233
244
  color: inherit;
245
+ }
246
+ .fallbackDirection__HeRgn:not([dir]) {
247
+ direction: var(--wix-opt-in-direction);
234
248
  }
@@ -1,9 +1,15 @@
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-V7QOLP3D.js";
1
+ import { I as INTERACTIONS, D as DATA, b as DISPLAY_GROUPS, C as CSS_PROPERTIES, E as ELEMENTS, N as NativeStateType, L as LAYOUT, A as Archetype } from "../chunks/chunk-V7QOLP3D.js";
2
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";
6
6
  import { m as manifestValidation } from "../chunks/manifest2.js";
7
+ const designState = (s, pseudoClass) => withSpec({
8
+ spec: IS_SUPPORT_DESIGN_STATE_SPEC,
9
+ displayName: s.displayName,
10
+ className: s.className,
11
+ ...pseudoClass ? { pseudoClass } : {}
12
+ });
7
13
  const manifest = {
8
14
  id: "e95f3cfd-a78d-4d7c-addb-c93182193857",
9
15
  type: "wixEditorElements.TextInput__DEV__v2",
@@ -15,8 +21,7 @@ const manifest = {
15
21
  pixels: 280
16
22
  },
17
23
  height: {
18
- sizingType: LAYOUT.SIZING_TYPE.pixels,
19
- pixels: 42
24
+ sizingType: LAYOUT.SIZING_TYPE.content
20
25
  }
21
26
  }
22
27
  },
@@ -37,35 +42,259 @@ const manifest = {
37
42
  archetype: Archetype.TextInput,
38
43
  layout: {
39
44
  resizeDirection: LAYOUT.RESIZE_DIRECTION.horizontalAndVertical,
40
- contentResizeDirection: LAYOUT.CONTENT_RESIZE_DIRECTION.horizontal,
41
- disableStretching: false,
45
+ contentResizeDirection: LAYOUT.CONTENT_RESIZE_DIRECTION.vertical,
46
+ disableStretching: true,
42
47
  disablePositioning: false
43
48
  },
44
- states: {
45
- hover: withSpec({
46
- spec: IS_SUPPORT_DESIGN_STATE_SPEC,
47
- displayName: DesignStates.root.hover.displayName,
48
- className: DesignStates.root.hover.className,
49
- pseudoClass: NativeStateType.hover
50
- }),
51
- focus: withSpec({
52
- spec: IS_SUPPORT_DESIGN_STATE_SPEC,
53
- displayName: DesignStates.root.focus.displayName,
54
- className: DesignStates.root.focus.className,
55
- pseudoClass: NativeStateType.focus
56
- }),
57
- error: withSpec({
58
- spec: IS_SUPPORT_DESIGN_STATE_SPEC,
59
- displayName: DesignStates.root.error.displayName,
60
- className: DesignStates.root.error.className
61
- }),
62
- disabled: withSpec({
63
- spec: IS_SUPPORT_DESIGN_STATE_SPEC,
64
- displayName: DesignStates.root.disabled.displayName,
65
- className: DesignStates.root.disabled.className,
66
- pseudoClass: NativeStateType.disabled,
67
- props: { isDisabled: true }
68
- })
49
+ elements: {
50
+ label: {
51
+ elementType: ELEMENTS.ELEMENT_TYPE.inlineElement,
52
+ inlineElement: {
53
+ displayName: DisplayNames.root.elements.label,
54
+ selector: getSelector(selectors.label),
55
+ behaviors: { selectable: false },
56
+ displayGroups: {
57
+ labelPaddingGroup: {
58
+ groupType: DISPLAY_GROUPS.GROUP_TYPE.padding,
59
+ padding: {
60
+ left: "labelPaddingInlineStart",
61
+ right: "labelPaddingInlineEnd"
62
+ }
63
+ }
64
+ },
65
+ cssCustomProperties: {
66
+ labelFont: {
67
+ displayName: DisplayNames.cssCustomProperties.labelFont,
68
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.font
69
+ },
70
+ labelTextColor: {
71
+ displayName: DisplayNames.cssCustomProperties.labelTextColor,
72
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.color
73
+ },
74
+ requiredTextColor: {
75
+ displayName: DisplayNames.cssCustomProperties.requiredTextColor,
76
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.color
77
+ },
78
+ labelMarginBottom: {
79
+ displayName: DisplayNames.cssCustomProperties.labelMarginBottom,
80
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.marginBottom
81
+ },
82
+ labelPaddingInlineStart: {
83
+ displayName: DisplayNames.cssCustomProperties.labelPaddingInlineStart,
84
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.paddingInlineStart
85
+ },
86
+ labelPaddingInlineEnd: {
87
+ displayName: DisplayNames.cssCustomProperties.labelPaddingInlineEnd,
88
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.paddingInlineEnd
89
+ },
90
+ labelAlign: {
91
+ displayName: DisplayNames.cssCustomProperties.labelAlign,
92
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.customEnum,
93
+ defaultValue: "start",
94
+ customEnum: {
95
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.string,
96
+ options: [
97
+ {
98
+ value: "start",
99
+ displayName: DisplayNames.options.start,
100
+ appliedStyles: [
101
+ { property: "--labelAlign", value: "start" },
102
+ {
103
+ property: "--labelPadding_start",
104
+ value: "var(--labelPadding)"
105
+ },
106
+ { property: "--labelPadding_end", value: "20" }
107
+ ]
108
+ },
109
+ {
110
+ value: "center",
111
+ displayName: DisplayNames.options.center,
112
+ appliedStyles: [
113
+ { property: "--labelAlign", value: "center" },
114
+ { property: "--labelPadding_start", value: "0" },
115
+ { property: "--labelPadding_end", value: "0" }
116
+ ]
117
+ },
118
+ {
119
+ value: "end",
120
+ displayName: DisplayNames.options.end,
121
+ appliedStyles: [
122
+ { property: "--labelAlign", value: "end" },
123
+ { property: "--labelPadding_start", value: "20" },
124
+ {
125
+ property: "--labelPadding_end",
126
+ value: "var(--labelPadding)"
127
+ }
128
+ ]
129
+ }
130
+ ]
131
+ }
132
+ }
133
+ }
134
+ }
135
+ },
136
+ input: {
137
+ elementType: ELEMENTS.ELEMENT_TYPE.inlineElement,
138
+ inlineElement: {
139
+ displayName: DisplayNames.root.elements.input,
140
+ selector: getSelector(selectors.input),
141
+ behaviors: { selectable: false },
142
+ states: {
143
+ hover: designState(
144
+ DesignStates.input.hover,
145
+ NativeStateType.hover
146
+ ),
147
+ focus: designState(
148
+ DesignStates.input.focus,
149
+ NativeStateType.focus
150
+ ),
151
+ error: designState(DesignStates.input.error),
152
+ disabled: {
153
+ ...designState(
154
+ DesignStates.input.disabled,
155
+ NativeStateType.disabled
156
+ ),
157
+ props: { isDisabled: true }
158
+ }
159
+ },
160
+ displayGroups: {
161
+ textPaddingGroup: {
162
+ groupType: DISPLAY_GROUPS.GROUP_TYPE.padding,
163
+ padding: {
164
+ top: "textPaddingTop",
165
+ bottom: "textPaddingBottom",
166
+ left: "textPaddingInlineStart",
167
+ right: "textPaddingInlineEnd"
168
+ }
169
+ },
170
+ borderGroup: {
171
+ groupType: DISPLAY_GROUPS.GROUP_TYPE.border,
172
+ border: {
173
+ width: "borderWidth",
174
+ color: "borderColor"
175
+ }
176
+ }
177
+ },
178
+ cssCustomProperties: {
179
+ boxShadow: {
180
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.boxShadow
181
+ },
182
+ borderRadius: {
183
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.borderRadius
184
+ },
185
+ font: {
186
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.font
187
+ },
188
+ borderWidth: {
189
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.borderWidth
190
+ },
191
+ borderColor: {
192
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.borderColor
193
+ },
194
+ background: {
195
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.background
196
+ },
197
+ textColor: {
198
+ displayName: DisplayNames.cssCustomProperties.textColor,
199
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.color
200
+ },
201
+ placeholderTextColor: {
202
+ displayName: DisplayNames.cssCustomProperties.placeholderTextColor,
203
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.color
204
+ },
205
+ textPaddingTop: {
206
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.paddingTop
207
+ },
208
+ textPaddingBottom: {
209
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.paddingBottom
210
+ },
211
+ textPaddingInlineStart: {
212
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.paddingInlineStart
213
+ },
214
+ textPaddingInlineEnd: {
215
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.paddingInlineEnd
216
+ },
217
+ inputAlign: {
218
+ displayName: DisplayNames.cssCustomProperties.inputAlign,
219
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.customEnum,
220
+ defaultValue: "start",
221
+ customEnum: {
222
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.string,
223
+ options: [
224
+ {
225
+ value: "start",
226
+ displayName: DisplayNames.options.start,
227
+ appliedStyles: [
228
+ { property: "--inputAlign", value: "left" },
229
+ { property: "--textPadding", value: "3" },
230
+ { property: "--textPadding_start", value: "3" },
231
+ { property: "--textPadding_end", value: "3" }
232
+ ]
233
+ },
234
+ {
235
+ value: "center",
236
+ displayName: DisplayNames.options.center,
237
+ appliedStyles: [
238
+ { property: "--inputAlign", value: "center" },
239
+ { property: "--textPadding", value: "3" },
240
+ {
241
+ property: "--textPadding_start",
242
+ value: "var(--textPadding)"
243
+ },
244
+ { property: "--textPadding_end", value: "3" }
245
+ ]
246
+ },
247
+ {
248
+ value: "end",
249
+ displayName: DisplayNames.options.end,
250
+ appliedStyles: [
251
+ { property: "--inputAlign", value: "right" },
252
+ { property: "--textPadding", value: "3" },
253
+ { property: "--textPadding_start", value: "3" },
254
+ {
255
+ property: "--textPadding_end",
256
+ value: "var(--textPadding)"
257
+ }
258
+ ]
259
+ }
260
+ ]
261
+ }
262
+ }
263
+ }
264
+ }
265
+ },
266
+ prefix: {
267
+ elementType: ELEMENTS.ELEMENT_TYPE.inlineElement,
268
+ inlineElement: {
269
+ displayName: DisplayNames.root.elements.prefix,
270
+ selector: getSelector(selectors.prefix),
271
+ behaviors: { selectable: false },
272
+ cssCustomProperties: {
273
+ prefixFont: {
274
+ displayName: DisplayNames.cssCustomProperties.prefixFont,
275
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.font
276
+ }
277
+ }
278
+ }
279
+ },
280
+ helperText: {
281
+ elementType: ELEMENTS.ELEMENT_TYPE.inlineElement,
282
+ inlineElement: {
283
+ displayName: DisplayNames.root.elements.helperText,
284
+ selector: getSelector(selectors.helperText),
285
+ behaviors: { selectable: false },
286
+ cssCustomProperties: {
287
+ helperFont: {
288
+ displayName: DisplayNames.cssCustomProperties.helperFont,
289
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.font
290
+ },
291
+ helperColor: {
292
+ displayName: DisplayNames.cssCustomProperties.helperColor,
293
+ cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.color
294
+ }
295
+ }
296
+ }
297
+ }
69
298
  },
70
299
  displayGroups: {
71
300
  orderedDataGroup: {
@@ -81,6 +310,7 @@ const manifest = {
81
310
  "label",
82
311
  "placeholder",
83
312
  "tooltip",
313
+ "description",
84
314
  "prefix",
85
315
  "autocompleteToken",
86
316
  "pattern",
@@ -93,277 +323,6 @@ const manifest = {
93
323
  "errorMessageType"
94
324
  ]
95
325
  }
96
- },
97
- textPaddingGroup: {
98
- groupType: DISPLAY_GROUPS.GROUP_TYPE.padding,
99
- padding: {
100
- top: "textPaddingTop",
101
- bottom: "textPaddingBottom",
102
- left: "textPaddingInlineStart",
103
- right: "textPaddingInlineEnd"
104
- }
105
- },
106
- labelPaddingGroup: {
107
- groupType: DISPLAY_GROUPS.GROUP_TYPE.padding,
108
- padding: {
109
- left: "labelPaddingInlineStart",
110
- right: "labelPaddingInlineEnd"
111
- }
112
- },
113
- borderGroup: {
114
- groupType: DISPLAY_GROUPS.GROUP_TYPE.border,
115
- border: {
116
- width: "borderWidth",
117
- color: "borderColor"
118
- }
119
- }
120
- },
121
- cssCustomProperties: {
122
- boxShadow: {
123
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.boxShadow
124
- },
125
- borderRadius: {
126
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.borderRadius
127
- },
128
- font: {
129
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.font
130
- },
131
- borderWidth: {
132
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.borderWidth
133
- },
134
- borderColor: {
135
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.borderColor
136
- },
137
- background: {
138
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.background
139
- },
140
- textColor: {
141
- displayName: DisplayNames.cssCustomProperties.textColor,
142
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.color
143
- },
144
- placeholderTextColor: {
145
- displayName: DisplayNames.cssCustomProperties.placeholderTextColor,
146
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.color
147
- },
148
- requiredTextColor: {
149
- displayName: DisplayNames.cssCustomProperties.requiredTextColor,
150
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.color
151
- },
152
- textPaddingTop: {
153
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.paddingTop
154
- },
155
- textPaddingBottom: {
156
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.paddingBottom
157
- },
158
- textPaddingInlineStart: {
159
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.paddingInlineStart
160
- },
161
- textPaddingInlineEnd: {
162
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.paddingInlineEnd
163
- },
164
- prefixFont: {
165
- displayName: DisplayNames.cssCustomProperties.prefixFont,
166
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.font
167
- },
168
- labelFont: {
169
- displayName: DisplayNames.cssCustomProperties.labelFont,
170
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.font
171
- },
172
- labelTextColor: {
173
- displayName: DisplayNames.cssCustomProperties.labelTextColor,
174
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.color
175
- },
176
- labelMarginBottom: {
177
- displayName: DisplayNames.cssCustomProperties.labelMarginBottom,
178
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.marginBottom
179
- },
180
- labelPaddingInlineStart: {
181
- displayName: DisplayNames.cssCustomProperties.labelPaddingInlineStart,
182
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.paddingInlineStart
183
- },
184
- labelPaddingInlineEnd: {
185
- displayName: DisplayNames.cssCustomProperties.labelPaddingInlineEnd,
186
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.paddingInlineEnd
187
- },
188
- align: {
189
- displayName: DisplayNames.cssCustomProperties.align,
190
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.customEnum,
191
- defaultValue: "left",
192
- customEnum: {
193
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.string,
194
- options: [
195
- {
196
- value: "start",
197
- displayName: DisplayNames.options.start,
198
- appliedStyles: [
199
- {
200
- property: "--align",
201
- value: "start"
202
- }
203
- ]
204
- },
205
- {
206
- value: "center",
207
- displayName: DisplayNames.options.center,
208
- appliedStyles: [
209
- {
210
- property: "--align",
211
- value: "center"
212
- }
213
- ]
214
- },
215
- {
216
- value: "end",
217
- displayName: DisplayNames.options.end,
218
- appliedStyles: [
219
- {
220
- property: "--align",
221
- value: "end"
222
- }
223
- ]
224
- }
225
- ]
226
- }
227
- },
228
- labelAlign: {
229
- displayName: DisplayNames.cssCustomProperties.labelAlign,
230
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.customEnum,
231
- defaultValue: "left",
232
- customEnum: {
233
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.string,
234
- options: [
235
- {
236
- value: "start",
237
- displayName: DisplayNames.options.start,
238
- appliedStyles: [
239
- {
240
- property: "--labelAlign",
241
- value: "start"
242
- },
243
- {
244
- property: "--labelPadding_start",
245
- value: "var(--labelPadding)"
246
- },
247
- {
248
- property: "--labelPadding_end",
249
- value: "20"
250
- }
251
- ]
252
- },
253
- {
254
- value: "center",
255
- displayName: DisplayNames.options.center,
256
- appliedStyles: [
257
- {
258
- property: "--labelAlign",
259
- value: "center"
260
- },
261
- {
262
- property: "--labelPadding_start",
263
- value: "0"
264
- },
265
- {
266
- property: "--labelPadding_end",
267
- value: "0"
268
- }
269
- ]
270
- },
271
- {
272
- value: "end",
273
- displayName: DisplayNames.options.end,
274
- appliedStyles: [
275
- {
276
- property: "--labelAlign",
277
- value: "end"
278
- },
279
- {
280
- property: "--labelPadding_start",
281
- value: "20"
282
- },
283
- {
284
- property: "--labelPadding_end",
285
- value: "var(--labelPadding)"
286
- }
287
- ]
288
- }
289
- ]
290
- }
291
- },
292
- inputAlign: {
293
- displayName: DisplayNames.cssCustomProperties.inputAlign,
294
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.customEnum,
295
- defaultValue: "left",
296
- customEnum: {
297
- cssPropertyType: CSS_PROPERTIES.CSS_PROPERTY_TYPE.string,
298
- options: [
299
- {
300
- value: "start",
301
- displayName: DisplayNames.options.start,
302
- appliedStyles: [
303
- {
304
- property: "--inputAlign",
305
- value: "start"
306
- },
307
- {
308
- property: "--textPadding",
309
- value: "3"
310
- },
311
- {
312
- property: "--textPadding_start",
313
- value: "3"
314
- },
315
- {
316
- property: "--textPadding_end",
317
- value: "3"
318
- }
319
- ]
320
- },
321
- {
322
- value: "center",
323
- displayName: DisplayNames.options.center,
324
- appliedStyles: [
325
- {
326
- property: "--inputAlign",
327
- value: "center"
328
- },
329
- {
330
- property: "--textPadding",
331
- value: "3"
332
- },
333
- {
334
- property: "--textPadding_start",
335
- value: "var(--textPadding)"
336
- },
337
- {
338
- property: "--textPadding_end",
339
- value: "3"
340
- }
341
- ]
342
- },
343
- {
344
- value: "end",
345
- displayName: DisplayNames.options.end,
346
- appliedStyles: [
347
- {
348
- property: "--inputAlign",
349
- value: "end"
350
- },
351
- {
352
- property: "--textPadding",
353
- value: "3"
354
- },
355
- {
356
- property: "--textPadding_start",
357
- value: "3"
358
- },
359
- {
360
- property: "--textPadding_end",
361
- value: "var(--textPadding)"
362
- }
363
- ]
364
- }
365
- ]
366
- }
367
326
  }
368
327
  },
369
328
  data: {
@@ -400,6 +359,7 @@ const manifest = {
400
359
  inputType: {
401
360
  displayName: DisplayNames.data.inputType,
402
361
  dataType: DATA.DATA_TYPE.textEnum,
362
+ defaultValue: "text",
403
363
  [DATA.DATA_TYPE.textEnum]: {
404
364
  options: [
405
365
  { value: "text", displayName: DisplayNames.options.text },
@@ -476,6 +436,14 @@ const manifest = {
476
436
  maxLength: 400
477
437
  }
478
438
  },
439
+ description: {
440
+ displayName: DisplayNames.data.description,
441
+ dataType: DATA.DATA_TYPE.text,
442
+ defaultValue: "",
443
+ [DATA.DATA_TYPE.text]: {
444
+ maxLength: 400
445
+ }
446
+ },
479
447
  // Accessibility
480
448
  a11y: {
481
449
  dataType: DATA.DATA_TYPE.a11y,
@@ -1,5 +1,9 @@
1
1
  const selectors = {
2
2
  root: "textInput",
3
+ label: "textInput__label",
4
+ input: "textInput__input",
5
+ prefix: "textInput__prefix",
6
+ helperText: "textInput__helper",
3
7
  requiredIndicator: "textInput__required-indicator"
4
8
  };
5
9
  const TestIds = {
@@ -8,18 +12,29 @@ const TestIds = {
8
12
  };
9
13
  const VALUE_MISSING_MESSAGE = "This field is required";
10
14
  const DesignStates = {
11
- root: {
12
- hover: { displayName: "Hover", className: "textInput--hover" },
13
- focus: { displayName: "Focus", className: "textInput--focus" },
14
- error: { displayName: "Error", className: "textInput--error" },
15
- disabled: { displayName: "Disabled", className: "textInput--disabled" }
15
+ input: {
16
+ hover: { displayName: "Hover", className: "textInput__input--hover" },
17
+ focus: { displayName: "Focus", className: "textInput__input--focus" },
18
+ error: { displayName: "Error", className: "textInput__input--error" },
19
+ disabled: {
20
+ displayName: "Disabled",
21
+ className: "textInput__input--disabled"
22
+ }
16
23
  }
17
24
  };
18
25
  const DisplayNames = {
19
26
  root: {
20
- elementDisplayName: "TextInput"
27
+ elementDisplayName: "TextInput",
28
+ elements: {
29
+ label: "Label",
30
+ input: "Input",
31
+ prefix: "Prefix",
32
+ helperText: "Helper text"
33
+ }
21
34
  },
22
35
  cssCustomProperties: {
36
+ helperFont: "Helper text font",
37
+ helperColor: "Helper text color",
23
38
  textColor: "Text color",
24
39
  placeholderTextColor: "Placeholder text color",
25
40
  requiredTextColor: "Required text color",
@@ -29,7 +44,6 @@ const DisplayNames = {
29
44
  labelMarginBottom: "Label bottom margin",
30
45
  labelPaddingInlineStart: "Label left padding",
31
46
  labelPaddingInlineEnd: "Label right padding",
32
- align: "Alignment",
33
47
  labelAlign: "Label alignment",
34
48
  inputAlign: "Input alignment"
35
49
  },
@@ -52,6 +66,7 @@ const DisplayNames = {
52
66
  label: "Label text",
53
67
  placeholder: "Placeholder text",
54
68
  tooltip: "Tooltip",
69
+ description: "Helper text",
55
70
  autoComplete: "Autocomplete",
56
71
  readOnly: "Read only",
57
72
  required: "Required",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/editor-react-components",
3
- "version": "1.2482.0",
3
+ "version": "1.2483.0",
4
4
  "description": "React components for the Wix Editor",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -197,5 +197,5 @@
197
197
  "registry": "https://registry.npmjs.org/",
198
198
  "access": "public"
199
199
  },
200
- "falconPackageHash": "b747799e602beb519b1cf73c00ce222b5a928999eb3f20f857f9e21b"
200
+ "falconPackageHash": "6d1cc6d0b86f756faf4c894fa6ceef9f06d5ebe66f24de48cf6ce204"
201
201
  }