@vendure-io/ui 3.0.0-next.5 → 3.0.0-next.6
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.
- package/package.json +1 -1
- package/src/components/atoms/breadcrumb.tsx +31 -11
- package/src/components/atoms/carousel.tsx +33 -7
- package/src/components/atoms/combobox.tsx +23 -10
- package/src/components/atoms/command.tsx +14 -4
- package/src/components/atoms/pagination.tsx +43 -12
- package/src/components/atoms/sidebar.tsx +24 -5
- package/src/components/atoms/spinner.tsx +7 -2
- package/src/components/molecules/anonymized-token.tsx +19 -18
- package/src/components/molecules/app-shell.tsx +14 -5
- package/src/components/molecules/checklist/checklist.tsx +47 -17
- package/src/components/molecules/choice-card.tsx +3 -0
- package/src/components/molecules/confirm-dialog.tsx +6 -4
- package/src/components/molecules/data-table/data-table-filters.tsx +25 -7
- package/src/components/molecules/data-table/data-table-types.tsx +33 -16
- package/src/components/molecules/data-table/data-table-view-options.tsx +14 -4
- package/src/components/molecules/data-table/data-table.tsx +47 -26
- package/src/components/molecules/data-table/table-pagination.tsx +51 -29
- package/src/components/molecules/date-picker.tsx +4 -2
- package/src/components/molecules/date-range-picker.tsx +6 -2
- package/src/components/molecules/date-time-picker.tsx +4 -2
- package/src/components/molecules/file-dropzone.tsx +16 -5
- package/src/components/molecules/id-chip.tsx +10 -8
- package/src/components/molecules/issued-secret.tsx +34 -24
- package/src/components/molecules/multi-select.tsx +6 -2
- package/src/components/molecules/secret-value.tsx +26 -18
- package/src/components/molecules/skip-link.tsx +11 -9
- package/src/components/molecules/stat-card.tsx +2 -0
- package/src/components/molecules/state-views/error-state.tsx +18 -6
- package/src/components/molecules/state-views/loading-state.tsx +2 -0
- package/src/lib/format-messages.ts +176 -0
|
@@ -9,6 +9,14 @@ const defaultMessages = {
|
|
|
9
9
|
loading: 'Loading…',
|
|
10
10
|
/** The row of a BreadcrumbSearchMenu that reads the options again. */
|
|
11
11
|
retry: 'Retry',
|
|
12
|
+
/** BreadcrumbSearchMenu's row when the search matches no option. */
|
|
13
|
+
empty: 'No results.',
|
|
14
|
+
/** BreadcrumbSearchMenu's search placeholder. `{label}` is the menu's `label`, in lower case. */
|
|
15
|
+
search: 'Find {label}…',
|
|
16
|
+
/** Screen-reader text of BreadcrumbEllipsis. */
|
|
17
|
+
more: 'More',
|
|
18
|
+
/** Accessible name of the Breadcrumb landmark. */
|
|
19
|
+
nav: 'breadcrumb',
|
|
12
20
|
},
|
|
13
21
|
codeBlock: {
|
|
14
22
|
copyCode: 'Copy code',
|
|
@@ -24,6 +32,12 @@ const defaultMessages = {
|
|
|
24
32
|
combobox: {
|
|
25
33
|
/** Announced while a page of options loads. */
|
|
26
34
|
loading: 'Loading…',
|
|
35
|
+
/** Accessible name of ComboboxInput's icon-only open button. */
|
|
36
|
+
open: 'Open options',
|
|
37
|
+
/** Accessible name of the icon-only clear button. */
|
|
38
|
+
clear: 'Clear',
|
|
39
|
+
/** Accessible name of a ComboboxChip's remove button. */
|
|
40
|
+
remove: 'Remove',
|
|
27
41
|
},
|
|
28
42
|
comboboxFreeText: {
|
|
29
43
|
/** Announced by the field's spinner while suggestions load. */
|
|
@@ -32,6 +46,8 @@ const defaultMessages = {
|
|
|
32
46
|
confirmDialog: {
|
|
33
47
|
/** Screen-reader text of the spinner while the confirm action runs. */
|
|
34
48
|
loading: 'Loading',
|
|
49
|
+
confirm: 'Confirm',
|
|
50
|
+
cancel: 'Cancel',
|
|
35
51
|
},
|
|
36
52
|
copyButton: {
|
|
37
53
|
copy: 'Copy',
|
|
@@ -44,6 +60,8 @@ const defaultMessages = {
|
|
|
44
60
|
multiSelect: {
|
|
45
61
|
/** Stands in for the selected values while the options load. */
|
|
46
62
|
loading: 'Loading…',
|
|
63
|
+
/** The trigger's text when nothing is selected. */
|
|
64
|
+
placeholder: 'Select…',
|
|
47
65
|
},
|
|
48
66
|
passwordInput: {
|
|
49
67
|
showPassword: 'Show password',
|
|
@@ -52,6 +70,16 @@ const defaultMessages = {
|
|
|
52
70
|
secretValue: {
|
|
53
71
|
/** Screen-reader text of the spinner while the value loads. */
|
|
54
72
|
loading: 'Loading',
|
|
73
|
+
/** Accessible name while the value is masked. */
|
|
74
|
+
hidden: 'Hidden value',
|
|
75
|
+
/** Accessible name of the reveal button. */
|
|
76
|
+
show: 'Show value',
|
|
77
|
+
/** Accessible name of the button that masks the value again. */
|
|
78
|
+
hide: 'Hide value',
|
|
79
|
+
copy: 'Copy value',
|
|
80
|
+
copied: 'Value copied',
|
|
81
|
+
/** Shown when `loadValue` rejects. */
|
|
82
|
+
loadError: "Couldn't load the value.",
|
|
55
83
|
},
|
|
56
84
|
searchTrigger: {
|
|
57
85
|
label: 'Search',
|
|
@@ -73,6 +101,12 @@ const defaultMessages = {
|
|
|
73
101
|
anonymizedToken: {
|
|
74
102
|
/** Screen-reader text while the token loads (`value={undefined}`). */
|
|
75
103
|
loading: 'Loading token',
|
|
104
|
+
/** Accessible name while the preview is blurred. */
|
|
105
|
+
obscured: 'Partially obscured token',
|
|
106
|
+
/** Accessible name while the preview is sharp. */
|
|
107
|
+
preview: 'Partially visible token',
|
|
108
|
+
copy: 'Copy token',
|
|
109
|
+
copied: 'Token copied',
|
|
76
110
|
},
|
|
77
111
|
dateTime: {
|
|
78
112
|
/** Screen-reader text while the date loads (`value={undefined}`). */
|
|
@@ -89,16 +123,22 @@ const defaultMessages = {
|
|
|
89
123
|
datePicker: {
|
|
90
124
|
/** Accessible name of the button that clears the date. */
|
|
91
125
|
clear: 'Clear date',
|
|
126
|
+
/** The trigger's text with no date. */
|
|
127
|
+
placeholder: 'Pick a date',
|
|
92
128
|
},
|
|
93
129
|
dateTimePicker: {
|
|
94
130
|
/** Accessible name of the button that clears the date and time. */
|
|
95
131
|
clear: 'Clear date and time',
|
|
96
132
|
/** Accessible name of the time field. */
|
|
97
133
|
time: 'Time',
|
|
134
|
+
/** The trigger's text with no date. */
|
|
135
|
+
placeholder: 'Pick a date and time',
|
|
98
136
|
},
|
|
99
137
|
dateRangePicker: {
|
|
100
138
|
/** Accessible name of the button that clears the range. */
|
|
101
139
|
clear: 'Clear date range',
|
|
140
|
+
/** The trigger's text with no range. */
|
|
141
|
+
placeholder: 'Pick a date range',
|
|
102
142
|
},
|
|
103
143
|
fileDropzone: {
|
|
104
144
|
typeNotAccepted: 'This file type is not accepted.',
|
|
@@ -120,10 +160,119 @@ const defaultMessages = {
|
|
|
120
160
|
byte: 'B',
|
|
121
161
|
kilobyte: 'KB',
|
|
122
162
|
megabyte: 'MB',
|
|
163
|
+
/** The field's label. */
|
|
164
|
+
label: 'Upload files',
|
|
165
|
+
/** The drop prompt. */
|
|
166
|
+
empty: 'Drag and drop files here, or choose files',
|
|
167
|
+
/** The drop prompt while files are dragged over. */
|
|
168
|
+
drag: 'Drop files to add them',
|
|
123
169
|
},
|
|
124
170
|
dataTable: {
|
|
125
171
|
/** Placeholder and accessible name of the filter editor's default value input. */
|
|
126
172
|
filterValue: 'Value',
|
|
173
|
+
/** The row of a loaded table with no rows. */
|
|
174
|
+
empty: 'No results',
|
|
175
|
+
/** Accessible name of the header checkbox. */
|
|
176
|
+
selectAllRows: 'Select all rows',
|
|
177
|
+
/** Tooltip on the header checkbox while not every row on the page is selected. */
|
|
178
|
+
selectAllOnPage: 'Select all on this page',
|
|
179
|
+
/** Tooltip on the header checkbox while every row on the page is selected. */
|
|
180
|
+
clearPageSelection: 'Clear selection on this page',
|
|
181
|
+
/** Accessible name of a row's checkbox. `{row}` is the 1-based row number. */
|
|
182
|
+
selectRow: 'Select row {row}',
|
|
183
|
+
/** Screen-reader header of the row actions column. */
|
|
184
|
+
rowActions: 'Open row actions',
|
|
185
|
+
/** DataTableViewOptions' trigger. */
|
|
186
|
+
columnsTrigger: 'Columns',
|
|
187
|
+
/** DataTableViewOptions' menu heading. */
|
|
188
|
+
columnsHeading: 'Toggle columns',
|
|
189
|
+
/** DataTableAddFilter's trigger. */
|
|
190
|
+
addFilter: 'Add filter',
|
|
191
|
+
/** The button that clears every filter. */
|
|
192
|
+
clearFilters: 'Clear filters',
|
|
193
|
+
/** Accessible name of an applied filter's remove button. `{column}` is the column's label. */
|
|
194
|
+
removeFilter: 'Remove {column} filter',
|
|
195
|
+
/** Accessible name of a sortable header. `{column}` is the column's label. */
|
|
196
|
+
sortLabel: 'Sort by {column}',
|
|
197
|
+
/** The chip that holds the filters past `inlineChipLimit`. `{count}` is their number. */
|
|
198
|
+
filtersCollapsed: '{count} filters',
|
|
199
|
+
},
|
|
200
|
+
tablePagination: {
|
|
201
|
+
/** Accessible name of the prev/next navigation landmark. */
|
|
202
|
+
nav: 'Pagination',
|
|
203
|
+
/** Accessible name of the previous-page control. */
|
|
204
|
+
previous: 'Go to previous page',
|
|
205
|
+
/** Accessible name of the next-page control. */
|
|
206
|
+
next: 'Go to next page',
|
|
207
|
+
/** Visible and accessible name of the page-size selector. */
|
|
208
|
+
pageSize: 'Items per page',
|
|
209
|
+
/** The range text. `{start}`, `{end}` and `{total}` are formatted numbers. */
|
|
210
|
+
range: '{start}–{end} of {total}',
|
|
211
|
+
/** The range text of an empty list. */
|
|
212
|
+
rangeEmpty: '0 of 0',
|
|
213
|
+
},
|
|
214
|
+
checklist: {
|
|
215
|
+
/** Accessible name of the dismiss button. */
|
|
216
|
+
dismiss: 'Dismiss checklist',
|
|
217
|
+
/** Label of the group of finished steps. */
|
|
218
|
+
completed: 'Completed',
|
|
219
|
+
/** Read after a done step's label in system mode. */
|
|
220
|
+
stepDone: 'done',
|
|
221
|
+
/** Read after an open step's label in system mode. */
|
|
222
|
+
stepOpen: 'not done',
|
|
223
|
+
/** The count beside the title. `{done}` and `{total}` are step counts. */
|
|
224
|
+
count: '{done} of {total}',
|
|
225
|
+
/** Announced when the count changes. */
|
|
226
|
+
announcement: '{done} of {total} steps done',
|
|
227
|
+
},
|
|
228
|
+
errorState: {
|
|
229
|
+
/** The headline. */
|
|
230
|
+
title: 'Something went wrong',
|
|
231
|
+
/** The retry button. */
|
|
232
|
+
retry: 'Try again',
|
|
233
|
+
},
|
|
234
|
+
idChip: {
|
|
235
|
+
/** The tooltip before copying. The copy button's name adds the shown text: "Copy 9f2c4e1". */
|
|
236
|
+
copy: 'Copy',
|
|
237
|
+
copied: 'Copied',
|
|
238
|
+
},
|
|
239
|
+
issuedSecret: {
|
|
240
|
+
/** The copy button with one value. `{secret}` is the `secretName`. */
|
|
241
|
+
copy: 'Copy {secret}',
|
|
242
|
+
copied: 'Copied',
|
|
243
|
+
/** `{secret}` is the `secretName`. */
|
|
244
|
+
notice: 'You can copy the {secret} only now.',
|
|
245
|
+
/** `{secret}` is the `secretName`. */
|
|
246
|
+
fallbackDescription: 'The clipboard is not available. Select the {secret} and copy it by hand.',
|
|
247
|
+
/** `{secret}` is the `secretName`. */
|
|
248
|
+
warningTitle: 'The {secret} is not copied',
|
|
249
|
+
warningDescription:
|
|
250
|
+
'You cannot copy it after you close. Copy it now, or close without copying.',
|
|
251
|
+
/** IssuedSecretFooter's button. */
|
|
252
|
+
done: 'Done',
|
|
253
|
+
/** IssuedSecretFooter's button after the warning. */
|
|
254
|
+
closeAnyway: 'Close without copying',
|
|
255
|
+
},
|
|
256
|
+
pagination: {
|
|
257
|
+
/** Accessible name of the Pagination landmark. */
|
|
258
|
+
nav: 'pagination',
|
|
259
|
+
/** Accessible name of PaginationPrevious. */
|
|
260
|
+
previous: 'Go to previous page',
|
|
261
|
+
/** Visible text of PaginationPrevious. */
|
|
262
|
+
previousText: 'Previous',
|
|
263
|
+
/** Accessible name of PaginationNext. */
|
|
264
|
+
next: 'Go to next page',
|
|
265
|
+
/** Visible text of PaginationNext. */
|
|
266
|
+
nextText: 'Next',
|
|
267
|
+
/** Screen-reader text of PaginationEllipsis. */
|
|
268
|
+
more: 'More pages',
|
|
269
|
+
},
|
|
270
|
+
skipLink: {
|
|
271
|
+
label: 'Skip to main content',
|
|
272
|
+
},
|
|
273
|
+
spinner: {
|
|
274
|
+
/** The spinner's accessible name. */
|
|
275
|
+
loading: 'Loading',
|
|
127
276
|
},
|
|
128
277
|
dialog: {
|
|
129
278
|
/** Accessible name of the ✕, and the text of DialogFooter's Close button. */
|
|
@@ -138,6 +287,24 @@ const defaultMessages = {
|
|
|
138
287
|
mobileTitle: 'Sidebar',
|
|
139
288
|
/** Screen-reader description of the mobile Sidebar's sheet. */
|
|
140
289
|
mobileDescription: 'Displays the mobile sidebar.',
|
|
290
|
+
/** Accessible name of SidebarTrigger and SidebarRail, and SidebarRail's tooltip. */
|
|
291
|
+
toggle: 'Toggle Sidebar',
|
|
292
|
+
},
|
|
293
|
+
carousel: {
|
|
294
|
+
/** Screen-reader text of CarouselPrevious. */
|
|
295
|
+
previous: 'Previous slide',
|
|
296
|
+
/** Screen-reader text of CarouselNext. */
|
|
297
|
+
next: 'Next slide',
|
|
298
|
+
/** The Carousel region's `aria-roledescription`. */
|
|
299
|
+
region: 'carousel',
|
|
300
|
+
/** A CarouselItem's `aria-roledescription`. */
|
|
301
|
+
slide: 'slide',
|
|
302
|
+
},
|
|
303
|
+
command: {
|
|
304
|
+
/** Screen-reader title of CommandDialog. */
|
|
305
|
+
title: 'Command Palette',
|
|
306
|
+
/** Screen-reader description of CommandDialog. */
|
|
307
|
+
description: 'Search for a command to run...',
|
|
141
308
|
},
|
|
142
309
|
};
|
|
143
310
|
|
|
@@ -190,3 +357,12 @@ function useMessages<Group extends MessageGroup>(
|
|
|
190
357
|
|
|
191
358
|
export { defaultMessages, useMessages };
|
|
192
359
|
export type { FormatMessages };
|
|
360
|
+
|
|
361
|
+
/** Replaces each `{key}` in a message with its value. An unknown key stays as written. */
|
|
362
|
+
function fillMessage(template: string, values: Record<string, string | number>): string {
|
|
363
|
+
return template.replace(/\{(\w+)\}/g, (match, key: string) =>
|
|
364
|
+
key in values ? String(values[key]) : match,
|
|
365
|
+
);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export { fillMessage };
|