@nordhealth/components 1.0.0-alpha.57 → 1.0.0-alpha.58

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 (2) hide show
  1. package/custom-elements.json +1215 -1215
  2. package/package.json +5 -5
@@ -688,519 +688,275 @@
688
688
  },
689
689
  {
690
690
  "kind": "javascript-module",
691
- "path": "src/card/Card.ts",
691
+ "path": "src/calendar/Calendar.ts",
692
692
  "declarations": [
693
693
  {
694
694
  "kind": "class",
695
- "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.",
696
- "name": "Card",
697
- "slots": [
698
- {
699
- "description": "The card content.",
700
- "name": ""
701
- },
702
- {
703
- "description": "Optional slot that holds a header for the card.",
704
- "name": "header"
705
- },
706
- {
707
- "description": "Optional slot that holds footer content for the card.",
708
- "name": "footer"
709
- }
710
- ],
695
+ "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.",
696
+ "name": "Calendar",
711
697
  "members": [
712
698
  {
713
699
  "kind": "field",
714
- "name": "headerSlot",
715
- "privacy": "private",
716
- "default": "new SlotController(this, \"header\")"
717
- },
718
- {
719
- "kind": "field",
720
- "name": "footerSlot",
721
- "privacy": "private",
722
- "default": "new SlotController(this, \"footer\")"
723
- },
724
- {
725
- "kind": "field",
726
- "name": "padding",
700
+ "name": "dialogLabelId",
727
701
  "type": {
728
- "text": "\"m\" | \"l\" | \"none\""
702
+ "text": "string"
729
703
  },
730
- "default": "\"m\"",
731
- "description": "Controls the padding of card component. When set to “none”,\nthe header and footer slots will still have padding.",
732
- "attribute": "padding",
733
- "reflects": true
704
+ "privacy": "private",
705
+ "default": "\"dialog-header\""
734
706
  },
735
707
  {
736
708
  "kind": "field",
737
- "name": "_warningLogged",
738
- "type": {
739
- "text": "boolean"
740
- },
741
- "privacy": "private",
742
- "static": true,
743
- "default": "false",
744
- "inheritedFrom": {
745
- "name": "DraftComponentMixin",
746
- "module": "src/common/mixins/DraftComponentMixin.ts"
747
- }
748
- }
749
- ],
750
- "attributes": [
751
- {
752
- "name": "padding",
709
+ "name": "monthSelectNode",
753
710
  "type": {
754
- "text": "\"m\" | \"l\" | \"none\""
711
+ "text": "HTMLElement"
755
712
  },
756
- "default": "\"m\"",
757
- "description": "Controls the padding of card component. When set to “none”,\nthe header and footer slots will still have padding.",
758
- "fieldName": "padding"
759
- }
760
- ],
761
- "mixins": [
762
- {
763
- "name": "DraftComponentMixin",
764
- "module": "/src/common/mixins/DraftComponentMixin.js"
765
- }
766
- ],
767
- "superclass": {
768
- "name": "LitElement",
769
- "package": "lit"
770
- },
771
- "status": "draft",
772
- "category": "structure",
773
- "tagName": "nord-card",
774
- "customElement": true
775
- }
776
- ],
777
- "exports": [
778
- {
779
- "kind": "js",
780
- "name": "default",
781
- "declaration": {
782
- "name": "Card",
783
- "module": "src/card/Card.ts"
784
- }
785
- },
786
- {
787
- "kind": "custom-element-definition",
788
- "name": "nord-card",
789
- "declaration": {
790
- "name": "Card",
791
- "module": "src/card/Card.ts"
792
- }
793
- }
794
- ],
795
- "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\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\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"
796
- },
797
- {
798
- "kind": "javascript-module",
799
- "path": "src/checkbox/Checkbox.ts",
800
- "declarations": [
801
- {
802
- "kind": "class",
803
- "description": "Checkboxes allow user to choose one or more options from a limited set of options.\nIf you have more than 10 options, please use Select component instead.",
804
- "name": "Checkbox",
805
- "slots": [
806
- {
807
- "description": "Use when a label requires more than plain text.",
808
- "name": "label"
809
- },
810
- {
811
- "description": "Optional slot that holds hint text for the input.",
812
- "name": "hint"
813
- },
814
- {
815
- "description": "Optional slot that holds error text for the input.",
816
- "name": "error"
817
- }
818
- ],
819
- "members": [
820
- {
821
- "kind": "field",
822
- "name": "formValue",
823
- "privacy": "protected",
824
- "inheritedFrom": {
825
- "name": "FormAssociatedMixin",
826
- "module": "src/common/mixins/FormAssociatedMixin.ts"
827
- }
713
+ "privacy": "private"
828
714
  },
829
715
  {
830
716
  "kind": "field",
831
- "name": "checked",
717
+ "name": "focusedDayNode",
832
718
  "type": {
833
- "text": "boolean"
719
+ "text": "HTMLButtonElement"
834
720
  },
835
- "default": "false",
836
- "description": "Controls whether the checkbox is checked or not.",
837
- "attribute": "checked"
721
+ "privacy": "private"
838
722
  },
839
723
  {
840
- "kind": "method",
841
- "name": "handleChange",
842
- "privacy": "protected",
843
- "return": {
844
- "type": {
845
- "text": "void"
846
- }
847
- },
848
- "parameters": [
849
- {
850
- "name": "e",
851
- "type": {
852
- "text": "Event"
853
- }
854
- }
855
- ],
856
- "inheritedFrom": {
857
- "name": "FormAssociatedMixin",
858
- "module": "src/common/mixins/FormAssociatedMixin.ts"
859
- }
724
+ "kind": "field",
725
+ "name": "direction",
726
+ "privacy": "private",
727
+ "default": "new DirectionController(this)"
860
728
  },
861
729
  {
862
730
  "kind": "field",
863
- "name": "labelSlot",
864
- "privacy": "protected",
865
- "default": "new SlotController(this, \"label\")",
866
- "inheritedFrom": {
867
- "name": "FormAssociatedMixin",
868
- "module": "src/common/mixins/FormAssociatedMixin.ts"
869
- }
731
+ "name": "swipe",
732
+ "privacy": "private",
733
+ "default": "new SwipeController(this, {\n matchesGesture: isHorizontalSwipe,\n onSwipeEnd: ({ distX }) => this.addMonths(distX < 0 ? 1 : -1),\n })"
870
734
  },
871
735
  {
872
736
  "kind": "field",
873
- "name": "errorSlot",
874
- "privacy": "protected",
875
- "default": "new SlotController(this, \"error\")",
876
- "inheritedFrom": {
877
- "name": "FormAssociatedMixin",
878
- "module": "src/common/mixins/FormAssociatedMixin.ts"
879
- }
737
+ "name": "shortcuts",
738
+ "privacy": "private"
880
739
  },
881
740
  {
882
741
  "kind": "field",
883
- "name": "hintSlot",
884
- "privacy": "protected",
885
- "default": "new SlotController(this, \"hint\")",
886
- "inheritedFrom": {
887
- "name": "FormAssociatedMixin",
888
- "module": "src/common/mixins/FormAssociatedMixin.ts"
889
- }
742
+ "name": "dateFormatShort",
743
+ "type": {
744
+ "text": "Intl.DateTimeFormat"
745
+ },
746
+ "privacy": "private",
747
+ "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"
890
748
  },
891
749
  {
892
750
  "kind": "field",
893
- "name": "formData",
894
- "privacy": "protected",
895
- "default": "new FormDataController(this, { value: () => this.formValue })",
896
- "inheritedFrom": {
897
- "name": "FormAssociatedMixin",
898
- "module": "src/common/mixins/FormAssociatedMixin.ts"
899
- }
751
+ "name": "localization",
752
+ "type": {
753
+ "text": "CalendarLocalizedText"
754
+ },
755
+ "default": "localization"
900
756
  },
901
757
  {
902
758
  "kind": "field",
903
- "name": "inputId",
759
+ "name": "value",
904
760
  "type": {
905
761
  "text": "string"
906
762
  },
907
- "privacy": "protected",
908
- "default": "\"input\"",
909
- "inheritedFrom": {
910
- "name": "FormAssociatedMixin",
911
- "module": "src/common/mixins/FormAssociatedMixin.ts"
912
- }
763
+ "default": "\"\"",
764
+ "description": "The selected date on the calendar. Must be in IS0-8601 format: YYYY-MM-DD.",
765
+ "attribute": "value"
913
766
  },
914
767
  {
915
768
  "kind": "field",
916
- "name": "errorId",
769
+ "name": "firstDayOfWeek",
917
770
  "type": {
918
- "text": "string"
771
+ "text": "DaysOfWeek"
919
772
  },
920
- "privacy": "protected",
921
- "default": "\"error\"",
922
- "inheritedFrom": {
923
- "name": "FormAssociatedMixin",
924
- "module": "src/common/mixins/FormAssociatedMixin.ts"
925
- }
773
+ "description": "Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\nDefault is Monday.",
774
+ "attribute": "firstDayOfWeek"
926
775
  },
927
776
  {
928
777
  "kind": "field",
929
- "name": "hintId",
778
+ "name": "min",
930
779
  "type": {
931
780
  "text": "string"
932
781
  },
933
- "privacy": "protected",
934
- "default": "\"hint\"",
935
- "inheritedFrom": {
936
- "name": "FormAssociatedMixin",
937
- "module": "src/common/mixins/FormAssociatedMixin.ts"
938
- }
782
+ "default": "\"\"",
783
+ "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.",
784
+ "attribute": "min"
939
785
  },
940
786
  {
941
787
  "kind": "field",
942
- "name": "label",
788
+ "name": "max",
943
789
  "type": {
944
790
  "text": "string"
945
791
  },
946
792
  "default": "\"\"",
947
- "description": "Label for the input.",
948
- "attribute": "label",
949
- "inheritedFrom": {
950
- "name": "FormAssociatedMixin",
951
- "module": "src/common/mixins/FormAssociatedMixin.ts"
952
- }
793
+ "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.",
794
+ "attribute": "max"
953
795
  },
954
796
  {
955
797
  "kind": "field",
956
- "name": "hint",
798
+ "name": "isDateDisabled",
957
799
  "type": {
958
- "text": "string | undefined"
800
+ "text": "DateDisabledPredicate"
959
801
  },
960
- "description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
961
- "attribute": "hint",
962
- "inheritedFrom": {
963
- "name": "FormAssociatedMixin",
964
- "module": "src/common/mixins/FormAssociatedMixin.ts"
965
- }
802
+ "default": "isDateDisabled",
803
+ "description": "Controls which days are disabled and therefore disallowed.\nFor example, this can be used to disallow selection of weekends."
966
804
  },
967
805
  {
968
806
  "kind": "field",
969
- "name": "hideLabel",
807
+ "name": "activeFocus",
970
808
  "type": {
971
809
  "text": "boolean"
972
810
  },
973
- "default": "false",
974
- "description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
975
- "attribute": "hide-label",
976
- "inheritedFrom": {
977
- "name": "FormAssociatedMixin",
978
- "module": "src/common/mixins/FormAssociatedMixin.ts"
979
- }
811
+ "privacy": "private",
812
+ "default": "false"
980
813
  },
981
814
  {
982
815
  "kind": "field",
983
- "name": "placeholder",
984
- "type": {
985
- "text": "string | undefined"
986
- },
987
- "description": "Placeholder text to display within the input.",
988
- "attribute": "placeholder",
989
- "inheritedFrom": {
990
- "name": "FormAssociatedMixin",
991
- "module": "src/common/mixins/FormAssociatedMixin.ts"
992
- }
816
+ "name": "focusedDay",
817
+ "privacy": "private",
818
+ "default": "new Date()"
993
819
  },
994
820
  {
995
- "kind": "field",
996
- "name": "error",
997
- "type": {
998
- "text": "string | undefined"
999
- },
1000
- "description": "Optional error to be shown with the input. Alternatively use the error slot.",
1001
- "attribute": "error",
1002
- "inheritedFrom": {
1003
- "name": "FormAssociatedMixin",
1004
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1005
- }
821
+ "kind": "method",
822
+ "name": "focus",
823
+ "parameters": [
824
+ {
825
+ "name": "options",
826
+ "optional": true,
827
+ "type": {
828
+ "text": "FocusOptions & { target: \"day\" | \"month\" }"
829
+ }
830
+ }
831
+ ]
1006
832
  },
1007
833
  {
1008
- "kind": "field",
1009
- "name": "required",
1010
- "type": {
1011
- "text": "boolean"
1012
- },
1013
- "default": "false",
1014
- "description": "Determines whether the input is required or not.\nAn input marked as required will be announced as such to users of assistive technology.\nWhen using this property you need to also set “novalidate” attribute on a form element to prevent browser from displaying its own validation errors.",
1015
- "attribute": "required",
1016
- "inheritedFrom": {
1017
- "name": "FormAssociatedMixin",
1018
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1019
- }
834
+ "kind": "method",
835
+ "name": "createDateFormatter",
836
+ "privacy": "private"
1020
837
  },
1021
838
  {
1022
839
  "kind": "field",
1023
- "name": "expand",
1024
- "type": {
1025
- "text": "boolean"
1026
- },
1027
- "default": "false",
1028
- "description": "Controls whether the input expands to fill the width of its container.",
1029
- "attribute": "expand",
1030
- "reflects": true,
1031
- "inheritedFrom": {
1032
- "name": "FormAssociatedMixin",
1033
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1034
- }
840
+ "name": "handleDaySelect",
841
+ "privacy": "private"
1035
842
  },
1036
843
  {
1037
844
  "kind": "method",
1038
- "name": "handleInput",
1039
- "privacy": "protected",
845
+ "name": "addDays",
846
+ "privacy": "private",
1040
847
  "parameters": [
1041
848
  {
1042
- "name": "e",
849
+ "name": "days",
1043
850
  "type": {
1044
- "text": "Event"
851
+ "text": "number"
1045
852
  }
1046
853
  }
1047
- ],
1048
- "inheritedFrom": {
1049
- "name": "FormAssociatedMixin",
1050
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1051
- }
854
+ ]
1052
855
  },
1053
856
  {
1054
857
  "kind": "method",
1055
- "name": "renderLabel",
1056
- "privacy": "protected",
1057
- "inheritedFrom": {
1058
- "name": "FormAssociatedMixin",
1059
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1060
- }
858
+ "name": "addMonths",
859
+ "privacy": "private",
860
+ "parameters": [
861
+ {
862
+ "name": "months",
863
+ "type": {
864
+ "text": "number"
865
+ }
866
+ }
867
+ ]
1061
868
  },
1062
869
  {
1063
870
  "kind": "method",
1064
- "name": "renderError",
1065
- "privacy": "protected",
1066
- "inheritedFrom": {
1067
- "name": "FormAssociatedMixin",
1068
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1069
- }
871
+ "name": "addYears",
872
+ "privacy": "private",
873
+ "parameters": [
874
+ {
875
+ "name": "years",
876
+ "type": {
877
+ "text": "number"
878
+ }
879
+ }
880
+ ]
1070
881
  },
1071
882
  {
1072
883
  "kind": "method",
1073
- "name": "getDescribedBy",
1074
- "privacy": "protected",
1075
- "inheritedFrom": {
1076
- "name": "FormAssociatedMixin",
1077
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1078
- }
884
+ "name": "startOfWeek",
885
+ "privacy": "private"
1079
886
  },
1080
887
  {
1081
888
  "kind": "method",
1082
- "name": "getInvalid",
1083
- "privacy": "protected",
1084
- "inheritedFrom": {
1085
- "name": "FormAssociatedMixin",
1086
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1087
- }
889
+ "name": "endOfWeek",
890
+ "privacy": "private"
1088
891
  },
1089
892
  {
1090
- "kind": "field",
1091
- "name": "hasHint",
1092
- "privacy": "protected",
1093
- "inheritedFrom": {
1094
- "name": "FormAssociatedMixin",
1095
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1096
- }
893
+ "kind": "method",
894
+ "name": "setMonth",
895
+ "privacy": "private",
896
+ "parameters": [
897
+ {
898
+ "name": "month",
899
+ "type": {
900
+ "text": "number"
901
+ }
902
+ }
903
+ ]
904
+ },
905
+ {
906
+ "kind": "method",
907
+ "name": "setYear",
908
+ "privacy": "private",
909
+ "parameters": [
910
+ {
911
+ "name": "year",
912
+ "type": {
913
+ "text": "number"
914
+ }
915
+ }
916
+ ]
917
+ },
918
+ {
919
+ "kind": "method",
920
+ "name": "setFocusedDay",
921
+ "privacy": "private",
922
+ "parameters": [
923
+ {
924
+ "name": "day",
925
+ "type": {
926
+ "text": "Date"
927
+ }
928
+ }
929
+ ]
1097
930
  },
1098
931
  {
1099
932
  "kind": "field",
1100
- "name": "hasError",
1101
- "privacy": "protected",
1102
- "inheritedFrom": {
1103
- "name": "FormAssociatedMixin",
1104
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1105
- }
933
+ "name": "handleMonthSelect",
934
+ "privacy": "private"
1106
935
  },
1107
936
  {
1108
937
  "kind": "field",
1109
- "name": "disabled",
1110
- "type": {
1111
- "text": "boolean"
1112
- },
1113
- "default": "false",
1114
- "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
1115
- "attribute": "disabled",
1116
- "reflects": true,
1117
- "inheritedFrom": {
1118
- "name": "InputMixin",
1119
- "module": "src/common/mixins/InputMixin.ts"
1120
- }
938
+ "name": "handleYearSelect",
939
+ "privacy": "private"
1121
940
  },
1122
941
  {
1123
942
  "kind": "field",
1124
- "name": "name",
1125
- "type": {
1126
- "text": "string | undefined"
1127
- },
1128
- "description": "The name of the form component.",
1129
- "attribute": "name",
1130
- "inheritedFrom": {
1131
- "name": "InputMixin",
1132
- "module": "src/common/mixins/InputMixin.ts"
1133
- }
943
+ "name": "handleNextMonthClick",
944
+ "privacy": "private"
1134
945
  },
1135
946
  {
1136
947
  "kind": "field",
1137
- "name": "value",
1138
- "type": {
1139
- "text": "string"
1140
- },
1141
- "default": "\"\"",
1142
- "description": "The value of the form component.",
1143
- "attribute": "value",
1144
- "inheritedFrom": {
1145
- "name": "InputMixin",
1146
- "module": "src/common/mixins/InputMixin.ts"
1147
- }
948
+ "name": "handlePreviousMonthClick",
949
+ "privacy": "private"
1148
950
  },
1149
951
  {
1150
952
  "kind": "field",
1151
- "name": "form",
1152
- "privacy": "protected",
1153
- "description": "Gets the form, if any, associated with the form element.",
1154
- "inheritedFrom": {
1155
- "name": "InputMixin",
1156
- "module": "src/common/mixins/InputMixin.ts"
1157
- }
953
+ "name": "enableActiveFocus",
954
+ "privacy": "private"
1158
955
  },
1159
956
  {
1160
957
  "kind": "field",
1161
- "name": "focusableRef",
1162
- "privacy": "protected",
1163
- "inheritedFrom": {
1164
- "name": "FocusableMixin",
1165
- "module": "src/common/mixins/FocusableMixin.ts"
1166
- }
1167
- },
1168
- {
1169
- "kind": "method",
1170
- "name": "focus",
1171
- "parameters": [
1172
- {
1173
- "name": "options",
1174
- "optional": true,
1175
- "type": {
1176
- "text": "FocusOptions"
1177
- },
1178
- "description": "An object which controls aspects of the focusing process."
1179
- }
1180
- ],
1181
- "description": "Programmatically move focus to the component.",
1182
- "inheritedFrom": {
1183
- "name": "FocusableMixin",
1184
- "module": "src/common/mixins/FocusableMixin.ts"
1185
- }
1186
- },
1187
- {
1188
- "kind": "method",
1189
- "name": "blur",
1190
- "description": "Programmatically remove focus from the component.",
1191
- "inheritedFrom": {
1192
- "name": "FocusableMixin",
1193
- "module": "src/common/mixins/FocusableMixin.ts"
1194
- }
1195
- },
1196
- {
1197
- "kind": "method",
1198
- "name": "click",
1199
- "description": "Programmatically simulates a click on the component.",
1200
- "inheritedFrom": {
1201
- "name": "FocusableMixin",
1202
- "module": "src/common/mixins/FocusableMixin.ts"
1203
- }
958
+ "name": "disableActiveFocus",
959
+ "privacy": "private"
1204
960
  },
1205
961
  {
1206
962
  "kind": "field",
@@ -1219,154 +975,42 @@
1219
975
  ],
1220
976
  "attributes": [
1221
977
  {
1222
- "name": "checked",
1223
- "type": {
1224
- "text": "boolean"
1225
- },
1226
- "default": "false",
1227
- "description": "Controls whether the checkbox is checked or not.",
1228
- "fieldName": "checked"
1229
- },
1230
- {
1231
- "name": "label",
978
+ "name": "value",
1232
979
  "type": {
1233
980
  "text": "string"
1234
981
  },
1235
982
  "default": "\"\"",
1236
- "description": "Label for the input.",
1237
- "fieldName": "label",
1238
- "inheritedFrom": {
1239
- "name": "FormAssociatedMixin",
1240
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1241
- }
1242
- },
1243
- {
1244
- "name": "hint",
1245
- "type": {
1246
- "text": "string | undefined"
1247
- },
1248
- "description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
1249
- "fieldName": "hint",
1250
- "inheritedFrom": {
1251
- "name": "FormAssociatedMixin",
1252
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1253
- }
1254
- },
1255
- {
1256
- "name": "hide-label",
1257
- "type": {
1258
- "text": "boolean"
1259
- },
1260
- "default": "false",
1261
- "description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
1262
- "fieldName": "hideLabel",
1263
- "inheritedFrom": {
1264
- "name": "FormAssociatedMixin",
1265
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1266
- }
1267
- },
1268
- {
1269
- "name": "placeholder",
1270
- "type": {
1271
- "text": "string | undefined"
1272
- },
1273
- "description": "Placeholder text to display within the input.",
1274
- "fieldName": "placeholder",
1275
- "inheritedFrom": {
1276
- "name": "FormAssociatedMixin",
1277
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1278
- }
1279
- },
1280
- {
1281
- "name": "error",
1282
- "type": {
1283
- "text": "string | undefined"
1284
- },
1285
- "description": "Optional error to be shown with the input. Alternatively use the error slot.",
1286
- "fieldName": "error",
1287
- "inheritedFrom": {
1288
- "name": "FormAssociatedMixin",
1289
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1290
- }
1291
- },
1292
- {
1293
- "name": "required",
1294
- "type": {
1295
- "text": "boolean"
1296
- },
1297
- "default": "false",
1298
- "description": "Determines whether the input is required or not.\nAn input marked as required will be announced as such to users of assistive technology.\nWhen using this property you need to also set “novalidate” attribute on a form element to prevent browser from displaying its own validation errors.",
1299
- "fieldName": "required",
1300
- "inheritedFrom": {
1301
- "name": "FormAssociatedMixin",
1302
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1303
- }
1304
- },
1305
- {
1306
- "name": "expand",
1307
- "type": {
1308
- "text": "boolean"
1309
- },
1310
- "default": "false",
1311
- "description": "Controls whether the input expands to fill the width of its container.",
1312
- "fieldName": "expand",
1313
- "inheritedFrom": {
1314
- "name": "FormAssociatedMixin",
1315
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1316
- }
983
+ "description": "The selected date on the calendar. Must be in IS0-8601 format: YYYY-MM-DD.",
984
+ "fieldName": "value"
1317
985
  },
1318
986
  {
1319
- "name": "disabled",
987
+ "name": "firstDayOfWeek",
1320
988
  "type": {
1321
- "text": "boolean"
989
+ "text": "DaysOfWeek"
1322
990
  },
1323
- "default": "false",
1324
- "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
1325
- "fieldName": "disabled",
1326
- "inheritedFrom": {
1327
- "name": "InputMixin",
1328
- "module": "src/common/mixins/InputMixin.ts"
1329
- }
991
+ "description": "Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\nDefault is Monday.",
992
+ "fieldName": "firstDayOfWeek"
1330
993
  },
1331
994
  {
1332
- "name": "name",
995
+ "name": "min",
1333
996
  "type": {
1334
- "text": "string | undefined"
997
+ "text": "string"
1335
998
  },
1336
- "description": "The name of the form component.",
1337
- "fieldName": "name",
1338
- "inheritedFrom": {
1339
- "name": "InputMixin",
1340
- "module": "src/common/mixins/InputMixin.ts"
1341
- }
999
+ "default": "\"\"",
1000
+ "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.",
1001
+ "fieldName": "min"
1342
1002
  },
1343
1003
  {
1344
- "name": "value",
1004
+ "name": "max",
1345
1005
  "type": {
1346
1006
  "text": "string"
1347
1007
  },
1348
1008
  "default": "\"\"",
1349
- "description": "The value of the form component.",
1350
- "fieldName": "value",
1351
- "inheritedFrom": {
1352
- "name": "InputMixin",
1353
- "module": "src/common/mixins/InputMixin.ts"
1354
- }
1009
+ "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.",
1010
+ "fieldName": "max"
1355
1011
  }
1356
1012
  ],
1357
1013
  "mixins": [
1358
- {
1359
- "name": "FormAssociatedMixin",
1360
- "module": "/src/common/mixins/FormAssociatedMixin.js"
1361
- },
1362
- {
1363
- "name": "InputMixin",
1364
- "module": "/src/common/mixins/InputMixin.js"
1365
- },
1366
- {
1367
- "name": "FocusableMixin",
1368
- "module": "/src/common/mixins/FocusableMixin.js"
1369
- },
1370
1014
  {
1371
1015
  "name": "DraftComponentMixin",
1372
1016
  "module": "/src/common/mixins/DraftComponentMixin.js"
@@ -1377,33 +1021,9 @@
1377
1021
  "package": "lit"
1378
1022
  },
1379
1023
  "status": "draft",
1380
- "category": "form",
1381
- "tagName": "nord-checkbox",
1382
- "customElement": true,
1383
- "events": [
1384
- {
1385
- "name": "input",
1386
- "type": {
1387
- "text": "NordEvent"
1388
- },
1389
- "description": "Fired as the user types into the input.",
1390
- "inheritedFrom": {
1391
- "name": "FormAssociatedMixin",
1392
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1393
- }
1394
- },
1395
- {
1396
- "name": "change",
1397
- "type": {
1398
- "text": "NordEvent"
1399
- },
1400
- "description": "Fired whenever the input's value is changed via user interaction.",
1401
- "inheritedFrom": {
1402
- "name": "FormAssociatedMixin",
1403
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1404
- }
1405
- }
1406
- ]
1024
+ "category": "list",
1025
+ "tagName": "nord-calendar",
1026
+ "customElement": true
1407
1027
  }
1408
1028
  ],
1409
1029
  "exports": [
@@ -1411,291 +1031,412 @@
1411
1031
  "kind": "js",
1412
1032
  "name": "default",
1413
1033
  "declaration": {
1414
- "name": "Checkbox",
1415
- "module": "src/checkbox/Checkbox.ts"
1034
+ "name": "Calendar",
1035
+ "module": "src/calendar/Calendar.ts"
1416
1036
  }
1417
1037
  },
1418
1038
  {
1419
1039
  "kind": "custom-element-definition",
1420
- "name": "nord-checkbox",
1040
+ "name": "nord-calendar",
1421
1041
  "declaration": {
1422
- "name": "Checkbox",
1423
- "module": "src/checkbox/Checkbox.ts"
1042
+ "name": "Calendar",
1043
+ "module": "src/calendar/Calendar.ts"
1424
1044
  }
1425
1045
  }
1426
1046
  ],
1427
- "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 for making it possible to choose one or more options from a limited number of options.\n- Use for “accepting terms of service” and similar functionality.\n- Use in forms to toggle something on or off.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use when you have more than 10 options to choose from.\n- Don’t change the selection of another checkbox when another one is clicked. Only exception is when a checkbox is used to make a bulk selection of multiple items.\n\n</div>\n\n---\n\n## Content guidelines\n\nCheckbox labels should be clear, accurate and predictable. It should be possible for the user to understand what they are selecting:\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">Option 1</div>\n\nWhen writing checkbox 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\">User settings</div>\n<div class=\"n-usage n-usage-dont\">User Settings</div>\n\nAvoid ending in punctuation if it’s a single sentence, word, or a fragment:\n\n<div class=\"n-usage n-usage-do\">Show dashboard</div>\n<div class=\"n-usage n-usage-dont\">Show dashboard.</div>\n\nDo not use commas or semicolons at the end of each line\n\n<div class=\"n-usage n-usage-do\">Patients</div>\n<div class=\"n-usage n-usage-dont\">Patients;</div>\n"
1047
+ "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"
1428
1048
  },
1429
1049
  {
1430
1050
  "kind": "javascript-module",
1431
- "path": "src/calendar/Calendar.ts",
1051
+ "path": "src/calendar/DateSelectEvent.ts",
1432
1052
  "declarations": [
1433
1053
  {
1434
1054
  "kind": "class",
1435
- "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.",
1436
- "name": "Calendar",
1055
+ "description": "",
1056
+ "name": "DateSelectEvent",
1437
1057
  "members": [
1438
1058
  {
1439
1059
  "kind": "field",
1440
- "name": "dialogLabelId",
1060
+ "name": "eventName",
1441
1061
  "type": {
1442
1062
  "text": "string"
1443
1063
  },
1444
- "privacy": "private",
1445
- "default": "\"dialog-header\""
1446
- },
1447
- {
1448
- "kind": "field",
1449
- "name": "monthSelectNode",
1450
- "type": {
1451
- "text": "HTMLElement"
1452
- },
1453
- "privacy": "private"
1064
+ "static": true,
1065
+ "default": "\"nord-select\""
1454
1066
  },
1455
1067
  {
1456
1068
  "kind": "field",
1457
- "name": "focusedDayNode",
1069
+ "name": "date",
1458
1070
  "type": {
1459
- "text": "HTMLButtonElement"
1071
+ "text": "Date"
1460
1072
  },
1461
- "privacy": "private"
1462
- },
1463
- {
1464
- "kind": "field",
1465
- "name": "direction",
1466
- "privacy": "private",
1467
- "default": "new DirectionController(this)"
1468
- },
1469
- {
1470
- "kind": "field",
1471
- "name": "swipe",
1472
- "privacy": "private",
1473
- "default": "new SwipeController(this, {\n matchesGesture: isHorizontalSwipe,\n onSwipeEnd: ({ distX }) => this.addMonths(distX < 0 ? 1 : -1),\n })"
1073
+ "default": "date"
1074
+ }
1075
+ ],
1076
+ "superclass": {
1077
+ "name": "NordEvent",
1078
+ "module": "/src/common/events.js"
1079
+ }
1080
+ }
1081
+ ],
1082
+ "exports": [
1083
+ {
1084
+ "kind": "js",
1085
+ "name": "DateSelectEvent",
1086
+ "declaration": {
1087
+ "name": "DateSelectEvent",
1088
+ "module": "src/calendar/DateSelectEvent.ts"
1089
+ }
1090
+ }
1091
+ ],
1092
+ "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"
1093
+ },
1094
+ {
1095
+ "kind": "javascript-module",
1096
+ "path": "src/calendar/calendar-localization.ts",
1097
+ "declarations": [
1098
+ {
1099
+ "kind": "variable",
1100
+ "name": "localization",
1101
+ "type": {
1102
+ "text": "CalendarLocalizedText"
1103
+ },
1104
+ "default": "{\n prevMonthLabel: \"Previous month\",\n nextMonthLabel: \"Next month\",\n monthSelectLabel: \"Month\",\n yearSelectLabel: \"Year\",\n calendarHeading: \"Choose a date\",\n dayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n monthNames: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n monthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n locale: \"en-GB\",\n}"
1105
+ }
1106
+ ],
1107
+ "exports": [
1108
+ {
1109
+ "kind": "js",
1110
+ "name": "default",
1111
+ "declaration": {
1112
+ "name": "localization",
1113
+ "module": "src/calendar/calendar-localization.ts"
1114
+ }
1115
+ }
1116
+ ],
1117
+ "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"
1118
+ },
1119
+ {
1120
+ "kind": "javascript-module",
1121
+ "path": "src/calendar/month-view.ts",
1122
+ "declarations": [
1123
+ {
1124
+ "kind": "function",
1125
+ "name": "dayView",
1126
+ "parameters": [
1127
+ {
1128
+ "name": "{\n focusedDay,\n today,\n day,\n onDaySelect,\n onKeyboardNavigation,\n disabled,\n inRange,\n isSelected,\n dateFormatter,\n}",
1129
+ "type": {
1130
+ "text": "DatePickerDayProps"
1131
+ }
1132
+ }
1133
+ ]
1134
+ },
1135
+ {
1136
+ "kind": "function",
1137
+ "name": "monthView",
1138
+ "parameters": [
1139
+ {
1140
+ "name": "{\n onFocusIn,\n onFocusOut,\n selectedDate,\n focusedDate,\n labelledById,\n localization,\n firstDayOfWeek,\n min,\n max,\n dateFormatter,\n isDateDisabled,\n onDateSelect,\n onKeyboardNavigation,\n}",
1141
+ "type": {
1142
+ "text": "MonthViewArgs"
1143
+ }
1144
+ }
1145
+ ]
1146
+ }
1147
+ ],
1148
+ "exports": [
1149
+ {
1150
+ "kind": "js",
1151
+ "name": "dayView",
1152
+ "declaration": {
1153
+ "name": "dayView",
1154
+ "module": "src/calendar/month-view.ts"
1155
+ }
1156
+ },
1157
+ {
1158
+ "kind": "js",
1159
+ "name": "monthView",
1160
+ "declaration": {
1161
+ "name": "monthView",
1162
+ "module": "src/calendar/month-view.ts"
1163
+ }
1164
+ }
1165
+ ],
1166
+ "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"
1167
+ },
1168
+ {
1169
+ "kind": "javascript-module",
1170
+ "path": "src/command-menu/CommandMenu.ts",
1171
+ "declarations": [
1172
+ {
1173
+ "kind": "class",
1174
+ "description": "Command Menu allows users to navigate and use an app without\ntouching the mouse and helps them transform into “power users”\nwho can harness more advanced features far faster.",
1175
+ "name": "CommandMenu",
1176
+ "slots": [
1177
+ {
1178
+ "description": "Used to replace the default footer contents.",
1179
+ "name": "footer"
1180
+ }
1181
+ ],
1182
+ "members": [
1183
+ {
1184
+ "kind": "field",
1185
+ "name": "inputRef",
1186
+ "privacy": "private"
1474
1187
  },
1475
1188
  {
1476
1189
  "kind": "field",
1477
- "name": "shortcuts",
1190
+ "name": "listRef",
1478
1191
  "privacy": "private"
1479
1192
  },
1480
1193
  {
1481
1194
  "kind": "field",
1482
- "name": "dateFormatShort",
1195
+ "name": "previousFocus",
1483
1196
  "type": {
1484
- "text": "Intl.DateTimeFormat"
1197
+ "text": "HTMLElement | undefined"
1485
1198
  },
1199
+ "privacy": "private"
1200
+ },
1201
+ {
1202
+ "kind": "field",
1203
+ "name": "dismissController",
1486
1204
  "privacy": "private",
1487
- "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"
1205
+ "default": "new LightDismissController(this, {\n isOpen: () => this.open,\n onDismiss: () => this.close(),\n })"
1488
1206
  },
1489
1207
  {
1490
1208
  "kind": "field",
1491
- "name": "localization",
1209
+ "name": "keyboardController",
1210
+ "privacy": "private",
1211
+ "default": "new KeyboardController(this, {\n trigger: () => this.select(),\n goBack: () => this.goBack(),\n end: () => this.end(),\n start: () => this.start(),\n next: () => this.next(),\n previous: () => this.previous(),\n toggleOpen: () => this.toggleOpen(),\n })"
1212
+ },
1213
+ {
1214
+ "kind": "field",
1215
+ "name": "open",
1492
1216
  "type": {
1493
- "text": "CalendarLocalizedText"
1217
+ "text": "boolean"
1494
1218
  },
1495
- "default": "localization"
1219
+ "default": "false",
1220
+ "description": "Show or hide the command menu.",
1221
+ "attribute": "open"
1496
1222
  },
1497
1223
  {
1498
1224
  "kind": "field",
1499
- "name": "value",
1225
+ "name": "placeholder",
1500
1226
  "type": {
1501
1227
  "text": "string"
1502
1228
  },
1503
- "default": "\"\"",
1504
- "description": "The selected date on the calendar. Must be in IS0-8601 format: YYYY-MM-DD.",
1505
- "attribute": "value"
1229
+ "default": "\"Type a command or search...\"",
1230
+ "description": "Hint text to display in the Command Menu search field.",
1231
+ "attribute": "placeholder"
1506
1232
  },
1507
1233
  {
1508
1234
  "kind": "field",
1509
- "name": "firstDayOfWeek",
1235
+ "name": "commands",
1510
1236
  "type": {
1511
- "text": "DaysOfWeek"
1237
+ "text": "Array<ICommandMenuAction>"
1512
1238
  },
1513
- "description": "Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\nDefault is Monday.",
1514
- "attribute": "firstDayOfWeek"
1239
+ "default": "[]",
1240
+ "description": "Array of commands to be included in the menu.\nPlease see “Commands data” section for more documentation."
1515
1241
  },
1516
1242
  {
1517
1243
  "kind": "field",
1518
- "name": "min",
1244
+ "name": "parent",
1519
1245
  "type": {
1520
- "text": "string"
1246
+ "text": "string | undefined"
1521
1247
  },
1522
- "default": "\"\"",
1523
- "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.",
1524
- "attribute": "min"
1248
+ "privacy": "private"
1525
1249
  },
1526
1250
  {
1527
1251
  "kind": "field",
1528
- "name": "max",
1252
+ "name": "search",
1529
1253
  "type": {
1530
1254
  "text": "string"
1531
1255
  },
1532
- "default": "\"\"",
1533
- "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.",
1534
- "attribute": "max"
1256
+ "privacy": "private",
1257
+ "default": "\"\""
1535
1258
  },
1536
1259
  {
1537
1260
  "kind": "field",
1538
- "name": "isDateDisabled",
1261
+ "name": "bump",
1539
1262
  "type": {
1540
- "text": "DateDisabledPredicate"
1263
+ "text": "boolean"
1541
1264
  },
1542
- "default": "isDateDisabled",
1543
- "description": "Controls which days are disabled and therefore disallowed.\nFor example, this can be used to disallow selection of weekends."
1265
+ "privacy": "private",
1266
+ "default": "true"
1544
1267
  },
1545
1268
  {
1546
1269
  "kind": "field",
1547
- "name": "activeFocus",
1270
+ "name": "selectedIndex",
1548
1271
  "type": {
1549
- "text": "boolean"
1272
+ "text": "number"
1550
1273
  },
1551
1274
  "privacy": "private",
1552
- "default": "false"
1275
+ "default": "0"
1553
1276
  },
1554
1277
  {
1555
1278
  "kind": "field",
1556
- "name": "focusedDay",
1279
+ "name": "filteredCommands",
1280
+ "type": {
1281
+ "text": "Array<ICommandMenuAction>"
1282
+ },
1557
1283
  "privacy": "private",
1558
- "default": "new Date()"
1284
+ "default": "[]"
1285
+ },
1286
+ {
1287
+ "kind": "field",
1288
+ "name": "selected",
1289
+ "type": {
1290
+ "text": "ICommandMenuAction"
1291
+ },
1292
+ "privacy": "private"
1559
1293
  },
1560
1294
  {
1561
1295
  "kind": "method",
1562
- "name": "focus",
1296
+ "name": "show",
1563
1297
  "parameters": [
1564
1298
  {
1565
1299
  "name": "options",
1566
- "optional": true,
1300
+ "default": "{}",
1567
1301
  "type": {
1568
- "text": "FocusOptions & { target: \"day\" | \"month\" }"
1569
- }
1302
+ "text": "{ parent?: string }"
1303
+ },
1304
+ "description": "allows you to open the menu filtered to a specific parent command."
1570
1305
  }
1571
- ]
1306
+ ],
1307
+ "description": "Show the command menu programmatically."
1572
1308
  },
1573
1309
  {
1574
1310
  "kind": "method",
1575
- "name": "createDateFormatter",
1576
- "privacy": "private"
1311
+ "name": "close",
1312
+ "description": "Close the command menu programmatically."
1577
1313
  },
1578
1314
  {
1579
- "kind": "field",
1580
- "name": "handleDaySelect",
1315
+ "kind": "method",
1316
+ "name": "toggleOpen",
1317
+ "description": "Toggle the open state programmatically."
1318
+ },
1319
+ {
1320
+ "kind": "method",
1321
+ "name": "focus",
1322
+ "description": "Focus the command menu's input."
1323
+ },
1324
+ {
1325
+ "kind": "method",
1326
+ "name": "renderNoResults",
1581
1327
  "privacy": "private"
1582
1328
  },
1583
1329
  {
1584
1330
  "kind": "method",
1585
- "name": "addDays",
1331
+ "name": "renderSection",
1586
1332
  "privacy": "private",
1587
1333
  "parameters": [
1588
1334
  {
1589
- "name": "days",
1335
+ "name": "section",
1590
1336
  "type": {
1591
- "text": "number"
1337
+ "text": "string | undefined"
1592
1338
  }
1593
- }
1594
- ]
1595
- },
1596
- {
1597
- "kind": "method",
1598
- "name": "addMonths",
1599
- "privacy": "private",
1600
- "parameters": [
1339
+ },
1601
1340
  {
1602
- "name": "months",
1341
+ "name": "commands",
1603
1342
  "type": {
1604
- "text": "number"
1343
+ "text": "ICommandMenuAction[]"
1605
1344
  }
1606
1345
  }
1607
1346
  ]
1608
1347
  },
1609
1348
  {
1610
1349
  "kind": "method",
1611
- "name": "addYears",
1612
- "privacy": "private",
1613
- "parameters": [
1614
- {
1615
- "name": "years",
1616
- "type": {
1617
- "text": "number"
1618
- }
1619
- }
1620
- ]
1621
- },
1622
- {
1623
- "kind": "method",
1624
- "name": "startOfWeek",
1350
+ "name": "handleAnimationEnd",
1625
1351
  "privacy": "private"
1626
1352
  },
1627
1353
  {
1628
1354
  "kind": "method",
1629
- "name": "endOfWeek",
1355
+ "name": "handleBlur",
1630
1356
  "privacy": "private"
1631
1357
  },
1632
1358
  {
1633
1359
  "kind": "method",
1634
- "name": "setMonth",
1360
+ "name": "handleInput",
1635
1361
  "privacy": "private",
1636
1362
  "parameters": [
1637
1363
  {
1638
- "name": "month",
1364
+ "name": "event",
1639
1365
  "type": {
1640
- "text": "number"
1366
+ "text": "KeyboardEvent"
1641
1367
  }
1642
1368
  }
1643
1369
  ]
1644
1370
  },
1645
1371
  {
1646
1372
  "kind": "method",
1647
- "name": "setYear",
1373
+ "name": "select",
1648
1374
  "privacy": "private",
1649
1375
  "parameters": [
1650
1376
  {
1651
- "name": "year",
1377
+ "name": "command",
1378
+ "default": "this.selected",
1652
1379
  "type": {
1653
- "text": "number"
1380
+ "text": "ICommandMenuAction"
1654
1381
  }
1655
1382
  }
1656
1383
  ]
1657
1384
  },
1658
1385
  {
1659
1386
  "kind": "method",
1660
- "name": "setFocusedDay",
1661
- "privacy": "private",
1662
- "parameters": [
1663
- {
1664
- "name": "day",
1665
- "type": {
1666
- "text": "Date"
1667
- }
1668
- }
1669
- ]
1387
+ "name": "start",
1388
+ "privacy": "private"
1670
1389
  },
1671
1390
  {
1672
- "kind": "field",
1673
- "name": "handleMonthSelect",
1391
+ "kind": "method",
1392
+ "name": "end",
1674
1393
  "privacy": "private"
1675
1394
  },
1676
1395
  {
1677
- "kind": "field",
1678
- "name": "handleYearSelect",
1396
+ "kind": "method",
1397
+ "name": "next",
1679
1398
  "privacy": "private"
1680
1399
  },
1681
1400
  {
1682
- "kind": "field",
1683
- "name": "handleNextMonthClick",
1401
+ "kind": "method",
1402
+ "name": "previous",
1684
1403
  "privacy": "private"
1685
1404
  },
1686
1405
  {
1687
- "kind": "field",
1688
- "name": "handlePreviousMonthClick",
1406
+ "kind": "method",
1407
+ "name": "goBack",
1689
1408
  "privacy": "private"
1690
1409
  },
1691
1410
  {
1692
- "kind": "field",
1693
- "name": "enableActiveFocus",
1694
- "privacy": "private"
1411
+ "kind": "method",
1412
+ "name": "setParent",
1413
+ "privacy": "private",
1414
+ "parameters": [
1415
+ {
1416
+ "name": "parent",
1417
+ "optional": true,
1418
+ "type": {
1419
+ "text": "string"
1420
+ }
1421
+ }
1422
+ ]
1695
1423
  },
1696
1424
  {
1697
- "kind": "field",
1698
- "name": "disableActiveFocus",
1425
+ "kind": "method",
1426
+ "name": "setSearch",
1427
+ "privacy": "private",
1428
+ "parameters": [
1429
+ {
1430
+ "name": "str",
1431
+ "type": {
1432
+ "text": "string"
1433
+ }
1434
+ }
1435
+ ]
1436
+ },
1437
+ {
1438
+ "kind": "method",
1439
+ "name": "filterCommands",
1699
1440
  "privacy": "private"
1700
1441
  },
1701
1442
  {
@@ -1713,41 +1454,47 @@
1713
1454
  }
1714
1455
  }
1715
1456
  ],
1716
- "attributes": [
1457
+ "events": [
1717
1458
  {
1718
- "name": "value",
1459
+ "name": "open",
1719
1460
  "type": {
1720
- "text": "string"
1461
+ "text": "NordEvent"
1721
1462
  },
1722
- "default": "\"\"",
1723
- "description": "The selected date on the calendar. Must be in IS0-8601 format: YYYY-MM-DD.",
1724
- "fieldName": "value"
1463
+ "description": "The command menu was opened."
1725
1464
  },
1726
1465
  {
1727
- "name": "firstDayOfWeek",
1466
+ "name": "close",
1728
1467
  "type": {
1729
- "text": "DaysOfWeek"
1468
+ "text": "NordEvent"
1730
1469
  },
1731
- "description": "Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\nDefault is Monday.",
1732
- "fieldName": "firstDayOfWeek"
1470
+ "description": "The command menu was closed."
1733
1471
  },
1734
1472
  {
1735
- "name": "min",
1736
1473
  "type": {
1737
- "text": "string"
1474
+ "text": "SelectEvent"
1738
1475
  },
1739
- "default": "\"\"",
1740
- "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.",
1741
- "fieldName": "min"
1476
+ "description": "User selected a command from the menu.",
1477
+ "name": "nord-select"
1478
+ }
1479
+ ],
1480
+ "attributes": [
1481
+ {
1482
+ "name": "open",
1483
+ "type": {
1484
+ "text": "boolean"
1485
+ },
1486
+ "default": "false",
1487
+ "description": "Show or hide the command menu.",
1488
+ "fieldName": "open"
1742
1489
  },
1743
1490
  {
1744
- "name": "max",
1491
+ "name": "placeholder",
1745
1492
  "type": {
1746
1493
  "text": "string"
1747
1494
  },
1748
- "default": "\"\"",
1749
- "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.",
1750
- "fieldName": "max"
1495
+ "default": "\"Type a command or search...\"",
1496
+ "description": "Hint text to display in the Command Menu search field.",
1497
+ "fieldName": "placeholder"
1751
1498
  }
1752
1499
  ],
1753
1500
  "mixins": [
@@ -1761,8 +1508,8 @@
1761
1508
  "package": "lit"
1762
1509
  },
1763
1510
  "status": "draft",
1764
- "category": "list",
1765
- "tagName": "nord-calendar",
1511
+ "category": "action",
1512
+ "tagName": "nord-command-menu",
1766
1513
  "customElement": true
1767
1514
  }
1768
1515
  ],
@@ -1771,116 +1518,161 @@
1771
1518
  "kind": "js",
1772
1519
  "name": "default",
1773
1520
  "declaration": {
1774
- "name": "Calendar",
1775
- "module": "src/calendar/Calendar.ts"
1521
+ "name": "CommandMenu",
1522
+ "module": "src/command-menu/CommandMenu.ts"
1776
1523
  }
1777
1524
  },
1778
1525
  {
1779
1526
  "kind": "custom-element-definition",
1780
- "name": "nord-calendar",
1527
+ "name": "nord-command-menu",
1781
1528
  "declaration": {
1782
- "name": "Calendar",
1783
- "module": "src/calendar/Calendar.ts"
1529
+ "name": "CommandMenu",
1530
+ "module": "src/command-menu/CommandMenu.ts"
1784
1531
  }
1785
1532
  }
1786
1533
  ],
1787
- "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"
1534
+ "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 provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, 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\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A&nbsp;command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
1788
1535
  },
1789
1536
  {
1790
1537
  "kind": "javascript-module",
1791
- "path": "src/calendar/DateSelectEvent.ts",
1538
+ "path": "src/command-menu/CommandMenuAction.ts",
1792
1539
  "declarations": [
1793
1540
  {
1794
1541
  "kind": "class",
1795
- "description": "",
1796
- "name": "DateSelectEvent",
1542
+ "description": "Command Menu Action displays a single action that can be executed by the user. For usage examples, please see Command Menu component.",
1543
+ "name": "CommandMenuAction",
1797
1544
  "members": [
1798
1545
  {
1799
1546
  "kind": "field",
1800
- "name": "eventName",
1547
+ "name": "command",
1801
1548
  "type": {
1802
- "text": "string"
1549
+ "text": "ICommandMenuAction"
1803
1550
  },
1804
- "static": true,
1805
- "default": "\"nord-select\""
1551
+ "attribute": "command"
1806
1552
  },
1807
1553
  {
1808
1554
  "kind": "field",
1809
- "name": "date",
1555
+ "name": "selected",
1810
1556
  "type": {
1811
- "text": "Date"
1557
+ "text": "boolean"
1812
1558
  },
1813
- "default": "date"
1559
+ "default": "false",
1560
+ "attribute": "selected"
1561
+ },
1562
+ {
1563
+ "kind": "method",
1564
+ "name": "ensureInView",
1565
+ "privacy": "private",
1566
+ "description": "Scroll to show element"
1567
+ },
1568
+ {
1569
+ "kind": "method",
1570
+ "name": "renderShortcut",
1571
+ "privacy": "private"
1572
+ }
1573
+ ],
1574
+ "attributes": [
1575
+ {
1576
+ "name": "command",
1577
+ "type": {
1578
+ "text": "ICommandMenuAction"
1579
+ },
1580
+ "fieldName": "command"
1581
+ },
1582
+ {
1583
+ "name": "selected",
1584
+ "type": {
1585
+ "text": "boolean"
1586
+ },
1587
+ "default": "false",
1588
+ "fieldName": "selected"
1814
1589
  }
1815
1590
  ],
1816
1591
  "superclass": {
1817
- "name": "NordEvent",
1818
- "module": "/src/common/events.js"
1819
- }
1592
+ "name": "LitElement",
1593
+ "package": "lit"
1594
+ },
1595
+ "status": "internal",
1596
+ "category": null,
1597
+ "tagName": "nord-command-menu-action",
1598
+ "customElement": true
1820
1599
  }
1821
1600
  ],
1822
1601
  "exports": [
1823
1602
  {
1824
1603
  "kind": "js",
1825
- "name": "DateSelectEvent",
1604
+ "name": "default",
1826
1605
  "declaration": {
1827
- "name": "DateSelectEvent",
1828
- "module": "src/calendar/DateSelectEvent.ts"
1606
+ "name": "CommandMenuAction",
1607
+ "module": "src/command-menu/CommandMenuAction.ts"
1829
1608
  }
1830
- }
1831
- ],
1832
- "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"
1833
- },
1834
- {
1835
- "kind": "javascript-module",
1836
- "path": "src/calendar/calendar-localization.ts",
1837
- "declarations": [
1838
- {
1839
- "kind": "variable",
1840
- "name": "localization",
1841
- "type": {
1842
- "text": "CalendarLocalizedText"
1843
- },
1844
- "default": "{\n prevMonthLabel: \"Previous month\",\n nextMonthLabel: \"Next month\",\n monthSelectLabel: \"Month\",\n yearSelectLabel: \"Year\",\n calendarHeading: \"Choose a date\",\n dayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n monthNames: [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n ],\n monthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n locale: \"en-GB\",\n}"
1845
- }
1846
- ],
1847
- "exports": [
1609
+ },
1848
1610
  {
1849
- "kind": "js",
1850
- "name": "default",
1611
+ "kind": "custom-element-definition",
1612
+ "name": "nord-command-menu-action",
1851
1613
  "declaration": {
1852
- "name": "localization",
1853
- "module": "src/calendar/calendar-localization.ts"
1614
+ "name": "CommandMenuAction",
1615
+ "module": "src/command-menu/CommandMenuAction.ts"
1854
1616
  }
1855
1617
  }
1856
1618
  ],
1857
- "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"
1619
+ "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 provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, 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\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A&nbsp;command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
1858
1620
  },
1859
1621
  {
1860
1622
  "kind": "javascript-module",
1861
- "path": "src/calendar/month-view.ts",
1623
+ "path": "src/command-menu/ICommandMenuAction.ts",
1624
+ "declarations": [],
1625
+ "exports": [],
1626
+ "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 provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, 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\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A&nbsp;command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
1627
+ },
1628
+ {
1629
+ "kind": "javascript-module",
1630
+ "path": "src/command-menu/KeyboardController.ts",
1862
1631
  "declarations": [
1863
1632
  {
1864
- "kind": "function",
1865
- "name": "dayView",
1866
- "parameters": [
1633
+ "kind": "class",
1634
+ "description": "",
1635
+ "name": "KeyboardController",
1636
+ "members": [
1867
1637
  {
1868
- "name": "{\n focusedDay,\n today,\n day,\n onDaySelect,\n onKeyboardNavigation,\n disabled,\n inRange,\n isSelected,\n dateFormatter,\n}",
1869
- "type": {
1870
- "text": "DatePickerDayProps"
1871
- }
1872
- }
1873
- ]
1874
- },
1875
- {
1876
- "kind": "function",
1877
- "name": "monthView",
1878
- "parameters": [
1638
+ "kind": "field",
1639
+ "name": "host",
1640
+ "type": {
1641
+ "text": "CommandMenu"
1642
+ },
1643
+ "privacy": "private",
1644
+ "default": "host"
1645
+ },
1879
1646
  {
1880
- "name": "{\n onFocusIn,\n onFocusOut,\n selectedDate,\n focusedDate,\n labelledById,\n localization,\n firstDayOfWeek,\n min,\n max,\n dateFormatter,\n isDateDisabled,\n onDateSelect,\n onKeyboardNavigation,\n}",
1647
+ "kind": "field",
1648
+ "name": "globalShortcuts",
1881
1649
  "type": {
1882
- "text": "MonthViewArgs"
1883
- }
1650
+ "text": "ShortcutController"
1651
+ },
1652
+ "privacy": "private",
1653
+ "default": "new ShortcutController(host, { \"$mod+k\": preventDefault(actions.toggleOpen) })"
1654
+ },
1655
+ {
1656
+ "kind": "field",
1657
+ "name": "navigationShortcuts",
1658
+ "type": {
1659
+ "text": "ShortcutController"
1660
+ },
1661
+ "privacy": "private",
1662
+ "default": "new ShortcutController(\n host,\n {\n Enter: preventDefault(actions.trigger),\n Backspace: actions.goBack, // we don't want to prevent default, since that would stop backspace deleting chars\n End: preventDefault(actions.end),\n Home: preventDefault(actions.start),\n ArrowDown: preventDefault(actions.next),\n ArrowUp: preventDefault(actions.previous),\n },\n host\n )"
1663
+ },
1664
+ {
1665
+ "kind": "field",
1666
+ "name": "commandShortcuts",
1667
+ "type": {
1668
+ "text": "ShortcutController"
1669
+ },
1670
+ "privacy": "private",
1671
+ "default": "new ShortcutController(host)"
1672
+ },
1673
+ {
1674
+ "kind": "method",
1675
+ "name": "registerCommandShortcuts"
1884
1676
  }
1885
1677
  ]
1886
1678
  }
@@ -1888,531 +1680,668 @@
1888
1680
  "exports": [
1889
1681
  {
1890
1682
  "kind": "js",
1891
- "name": "dayView",
1683
+ "name": "KeyboardController",
1892
1684
  "declaration": {
1893
- "name": "dayView",
1894
- "module": "src/calendar/month-view.ts"
1685
+ "name": "KeyboardController",
1686
+ "module": "src/command-menu/KeyboardController.ts"
1895
1687
  }
1896
- },
1688
+ }
1689
+ ],
1690
+ "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 provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, 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\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A&nbsp;command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
1691
+ },
1692
+ {
1693
+ "kind": "javascript-module",
1694
+ "path": "src/command-menu/SelectEvent.ts",
1695
+ "declarations": [
1696
+ {
1697
+ "kind": "class",
1698
+ "description": "",
1699
+ "name": "SelectEvent",
1700
+ "members": [
1701
+ {
1702
+ "kind": "field",
1703
+ "name": "eventName",
1704
+ "type": {
1705
+ "text": "string"
1706
+ },
1707
+ "static": true,
1708
+ "default": "\"nord-select\""
1709
+ },
1710
+ {
1711
+ "kind": "field",
1712
+ "name": "command",
1713
+ "type": {
1714
+ "text": "ICommandMenuAction"
1715
+ },
1716
+ "default": "command"
1717
+ }
1718
+ ],
1719
+ "superclass": {
1720
+ "name": "NordEvent",
1721
+ "module": "/src/common/events.js"
1722
+ }
1723
+ }
1724
+ ],
1725
+ "exports": [
1897
1726
  {
1898
1727
  "kind": "js",
1899
- "name": "monthView",
1728
+ "name": "SelectEvent",
1900
1729
  "declaration": {
1901
- "name": "monthView",
1902
- "module": "src/calendar/month-view.ts"
1730
+ "name": "SelectEvent",
1731
+ "module": "src/command-menu/SelectEvent.ts"
1903
1732
  }
1904
1733
  }
1905
1734
  ],
1906
- "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"
1735
+ "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 provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, 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\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A&nbsp;command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
1907
1736
  },
1908
1737
  {
1909
1738
  "kind": "javascript-module",
1910
- "path": "src/command-menu/CommandMenu.ts",
1739
+ "path": "src/checkbox/Checkbox.ts",
1911
1740
  "declarations": [
1912
1741
  {
1913
1742
  "kind": "class",
1914
- "description": "Command Menu allows users to navigate and use an app without\ntouching the mouse and helps them transform into “power users”\nwho can harness more advanced features far faster.",
1915
- "name": "CommandMenu",
1743
+ "description": "Checkboxes allow user to choose one or more options from a limited set of options.\nIf you have more than 10 options, please use Select component instead.",
1744
+ "name": "Checkbox",
1916
1745
  "slots": [
1917
1746
  {
1918
- "description": "Used to replace the default footer contents.",
1919
- "name": "footer"
1747
+ "description": "Use when a label requires more than plain text.",
1748
+ "name": "label"
1749
+ },
1750
+ {
1751
+ "description": "Optional slot that holds hint text for the input.",
1752
+ "name": "hint"
1753
+ },
1754
+ {
1755
+ "description": "Optional slot that holds error text for the input.",
1756
+ "name": "error"
1920
1757
  }
1921
1758
  ],
1922
1759
  "members": [
1923
1760
  {
1924
1761
  "kind": "field",
1925
- "name": "inputRef",
1926
- "privacy": "private"
1762
+ "name": "formValue",
1763
+ "privacy": "protected",
1764
+ "inheritedFrom": {
1765
+ "name": "FormAssociatedMixin",
1766
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1767
+ }
1927
1768
  },
1928
1769
  {
1929
1770
  "kind": "field",
1930
- "name": "listRef",
1931
- "privacy": "private"
1771
+ "name": "checked",
1772
+ "type": {
1773
+ "text": "boolean"
1774
+ },
1775
+ "default": "false",
1776
+ "description": "Controls whether the checkbox is checked or not.",
1777
+ "attribute": "checked"
1932
1778
  },
1933
1779
  {
1934
- "kind": "field",
1935
- "name": "previousFocus",
1936
- "type": {
1937
- "text": "HTMLElement | undefined"
1780
+ "kind": "method",
1781
+ "name": "handleChange",
1782
+ "privacy": "protected",
1783
+ "return": {
1784
+ "type": {
1785
+ "text": "void"
1786
+ }
1938
1787
  },
1939
- "privacy": "private"
1788
+ "parameters": [
1789
+ {
1790
+ "name": "e",
1791
+ "type": {
1792
+ "text": "Event"
1793
+ }
1794
+ }
1795
+ ],
1796
+ "inheritedFrom": {
1797
+ "name": "FormAssociatedMixin",
1798
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1799
+ }
1940
1800
  },
1941
1801
  {
1942
1802
  "kind": "field",
1943
- "name": "dismissController",
1944
- "privacy": "private",
1945
- "default": "new LightDismissController(this, {\n isOpen: () => this.open,\n onDismiss: () => this.close(),\n })"
1803
+ "name": "labelSlot",
1804
+ "privacy": "protected",
1805
+ "default": "new SlotController(this, \"label\")",
1806
+ "inheritedFrom": {
1807
+ "name": "FormAssociatedMixin",
1808
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1809
+ }
1946
1810
  },
1947
1811
  {
1948
1812
  "kind": "field",
1949
- "name": "keyboardController",
1950
- "privacy": "private",
1951
- "default": "new KeyboardController(this, {\n trigger: () => this.select(),\n goBack: () => this.goBack(),\n end: () => this.end(),\n start: () => this.start(),\n next: () => this.next(),\n previous: () => this.previous(),\n toggleOpen: () => this.toggleOpen(),\n })"
1813
+ "name": "errorSlot",
1814
+ "privacy": "protected",
1815
+ "default": "new SlotController(this, \"error\")",
1816
+ "inheritedFrom": {
1817
+ "name": "FormAssociatedMixin",
1818
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1819
+ }
1952
1820
  },
1953
1821
  {
1954
1822
  "kind": "field",
1955
- "name": "open",
1956
- "type": {
1957
- "text": "boolean"
1958
- },
1959
- "default": "false",
1960
- "description": "Show or hide the command menu.",
1961
- "attribute": "open"
1823
+ "name": "hintSlot",
1824
+ "privacy": "protected",
1825
+ "default": "new SlotController(this, \"hint\")",
1826
+ "inheritedFrom": {
1827
+ "name": "FormAssociatedMixin",
1828
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1829
+ }
1962
1830
  },
1963
1831
  {
1964
1832
  "kind": "field",
1965
- "name": "placeholder",
1966
- "type": {
1967
- "text": "string"
1968
- },
1969
- "default": "\"Type a command or search...\"",
1970
- "description": "Hint text to display in the Command Menu search field.",
1971
- "attribute": "placeholder"
1833
+ "name": "formData",
1834
+ "privacy": "protected",
1835
+ "default": "new FormDataController(this, { value: () => this.formValue })",
1836
+ "inheritedFrom": {
1837
+ "name": "FormAssociatedMixin",
1838
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1839
+ }
1972
1840
  },
1973
1841
  {
1974
1842
  "kind": "field",
1975
- "name": "commands",
1843
+ "name": "inputId",
1976
1844
  "type": {
1977
- "text": "Array<ICommandMenuAction>"
1845
+ "text": "string"
1978
1846
  },
1979
- "default": "[]",
1980
- "description": "Array of commands to be included in the menu.\nPlease see “Commands data” section for more documentation."
1847
+ "privacy": "protected",
1848
+ "default": "\"input\"",
1849
+ "inheritedFrom": {
1850
+ "name": "FormAssociatedMixin",
1851
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1852
+ }
1981
1853
  },
1982
1854
  {
1983
1855
  "kind": "field",
1984
- "name": "parent",
1856
+ "name": "errorId",
1985
1857
  "type": {
1986
- "text": "string | undefined"
1858
+ "text": "string"
1987
1859
  },
1988
- "privacy": "private"
1860
+ "privacy": "protected",
1861
+ "default": "\"error\"",
1862
+ "inheritedFrom": {
1863
+ "name": "FormAssociatedMixin",
1864
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1865
+ }
1989
1866
  },
1990
1867
  {
1991
1868
  "kind": "field",
1992
- "name": "search",
1869
+ "name": "hintId",
1993
1870
  "type": {
1994
1871
  "text": "string"
1995
1872
  },
1996
- "privacy": "private",
1997
- "default": "\"\""
1873
+ "privacy": "protected",
1874
+ "default": "\"hint\"",
1875
+ "inheritedFrom": {
1876
+ "name": "FormAssociatedMixin",
1877
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1878
+ }
1998
1879
  },
1999
1880
  {
2000
1881
  "kind": "field",
2001
- "name": "bump",
1882
+ "name": "label",
2002
1883
  "type": {
2003
- "text": "boolean"
1884
+ "text": "string"
2004
1885
  },
2005
- "privacy": "private",
2006
- "default": "true"
1886
+ "default": "\"\"",
1887
+ "description": "Label for the input.",
1888
+ "attribute": "label",
1889
+ "inheritedFrom": {
1890
+ "name": "FormAssociatedMixin",
1891
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1892
+ }
2007
1893
  },
2008
1894
  {
2009
1895
  "kind": "field",
2010
- "name": "selectedIndex",
1896
+ "name": "hint",
2011
1897
  "type": {
2012
- "text": "number"
1898
+ "text": "string | undefined"
2013
1899
  },
2014
- "privacy": "private",
2015
- "default": "0"
1900
+ "description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
1901
+ "attribute": "hint",
1902
+ "inheritedFrom": {
1903
+ "name": "FormAssociatedMixin",
1904
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1905
+ }
2016
1906
  },
2017
1907
  {
2018
1908
  "kind": "field",
2019
- "name": "filteredCommands",
1909
+ "name": "hideLabel",
2020
1910
  "type": {
2021
- "text": "Array<ICommandMenuAction>"
1911
+ "text": "boolean"
2022
1912
  },
2023
- "privacy": "private",
2024
- "default": "[]"
1913
+ "default": "false",
1914
+ "description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
1915
+ "attribute": "hide-label",
1916
+ "inheritedFrom": {
1917
+ "name": "FormAssociatedMixin",
1918
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1919
+ }
2025
1920
  },
2026
1921
  {
2027
1922
  "kind": "field",
2028
- "name": "selected",
1923
+ "name": "placeholder",
2029
1924
  "type": {
2030
- "text": "ICommandMenuAction"
1925
+ "text": "string | undefined"
2031
1926
  },
2032
- "privacy": "private"
2033
- },
2034
- {
2035
- "kind": "method",
2036
- "name": "show",
2037
- "parameters": [
2038
- {
2039
- "name": "options",
2040
- "default": "{}",
2041
- "type": {
2042
- "text": "{ parent?: string }"
2043
- },
2044
- "description": "allows you to open the menu filtered to a specific parent command."
2045
- }
2046
- ],
2047
- "description": "Show the command menu programmatically."
2048
- },
2049
- {
2050
- "kind": "method",
2051
- "name": "close",
2052
- "description": "Close the command menu programmatically."
2053
- },
2054
- {
2055
- "kind": "method",
2056
- "name": "toggleOpen",
2057
- "description": "Toggle the open state programmatically."
2058
- },
2059
- {
2060
- "kind": "method",
2061
- "name": "focus",
2062
- "description": "Focus the command menu's input."
2063
- },
2064
- {
2065
- "kind": "method",
2066
- "name": "renderNoResults",
2067
- "privacy": "private"
1927
+ "description": "Placeholder text to display within the input.",
1928
+ "attribute": "placeholder",
1929
+ "inheritedFrom": {
1930
+ "name": "FormAssociatedMixin",
1931
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1932
+ }
2068
1933
  },
2069
1934
  {
2070
- "kind": "method",
2071
- "name": "renderSection",
2072
- "privacy": "private",
2073
- "parameters": [
2074
- {
2075
- "name": "section",
2076
- "type": {
2077
- "text": "string | undefined"
2078
- }
2079
- },
2080
- {
2081
- "name": "commands",
2082
- "type": {
2083
- "text": "ICommandMenuAction[]"
2084
- }
2085
- }
2086
- ]
1935
+ "kind": "field",
1936
+ "name": "error",
1937
+ "type": {
1938
+ "text": "string | undefined"
1939
+ },
1940
+ "description": "Optional error to be shown with the input. Alternatively use the error slot.",
1941
+ "attribute": "error",
1942
+ "inheritedFrom": {
1943
+ "name": "FormAssociatedMixin",
1944
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1945
+ }
2087
1946
  },
2088
1947
  {
2089
- "kind": "method",
2090
- "name": "handleAnimationEnd",
2091
- "privacy": "private"
1948
+ "kind": "field",
1949
+ "name": "required",
1950
+ "type": {
1951
+ "text": "boolean"
1952
+ },
1953
+ "default": "false",
1954
+ "description": "Determines whether the input is required or not.\nAn input marked as required will be announced as such to users of assistive technology.\nWhen using this property you need to also set “novalidate” attribute on a form element to prevent browser from displaying its own validation errors.",
1955
+ "attribute": "required",
1956
+ "inheritedFrom": {
1957
+ "name": "FormAssociatedMixin",
1958
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1959
+ }
2092
1960
  },
2093
1961
  {
2094
- "kind": "method",
2095
- "name": "handleBlur",
2096
- "privacy": "private"
1962
+ "kind": "field",
1963
+ "name": "expand",
1964
+ "type": {
1965
+ "text": "boolean"
1966
+ },
1967
+ "default": "false",
1968
+ "description": "Controls whether the input expands to fill the width of its container.",
1969
+ "attribute": "expand",
1970
+ "reflects": true,
1971
+ "inheritedFrom": {
1972
+ "name": "FormAssociatedMixin",
1973
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1974
+ }
2097
1975
  },
2098
1976
  {
2099
1977
  "kind": "method",
2100
1978
  "name": "handleInput",
2101
- "privacy": "private",
2102
- "parameters": [
2103
- {
2104
- "name": "event",
2105
- "type": {
2106
- "text": "KeyboardEvent"
2107
- }
2108
- }
2109
- ]
2110
- },
2111
- {
2112
- "kind": "method",
2113
- "name": "select",
2114
- "privacy": "private",
1979
+ "privacy": "protected",
2115
1980
  "parameters": [
2116
1981
  {
2117
- "name": "command",
2118
- "default": "this.selected",
1982
+ "name": "e",
2119
1983
  "type": {
2120
- "text": "ICommandMenuAction"
1984
+ "text": "Event"
2121
1985
  }
2122
1986
  }
2123
- ]
2124
- },
2125
- {
2126
- "kind": "method",
2127
- "name": "start",
2128
- "privacy": "private"
2129
- },
2130
- {
2131
- "kind": "method",
2132
- "name": "end",
2133
- "privacy": "private"
1987
+ ],
1988
+ "inheritedFrom": {
1989
+ "name": "FormAssociatedMixin",
1990
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1991
+ }
2134
1992
  },
2135
1993
  {
2136
1994
  "kind": "method",
2137
- "name": "next",
2138
- "privacy": "private"
1995
+ "name": "renderLabel",
1996
+ "privacy": "protected",
1997
+ "inheritedFrom": {
1998
+ "name": "FormAssociatedMixin",
1999
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2000
+ }
2139
2001
  },
2140
2002
  {
2141
2003
  "kind": "method",
2142
- "name": "previous",
2143
- "privacy": "private"
2004
+ "name": "renderError",
2005
+ "privacy": "protected",
2006
+ "inheritedFrom": {
2007
+ "name": "FormAssociatedMixin",
2008
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2009
+ }
2144
2010
  },
2145
2011
  {
2146
2012
  "kind": "method",
2147
- "name": "goBack",
2148
- "privacy": "private"
2013
+ "name": "getDescribedBy",
2014
+ "privacy": "protected",
2015
+ "inheritedFrom": {
2016
+ "name": "FormAssociatedMixin",
2017
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2018
+ }
2149
2019
  },
2150
2020
  {
2151
2021
  "kind": "method",
2152
- "name": "setParent",
2153
- "privacy": "private",
2154
- "parameters": [
2155
- {
2156
- "name": "parent",
2157
- "optional": true,
2158
- "type": {
2159
- "text": "string"
2160
- }
2161
- }
2162
- ]
2022
+ "name": "getInvalid",
2023
+ "privacy": "protected",
2024
+ "inheritedFrom": {
2025
+ "name": "FormAssociatedMixin",
2026
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2027
+ }
2163
2028
  },
2164
2029
  {
2165
- "kind": "method",
2166
- "name": "setSearch",
2167
- "privacy": "private",
2168
- "parameters": [
2169
- {
2170
- "name": "str",
2171
- "type": {
2172
- "text": "string"
2173
- }
2174
- }
2175
- ]
2030
+ "kind": "field",
2031
+ "name": "hasHint",
2032
+ "privacy": "protected",
2033
+ "inheritedFrom": {
2034
+ "name": "FormAssociatedMixin",
2035
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2036
+ }
2176
2037
  },
2177
2038
  {
2178
- "kind": "method",
2179
- "name": "filterCommands",
2180
- "privacy": "private"
2039
+ "kind": "field",
2040
+ "name": "hasError",
2041
+ "privacy": "protected",
2042
+ "inheritedFrom": {
2043
+ "name": "FormAssociatedMixin",
2044
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2045
+ }
2181
2046
  },
2182
2047
  {
2183
2048
  "kind": "field",
2184
- "name": "_warningLogged",
2049
+ "name": "disabled",
2185
2050
  "type": {
2186
2051
  "text": "boolean"
2187
2052
  },
2188
- "privacy": "private",
2189
- "static": true,
2190
2053
  "default": "false",
2054
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
2055
+ "attribute": "disabled",
2056
+ "reflects": true,
2191
2057
  "inheritedFrom": {
2192
- "name": "DraftComponentMixin",
2193
- "module": "src/common/mixins/DraftComponentMixin.ts"
2058
+ "name": "InputMixin",
2059
+ "module": "src/common/mixins/InputMixin.ts"
2194
2060
  }
2195
- }
2196
- ],
2197
- "events": [
2198
- {
2199
- "name": "open",
2200
- "type": {
2201
- "text": "NordEvent"
2202
- },
2203
- "description": "The command menu was opened."
2204
2061
  },
2205
2062
  {
2206
- "name": "close",
2063
+ "kind": "field",
2064
+ "name": "name",
2207
2065
  "type": {
2208
- "text": "NordEvent"
2066
+ "text": "string | undefined"
2209
2067
  },
2210
- "description": "The command menu was closed."
2068
+ "description": "The name of the form component.",
2069
+ "attribute": "name",
2070
+ "inheritedFrom": {
2071
+ "name": "InputMixin",
2072
+ "module": "src/common/mixins/InputMixin.ts"
2073
+ }
2211
2074
  },
2212
2075
  {
2076
+ "kind": "field",
2077
+ "name": "value",
2213
2078
  "type": {
2214
- "text": "SelectEvent"
2079
+ "text": "string"
2215
2080
  },
2216
- "description": "User selected a command from the menu.",
2217
- "name": "nord-select"
2081
+ "default": "\"\"",
2082
+ "description": "The value of the form component.",
2083
+ "attribute": "value",
2084
+ "inheritedFrom": {
2085
+ "name": "InputMixin",
2086
+ "module": "src/common/mixins/InputMixin.ts"
2087
+ }
2088
+ },
2089
+ {
2090
+ "kind": "field",
2091
+ "name": "form",
2092
+ "privacy": "protected",
2093
+ "description": "Gets the form, if any, associated with the form element.",
2094
+ "inheritedFrom": {
2095
+ "name": "InputMixin",
2096
+ "module": "src/common/mixins/InputMixin.ts"
2097
+ }
2098
+ },
2099
+ {
2100
+ "kind": "field",
2101
+ "name": "focusableRef",
2102
+ "privacy": "protected",
2103
+ "inheritedFrom": {
2104
+ "name": "FocusableMixin",
2105
+ "module": "src/common/mixins/FocusableMixin.ts"
2106
+ }
2107
+ },
2108
+ {
2109
+ "kind": "method",
2110
+ "name": "focus",
2111
+ "parameters": [
2112
+ {
2113
+ "name": "options",
2114
+ "optional": true,
2115
+ "type": {
2116
+ "text": "FocusOptions"
2117
+ },
2118
+ "description": "An object which controls aspects of the focusing process."
2119
+ }
2120
+ ],
2121
+ "description": "Programmatically move focus to the component.",
2122
+ "inheritedFrom": {
2123
+ "name": "FocusableMixin",
2124
+ "module": "src/common/mixins/FocusableMixin.ts"
2125
+ }
2126
+ },
2127
+ {
2128
+ "kind": "method",
2129
+ "name": "blur",
2130
+ "description": "Programmatically remove focus from the component.",
2131
+ "inheritedFrom": {
2132
+ "name": "FocusableMixin",
2133
+ "module": "src/common/mixins/FocusableMixin.ts"
2134
+ }
2135
+ },
2136
+ {
2137
+ "kind": "method",
2138
+ "name": "click",
2139
+ "description": "Programmatically simulates a click on the component.",
2140
+ "inheritedFrom": {
2141
+ "name": "FocusableMixin",
2142
+ "module": "src/common/mixins/FocusableMixin.ts"
2143
+ }
2144
+ },
2145
+ {
2146
+ "kind": "field",
2147
+ "name": "_warningLogged",
2148
+ "type": {
2149
+ "text": "boolean"
2150
+ },
2151
+ "privacy": "private",
2152
+ "static": true,
2153
+ "default": "false",
2154
+ "inheritedFrom": {
2155
+ "name": "DraftComponentMixin",
2156
+ "module": "src/common/mixins/DraftComponentMixin.ts"
2157
+ }
2218
2158
  }
2219
2159
  ],
2220
2160
  "attributes": [
2221
2161
  {
2222
- "name": "open",
2162
+ "name": "checked",
2223
2163
  "type": {
2224
2164
  "text": "boolean"
2225
2165
  },
2226
2166
  "default": "false",
2227
- "description": "Show or hide the command menu.",
2228
- "fieldName": "open"
2167
+ "description": "Controls whether the checkbox is checked or not.",
2168
+ "fieldName": "checked"
2229
2169
  },
2230
2170
  {
2231
- "name": "placeholder",
2171
+ "name": "label",
2232
2172
  "type": {
2233
2173
  "text": "string"
2234
2174
  },
2235
- "default": "\"Type a command or search...\"",
2236
- "description": "Hint text to display in the Command Menu search field.",
2237
- "fieldName": "placeholder"
2238
- }
2239
- ],
2240
- "mixins": [
2241
- {
2242
- "name": "DraftComponentMixin",
2243
- "module": "/src/common/mixins/DraftComponentMixin.js"
2244
- }
2245
- ],
2246
- "superclass": {
2247
- "name": "LitElement",
2248
- "package": "lit"
2249
- },
2250
- "status": "draft",
2251
- "category": "action",
2252
- "tagName": "nord-command-menu",
2253
- "customElement": true
2254
- }
2255
- ],
2256
- "exports": [
2257
- {
2258
- "kind": "js",
2259
- "name": "default",
2260
- "declaration": {
2261
- "name": "CommandMenu",
2262
- "module": "src/command-menu/CommandMenu.ts"
2263
- }
2264
- },
2265
- {
2266
- "kind": "custom-element-definition",
2267
- "name": "nord-command-menu",
2268
- "declaration": {
2269
- "name": "CommandMenu",
2270
- "module": "src/command-menu/CommandMenu.ts"
2271
- }
2272
- }
2273
- ],
2274
- "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 provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, 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\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A&nbsp;command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
2275
- },
2276
- {
2277
- "kind": "javascript-module",
2278
- "path": "src/command-menu/CommandMenuAction.ts",
2279
- "declarations": [
2280
- {
2281
- "kind": "class",
2282
- "description": "Command Menu Action displays a single action that can be executed by the user. For usage examples, please see Command Menu component.",
2283
- "name": "CommandMenuAction",
2284
- "members": [
2175
+ "default": "\"\"",
2176
+ "description": "Label for the input.",
2177
+ "fieldName": "label",
2178
+ "inheritedFrom": {
2179
+ "name": "FormAssociatedMixin",
2180
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2181
+ }
2182
+ },
2285
2183
  {
2286
- "kind": "field",
2287
- "name": "command",
2184
+ "name": "hint",
2288
2185
  "type": {
2289
- "text": "ICommandMenuAction"
2186
+ "text": "string | undefined"
2290
2187
  },
2291
- "attribute": "command"
2188
+ "description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
2189
+ "fieldName": "hint",
2190
+ "inheritedFrom": {
2191
+ "name": "FormAssociatedMixin",
2192
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2193
+ }
2292
2194
  },
2293
2195
  {
2294
- "kind": "field",
2295
- "name": "selected",
2196
+ "name": "hide-label",
2296
2197
  "type": {
2297
2198
  "text": "boolean"
2298
2199
  },
2299
2200
  "default": "false",
2300
- "attribute": "selected"
2201
+ "description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
2202
+ "fieldName": "hideLabel",
2203
+ "inheritedFrom": {
2204
+ "name": "FormAssociatedMixin",
2205
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2206
+ }
2301
2207
  },
2302
2208
  {
2303
- "kind": "method",
2304
- "name": "ensureInView",
2305
- "privacy": "private",
2306
- "description": "Scroll to show element"
2209
+ "name": "placeholder",
2210
+ "type": {
2211
+ "text": "string | undefined"
2212
+ },
2213
+ "description": "Placeholder text to display within the input.",
2214
+ "fieldName": "placeholder",
2215
+ "inheritedFrom": {
2216
+ "name": "FormAssociatedMixin",
2217
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2218
+ }
2307
2219
  },
2308
2220
  {
2309
- "kind": "method",
2310
- "name": "renderShortcut",
2311
- "privacy": "private"
2312
- }
2313
- ],
2314
- "attributes": [
2221
+ "name": "error",
2222
+ "type": {
2223
+ "text": "string | undefined"
2224
+ },
2225
+ "description": "Optional error to be shown with the input. Alternatively use the error slot.",
2226
+ "fieldName": "error",
2227
+ "inheritedFrom": {
2228
+ "name": "FormAssociatedMixin",
2229
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2230
+ }
2231
+ },
2315
2232
  {
2316
- "name": "command",
2233
+ "name": "required",
2317
2234
  "type": {
2318
- "text": "ICommandMenuAction"
2235
+ "text": "boolean"
2319
2236
  },
2320
- "fieldName": "command"
2237
+ "default": "false",
2238
+ "description": "Determines whether the input is required or not.\nAn input marked as required will be announced as such to users of assistive technology.\nWhen using this property you need to also set “novalidate” attribute on a form element to prevent browser from displaying its own validation errors.",
2239
+ "fieldName": "required",
2240
+ "inheritedFrom": {
2241
+ "name": "FormAssociatedMixin",
2242
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2243
+ }
2321
2244
  },
2322
2245
  {
2323
- "name": "selected",
2246
+ "name": "expand",
2324
2247
  "type": {
2325
2248
  "text": "boolean"
2326
2249
  },
2327
2250
  "default": "false",
2328
- "fieldName": "selected"
2329
- }
2330
- ],
2331
- "superclass": {
2332
- "name": "LitElement",
2333
- "package": "lit"
2334
- },
2335
- "status": "internal",
2336
- "category": null,
2337
- "tagName": "nord-command-menu-action",
2338
- "customElement": true
2339
- }
2340
- ],
2341
- "exports": [
2342
- {
2343
- "kind": "js",
2344
- "name": "default",
2345
- "declaration": {
2346
- "name": "CommandMenuAction",
2347
- "module": "src/command-menu/CommandMenuAction.ts"
2348
- }
2349
- },
2350
- {
2351
- "kind": "custom-element-definition",
2352
- "name": "nord-command-menu-action",
2353
- "declaration": {
2354
- "name": "CommandMenuAction",
2355
- "module": "src/command-menu/CommandMenuAction.ts"
2356
- }
2357
- }
2358
- ],
2359
- "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 provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, 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\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A&nbsp;command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
2360
- },
2361
- {
2362
- "kind": "javascript-module",
2363
- "path": "src/command-menu/ICommandMenuAction.ts",
2364
- "declarations": [],
2365
- "exports": [],
2366
- "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 provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, 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\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A&nbsp;command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
2367
- },
2368
- {
2369
- "kind": "javascript-module",
2370
- "path": "src/command-menu/KeyboardController.ts",
2371
- "declarations": [
2372
- {
2373
- "kind": "class",
2374
- "description": "",
2375
- "name": "KeyboardController",
2376
- "members": [
2251
+ "description": "Controls whether the input expands to fill the width of its container.",
2252
+ "fieldName": "expand",
2253
+ "inheritedFrom": {
2254
+ "name": "FormAssociatedMixin",
2255
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2256
+ }
2257
+ },
2377
2258
  {
2378
- "kind": "field",
2379
- "name": "host",
2259
+ "name": "disabled",
2380
2260
  "type": {
2381
- "text": "CommandMenu"
2261
+ "text": "boolean"
2382
2262
  },
2383
- "privacy": "private",
2384
- "default": "host"
2263
+ "default": "false",
2264
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
2265
+ "fieldName": "disabled",
2266
+ "inheritedFrom": {
2267
+ "name": "InputMixin",
2268
+ "module": "src/common/mixins/InputMixin.ts"
2269
+ }
2385
2270
  },
2386
2271
  {
2387
- "kind": "field",
2388
- "name": "globalShortcuts",
2272
+ "name": "name",
2389
2273
  "type": {
2390
- "text": "ShortcutController"
2274
+ "text": "string | undefined"
2391
2275
  },
2392
- "privacy": "private",
2393
- "default": "new ShortcutController(host, { \"$mod+k\": preventDefault(actions.toggleOpen) })"
2276
+ "description": "The name of the form component.",
2277
+ "fieldName": "name",
2278
+ "inheritedFrom": {
2279
+ "name": "InputMixin",
2280
+ "module": "src/common/mixins/InputMixin.ts"
2281
+ }
2394
2282
  },
2395
2283
  {
2396
- "kind": "field",
2397
- "name": "navigationShortcuts",
2284
+ "name": "value",
2398
2285
  "type": {
2399
- "text": "ShortcutController"
2286
+ "text": "string"
2400
2287
  },
2401
- "privacy": "private",
2402
- "default": "new ShortcutController(\n host,\n {\n Enter: preventDefault(actions.trigger),\n Backspace: actions.goBack, // we don't want to prevent default, since that would stop backspace deleting chars\n End: preventDefault(actions.end),\n Home: preventDefault(actions.start),\n ArrowDown: preventDefault(actions.next),\n ArrowUp: preventDefault(actions.previous),\n },\n host\n )"
2288
+ "default": "\"\"",
2289
+ "description": "The value of the form component.",
2290
+ "fieldName": "value",
2291
+ "inheritedFrom": {
2292
+ "name": "InputMixin",
2293
+ "module": "src/common/mixins/InputMixin.ts"
2294
+ }
2295
+ }
2296
+ ],
2297
+ "mixins": [
2298
+ {
2299
+ "name": "FormAssociatedMixin",
2300
+ "module": "/src/common/mixins/FormAssociatedMixin.js"
2403
2301
  },
2404
2302
  {
2405
- "kind": "field",
2406
- "name": "commandShortcuts",
2303
+ "name": "InputMixin",
2304
+ "module": "/src/common/mixins/InputMixin.js"
2305
+ },
2306
+ {
2307
+ "name": "FocusableMixin",
2308
+ "module": "/src/common/mixins/FocusableMixin.js"
2309
+ },
2310
+ {
2311
+ "name": "DraftComponentMixin",
2312
+ "module": "/src/common/mixins/DraftComponentMixin.js"
2313
+ }
2314
+ ],
2315
+ "superclass": {
2316
+ "name": "LitElement",
2317
+ "package": "lit"
2318
+ },
2319
+ "status": "draft",
2320
+ "category": "form",
2321
+ "tagName": "nord-checkbox",
2322
+ "customElement": true,
2323
+ "events": [
2324
+ {
2325
+ "name": "input",
2407
2326
  "type": {
2408
- "text": "ShortcutController"
2327
+ "text": "NordEvent"
2409
2328
  },
2410
- "privacy": "private",
2411
- "default": "new ShortcutController(host)"
2329
+ "description": "Fired as the user types into the input.",
2330
+ "inheritedFrom": {
2331
+ "name": "FormAssociatedMixin",
2332
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2333
+ }
2412
2334
  },
2413
2335
  {
2414
- "kind": "method",
2415
- "name": "registerCommandShortcuts"
2336
+ "name": "change",
2337
+ "type": {
2338
+ "text": "NordEvent"
2339
+ },
2340
+ "description": "Fired whenever the input's value is changed via user interaction.",
2341
+ "inheritedFrom": {
2342
+ "name": "FormAssociatedMixin",
2343
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2344
+ }
2416
2345
  }
2417
2346
  ]
2418
2347
  }
@@ -2420,59 +2349,130 @@
2420
2349
  "exports": [
2421
2350
  {
2422
2351
  "kind": "js",
2423
- "name": "KeyboardController",
2352
+ "name": "default",
2353
+ "declaration": {
2354
+ "name": "Checkbox",
2355
+ "module": "src/checkbox/Checkbox.ts"
2356
+ }
2357
+ },
2358
+ {
2359
+ "kind": "custom-element-definition",
2360
+ "name": "nord-checkbox",
2424
2361
  "declaration": {
2425
- "name": "KeyboardController",
2426
- "module": "src/command-menu/KeyboardController.ts"
2362
+ "name": "Checkbox",
2363
+ "module": "src/checkbox/Checkbox.ts"
2427
2364
  }
2428
2365
  }
2429
2366
  ],
2430
- "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 provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, 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\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A&nbsp;command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
2367
+ "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 for making it possible to choose one or more options from a limited number of options.\n- Use for “accepting terms of service” and similar functionality.\n- Use in forms to toggle something on or off.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use when you have more than 10 options to choose from.\n- Don’t change the selection of another checkbox when another one is clicked. Only exception is when a checkbox is used to make a bulk selection of multiple items.\n\n</div>\n\n---\n\n## Content guidelines\n\nCheckbox labels should be clear, accurate and predictable. It should be possible for the user to understand what they are selecting:\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">Option 1</div>\n\nWhen writing checkbox 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\">User settings</div>\n<div class=\"n-usage n-usage-dont\">User Settings</div>\n\nAvoid ending in punctuation if it’s a single sentence, word, or a fragment:\n\n<div class=\"n-usage n-usage-do\">Show dashboard</div>\n<div class=\"n-usage n-usage-dont\">Show dashboard.</div>\n\nDo not use commas or semicolons at the end of each line\n\n<div class=\"n-usage n-usage-do\">Patients</div>\n<div class=\"n-usage n-usage-dont\">Patients;</div>\n"
2431
2368
  },
2432
2369
  {
2433
2370
  "kind": "javascript-module",
2434
- "path": "src/command-menu/SelectEvent.ts",
2371
+ "path": "src/card/Card.ts",
2435
2372
  "declarations": [
2436
2373
  {
2437
2374
  "kind": "class",
2438
- "description": "",
2439
- "name": "SelectEvent",
2375
+ "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.",
2376
+ "name": "Card",
2377
+ "slots": [
2378
+ {
2379
+ "description": "The card content.",
2380
+ "name": ""
2381
+ },
2382
+ {
2383
+ "description": "Optional slot that holds a header for the card.",
2384
+ "name": "header"
2385
+ },
2386
+ {
2387
+ "description": "Optional slot that holds footer content for the card.",
2388
+ "name": "footer"
2389
+ }
2390
+ ],
2440
2391
  "members": [
2441
2392
  {
2442
2393
  "kind": "field",
2443
- "name": "eventName",
2394
+ "name": "headerSlot",
2395
+ "privacy": "private",
2396
+ "default": "new SlotController(this, \"header\")"
2397
+ },
2398
+ {
2399
+ "kind": "field",
2400
+ "name": "footerSlot",
2401
+ "privacy": "private",
2402
+ "default": "new SlotController(this, \"footer\")"
2403
+ },
2404
+ {
2405
+ "kind": "field",
2406
+ "name": "padding",
2444
2407
  "type": {
2445
- "text": "string"
2408
+ "text": "\"m\" | \"l\" | \"none\""
2446
2409
  },
2447
- "static": true,
2448
- "default": "\"nord-select\""
2410
+ "default": "\"m\"",
2411
+ "description": "Controls the padding of card component. When set to “none”,\nthe header and footer slots will still have padding.",
2412
+ "attribute": "padding",
2413
+ "reflects": true
2449
2414
  },
2450
2415
  {
2451
2416
  "kind": "field",
2452
- "name": "command",
2417
+ "name": "_warningLogged",
2453
2418
  "type": {
2454
- "text": "ICommandMenuAction"
2419
+ "text": "boolean"
2455
2420
  },
2456
- "default": "command"
2421
+ "privacy": "private",
2422
+ "static": true,
2423
+ "default": "false",
2424
+ "inheritedFrom": {
2425
+ "name": "DraftComponentMixin",
2426
+ "module": "src/common/mixins/DraftComponentMixin.ts"
2427
+ }
2428
+ }
2429
+ ],
2430
+ "attributes": [
2431
+ {
2432
+ "name": "padding",
2433
+ "type": {
2434
+ "text": "\"m\" | \"l\" | \"none\""
2435
+ },
2436
+ "default": "\"m\"",
2437
+ "description": "Controls the padding of card component. When set to “none”,\nthe header and footer slots will still have padding.",
2438
+ "fieldName": "padding"
2439
+ }
2440
+ ],
2441
+ "mixins": [
2442
+ {
2443
+ "name": "DraftComponentMixin",
2444
+ "module": "/src/common/mixins/DraftComponentMixin.js"
2457
2445
  }
2458
2446
  ],
2459
2447
  "superclass": {
2460
- "name": "NordEvent",
2461
- "module": "/src/common/events.js"
2462
- }
2448
+ "name": "LitElement",
2449
+ "package": "lit"
2450
+ },
2451
+ "status": "draft",
2452
+ "category": "structure",
2453
+ "tagName": "nord-card",
2454
+ "customElement": true
2463
2455
  }
2464
2456
  ],
2465
2457
  "exports": [
2466
2458
  {
2467
2459
  "kind": "js",
2468
- "name": "SelectEvent",
2460
+ "name": "default",
2469
2461
  "declaration": {
2470
- "name": "SelectEvent",
2471
- "module": "src/command-menu/SelectEvent.ts"
2462
+ "name": "Card",
2463
+ "module": "src/card/Card.ts"
2464
+ }
2465
+ },
2466
+ {
2467
+ "kind": "custom-element-definition",
2468
+ "name": "nord-card",
2469
+ "declaration": {
2470
+ "name": "Card",
2471
+ "module": "src/card/Card.ts"
2472
2472
  }
2473
2473
  }
2474
2474
  ],
2475
- "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 provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, 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\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A&nbsp;command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
2475
+ "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\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\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"
2476
2476
  },
2477
2477
  {
2478
2478
  "kind": "javascript-module",
@@ -4493,82 +4493,6 @@
4493
4493
  ],
4494
4494
  "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 the fieldset component when you need to create a relationship between multiple form inputs.\n- It is especially important to use with a group of radio components.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t place interactive content (buttons, links etc) inside the label.\n- Don’t use with a checkbox component when there is **only one** checkbox. For example, when accepting terms and conditions.\n\n</div>\n\n-------\n\n## Content guidelines\n\nFieldset label should be clear, accurate and predictable. It should help the user to understand how the items in the fieldset are grouped together, or what kind of choice the user is making:\n\n<div class=\"n-usage n-usage-do\">Pick a color</div>\n<div class=\"n-usage n-usage-dont\">Choose</div>\n\nWhen writing fieldset 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\">Pick a color</div>\n<div class=\"n-usage n-usage-dont\">Pick A Color</div>\n\nAvoid ending in punctuation if it’s a single sentence, word, or a fragment:\n\n<div class=\"n-usage n-usage-do\">Pick a color</div>\n<div class=\"n-usage n-usage-dont\">Pick a color.</div>\n\nDo not use colons in fieldset label:\n\n<div class=\"n-usage n-usage-do\">Payment details</div>\n<div class=\"n-usage n-usage-dont\">Payment details:</div>\n\n-------\n\n## Additional considerations\n\n- A label (which becomes to `<legend>` inside the fieldset) is always required.\n- Hint text can be used to offer further information or explanation for an option.\n"
4495
4495
  },
4496
- {
4497
- "kind": "javascript-module",
4498
- "path": "src/header/Header.ts",
4499
- "declarations": [
4500
- {
4501
- "kind": "class",
4502
- "description": "The header is a block of designated space for labelling the currently\nviewed context as well as providing primary actions.",
4503
- "name": "Header",
4504
- "slots": [
4505
- {
4506
- "description": "The header content.",
4507
- "name": ""
4508
- },
4509
- {
4510
- "description": "Optional slot for buttons, toggles, etc.",
4511
- "name": "action"
4512
- }
4513
- ],
4514
- "members": [
4515
- {
4516
- "kind": "field",
4517
- "name": "actionSlot",
4518
- "privacy": "private",
4519
- "default": "new SlotController(this, \"action\")"
4520
- },
4521
- {
4522
- "kind": "field",
4523
- "name": "_warningLogged",
4524
- "type": {
4525
- "text": "boolean"
4526
- },
4527
- "privacy": "private",
4528
- "static": true,
4529
- "default": "false",
4530
- "inheritedFrom": {
4531
- "name": "DraftComponentMixin",
4532
- "module": "src/common/mixins/DraftComponentMixin.ts"
4533
- }
4534
- }
4535
- ],
4536
- "mixins": [
4537
- {
4538
- "name": "DraftComponentMixin",
4539
- "module": "/src/common/mixins/DraftComponentMixin.js"
4540
- }
4541
- ],
4542
- "superclass": {
4543
- "name": "LitElement",
4544
- "package": "lit"
4545
- },
4546
- "status": "draft",
4547
- "category": "structure",
4548
- "tagName": "nord-header",
4549
- "customElement": true
4550
- }
4551
- ],
4552
- "exports": [
4553
- {
4554
- "kind": "js",
4555
- "name": "default",
4556
- "declaration": {
4557
- "name": "Header",
4558
- "module": "src/header/Header.ts"
4559
- }
4560
- },
4561
- {
4562
- "kind": "custom-element-definition",
4563
- "name": "nord-header",
4564
- "declaration": {
4565
- "name": "Header",
4566
- "module": "src/header/Header.ts"
4567
- }
4568
- }
4569
- ],
4570
- "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 the header component to show a heading to describe the current view.\n- Use the header component to hold primary actions.\n- Use the header component at a visual high position at full width.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t overcrowd the header component with too many actions or information.\n- Don’t nest the header component too deeply and restrict its available space.\n\n</div>\n\n-------\n\n## Content guidelines\n\nThe header component should be a containing element placed high on the page to present high level controls and to describe the page itself. It shouldn’t be overcrowded with controls or information.\n\n<div class=\"n-usage n-usage-do\">[Menu] Dashboard [Account] [Log out]</div>\n<div class=\"n-usage n-usage-dont\">[Menu] Use the cards below to view various information [Export] [Save] [Edit Profile] [Log out] [Preferences]</div>\n"
4571
- },
4572
4496
  {
4573
4497
  "kind": "javascript-module",
4574
4498
  "path": "src/icon/Icon.ts",
@@ -4824,6 +4748,82 @@
4824
4748
  ],
4825
4749
  "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 provide additional meaning in addition to a text label.\n- Use to help users who have difficulties with reading and attention.\n- Use in places where text label doesn’t fit (remember to add an accessible label for the icon).\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for decorative purposes alone.\n- Don’t use when a button’s action is already clear based on the text label.\n- Don’t use the same icon for differing purposes, as users will come to associate icons with specific types of actions.\n\n</div>\n\n---\n\n## Additional considerations\n\n- Icon components are hidden from assistive technologies by default.\n- Use `label` property to give an accessible label for the icon and to make it visible to assistive technologies.\n"
4826
4750
  },
4751
+ {
4752
+ "kind": "javascript-module",
4753
+ "path": "src/header/Header.ts",
4754
+ "declarations": [
4755
+ {
4756
+ "kind": "class",
4757
+ "description": "The header is a block of designated space for labelling the currently\nviewed context as well as providing primary actions.",
4758
+ "name": "Header",
4759
+ "slots": [
4760
+ {
4761
+ "description": "The header content.",
4762
+ "name": ""
4763
+ },
4764
+ {
4765
+ "description": "Optional slot for buttons, toggles, etc.",
4766
+ "name": "action"
4767
+ }
4768
+ ],
4769
+ "members": [
4770
+ {
4771
+ "kind": "field",
4772
+ "name": "actionSlot",
4773
+ "privacy": "private",
4774
+ "default": "new SlotController(this, \"action\")"
4775
+ },
4776
+ {
4777
+ "kind": "field",
4778
+ "name": "_warningLogged",
4779
+ "type": {
4780
+ "text": "boolean"
4781
+ },
4782
+ "privacy": "private",
4783
+ "static": true,
4784
+ "default": "false",
4785
+ "inheritedFrom": {
4786
+ "name": "DraftComponentMixin",
4787
+ "module": "src/common/mixins/DraftComponentMixin.ts"
4788
+ }
4789
+ }
4790
+ ],
4791
+ "mixins": [
4792
+ {
4793
+ "name": "DraftComponentMixin",
4794
+ "module": "/src/common/mixins/DraftComponentMixin.js"
4795
+ }
4796
+ ],
4797
+ "superclass": {
4798
+ "name": "LitElement",
4799
+ "package": "lit"
4800
+ },
4801
+ "status": "draft",
4802
+ "category": "structure",
4803
+ "tagName": "nord-header",
4804
+ "customElement": true
4805
+ }
4806
+ ],
4807
+ "exports": [
4808
+ {
4809
+ "kind": "js",
4810
+ "name": "default",
4811
+ "declaration": {
4812
+ "name": "Header",
4813
+ "module": "src/header/Header.ts"
4814
+ }
4815
+ },
4816
+ {
4817
+ "kind": "custom-element-definition",
4818
+ "name": "nord-header",
4819
+ "declaration": {
4820
+ "name": "Header",
4821
+ "module": "src/header/Header.ts"
4822
+ }
4823
+ }
4824
+ ],
4825
+ "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 the header component to show a heading to describe the current view.\n- Use the header component to hold primary actions.\n- Use the header component at a visual high position at full width.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t overcrowd the header component with too many actions or information.\n- Don’t nest the header component too deeply and restrict its available space.\n\n</div>\n\n-------\n\n## Content guidelines\n\nThe header component should be a containing element placed high on the page to present high level controls and to describe the page itself. It shouldn’t be overcrowded with controls or information.\n\n<div class=\"n-usage n-usage-do\">[Menu] Dashboard [Account] [Log out]</div>\n<div class=\"n-usage n-usage-dont\">[Menu] Use the cards below to view various information [Export] [Save] [Edit Profile] [Log out] [Preferences]</div>\n"
4826
+ },
4827
4827
  {
4828
4828
  "kind": "javascript-module",
4829
4829
  "path": "src/input/Input.ts",