@jirawatpyk/aura-react 4.15.0 → 4.17.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,352 +1,6 @@
1
1
  'use client';
2
2
  import * as React from "react";
3
- const n = function(x) {
4
- return Number(x).toLocaleString("en");
5
- };
6
- const nsv = function(x) {
7
- return Number(x).toLocaleString("sv-SE");
8
- };
9
- const STRINGS = {
10
- en: {
11
- close: "Close",
12
- dismiss: "Dismiss",
13
- dismissToast: "Dismiss notification",
14
- showPassword: "Show password",
15
- filters: "Filters",
16
- search: "Search",
17
- clearFilters: "Clear all",
18
- results: function(n2) {
19
- return n2 === 1 ? "1 result" : n2.toLocaleString("en") + " results";
20
- },
21
- commandMenu: "Command menu",
22
- commandPlaceholder: "Type a command or search\u2026",
23
- commandHint: "\u2191\u2193 to move \xB7 Enter to open \xB7 Esc to close",
24
- errorSummary: function(n2) {
25
- return n2 === 1 ? "Fix 1 field to continue" : "Fix " + n2 + " fields to continue";
26
- },
27
- notifications: "Notifications",
28
- mainNav: "Main",
29
- breadcrumb: "Breadcrumb",
30
- navigation: "Navigation",
31
- openNav: "Open navigation",
32
- collapseNav: "Collapse sidebar",
33
- expandNav: "Expand sidebar",
34
- searching: "Searching\u2026",
35
- noMatches: "No matches",
36
- clear: function(what) {
37
- return "Clear " + (what || "selection");
38
- },
39
- keepTyping: function(total) {
40
- return "Keep typing to narrow " + n(total) + " options";
41
- },
42
- sortAsc: "Sort ascending",
43
- sortDesc: "Sort descending",
44
- pin: "Pin to left",
45
- unpin: "Unpin column",
46
- moveLeft: "Move left",
47
- moveRight: "Move right",
48
- hideColumn: "Hide column",
49
- resetColumns: "Reset columns",
50
- selectRows: "Select rows",
51
- selectAllRows: "Select all rows",
52
- deselectAllRows: "Deselect all rows",
53
- selectAll: "Select all",
54
- selectRow: function(k) {
55
- return "Select " + k;
56
- },
57
- selectedCount: function(c) {
58
- return n(c) + " selected";
59
- },
60
- pinned: "Pinned",
61
- columnOptions: function(label) {
62
- return label + " column options";
63
- },
64
- column: function(label) {
65
- return label ? label + " column" : "Column";
66
- },
67
- columns: "Columns",
68
- showHideColumns: "Show or hide columns",
69
- empty: "Nothing here yet",
70
- loading: "Loading\u2026",
71
- loadingRows: "Loading rows",
72
- range: function(a, b, total) {
73
- return a + "\u2013" + b + " of " + n(total);
74
- },
75
- page: function(p, total) {
76
- return "Page " + p + " of " + total;
77
- },
78
- prevPage: "Previous page",
79
- nextPage: "Next page",
80
- rowCount: function(c) {
81
- return n(c) + " rows";
82
- },
83
- actions: "Actions",
84
- optional: "optional",
85
- timePlaceholder: "hh:mm",
86
- timeInvalid: "Type a time like 09:30",
87
- timeOutOfRange: function(a, b) {
88
- return "Choose a time between " + a + " and " + b;
89
- },
90
- dropFiles: "Drag files here or",
91
- browse: "Choose files",
92
- browseOne: "Choose a file",
93
- remove: function(n2) {
94
- return "Remove " + n2;
95
- },
96
- fileTooBig: function(max) {
97
- return "Larger than " + max;
98
- },
99
- fileWrongType: "This file type isn\u2019t accepted",
100
- tooManyFiles: function(n2) {
101
- return "Up to " + n2 + " files";
102
- },
103
- colorScheme: "Colour scheme",
104
- increase: "Increase",
105
- decrease: "Decrease",
106
- stepDone: "completed",
107
- stepOf: function(i, total) {
108
- return "Step " + i + " of " + total;
109
- },
110
- schemeLight: "Light",
111
- schemeDark: "Dark",
112
- schemeSystem: "System",
113
- uploading: "Uploading\u2026",
114
- images: "Images",
115
- pagination: "Pagination",
116
- pageN: function(p) {
117
- return "Page " + p;
118
- },
119
- accepts: function(list, max) {
120
- return [list, max && "up to " + max + " each"].filter(Boolean).join(", ");
121
- }
122
- },
123
- th: {
124
- close: "\u0E1B\u0E34\u0E14",
125
- dismiss: "\u0E1B\u0E34\u0E14",
126
- dismissToast: "\u0E1B\u0E34\u0E14\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19",
127
- showPassword: "\u0E41\u0E2A\u0E14\u0E07\u0E23\u0E2B\u0E31\u0E2A\u0E1C\u0E48\u0E32\u0E19",
128
- filters: "\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07",
129
- search: "\u0E04\u0E49\u0E19\u0E2B\u0E32",
130
- clearFilters: "\u0E25\u0E49\u0E32\u0E07\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",
131
- results: function(n2) {
132
- return n2.toLocaleString("en") + " \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23";
133
- },
134
- commandMenu: "\u0E40\u0E21\u0E19\u0E39\u0E04\u0E33\u0E2A\u0E31\u0E48\u0E07",
135
- commandPlaceholder: "\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E04\u0E33\u0E2A\u0E31\u0E48\u0E07\u0E2B\u0E23\u0E37\u0E2D\u0E04\u0E49\u0E19\u0E2B\u0E32\u2026",
136
- commandHint: "\u2191\u2193 \u0E40\u0E25\u0E37\u0E48\u0E2D\u0E19 \xB7 Enter \u0E40\u0E1B\u0E34\u0E14 \xB7 Esc \u0E1B\u0E34\u0E14",
137
- errorSummary: function(n2) {
138
- return "\u0E41\u0E01\u0E49\u0E44\u0E02 " + n2 + " \u0E0A\u0E48\u0E2D\u0E07\u0E01\u0E48\u0E2D\u0E19\u0E44\u0E1B\u0E15\u0E48\u0E2D";
139
- },
140
- notifications: "\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19",
141
- mainNav: "\u0E40\u0E21\u0E19\u0E39\u0E2B\u0E25\u0E31\u0E01",
142
- breadcrumb: "\u0E40\u0E2A\u0E49\u0E19\u0E17\u0E32\u0E07",
143
- navigation: "\u0E40\u0E21\u0E19\u0E39",
144
- openNav: "\u0E40\u0E1B\u0E34\u0E14\u0E40\u0E21\u0E19\u0E39",
145
- collapseNav: "\u0E22\u0E48\u0E2D\u0E41\u0E16\u0E1A\u0E40\u0E21\u0E19\u0E39",
146
- expandNav: "\u0E02\u0E22\u0E32\u0E22\u0E41\u0E16\u0E1A\u0E40\u0E21\u0E19\u0E39",
147
- searching: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E04\u0E49\u0E19\u0E2B\u0E32\u2026",
148
- noMatches: "\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E17\u0E35\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E19",
149
- clear: function(what) {
150
- return "\u0E25\u0E49\u0E32\u0E07" + (what || "\u0E17\u0E35\u0E48\u0E40\u0E25\u0E37\u0E2D\u0E01");
151
- },
152
- keepTyping: function(total) {
153
- return "\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E01\u0E23\u0E2D\u0E07\u0E08\u0E32\u0E01 " + n(total) + " \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23";
154
- },
155
- sortAsc: "\u0E40\u0E23\u0E35\u0E22\u0E07\u0E08\u0E32\u0E01\u0E19\u0E49\u0E2D\u0E22\u0E44\u0E1B\u0E21\u0E32\u0E01",
156
- sortDesc: "\u0E40\u0E23\u0E35\u0E22\u0E07\u0E08\u0E32\u0E01\u0E21\u0E32\u0E01\u0E44\u0E1B\u0E19\u0E49\u0E2D\u0E22",
157
- pin: "\u0E15\u0E23\u0E36\u0E07\u0E44\u0E27\u0E49\u0E0B\u0E49\u0E32\u0E22",
158
- unpin: "\u0E40\u0E25\u0E34\u0E01\u0E15\u0E23\u0E36\u0E07\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
159
- moveLeft: "\u0E22\u0E49\u0E32\u0E22\u0E44\u0E1B\u0E0B\u0E49\u0E32\u0E22",
160
- moveRight: "\u0E22\u0E49\u0E32\u0E22\u0E44\u0E1B\u0E02\u0E27\u0E32",
161
- hideColumn: "\u0E0B\u0E48\u0E2D\u0E19\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
162
- resetColumns: "\u0E04\u0E37\u0E19\u0E04\u0E48\u0E32\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
163
- selectRows: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E41\u0E16\u0E27",
164
- selectAllRows: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E38\u0E01\u0E41\u0E16\u0E27",
165
- deselectAllRows: "\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01\u0E01\u0E32\u0E23\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E38\u0E01\u0E41\u0E16\u0E27",
166
- selectAll: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",
167
- selectRow: function(k) {
168
- return "\u0E40\u0E25\u0E37\u0E2D\u0E01 " + k;
169
- },
170
- selectedCount: function(c) {
171
- return "\u0E40\u0E25\u0E37\u0E2D\u0E01 " + n(c) + " \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23";
172
- },
173
- pinned: "\u0E15\u0E23\u0E36\u0E07\u0E2D\u0E22\u0E39\u0E48",
174
- columnOptions: function(label) {
175
- return "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C " + label;
176
- },
177
- column: function(label) {
178
- return label ? "\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C " + label : "\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C";
179
- },
180
- columns: "\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
181
- showHideColumns: "\u0E41\u0E2A\u0E14\u0E07\u0E2B\u0E23\u0E37\u0E2D\u0E0B\u0E48\u0E2D\u0E19\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
182
- empty: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
183
- loading: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14\u2026",
184
- loadingRows: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
185
- range: function(a, b, total) {
186
- return a + "\u2013" + b + " \u0E08\u0E32\u0E01 " + n(total);
187
- },
188
- page: function(p, total) {
189
- return "\u0E2B\u0E19\u0E49\u0E32 " + p + " / " + total;
190
- },
191
- prevPage: "\u0E2B\u0E19\u0E49\u0E32\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32",
192
- nextPage: "\u0E2B\u0E19\u0E49\u0E32\u0E16\u0E31\u0E14\u0E44\u0E1B",
193
- rowCount: function(c) {
194
- return n(c) + " \u0E41\u0E16\u0E27";
195
- },
196
- actions: "\u0E01\u0E32\u0E23\u0E08\u0E31\u0E14\u0E01\u0E32\u0E23",
197
- optional: "\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A",
198
- timePlaceholder: "\u0E0A\u0E0A:\u0E19\u0E19",
199
- timeInvalid: "\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A 09:30",
200
- timeOutOfRange: function(a, b) {
201
- return "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E40\u0E27\u0E25\u0E32\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07 " + a + "\u2013" + b + " \u0E19.";
202
- },
203
- dropFiles: "\u0E25\u0E32\u0E01\u0E44\u0E1F\u0E25\u0E4C\u0E21\u0E32\u0E27\u0E32\u0E07 \u0E2B\u0E23\u0E37\u0E2D",
204
- browse: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E1F\u0E25\u0E4C",
205
- browseOne: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E1F\u0E25\u0E4C",
206
- remove: function(n2) {
207
- return "\u0E25\u0E1A " + n2;
208
- },
209
- fileTooBig: function(max) {
210
- return "\u0E44\u0E1F\u0E25\u0E4C\u0E43\u0E2B\u0E0D\u0E48\u0E40\u0E01\u0E34\u0E19 " + max;
211
- },
212
- fileWrongType: "\u0E44\u0E21\u0E48\u0E23\u0E2D\u0E07\u0E23\u0E31\u0E1A\u0E44\u0E1F\u0E25\u0E4C\u0E0A\u0E19\u0E34\u0E14\u0E19\u0E35\u0E49",
213
- tooManyFiles: function(n2) {
214
- return "\u0E41\u0E19\u0E1A\u0E44\u0E14\u0E49\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 " + n2 + " \u0E44\u0E1F\u0E25\u0E4C";
215
- },
216
- colorScheme: "\u0E42\u0E2B\u0E21\u0E14\u0E2A\u0E35",
217
- increase: "\u0E40\u0E1E\u0E34\u0E48\u0E21",
218
- decrease: "\u0E25\u0E14",
219
- stepDone: "\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E41\u0E25\u0E49\u0E27",
220
- stepOf: function(i, total) {
221
- return "\u0E02\u0E31\u0E49\u0E19\u0E17\u0E35\u0E48 " + i + " \u0E08\u0E32\u0E01 " + total;
222
- },
223
- schemeLight: "\u0E2A\u0E27\u0E48\u0E32\u0E07",
224
- schemeDark: "\u0E21\u0E37\u0E14",
225
- schemeSystem: "\u0E15\u0E32\u0E21\u0E23\u0E30\u0E1A\u0E1A",
226
- uploading: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14\u2026",
227
- images: "\u0E23\u0E39\u0E1B\u0E20\u0E32\u0E1E",
228
- pagination: "\u0E40\u0E25\u0E02\u0E2B\u0E19\u0E49\u0E32",
229
- pageN: function(p) {
230
- return "\u0E2B\u0E19\u0E49\u0E32 " + p;
231
- },
232
- accepts: function(list, max) {
233
- return [list, max && "\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 " + max + " \u0E15\u0E48\u0E2D\u0E44\u0E1F\u0E25\u0E4C"].filter(Boolean).join(" \xB7 ");
234
- }
235
- },
236
- sv: {
237
- close: "St\xE4ng",
238
- dismiss: "St\xE4ng",
239
- dismissToast: "St\xE4ng aviseringen",
240
- showPassword: "Visa l\xF6senord",
241
- filters: "Filter",
242
- search: "S\xF6k",
243
- clearFilters: "Rensa alla",
244
- results: function(n2) {
245
- return n2 === 1 ? "1 tr\xE4ff" : n2.toLocaleString("sv-SE") + " tr\xE4ffar";
246
- },
247
- commandMenu: "Kommandomeny",
248
- commandPlaceholder: "Skriv ett kommando eller s\xF6k\u2026",
249
- commandHint: "\u2191\u2193 flytta \xB7 Enter \xF6ppna \xB7 Esc st\xE4ng",
250
- errorSummary: function(n2) {
251
- return n2 === 1 ? "R\xE4tta 1 f\xE4lt f\xF6r att forts\xE4tta" : "R\xE4tta " + n2 + " f\xE4lt f\xF6r att forts\xE4tta";
252
- },
253
- notifications: "Aviseringar",
254
- mainNav: "Huvudmeny",
255
- breadcrumb: "Br\xF6dsmulor",
256
- navigation: "Navigering",
257
- openNav: "\xD6ppna menyn",
258
- collapseNav: "F\xE4ll ihop sidof\xE4ltet",
259
- expandNav: "F\xE4ll ut sidof\xE4ltet",
260
- searching: "S\xF6ker\u2026",
261
- noMatches: "Inga tr\xE4ffar",
262
- clear: function(what) {
263
- return "Rensa " + (what || "urvalet");
264
- },
265
- keepTyping: function(total) {
266
- return "Skriv mer f\xF6r att begr\xE4nsa " + nsv(total) + " alternativ";
267
- },
268
- sortAsc: "Sortera stigande",
269
- sortDesc: "Sortera fallande",
270
- pin: "F\xE4st till v\xE4nster",
271
- unpin: "Lossa kolumnen",
272
- moveLeft: "Flytta v\xE4nster",
273
- moveRight: "Flytta h\xF6ger",
274
- hideColumn: "D\xF6lj kolumnen",
275
- resetColumns: "\xC5terst\xE4ll kolumner",
276
- selectRows: "V\xE4lj rader",
277
- selectAllRows: "V\xE4lj alla rader",
278
- deselectAllRows: "Avmarkera alla rader",
279
- selectAll: "V\xE4lj alla",
280
- selectRow: function(k) {
281
- return "V\xE4lj " + k;
282
- },
283
- selectedCount: function(c) {
284
- return nsv(c) + " valda";
285
- },
286
- pinned: "F\xE4st",
287
- columnOptions: function(label) {
288
- return "Alternativ f\xF6r kolumnen " + label;
289
- },
290
- column: function(label) {
291
- return label ? "Kolumnen " + label : "Kolumn";
292
- },
293
- columns: "Kolumner",
294
- showHideColumns: "Visa eller d\xF6lj kolumner",
295
- empty: "Inget h\xE4r \xE4nnu",
296
- loading: "Laddar\u2026",
297
- loadingRows: "Laddar rader",
298
- range: function(a, b, total) {
299
- return a + "\u2013" + b + " av " + nsv(total);
300
- },
301
- page: function(p, total) {
302
- return "Sida " + p + " av " + total;
303
- },
304
- prevPage: "F\xF6reg\xE5ende sida",
305
- nextPage: "N\xE4sta sida",
306
- rowCount: function(c) {
307
- return nsv(c) + " rader";
308
- },
309
- actions: "\xC5tg\xE4rder",
310
- optional: "valfritt",
311
- timePlaceholder: "tt:mm",
312
- timeInvalid: "Skriv en tid som 09:30",
313
- timeOutOfRange: function(a, b) {
314
- return "V\xE4lj en tid mellan " + a + " och " + b;
315
- },
316
- dropFiles: "Dra filer hit eller",
317
- browse: "V\xE4lj filer",
318
- browseOne: "V\xE4lj en fil",
319
- remove: function(n2) {
320
- return "Ta bort " + n2;
321
- },
322
- fileTooBig: function(max) {
323
- return "St\xF6rre \xE4n " + max;
324
- },
325
- fileWrongType: "Den h\xE4r filtypen godtas inte",
326
- tooManyFiles: function(n2) {
327
- return "H\xF6gst " + n2 + " filer";
328
- },
329
- colorScheme: "F\xE4rgl\xE4ge",
330
- increase: "\xD6ka",
331
- decrease: "Minska",
332
- stepDone: "klart",
333
- stepOf: function(i, total) {
334
- return "Steg " + i + " av " + total;
335
- },
336
- schemeLight: "Ljust",
337
- schemeDark: "M\xF6rkt",
338
- schemeSystem: "System",
339
- uploading: "Laddar upp\u2026",
340
- images: "Bilder",
341
- pagination: "Sidnumrering",
342
- pageN: function(p) {
343
- return "Sida " + p;
344
- },
345
- accepts: function(list, max) {
346
- return [list, max && "h\xF6gst " + max + " per fil"].filter(Boolean).join(", ");
347
- }
348
- }
349
- };
3
+ import { STRINGS } from "./strings.js";
350
4
  const LocaleContext = React.createContext(null);
351
5
  function AuraProvider(props) {
352
6
  const outer = React.useContext(LocaleContext);
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import * as React from "react";
3
- const breakpoints = { sm: 640, md: 768, lg: 1024, xl: 1280 };
3
+ import { breakpoints } from "./breakpoints.js";
4
4
  const ORDER = ["base", "sm", "md", "lg", "xl"];
5
5
  function useBreakpoint() {
6
6
  return React.useSyncExternalStore(subscribe, current, function() {
@@ -0,0 +1,17 @@
1
+ 'use client';
2
+ const TONE_WORDS = {
3
+ ready: ["ready", "done", "complete", "completed", "approved", "live", "passed"],
4
+ progress: ["in progress", "in review", "review", "syncing", "running", "pending"],
5
+ blocked: ["blocked", "failed", "error", "rejected", "on hold", "cancelled"]
6
+ };
7
+ function toneFor(status) {
8
+ const s = String(status == null ? "" : status).trim().toLowerCase();
9
+ for (const t in TONE_WORDS) if (TONE_WORDS[t].indexOf(s) >= 0) return t;
10
+ return "neutral";
11
+ }
12
+ const TONE_ORDER = { neutral: 0, progress: 1, ready: 2, blocked: 3 };
13
+ export {
14
+ TONE_ORDER,
15
+ toneFor as statusTone,
16
+ toneFor
17
+ };