@wix/editor-react-components 1.2253.0 → 1.2255.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 (40) hide show
  1. package/dist/site/components/AccordionComponent/component.js +4 -81
  2. package/dist/site/components/AccordionComponent/manifest.js +1 -1
  3. package/dist/site/components/AudioPlayer/component.js +1 -1
  4. package/dist/site/components/AudioPlayer/manifest.js +1 -1
  5. package/dist/site/components/Breadcrumbs/component.js +1 -1
  6. package/dist/site/components/Breadcrumbs/manifest.js +1 -1
  7. package/dist/site/components/CollapsibleText/component.js +1 -1
  8. package/dist/site/components/CollapsibleText/manifest.js +1 -1
  9. package/dist/site/components/Dropdown/Dropdown.d.ts +3 -0
  10. package/dist/site/components/Dropdown/Dropdown.types.d.ts +91 -0
  11. package/dist/site/components/Dropdown/component.d.ts +2 -0
  12. package/dist/site/components/Dropdown/component.js +31100 -0
  13. package/dist/site/components/Dropdown/component.preview.d.ts +4 -0
  14. package/dist/site/components/Dropdown/components/DropdownChips.d.ts +7 -0
  15. package/dist/site/components/Dropdown/components/DropdownList.d.ts +17 -0
  16. package/dist/site/components/Dropdown/components/DropdownTrigger.d.ts +18 -0
  17. package/dist/site/components/Dropdown/constants.d.ts +140 -0
  18. package/dist/site/components/Dropdown/css.css +255 -0
  19. package/dist/site/components/Dropdown/dropdownUtils.d.ts +24 -0
  20. package/dist/site/components/Dropdown/hooks/useChipOverflow.d.ts +9 -0
  21. package/dist/site/components/Dropdown/hooks/useDropdownQuery.d.ts +15 -0
  22. package/dist/site/components/Dropdown/hooks/useDropdownSelection.d.ts +16 -0
  23. package/dist/site/components/Dropdown/index.d.ts +2 -0
  24. package/dist/site/components/Dropdown/index.js +6 -0
  25. package/dist/site/components/Dropdown/manifest.d.ts +5 -0
  26. package/dist/site/components/Dropdown/manifest.js +418 -0
  27. package/dist/site/components/Line/manifest.js +3 -39
  28. package/dist/site/components/chunks/_baseSlice.js +43 -0
  29. package/dist/site/components/chunks/constants29.js +114 -46
  30. package/dist/site/components/chunks/constants30.js +53 -71
  31. package/dist/site/components/chunks/constants31.js +73 -77
  32. package/dist/site/components/chunks/constants32.js +76 -57
  33. package/dist/site/components/chunks/constants33.js +72 -0
  34. package/dist/site/components/chunks/isArray.js +12 -0
  35. package/dist/site/components/chunks/isArrayLike.js +88 -0
  36. package/dist/site/components/chunks/isObjectLike.js +5 -15
  37. package/dist/site/components/chunks/manifestSdkMixins.js +13 -0
  38. package/dist/site/components/chunks/useConsentPolicyProps.js +5 -5
  39. package/dist/site/components/extensions.js +51 -46
  40. package/package.json +4 -3
@@ -0,0 +1,4 @@
1
+ import { ResolveManifestOverrides } from '../../../utils/ResolveManifestOverrides';
2
+ import { default as Dropdown } from './Dropdown';
3
+ export default Dropdown;
4
+ export declare const resolveManifestOverrides: ResolveManifestOverrides;
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ import { DropdownItem } from '../dropdownUtils';
3
+ export declare const DropdownChips: ({ items, inputControl, removeItemLabel, }: {
4
+ items: Array<DropdownItem>;
5
+ inputControl: React.ReactNode;
6
+ removeItemLabel: string;
7
+ }) => React.ReactElement;
@@ -0,0 +1,17 @@
1
+ import { default as React } from 'react';
2
+ import { DropdownItem } from '../dropdownUtils';
3
+ type DropdownListProps = {
4
+ optionItems: Array<DropdownItem>;
5
+ filterItem: (item: DropdownItem, typed: string) => boolean;
6
+ inputValue: string;
7
+ limit: number;
8
+ isGrid: boolean;
9
+ columns: number;
10
+ inline: boolean;
11
+ isMultiple: boolean;
12
+ hasInput: boolean;
13
+ hasQuery: boolean;
14
+ popoverContainer: HTMLDivElement | null;
15
+ };
16
+ export declare const DropdownList: ({ optionItems, filterItem, inputValue, limit, isGrid, columns, inline, isMultiple, hasInput, hasQuery, popoverContainer, }: DropdownListProps) => React.ReactElement;
17
+ export {};
@@ -0,0 +1,18 @@
1
+ import { default as React } from 'react';
2
+ import { DropdownItem } from '../dropdownUtils';
3
+ type DropdownTriggerProps = {
4
+ isMultiple: boolean;
5
+ isSearchable: boolean;
6
+ clearable: boolean;
7
+ selectedLabel: string;
8
+ selectedItems: Array<DropdownItem>;
9
+ placeholder: string;
10
+ ariaLabel: string;
11
+ clearLabel: string;
12
+ removeItemLabel: string;
13
+ descriptionId: string | undefined;
14
+ onFocus: (event: React.FocusEvent) => void;
15
+ onBlur: (event: React.FocusEvent) => void;
16
+ };
17
+ export declare const DropdownTrigger: ({ isMultiple, isSearchable, clearable, selectedLabel, selectedItems, placeholder, ariaLabel, clearLabel, removeItemLabel, descriptionId, onFocus, onBlur, }: DropdownTriggerProps) => React.ReactElement;
18
+ export {};
@@ -0,0 +1,140 @@
1
+ export declare const DesignStates: {
2
+ readonly root: {
3
+ readonly hover: {
4
+ readonly displayName: "Hover";
5
+ readonly className: "dropdown--hover";
6
+ };
7
+ readonly disabled: {
8
+ readonly displayName: "Disabled";
9
+ readonly className: "dropdown--disabled";
10
+ };
11
+ };
12
+ };
13
+ export declare const DisplayNames: {
14
+ root: {
15
+ elementDisplayName: string;
16
+ data: {
17
+ options: string;
18
+ optionLabel: string;
19
+ optionValue: string;
20
+ value: string;
21
+ values: string;
22
+ inputValue: string;
23
+ open: string;
24
+ isDisabled: string;
25
+ placeholder: string;
26
+ searchable: string;
27
+ multiple: string;
28
+ clearable: string;
29
+ autoHighlight: string;
30
+ openOnInputClick: string;
31
+ inline: string;
32
+ grid: string;
33
+ columns: string;
34
+ limit: string;
35
+ label: string;
36
+ required: string;
37
+ readOnly: string;
38
+ description: string;
39
+ triggerMode: {
40
+ displayName: string;
41
+ options: {
42
+ onSelection: string;
43
+ onApply: string;
44
+ };
45
+ };
46
+ applyButtonLabel: string;
47
+ };
48
+ cssCustomProperties: {
49
+ width: string;
50
+ maxWidth: string;
51
+ backgroundColor: string;
52
+ borderColor: string;
53
+ borderWidth: string;
54
+ paddingTop: string;
55
+ paddingBottom: string;
56
+ paddingInlineStart: string;
57
+ paddingInlineEnd: string;
58
+ gap: string;
59
+ textAlign: string;
60
+ font: string;
61
+ textColor: string;
62
+ labelFont: string;
63
+ labelColor: string;
64
+ helperFont: string;
65
+ helperColor: string;
66
+ optionTextColor: string;
67
+ optionHoverBackgroundColor: string;
68
+ };
69
+ displayGroups: {
70
+ optionsGroup: string;
71
+ sizeGroup: string;
72
+ backgroundGroup: string;
73
+ cornersGroup: string;
74
+ paddingGroup: string;
75
+ };
76
+ };
77
+ };
78
+ export declare const defaultValues: {
79
+ readonly placeholder: "Select a value";
80
+ readonly inputValue: "";
81
+ readonly open: false;
82
+ readonly isDisabled: false;
83
+ readonly searchable: false;
84
+ readonly multiple: false;
85
+ readonly clearable: false;
86
+ readonly autoHighlight: false;
87
+ readonly openOnInputClick: true;
88
+ readonly inline: false;
89
+ readonly grid: false;
90
+ readonly columns: 3;
91
+ readonly limit: -1;
92
+ readonly label: "";
93
+ readonly required: false;
94
+ readonly readOnly: false;
95
+ readonly name: "";
96
+ readonly description: "";
97
+ readonly triggerMode: "onSelection";
98
+ readonly applyButtonLabel: "Apply";
99
+ readonly noResultsText: "No results";
100
+ };
101
+ export declare const enum TriggerModeValues {
102
+ OnSelection = "onSelection",
103
+ OnApply = "onApply"
104
+ }
105
+ /** The value that represents the cleared / empty state. */
106
+ export declare const ALL_VALUE = "";
107
+ export declare const TestIds: {
108
+ readonly root: "dropdown-root";
109
+ readonly label: "dropdown-label";
110
+ readonly trigger: "dropdown-trigger";
111
+ readonly listbox: "dropdown-listbox";
112
+ readonly clear: "dropdown-clear";
113
+ readonly applyButton: "dropdown-apply-button";
114
+ readonly description: "dropdown-description";
115
+ };
116
+ export declare const selectors: {
117
+ readonly root: "dropdown";
118
+ };
119
+ export declare const semanticClassNames: {
120
+ readonly root: "dropdown";
121
+ readonly trigger: "dropdown__trigger";
122
+ readonly listbox: "dropdown__listbox";
123
+ readonly option: "dropdown__option";
124
+ readonly applyButton: "dropdown__apply-button";
125
+ };
126
+ export declare const ARIA_LABEL_NAMESPACE = "ariaLabels";
127
+ export declare const AriaLabels: {
128
+ readonly root: {
129
+ readonly key: "Dropdown_AriaLabel";
130
+ readonly default: "Dropdown";
131
+ };
132
+ readonly clear: {
133
+ readonly key: "Dropdown_AriaLabel_Clear";
134
+ readonly default: "Clear";
135
+ };
136
+ readonly removeItem: {
137
+ readonly key: "Dropdown_AriaLabel_RemoveItem";
138
+ readonly default: "Remove";
139
+ };
140
+ };
@@ -0,0 +1,255 @@
1
+ .root__WnTks {
2
+ box-sizing: border-box;
3
+ display: inline-flex;
4
+ align-items: center;
5
+ gap: var(--gap);
6
+ min-width: var(--minWidth, 240px);
7
+ max-width: var(--maxWidth, 100%);
8
+ }
9
+ .root__WnTks .trigger__J7jn7 {
10
+ box-sizing: border-box;
11
+ display: flex;
12
+ align-items: center;
13
+ gap: 4px;
14
+ width: 100%;
15
+ appearance: none;
16
+ cursor: pointer;
17
+ text-align: inherit;
18
+ height: auto;
19
+ min-height: var(--wst-select-height, 42px);
20
+ background-color: var(--backgroundColor, var(--wst-primary-background-color, #fff));
21
+ border-style: solid;
22
+ border-width: var(--borderWidth);
23
+ border-color: var(--borderColor, color-mix(in srgb, var(--wst-paragraph-2-color, #000) 60%, transparent));
24
+ border-start-start-radius: var(--borderStartStartRadius);
25
+ border-start-end-radius: var(--borderStartEndRadius);
26
+ border-end-start-radius: var(--borderEndStartRadius);
27
+ border-end-end-radius: var(--borderEndEndRadius);
28
+ padding-top: var(--paddingTop);
29
+ padding-bottom: var(--paddingBottom);
30
+ padding-inline-start: var(--paddingInlineStart);
31
+ padding-inline-end: var(--paddingInlineEnd);
32
+ color: var(--textColor, var(--wst-paragraph-2-color, #000));
33
+ font: var(--font, var(--wst-paragraph-2-font));
34
+ }
35
+ .root__WnTks .trigger__J7jn7:focus-within {
36
+ border-color: var(--borderColor, var(--wst-system-line-1-color, #000));
37
+ }
38
+ .root__WnTks .option__QJeiF {
39
+ display: flex;
40
+ align-items: center;
41
+ gap: 8px;
42
+ padding-block: 10px;
43
+ padding-inline: 12px;
44
+ cursor: pointer;
45
+ color: var(--optionTextColor, var(--wst-paragraph-2-color, #000));
46
+ font: var(--font, var(--wst-paragraph-2-font));
47
+ }
48
+ .root__WnTks .option__QJeiF[data-highlighted] {
49
+ background-color: var(--optionHoverBackgroundColor, color-mix(in srgb, var(--wst-paragraph-2-color, #000) 6%, transparent));
50
+ }
51
+ .root__WnTks .option__QJeiF[data-selected] {
52
+ background-color: color-mix(in srgb, var(--wst-paragraph-2-color, #000) 12%, transparent);
53
+ }
54
+
55
+ .multiple__ay77b {
56
+ width: var(--width, var(--minWidth, 240px));
57
+ }
58
+
59
+ .select__Lo-N7 {
60
+ flex: 1;
61
+ min-width: 0;
62
+ display: flex;
63
+ flex-direction: column;
64
+ gap: 4px;
65
+ }
66
+
67
+ .label__Q7fZH {
68
+ font: var(--labelFont, var(--wst-paragraph-2-font));
69
+ color: var(--labelColor, var(--wst-paragraph-2-color, #000));
70
+ }
71
+
72
+ .description__77blZ {
73
+ margin: 0;
74
+ font: var(--helperFont, var(--wst-paragraph-3-font));
75
+ color: var(--helperColor, color-mix(in srgb, var(--wst-paragraph-2-color, #000) 65%, transparent));
76
+ }
77
+
78
+ .clear__isa6G {
79
+ flex: none;
80
+ display: inline-flex;
81
+ align-items: center;
82
+ justify-content: center;
83
+ padding: 0 4px;
84
+ border: none;
85
+ background: none;
86
+ color: inherit;
87
+ font: inherit;
88
+ line-height: 1;
89
+ cursor: pointer;
90
+ }
91
+
92
+ .chips__LvQLW {
93
+ display: flex;
94
+ flex-wrap: nowrap;
95
+ align-items: center;
96
+ gap: 4px;
97
+ flex: 1;
98
+ min-width: 0;
99
+ overflow-x: auto;
100
+ }
101
+
102
+ .chipsOverflow__mUTan {
103
+ flex: none;
104
+ padding-inline: 4px;
105
+ font: var(--font, var(--wst-paragraph-2-font));
106
+ line-height: 1.4;
107
+ white-space: nowrap;
108
+ color: color-mix(in srgb, var(--wst-paragraph-2-color, #000) 65%, transparent);
109
+ }
110
+
111
+ .chip__Fr--t {
112
+ flex: none;
113
+ display: inline-flex;
114
+ align-items: center;
115
+ gap: 4px;
116
+ padding: 2px 6px;
117
+ border-start-start-radius: var(--borderStartStartRadius);
118
+ border-start-end-radius: var(--borderStartEndRadius);
119
+ border-end-start-radius: var(--borderEndStartRadius);
120
+ border-end-end-radius: var(--borderEndEndRadius);
121
+ background-color: color-mix(in srgb, var(--wst-paragraph-2-color, #000) 8%, transparent);
122
+ font: var(--font, var(--wst-paragraph-2-font));
123
+ line-height: 1.4;
124
+ }
125
+
126
+ .chipLabel__gL-DJ {
127
+ min-width: 0;
128
+ overflow: hidden;
129
+ text-overflow: ellipsis;
130
+ white-space: nowrap;
131
+ }
132
+
133
+ .chipShrink__kDlpE {
134
+ flex: 0 1 auto;
135
+ min-width: 0;
136
+ }
137
+
138
+ .chipRemove__sBxpf {
139
+ display: inline-flex;
140
+ align-items: center;
141
+ justify-content: center;
142
+ padding: 0;
143
+ border: none;
144
+ background: none;
145
+ color: inherit;
146
+ font: inherit;
147
+ line-height: 1;
148
+ cursor: pointer;
149
+ }
150
+
151
+ .itemIndicator__-IS1X {
152
+ margin-inline-start: auto;
153
+ padding-inline-start: 8px;
154
+ }
155
+
156
+ .empty__dKQbw {
157
+ display: block;
158
+ padding: 12px;
159
+ text-align: center;
160
+ font: var(--font, var(--wst-paragraph-2-font));
161
+ color: var(--wst-shade-3-color, #767676);
162
+ }
163
+ .empty__dKQbw:empty {
164
+ padding: 0;
165
+ }
166
+
167
+ .positioner__YS--m {
168
+ width: var(--anchor-width);
169
+ z-index: 100;
170
+ }
171
+
172
+ .popup__GQi1e {
173
+ box-sizing: border-box;
174
+ overflow: hidden;
175
+ background-color: var(--backgroundColor, var(--wst-primary-background-color, #fff));
176
+ border: var(--borderWidth, 1px) solid var(--borderColor, color-mix(in srgb, var(--wst-paragraph-2-color, #000) 60%, transparent));
177
+ border-start-start-radius: var(--borderStartStartRadius);
178
+ border-start-end-radius: var(--borderStartEndRadius);
179
+ border-end-start-radius: var(--borderEndStartRadius);
180
+ border-end-end-radius: var(--borderEndEndRadius);
181
+ box-shadow: 0 4px 12px color-mix(in srgb, var(--wst-paragraph-2-color, #000) 12%, transparent);
182
+ }
183
+
184
+ .list__DruZL {
185
+ display: flex;
186
+ flex-direction: column;
187
+ max-height: 300px;
188
+ overflow-y: auto;
189
+ padding-block: 4px;
190
+ }
191
+ .list__DruZL:empty {
192
+ padding-block: 0;
193
+ }
194
+
195
+ .gridRow__9DEae {
196
+ display: grid;
197
+ grid-template-columns: repeat(var(--columns, 3), minmax(0, 1fr));
198
+ gap: 4px;
199
+ }
200
+
201
+ .inlineList__eJvV9 {
202
+ margin-top: 4px;
203
+ max-height: 240px;
204
+ overflow-y: auto;
205
+ border: var(--borderWidth) solid var(--borderColor, color-mix(in srgb, var(--wst-paragraph-2-color, #000) 60%, transparent));
206
+ border-start-start-radius: var(--borderStartStartRadius);
207
+ border-start-end-radius: var(--borderStartEndRadius);
208
+ border-end-start-radius: var(--borderEndStartRadius);
209
+ border-end-end-radius: var(--borderEndEndRadius);
210
+ }
211
+
212
+ .value__pqgtJ {
213
+ flex: 1;
214
+ min-width: 0;
215
+ padding: 0;
216
+ text-align: var(--textAlign);
217
+ border: none;
218
+ outline: none;
219
+ background: transparent;
220
+ color: inherit;
221
+ font: inherit;
222
+ }
223
+
224
+ .arrow__Q2E2Y {
225
+ flex: none;
226
+ width: 0;
227
+ height: 0;
228
+ border-inline-start: 4px solid transparent;
229
+ border-inline-end: 4px solid transparent;
230
+ border-top: 5px solid currentColor;
231
+ }
232
+
233
+ .applyButton__GsIJM {
234
+ flex: none;
235
+ }.dropdown {
236
+ --minWidth: 240px;
237
+ --maxWidth: 640px;
238
+ --borderWidth: 1px;
239
+ --borderStartStartRadius: 4px;
240
+ --borderStartEndRadius: 4px;
241
+ --borderEndStartRadius: 4px;
242
+ --borderEndEndRadius: 4px;
243
+ --paddingTop: 8px;
244
+ --paddingBottom: 8px;
245
+ --paddingInlineStart: 12px;
246
+ --paddingInlineEnd: 12px;
247
+ --gap: 8px;
248
+ --textAlign: start;
249
+ }
250
+ .fallbackDirection__HeRgn:not([dir]) {
251
+ direction: var(--wix-opt-in-direction);
252
+ }
253
+ .presetWrapper__J1yzj {
254
+ display: contents;
255
+ }
@@ -0,0 +1,24 @@
1
+ import { DropdownFilter, DropdownOption, DropdownProps } from './Dropdown.types';
2
+ /** An option normalized for base-ui: a stable key plus its value and label. */
3
+ export type DropdownItem = {
4
+ key: string;
5
+ value: string;
6
+ label: string;
7
+ };
8
+ /** Reads a value string from a selection item: a bare string or `{ value }`. */
9
+ export declare const readOptionValue: (item: unknown) => string | null;
10
+ /** Drops blank-label options and assigns stable index keys. */
11
+ export declare const toOptionItems: (options: Array<DropdownOption>) => Array<DropdownItem>;
12
+ /** Normalizes the bound `value` (string, `string[]`, or `{ value }[]`) to values. */
13
+ export declare const readSelectedValues: (rawValue: unknown, isMultiple: boolean) => Array<string>;
14
+ /** Builds the per-item match used to filter the list against the typed query. */
15
+ export declare const createFilterItem: (params: {
16
+ customFilter?: DropdownFilter;
17
+ isSearchable: boolean;
18
+ isMultiple: boolean;
19
+ inline: boolean;
20
+ }) => (item: DropdownItem, typed: string) => boolean;
21
+ export declare const emitChange: (onChange: NonNullable<DropdownProps['onChange']>, value: string | {
22
+ value: string;
23
+ }[]) => void;
24
+ export declare const emitInput: (onInput: NonNullable<DropdownProps['onInput']>, value: string) => void;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Returns how many of `count` chips fit on one row of `ref`, leaving room for a
3
+ * "+N" counter. Renders all chips first (to measure them), then caps; re-runs on
4
+ * selection change and container resize. Falls back to `count` when it can't
5
+ * measure (e.g. SSR / not yet laid out).
6
+ */
7
+ export declare const useChipOverflow: (ref: {
8
+ current: HTMLElement | null;
9
+ }, count: number) => number;
@@ -0,0 +1,15 @@
1
+ import { DropdownProps } from '../Dropdown.types';
2
+ export declare const useDropdownQuery: (params: {
3
+ boundInputValue: string | undefined;
4
+ boundOpen: boolean | undefined;
5
+ isMultiple: boolean;
6
+ selectedKey: string | null;
7
+ selectedOptionLabel: string;
8
+ onInput: NonNullable<DropdownProps['onInput']>;
9
+ }) => {
10
+ inputValue: string;
11
+ handleInputValueChange: (next: string) => void;
12
+ hasQuery: boolean;
13
+ isOpen: boolean;
14
+ setIsOpen: import('react').Dispatch<import('react').SetStateAction<boolean>>;
15
+ };
@@ -0,0 +1,16 @@
1
+ import { DropdownProps } from '../Dropdown.types';
2
+ import { DropdownItem } from '../dropdownUtils';
3
+ export declare const useDropdownSelection: (params: {
4
+ optionItems: Array<DropdownItem>;
5
+ selectedValues: Array<string>;
6
+ isMultiple: boolean;
7
+ isApplyMode: boolean;
8
+ onChange: NonNullable<DropdownProps['onChange']>;
9
+ }) => {
10
+ selectedKeys: string[];
11
+ selectedItems: DropdownItem[];
12
+ selectedKey: string;
13
+ selectedOptionLabel: string;
14
+ handleSelectionChange: (keys: Array<string>) => void;
15
+ handleApply: () => void;
16
+ };
@@ -0,0 +1,2 @@
1
+ export * from './component';
2
+ export { default, default as Dropdown } from './component';
@@ -0,0 +1,6 @@
1
+ 'use client';
2
+
3
+ import Dropdown from './component.js';
4
+
5
+ export { Dropdown };
6
+ export default Dropdown;
@@ -0,0 +1,5 @@
1
+ import { EditorReactComponent } from '@wix/component-protocol/schema';
2
+ declare const manifest: EditorReactComponent & {
3
+ id: string;
4
+ };
5
+ export default manifest;