@wix/editor-react-components 1.2452.0 → 1.2453.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 (71) hide show
  1. package/dist/site/components/AccordionComponent/AccordionItem.d.ts +1 -1
  2. package/dist/site/components/AccordionComponent/component.js +59 -34
  3. package/dist/site/components/AccordionComponent/manifestConfigs/iconPositionConfig.d.ts +2 -2
  4. package/dist/site/components/AccordionComponent/types.d.ts +9 -3
  5. package/dist/site/components/AudioPlayer/component.js +92 -35
  6. package/dist/site/components/AudioPlayer/manifestConfigs/controlsConfig.d.ts +8 -8
  7. package/dist/site/components/AudioPlayer/manifestConfigs/coverMediaConfig.d.ts +1 -1
  8. package/dist/site/components/AudioPlayer/types.d.ts +26 -0
  9. package/dist/site/components/Breadcrumbs/BreadcrumbItem.d.ts +1 -1
  10. package/dist/site/components/Breadcrumbs/Separator.d.ts +3 -1
  11. package/dist/site/components/Breadcrumbs/component.js +20 -11
  12. package/dist/site/components/Breadcrumbs/types.d.ts +10 -7
  13. package/dist/site/components/Button/Button.types.d.ts +5 -0
  14. package/dist/site/components/Checkbox/Checkbox.types.d.ts +8 -0
  15. package/dist/site/components/Checkbox/component.js +7 -3
  16. package/dist/site/components/CheckboxGroup/CheckboxGroup.types.d.ts +12 -0
  17. package/dist/site/components/CheckboxGroup/component.js +41 -31
  18. package/dist/site/components/CollapsibleText/component.js +7 -5
  19. package/dist/site/components/CollapsibleText/types.d.ts +1 -0
  20. package/dist/site/components/DatePicker/DatePicker.types.d.ts +28 -0
  21. package/dist/site/components/DatePicker/component.js +128 -88
  22. package/dist/site/components/DatePicker/components/DatePickerCalendar.d.ts +3 -1
  23. package/dist/site/components/DatePicker/components/DatePickerField.d.ts +9 -1
  24. package/dist/site/components/DatePicker/components/DatePickerLabel.d.ts +2 -1
  25. package/dist/site/components/Dropdown/Dropdown.types.d.ts +25 -0
  26. package/dist/site/components/Dropdown/component.js +36 -23
  27. package/dist/site/components/Dropdown/components/DropdownChips.d.ts +2 -1
  28. package/dist/site/components/Dropdown/components/DropdownList.d.ts +3 -1
  29. package/dist/site/components/Dropdown/components/DropdownTrigger.d.ts +3 -1
  30. package/dist/site/components/LegacyAppWidget/component.js +3 -2
  31. package/dist/site/components/LegacyAppWidget/components/AppWidget.types.d.ts +4 -2
  32. package/dist/site/components/LegacyContainer/component.d.ts +3 -1
  33. package/dist/site/components/LegacyContainer/component.js +2 -0
  34. package/dist/site/components/LegacyContainer/components/Container.types.d.ts +2 -1
  35. package/dist/site/components/LegacyMultiStateBox/LegacyMultiStateBox.types.d.ts +2 -0
  36. package/dist/site/components/Line/manifestConfigs/shapeConfig.d.ts +2 -2
  37. package/dist/site/components/Line/manifestConfigs/typeConfig.d.ts +2 -2
  38. package/dist/site/components/Lottie/component.js +4 -1
  39. package/dist/site/components/Lottie/types.d.ts +6 -0
  40. package/dist/site/components/Menu/Menu.types.d.ts +33 -3
  41. package/dist/site/components/Menu/component.js +62 -30
  42. package/dist/site/components/Menu/components/MenuContent/MenuItem/MenuItemLabel.d.ts +1 -0
  43. package/dist/site/components/Menu/components/Submenu/types.d.ts +2 -0
  44. package/dist/site/components/Menu/manifestConfigs/dropdownConfig.d.ts +45 -45
  45. package/dist/site/components/ProgressBar/ProgressBar.d.ts +9 -8
  46. package/dist/site/components/ProgressBar/component.js +8 -3
  47. package/dist/site/components/RadioButtons/RadioButtons.types.d.ts +12 -0
  48. package/dist/site/components/RadioButtons/component.js +61 -54
  49. package/dist/site/components/ShareButtons/ShareButtons.types.d.ts +13 -0
  50. package/dist/site/components/ShareButtons/component.js +23 -8
  51. package/dist/site/components/ShareButtons/constants.d.ts +1 -1
  52. package/dist/site/components/Slideshow/SlideIndicators.d.ts +2 -5
  53. package/dist/site/components/Slideshow/Slideshow.d.ts +10 -7
  54. package/dist/site/components/Slideshow/component.js +23 -12
  55. package/dist/site/components/Tabs/Tabs.d.ts +9 -0
  56. package/dist/site/components/Tabs/component.js +23 -10
  57. package/dist/site/components/Tabs/components/ScrollControls/ScrollControls.d.ts +3 -0
  58. package/dist/site/components/TestComp/TestComp.d.ts +3 -0
  59. package/dist/site/components/TestComp/component.js +39 -9
  60. package/dist/site/components/TextBox/TextBox.types.d.ts +12 -0
  61. package/dist/site/components/TextBox/component.js +9 -4
  62. package/dist/site/components/TextEffectsShared/manifestBase.d.ts +15 -15
  63. package/dist/site/components/TimePicker/TimePicker.types.d.ts +16 -0
  64. package/dist/site/components/TimePicker/component.js +59 -33
  65. package/dist/site/components/TimePicker/components/TimePickerField.d.ts +3 -1
  66. package/dist/site/components/TransparentVideo/useTransparentVideo.d.ts +1 -1
  67. package/dist/site/components/chunks/Button.js +7 -4
  68. package/dist/site/components/chunks/ResponsiveBox.js +9 -6
  69. package/dist/site/components/chunks/ResponsiveContainer.js +8 -2
  70. package/dist/site/components/chunks/types.impl.js +0 -18
  71. package/package.json +4 -4
@@ -36,6 +36,7 @@ const styles = {
36
36
  const noop = () => {
37
37
  };
38
38
  function CheckboxComponent(props) {
39
+ var _a, _b;
39
40
  const environmentService = useService(EnvironmentDefinition);
40
41
  const {
41
42
  id,
@@ -56,7 +57,8 @@ function CheckboxComponent(props) {
56
57
  showValidityIndication,
57
58
  onValidate,
58
59
  onValidityChange,
59
- wix
60
+ wix,
61
+ elementProps
60
62
  } = props;
61
63
  const isControlled = props.checked !== void 0;
62
64
  const [uncontrolledChecked, setUncontrolledChecked] = useState(defaultChecked);
@@ -135,7 +137,8 @@ function CheckboxComponent(props) {
135
137
  className: clsx(
136
138
  styles.indicator,
137
139
  selectors.indicator,
138
- formatClassNames(semanticClassNames.indicator)
140
+ formatClassNames(semanticClassNames.indicator),
141
+ (_a = elementProps == null ? void 0 : elementProps.indicator) == null ? void 0 : _a.className
139
142
  ),
140
143
  "data-testid": TestIds.indicator,
141
144
  children: /* @__PURE__ */ jsx(
@@ -158,7 +161,8 @@ function CheckboxComponent(props) {
158
161
  className: clsx(
159
162
  styles.label,
160
163
  selectors.label,
161
- formatClassNames(semanticClassNames.label)
164
+ formatClassNames(semanticClassNames.label),
165
+ (_b = elementProps == null ? void 0 : elementProps.label) == null ? void 0 : _b.className
162
166
  ),
163
167
  "data-testid": TestIds.label,
164
168
  children: [
@@ -3,6 +3,17 @@ import { SdkFunctionFocusableProps } from '../../../utils/functions/sdkFunctionC
3
3
  import { FieldValidationProps } from '../../../utils/validation/types';
4
4
  import { CheckboxGroupOption } from './constants';
5
5
  export type { CheckboxGroupOption } from './constants';
6
+ export type CheckboxGroupElementProps = {
7
+ indicator?: {
8
+ className?: string;
9
+ };
10
+ optionLabel?: {
11
+ className?: string;
12
+ };
13
+ groupLabel?: {
14
+ className?: string;
15
+ };
16
+ };
6
17
  export type CheckboxGroupProps = SdkFunctionFocusableProps & FieldValidationProps<Array<string>> & {
7
18
  id: string;
8
19
  className: string;
@@ -19,6 +30,7 @@ export type CheckboxGroupProps = SdkFunctionFocusableProps & FieldValidationProp
19
30
  disabled?: boolean;
20
31
  direction?: Direction;
21
32
  a11y?: Pick<A11y, 'ariaLabel'>;
33
+ elementProps?: CheckboxGroupElementProps;
22
34
  wix?: {
23
35
  presetsWrapperProps?: Record<string, unknown>;
24
36
  };
@@ -53,6 +53,7 @@ const CheckmarkIcon = () => /* @__PURE__ */ jsx(
53
53
  }
54
54
  );
55
55
  function CheckboxGroupComponent(props) {
56
+ var _a, _b;
56
57
  const environmentService = useService(EnvironmentDefinition);
57
58
  const {
58
59
  id,
@@ -68,6 +69,7 @@ function CheckboxGroupComponent(props) {
68
69
  value,
69
70
  direction,
70
71
  a11y,
72
+ elementProps,
71
73
  onChange = noop,
72
74
  onFocus = noop,
73
75
  onBlur = noop,
@@ -77,6 +79,7 @@ function CheckboxGroupComponent(props) {
77
79
  onValidityChange,
78
80
  wix
79
81
  } = props;
82
+ const optionLabelClassName = (_a = elementProps == null ? void 0 : elementProps.optionLabel) == null ? void 0 : _a.className;
80
83
  const sourceOptions = Array.isArray(props.options) && props.options.length ? props.options : defaultOptions;
81
84
  const options = sourceOptions.filter((option2) => !!option2).map((option2) => ({
82
85
  ...option2,
@@ -139,34 +142,38 @@ function CheckboxGroupComponent(props) {
139
142
  name,
140
143
  parent,
141
144
  optionDisabled
142
- }) => /* @__PURE__ */ jsx(
143
- Checkbox.Root,
144
- {
145
- name,
146
- parent,
147
- readOnly,
148
- disabled: disabled || !!optionDisabled,
149
- className: clsx(
150
- styles.control,
151
- formatClassNames(semanticClassNames.control)
152
- ),
153
- "data-testid": TestIds.control,
154
- children: /* @__PURE__ */ jsx(
155
- Checkbox.Indicator,
156
- {
157
- keepMounted: true,
158
- className: clsx(
159
- styles.indicator,
160
- selectors.indicator,
161
- formatClassNames(semanticClassNames.indicator)
162
- ),
163
- "data-testid": TestIds.indicator,
164
- children: /* @__PURE__ */ jsx(CheckmarkIcon, {})
165
- }
166
- )
167
- },
168
- key
169
- );
145
+ }) => {
146
+ var _a2;
147
+ return /* @__PURE__ */ jsx(
148
+ Checkbox.Root,
149
+ {
150
+ name,
151
+ parent,
152
+ readOnly,
153
+ disabled: disabled || !!optionDisabled,
154
+ className: clsx(
155
+ styles.control,
156
+ formatClassNames(semanticClassNames.control)
157
+ ),
158
+ "data-testid": TestIds.control,
159
+ children: /* @__PURE__ */ jsx(
160
+ Checkbox.Indicator,
161
+ {
162
+ keepMounted: true,
163
+ className: clsx(
164
+ styles.indicator,
165
+ selectors.indicator,
166
+ formatClassNames(semanticClassNames.indicator),
167
+ (_a2 = elementProps == null ? void 0 : elementProps.indicator) == null ? void 0 : _a2.className
168
+ ),
169
+ "data-testid": TestIds.indicator,
170
+ children: /* @__PURE__ */ jsx(CheckmarkIcon, {})
171
+ }
172
+ )
173
+ },
174
+ key
175
+ );
176
+ };
170
177
  return /* @__PURE__ */ jsx("div", { className: presetWrapperStyles.presetWrapper, ...presetsWrapperProps, children: /* @__PURE__ */ jsx(
171
178
  "div",
172
179
  {
@@ -184,7 +191,8 @@ function CheckboxGroupComponent(props) {
184
191
  className: clsx(
185
192
  styles.groupLabel,
186
193
  selectors.groupLabel,
187
- formatClassNames(semanticClassNames.groupLabel)
194
+ formatClassNames(semanticClassNames.groupLabel),
195
+ (_b = elementProps == null ? void 0 : elementProps.groupLabel) == null ? void 0 : _b.className
188
196
  ),
189
197
  "data-testid": TestIds.legend,
190
198
  children: [
@@ -247,7 +255,8 @@ function CheckboxGroupComponent(props) {
247
255
  className: clsx(
248
256
  styles.label,
249
257
  selectors.label,
250
- formatClassNames(semanticClassNames.label)
258
+ formatClassNames(semanticClassNames.label),
259
+ optionLabelClassName
251
260
  ),
252
261
  children: selectAllLabel
253
262
  }
@@ -274,7 +283,8 @@ function CheckboxGroupComponent(props) {
274
283
  className: clsx(
275
284
  styles.label,
276
285
  selectors.label,
277
- formatClassNames(semanticClassNames.label)
286
+ formatClassNames(semanticClassNames.label),
287
+ optionLabelClassName
278
288
  ),
279
289
  "data-testid": TestIds.optionLabel,
280
290
  children: option2.label
@@ -81,15 +81,16 @@ function ExpandControl({
81
81
  }) {
82
82
  const expandControlClassName = clsx(
83
83
  manifestClasses.expandControl,
84
- styles["expand-control"]
84
+ styles["expand-control"],
85
+ buttonProps == null ? void 0 : buttonProps.className
85
86
  );
86
87
  switch (expandMode) {
87
88
  case ExpandModeValues.Expand:
88
89
  return /* @__PURE__ */ jsx(
89
90
  Button,
90
91
  {
91
- className: expandControlClassName,
92
92
  ...buttonProps,
93
+ className: expandControlClassName,
93
94
  label: isExpanded ? readLessText : readMoreText,
94
95
  onClick: onExpandClick
95
96
  }
@@ -98,8 +99,8 @@ function ExpandControl({
98
99
  return /* @__PURE__ */ jsx(
99
100
  Button,
100
101
  {
101
- className: expandControlClassName,
102
102
  ...buttonProps,
103
+ className: expandControlClassName,
103
104
  label: linkText,
104
105
  link
105
106
  }
@@ -129,7 +130,7 @@ function CollapsibleText(props) {
129
130
  onMouseIn = noop,
130
131
  onMouseOut = noop
131
132
  } = props;
132
- const { direction: textDirection } = ((_a = props.elementProps) == null ? void 0 : _a.text) ?? {};
133
+ const { direction: textDirection, className: textClassNameProp } = ((_a = props.elementProps) == null ? void 0 : _a.text) ?? {};
133
134
  const { direction: buttonDirection } = ((_b = props.elementProps) == null ? void 0 : _b.button) ?? {};
134
135
  const textRef = useRef(null);
135
136
  const [isExpandRedundant, setIsExpandRedundant] = useState(false);
@@ -159,7 +160,8 @@ function CollapsibleText(props) {
159
160
  [styles.plain]: textFormat === "plain",
160
161
  [styles.withSafariListsFix]: isSafariWithBrokenLineClamp()
161
162
  },
162
- !textDirection && directionStyles.fallbackDirection
163
+ !textDirection && directionStyles.fallbackDirection,
164
+ textClassNameProp
163
165
  );
164
166
  const onExpandClick = () => {
165
167
  setIsExpanded(!isExpanded);
@@ -25,6 +25,7 @@ export type CollapsibleTextProps = SdkFunctionClickableProps & SdkFunctionMouseH
25
25
  /** Props forwarded to nested elements. `text.direction` sets writing direction on the text wrapper; `button` is the prop bag for the internal Button slot. */
26
26
  elementProps: {
27
27
  text: {
28
+ className?: string;
28
29
  direction: Direction;
29
30
  };
30
31
  button: Partial<ButtonProps> & {
@@ -20,6 +20,32 @@ export type UnavailableDateRange = {
20
20
  from?: string;
21
21
  to?: string;
22
22
  };
23
+ export type DatePickerElementProps = {
24
+ label?: {
25
+ className?: string;
26
+ };
27
+ description?: {
28
+ className?: string;
29
+ };
30
+ dateInput?: {
31
+ className?: string;
32
+ };
33
+ calendarButton?: {
34
+ className?: string;
35
+ };
36
+ popover?: {
37
+ className?: string;
38
+ };
39
+ calendar?: {
40
+ className?: string;
41
+ };
42
+ calendarDay?: {
43
+ className?: string;
44
+ };
45
+ today?: {
46
+ className?: string;
47
+ };
48
+ };
23
49
  export type DatePickerProps = Omit<SdkFunctionChangeableProps, 'onChange'> & SdkFunctionFocusableProps & FieldValidationProps<string> & {
24
50
  /** Fires with the selected ISO date string (range mode: the start date). */
25
51
  onChange?: (value: string) => void;
@@ -93,4 +119,6 @@ export type DatePickerProps = Omit<SdkFunctionChangeableProps, 'onChange'> & Sdk
93
119
  /** Spread on the preset wrapper. */
94
120
  presetsWrapperProps?: Record<string, unknown>;
95
121
  };
122
+ /** Per-element className overrides injected by the platform. */
123
+ elementProps?: DatePickerElementProps;
96
124
  };
@@ -15,7 +15,7 @@ import { T as TranslationsDefinition } from "../chunks/index6.js";
15
15
  import { a as getDataAttributes } from "../chunks/dataUtils.js";
16
16
  import { d as directionStyles } from "../chunks/direction.module.js";
17
17
  import { p as presetWrapperStyles } from "../chunks/presetWrapper.module.js";
18
- import { E as EMPTY_VALUE, T as TestIds, s as selectors, D as DesignStates, A as ARIA_LABEL_NAMESPACE, d as defaultValues, S as SelectionModeValues, G as GranularityValues, V as VALUE_MISSING_MESSAGE, a as AriaLabels } from "../chunks/constants34.js";
18
+ import { E as EMPTY_VALUE, T as TestIds, D as DesignStates, s as selectors, A as ARIA_LABEL_NAMESPACE, d as defaultValues, S as SelectionModeValues, G as GranularityValues, V as VALUE_MISSING_MESSAGE, a as AriaLabels } from "../chunks/constants34.js";
19
19
  import { R as RequiredIndicator, u as useValidatedField } from "../chunks/RequiredIndicator.js";
20
20
  import { I as InfoCircleSmall_default } from "../chunks/InfoCircleSmall.js";
21
21
  import { D as DismissSmall_default } from "../chunks/DismissSmall.js";
@@ -4396,101 +4396,132 @@ const useUnavailableDates = (unavailableDates) => {
4396
4396
  return useMemo(() => buildIsDateUnavailable(unavailableDates), [key]);
4397
4397
  };
4398
4398
  const renderSegments = (segment2) => /* @__PURE__ */ jsx($40825cdb76e74f70$export$336ab7fa954c4b5f, { segment: segment2, className: styles.segment });
4399
- const groupClassName = ({
4400
- isHovered,
4401
- isFocusWithin,
4402
- isDisabled
4403
- }) => clsx(
4404
- styles.group,
4405
- selectors.group,
4406
- isHovered && DesignStates.dateInput.hover.className,
4407
- isFocusWithin && DesignStates.dateInput.focus.className,
4408
- isDisabled && DesignStates.dateInput.disabled.className
4409
- );
4410
- const calendarButtonClassName = ({ isHovered, isPressed }) => clsx(
4411
- styles.calendarButton,
4412
- selectors.calendarButton,
4413
- isHovered && DesignStates.calendarButton.hover.className,
4414
- isPressed && DesignStates.calendarButton.selected.className
4415
- );
4416
4399
  const DatePickerField = ({
4417
4400
  isRange,
4418
4401
  clearButton: clearButton2,
4419
- calendarButtonLabel
4420
- }) => /* @__PURE__ */ jsxs($a049562f99e7db0e$export$eb2fcfdbd7ba97d4, { className: groupClassName, "data-testid": TestIds.group, children: [
4421
- isRange ? /* @__PURE__ */ jsxs(Fragment, { children: [
4422
- /* @__PURE__ */ jsx(
4423
- $40825cdb76e74f70$export$7edc06cf1783b30f,
4424
- {
4425
- slot: "start",
4426
- className: styles.field,
4427
- "data-testid": TestIds.field,
4428
- children: renderSegments
4429
- }
4430
- ),
4431
- /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: styles.rangeSeparator, children: "–" }),
4402
+ calendarButtonLabel,
4403
+ elementProps
4404
+ }) => {
4405
+ const groupClassName = ({
4406
+ isHovered,
4407
+ isFocusWithin,
4408
+ isDisabled
4409
+ }) => {
4410
+ var _a;
4411
+ return clsx(
4412
+ styles.group,
4413
+ selectors.group,
4414
+ isHovered && DesignStates.dateInput.hover.className,
4415
+ isFocusWithin && DesignStates.dateInput.focus.className,
4416
+ isDisabled && DesignStates.dateInput.disabled.className,
4417
+ (_a = elementProps == null ? void 0 : elementProps.dateInput) == null ? void 0 : _a.className
4418
+ );
4419
+ };
4420
+ const calendarButtonClassName = ({ isHovered, isPressed }) => {
4421
+ var _a;
4422
+ return clsx(
4423
+ styles.calendarButton,
4424
+ selectors.calendarButton,
4425
+ isHovered && DesignStates.calendarButton.hover.className,
4426
+ isPressed && DesignStates.calendarButton.selected.className,
4427
+ (_a = elementProps == null ? void 0 : elementProps.calendarButton) == null ? void 0 : _a.className
4428
+ );
4429
+ };
4430
+ return /* @__PURE__ */ jsxs($a049562f99e7db0e$export$eb2fcfdbd7ba97d4, { className: groupClassName, "data-testid": TestIds.group, children: [
4431
+ isRange ? /* @__PURE__ */ jsxs(Fragment, { children: [
4432
+ /* @__PURE__ */ jsx(
4433
+ $40825cdb76e74f70$export$7edc06cf1783b30f,
4434
+ {
4435
+ slot: "start",
4436
+ className: styles.field,
4437
+ "data-testid": TestIds.field,
4438
+ children: renderSegments
4439
+ }
4440
+ ),
4441
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: styles.rangeSeparator, children: "–" }),
4442
+ /* @__PURE__ */ jsx(
4443
+ $40825cdb76e74f70$export$7edc06cf1783b30f,
4444
+ {
4445
+ slot: "end",
4446
+ className: styles.field,
4447
+ "data-testid": TestIds.endField,
4448
+ children: renderSegments
4449
+ }
4450
+ )
4451
+ ] }) : /* @__PURE__ */ jsx($40825cdb76e74f70$export$7edc06cf1783b30f, { className: styles.field, "data-testid": TestIds.field, children: renderSegments }),
4452
+ clearButton2,
4432
4453
  /* @__PURE__ */ jsx(
4433
- $40825cdb76e74f70$export$7edc06cf1783b30f,
4454
+ $d2b4bc8c273e7be6$export$353f5b6fc5456de1,
4434
4455
  {
4435
- slot: "end",
4436
- className: styles.field,
4437
- "data-testid": TestIds.endField,
4438
- children: renderSegments
4456
+ className: calendarButtonClassName,
4457
+ "data-testid": TestIds.calendarButton,
4458
+ "aria-label": calendarButtonLabel,
4459
+ children: /* @__PURE__ */ jsx(Date_default, { "aria-hidden": true, className: styles.calendarIcon })
4439
4460
  }
4440
4461
  )
4441
- ] }) : /* @__PURE__ */ jsx($40825cdb76e74f70$export$7edc06cf1783b30f, { className: styles.field, "data-testid": TestIds.field, children: renderSegments }),
4442
- clearButton2,
4443
- /* @__PURE__ */ jsx(
4444
- $d2b4bc8c273e7be6$export$353f5b6fc5456de1,
4445
- {
4446
- className: calendarButtonClassName,
4447
- "data-testid": TestIds.calendarButton,
4448
- "aria-label": calendarButtonLabel,
4449
- children: /* @__PURE__ */ jsx(Date_default, { "aria-hidden": true, className: styles.calendarIcon })
4450
- }
4451
- )
4452
- ] });
4453
- const dayClassName = ({
4454
- isHovered,
4455
- isSelected,
4456
- isDisabled
4457
- }) => clsx(
4458
- styles.calendarCell,
4459
- selectors.day,
4460
- isHovered && DesignStates.calendarDay.hover.className,
4461
- isSelected && DesignStates.calendarDay.selected.className,
4462
- isDisabled && DesignStates.calendarDay.disabled.className
4463
- );
4464
- const calendarBody = /* @__PURE__ */ jsxs(Fragment, { children: [
4465
- /* @__PURE__ */ jsxs("header", { className: styles.calendarHeader, children: [
4466
- /* @__PURE__ */ jsx($d2b4bc8c273e7be6$export$353f5b6fc5456de1, { slot: "previous", className: styles.navButton, children: /* @__PURE__ */ jsx(ChevronLeft_default, { "aria-hidden": true, className: styles.navIcon }) }),
4467
- /* @__PURE__ */ jsx($5cb03073d3f54797$export$a8a3e93435678ff9, { className: styles.calendarHeading }),
4468
- /* @__PURE__ */ jsx($d2b4bc8c273e7be6$export$353f5b6fc5456de1, { slot: "next", className: styles.navButton, children: /* @__PURE__ */ jsx(ChevronRight_default, { "aria-hidden": true, className: styles.navIcon }) })
4469
- ] }),
4470
- /* @__PURE__ */ jsx($dfd62f934fc76fed$export$5bd780d491cfc46c, { className: styles.calendarGrid, children: (date) => /* @__PURE__ */ jsx($dfd62f934fc76fed$export$5d847498420df57b, { date, className: dayClassName }) })
4471
- ] });
4472
- const DatePickerCalendar = ({ isRange }) => {
4462
+ ] });
4463
+ };
4464
+ const DatePickerCalendar = ({
4465
+ isRange,
4466
+ elementProps
4467
+ }) => {
4468
+ var _a, _b;
4469
+ const calendarClassName = clsx(
4470
+ styles.calendar,
4471
+ selectors.calendar,
4472
+ (_a = elementProps == null ? void 0 : elementProps.calendar) == null ? void 0 : _a.className
4473
+ );
4474
+ const dayClassName = ({ isHovered, isSelected, isDisabled, isToday }) => {
4475
+ var _a2, _b2;
4476
+ return clsx(
4477
+ styles.calendarCell,
4478
+ selectors.day,
4479
+ isHovered && DesignStates.calendarDay.hover.className,
4480
+ isSelected && DesignStates.calendarDay.selected.className,
4481
+ isDisabled && DesignStates.calendarDay.disabled.className,
4482
+ (_a2 = elementProps == null ? void 0 : elementProps.calendarDay) == null ? void 0 : _a2.className,
4483
+ isToday && ((_b2 = elementProps == null ? void 0 : elementProps.today) == null ? void 0 : _b2.className)
4484
+ );
4485
+ };
4486
+ const calendarBody = /* @__PURE__ */ jsxs(Fragment, { children: [
4487
+ /* @__PURE__ */ jsxs("header", { className: styles.calendarHeader, children: [
4488
+ /* @__PURE__ */ jsx($d2b4bc8c273e7be6$export$353f5b6fc5456de1, { slot: "previous", className: styles.navButton, children: /* @__PURE__ */ jsx(ChevronLeft_default, { "aria-hidden": true, className: styles.navIcon }) }),
4489
+ /* @__PURE__ */ jsx($5cb03073d3f54797$export$a8a3e93435678ff9, { className: styles.calendarHeading }),
4490
+ /* @__PURE__ */ jsx($d2b4bc8c273e7be6$export$353f5b6fc5456de1, { slot: "next", className: styles.navButton, children: /* @__PURE__ */ jsx(ChevronRight_default, { "aria-hidden": true, className: styles.navIcon }) })
4491
+ ] }),
4492
+ /* @__PURE__ */ jsx($dfd62f934fc76fed$export$5bd780d491cfc46c, { className: styles.calendarGrid, children: (date) => /* @__PURE__ */ jsx($dfd62f934fc76fed$export$5d847498420df57b, { date, className: dayClassName }) })
4493
+ ] });
4473
4494
  return (
4474
4495
  // Portals to <body> (react-aria default) so the calendar escapes the page
4475
4496
  // section's stacking context — otherwise the section below paints over the
4476
4497
  // part of the popover that overflows past it. The theme CSS vars are applied
4477
4498
  // to `.popover` directly (see defaults.css) since it no longer inherits them
4478
4499
  // from the root; `dir`/locale still flow through the React portal.
4479
- /* @__PURE__ */ jsx($07b14b47974efb58$export$5b6b19405a83ff9d, { className: clsx(styles.popover, selectors.popover), children: /* @__PURE__ */ jsx($de32f1b87079253c$export$3ddf2d174ce01153, { className: styles.dialog, children: isRange ? /* @__PURE__ */ jsx(
4480
- $dfd62f934fc76fed$export$a4f5c8b89d277a8d,
4481
- {
4482
- className: clsx(styles.calendar, selectors.calendar),
4483
- "data-testid": TestIds.calendar,
4484
- children: calendarBody
4485
- }
4486
- ) : /* @__PURE__ */ jsx(
4487
- $dfd62f934fc76fed$export$e1aef45b828286de,
4500
+ /* @__PURE__ */ jsx(
4501
+ $07b14b47974efb58$export$5b6b19405a83ff9d,
4488
4502
  {
4489
- className: clsx(styles.calendar, selectors.calendar),
4490
- "data-testid": TestIds.calendar,
4491
- children: calendarBody
4503
+ className: clsx(
4504
+ styles.popover,
4505
+ selectors.popover,
4506
+ (_b = elementProps == null ? void 0 : elementProps.popover) == null ? void 0 : _b.className
4507
+ ),
4508
+ children: /* @__PURE__ */ jsx($de32f1b87079253c$export$3ddf2d174ce01153, { className: styles.dialog, children: isRange ? /* @__PURE__ */ jsx(
4509
+ $dfd62f934fc76fed$export$a4f5c8b89d277a8d,
4510
+ {
4511
+ className: calendarClassName,
4512
+ "data-testid": TestIds.calendar,
4513
+ children: calendarBody
4514
+ }
4515
+ ) : /* @__PURE__ */ jsx(
4516
+ $dfd62f934fc76fed$export$e1aef45b828286de,
4517
+ {
4518
+ className: calendarClassName,
4519
+ "data-testid": TestIds.calendar,
4520
+ children: calendarBody
4521
+ }
4522
+ ) })
4492
4523
  }
4493
- ) }) })
4524
+ )
4494
4525
  );
4495
4526
  };
4496
4527
  const DatePickerTooltip = ({
@@ -4520,13 +4551,14 @@ const DatePickerLabel = ({
4520
4551
  label: label2,
4521
4552
  tooltip: tooltip2,
4522
4553
  required,
4523
- portalContainer
4554
+ portalContainer,
4555
+ className
4524
4556
  }) => {
4525
4557
  if (!label2 && !tooltip2) {
4526
4558
  return null;
4527
4559
  }
4528
4560
  return /* @__PURE__ */ jsxs("div", { className: styles.labelRow, children: [
4529
- label2 ? /* @__PURE__ */ jsxs($01b77f81d0f07f68$export$b04be29aa201d4f5, { className: clsx(styles.label, selectors.label), children: [
4561
+ label2 ? /* @__PURE__ */ jsxs($01b77f81d0f07f68$export$b04be29aa201d4f5, { className: clsx(styles.label, selectors.label, className), children: [
4530
4562
  label2,
4531
4563
  required && /* @__PURE__ */ jsx(
4532
4564
  RequiredIndicator,
@@ -4542,6 +4574,7 @@ const DatePickerLabel = ({
4542
4574
  const noop = () => {
4543
4575
  };
4544
4576
  function DatePicker2(props) {
4577
+ var _a, _b;
4545
4578
  const environmentService = useService(EnvironmentDefinition);
4546
4579
  const { translate } = useService(TranslationsDefinition);
4547
4580
  const translateAria = translate(ARIA_LABEL_NAMESPACE);
@@ -4569,7 +4602,8 @@ function DatePicker2(props) {
4569
4602
  showValidityIndication,
4570
4603
  onValidate,
4571
4604
  onValidityChange,
4572
- wix
4605
+ wix,
4606
+ elementProps
4573
4607
  } = props;
4574
4608
  const label2 = readString(props.label);
4575
4609
  const description2 = readString(props.description);
@@ -4648,7 +4682,8 @@ function DatePicker2(props) {
4648
4682
  label: label2,
4649
4683
  tooltip: tooltip2,
4650
4684
  required: isRequired,
4651
- portalContainer
4685
+ portalContainer,
4686
+ className: (_a = elementProps == null ? void 0 : elementProps.label) == null ? void 0 : _a.className
4652
4687
  }
4653
4688
  ),
4654
4689
  /* @__PURE__ */ jsx(
@@ -4656,14 +4691,19 @@ function DatePicker2(props) {
4656
4691
  {
4657
4692
  isRange,
4658
4693
  clearButton: clearButton2,
4659
- calendarButtonLabel: t(AriaLabels.openCalendar)
4694
+ calendarButtonLabel: t(AriaLabels.openCalendar),
4695
+ elementProps
4660
4696
  }
4661
4697
  ),
4662
4698
  description2 ? /* @__PURE__ */ jsx(
4663
4699
  $514c0188e459b4c0$export$5f1af8db9871e1d6,
4664
4700
  {
4665
4701
  slot: "description",
4666
- className: clsx(styles.description, selectors.description),
4702
+ className: clsx(
4703
+ styles.description,
4704
+ selectors.description,
4705
+ (_b = elementProps == null ? void 0 : elementProps.description) == null ? void 0 : _b.className
4706
+ ),
4667
4707
  children: description2
4668
4708
  }
4669
4709
  ) : null,
@@ -4675,7 +4715,7 @@ function DatePicker2(props) {
4675
4715
  children: validity.validationMessage
4676
4716
  }
4677
4717
  ) : null,
4678
- /* @__PURE__ */ jsx(DatePickerCalendar, { isRange })
4718
+ /* @__PURE__ */ jsx(DatePickerCalendar, { isRange, elementProps })
4679
4719
  ] });
4680
4720
  const sharedProps = {
4681
4721
  granularity,
@@ -1,4 +1,6 @@
1
1
  import { default as React } from 'react';
2
- export declare const DatePickerCalendar: ({ isRange }: {
2
+ import { DatePickerElementProps } from '../DatePicker.types';
3
+ export declare const DatePickerCalendar: ({ isRange, elementProps, }: {
3
4
  isRange: boolean;
5
+ elementProps?: DatePickerElementProps;
4
6
  }) => React.JSX.Element;
@@ -1,6 +1,14 @@
1
1
  import { default as React } from 'react';
2
- export declare const DatePickerField: ({ isRange, clearButton, calendarButtonLabel, }: {
2
+ export declare const DatePickerField: ({ isRange, clearButton, calendarButtonLabel, elementProps, }: {
3
3
  isRange: boolean;
4
4
  clearButton: React.ReactNode;
5
5
  calendarButtonLabel: string;
6
+ elementProps?: {
7
+ dateInput?: {
8
+ className?: string;
9
+ };
10
+ calendarButton?: {
11
+ className?: string;
12
+ };
13
+ };
6
14
  }) => React.JSX.Element;
@@ -1,7 +1,8 @@
1
1
  import { default as React } from 'react';
2
- export declare const DatePickerLabel: ({ label, tooltip, required, portalContainer, }: {
2
+ export declare const DatePickerLabel: ({ label, tooltip, required, portalContainer, className, }: {
3
3
  label: string;
4
4
  tooltip: string;
5
5
  required: boolean;
6
6
  portalContainer: HTMLElement | null;
7
+ className?: string;
7
8
  }) => React.JSX.Element | null;
@@ -17,6 +17,29 @@ export type DropdownValueItem = {
17
17
  export type DropdownValue = string | Array<string>;
18
18
  /** Match rule for searchable mode; defaults to case-insensitive "contains". */
19
19
  export type DropdownFilter = (item: DropdownOption, query: string) => boolean;
20
+ export type DropdownElementProps = {
21
+ label?: {
22
+ className?: string;
23
+ };
24
+ input?: {
25
+ className?: string;
26
+ };
27
+ trigger?: {
28
+ className?: string;
29
+ };
30
+ clearButton?: {
31
+ className?: string;
32
+ };
33
+ list?: {
34
+ className?: string;
35
+ };
36
+ option?: {
37
+ className?: string;
38
+ };
39
+ chip?: {
40
+ className?: string;
41
+ };
42
+ };
20
43
  export type DropdownProps = Omit<SdkFunctionChangeableProps, 'onChange'> & SdkFunctionFocusableProps & Omit<SdkFunctionInputableProps, 'onInput'> & FieldValidationProps<DropdownValue> & {
21
44
  /** DOM `id` on the root `.dropdown` wrapper. */
22
45
  id: string;
@@ -103,6 +126,8 @@ export type DropdownProps = Omit<SdkFunctionChangeableProps, 'onChange'> & SdkFu
103
126
  direction?: Direction;
104
127
  /** Accessibility attributes. `ariaLabel` labels the dropdown for assistive tech. */
105
128
  a11y?: A11y;
129
+ /** Per-element className overrides. Keys match the manifest element keys. */
130
+ elementProps?: DropdownElementProps;
106
131
  /** Platform-provided props. */
107
132
  wix?: {
108
133
  /** Spread on the preset wrapper. */