@nordhealth/components 3.4.0-alpha.0 → 3.4.0-alpha.2

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 (118) hide show
  1. package/custom-elements.json +983 -983
  2. package/lib/{AutocompleteMixin-60503685.js → AutocompleteMixin-a98ada34.js} +2 -2
  3. package/lib/{AutocompleteMixin-60503685.js.map → AutocompleteMixin-a98ada34.js.map} +1 -1
  4. package/lib/Avatar.js +1 -1
  5. package/lib/Avatar.js.map +1 -1
  6. package/lib/Badge.js +1 -1
  7. package/lib/Banner.js +1 -1
  8. package/lib/Banner.js.map +1 -1
  9. package/lib/Button.js +1 -1
  10. package/lib/ButtonGroup.js +1 -1
  11. package/lib/{Calendar-f7e95d9a.js → Calendar-3fd55b5d.js} +2 -2
  12. package/lib/{Calendar-f7e95d9a.js.map → Calendar-3fd55b5d.js.map} +1 -1
  13. package/lib/Calendar.js +1 -1
  14. package/lib/Card.js +1 -1
  15. package/lib/Checkbox.js +1 -1
  16. package/lib/CommandMenu.js +1 -1
  17. package/lib/CommandMenu.js.map +1 -1
  18. package/lib/CommandMenuAction.js +1 -1
  19. package/lib/CommandMenuAction.js.map +1 -1
  20. package/lib/{Component-253ecb24.js → Component-1f694235.js} +2 -2
  21. package/lib/Component-1f694235.js.map +1 -0
  22. package/lib/DatePicker.js +1 -1
  23. package/lib/Divider.js +1 -1
  24. package/lib/Drawer.js +1 -1
  25. package/lib/Dropdown.js +1 -1
  26. package/lib/DropdownGroup.js +1 -1
  27. package/lib/{DropdownItem-75a2468a.js → DropdownItem-4a02675f.js} +2 -2
  28. package/lib/DropdownItem-4a02675f.js.map +1 -0
  29. package/lib/DropdownItem.js +1 -1
  30. package/lib/EmptyState.js +1 -1
  31. package/lib/Fieldset.js +1 -1
  32. package/lib/FocusableMixin-186c69a2.js +2 -0
  33. package/lib/{FocusableMixin-003e1094.js.map → FocusableMixin-186c69a2.js.map} +1 -1
  34. package/lib/{FormAssociatedMixin-0638b151.js → FormAssociatedMixin-5fedde68.js} +2 -2
  35. package/lib/{FormAssociatedMixin-0638b151.js.map → FormAssociatedMixin-5fedde68.js.map} +1 -1
  36. package/lib/{FormField-0783cb5a.js → FormField-3226fb17.js} +2 -2
  37. package/lib/FormField-3226fb17.js.map +1 -0
  38. package/lib/Header.js +1 -1
  39. package/lib/Icon.js +2 -2
  40. package/lib/Input.js +1 -1
  41. package/lib/{InputMixin-87012c5a.js → InputMixin-d50cb41a.js} +2 -2
  42. package/lib/{InputMixin-87012c5a.js.map → InputMixin-d50cb41a.js.map} +1 -1
  43. package/lib/Layout.js +1 -1
  44. package/lib/Layout.js.map +1 -1
  45. package/lib/{LightDomController-5c53b3f4.js → LightDomController-8a770234.js} +2 -2
  46. package/lib/{LightDomController-5c53b3f4.js.map → LightDomController-8a770234.js.map} +1 -1
  47. package/lib/Message.js +1 -1
  48. package/lib/Modal.js +1 -1
  49. package/lib/NavGroup.js +1 -1
  50. package/lib/NavItem.js +1 -1
  51. package/lib/{NavToggle-7e1ba314.js → NavToggle-fbd227e5.js} +2 -2
  52. package/lib/{NavToggle-7e1ba314.js.map → NavToggle-fbd227e5.js.map} +1 -1
  53. package/lib/NavToggle.js +1 -1
  54. package/lib/Navigation.js +1 -1
  55. package/lib/Navigation.js.map +1 -1
  56. package/lib/Notification.js +1 -1
  57. package/lib/NotificationGroup.js +1 -1
  58. package/lib/{NotificationMixin-cea138a7.js → NotificationMixin-5e028561.js} +2 -2
  59. package/lib/{NotificationMixin-cea138a7.js.map → NotificationMixin-5e028561.js.map} +1 -1
  60. package/lib/{Popout-1183c22b.js → Popout-6a85e4b6.js} +2 -2
  61. package/lib/{Popout-1183c22b.js.map → Popout-6a85e4b6.js.map} +1 -1
  62. package/lib/Popout.js +1 -1
  63. package/lib/ProgressBar.js +1 -1
  64. package/lib/Qrcode.js +1 -1
  65. package/lib/Qrcode.js.map +1 -1
  66. package/lib/Radio.js +1 -1
  67. package/lib/Range.js +1 -1
  68. package/lib/Select.js +1 -1
  69. package/lib/{SizeMixin-bc2098f4.js → SizeMixin-f04ac402.js} +2 -2
  70. package/lib/{SizeMixin-bc2098f4.js.map → SizeMixin-f04ac402.js.map} +1 -1
  71. package/lib/Skeleton.js +1 -1
  72. package/lib/Spinner.js +1 -1
  73. package/lib/Stack.js +1 -1
  74. package/lib/{Sticky-220280e0.js → Sticky-b4e6c315.js} +2 -2
  75. package/lib/Sticky-b4e6c315.js.map +1 -0
  76. package/lib/Tab.js +1 -1
  77. package/lib/TabGroup.js +1 -1
  78. package/lib/TabPanel.js +1 -1
  79. package/lib/Table.js +1 -1
  80. package/lib/{TextField-b455a6dd.js → TextField-3f901ec8.js} +2 -2
  81. package/lib/{TextField-b455a6dd.js.map → TextField-3f901ec8.js.map} +1 -1
  82. package/lib/Textarea.js +1 -1
  83. package/lib/Toast.js +1 -1
  84. package/lib/ToastGroup.js +1 -1
  85. package/lib/Toggle.js +1 -1
  86. package/lib/Tooltip.js +1 -1
  87. package/lib/TopBar.js +1 -1
  88. package/lib/TopBar.js.map +1 -1
  89. package/lib/VisuallyHidden.js +1 -1
  90. package/lib/bundle.js +5 -5
  91. package/lib/bundle.js.map +1 -1
  92. package/lib/{class-map-4a0dec4a.js → class-map-c0d8e1e5.js} +2 -2
  93. package/lib/{class-map-4a0dec4a.js.map → class-map-c0d8e1e5.js.map} +1 -1
  94. package/lib/{collection-bba319d3.js → collection-498f2b1f.js} +3 -3
  95. package/lib/{collection-bba319d3.js.map → collection-498f2b1f.js.map} +1 -1
  96. package/lib/cond-09498763.js +2 -0
  97. package/lib/{cond-77258def.js.map → cond-09498763.js.map} +1 -1
  98. package/lib/{if-defined-10508457.js → if-defined-8a007930.js} +2 -2
  99. package/lib/{if-defined-10508457.js.map → if-defined-8a007930.js.map} +1 -1
  100. package/lib/index.js +1 -1
  101. package/lib/positioning-a572d126.js +1 -1
  102. package/lib/positioning-a572d126.js.map +1 -1
  103. package/lib/{query-assigned-elements-2f8275b7.js → query-assigned-elements-822fe360.js} +2 -2
  104. package/lib/query-assigned-elements-822fe360.js.map +1 -0
  105. package/lib/{ref-f75a30b7.js → ref-6b46e5ea.js} +3 -3
  106. package/lib/{ref-f75a30b7.js.map → ref-6b46e5ea.js.map} +1 -1
  107. package/lib/style-map-5b757428.js +7 -0
  108. package/lib/style-map-5b757428.js.map +1 -0
  109. package/package.json +2 -2
  110. package/lib/Component-253ecb24.js.map +0 -1
  111. package/lib/DropdownItem-75a2468a.js.map +0 -1
  112. package/lib/FocusableMixin-003e1094.js +0 -2
  113. package/lib/FormField-0783cb5a.js.map +0 -1
  114. package/lib/Sticky-220280e0.js.map +0 -1
  115. package/lib/cond-77258def.js +0 -2
  116. package/lib/query-assigned-elements-2f8275b7.js.map +0 -1
  117. package/lib/style-map-75ce20b3.js +0 -7
  118. package/lib/style-map-75ce20b3.js.map +0 -1
@@ -628,119 +628,6 @@
628
628
  }
629
629
  ]
630
630
  },
631
- {
632
- "kind": "javascript-module",
633
- "path": "src/badge/Badge.ts",
634
- "declarations": [
635
- {
636
- "kind": "class",
637
- "description": "Badges are used to inform users of the status of an object\nor of an action that’s been taken. Commonly used in tabular\ndata to indicate status.",
638
- "name": "Badge",
639
- "slots": [
640
- {
641
- "description": "The badge content.",
642
- "name": ""
643
- },
644
- {
645
- "description": "Used to place an icon at the start of badge.",
646
- "name": "icon"
647
- }
648
- ],
649
- "members": [
650
- {
651
- "kind": "field",
652
- "name": "type",
653
- "type": {
654
- "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | \"neutral\" | \"progress\" | undefined"
655
- },
656
- "description": "The type of badge.\nDetermines the background color of the badge.",
657
- "deprecated": "Use `variant` instead. If you previously used `\"progress\"`, use `\"info\"` instead.",
658
- "attribute": "type",
659
- "reflects": true
660
- },
661
- {
662
- "kind": "field",
663
- "name": "variant",
664
- "type": {
665
- "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"neutral\" | \"info\" | undefined"
666
- },
667
- "description": "The style variant of the badge.\nDetermines the background color of the badge.",
668
- "attribute": "variant",
669
- "reflects": true
670
- },
671
- {
672
- "kind": "field",
673
- "name": "strong",
674
- "type": {
675
- "text": "boolean"
676
- },
677
- "default": "false",
678
- "description": "Strong badges are a secondary style for badges.\nThey provide more visual prominence and emphasize them.",
679
- "attribute": "strong",
680
- "reflects": true
681
- }
682
- ],
683
- "attributes": [
684
- {
685
- "name": "type",
686
- "type": {
687
- "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | \"neutral\" | \"progress\" | undefined"
688
- },
689
- "description": "The type of badge.\nDetermines the background color of the badge.",
690
- "deprecated": "Use `variant` instead. If you previously used `\"progress\"`, use `\"info\"` instead.",
691
- "fieldName": "type"
692
- },
693
- {
694
- "name": "variant",
695
- "type": {
696
- "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"neutral\" | \"info\" | undefined"
697
- },
698
- "description": "The style variant of the badge.\nDetermines the background color of the badge.",
699
- "fieldName": "variant"
700
- },
701
- {
702
- "name": "strong",
703
- "type": {
704
- "text": "boolean"
705
- },
706
- "default": "false",
707
- "description": "Strong badges are a secondary style for badges.\nThey provide more visual prominence and emphasize them.",
708
- "fieldName": "strong"
709
- }
710
- ],
711
- "superclass": {
712
- "name": "LitElement",
713
- "package": "lit"
714
- },
715
- "localization": [],
716
- "status": "ready",
717
- "category": "text",
718
- "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use established variants and color patterns so that users can clearly identify the importance level.\n- Use to show a status update on a piece of information or action.\n- Use to mark something as a “draft” or “new”.\n- Use when you want to highlight something that has been added recently.\n- Always position badge so that it’s clear to understand what object it’s related to.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make badges clickable. Instead use button component’s small variant.\n- Don’t use alternatives to existing badge variants.\n\n</div>\n\n---\n\n## Content guidelines\n\nBadge labels should use a single word to describe the status of an object. Only use two words if you need to describe a complex state:\n\n<div class=\"n-usage n-usage-do\">Complete</div>\n<div class=\"n-usage n-usage-dont\">Action completed</div>\n\nWhen writing badge labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">Partially refunded</div>\n<div class=\"n-usage n-usage-dont\">Partially Refunded</div>\n\nAvoid unnecessary words and articles in badge labels, such as “is”, “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Pending</div>\n<div class=\"n-usage n-usage-dont\">Item is pending</div>\n\nAlways describe the status in the past tense:\n\n<div class=\"n-usage n-usage-do\">Refunded</div>\n<div class=\"n-usage n-usage-dont\">Refund</div>\n\n---\n\n## Variants\n\nThis section describes the different component variants, their purpose, and when to use each variant.\n\n| Name | Purpose |\n| ----------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| `neutral` | The default style variant. |\n| `info` | Used to convey general information that isn’t critical. |\n| `success` | Used to convey success states. For example, you might want to show a badge that tells the user a payment was successful. |\n| `highlight` | Used to highlight specific items in the interface, like notifications. |\n| `danger` | Used to communicate problems that have to be resolved so that user can continue forward. Should always be used for highlighting errors. |\n| `warning` | Used to display information that needs a user’s attention attention and may require further steps. |\n| `progress` | Used to convey something that’s in progress. |\n",
719
- "examples": [],
720
- "dependencies": [],
721
- "tagName": "nord-badge",
722
- "customElement": true
723
- }
724
- ],
725
- "exports": [
726
- {
727
- "kind": "js",
728
- "name": "default",
729
- "declaration": {
730
- "name": "Badge",
731
- "module": "src/badge/Badge.ts"
732
- }
733
- },
734
- {
735
- "kind": "custom-element-definition",
736
- "name": "nord-badge",
737
- "declaration": {
738
- "name": "Badge",
739
- "module": "src/badge/Badge.ts"
740
- }
741
- }
742
- ]
743
- },
744
631
  {
745
632
  "kind": "javascript-module",
746
633
  "path": "src/banner/Banner.ts",
@@ -828,246 +715,197 @@
828
715
  },
829
716
  {
830
717
  "kind": "javascript-module",
831
- "path": "src/button-group/ButtonGroup.ts",
718
+ "path": "src/button/Button.ts",
832
719
  "declarations": [
833
720
  {
834
721
  "kind": "class",
835
- "description": "Button groups are designed to bring together button controls that are of a similar nature. For example text formatting controls.",
836
- "name": "ButtonGroup",
722
+ "description": "Buttons are used for interface actions. Primary style should be\nused only once per section for main call-to-action, while other\nstyles can appear more frequently.",
723
+ "name": "Button",
837
724
  "cssProperties": [
838
725
  {
839
726
  "description": "Controls the rounded corners of the button, using [border radius tokens](/tokens/#border-radius).",
840
- "name": "--n-button-group-border-radius",
727
+ "name": "--n-button-border-radius",
841
728
  "default": "var(--n-border-radius-s)"
842
729
  },
843
730
  {
844
- "description": "Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).",
845
- "name": "--n-button-group-box-shadow",
731
+ "description": "Controls the spacing between items within the button, using our [spacing tokens](/tokens/#space).",
732
+ "name": "--n-button-gap",
733
+ "default": "var(--n-space-s)"
734
+ },
735
+ {
736
+ "description": "Controls the overlayed gradient background on the button.",
737
+ "name": "--n-button-gradient",
738
+ "default": "linear-gradient(to bottom, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.013) 100%))"
739
+ },
740
+ {
741
+ "description": "Controls the background color of the button, using our [color tokens](/tokens/#color).",
742
+ "name": "--n-button-background-color",
743
+ "default": "var(--n-color-button)"
744
+ },
745
+ {
746
+ "description": "Controls the border color of the button, using our [color tokens](/tokens/#color).",
747
+ "name": "--n-button-border-color",
748
+ "default": "var(--n-color-border-strong)"
749
+ },
750
+ {
751
+ "description": "Controls the text alignment for the text in the button.",
752
+ "name": "--n-button-text-align",
753
+ "default": "center"
754
+ },
755
+ {
756
+ "description": "Controls the surrounding shadow, using our [box shadow tokens](/tokens/#box-shadow).",
757
+ "name": "--n-button-box-shadow",
846
758
  "default": "var(--n-box-shadow)"
759
+ },
760
+ {
761
+ "description": "Controls the color of the text within the button, using our [color tokens](/tokens/#color).",
762
+ "name": "--n-button-color",
763
+ "default": "var(--n-color-text)"
764
+ },
765
+ {
766
+ "description": "Controls the inline, or left and right, padding of the button.",
767
+ "name": "--n-button-padding-inline",
768
+ "default": "calc(var(--n-space-m) / 1.2)"
769
+ },
770
+ {
771
+ "description": "Controls the size of the text within the button, using our [font tokens](/tokens/#font).",
772
+ "name": "--n-button-font-size",
773
+ "default": "var(--n-font-size-m)"
774
+ },
775
+ {
776
+ "description": "Controls the weight of the text within the button, using our [font tokens](/tokens/#font).",
777
+ "name": "--n-button-font-weight",
778
+ "default": "var(--n-font-weight)"
779
+ },
780
+ {
781
+ "description": "Controls the minimum block size, or height, of the button using our [spacing tokens](/tokens/#space).",
782
+ "name": "--n-button-min-block-size",
783
+ "default": "var(--n-space-xl)"
784
+ },
785
+ {
786
+ "description": "Controls the color of toggle icon that gets rendered when the button is used as a [Dropdown](/components/dropdown/) toggle.",
787
+ "name": "--n-button-toggle-icon-color",
788
+ "default": "var(--n-color-icon)"
847
789
  }
848
790
  ],
849
791
  "slots": [
850
792
  {
851
- "description": "The button group content",
793
+ "description": "The button content",
852
794
  "name": ""
795
+ },
796
+ {
797
+ "description": "Used to place content at the start of button text. Typically used for icons.",
798
+ "name": "start"
799
+ },
800
+ {
801
+ "description": "Used to place content at the end of button text. Typically used for icons.",
802
+ "name": "end"
853
803
  }
854
804
  ],
855
805
  "members": [
856
806
  {
857
807
  "kind": "field",
858
- "name": "direction",
808
+ "name": "defaultSlot",
809
+ "privacy": "private",
810
+ "default": "new SlotController(this)"
811
+ },
812
+ {
813
+ "kind": "field",
814
+ "name": "buttonRef",
815
+ "privacy": "private"
816
+ },
817
+ {
818
+ "kind": "field",
819
+ "name": "events",
820
+ "privacy": "private",
821
+ "default": "new EventController(this)"
822
+ },
823
+ {
824
+ "kind": "field",
825
+ "name": "lightDom",
826
+ "privacy": "private",
827
+ "default": "new LightDomController(this, {\n render: () => this.renderLightDom(),\n })"
828
+ },
829
+ {
830
+ "kind": "field",
831
+ "name": "variant",
859
832
  "type": {
860
- "text": "\"vertical\" | \"horizontal\""
833
+ "text": "\"default\" | \"primary\" | \"dashed\" | \"plain\" | \"danger\""
861
834
  },
862
- "default": "\"horizontal\"",
863
- "description": "The direction of the button group.",
864
- "attribute": "direction",
835
+ "default": "\"default\"",
836
+ "description": "The style variant of the button.",
837
+ "attribute": "variant",
865
838
  "reflects": true
866
839
  },
867
840
  {
868
841
  "kind": "field",
869
- "name": "role",
842
+ "name": "type",
870
843
  "type": {
871
- "text": "string"
844
+ "text": "\"button\" | \"submit\" | \"reset\""
872
845
  },
873
- "default": "\"group\"",
874
- "description": "The appropriate role for the containing element.",
875
- "attribute": "role",
846
+ "default": "\"submit\"",
847
+ "description": "The type of the button.",
848
+ "attribute": "type",
876
849
  "reflects": true
877
- }
878
- ],
879
- "attributes": [
850
+ },
880
851
  {
881
- "name": "direction",
852
+ "kind": "field",
853
+ "name": "size",
882
854
  "type": {
883
- "text": "\"vertical\" | \"horizontal\""
855
+ "text": "\"s\" | \"m\" | \"l\""
884
856
  },
885
- "default": "\"horizontal\"",
886
- "description": "The direction of the button group.",
887
- "fieldName": "direction"
857
+ "default": "\"m\"",
858
+ "description": "The size of the button.\nThis affects font-size and padding.",
859
+ "attribute": "size",
860
+ "reflects": true
888
861
  },
889
862
  {
890
- "name": "role",
863
+ "kind": "field",
864
+ "name": "accessibleExpanded",
891
865
  "type": {
892
- "text": "string"
866
+ "text": "\"true\" | \"false\" | undefined"
893
867
  },
894
- "default": "\"group\"",
895
- "description": "The appropriate role for the containing element.",
896
- "fieldName": "role"
897
- }
898
- ],
899
- "superclass": {
900
- "name": "LitElement",
901
- "package": "lit"
902
- },
903
- "localization": [],
904
- "status": "new",
905
- "category": "structure",
906
- "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to group together buttons, or dropdowns, of a similar nature or purpose.\n- Use the appropriate `role` attribute on the button group to provide additional semantics.\n- Use an `aria-labelledby` attribute referencing another element to best explain the contents of the button group.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t add components other than buttons, dropdowns and in some instances visually hidden components to the button group.\n- Don’t skip the addition of an appropriate label if the added `role` attribute value calls for it.\n- Don’t use for building grid based layouts.\n\n</div>\n\n---\n\n## Content guidelines\n\nButton labels should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they click a button:\n\n<div class=\"n-usage n-usage-do\">View user settings</div>\n<div class=\"n-usage n-usage-dont\">Click here</div>\n\nWhen writing button labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">My tasks</div>\n<div class=\"n-usage n-usage-dont\">My Tasks</div>\n\nAvoid unnecessary words and articles in button labels, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Add item</div>\n<div class=\"n-usage n-usage-dont\">Add an item</div>\n",
907
- "examples": [],
908
- "dependencies": [],
909
- "tagName": "nord-button-group",
910
- "customElement": true
911
- }
912
- ],
913
- "exports": [
914
- {
915
- "kind": "js",
916
- "name": "default",
917
- "declaration": {
918
- "name": "ButtonGroup",
919
- "module": "src/button-group/ButtonGroup.ts"
920
- }
921
- },
922
- {
923
- "kind": "custom-element-definition",
924
- "name": "nord-button-group",
925
- "declaration": {
926
- "name": "ButtonGroup",
927
- "module": "src/button-group/ButtonGroup.ts"
928
- }
929
- }
930
- ]
931
- },
932
- {
933
- "kind": "javascript-module",
934
- "path": "src/calendar/Calendar.ts",
935
- "declarations": [
936
- {
937
- "kind": "class",
938
- "description": "Calendar allows user to pick a date. It comes with built-in\nfunctionality that allows you to set a minimum and a maximum allowed date.\nPlease note that the date must be passed in ISO-8601 format.",
939
- "name": "Calendar",
940
- "cssProperties": [
941
- {
942
- "description": "Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).",
943
- "name": "--n-calendar-border-radius",
944
- "default": "var(--n-border-radius)"
945
- },
946
- {
947
- "description": "Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).",
948
- "name": "--n-calendar-box-shadow",
949
- "default": "var(--n-box-shadow-popout)"
950
- }
951
- ],
952
- "members": [
953
- {
954
- "kind": "field",
955
- "name": "monthSelectNode",
956
- "type": {
957
- "text": "HTMLElement"
958
- },
959
- "privacy": "private"
960
- },
961
- {
962
- "kind": "field",
963
- "name": "focusedDayNode",
964
- "type": {
965
- "text": "HTMLButtonElement"
966
- },
967
- "privacy": "private"
968
- },
969
- {
970
- "kind": "field",
971
- "name": "direction",
972
- "privacy": "private",
973
- "default": "new DirectionController(this)"
974
- },
975
- {
976
- "kind": "field",
977
- "name": "swipe",
978
- "privacy": "private",
979
- "default": "new SwipeController(this, {\n matchesGesture: isHorizontalSwipe,\n onSwipeEnd: ({ distX }) => this.addMonths(distX < 0 ? 1 : -1),\n })"
980
- },
981
- {
982
- "kind": "field",
983
- "name": "shortcuts",
984
- "privacy": "private"
985
- },
986
- {
987
- "kind": "field",
988
- "name": "localize",
989
868
  "privacy": "private",
990
- "default": "new LocalizeController<\"nord-calendar\">(this, {\n onLangChange: () => this.handleLangChange(),\n })"
869
+ "attribute": "aria-expanded"
991
870
  },
992
871
  {
993
872
  "kind": "field",
994
- "name": "dateFormatShort",
873
+ "name": "accessibleHasPopup",
995
874
  "type": {
996
- "text": "Intl.DateTimeFormat"
875
+ "text": "| \"false\"\n | \"true\"\n | \"menu\"\n | \"listbox\"\n | \"tree\"\n | \"grid\"\n | \"dialog\" | undefined"
997
876
  },
998
877
  "privacy": "private",
999
- "description": "Whilst dateAdapter is used for handling the formatting/parsing dates in the input,\nthese are used to format dates exclusively for the benefit of screen readers.\n\nWe prefer DateTimeFormat over date.toLocaleDateString, as the former has\nbetter performance when formatting large number of dates. See:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString#Performance"
1000
- },
1001
- {
1002
- "kind": "field",
1003
- "name": "monthNames",
1004
- "type": {
1005
- "text": "string[]"
1006
- },
1007
- "privacy": "private"
1008
- },
1009
- {
1010
- "kind": "field",
1011
- "name": "monthNamesShort",
1012
- "type": {
1013
- "text": "string[]"
1014
- },
1015
- "privacy": "private"
1016
- },
1017
- {
1018
- "kind": "field",
1019
- "name": "dayNames",
1020
- "type": {
1021
- "text": "string[]"
1022
- },
1023
- "privacy": "private"
1024
- },
1025
- {
1026
- "kind": "field",
1027
- "name": "dayNamesShort",
1028
- "type": {
1029
- "text": "string[]"
1030
- },
1031
- "privacy": "private"
1032
- },
1033
- {
1034
- "kind": "field",
1035
- "name": "value",
1036
- "type": {
1037
- "text": "string"
1038
- },
1039
- "default": "\"\"",
1040
- "description": "The selected date on the calendar. Must be in IS0-8601 format: YYYY-MM-DD.",
1041
- "attribute": "value"
878
+ "attribute": "aria-haspopup"
1042
879
  },
1043
880
  {
1044
881
  "kind": "field",
1045
- "name": "firstDayOfWeek",
882
+ "name": "href",
1046
883
  "type": {
1047
- "text": "DaysOfWeek"
884
+ "text": "string | undefined"
1048
885
  },
1049
- "description": "Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\nDefault is Monday.",
1050
- "attribute": "firstDayOfWeek"
886
+ "description": "When provided, renders the button as a link,\nwith its href attribute set to the given value.",
887
+ "attribute": "href",
888
+ "reflects": true
1051
889
  },
1052
890
  {
1053
891
  "kind": "field",
1054
- "name": "min",
892
+ "name": "download",
1055
893
  "type": {
1056
- "text": "string"
894
+ "text": "boolean"
1057
895
  },
1058
- "default": "\"\"",
1059
- "description": "Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\nThis setting can be used alone or together with the max property.",
1060
- "attribute": "min"
896
+ "default": "false",
897
+ "description": "When provided together with a href property, the button will\ntrigger a file download instead of a page visit.",
898
+ "attribute": "download"
1061
899
  },
1062
900
  {
1063
901
  "kind": "field",
1064
- "name": "max",
902
+ "name": "target",
1065
903
  "type": {
1066
- "text": "string"
904
+ "text": "\"_self\" | \"_blank\" | \"_parent\" | \"_top\""
1067
905
  },
1068
- "default": "\"\"",
1069
- "description": "Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\nThis setting can be used alone or together with the min property.",
1070
- "attribute": "max"
906
+ "default": "\"_self\"",
907
+ "description": "When provided together with a href property, determines where\nto open the linked URL. The keywords have special meanings for\nwhere to load the URL: “_self” means the current browsing context,\n“_blank” usually a new tab but users can configure browsers this to\nopen a new window instead, “_parent” means the parent browsing\ncontext of the current one, but if no parent exists, behaves as\n_self, and finally “top” means the topmost browsing context.",
908
+ "attribute": "target"
1071
909
  },
1072
910
  {
1073
911
  "kind": "field",
@@ -1076,291 +914,372 @@
1076
914
  "text": "boolean"
1077
915
  },
1078
916
  "default": "false",
1079
- "description": "Controls whether the calendar expands to fill the width of its container.",
917
+ "description": "Controls whether the button expands to fill the width of its container.",
1080
918
  "attribute": "expand",
1081
919
  "reflects": true
1082
920
  },
1083
921
  {
1084
922
  "kind": "field",
1085
- "name": "isDateDisabled",
1086
- "type": {
1087
- "text": "DatePredicate"
1088
- },
1089
- "default": "isDateDisabled",
1090
- "description": "Controls which days are disabled and therefore disallowed.\nFor example, this can be used to disallow selection of weekends."
1091
- },
1092
- {
1093
- "kind": "field",
1094
- "name": "isDateHighlighted",
1095
- "type": {
1096
- "text": "(date: Date) => string | boolean"
1097
- },
1098
- "default": "isDateHighlighted",
1099
- "description": "Controls which days are highlighted with a small indicator.\nReturning a \"falsy\" value will not show an indicator.\nReturning \"truthy\" value will show the indicator, but without an accessible label.\nReturning a string will show the indicator, and use the string as accessible label.\nIt is recommended to return a string rather than a truthy value whenever possible."
1100
- },
1101
- {
1102
- "kind": "field",
1103
- "name": "activeFocus",
923
+ "name": "loading",
1104
924
  "type": {
1105
925
  "text": "boolean"
1106
926
  },
1107
- "privacy": "private",
1108
- "default": "false"
1109
- },
1110
- {
1111
- "kind": "field",
1112
- "name": "focusedDay",
1113
- "privacy": "private",
1114
- "default": "new Date()"
927
+ "default": "false",
928
+ "description": "Controls whether the button is in loading state. Please note that the spinner\nis hidden from assistive technologies, so you need to make sure to announce\nthe loading state to e.g. screen reader users. We also recommend disabling\nall user interactions on the button itself while in loading state.",
929
+ "attribute": "loading",
930
+ "reflects": true
1115
931
  },
1116
932
  {
1117
933
  "kind": "method",
1118
- "name": "focus",
934
+ "name": "renderLink",
935
+ "privacy": "private",
1119
936
  "parameters": [
1120
937
  {
1121
- "name": "options",
1122
- "optional": true,
938
+ "name": "innards",
1123
939
  "type": {
1124
- "text": "FocusOptions & { target: \"day\" | \"month\" }"
1125
- },
1126
- "description": "An object which controls aspects of the focusing process."
940
+ "text": "TemplateResult"
941
+ }
1127
942
  }
1128
943
  ],
1129
- "description": "Programmatically move focus to the calendar."
1130
- },
1131
- {
1132
- "kind": "method",
1133
- "name": "handleValueChange",
1134
- "privacy": "protected"
944
+ "description": "We jump through some hoops here to ensure the link is treated correctly when \"disabled\".\nLinks cannot be disabled natively, so we need to rely on some aria magic to get the correct semantics.\nAlong with the advice in the article below, we also set tabindex to \"-1\", so it is taken out of tab order."
1135
945
  },
1136
946
  {
1137
947
  "kind": "method",
1138
- "name": "handleFocusedDayChange",
1139
- "privacy": "protected"
948
+ "name": "renderButton",
949
+ "privacy": "private",
950
+ "parameters": [
951
+ {
952
+ "name": "innards",
953
+ "type": {
954
+ "text": "TemplateResult"
955
+ }
956
+ }
957
+ ]
1140
958
  },
1141
959
  {
1142
960
  "kind": "method",
1143
- "name": "handleLangChange",
961
+ "name": "renderLightDom",
1144
962
  "privacy": "private"
1145
963
  },
1146
964
  {
1147
965
  "kind": "field",
1148
- "name": "handleDaySelect",
966
+ "name": "handleOuterClick",
1149
967
  "privacy": "private"
1150
968
  },
1151
969
  {
1152
970
  "kind": "method",
1153
- "name": "addDays",
971
+ "name": "handleClick",
1154
972
  "privacy": "private",
1155
973
  "parameters": [
1156
974
  {
1157
- "name": "days",
975
+ "name": "e",
1158
976
  "type": {
1159
- "text": "number"
977
+ "text": "Event"
1160
978
  }
1161
979
  }
1162
980
  ]
1163
981
  },
1164
982
  {
1165
983
  "kind": "method",
1166
- "name": "addMonths",
984
+ "name": "handleProxyChange",
1167
985
  "privacy": "private",
1168
986
  "parameters": [
1169
987
  {
1170
- "name": "months",
988
+ "name": "e",
1171
989
  "type": {
1172
- "text": "number"
990
+ "text": "Event"
1173
991
  }
1174
992
  }
1175
- ]
993
+ ],
994
+ "description": "React/Vue etc may remove our proxy button when updating button text, since they are unaware of its existence.\nSo we listen for a slotchange event, and if the element is no longer connected to the DOM we add it back in."
1176
995
  },
1177
996
  {
1178
- "kind": "method",
1179
- "name": "addYears",
1180
- "privacy": "private",
1181
- "parameters": [
1182
- {
1183
- "name": "years",
1184
- "type": {
1185
- "text": "number"
1186
- }
1187
- }
1188
- ]
1189
- },
1190
- {
1191
- "kind": "method",
1192
- "name": "startOfWeek",
1193
- "privacy": "private"
1194
- },
1195
- {
1196
- "kind": "method",
1197
- "name": "endOfWeek",
1198
- "privacy": "private"
997
+ "kind": "field",
998
+ "name": "disabled",
999
+ "type": {
1000
+ "text": "boolean"
1001
+ },
1002
+ "default": "false",
1003
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
1004
+ "attribute": "disabled",
1005
+ "reflects": true,
1006
+ "inheritedFrom": {
1007
+ "name": "InputMixin",
1008
+ "module": "src/common/mixins/InputMixin.ts"
1009
+ }
1199
1010
  },
1200
1011
  {
1201
- "kind": "method",
1202
- "name": "setMonth",
1203
- "privacy": "private",
1204
- "parameters": [
1205
- {
1206
- "name": "month",
1207
- "type": {
1208
- "text": "number"
1209
- }
1210
- }
1211
- ]
1012
+ "kind": "field",
1013
+ "name": "name",
1014
+ "type": {
1015
+ "text": "string | undefined"
1016
+ },
1017
+ "description": "The name of the form component.",
1018
+ "attribute": "name",
1019
+ "inheritedFrom": {
1020
+ "name": "InputMixin",
1021
+ "module": "src/common/mixins/InputMixin.ts"
1022
+ }
1212
1023
  },
1213
1024
  {
1214
- "kind": "method",
1215
- "name": "setYear",
1216
- "privacy": "private",
1217
- "parameters": [
1218
- {
1219
- "name": "year",
1220
- "type": {
1221
- "text": "number"
1222
- }
1223
- }
1224
- ]
1025
+ "kind": "field",
1026
+ "name": "value",
1027
+ "type": {
1028
+ "text": "string"
1029
+ },
1030
+ "default": "\"\"",
1031
+ "description": "The value of the form component.",
1032
+ "attribute": "value",
1033
+ "inheritedFrom": {
1034
+ "name": "InputMixin",
1035
+ "module": "src/common/mixins/InputMixin.ts"
1036
+ }
1225
1037
  },
1226
1038
  {
1227
- "kind": "method",
1228
- "name": "setFocusedDay",
1039
+ "kind": "field",
1040
+ "name": "formAncestor",
1041
+ "type": {
1042
+ "text": "HTMLFormElement | null"
1043
+ },
1229
1044
  "privacy": "private",
1230
- "parameters": [
1231
- {
1232
- "name": "day",
1233
- "type": {
1234
- "text": "Date"
1235
- }
1236
- }
1237
- ]
1045
+ "default": "null",
1046
+ "inheritedFrom": {
1047
+ "name": "InputMixin",
1048
+ "module": "src/common/mixins/InputMixin.ts"
1049
+ }
1238
1050
  },
1239
1051
  {
1240
1052
  "kind": "field",
1241
- "name": "handleMonthSelect",
1242
- "privacy": "private"
1053
+ "name": "_formId",
1054
+ "type": {
1055
+ "text": "string | undefined"
1056
+ },
1057
+ "privacy": "protected",
1058
+ "inheritedFrom": {
1059
+ "name": "InputMixin",
1060
+ "module": "src/common/mixins/InputMixin.ts"
1061
+ }
1243
1062
  },
1244
1063
  {
1245
1064
  "kind": "field",
1246
- "name": "handleYearSelect",
1247
- "privacy": "private"
1065
+ "name": "form",
1066
+ "type": {
1067
+ "text": "HTMLFormElement | null"
1068
+ },
1069
+ "description": "Gets the form, if any, associated with the form element.\nThe setter accepts a string, which is the id of the form.",
1070
+ "attribute": "form",
1071
+ "inheritedFrom": {
1072
+ "name": "InputMixin",
1073
+ "module": "src/common/mixins/InputMixin.ts"
1074
+ }
1248
1075
  },
1249
1076
  {
1250
1077
  "kind": "field",
1251
- "name": "handleNextMonthClick",
1252
- "privacy": "private"
1078
+ "name": "focusableRef",
1079
+ "privacy": "protected",
1080
+ "inheritedFrom": {
1081
+ "name": "FocusableMixin",
1082
+ "module": "src/common/mixins/FocusableMixin.ts"
1083
+ }
1253
1084
  },
1254
1085
  {
1255
- "kind": "field",
1256
- "name": "handlePreviousMonthClick",
1257
- "privacy": "private"
1086
+ "kind": "method",
1087
+ "name": "focus",
1088
+ "parameters": [
1089
+ {
1090
+ "name": "options",
1091
+ "optional": true,
1092
+ "type": {
1093
+ "text": "FocusOptions"
1094
+ },
1095
+ "description": "An object which controls aspects of the focusing process."
1096
+ }
1097
+ ],
1098
+ "description": "Programmatically move focus to the component.",
1099
+ "inheritedFrom": {
1100
+ "name": "FocusableMixin",
1101
+ "module": "src/common/mixins/FocusableMixin.ts"
1102
+ }
1258
1103
  },
1259
1104
  {
1260
- "kind": "field",
1261
- "name": "enableActiveFocus",
1262
- "privacy": "private"
1105
+ "kind": "method",
1106
+ "name": "blur",
1107
+ "description": "Programmatically remove focus from the component.",
1108
+ "inheritedFrom": {
1109
+ "name": "FocusableMixin",
1110
+ "module": "src/common/mixins/FocusableMixin.ts"
1111
+ }
1263
1112
  },
1264
1113
  {
1265
- "kind": "field",
1266
- "name": "disableActiveFocus",
1267
- "privacy": "private"
1114
+ "kind": "method",
1115
+ "name": "click",
1116
+ "description": "Programmatically simulates a click on the component.",
1117
+ "inheritedFrom": {
1118
+ "name": "FocusableMixin",
1119
+ "module": "src/common/mixins/FocusableMixin.ts"
1120
+ }
1268
1121
  }
1269
1122
  ],
1270
- "events": [
1123
+ "attributes": [
1271
1124
  {
1272
- "name": "nord-focus-date",
1125
+ "name": "variant",
1273
1126
  "type": {
1274
- "text": "DateSelectEvent"
1127
+ "text": "\"default\" | \"primary\" | \"dashed\" | \"plain\" | \"danger\""
1275
1128
  },
1276
- "description": "Dispatched when the calendar's focused date changes."
1129
+ "default": "\"default\"",
1130
+ "description": "The style variant of the button.",
1131
+ "fieldName": "variant"
1277
1132
  },
1278
1133
  {
1134
+ "name": "type",
1279
1135
  "type": {
1280
- "text": "DateSelectEvent"
1136
+ "text": "\"button\" | \"submit\" | \"reset\""
1281
1137
  },
1282
- "description": "Dispatched when a date is selected and the value changes.",
1283
- "name": "change"
1284
- }
1285
- ],
1286
- "attributes": [
1138
+ "default": "\"submit\"",
1139
+ "description": "The type of the button.",
1140
+ "fieldName": "type"
1141
+ },
1287
1142
  {
1288
- "name": "value",
1143
+ "name": "size",
1289
1144
  "type": {
1290
- "text": "string"
1145
+ "text": "\"s\" | \"m\" | \"l\""
1291
1146
  },
1292
- "default": "\"\"",
1293
- "description": "The selected date on the calendar. Must be in IS0-8601 format: YYYY-MM-DD.",
1294
- "fieldName": "value"
1147
+ "default": "\"m\"",
1148
+ "description": "The size of the button.\nThis affects font-size and padding.",
1149
+ "fieldName": "size"
1295
1150
  },
1296
1151
  {
1297
- "name": "firstDayOfWeek",
1152
+ "name": "aria-expanded",
1298
1153
  "type": {
1299
- "text": "DaysOfWeek"
1154
+ "text": "\"true\" | \"false\" | undefined"
1300
1155
  },
1301
- "description": "Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\nDefault is Monday.",
1302
- "fieldName": "firstDayOfWeek"
1156
+ "fieldName": "accessibleExpanded"
1303
1157
  },
1304
1158
  {
1305
- "name": "min",
1159
+ "name": "aria-haspopup",
1306
1160
  "type": {
1307
- "text": "string"
1161
+ "text": "| \"false\"\n | \"true\"\n | \"menu\"\n | \"listbox\"\n | \"tree\"\n | \"grid\"\n | \"dialog\" | undefined"
1308
1162
  },
1309
- "default": "\"\"",
1310
- "description": "Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\nThis setting can be used alone or together with the max property.",
1311
- "fieldName": "min"
1163
+ "fieldName": "accessibleHasPopup"
1312
1164
  },
1313
1165
  {
1314
- "name": "max",
1166
+ "name": "href",
1315
1167
  "type": {
1316
- "text": "string"
1168
+ "text": "string | undefined"
1317
1169
  },
1318
- "default": "\"\"",
1319
- "description": "Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\nThis setting can be used alone or together with the min property.",
1320
- "fieldName": "max"
1170
+ "description": "When provided, renders the button as a link,\nwith its href attribute set to the given value.",
1171
+ "fieldName": "href"
1321
1172
  },
1322
1173
  {
1323
- "name": "expand",
1174
+ "name": "download",
1324
1175
  "type": {
1325
1176
  "text": "boolean"
1326
1177
  },
1327
1178
  "default": "false",
1328
- "description": "Controls whether the calendar expands to fill the width of its container.",
1329
- "fieldName": "expand"
1330
- }
1331
- ],
1332
- "superclass": {
1333
- "name": "LitElement",
1334
- "package": "lit"
1335
- },
1336
- "localization": [
1337
- {
1338
- "name": "prevMonthLabel",
1339
- "description": "Accessible label for the previous month button."
1340
- },
1341
- {
1342
- "name": "nextMonthLabel",
1343
- "description": "Accessible label for the next month button."
1179
+ "description": "When provided together with a href property, the button will\ntrigger a file download instead of a page visit.",
1180
+ "fieldName": "download"
1344
1181
  },
1345
1182
  {
1346
- "name": "monthSelectLabel",
1347
- "description": "Accessible label for the month select."
1183
+ "name": "target",
1184
+ "type": {
1185
+ "text": "\"_self\" | \"_blank\" | \"_parent\" | \"_top\""
1186
+ },
1187
+ "default": "\"_self\"",
1188
+ "description": "When provided together with a href property, determines where\nto open the linked URL. The keywords have special meanings for\nwhere to load the URL: “_self” means the current browsing context,\n“_blank” usually a new tab but users can configure browsers this to\nopen a new window instead, “_parent” means the parent browsing\ncontext of the current one, but if no parent exists, behaves as\n_self, and finally “top” means the topmost browsing context.",
1189
+ "fieldName": "target"
1348
1190
  },
1349
1191
  {
1350
- "name": "yearSelectLabel",
1351
- "description": "Accessible label for the year select."
1192
+ "name": "expand",
1193
+ "type": {
1194
+ "text": "boolean"
1195
+ },
1196
+ "default": "false",
1197
+ "description": "Controls whether the button expands to fill the width of its container.",
1198
+ "fieldName": "expand"
1199
+ },
1200
+ {
1201
+ "name": "loading",
1202
+ "type": {
1203
+ "text": "boolean"
1204
+ },
1205
+ "default": "false",
1206
+ "description": "Controls whether the button is in loading state. Please note that the spinner\nis hidden from assistive technologies, so you need to make sure to announce\nthe loading state to e.g. screen reader users. We also recommend disabling\nall user interactions on the button itself while in loading state.",
1207
+ "fieldName": "loading"
1208
+ },
1209
+ {
1210
+ "name": "disabled",
1211
+ "type": {
1212
+ "text": "boolean"
1213
+ },
1214
+ "default": "false",
1215
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
1216
+ "fieldName": "disabled",
1217
+ "inheritedFrom": {
1218
+ "name": "InputMixin",
1219
+ "module": "src/common/mixins/InputMixin.ts"
1220
+ }
1221
+ },
1222
+ {
1223
+ "name": "name",
1224
+ "type": {
1225
+ "text": "string | undefined"
1226
+ },
1227
+ "description": "The name of the form component.",
1228
+ "fieldName": "name",
1229
+ "inheritedFrom": {
1230
+ "name": "InputMixin",
1231
+ "module": "src/common/mixins/InputMixin.ts"
1232
+ }
1233
+ },
1234
+ {
1235
+ "name": "value",
1236
+ "type": {
1237
+ "text": "string"
1238
+ },
1239
+ "default": "\"\"",
1240
+ "description": "The value of the form component.",
1241
+ "fieldName": "value",
1242
+ "inheritedFrom": {
1243
+ "name": "InputMixin",
1244
+ "module": "src/common/mixins/InputMixin.ts"
1245
+ }
1246
+ },
1247
+ {
1248
+ "name": "form",
1249
+ "type": {
1250
+ "text": "HTMLFormElement | null"
1251
+ },
1252
+ "description": "Gets the form, if any, associated with the form element.\nThe setter accepts a string, which is the id of the form.",
1253
+ "fieldName": "form",
1254
+ "inheritedFrom": {
1255
+ "name": "InputMixin",
1256
+ "module": "src/common/mixins/InputMixin.ts"
1257
+ }
1258
+ }
1259
+ ],
1260
+ "mixins": [
1261
+ {
1262
+ "name": "InputMixin",
1263
+ "module": "/src/common/mixins/InputMixin.js"
1264
+ },
1265
+ {
1266
+ "name": "FocusableMixin",
1267
+ "module": "/src/common/mixins/FocusableMixin.js"
1352
1268
  }
1353
1269
  ],
1270
+ "superclass": {
1271
+ "name": "LitElement",
1272
+ "package": "lit"
1273
+ },
1274
+ "localization": [],
1354
1275
  "status": "ready",
1355
- "category": "list",
1356
- "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n- Close calendar after a single date is selected, unless a range with a start and end date is required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Dont use for entering date of birth. Use input component instead.\n- Don’t use for choosing a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nCalendar component is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Calendar grid\n\n- `Space, Enter`: Selects a date.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n",
1276
+ "category": "action",
1277
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Only use one primary button per section, as a main call-to-action.\n- Use clear and accurate labels.\n- Use established button colors appropriately. For example, only use a danger button style for an action that’s difficult or impossible to undo.\n- Prioritize the most important actions. Too many buttons will cause confusion.\n- Be consistent with positioning of buttons in the user interface.\n- Use strong, actionable verbs in labels such as “Add”, “Close”, “Cancel”, or “Save”.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don't use a primary button in every row of a table.\n- Don’t use buttons to link to other pages. Use regular link or a plain style instead where necessary.\n- Don’t use buttons for navigation where the link appears within or following a sentence.\n- Don’t use labels such as “Read more”, “Click here” or “More”.\n\n</div>\n\n---\n\n## Content guidelines\n\nButton labels should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they click a button:\n\n<div class=\"n-usage n-usage-do\">View user settings</div>\n<div class=\"n-usage n-usage-dont\">Click here</div>\n\nWhen writing button labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">My tasks</div>\n<div class=\"n-usage n-usage-dont\">My Tasks</div>\n\nAvoid unnecessary words and articles in button labels, such as the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Add item</div>\n<div class=\"n-usage n-usage-dont\">Add an item</div>\n\n---\n\n## Variants\n\nThis section describes the different component variants, their purpose, and when to use each variant.\n\n| Name | Purpose |\n| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `default` | Default style is the most common button variant. Only switch to another variant if you need to adjust the visual weight of the element. |\n| `primary` | Primary style is reserved for main call-to-actions. Should be used only once per content area or panel, e.g. for a “Save” action. |\n| `dashed` | Dashed style should be used for actions that trigger filtering. |\n| `danger` | Danger style should be used for actions that delete data or otherwise make it hard to undo the action. |\n| `plain` | Used for less important or less common actions. Can be also used for linking to other pages. |\n| `disabled` | Used for actions that aren’t currently available or not available anymore. Also prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies. |\n\n---\n\n## Icon usage in button\n\nIllustrative icons should be always positioned in the `start` slot:\n\n<img src=\"/img/components/button/start-slot.png\" class=\"n-border n-border-radius\" style=\"max-width:700px;\" loading=\"lazy\" height=\"475\" width=\"800\" alt=\"Button with icon in start slot\" />\n\nWhen a button is used as a dropdown toggle, the `interface-dropdown-small` icon from [Nordicons](/nordicons/) is automatically placed in the `end` slot:\n\n<img src=\"/img/components/button/dropdown.png\" class=\"n-border n-border-radius\" style=\"max-width:700px;\" loading=\"lazy\" height=\"475\" width=\"800\" alt=\"Dropdown button\" />\n\nEach button size has a recommended icon size. The medium button uses the `s` icon size, the [small button](/components/button/?example=small+buttons) uses the `xs` icon size, and the [large button](/components/button/?example=large+buttons) uses the `m` icon size. The icon will adjust size automatically based on the button size, so you will get the correct behavior by default. However, this can be overridden by explicitly setting a size on the icon.\n\n<img src=\"/img/components/button/icon-sizes.png\" class=\"n-border n-border-radius\" style=\"max-width:700px;\" loading=\"lazy\" height=\"475\" width=\"800\" alt=\"Button icon sizes\" />\n\nUse `interface-add-small` icon in the `start` slot for create/add type primary actions in the [header](/components/header/):\n\n<img src=\"/img/components/button/create.png\" class=\"n-border n-border-radius\" style=\"max-width:700px;\" loading=\"lazy\" height=\"475\" width=\"800\" alt=\"Create/add type primary action with icon\" />\n\n---\n\n## Additional considerations\n\n- Users of assistive technology expect a button to submit data or do an action. If you need the button to navigate into another view, use the `href` property which will output `<a>` tag instead of a `<button>`.\n- When you need to disable a button, use `disabled` property as it conveys this information correctly to assistive technologies like screen readers.\n- Button component provides 3 size variants; small, medium and large. The large size should only be used for marketing purposes or on areas such as an empty space/content notice.\n",
1357
1278
  "examples": [],
1358
1279
  "dependencies": [
1359
- "button",
1360
- "visually-hidden",
1361
- "icon"
1280
+ "spinner"
1362
1281
  ],
1363
- "tagName": "nord-calendar",
1282
+ "tagName": "nord-button",
1364
1283
  "customElement": true
1365
1284
  }
1366
1285
  ],
@@ -1369,262 +1288,375 @@
1369
1288
  "kind": "js",
1370
1289
  "name": "default",
1371
1290
  "declaration": {
1372
- "name": "Calendar",
1373
- "module": "src/calendar/Calendar.ts"
1291
+ "name": "Button",
1292
+ "module": "src/button/Button.ts"
1374
1293
  }
1375
1294
  },
1376
1295
  {
1377
1296
  "kind": "custom-element-definition",
1378
- "name": "nord-calendar",
1297
+ "name": "nord-button",
1379
1298
  "declaration": {
1380
- "name": "Calendar",
1381
- "module": "src/calendar/Calendar.ts"
1299
+ "name": "Button",
1300
+ "module": "src/button/Button.ts"
1382
1301
  }
1383
1302
  }
1384
1303
  ]
1385
1304
  },
1386
1305
  {
1387
1306
  "kind": "javascript-module",
1388
- "path": "src/calendar/DateSelectEvent.ts",
1307
+ "path": "src/button-group/ButtonGroup.ts",
1389
1308
  "declarations": [
1390
1309
  {
1391
1310
  "kind": "class",
1392
- "description": "",
1393
- "name": "DateSelectEvent",
1311
+ "description": "Button groups are designed to bring together button controls that are of a similar nature. For example text formatting controls.",
1312
+ "name": "ButtonGroup",
1313
+ "cssProperties": [
1314
+ {
1315
+ "description": "Controls the rounded corners of the button, using [border radius tokens](/tokens/#border-radius).",
1316
+ "name": "--n-button-group-border-radius",
1317
+ "default": "var(--n-border-radius-s)"
1318
+ },
1319
+ {
1320
+ "description": "Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).",
1321
+ "name": "--n-button-group-box-shadow",
1322
+ "default": "var(--n-box-shadow)"
1323
+ }
1324
+ ],
1325
+ "slots": [
1326
+ {
1327
+ "description": "The button group content",
1328
+ "name": ""
1329
+ }
1330
+ ],
1331
+ "members": [
1332
+ {
1333
+ "kind": "field",
1334
+ "name": "direction",
1335
+ "type": {
1336
+ "text": "\"vertical\" | \"horizontal\""
1337
+ },
1338
+ "default": "\"horizontal\"",
1339
+ "description": "The direction of the button group.",
1340
+ "attribute": "direction",
1341
+ "reflects": true
1342
+ },
1343
+ {
1344
+ "kind": "field",
1345
+ "name": "role",
1346
+ "type": {
1347
+ "text": "string"
1348
+ },
1349
+ "default": "\"group\"",
1350
+ "description": "The appropriate role for the containing element.",
1351
+ "attribute": "role",
1352
+ "reflects": true
1353
+ }
1354
+ ],
1355
+ "attributes": [
1356
+ {
1357
+ "name": "direction",
1358
+ "type": {
1359
+ "text": "\"vertical\" | \"horizontal\""
1360
+ },
1361
+ "default": "\"horizontal\"",
1362
+ "description": "The direction of the button group.",
1363
+ "fieldName": "direction"
1364
+ },
1365
+ {
1366
+ "name": "role",
1367
+ "type": {
1368
+ "text": "string"
1369
+ },
1370
+ "default": "\"group\"",
1371
+ "description": "The appropriate role for the containing element.",
1372
+ "fieldName": "role"
1373
+ }
1374
+ ],
1394
1375
  "superclass": {
1395
- "name": "NordEvent",
1396
- "module": "/src/common/events.js"
1397
- }
1376
+ "name": "LitElement",
1377
+ "package": "lit"
1378
+ },
1379
+ "localization": [],
1380
+ "status": "new",
1381
+ "category": "structure",
1382
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to group together buttons, or dropdowns, of a similar nature or purpose.\n- Use the appropriate `role` attribute on the button group to provide additional semantics.\n- Use an `aria-labelledby` attribute referencing another element to best explain the contents of the button group.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t add components other than buttons, dropdowns and in some instances visually hidden components to the button group.\n- Don’t skip the addition of an appropriate label if the added `role` attribute value calls for it.\n- Don’t use for building grid based layouts.\n\n</div>\n\n---\n\n## Content guidelines\n\nButton labels should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they click a button:\n\n<div class=\"n-usage n-usage-do\">View user settings</div>\n<div class=\"n-usage n-usage-dont\">Click here</div>\n\nWhen writing button labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">My tasks</div>\n<div class=\"n-usage n-usage-dont\">My Tasks</div>\n\nAvoid unnecessary words and articles in button labels, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Add item</div>\n<div class=\"n-usage n-usage-dont\">Add an item</div>\n",
1383
+ "examples": [],
1384
+ "dependencies": [],
1385
+ "tagName": "nord-button-group",
1386
+ "customElement": true
1398
1387
  }
1399
1388
  ],
1400
1389
  "exports": [
1401
1390
  {
1402
1391
  "kind": "js",
1403
- "name": "DateSelectEvent",
1392
+ "name": "default",
1404
1393
  "declaration": {
1405
- "name": "DateSelectEvent",
1406
- "module": "src/calendar/DateSelectEvent.ts"
1394
+ "name": "ButtonGroup",
1395
+ "module": "src/button-group/ButtonGroup.ts"
1407
1396
  }
1408
- }
1409
- ]
1410
- },
1411
- {
1412
- "kind": "javascript-module",
1413
- "path": "src/calendar/localization.ts",
1414
- "declarations": [
1415
- {
1416
- "kind": "variable",
1417
- "name": "calendarLocalization",
1418
- "type": {
1419
- "text": "object"
1420
- },
1421
- "default": "{\n prevMonthLabel: \"Previous month\",\n nextMonthLabel: \"Next month\",\n monthSelectLabel: \"Month\",\n yearSelectLabel: \"Year\",\n}"
1422
- }
1423
- ],
1424
- "exports": [
1397
+ },
1425
1398
  {
1426
- "kind": "js",
1427
- "name": "default",
1399
+ "kind": "custom-element-definition",
1400
+ "name": "nord-button-group",
1428
1401
  "declaration": {
1429
- "name": "calendarLocalization",
1430
- "module": "src/calendar/localization.ts"
1402
+ "name": "ButtonGroup",
1403
+ "module": "src/button-group/ButtonGroup.ts"
1431
1404
  }
1432
1405
  }
1433
1406
  ]
1434
1407
  },
1435
1408
  {
1436
1409
  "kind": "javascript-module",
1437
- "path": "src/button/Button.ts",
1410
+ "path": "src/badge/Badge.ts",
1438
1411
  "declarations": [
1439
1412
  {
1440
1413
  "kind": "class",
1441
- "description": "Buttons are used for interface actions. Primary style should be\nused only once per section for main call-to-action, while other\nstyles can appear more frequently.",
1442
- "name": "Button",
1443
- "cssProperties": [
1444
- {
1445
- "description": "Controls the rounded corners of the button, using [border radius tokens](/tokens/#border-radius).",
1446
- "name": "--n-button-border-radius",
1447
- "default": "var(--n-border-radius-s)"
1448
- },
1414
+ "description": "Badges are used to inform users of the status of an object\nor of an action that’s been taken. Commonly used in tabular\ndata to indicate status.",
1415
+ "name": "Badge",
1416
+ "slots": [
1449
1417
  {
1450
- "description": "Controls the spacing between items within the button, using our [spacing tokens](/tokens/#space).",
1451
- "name": "--n-button-gap",
1452
- "default": "var(--n-space-s)"
1418
+ "description": "The badge content.",
1419
+ "name": ""
1453
1420
  },
1454
1421
  {
1455
- "description": "Controls the overlayed gradient background on the button.",
1456
- "name": "--n-button-gradient",
1457
- "default": "linear-gradient(to bottom, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.013) 100%))"
1458
- },
1422
+ "description": "Used to place an icon at the start of badge.",
1423
+ "name": "icon"
1424
+ }
1425
+ ],
1426
+ "members": [
1459
1427
  {
1460
- "description": "Controls the background color of the button, using our [color tokens](/tokens/#color).",
1461
- "name": "--n-button-background-color",
1462
- "default": "var(--n-color-button)"
1428
+ "kind": "field",
1429
+ "name": "type",
1430
+ "type": {
1431
+ "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | \"neutral\" | \"progress\" | undefined"
1432
+ },
1433
+ "description": "The type of badge.\nDetermines the background color of the badge.",
1434
+ "deprecated": "Use `variant` instead. If you previously used `\"progress\"`, use `\"info\"` instead.",
1435
+ "attribute": "type",
1436
+ "reflects": true
1463
1437
  },
1464
1438
  {
1465
- "description": "Controls the border color of the button, using our [color tokens](/tokens/#color).",
1466
- "name": "--n-button-border-color",
1467
- "default": "var(--n-color-border-strong)"
1468
- },
1469
- {
1470
- "description": "Controls the text alignment for the text in the button.",
1471
- "name": "--n-button-text-align",
1472
- "default": "center"
1473
- },
1474
- {
1475
- "description": "Controls the surrounding shadow, using our [box shadow tokens](/tokens/#box-shadow).",
1476
- "name": "--n-button-box-shadow",
1477
- "default": "var(--n-box-shadow)"
1439
+ "kind": "field",
1440
+ "name": "variant",
1441
+ "type": {
1442
+ "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"neutral\" | \"info\" | undefined"
1443
+ },
1444
+ "description": "The style variant of the badge.\nDetermines the background color of the badge.",
1445
+ "attribute": "variant",
1446
+ "reflects": true
1478
1447
  },
1479
1448
  {
1480
- "description": "Controls the color of the text within the button, using our [color tokens](/tokens/#color).",
1481
- "name": "--n-button-color",
1482
- "default": "var(--n-color-text)"
1483
- },
1449
+ "kind": "field",
1450
+ "name": "strong",
1451
+ "type": {
1452
+ "text": "boolean"
1453
+ },
1454
+ "default": "false",
1455
+ "description": "Strong badges are a secondary style for badges.\nThey provide more visual prominence and emphasize them.",
1456
+ "attribute": "strong",
1457
+ "reflects": true
1458
+ }
1459
+ ],
1460
+ "attributes": [
1484
1461
  {
1485
- "description": "Controls the inline, or left and right, padding of the button.",
1486
- "name": "--n-button-padding-inline",
1487
- "default": "calc(var(--n-space-m) / 1.2)"
1462
+ "name": "type",
1463
+ "type": {
1464
+ "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | \"neutral\" | \"progress\" | undefined"
1465
+ },
1466
+ "description": "The type of badge.\nDetermines the background color of the badge.",
1467
+ "deprecated": "Use `variant` instead. If you previously used `\"progress\"`, use `\"info\"` instead.",
1468
+ "fieldName": "type"
1488
1469
  },
1489
1470
  {
1490
- "description": "Controls the size of the text within the button, using our [font tokens](/tokens/#font).",
1491
- "name": "--n-button-font-size",
1492
- "default": "var(--n-font-size-m)"
1471
+ "name": "variant",
1472
+ "type": {
1473
+ "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"neutral\" | \"info\" | undefined"
1474
+ },
1475
+ "description": "The style variant of the badge.\nDetermines the background color of the badge.",
1476
+ "fieldName": "variant"
1493
1477
  },
1494
1478
  {
1495
- "description": "Controls the weight of the text within the button, using our [font tokens](/tokens/#font).",
1496
- "name": "--n-button-font-weight",
1497
- "default": "var(--n-font-weight)"
1498
- },
1479
+ "name": "strong",
1480
+ "type": {
1481
+ "text": "boolean"
1482
+ },
1483
+ "default": "false",
1484
+ "description": "Strong badges are a secondary style for badges.\nThey provide more visual prominence and emphasize them.",
1485
+ "fieldName": "strong"
1486
+ }
1487
+ ],
1488
+ "superclass": {
1489
+ "name": "LitElement",
1490
+ "package": "lit"
1491
+ },
1492
+ "localization": [],
1493
+ "status": "ready",
1494
+ "category": "text",
1495
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use established variants and color patterns so that users can clearly identify the importance level.\n- Use to show a status update on a piece of information or action.\n- Use to mark something as a “draft” or “new”.\n- Use when you want to highlight something that has been added recently.\n- Always position badge so that it’s clear to understand what object it’s related to.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make badges clickable. Instead use button component’s small variant.\n- Don’t use alternatives to existing badge variants.\n\n</div>\n\n---\n\n## Content guidelines\n\nBadge labels should use a single word to describe the status of an object. Only use two words if you need to describe a complex state:\n\n<div class=\"n-usage n-usage-do\">Complete</div>\n<div class=\"n-usage n-usage-dont\">Action completed</div>\n\nWhen writing badge labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">Partially refunded</div>\n<div class=\"n-usage n-usage-dont\">Partially Refunded</div>\n\nAvoid unnecessary words and articles in badge labels, such as “is”, “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Pending</div>\n<div class=\"n-usage n-usage-dont\">Item is pending</div>\n\nAlways describe the status in the past tense:\n\n<div class=\"n-usage n-usage-do\">Refunded</div>\n<div class=\"n-usage n-usage-dont\">Refund</div>\n\n---\n\n## Variants\n\nThis section describes the different component variants, their purpose, and when to use each variant.\n\n| Name | Purpose |\n| ----------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| `neutral` | The default style variant. |\n| `info` | Used to convey general information that isn’t critical. |\n| `success` | Used to convey success states. For example, you might want to show a badge that tells the user a payment was successful. |\n| `highlight` | Used to highlight specific items in the interface, like notifications. |\n| `danger` | Used to communicate problems that have to be resolved so that user can continue forward. Should always be used for highlighting errors. |\n| `warning` | Used to display information that needs a user’s attention attention and may require further steps. |\n| `progress` | Used to convey something that’s in progress. |\n",
1496
+ "examples": [],
1497
+ "dependencies": [],
1498
+ "tagName": "nord-badge",
1499
+ "customElement": true
1500
+ }
1501
+ ],
1502
+ "exports": [
1503
+ {
1504
+ "kind": "js",
1505
+ "name": "default",
1506
+ "declaration": {
1507
+ "name": "Badge",
1508
+ "module": "src/badge/Badge.ts"
1509
+ }
1510
+ },
1511
+ {
1512
+ "kind": "custom-element-definition",
1513
+ "name": "nord-badge",
1514
+ "declaration": {
1515
+ "name": "Badge",
1516
+ "module": "src/badge/Badge.ts"
1517
+ }
1518
+ }
1519
+ ]
1520
+ },
1521
+ {
1522
+ "kind": "javascript-module",
1523
+ "path": "src/calendar/Calendar.ts",
1524
+ "declarations": [
1525
+ {
1526
+ "kind": "class",
1527
+ "description": "Calendar allows user to pick a date. It comes with built-in\nfunctionality that allows you to set a minimum and a maximum allowed date.\nPlease note that the date must be passed in ISO-8601 format.",
1528
+ "name": "Calendar",
1529
+ "cssProperties": [
1499
1530
  {
1500
- "description": "Controls the minimum block size, or height, of the button using our [spacing tokens](/tokens/#space).",
1501
- "name": "--n-button-min-block-size",
1502
- "default": "var(--n-space-xl)"
1531
+ "description": "Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).",
1532
+ "name": "--n-calendar-border-radius",
1533
+ "default": "var(--n-border-radius)"
1503
1534
  },
1504
1535
  {
1505
- "description": "Controls the color of toggle icon that gets rendered when the button is used as a [Dropdown](/components/dropdown/) toggle.",
1506
- "name": "--n-button-toggle-icon-color",
1507
- "default": "var(--n-color-icon)"
1536
+ "description": "Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).",
1537
+ "name": "--n-calendar-box-shadow",
1538
+ "default": "var(--n-box-shadow-popout)"
1508
1539
  }
1509
1540
  ],
1510
- "slots": [
1541
+ "members": [
1511
1542
  {
1512
- "description": "The button content",
1513
- "name": ""
1543
+ "kind": "field",
1544
+ "name": "monthSelectNode",
1545
+ "type": {
1546
+ "text": "HTMLElement"
1547
+ },
1548
+ "privacy": "private"
1514
1549
  },
1515
1550
  {
1516
- "description": "Used to place content at the start of button text. Typically used for icons.",
1517
- "name": "start"
1551
+ "kind": "field",
1552
+ "name": "focusedDayNode",
1553
+ "type": {
1554
+ "text": "HTMLButtonElement"
1555
+ },
1556
+ "privacy": "private"
1518
1557
  },
1519
1558
  {
1520
- "description": "Used to place content at the end of button text. Typically used for icons.",
1521
- "name": "end"
1522
- }
1523
- ],
1524
- "members": [
1559
+ "kind": "field",
1560
+ "name": "direction",
1561
+ "privacy": "private",
1562
+ "default": "new DirectionController(this)"
1563
+ },
1525
1564
  {
1526
1565
  "kind": "field",
1527
- "name": "defaultSlot",
1566
+ "name": "swipe",
1528
1567
  "privacy": "private",
1529
- "default": "new SlotController(this)"
1568
+ "default": "new SwipeController(this, {\n matchesGesture: isHorizontalSwipe,\n onSwipeEnd: ({ distX }) => this.addMonths(distX < 0 ? 1 : -1),\n })"
1530
1569
  },
1531
1570
  {
1532
1571
  "kind": "field",
1533
- "name": "buttonRef",
1572
+ "name": "shortcuts",
1534
1573
  "privacy": "private"
1535
1574
  },
1536
1575
  {
1537
1576
  "kind": "field",
1538
- "name": "events",
1577
+ "name": "localize",
1539
1578
  "privacy": "private",
1540
- "default": "new EventController(this)"
1579
+ "default": "new LocalizeController<\"nord-calendar\">(this, {\n onLangChange: () => this.handleLangChange(),\n })"
1541
1580
  },
1542
1581
  {
1543
1582
  "kind": "field",
1544
- "name": "lightDom",
1583
+ "name": "dateFormatShort",
1584
+ "type": {
1585
+ "text": "Intl.DateTimeFormat"
1586
+ },
1545
1587
  "privacy": "private",
1546
- "default": "new LightDomController(this, {\n render: () => this.renderLightDom(),\n })"
1588
+ "description": "Whilst dateAdapter is used for handling the formatting/parsing dates in the input,\nthese are used to format dates exclusively for the benefit of screen readers.\n\nWe prefer DateTimeFormat over date.toLocaleDateString, as the former has\nbetter performance when formatting large number of dates. See:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString#Performance"
1547
1589
  },
1548
1590
  {
1549
1591
  "kind": "field",
1550
- "name": "variant",
1592
+ "name": "monthNames",
1551
1593
  "type": {
1552
- "text": "\"default\" | \"primary\" | \"dashed\" | \"plain\" | \"danger\""
1594
+ "text": "string[]"
1553
1595
  },
1554
- "default": "\"default\"",
1555
- "description": "The style variant of the button.",
1556
- "attribute": "variant",
1557
- "reflects": true
1596
+ "privacy": "private"
1558
1597
  },
1559
1598
  {
1560
1599
  "kind": "field",
1561
- "name": "type",
1600
+ "name": "monthNamesShort",
1562
1601
  "type": {
1563
- "text": "\"button\" | \"submit\" | \"reset\""
1602
+ "text": "string[]"
1564
1603
  },
1565
- "default": "\"submit\"",
1566
- "description": "The type of the button.",
1567
- "attribute": "type",
1568
- "reflects": true
1604
+ "privacy": "private"
1569
1605
  },
1570
1606
  {
1571
1607
  "kind": "field",
1572
- "name": "size",
1608
+ "name": "dayNames",
1573
1609
  "type": {
1574
- "text": "\"s\" | \"m\" | \"l\""
1610
+ "text": "string[]"
1575
1611
  },
1576
- "default": "\"m\"",
1577
- "description": "The size of the button.\nThis affects font-size and padding.",
1578
- "attribute": "size",
1579
- "reflects": true
1612
+ "privacy": "private"
1580
1613
  },
1581
1614
  {
1582
1615
  "kind": "field",
1583
- "name": "accessibleExpanded",
1616
+ "name": "dayNamesShort",
1584
1617
  "type": {
1585
- "text": "\"true\" | \"false\" | undefined"
1618
+ "text": "string[]"
1586
1619
  },
1587
- "privacy": "private",
1588
- "attribute": "aria-expanded"
1620
+ "privacy": "private"
1589
1621
  },
1590
1622
  {
1591
1623
  "kind": "field",
1592
- "name": "accessibleHasPopup",
1624
+ "name": "value",
1593
1625
  "type": {
1594
- "text": "| \"false\"\n | \"true\"\n | \"menu\"\n | \"listbox\"\n | \"tree\"\n | \"grid\"\n | \"dialog\" | undefined"
1626
+ "text": "string"
1595
1627
  },
1596
- "privacy": "private",
1597
- "attribute": "aria-haspopup"
1628
+ "default": "\"\"",
1629
+ "description": "The selected date on the calendar. Must be in IS0-8601 format: YYYY-MM-DD.",
1630
+ "attribute": "value"
1598
1631
  },
1599
1632
  {
1600
1633
  "kind": "field",
1601
- "name": "href",
1634
+ "name": "firstDayOfWeek",
1602
1635
  "type": {
1603
- "text": "string | undefined"
1636
+ "text": "DaysOfWeek"
1604
1637
  },
1605
- "description": "When provided, renders the button as a link,\nwith its href attribute set to the given value.",
1606
- "attribute": "href",
1607
- "reflects": true
1638
+ "description": "Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\nDefault is Monday.",
1639
+ "attribute": "firstDayOfWeek"
1608
1640
  },
1609
1641
  {
1610
1642
  "kind": "field",
1611
- "name": "download",
1643
+ "name": "min",
1612
1644
  "type": {
1613
- "text": "boolean"
1645
+ "text": "string"
1614
1646
  },
1615
- "default": "false",
1616
- "description": "When provided together with a href property, the button will\ntrigger a file download instead of a page visit.",
1617
- "attribute": "download"
1647
+ "default": "\"\"",
1648
+ "description": "Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\nThis setting can be used alone or together with the max property.",
1649
+ "attribute": "min"
1618
1650
  },
1619
1651
  {
1620
1652
  "kind": "field",
1621
- "name": "target",
1653
+ "name": "max",
1622
1654
  "type": {
1623
- "text": "\"_self\" | \"_blank\" | \"_parent\" | \"_top\""
1655
+ "text": "string"
1624
1656
  },
1625
- "default": "\"_self\"",
1626
- "description": "When provided together with a href property, determines where\nto open the linked URL. The keywords have special meanings for\nwhere to load the URL: “_self” means the current browsing context,\n“_blank” usually a new tab but users can configure browsers this to\nopen a new window instead, “_parent” means the parent browsing\ncontext of the current one, but if no parent exists, behaves as\n_self, and finally “top” means the topmost browsing context.",
1627
- "attribute": "target"
1657
+ "default": "\"\"",
1658
+ "description": "Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\nThis setting can be used alone or together with the min property.",
1659
+ "attribute": "max"
1628
1660
  },
1629
1661
  {
1630
1662
  "kind": "field",
@@ -1633,357 +1665,450 @@
1633
1665
  "text": "boolean"
1634
1666
  },
1635
1667
  "default": "false",
1636
- "description": "Controls whether the button expands to fill the width of its container.",
1668
+ "description": "Controls whether the calendar expands to fill the width of its container.",
1637
1669
  "attribute": "expand",
1638
1670
  "reflects": true
1639
1671
  },
1640
1672
  {
1641
1673
  "kind": "field",
1642
- "name": "loading",
1674
+ "name": "isDateDisabled",
1643
1675
  "type": {
1644
- "text": "boolean"
1676
+ "text": "DatePredicate"
1645
1677
  },
1646
- "default": "false",
1647
- "description": "Controls whether the button is in loading state. Please note that the spinner\nis hidden from assistive technologies, so you need to make sure to announce\nthe loading state to e.g. screen reader users. We also recommend disabling\nall user interactions on the button itself while in loading state.",
1648
- "attribute": "loading",
1649
- "reflects": true
1678
+ "default": "isDateDisabled",
1679
+ "description": "Controls which days are disabled and therefore disallowed.\nFor example, this can be used to disallow selection of weekends."
1650
1680
  },
1651
1681
  {
1652
- "kind": "method",
1653
- "name": "renderLink",
1654
- "privacy": "private",
1655
- "parameters": [
1656
- {
1657
- "name": "innards",
1682
+ "kind": "field",
1683
+ "name": "isDateHighlighted",
1684
+ "type": {
1685
+ "text": "(date: Date) => string | boolean"
1686
+ },
1687
+ "default": "isDateHighlighted",
1688
+ "description": "Controls which days are highlighted with a small indicator.\nReturning a \"falsy\" value will not show an indicator.\nReturning \"truthy\" value will show the indicator, but without an accessible label.\nReturning a string will show the indicator, and use the string as accessible label.\nIt is recommended to return a string rather than a truthy value whenever possible."
1689
+ },
1690
+ {
1691
+ "kind": "field",
1692
+ "name": "activeFocus",
1693
+ "type": {
1694
+ "text": "boolean"
1695
+ },
1696
+ "privacy": "private",
1697
+ "default": "false"
1698
+ },
1699
+ {
1700
+ "kind": "field",
1701
+ "name": "focusedDay",
1702
+ "privacy": "private",
1703
+ "default": "new Date()"
1704
+ },
1705
+ {
1706
+ "kind": "method",
1707
+ "name": "focus",
1708
+ "parameters": [
1709
+ {
1710
+ "name": "options",
1711
+ "optional": true,
1658
1712
  "type": {
1659
- "text": "TemplateResult"
1660
- }
1713
+ "text": "FocusOptions & { target: \"day\" | \"month\" }"
1714
+ },
1715
+ "description": "An object which controls aspects of the focusing process."
1661
1716
  }
1662
1717
  ],
1663
- "description": "We jump through some hoops here to ensure the link is treated correctly when \"disabled\".\nLinks cannot be disabled natively, so we need to rely on some aria magic to get the correct semantics.\nAlong with the advice in the article below, we also set tabindex to \"-1\", so it is taken out of tab order."
1718
+ "description": "Programmatically move focus to the calendar."
1664
1719
  },
1665
1720
  {
1666
1721
  "kind": "method",
1667
- "name": "renderButton",
1722
+ "name": "handleValueChange",
1723
+ "privacy": "protected"
1724
+ },
1725
+ {
1726
+ "kind": "method",
1727
+ "name": "handleFocusedDayChange",
1728
+ "privacy": "protected"
1729
+ },
1730
+ {
1731
+ "kind": "method",
1732
+ "name": "handleLangChange",
1733
+ "privacy": "private"
1734
+ },
1735
+ {
1736
+ "kind": "field",
1737
+ "name": "handleDaySelect",
1738
+ "privacy": "private"
1739
+ },
1740
+ {
1741
+ "kind": "method",
1742
+ "name": "addDays",
1668
1743
  "privacy": "private",
1669
1744
  "parameters": [
1670
1745
  {
1671
- "name": "innards",
1746
+ "name": "days",
1672
1747
  "type": {
1673
- "text": "TemplateResult"
1748
+ "text": "number"
1674
1749
  }
1675
1750
  }
1676
1751
  ]
1677
1752
  },
1678
1753
  {
1679
1754
  "kind": "method",
1680
- "name": "renderLightDom",
1755
+ "name": "addMonths",
1756
+ "privacy": "private",
1757
+ "parameters": [
1758
+ {
1759
+ "name": "months",
1760
+ "type": {
1761
+ "text": "number"
1762
+ }
1763
+ }
1764
+ ]
1765
+ },
1766
+ {
1767
+ "kind": "method",
1768
+ "name": "addYears",
1769
+ "privacy": "private",
1770
+ "parameters": [
1771
+ {
1772
+ "name": "years",
1773
+ "type": {
1774
+ "text": "number"
1775
+ }
1776
+ }
1777
+ ]
1778
+ },
1779
+ {
1780
+ "kind": "method",
1781
+ "name": "startOfWeek",
1681
1782
  "privacy": "private"
1682
1783
  },
1683
1784
  {
1684
- "kind": "field",
1685
- "name": "handleOuterClick",
1785
+ "kind": "method",
1786
+ "name": "endOfWeek",
1686
1787
  "privacy": "private"
1687
1788
  },
1688
1789
  {
1689
1790
  "kind": "method",
1690
- "name": "handleClick",
1791
+ "name": "setMonth",
1691
1792
  "privacy": "private",
1692
1793
  "parameters": [
1693
1794
  {
1694
- "name": "e",
1795
+ "name": "month",
1695
1796
  "type": {
1696
- "text": "Event"
1797
+ "text": "number"
1697
1798
  }
1698
1799
  }
1699
1800
  ]
1700
1801
  },
1701
1802
  {
1702
1803
  "kind": "method",
1703
- "name": "handleProxyChange",
1804
+ "name": "setYear",
1704
1805
  "privacy": "private",
1705
1806
  "parameters": [
1706
1807
  {
1707
- "name": "e",
1808
+ "name": "year",
1708
1809
  "type": {
1709
- "text": "Event"
1810
+ "text": "number"
1710
1811
  }
1711
1812
  }
1712
- ],
1713
- "description": "React/Vue etc may remove our proxy button when updating button text, since they are unaware of its existence.\nSo we listen for a slotchange event, and if the element is no longer connected to the DOM we add it back in."
1813
+ ]
1714
1814
  },
1715
1815
  {
1716
- "kind": "field",
1717
- "name": "disabled",
1718
- "type": {
1719
- "text": "boolean"
1720
- },
1721
- "default": "false",
1722
- "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
1723
- "attribute": "disabled",
1724
- "reflects": true,
1725
- "inheritedFrom": {
1726
- "name": "InputMixin",
1727
- "module": "src/common/mixins/InputMixin.ts"
1728
- }
1816
+ "kind": "method",
1817
+ "name": "setFocusedDay",
1818
+ "privacy": "private",
1819
+ "parameters": [
1820
+ {
1821
+ "name": "day",
1822
+ "type": {
1823
+ "text": "Date"
1824
+ }
1825
+ }
1826
+ ]
1729
1827
  },
1730
1828
  {
1731
1829
  "kind": "field",
1732
- "name": "name",
1733
- "type": {
1734
- "text": "string | undefined"
1735
- },
1736
- "description": "The name of the form component.",
1737
- "attribute": "name",
1738
- "inheritedFrom": {
1739
- "name": "InputMixin",
1740
- "module": "src/common/mixins/InputMixin.ts"
1741
- }
1830
+ "name": "handleMonthSelect",
1831
+ "privacy": "private"
1742
1832
  },
1743
1833
  {
1744
1834
  "kind": "field",
1745
- "name": "value",
1746
- "type": {
1747
- "text": "string"
1748
- },
1749
- "default": "\"\"",
1750
- "description": "The value of the form component.",
1751
- "attribute": "value",
1752
- "inheritedFrom": {
1753
- "name": "InputMixin",
1754
- "module": "src/common/mixins/InputMixin.ts"
1755
- }
1835
+ "name": "handleYearSelect",
1836
+ "privacy": "private"
1756
1837
  },
1757
1838
  {
1758
1839
  "kind": "field",
1759
- "name": "formAncestor",
1760
- "type": {
1761
- "text": "HTMLFormElement | null"
1762
- },
1763
- "privacy": "private",
1764
- "default": "null",
1765
- "inheritedFrom": {
1766
- "name": "InputMixin",
1767
- "module": "src/common/mixins/InputMixin.ts"
1768
- }
1840
+ "name": "handleNextMonthClick",
1841
+ "privacy": "private"
1769
1842
  },
1770
1843
  {
1771
1844
  "kind": "field",
1772
- "name": "_formId",
1773
- "type": {
1774
- "text": "string | undefined"
1775
- },
1776
- "privacy": "protected",
1777
- "inheritedFrom": {
1778
- "name": "InputMixin",
1779
- "module": "src/common/mixins/InputMixin.ts"
1780
- }
1845
+ "name": "handlePreviousMonthClick",
1846
+ "privacy": "private"
1781
1847
  },
1782
1848
  {
1783
1849
  "kind": "field",
1784
- "name": "form",
1785
- "type": {
1786
- "text": "HTMLFormElement | null"
1787
- },
1788
- "description": "Gets the form, if any, associated with the form element.\nThe setter accepts a string, which is the id of the form.",
1789
- "attribute": "form",
1790
- "inheritedFrom": {
1791
- "name": "InputMixin",
1792
- "module": "src/common/mixins/InputMixin.ts"
1793
- }
1850
+ "name": "enableActiveFocus",
1851
+ "privacy": "private"
1794
1852
  },
1795
1853
  {
1796
1854
  "kind": "field",
1797
- "name": "focusableRef",
1798
- "privacy": "protected",
1799
- "inheritedFrom": {
1800
- "name": "FocusableMixin",
1801
- "module": "src/common/mixins/FocusableMixin.ts"
1802
- }
1803
- },
1804
- {
1805
- "kind": "method",
1806
- "name": "focus",
1807
- "parameters": [
1808
- {
1809
- "name": "options",
1810
- "optional": true,
1811
- "type": {
1812
- "text": "FocusOptions"
1813
- },
1814
- "description": "An object which controls aspects of the focusing process."
1815
- }
1816
- ],
1817
- "description": "Programmatically move focus to the component.",
1818
- "inheritedFrom": {
1819
- "name": "FocusableMixin",
1820
- "module": "src/common/mixins/FocusableMixin.ts"
1821
- }
1822
- },
1823
- {
1824
- "kind": "method",
1825
- "name": "blur",
1826
- "description": "Programmatically remove focus from the component.",
1827
- "inheritedFrom": {
1828
- "name": "FocusableMixin",
1829
- "module": "src/common/mixins/FocusableMixin.ts"
1830
- }
1831
- },
1832
- {
1833
- "kind": "method",
1834
- "name": "click",
1835
- "description": "Programmatically simulates a click on the component.",
1836
- "inheritedFrom": {
1837
- "name": "FocusableMixin",
1838
- "module": "src/common/mixins/FocusableMixin.ts"
1839
- }
1855
+ "name": "disableActiveFocus",
1856
+ "privacy": "private"
1840
1857
  }
1841
1858
  ],
1842
- "attributes": [
1859
+ "events": [
1843
1860
  {
1844
- "name": "variant",
1861
+ "name": "nord-focus-date",
1845
1862
  "type": {
1846
- "text": "\"default\" | \"primary\" | \"dashed\" | \"plain\" | \"danger\""
1863
+ "text": "DateSelectEvent"
1847
1864
  },
1848
- "default": "\"default\"",
1849
- "description": "The style variant of the button.",
1850
- "fieldName": "variant"
1865
+ "description": "Dispatched when the calendar's focused date changes."
1851
1866
  },
1852
1867
  {
1853
- "name": "type",
1854
1868
  "type": {
1855
- "text": "\"button\" | \"submit\" | \"reset\""
1869
+ "text": "DateSelectEvent"
1856
1870
  },
1857
- "default": "\"submit\"",
1858
- "description": "The type of the button.",
1859
- "fieldName": "type"
1860
- },
1871
+ "description": "Dispatched when a date is selected and the value changes.",
1872
+ "name": "change"
1873
+ }
1874
+ ],
1875
+ "attributes": [
1861
1876
  {
1862
- "name": "size",
1877
+ "name": "value",
1863
1878
  "type": {
1864
- "text": "\"s\" | \"m\" | \"l\""
1879
+ "text": "string"
1865
1880
  },
1866
- "default": "\"m\"",
1867
- "description": "The size of the button.\nThis affects font-size and padding.",
1868
- "fieldName": "size"
1881
+ "default": "\"\"",
1882
+ "description": "The selected date on the calendar. Must be in IS0-8601 format: YYYY-MM-DD.",
1883
+ "fieldName": "value"
1869
1884
  },
1870
1885
  {
1871
- "name": "aria-expanded",
1886
+ "name": "firstDayOfWeek",
1872
1887
  "type": {
1873
- "text": "\"true\" | \"false\" | undefined"
1888
+ "text": "DaysOfWeek"
1874
1889
  },
1875
- "fieldName": "accessibleExpanded"
1890
+ "description": "Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\nDefault is Monday.",
1891
+ "fieldName": "firstDayOfWeek"
1876
1892
  },
1877
1893
  {
1878
- "name": "aria-haspopup",
1894
+ "name": "min",
1879
1895
  "type": {
1880
- "text": "| \"false\"\n | \"true\"\n | \"menu\"\n | \"listbox\"\n | \"tree\"\n | \"grid\"\n | \"dialog\" | undefined"
1896
+ "text": "string"
1881
1897
  },
1882
- "fieldName": "accessibleHasPopup"
1898
+ "default": "\"\"",
1899
+ "description": "Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\nThis setting can be used alone or together with the max property.",
1900
+ "fieldName": "min"
1883
1901
  },
1884
1902
  {
1885
- "name": "href",
1903
+ "name": "max",
1886
1904
  "type": {
1887
- "text": "string | undefined"
1905
+ "text": "string"
1888
1906
  },
1889
- "description": "When provided, renders the button as a link,\nwith its href attribute set to the given value.",
1890
- "fieldName": "href"
1907
+ "default": "\"\"",
1908
+ "description": "Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\nThis setting can be used alone or together with the min property.",
1909
+ "fieldName": "max"
1891
1910
  },
1892
1911
  {
1893
- "name": "download",
1912
+ "name": "expand",
1894
1913
  "type": {
1895
1914
  "text": "boolean"
1896
1915
  },
1897
1916
  "default": "false",
1898
- "description": "When provided together with a href property, the button will\ntrigger a file download instead of a page visit.",
1899
- "fieldName": "download"
1917
+ "description": "Controls whether the calendar expands to fill the width of its container.",
1918
+ "fieldName": "expand"
1919
+ }
1920
+ ],
1921
+ "superclass": {
1922
+ "name": "LitElement",
1923
+ "package": "lit"
1924
+ },
1925
+ "localization": [
1926
+ {
1927
+ "name": "prevMonthLabel",
1928
+ "description": "Accessible label for the previous month button."
1900
1929
  },
1901
1930
  {
1902
- "name": "target",
1903
- "type": {
1904
- "text": "\"_self\" | \"_blank\" | \"_parent\" | \"_top\""
1905
- },
1906
- "default": "\"_self\"",
1907
- "description": "When provided together with a href property, determines where\nto open the linked URL. The keywords have special meanings for\nwhere to load the URL: “_self” means the current browsing context,\n“_blank” usually a new tab but users can configure browsers this to\nopen a new window instead, “_parent” means the parent browsing\ncontext of the current one, but if no parent exists, behaves as\n_self, and finally “top” means the topmost browsing context.",
1908
- "fieldName": "target"
1931
+ "name": "nextMonthLabel",
1932
+ "description": "Accessible label for the next month button."
1933
+ },
1934
+ {
1935
+ "name": "monthSelectLabel",
1936
+ "description": "Accessible label for the month select."
1937
+ },
1938
+ {
1939
+ "name": "yearSelectLabel",
1940
+ "description": "Accessible label for the year select."
1941
+ }
1942
+ ],
1943
+ "status": "ready",
1944
+ "category": "list",
1945
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n- Close calendar after a single date is selected, unless a range with a start and end date is required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use for choosing a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nCalendar component is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Calendar grid\n\n- `Space, Enter`: Selects a date.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n",
1946
+ "examples": [],
1947
+ "dependencies": [
1948
+ "button",
1949
+ "visually-hidden",
1950
+ "icon"
1951
+ ],
1952
+ "tagName": "nord-calendar",
1953
+ "customElement": true
1954
+ }
1955
+ ],
1956
+ "exports": [
1957
+ {
1958
+ "kind": "js",
1959
+ "name": "default",
1960
+ "declaration": {
1961
+ "name": "Calendar",
1962
+ "module": "src/calendar/Calendar.ts"
1963
+ }
1964
+ },
1965
+ {
1966
+ "kind": "custom-element-definition",
1967
+ "name": "nord-calendar",
1968
+ "declaration": {
1969
+ "name": "Calendar",
1970
+ "module": "src/calendar/Calendar.ts"
1971
+ }
1972
+ }
1973
+ ]
1974
+ },
1975
+ {
1976
+ "kind": "javascript-module",
1977
+ "path": "src/calendar/DateSelectEvent.ts",
1978
+ "declarations": [
1979
+ {
1980
+ "kind": "class",
1981
+ "description": "",
1982
+ "name": "DateSelectEvent",
1983
+ "superclass": {
1984
+ "name": "NordEvent",
1985
+ "module": "/src/common/events.js"
1986
+ }
1987
+ }
1988
+ ],
1989
+ "exports": [
1990
+ {
1991
+ "kind": "js",
1992
+ "name": "DateSelectEvent",
1993
+ "declaration": {
1994
+ "name": "DateSelectEvent",
1995
+ "module": "src/calendar/DateSelectEvent.ts"
1996
+ }
1997
+ }
1998
+ ]
1999
+ },
2000
+ {
2001
+ "kind": "javascript-module",
2002
+ "path": "src/calendar/localization.ts",
2003
+ "declarations": [
2004
+ {
2005
+ "kind": "variable",
2006
+ "name": "calendarLocalization",
2007
+ "type": {
2008
+ "text": "object"
2009
+ },
2010
+ "default": "{\n prevMonthLabel: \"Previous month\",\n nextMonthLabel: \"Next month\",\n monthSelectLabel: \"Month\",\n yearSelectLabel: \"Year\",\n}"
2011
+ }
2012
+ ],
2013
+ "exports": [
2014
+ {
2015
+ "kind": "js",
2016
+ "name": "default",
2017
+ "declaration": {
2018
+ "name": "calendarLocalization",
2019
+ "module": "src/calendar/localization.ts"
2020
+ }
2021
+ }
2022
+ ]
2023
+ },
2024
+ {
2025
+ "kind": "javascript-module",
2026
+ "path": "src/card/Card.ts",
2027
+ "declarations": [
2028
+ {
2029
+ "kind": "class",
2030
+ "description": "Cards are shadowed surfaces that display content and actions on a\nsingle topic. They should be easy to scan for relevant and\nactionable information.",
2031
+ "name": "Card",
2032
+ "cssProperties": [
2033
+ {
2034
+ "description": "Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).",
2035
+ "name": "--n-card-border-radius",
2036
+ "default": "var(--n-border-radius)"
2037
+ },
2038
+ {
2039
+ "description": "Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).",
2040
+ "name": "--n-card-box-shadow",
2041
+ "default": "var(--n-box-shadow-popout)"
2042
+ },
2043
+ {
2044
+ "description": "Controls the padding on all sides of the card.",
2045
+ "name": "--n-card-padding",
2046
+ "default": "var(--n-space-m)"
2047
+ },
2048
+ {
2049
+ "description": "Controls the padding of items slotted within the card. This does not affect the block padding of items slotted into the header.",
2050
+ "name": "--n-card-slot-padding",
2051
+ "default": "var(--n-space-m)"
2052
+ }
2053
+ ],
2054
+ "slots": [
2055
+ {
2056
+ "description": "The card content.",
2057
+ "name": ""
1909
2058
  },
1910
2059
  {
1911
- "name": "expand",
1912
- "type": {
1913
- "text": "boolean"
1914
- },
1915
- "default": "false",
1916
- "description": "Controls whether the button expands to fill the width of its container.",
1917
- "fieldName": "expand"
2060
+ "description": "Optional slot that holds a header for the card.",
2061
+ "name": "header"
1918
2062
  },
1919
2063
  {
1920
- "name": "loading",
1921
- "type": {
1922
- "text": "boolean"
1923
- },
1924
- "default": "false",
1925
- "description": "Controls whether the button is in loading state. Please note that the spinner\nis hidden from assistive technologies, so you need to make sure to announce\nthe loading state to e.g. screen reader users. We also recommend disabling\nall user interactions on the button itself while in loading state.",
1926
- "fieldName": "loading"
2064
+ "description": "Optional slot that positions content at the end of the header. Useful for actions or additional info.",
2065
+ "name": "header-end"
1927
2066
  },
1928
2067
  {
1929
- "name": "disabled",
1930
- "type": {
1931
- "text": "boolean"
1932
- },
1933
- "default": "false",
1934
- "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
1935
- "fieldName": "disabled",
1936
- "inheritedFrom": {
1937
- "name": "InputMixin",
1938
- "module": "src/common/mixins/InputMixin.ts"
1939
- }
2068
+ "description": "Optional slot that holds footer content for the card.",
2069
+ "name": "footer"
2070
+ }
2071
+ ],
2072
+ "members": [
2073
+ {
2074
+ "kind": "field",
2075
+ "name": "headerSlot",
2076
+ "privacy": "private",
2077
+ "default": "new SlotController(this, \"header\")"
1940
2078
  },
1941
2079
  {
1942
- "name": "name",
1943
- "type": {
1944
- "text": "string | undefined"
1945
- },
1946
- "description": "The name of the form component.",
1947
- "fieldName": "name",
1948
- "inheritedFrom": {
1949
- "name": "InputMixin",
1950
- "module": "src/common/mixins/InputMixin.ts"
1951
- }
2080
+ "kind": "field",
2081
+ "name": "headerEndSlot",
2082
+ "privacy": "private",
2083
+ "default": "new SlotController(this, \"header-end\")"
1952
2084
  },
1953
2085
  {
1954
- "name": "value",
1955
- "type": {
1956
- "text": "string"
1957
- },
1958
- "default": "\"\"",
1959
- "description": "The value of the form component.",
1960
- "fieldName": "value",
1961
- "inheritedFrom": {
1962
- "name": "InputMixin",
1963
- "module": "src/common/mixins/InputMixin.ts"
1964
- }
2086
+ "kind": "field",
2087
+ "name": "footerSlot",
2088
+ "privacy": "private",
2089
+ "default": "new SlotController(this, \"footer\")"
1965
2090
  },
1966
2091
  {
1967
- "name": "form",
2092
+ "kind": "field",
2093
+ "name": "padding",
1968
2094
  "type": {
1969
- "text": "HTMLFormElement | null"
2095
+ "text": "\"m\" | \"l\" | \"none\""
1970
2096
  },
1971
- "description": "Gets the form, if any, associated with the form element.\nThe setter accepts a string, which is the id of the form.",
1972
- "fieldName": "form",
1973
- "inheritedFrom": {
1974
- "name": "InputMixin",
1975
- "module": "src/common/mixins/InputMixin.ts"
1976
- }
2097
+ "default": "\"m\"",
2098
+ "description": "Controls the padding of the card component. When set to “none”,\nthe header and footer slots will still have padding.",
2099
+ "attribute": "padding",
2100
+ "reflects": true
1977
2101
  }
1978
2102
  ],
1979
- "mixins": [
1980
- {
1981
- "name": "InputMixin",
1982
- "module": "/src/common/mixins/InputMixin.js"
1983
- },
2103
+ "attributes": [
1984
2104
  {
1985
- "name": "FocusableMixin",
1986
- "module": "/src/common/mixins/FocusableMixin.js"
2105
+ "name": "padding",
2106
+ "type": {
2107
+ "text": "\"m\" | \"l\" | \"none\""
2108
+ },
2109
+ "default": "\"m\"",
2110
+ "description": "Controls the padding of the card component. When set to “none”,\nthe header and footer slots will still have padding.",
2111
+ "fieldName": "padding"
1987
2112
  }
1988
2113
  ],
1989
2114
  "superclass": {
@@ -1992,13 +2117,11 @@
1992
2117
  },
1993
2118
  "localization": [],
1994
2119
  "status": "ready",
1995
- "category": "action",
1996
- "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Only use one primary button per section, as a main call-to-action.\n- Use clear and accurate labels.\n- Use established button colors appropriately. For example, only use a danger button style for an action that’s difficult or impossible to undo.\n- Prioritize the most important actions. Too many buttons will cause confusion.\n- Be consistent with positioning of buttons in the user interface.\n- Use strong, actionable verbs in labels such as “Add”, “Close”, “Cancel”, or “Save”.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don't use a primary button in every row of a table.\n- Don’t use buttons to link to other pages. Use regular link or a plain style instead where necessary.\n- Don’t use buttons for navigation where the link appears within or following a sentence.\n- Don’t use labels such as “Read more”, “Click here” or “More”.\n\n</div>\n\n---\n\n## Content guidelines\n\nButton labels should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they click a button:\n\n<div class=\"n-usage n-usage-do\">View user settings</div>\n<div class=\"n-usage n-usage-dont\">Click here</div>\n\nWhen writing button labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">My tasks</div>\n<div class=\"n-usage n-usage-dont\">My Tasks</div>\n\nAvoid unnecessary words and articles in button labels, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Add item</div>\n<div class=\"n-usage n-usage-dont\">Add an item</div>\n\n---\n\n## Variants\n\nThis section describes the different component variants, their purpose, and when to use each variant.\n\n| Name | Purpose |\n| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `default` | Default style is the most common button variant. Only switch to another variant if you need to adjust the visual weight of the element. |\n| `primary` | Primary style is reserved for main call-to-actions. Should be used only once per content area or panel, e.g. for a “Save” action. |\n| `dashed` | Dashed style should be used for actions that trigger filtering. |\n| `danger` | Danger style should be used for actions that delete data or otherwise make it hard to undo the action. |\n| `plain` | Used for less important or less common actions. Can be also used for linking to other pages. |\n| `disabled` | Used for actions that aren’t currently available or not available anymore. Also prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies. |\n\n---\n\n## Icon usage in button\n\nIllustrative icons should be always positioned in the `start` slot:\n\n<img src=\"/img/components/button/start-slot.png\" class=\"n-border n-border-radius\" style=\"max-width:700px;\" loading=\"lazy\" height=\"475\" width=\"800\" alt=\"Button with icon in start slot\" />\n\nWhen a button is used as a dropdown toggle, the `interface-dropdown-small` icon from [Nordicons](/nordicons/) is automatically placed in the `end` slot:\n\n<img src=\"/img/components/button/dropdown.png\" class=\"n-border n-border-radius\" style=\"max-width:700px;\" loading=\"lazy\" height=\"475\" width=\"800\" alt=\"Dropdown button\" />\n\nEach button size has a recommended icon size. The medium button uses the `s` icon size, the [small button](/components/button/?example=small+buttons) uses the `xs` icon size, and the [large button](/components/button/?example=large+buttons) uses the `m` icon size. The icon will adjust size automatically based on the button size, so you will get the correct behavior by default. However, this can be overridden by explicitly setting a size on the icon.\n\n<img src=\"/img/components/button/icon-sizes.png\" class=\"n-border n-border-radius\" style=\"max-width:700px;\" loading=\"lazy\" height=\"475\" width=\"800\" alt=\"Button icon sizes\" />\n\nUse `interface-add-small` icon in the `start` slot for create/add type primary actions in the [header](/components/header/):\n\n<img src=\"/img/components/button/create.png\" class=\"n-border n-border-radius\" style=\"max-width:700px;\" loading=\"lazy\" height=\"475\" width=\"800\" alt=\"Create/add type primary action with icon\" />\n\n---\n\n## Additional considerations\n\n- Users of assistive technology expect a button to submit data or do an action. If you need the button to navigate into another view, use the `href` property which will output `<a>` tag instead of a `<button>`.\n- When you need to disable a button, use `disabled` property as it conveys this information correctly to assistive technologies like screen readers.\n- Button component provides 3 size variants; small, medium and large. The large size should only be used for marketing purposes or on areas such as an empty space/content notice.\n",
2120
+ "category": "structure",
2121
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to display content and actions on a single topic inside a container.\n- Use to visually separate specific parts of content in an application view.\n- Use to wrap a form into a container, for example a login form.\n- Include a header when placing a [Table](/components/table) component inside the card.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t place cards within cards. Consider using the [divider](/components/divider/) component to break up sections instead.\n- Don’t use when you need to capture user’s attention in a prominent way.\n- Don’t use to inform user about important changes or conditions in the interface.\n- Don’t use multiple primary buttons inside a card. A card should only contain a single primary action.\n\n</div>\n",
1997
2122
  "examples": [],
1998
- "dependencies": [
1999
- "spinner"
2000
- ],
2001
- "tagName": "nord-button",
2123
+ "dependencies": [],
2124
+ "tagName": "nord-card",
2002
2125
  "customElement": true
2003
2126
  }
2004
2127
  ],
@@ -2007,16 +2130,16 @@
2007
2130
  "kind": "js",
2008
2131
  "name": "default",
2009
2132
  "declaration": {
2010
- "name": "Button",
2011
- "module": "src/button/Button.ts"
2133
+ "name": "Card",
2134
+ "module": "src/card/Card.ts"
2012
2135
  }
2013
2136
  },
2014
2137
  {
2015
2138
  "kind": "custom-element-definition",
2016
- "name": "nord-button",
2139
+ "name": "nord-card",
2017
2140
  "declaration": {
2018
- "name": "Button",
2019
- "module": "src/button/Button.ts"
2141
+ "name": "Card",
2142
+ "module": "src/card/Card.ts"
2020
2143
  }
2021
2144
  }
2022
2145
  ]
@@ -2742,129 +2865,6 @@
2742
2865
  }
2743
2866
  ]
2744
2867
  },
2745
- {
2746
- "kind": "javascript-module",
2747
- "path": "src/card/Card.ts",
2748
- "declarations": [
2749
- {
2750
- "kind": "class",
2751
- "description": "Cards are shadowed surfaces that display content and actions on a\nsingle topic. They should be easy to scan for relevant and\nactionable information.",
2752
- "name": "Card",
2753
- "cssProperties": [
2754
- {
2755
- "description": "Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).",
2756
- "name": "--n-card-border-radius",
2757
- "default": "var(--n-border-radius)"
2758
- },
2759
- {
2760
- "description": "Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).",
2761
- "name": "--n-card-box-shadow",
2762
- "default": "var(--n-box-shadow-popout)"
2763
- },
2764
- {
2765
- "description": "Controls the padding on all sides of the card.",
2766
- "name": "--n-card-padding",
2767
- "default": "var(--n-space-m)"
2768
- },
2769
- {
2770
- "description": "Controls the padding of items slotted within the card. This does not affect the block padding of items slotted into the header.",
2771
- "name": "--n-card-slot-padding",
2772
- "default": "var(--n-space-m)"
2773
- }
2774
- ],
2775
- "slots": [
2776
- {
2777
- "description": "The card content.",
2778
- "name": ""
2779
- },
2780
- {
2781
- "description": "Optional slot that holds a header for the card.",
2782
- "name": "header"
2783
- },
2784
- {
2785
- "description": "Optional slot that positions content at the end of the header. Useful for actions or additional info.",
2786
- "name": "header-end"
2787
- },
2788
- {
2789
- "description": "Optional slot that holds footer content for the card.",
2790
- "name": "footer"
2791
- }
2792
- ],
2793
- "members": [
2794
- {
2795
- "kind": "field",
2796
- "name": "headerSlot",
2797
- "privacy": "private",
2798
- "default": "new SlotController(this, \"header\")"
2799
- },
2800
- {
2801
- "kind": "field",
2802
- "name": "headerEndSlot",
2803
- "privacy": "private",
2804
- "default": "new SlotController(this, \"header-end\")"
2805
- },
2806
- {
2807
- "kind": "field",
2808
- "name": "footerSlot",
2809
- "privacy": "private",
2810
- "default": "new SlotController(this, \"footer\")"
2811
- },
2812
- {
2813
- "kind": "field",
2814
- "name": "padding",
2815
- "type": {
2816
- "text": "\"m\" | \"l\" | \"none\""
2817
- },
2818
- "default": "\"m\"",
2819
- "description": "Controls the padding of the card component. When set to “none”,\nthe header and footer slots will still have padding.",
2820
- "attribute": "padding",
2821
- "reflects": true
2822
- }
2823
- ],
2824
- "attributes": [
2825
- {
2826
- "name": "padding",
2827
- "type": {
2828
- "text": "\"m\" | \"l\" | \"none\""
2829
- },
2830
- "default": "\"m\"",
2831
- "description": "Controls the padding of the card component. When set to “none”,\nthe header and footer slots will still have padding.",
2832
- "fieldName": "padding"
2833
- }
2834
- ],
2835
- "superclass": {
2836
- "name": "LitElement",
2837
- "package": "lit"
2838
- },
2839
- "localization": [],
2840
- "status": "ready",
2841
- "category": "structure",
2842
- "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to display content and actions on a single topic inside a container.\n- Use to visually separate specific parts of content in an application view.\n- Use to wrap a form into a container, for example a login form.\n- Include a header when placing a [Table](/components/table) component inside the card.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t place cards within cards. Consider using the [divider](/components/divider/) component to break up sections instead.\n- Don’t use when you need to capture user’s attention in a prominent way.\n- Don’t use to inform user about important changes or conditions in the interface.\n- Don’t use multiple primary buttons inside a card. A card should only contain a single primary action.\n\n</div>\n",
2843
- "examples": [],
2844
- "dependencies": [],
2845
- "tagName": "nord-card",
2846
- "customElement": true
2847
- }
2848
- ],
2849
- "exports": [
2850
- {
2851
- "kind": "js",
2852
- "name": "default",
2853
- "declaration": {
2854
- "name": "Card",
2855
- "module": "src/card/Card.ts"
2856
- }
2857
- },
2858
- {
2859
- "kind": "custom-element-definition",
2860
- "name": "nord-card",
2861
- "declaration": {
2862
- "name": "Card",
2863
- "module": "src/card/Card.ts"
2864
- }
2865
- }
2866
- ]
2867
- },
2868
2868
  {
2869
2869
  "kind": "javascript-module",
2870
2870
  "path": "src/command-menu/CommandMenu.ts",