@f-ewald/components 1.29.0 → 1.30.1

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.
@@ -0,0 +1,409 @@
1
+ /**
2
+ * Pure helpers for standard 5-field POSIX/Vixie cron expressions
3
+ * (`minute hour day-of-month month day-of-week`).
4
+ *
5
+ * Supported syntax: `*`, single values, lists (`,`), ranges (`-`), steps
6
+ * (`/`), three-letter month/weekday names, `7` as an alias for Sunday, and the
7
+ * `@yearly`/`@annually`/`@monthly`/`@weekly`/`@daily`/`@midnight`/`@hourly`
8
+ * shorthands. `?` is tolerated on the day fields (read as `*`) for
9
+ * Quartz-flavoured input but is never emitted. `@reboot` and the Quartz-only
10
+ * `L`/`W`/`#` characters are deliberately unsupported — they have no
11
+ * representation in the five numeric fields.
12
+ */
13
+ /** The five cron field names, in expression order. */
14
+ export const CRON_FIELD_NAMES = [
15
+ "minute",
16
+ "hour",
17
+ "dayOfMonth",
18
+ "month",
19
+ "dayOfWeek",
20
+ ];
21
+ /** Inclusive `[min, max]` value bounds for each cron field. */
22
+ export const CRON_FIELD_BOUNDS = {
23
+ minute: [0, 59],
24
+ hour: [0, 23],
25
+ dayOfMonth: [1, 31],
26
+ month: [1, 12],
27
+ dayOfWeek: [0, 6],
28
+ };
29
+ /** Human-readable labels for each cron field. */
30
+ export const CRON_FIELD_LABELS = {
31
+ minute: "Minute",
32
+ hour: "Hour",
33
+ dayOfMonth: "Day of month",
34
+ month: "Month",
35
+ dayOfWeek: "Day of week",
36
+ };
37
+ /** Full weekday names indexed by cron day-of-week value (0 = Sunday). */
38
+ export const WEEKDAY_NAMES = [
39
+ "Sunday",
40
+ "Monday",
41
+ "Tuesday",
42
+ "Wednesday",
43
+ "Thursday",
44
+ "Friday",
45
+ "Saturday",
46
+ ];
47
+ /** Three-letter weekday abbreviations indexed by cron value (0 = Sun). */
48
+ export const WEEKDAY_ABBREVIATIONS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
49
+ /** Full month names indexed from 0, so month `n` is `MONTH_NAMES[n - 1]`. */
50
+ export const MONTH_NAMES = [
51
+ "January",
52
+ "February",
53
+ "March",
54
+ "April",
55
+ "May",
56
+ "June",
57
+ "July",
58
+ "August",
59
+ "September",
60
+ "October",
61
+ "November",
62
+ "December",
63
+ ];
64
+ /** Three-letter month abbreviations indexed from 0 (`Jan` is month 1). */
65
+ export const MONTH_ABBREVIATIONS = [
66
+ "Jan",
67
+ "Feb",
68
+ "Mar",
69
+ "Apr",
70
+ "May",
71
+ "Jun",
72
+ "Jul",
73
+ "Aug",
74
+ "Sep",
75
+ "Oct",
76
+ "Nov",
77
+ "Dec",
78
+ ];
79
+ /** Supported `@`-shorthands mapped to their five-field equivalents. */
80
+ export const CRON_ALIASES = {
81
+ "@yearly": "0 0 1 1 *",
82
+ "@annually": "0 0 1 1 *",
83
+ "@monthly": "0 0 1 * *",
84
+ "@weekly": "0 0 * * 0",
85
+ "@daily": "0 0 * * *",
86
+ "@midnight": "0 0 * * *",
87
+ "@hourly": "0 * * * *",
88
+ };
89
+ const NAME_LOOKUPS = {
90
+ month: Object.fromEntries(MONTH_ABBREVIATIONS.map((name, index) => [name.toLowerCase(), index + 1])),
91
+ dayOfWeek: Object.fromEntries(WEEKDAY_ABBREVIATIONS.map((name, index) => [name.toLowerCase(), index])),
92
+ };
93
+ function parseValue(token, field) {
94
+ const named = NAME_LOOKUPS[field]?.[token.toLowerCase()];
95
+ if (named !== undefined)
96
+ return named;
97
+ if (!/^\d+$/.test(token))
98
+ return null;
99
+ const value = Number(token);
100
+ const [min, max] = CRON_FIELD_BOUNDS[field];
101
+ // Vixie cron accepts 7 as a second spelling of Sunday.
102
+ if (field === "dayOfWeek" && value === 7)
103
+ return 0;
104
+ return value >= min && value <= max ? value : null;
105
+ }
106
+ function parseTerm(token, field) {
107
+ const [base, stepToken, ...rest] = token.split("/");
108
+ if (rest.length > 0 || base === undefined || base === "")
109
+ return null;
110
+ if (stepToken !== undefined) {
111
+ if (!/^\d+$/.test(stepToken))
112
+ return null;
113
+ const step = Number(stepToken);
114
+ if (step < 1)
115
+ return null;
116
+ const [min, max] = CRON_FIELD_BOUNDS[field];
117
+ if (base === "*" || base === "?")
118
+ return { kind: "step", from: min, to: null, step };
119
+ const range = base.split("-");
120
+ if (range.length === 1) {
121
+ const from = parseValue(range[0], field);
122
+ return from === null ? null : { kind: "step", from, to: null, step };
123
+ }
124
+ if (range.length !== 2)
125
+ return null;
126
+ const from = parseValue(range[0], field);
127
+ const to = parseValue(range[1], field);
128
+ if (from === null || to === null || to < from || to > max)
129
+ return null;
130
+ return { kind: "step", from, to, step };
131
+ }
132
+ if (base === "*" || base === "?")
133
+ return { kind: "all" };
134
+ const range = base.split("-");
135
+ if (range.length === 1) {
136
+ const value = parseValue(range[0], field);
137
+ return value === null ? null : { kind: "value", value };
138
+ }
139
+ if (range.length !== 2)
140
+ return null;
141
+ const from = parseValue(range[0], field);
142
+ const to = parseValue(range[1], field);
143
+ if (from === null || to === null || to < from)
144
+ return null;
145
+ return { kind: "range", from, to };
146
+ }
147
+ function parseField(text, field) {
148
+ const tokens = text.split(",");
149
+ const terms = [];
150
+ for (const token of tokens) {
151
+ const term = parseTerm(token.trim(), field);
152
+ if (!term)
153
+ return null;
154
+ terms.push(term);
155
+ }
156
+ return terms.length > 0 ? terms : null;
157
+ }
158
+ /**
159
+ * Parses a cron expression, expanding any supported `@`-shorthand first.
160
+ * Returns `null` when the input is not a valid supported expression.
161
+ */
162
+ export function parseCron(expression) {
163
+ const trimmed = expression.trim();
164
+ if (!trimmed)
165
+ return null;
166
+ const expanded = CRON_ALIASES[trimmed.toLowerCase()] ?? trimmed;
167
+ const parts = expanded.split(/\s+/);
168
+ if (parts.length !== CRON_FIELD_NAMES.length)
169
+ return null;
170
+ const fields = {};
171
+ for (const [index, name] of CRON_FIELD_NAMES.entries()) {
172
+ const parsed = parseField(parts[index], name);
173
+ if (!parsed)
174
+ return null;
175
+ fields[name] = parsed;
176
+ }
177
+ return fields;
178
+ }
179
+ function formatTerm(term, field) {
180
+ if (term.kind === "all")
181
+ return "*";
182
+ if (term.kind === "value")
183
+ return String(term.value);
184
+ if (term.kind === "range")
185
+ return `${term.from}-${term.to}`;
186
+ const [min, max] = CRON_FIELD_BOUNDS[field];
187
+ const end = term.to ?? max;
188
+ if (term.from === min && end === max)
189
+ return `*/${term.step}`;
190
+ return `${term.from}-${end}/${term.step}`;
191
+ }
192
+ /** Serializes an expression canonically: numeric values, `*` for unconstrained fields. */
193
+ export function formatCron(expression) {
194
+ return CRON_FIELD_NAMES.map((name) => expression[name].map((term) => formatTerm(term, name)).join(",")).join(" ");
195
+ }
196
+ /** Builds a field from an explicit list of values, or `[{ kind: "all" }]` when empty. */
197
+ export function fieldFromValues(values) {
198
+ const unique = [...new Set(values)].sort((a, b) => a - b);
199
+ if (unique.length === 0)
200
+ return [{ kind: "all" }];
201
+ return unique.map((value) => ({ kind: "value", value }));
202
+ }
203
+ /** Every value a field matches, ascending and de-duplicated. */
204
+ export function expandField(field, name) {
205
+ const [min, max] = CRON_FIELD_BOUNDS[name];
206
+ const values = new Set();
207
+ for (const term of field) {
208
+ if (term.kind === "all") {
209
+ for (let value = min; value <= max; value += 1)
210
+ values.add(value);
211
+ }
212
+ else if (term.kind === "value") {
213
+ values.add(term.value);
214
+ }
215
+ else if (term.kind === "range") {
216
+ for (let value = term.from; value <= term.to; value += 1)
217
+ values.add(value);
218
+ }
219
+ else {
220
+ const end = term.to ?? max;
221
+ for (let value = term.from; value <= end; value += term.step)
222
+ values.add(value);
223
+ }
224
+ }
225
+ return [...values].sort((a, b) => a - b);
226
+ }
227
+ /** Whether a field is unconstrained (`*`, possibly among redundant terms). */
228
+ export function isEveryValue(field) {
229
+ return field.some((term) => term.kind === "all");
230
+ }
231
+ function singleValue(field) {
232
+ if (field.length !== 1)
233
+ return null;
234
+ const term = field[0];
235
+ return term.kind === "value" ? term.value : null;
236
+ }
237
+ function wholeFieldStep(field, name) {
238
+ if (field.length !== 1)
239
+ return null;
240
+ const term = field[0];
241
+ if (term.kind !== "step" || term.to !== null)
242
+ return null;
243
+ return term.from === CRON_FIELD_BOUNDS[name][0] ? term.step : null;
244
+ }
245
+ /**
246
+ * Whether a checkbox grid can represent the field, i.e. it selects a finite
247
+ * set of values. Ranges and steps qualify — the grid shows them checked and
248
+ * re-serializes them as a plain list once the user edits the selection.
249
+ */
250
+ function isSelectableSet(field) {
251
+ return !isEveryValue(field);
252
+ }
253
+ /**
254
+ * The preset form mode whose controls can reproduce `expression` exactly,
255
+ * or `"advanced"` when only the per-field editor can.
256
+ */
257
+ export function detectFrequency(expression) {
258
+ const { minute, hour, dayOfMonth, month, dayOfWeek } = expression;
259
+ const everyDayOfMonth = isEveryValue(dayOfMonth);
260
+ const everyMonth = isEveryValue(month);
261
+ const everyDayOfWeek = isEveryValue(dayOfWeek);
262
+ if (everyDayOfMonth && everyMonth && everyDayOfWeek) {
263
+ if (isEveryValue(hour)) {
264
+ if (isEveryValue(minute) || wholeFieldStep(minute, "minute") !== null)
265
+ return "minute";
266
+ if (singleValue(minute) !== null)
267
+ return "hourly";
268
+ return "advanced";
269
+ }
270
+ if (singleValue(minute) === null)
271
+ return "advanced";
272
+ if (wholeFieldStep(hour, "hour") !== null)
273
+ return "hourly";
274
+ if (singleValue(hour) !== null)
275
+ return "daily";
276
+ return "advanced";
277
+ }
278
+ if (singleValue(minute) === null || singleValue(hour) === null)
279
+ return "advanced";
280
+ if (everyDayOfMonth && everyMonth && isSelectableSet(dayOfWeek))
281
+ return "weekly";
282
+ if (everyDayOfWeek && isSelectableSet(dayOfMonth)) {
283
+ if (everyMonth)
284
+ return "monthly";
285
+ if (isSelectableSet(month))
286
+ return "yearly";
287
+ }
288
+ return "advanced";
289
+ }
290
+ function pad(value) {
291
+ return String(value).padStart(2, "0");
292
+ }
293
+ /** `"09:05"` for hour 9, minute 5. */
294
+ function formatTime(hour, minute) {
295
+ return `${pad(hour)}:${pad(minute)}`;
296
+ }
297
+ /** `"a, b and c"`. */
298
+ function joinList(parts) {
299
+ if (parts.length <= 1)
300
+ return parts[0] ?? "";
301
+ return `${parts.slice(0, -1).join(", ")} and ${parts.at(-1)}`;
302
+ }
303
+ function describeWeekdays(field) {
304
+ const days = expandField(field, "dayOfWeek");
305
+ if (days.length === 1)
306
+ return WEEKDAY_NAMES[days[0]];
307
+ return joinList(days.map((day) => WEEKDAY_ABBREVIATIONS[day]));
308
+ }
309
+ function describeMonthDays(field) {
310
+ const days = expandField(field, "dayOfMonth");
311
+ return joinList(days.map((day) => String(day)));
312
+ }
313
+ function describeMonths(field) {
314
+ const months = expandField(field, "month");
315
+ if (months.length === 1)
316
+ return MONTH_NAMES[months[0] - 1];
317
+ return joinList(months.map((month) => MONTH_ABBREVIATIONS[month - 1]));
318
+ }
319
+ function describeFieldTerms(field, name) {
320
+ const label = name === "month" ? "month" : name === "dayOfMonth" ? "day" : name;
321
+ const readable = (value) => {
322
+ if (name === "month")
323
+ return MONTH_ABBREVIATIONS[value - 1];
324
+ if (name === "dayOfWeek")
325
+ return WEEKDAY_ABBREVIATIONS[value];
326
+ return String(value);
327
+ };
328
+ const parts = field.map((term) => {
329
+ if (term.kind === "all")
330
+ return `every ${label}`;
331
+ if (term.kind === "value")
332
+ return readable(term.value);
333
+ if (term.kind === "range")
334
+ return `${readable(term.from)}–${readable(term.to)}`;
335
+ const [min, max] = CRON_FIELD_BOUNDS[name];
336
+ const end = term.to ?? max;
337
+ if (term.from === min && end === max)
338
+ return `every ${term.step}`;
339
+ return `every ${term.step} from ${readable(term.from)} to ${readable(end)}`;
340
+ });
341
+ return joinList(parts);
342
+ }
343
+ function describeDayScope(expression) {
344
+ const { dayOfMonth, month, dayOfWeek } = expression;
345
+ const everyDayOfMonth = isEveryValue(dayOfMonth);
346
+ const everyMonth = isEveryValue(month);
347
+ const everyDayOfWeek = isEveryValue(dayOfWeek);
348
+ if (everyDayOfMonth && everyMonth && everyDayOfWeek)
349
+ return "every day";
350
+ const parts = [];
351
+ if (!everyDayOfMonth) {
352
+ parts.push(everyMonth
353
+ ? `on day ${describeMonthDays(dayOfMonth)} of every month`
354
+ : `on ${describeMonthDays(dayOfMonth)} ${describeMonths(month)}`);
355
+ }
356
+ else if (!everyMonth) {
357
+ parts.push(`every day in ${describeMonths(month)}`);
358
+ }
359
+ // cron ORs day-of-month and day-of-week whenever both are restricted.
360
+ if (!everyDayOfWeek)
361
+ parts.push(`every ${describeWeekdays(dayOfWeek)}`);
362
+ return parts.join(parts.length > 1 ? " or " : "");
363
+ }
364
+ function describeAdvanced(expression) {
365
+ const parts = CRON_FIELD_NAMES.filter((name) => !isEveryValue(expression[name])).map((name) => `${CRON_FIELD_LABELS[name].toLowerCase()} ${describeFieldTerms(expression[name], name)}`);
366
+ return parts.length === 0 ? "Every minute" : `Custom: ${joinList(parts)}`;
367
+ }
368
+ /**
369
+ * A compact English description of an expression, e.g. `"Every hour"`,
370
+ * `"10:17 every Monday"`, `"09:00 on day 1 of every month"`. Returns the raw
371
+ * input unchanged when it cannot be parsed.
372
+ */
373
+ export function describeCron(expression) {
374
+ const parsed = typeof expression === "string" ? parseCron(expression) : expression;
375
+ if (!parsed)
376
+ return typeof expression === "string" ? expression.trim() : "";
377
+ const { minute, hour } = parsed;
378
+ const scope = describeDayScope(parsed);
379
+ const everyDay = scope === "every day";
380
+ const suffix = everyDay ? "" : ` ${scope}`;
381
+ if (isEveryValue(hour)) {
382
+ if (isEveryValue(minute))
383
+ return everyDay ? "Every minute" : `Every minute${suffix}`;
384
+ const minuteStep = wholeFieldStep(minute, "minute");
385
+ if (minuteStep !== null)
386
+ return `Every ${minuteStep} minutes${suffix}`;
387
+ const minuteValue = singleValue(minute);
388
+ if (minuteValue !== null) {
389
+ return minuteValue === 0
390
+ ? `Every hour${suffix}`
391
+ : `Every hour at :${pad(minuteValue)}${suffix}`;
392
+ }
393
+ return describeAdvanced(parsed);
394
+ }
395
+ const minuteValue = singleValue(minute);
396
+ if (minuteValue === null)
397
+ return describeAdvanced(parsed);
398
+ const hourStep = wholeFieldStep(hour, "hour");
399
+ if (hourStep !== null) {
400
+ const at = minuteValue === 0 ? "" : ` at :${pad(minuteValue)}`;
401
+ return `Every ${hourStep} hours${at}${suffix}`;
402
+ }
403
+ const hourValue = singleValue(hour);
404
+ if (hourValue === null)
405
+ return describeAdvanced(parsed);
406
+ const time = formatTime(hourValue, minuteValue);
407
+ return everyDay ? `${time} every day` : `${time} ${scope}`;
408
+ }
409
+ //# sourceMappingURL=cron.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cron.js","sourceRoot":"","sources":["../../src/utils/cron.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA+BH,sDAAsD;AACtD,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,QAAQ;IACR,MAAM;IACN,YAAY;IACZ,OAAO;IACP,WAAW;CACH,CAAC;AAKX,+DAA+D;AAC/D,MAAM,CAAC,MAAM,iBAAiB,GAA4C;IACxE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;IACf,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;IACb,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;IACnB,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;IACd,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;CAClB,CAAC;AAEF,iDAAiD;AACjD,MAAM,CAAC,MAAM,iBAAiB,GAAkC;IAC9D,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,cAAc;IAC1B,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,aAAa;CACzB,CAAC;AAEF,yEAAyE;AACzE,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,WAAW;IACX,UAAU;IACV,QAAQ;IACR,UAAU;CACX,CAAC;AAEF,0EAA0E;AAC1E,MAAM,CAAC,MAAM,qB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AgB,CAAC,MAAM,CAAC,CAAC;IAE1D,MAAM,QAAQ,GAAG,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC9C,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,MAAM,EAAE,GAAG,WAAW,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;QAC/D,OAAO,SAAS,QAAQ,SAAS,EAAE,GAAG,MAAM,EAAE,CAAC;IACjD,CAAC;IAED,MAAM,SAAS,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,SAAS,KAAK,IAAI;QAAE,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAExD,MAAM,IAAI,GAAG,UAAU,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAChD,OAAO,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,KAAK,EAAE,CAAC;AAC7D,CAAC","sourcesContent":["/**\n * Pure helpers for standard 5-field POSIX/Vixie cron expressions\n * (`minute hour day-of-month month day-of-week`).\n *\n * Supported syntax: `*`, single values, lists (`,`), ranges (`-`), steps\n * (`/`), three-letter month/weekday names, `7` as an alias for Sunday, and the\n * `@yearly`/`@annually`/`@monthly`/`@weekly`/`@daily`/`@midnight`/`@hourly`\n * shorthands. `?` is tolerated on the day fields (read as `*`) for\n * Quartz-flavoured input but is never emitted. `@reboot` and the Quartz-only\n * `L`/`W`/`#` characters are deliberately unsupported — they have no\n * representation in the five numeric fields.\n */\n\n/** A single term within one cron field. */\nexport type CronTerm =\n | { kind: \"all\" }\n | { kind: \"value\"; value: number }\n | { kind: \"range\"; from: number; to: number }\n | { kind: \"step\"; from: number; to: number | null; step: number };\n\n/** One cron field: a non-empty, comma-joined list of terms. */\nexport type CronField = CronTerm[];\n\n/** A parsed cron expression's five fields. */\nexport interface CronExpression {\n minute: CronField;\n hour: CronField;\n dayOfMonth: CronField;\n month: CronField;\n dayOfWeek: CronField;\n}\n\n/** The preset form mode whose controls can round-trip an expression. */\nexport type CronFrequency =\n | \"minute\"\n | \"hourly\"\n | \"daily\"\n | \"weekly\"\n | \"monthly\"\n | \"yearly\"\n | \"advanced\";\n\n/** The five cron field names, in expression order. */\nexport const CRON_FIELD_NAMES = [\n \"minute\",\n \"hour\",\n \"dayOfMonth\",\n \"month\",\n \"dayOfWeek\",\n] as const;\n\n/** One of the five cron field names. */\nexport type CronFieldName = (typeof CRON_FIELD_NAMES)[number];\n\n/** Inclusive `[min, max]` value bounds for each cron field. */\nexport const CRON_FIELD_BOUNDS: Record<CronFieldName, [number, number]> = {\n minute: [0, 59],\n hour: [0, 23],\n dayOfMonth: [1, 31],\n month: [1, 12],\n dayOfWeek: [0, 6],\n};\n\n/** Human-readable labels for each cron field. */\nexport const CRON_FIELD_LABELS: Record<CronFieldName, string> = {\n minute: \"Minute\",\n hour: \"Hour\",\n dayOfMonth: \"Day of month\",\n month: \"Month\",\n dayOfWeek: \"Day of week\",\n};\n\n/** Full weekday names indexed by cron day-of-week value (0 = Sunday). */\nexport const WEEKDAY_NAMES = [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n];\n\n/** Three-letter weekday abbreviations indexed by cron value (0 = Sun). */\nexport const WEEKDAY_ABBREVIATIONS = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\n\n/** Full month names indexed from 0, so month `n` is `MONTH_NAMES[n - 1]`. */\nexport const MONTH_NAMES = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\n/** Three-letter month abbreviations indexed from 0 (`Jan` is month 1). */\nexport const MONTH_ABBREVIATIONS = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\n/** Supported `@`-shorthands mapped to their five-field equivalents. */\nexport const CRON_ALIASES: Record<string, string> = {\n \"@yearly\": \"0 0 1 1 *\",\n \"@annually\": \"0 0 1 1 *\",\n \"@monthly\": \"0 0 1 * *\",\n \"@weekly\": \"0 0 * * 0\",\n \"@daily\": \"0 0 * * *\",\n \"@midnight\": \"0 0 * * *\",\n \"@hourly\": \"0 * * * *\",\n};\n\nconst NAME_LOOKUPS: Partial<Record<CronFieldName, Record<string, number>>> = {\n month: Object.fromEntries(\n MONTH_ABBREVIATIONS.map((name, index) => [name.toLowerCase(), index + 1]),\n ),\n dayOfWeek: Object.fromEntries(\n WEEKDAY_ABBREVIATIONS.map((name, index) => [name.toLowerCase(), index]),\n ),\n};\n\nfunction parseValue(token: string, field: CronFieldName): number | null {\n const named = NAME_LOOKUPS[field]?.[token.toLowerCase()];\n if (named !== undefined) return named;\n if (!/^\\d+$/.test(token)) return null;\n\n const value = Number(token);\n const [min, max] = CRON_FIELD_BOUNDS[field];\n // Vixie cron accepts 7 as a second spelling of Sunday.\n if (field === \"dayOfWeek\" && value === 7) return 0;\n return value >= min && value <= max ? value : null;\n}\n\nfunction parseTerm(token: string, field: CronFieldName): CronTerm | null {\n const [base, stepToken, ...rest] = token.split(\"/\");\n if (rest.length > 0 || base === undefined || base === \"\") return null;\n\n if (stepToken !== undefined) {\n if (!/^\\d+$/.test(stepToken)) return null;\n const step = Number(stepToken);\n if (step < 1) return null;\n\n const [min, max] = CRON_FIELD_BOUNDS[field];\n if (base === \"*\" || base === \"?\") return { kind: \"step\", from: min, to: null, step };\n\n const range = base.split(\"-\");\n if (range.length === 1) {\n const from = parseValue(range[0]!, field);\n return from === null ? null : { kind: \"step\", from, to: null, step };\n }\n if (range.length !== 2) return null;\n const from = parseValue(range[0]!, field);\n const to = parseValue(range[1]!, field);\n if (from === null || to === null || to < from || to > max) return null;\n return { kind: \"step\", from, to, step };\n }\n\n if (base === \"*\" || base === \"?\") return { kind: \"all\" };\n\n const range = base.split(\"-\");\n if (range.length === 1) {\n const value = parseValue(range[0]!, field);\n return value === null ? null : { kind: \"value\", value };\n }\n if (range.length !== 2) return null;\n const from = parseValue(range[0]!, field);\n const to = parseValue(range[1]!, field);\n if (from === null || to === null || to < from) return null;\n return { kind: \"range\", from, to };\n}\n\nfunction parseField(text: string, field: CronFieldName): CronField | null {\n const tokens = text.split(\",\");\n const terms: CronField = [];\n for (const token of tokens) {\n const term = parseTerm(token.trim(), field);\n if (!term) return null;\n terms.push(term);\n }\n return terms.length > 0 ? terms : null;\n}\n\n/**\n * Parses a cron expression, expanding any supported `@`-shorthand first.\n * Returns `null` when the input is not a valid supported expression.\n */\nexport function parseCron(expression: string): CronExpression | null {\n const trimmed = expression.trim();\n if (!trimmed) return null;\n\n const expanded = CRON_ALIASES[trimmed.toLowerCase()] ?? trimmed;\n const parts = expanded.split(/\\s+/);\n if (parts.length !== CRON_FIELD_NAMES.length) return null;\n\n const fields = {} as CronExpression;\n for (const [index, name] of CRON_FIELD_NAMES.entries()) {\n const parsed = parseField(parts[index]!, name);\n if (!parsed) return null;\n fields[name] = parsed;\n }\n return fields;\n}\n\nfunction formatTerm(term: CronTerm, field: CronFieldName): string {\n if (term.kind === \"all\") return \"*\";\n if (term.kind === \"value\") return String(term.value);\n if (term.kind === \"range\") return `${term.from}-${term.to}`;\n\n const [min, max] = CRON_FIELD_BOUNDS[field];\n const end = term.to ?? max;\n if (term.from === min && end === max) return `*/${term.step}`;\n return `${term.from}-${end}/${term.step}`;\n}\n\n/** Serializes an expression canonically: numeric values, `*` for unconstrained fields. */\nexport function formatCron(expression: CronExpression): string {\n return CRON_FIELD_NAMES.map((name) =>\n expression[name].map((term) => formatTerm(term, name)).join(\",\"),\n ).join(\" \");\n}\n\n/** Builds a field from an explicit list of values, or `[{ kind: \"all\" }]` when empty. */\nexport function fieldFromValues(values: number[]): CronField {\n const unique = [...new Set(values)].sort((a, b) => a - b);\n if (unique.length === 0) return [{ kind: \"all\" }];\n return unique.map((value) => ({ kind: \"value\", value }) as CronTerm);\n}\n\n/** Every value a field matches, ascending and de-duplicated. */\nexport function expandField(field: CronField, name: CronFieldName): number[] {\n const [min, max] = CRON_FIELD_BOUNDS[name];\n const values = new Set<number>();\n for (const term of field) {\n if (term.kind === \"all\") {\n for (let value = min; value <= max; value += 1) values.add(value);\n } else if (term.kind === \"value\") {\n values.add(term.value);\n } else if (term.kind === \"range\") {\n for (let value = term.from; value <= term.to; value += 1) values.add(value);\n } else {\n const end = term.to ?? max;\n for (let value = term.from; value <= end; value += term.step) values.add(value);\n }\n }\n return [...values].sort((a, b) => a - b);\n}\n\n/** Whether a field is unconstrained (`*`, possibly among redundant terms). */\nexport function isEveryValue(field: CronField): boolean {\n return field.some((term) => term.kind === \"all\");\n}\n\nfunction singleValue(field: CronField): number | null {\n if (field.length !== 1) return null;\n const term = field[0]!;\n return term.kind === \"value\" ? term.value : null;\n}\n\nfunction wholeFieldStep(field: CronField, name: CronFieldName): number | null {\n if (field.length !== 1) return null;\n const term = field[0]!;\n if (term.kind !== \"step\" || term.to !== null) return null;\n return term.from === CRON_FIELD_BOUNDS[name][0] ? term.step : null;\n}\n\n/**\n * Whether a checkbox grid can represent the field, i.e. it selects a finite\n * set of values. Ranges and steps qualify — the grid shows them checked and\n * re-serializes them as a plain list once the user edits the selection.\n */\nfunction isSelectableSet(field: CronField): boolean {\n return !isEveryValue(field);\n}\n\n/**\n * The preset form mode whose controls can reproduce `expression` exactly,\n * or `\"advanced\"` when only the per-field editor can.\n */\nexport function detectFrequency(expression: CronExpression): CronFrequency {\n const { minute, hour, dayOfMonth, month, dayOfWeek } = expression;\n const everyDayOfMonth = isEveryValue(dayOfMonth);\n const everyMonth = isEveryValue(month);\n const everyDayOfWeek = isEveryValue(dayOfWeek);\n\n if (everyDayOfMonth && everyMonth && everyDayOfWeek) {\n if (isEveryValue(hour)) {\n if (isEveryValue(minute) || wholeFieldStep(minute, \"minute\") !== null) return \"minute\";\n if (singleValue(minute) !== null) return \"hourly\";\n return \"advanced\";\n }\n if (singleValue(minute) === null) return \"advanced\";\n if (wholeFieldStep(hour, \"hour\") !== null) return \"hourly\";\n if (singleValue(hour) !== null) return \"daily\";\n return \"advanced\";\n }\n\n if (singleValue(minute) === null || singleValue(hour) === null) return \"advanced\";\n\n if (everyDayOfMonth && everyMonth && isSelectableSet(dayOfWeek)) return \"weekly\";\n if (everyDayOfWeek && isSelectableSet(dayOfMonth)) {\n if (everyMonth) return \"monthly\";\n if (isSelectableSet(month)) return \"yearly\";\n }\n return \"advanced\";\n}\n\nfunction pad(value: number): string {\n return String(value).padStart(2, \"0\");\n}\n\n/** `\"09:05\"` for hour 9, minute 5. */\nfunction formatTime(hour: number, minute: number): string {\n return `${pad(hour)}:${pad(minute)}`;\n}\n\n/** `\"a, b and c\"`. */\nfunction joinList(parts: string[]): string {\n if (parts.length <= 1) return parts[0] ?? \"\";\n return `${parts.slice(0, -1).join(\", \")} and ${parts.at(-1)}`;\n}\n\nfunction describeWeekdays(field: CronField): string {\n const days = expandField(field, \"dayOfWeek\");\n if (days.length === 1) return WEEKDAY_NAMES[days[0]!]!;\n return joinList(days.map((day) => WEEKDAY_ABBREVIATIONS[day]!));\n}\n\nfunction describeMonthDays(field: CronField): string {\n const days = expandField(field, \"dayOfMonth\");\n return joinList(days.map((day) => String(day)));\n}\n\nfunction describeMonths(field: CronField): string {\n const months = expandField(field, \"month\");\n if (months.length === 1) return MONTH_NAMES[months[0]! - 1]!;\n return joinList(months.map((month) => MONTH_ABBREVIATIONS[month - 1]!));\n}\n\nfunction describeFieldTerms(field: CronField, name: CronFieldName): string {\n const label = name === \"month\" ? \"month\" : name === \"dayOfMonth\" ? \"day\" : name;\n const readable = (value: number): string => {\n if (name === \"month\") return MONTH_ABBREVIATIONS[value - 1]!;\n if (name === \"dayOfWeek\") return WEEKDAY_ABBREVIATIONS[value]!;\n return String(value);\n };\n const parts = field.map((term) => {\n if (term.kind === \"all\") return `every ${label}`;\n if (term.kind === \"value\") return readable(term.value);\n if (term.kind === \"range\") return `${readable(term.from)}–${readable(term.to)}`;\n const [min, max] = CRON_FIELD_BOUNDS[name];\n const end = term.to ?? max;\n if (term.from === min && end === max) return `every ${term.step}`;\n return `every ${term.step} from ${readable(term.from)} to ${readable(end)}`;\n });\n return joinList(parts);\n}\n\nfunction describeDayScope(expression: CronExpression): string {\n const { dayOfMonth, month, dayOfWeek } = expression;\n const everyDayOfMonth = isEveryValue(dayOfMonth);\n const everyMonth = isEveryValue(month);\n const everyDayOfWeek = isEveryValue(dayOfWeek);\n\n if (everyDayOfMonth && everyMonth && everyDayOfWeek) return \"every day\";\n\n const parts: string[] = [];\n if (!everyDayOfMonth) {\n parts.push(\n everyMonth\n ? `on day ${describeMonthDays(dayOfMonth)} of every month`\n : `on ${describeMonthDays(dayOfMonth)} ${describeMonths(month)}`,\n );\n } else if (!everyMonth) {\n parts.push(`every day in ${describeMonths(month)}`);\n }\n // cron ORs day-of-month and day-of-week whenever both are restricted.\n if (!everyDayOfWeek) parts.push(`every ${describeWeekdays(dayOfWeek)}`);\n return parts.join(parts.length > 1 ? \" or \" : \"\");\n}\n\nfunction describeAdvanced(expression: CronExpression): string {\n const parts = CRON_FIELD_NAMES.filter((name) => !isEveryValue(expression[name])).map(\n (name) => `${CRON_FIELD_LABELS[name].toLowerCase()} ${describeFieldTerms(expression[name], name)}`,\n );\n return parts.length === 0 ? \"Every minute\" : `Custom: ${joinList(parts)}`;\n}\n\n/**\n * A compact English description of an expression, e.g. `\"Every hour\"`,\n * `\"10:17 every Monday\"`, `\"09:00 on day 1 of every month\"`. Returns the raw\n * input unchanged when it cannot be parsed.\n */\nexport function describeCron(expression: string | CronExpression): string {\n const parsed = typeof expression === \"string\" ? parseCron(expression) : expression;\n if (!parsed) return typeof expression === \"string\" ? expression.trim() : \"\";\n\n const { minute, hour } = parsed;\n const scope = describeDayScope(parsed);\n const everyDay = scope === \"every day\";\n const suffix = everyDay ? \"\" : ` ${scope}`;\n\n if (isEveryValue(hour)) {\n if (isEveryValue(minute)) return everyDay ? \"Every minute\" : `Every minute${suffix}`;\n const minuteStep = wholeFieldStep(minute, \"minute\");\n if (minuteStep !== null) return `Every ${minuteStep} minutes${suffix}`;\n const minuteValue = singleValue(minute);\n if (minuteValue !== null) {\n return minuteValue === 0\n ? `Every hour${suffix}`\n : `Every hour at :${pad(minuteValue)}${suffix}`;\n }\n return describeAdvanced(parsed);\n }\n\n const minuteValue = singleValue(minute);\n if (minuteValue === null) return describeAdvanced(parsed);\n\n const hourStep = wholeFieldStep(hour, \"hour\");\n if (hourStep !== null) {\n const at = minuteValue === 0 ? \"\" : ` at :${pad(minuteValue)}`;\n return `Every ${hourStep} hours${at}${suffix}`;\n }\n\n const hourValue = singleValue(hour);\n if (hourValue === null) return describeAdvanced(parsed);\n\n const time = formatTime(hourValue, minuteValue);\n return everyDay ? `${time} every day` : `${time} ${scope}`;\n}\n"]}
@@ -36,7 +36,7 @@ import "@f-ewald/components/calendar-day.js";
36
36
  | Property | Attribute | Type | Default | Description |
37
37
  | --- | --- | --- | --- | --- |
38
38
  | `date` | `date` | `string` | `—` | The day shown, `"YYYY-MM-DD"`. |
39
- | `timeMarker` | `time-marker` | `boolean` | `false` | Shows a fine live line marking the current time, Google-Calendar-style. Only rendered when `date` is today. |
39
+ | `timeMarker` | `time-marker` | `boolean` | `false` | Shows a fine live line marking the current time, with a rounded pill in the hour gutter reading the current clock time. The hour label the pill covers is hidden while it does. Only rendered when `date` is today. |
40
40
  | `minWidth` | `min-width` | `string` | `""` | Minimum width for the day column, as a CSS length (e.g. `"18rem"`). Unset leaves the host's width fully controlled by its container — useful as the sizing floor when placing several `calendar-day` elements in a scrollable row. |
41
41
 
42
42
  ## Events
@@ -67,6 +67,7 @@ _None._
67
67
  | `--ui-hover-overlay` |
68
68
  | `--ui-info` |
69
69
  | `--ui-line-height-tight` |
70
+ | `--ui-on-accent` |
70
71
  | `--ui-primary` |
71
72
  | `--ui-radius-sm` |
72
73
  | `--ui-success` |
@@ -0,0 +1,40 @@
1
+ # `<countdown-timer>`
2
+
3
+ Per-second ticking count-down timer, e.g. a live "Retrying in 3 seconds"
4
+ indicator while waiting to retry a failed request. Renders nothing while
5
+ `until` is unset or unparseable. Remaining time is clamped to zero — it
6
+ never goes negative once the target instant has passed.
7
+
8
+ ## Install
9
+
10
+ ```js
11
+ import "@f-ewald/components/countdown-timer.js";
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ ```html
17
+ <countdown-timer until="2026-07-19T12:00:10Z" prefix="Retrying in "></countdown-timer>
18
+ <countdown-timer until="2026-07-19T12:00:10Z" format="compact" prefix="retrying in "></countdown-timer>
19
+ ```
20
+
21
+ ## Attributes / properties
22
+
23
+ | Property | Attribute | Type | Default | Description |
24
+ | --- | --- | --- | --- | --- |
25
+ | `until` | `until` | `string | null` | `null` | ISO-8601 target instant; remaining time is measured until here. |
26
+ | `format` | `format` | `DurationFormat` | `"seconds"` | `"seconds"` -> "1 second", "12 seconds"; `"compact"` -> "12s", "3m 12s", "1h 03m 12s". |
27
+ | `prefix` | `prefix` | `string` | `""` | Text rendered before the formatted value. |
28
+ | `suffix` | `suffix` | `string` | `""` | Text rendered after the formatted value. |
29
+
30
+ ## Events
31
+
32
+ _None._
33
+
34
+ ## Slots
35
+
36
+ _None._
37
+
38
+ ## CSS custom properties
39
+
40
+ _None._
@@ -0,0 +1,82 @@
1
+ # `<cron-schedule>`
2
+
3
+ Repeat-schedule picker that reads and writes a standard 5-field cron
4
+ expression. The collapsed trigger shows a compact English description of
5
+ the current schedule ("Every hour", "10:17 every Monday"); clicking it
6
+ opens an anchored panel with the schedule form.
7
+
8
+ The panel offers frequency presets (every N minutes, hourly, daily, weekly,
9
+ monthly, yearly) plus an `Advanced` mode that edits each cron field as a
10
+ list of terms, so any valid expression — including compound fields that mix
11
+ ranges, steps, and single values — is reachable. Edits apply immediately:
12
+ each change updates `value` and fires `change`; closing the panel only
13
+ dismisses it.
14
+
15
+ An unparseable `value` (e.g. `@reboot`, which has no five-field form) is
16
+ preserved verbatim and shown as-is on the trigger; the panel then starts
17
+ from the default hourly schedule.
18
+
19
+ The host is `display: block` with a full-width trigger, matching the other
20
+ value-entry fields. To shrink an instance to its content, constrain the
21
+ host: `cron-schedule { display: inline-block; }`.
22
+
23
+ ## Install
24
+
25
+ ```js
26
+ import "@f-ewald/components/cron-schedule.js";
27
+ ```
28
+
29
+ ## Usage
30
+
31
+ ```html
32
+ <cron-schedule label="Backup schedule" value="0 * * * *"></cron-schedule>
33
+
34
+ <script type="module">
35
+ const schedule = document.querySelector("cron-schedule");
36
+ schedule.addEventListener("change", (e) => {
37
+ console.log(e.detail.value, schedule.description);
38
+ });
39
+ </script>
40
+ ```
41
+
42
+ ## Attributes / properties
43
+
44
+ | Property | Attribute | Type | Default | Description |
45
+ | --- | --- | --- | --- | --- |
46
+ | `value` | `value` | `string` | `"0 * * * *"` | The cron expression, e.g. `"0 * * * *"`. |
47
+ | `label` | `label` | `string` | `""` | Accessible label for the trigger. |
48
+ | `disabled` | `disabled` | `boolean` | `false` | Whether the picker is disabled. |
49
+ | `open` | `open` | `boolean` | `false` | Whether the schedule panel is open. |
50
+ | `description` | _(JS property only)_ | `string` | `—` | The compact English description of the current expression. _(read-only)_ |
51
+
52
+ ## Events
53
+
54
+ | Event | Description |
55
+ | --- | --- |
56
+ | `change` | Fired with `{ value: string }` whenever the expression changes. |
57
+
58
+ ## Slots
59
+
60
+ _None._
61
+
62
+ ## CSS custom properties
63
+
64
+ | Custom property |
65
+ | --- |
66
+ | `--ui-border` |
67
+ | `--ui-focus-ring` |
68
+ | `--ui-font` |
69
+ | `--ui-font-mono` |
70
+ | `--ui-font-size-sm` |
71
+ | `--ui-font-size-xs` |
72
+ | `--ui-font-weight-medium` |
73
+ | `--ui-line-height-tight` |
74
+ | `--ui-primary` |
75
+ | `--ui-radius` |
76
+ | `--ui-radius-sm` |
77
+ | `--ui-shadow-lg` |
78
+ | `--ui-surface` |
79
+ | `--ui-surface-muted` |
80
+ | `--ui-text` |
81
+ | `--ui-text-muted` |
82
+ | `--ui-tracking-wide` |
@@ -114,6 +114,9 @@ literal values are migrated onto them.
114
114
  row-driven height. Unsupported controls keep the normal external label.
115
115
  - Icons are `14px` inline (next to text) and `18px` standalone; icon-only tap
116
116
  targets are `32px`.
117
+ - Icons come from the generated Heroicons catalog (`icons.js`; `docs/icons.md`);
118
+ add new names through `scripts/generate-icons.mjs` and `npm run icons`, not
119
+ ad hoc inline SVGs.
117
120
  - Control corners use `--ui-radius-sm` (4px); enclosing surfaces use
118
121
  `--ui-radius` (8px).
119
122
  - Side panels use a `20rem` compact / `25rem` comfortable width; the shared