@aurodesignsystem-dev/auro-formkit 0.0.0-pr1489.5 → 0.0.0-pr1490.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 (64) hide show
  1. package/components/checkbox/demo/customize.min.js +249 -125
  2. package/components/checkbox/demo/getting-started.min.js +249 -125
  3. package/components/checkbox/demo/index.min.js +249 -125
  4. package/components/checkbox/demo/styles.min.css +1 -1
  5. package/components/checkbox/dist/index.js +249 -125
  6. package/components/checkbox/dist/registered.js +249 -125
  7. package/components/combobox/demo/customize.min.js +502 -254
  8. package/components/combobox/demo/getting-started.min.js +502 -254
  9. package/components/combobox/demo/index.min.js +502 -254
  10. package/components/combobox/demo/styles.min.css +1 -1
  11. package/components/combobox/dist/index.js +502 -254
  12. package/components/combobox/dist/registered.js +502 -254
  13. package/components/counter/demo/customize.min.js +250 -126
  14. package/components/counter/demo/index.min.js +250 -126
  15. package/components/counter/demo/styles.min.css +1 -1
  16. package/components/counter/dist/index.js +249 -125
  17. package/components/counter/dist/registered.js +249 -125
  18. package/components/datepicker/demo/accessibility.md +9 -6
  19. package/components/datepicker/demo/api.md +1 -1
  20. package/components/datepicker/demo/customize.min.js +1544 -527
  21. package/components/datepicker/demo/index.md +6 -4
  22. package/components/datepicker/demo/index.min.js +1560 -532
  23. package/components/datepicker/demo/keyboard-behavior.md +15 -15
  24. package/components/datepicker/demo/styles.min.css +1 -1
  25. package/components/datepicker/demo/voiceover.md +5 -3
  26. package/components/datepicker/demo/why-datepicker.md +2 -2
  27. package/components/datepicker/dist/index.js +1536 -519
  28. package/components/datepicker/dist/registered.js +1536 -519
  29. package/components/datepicker/dist/src/auro-calendar-cell.d.ts +50 -15
  30. package/components/datepicker/dist/src/auro-calendar-month.d.ts +9 -0
  31. package/components/datepicker/dist/src/auro-calendar.d.ts +161 -8
  32. package/components/datepicker/dist/src/auro-datepicker.d.ts +5 -7
  33. package/components/dropdown/demo/customize.min.js +1 -1
  34. package/components/dropdown/demo/getting-started.min.js +1 -1
  35. package/components/dropdown/demo/index.min.js +1 -1
  36. package/components/dropdown/demo/styles.min.css +1 -1
  37. package/components/dropdown/dist/index.js +1 -1
  38. package/components/dropdown/dist/registered.js +1 -1
  39. package/components/form/demo/customize.min.js +3263 -1378
  40. package/components/form/demo/getting-started.min.js +3263 -1378
  41. package/components/form/demo/index.min.js +3263 -1378
  42. package/components/form/demo/registerDemoDeps.min.js +3263 -1378
  43. package/components/form/demo/styles.min.css +1 -1
  44. package/components/input/demo/customize.min.js +249 -125
  45. package/components/input/demo/getting-started.min.js +249 -125
  46. package/components/input/demo/index.min.js +249 -125
  47. package/components/input/demo/styles.min.css +1 -1
  48. package/components/input/dist/index.js +249 -125
  49. package/components/input/dist/registered.js +249 -125
  50. package/components/menu/demo/styles.min.css +1 -1
  51. package/components/radio/demo/customize.min.js +249 -125
  52. package/components/radio/demo/getting-started.min.js +249 -125
  53. package/components/radio/demo/index.min.js +249 -125
  54. package/components/radio/demo/styles.min.css +1 -1
  55. package/components/radio/dist/index.js +249 -125
  56. package/components/radio/dist/registered.js +249 -125
  57. package/components/select/demo/customize.min.js +250 -126
  58. package/components/select/demo/getting-started.min.js +250 -126
  59. package/components/select/demo/index.min.js +250 -126
  60. package/components/select/demo/styles.min.css +1 -1
  61. package/components/select/dist/index.js +250 -126
  62. package/components/select/dist/registered.js +250 -126
  63. package/custom-elements.json +1818 -1491
  64. package/package.json +8 -8
@@ -183,109 +183,236 @@ var shapeSizeCss$1 = i$6`.shape-classic-xl,.shape-classic-lg,.shape-classic-md,.
183
183
 
184
184
  var tokensCss$3 = i$6`:host(:not([ondark])),:host(:not([appearance=inverse])){--ds-auro-select-border-color: var(--ds-basic-color-border-bold, #585e67);--ds-auro-select-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-select-label-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-select-placeholder-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-select-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-select-error-icon-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-select-outline-color: transparent}:host([ondark]),:host([appearance=inverse]){--ds-auro-select-border-color: var(--ds-basic-color-border-inverse, #ffffff);--ds-auro-select-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-select-label-text-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db);--ds-auro-select-placeholder-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-select-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-select-error-icon-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8);--ds-auro-select-outline-color: transparent}`;
185
185
 
186
- class DateFormatter {
186
+ /**
187
+ * @description Splits a date string into its parts according to the provided format. Does NOT validate that the result is a real calendar date — use `parseDate` when validation is required.
188
+ * @param {string} dateStr - Date string to parse.
189
+ * @param {string} format - Date format to parse.
190
+ * @returns {{ month?: string, day?: string, year?: string }|undefined}
191
+ */
192
+ function getDateParts(dateStr, format) {
193
+ if (!dateStr) {
194
+ return undefined;
195
+ }
187
196
 
188
- constructor() {
197
+ const formatSeparatorMatch = format.match(/[/.-]/);
198
+ let valueParts;
199
+ let formatParts;
189
200
 
190
- /**
191
- * @description Parses a date string into its components.
192
- * @param {string} dateStr - Date string to parse.
193
- * @param {string} format - Date format to parse.
194
- * @returns {Object<key["month" | "day" | "year"]: number>|undefined}
195
- */
196
- this.parseDate = (dateStr, format = 'mm/dd/yyyy') => {
201
+ if (formatSeparatorMatch) {
202
+ const separator = formatSeparatorMatch[0];
203
+ valueParts = dateStr.split(separator);
204
+ formatParts = format.split(separator);
205
+ } else {
206
+ if (dateStr.match(/[/.-]/)) {
207
+ throw new Error(
208
+ "AuroDatepickerUtilities | parseDate: Date string has no separators",
209
+ );
210
+ }
197
211
 
198
- // Guard Clause: Date string is defined
199
- if (!dateStr) {
200
- return undefined;
201
- }
212
+ if (dateStr.length !== format.length) {
213
+ throw new Error(
214
+ "AuroDatepickerUtilities | parseDate: Date string and format length do not match",
215
+ );
216
+ }
202
217
 
203
- // Assume the separator is a "/" a defined in our code base
204
- const separator = '/';
218
+ valueParts = [dateStr];
219
+ formatParts = [format];
220
+ }
205
221
 
206
- // Get the parts of the date and format
207
- const valueParts = dateStr.split(separator);
208
- const formatParts = format.split(separator);
222
+ if (valueParts.length !== formatParts.length) {
223
+ throw new Error(
224
+ `AuroDatepickerUtilities | parseDate: Date string and format do not match : ${dateStr} vs ${format}`,
225
+ );
226
+ }
209
227
 
210
- // Check if the value and format have the correct number of parts
211
- if (valueParts.length !== formatParts.length) {
212
- throw new Error('AuroDatepickerUtilities | parseDate: Date string and format length do not match');
213
- }
228
+ const result = formatParts.reduce((acc, part, index) => {
229
+ const value = valueParts[index];
214
230
 
215
- // Holds the result to be returned
216
- const result = formatParts.reduce((acc, part, index) => {
217
- const value = valueParts[index];
231
+ if (/m/iu.test(part) && part.length === value.length) {
232
+ acc.month = value;
233
+ } else if (/d/iu.test(part) && part.length === value.length) {
234
+ acc.day = value;
235
+ } else if (/y/iu.test(part) && part.length === value.length) {
236
+ acc.year = value;
237
+ }
218
238
 
219
- if ((/m/iu).test(part)) {
220
- acc.month = value;
221
- } else if ((/d/iu).test(part)) {
222
- acc.day = value;
223
- } else if ((/y/iu).test(part)) {
224
- acc.year = value;
225
- }
239
+ return acc;
240
+ }, {});
226
241
 
227
- return acc;
228
- }, {});
242
+ if (!result.month && !result.day && !result.year) {
243
+ throw new Error(
244
+ "AuroDatepickerUtilities | parseDate: Unable to parse date string",
245
+ );
246
+ }
229
247
 
230
- // If we found all the parts, return the result
231
- if (result.month && result.year) {
232
- return result;
233
- }
248
+ return result;
249
+ }
234
250
 
235
- // Throw an error to let the dev know we were unable to parse the date string
236
- throw new Error('AuroDatepickerUtilities | parseDate: Unable to parse date string');
237
- };
251
+ function isCalendarDate(year, month, day) {
252
+ let yearNumber = Number(year);
253
+ const monthNumber = Number(month);
254
+ const dayNumber = Number(day);
238
255
 
239
- /**
240
- * Convert a date object to string format.
241
- * @param {Object} date - Date to convert to string.
242
- * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
243
- * @returns {String} Returns the date as a string.
244
- */
245
- this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
246
- year: "numeric",
247
- month: "2-digit",
248
- day: "2-digit",
249
- });
256
+ if (
257
+ !Number.isInteger(yearNumber) ||
258
+ !Number.isInteger(monthNumber) ||
259
+ !Number.isInteger(dayNumber)
260
+ ) {
261
+ return false;
262
+ }
250
263
 
251
- /**
252
- * Converts a date string to a North American date format.
253
- * @param {String} dateStr - Date to validate.
254
- * @param {String} format - Date format to validate against.
255
- * @returns {Boolean}
256
- */
257
- this.toNorthAmericanFormat = (dateStr, format) => {
264
+ // Handle 2-digit years by converting them to 4-digit years based on a cutoff. This allows for parsing of 2-digit year formats while still validating the resulting date.
265
+ if (yearNumber < 100 && yearNumber >= 50) {
266
+ yearNumber += 1900;
267
+ } else if (yearNumber < 50) {
268
+ yearNumber += 2000;
269
+ }
258
270
 
259
- if (format === 'mm/dd/yyyy') {
260
- return dateStr;
261
- }
271
+ const stringified = `${String(yearNumber).padStart(4, "0")}-${String(monthNumber).padStart(2, "0")}-${String(dayNumber).padStart(2, "0")}`;
272
+ const date = new Date(stringified.replace(/[.-]/g, "/"));
262
273
 
263
- const parsedDate = this.parseDate(dateStr, format);
274
+ return (
275
+ !Number.isNaN(date.getTime()) && toISOFormatString(date) === stringified
276
+ );
277
+ }
264
278
 
265
- if (!parsedDate) {
266
- throw new Error('AuroDatepickerUtilities | toNorthAmericanFormat: Unable to parse date string');
267
- }
279
+ /**
280
+ * @description Parses a date string into its components and validates that the result is a real calendar date. Use `getDateParts` instead when raw splitting without validation is needed (e.g. for in-progress input).
281
+ *
282
+ * Partial formats are supported: components absent from `format` default to `year → "0"`,
283
+ * `month → "01"`, `day → "01"` for calendar validation only. The returned object contains
284
+ * only the fields actually present in the format string — missing fields are never injected.
285
+ * @param {string} dateStr - Date string to parse.
286
+ * @param {string} format - Date format to parse.
287
+ * @returns {{ month?: string, day?: string, year?: string }|undefined}
288
+ * @throws {Error} Throws when the parsed result does not represent a valid calendar date.
289
+ */
290
+ function parseDate(dateStr, format = "mm/dd/yyyy") {
291
+ if (!dateStr || !format) {
292
+ return undefined;
293
+ }
294
+ const result = getDateParts(dateStr.trim(), format);
268
295
 
269
- const { month, day, year } = parsedDate;
296
+ if (!result) {
297
+ return undefined;
298
+ }
270
299
 
271
- const dateParts = [];
272
- if (month) {
273
- dateParts.push(month);
274
- }
300
+ const lowerFormat = format.toLowerCase();
301
+ const year = lowerFormat.includes("yy") ? result.year : "0";
302
+ const month = lowerFormat.includes("mm") ? result.month : "01";
303
+ const day = lowerFormat.includes("dd") ? result.day : "01";
275
304
 
276
- if (day) {
277
- dateParts.push(day);
278
- }
305
+ if (isCalendarDate(year, month, day)) {
306
+ return result;
307
+ }
279
308
 
280
- if (year) {
281
- dateParts.push(year);
282
- }
309
+ throw new Error(
310
+ `AuroDatepickerUtilities | parseDate: Date string is not a valid date ${JSON.stringify(result)} with format ${format}`,
311
+ );
312
+ }
283
313
 
284
- return dateParts.join('/');
285
- };
314
+ /**
315
+ * Convert a date object to string format.
316
+ * @param {Object} date - Date to convert to string.
317
+ * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
318
+ * @returns {String} Returns the date as a string.
319
+ */
320
+ function getDateAsString(date, locale = undefined) {
321
+ return date.toLocaleDateString(locale, {
322
+ year: "numeric",
323
+ month: "2-digit",
324
+ day: "2-digit",
325
+ });
326
+ }
327
+
328
+ /**
329
+ * Converts a date string to a North American date format.
330
+ * @param {String} dateStr - Date to validate.
331
+ * @param {String} format - Date format to validate against.
332
+ * @returns {String}
333
+ */
334
+ function toNorthAmericanFormat$1(dateStr, format) {
335
+ if (format === "mm/dd/yyyy") {
336
+ return dateStr;
286
337
  }
338
+
339
+ const parsedDate = parseDate(dateStr, format);
340
+
341
+ if (!parsedDate) {
342
+ throw new Error(
343
+ "AuroDatepickerUtilities | toNorthAmericanFormat: Unable to parse date string",
344
+ );
345
+ }
346
+
347
+ const { month, day, year } = parsedDate;
348
+
349
+ return [month, day, year].filter(Boolean).join("/");
287
350
  }
288
- const dateFormatter = new DateFormatter();
351
+
352
+ /**
353
+ * Validates that a date string matches the provided format and represents a real calendar date.
354
+ *
355
+ * @param {string} dateStr - Date string to validate.
356
+ * @param {string} [format="yyyy-mm-dd"] - Format of the date string.
357
+ * @returns {boolean} True when the date string is valid for the provided format, otherwise false.
358
+ */
359
+ function isValidDate(dateStr, format = "yyyy-mm-dd") {
360
+ try {
361
+ if (typeof dateStr !== "string" || !dateStr || format?.length < 8) {
362
+ return false;
363
+ }
364
+
365
+ if (parseDate(dateStr, format)) {
366
+ return true;
367
+ }
368
+ } catch (error) {
369
+ return false;
370
+ }
371
+ return false;
372
+ }
373
+
374
+ /**
375
+ * Converts a JavaScript Date instance to a simple ISO-like date string. This returns only the calendar date portion without any time or timezone information.
376
+ *
377
+ * @param {Date} date - Date instance to convert to an ISO-like string.
378
+ * @returns {string} A string in the format "yyyy-mm-dd" representing the provided date.
379
+ * @throws {Error} Throws an error when the input is not a valid Date instance.
380
+ */
381
+ function toISOFormatString(date) {
382
+ if (!(date instanceof Date) || Number.isNaN(date.getTime())) {
383
+ throw new Error(
384
+ "AuroDatepickerUtilities | toISOFormatString: Input must be a valid Date instance",
385
+ );
386
+ }
387
+ return `${String(date.getFullYear()).padStart(4, "0")}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
388
+ }
389
+
390
+ /**
391
+ * Converts a date string into a JavaScript Date instance. This method supports ISO formatted strings and other formats that can be parsed by the formatter.
392
+ *
393
+ * @param {String} dateStr - Date string to convert into a Date object.
394
+ * @param {String} format - Date format used to parse the string when it is not in ISO format.
395
+ * @returns {Date|null} Returns a Date instance for valid input or null for non-string input.
396
+ * @throws {Error} Throws when parsing fails for non-ISO string input.
397
+ */
398
+ function stringToDateInstance(dateStr, format = "yyyy-mm-dd") {
399
+ if (typeof dateStr !== "string") {
400
+ return null;
401
+ }
402
+
403
+ const { month, day, year } = parseDate(dateStr, format);
404
+ return new Date(`${year}/${month}/${day}`);
405
+ }
406
+
407
+ const dateFormatter = {
408
+ parseDate,
409
+ getDateParts,
410
+ getDateAsString,
411
+ toNorthAmericanFormat: toNorthAmericanFormat$1,
412
+ isValidDate,
413
+ toISOFormatString,
414
+ stringToDateInstance,
415
+ };
289
416
 
290
417
  // filepath: dateConstraints.mjs
291
418
  const DATE_UTIL_CONSTRAINTS = {
@@ -357,12 +484,11 @@ class AuroDateUtilitiesBase {
357
484
  /* eslint-disable no-magic-numbers */
358
485
 
359
486
  class AuroDateUtilities extends AuroDateUtilitiesBase {
360
-
361
487
  /**
362
488
  * Returns the current century.
363
489
  * @returns {String} The current century.
364
490
  */
365
- getCentury () {
491
+ getCentury() {
366
492
  return String(new Date().getFullYear()).slice(0, 2);
367
493
  }
368
494
 
@@ -371,14 +497,12 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
371
497
  * @param {String} year - The year to convert to four digits.
372
498
  * @returns {String} The four digit year.
373
499
  */
374
- getFourDigitYear (year) {
375
-
500
+ getFourDigitYear(year) {
376
501
  const strYear = String(year).trim();
377
502
  return strYear.length <= 2 ? this.getCentury() + strYear : strYear;
378
503
  }
379
504
 
380
505
  constructor() {
381
-
382
506
  super();
383
507
 
384
508
  /**
@@ -387,7 +511,8 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
387
511
  * @param {Object} date2 - Second date to compare.
388
512
  * @returns {Boolean} Returns true if the dates match.
389
513
  */
390
- this.datesMatch = (date1, date2) => new Date(date1).getTime() === new Date(date2).getTime();
514
+ this.datesMatch = (date1, date2) =>
515
+ new Date(date1).getTime() === new Date(date2).getTime();
391
516
 
392
517
  /**
393
518
  * Returns true if value passed in is a valid date.
@@ -396,53 +521,41 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
396
521
  * @returns {Boolean}
397
522
  */
398
523
  this.validDateStr = (date, format) => {
399
-
400
524
  // The length we expect the date string to be
401
- const dateStrLength = format.length;
525
+ const dateStrLength = format?.length || 0;
402
526
 
403
527
  // Guard Clause: Date and format are defined
404
528
  if (typeof date === "undefined" || typeof format === "undefined") {
405
- throw new Error('AuroDatepickerUtilities | validateDateStr: Date and format are required');
529
+ throw new Error(
530
+ "AuroDatepickerUtilities | validateDateStr: Date and format are required",
531
+ );
406
532
  }
407
533
 
408
534
  // Guard Clause: Date should be of type string
409
535
  if (typeof date !== "string") {
410
- throw new Error('AuroDatepickerUtilities | validateDateStr: Date must be a string');
536
+ throw new Error(
537
+ "AuroDatepickerUtilities | validateDateStr: Date must be a string",
538
+ );
411
539
  }
412
540
 
413
541
  // Guard Clause: Format should be of type string
414
542
  if (typeof format !== "string") {
415
- throw new Error('AuroDatepickerUtilities | validateDateStr: Format must be a string');
543
+ throw new Error(
544
+ "AuroDatepickerUtilities | validateDateStr: Format must be a string",
545
+ );
416
546
  }
417
547
 
418
548
  // Guard Clause: Length is what we expect it to be
419
549
  if (date.length !== dateStrLength) {
420
550
  return false;
421
551
  }
422
- // Get a formatted date string and parse it
423
- const dateParts = dateFormatter.parseDate(date, format);
424
-
425
- // Guard Clause: Date parse succeeded
426
- if (!dateParts) {
427
- return false;
428
- }
429
552
 
430
- // Create the expected date string based on the date parts
431
- const expectedDateStr = `${dateParts.month}/${dateParts.day || "01"}/${this.getFourDigitYear(dateParts.year)}`;
432
-
433
- // Generate a date object that we will extract a string date from to compare to the passed in date string
434
- const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
435
-
436
- // Get the date string of the date object we created from the string date
437
- const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
438
-
439
- // Guard Clause: Generated date matches date string input
440
- if (expectedDateStr !== actualDateStr) {
553
+ // Get a formatted date string and parse and validate it
554
+ try {
555
+ return Boolean(dateFormatter.parseDate(date, format));
556
+ } catch (error) {
441
557
  return false;
442
558
  }
443
-
444
- // If we passed all other checks, we can assume the date is valid
445
- return true;
446
559
  };
447
560
 
448
561
  /**
@@ -452,10 +565,11 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
452
565
  * @returns {boolean}
453
566
  */
454
567
  this.dateAndFormatMatch = (value, format) => {
455
-
456
568
  // Ensure we have both values we need to do the comparison
457
569
  if (!value || !format) {
458
- throw new Error('AuroFormValidation | dateFormatMatch: value and format are required');
570
+ throw new Error(
571
+ "AuroFormValidation | dateFormatMatch: value and format are required",
572
+ );
459
573
  }
460
574
 
461
575
  // If the lengths are different, they cannot match
@@ -464,11 +578,10 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
464
578
  }
465
579
 
466
580
  // Get the parts of the date
467
- const dateParts = dateFormatter.parseDate(value, format);
581
+ const dateParts = dateFormatter.getDateParts(value, format);
468
582
 
469
583
  // Validator for day
470
584
  const dayValueIsValid = (day) => {
471
-
472
585
  // Guard clause: if there is no day in the dateParts, we can ignore this check.
473
586
  if (!dateParts.day) {
474
587
  return true;
@@ -484,7 +597,9 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
484
597
 
485
598
  // Guard clause: ensure day is a valid integer
486
599
  if (Number.isNaN(numDay)) {
487
- throw new Error('AuroDatepickerUtilities | dayValueIsValid: Unable to parse day value integer');
600
+ throw new Error(
601
+ "AuroDatepickerUtilities | dayValueIsValid: Unable to parse day value integer",
602
+ );
488
603
  }
489
604
 
490
605
  // Guard clause: ensure day is within the valid range
@@ -498,6 +613,10 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
498
613
 
499
614
  // Validator for month
500
615
  const monthValueIsValid = (month) => {
616
+ // Guard clause: if there is no month in the dateParts, we can ignore this check.
617
+ if (!dateParts.month) {
618
+ return true;
619
+ }
501
620
 
502
621
  // Guard clause: ensure month exists.
503
622
  if (!month) {
@@ -509,7 +628,9 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
509
628
 
510
629
  // Guard clause: ensure month is a valid integer
511
630
  if (Number.isNaN(numMonth)) {
512
- throw new Error('AuroDatepickerUtilities | monthValueIsValid: Unable to parse month value integer');
631
+ throw new Error(
632
+ "AuroDatepickerUtilities | monthValueIsValid: Unable to parse month value integer",
633
+ );
513
634
  }
514
635
 
515
636
  // Guard clause: ensure month is within the valid range
@@ -523,6 +644,10 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
523
644
 
524
645
  // Validator for year
525
646
  const yearIsValid = (_year) => {
647
+ // Guard clause: if there is no year in the dateParts, we can ignore this check.
648
+ if (!dateParts.year) {
649
+ return true;
650
+ }
526
651
 
527
652
  // Guard clause: ensure year exists.
528
653
  if (!_year) {
@@ -537,7 +662,9 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
537
662
 
538
663
  // Guard clause: ensure year is a valid integer
539
664
  if (Number.isNaN(numYear)) {
540
- throw new Error('AuroDatepickerUtilities | yearValueIsValid: Unable to parse year value integer');
665
+ throw new Error(
666
+ "AuroDatepickerUtilities | yearValueIsValid: Unable to parse year value integer",
667
+ );
541
668
  }
542
669
 
543
670
  // Guard clause: ensure year is within the valid range
@@ -553,7 +680,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
553
680
  const checks = [
554
681
  monthValueIsValid(dateParts.month),
555
682
  dayValueIsValid(dateParts.day),
556
- yearIsValid(dateParts.year)
683
+ yearIsValid(dateParts.year),
557
684
  ];
558
685
 
559
686
  // If any of the checks failed, the date format does not match and the result is invalid
@@ -587,10 +714,7 @@ const {
587
714
  } = dateUtilities;
588
715
 
589
716
  const {
590
- toNorthAmericanFormat,
591
- parseDate,
592
- getDateAsString
593
- } = dateFormatter;
717
+ toNorthAmericanFormat} = dateFormatter;
594
718
 
595
719
  // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
596
720
  // See LICENSE in the project root for license information.
@@ -5366,7 +5490,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$3 {
5366
5490
  }
5367
5491
  };
5368
5492
 
5369
- var formkitVersion$1 = '202606011922';
5493
+ var formkitVersion$1 = '202606012111';
5370
5494
 
5371
5495
  class AuroElement extends i$3 {
5372
5496
  static get properties() {
@@ -7340,7 +7464,7 @@ class AuroHelpText extends i$3 {
7340
7464
  }
7341
7465
  }
7342
7466
 
7343
- var formkitVersion = '202606011922';
7467
+ var formkitVersion = '202606012111';
7344
7468
 
7345
7469
  var styleCss$2 = i$6`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}.body-default{font-size:var(--wcss-body-default-font-size, 1rem);font-weight:var(--wcss-body-default-weight, );line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-default,.body-default-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-default-emphasized{font-size:var(--wcss-body-default-emphasized-font-size, 1rem);font-weight:var(--wcss-body-default-emphasized-weight, );line-height:var(--wcss-body-default-emphasized-line-height, 1.5rem)}.body-lg{font-size:var(--wcss-body-lg-font-size, 1.125rem);font-weight:var(--wcss-body-lg-weight, );line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-lg,.body-lg-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-lg-emphasized{font-size:var(--wcss-body-lg-emphasized-font-size, 1.125rem);font-weight:var(--wcss-body-lg-emphasized-weight, );line-height:var(--wcss-body-lg-emphasized-line-height, 1.625rem)}.body-sm{font-size:var(--wcss-body-sm-font-size, 0.875rem);font-weight:var(--wcss-body-sm-weight, );line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-sm,.body-sm-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-sm-emphasized{font-size:var(--wcss-body-sm-emphasized-font-size, 0.875rem);font-weight:var(--wcss-body-sm-emphasized-weight, );line-height:var(--wcss-body-sm-emphasized-line-height, 1.25rem)}.body-xs{font-size:var(--wcss-body-xs-font-size, 0.75rem);font-weight:var(--wcss-body-xs-weight, );line-height:var(--wcss-body-xs-line-height, 1rem)}.body-xs,.body-xs-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-xs-emphasized{font-size:var(--wcss-body-xs-emphasized-font-size, 0.75rem);font-weight:var(--wcss-body-xs-emphasized-weight, );line-height:var(--wcss-body-xs-emphasized-line-height, 1rem)}.body-2xs{font-size:var(--wcss-body-2xs-font-size, 0.625rem);font-weight:var(--wcss-body-2xs-weight, );line-height:var(--wcss-body-2xs-line-height, 0.875rem)}.body-2xs,.body-2xs-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-2xs-emphasized{font-size:var(--wcss-body-2xs-emphasized-font-size, 0.625rem);font-weight:var(--wcss-body-2xs-emphasized-weight, );line-height:var(--wcss-body-2xs-emphasized-line-height, 0.875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular"),var(--wcss-display-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem));font-weight:var(--wcss-display-2xl-weight, 300);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);line-height:var(--wcss-display-2xl-line-height, 1.3)}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular"),var(--wcss-display-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem));font-weight:var(--wcss-display-xl-weight, 300);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);line-height:var(--wcss-display-xl-line-height, 1.3)}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular"),var(--wcss-display-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem));font-weight:var(--wcss-display-lg-weight, 300);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);line-height:var(--wcss-display-lg-line-height, 1.3)}.display-md{font-family:var(--wcss-display-md-family, "AS Circular"),var(--wcss-display-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem));font-weight:var(--wcss-display-md-weight, 300);letter-spacing:var(--wcss-display-md-letter-spacing, 0);line-height:var(--wcss-display-md-line-height, 1.3)}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular"),var(--wcss-display-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem));font-weight:var(--wcss-display-sm-weight, 300);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);line-height:var(--wcss-display-sm-line-height, 1.3)}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular"),var(--wcss-display-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem));font-weight:var(--wcss-display-xs-weight, 300);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);line-height:var(--wcss-display-xs-line-height, 1.3)}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular"),var(--wcss-heading-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem));font-weight:var(--wcss-heading-xl-weight, 300);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);line-height:var(--wcss-heading-xl-line-height, 1.3)}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular"),var(--wcss-heading-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem));font-weight:var(--wcss-heading-lg-weight, 300);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);line-height:var(--wcss-heading-lg-line-height, 1.3)}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular"),var(--wcss-heading-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem));font-weight:var(--wcss-heading-md-weight, 300);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);line-height:var(--wcss-heading-md-line-height, 1.3)}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular"),var(--wcss-heading-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem));font-weight:var(--wcss-heading-sm-weight, 300);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);line-height:var(--wcss-heading-sm-line-height, 1.3)}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular"),var(--wcss-heading-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem));font-weight:var(--wcss-heading-xs-weight, 300);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);line-height:var(--wcss-heading-xs-line-height, 1.3)}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular"),var(--wcss-heading-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem));font-weight:var(--wcss-heading-2xs-weight, 300);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);line-height:var(--wcss-heading-2xs-line-height, 1.3)}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT"),var(--wcss-accent-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));font-weight:var(--wcss-accent-2xl-weight, 450);letter-spacing:var(--wcss-accent-2xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-2xl-line-height, 1)}.accent-2xl,.accent-xl{text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT"),var(--wcss-accent-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));font-weight:var(--wcss-accent-xl-weight, 450);letter-spacing:var(--wcss-accent-xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-xl-line-height, 1.3)}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT"),var(--wcss-accent-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));font-weight:var(--wcss-accent-lg-weight, 450);letter-spacing:var(--wcss-accent-lg-letter-spacing, 0.05em);line-height:var(--wcss-accent-lg-line-height, 1.3)}.accent-lg,.accent-md{text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT"),var(--wcss-accent-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));font-weight:var(--wcss-accent-md-weight, 500);letter-spacing:var(--wcss-accent-md-letter-spacing, 0.05em);line-height:var(--wcss-accent-md-line-height, 1.3)}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT"),var(--wcss-accent-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));font-weight:var(--wcss-accent-sm-weight, 500);letter-spacing:var(--wcss-accent-sm-letter-spacing, 0.05em);line-height:var(--wcss-accent-sm-line-height, 1.3)}.accent-sm,.accent-xs{text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT"),var(--wcss-accent-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));font-weight:var(--wcss-accent-xs-weight, 500);letter-spacing:var(--wcss-accent-xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-xs-line-height, 1.3)}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT"),var(--wcss-accent-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xs-font-size, clamp(0.875rem, 1.1666666667vw, 0.875rem));font-weight:var(--wcss-accent-2xs-weight, 450);letter-spacing:var(--wcss-accent-2xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-2xs-line-height, 1.3);text-transform:uppercase}[auro-dropdown]{--ds-auro-dropdown-trigger-border-color: var(--ds-auro-select-border-color);--ds-auro-dropdown-trigger-background-color: var(--ds-auro-select-background-color);--ds-auro-dropdown-trigger-container-color: var(--ds-auro-select-background-color);--ds-auro-dropdown-trigger-outline-color: var(--ds-auro-select-outline-color)}:host{display:inline-block;text-align:left;vertical-align:top}:host([layout*=emphasized]) [auro-dropdown],:host([layout*=snowflake]) [auro-dropdown]{--ds-auro-select-border-color: transparent}:host([layout*=emphasized]) .mainContent,:host([layout*=snowflake]) .mainContent{text-align:center}.mainContent{position:relative;display:flex;overflow:hidden;flex:1;flex-direction:column;align-items:center;justify-content:center}.valueContainer [slot=displayValue]{display:none}.accents{display:flex;flex-direction:row;align-items:center;justify-content:center}::slotted([slot=typeIcon]){margin-right:var(--ds-size-100, 0.5rem)}.displayValue{display:block}.displayValue:not(.force){display:none}.displayValue:not(.force).hasContent:is(.withValue):not(.hasFocus){display:block}.triggerContent{display:flex;width:100%;align-items:center;justify-content:center}:host([layout*=emphasized]) .triggerContent{padding:0 var(--ds-size-100, 0.5rem) 0 var(--ds-size-300, 1.5rem)}:host([layout*=snowflake]) .triggerContent{padding:0 var(--ds-size-100, 0.5rem) 0 var(--ds-size-200, 1rem)}:host([layout*=snowflake]) label{padding-block:var(--ds-size-25, 0.125rem)}:host([layout*=classic]) .triggerContent{padding:0 var(--ds-size-100, 0.5rem)}:host([layout*=classic]) .mainContent{align-items:start}:host([layout*=classic]) label{overflow:hidden;cursor:text;text-overflow:ellipsis;white-space:nowrap}:host([layout*=classic]) .value{height:auto}label{color:var(--ds-auro-select-label-text-color)}:host(:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-select-outline-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]:is([validity]:not([validity=valid]))) [auro-dropdown],:host([appearance=inverse]:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8);--ds-auro-select-outline-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}#slotHolder{display:none}:host([fluid]){width:100%}:host([disabled]){pointer-events:none;user-select:none}:host([disabled]:not([ondark])) [auro-dropdown],:host([disabled]:not([appearance=inverse])) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host(:not([layout*=classic])[disabled][ondark]) [auro-dropdown],:host(:not([layout*=classic])[disabled][appearance=inverse]) [auro-dropdown]{--ds-auro-select-border-color: transparent}`;
7346
7470