@commmerce/ui 1.0.0-rc.4 → 1.0.0-rc.5

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 (101) hide show
  1. package/README.md +1 -1
  2. package/dist/base.d.ts +5 -0
  3. package/dist/base.js +10 -0
  4. package/dist/calendar.d.ts +95 -0
  5. package/dist/calendar.js +280 -0
  6. package/dist/cdn.js +721 -477
  7. package/dist/components/accordion.js +2 -2
  8. package/dist/components/action-bar.d.ts +12 -2
  9. package/dist/components/action-bar.js +10 -5
  10. package/dist/components/action-menu.d.ts +17 -4
  11. package/dist/components/action-menu.js +8 -5
  12. package/dist/components/app-card.d.ts +24 -2
  13. package/dist/components/app-card.js +25 -10
  14. package/dist/components/banner.d.ts +2 -2
  15. package/dist/components/banner.js +4 -3
  16. package/dist/components/bottom-navigation.d.ts +16 -4
  17. package/dist/components/bottom-navigation.js +10 -7
  18. package/dist/components/bottom-sheet.d.ts +4 -1
  19. package/dist/components/bottom-sheet.js +2 -2
  20. package/dist/components/checkbox.d.ts +12 -2
  21. package/dist/components/checkbox.js +7 -2
  22. package/dist/components/combobox.d.ts +186 -0
  23. package/dist/components/combobox.js +521 -0
  24. package/dist/components/comment.d.ts +27 -9
  25. package/dist/components/comment.js +14 -13
  26. package/dist/components/data-table.d.ts +14 -2
  27. package/dist/components/data-table.js +31 -10
  28. package/dist/components/date-picker.d.ts +179 -0
  29. package/dist/components/date-picker.js +336 -0
  30. package/dist/components/date-range-picker.d.ts +251 -0
  31. package/dist/components/date-range-picker.js +484 -0
  32. package/dist/components/file-upload.d.ts +30 -4
  33. package/dist/components/file-upload.js +37 -17
  34. package/dist/components/filter-panel.d.ts +29 -6
  35. package/dist/components/filter-panel.js +16 -14
  36. package/dist/components/flash-offer-bar.d.ts +18 -4
  37. package/dist/components/flash-offer-bar.js +13 -8
  38. package/dist/components/header-bar.d.ts +20 -4
  39. package/dist/components/header-bar.js +20 -13
  40. package/dist/components/icon.d.ts +7 -0
  41. package/dist/components/icon.js +9 -1
  42. package/dist/components/link-tabs.d.ts +16 -4
  43. package/dist/components/link-tabs.js +10 -7
  44. package/dist/components/mobile-menu.d.ts +19 -4
  45. package/dist/components/mobile-menu.js +16 -10
  46. package/dist/components/modal.d.ts +4 -1
  47. package/dist/components/nested-list.d.ts +22 -3
  48. package/dist/components/nested-list.js +25 -12
  49. package/dist/components/notification-panel.d.ts +26 -5
  50. package/dist/components/notification-panel.js +17 -11
  51. package/dist/components/option-group.d.ts +12 -2
  52. package/dist/components/option-group.js +13 -7
  53. package/dist/components/page-header.d.ts +18 -2
  54. package/dist/components/page-header.js +23 -10
  55. package/dist/components/pagination.d.ts +27 -4
  56. package/dist/components/pagination.js +28 -16
  57. package/dist/components/progress-bar.d.ts +12 -2
  58. package/dist/components/progress-bar.js +9 -4
  59. package/dist/components/radio.d.ts +12 -1
  60. package/dist/components/radio.js +12 -6
  61. package/dist/components/report-tile.d.ts +12 -1
  62. package/dist/components/report-tile.js +9 -4
  63. package/dist/components/resource-list.d.ts +36 -5
  64. package/dist/components/resource-list.js +50 -23
  65. package/dist/components/save-bar.d.ts +23 -6
  66. package/dist/components/save-bar.js +14 -12
  67. package/dist/components/search.d.ts +28 -7
  68. package/dist/components/search.js +18 -13
  69. package/dist/components/select.d.ts +12 -2
  70. package/dist/components/select.js +9 -4
  71. package/dist/components/side-navigation.d.ts +16 -4
  72. package/dist/components/side-navigation.js +16 -12
  73. package/dist/components/side-panel.d.ts +5 -2
  74. package/dist/components/side-panel.js +5 -3
  75. package/dist/components/skeleton-display.d.ts +6 -4
  76. package/dist/components/skeleton-display.js +4 -5
  77. package/dist/components/smart-tip.d.ts +25 -6
  78. package/dist/components/smart-tip.js +18 -12
  79. package/dist/components/spinner.d.ts +4 -3
  80. package/dist/components/spinner.js +5 -6
  81. package/dist/components/status-tabs.d.ts +12 -2
  82. package/dist/components/status-tabs.js +14 -8
  83. package/dist/components/table-header.d.ts +15 -2
  84. package/dist/components/table-header.js +13 -5
  85. package/dist/components/tag.d.ts +12 -2
  86. package/dist/components/tag.js +9 -4
  87. package/dist/components/text-field.d.ts +12 -2
  88. package/dist/components/text-field.js +9 -4
  89. package/dist/components/thumbnail.d.ts +12 -2
  90. package/dist/components/thumbnail.js +8 -3
  91. package/dist/components/toast.d.ts +14 -3
  92. package/dist/components/toast.js +20 -9
  93. package/dist/components/toggle.js +2 -0
  94. package/dist/custom-elements.json +16477 -6434
  95. package/dist/index.d.ts +7 -1
  96. package/dist/index.js +5 -1
  97. package/dist/localize.d.ts +130 -0
  98. package/dist/localize.js +232 -0
  99. package/dist/overlay.d.ts +8 -4
  100. package/dist/overlay.js +9 -12
  101. package/package.json +4 -4
@@ -0,0 +1,186 @@
1
+ import { type PropertyValues } from 'lit';
2
+ import { CmLocalizedElement } from '../localize.js';
3
+ import type { SelectOption } from './select.js';
4
+ import './icon.js';
5
+ import './tag.js';
6
+ import './spinner.js';
7
+ declare const strings: {
8
+ /** Shown in the open list when nothing matches. */
9
+ noResults: string;
10
+ /** Announced as the list changes. */
11
+ results: {
12
+ one: string;
13
+ other: string;
14
+ };
15
+ /** The row that adds what was typed (`allow-custom`). */
16
+ add: string;
17
+ /** Accessible name of a tag's remove button (`multiple`). */
18
+ remove: string;
19
+ /** Validation: `required` and nothing chosen. */
20
+ required: string;
21
+ /** Validation: `required`, `multiple` and nothing chosen. */
22
+ requiredMultiple: string;
23
+ };
24
+ declare module '../localize.js' {
25
+ interface CmStrings {
26
+ combobox: typeof strings;
27
+ }
28
+ }
29
+ /**
30
+ * Editable combobox: a text box that suggests matching options as the merchant types (the WAI-ARIA APG
31
+ * "combobox with list autocomplete" pattern). Picks one option, or several with `multiple` (shown as removable
32
+ * tags). With `filter="none"` it doesn't filter by itself: listen for `cm-search`, fetch matches, set `options`
33
+ * and toggle `loading`. With `allow-custom` the merchant can add a value that isn't in the list (a new product tag).
34
+ *
35
+ * Options come from `<option>` children or the `options` property, as for `cm-select`.
36
+ * @element cm-combobox
37
+ * @slot - `<option value="…">Label</option>` elements. `disabled` and `selected` are honoured.
38
+ * @fires change - When the value changes (an option picked or removed, or a custom value added).
39
+ * @fires input - Same moment as `change`.
40
+ * @fires cm-search - As the merchant types, with `detail: { query }`. Use it to load matches from the server.
41
+ * @fires cm-create - Before a custom value is added (`allow-custom`), with `detail: { value }`. Cancelable: call `preventDefault()` to refuse it.
42
+ * @csspart box - The bordered box around the tags and the text input.
43
+ * @csspart input - The text input.
44
+ * @csspart listbox - The list of suggestions.
45
+ */
46
+ export declare class CmCombobox extends CmLocalizedElement {
47
+ #private;
48
+ static formAssociated: boolean;
49
+ static shadowRootOptions: {
50
+ delegatesFocus: boolean;
51
+ mode: ShadowRootMode;
52
+ serializable?: boolean;
53
+ slotAssignment?: SlotAssignmentMode;
54
+ };
55
+ static properties: {
56
+ label: {};
57
+ helpText: {
58
+ attribute: string;
59
+ };
60
+ error: {
61
+ reflect: boolean;
62
+ };
63
+ name: {
64
+ reflect: boolean;
65
+ };
66
+ value: {};
67
+ values: {
68
+ type: ArrayConstructor;
69
+ };
70
+ placeholder: {};
71
+ options: {
72
+ type: ArrayConstructor;
73
+ };
74
+ multiple: {
75
+ type: BooleanConstructor;
76
+ reflect: boolean;
77
+ };
78
+ allowCustom: {
79
+ type: BooleanConstructor;
80
+ attribute: string;
81
+ };
82
+ filter: {};
83
+ loading: {
84
+ type: BooleanConstructor;
85
+ reflect: boolean;
86
+ };
87
+ emptyText: {
88
+ attribute: string;
89
+ string: string;
90
+ };
91
+ loadingText: {
92
+ attribute: string;
93
+ string: string;
94
+ };
95
+ required: {
96
+ type: BooleanConstructor;
97
+ reflect: boolean;
98
+ };
99
+ disabled: {
100
+ type: BooleanConstructor;
101
+ reflect: boolean;
102
+ };
103
+ open: {
104
+ type: BooleanConstructor;
105
+ reflect: boolean;
106
+ };
107
+ _query: {
108
+ state: boolean;
109
+ };
110
+ _active: {
111
+ state: boolean;
112
+ };
113
+ _slotted: {
114
+ state: boolean;
115
+ };
116
+ _typing: {
117
+ state: boolean;
118
+ };
119
+ };
120
+ /** Visible label above the box. Required for accessibility unless the element has an aria-label. */
121
+ label: string;
122
+ /** One sentence under the box in text-tertiary. */
123
+ helpText: string;
124
+ /** Error message; turns the border critical and sets aria-invalid. */
125
+ error: string;
126
+ /** Form field name. With `multiple`, each value is submitted as its own entry under this name. */
127
+ name: string;
128
+ /** Value of the chosen option (single mode). Empty when nothing is chosen. */
129
+ value: string;
130
+ /** Values of the chosen options (`multiple` mode), in the order they were added. */
131
+ values: string[];
132
+ /** Shown in the empty text box, e.g. "Search tags". */
133
+ placeholder: string;
134
+ /** Options as strings or `{ value, label, disabled }`. Used instead of `<option>` children when set. */
135
+ options: Array<string | SelectOption>;
136
+ /** Lets the merchant choose several options, shown as removable tags. Backspace in the empty box removes the last one. */
137
+ multiple: boolean;
138
+ /** Lets the merchant add what they typed when it isn't an option ("Add “summer”"). Fires a cancelable `cm-create`. */
139
+ allowCustom: boolean;
140
+ /** How typing narrows the list: `contains` (default), `starts-with`, or `none` when you filter on the server from `cm-search`. */
141
+ filter: 'contains' | 'starts-with' | 'none';
142
+ /** Shows a spinner in the list while you load options. */
143
+ loading: boolean;
144
+ /** Shown in the list when nothing matches. Default: the built-in string `noResults` ("No results"). */
145
+ emptyText: string;
146
+ /** Announced and shown while `loading`. Default: the built-in string `loading` ("Loading", shared with other components). */
147
+ loadingText: string;
148
+ /** The form will not submit until something is chosen. */
149
+ required: boolean;
150
+ /** Blocks interaction. Also set by a disabled `<fieldset>`. */
151
+ disabled: boolean;
152
+ /** Whether the list is showing. */
153
+ open: boolean;
154
+ _query: string;
155
+ _active: number;
156
+ _slotted: SelectOption[];
157
+ /** True while the text box holds the merchant's own query rather than the chosen option's label. */
158
+ _typing: boolean;
159
+ static styles: import("lit").CSSResult[];
160
+ connectedCallback(): void;
161
+ disconnectedCallback(): void;
162
+ get form(): HTMLFormElement | null;
163
+ get validity(): ValidityState;
164
+ get validationMessage(): string;
165
+ checkValidity(): boolean;
166
+ reportValidity(): boolean;
167
+ formResetCallback(): void;
168
+ formDisabledCallback(d: boolean): void;
169
+ formStateRestoreCallback(state: string | FormData): void;
170
+ /** All options in use, normalised (before filtering). */
171
+ get items(): SelectOption[];
172
+ /** The options shown for the current query. */
173
+ get filteredItems(): SelectOption[];
174
+ firstUpdated(): void;
175
+ willUpdate(changed: PropertyValues): void;
176
+ updated(changed: PropertyValues): void;
177
+ /** Removes a chosen value (`multiple`). */
178
+ removeValue(value: string): void;
179
+ render(): import("lit-html").TemplateResult<1>;
180
+ }
181
+ declare global {
182
+ interface HTMLElementTagNameMap {
183
+ 'cm-combobox': CmCombobox;
184
+ }
185
+ }
186
+ export {};