@nordhealth/components 1.11.1 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/custom-elements.json +1182 -1132
  2. package/lib/Avatar.js +1 -1
  3. package/lib/Badge.js +1 -1
  4. package/lib/Banner.js +1 -1
  5. package/lib/Button.js +1 -1
  6. package/lib/{Calendar-8b474799.js → Calendar-3efcf67b.js} +2 -2
  7. package/lib/{Calendar-8b474799.js.map → Calendar-3efcf67b.js.map} +1 -1
  8. package/lib/Calendar.js +1 -1
  9. package/lib/Card.js +1 -1
  10. package/lib/Card.js.map +1 -1
  11. package/lib/Checkbox.js +1 -1
  12. package/lib/CommandMenu.js +1 -1
  13. package/lib/CommandMenuAction.js +1 -1
  14. package/lib/{Component-a61df53a.js → Component-5a0a26a0.js} +2 -2
  15. package/lib/Component-5a0a26a0.js.map +1 -0
  16. package/lib/DatePicker.js +1 -1
  17. package/lib/Divider.js +1 -1
  18. package/lib/Dropdown.js +1 -1
  19. package/lib/DropdownGroup.js +1 -1
  20. package/lib/DropdownItem.js +1 -1
  21. package/lib/EmptyState.js +1 -1
  22. package/lib/Fieldset.js +1 -1
  23. package/lib/Header.js +1 -1
  24. package/lib/Icon.js +1 -1
  25. package/lib/Input.js +1 -1
  26. package/lib/Layout.js +1 -1
  27. package/lib/Modal.js +1 -1
  28. package/lib/NavGroup.js +1 -1
  29. package/lib/Popout.js +1 -1
  30. package/lib/ProgressBar.js +1 -1
  31. package/lib/Qrcode.js +2 -2
  32. package/lib/Radio.js +1 -1
  33. package/lib/Select.js +1 -1
  34. package/lib/Skeleton.js +1 -1
  35. package/lib/Spinner.js +1 -1
  36. package/lib/Stack.js +1 -1
  37. package/lib/Tab.js +1 -1
  38. package/lib/TabGroup.js +1 -1
  39. package/lib/TabPanel.js +1 -1
  40. package/lib/Table.js +1 -1
  41. package/lib/Table.js.map +1 -1
  42. package/lib/Textarea.js +1 -1
  43. package/lib/Toast.js +1 -1
  44. package/lib/ToastGroup.js +1 -1
  45. package/lib/Toggle.js +1 -1
  46. package/lib/Tooltip.js +1 -1
  47. package/lib/bundle.js +9 -9
  48. package/lib/bundle.js.map +1 -1
  49. package/lib/index.js +1 -1
  50. package/lib/src/card/Card.d.ts +2 -0
  51. package/lib/src/table/Table.d.ts +9 -2
  52. package/lib/src/table/Table.test.d.ts +1 -0
  53. package/package.json +4 -4
  54. package/lib/Component-a61df53a.js.map +0 -1
@@ -503,6 +503,144 @@
503
503
  ],
504
504
  "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- Always add the name of the person using the `name` property.\n- For the best results, use square images or images cropped into a square.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Try to avoid using landscape or portrait images as avatars. Let users crop their images before or after uploading if possible.\n\n</div>\n"
505
505
  },
506
+ {
507
+ "kind": "javascript-module",
508
+ "path": "src/badge/Badge.ts",
509
+ "declarations": [
510
+ {
511
+ "kind": "class",
512
+ "description": "Badges are used to inform users of the status of an object or of an action that’s been taken. Commonly used in tabular data to indicate status.",
513
+ "name": "Badge",
514
+ "slots": [
515
+ {
516
+ "description": "The badge content.",
517
+ "name": ""
518
+ }
519
+ ],
520
+ "members": [
521
+ {
522
+ "kind": "field",
523
+ "name": "type",
524
+ "type": {
525
+ "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | undefined"
526
+ },
527
+ "default": "\"info\"",
528
+ "description": "The type of badge.\nDetermines the color of the chip shown on the badge.",
529
+ "attribute": "type",
530
+ "reflects": true
531
+ }
532
+ ],
533
+ "attributes": [
534
+ {
535
+ "name": "type",
536
+ "type": {
537
+ "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | undefined"
538
+ },
539
+ "default": "\"info\"",
540
+ "description": "The type of badge.\nDetermines the color of the chip shown on the badge.",
541
+ "fieldName": "type"
542
+ }
543
+ ],
544
+ "superclass": {
545
+ "name": "LitElement",
546
+ "package": "lit"
547
+ },
548
+ "status": "ready",
549
+ "category": "text",
550
+ "displayName": null,
551
+ "tagName": "nord-badge",
552
+ "customElement": true
553
+ }
554
+ ],
555
+ "exports": [
556
+ {
557
+ "kind": "js",
558
+ "name": "default",
559
+ "declaration": {
560
+ "name": "Badge",
561
+ "module": "src/badge/Badge.ts"
562
+ }
563
+ },
564
+ {
565
+ "kind": "custom-element-definition",
566
+ "name": "nord-badge",
567
+ "declaration": {
568
+ "name": "Badge",
569
+ "module": "src/badge/Badge.ts"
570
+ }
571
+ }
572
+ ],
573
+ "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 show a status update on a piece of information or action.\n- Use to mark something as a “draft” or “new”.\n- Use when you want to highlight something that has been added recently.\n- Use established color patterns so that users can clearly identify the importance level.\n- Always position badge so that it’s clear to understand what object it’s related to.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make badges clickable. Instead use button component’s small variant.\n- Don’t use alternatives to existing badge variants.\n\n</div>\n\n---\n\n## Content guidelines\n\nBadge labels should use a single word to describe the status of an object. Only use two words if you need to describe a complex state:\n\n<div class=\"n-usage n-usage-do\">Complete</div>\n<div class=\"n-usage n-usage-dont\">Action completed</div>\n\nWhen writing badge labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">Partially refunded</div>\n<div class=\"n-usage n-usage-dont\">Partially Refunded</div>\n\nAvoid unnecessary words and articles in badge labels, such as “is”, “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Pending</div>\n<div class=\"n-usage n-usage-dont\">Item is pending</div>\n\nAlways describe the status in the past tense:\n\n<div class=\"n-usage n-usage-do\">Refunded</div>\n<div class=\"n-usage n-usage-dont\">Refund</div>\n\n---\n\n## Variants\n\nThis section describes the different component variants, their purpose, and when to use each variant.\n\n| Name | Purpose |\n| ----------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| `info` | The default variant. Used to convey general information that isn’t critical. |\n| `success` | Used to convey success states. For example, you might want to show a badge that tells the user a payment was successful. |\n| `highlight` | Used to highlight specific items in the interface, like notifications. |\n| `danger` | Used to communicate problems that have to be resolved so that user can continue forward. Should always be used for highlighting errors. |\n| `warning` | Used to display information that needs a user’s attention attention and may require further steps. |\n"
574
+ },
575
+ {
576
+ "kind": "javascript-module",
577
+ "path": "src/banner/Banner.ts",
578
+ "declarations": [
579
+ {
580
+ "kind": "class",
581
+ "description": "Banner informs users about important changes or conditions in the\ninterface. Use this component if you need to communicate to users\nin a prominent way.",
582
+ "name": "Banner",
583
+ "slots": [
584
+ {
585
+ "description": "default slot",
586
+ "name": ""
587
+ }
588
+ ],
589
+ "members": [
590
+ {
591
+ "kind": "field",
592
+ "name": "variant",
593
+ "type": {
594
+ "text": "\"info\" | \"danger\" | \"success\" | \"warning\""
595
+ },
596
+ "default": "\"info\"",
597
+ "description": "The style variant of the banner.",
598
+ "attribute": "variant",
599
+ "reflects": true
600
+ }
601
+ ],
602
+ "attributes": [
603
+ {
604
+ "name": "variant",
605
+ "type": {
606
+ "text": "\"info\" | \"danger\" | \"success\" | \"warning\""
607
+ },
608
+ "default": "\"info\"",
609
+ "description": "The style variant of the banner.",
610
+ "fieldName": "variant"
611
+ }
612
+ ],
613
+ "superclass": {
614
+ "name": "LitElement",
615
+ "package": "lit"
616
+ },
617
+ "status": "ready",
618
+ "category": "feedback",
619
+ "displayName": null,
620
+ "tagName": "nord-banner",
621
+ "customElement": true
622
+ }
623
+ ],
624
+ "exports": [
625
+ {
626
+ "kind": "js",
627
+ "name": "default",
628
+ "declaration": {
629
+ "name": "Banner",
630
+ "module": "src/banner/Banner.ts"
631
+ }
632
+ },
633
+ {
634
+ "kind": "custom-element-definition",
635
+ "name": "nord-banner",
636
+ "declaration": {
637
+ "name": "Banner",
638
+ "module": "src/banner/Banner.ts"
639
+ }
640
+ }
641
+ ],
642
+ "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 this component if you need to communicate in a prominent way.\n- Place banner at the top of the section it applies to.\n- Use for highlighting errors and success statuses.\n- Put banner close to the context it’s referring to.\n- Move focus to the banner if it’s relevant to the current workflow.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Move focus to banner if it appears on page load.\n- Use for highlighting general content or as a banner.\n- Use to replace an error page.\n\n</div>\n\n---\n\n## Content guidelines\n\nBanner content should be clear, accurate and easy to understand:\n\n<div class=\"n-usage n-usage-do\">We’re experiencing an incident. Please see our status page for more details.</div>\n<div class=\"n-usage n-usage-dont\">There was an error.</div>\n\nWhen writing banner content, always write it 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\">We’re experiencing an incident.</div>\n<div class=\"n-usage n-usage-dont\">We’re Experiencing An Incident.</div>\n\nAlways end in punctuation:\n\n<div class=\"n-usage n-usage-do\">We’re experiencing an incident.</div>\n<div class=\"n-usage n-usage-dont\">We’re experiencing an incident</div>\n"
643
+ },
506
644
  {
507
645
  "kind": "javascript-module",
508
646
  "path": "src/calendar/Calendar.ts",
@@ -1024,40 +1162,70 @@
1024
1162
  },
1025
1163
  {
1026
1164
  "kind": "javascript-module",
1027
- "path": "src/banner/Banner.ts",
1165
+ "path": "src/card/Card.ts",
1028
1166
  "declarations": [
1029
1167
  {
1030
1168
  "kind": "class",
1031
- "description": "Banner informs users about important changes or conditions in the\ninterface. Use this component if you need to communicate to users\nin a prominent way.",
1032
- "name": "Banner",
1169
+ "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.",
1170
+ "name": "Card",
1033
1171
  "slots": [
1034
1172
  {
1035
- "description": "default slot",
1173
+ "description": "The card content.",
1036
1174
  "name": ""
1175
+ },
1176
+ {
1177
+ "description": "Optional slot that holds a header for the card.",
1178
+ "name": "header"
1179
+ },
1180
+ {
1181
+ "description": "Optional slot that positions content at the end of the header. Useful for actions or additional info.",
1182
+ "name": "header-end"
1183
+ },
1184
+ {
1185
+ "description": "Optional slot that holds footer content for the card.",
1186
+ "name": "footer"
1037
1187
  }
1038
1188
  ],
1039
1189
  "members": [
1040
1190
  {
1041
1191
  "kind": "field",
1042
- "name": "variant",
1192
+ "name": "headerSlot",
1193
+ "privacy": "private",
1194
+ "default": "new SlotController(this, \"header\")"
1195
+ },
1196
+ {
1197
+ "kind": "field",
1198
+ "name": "headerEndSlot",
1199
+ "privacy": "private",
1200
+ "default": "new SlotController(this, \"header-end\")"
1201
+ },
1202
+ {
1203
+ "kind": "field",
1204
+ "name": "footerSlot",
1205
+ "privacy": "private",
1206
+ "default": "new SlotController(this, \"footer\")"
1207
+ },
1208
+ {
1209
+ "kind": "field",
1210
+ "name": "padding",
1043
1211
  "type": {
1044
- "text": "\"info\" | \"danger\" | \"success\" | \"warning\""
1212
+ "text": "\"m\" | \"l\" | \"none\""
1045
1213
  },
1046
- "default": "\"info\"",
1047
- "description": "The style variant of the banner.",
1048
- "attribute": "variant",
1214
+ "default": "\"m\"",
1215
+ "description": "Controls the padding of the card component. When set to “none”,\nthe header and footer slots will still have padding.",
1216
+ "attribute": "padding",
1049
1217
  "reflects": true
1050
1218
  }
1051
1219
  ],
1052
1220
  "attributes": [
1053
1221
  {
1054
- "name": "variant",
1222
+ "name": "padding",
1055
1223
  "type": {
1056
- "text": "\"info\" | \"danger\" | \"success\" | \"warning\""
1224
+ "text": "\"m\" | \"l\" | \"none\""
1057
1225
  },
1058
- "default": "\"info\"",
1059
- "description": "The style variant of the banner.",
1060
- "fieldName": "variant"
1226
+ "default": "\"m\"",
1227
+ "description": "Controls the padding of the card component. When set to “none”,\nthe header and footer slots will still have padding.",
1228
+ "fieldName": "padding"
1061
1229
  }
1062
1230
  ],
1063
1231
  "superclass": {
@@ -1065,9 +1233,9 @@
1065
1233
  "package": "lit"
1066
1234
  },
1067
1235
  "status": "ready",
1068
- "category": "feedback",
1236
+ "category": "structure",
1069
1237
  "displayName": null,
1070
- "tagName": "nord-banner",
1238
+ "tagName": "nord-card",
1071
1239
  "customElement": true
1072
1240
  }
1073
1241
  ],
@@ -1076,501 +1244,358 @@
1076
1244
  "kind": "js",
1077
1245
  "name": "default",
1078
1246
  "declaration": {
1079
- "name": "Banner",
1080
- "module": "src/banner/Banner.ts"
1247
+ "name": "Card",
1248
+ "module": "src/card/Card.ts"
1081
1249
  }
1082
1250
  },
1083
1251
  {
1084
1252
  "kind": "custom-element-definition",
1085
- "name": "nord-banner",
1253
+ "name": "nord-card",
1086
1254
  "declaration": {
1087
- "name": "Banner",
1088
- "module": "src/banner/Banner.ts"
1255
+ "name": "Card",
1256
+ "module": "src/card/Card.ts"
1089
1257
  }
1090
1258
  }
1091
1259
  ],
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 this component if you need to communicate in a prominent way.\n- Place banner at the top of the section it applies to.\n- Use for highlighting errors and success statuses.\n- Put banner close to the context it’s referring to.\n- Move focus to the banner if it’s relevant to the current workflow.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Move focus to banner if it appears on page load.\n- Use for highlighting general content or as a banner.\n- Use to replace an error page.\n\n</div>\n\n---\n\n## Content guidelines\n\nBanner content should be clear, accurate and easy to understand:\n\n<div class=\"n-usage n-usage-do\">Were experiencing an incident. Please see our status page for more details.</div>\n<div class=\"n-usage n-usage-dont\">There was an error.</div>\n\nWhen writing banner content, always write it 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\">We’re experiencing an incident.</div>\n<div class=\"n-usage n-usage-dont\">We’re Experiencing An Incident.</div>\n\nAlways end in punctuation:\n\n<div class=\"n-usage n-usage-do\">We’re experiencing an incident.</div>\n<div class=\"n-usage n-usage-dont\">We’re experiencing an incident</div>\n"
1260
+ "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- Dont 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"
1093
1261
  },
1094
1262
  {
1095
1263
  "kind": "javascript-module",
1096
- "path": "src/badge/Badge.ts",
1264
+ "path": "src/command-menu/CommandMenu.ts",
1097
1265
  "declarations": [
1098
1266
  {
1099
1267
  "kind": "class",
1100
- "description": "Badges are used to inform users of the status of an object or of an action that’s been taken. Commonly used in tabular data to indicate status.",
1101
- "name": "Badge",
1268
+ "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.",
1269
+ "name": "CommandMenu",
1102
1270
  "slots": [
1103
1271
  {
1104
- "description": "The badge content.",
1105
- "name": ""
1272
+ "description": "Used to replace the default footer contents.",
1273
+ "name": "footer"
1106
1274
  }
1107
1275
  ],
1108
1276
  "members": [
1109
1277
  {
1110
1278
  "kind": "field",
1111
- "name": "type",
1112
- "type": {
1113
- "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | undefined"
1114
- },
1115
- "default": "\"info\"",
1116
- "description": "The type of badge.\nDetermines the color of the chip shown on the badge.",
1117
- "attribute": "type",
1118
- "reflects": true
1119
- }
1120
- ],
1121
- "attributes": [
1279
+ "name": "inputRef",
1280
+ "privacy": "private"
1281
+ },
1122
1282
  {
1123
- "name": "type",
1283
+ "kind": "field",
1284
+ "name": "listRef",
1285
+ "privacy": "private"
1286
+ },
1287
+ {
1288
+ "kind": "field",
1289
+ "name": "previousFocus",
1124
1290
  "type": {
1125
- "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | undefined"
1291
+ "text": "HTMLElement | undefined"
1126
1292
  },
1127
- "default": "\"info\"",
1128
- "description": "The type of badge.\nDetermines the color of the chip shown on the badge.",
1129
- "fieldName": "type"
1130
- }
1131
- ],
1132
- "superclass": {
1133
- "name": "LitElement",
1134
- "package": "lit"
1135
- },
1136
- "status": "ready",
1137
- "category": "text",
1138
- "displayName": null,
1139
- "tagName": "nord-badge",
1140
- "customElement": true
1141
- }
1142
- ],
1143
- "exports": [
1144
- {
1145
- "kind": "js",
1146
- "name": "default",
1147
- "declaration": {
1148
- "name": "Badge",
1149
- "module": "src/badge/Badge.ts"
1150
- }
1151
- },
1152
- {
1153
- "kind": "custom-element-definition",
1154
- "name": "nord-badge",
1155
- "declaration": {
1156
- "name": "Badge",
1157
- "module": "src/badge/Badge.ts"
1158
- }
1159
- }
1160
- ],
1161
- "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 show a status update on a piece of information or action.\n- Use to mark something as a “draft” or “new”.\n- Use when you want to highlight something that has been added recently.\n- Use established color patterns so that users can clearly identify the importance level.\n- Always position badge so that it’s clear to understand what object it’s related to.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make badges clickable. Instead use button component’s small variant.\n- Don’t use alternatives to existing badge variants.\n\n</div>\n\n---\n\n## Content guidelines\n\nBadge labels should use a single word to describe the status of an object. Only use two words if you need to describe a complex state:\n\n<div class=\"n-usage n-usage-do\">Complete</div>\n<div class=\"n-usage n-usage-dont\">Action completed</div>\n\nWhen writing badge labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">Partially refunded</div>\n<div class=\"n-usage n-usage-dont\">Partially Refunded</div>\n\nAvoid unnecessary words and articles in badge labels, such as “is”, “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Pending</div>\n<div class=\"n-usage n-usage-dont\">Item is pending</div>\n\nAlways describe the status in the past tense:\n\n<div class=\"n-usage n-usage-do\">Refunded</div>\n<div class=\"n-usage n-usage-dont\">Refund</div>\n\n---\n\n## Variants\n\nThis section describes the different component variants, their purpose, and when to use each variant.\n\n| Name | Purpose |\n| ----------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| `info` | The default variant. Used to convey general information that isn’t critical. |\n| `success` | Used to convey success states. For example, you might want to show a badge that tells the user a payment was successful. |\n| `highlight` | Used to highlight specific items in the interface, like notifications. |\n| `danger` | Used to communicate problems that have to be resolved so that user can continue forward. Should always be used for highlighting errors. |\n| `warning` | Used to display information that needs a user’s attention attention and may require further steps. |\n"
1162
- },
1163
- {
1164
- "kind": "javascript-module",
1165
- "path": "src/button/Button.ts",
1166
- "declarations": [
1167
- {
1168
- "kind": "class",
1169
- "description": "Buttons are used for interface actions. Primary style should be\nused only once per section for main call-to-action, while other\nstyles can appear more frequently.",
1170
- "name": "Button",
1171
- "slots": [
1172
- {
1173
- "description": "The button content",
1174
- "name": ""
1175
- },
1176
- {
1177
- "description": "Used to place content at the start of button text. Typically used for icons.",
1178
- "name": "start"
1293
+ "privacy": "private"
1179
1294
  },
1180
- {
1181
- "description": "Used to place content at the end of button text. Typically used for icons.",
1182
- "name": "end"
1183
- }
1184
- ],
1185
- "members": [
1186
1295
  {
1187
1296
  "kind": "field",
1188
- "name": "buttonRef",
1189
- "privacy": "private"
1297
+ "name": "localize",
1298
+ "privacy": "private",
1299
+ "default": "new LocalizeController<\"nord-command-menu\">(this)"
1190
1300
  },
1191
1301
  {
1192
1302
  "kind": "field",
1193
- "name": "events",
1303
+ "name": "dismissController",
1194
1304
  "privacy": "private",
1195
- "default": "new EventController(this)"
1305
+ "default": "new LightDismissController(this, {\n isOpen: () => this.open,\n onDismiss: () => this.close(),\n })"
1196
1306
  },
1197
1307
  {
1198
1308
  "kind": "field",
1199
- "name": "lightDom",
1309
+ "name": "keyboardController",
1200
1310
  "privacy": "private",
1201
- "default": "new LightDomController(this, {\n render: () => this.renderLightDom(),\n })"
1311
+ "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 })"
1202
1312
  },
1203
1313
  {
1204
1314
  "kind": "field",
1205
- "name": "variant",
1315
+ "name": "open",
1206
1316
  "type": {
1207
- "text": "\"default\" | \"primary\" | \"dashed\" | \"plain\" | \"danger\" | \"switch\""
1317
+ "text": "boolean"
1208
1318
  },
1209
- "default": "\"default\"",
1210
- "description": "The style variant of the button.",
1211
- "attribute": "variant",
1212
- "reflects": true
1319
+ "default": "false",
1320
+ "description": "Show or hide the command menu.",
1321
+ "attribute": "open"
1213
1322
  },
1214
1323
  {
1215
1324
  "kind": "field",
1216
- "name": "type",
1325
+ "name": "placeholder",
1217
1326
  "type": {
1218
- "text": "\"button\" | \"submit\" | \"reset\""
1327
+ "text": "string"
1219
1328
  },
1220
- "default": "\"submit\"",
1221
- "description": "The type of the button.",
1222
- "attribute": "type",
1223
- "reflects": true
1329
+ "default": "\"Type a command or search...\"",
1330
+ "description": "Hint text to display in the Command Menu search field.",
1331
+ "attribute": "placeholder"
1224
1332
  },
1225
1333
  {
1226
1334
  "kind": "field",
1227
- "name": "size",
1335
+ "name": "commands",
1228
1336
  "type": {
1229
- "text": "\"s\" | \"m\" | \"l\""
1337
+ "text": "Array<ICommandMenuAction>"
1230
1338
  },
1231
- "default": "\"m\"",
1232
- "description": "The size of the button.\nThis affects font-size and padding.",
1233
- "attribute": "size",
1234
- "reflects": true
1339
+ "default": "[]",
1340
+ "description": "Array of commands to be included in the menu.\nPlease see “Commands data” section for more documentation."
1235
1341
  },
1236
1342
  {
1237
1343
  "kind": "field",
1238
- "name": "accessibleExpanded",
1344
+ "name": "parent",
1239
1345
  "type": {
1240
- "text": "\"true\" | \"false\" | undefined"
1346
+ "text": "string | undefined"
1241
1347
  },
1242
- "privacy": "private",
1243
- "attribute": "aria-expanded"
1348
+ "privacy": "private"
1244
1349
  },
1245
1350
  {
1246
1351
  "kind": "field",
1247
- "name": "accessibleHasPopup",
1352
+ "name": "search",
1248
1353
  "type": {
1249
- "text": "| \"false\"\n | \"true\"\n | \"menu\"\n | \"listbox\"\n | \"tree\"\n | \"grid\"\n | \"dialog\" | undefined"
1354
+ "text": "string"
1250
1355
  },
1251
1356
  "privacy": "private",
1252
- "attribute": "aria-haspopup"
1357
+ "default": "\"\""
1253
1358
  },
1254
1359
  {
1255
1360
  "kind": "field",
1256
- "name": "href",
1361
+ "name": "bump",
1257
1362
  "type": {
1258
- "text": "string | undefined"
1363
+ "text": "boolean"
1259
1364
  },
1260
- "description": "When provided, renders the button as a link,\nwith its href attribute set to the given value.",
1261
- "attribute": "href",
1262
- "reflects": true
1365
+ "privacy": "private",
1366
+ "default": "true"
1263
1367
  },
1264
1368
  {
1265
1369
  "kind": "field",
1266
- "name": "download",
1370
+ "name": "selectedIndex",
1267
1371
  "type": {
1268
- "text": "boolean"
1372
+ "text": "number"
1269
1373
  },
1270
- "default": "false",
1271
- "description": "When provided together with a href property, the button will\ntrigger a file download instead of a page visit.",
1272
- "attribute": "download"
1374
+ "privacy": "private",
1375
+ "default": "0"
1273
1376
  },
1274
1377
  {
1275
1378
  "kind": "field",
1276
- "name": "target",
1379
+ "name": "filteredCommands",
1277
1380
  "type": {
1278
- "text": "\"_self\" | \"_blank\" | \"_parent\" | \"_top\""
1381
+ "text": "Array<ICommandMenuAction>"
1279
1382
  },
1280
- "default": "\"_self\"",
1281
- "description": "When provided together with a href property, determines where\nto open the linked URL. The keywords have special meanings for\nwhere to load the URL: “_self” means the current browsing context,\n“_blank” usually a new tab but users can configure browsers this to\nopen a new window instead, “_parent” means the parent browsing\ncontext of the current one, but if no parent exists, behaves as\n_self, and finally “top” means the topmost browsing context.",
1282
- "attribute": "target",
1283
- "reflects": true
1383
+ "privacy": "private",
1384
+ "default": "[]"
1284
1385
  },
1285
1386
  {
1286
1387
  "kind": "field",
1287
- "name": "expand",
1388
+ "name": "selected",
1288
1389
  "type": {
1289
- "text": "boolean"
1390
+ "text": "ICommandMenuAction"
1290
1391
  },
1291
- "default": "false",
1292
- "description": "Controls whether the button expands to fill the width of its container.",
1293
- "attribute": "expand",
1294
- "reflects": true
1392
+ "privacy": "private"
1295
1393
  },
1296
1394
  {
1297
1395
  "kind": "method",
1298
- "name": "renderLink",
1299
- "privacy": "private",
1396
+ "name": "show",
1300
1397
  "parameters": [
1301
1398
  {
1302
- "name": "innards",
1399
+ "name": "options",
1400
+ "default": "{}",
1303
1401
  "type": {
1304
- "text": "TemplateResult"
1305
- }
1402
+ "text": "{ parent?: string }"
1403
+ },
1404
+ "description": "allows you to open the menu filtered to a specific parent command."
1306
1405
  }
1307
1406
  ],
1308
- "description": "We jump through some hoops here to ensure the link is treated correctly when \"disabled\".\nLinks cannot be disabled natively, so we need to rely on some aria magic to get the correct semantics.\nAlong with the advice in the article below, we also set tabindex to \"-1\", so it is taken out of tab order."
1407
+ "description": "Show the command menu programmatically."
1309
1408
  },
1310
1409
  {
1311
1410
  "kind": "method",
1312
- "name": "renderButton",
1411
+ "name": "close",
1412
+ "description": "Close the command menu programmatically."
1413
+ },
1414
+ {
1415
+ "kind": "method",
1416
+ "name": "toggleOpen",
1417
+ "description": "Toggle the open state programmatically."
1418
+ },
1419
+ {
1420
+ "kind": "method",
1421
+ "name": "focus",
1422
+ "description": "Focus the command menu's input."
1423
+ },
1424
+ {
1425
+ "kind": "method",
1426
+ "name": "renderNoResults",
1427
+ "privacy": "private"
1428
+ },
1429
+ {
1430
+ "kind": "method",
1431
+ "name": "renderSection",
1313
1432
  "privacy": "private",
1314
1433
  "parameters": [
1315
1434
  {
1316
- "name": "innards",
1435
+ "name": "section",
1317
1436
  "type": {
1318
- "text": "TemplateResult"
1437
+ "text": "string | undefined"
1438
+ }
1439
+ },
1440
+ {
1441
+ "name": "commands",
1442
+ "type": {
1443
+ "text": "ICommandMenuAction[]"
1319
1444
  }
1320
1445
  }
1321
1446
  ]
1322
1447
  },
1323
1448
  {
1324
1449
  "kind": "method",
1325
- "name": "renderLightDom",
1450
+ "name": "handleCommandsChange",
1451
+ "privacy": "protected"
1452
+ },
1453
+ {
1454
+ "kind": "method",
1455
+ "name": "handleBump",
1456
+ "privacy": "protected"
1457
+ },
1458
+ {
1459
+ "kind": "method",
1460
+ "name": "focusOnOpen",
1461
+ "privacy": "protected"
1462
+ },
1463
+ {
1464
+ "kind": "method",
1465
+ "name": "handleAnimationEnd",
1326
1466
  "privacy": "private"
1327
1467
  },
1328
1468
  {
1329
- "kind": "field",
1330
- "name": "handleOuterClick",
1469
+ "kind": "method",
1470
+ "name": "handleBlur",
1331
1471
  "privacy": "private"
1332
1472
  },
1333
1473
  {
1334
1474
  "kind": "method",
1335
- "name": "handleClick",
1475
+ "name": "handleInput",
1336
1476
  "privacy": "private",
1337
1477
  "parameters": [
1338
1478
  {
1339
- "name": "e",
1479
+ "name": "event",
1340
1480
  "type": {
1341
- "text": "Event"
1481
+ "text": "KeyboardEvent"
1342
1482
  }
1343
1483
  }
1344
1484
  ]
1345
1485
  },
1346
1486
  {
1347
1487
  "kind": "method",
1348
- "name": "handleProxyChange",
1488
+ "name": "select",
1349
1489
  "privacy": "private",
1350
- "description": "React/Vue etc may remove our proxy button when updating button text, since they are unaware of its existence.\nSo we listen for a slotchange event, and if the element is no longer connected to the DOM we add it back in."
1490
+ "parameters": [
1491
+ {
1492
+ "name": "command",
1493
+ "default": "this.selected",
1494
+ "type": {
1495
+ "text": "ICommandMenuAction"
1496
+ }
1497
+ }
1498
+ ]
1351
1499
  },
1352
1500
  {
1353
- "kind": "field",
1354
- "name": "disabled",
1355
- "type": {
1356
- "text": "boolean"
1357
- },
1358
- "default": "false",
1359
- "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
1360
- "attribute": "disabled",
1361
- "reflects": true,
1362
- "inheritedFrom": {
1363
- "name": "InputMixin",
1364
- "module": "src/common/mixins/InputMixin.ts"
1365
- }
1501
+ "kind": "method",
1502
+ "name": "start",
1503
+ "privacy": "private"
1366
1504
  },
1367
1505
  {
1368
- "kind": "field",
1369
- "name": "name",
1370
- "type": {
1371
- "text": "string | undefined"
1372
- },
1373
- "description": "The name of the form component.",
1374
- "attribute": "name",
1375
- "inheritedFrom": {
1376
- "name": "InputMixin",
1377
- "module": "src/common/mixins/InputMixin.ts"
1378
- }
1506
+ "kind": "method",
1507
+ "name": "end",
1508
+ "privacy": "private"
1379
1509
  },
1380
1510
  {
1381
- "kind": "field",
1382
- "name": "value",
1383
- "type": {
1384
- "text": "string"
1385
- },
1386
- "default": "\"\"",
1387
- "description": "The value of the form component.",
1388
- "attribute": "value",
1389
- "inheritedFrom": {
1390
- "name": "InputMixin",
1391
- "module": "src/common/mixins/InputMixin.ts"
1392
- }
1511
+ "kind": "method",
1512
+ "name": "next",
1513
+ "privacy": "private"
1393
1514
  },
1394
1515
  {
1395
- "kind": "field",
1396
- "name": "form",
1397
- "description": "Gets the form, if any, associated with the form element.",
1398
- "inheritedFrom": {
1399
- "name": "InputMixin",
1400
- "module": "src/common/mixins/InputMixin.ts"
1401
- }
1516
+ "kind": "method",
1517
+ "name": "previous",
1518
+ "privacy": "private"
1402
1519
  },
1403
1520
  {
1404
- "kind": "field",
1405
- "name": "focusableRef",
1406
- "privacy": "protected",
1407
- "inheritedFrom": {
1408
- "name": "FocusableMixin",
1409
- "module": "src/common/mixins/FocusableMixin.ts"
1410
- }
1521
+ "kind": "method",
1522
+ "name": "goBack",
1523
+ "privacy": "private"
1411
1524
  },
1412
1525
  {
1413
1526
  "kind": "method",
1414
- "name": "focus",
1527
+ "name": "setParent",
1528
+ "privacy": "private",
1415
1529
  "parameters": [
1416
1530
  {
1417
- "name": "options",
1531
+ "name": "parent",
1418
1532
  "optional": true,
1419
1533
  "type": {
1420
- "text": "FocusOptions"
1421
- },
1422
- "description": "An object which controls aspects of the focusing process."
1534
+ "text": "string"
1535
+ }
1423
1536
  }
1424
- ],
1425
- "description": "Programmatically move focus to the component.",
1426
- "inheritedFrom": {
1427
- "name": "FocusableMixin",
1428
- "module": "src/common/mixins/FocusableMixin.ts"
1429
- }
1537
+ ]
1430
1538
  },
1431
1539
  {
1432
1540
  "kind": "method",
1433
- "name": "blur",
1434
- "description": "Programmatically remove focus from the component.",
1435
- "inheritedFrom": {
1436
- "name": "FocusableMixin",
1437
- "module": "src/common/mixins/FocusableMixin.ts"
1438
- }
1541
+ "name": "setSearch",
1542
+ "privacy": "private",
1543
+ "parameters": [
1544
+ {
1545
+ "name": "str",
1546
+ "type": {
1547
+ "text": "string"
1548
+ }
1549
+ }
1550
+ ]
1439
1551
  },
1440
1552
  {
1441
1553
  "kind": "method",
1442
- "name": "click",
1443
- "description": "Programmatically simulates a click on the component.",
1444
- "inheritedFrom": {
1445
- "name": "FocusableMixin",
1446
- "module": "src/common/mixins/FocusableMixin.ts"
1447
- }
1554
+ "name": "filterCommands",
1555
+ "privacy": "private"
1448
1556
  }
1449
1557
  ],
1450
- "attributes": [
1451
- {
1452
- "name": "variant",
1453
- "type": {
1454
- "text": "\"default\" | \"primary\" | \"dashed\" | \"plain\" | \"danger\" | \"switch\""
1455
- },
1456
- "default": "\"default\"",
1457
- "description": "The style variant of the button.",
1458
- "fieldName": "variant"
1459
- },
1460
- {
1461
- "name": "type",
1462
- "type": {
1463
- "text": "\"button\" | \"submit\" | \"reset\""
1464
- },
1465
- "default": "\"submit\"",
1466
- "description": "The type of the button.",
1467
- "fieldName": "type"
1468
- },
1469
- {
1470
- "name": "size",
1471
- "type": {
1472
- "text": "\"s\" | \"m\" | \"l\""
1473
- },
1474
- "default": "\"m\"",
1475
- "description": "The size of the button.\nThis affects font-size and padding.",
1476
- "fieldName": "size"
1477
- },
1478
- {
1479
- "name": "aria-expanded",
1480
- "type": {
1481
- "text": "\"true\" | \"false\" | undefined"
1482
- },
1483
- "fieldName": "accessibleExpanded"
1484
- },
1485
- {
1486
- "name": "aria-haspopup",
1487
- "type": {
1488
- "text": "| \"false\"\n | \"true\"\n | \"menu\"\n | \"listbox\"\n | \"tree\"\n | \"grid\"\n | \"dialog\" | undefined"
1489
- },
1490
- "fieldName": "accessibleHasPopup"
1491
- },
1492
- {
1493
- "name": "href",
1494
- "type": {
1495
- "text": "string | undefined"
1496
- },
1497
- "description": "When provided, renders the button as a link,\nwith its href attribute set to the given value.",
1498
- "fieldName": "href"
1499
- },
1558
+ "events": [
1500
1559
  {
1501
- "name": "download",
1560
+ "name": "open",
1502
1561
  "type": {
1503
- "text": "boolean"
1562
+ "text": "NordEvent"
1504
1563
  },
1505
- "default": "false",
1506
- "description": "When provided together with a href property, the button will\ntrigger a file download instead of a page visit.",
1507
- "fieldName": "download"
1564
+ "description": "The command menu was opened."
1508
1565
  },
1509
1566
  {
1510
- "name": "target",
1567
+ "name": "close",
1511
1568
  "type": {
1512
- "text": "\"_self\" | \"_blank\" | \"_parent\" | \"_top\""
1569
+ "text": "NordEvent"
1513
1570
  },
1514
- "default": "\"_self\"",
1515
- "description": "When provided together with a href property, determines where\nto open the linked URL. The keywords have special meanings for\nwhere to load the URL: “_self” means the current browsing context,\n“_blank” usually a new tab but users can configure browsers this to\nopen a new window instead, “_parent” means the parent browsing\ncontext of the current one, but if no parent exists, behaves as\n_self, and finally “top” means the topmost browsing context.",
1516
- "fieldName": "target"
1571
+ "description": "The command menu was closed."
1517
1572
  },
1518
1573
  {
1519
- "name": "expand",
1520
1574
  "type": {
1521
- "text": "boolean"
1575
+ "text": "SelectEvent"
1522
1576
  },
1523
- "default": "false",
1524
- "description": "Controls whether the button expands to fill the width of its container.",
1525
- "fieldName": "expand"
1526
- },
1577
+ "description": "User selected a command from the menu.",
1578
+ "name": "nord-select"
1579
+ }
1580
+ ],
1581
+ "attributes": [
1527
1582
  {
1528
- "name": "disabled",
1583
+ "name": "open",
1529
1584
  "type": {
1530
1585
  "text": "boolean"
1531
1586
  },
1532
1587
  "default": "false",
1533
- "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
1534
- "fieldName": "disabled",
1535
- "inheritedFrom": {
1536
- "name": "InputMixin",
1537
- "module": "src/common/mixins/InputMixin.ts"
1538
- }
1539
- },
1540
- {
1541
- "name": "name",
1542
- "type": {
1543
- "text": "string | undefined"
1544
- },
1545
- "description": "The name of the form component.",
1546
- "fieldName": "name",
1547
- "inheritedFrom": {
1548
- "name": "InputMixin",
1549
- "module": "src/common/mixins/InputMixin.ts"
1550
- }
1588
+ "description": "Show or hide the command menu.",
1589
+ "fieldName": "open"
1551
1590
  },
1552
1591
  {
1553
- "name": "value",
1592
+ "name": "placeholder",
1554
1593
  "type": {
1555
1594
  "text": "string"
1556
1595
  },
1557
- "default": "\"\"",
1558
- "description": "The value of the form component.",
1559
- "fieldName": "value",
1560
- "inheritedFrom": {
1561
- "name": "InputMixin",
1562
- "module": "src/common/mixins/InputMixin.ts"
1563
- }
1564
- }
1565
- ],
1566
- "mixins": [
1567
- {
1568
- "name": "InputMixin",
1569
- "module": "/src/common/mixins/InputMixin.js"
1570
- },
1571
- {
1572
- "name": "FocusableMixin",
1573
- "module": "/src/common/mixins/FocusableMixin.js"
1596
+ "default": "\"Type a command or search...\"",
1597
+ "description": "Hint text to display in the Command Menu search field.",
1598
+ "fieldName": "placeholder"
1574
1599
  }
1575
1600
  ],
1576
1601
  "superclass": {
@@ -1580,7 +1605,7 @@
1580
1605
  "status": "ready",
1581
1606
  "category": "action",
1582
1607
  "displayName": null,
1583
- "tagName": "nord-button",
1608
+ "tagName": "nord-command-menu",
1584
1609
  "customElement": true
1585
1610
  }
1586
1611
  ],
@@ -1589,87 +1614,95 @@
1589
1614
  "kind": "js",
1590
1615
  "name": "default",
1591
1616
  "declaration": {
1592
- "name": "Button",
1593
- "module": "src/button/Button.ts"
1617
+ "name": "CommandMenu",
1618
+ "module": "src/command-menu/CommandMenu.ts"
1594
1619
  }
1595
1620
  },
1596
1621
  {
1597
1622
  "kind": "custom-element-definition",
1598
- "name": "nord-button",
1623
+ "name": "nord-command-menu",
1599
1624
  "declaration": {
1600
- "name": "Button",
1601
- "module": "src/button/Button.ts"
1625
+ "name": "CommandMenu",
1626
+ "module": "src/command-menu/CommandMenu.ts"
1602
1627
  }
1603
1628
  }
1604
1629
  ],
1605
- "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Only use one primary button per section, as a main call-to-action.\n- Use clear and accurate labels.\n- Use established button colors appropriately. For example, only use a danger button style for an action that’s difficult or impossible to undo.\n- Prioritize the most important actions. Too many buttons will cause confusion.\n- Be consistent with positioning of buttons in the user interface.\n- Use strong, actionable verbs in labels such as “Add”, “Close”, “Cancel”, or “Save”.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don't use a primary button in every row of a table.\n- Don’t use buttons to link to other pages. Use regular link or a plain style instead where necessary.\n- Don’t use buttons for navigation where the link appears within or following a sentence.\n- Don’t use labels such as “Read more”, “Click here” or “More”.\n\n</div>\n\n---\n\n## Content guidelines\n\nButton labels should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they click a button:\n\n<div class=\"n-usage n-usage-do\">View user settings</div>\n<div class=\"n-usage n-usage-dont\">Click here</div>\n\nWhen writing button labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">My tasks</div>\n<div class=\"n-usage n-usage-dont\">My Tasks</div>\n\nAvoid unnecessary words and articles in button labels, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Add item</div>\n<div class=\"n-usage n-usage-dont\">Add an item</div>\n\n---\n\n## Variants\n\nThis section describes the different component variants, their purpose, and when to use each variant.\n\n| Name | Purpose |\n| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `default` | Default style is the most common button variant. Only switch to another variant if you need to adjust the visual weight of the element. |\n| `primary` | Primary style is reserved for main call-to-actions. Should be used only once per content area or panel, e.g. for a “Save” action. |\n| `dashed` | Dashed style should be used for actions that trigger filtering. |\n| `danger` | Danger style should be used for actions that delete data or otherwise make it hard to undo the action. |\n| `plain` | Used for less important or less common actions. Can be also used for linking to other pages. |\n| `disabled` | Used for actions that aren’t currently available or not available anymore. Also prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies. |\n| `switch` | Switch style is reserved for the clinic switcher in the top left corner of an application. |\n\n---\n\n## Additional considerations\n\n- Users of assistive technology expect a button to submit data or do an action. If you need the button to navigate into another view, use the `href` property which will output `<a>` tag instead of a `<button>`.\n- When you need to disable a button, use `disabled` property as it conveys this information correctly to assistive technologies like screen readers.\n- Button component provides 3 size variants; small, medium and large. The large size should only be used for marketing purposes or on areas such as an empty space/content notice.\n"
1630
+ "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"
1606
1631
  },
1607
1632
  {
1608
1633
  "kind": "javascript-module",
1609
- "path": "src/card/Card.ts",
1634
+ "path": "src/command-menu/CommandMenuAction.ts",
1610
1635
  "declarations": [
1611
1636
  {
1612
1637
  "kind": "class",
1613
- "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.",
1614
- "name": "Card",
1615
- "slots": [
1616
- {
1617
- "description": "The card content.",
1618
- "name": ""
1619
- },
1620
- {
1621
- "description": "Optional slot that holds a header for the card.",
1622
- "name": "header"
1623
- },
1624
- {
1625
- "description": "Optional slot that holds footer content for the card.",
1626
- "name": "footer"
1627
- }
1628
- ],
1638
+ "description": "Command Menu Action displays a single action that can be executed by the user. For usage examples, please see Command Menu component.",
1639
+ "name": "CommandMenuAction",
1629
1640
  "members": [
1630
1641
  {
1631
1642
  "kind": "field",
1632
- "name": "headerSlot",
1643
+ "name": "direction",
1633
1644
  "privacy": "private",
1634
- "default": "new SlotController(this, \"header\")"
1645
+ "default": "new DirectionController(this)"
1635
1646
  },
1636
1647
  {
1637
1648
  "kind": "field",
1638
- "name": "footerSlot",
1639
- "privacy": "private",
1640
- "default": "new SlotController(this, \"footer\")"
1649
+ "name": "command",
1650
+ "type": {
1651
+ "text": "ICommandMenuAction"
1652
+ },
1653
+ "attribute": "command"
1641
1654
  },
1642
1655
  {
1643
1656
  "kind": "field",
1644
- "name": "padding",
1657
+ "name": "selected",
1645
1658
  "type": {
1646
- "text": "\"m\" | \"l\" | \"none\""
1659
+ "text": "boolean"
1647
1660
  },
1648
- "default": "\"m\"",
1649
- "description": "Controls the padding of the card component. When set to “none”,\nthe header and footer slots will still have padding.",
1650
- "attribute": "padding",
1651
- "reflects": true
1652
- }
1653
- ],
1654
- "attributes": [
1655
- {
1656
- "name": "padding",
1661
+ "default": "false",
1662
+ "attribute": "selected"
1663
+ },
1664
+ {
1665
+ "kind": "method",
1666
+ "name": "ensureInView",
1667
+ "privacy": "protected",
1668
+ "description": "Scroll to show element"
1669
+ },
1670
+ {
1671
+ "kind": "method",
1672
+ "name": "getIconName",
1673
+ "privacy": "private"
1674
+ },
1675
+ {
1676
+ "kind": "method",
1677
+ "name": "renderShortcut",
1678
+ "privacy": "private"
1679
+ }
1680
+ ],
1681
+ "attributes": [
1682
+ {
1683
+ "name": "command",
1657
1684
  "type": {
1658
- "text": "\"m\" | \"l\" | \"none\""
1685
+ "text": "ICommandMenuAction"
1659
1686
  },
1660
- "default": "\"m\"",
1661
- "description": "Controls the padding of the card component. When set to “none”,\nthe header and footer slots will still have padding.",
1662
- "fieldName": "padding"
1687
+ "fieldName": "command"
1688
+ },
1689
+ {
1690
+ "name": "selected",
1691
+ "type": {
1692
+ "text": "boolean"
1693
+ },
1694
+ "default": "false",
1695
+ "fieldName": "selected"
1663
1696
  }
1664
1697
  ],
1665
1698
  "superclass": {
1666
1699
  "name": "LitElement",
1667
1700
  "package": "lit"
1668
1701
  },
1669
- "status": "ready",
1670
- "category": "structure",
1702
+ "status": "internal",
1703
+ "category": null,
1671
1704
  "displayName": null,
1672
- "tagName": "nord-card",
1705
+ "tagName": "nord-command-menu-action",
1673
1706
  "customElement": true
1674
1707
  }
1675
1708
  ],
@@ -1678,20 +1711,144 @@
1678
1711
  "kind": "js",
1679
1712
  "name": "default",
1680
1713
  "declaration": {
1681
- "name": "Card",
1682
- "module": "src/card/Card.ts"
1714
+ "name": "CommandMenuAction",
1715
+ "module": "src/command-menu/CommandMenuAction.ts"
1683
1716
  }
1684
1717
  },
1685
1718
  {
1686
1719
  "kind": "custom-element-definition",
1687
- "name": "nord-card",
1720
+ "name": "nord-command-menu-action",
1688
1721
  "declaration": {
1689
- "name": "Card",
1690
- "module": "src/card/Card.ts"
1722
+ "name": "CommandMenuAction",
1723
+ "module": "src/command-menu/CommandMenuAction.ts"
1691
1724
  }
1692
1725
  }
1693
1726
  ],
1694
- "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"
1727
+ "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"
1728
+ },
1729
+ {
1730
+ "kind": "javascript-module",
1731
+ "path": "src/command-menu/ICommandMenuAction.ts",
1732
+ "declarations": [],
1733
+ "exports": [],
1734
+ "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"
1735
+ },
1736
+ {
1737
+ "kind": "javascript-module",
1738
+ "path": "src/command-menu/KeyboardController.ts",
1739
+ "declarations": [
1740
+ {
1741
+ "kind": "class",
1742
+ "description": "",
1743
+ "name": "KeyboardController",
1744
+ "members": [
1745
+ {
1746
+ "kind": "field",
1747
+ "name": "globalShortcuts",
1748
+ "type": {
1749
+ "text": "ShortcutController"
1750
+ },
1751
+ "privacy": "private",
1752
+ "default": "new ShortcutController(host, { \"$mod+k\": preventDefault(actions.toggleOpen) })"
1753
+ },
1754
+ {
1755
+ "kind": "field",
1756
+ "name": "navigationShortcuts",
1757
+ "type": {
1758
+ "text": "ShortcutController"
1759
+ },
1760
+ "privacy": "private",
1761
+ "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 )"
1762
+ },
1763
+ {
1764
+ "kind": "field",
1765
+ "name": "commandShortcuts",
1766
+ "type": {
1767
+ "text": "ShortcutController"
1768
+ },
1769
+ "privacy": "private",
1770
+ "default": "new ShortcutController(host)"
1771
+ },
1772
+ {
1773
+ "kind": "method",
1774
+ "name": "registerCommandShortcuts"
1775
+ }
1776
+ ]
1777
+ }
1778
+ ],
1779
+ "exports": [
1780
+ {
1781
+ "kind": "js",
1782
+ "name": "KeyboardController",
1783
+ "declaration": {
1784
+ "name": "KeyboardController",
1785
+ "module": "src/command-menu/KeyboardController.ts"
1786
+ }
1787
+ }
1788
+ ],
1789
+ "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"
1790
+ },
1791
+ {
1792
+ "kind": "javascript-module",
1793
+ "path": "src/command-menu/SelectEvent.ts",
1794
+ "declarations": [
1795
+ {
1796
+ "kind": "class",
1797
+ "description": "",
1798
+ "name": "SelectEvent",
1799
+ "members": [
1800
+ {
1801
+ "kind": "field",
1802
+ "name": "eventName",
1803
+ "type": {
1804
+ "text": "string"
1805
+ },
1806
+ "static": true,
1807
+ "default": "\"nord-select\""
1808
+ }
1809
+ ],
1810
+ "superclass": {
1811
+ "name": "NordEvent",
1812
+ "module": "/src/common/events.js"
1813
+ }
1814
+ }
1815
+ ],
1816
+ "exports": [
1817
+ {
1818
+ "kind": "js",
1819
+ "name": "SelectEvent",
1820
+ "declaration": {
1821
+ "name": "SelectEvent",
1822
+ "module": "src/command-menu/SelectEvent.ts"
1823
+ }
1824
+ }
1825
+ ],
1826
+ "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"
1827
+ },
1828
+ {
1829
+ "kind": "javascript-module",
1830
+ "path": "src/command-menu/localization.ts",
1831
+ "declarations": [
1832
+ {
1833
+ "kind": "variable",
1834
+ "name": "commandMenuLocalization",
1835
+ "type": {
1836
+ "text": "object"
1837
+ },
1838
+ "default": "{\n instructions: \"Press 'Enter' to confirm your input or 'Escape' to cancel\",\n inputLabel: \"Type the name of a command to run.\",\n footerArrowKeys: \"Navigate\",\n footerEnterKey: \"Select\",\n footerEscapeKey: \"Esc to dismiss\",\n footerBackspaceKey: \"Move to parent\",\n noResults: (searchTerm: string) => `No results for “${searchTerm}”`,\n tip: \"Search tips: some search terms require exact match. Try typing the entire command name, or use a different word or phrase.\",\n}"
1839
+ }
1840
+ ],
1841
+ "exports": [
1842
+ {
1843
+ "kind": "js",
1844
+ "name": "default",
1845
+ "declaration": {
1846
+ "name": "commandMenuLocalization",
1847
+ "module": "src/command-menu/localization.ts"
1848
+ }
1849
+ }
1850
+ ],
1851
+ "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"
1695
1852
  },
1696
1853
  {
1697
1854
  "kind": "javascript-module",
@@ -2300,594 +2457,447 @@
2300
2457
  },
2301
2458
  {
2302
2459
  "kind": "javascript-module",
2303
- "path": "src/command-menu/CommandMenu.ts",
2460
+ "path": "src/button/Button.ts",
2304
2461
  "declarations": [
2305
2462
  {
2306
2463
  "kind": "class",
2307
- "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.",
2308
- "name": "CommandMenu",
2464
+ "description": "Buttons are used for interface actions. Primary style should be\nused only once per section for main call-to-action, while other\nstyles can appear more frequently.",
2465
+ "name": "Button",
2309
2466
  "slots": [
2310
2467
  {
2311
- "description": "Used to replace the default footer contents.",
2312
- "name": "footer"
2313
- }
2314
- ],
2315
- "members": [
2316
- {
2317
- "kind": "field",
2318
- "name": "inputRef",
2319
- "privacy": "private"
2468
+ "description": "The button content",
2469
+ "name": ""
2320
2470
  },
2321
2471
  {
2322
- "kind": "field",
2323
- "name": "listRef",
2324
- "privacy": "private"
2472
+ "description": "Used to place content at the start of button text. Typically used for icons.",
2473
+ "name": "start"
2325
2474
  },
2475
+ {
2476
+ "description": "Used to place content at the end of button text. Typically used for icons.",
2477
+ "name": "end"
2478
+ }
2479
+ ],
2480
+ "members": [
2326
2481
  {
2327
2482
  "kind": "field",
2328
- "name": "previousFocus",
2329
- "type": {
2330
- "text": "HTMLElement | undefined"
2331
- },
2483
+ "name": "buttonRef",
2332
2484
  "privacy": "private"
2333
2485
  },
2334
2486
  {
2335
2487
  "kind": "field",
2336
- "name": "localize",
2488
+ "name": "events",
2337
2489
  "privacy": "private",
2338
- "default": "new LocalizeController<\"nord-command-menu\">(this)"
2490
+ "default": "new EventController(this)"
2339
2491
  },
2340
2492
  {
2341
2493
  "kind": "field",
2342
- "name": "dismissController",
2494
+ "name": "lightDom",
2343
2495
  "privacy": "private",
2344
- "default": "new LightDismissController(this, {\n isOpen: () => this.open,\n onDismiss: () => this.close(),\n })"
2496
+ "default": "new LightDomController(this, {\n render: () => this.renderLightDom(),\n })"
2345
2497
  },
2346
2498
  {
2347
2499
  "kind": "field",
2348
- "name": "keyboardController",
2349
- "privacy": "private",
2350
- "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 })"
2500
+ "name": "variant",
2501
+ "type": {
2502
+ "text": "\"default\" | \"primary\" | \"dashed\" | \"plain\" | \"danger\" | \"switch\""
2503
+ },
2504
+ "default": "\"default\"",
2505
+ "description": "The style variant of the button.",
2506
+ "attribute": "variant",
2507
+ "reflects": true
2351
2508
  },
2352
2509
  {
2353
2510
  "kind": "field",
2354
- "name": "open",
2511
+ "name": "type",
2355
2512
  "type": {
2356
- "text": "boolean"
2513
+ "text": "\"button\" | \"submit\" | \"reset\""
2357
2514
  },
2358
- "default": "false",
2359
- "description": "Show or hide the command menu.",
2360
- "attribute": "open"
2515
+ "default": "\"submit\"",
2516
+ "description": "The type of the button.",
2517
+ "attribute": "type",
2518
+ "reflects": true
2361
2519
  },
2362
2520
  {
2363
2521
  "kind": "field",
2364
- "name": "placeholder",
2522
+ "name": "size",
2365
2523
  "type": {
2366
- "text": "string"
2524
+ "text": "\"s\" | \"m\" | \"l\""
2367
2525
  },
2368
- "default": "\"Type a command or search...\"",
2369
- "description": "Hint text to display in the Command Menu search field.",
2370
- "attribute": "placeholder"
2526
+ "default": "\"m\"",
2527
+ "description": "The size of the button.\nThis affects font-size and padding.",
2528
+ "attribute": "size",
2529
+ "reflects": true
2371
2530
  },
2372
2531
  {
2373
2532
  "kind": "field",
2374
- "name": "commands",
2533
+ "name": "accessibleExpanded",
2375
2534
  "type": {
2376
- "text": "Array<ICommandMenuAction>"
2377
- },
2378
- "default": "[]",
2379
- "description": "Array of commands to be included in the menu.\nPlease see “Commands data” section for more documentation."
2380
- },
2381
- {
2382
- "kind": "field",
2383
- "name": "parent",
2384
- "type": {
2385
- "text": "string | undefined"
2535
+ "text": "\"true\" | \"false\" | undefined"
2386
2536
  },
2387
- "privacy": "private"
2537
+ "privacy": "private",
2538
+ "attribute": "aria-expanded"
2388
2539
  },
2389
2540
  {
2390
2541
  "kind": "field",
2391
- "name": "search",
2542
+ "name": "accessibleHasPopup",
2392
2543
  "type": {
2393
- "text": "string"
2544
+ "text": "| \"false\"\n | \"true\"\n | \"menu\"\n | \"listbox\"\n | \"tree\"\n | \"grid\"\n | \"dialog\" | undefined"
2394
2545
  },
2395
2546
  "privacy": "private",
2396
- "default": "\"\""
2547
+ "attribute": "aria-haspopup"
2397
2548
  },
2398
2549
  {
2399
2550
  "kind": "field",
2400
- "name": "bump",
2551
+ "name": "href",
2401
2552
  "type": {
2402
- "text": "boolean"
2553
+ "text": "string | undefined"
2403
2554
  },
2404
- "privacy": "private",
2405
- "default": "true"
2555
+ "description": "When provided, renders the button as a link,\nwith its href attribute set to the given value.",
2556
+ "attribute": "href",
2557
+ "reflects": true
2406
2558
  },
2407
2559
  {
2408
2560
  "kind": "field",
2409
- "name": "selectedIndex",
2561
+ "name": "download",
2410
2562
  "type": {
2411
- "text": "number"
2563
+ "text": "boolean"
2412
2564
  },
2413
- "privacy": "private",
2414
- "default": "0"
2565
+ "default": "false",
2566
+ "description": "When provided together with a href property, the button will\ntrigger a file download instead of a page visit.",
2567
+ "attribute": "download"
2415
2568
  },
2416
2569
  {
2417
2570
  "kind": "field",
2418
- "name": "filteredCommands",
2571
+ "name": "target",
2419
2572
  "type": {
2420
- "text": "Array<ICommandMenuAction>"
2573
+ "text": "\"_self\" | \"_blank\" | \"_parent\" | \"_top\""
2421
2574
  },
2422
- "privacy": "private",
2423
- "default": "[]"
2575
+ "default": "\"_self\"",
2576
+ "description": "When provided together with a href property, determines where\nto open the linked URL. The keywords have special meanings for\nwhere to load the URL: “_self” means the current browsing context,\n“_blank” usually a new tab but users can configure browsers this to\nopen a new window instead, “_parent” means the parent browsing\ncontext of the current one, but if no parent exists, behaves as\n_self, and finally “top” means the topmost browsing context.",
2577
+ "attribute": "target",
2578
+ "reflects": true
2424
2579
  },
2425
2580
  {
2426
2581
  "kind": "field",
2427
- "name": "selected",
2582
+ "name": "expand",
2428
2583
  "type": {
2429
- "text": "ICommandMenuAction"
2584
+ "text": "boolean"
2430
2585
  },
2431
- "privacy": "private"
2586
+ "default": "false",
2587
+ "description": "Controls whether the button expands to fill the width of its container.",
2588
+ "attribute": "expand",
2589
+ "reflects": true
2432
2590
  },
2433
2591
  {
2434
2592
  "kind": "method",
2435
- "name": "show",
2593
+ "name": "renderLink",
2594
+ "privacy": "private",
2436
2595
  "parameters": [
2437
2596
  {
2438
- "name": "options",
2439
- "default": "{}",
2597
+ "name": "innards",
2440
2598
  "type": {
2441
- "text": "{ parent?: string }"
2442
- },
2443
- "description": "allows you to open the menu filtered to a specific parent command."
2599
+ "text": "TemplateResult"
2600
+ }
2444
2601
  }
2445
2602
  ],
2446
- "description": "Show the command menu programmatically."
2447
- },
2448
- {
2449
- "kind": "method",
2450
- "name": "close",
2451
- "description": "Close the command menu programmatically."
2452
- },
2453
- {
2454
- "kind": "method",
2455
- "name": "toggleOpen",
2456
- "description": "Toggle the open state programmatically."
2457
- },
2458
- {
2459
- "kind": "method",
2460
- "name": "focus",
2461
- "description": "Focus the command menu's input."
2462
- },
2463
- {
2464
- "kind": "method",
2465
- "name": "renderNoResults",
2466
- "privacy": "private"
2603
+ "description": "We jump through some hoops here to ensure the link is treated correctly when \"disabled\".\nLinks cannot be disabled natively, so we need to rely on some aria magic to get the correct semantics.\nAlong with the advice in the article below, we also set tabindex to \"-1\", so it is taken out of tab order."
2467
2604
  },
2468
2605
  {
2469
2606
  "kind": "method",
2470
- "name": "renderSection",
2607
+ "name": "renderButton",
2471
2608
  "privacy": "private",
2472
2609
  "parameters": [
2473
2610
  {
2474
- "name": "section",
2475
- "type": {
2476
- "text": "string | undefined"
2477
- }
2478
- },
2479
- {
2480
- "name": "commands",
2611
+ "name": "innards",
2481
2612
  "type": {
2482
- "text": "ICommandMenuAction[]"
2613
+ "text": "TemplateResult"
2483
2614
  }
2484
2615
  }
2485
2616
  ]
2486
2617
  },
2487
2618
  {
2488
2619
  "kind": "method",
2489
- "name": "handleCommandsChange",
2490
- "privacy": "protected"
2491
- },
2492
- {
2493
- "kind": "method",
2494
- "name": "handleBump",
2495
- "privacy": "protected"
2496
- },
2497
- {
2498
- "kind": "method",
2499
- "name": "focusOnOpen",
2500
- "privacy": "protected"
2501
- },
2502
- {
2503
- "kind": "method",
2504
- "name": "handleAnimationEnd",
2620
+ "name": "renderLightDom",
2505
2621
  "privacy": "private"
2506
2622
  },
2507
2623
  {
2508
- "kind": "method",
2509
- "name": "handleBlur",
2624
+ "kind": "field",
2625
+ "name": "handleOuterClick",
2510
2626
  "privacy": "private"
2511
2627
  },
2512
2628
  {
2513
2629
  "kind": "method",
2514
- "name": "handleInput",
2630
+ "name": "handleClick",
2515
2631
  "privacy": "private",
2516
2632
  "parameters": [
2517
2633
  {
2518
- "name": "event",
2634
+ "name": "e",
2519
2635
  "type": {
2520
- "text": "KeyboardEvent"
2636
+ "text": "Event"
2521
2637
  }
2522
2638
  }
2523
2639
  ]
2524
2640
  },
2525
2641
  {
2526
2642
  "kind": "method",
2527
- "name": "select",
2643
+ "name": "handleProxyChange",
2528
2644
  "privacy": "private",
2529
- "parameters": [
2530
- {
2531
- "name": "command",
2532
- "default": "this.selected",
2533
- "type": {
2534
- "text": "ICommandMenuAction"
2535
- }
2536
- }
2537
- ]
2645
+ "description": "React/Vue etc may remove our proxy button when updating button text, since they are unaware of its existence.\nSo we listen for a slotchange event, and if the element is no longer connected to the DOM we add it back in."
2538
2646
  },
2539
2647
  {
2540
- "kind": "method",
2541
- "name": "start",
2542
- "privacy": "private"
2648
+ "kind": "field",
2649
+ "name": "disabled",
2650
+ "type": {
2651
+ "text": "boolean"
2652
+ },
2653
+ "default": "false",
2654
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
2655
+ "attribute": "disabled",
2656
+ "reflects": true,
2657
+ "inheritedFrom": {
2658
+ "name": "InputMixin",
2659
+ "module": "src/common/mixins/InputMixin.ts"
2660
+ }
2543
2661
  },
2544
2662
  {
2545
- "kind": "method",
2546
- "name": "end",
2547
- "privacy": "private"
2663
+ "kind": "field",
2664
+ "name": "name",
2665
+ "type": {
2666
+ "text": "string | undefined"
2667
+ },
2668
+ "description": "The name of the form component.",
2669
+ "attribute": "name",
2670
+ "inheritedFrom": {
2671
+ "name": "InputMixin",
2672
+ "module": "src/common/mixins/InputMixin.ts"
2673
+ }
2548
2674
  },
2549
2675
  {
2550
- "kind": "method",
2551
- "name": "next",
2552
- "privacy": "private"
2676
+ "kind": "field",
2677
+ "name": "value",
2678
+ "type": {
2679
+ "text": "string"
2680
+ },
2681
+ "default": "\"\"",
2682
+ "description": "The value of the form component.",
2683
+ "attribute": "value",
2684
+ "inheritedFrom": {
2685
+ "name": "InputMixin",
2686
+ "module": "src/common/mixins/InputMixin.ts"
2687
+ }
2553
2688
  },
2554
2689
  {
2555
- "kind": "method",
2556
- "name": "previous",
2557
- "privacy": "private"
2690
+ "kind": "field",
2691
+ "name": "form",
2692
+ "description": "Gets the form, if any, associated with the form element.",
2693
+ "inheritedFrom": {
2694
+ "name": "InputMixin",
2695
+ "module": "src/common/mixins/InputMixin.ts"
2696
+ }
2558
2697
  },
2559
2698
  {
2560
- "kind": "method",
2561
- "name": "goBack",
2562
- "privacy": "private"
2699
+ "kind": "field",
2700
+ "name": "focusableRef",
2701
+ "privacy": "protected",
2702
+ "inheritedFrom": {
2703
+ "name": "FocusableMixin",
2704
+ "module": "src/common/mixins/FocusableMixin.ts"
2705
+ }
2563
2706
  },
2564
2707
  {
2565
2708
  "kind": "method",
2566
- "name": "setParent",
2567
- "privacy": "private",
2709
+ "name": "focus",
2568
2710
  "parameters": [
2569
2711
  {
2570
- "name": "parent",
2712
+ "name": "options",
2571
2713
  "optional": true,
2572
2714
  "type": {
2573
- "text": "string"
2574
- }
2715
+ "text": "FocusOptions"
2716
+ },
2717
+ "description": "An object which controls aspects of the focusing process."
2575
2718
  }
2576
- ]
2719
+ ],
2720
+ "description": "Programmatically move focus to the component.",
2721
+ "inheritedFrom": {
2722
+ "name": "FocusableMixin",
2723
+ "module": "src/common/mixins/FocusableMixin.ts"
2724
+ }
2577
2725
  },
2578
2726
  {
2579
2727
  "kind": "method",
2580
- "name": "setSearch",
2581
- "privacy": "private",
2582
- "parameters": [
2583
- {
2584
- "name": "str",
2585
- "type": {
2586
- "text": "string"
2587
- }
2588
- }
2589
- ]
2728
+ "name": "blur",
2729
+ "description": "Programmatically remove focus from the component.",
2730
+ "inheritedFrom": {
2731
+ "name": "FocusableMixin",
2732
+ "module": "src/common/mixins/FocusableMixin.ts"
2733
+ }
2590
2734
  },
2591
2735
  {
2592
2736
  "kind": "method",
2593
- "name": "filterCommands",
2594
- "privacy": "private"
2737
+ "name": "click",
2738
+ "description": "Programmatically simulates a click on the component.",
2739
+ "inheritedFrom": {
2740
+ "name": "FocusableMixin",
2741
+ "module": "src/common/mixins/FocusableMixin.ts"
2742
+ }
2595
2743
  }
2596
2744
  ],
2597
- "events": [
2745
+ "attributes": [
2598
2746
  {
2599
- "name": "open",
2747
+ "name": "variant",
2600
2748
  "type": {
2601
- "text": "NordEvent"
2749
+ "text": "\"default\" | \"primary\" | \"dashed\" | \"plain\" | \"danger\" | \"switch\""
2602
2750
  },
2603
- "description": "The command menu was opened."
2751
+ "default": "\"default\"",
2752
+ "description": "The style variant of the button.",
2753
+ "fieldName": "variant"
2604
2754
  },
2605
2755
  {
2606
- "name": "close",
2756
+ "name": "type",
2607
2757
  "type": {
2608
- "text": "NordEvent"
2758
+ "text": "\"button\" | \"submit\" | \"reset\""
2609
2759
  },
2610
- "description": "The command menu was closed."
2760
+ "default": "\"submit\"",
2761
+ "description": "The type of the button.",
2762
+ "fieldName": "type"
2611
2763
  },
2612
2764
  {
2765
+ "name": "size",
2613
2766
  "type": {
2614
- "text": "SelectEvent"
2767
+ "text": "\"s\" | \"m\" | \"l\""
2615
2768
  },
2616
- "description": "User selected a command from the menu.",
2617
- "name": "nord-select"
2618
- }
2619
- ],
2620
- "attributes": [
2769
+ "default": "\"m\"",
2770
+ "description": "The size of the button.\nThis affects font-size and padding.",
2771
+ "fieldName": "size"
2772
+ },
2621
2773
  {
2622
- "name": "open",
2774
+ "name": "aria-expanded",
2623
2775
  "type": {
2624
- "text": "boolean"
2776
+ "text": "\"true\" | \"false\" | undefined"
2625
2777
  },
2626
- "default": "false",
2627
- "description": "Show or hide the command menu.",
2628
- "fieldName": "open"
2778
+ "fieldName": "accessibleExpanded"
2629
2779
  },
2630
2780
  {
2631
- "name": "placeholder",
2781
+ "name": "aria-haspopup",
2632
2782
  "type": {
2633
- "text": "string"
2783
+ "text": "| \"false\"\n | \"true\"\n | \"menu\"\n | \"listbox\"\n | \"tree\"\n | \"grid\"\n | \"dialog\" | undefined"
2634
2784
  },
2635
- "default": "\"Type a command or search...\"",
2636
- "description": "Hint text to display in the Command Menu search field.",
2637
- "fieldName": "placeholder"
2638
- }
2639
- ],
2640
- "superclass": {
2641
- "name": "LitElement",
2642
- "package": "lit"
2643
- },
2644
- "status": "ready",
2645
- "category": "action",
2646
- "displayName": null,
2647
- "tagName": "nord-command-menu",
2648
- "customElement": true
2649
- }
2650
- ],
2651
- "exports": [
2652
- {
2653
- "kind": "js",
2654
- "name": "default",
2655
- "declaration": {
2656
- "name": "CommandMenu",
2657
- "module": "src/command-menu/CommandMenu.ts"
2658
- }
2659
- },
2660
- {
2661
- "kind": "custom-element-definition",
2662
- "name": "nord-command-menu",
2663
- "declaration": {
2664
- "name": "CommandMenu",
2665
- "module": "src/command-menu/CommandMenu.ts"
2666
- }
2667
- }
2668
- ],
2669
- "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"
2670
- },
2671
- {
2672
- "kind": "javascript-module",
2673
- "path": "src/command-menu/CommandMenuAction.ts",
2674
- "declarations": [
2675
- {
2676
- "kind": "class",
2677
- "description": "Command Menu Action displays a single action that can be executed by the user. For usage examples, please see Command Menu component.",
2678
- "name": "CommandMenuAction",
2679
- "members": [
2680
- {
2681
- "kind": "field",
2682
- "name": "direction",
2683
- "privacy": "private",
2684
- "default": "new DirectionController(this)"
2785
+ "fieldName": "accessibleHasPopup"
2685
2786
  },
2686
2787
  {
2687
- "kind": "field",
2688
- "name": "command",
2788
+ "name": "href",
2689
2789
  "type": {
2690
- "text": "ICommandMenuAction"
2790
+ "text": "string | undefined"
2691
2791
  },
2692
- "attribute": "command"
2792
+ "description": "When provided, renders the button as a link,\nwith its href attribute set to the given value.",
2793
+ "fieldName": "href"
2693
2794
  },
2694
2795
  {
2695
- "kind": "field",
2696
- "name": "selected",
2796
+ "name": "download",
2697
2797
  "type": {
2698
2798
  "text": "boolean"
2699
2799
  },
2700
2800
  "default": "false",
2701
- "attribute": "selected"
2702
- },
2703
- {
2704
- "kind": "method",
2705
- "name": "ensureInView",
2706
- "privacy": "protected",
2707
- "description": "Scroll to show element"
2708
- },
2709
- {
2710
- "kind": "method",
2711
- "name": "getIconName",
2712
- "privacy": "private"
2801
+ "description": "When provided together with a href property, the button will\ntrigger a file download instead of a page visit.",
2802
+ "fieldName": "download"
2713
2803
  },
2714
2804
  {
2715
- "kind": "method",
2716
- "name": "renderShortcut",
2717
- "privacy": "private"
2718
- }
2719
- ],
2720
- "attributes": [
2721
- {
2722
- "name": "command",
2805
+ "name": "target",
2723
2806
  "type": {
2724
- "text": "ICommandMenuAction"
2807
+ "text": "\"_self\" | \"_blank\" | \"_parent\" | \"_top\""
2725
2808
  },
2726
- "fieldName": "command"
2809
+ "default": "\"_self\"",
2810
+ "description": "When provided together with a href property, determines where\nto open the linked URL. The keywords have special meanings for\nwhere to load the URL: “_self” means the current browsing context,\n“_blank” usually a new tab but users can configure browsers this to\nopen a new window instead, “_parent” means the parent browsing\ncontext of the current one, but if no parent exists, behaves as\n_self, and finally “top” means the topmost browsing context.",
2811
+ "fieldName": "target"
2727
2812
  },
2728
2813
  {
2729
- "name": "selected",
2814
+ "name": "expand",
2730
2815
  "type": {
2731
2816
  "text": "boolean"
2732
2817
  },
2733
2818
  "default": "false",
2734
- "fieldName": "selected"
2735
- }
2736
- ],
2737
- "superclass": {
2738
- "name": "LitElement",
2739
- "package": "lit"
2740
- },
2741
- "status": "internal",
2742
- "category": null,
2743
- "displayName": null,
2744
- "tagName": "nord-command-menu-action",
2745
- "customElement": true
2746
- }
2747
- ],
2748
- "exports": [
2749
- {
2750
- "kind": "js",
2751
- "name": "default",
2752
- "declaration": {
2753
- "name": "CommandMenuAction",
2754
- "module": "src/command-menu/CommandMenuAction.ts"
2755
- }
2756
- },
2757
- {
2758
- "kind": "custom-element-definition",
2759
- "name": "nord-command-menu-action",
2760
- "declaration": {
2761
- "name": "CommandMenuAction",
2762
- "module": "src/command-menu/CommandMenuAction.ts"
2763
- }
2764
- }
2765
- ],
2766
- "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"
2767
- },
2768
- {
2769
- "kind": "javascript-module",
2770
- "path": "src/command-menu/ICommandMenuAction.ts",
2771
- "declarations": [],
2772
- "exports": [],
2773
- "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"
2774
- },
2775
- {
2776
- "kind": "javascript-module",
2777
- "path": "src/command-menu/KeyboardController.ts",
2778
- "declarations": [
2779
- {
2780
- "kind": "class",
2781
- "description": "",
2782
- "name": "KeyboardController",
2783
- "members": [
2819
+ "description": "Controls whether the button expands to fill the width of its container.",
2820
+ "fieldName": "expand"
2821
+ },
2784
2822
  {
2785
- "kind": "field",
2786
- "name": "globalShortcuts",
2823
+ "name": "disabled",
2787
2824
  "type": {
2788
- "text": "ShortcutController"
2825
+ "text": "boolean"
2789
2826
  },
2790
- "privacy": "private",
2791
- "default": "new ShortcutController(host, { \"$mod+k\": preventDefault(actions.toggleOpen) })"
2827
+ "default": "false",
2828
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
2829
+ "fieldName": "disabled",
2830
+ "inheritedFrom": {
2831
+ "name": "InputMixin",
2832
+ "module": "src/common/mixins/InputMixin.ts"
2833
+ }
2792
2834
  },
2793
2835
  {
2794
- "kind": "field",
2795
- "name": "navigationShortcuts",
2836
+ "name": "name",
2796
2837
  "type": {
2797
- "text": "ShortcutController"
2838
+ "text": "string | undefined"
2798
2839
  },
2799
- "privacy": "private",
2800
- "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 )"
2840
+ "description": "The name of the form component.",
2841
+ "fieldName": "name",
2842
+ "inheritedFrom": {
2843
+ "name": "InputMixin",
2844
+ "module": "src/common/mixins/InputMixin.ts"
2845
+ }
2801
2846
  },
2802
2847
  {
2803
- "kind": "field",
2804
- "name": "commandShortcuts",
2848
+ "name": "value",
2805
2849
  "type": {
2806
- "text": "ShortcutController"
2850
+ "text": "string"
2807
2851
  },
2808
- "privacy": "private",
2809
- "default": "new ShortcutController(host)"
2810
- },
2811
- {
2812
- "kind": "method",
2813
- "name": "registerCommandShortcuts"
2852
+ "default": "\"\"",
2853
+ "description": "The value of the form component.",
2854
+ "fieldName": "value",
2855
+ "inheritedFrom": {
2856
+ "name": "InputMixin",
2857
+ "module": "src/common/mixins/InputMixin.ts"
2858
+ }
2814
2859
  }
2815
- ]
2816
- }
2817
- ],
2818
- "exports": [
2819
- {
2820
- "kind": "js",
2821
- "name": "KeyboardController",
2822
- "declaration": {
2823
- "name": "KeyboardController",
2824
- "module": "src/command-menu/KeyboardController.ts"
2825
- }
2826
- }
2827
- ],
2828
- "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"
2829
- },
2830
- {
2831
- "kind": "javascript-module",
2832
- "path": "src/command-menu/SelectEvent.ts",
2833
- "declarations": [
2834
- {
2835
- "kind": "class",
2836
- "description": "",
2837
- "name": "SelectEvent",
2838
- "members": [
2860
+ ],
2861
+ "mixins": [
2839
2862
  {
2840
- "kind": "field",
2841
- "name": "eventName",
2842
- "type": {
2843
- "text": "string"
2844
- },
2845
- "static": true,
2846
- "default": "\"nord-select\""
2863
+ "name": "InputMixin",
2864
+ "module": "/src/common/mixins/InputMixin.js"
2865
+ },
2866
+ {
2867
+ "name": "FocusableMixin",
2868
+ "module": "/src/common/mixins/FocusableMixin.js"
2847
2869
  }
2848
2870
  ],
2849
2871
  "superclass": {
2850
- "name": "NordEvent",
2851
- "module": "/src/common/events.js"
2852
- }
2872
+ "name": "LitElement",
2873
+ "package": "lit"
2874
+ },
2875
+ "status": "ready",
2876
+ "category": "action",
2877
+ "displayName": null,
2878
+ "tagName": "nord-button",
2879
+ "customElement": true
2853
2880
  }
2854
2881
  ],
2855
2882
  "exports": [
2856
2883
  {
2857
2884
  "kind": "js",
2858
- "name": "SelectEvent",
2885
+ "name": "default",
2859
2886
  "declaration": {
2860
- "name": "SelectEvent",
2861
- "module": "src/command-menu/SelectEvent.ts"
2887
+ "name": "Button",
2888
+ "module": "src/button/Button.ts"
2862
2889
  }
2863
- }
2864
- ],
2865
- "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"
2866
- },
2867
- {
2868
- "kind": "javascript-module",
2869
- "path": "src/command-menu/localization.ts",
2870
- "declarations": [
2871
- {
2872
- "kind": "variable",
2873
- "name": "commandMenuLocalization",
2874
- "type": {
2875
- "text": "object"
2876
- },
2877
- "default": "{\n instructions: \"Press 'Enter' to confirm your input or 'Escape' to cancel\",\n inputLabel: \"Type the name of a command to run.\",\n footerArrowKeys: \"Navigate\",\n footerEnterKey: \"Select\",\n footerEscapeKey: \"Esc to dismiss\",\n footerBackspaceKey: \"Move to parent\",\n noResults: (searchTerm: string) => `No results for “${searchTerm}”`,\n tip: \"Search tips: some search terms require exact match. Try typing the entire command name, or use a different word or phrase.\",\n}"
2878
- }
2879
- ],
2880
- "exports": [
2890
+ },
2881
2891
  {
2882
- "kind": "js",
2883
- "name": "default",
2892
+ "kind": "custom-element-definition",
2893
+ "name": "nord-button",
2884
2894
  "declaration": {
2885
- "name": "commandMenuLocalization",
2886
- "module": "src/command-menu/localization.ts"
2895
+ "name": "Button",
2896
+ "module": "src/button/Button.ts"
2887
2897
  }
2888
2898
  }
2889
2899
  ],
2890
- "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"
2900
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Only use one primary button per section, as a main call-to-action.\n- Use clear and accurate labels.\n- Use established button colors appropriately. For example, only use a danger button style for an action that’s difficult or impossible to undo.\n- Prioritize the most important actions. Too many buttons will cause confusion.\n- Be consistent with positioning of buttons in the user interface.\n- Use strong, actionable verbs in labels such as “Add”, “Close”, “Cancel”, or “Save”.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don't use a primary button in every row of a table.\n- Don’t use buttons to link to other pages. Use regular link or a plain style instead where necessary.\n- Don’t use buttons for navigation where the link appears within or following a sentence.\n- Don’t use labels such as “Read more”, “Click here” or “More”.\n\n</div>\n\n---\n\n## Content guidelines\n\nButton labels should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they click a button:\n\n<div class=\"n-usage n-usage-do\">View user settings</div>\n<div class=\"n-usage n-usage-dont\">Click here</div>\n\nWhen writing button labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">My tasks</div>\n<div class=\"n-usage n-usage-dont\">My Tasks</div>\n\nAvoid unnecessary words and articles in button labels, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Add item</div>\n<div class=\"n-usage n-usage-dont\">Add an item</div>\n\n---\n\n## Variants\n\nThis section describes the different component variants, their purpose, and when to use each variant.\n\n| Name | Purpose |\n| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `default` | Default style is the most common button variant. Only switch to another variant if you need to adjust the visual weight of the element. |\n| `primary` | Primary style is reserved for main call-to-actions. Should be used only once per content area or panel, e.g. for a “Save” action. |\n| `dashed` | Dashed style should be used for actions that trigger filtering. |\n| `danger` | Danger style should be used for actions that delete data or otherwise make it hard to undo the action. |\n| `plain` | Used for less important or less common actions. Can be also used for linking to other pages. |\n| `disabled` | Used for actions that aren’t currently available or not available anymore. Also prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies. |\n| `switch` | Switch style is reserved for the clinic switcher in the top left corner of an application. |\n\n---\n\n## Additional considerations\n\n- Users of assistive technology expect a button to submit data or do an action. If you need the button to navigate into another view, use the `href` property which will output `<a>` tag instead of a `<button>`.\n- When you need to disable a button, use `disabled` property as it conveys this information correctly to assistive technologies like screen readers.\n- Button component provides 3 size variants; small, medium and large. The large size should only be used for marketing purposes or on areas such as an empty space/content notice.\n"
2891
2901
  },
2892
2902
  {
2893
2903
  "kind": "javascript-module",
@@ -7848,239 +7858,32 @@
7848
7858
  "text": "string | undefined"
7849
7859
  },
7850
7860
  "description": "The name of an icon from Nordicons to display for the nav item.",
7851
- "fieldName": "icon"
7852
- },
7853
- {
7854
- "name": "href",
7855
- "type": {
7856
- "text": "string | undefined"
7857
- },
7858
- "description": "The url the nav item should link to.\nNote: this is not used if you have nested navigation using the \"subnav\" slot.",
7859
- "fieldName": "href"
7860
- },
7861
- {
7862
- "name": "badge",
7863
- "type": {
7864
- "text": "string | undefined"
7865
- },
7866
- "description": "Allows you to add a notification badge with a number next to the nav item.",
7867
- "fieldName": "badge"
7868
- },
7869
- {
7870
- "name": "open",
7871
- "type": {
7872
- "text": "boolean"
7873
- },
7874
- "default": "false",
7875
- "description": "When the nav items contains a subnav, controls whether the section is expanded or not.\nNote: this is only used if you have nested navigation using the \"subnav\" slot.",
7876
- "fieldName": "open"
7877
- }
7878
- ],
7879
- "mixins": [
7880
- {
7881
- "name": "FocusableMixin",
7882
- "module": "/src/common/mixins/FocusableMixin.js"
7883
- }
7884
- ],
7885
- "superclass": {
7886
- "name": "LitElement",
7887
- "package": "lit"
7888
- },
7889
- "status": "ready",
7890
- "category": "navigation",
7891
- "displayName": null,
7892
- "tagName": "nord-nav-item",
7893
- "customElement": true
7894
- }
7895
- ],
7896
- "exports": [
7897
- {
7898
- "kind": "js",
7899
- "name": "default",
7900
- "declaration": {
7901
- "name": "NavItem",
7902
- "module": "src/nav-item/NavItem.ts"
7903
- }
7904
- },
7905
- {
7906
- "kind": "custom-element-definition",
7907
- "name": "nord-nav-item",
7908
- "declaration": {
7909
- "name": "NavItem",
7910
- "module": "src/nav-item/NavItem.ts"
7911
- }
7912
- }
7913
- ],
7914
- "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- Group navigation items into navigation groups based on related categories.\n- Use group headings to clarify the category of a section.\n- Use icons for all top level navigation items.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use navigation item outside of navigation group and navigation components.\n\n</div>\n\n---\n\n## Content guidelines\n\nWhen writing navigation item labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">My tasks</div>\n<div class=\"n-usage n-usage-dont\">My Tasks</div>\n\nAvoid unnecessary words and articles in item labels, 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 item labels 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 as few words as possible to describe each item label:\n\n<div class=\"n-usage n-usage-do\">Payments</div>\n<div class=\"n-usage n-usage-dont\">Payments in your clinic</div>\n\nAvoid all caps for item labels and group titles:\n\n<div class=\"n-usage n-usage-do\">Dashboard</div>\n<div class=\"n-usage n-usage-dont\">DASHBOARD</div>\n"
7915
- },
7916
- {
7917
- "kind": "javascript-module",
7918
- "path": "src/navigation/Navigation.ts",
7919
- "declarations": [
7920
- {
7921
- "kind": "class",
7922
- "description": "Navigation is used to display the primary navigation in the sidebar\nof an application. Navigation includes a list of links that users\nuse to move between sections of the application.",
7923
- "name": "Navigation",
7924
- "slots": [
7925
- {
7926
- "description": "The main section of the sidebar, for holding nav components.",
7927
- "name": ""
7928
- },
7929
- {
7930
- "description": "The top section of the sidebar.",
7931
- "name": "header"
7932
- },
7933
- {
7934
- "description": "The bottom section of the sidebar.",
7935
- "name": "footer"
7936
- }
7937
- ],
7938
- "members": [],
7939
- "superclass": {
7940
- "name": "LitElement",
7941
- "package": "lit"
7942
- },
7943
- "status": "ready",
7944
- "category": "navigation",
7945
- "displayName": null,
7946
- "tagName": "nord-navigation",
7947
- "customElement": true
7948
- }
7949
- ],
7950
- "exports": [
7951
- {
7952
- "kind": "js",
7953
- "name": "default",
7954
- "declaration": {
7955
- "name": "Navigation",
7956
- "module": "src/navigation/Navigation.ts"
7957
- }
7958
- },
7959
- {
7960
- "kind": "custom-element-definition",
7961
- "name": "nord-navigation",
7962
- "declaration": {
7963
- "name": "Navigation",
7964
- "module": "src/navigation/Navigation.ts"
7965
- }
7966
- }
7967
- ],
7968
- "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 primary navigation items that perform an action when clicked. Each action should navigate to a URL or trigger another action like a modal overlay.\n- Group navigation items into navigation groups based on related categories.\n- Use group headings to clarify the category of a section.\n- Use icons for all top level navigation items.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t place a `<nav>` element inside the navigation component, as it already contains one internally.\n\n</div>\n\n---\n\n## Content guidelines\n\nWhen writing navigation item labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">My tasks</div>\n<div class=\"n-usage n-usage-dont\">My Tasks</div>\n\nAvoid unnecessary words and articles in item labels, 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 item labels 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 as few words as possible to describe each item label:\n\n<div class=\"n-usage n-usage-do\">Payments</div>\n<div class=\"n-usage n-usage-dont\">Payments in your clinic</div>\n\nAvoid all caps for item labels and group titles:\n\n<div class=\"n-usage n-usage-do\">Dashboard</div>\n<div class=\"n-usage n-usage-dont\">DASHBOARD</div>\n"
7969
- },
7970
- {
7971
- "kind": "javascript-module",
7972
- "path": "src/progress-bar/ProgressBar.ts",
7973
- "declarations": [
7974
- {
7975
- "kind": "class",
7976
- "description": "Progress Bar is used to visually represent the completion\nof a task or process. It shows how much of the task has\nbeen completed and how much is still left.",
7977
- "name": "ProgressBar",
7978
- "members": [
7979
- {
7980
- "kind": "field",
7981
- "name": "value",
7982
- "type": {
7983
- "text": "number | undefined"
7984
- },
7985
- "description": "Specifies how much of the task has been completed. Must be a valid floating\npoint number between 0 and max, or between 0 and 100 if max is omitted. If\nthere is no value, the progress bar is indeterminate; this indicates that\nan activity is ongoing with no indication of how long it’s expected to take.",
7986
- "attribute": "value",
7987
- "reflects": true
7988
- },
7989
- {
7990
- "kind": "field",
7991
- "name": "max",
7992
- "type": {
7993
- "text": "number"
7994
- },
7995
- "default": "100",
7996
- "description": "Describes how much work the task indicated by the progress element requires.\nThe max attribute, if present, must have a value greater than 0 and be a\nvalid floating point number.",
7997
- "attribute": "max",
7998
- "reflects": true
7999
- },
8000
- {
8001
- "kind": "field",
8002
- "name": "label",
8003
- "type": {
8004
- "text": "string"
8005
- },
8006
- "default": "\"Current progress\"",
8007
- "description": "Accessible label for the progress indicator. Visually hidden, but shown\nfor assistive technology.",
8008
- "attribute": "label",
8009
- "reflects": true
8010
- },
8011
- {
8012
- "kind": "field",
8013
- "name": "focusableRef",
8014
- "privacy": "protected",
8015
- "inheritedFrom": {
8016
- "name": "FocusableMixin",
8017
- "module": "src/common/mixins/FocusableMixin.ts"
8018
- }
8019
- },
8020
- {
8021
- "kind": "method",
8022
- "name": "focus",
8023
- "parameters": [
8024
- {
8025
- "name": "options",
8026
- "optional": true,
8027
- "type": {
8028
- "text": "FocusOptions"
8029
- },
8030
- "description": "An object which controls aspects of the focusing process."
8031
- }
8032
- ],
8033
- "description": "Programmatically move focus to the component.",
8034
- "inheritedFrom": {
8035
- "name": "FocusableMixin",
8036
- "module": "src/common/mixins/FocusableMixin.ts"
8037
- }
8038
- },
8039
- {
8040
- "kind": "method",
8041
- "name": "blur",
8042
- "description": "Programmatically remove focus from the component.",
8043
- "inheritedFrom": {
8044
- "name": "FocusableMixin",
8045
- "module": "src/common/mixins/FocusableMixin.ts"
8046
- }
7861
+ "fieldName": "icon"
8047
7862
  },
8048
7863
  {
8049
- "kind": "method",
8050
- "name": "click",
8051
- "description": "Programmatically simulates a click on the component.",
8052
- "inheritedFrom": {
8053
- "name": "FocusableMixin",
8054
- "module": "src/common/mixins/FocusableMixin.ts"
8055
- }
8056
- }
8057
- ],
8058
- "attributes": [
8059
- {
8060
- "name": "value",
7864
+ "name": "href",
8061
7865
  "type": {
8062
- "text": "number | undefined"
7866
+ "text": "string | undefined"
8063
7867
  },
8064
- "description": "Specifies how much of the task has been completed. Must be a valid floating\npoint number between 0 and max, or between 0 and 100 if max is omitted. If\nthere is no value, the progress bar is indeterminate; this indicates that\nan activity is ongoing with no indication of how long it’s expected to take.",
8065
- "fieldName": "value"
7868
+ "description": "The url the nav item should link to.\nNote: this is not used if you have nested navigation using the \"subnav\" slot.",
7869
+ "fieldName": "href"
8066
7870
  },
8067
7871
  {
8068
- "name": "max",
7872
+ "name": "badge",
8069
7873
  "type": {
8070
- "text": "number"
7874
+ "text": "string | undefined"
8071
7875
  },
8072
- "default": "100",
8073
- "description": "Describes how much work the task indicated by the progress element requires.\nThe max attribute, if present, must have a value greater than 0 and be a\nvalid floating point number.",
8074
- "fieldName": "max"
7876
+ "description": "Allows you to add a notification badge with a number next to the nav item.",
7877
+ "fieldName": "badge"
8075
7878
  },
8076
7879
  {
8077
- "name": "label",
7880
+ "name": "open",
8078
7881
  "type": {
8079
- "text": "string"
7882
+ "text": "boolean"
8080
7883
  },
8081
- "default": "\"Current progress\"",
8082
- "description": "Accessible label for the progress indicator. Visually hidden, but shown\nfor assistive technology.",
8083
- "fieldName": "label"
7884
+ "default": "false",
7885
+ "description": "When the nav items contains a subnav, controls whether the section is expanded or not.\nNote: this is only used if you have nested navigation using the \"subnav\" slot.",
7886
+ "fieldName": "open"
8084
7887
  }
8085
7888
  ],
8086
7889
  "mixins": [
@@ -8093,10 +7896,10 @@
8093
7896
  "name": "LitElement",
8094
7897
  "package": "lit"
8095
7898
  },
8096
- "status": "new",
8097
- "category": "feedback",
7899
+ "status": "ready",
7900
+ "category": "navigation",
8098
7901
  "displayName": null,
8099
- "tagName": "nord-progress-bar",
7902
+ "tagName": "nord-nav-item",
8100
7903
  "customElement": true
8101
7904
  }
8102
7905
  ],
@@ -8105,20 +7908,74 @@
8105
7908
  "kind": "js",
8106
7909
  "name": "default",
8107
7910
  "declaration": {
8108
- "name": "ProgressBar",
8109
- "module": "src/progress-bar/ProgressBar.ts"
7911
+ "name": "NavItem",
7912
+ "module": "src/nav-item/NavItem.ts"
8110
7913
  }
8111
7914
  },
8112
7915
  {
8113
7916
  "kind": "custom-element-definition",
8114
- "name": "nord-progress-bar",
7917
+ "name": "nord-nav-item",
8115
7918
  "declaration": {
8116
- "name": "ProgressBar",
8117
- "module": "src/progress-bar/ProgressBar.ts"
7919
+ "name": "NavItem",
7920
+ "module": "src/nav-item/NavItem.ts"
8118
7921
  }
8119
7922
  }
8120
7923
  ],
8121
- "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 show the completion status of an ongoing task.\n- Use progress bar when you can determine the percentage of the completed task at any time.\n- Always provide an accessible label when using Progress Bar.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use in constrained spaces indicating indeterminate loading state, see [Spinner](/components/spinner/) instead.\n\n</div>\n"
7924
+ "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- Group navigation items into navigation groups based on related categories.\n- Use group headings to clarify the category of a section.\n- Use icons for all top level navigation items.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use navigation item outside of navigation group and navigation components.\n\n</div>\n\n---\n\n## Content guidelines\n\nWhen writing navigation item labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">My tasks</div>\n<div class=\"n-usage n-usage-dont\">My Tasks</div>\n\nAvoid unnecessary words and articles in item labels, 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 item labels 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 as few words as possible to describe each item label:\n\n<div class=\"n-usage n-usage-do\">Payments</div>\n<div class=\"n-usage n-usage-dont\">Payments in your clinic</div>\n\nAvoid all caps for item labels and group titles:\n\n<div class=\"n-usage n-usage-do\">Dashboard</div>\n<div class=\"n-usage n-usage-dont\">DASHBOARD</div>\n"
7925
+ },
7926
+ {
7927
+ "kind": "javascript-module",
7928
+ "path": "src/navigation/Navigation.ts",
7929
+ "declarations": [
7930
+ {
7931
+ "kind": "class",
7932
+ "description": "Navigation is used to display the primary navigation in the sidebar\nof an application. Navigation includes a list of links that users\nuse to move between sections of the application.",
7933
+ "name": "Navigation",
7934
+ "slots": [
7935
+ {
7936
+ "description": "The main section of the sidebar, for holding nav components.",
7937
+ "name": ""
7938
+ },
7939
+ {
7940
+ "description": "The top section of the sidebar.",
7941
+ "name": "header"
7942
+ },
7943
+ {
7944
+ "description": "The bottom section of the sidebar.",
7945
+ "name": "footer"
7946
+ }
7947
+ ],
7948
+ "members": [],
7949
+ "superclass": {
7950
+ "name": "LitElement",
7951
+ "package": "lit"
7952
+ },
7953
+ "status": "ready",
7954
+ "category": "navigation",
7955
+ "displayName": null,
7956
+ "tagName": "nord-navigation",
7957
+ "customElement": true
7958
+ }
7959
+ ],
7960
+ "exports": [
7961
+ {
7962
+ "kind": "js",
7963
+ "name": "default",
7964
+ "declaration": {
7965
+ "name": "Navigation",
7966
+ "module": "src/navigation/Navigation.ts"
7967
+ }
7968
+ },
7969
+ {
7970
+ "kind": "custom-element-definition",
7971
+ "name": "nord-navigation",
7972
+ "declaration": {
7973
+ "name": "Navigation",
7974
+ "module": "src/navigation/Navigation.ts"
7975
+ }
7976
+ }
7977
+ ],
7978
+ "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 primary navigation items that perform an action when clicked. Each action should navigate to a URL or trigger another action like a modal overlay.\n- Group navigation items into navigation groups based on related categories.\n- Use group headings to clarify the category of a section.\n- Use icons for all top level navigation items.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t place a `<nav>` element inside the navigation component, as it already contains one internally.\n\n</div>\n\n---\n\n## Content guidelines\n\nWhen writing navigation item labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">My tasks</div>\n<div class=\"n-usage n-usage-dont\">My Tasks</div>\n\nAvoid unnecessary words and articles in item labels, 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 item labels 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 as few words as possible to describe each item label:\n\n<div class=\"n-usage n-usage-do\">Payments</div>\n<div class=\"n-usage n-usage-dont\">Payments in your clinic</div>\n\nAvoid all caps for item labels and group titles:\n\n<div class=\"n-usage n-usage-do\">Dashboard</div>\n<div class=\"n-usage n-usage-dont\">DASHBOARD</div>\n"
8122
7979
  },
8123
7980
  {
8124
7981
  "kind": "javascript-module",
@@ -8282,50 +8139,203 @@
8282
8139
  "description": "Dispatched when the popout is opened."
8283
8140
  },
8284
8141
  {
8285
- "name": "close",
8286
- "type": {
8287
- "text": "NordEvent"
8288
- },
8289
- "description": "Dispatched when the popout is closed."
8142
+ "name": "close",
8143
+ "type": {
8144
+ "text": "NordEvent"
8145
+ },
8146
+ "description": "Dispatched when the popout is closed."
8147
+ }
8148
+ ],
8149
+ "attributes": [
8150
+ {
8151
+ "name": "align",
8152
+ "type": {
8153
+ "text": "\"start\" | \"end\""
8154
+ },
8155
+ "default": "\"start\"",
8156
+ "description": "Set the alignment of the popout in relation to the toggle depending on the position.\n`start` will align the left of the popout to the left of the toggle.\n`end` will align the right of the popout to the right of the toggle.\nA popout with a set position of `inline-start` or `inline-end` will switch\n`start` and `end` to the top and bottom of the popout respectively.",
8157
+ "fieldName": "align"
8158
+ },
8159
+ {
8160
+ "name": "position",
8161
+ "type": {
8162
+ "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\""
8163
+ },
8164
+ "default": "\"block-end\"",
8165
+ "description": "Set the position of the popout in relation to the toggle.\nOptions follow logical properties.\n`block-start` and `block-end` referring to top and bottom respectively,\n`inline-start` and `inline-end` referring to left and right respectively.",
8166
+ "fieldName": "position"
8167
+ },
8168
+ {
8169
+ "name": "id",
8170
+ "type": {
8171
+ "text": "string"
8172
+ },
8173
+ "default": "\"\"",
8174
+ "description": "The id for the active element to reference via aria-controls.",
8175
+ "fieldName": "id"
8176
+ }
8177
+ ],
8178
+ "superclass": {
8179
+ "name": "LitElement",
8180
+ "package": "lit"
8181
+ },
8182
+ "status": "ready",
8183
+ "category": "overlay",
8184
+ "displayName": null,
8185
+ "tagName": "nord-popout",
8186
+ "customElement": true
8187
+ }
8188
+ ],
8189
+ "exports": [
8190
+ {
8191
+ "kind": "js",
8192
+ "name": "default",
8193
+ "declaration": {
8194
+ "name": "Popout",
8195
+ "module": "src/popout/Popout.ts"
8196
+ }
8197
+ },
8198
+ {
8199
+ "kind": "custom-element-definition",
8200
+ "name": "nord-popout",
8201
+ "declaration": {
8202
+ "name": "Popout",
8203
+ "module": "src/popout/Popout.ts"
8204
+ }
8205
+ }
8206
+ ],
8207
+ "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- Always position popout next to the button or other interface element that toggles it.\n- Use a popout to contain controls or information that doesn’t need to be shown immediately.\n- Use a popout to contain items that will most likely not fit into the current view.\n- Use a clearly labelled button to reveal the popout.\n- Use the appropriate `aria-haspopup` and `role` attributes for both the toggle button and containing items. Please refer to the [MDN documentation on both role values](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-haspopup#values) and [child role values](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-haspopup#associated_roles).\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t hide information inside a popout that is imperative to using the current view.\n- Don’t obscure other controls that are important with the popout.\n- Don’t allow the popout to be obscured by other controls or the outer bounds of the current view.\n</div>\n\n---\n\n## Content guidelines\n\nIf a popout contains actions, they should be always written 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\">Create user</div>\n<div class=\"n-usage n-usage-dont\">Create User</div>\n\nPopout actions should always lead with a strong verb that encourages action. Use the `{verb}+{noun}` format except in the case of common actions like Save, Close or Cancel:\n\n<div class=\"n-usage n-usage-do\">Edit row</div>\n<div class=\"n-usage n-usage-dont\">Editing options</div>\n\nAvoid unnecessary words and articles in popout actions, 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 popout actions 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\nAvoid all caps for popout actions:\n\n<div class=\"n-usage n-usage-do\">Rename</div>\n<div class=\"n-usage n-usage-dont\">RENAME</div>\n\n---\n\n## Additional considerations\n\n- The popout component is a containing component, only providing a way to reveal and hide controls by using a single button.\n"
8208
+ },
8209
+ {
8210
+ "kind": "javascript-module",
8211
+ "path": "src/progress-bar/ProgressBar.ts",
8212
+ "declarations": [
8213
+ {
8214
+ "kind": "class",
8215
+ "description": "Progress Bar is used to visually represent the completion\nof a task or process. It shows how much of the task has\nbeen completed and how much is still left.",
8216
+ "name": "ProgressBar",
8217
+ "members": [
8218
+ {
8219
+ "kind": "field",
8220
+ "name": "value",
8221
+ "type": {
8222
+ "text": "number | undefined"
8223
+ },
8224
+ "description": "Specifies how much of the task has been completed. Must be a valid floating\npoint number between 0 and max, or between 0 and 100 if max is omitted. If\nthere is no value, the progress bar is indeterminate; this indicates that\nan activity is ongoing with no indication of how long it’s expected to take.",
8225
+ "attribute": "value",
8226
+ "reflects": true
8227
+ },
8228
+ {
8229
+ "kind": "field",
8230
+ "name": "max",
8231
+ "type": {
8232
+ "text": "number"
8233
+ },
8234
+ "default": "100",
8235
+ "description": "Describes how much work the task indicated by the progress element requires.\nThe max attribute, if present, must have a value greater than 0 and be a\nvalid floating point number.",
8236
+ "attribute": "max",
8237
+ "reflects": true
8238
+ },
8239
+ {
8240
+ "kind": "field",
8241
+ "name": "label",
8242
+ "type": {
8243
+ "text": "string"
8244
+ },
8245
+ "default": "\"Current progress\"",
8246
+ "description": "Accessible label for the progress indicator. Visually hidden, but shown\nfor assistive technology.",
8247
+ "attribute": "label",
8248
+ "reflects": true
8249
+ },
8250
+ {
8251
+ "kind": "field",
8252
+ "name": "focusableRef",
8253
+ "privacy": "protected",
8254
+ "inheritedFrom": {
8255
+ "name": "FocusableMixin",
8256
+ "module": "src/common/mixins/FocusableMixin.ts"
8257
+ }
8258
+ },
8259
+ {
8260
+ "kind": "method",
8261
+ "name": "focus",
8262
+ "parameters": [
8263
+ {
8264
+ "name": "options",
8265
+ "optional": true,
8266
+ "type": {
8267
+ "text": "FocusOptions"
8268
+ },
8269
+ "description": "An object which controls aspects of the focusing process."
8270
+ }
8271
+ ],
8272
+ "description": "Programmatically move focus to the component.",
8273
+ "inheritedFrom": {
8274
+ "name": "FocusableMixin",
8275
+ "module": "src/common/mixins/FocusableMixin.ts"
8276
+ }
8277
+ },
8278
+ {
8279
+ "kind": "method",
8280
+ "name": "blur",
8281
+ "description": "Programmatically remove focus from the component.",
8282
+ "inheritedFrom": {
8283
+ "name": "FocusableMixin",
8284
+ "module": "src/common/mixins/FocusableMixin.ts"
8285
+ }
8286
+ },
8287
+ {
8288
+ "kind": "method",
8289
+ "name": "click",
8290
+ "description": "Programmatically simulates a click on the component.",
8291
+ "inheritedFrom": {
8292
+ "name": "FocusableMixin",
8293
+ "module": "src/common/mixins/FocusableMixin.ts"
8294
+ }
8290
8295
  }
8291
8296
  ],
8292
8297
  "attributes": [
8293
8298
  {
8294
- "name": "align",
8299
+ "name": "value",
8295
8300
  "type": {
8296
- "text": "\"start\" | \"end\""
8301
+ "text": "number | undefined"
8297
8302
  },
8298
- "default": "\"start\"",
8299
- "description": "Set the alignment of the popout in relation to the toggle depending on the position.\n`start` will align the left of the popout to the left of the toggle.\n`end` will align the right of the popout to the right of the toggle.\nA popout with a set position of `inline-start` or `inline-end` will switch\n`start` and `end` to the top and bottom of the popout respectively.",
8300
- "fieldName": "align"
8303
+ "description": "Specifies how much of the task has been completed. Must be a valid floating\npoint number between 0 and max, or between 0 and 100 if max is omitted. If\nthere is no value, the progress bar is indeterminate; this indicates that\nan activity is ongoing with no indication of how long it’s expected to take.",
8304
+ "fieldName": "value"
8301
8305
  },
8302
8306
  {
8303
- "name": "position",
8307
+ "name": "max",
8304
8308
  "type": {
8305
- "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\""
8309
+ "text": "number"
8306
8310
  },
8307
- "default": "\"block-end\"",
8308
- "description": "Set the position of the popout in relation to the toggle.\nOptions follow logical properties.\n`block-start` and `block-end` referring to top and bottom respectively,\n`inline-start` and `inline-end` referring to left and right respectively.",
8309
- "fieldName": "position"
8311
+ "default": "100",
8312
+ "description": "Describes how much work the task indicated by the progress element requires.\nThe max attribute, if present, must have a value greater than 0 and be a\nvalid floating point number.",
8313
+ "fieldName": "max"
8310
8314
  },
8311
8315
  {
8312
- "name": "id",
8316
+ "name": "label",
8313
8317
  "type": {
8314
8318
  "text": "string"
8315
8319
  },
8316
- "default": "\"\"",
8317
- "description": "The id for the active element to reference via aria-controls.",
8318
- "fieldName": "id"
8320
+ "default": "\"Current progress\"",
8321
+ "description": "Accessible label for the progress indicator. Visually hidden, but shown\nfor assistive technology.",
8322
+ "fieldName": "label"
8323
+ }
8324
+ ],
8325
+ "mixins": [
8326
+ {
8327
+ "name": "FocusableMixin",
8328
+ "module": "/src/common/mixins/FocusableMixin.js"
8319
8329
  }
8320
8330
  ],
8321
8331
  "superclass": {
8322
8332
  "name": "LitElement",
8323
8333
  "package": "lit"
8324
8334
  },
8325
- "status": "ready",
8326
- "category": "overlay",
8335
+ "status": "new",
8336
+ "category": "feedback",
8327
8337
  "displayName": null,
8328
- "tagName": "nord-popout",
8338
+ "tagName": "nord-progress-bar",
8329
8339
  "customElement": true
8330
8340
  }
8331
8341
  ],
@@ -8334,20 +8344,20 @@
8334
8344
  "kind": "js",
8335
8345
  "name": "default",
8336
8346
  "declaration": {
8337
- "name": "Popout",
8338
- "module": "src/popout/Popout.ts"
8347
+ "name": "ProgressBar",
8348
+ "module": "src/progress-bar/ProgressBar.ts"
8339
8349
  }
8340
8350
  },
8341
8351
  {
8342
8352
  "kind": "custom-element-definition",
8343
- "name": "nord-popout",
8353
+ "name": "nord-progress-bar",
8344
8354
  "declaration": {
8345
- "name": "Popout",
8346
- "module": "src/popout/Popout.ts"
8355
+ "name": "ProgressBar",
8356
+ "module": "src/progress-bar/ProgressBar.ts"
8347
8357
  }
8348
8358
  }
8349
8359
  ],
8350
- "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- Always position popout next to the button or other interface element that toggles it.\n- Use a popout to contain controls or information that doesn’t need to be shown immediately.\n- Use a popout to contain items that will most likely not fit into the current view.\n- Use a clearly labelled button to reveal the popout.\n- Use the appropriate `aria-haspopup` and `role` attributes for both the toggle button and containing items. Please refer to the [MDN documentation on both role values](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-haspopup#values) and [child role values](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-haspopup#associated_roles).\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t hide information inside a popout that is imperative to using the current view.\n- Don’t obscure other controls that are important with the popout.\n- Don’t allow the popout to be obscured by other controls or the outer bounds of the current view.\n</div>\n\n---\n\n## Content guidelines\n\nIf a popout contains actions, they should be always written 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\">Create user</div>\n<div class=\"n-usage n-usage-dont\">Create User</div>\n\nPopout actions should always lead with a strong verb that encourages action. Use the `{verb}+{noun}` format except in the case of common actions like Save, Close or Cancel:\n\n<div class=\"n-usage n-usage-do\">Edit row</div>\n<div class=\"n-usage n-usage-dont\">Editing options</div>\n\nAvoid unnecessary words and articles in popout actions, 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 popout actions 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\nAvoid all caps for popout actions:\n\n<div class=\"n-usage n-usage-do\">Rename</div>\n<div class=\"n-usage n-usage-dont\">RENAME</div>\n\n---\n\n## Additional considerations\n\n- The popout component is a containing component, only providing a way to reveal and hide controls by using a single button.\n"
8360
+ "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 show the completion status of an ongoing task.\n- Use progress bar when you can determine the percentage of the completed task at any time.\n- Always provide an accessible label when using Progress Bar.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use in constrained spaces indicating indeterminate loading state, see [Spinner](/components/spinner/) instead.\n\n</div>\n"
8351
8361
  },
8352
8362
  {
8353
8363
  "kind": "javascript-module",
@@ -9834,6 +9844,88 @@
9834
9844
  ],
9835
9845
  "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 let a user choose one option from an options menu.\n- Use when you have more than 6 options to choose from.\n- Use when you don’t know how many options there will be.\n- Use hint text and placeholder to provide additional, non-critical instructions.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don't use a select if you have less than 6 options to choose from. Consider using radio components instead, if you have enough space to allow it. \n\n</div>\n\n---\n\n## Content guidelines\n\nSelect labels act as a title for the select field. Labels should typically be short and in noun&nbsp;form:\n\n<div class=\"n-usage n-usage-do\">Company name</div>\n<div class=\"n-usage n-usage-dont\">What is your company name?</div>\n\nWhen writing select 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\">Company name</div>\n<div class=\"n-usage n-usage-dont\">Company Name</div>\n\nDo not use colons in select labels:\n\n<div class=\"n-usage n-usage-do\">Choose organization</div>\n<div class=\"n-usage n-usage-dont\">Choose organization:</div>\n"
9836
9846
  },
9847
+ {
9848
+ "kind": "javascript-module",
9849
+ "path": "src/skeleton/Skeleton.ts",
9850
+ "declarations": [
9851
+ {
9852
+ "kind": "class",
9853
+ "description": "Skeletons are used to provide a low fidelity representation of content\nbefore it appears in a view. This improves the perceived loading time\nfor our users.",
9854
+ "name": "Skeleton",
9855
+ "members": [
9856
+ {
9857
+ "kind": "field",
9858
+ "name": "effect",
9859
+ "type": {
9860
+ "text": "\"pulse\" | \"sheen\" | \"none\""
9861
+ },
9862
+ "default": "\"none\"",
9863
+ "description": "Determines which animation effect the skeleton will use.",
9864
+ "attribute": "effect"
9865
+ },
9866
+ {
9867
+ "kind": "field",
9868
+ "name": "_warningLogged",
9869
+ "type": {
9870
+ "text": "boolean"
9871
+ },
9872
+ "privacy": "private",
9873
+ "static": true,
9874
+ "default": "false",
9875
+ "inheritedFrom": {
9876
+ "name": "DraftComponentMixin",
9877
+ "module": "src/common/mixins/DraftComponentMixin.ts"
9878
+ }
9879
+ }
9880
+ ],
9881
+ "attributes": [
9882
+ {
9883
+ "name": "effect",
9884
+ "type": {
9885
+ "text": "\"pulse\" | \"sheen\" | \"none\""
9886
+ },
9887
+ "default": "\"none\"",
9888
+ "description": "Determines which animation effect the skeleton will use.",
9889
+ "fieldName": "effect"
9890
+ }
9891
+ ],
9892
+ "mixins": [
9893
+ {
9894
+ "name": "DraftComponentMixin",
9895
+ "module": "/src/common/mixins/DraftComponentMixin.js"
9896
+ }
9897
+ ],
9898
+ "superclass": {
9899
+ "name": "LitElement",
9900
+ "package": "lit"
9901
+ },
9902
+ "status": "draft",
9903
+ "category": "feedback",
9904
+ "displayName": null,
9905
+ "tagName": "nord-skeleton",
9906
+ "customElement": true
9907
+ }
9908
+ ],
9909
+ "exports": [
9910
+ {
9911
+ "kind": "js",
9912
+ "name": "default",
9913
+ "declaration": {
9914
+ "name": "Skeleton",
9915
+ "module": "src/skeleton/Skeleton.ts"
9916
+ }
9917
+ },
9918
+ {
9919
+ "kind": "custom-element-definition",
9920
+ "name": "nord-skeleton",
9921
+ "declaration": {
9922
+ "name": "Skeleton",
9923
+ "module": "src/skeleton/Skeleton.ts"
9924
+ }
9925
+ }
9926
+ ],
9927
+ "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 skeleton component for dynamic content only.\n- Use to give the user an indication of what the page layout will be like once loaded.\n- Mimick the actual layout using multiple Skeleton components.\n- Use `aria-busy=\"true\"` to indicate which area on the screen is currently loading and remove it or set it to `false` once loaded.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use Skeleton component for static content.\n- Don’t show placeholder content after Skeleton disappears that will change when the page fully loads.\n\n</div>\n"
9928
+ },
9837
9929
  {
9838
9930
  "kind": "javascript-module",
9839
9931
  "path": "src/spinner/Spinner.ts",
@@ -9933,88 +10025,6 @@
9933
10025
  ],
9934
10026
  "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 indicating users that their action is being processed.\n- Use the label property to provide an accessible label for the spinner. If no label is supplied, the spinner is hidden from assistive technology.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use to show progress. Favor a progress bar instead.\n\n</div>\n"
9935
10027
  },
9936
- {
9937
- "kind": "javascript-module",
9938
- "path": "src/skeleton/Skeleton.ts",
9939
- "declarations": [
9940
- {
9941
- "kind": "class",
9942
- "description": "Skeletons are used to provide a low fidelity representation of content\nbefore it appears in a view. This improves the perceived loading time\nfor our users.",
9943
- "name": "Skeleton",
9944
- "members": [
9945
- {
9946
- "kind": "field",
9947
- "name": "effect",
9948
- "type": {
9949
- "text": "\"pulse\" | \"sheen\" | \"none\""
9950
- },
9951
- "default": "\"none\"",
9952
- "description": "Determines which animation effect the skeleton will use.",
9953
- "attribute": "effect"
9954
- },
9955
- {
9956
- "kind": "field",
9957
- "name": "_warningLogged",
9958
- "type": {
9959
- "text": "boolean"
9960
- },
9961
- "privacy": "private",
9962
- "static": true,
9963
- "default": "false",
9964
- "inheritedFrom": {
9965
- "name": "DraftComponentMixin",
9966
- "module": "src/common/mixins/DraftComponentMixin.ts"
9967
- }
9968
- }
9969
- ],
9970
- "attributes": [
9971
- {
9972
- "name": "effect",
9973
- "type": {
9974
- "text": "\"pulse\" | \"sheen\" | \"none\""
9975
- },
9976
- "default": "\"none\"",
9977
- "description": "Determines which animation effect the skeleton will use.",
9978
- "fieldName": "effect"
9979
- }
9980
- ],
9981
- "mixins": [
9982
- {
9983
- "name": "DraftComponentMixin",
9984
- "module": "/src/common/mixins/DraftComponentMixin.js"
9985
- }
9986
- ],
9987
- "superclass": {
9988
- "name": "LitElement",
9989
- "package": "lit"
9990
- },
9991
- "status": "draft",
9992
- "category": "feedback",
9993
- "displayName": null,
9994
- "tagName": "nord-skeleton",
9995
- "customElement": true
9996
- }
9997
- ],
9998
- "exports": [
9999
- {
10000
- "kind": "js",
10001
- "name": "default",
10002
- "declaration": {
10003
- "name": "Skeleton",
10004
- "module": "src/skeleton/Skeleton.ts"
10005
- }
10006
- },
10007
- {
10008
- "kind": "custom-element-definition",
10009
- "name": "nord-skeleton",
10010
- "declaration": {
10011
- "name": "Skeleton",
10012
- "module": "src/skeleton/Skeleton.ts"
10013
- }
10014
- }
10015
- ],
10016
- "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 skeleton component for dynamic content only.\n- Use to give the user an indication of what the page layout will be like once loaded.\n- Mimick the actual layout using multiple Skeleton components.\n- Use `aria-busy=\"true\"` to indicate which area on the screen is currently loading and remove it or set it to `false` once loaded.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use Skeleton component for static content.\n- Don’t show placeholder content after Skeleton disappears that will change when the page fully loads.\n\n</div>\n"
10017
- },
10018
10028
  {
10019
10029
  "kind": "javascript-module",
10020
10030
  "path": "src/stack/Stack.ts",
@@ -10615,7 +10625,7 @@
10615
10625
  "name": "Table",
10616
10626
  "slots": [
10617
10627
  {
10618
- "description": "The table.",
10628
+ "description": "Default slot which holds the HTML `<table>` element.",
10619
10629
  "name": ""
10620
10630
  }
10621
10631
  ],
@@ -10631,6 +10641,28 @@
10631
10641
  "attribute": "density",
10632
10642
  "reflects": true
10633
10643
  },
10644
+ {
10645
+ "kind": "field",
10646
+ "name": "scrollSnap",
10647
+ "type": {
10648
+ "text": "boolean"
10649
+ },
10650
+ "default": "false",
10651
+ "description": "Enables scroll-snapping, meaning the scroll position is always column-aligned.",
10652
+ "attribute": "scroll-snap",
10653
+ "reflects": true
10654
+ },
10655
+ {
10656
+ "kind": "field",
10657
+ "name": "striped",
10658
+ "type": {
10659
+ "text": "boolean"
10660
+ },
10661
+ "default": "false",
10662
+ "description": "Controls whether to use zebra striping on tables, which can improve readability.",
10663
+ "attribute": "striped",
10664
+ "reflects": true
10665
+ },
10634
10666
  {
10635
10667
  "kind": "method",
10636
10668
  "name": "renderStyles",
@@ -10653,6 +10685,24 @@
10653
10685
  "default": "\"default\"",
10654
10686
  "description": "Controls the density of the table's rows and headers.\nRelaxed increases space, condensed reduces space.",
10655
10687
  "fieldName": "density"
10688
+ },
10689
+ {
10690
+ "name": "scroll-snap",
10691
+ "type": {
10692
+ "text": "boolean"
10693
+ },
10694
+ "default": "false",
10695
+ "description": "Enables scroll-snapping, meaning the scroll position is always column-aligned.",
10696
+ "fieldName": "scrollSnap"
10697
+ },
10698
+ {
10699
+ "name": "striped",
10700
+ "type": {
10701
+ "text": "boolean"
10702
+ },
10703
+ "default": "false",
10704
+ "description": "Controls whether to use zebra striping on tables, which can improve readability.",
10705
+ "fieldName": "striped"
10656
10706
  }
10657
10707
  ],
10658
10708
  "superclass": {