@aurodesignsystem-dev/auro-formkit 0.0.0-pr1483.0 → 0.0.0-pr1483.10

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 (52) hide show
  1. package/components/checkbox/demo/customize.min.js +2 -233
  2. package/components/checkbox/demo/getting-started.min.js +2 -233
  3. package/components/checkbox/demo/index.min.js +2 -233
  4. package/components/checkbox/dist/index.js +2 -233
  5. package/components/checkbox/dist/registered.js +2 -233
  6. package/components/combobox/demo/customize.min.js +7 -238
  7. package/components/combobox/demo/getting-started.min.js +7 -238
  8. package/components/combobox/demo/index.min.js +7 -238
  9. package/components/combobox/demo/keyboard-behavior.md +68 -8
  10. package/components/combobox/dist/index.js +7 -238
  11. package/components/combobox/dist/registered.js +7 -238
  12. package/components/counter/demo/customize.min.js +3 -234
  13. package/components/counter/demo/index.min.js +3 -234
  14. package/components/counter/dist/index.js +2 -233
  15. package/components/counter/dist/registered.js +2 -233
  16. package/components/datepicker/demo/api.md +52 -51
  17. package/components/datepicker/demo/customize.md +52 -15
  18. package/components/datepicker/demo/index.md +23 -0
  19. package/components/datepicker/demo/index.min.js +5069 -1044
  20. package/components/datepicker/dist/index.js +4587 -562
  21. package/components/datepicker/dist/registered.js +4587 -562
  22. package/components/datepicker/dist/src/auro-calendar-cell.d.ts +3 -1
  23. package/components/datepicker/dist/src/auro-calendar-month.d.ts +23 -0
  24. package/components/datepicker/dist/src/auro-calendar.d.ts +15 -0
  25. package/components/datepicker/dist/src/auro-datepicker.d.ts +27 -13
  26. package/components/datepicker/dist/src/utilities.d.ts +0 -20
  27. package/components/datepicker/dist/src/utilitiesCalendar.d.ts +0 -1
  28. package/components/dropdown/demo/customize.min.js +1 -1
  29. package/components/dropdown/demo/getting-started.min.js +1 -1
  30. package/components/dropdown/demo/index.min.js +1 -1
  31. package/components/dropdown/dist/index.js +1 -1
  32. package/components/dropdown/dist/registered.js +1 -1
  33. package/components/form/demo/customize.min.js +5294 -2422
  34. package/components/form/demo/getting-started.min.js +5294 -2422
  35. package/components/form/demo/index.min.js +5294 -2422
  36. package/components/form/demo/registerDemoDeps.min.js +5294 -2422
  37. package/components/input/demo/customize.min.js +2 -2
  38. package/components/input/demo/getting-started.min.js +2 -2
  39. package/components/input/demo/index.min.js +2 -2
  40. package/components/input/dist/index.js +2 -2
  41. package/components/input/dist/registered.js +2 -2
  42. package/components/radio/demo/index.min.js +2 -233
  43. package/components/radio/dist/index.js +2 -233
  44. package/components/radio/dist/registered.js +2 -233
  45. package/components/select/demo/customize.min.js +21 -250
  46. package/components/select/demo/getting-started.min.js +21 -250
  47. package/components/select/demo/index.min.js +21 -250
  48. package/components/select/demo/keyboard-behavior.md +54 -8
  49. package/components/select/dist/index.js +21 -250
  50. package/components/select/dist/registered.js +21 -250
  51. package/custom-elements.json +1597 -1582
  52. package/package.json +3 -3
@@ -539,237 +539,6 @@ class AuroCheckbox extends i$2 {
539
539
  */
540
540
  const a=Symbol.for(""),o=t=>{if(t?.r===a)return t?._$litStatic$},s=t=>({_$litStatic$:t,r:a}),i=(t,...r)=>({_$litStatic$:r.reduce((r,e,a)=>r+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(e)+t[a+1],t[0]),r:a}),l=new Map,n=t=>(r,...e)=>{const a=e.length;let s,i;const n=[],u=[];let c,$=0,f=false;for(;$<a;){for(c=r[$];$<a&&void 0!==(i=e[$],s=o(i));)c+=s+r[++$],f=true;$!==a&&u.push(i),n.push(c),$++;}if($===a&&n.push(r[a]),f){const t=n.join("$$lit$$");void 0===(r=l.get(t))&&(n.raw=n,l.set(t,r=n)),e=u;}return t(r,...e)},u=n(b);
541
541
 
542
- /**
543
- * @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.
544
- * @param {string} dateStr - Date string to parse.
545
- * @param {string} format - Date format to parse.
546
- * @returns {{ month?: string, day?: string, year?: string }|undefined}
547
- */
548
- function getDateParts(dateStr, format) {
549
- if (!dateStr) {
550
- return undefined;
551
- }
552
-
553
- const formatSeparatorMatch = format.match(/[/.-]/);
554
- let valueParts;
555
- let formatParts;
556
-
557
- if (formatSeparatorMatch) {
558
- const separator = formatSeparatorMatch[0];
559
- valueParts = dateStr.split(separator);
560
- formatParts = format.split(separator);
561
- } else {
562
- if (dateStr.match(/[/.-]/)) {
563
- throw new Error(
564
- "AuroDatepickerUtilities | parseDate: Date string has no separators",
565
- );
566
- }
567
-
568
- if (dateStr.length !== format.length) {
569
- throw new Error(
570
- "AuroDatepickerUtilities | parseDate: Date string and format length do not match",
571
- );
572
- }
573
-
574
- valueParts = [dateStr];
575
- formatParts = [format];
576
- }
577
-
578
- if (valueParts.length !== formatParts.length) {
579
- throw new Error(
580
- `AuroDatepickerUtilities | parseDate: Date string and format do not match : ${dateStr} vs ${format}`,
581
- );
582
- }
583
-
584
- const result = formatParts.reduce((acc, part, index) => {
585
- const value = valueParts[index];
586
-
587
- if (/m/iu.test(part) && part.length === value.length) {
588
- acc.month = value;
589
- } else if (/d/iu.test(part) && part.length === value.length) {
590
- acc.day = value;
591
- } else if (/y/iu.test(part) && part.length === value.length) {
592
- acc.year = value;
593
- }
594
-
595
- return acc;
596
- }, {});
597
-
598
- if (!result.month && !result.day && !result.year) {
599
- throw new Error(
600
- "AuroDatepickerUtilities | parseDate: Unable to parse date string",
601
- );
602
- }
603
-
604
- return result;
605
- }
606
-
607
- function isCalendarDate(year, month, day) {
608
- let yearNumber = Number(year);
609
- const monthNumber = Number(month);
610
- const dayNumber = Number(day);
611
-
612
- if (
613
- !Number.isInteger(yearNumber) ||
614
- !Number.isInteger(monthNumber) ||
615
- !Number.isInteger(dayNumber)
616
- ) {
617
- return false;
618
- }
619
-
620
- // 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.
621
- if (yearNumber < 100 && yearNumber >= 50) {
622
- yearNumber += 1900;
623
- } else if (yearNumber < 50) {
624
- yearNumber += 2000;
625
- }
626
-
627
- const stringified = `${String(yearNumber).padStart(4, "0")}-${String(monthNumber).padStart(2, "0")}-${String(dayNumber).padStart(2, "0")}`;
628
- const date = new Date(stringified.replace(/[.-]/g, "/"));
629
-
630
- return (
631
- !Number.isNaN(date.getTime()) && toISOFormatString(date) === stringified
632
- );
633
- }
634
-
635
- /**
636
- * @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).
637
- *
638
- * Partial formats are supported: components absent from `format` default to `year → "0"`,
639
- * `month → "01"`, `day → "01"` for calendar validation only. The returned object contains
640
- * only the fields actually present in the format string — missing fields are never injected.
641
- * @param {string} dateStr - Date string to parse.
642
- * @param {string} format - Date format to parse.
643
- * @returns {{ month?: string, day?: string, year?: string }|undefined}
644
- * @throws {Error} Throws when the parsed result does not represent a valid calendar date.
645
- */
646
- function parseDate(dateStr, format = "mm/dd/yyyy") {
647
- if (!dateStr || !format) {
648
- return undefined;
649
- }
650
- const result = getDateParts(dateStr.trim(), format);
651
-
652
- if (!result) {
653
- return undefined;
654
- }
655
-
656
- const lowerFormat = format.toLowerCase();
657
- const year = lowerFormat.includes("yy") ? result.year : "0";
658
- const month = lowerFormat.includes("mm") ? result.month : "01";
659
- const day = lowerFormat.includes("dd") ? result.day : "01";
660
-
661
- if (isCalendarDate(year, month, day)) {
662
- return result;
663
- }
664
-
665
- throw new Error(
666
- `AuroDatepickerUtilities | parseDate: Date string is not a valid date ${JSON.stringify(result)} with format ${format}`,
667
- );
668
- }
669
-
670
- /**
671
- * Convert a date object to string format.
672
- * @param {Object} date - Date to convert to string.
673
- * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
674
- * @returns {String} Returns the date as a string.
675
- */
676
- function getDateAsString(date, locale = undefined) {
677
- return date.toLocaleDateString(locale, {
678
- year: "numeric",
679
- month: "2-digit",
680
- day: "2-digit",
681
- });
682
- }
683
-
684
- /**
685
- * Converts a date string to a North American date format.
686
- * @param {String} dateStr - Date to validate.
687
- * @param {String} format - Date format to validate against.
688
- * @returns {String}
689
- */
690
- function toNorthAmericanFormat(dateStr, format) {
691
- if (format === "mm/dd/yyyy") {
692
- return dateStr;
693
- }
694
-
695
- const parsedDate = parseDate(dateStr, format);
696
-
697
- if (!parsedDate) {
698
- throw new Error(
699
- "AuroDatepickerUtilities | toNorthAmericanFormat: Unable to parse date string",
700
- );
701
- }
702
-
703
- const { month, day, year } = parsedDate;
704
-
705
- return [month, day, year].filter(Boolean).join("/");
706
- }
707
-
708
- /**
709
- * Validates that a date string matches the provided format and represents a real calendar date.
710
- *
711
- * @param {string} dateStr - Date string to validate.
712
- * @param {string} [format="yyyy-mm-dd"] - Format of the date string.
713
- * @returns {boolean} True when the date string is valid for the provided format, otherwise false.
714
- */
715
- function isValidDate(dateStr, format = "yyyy-mm-dd") {
716
- try {
717
- if (typeof dateStr !== "string" || !dateStr || format?.length < 8) {
718
- return false;
719
- }
720
-
721
- if (parseDate(dateStr, format)) {
722
- return true;
723
- }
724
- } catch (error) {
725
- return false;
726
- }
727
- return false;
728
- }
729
-
730
- /**
731
- * 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.
732
- *
733
- * @param {Date} date - Date instance to convert to an ISO-like string.
734
- * @returns {string} A string in the format "yyyy-mm-dd" representing the provided date.
735
- * @throws {Error} Throws an error when the input is not a valid Date instance.
736
- */
737
- function toISOFormatString(date) {
738
- if (!(date instanceof Date) || Number.isNaN(date.getTime())) {
739
- throw new Error(
740
- "AuroDatepickerUtilities | toISOFormatString: Input must be a valid Date instance",
741
- );
742
- }
743
- return `${String(date.getFullYear()).padStart(4, "0")}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
744
- }
745
-
746
- /**
747
- * 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.
748
- *
749
- * @param {String} dateStr - Date string to convert into a Date object.
750
- * @param {String} format - Date format used to parse the string when it is not in ISO format.
751
- * @returns {Date|null} Returns a Date instance for valid input or null for non-string input.
752
- * @throws {Error} Throws when parsing fails for non-ISO string input.
753
- */
754
- function stringToDateInstance(dateStr, format = "yyyy-mm-dd") {
755
- if (typeof dateStr !== "string") {
756
- return null;
757
- }
758
-
759
- const { month, day, year } = parseDate(dateStr, format);
760
- return new Date(`${year}/${month}/${day}`);
761
- }
762
-
763
- const dateFormatter = {
764
- parseDate,
765
- getDateParts,
766
- getDateAsString,
767
- toNorthAmericanFormat,
768
- isValidDate,
769
- toISOFormatString,
770
- stringToDateInstance,
771
- };
772
-
773
542
  // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
774
543
  // See LICENSE in the project root for license information.
775
544
 
@@ -991,7 +760,7 @@ class AuroFormValidation {
991
760
  }
992
761
 
993
762
  // Validate that the date passed was the correct format and is a valid date
994
- if (elem.value && !dateFormatter.isValidDate(elem.inputElement.value, elem.format)) {
763
+ if (elem.value && !elem.valueObject) {
995
764
  elem.validity = 'patternMismatch';
996
765
  elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || 'Invalid Date Format Entered';
997
766
  return;
@@ -1491,7 +1260,7 @@ class AuroHelpText extends i$2 {
1491
1260
  }
1492
1261
  }
1493
1262
 
1494
- var formkitVersion = '202605271728';
1263
+ var formkitVersion = '202606051610';
1495
1264
 
1496
1265
  // Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
1497
1266
  // See LICENSE in the project root for license information.
@@ -492,237 +492,6 @@ class AuroCheckbox extends LitElement {
492
492
  }
493
493
  }
494
494
 
495
- /**
496
- * @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.
497
- * @param {string} dateStr - Date string to parse.
498
- * @param {string} format - Date format to parse.
499
- * @returns {{ month?: string, day?: string, year?: string }|undefined}
500
- */
501
- function getDateParts(dateStr, format) {
502
- if (!dateStr) {
503
- return undefined;
504
- }
505
-
506
- const formatSeparatorMatch = format.match(/[/.-]/);
507
- let valueParts;
508
- let formatParts;
509
-
510
- if (formatSeparatorMatch) {
511
- const separator = formatSeparatorMatch[0];
512
- valueParts = dateStr.split(separator);
513
- formatParts = format.split(separator);
514
- } else {
515
- if (dateStr.match(/[/.-]/)) {
516
- throw new Error(
517
- "AuroDatepickerUtilities | parseDate: Date string has no separators",
518
- );
519
- }
520
-
521
- if (dateStr.length !== format.length) {
522
- throw new Error(
523
- "AuroDatepickerUtilities | parseDate: Date string and format length do not match",
524
- );
525
- }
526
-
527
- valueParts = [dateStr];
528
- formatParts = [format];
529
- }
530
-
531
- if (valueParts.length !== formatParts.length) {
532
- throw new Error(
533
- `AuroDatepickerUtilities | parseDate: Date string and format do not match : ${dateStr} vs ${format}`,
534
- );
535
- }
536
-
537
- const result = formatParts.reduce((acc, part, index) => {
538
- const value = valueParts[index];
539
-
540
- if (/m/iu.test(part) && part.length === value.length) {
541
- acc.month = value;
542
- } else if (/d/iu.test(part) && part.length === value.length) {
543
- acc.day = value;
544
- } else if (/y/iu.test(part) && part.length === value.length) {
545
- acc.year = value;
546
- }
547
-
548
- return acc;
549
- }, {});
550
-
551
- if (!result.month && !result.day && !result.year) {
552
- throw new Error(
553
- "AuroDatepickerUtilities | parseDate: Unable to parse date string",
554
- );
555
- }
556
-
557
- return result;
558
- }
559
-
560
- function isCalendarDate(year, month, day) {
561
- let yearNumber = Number(year);
562
- const monthNumber = Number(month);
563
- const dayNumber = Number(day);
564
-
565
- if (
566
- !Number.isInteger(yearNumber) ||
567
- !Number.isInteger(monthNumber) ||
568
- !Number.isInteger(dayNumber)
569
- ) {
570
- return false;
571
- }
572
-
573
- // 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.
574
- if (yearNumber < 100 && yearNumber >= 50) {
575
- yearNumber += 1900;
576
- } else if (yearNumber < 50) {
577
- yearNumber += 2000;
578
- }
579
-
580
- const stringified = `${String(yearNumber).padStart(4, "0")}-${String(monthNumber).padStart(2, "0")}-${String(dayNumber).padStart(2, "0")}`;
581
- const date = new Date(stringified.replace(/[.-]/g, "/"));
582
-
583
- return (
584
- !Number.isNaN(date.getTime()) && toISOFormatString(date) === stringified
585
- );
586
- }
587
-
588
- /**
589
- * @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).
590
- *
591
- * Partial formats are supported: components absent from `format` default to `year → "0"`,
592
- * `month → "01"`, `day → "01"` for calendar validation only. The returned object contains
593
- * only the fields actually present in the format string — missing fields are never injected.
594
- * @param {string} dateStr - Date string to parse.
595
- * @param {string} format - Date format to parse.
596
- * @returns {{ month?: string, day?: string, year?: string }|undefined}
597
- * @throws {Error} Throws when the parsed result does not represent a valid calendar date.
598
- */
599
- function parseDate(dateStr, format = "mm/dd/yyyy") {
600
- if (!dateStr || !format) {
601
- return undefined;
602
- }
603
- const result = getDateParts(dateStr.trim(), format);
604
-
605
- if (!result) {
606
- return undefined;
607
- }
608
-
609
- const lowerFormat = format.toLowerCase();
610
- const year = lowerFormat.includes("yy") ? result.year : "0";
611
- const month = lowerFormat.includes("mm") ? result.month : "01";
612
- const day = lowerFormat.includes("dd") ? result.day : "01";
613
-
614
- if (isCalendarDate(year, month, day)) {
615
- return result;
616
- }
617
-
618
- throw new Error(
619
- `AuroDatepickerUtilities | parseDate: Date string is not a valid date ${JSON.stringify(result)} with format ${format}`,
620
- );
621
- }
622
-
623
- /**
624
- * Convert a date object to string format.
625
- * @param {Object} date - Date to convert to string.
626
- * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
627
- * @returns {String} Returns the date as a string.
628
- */
629
- function getDateAsString(date, locale = undefined) {
630
- return date.toLocaleDateString(locale, {
631
- year: "numeric",
632
- month: "2-digit",
633
- day: "2-digit",
634
- });
635
- }
636
-
637
- /**
638
- * Converts a date string to a North American date format.
639
- * @param {String} dateStr - Date to validate.
640
- * @param {String} format - Date format to validate against.
641
- * @returns {String}
642
- */
643
- function toNorthAmericanFormat(dateStr, format) {
644
- if (format === "mm/dd/yyyy") {
645
- return dateStr;
646
- }
647
-
648
- const parsedDate = parseDate(dateStr, format);
649
-
650
- if (!parsedDate) {
651
- throw new Error(
652
- "AuroDatepickerUtilities | toNorthAmericanFormat: Unable to parse date string",
653
- );
654
- }
655
-
656
- const { month, day, year } = parsedDate;
657
-
658
- return [month, day, year].filter(Boolean).join("/");
659
- }
660
-
661
- /**
662
- * Validates that a date string matches the provided format and represents a real calendar date.
663
- *
664
- * @param {string} dateStr - Date string to validate.
665
- * @param {string} [format="yyyy-mm-dd"] - Format of the date string.
666
- * @returns {boolean} True when the date string is valid for the provided format, otherwise false.
667
- */
668
- function isValidDate(dateStr, format = "yyyy-mm-dd") {
669
- try {
670
- if (typeof dateStr !== "string" || !dateStr || format?.length < 8) {
671
- return false;
672
- }
673
-
674
- if (parseDate(dateStr, format)) {
675
- return true;
676
- }
677
- } catch (error) {
678
- return false;
679
- }
680
- return false;
681
- }
682
-
683
- /**
684
- * 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.
685
- *
686
- * @param {Date} date - Date instance to convert to an ISO-like string.
687
- * @returns {string} A string in the format "yyyy-mm-dd" representing the provided date.
688
- * @throws {Error} Throws an error when the input is not a valid Date instance.
689
- */
690
- function toISOFormatString(date) {
691
- if (!(date instanceof Date) || Number.isNaN(date.getTime())) {
692
- throw new Error(
693
- "AuroDatepickerUtilities | toISOFormatString: Input must be a valid Date instance",
694
- );
695
- }
696
- return `${String(date.getFullYear()).padStart(4, "0")}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
697
- }
698
-
699
- /**
700
- * 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.
701
- *
702
- * @param {String} dateStr - Date string to convert into a Date object.
703
- * @param {String} format - Date format used to parse the string when it is not in ISO format.
704
- * @returns {Date|null} Returns a Date instance for valid input or null for non-string input.
705
- * @throws {Error} Throws when parsing fails for non-ISO string input.
706
- */
707
- function stringToDateInstance(dateStr, format = "yyyy-mm-dd") {
708
- if (typeof dateStr !== "string") {
709
- return null;
710
- }
711
-
712
- const { month, day, year } = parseDate(dateStr, format);
713
- return new Date(`${year}/${month}/${day}`);
714
- }
715
-
716
- const dateFormatter = {
717
- parseDate,
718
- getDateParts,
719
- getDateAsString,
720
- toNorthAmericanFormat,
721
- isValidDate,
722
- toISOFormatString,
723
- stringToDateInstance,
724
- };
725
-
726
495
  // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
727
496
  // See LICENSE in the project root for license information.
728
497
 
@@ -944,7 +713,7 @@ class AuroFormValidation {
944
713
  }
945
714
 
946
715
  // Validate that the date passed was the correct format and is a valid date
947
- if (elem.value && !dateFormatter.isValidDate(elem.inputElement.value, elem.format)) {
716
+ if (elem.value && !elem.valueObject) {
948
717
  elem.validity = 'patternMismatch';
949
718
  elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || 'Invalid Date Format Entered';
950
719
  return;
@@ -1444,7 +1213,7 @@ class AuroHelpText extends LitElement {
1444
1213
  }
1445
1214
  }
1446
1215
 
1447
- var formkitVersion = '202605271728';
1216
+ var formkitVersion = '202606051610';
1448
1217
 
1449
1218
  // Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
1450
1219
  // See LICENSE in the project root for license information.