@nordhealth/components 1.0.0-alpha.48 → 1.0.0-alpha.49

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 (59) hide show
  1. package/custom-elements.json +1244 -1221
  2. package/lib/Badge.js +1 -1
  3. package/lib/Badge.js.map +1 -1
  4. package/lib/Button.js +1 -1
  5. package/lib/Button.js.map +1 -1
  6. package/lib/Calendar-d6be720e.js +13 -0
  7. package/lib/Calendar-d6be720e.js.map +1 -0
  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/Checkbox.js.map +1 -1
  13. package/lib/CommandMenu.js +1 -1
  14. package/lib/CommandMenu.js.map +1 -1
  15. package/lib/CommandMenuAction.js +1 -1
  16. package/lib/CommandMenuAction.js.map +1 -1
  17. package/lib/Component-a6208841.js +2 -0
  18. package/lib/Component-a6208841.js.map +1 -0
  19. package/lib/DatePicker.js +1 -1
  20. package/lib/DatePicker.js.map +1 -1
  21. package/lib/Fieldset.js +1 -1
  22. package/lib/Fieldset.js.map +1 -1
  23. package/lib/Header.js +1 -1
  24. package/lib/Header.js.map +1 -1
  25. package/lib/Icon.js +1 -1
  26. package/lib/Icon.js.map +1 -1
  27. package/lib/Input.js +1 -1
  28. package/lib/{InputMixin-367f0927.js → InputMixin-f2da5fa8.js} +1 -1
  29. package/lib/InputMixin-f2da5fa8.js.map +1 -0
  30. package/lib/KeyboardController.js +1 -1
  31. package/lib/KeyboardController.js.map +1 -1
  32. package/lib/Radio.js +1 -1
  33. package/lib/Select.js +1 -1
  34. package/lib/Select.js.map +1 -1
  35. package/lib/Spinner.js +1 -1
  36. package/lib/Spinner.js.map +1 -1
  37. package/lib/Stack.js +1 -1
  38. package/lib/Stack.js.map +1 -1
  39. package/lib/Textarea.js +1 -1
  40. package/lib/Tooltip.js +1 -1
  41. package/lib/Tooltip.js.map +1 -1
  42. package/lib/index.js +1 -1
  43. package/lib/src/badge/Badge.d.ts +2 -2
  44. package/lib/src/button/Button.d.ts +2 -2
  45. package/lib/src/calendar/Calendar.d.ts +1 -1
  46. package/lib/src/card/Card.d.ts +3 -3
  47. package/lib/src/checkbox/Checkbox.test.d.ts +1 -0
  48. package/lib/src/command-menu/CommandMenu.d.ts +8 -5
  49. package/lib/src/command-menu/ICommandMenuAction.d.ts +1 -1
  50. package/lib/src/date-picker/DatePicker.d.ts +1 -1
  51. package/lib/src/header/Header.d.ts +1 -1
  52. package/lib/src/icon/Icon.d.ts +1 -1
  53. package/lib/src/spinner/Spinner.d.ts +1 -1
  54. package/lib/src/stack/Stack.d.ts +1 -1
  55. package/lib/src/tooltip/Tooltip.d.ts +2 -2
  56. package/package.json +2 -2
  57. package/lib/Calendar-6776543a.js +0 -13
  58. package/lib/Calendar-6776543a.js.map +0 -1
  59. package/lib/InputMixin-367f0927.js.map +0 -1
@@ -191,7 +191,7 @@
191
191
  "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | undefined"
192
192
  },
193
193
  "default": "\"info\"",
194
- "description": "The type of badge.\nDetermines the colour of the chip shown on the badge.",
194
+ "description": "The type of badge.\nDetermines the color of the chip shown on the badge.",
195
195
  "attribute": "type",
196
196
  "reflects": true
197
197
  },
@@ -217,7 +217,7 @@
217
217
  "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | undefined"
218
218
  },
219
219
  "default": "\"info\"",
220
- "description": "The type of badge.\nDetermines the colour of the chip shown on the badge.",
220
+ "description": "The type of badge.\nDetermines the color of the chip shown on the badge.",
221
221
  "fieldName": "type"
222
222
  }
223
223
  ],
@@ -254,7 +254,8 @@
254
254
  "module": "src/badge/Badge.ts"
255
255
  }
256
256
  }
257
- ]
257
+ ],
258
+ "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 for example 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"
258
259
  },
259
260
  {
260
261
  "kind": "javascript-module",
@@ -329,7 +330,7 @@
329
330
  "type": {
330
331
  "text": "string | undefined"
331
332
  },
332
- "description": "When provided, renders the button as a link,\nwith it's href attribute set to the given value.",
333
+ "description": "When provided, renders the button as a link,\nwith its href attribute set to the given value.",
333
334
  "attribute": "href",
334
335
  "reflects": true
335
336
  },
@@ -382,7 +383,7 @@
382
383
  "text": "boolean"
383
384
  },
384
385
  "default": "false",
385
- "description": "Makes the input component disabled.\nThis prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies.",
386
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
386
387
  "attribute": "disabled",
387
388
  "reflects": true,
388
389
  "inheritedFrom": {
@@ -396,7 +397,7 @@
396
397
  "type": {
397
398
  "text": "string | undefined"
398
399
  },
399
- "description": "The name of the input component.",
400
+ "description": "The name of the form component.",
400
401
  "attribute": "name",
401
402
  "inheritedFrom": {
402
403
  "name": "InputMixin",
@@ -410,7 +411,7 @@
410
411
  "text": "string"
411
412
  },
412
413
  "default": "\"\"",
413
- "description": "The value of the input component.",
414
+ "description": "The value of the form component.",
414
415
  "attribute": "value",
415
416
  "inheritedFrom": {
416
417
  "name": "InputMixin",
@@ -421,7 +422,7 @@
421
422
  "kind": "field",
422
423
  "name": "form",
423
424
  "privacy": "protected",
424
- "description": "Gets the form, if any, associated with the input element.",
425
+ "description": "Gets the form, if any, associated with the form element.",
425
426
  "inheritedFrom": {
426
427
  "name": "InputMixin",
427
428
  "module": "src/common/mixins/InputMixin.ts"
@@ -449,7 +450,7 @@
449
450
  "description": "An object which controls aspects of the focusing process."
450
451
  }
451
452
  ],
452
- "description": "Programmatically move focus to the component",
453
+ "description": "Programmatically move focus to the component.",
453
454
  "inheritedFrom": {
454
455
  "name": "FocusableMixin",
455
456
  "module": "src/common/mixins/FocusableMixin.ts"
@@ -521,7 +522,7 @@
521
522
  "type": {
522
523
  "text": "string | undefined"
523
524
  },
524
- "description": "When provided, renders the button as a link,\nwith it's href attribute set to the given value.",
525
+ "description": "When provided, renders the button as a link,\nwith its href attribute set to the given value.",
525
526
  "fieldName": "href"
526
527
  },
527
528
  {
@@ -557,7 +558,7 @@
557
558
  "text": "boolean"
558
559
  },
559
560
  "default": "false",
560
- "description": "Makes the input component disabled.\nThis prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies.",
561
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
561
562
  "fieldName": "disabled",
562
563
  "inheritedFrom": {
563
564
  "name": "InputMixin",
@@ -569,7 +570,7 @@
569
570
  "type": {
570
571
  "text": "string | undefined"
571
572
  },
572
- "description": "The name of the input component.",
573
+ "description": "The name of the form component.",
573
574
  "fieldName": "name",
574
575
  "inheritedFrom": {
575
576
  "name": "InputMixin",
@@ -582,7 +583,7 @@
582
583
  "text": "string"
583
584
  },
584
585
  "default": "\"\"",
585
- "description": "The value of the input component.",
586
+ "description": "The value of the form component.",
586
587
  "fieldName": "value",
587
588
  "inheritedFrom": {
588
589
  "name": "InputMixin",
@@ -632,7 +633,7 @@
632
633
  }
633
634
  }
634
635
  ],
635
- "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 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 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## Variations\n\nThis section describes the different component variations, their purpose, and when to use each variation.\n\n| Name | Purpose |\n| ---- | ------- |\n| `default` | Default style is the most common button variation. Only switch to another variation if you need to adjust the visual weight of the element. |\n| `primary` | Primary style is reserved for main call-to-actions. Should be used only once per content area or panel, e.g. for a “Save” action. |\n| `dashed` | Dashed style should be used for actions that trigger filtering. |\n| `danger` | Danger style should be used for actions that delete data or otherwise make it hard to undo the action. |\n| `plain` | Used for less important or less common actions. Can be also used for linking to other pages. |\n| `disabled` | Used for actions that aren’t currently available or not available anymore. Also prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies. |\n\n-------\n\n## 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"
636
+ "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 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 buttons to link to other pages. Use regular link or a plain style instead where necessary.\n- Don’t use buttons for navigation where the link appears within or following a sentence.\n- Don’t use labels such as “Read more”, “Click here” or “More”.\n\n</div>\n\n---\n\n## Content guidelines\n\nButton labels should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they click a button:\n\n<div class=\"n-usage n-usage-do\">View user settings</div>\n<div class=\"n-usage n-usage-dont\">Click here</div>\n\nWhen writing button labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">My tasks</div>\n<div class=\"n-usage n-usage-dont\">My Tasks</div>\n\nAvoid unnecessary words and articles in button labels, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Add item</div>\n<div class=\"n-usage n-usage-dont\">Add an item</div>\n\n---\n\n## Variants\n\nThis section describes the different component variants, their purpose, and when to use each variant.\n\n| Name | Purpose |\n| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `default` | Default style is the most common button variant. Only switch to another variant if you need to adjust the visual weight of the element. |\n| `primary` | Primary style is reserved for main call-to-actions. Should be used only once per content area or panel, e.g. for a “Save” action. |\n| `dashed` | Dashed style should be used for actions that trigger filtering. |\n| `danger` | Danger style should be used for actions that delete data or otherwise make it hard to undo the action. |\n| `plain` | Used for less important or less common actions. Can be also used for linking to other pages. |\n| `disabled` | Used for actions that aren’t currently available or not available anymore. Also prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies. |\n\n---\n\n## 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"
636
637
  },
637
638
  {
638
639
  "kind": "javascript-module",
@@ -991,7 +992,8 @@
991
992
  "module": "src/calendar/Calendar.ts"
992
993
  }
993
994
  }
994
- ]
995
+ ],
996
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n- Close calendar after a single date is selected, unless a range with a start and end date is required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use for choosing a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nCalendar component is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Calendar grid\n\n- `Space, Enter`: Selects a date.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n"
995
997
  },
996
998
  {
997
999
  "kind": "javascript-module",
@@ -1035,7 +1037,8 @@
1035
1037
  "module": "src/calendar/DateSelectEvent.ts"
1036
1038
  }
1037
1039
  }
1038
- ]
1040
+ ],
1041
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n- Close calendar after a single date is selected, unless a range with a start and end date is required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use for choosing a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nCalendar component is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Calendar grid\n\n- `Space, Enter`: Selects a date.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n"
1039
1042
  },
1040
1043
  {
1041
1044
  "kind": "javascript-module",
@@ -1059,7 +1062,8 @@
1059
1062
  "module": "src/calendar/calendar-localization.ts"
1060
1063
  }
1061
1064
  }
1062
- ]
1065
+ ],
1066
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n- Close calendar after a single date is selected, unless a range with a start and end date is required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use for choosing a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nCalendar component is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Calendar grid\n\n- `Space, Enter`: Selects a date.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n"
1063
1067
  },
1064
1068
  {
1065
1069
  "kind": "javascript-module",
@@ -1107,7 +1111,8 @@
1107
1111
  "module": "src/calendar/month-view.ts"
1108
1112
  }
1109
1113
  }
1110
- ]
1114
+ ],
1115
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n- Close calendar after a single date is selected, unless a range with a start and end date is required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use for choosing a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nCalendar component is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Calendar grid\n\n- `Space, Enter`: Selects a date.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n"
1111
1116
  },
1112
1117
  {
1113
1118
  "kind": "javascript-module",
@@ -1151,7 +1156,7 @@
1151
1156
  "text": "\"m\" | \"l\" | \"none\""
1152
1157
  },
1153
1158
  "default": "\"m\"",
1154
- "description": "Control the padding of the card component.\nWhen set to \"none\", the header and footer slots will still have padding.",
1159
+ "description": "Controls the padding of card component. When set to none”,\nthe header and footer slots will still have padding.",
1155
1160
  "attribute": "padding",
1156
1161
  "reflects": true
1157
1162
  },
@@ -1177,7 +1182,7 @@
1177
1182
  "text": "\"m\" | \"l\" | \"none\""
1178
1183
  },
1179
1184
  "default": "\"m\"",
1180
- "description": "Control the padding of the card component.\nWhen set to \"none\", the header and footer slots will still have padding.",
1185
+ "description": "Controls the padding of card component. When set to none”,\nthe header and footer slots will still have padding.",
1181
1186
  "fieldName": "padding"
1182
1187
  }
1183
1188
  ],
@@ -1214,424 +1219,282 @@
1214
1219
  "module": "src/card/Card.ts"
1215
1220
  }
1216
1221
  }
1217
- ]
1222
+ ],
1223
+ "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"
1218
1224
  },
1219
1225
  {
1220
1226
  "kind": "javascript-module",
1221
- "path": "src/checkbox/Checkbox.ts",
1227
+ "path": "src/command-menu/CommandMenu.ts",
1222
1228
  "declarations": [
1223
1229
  {
1224
1230
  "kind": "class",
1225
- "description": "Checkboxes allow user to choose one or more options from a limited set of options.\nIf you have more than 10 options, please use Select component instead.",
1226
- "name": "Checkbox",
1231
+ "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.",
1232
+ "name": "CommandMenu",
1227
1233
  "slots": [
1228
1234
  {
1229
- "description": "Use when a label requires more than plain text.",
1230
- "name": "label"
1231
- },
1232
- {
1233
- "description": "Optional slot that holds hint text for the input.",
1234
- "name": "hint"
1235
- },
1236
- {
1237
- "description": "Optional slot that holds error text for the input.",
1238
- "name": "error"
1235
+ "description": "Used to replace the default footer contents.",
1236
+ "name": "footer"
1239
1237
  }
1240
1238
  ],
1241
1239
  "members": [
1242
1240
  {
1243
1241
  "kind": "field",
1244
- "name": "formValue",
1245
- "privacy": "protected",
1246
- "inheritedFrom": {
1247
- "name": "FormAssociatedMixin",
1248
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1249
- }
1250
- },
1251
- {
1252
- "kind": "field",
1253
- "name": "checked",
1254
- "type": {
1255
- "text": "boolean"
1256
- },
1257
- "default": "false",
1258
- "description": "Controls whether the checkbox is checked or not.",
1259
- "attribute": "checked"
1260
- },
1261
- {
1262
- "kind": "method",
1263
- "name": "handleChange",
1264
- "privacy": "protected",
1265
- "return": {
1266
- "type": {
1267
- "text": "void"
1268
- }
1269
- },
1270
- "parameters": [
1271
- {
1272
- "name": "e",
1273
- "type": {
1274
- "text": "Event"
1275
- }
1276
- }
1277
- ],
1278
- "inheritedFrom": {
1279
- "name": "FormAssociatedMixin",
1280
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1281
- }
1282
- },
1283
- {
1284
- "kind": "field",
1285
- "name": "labelSlot",
1286
- "privacy": "protected",
1287
- "default": "new SlotController(this, \"label\")",
1288
- "inheritedFrom": {
1289
- "name": "FormAssociatedMixin",
1290
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1291
- }
1242
+ "name": "inputRef",
1243
+ "privacy": "private"
1292
1244
  },
1293
1245
  {
1294
1246
  "kind": "field",
1295
- "name": "errorSlot",
1296
- "privacy": "protected",
1297
- "default": "new SlotController(this, \"error\")",
1298
- "inheritedFrom": {
1299
- "name": "FormAssociatedMixin",
1300
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1301
- }
1247
+ "name": "listRef",
1248
+ "privacy": "private"
1302
1249
  },
1303
1250
  {
1304
1251
  "kind": "field",
1305
- "name": "hintSlot",
1306
- "privacy": "protected",
1307
- "default": "new SlotController(this, \"hint\")",
1308
- "inheritedFrom": {
1309
- "name": "FormAssociatedMixin",
1310
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1311
- }
1252
+ "name": "previousFocus",
1253
+ "type": {
1254
+ "text": "HTMLElement | undefined"
1255
+ },
1256
+ "privacy": "private"
1312
1257
  },
1313
1258
  {
1314
1259
  "kind": "field",
1315
- "name": "formData",
1316
- "privacy": "protected",
1317
- "default": "new FormDataController(this, { value: () => this.formValue })",
1318
- "inheritedFrom": {
1319
- "name": "FormAssociatedMixin",
1320
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1321
- }
1260
+ "name": "dismissController",
1261
+ "privacy": "private",
1262
+ "default": "new LightDismissController(this, {\n isOpen: () => this.open,\n onDismiss: () => this.close(),\n })"
1322
1263
  },
1323
1264
  {
1324
1265
  "kind": "field",
1325
- "name": "inputId",
1326
- "type": {
1327
- "text": "string"
1328
- },
1329
- "privacy": "protected",
1330
- "default": "\"input\"",
1331
- "inheritedFrom": {
1332
- "name": "FormAssociatedMixin",
1333
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1334
- }
1266
+ "name": "keyboardController",
1267
+ "privacy": "private",
1268
+ "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 })"
1335
1269
  },
1336
1270
  {
1337
1271
  "kind": "field",
1338
- "name": "errorId",
1272
+ "name": "open",
1339
1273
  "type": {
1340
- "text": "string"
1274
+ "text": "boolean"
1341
1275
  },
1342
- "privacy": "protected",
1343
- "default": "\"error\"",
1344
- "inheritedFrom": {
1345
- "name": "FormAssociatedMixin",
1346
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1347
- }
1276
+ "default": "false",
1277
+ "description": "Show or hide the command menu.",
1278
+ "attribute": "open"
1348
1279
  },
1349
1280
  {
1350
1281
  "kind": "field",
1351
- "name": "hintId",
1282
+ "name": "placeholder",
1352
1283
  "type": {
1353
1284
  "text": "string"
1354
1285
  },
1355
- "privacy": "protected",
1356
- "default": "\"hint\"",
1357
- "inheritedFrom": {
1358
- "name": "FormAssociatedMixin",
1359
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1360
- }
1286
+ "default": "\"Type a command or search...\"",
1287
+ "description": "Hint text to display in the Command Menu search field.",
1288
+ "attribute": "placeholder"
1361
1289
  },
1362
1290
  {
1363
1291
  "kind": "field",
1364
- "name": "label",
1292
+ "name": "commands",
1365
1293
  "type": {
1366
- "text": "string"
1294
+ "text": "Array<ICommandMenuAction>"
1367
1295
  },
1368
- "default": "\"\"",
1369
- "description": "Label for the input.",
1370
- "attribute": "label",
1371
- "inheritedFrom": {
1372
- "name": "FormAssociatedMixin",
1373
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1374
- }
1296
+ "default": "[]",
1297
+ "description": "Array of commands to be included in the menu.\nPlease see “Commands data” section for more documentation."
1375
1298
  },
1376
1299
  {
1377
1300
  "kind": "field",
1378
- "name": "hint",
1301
+ "name": "parent",
1379
1302
  "type": {
1380
1303
  "text": "string | undefined"
1381
1304
  },
1382
- "description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
1383
- "attribute": "hint",
1384
- "inheritedFrom": {
1385
- "name": "FormAssociatedMixin",
1386
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1387
- }
1305
+ "privacy": "private"
1388
1306
  },
1389
1307
  {
1390
1308
  "kind": "field",
1391
- "name": "hideLabel",
1309
+ "name": "search",
1392
1310
  "type": {
1393
- "text": "boolean"
1311
+ "text": "string"
1394
1312
  },
1395
- "default": "false",
1396
- "description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
1397
- "attribute": "hide-label",
1398
- "inheritedFrom": {
1399
- "name": "FormAssociatedMixin",
1400
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1401
- }
1313
+ "privacy": "private",
1314
+ "default": "\"\""
1402
1315
  },
1403
1316
  {
1404
1317
  "kind": "field",
1405
- "name": "placeholder",
1318
+ "name": "bump",
1406
1319
  "type": {
1407
- "text": "string | undefined"
1320
+ "text": "boolean"
1408
1321
  },
1409
- "description": "Placeholder text to display within the input.",
1410
- "attribute": "placeholder",
1411
- "inheritedFrom": {
1412
- "name": "FormAssociatedMixin",
1413
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1414
- }
1322
+ "privacy": "private",
1323
+ "default": "true"
1415
1324
  },
1416
1325
  {
1417
1326
  "kind": "field",
1418
- "name": "error",
1327
+ "name": "selectedIndex",
1419
1328
  "type": {
1420
- "text": "string | undefined"
1329
+ "text": "number"
1421
1330
  },
1422
- "description": "Optional error to be shown with the input. Alternatively use the error slot.",
1423
- "attribute": "error",
1424
- "inheritedFrom": {
1425
- "name": "FormAssociatedMixin",
1426
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1427
- }
1331
+ "privacy": "private",
1332
+ "default": "0"
1428
1333
  },
1429
1334
  {
1430
1335
  "kind": "field",
1431
- "name": "required",
1336
+ "name": "filteredCommands",
1432
1337
  "type": {
1433
- "text": "boolean"
1338
+ "text": "Array<ICommandMenuAction>"
1434
1339
  },
1435
- "default": "false",
1436
- "description": "Determines whether the input is required or not.\nAn input marked as required will be announced as such to users of assistive technology.\nWhen using this property you need to also set “novalidate” attribute on a form element to prevent browser from displaying its own validation errors.",
1437
- "attribute": "required",
1438
- "inheritedFrom": {
1439
- "name": "FormAssociatedMixin",
1440
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1441
- }
1340
+ "privacy": "private",
1341
+ "default": "[]"
1442
1342
  },
1443
1343
  {
1444
1344
  "kind": "field",
1445
- "name": "expand",
1345
+ "name": "selected",
1446
1346
  "type": {
1447
- "text": "boolean"
1347
+ "text": "ICommandMenuAction"
1448
1348
  },
1449
- "default": "false",
1450
- "description": "Controls whether the input expands to fill the width of its container.",
1451
- "attribute": "expand",
1452
- "reflects": true,
1453
- "inheritedFrom": {
1454
- "name": "FormAssociatedMixin",
1455
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1456
- }
1349
+ "privacy": "private"
1457
1350
  },
1458
1351
  {
1459
1352
  "kind": "method",
1460
- "name": "handleInput",
1461
- "privacy": "protected",
1353
+ "name": "show",
1462
1354
  "parameters": [
1463
1355
  {
1464
- "name": "e",
1356
+ "name": "options",
1357
+ "default": "{}",
1465
1358
  "type": {
1466
- "text": "Event"
1467
- }
1359
+ "text": "{ parent?: string }"
1360
+ },
1361
+ "description": "allows you to open the menu filtered to a specific parent command."
1468
1362
  }
1469
1363
  ],
1470
- "inheritedFrom": {
1471
- "name": "FormAssociatedMixin",
1472
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1473
- }
1364
+ "description": "Show the command menu programmatically."
1474
1365
  },
1475
1366
  {
1476
1367
  "kind": "method",
1477
- "name": "renderLabel",
1478
- "privacy": "protected",
1479
- "inheritedFrom": {
1480
- "name": "FormAssociatedMixin",
1481
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1482
- }
1368
+ "name": "close",
1369
+ "description": "Close the command menu programmatically."
1483
1370
  },
1484
1371
  {
1485
1372
  "kind": "method",
1486
- "name": "renderHint",
1487
- "privacy": "private",
1488
- "inheritedFrom": {
1489
- "name": "FormAssociatedMixin",
1490
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1491
- }
1373
+ "name": "toggleOpen",
1374
+ "description": "Toggle the open state programmatically."
1492
1375
  },
1493
1376
  {
1494
1377
  "kind": "method",
1495
- "name": "renderError",
1496
- "privacy": "protected",
1497
- "inheritedFrom": {
1498
- "name": "FormAssociatedMixin",
1499
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1500
- }
1378
+ "name": "focus",
1379
+ "description": "Focus the command menu's input."
1501
1380
  },
1502
1381
  {
1503
1382
  "kind": "method",
1504
- "name": "getDescribedBy",
1505
- "privacy": "protected",
1506
- "inheritedFrom": {
1507
- "name": "FormAssociatedMixin",
1508
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1509
- }
1383
+ "name": "renderNoResults",
1384
+ "privacy": "private"
1510
1385
  },
1511
1386
  {
1512
1387
  "kind": "method",
1513
- "name": "getInvalid",
1514
- "privacy": "protected",
1515
- "inheritedFrom": {
1516
- "name": "FormAssociatedMixin",
1517
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1518
- }
1388
+ "name": "renderSection",
1389
+ "privacy": "private",
1390
+ "parameters": [
1391
+ {
1392
+ "name": "section",
1393
+ "type": {
1394
+ "text": "string | undefined"
1395
+ }
1396
+ },
1397
+ {
1398
+ "name": "commands",
1399
+ "type": {
1400
+ "text": "ICommandMenuAction[]"
1401
+ }
1402
+ }
1403
+ ]
1519
1404
  },
1520
1405
  {
1521
- "kind": "field",
1522
- "name": "hasHint",
1523
- "privacy": "protected",
1524
- "inheritedFrom": {
1525
- "name": "FormAssociatedMixin",
1526
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1527
- }
1406
+ "kind": "method",
1407
+ "name": "handleAnimationEnd",
1408
+ "privacy": "private"
1528
1409
  },
1529
1410
  {
1530
- "kind": "field",
1531
- "name": "hasError",
1532
- "privacy": "protected",
1533
- "inheritedFrom": {
1534
- "name": "FormAssociatedMixin",
1535
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1536
- }
1411
+ "kind": "method",
1412
+ "name": "handleBlur",
1413
+ "privacy": "private"
1537
1414
  },
1538
1415
  {
1539
- "kind": "field",
1540
- "name": "disabled",
1541
- "type": {
1542
- "text": "boolean"
1543
- },
1544
- "default": "false",
1545
- "description": "Makes the input component disabled.\nThis prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies.",
1546
- "attribute": "disabled",
1547
- "reflects": true,
1548
- "inheritedFrom": {
1549
- "name": "InputMixin",
1550
- "module": "src/common/mixins/InputMixin.ts"
1551
- }
1416
+ "kind": "method",
1417
+ "name": "handleInput",
1418
+ "privacy": "private",
1419
+ "parameters": [
1420
+ {
1421
+ "name": "event",
1422
+ "type": {
1423
+ "text": "KeyboardEvent"
1424
+ }
1425
+ }
1426
+ ]
1552
1427
  },
1553
1428
  {
1554
- "kind": "field",
1555
- "name": "name",
1556
- "type": {
1557
- "text": "string | undefined"
1558
- },
1559
- "description": "The name of the input component.",
1560
- "attribute": "name",
1561
- "inheritedFrom": {
1562
- "name": "InputMixin",
1563
- "module": "src/common/mixins/InputMixin.ts"
1564
- }
1429
+ "kind": "method",
1430
+ "name": "select",
1431
+ "privacy": "private",
1432
+ "parameters": [
1433
+ {
1434
+ "name": "command",
1435
+ "default": "this.selected",
1436
+ "type": {
1437
+ "text": "ICommandMenuAction"
1438
+ }
1439
+ }
1440
+ ]
1565
1441
  },
1566
1442
  {
1567
- "kind": "field",
1568
- "name": "value",
1569
- "type": {
1570
- "text": "string"
1571
- },
1572
- "default": "\"\"",
1573
- "description": "The value of the input component.",
1574
- "attribute": "value",
1575
- "inheritedFrom": {
1576
- "name": "InputMixin",
1577
- "module": "src/common/mixins/InputMixin.ts"
1578
- }
1443
+ "kind": "method",
1444
+ "name": "start",
1445
+ "privacy": "private"
1579
1446
  },
1580
1447
  {
1581
- "kind": "field",
1582
- "name": "form",
1583
- "privacy": "protected",
1584
- "description": "Gets the form, if any, associated with the input element.",
1585
- "inheritedFrom": {
1586
- "name": "InputMixin",
1587
- "module": "src/common/mixins/InputMixin.ts"
1588
- }
1448
+ "kind": "method",
1449
+ "name": "end",
1450
+ "privacy": "private"
1589
1451
  },
1590
1452
  {
1591
- "kind": "field",
1592
- "name": "focusableRef",
1593
- "privacy": "protected",
1594
- "inheritedFrom": {
1595
- "name": "FocusableMixin",
1596
- "module": "src/common/mixins/FocusableMixin.ts"
1597
- }
1453
+ "kind": "method",
1454
+ "name": "next",
1455
+ "privacy": "private"
1598
1456
  },
1599
1457
  {
1600
1458
  "kind": "method",
1601
- "name": "focus",
1459
+ "name": "previous",
1460
+ "privacy": "private"
1461
+ },
1462
+ {
1463
+ "kind": "method",
1464
+ "name": "goBack",
1465
+ "privacy": "private"
1466
+ },
1467
+ {
1468
+ "kind": "method",
1469
+ "name": "setParent",
1470
+ "privacy": "private",
1602
1471
  "parameters": [
1603
1472
  {
1604
- "name": "options",
1473
+ "name": "parent",
1605
1474
  "optional": true,
1606
1475
  "type": {
1607
- "text": "FocusOptions"
1608
- },
1609
- "description": "An object which controls aspects of the focusing process."
1476
+ "text": "string"
1477
+ }
1610
1478
  }
1611
- ],
1612
- "description": "Programmatically move focus to the component",
1613
- "inheritedFrom": {
1614
- "name": "FocusableMixin",
1615
- "module": "src/common/mixins/FocusableMixin.ts"
1616
- }
1479
+ ]
1617
1480
  },
1618
1481
  {
1619
1482
  "kind": "method",
1620
- "name": "blur",
1621
- "description": "Programmatically remove focus from the component.",
1622
- "inheritedFrom": {
1623
- "name": "FocusableMixin",
1624
- "module": "src/common/mixins/FocusableMixin.ts"
1625
- }
1483
+ "name": "setSearch",
1484
+ "privacy": "private",
1485
+ "parameters": [
1486
+ {
1487
+ "name": "str",
1488
+ "type": {
1489
+ "text": "string"
1490
+ }
1491
+ }
1492
+ ]
1626
1493
  },
1627
1494
  {
1628
1495
  "kind": "method",
1629
- "name": "click",
1630
- "description": "Programmatically simulates a click on the component.",
1631
- "inheritedFrom": {
1632
- "name": "FocusableMixin",
1633
- "module": "src/common/mixins/FocusableMixin.ts"
1634
- }
1496
+ "name": "filterCommands",
1497
+ "privacy": "private"
1635
1498
  },
1636
1499
  {
1637
1500
  "kind": "field",
@@ -1648,156 +1511,50 @@
1648
1511
  }
1649
1512
  }
1650
1513
  ],
1651
- "attributes": [
1514
+ "events": [
1652
1515
  {
1653
- "name": "checked",
1516
+ "name": "open",
1654
1517
  "type": {
1655
- "text": "boolean"
1518
+ "text": "NordEvent"
1656
1519
  },
1657
- "default": "false",
1658
- "description": "Controls whether the checkbox is checked or not.",
1659
- "fieldName": "checked"
1520
+ "description": "The command menu was opened."
1660
1521
  },
1661
1522
  {
1662
- "name": "label",
1523
+ "name": "close",
1663
1524
  "type": {
1664
- "text": "string"
1525
+ "text": "NordEvent"
1665
1526
  },
1666
- "default": "\"\"",
1667
- "description": "Label for the input.",
1668
- "fieldName": "label",
1669
- "inheritedFrom": {
1670
- "name": "FormAssociatedMixin",
1671
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1672
- }
1527
+ "description": "The command menu was closed."
1673
1528
  },
1674
1529
  {
1675
- "name": "hint",
1676
1530
  "type": {
1677
- "text": "string | undefined"
1531
+ "text": "SelectEvent"
1678
1532
  },
1679
- "description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
1680
- "fieldName": "hint",
1681
- "inheritedFrom": {
1682
- "name": "FormAssociatedMixin",
1683
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1684
- }
1685
- },
1533
+ "description": "User selected a command from the menu.",
1534
+ "name": "n-select"
1535
+ }
1536
+ ],
1537
+ "attributes": [
1686
1538
  {
1687
- "name": "hide-label",
1539
+ "name": "open",
1688
1540
  "type": {
1689
1541
  "text": "boolean"
1690
1542
  },
1691
1543
  "default": "false",
1692
- "description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
1693
- "fieldName": "hideLabel",
1694
- "inheritedFrom": {
1695
- "name": "FormAssociatedMixin",
1696
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1697
- }
1544
+ "description": "Show or hide the command menu.",
1545
+ "fieldName": "open"
1698
1546
  },
1699
1547
  {
1700
1548
  "name": "placeholder",
1701
1549
  "type": {
1702
- "text": "string | undefined"
1550
+ "text": "string"
1703
1551
  },
1704
- "description": "Placeholder text to display within the input.",
1705
- "fieldName": "placeholder",
1706
- "inheritedFrom": {
1707
- "name": "FormAssociatedMixin",
1708
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1709
- }
1710
- },
1711
- {
1712
- "name": "error",
1713
- "type": {
1714
- "text": "string | undefined"
1715
- },
1716
- "description": "Optional error to be shown with the input. Alternatively use the error slot.",
1717
- "fieldName": "error",
1718
- "inheritedFrom": {
1719
- "name": "FormAssociatedMixin",
1720
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1721
- }
1722
- },
1723
- {
1724
- "name": "required",
1725
- "type": {
1726
- "text": "boolean"
1727
- },
1728
- "default": "false",
1729
- "description": "Determines whether the input is required or not.\nAn input marked as required will be announced as such to users of assistive technology.\nWhen using this property you need to also set “novalidate” attribute on a form element to prevent browser from displaying its own validation errors.",
1730
- "fieldName": "required",
1731
- "inheritedFrom": {
1732
- "name": "FormAssociatedMixin",
1733
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1734
- }
1735
- },
1736
- {
1737
- "name": "expand",
1738
- "type": {
1739
- "text": "boolean"
1740
- },
1741
- "default": "false",
1742
- "description": "Controls whether the input expands to fill the width of its container.",
1743
- "fieldName": "expand",
1744
- "inheritedFrom": {
1745
- "name": "FormAssociatedMixin",
1746
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1747
- }
1748
- },
1749
- {
1750
- "name": "disabled",
1751
- "type": {
1752
- "text": "boolean"
1753
- },
1754
- "default": "false",
1755
- "description": "Makes the input component disabled.\nThis prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies.",
1756
- "fieldName": "disabled",
1757
- "inheritedFrom": {
1758
- "name": "InputMixin",
1759
- "module": "src/common/mixins/InputMixin.ts"
1760
- }
1761
- },
1762
- {
1763
- "name": "name",
1764
- "type": {
1765
- "text": "string | undefined"
1766
- },
1767
- "description": "The name of the input component.",
1768
- "fieldName": "name",
1769
- "inheritedFrom": {
1770
- "name": "InputMixin",
1771
- "module": "src/common/mixins/InputMixin.ts"
1772
- }
1773
- },
1774
- {
1775
- "name": "value",
1776
- "type": {
1777
- "text": "string"
1778
- },
1779
- "default": "\"\"",
1780
- "description": "The value of the input component.",
1781
- "fieldName": "value",
1782
- "inheritedFrom": {
1783
- "name": "InputMixin",
1784
- "module": "src/common/mixins/InputMixin.ts"
1785
- }
1786
- }
1787
- ],
1788
- "mixins": [
1789
- {
1790
- "name": "FormAssociatedMixin",
1791
- "module": "/src/common/mixins/FormAssociatedMixin.js"
1792
- },
1793
- {
1794
- "name": "InputMixin",
1795
- "module": "/src/common/mixins/InputMixin.js"
1796
- },
1797
- {
1798
- "name": "FocusableMixin",
1799
- "module": "/src/common/mixins/FocusableMixin.js"
1800
- },
1552
+ "default": "\"Type a command or search...\"",
1553
+ "description": "Hint text to display in the Command Menu search field.",
1554
+ "fieldName": "placeholder"
1555
+ }
1556
+ ],
1557
+ "mixins": [
1801
1558
  {
1802
1559
  "name": "DraftComponentMixin",
1803
1560
  "module": "/src/common/mixins/DraftComponentMixin.js"
@@ -1808,33 +1565,9 @@
1808
1565
  "package": "lit"
1809
1566
  },
1810
1567
  "status": "draft",
1811
- "category": "form",
1812
- "tagName": "nord-checkbox",
1813
- "customElement": true,
1814
- "events": [
1815
- {
1816
- "name": "input",
1817
- "type": {
1818
- "text": "NordEvent"
1819
- },
1820
- "description": "Fired as the user types into the input.",
1821
- "inheritedFrom": {
1822
- "name": "FormAssociatedMixin",
1823
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1824
- }
1825
- },
1826
- {
1827
- "name": "change",
1828
- "type": {
1829
- "text": "NordEvent"
1830
- },
1831
- "description": "Fired whenever the input's value is changed via user interaction.",
1832
- "inheritedFrom": {
1833
- "name": "FormAssociatedMixin",
1834
- "module": "src/common/mixins/FormAssociatedMixin.ts"
1835
- }
1836
- }
1837
- ]
1568
+ "category": "action",
1569
+ "tagName": "nord-command-menu",
1570
+ "customElement": true
1838
1571
  }
1839
1572
  ],
1840
1573
  "exports": [
@@ -1842,293 +1575,629 @@
1842
1575
  "kind": "js",
1843
1576
  "name": "default",
1844
1577
  "declaration": {
1845
- "name": "Checkbox",
1846
- "module": "src/checkbox/Checkbox.ts"
1578
+ "name": "CommandMenu",
1579
+ "module": "src/command-menu/CommandMenu.ts"
1847
1580
  }
1848
1581
  },
1849
1582
  {
1850
1583
  "kind": "custom-element-definition",
1851
- "name": "nord-checkbox",
1584
+ "name": "nord-command-menu",
1852
1585
  "declaration": {
1853
- "name": "Checkbox",
1854
- "module": "src/checkbox/Checkbox.ts"
1586
+ "name": "CommandMenu",
1587
+ "module": "src/command-menu/CommandMenu.ts"
1855
1588
  }
1856
1589
  }
1857
- ]
1590
+ ],
1591
+ "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## 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\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose | Required? |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. | Yes |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. | Yes |\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\"`. | No |\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. | No |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. | No |\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\"`. | No |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. | No |\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. | No |\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"
1858
1592
  },
1859
1593
  {
1860
1594
  "kind": "javascript-module",
1861
- "path": "src/command-menu/CommandMenu.ts",
1595
+ "path": "src/command-menu/CommandMenuAction.ts",
1862
1596
  "declarations": [
1863
1597
  {
1864
1598
  "kind": "class",
1865
- "description": "Command Menu allows users to navigate and use an app without touching the mouse and helps them transform into “power users” who can harness more advanced features far faster.",
1866
- "name": "CommandMenu",
1867
- "slots": [
1868
- {
1869
- "description": "Used to replace the default footer contents.",
1870
- "name": "footer"
1871
- }
1872
- ],
1599
+ "description": "Command Menu Action displays a single action that can be executed by the user. For usage examples, please see Command Menu component.",
1600
+ "name": "CommandMenuAction",
1873
1601
  "members": [
1874
1602
  {
1875
1603
  "kind": "field",
1876
- "name": "inputRef",
1877
- "privacy": "private"
1878
- },
1879
- {
1880
- "kind": "field",
1881
- "name": "listRef",
1882
- "privacy": "private"
1604
+ "name": "command",
1605
+ "type": {
1606
+ "text": "ICommandMenuAction"
1607
+ },
1608
+ "attribute": "command"
1883
1609
  },
1884
1610
  {
1885
1611
  "kind": "field",
1886
- "name": "previousFocus",
1612
+ "name": "selected",
1887
1613
  "type": {
1888
- "text": "HTMLElement | undefined"
1614
+ "text": "boolean"
1889
1615
  },
1890
- "privacy": "private"
1616
+ "default": "false",
1617
+ "attribute": "selected"
1891
1618
  },
1892
1619
  {
1893
- "kind": "field",
1894
- "name": "dismissController",
1620
+ "kind": "method",
1621
+ "name": "ensureInView",
1895
1622
  "privacy": "private",
1896
- "default": "new LightDismissController(this, {\n isOpen: () => this.open,\n onDismiss: () => this.close(),\n })"
1623
+ "description": "Scroll to show element"
1897
1624
  },
1898
1625
  {
1899
- "kind": "field",
1900
- "name": "keyboardController",
1901
- "privacy": "private",
1902
- "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 })"
1626
+ "kind": "method",
1627
+ "name": "renderShortcut",
1628
+ "privacy": "private"
1629
+ }
1630
+ ],
1631
+ "attributes": [
1632
+ {
1633
+ "name": "command",
1634
+ "type": {
1635
+ "text": "ICommandMenuAction"
1636
+ },
1637
+ "fieldName": "command"
1903
1638
  },
1904
1639
  {
1905
- "kind": "field",
1906
- "name": "open",
1640
+ "name": "selected",
1907
1641
  "type": {
1908
1642
  "text": "boolean"
1909
1643
  },
1910
1644
  "default": "false",
1911
- "description": "Show or hide the command menu.",
1912
- "attribute": "open"
1913
- },
1645
+ "fieldName": "selected"
1646
+ }
1647
+ ],
1648
+ "superclass": {
1649
+ "name": "LitElement",
1650
+ "package": "lit"
1651
+ },
1652
+ "status": "internal",
1653
+ "category": null,
1654
+ "tagName": "nord-command-menu-action",
1655
+ "customElement": true
1656
+ }
1657
+ ],
1658
+ "exports": [
1659
+ {
1660
+ "kind": "js",
1661
+ "name": "default",
1662
+ "declaration": {
1663
+ "name": "CommandMenuAction",
1664
+ "module": "src/command-menu/CommandMenuAction.ts"
1665
+ }
1666
+ },
1667
+ {
1668
+ "kind": "custom-element-definition",
1669
+ "name": "nord-command-menu-action",
1670
+ "declaration": {
1671
+ "name": "CommandMenuAction",
1672
+ "module": "src/command-menu/CommandMenuAction.ts"
1673
+ }
1674
+ }
1675
+ ],
1676
+ "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## 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\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose | Required? |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. | Yes |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. | Yes |\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\"`. | No |\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. | No |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. | No |\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\"`. | No |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. | No |\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. | No |\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"
1677
+ },
1678
+ {
1679
+ "kind": "javascript-module",
1680
+ "path": "src/command-menu/ICommandMenuAction.ts",
1681
+ "declarations": [],
1682
+ "exports": [],
1683
+ "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## 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\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose | Required? |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. | Yes |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. | Yes |\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\"`. | No |\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. | No |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. | No |\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\"`. | No |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. | No |\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. | No |\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"
1684
+ },
1685
+ {
1686
+ "kind": "javascript-module",
1687
+ "path": "src/command-menu/KeyboardController.ts",
1688
+ "declarations": [
1689
+ {
1690
+ "kind": "class",
1691
+ "description": "",
1692
+ "name": "KeyboardController",
1693
+ "members": [
1914
1694
  {
1915
1695
  "kind": "field",
1916
- "name": "placeholder",
1696
+ "name": "host",
1917
1697
  "type": {
1918
- "text": "string"
1698
+ "text": "CommandMenu"
1919
1699
  },
1920
- "default": "\"Type a command or search...\"",
1921
- "description": "Hint text to display in the search field.",
1922
- "attribute": "placeholder"
1700
+ "privacy": "private",
1701
+ "default": "host"
1923
1702
  },
1924
1703
  {
1925
1704
  "kind": "field",
1926
- "name": "commands",
1705
+ "name": "globalShortcuts",
1927
1706
  "type": {
1928
- "text": "Array<ICommandMenuAction>"
1707
+ "text": "ShortcutController"
1929
1708
  },
1930
- "default": "[]",
1931
- "description": "Array of commands to be included in the menu."
1709
+ "privacy": "private",
1710
+ "default": "new ShortcutController(host, { \"$mod+k\": preventDefault(actions.toggleOpen) })"
1932
1711
  },
1933
1712
  {
1934
1713
  "kind": "field",
1935
- "name": "parent",
1714
+ "name": "navigationShortcuts",
1936
1715
  "type": {
1937
- "text": "string | undefined"
1716
+ "text": "ShortcutController"
1938
1717
  },
1939
- "privacy": "private"
1718
+ "privacy": "private",
1719
+ "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 )"
1940
1720
  },
1941
1721
  {
1942
1722
  "kind": "field",
1943
- "name": "search",
1723
+ "name": "commandShortcuts",
1944
1724
  "type": {
1945
- "text": "string"
1725
+ "text": "ShortcutController"
1946
1726
  },
1947
1727
  "privacy": "private",
1948
- "default": "\"\""
1728
+ "default": "new ShortcutController(host)"
1949
1729
  },
1730
+ {
1731
+ "kind": "method",
1732
+ "name": "registerCommandShortcuts"
1733
+ }
1734
+ ]
1735
+ }
1736
+ ],
1737
+ "exports": [
1738
+ {
1739
+ "kind": "js",
1740
+ "name": "KeyboardController",
1741
+ "declaration": {
1742
+ "name": "KeyboardController",
1743
+ "module": "src/command-menu/KeyboardController.ts"
1744
+ }
1745
+ }
1746
+ ],
1747
+ "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## 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\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose | Required? |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. | Yes |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. | Yes |\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\"`. | No |\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. | No |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. | No |\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\"`. | No |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. | No |\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. | No |\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"
1748
+ },
1749
+ {
1750
+ "kind": "javascript-module",
1751
+ "path": "src/command-menu/events.ts",
1752
+ "declarations": [
1753
+ {
1754
+ "kind": "class",
1755
+ "description": "",
1756
+ "name": "SelectEvent",
1757
+ "members": [
1950
1758
  {
1951
1759
  "kind": "field",
1952
- "name": "bump",
1760
+ "name": "command",
1953
1761
  "type": {
1954
- "text": "boolean"
1762
+ "text": "ICommandMenuAction"
1955
1763
  },
1956
- "privacy": "private",
1957
- "default": "true"
1764
+ "default": "command"
1765
+ }
1766
+ ],
1767
+ "superclass": {
1768
+ "name": "NordEvent",
1769
+ "module": "/src/common/events.js"
1770
+ }
1771
+ }
1772
+ ],
1773
+ "exports": [
1774
+ {
1775
+ "kind": "js",
1776
+ "name": "SelectEvent",
1777
+ "declaration": {
1778
+ "name": "SelectEvent",
1779
+ "module": "src/command-menu/events.ts"
1780
+ }
1781
+ }
1782
+ ],
1783
+ "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## 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\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose | Required? |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. | Yes |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. | Yes |\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\"`. | No |\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. | No |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. | No |\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\"`. | No |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. | No |\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. | No |\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"
1784
+ },
1785
+ {
1786
+ "kind": "javascript-module",
1787
+ "path": "src/checkbox/Checkbox.ts",
1788
+ "declarations": [
1789
+ {
1790
+ "kind": "class",
1791
+ "description": "Checkboxes allow user to choose one or more options from a limited set of options.\nIf you have more than 10 options, please use Select component instead.",
1792
+ "name": "Checkbox",
1793
+ "slots": [
1794
+ {
1795
+ "description": "Use when a label requires more than plain text.",
1796
+ "name": "label"
1958
1797
  },
1959
1798
  {
1960
- "kind": "field",
1961
- "name": "selectedIndex",
1962
- "type": {
1963
- "text": "number"
1964
- },
1965
- "privacy": "private",
1966
- "default": "0"
1799
+ "description": "Optional slot that holds hint text for the input.",
1800
+ "name": "hint"
1967
1801
  },
1802
+ {
1803
+ "description": "Optional slot that holds error text for the input.",
1804
+ "name": "error"
1805
+ }
1806
+ ],
1807
+ "members": [
1968
1808
  {
1969
1809
  "kind": "field",
1970
- "name": "filteredCommands",
1971
- "type": {
1972
- "text": "Array<ICommandMenuAction>"
1973
- },
1974
- "privacy": "private",
1975
- "default": "[]"
1810
+ "name": "formValue",
1811
+ "privacy": "protected",
1812
+ "inheritedFrom": {
1813
+ "name": "FormAssociatedMixin",
1814
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1815
+ }
1976
1816
  },
1977
1817
  {
1978
1818
  "kind": "field",
1979
- "name": "selected",
1819
+ "name": "checked",
1980
1820
  "type": {
1981
- "text": "ICommandMenuAction"
1821
+ "text": "boolean"
1982
1822
  },
1983
- "privacy": "private"
1823
+ "default": "false",
1824
+ "description": "Controls whether the checkbox is checked or not.",
1825
+ "attribute": "checked"
1984
1826
  },
1985
1827
  {
1986
1828
  "kind": "method",
1987
- "name": "show",
1829
+ "name": "handleChange",
1830
+ "privacy": "protected",
1831
+ "return": {
1832
+ "type": {
1833
+ "text": "void"
1834
+ }
1835
+ },
1988
1836
  "parameters": [
1989
1837
  {
1990
- "name": "options",
1991
- "default": "{}",
1838
+ "name": "e",
1992
1839
  "type": {
1993
- "text": "{ parent?: string }"
1994
- },
1995
- "description": "allows you to open the menu filtered to a specific parent command."
1840
+ "text": "Event"
1841
+ }
1996
1842
  }
1997
1843
  ],
1998
- "description": "Show the command menu programmatically."
1844
+ "inheritedFrom": {
1845
+ "name": "FormAssociatedMixin",
1846
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1847
+ }
1999
1848
  },
2000
1849
  {
2001
- "kind": "method",
2002
- "name": "close",
2003
- "description": "Close the command menu programmatically."
1850
+ "kind": "field",
1851
+ "name": "labelSlot",
1852
+ "privacy": "protected",
1853
+ "default": "new SlotController(this, \"label\")",
1854
+ "inheritedFrom": {
1855
+ "name": "FormAssociatedMixin",
1856
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1857
+ }
2004
1858
  },
2005
1859
  {
2006
- "kind": "method",
2007
- "name": "toggleOpen",
2008
- "description": "Toggle the open state programmatically."
1860
+ "kind": "field",
1861
+ "name": "errorSlot",
1862
+ "privacy": "protected",
1863
+ "default": "new SlotController(this, \"error\")",
1864
+ "inheritedFrom": {
1865
+ "name": "FormAssociatedMixin",
1866
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1867
+ }
2009
1868
  },
2010
1869
  {
2011
- "kind": "method",
2012
- "name": "focus",
2013
- "description": "Focus the command menu's input."
1870
+ "kind": "field",
1871
+ "name": "hintSlot",
1872
+ "privacy": "protected",
1873
+ "default": "new SlotController(this, \"hint\")",
1874
+ "inheritedFrom": {
1875
+ "name": "FormAssociatedMixin",
1876
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1877
+ }
2014
1878
  },
2015
1879
  {
2016
- "kind": "method",
2017
- "name": "renderNoResults",
2018
- "privacy": "private"
1880
+ "kind": "field",
1881
+ "name": "formData",
1882
+ "privacy": "protected",
1883
+ "default": "new FormDataController(this, { value: () => this.formValue })",
1884
+ "inheritedFrom": {
1885
+ "name": "FormAssociatedMixin",
1886
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1887
+ }
2019
1888
  },
2020
1889
  {
2021
- "kind": "method",
2022
- "name": "renderSection",
2023
- "privacy": "private",
2024
- "parameters": [
2025
- {
2026
- "name": "section",
2027
- "type": {
2028
- "text": "string | undefined"
2029
- }
2030
- },
2031
- {
2032
- "name": "commands",
2033
- "type": {
2034
- "text": "ICommandMenuAction[]"
2035
- }
2036
- }
2037
- ]
1890
+ "kind": "field",
1891
+ "name": "inputId",
1892
+ "type": {
1893
+ "text": "string"
1894
+ },
1895
+ "privacy": "protected",
1896
+ "default": "\"input\"",
1897
+ "inheritedFrom": {
1898
+ "name": "FormAssociatedMixin",
1899
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1900
+ }
2038
1901
  },
2039
1902
  {
2040
- "kind": "method",
2041
- "name": "handleAnimationEnd",
2042
- "privacy": "private"
1903
+ "kind": "field",
1904
+ "name": "errorId",
1905
+ "type": {
1906
+ "text": "string"
1907
+ },
1908
+ "privacy": "protected",
1909
+ "default": "\"error\"",
1910
+ "inheritedFrom": {
1911
+ "name": "FormAssociatedMixin",
1912
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1913
+ }
2043
1914
  },
2044
1915
  {
2045
- "kind": "method",
2046
- "name": "handleBlur",
2047
- "privacy": "private"
1916
+ "kind": "field",
1917
+ "name": "hintId",
1918
+ "type": {
1919
+ "text": "string"
1920
+ },
1921
+ "privacy": "protected",
1922
+ "default": "\"hint\"",
1923
+ "inheritedFrom": {
1924
+ "name": "FormAssociatedMixin",
1925
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1926
+ }
1927
+ },
1928
+ {
1929
+ "kind": "field",
1930
+ "name": "label",
1931
+ "type": {
1932
+ "text": "string"
1933
+ },
1934
+ "default": "\"\"",
1935
+ "description": "Label for the input.",
1936
+ "attribute": "label",
1937
+ "inheritedFrom": {
1938
+ "name": "FormAssociatedMixin",
1939
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1940
+ }
1941
+ },
1942
+ {
1943
+ "kind": "field",
1944
+ "name": "hint",
1945
+ "type": {
1946
+ "text": "string | undefined"
1947
+ },
1948
+ "description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
1949
+ "attribute": "hint",
1950
+ "inheritedFrom": {
1951
+ "name": "FormAssociatedMixin",
1952
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1953
+ }
1954
+ },
1955
+ {
1956
+ "kind": "field",
1957
+ "name": "hideLabel",
1958
+ "type": {
1959
+ "text": "boolean"
1960
+ },
1961
+ "default": "false",
1962
+ "description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
1963
+ "attribute": "hide-label",
1964
+ "inheritedFrom": {
1965
+ "name": "FormAssociatedMixin",
1966
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1967
+ }
1968
+ },
1969
+ {
1970
+ "kind": "field",
1971
+ "name": "placeholder",
1972
+ "type": {
1973
+ "text": "string | undefined"
1974
+ },
1975
+ "description": "Placeholder text to display within the input.",
1976
+ "attribute": "placeholder",
1977
+ "inheritedFrom": {
1978
+ "name": "FormAssociatedMixin",
1979
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1980
+ }
1981
+ },
1982
+ {
1983
+ "kind": "field",
1984
+ "name": "error",
1985
+ "type": {
1986
+ "text": "string | undefined"
1987
+ },
1988
+ "description": "Optional error to be shown with the input. Alternatively use the error slot.",
1989
+ "attribute": "error",
1990
+ "inheritedFrom": {
1991
+ "name": "FormAssociatedMixin",
1992
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
1993
+ }
1994
+ },
1995
+ {
1996
+ "kind": "field",
1997
+ "name": "required",
1998
+ "type": {
1999
+ "text": "boolean"
2000
+ },
2001
+ "default": "false",
2002
+ "description": "Determines whether the input is required or not.\nAn input marked as required will be announced as such to users of assistive technology.\nWhen using this property you need to also set “novalidate” attribute on a form element to prevent browser from displaying its own validation errors.",
2003
+ "attribute": "required",
2004
+ "inheritedFrom": {
2005
+ "name": "FormAssociatedMixin",
2006
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2007
+ }
2008
+ },
2009
+ {
2010
+ "kind": "field",
2011
+ "name": "expand",
2012
+ "type": {
2013
+ "text": "boolean"
2014
+ },
2015
+ "default": "false",
2016
+ "description": "Controls whether the input expands to fill the width of its container.",
2017
+ "attribute": "expand",
2018
+ "reflects": true,
2019
+ "inheritedFrom": {
2020
+ "name": "FormAssociatedMixin",
2021
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2022
+ }
2048
2023
  },
2049
2024
  {
2050
2025
  "kind": "method",
2051
2026
  "name": "handleInput",
2052
- "privacy": "private",
2027
+ "privacy": "protected",
2053
2028
  "parameters": [
2054
2029
  {
2055
- "name": "event",
2030
+ "name": "e",
2056
2031
  "type": {
2057
- "text": "KeyboardEvent"
2032
+ "text": "Event"
2058
2033
  }
2059
2034
  }
2060
- ]
2035
+ ],
2036
+ "inheritedFrom": {
2037
+ "name": "FormAssociatedMixin",
2038
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2039
+ }
2061
2040
  },
2062
2041
  {
2063
2042
  "kind": "method",
2064
- "name": "select",
2065
- "privacy": "private",
2066
- "parameters": [
2067
- {
2068
- "name": "command",
2069
- "default": "this.selected",
2070
- "type": {
2071
- "text": "ICommandMenuAction"
2072
- }
2073
- }
2074
- ]
2043
+ "name": "renderLabel",
2044
+ "privacy": "protected",
2045
+ "inheritedFrom": {
2046
+ "name": "FormAssociatedMixin",
2047
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2048
+ }
2075
2049
  },
2076
2050
  {
2077
2051
  "kind": "method",
2078
- "name": "start",
2079
- "privacy": "private"
2052
+ "name": "renderHint",
2053
+ "privacy": "private",
2054
+ "inheritedFrom": {
2055
+ "name": "FormAssociatedMixin",
2056
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2057
+ }
2080
2058
  },
2081
2059
  {
2082
2060
  "kind": "method",
2083
- "name": "end",
2084
- "privacy": "private"
2061
+ "name": "renderError",
2062
+ "privacy": "protected",
2063
+ "inheritedFrom": {
2064
+ "name": "FormAssociatedMixin",
2065
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2066
+ }
2085
2067
  },
2086
2068
  {
2087
2069
  "kind": "method",
2088
- "name": "next",
2089
- "privacy": "private"
2070
+ "name": "getDescribedBy",
2071
+ "privacy": "protected",
2072
+ "inheritedFrom": {
2073
+ "name": "FormAssociatedMixin",
2074
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2075
+ }
2090
2076
  },
2091
2077
  {
2092
2078
  "kind": "method",
2093
- "name": "previous",
2094
- "privacy": "private"
2079
+ "name": "getInvalid",
2080
+ "privacy": "protected",
2081
+ "inheritedFrom": {
2082
+ "name": "FormAssociatedMixin",
2083
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2084
+ }
2095
2085
  },
2096
2086
  {
2097
- "kind": "method",
2098
- "name": "goBack",
2099
- "privacy": "private"
2087
+ "kind": "field",
2088
+ "name": "hasHint",
2089
+ "privacy": "protected",
2090
+ "inheritedFrom": {
2091
+ "name": "FormAssociatedMixin",
2092
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2093
+ }
2094
+ },
2095
+ {
2096
+ "kind": "field",
2097
+ "name": "hasError",
2098
+ "privacy": "protected",
2099
+ "inheritedFrom": {
2100
+ "name": "FormAssociatedMixin",
2101
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2102
+ }
2103
+ },
2104
+ {
2105
+ "kind": "field",
2106
+ "name": "disabled",
2107
+ "type": {
2108
+ "text": "boolean"
2109
+ },
2110
+ "default": "false",
2111
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
2112
+ "attribute": "disabled",
2113
+ "reflects": true,
2114
+ "inheritedFrom": {
2115
+ "name": "InputMixin",
2116
+ "module": "src/common/mixins/InputMixin.ts"
2117
+ }
2118
+ },
2119
+ {
2120
+ "kind": "field",
2121
+ "name": "name",
2122
+ "type": {
2123
+ "text": "string | undefined"
2124
+ },
2125
+ "description": "The name of the form component.",
2126
+ "attribute": "name",
2127
+ "inheritedFrom": {
2128
+ "name": "InputMixin",
2129
+ "module": "src/common/mixins/InputMixin.ts"
2130
+ }
2131
+ },
2132
+ {
2133
+ "kind": "field",
2134
+ "name": "value",
2135
+ "type": {
2136
+ "text": "string"
2137
+ },
2138
+ "default": "\"\"",
2139
+ "description": "The value of the form component.",
2140
+ "attribute": "value",
2141
+ "inheritedFrom": {
2142
+ "name": "InputMixin",
2143
+ "module": "src/common/mixins/InputMixin.ts"
2144
+ }
2145
+ },
2146
+ {
2147
+ "kind": "field",
2148
+ "name": "form",
2149
+ "privacy": "protected",
2150
+ "description": "Gets the form, if any, associated with the form element.",
2151
+ "inheritedFrom": {
2152
+ "name": "InputMixin",
2153
+ "module": "src/common/mixins/InputMixin.ts"
2154
+ }
2155
+ },
2156
+ {
2157
+ "kind": "field",
2158
+ "name": "focusableRef",
2159
+ "privacy": "protected",
2160
+ "inheritedFrom": {
2161
+ "name": "FocusableMixin",
2162
+ "module": "src/common/mixins/FocusableMixin.ts"
2163
+ }
2100
2164
  },
2101
2165
  {
2102
2166
  "kind": "method",
2103
- "name": "setParent",
2104
- "privacy": "private",
2167
+ "name": "focus",
2105
2168
  "parameters": [
2106
2169
  {
2107
- "name": "parent",
2170
+ "name": "options",
2108
2171
  "optional": true,
2109
2172
  "type": {
2110
- "text": "string"
2111
- }
2173
+ "text": "FocusOptions"
2174
+ },
2175
+ "description": "An object which controls aspects of the focusing process."
2112
2176
  }
2113
- ]
2177
+ ],
2178
+ "description": "Programmatically move focus to the component.",
2179
+ "inheritedFrom": {
2180
+ "name": "FocusableMixin",
2181
+ "module": "src/common/mixins/FocusableMixin.ts"
2182
+ }
2114
2183
  },
2115
2184
  {
2116
2185
  "kind": "method",
2117
- "name": "setSearch",
2118
- "privacy": "private",
2119
- "parameters": [
2120
- {
2121
- "name": "str",
2122
- "type": {
2123
- "text": "string"
2124
- }
2125
- }
2126
- ]
2186
+ "name": "blur",
2187
+ "description": "Programmatically remove focus from the component.",
2188
+ "inheritedFrom": {
2189
+ "name": "FocusableMixin",
2190
+ "module": "src/common/mixins/FocusableMixin.ts"
2191
+ }
2127
2192
  },
2128
2193
  {
2129
- "kind": "method",
2130
- "name": "filterCommands",
2131
- "privacy": "private"
2194
+ "kind": "method",
2195
+ "name": "click",
2196
+ "description": "Programmatically simulates a click on the component.",
2197
+ "inheritedFrom": {
2198
+ "name": "FocusableMixin",
2199
+ "module": "src/common/mixins/FocusableMixin.ts"
2200
+ }
2132
2201
  },
2133
2202
  {
2134
2203
  "kind": "field",
@@ -2145,222 +2214,191 @@
2145
2214
  }
2146
2215
  }
2147
2216
  ],
2148
- "events": [
2217
+ "attributes": [
2149
2218
  {
2150
- "name": "open",
2219
+ "name": "checked",
2151
2220
  "type": {
2152
- "text": "NordEvent"
2221
+ "text": "boolean"
2153
2222
  },
2154
- "description": "The command menu was opened foo."
2223
+ "default": "false",
2224
+ "description": "Controls whether the checkbox is checked or not.",
2225
+ "fieldName": "checked"
2155
2226
  },
2156
2227
  {
2157
- "name": "close",
2228
+ "name": "label",
2158
2229
  "type": {
2159
- "text": "NordEvent"
2230
+ "text": "string"
2160
2231
  },
2161
- "description": "The command menu was closed bar."
2232
+ "default": "\"\"",
2233
+ "description": "Label for the input.",
2234
+ "fieldName": "label",
2235
+ "inheritedFrom": {
2236
+ "name": "FormAssociatedMixin",
2237
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2238
+ }
2162
2239
  },
2163
2240
  {
2241
+ "name": "hint",
2164
2242
  "type": {
2165
- "text": "SelectEvent"
2243
+ "text": "string | undefined"
2166
2244
  },
2167
- "description": "User selected a command from the menu.",
2168
- "name": "n-select"
2169
- }
2170
- ],
2171
- "attributes": [
2245
+ "description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
2246
+ "fieldName": "hint",
2247
+ "inheritedFrom": {
2248
+ "name": "FormAssociatedMixin",
2249
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2250
+ }
2251
+ },
2172
2252
  {
2173
- "name": "open",
2253
+ "name": "hide-label",
2174
2254
  "type": {
2175
2255
  "text": "boolean"
2176
2256
  },
2177
2257
  "default": "false",
2178
- "description": "Show or hide the command menu.",
2179
- "fieldName": "open"
2258
+ "description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
2259
+ "fieldName": "hideLabel",
2260
+ "inheritedFrom": {
2261
+ "name": "FormAssociatedMixin",
2262
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2263
+ }
2180
2264
  },
2181
2265
  {
2182
2266
  "name": "placeholder",
2183
2267
  "type": {
2184
- "text": "string"
2268
+ "text": "string | undefined"
2185
2269
  },
2186
- "default": "\"Type a command or search...\"",
2187
- "description": "Hint text to display in the search field.",
2188
- "fieldName": "placeholder"
2189
- }
2190
- ],
2191
- "mixins": [
2192
- {
2193
- "name": "DraftComponentMixin",
2194
- "module": "/src/common/mixins/DraftComponentMixin.js"
2195
- }
2196
- ],
2197
- "superclass": {
2198
- "name": "LitElement",
2199
- "package": "lit"
2200
- },
2201
- "status": "draft",
2202
- "category": "action",
2203
- "tagName": "nord-command-menu",
2204
- "customElement": true
2205
- }
2206
- ],
2207
- "exports": [
2208
- {
2209
- "kind": "js",
2210
- "name": "default",
2211
- "declaration": {
2212
- "name": "CommandMenu",
2213
- "module": "src/command-menu/CommandMenu.ts"
2214
- }
2215
- },
2216
- {
2217
- "kind": "custom-element-definition",
2218
- "name": "nord-command-menu",
2219
- "declaration": {
2220
- "name": "CommandMenu",
2221
- "module": "src/command-menu/CommandMenu.ts"
2222
- }
2223
- }
2224
- ]
2225
- },
2226
- {
2227
- "kind": "javascript-module",
2228
- "path": "src/command-menu/CommandMenuAction.ts",
2229
- "declarations": [
2230
- {
2231
- "kind": "class",
2232
- "description": "Command Menu Action displays a single action that can be executed by the user. For usage examples, please see Command Menu component.",
2233
- "name": "CommandMenuAction",
2234
- "members": [
2270
+ "description": "Placeholder text to display within the input.",
2271
+ "fieldName": "placeholder",
2272
+ "inheritedFrom": {
2273
+ "name": "FormAssociatedMixin",
2274
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2275
+ }
2276
+ },
2235
2277
  {
2236
- "kind": "field",
2237
- "name": "command",
2278
+ "name": "error",
2238
2279
  "type": {
2239
- "text": "ICommandMenuAction"
2280
+ "text": "string | undefined"
2240
2281
  },
2241
- "attribute": "command"
2282
+ "description": "Optional error to be shown with the input. Alternatively use the error slot.",
2283
+ "fieldName": "error",
2284
+ "inheritedFrom": {
2285
+ "name": "FormAssociatedMixin",
2286
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2287
+ }
2242
2288
  },
2243
2289
  {
2244
- "kind": "field",
2245
- "name": "selected",
2290
+ "name": "required",
2246
2291
  "type": {
2247
2292
  "text": "boolean"
2248
2293
  },
2249
2294
  "default": "false",
2250
- "attribute": "selected"
2251
- },
2252
- {
2253
- "kind": "method",
2254
- "name": "ensureInView",
2255
- "privacy": "private",
2256
- "description": "Scroll to show element"
2295
+ "description": "Determines whether the input is required or not.\nAn input marked as required will be announced as such to users of assistive technology.\nWhen using this property you need to also set “novalidate” attribute on a form element to prevent browser from displaying its own validation errors.",
2296
+ "fieldName": "required",
2297
+ "inheritedFrom": {
2298
+ "name": "FormAssociatedMixin",
2299
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2300
+ }
2257
2301
  },
2258
2302
  {
2259
- "kind": "method",
2260
- "name": "renderShortcut",
2261
- "privacy": "private"
2262
- }
2263
- ],
2264
- "attributes": [
2265
- {
2266
- "name": "command",
2303
+ "name": "expand",
2267
2304
  "type": {
2268
- "text": "ICommandMenuAction"
2305
+ "text": "boolean"
2269
2306
  },
2270
- "fieldName": "command"
2307
+ "default": "false",
2308
+ "description": "Controls whether the input expands to fill the width of its container.",
2309
+ "fieldName": "expand",
2310
+ "inheritedFrom": {
2311
+ "name": "FormAssociatedMixin",
2312
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2313
+ }
2271
2314
  },
2272
2315
  {
2273
- "name": "selected",
2316
+ "name": "disabled",
2274
2317
  "type": {
2275
2318
  "text": "boolean"
2276
2319
  },
2277
2320
  "default": "false",
2278
- "fieldName": "selected"
2279
- }
2280
- ],
2281
- "superclass": {
2282
- "name": "LitElement",
2283
- "package": "lit"
2284
- },
2285
- "status": "internal",
2286
- "category": null,
2287
- "tagName": "nord-command-menu-action",
2288
- "customElement": true
2289
- }
2290
- ],
2291
- "exports": [
2292
- {
2293
- "kind": "js",
2294
- "name": "default",
2295
- "declaration": {
2296
- "name": "CommandMenuAction",
2297
- "module": "src/command-menu/CommandMenuAction.ts"
2298
- }
2299
- },
2300
- {
2301
- "kind": "custom-element-definition",
2302
- "name": "nord-command-menu-action",
2303
- "declaration": {
2304
- "name": "CommandMenuAction",
2305
- "module": "src/command-menu/CommandMenuAction.ts"
2306
- }
2307
- }
2308
- ]
2309
- },
2310
- {
2311
- "kind": "javascript-module",
2312
- "path": "src/command-menu/ICommandMenuAction.ts",
2313
- "declarations": [],
2314
- "exports": []
2315
- },
2316
- {
2317
- "kind": "javascript-module",
2318
- "path": "src/command-menu/KeyboardController.ts",
2319
- "declarations": [
2320
- {
2321
- "kind": "class",
2322
- "description": "",
2323
- "name": "KeyboardController",
2324
- "members": [
2321
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
2322
+ "fieldName": "disabled",
2323
+ "inheritedFrom": {
2324
+ "name": "InputMixin",
2325
+ "module": "src/common/mixins/InputMixin.ts"
2326
+ }
2327
+ },
2325
2328
  {
2326
- "kind": "field",
2327
- "name": "host",
2329
+ "name": "name",
2328
2330
  "type": {
2329
- "text": "CommandMenu"
2331
+ "text": "string | undefined"
2330
2332
  },
2331
- "privacy": "private",
2332
- "default": "host"
2333
+ "description": "The name of the form component.",
2334
+ "fieldName": "name",
2335
+ "inheritedFrom": {
2336
+ "name": "InputMixin",
2337
+ "module": "src/common/mixins/InputMixin.ts"
2338
+ }
2333
2339
  },
2334
2340
  {
2335
- "kind": "field",
2336
- "name": "globalShortcuts",
2341
+ "name": "value",
2337
2342
  "type": {
2338
- "text": "ShortcutController"
2343
+ "text": "string"
2339
2344
  },
2340
- "privacy": "private",
2341
- "default": "new ShortcutController(host, { \"$mod+k\": preventDefault(actions.toggleOpen) })"
2345
+ "default": "\"\"",
2346
+ "description": "The value of the form component.",
2347
+ "fieldName": "value",
2348
+ "inheritedFrom": {
2349
+ "name": "InputMixin",
2350
+ "module": "src/common/mixins/InputMixin.ts"
2351
+ }
2352
+ }
2353
+ ],
2354
+ "mixins": [
2355
+ {
2356
+ "name": "FormAssociatedMixin",
2357
+ "module": "/src/common/mixins/FormAssociatedMixin.js"
2358
+ },
2359
+ {
2360
+ "name": "InputMixin",
2361
+ "module": "/src/common/mixins/InputMixin.js"
2362
+ },
2363
+ {
2364
+ "name": "FocusableMixin",
2365
+ "module": "/src/common/mixins/FocusableMixin.js"
2342
2366
  },
2343
2367
  {
2344
- "kind": "field",
2345
- "name": "navigationShortcuts",
2368
+ "name": "DraftComponentMixin",
2369
+ "module": "/src/common/mixins/DraftComponentMixin.js"
2370
+ }
2371
+ ],
2372
+ "superclass": {
2373
+ "name": "LitElement",
2374
+ "package": "lit"
2375
+ },
2376
+ "status": "draft",
2377
+ "category": "form",
2378
+ "tagName": "nord-checkbox",
2379
+ "customElement": true,
2380
+ "events": [
2381
+ {
2382
+ "name": "input",
2346
2383
  "type": {
2347
- "text": "ShortcutController"
2384
+ "text": "NordEvent"
2348
2385
  },
2349
- "privacy": "private",
2350
- "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 )"
2386
+ "description": "Fired as the user types into the input.",
2387
+ "inheritedFrom": {
2388
+ "name": "FormAssociatedMixin",
2389
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2390
+ }
2351
2391
  },
2352
2392
  {
2353
- "kind": "field",
2354
- "name": "commandShortcuts",
2393
+ "name": "change",
2355
2394
  "type": {
2356
- "text": "ShortcutController"
2395
+ "text": "NordEvent"
2357
2396
  },
2358
- "privacy": "private",
2359
- "default": "new ShortcutController(host)"
2360
- },
2361
- {
2362
- "kind": "method",
2363
- "name": "registerCommandShortcuts"
2397
+ "description": "Fired whenever the input's value is changed via user interaction.",
2398
+ "inheritedFrom": {
2399
+ "name": "FormAssociatedMixin",
2400
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
2401
+ }
2364
2402
  }
2365
2403
  ]
2366
2404
  }
@@ -2368,48 +2406,22 @@
2368
2406
  "exports": [
2369
2407
  {
2370
2408
  "kind": "js",
2371
- "name": "KeyboardController",
2409
+ "name": "default",
2372
2410
  "declaration": {
2373
- "name": "KeyboardController",
2374
- "module": "src/command-menu/KeyboardController.ts"
2375
- }
2376
- }
2377
- ]
2378
- },
2379
- {
2380
- "kind": "javascript-module",
2381
- "path": "src/command-menu/events.ts",
2382
- "declarations": [
2383
- {
2384
- "kind": "class",
2385
- "description": "",
2386
- "name": "SelectEvent",
2387
- "members": [
2388
- {
2389
- "kind": "field",
2390
- "name": "command",
2391
- "type": {
2392
- "text": "ICommandMenuAction"
2393
- },
2394
- "default": "command"
2395
- }
2396
- ],
2397
- "superclass": {
2398
- "name": "NordEvent",
2399
- "module": "/src/common/events.js"
2411
+ "name": "Checkbox",
2412
+ "module": "src/checkbox/Checkbox.ts"
2400
2413
  }
2401
- }
2402
- ],
2403
- "exports": [
2414
+ },
2404
2415
  {
2405
- "kind": "js",
2406
- "name": "SelectEvent",
2416
+ "kind": "custom-element-definition",
2417
+ "name": "nord-checkbox",
2407
2418
  "declaration": {
2408
- "name": "SelectEvent",
2409
- "module": "src/command-menu/events.ts"
2419
+ "name": "Checkbox",
2420
+ "module": "src/checkbox/Checkbox.ts"
2410
2421
  }
2411
2422
  }
2412
- ]
2423
+ ],
2424
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use for making it possible to choose one or more options from a limited number of options.\n- Use for “accepting terms of service” and similar functionality.\n- Use in forms to toggle something on or off.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use when you have more than 10 options to choose from.\n- Don’t change the selection of another checkbox when another one is clicked. Only exception is when a checkbox is used to make a bulk selection of multiple items.\n\n</div>\n\n---\n\n## Content guidelines\n\nCheckbox labels should be clear, accurate and predictable. It should be possible for the user to understand what they are selecting:\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">Option 1</div>\n\nWhen writing checkbox labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">User Settings</div>\n\nAvoid ending in punctuation if it’s a single sentence, word, or a fragment:\n\n<div class=\"n-usage n-usage-do\">Show dashboard</div>\n<div class=\"n-usage n-usage-dont\">Show dashboard.</div>\n\nDo not use commas or semicolons at the end of each line\n\n<div class=\"n-usage n-usage-do\">Patients</div>\n<div class=\"n-usage n-usage-dont\">Patients;</div>\n"
2413
2425
  },
2414
2426
  {
2415
2427
  "kind": "javascript-module",
@@ -3349,7 +3361,7 @@
3349
3361
  "text": "string"
3350
3362
  },
3351
3363
  "default": "\"\"",
3352
- "description": "Date value. Must be in IS0-8601 format: YYYY-MM-DD",
3364
+ "description": "Date value. Must be in IS0-8601 format: YYYY-MM-DD.",
3353
3365
  "attribute": "value",
3354
3366
  "inheritedFrom": {
3355
3367
  "name": "InputMixin",
@@ -3788,7 +3800,7 @@
3788
3800
  "text": "boolean"
3789
3801
  },
3790
3802
  "default": "false",
3791
- "description": "Makes the input component disabled.\nThis prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies.",
3803
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
3792
3804
  "attribute": "disabled",
3793
3805
  "reflects": true,
3794
3806
  "inheritedFrom": {
@@ -3802,7 +3814,7 @@
3802
3814
  "type": {
3803
3815
  "text": "string | undefined"
3804
3816
  },
3805
- "description": "The name of the input component.",
3817
+ "description": "The name of the form component.",
3806
3818
  "attribute": "name",
3807
3819
  "inheritedFrom": {
3808
3820
  "name": "InputMixin",
@@ -3813,7 +3825,7 @@
3813
3825
  "kind": "field",
3814
3826
  "name": "form",
3815
3827
  "privacy": "protected",
3816
- "description": "Gets the form, if any, associated with the input element.",
3828
+ "description": "Gets the form, if any, associated with the form element.",
3817
3829
  "inheritedFrom": {
3818
3830
  "name": "InputMixin",
3819
3831
  "module": "src/common/mixins/InputMixin.ts"
@@ -3841,7 +3853,7 @@
3841
3853
  "description": "An object which controls aspects of the focusing process."
3842
3854
  }
3843
3855
  ],
3844
- "description": "Programmatically move focus to the component",
3856
+ "description": "Programmatically move focus to the component.",
3845
3857
  "inheritedFrom": {
3846
3858
  "name": "FocusableMixin",
3847
3859
  "module": "src/common/mixins/FocusableMixin.ts"
@@ -3925,7 +3937,7 @@
3925
3937
  "text": "string"
3926
3938
  },
3927
3939
  "default": "\"\"",
3928
- "description": "Date value. Must be in IS0-8601 format: YYYY-MM-DD",
3940
+ "description": "Date value. Must be in IS0-8601 format: YYYY-MM-DD.",
3929
3941
  "fieldName": "value",
3930
3942
  "inheritedFrom": {
3931
3943
  "name": "InputMixin",
@@ -4061,7 +4073,7 @@
4061
4073
  "text": "boolean"
4062
4074
  },
4063
4075
  "default": "false",
4064
- "description": "Makes the input component disabled.\nThis prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies.",
4076
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
4065
4077
  "fieldName": "disabled",
4066
4078
  "inheritedFrom": {
4067
4079
  "name": "InputMixin",
@@ -4073,7 +4085,7 @@
4073
4085
  "type": {
4074
4086
  "text": "string | undefined"
4075
4087
  },
4076
- "description": "The name of the input component.",
4088
+ "description": "The name of the form component.",
4077
4089
  "fieldName": "name",
4078
4090
  "inheritedFrom": {
4079
4091
  "name": "InputMixin",
@@ -4126,7 +4138,8 @@
4126
4138
  "module": "src/date-picker/DatePicker.ts"
4127
4139
  }
4128
4140
  }
4129
- ]
4141
+ ],
4142
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use to choose a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nDate picker is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Choose date button\n\n- `Space, Enter`: Opens the date picker dialog and moves focus to the first select menu in the dialog.\n\n### Date picker dialog\n\n- `Esc`: Closes the date picker dialog and moves focus back to the “choose date” button.\n- `Tab`: Moves focus to the next element in the dialog. Please note since the calendar uses `role=\"grid\"`, only one button in the calendar grid is in the tab sequence. Additionally, if focus is on the last focusable element, focus is next moved back to the first focusable element inside the date picker dialog.\n- `Shift + Tab`: Same as above, but in reverse order.\n\n### Date picker dialog: Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Date picker dialog: Date grid\n\n- `Space, Enter`: Selects a date, closes the dialog, and moves focus back to the “Choose Date” button. Additionally updates the value of the date picker input with the selected date, and adds selected date to “Choose Date” button label.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n\n#### Date picker dialog: Close button\n\n- `Space, Enter`: Closes the dialog, moves focus to “choose date” button, but does not update the date in input.\n"
4130
4143
  },
4131
4144
  {
4132
4145
  "kind": "javascript-module",
@@ -4150,7 +4163,8 @@
4150
4163
  "module": "src/date-picker/date-adapter.ts"
4151
4164
  }
4152
4165
  }
4153
- ]
4166
+ ],
4167
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use to choose a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nDate picker is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Choose date button\n\n- `Space, Enter`: Opens the date picker dialog and moves focus to the first select menu in the dialog.\n\n### Date picker dialog\n\n- `Esc`: Closes the date picker dialog and moves focus back to the “choose date” button.\n- `Tab`: Moves focus to the next element in the dialog. Please note since the calendar uses `role=\"grid\"`, only one button in the calendar grid is in the tab sequence. Additionally, if focus is on the last focusable element, focus is next moved back to the first focusable element inside the date picker dialog.\n- `Shift + Tab`: Same as above, but in reverse order.\n\n### Date picker dialog: Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Date picker dialog: Date grid\n\n- `Space, Enter`: Selects a date, closes the dialog, and moves focus back to the “Choose Date” button. Additionally updates the value of the date picker input with the selected date, and adds selected date to “Choose Date” button label.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n\n#### Date picker dialog: Close button\n\n- `Space, Enter`: Closes the dialog, moves focus to “choose date” button, but does not update the date in input.\n"
4154
4168
  },
4155
4169
  {
4156
4170
  "kind": "javascript-module",
@@ -4174,7 +4188,8 @@
4174
4188
  "module": "src/date-picker/date-localization.ts"
4175
4189
  }
4176
4190
  }
4177
- ]
4191
+ ],
4192
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use to choose a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nDate picker is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Choose date button\n\n- `Space, Enter`: Opens the date picker dialog and moves focus to the first select menu in the dialog.\n\n### Date picker dialog\n\n- `Esc`: Closes the date picker dialog and moves focus back to the “choose date” button.\n- `Tab`: Moves focus to the next element in the dialog. Please note since the calendar uses `role=\"grid\"`, only one button in the calendar grid is in the tab sequence. Additionally, if focus is on the last focusable element, focus is next moved back to the first focusable element inside the date picker dialog.\n- `Shift + Tab`: Same as above, but in reverse order.\n\n### Date picker dialog: Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Date picker dialog: Date grid\n\n- `Space, Enter`: Selects a date, closes the dialog, and moves focus back to the “Choose Date” button. Additionally updates the value of the date picker input with the selected date, and adds selected date to “Choose Date” button label.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n\n#### Date picker dialog: Close button\n\n- `Space, Enter`: Closes the dialog, moves focus to “choose date” button, but does not update the date in input.\n"
4178
4193
  },
4179
4194
  {
4180
4195
  "kind": "javascript-module",
@@ -4665,7 +4680,8 @@
4665
4680
  "module": "src/icon/Icon.ts"
4666
4681
  }
4667
4682
  }
4668
- ]
4683
+ ],
4684
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide additional meaning in addition to a text label.\n- Use to help users who have difficulties with reading and attention.\n- Use in places where text label doesn’t fit (remember to add an accessible label for the icon).\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for decorative purposes alone.\n- Don’t use when a button’s action is already clear based on the text label.\n- Don’t use the same icon for differing purposes, as users will come to associate icons with specific types of actions.\n\n</div>\n\n---\n\n## Additional considerations\n\n- Icon components are hidden from assistive technologies by default.\n- Use `label` property to give an accessible label for the icon and to make it visible to assistive technologies.\n"
4669
4685
  },
4670
4686
  {
4671
4687
  "kind": "javascript-module",
@@ -5003,7 +5019,7 @@
5003
5019
  "text": "boolean"
5004
5020
  },
5005
5021
  "default": "false",
5006
- "description": "Makes the input component disabled.\nThis prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies.",
5022
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
5007
5023
  "attribute": "disabled",
5008
5024
  "reflects": true,
5009
5025
  "inheritedFrom": {
@@ -5017,7 +5033,7 @@
5017
5033
  "type": {
5018
5034
  "text": "string | undefined"
5019
5035
  },
5020
- "description": "The name of the input component.",
5036
+ "description": "The name of the form component.",
5021
5037
  "attribute": "name",
5022
5038
  "inheritedFrom": {
5023
5039
  "name": "InputMixin",
@@ -5031,7 +5047,7 @@
5031
5047
  "text": "string"
5032
5048
  },
5033
5049
  "default": "\"\"",
5034
- "description": "The value of the input component.",
5050
+ "description": "The value of the form component.",
5035
5051
  "attribute": "value",
5036
5052
  "inheritedFrom": {
5037
5053
  "name": "InputMixin",
@@ -5042,7 +5058,7 @@
5042
5058
  "kind": "field",
5043
5059
  "name": "form",
5044
5060
  "privacy": "protected",
5045
- "description": "Gets the form, if any, associated with the input element.",
5061
+ "description": "Gets the form, if any, associated with the form element.",
5046
5062
  "inheritedFrom": {
5047
5063
  "name": "InputMixin",
5048
5064
  "module": "src/common/mixins/InputMixin.ts"
@@ -5070,7 +5086,7 @@
5070
5086
  "description": "An object which controls aspects of the focusing process."
5071
5087
  }
5072
5088
  ],
5073
- "description": "Programmatically move focus to the component",
5089
+ "description": "Programmatically move focus to the component.",
5074
5090
  "inheritedFrom": {
5075
5091
  "name": "FocusableMixin",
5076
5092
  "module": "src/common/mixins/FocusableMixin.ts"
@@ -5213,7 +5229,7 @@
5213
5229
  "text": "boolean"
5214
5230
  },
5215
5231
  "default": "false",
5216
- "description": "Makes the input component disabled.\nThis prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies.",
5232
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
5217
5233
  "fieldName": "disabled",
5218
5234
  "inheritedFrom": {
5219
5235
  "name": "InputMixin",
@@ -5225,7 +5241,7 @@
5225
5241
  "type": {
5226
5242
  "text": "string | undefined"
5227
5243
  },
5228
- "description": "The name of the input component.",
5244
+ "description": "The name of the form component.",
5229
5245
  "fieldName": "name",
5230
5246
  "inheritedFrom": {
5231
5247
  "name": "InputMixin",
@@ -5238,7 +5254,7 @@
5238
5254
  "text": "string"
5239
5255
  },
5240
5256
  "default": "\"\"",
5241
- "description": "The value of the input component.",
5257
+ "description": "The value of the form component.",
5242
5258
  "fieldName": "value",
5243
5259
  "inheritedFrom": {
5244
5260
  "name": "InputMixin",
@@ -5315,27 +5331,24 @@
5315
5331
  "module": "src/input/Input.ts"
5316
5332
  }
5317
5333
  }
5318
- ]
5334
+ ],
5335
+ "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 a text input where the expected input is short.\n- Use to only ask for information that’s really needed. Hide optional fields by default if possible or have them shown with a lower priority.\n- Use help text and placeholder to provide additional, non-critical instructions.\n- Validate input as soon as users have finished interacting with them (but not before).\n- Where necessary, label the input as “Optional” when you need to request input that’s not required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use when the expected text input is long. Use textarea component instead.\n- Don’t use the placeholder to provide information that’s required to use the input. Hint text should be used for this purpose instead.\n\n</div>\n\n---\n\n## Content guidelines\n\nInput labels act as a title for the text field. Labels should typically be short and in noun 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 input 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\nWhen an input isn’t part of a form and is placed individually on a page, you could provide the input label as a call to action:\n\n<div class=\"n-usage n-usage-do\">Leave a comment</div>\n<div class=\"n-usage n-usage-dont\">Comment</div>\n\nDo not use colons in input label:\n\n<div class=\"n-usage n-usage-do\">First name</div>\n<div class=\"n-usage n-usage-dont\">First name:</div>\n\n---\n\n## Types\n\nThis section describes the different input types, their purpose, and when to use each type.\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `text` | The default and most common variant. Displayed as a single-line text field. Line-breaks are automatically removed from the input value. |\n| `email` | A field for editing an email address. Looks similar to a text input, but has validation parameters and relevant keyboard for devices with dynamic keyboards. |\n| `password` | A single-line text field where the value is obscured. This type will alert user if a site is not secure. |\n| `tel` | A field for entering a telephone number. Displays a number keypad on mobile devices. |\n| `url` | A field variant that is used to let the user enter and edit an URL. |\n| `search` | A single-line text field for entering search strings. |\n| `number` | Used to let the user enter a number. |\n"
5319
5336
  },
5320
5337
  {
5321
5338
  "kind": "javascript-module",
5322
- "path": "src/select/Select.ts",
5339
+ "path": "src/radio/Radio.ts",
5323
5340
  "declarations": [
5324
5341
  {
5325
5342
  "kind": "class",
5326
- "description": "Select lets users choose one option from an options menu.\nConsider using select when you have 5 or more options to choose from.",
5327
- "name": "Select",
5343
+ "description": "Radio buttons are graphical user interface elements that allow user to choose only one option from\na predefined set of mutually exclusive options.",
5344
+ "name": "Radio",
5328
5345
  "slots": [
5329
- {
5330
- "description": "Default slot for holding <option> elements.",
5331
- "name": ""
5332
- },
5333
5346
  {
5334
5347
  "description": "Use when a label requires more than plain text.",
5335
5348
  "name": "label"
5336
5349
  },
5337
5350
  {
5338
- "description": "Use when a hint requires more than plain text.",
5351
+ "description": "Optional slot that holds hint text for the input.",
5339
5352
  "name": "hint"
5340
5353
  },
5341
5354
  {
@@ -5346,8 +5359,12 @@
5346
5359
  "members": [
5347
5360
  {
5348
5361
  "kind": "field",
5349
- "name": "formValue",
5362
+ "name": "inputId",
5363
+ "type": {
5364
+ "text": "string"
5365
+ },
5350
5366
  "privacy": "protected",
5367
+ "default": "\"input\"",
5351
5368
  "inheritedFrom": {
5352
5369
  "name": "FormAssociatedMixin",
5353
5370
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -5355,18 +5372,12 @@
5355
5372
  },
5356
5373
  {
5357
5374
  "kind": "field",
5358
- "name": "defaultSlot",
5359
- "privacy": "private",
5360
- "default": "new SlotController(this)"
5361
- },
5362
- {
5363
- "kind": "field",
5364
- "name": "inputId",
5375
+ "name": "hintId",
5365
5376
  "type": {
5366
5377
  "text": "string"
5367
5378
  },
5368
5379
  "privacy": "protected",
5369
- "default": "\"select\"",
5380
+ "default": "\"hint\"",
5370
5381
  "inheritedFrom": {
5371
5382
  "name": "FormAssociatedMixin",
5372
5383
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -5374,45 +5385,23 @@
5374
5385
  },
5375
5386
  {
5376
5387
  "kind": "field",
5377
- "name": "options",
5378
- "privacy": "private"
5379
- },
5380
- {
5381
- "kind": "method",
5382
- "name": "getButtonText",
5383
- "privacy": "private",
5384
- "return": {
5385
- "type": {
5386
- "text": "string"
5387
- }
5388
+ "name": "errorId",
5389
+ "type": {
5390
+ "text": "string"
5388
5391
  },
5389
- "parameters": [
5390
- {
5391
- "name": "options",
5392
- "type": {
5393
- "text": "HTMLOptionElement[]"
5394
- }
5395
- }
5396
- ]
5397
- },
5398
- {
5399
- "kind": "method",
5400
- "name": "renderOption",
5401
- "privacy": "private",
5402
- "parameters": [
5403
- {
5404
- "name": "option",
5405
- "type": {
5406
- "text": "HTMLOptionElement"
5407
- }
5408
- }
5409
- ]
5392
+ "privacy": "protected",
5393
+ "default": "\"error\"",
5394
+ "inheritedFrom": {
5395
+ "name": "FormAssociatedMixin",
5396
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
5397
+ }
5410
5398
  },
5411
5399
  {
5412
5400
  "kind": "field",
5413
- "name": "labelSlot",
5401
+ "name": "hintSlot",
5414
5402
  "privacy": "protected",
5415
- "default": "new SlotController(this, \"label\")",
5403
+ "default": "new LightSlotController(this, {\n slotName: \"hint\",\n render: () => (this.hint ? html`<div slot=\"hint-internal\" id=${this.hintId}>${this.hint}</div>` : nothing),\n syncLightDom: element => {\n element.id = this.hintId\n },\n })",
5404
+ "description": "For accessibility reasons, we render some parts of the component to the light DOM.",
5416
5405
  "inheritedFrom": {
5417
5406
  "name": "FormAssociatedMixin",
5418
5407
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -5420,9 +5409,9 @@
5420
5409
  },
5421
5410
  {
5422
5411
  "kind": "field",
5423
- "name": "errorSlot",
5412
+ "name": "labelSlot",
5424
5413
  "privacy": "protected",
5425
- "default": "new SlotController(this, \"error\")",
5414
+ "default": "new LightSlotController(this, {\n slotName: \"label\",\n render: () => (this.label ? html`<label slot=\"label-internal\" for=${this.inputId}>${this.label}</label>` : nothing),\n syncLightDom: element => {\n if (!isLabel(element)) {\n // eslint-disable-next-line no-console\n console.warn(`NORD: Only <label> elements should be placed in radio's \"label\" slot`)\n } else {\n element.htmlFor = this.inputId\n }\n },\n })",
5426
5415
  "inheritedFrom": {
5427
5416
  "name": "FormAssociatedMixin",
5428
5417
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -5430,9 +5419,9 @@
5430
5419
  },
5431
5420
  {
5432
5421
  "kind": "field",
5433
- "name": "hintSlot",
5422
+ "name": "errorSlot",
5434
5423
  "privacy": "protected",
5435
- "default": "new SlotController(this, \"hint\")",
5424
+ "default": "new LightSlotController(this, {\n slotName: \"error\",\n render: () => (this.error ? html`<div slot=\"error-internal\" id=${this.errorId}>${this.error}</div>` : nothing),\n syncLightDom: element => {\n element.id = this.hintId\n },\n })",
5436
5425
  "inheritedFrom": {
5437
5426
  "name": "FormAssociatedMixin",
5438
5427
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -5440,9 +5429,14 @@
5440
5429
  },
5441
5430
  {
5442
5431
  "kind": "field",
5443
- "name": "formData",
5432
+ "name": "inputSlot",
5433
+ "privacy": "protected",
5434
+ "default": "new LightDomController(this, {\n render: () =>\n html`\n <input\n slot=\"input\"\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n ${ref(this.focusableRef)}\n class=\"n-input\"\n id=${this.inputId}\n type=\"radio\"\n name=${ifDefined(this.name)}\n .value=${this.value}\n .checked=${this.checked}\n ?disabled=${this.disabled}\n ?required=${this.required}\n aria-describedby=${ifDefined(this.getDescribedBy())}\n aria-invalid=${ifDefined(this.getInvalid())}\n />\n `,\n })"
5435
+ },
5436
+ {
5437
+ "kind": "field",
5438
+ "name": "formValue",
5444
5439
  "privacy": "protected",
5445
- "default": "new FormDataController(this, { value: () => this.formValue })",
5446
5440
  "inheritedFrom": {
5447
5441
  "name": "FormAssociatedMixin",
5448
5442
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -5450,12 +5444,37 @@
5450
5444
  },
5451
5445
  {
5452
5446
  "kind": "field",
5453
- "name": "errorId",
5447
+ "name": "checked",
5454
5448
  "type": {
5455
- "text": "string"
5449
+ "text": "boolean"
5456
5450
  },
5451
+ "default": "false",
5452
+ "description": "Controls whether the checkbox is checked or not.",
5453
+ "attribute": "checked",
5454
+ "reflects": true
5455
+ },
5456
+ {
5457
+ "kind": "method",
5458
+ "name": "uncheckSiblings",
5459
+ "privacy": "private"
5460
+ },
5461
+ {
5462
+ "kind": "method",
5463
+ "name": "handleChange",
5457
5464
  "privacy": "protected",
5458
- "default": "\"error\"",
5465
+ "return": {
5466
+ "type": {
5467
+ "text": "void"
5468
+ }
5469
+ },
5470
+ "parameters": [
5471
+ {
5472
+ "name": "e",
5473
+ "type": {
5474
+ "text": "Event"
5475
+ }
5476
+ }
5477
+ ],
5459
5478
  "inheritedFrom": {
5460
5479
  "name": "FormAssociatedMixin",
5461
5480
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -5463,12 +5482,19 @@
5463
5482
  },
5464
5483
  {
5465
5484
  "kind": "field",
5466
- "name": "hintId",
5467
- "type": {
5468
- "text": "string"
5469
- },
5485
+ "name": "handleBlur",
5486
+ "privacy": "private"
5487
+ },
5488
+ {
5489
+ "kind": "field",
5490
+ "name": "handleFocus",
5491
+ "privacy": "private"
5492
+ },
5493
+ {
5494
+ "kind": "field",
5495
+ "name": "formData",
5470
5496
  "privacy": "protected",
5471
- "default": "\"hint\"",
5497
+ "default": "new FormDataController(this, { value: () => this.formValue })",
5472
5498
  "inheritedFrom": {
5473
5499
  "name": "FormAssociatedMixin",
5474
5500
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -5587,15 +5613,6 @@
5587
5613
  "module": "src/common/mixins/FormAssociatedMixin.ts"
5588
5614
  }
5589
5615
  },
5590
- {
5591
- "kind": "method",
5592
- "name": "handleChange",
5593
- "privacy": "protected",
5594
- "inheritedFrom": {
5595
- "name": "FormAssociatedMixin",
5596
- "module": "src/common/mixins/FormAssociatedMixin.ts"
5597
- }
5598
- },
5599
5616
  {
5600
5617
  "kind": "method",
5601
5618
  "name": "renderLabel",
@@ -5666,7 +5683,7 @@
5666
5683
  "text": "boolean"
5667
5684
  },
5668
5685
  "default": "false",
5669
- "description": "Makes the input component disabled.\nThis prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies.",
5686
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
5670
5687
  "attribute": "disabled",
5671
5688
  "reflects": true,
5672
5689
  "inheritedFrom": {
@@ -5680,7 +5697,7 @@
5680
5697
  "type": {
5681
5698
  "text": "string | undefined"
5682
5699
  },
5683
- "description": "The name of the input component.",
5700
+ "description": "The name of the form component.",
5684
5701
  "attribute": "name",
5685
5702
  "inheritedFrom": {
5686
5703
  "name": "InputMixin",
@@ -5694,7 +5711,7 @@
5694
5711
  "text": "string"
5695
5712
  },
5696
5713
  "default": "\"\"",
5697
- "description": "The value of the input component.",
5714
+ "description": "The value of the form component.",
5698
5715
  "attribute": "value",
5699
5716
  "inheritedFrom": {
5700
5717
  "name": "InputMixin",
@@ -5705,7 +5722,7 @@
5705
5722
  "kind": "field",
5706
5723
  "name": "form",
5707
5724
  "privacy": "protected",
5708
- "description": "Gets the form, if any, associated with the input element.",
5725
+ "description": "Gets the form, if any, associated with the form element.",
5709
5726
  "inheritedFrom": {
5710
5727
  "name": "InputMixin",
5711
5728
  "module": "src/common/mixins/InputMixin.ts"
@@ -5733,7 +5750,7 @@
5733
5750
  "description": "An object which controls aspects of the focusing process."
5734
5751
  }
5735
5752
  ],
5736
- "description": "Programmatically move focus to the component",
5753
+ "description": "Programmatically move focus to the component.",
5737
5754
  "inheritedFrom": {
5738
5755
  "name": "FocusableMixin",
5739
5756
  "module": "src/common/mixins/FocusableMixin.ts"
@@ -5772,33 +5789,16 @@
5772
5789
  }
5773
5790
  }
5774
5791
  ],
5775
- "mixins": [
5776
- {
5777
- "name": "FormAssociatedMixin",
5778
- "module": "/src/common/mixins/FormAssociatedMixin.js"
5779
- },
5780
- {
5781
- "name": "InputMixin",
5782
- "module": "/src/common/mixins/InputMixin.js"
5783
- },
5784
- {
5785
- "name": "FocusableMixin",
5786
- "module": "/src/common/mixins/FocusableMixin.js"
5787
- },
5788
- {
5789
- "name": "DraftComponentMixin",
5790
- "module": "/src/common/mixins/DraftComponentMixin.js"
5791
- }
5792
- ],
5793
- "superclass": {
5794
- "name": "LitElement",
5795
- "package": "lit"
5796
- },
5797
- "status": "draft",
5798
- "category": "form",
5799
- "tagName": "nord-select",
5800
- "customElement": true,
5801
5792
  "attributes": [
5793
+ {
5794
+ "name": "checked",
5795
+ "type": {
5796
+ "text": "boolean"
5797
+ },
5798
+ "default": "false",
5799
+ "description": "Controls whether the checkbox is checked or not.",
5800
+ "fieldName": "checked"
5801
+ },
5802
5802
  {
5803
5803
  "name": "label",
5804
5804
  "type": {
@@ -5893,7 +5893,7 @@
5893
5893
  "text": "boolean"
5894
5894
  },
5895
5895
  "default": "false",
5896
- "description": "Makes the input component disabled.\nThis prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies.",
5896
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
5897
5897
  "fieldName": "disabled",
5898
5898
  "inheritedFrom": {
5899
5899
  "name": "InputMixin",
@@ -5905,7 +5905,7 @@
5905
5905
  "type": {
5906
5906
  "text": "string | undefined"
5907
5907
  },
5908
- "description": "The name of the input component.",
5908
+ "description": "The name of the form component.",
5909
5909
  "fieldName": "name",
5910
5910
  "inheritedFrom": {
5911
5911
  "name": "InputMixin",
@@ -5918,7 +5918,7 @@
5918
5918
  "text": "string"
5919
5919
  },
5920
5920
  "default": "\"\"",
5921
- "description": "The value of the input component.",
5921
+ "description": "The value of the form component.",
5922
5922
  "fieldName": "value",
5923
5923
  "inheritedFrom": {
5924
5924
  "name": "InputMixin",
@@ -5926,6 +5926,32 @@
5926
5926
  }
5927
5927
  }
5928
5928
  ],
5929
+ "mixins": [
5930
+ {
5931
+ "name": "FormAssociatedMixin",
5932
+ "module": "/src/common/mixins/FormAssociatedMixin.js"
5933
+ },
5934
+ {
5935
+ "name": "InputMixin",
5936
+ "module": "/src/common/mixins/InputMixin.js"
5937
+ },
5938
+ {
5939
+ "name": "FocusableMixin",
5940
+ "module": "/src/common/mixins/FocusableMixin.js"
5941
+ },
5942
+ {
5943
+ "name": "DraftComponentMixin",
5944
+ "module": "/src/common/mixins/DraftComponentMixin.js"
5945
+ }
5946
+ ],
5947
+ "superclass": {
5948
+ "name": "LitElement",
5949
+ "package": "lit"
5950
+ },
5951
+ "status": "draft",
5952
+ "category": "form",
5953
+ "tagName": "nord-radio",
5954
+ "customElement": true,
5929
5955
  "events": [
5930
5956
  {
5931
5957
  "name": "input",
@@ -5957,152 +5983,40 @@
5957
5983
  "kind": "js",
5958
5984
  "name": "default",
5959
5985
  "declaration": {
5960
- "name": "Select",
5961
- "module": "src/select/Select.ts"
5986
+ "name": "Radio",
5987
+ "module": "src/radio/Radio.ts"
5962
5988
  }
5963
5989
  },
5964
5990
  {
5965
5991
  "kind": "custom-element-definition",
5966
- "name": "nord-select",
5992
+ "name": "nord-radio",
5967
5993
  "declaration": {
5968
- "name": "Select",
5969
- "module": "src/select/Select.ts"
5994
+ "name": "Radio",
5995
+ "module": "src/radio/Radio.ts"
5970
5996
  }
5971
5997
  }
5972
- ]
5973
- },
5974
- {
5975
- "kind": "javascript-module",
5976
- "path": "src/spinner/Spinner.ts",
5977
- "declarations": [
5978
- {
5979
- "kind": "class",
5980
- "description": "Spinner component is used to indicate users that their action is being\nprocessed. You can customize the size and color of the spinner with the\nprovided properties.",
5981
- "name": "Spinner",
5982
- "members": [
5983
- {
5984
- "kind": "field",
5985
- "name": "size",
5986
- "type": {
5987
- "text": "\"xs\" | \"s\" | \"m\" | \"l\" | \"xl\" | \"xxl\""
5988
- },
5989
- "default": "\"m\"",
5990
- "description": "The size of the spinner.",
5991
- "attribute": "size",
5992
- "reflects": true
5993
- },
5994
- {
5995
- "kind": "field",
5996
- "name": "color",
5997
- "type": {
5998
- "text": "string | undefined"
5999
- },
6000
- "description": "The color of the spinner.\nCan accept any valid CSS color value, including custom properties.",
6001
- "attribute": "color",
6002
- "reflects": true
6003
- },
6004
- {
6005
- "kind": "field",
6006
- "name": "label",
6007
- "type": {
6008
- "text": "string | undefined"
6009
- },
6010
- "description": "An accessible label for the spinner.\nIf no label is supplied, the spinner is hidden from assistive technology.",
6011
- "attribute": "label",
6012
- "reflects": true
6013
- },
6014
- {
6015
- "kind": "field",
6016
- "name": "_warningLogged",
6017
- "type": {
6018
- "text": "boolean"
6019
- },
6020
- "privacy": "private",
6021
- "static": true,
6022
- "default": "false",
6023
- "inheritedFrom": {
6024
- "name": "DraftComponentMixin",
6025
- "module": "src/common/mixins/DraftComponentMixin.ts"
6026
- }
6027
- }
6028
- ],
6029
- "attributes": [
6030
- {
6031
- "name": "size",
6032
- "type": {
6033
- "text": "\"xs\" | \"s\" | \"m\" | \"l\" | \"xl\" | \"xxl\""
6034
- },
6035
- "default": "\"m\"",
6036
- "description": "The size of the spinner.",
6037
- "fieldName": "size"
6038
- },
6039
- {
6040
- "name": "color",
6041
- "type": {
6042
- "text": "string | undefined"
6043
- },
6044
- "description": "The color of the spinner.\nCan accept any valid CSS color value, including custom properties.",
6045
- "fieldName": "color"
6046
- },
6047
- {
6048
- "name": "label",
6049
- "type": {
6050
- "text": "string | undefined"
6051
- },
6052
- "description": "An accessible label for the spinner.\nIf no label is supplied, the spinner is hidden from assistive technology.",
6053
- "fieldName": "label"
6054
- }
6055
- ],
6056
- "mixins": [
6057
- {
6058
- "name": "DraftComponentMixin",
6059
- "module": "/src/common/mixins/DraftComponentMixin.js"
6060
- }
6061
- ],
6062
- "superclass": {
6063
- "name": "LitElement",
6064
- "package": "lit"
6065
- },
6066
- "status": "draft",
6067
- "category": "feedback",
6068
- "tagName": "nord-spinner",
6069
- "customElement": true
6070
- }
6071
5998
  ],
6072
- "exports": [
6073
- {
6074
- "kind": "js",
6075
- "name": "default",
6076
- "declaration": {
6077
- "name": "Spinner",
6078
- "module": "src/spinner/Spinner.ts"
6079
- }
6080
- },
6081
- {
6082
- "kind": "custom-element-definition",
6083
- "name": "nord-spinner",
6084
- "declaration": {
6085
- "name": "Spinner",
6086
- "module": "src/spinner/Spinner.ts"
6087
- }
6088
- }
6089
- ]
5999
+ "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 a radio component when users can only select one option from a list.\n- Favour radios over a select component when there are a small number of options. This reduces the number of clicks a user has to make, increasing efficiency.\n- Radio buttons are grouped by their `name` attribute. Therefore, it is crucial that the same `name` is used for a group of radios.\n- Give each radio within a group a unique `value`.\n- Radios **must** be used in combination with a fieldset component.\n- In most cases, a stack component should be used to layout a group of radio buttons.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t place interactive content (buttons, links etc) inside the label.\n- Don’t use when a user can select more than one option. In this case, use a checkbox instead.\n- Don’t use for “accepting terms of service” and similar functionality. Use a checkbox instead.\n- When you have more than 10 options to choose from. Consider using a select instead.\n\n</div>\n\n---\n\n## Content guidelines\n\nRadio button labels should be clear, accurate and predictable. It should be possible for the user to understand what they are enabling or disabling:\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">Option 1</div>\n\nWhen writing radio 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 ending in punctuation if it’s a single sentence, word, or a fragment:\n\n<div class=\"n-usage n-usage-do\">Blue</div>\n<div class=\"n-usage n-usage-dont\">Blue.</div>\n\nDo not use commas or semicolons at the end of each line\n\n<div class=\"n-usage n-usage-do\">Patient</div>\n<div class=\"n-usage n-usage-dont\">Patient;</div>\n\n---\n\n## Additional considerations\n\n- Hint text can be used to offer further information or explanation for an option.\n- Once a radio has been selected, users cannot return to having no radios selected without refreshing their browser window. Therefore, you should include \"None of the above\" or \"I do not know\" if they are valid options.\n- In most cases, radio buttons should be stacked vertically. However, radio buttons can be stacked horizontally when there are only two options with short labels. An example might be a yes/no question.\n"
6090
6000
  },
6091
6001
  {
6092
6002
  "kind": "javascript-module",
6093
- "path": "src/radio/Radio.ts",
6003
+ "path": "src/select/Select.ts",
6094
6004
  "declarations": [
6095
6005
  {
6096
6006
  "kind": "class",
6097
- "description": "Radio buttons are graphical user interface elements that allow user to choose only one option from\na predefined set of mutually exclusive options.",
6098
- "name": "Radio",
6007
+ "description": "Select lets users choose one option from an options menu.\nConsider using select when you have 5 or more options to choose from.",
6008
+ "name": "Select",
6099
6009
  "slots": [
6010
+ {
6011
+ "description": "Default slot for holding <option> elements.",
6012
+ "name": ""
6013
+ },
6100
6014
  {
6101
6015
  "description": "Use when a label requires more than plain text.",
6102
6016
  "name": "label"
6103
6017
  },
6104
6018
  {
6105
- "description": "Optional slot that holds hint text for the input.",
6019
+ "description": "Use when a hint requires more than plain text.",
6106
6020
  "name": "hint"
6107
6021
  },
6108
6022
  {
@@ -6113,12 +6027,8 @@
6113
6027
  "members": [
6114
6028
  {
6115
6029
  "kind": "field",
6116
- "name": "inputId",
6117
- "type": {
6118
- "text": "string"
6119
- },
6030
+ "name": "formValue",
6120
6031
  "privacy": "protected",
6121
- "default": "\"input\"",
6122
6032
  "inheritedFrom": {
6123
6033
  "name": "FormAssociatedMixin",
6124
6034
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -6126,25 +6036,18 @@
6126
6036
  },
6127
6037
  {
6128
6038
  "kind": "field",
6129
- "name": "hintId",
6130
- "type": {
6131
- "text": "string"
6132
- },
6133
- "privacy": "protected",
6134
- "default": "\"hint\"",
6135
- "inheritedFrom": {
6136
- "name": "FormAssociatedMixin",
6137
- "module": "src/common/mixins/FormAssociatedMixin.ts"
6138
- }
6039
+ "name": "defaultSlot",
6040
+ "privacy": "private",
6041
+ "default": "new SlotController(this)"
6139
6042
  },
6140
6043
  {
6141
6044
  "kind": "field",
6142
- "name": "errorId",
6045
+ "name": "inputId",
6143
6046
  "type": {
6144
6047
  "text": "string"
6145
6048
  },
6146
6049
  "privacy": "protected",
6147
- "default": "\"error\"",
6050
+ "default": "\"select\"",
6148
6051
  "inheritedFrom": {
6149
6052
  "name": "FormAssociatedMixin",
6150
6053
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -6152,20 +6055,45 @@
6152
6055
  },
6153
6056
  {
6154
6057
  "kind": "field",
6155
- "name": "hintSlot",
6156
- "privacy": "protected",
6157
- "default": "new LightSlotController(this, {\n slotName: \"hint\",\n render: () => (this.hint ? html`<div slot=\"hint-internal\" id=${this.hintId}>${this.hint}</div>` : nothing),\n syncLightDom: element => {\n element.id = this.hintId\n },\n })",
6158
- "description": "For accessibility reasons, we render some parts of the component to the light DOM.",
6159
- "inheritedFrom": {
6160
- "name": "FormAssociatedMixin",
6161
- "module": "src/common/mixins/FormAssociatedMixin.ts"
6162
- }
6058
+ "name": "options",
6059
+ "privacy": "private"
6060
+ },
6061
+ {
6062
+ "kind": "method",
6063
+ "name": "getButtonText",
6064
+ "privacy": "private",
6065
+ "return": {
6066
+ "type": {
6067
+ "text": "string"
6068
+ }
6069
+ },
6070
+ "parameters": [
6071
+ {
6072
+ "name": "options",
6073
+ "type": {
6074
+ "text": "HTMLOptionElement[]"
6075
+ }
6076
+ }
6077
+ ]
6078
+ },
6079
+ {
6080
+ "kind": "method",
6081
+ "name": "renderOption",
6082
+ "privacy": "private",
6083
+ "parameters": [
6084
+ {
6085
+ "name": "option",
6086
+ "type": {
6087
+ "text": "HTMLOptionElement"
6088
+ }
6089
+ }
6090
+ ]
6163
6091
  },
6164
6092
  {
6165
6093
  "kind": "field",
6166
6094
  "name": "labelSlot",
6167
6095
  "privacy": "protected",
6168
- "default": "new LightSlotController(this, {\n slotName: \"label\",\n render: () => (this.label ? html`<label slot=\"label-internal\" for=${this.inputId}>${this.label}</label>` : nothing),\n syncLightDom: element => {\n if (!isLabel(element)) {\n // eslint-disable-next-line no-console\n console.warn(`NORD: Only <label> elements should be placed in radio's \"label\" slot`)\n } else {\n element.htmlFor = this.inputId\n }\n },\n })",
6096
+ "default": "new SlotController(this, \"label\")",
6169
6097
  "inheritedFrom": {
6170
6098
  "name": "FormAssociatedMixin",
6171
6099
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -6175,7 +6103,7 @@
6175
6103
  "kind": "field",
6176
6104
  "name": "errorSlot",
6177
6105
  "privacy": "protected",
6178
- "default": "new LightSlotController(this, {\n slotName: \"error\",\n render: () => (this.error ? html`<div slot=\"error-internal\" id=${this.errorId}>${this.error}</div>` : nothing),\n syncLightDom: element => {\n element.id = this.hintId\n },\n })",
6106
+ "default": "new SlotController(this, \"error\")",
6179
6107
  "inheritedFrom": {
6180
6108
  "name": "FormAssociatedMixin",
6181
6109
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -6183,14 +6111,19 @@
6183
6111
  },
6184
6112
  {
6185
6113
  "kind": "field",
6186
- "name": "inputSlot",
6114
+ "name": "hintSlot",
6187
6115
  "privacy": "protected",
6188
- "default": "new LightDomController(this, {\n render: () =>\n html`\n <input\n slot=\"input\"\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n ${ref(this.focusableRef)}\n class=\"n-input\"\n id=${this.inputId}\n type=\"radio\"\n name=${ifDefined(this.name)}\n .value=${this.value}\n .checked=${this.checked}\n ?disabled=${this.disabled}\n ?required=${this.required}\n aria-describedby=${ifDefined(this.getDescribedBy())}\n aria-invalid=${ifDefined(this.getInvalid())}\n />\n `,\n })"
6116
+ "default": "new SlotController(this, \"hint\")",
6117
+ "inheritedFrom": {
6118
+ "name": "FormAssociatedMixin",
6119
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
6120
+ }
6189
6121
  },
6190
6122
  {
6191
6123
  "kind": "field",
6192
- "name": "formValue",
6124
+ "name": "formData",
6193
6125
  "privacy": "protected",
6126
+ "default": "new FormDataController(this, { value: () => this.formValue })",
6194
6127
  "inheritedFrom": {
6195
6128
  "name": "FormAssociatedMixin",
6196
6129
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -6198,37 +6131,12 @@
6198
6131
  },
6199
6132
  {
6200
6133
  "kind": "field",
6201
- "name": "checked",
6134
+ "name": "errorId",
6202
6135
  "type": {
6203
- "text": "boolean"
6136
+ "text": "string"
6204
6137
  },
6205
- "default": "false",
6206
- "description": "Controls whether the checkbox is checked or not.",
6207
- "attribute": "checked",
6208
- "reflects": true
6209
- },
6210
- {
6211
- "kind": "method",
6212
- "name": "uncheckSiblings",
6213
- "privacy": "private"
6214
- },
6215
- {
6216
- "kind": "method",
6217
- "name": "handleChange",
6218
6138
  "privacy": "protected",
6219
- "return": {
6220
- "type": {
6221
- "text": "void"
6222
- }
6223
- },
6224
- "parameters": [
6225
- {
6226
- "name": "e",
6227
- "type": {
6228
- "text": "Event"
6229
- }
6230
- }
6231
- ],
6139
+ "default": "\"error\"",
6232
6140
  "inheritedFrom": {
6233
6141
  "name": "FormAssociatedMixin",
6234
6142
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -6236,19 +6144,12 @@
6236
6144
  },
6237
6145
  {
6238
6146
  "kind": "field",
6239
- "name": "handleBlur",
6240
- "privacy": "private"
6241
- },
6242
- {
6243
- "kind": "field",
6244
- "name": "handleFocus",
6245
- "privacy": "private"
6246
- },
6247
- {
6248
- "kind": "field",
6249
- "name": "formData",
6147
+ "name": "hintId",
6148
+ "type": {
6149
+ "text": "string"
6150
+ },
6250
6151
  "privacy": "protected",
6251
- "default": "new FormDataController(this, { value: () => this.formValue })",
6152
+ "default": "\"hint\"",
6252
6153
  "inheritedFrom": {
6253
6154
  "name": "FormAssociatedMixin",
6254
6155
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -6367,6 +6268,15 @@
6367
6268
  "module": "src/common/mixins/FormAssociatedMixin.ts"
6368
6269
  }
6369
6270
  },
6271
+ {
6272
+ "kind": "method",
6273
+ "name": "handleChange",
6274
+ "privacy": "protected",
6275
+ "inheritedFrom": {
6276
+ "name": "FormAssociatedMixin",
6277
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
6278
+ }
6279
+ },
6370
6280
  {
6371
6281
  "kind": "method",
6372
6282
  "name": "renderLabel",
@@ -6437,7 +6347,7 @@
6437
6347
  "text": "boolean"
6438
6348
  },
6439
6349
  "default": "false",
6440
- "description": "Makes the input component disabled.\nThis prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies.",
6350
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
6441
6351
  "attribute": "disabled",
6442
6352
  "reflects": true,
6443
6353
  "inheritedFrom": {
@@ -6451,7 +6361,7 @@
6451
6361
  "type": {
6452
6362
  "text": "string | undefined"
6453
6363
  },
6454
- "description": "The name of the input component.",
6364
+ "description": "The name of the form component.",
6455
6365
  "attribute": "name",
6456
6366
  "inheritedFrom": {
6457
6367
  "name": "InputMixin",
@@ -6465,7 +6375,7 @@
6465
6375
  "text": "string"
6466
6376
  },
6467
6377
  "default": "\"\"",
6468
- "description": "The value of the input component.",
6378
+ "description": "The value of the form component.",
6469
6379
  "attribute": "value",
6470
6380
  "inheritedFrom": {
6471
6381
  "name": "InputMixin",
@@ -6476,7 +6386,7 @@
6476
6386
  "kind": "field",
6477
6387
  "name": "form",
6478
6388
  "privacy": "protected",
6479
- "description": "Gets the form, if any, associated with the input element.",
6389
+ "description": "Gets the form, if any, associated with the form element.",
6480
6390
  "inheritedFrom": {
6481
6391
  "name": "InputMixin",
6482
6392
  "module": "src/common/mixins/InputMixin.ts"
@@ -6504,7 +6414,7 @@
6504
6414
  "description": "An object which controls aspects of the focusing process."
6505
6415
  }
6506
6416
  ],
6507
- "description": "Programmatically move focus to the component",
6417
+ "description": "Programmatically move focus to the component.",
6508
6418
  "inheritedFrom": {
6509
6419
  "name": "FocusableMixin",
6510
6420
  "module": "src/common/mixins/FocusableMixin.ts"
@@ -6543,16 +6453,33 @@
6543
6453
  }
6544
6454
  }
6545
6455
  ],
6546
- "attributes": [
6456
+ "mixins": [
6547
6457
  {
6548
- "name": "checked",
6549
- "type": {
6550
- "text": "boolean"
6551
- },
6552
- "default": "false",
6553
- "description": "Controls whether the checkbox is checked or not.",
6554
- "fieldName": "checked"
6458
+ "name": "FormAssociatedMixin",
6459
+ "module": "/src/common/mixins/FormAssociatedMixin.js"
6460
+ },
6461
+ {
6462
+ "name": "InputMixin",
6463
+ "module": "/src/common/mixins/InputMixin.js"
6464
+ },
6465
+ {
6466
+ "name": "FocusableMixin",
6467
+ "module": "/src/common/mixins/FocusableMixin.js"
6555
6468
  },
6469
+ {
6470
+ "name": "DraftComponentMixin",
6471
+ "module": "/src/common/mixins/DraftComponentMixin.js"
6472
+ }
6473
+ ],
6474
+ "superclass": {
6475
+ "name": "LitElement",
6476
+ "package": "lit"
6477
+ },
6478
+ "status": "draft",
6479
+ "category": "form",
6480
+ "tagName": "nord-select",
6481
+ "customElement": true,
6482
+ "attributes": [
6556
6483
  {
6557
6484
  "name": "label",
6558
6485
  "type": {
@@ -6647,7 +6574,7 @@
6647
6574
  "text": "boolean"
6648
6575
  },
6649
6576
  "default": "false",
6650
- "description": "Makes the input component disabled.\nThis prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies.",
6577
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
6651
6578
  "fieldName": "disabled",
6652
6579
  "inheritedFrom": {
6653
6580
  "name": "InputMixin",
@@ -6659,7 +6586,7 @@
6659
6586
  "type": {
6660
6587
  "text": "string | undefined"
6661
6588
  },
6662
- "description": "The name of the input component.",
6589
+ "description": "The name of the form component.",
6663
6590
  "fieldName": "name",
6664
6591
  "inheritedFrom": {
6665
6592
  "name": "InputMixin",
@@ -6672,7 +6599,7 @@
6672
6599
  "text": "string"
6673
6600
  },
6674
6601
  "default": "\"\"",
6675
- "description": "The value of the input component.",
6602
+ "description": "The value of the form component.",
6676
6603
  "fieldName": "value",
6677
6604
  "inheritedFrom": {
6678
6605
  "name": "InputMixin",
@@ -6680,32 +6607,6 @@
6680
6607
  }
6681
6608
  }
6682
6609
  ],
6683
- "mixins": [
6684
- {
6685
- "name": "FormAssociatedMixin",
6686
- "module": "/src/common/mixins/FormAssociatedMixin.js"
6687
- },
6688
- {
6689
- "name": "InputMixin",
6690
- "module": "/src/common/mixins/InputMixin.js"
6691
- },
6692
- {
6693
- "name": "FocusableMixin",
6694
- "module": "/src/common/mixins/FocusableMixin.js"
6695
- },
6696
- {
6697
- "name": "DraftComponentMixin",
6698
- "module": "/src/common/mixins/DraftComponentMixin.js"
6699
- }
6700
- ],
6701
- "superclass": {
6702
- "name": "LitElement",
6703
- "package": "lit"
6704
- },
6705
- "status": "draft",
6706
- "category": "form",
6707
- "tagName": "nord-radio",
6708
- "customElement": true,
6709
6610
  "events": [
6710
6611
  {
6711
6612
  "name": "input",
@@ -6737,20 +6638,138 @@
6737
6638
  "kind": "js",
6738
6639
  "name": "default",
6739
6640
  "declaration": {
6740
- "name": "Radio",
6741
- "module": "src/radio/Radio.ts"
6641
+ "name": "Select",
6642
+ "module": "src/select/Select.ts"
6742
6643
  }
6743
6644
  },
6744
6645
  {
6745
6646
  "kind": "custom-element-definition",
6746
- "name": "nord-radio",
6647
+ "name": "nord-select",
6747
6648
  "declaration": {
6748
- "name": "Radio",
6749
- "module": "src/radio/Radio.ts"
6649
+ "name": "Select",
6650
+ "module": "src/select/Select.ts"
6651
+ }
6652
+ }
6653
+ ],
6654
+ "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"
6655
+ },
6656
+ {
6657
+ "kind": "javascript-module",
6658
+ "path": "src/spinner/Spinner.ts",
6659
+ "declarations": [
6660
+ {
6661
+ "kind": "class",
6662
+ "description": "Spinner component is used to indicate users that their action is being\nprocessed. You can customize the size and color of the spinner with the\nprovided properties.",
6663
+ "name": "Spinner",
6664
+ "members": [
6665
+ {
6666
+ "kind": "field",
6667
+ "name": "size",
6668
+ "type": {
6669
+ "text": "\"xs\" | \"s\" | \"m\" | \"l\" | \"xl\" | \"xxl\""
6670
+ },
6671
+ "default": "\"m\"",
6672
+ "description": "The size of the spinner.",
6673
+ "attribute": "size",
6674
+ "reflects": true
6675
+ },
6676
+ {
6677
+ "kind": "field",
6678
+ "name": "color",
6679
+ "type": {
6680
+ "text": "string | undefined"
6681
+ },
6682
+ "description": "The color of the spinner.\nCan accept any valid CSS color value, including custom properties.",
6683
+ "attribute": "color",
6684
+ "reflects": true
6685
+ },
6686
+ {
6687
+ "kind": "field",
6688
+ "name": "label",
6689
+ "type": {
6690
+ "text": "string | undefined"
6691
+ },
6692
+ "description": "An accessible label for the spinner.\nIf no label is supplied, the spinner is hidden from assistive technology.",
6693
+ "attribute": "label",
6694
+ "reflects": true
6695
+ },
6696
+ {
6697
+ "kind": "field",
6698
+ "name": "_warningLogged",
6699
+ "type": {
6700
+ "text": "boolean"
6701
+ },
6702
+ "privacy": "private",
6703
+ "static": true,
6704
+ "default": "false",
6705
+ "inheritedFrom": {
6706
+ "name": "DraftComponentMixin",
6707
+ "module": "src/common/mixins/DraftComponentMixin.ts"
6708
+ }
6709
+ }
6710
+ ],
6711
+ "attributes": [
6712
+ {
6713
+ "name": "size",
6714
+ "type": {
6715
+ "text": "\"xs\" | \"s\" | \"m\" | \"l\" | \"xl\" | \"xxl\""
6716
+ },
6717
+ "default": "\"m\"",
6718
+ "description": "The size of the spinner.",
6719
+ "fieldName": "size"
6720
+ },
6721
+ {
6722
+ "name": "color",
6723
+ "type": {
6724
+ "text": "string | undefined"
6725
+ },
6726
+ "description": "The color of the spinner.\nCan accept any valid CSS color value, including custom properties.",
6727
+ "fieldName": "color"
6728
+ },
6729
+ {
6730
+ "name": "label",
6731
+ "type": {
6732
+ "text": "string | undefined"
6733
+ },
6734
+ "description": "An accessible label for the spinner.\nIf no label is supplied, the spinner is hidden from assistive technology.",
6735
+ "fieldName": "label"
6736
+ }
6737
+ ],
6738
+ "mixins": [
6739
+ {
6740
+ "name": "DraftComponentMixin",
6741
+ "module": "/src/common/mixins/DraftComponentMixin.js"
6742
+ }
6743
+ ],
6744
+ "superclass": {
6745
+ "name": "LitElement",
6746
+ "package": "lit"
6747
+ },
6748
+ "status": "draft",
6749
+ "category": "feedback",
6750
+ "tagName": "nord-spinner",
6751
+ "customElement": true
6752
+ }
6753
+ ],
6754
+ "exports": [
6755
+ {
6756
+ "kind": "js",
6757
+ "name": "default",
6758
+ "declaration": {
6759
+ "name": "Spinner",
6760
+ "module": "src/spinner/Spinner.ts"
6761
+ }
6762
+ },
6763
+ {
6764
+ "kind": "custom-element-definition",
6765
+ "name": "nord-spinner",
6766
+ "declaration": {
6767
+ "name": "Spinner",
6768
+ "module": "src/spinner/Spinner.ts"
6750
6769
  }
6751
6770
  }
6752
6771
  ],
6753
- "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 a radio component when users can only select one option from a list.\n- Favour radios over a select component when there are a small number of options. This reduces the number of clicks a user has to make, increasing efficiency.\n- Radio buttons are grouped by their `name` attribute. Therefore, it is crucial that the same `name` is used for a group of radios.\n- Give each radio within a group a unique `value`.\n- Radios **must** be used in combination with a fieldset component.\n- In most cases, a stack component should be used to layout a group of radio buttons.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t place interactive content (buttons, links etc) inside the label.\n- Don’t use when a user can select more than one option. In this case, use a checkbox instead.\n- Don’t use for “accepting terms of service” and similar functionality. Use a checkbox instead.\n- When you have more than 10 options to choose from. Consider using a select instead.\n\n</div>\n\n-------\n\n## Content guidelines\n\nRadio button labels should be clear, accurate and predictable. It should be possible for the user to understand what they are enabling or disabling:\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">Option 1</div>\n\nWhen writing radio 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 ending in punctuation if it’s a single sentence, word, or a fragment:\n\n<div class=\"n-usage n-usage-do\">Blue</div>\n<div class=\"n-usage n-usage-dont\">Blue.</div>\n\n-------\n\n## Additional considerations\n\n- Hint text can be used to offer further information or explanation for an option.\n- Once a radio has been selected, users cannot return to having no radios selected without refreshing their browser window. Therefore, you should include \"None of the above\" or \"I do not know\" if they are valid options.\n- In most cases, radio buttons should be stacked vertically. However, radio buttons can be stacked horizontally when there are only two options with short labels. An example might be a yes/no question."
6772
+ "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"
6754
6773
  },
6755
6774
  {
6756
6775
  "kind": "javascript-module",
@@ -6875,7 +6894,8 @@
6875
6894
  "module": "src/stack/Stack.ts"
6876
6895
  }
6877
6896
  }
6878
- ]
6897
+ ],
6898
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when you need to stack multiple components vertically or horizontally.\n- Use when you want to adjust the white space between two or more components.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for building grid based layouts.\n\n</div>\n"
6879
6899
  },
6880
6900
  {
6881
6901
  "kind": "javascript-module",
@@ -6974,7 +6994,8 @@
6974
6994
  "module": "src/table/Table.ts"
6975
6995
  }
6976
6996
  }
6977
- ]
6997
+ ],
6998
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when you need to display tabular data in a view.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use to display list data.\n- Don’t use tables for layout.\n\n</div>\n\n---\n\n## Content guidelines\n\nHeaders in a table should be clear, accurate and predictable. When writing headers, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">User account</div>\n<div class=\"n-usage n-usage-dont\">User Account</div>\n\nInclude units of measurement symbols in the table header so they aren’t repeated throughout every single column:\n\n<div class=\"n-usage n-usage-do\">Temperature °C</div>\n<div class=\"n-usage n-usage-dont\">Temperature</div>\n\nAvoid unnecessary words and articles in table headers, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Description</div>\n<div class=\"n-usage n-usage-dont\">A description</div>\n\nKeep decimals consistent. For example, don’t use 3 decimals in one row and 2 in others:\n\n<div class=\"n-usage n-usage-do\">30.00<br/>25.00</div>\n<div class=\"n-usage n-usage-dont\">30.000<br/>25.0</div>\n\n---\n\n## Additional considerations\n\n- Nord’s table component acts as a lightweight and un-opinionated component for enhancing tabular data. It is up to the user of this component to make sure that the table markup they use is accessible.\n- It’s important to pay close attention to semantics when authoring tables. The markup in the examples can be used as a starting point. However, be aware that HTML tables have a large feature set which cannot be fully covered in this documentation.\n"
6978
6999
  },
6979
7000
  {
6980
7001
  "kind": "javascript-module",
@@ -7295,7 +7316,7 @@
7295
7316
  "text": "boolean"
7296
7317
  },
7297
7318
  "default": "false",
7298
- "description": "Makes the input component disabled.\nThis prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies.",
7319
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
7299
7320
  "attribute": "disabled",
7300
7321
  "reflects": true,
7301
7322
  "inheritedFrom": {
@@ -7309,7 +7330,7 @@
7309
7330
  "type": {
7310
7331
  "text": "string | undefined"
7311
7332
  },
7312
- "description": "The name of the input component.",
7333
+ "description": "The name of the form component.",
7313
7334
  "attribute": "name",
7314
7335
  "inheritedFrom": {
7315
7336
  "name": "InputMixin",
@@ -7323,7 +7344,7 @@
7323
7344
  "text": "string"
7324
7345
  },
7325
7346
  "default": "\"\"",
7326
- "description": "The value of the input component.",
7347
+ "description": "The value of the form component.",
7327
7348
  "attribute": "value",
7328
7349
  "inheritedFrom": {
7329
7350
  "name": "InputMixin",
@@ -7334,7 +7355,7 @@
7334
7355
  "kind": "field",
7335
7356
  "name": "form",
7336
7357
  "privacy": "protected",
7337
- "description": "Gets the form, if any, associated with the input element.",
7358
+ "description": "Gets the form, if any, associated with the form element.",
7338
7359
  "inheritedFrom": {
7339
7360
  "name": "InputMixin",
7340
7361
  "module": "src/common/mixins/InputMixin.ts"
@@ -7362,7 +7383,7 @@
7362
7383
  "description": "An object which controls aspects of the focusing process."
7363
7384
  }
7364
7385
  ],
7365
- "description": "Programmatically move focus to the component",
7386
+ "description": "Programmatically move focus to the component.",
7366
7387
  "inheritedFrom": {
7367
7388
  "name": "FocusableMixin",
7368
7389
  "module": "src/common/mixins/FocusableMixin.ts"
@@ -7505,7 +7526,7 @@
7505
7526
  "text": "boolean"
7506
7527
  },
7507
7528
  "default": "false",
7508
- "description": "Makes the input component disabled.\nThis prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies.",
7529
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
7509
7530
  "fieldName": "disabled",
7510
7531
  "inheritedFrom": {
7511
7532
  "name": "InputMixin",
@@ -7517,7 +7538,7 @@
7517
7538
  "type": {
7518
7539
  "text": "string | undefined"
7519
7540
  },
7520
- "description": "The name of the input component.",
7541
+ "description": "The name of the form component.",
7521
7542
  "fieldName": "name",
7522
7543
  "inheritedFrom": {
7523
7544
  "name": "InputMixin",
@@ -7530,7 +7551,7 @@
7530
7551
  "text": "string"
7531
7552
  },
7532
7553
  "default": "\"\"",
7533
- "description": "The value of the input component.",
7554
+ "description": "The value of the form component.",
7534
7555
  "fieldName": "value",
7535
7556
  "inheritedFrom": {
7536
7557
  "name": "InputMixin",
@@ -7607,7 +7628,8 @@
7607
7628
  "module": "src/textarea/Textarea.ts"
7608
7629
  }
7609
7630
  }
7610
- ]
7631
+ ],
7632
+ "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 allow text input where the expected input is long.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use when the expected text input is short. Use input component instead.\n\n</div>\n\n---\n\n## Content guidelines\n\nTextarea labels act as a title for the text 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 textarea 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\">Provide description</div>\n<div class=\"n-usage n-usage-dont\">Provide Description</div>\n\nWhen a textarea isn’t part of a form and is placed individually on a page, you could provide the textarea label as a call to action:\n\n<div class=\"n-usage n-usage-do\">Leave a comment</div>\n<div class=\"n-usage n-usage-dont\">Comment</div>\n\nDo not use colons in textarea labels:\n\n<div class=\"n-usage n-usage-do\">Provide description</div>\n<div class=\"n-usage n-usage-dont\">Provide description:</div>\n"
7611
7633
  },
7612
7634
  {
7613
7635
  "kind": "javascript-module",
@@ -7615,7 +7637,7 @@
7615
7637
  "declarations": [
7616
7638
  {
7617
7639
  "kind": "class",
7618
- "description": "Tooltips are floating containers for displaying additional information\nfor the currently focused element. A tooltip can be useful when you want\nto e.g. give a hint about an existing Command Menu hotkey.",
7640
+ "description": "Tooltips are floating containers for displaying additional information\nfor the currently focused element. A tooltip can be useful when you want\nto e.g. give a hint about an existing Command Menu shortcut.",
7619
7641
  "name": "Tooltip",
7620
7642
  "slots": [
7621
7643
  {
@@ -7869,7 +7891,8 @@
7869
7891
  "module": "src/visually-hidden/VisuallyHidden.ts"
7870
7892
  }
7871
7893
  }
7872
- ]
7894
+ ],
7895
+ "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 hide text visually from the screen, but keep it available to assistive technologies, such as screen readers.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for hiding interactive content.\n\n</div>\n"
7873
7896
  },
7874
7897
  {
7875
7898
  "kind": "javascript-module",
@@ -8798,7 +8821,7 @@
8798
8821
  "description": "An object which controls aspects of the focusing process."
8799
8822
  }
8800
8823
  ],
8801
- "description": "Programmatically move focus to the component"
8824
+ "description": "Programmatically move focus to the component."
8802
8825
  },
8803
8826
  {
8804
8827
  "kind": "method",
@@ -9397,7 +9420,7 @@
9397
9420
  "text": "boolean"
9398
9421
  },
9399
9422
  "default": "false",
9400
- "description": "Makes the input component disabled.\nThis prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies.",
9423
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
9401
9424
  "attribute": "disabled",
9402
9425
  "reflects": true
9403
9426
  },
@@ -9407,7 +9430,7 @@
9407
9430
  "type": {
9408
9431
  "text": "string | undefined"
9409
9432
  },
9410
- "description": "The name of the input component.",
9433
+ "description": "The name of the form component.",
9411
9434
  "attribute": "name"
9412
9435
  },
9413
9436
  {
@@ -9417,14 +9440,14 @@
9417
9440
  "text": "string"
9418
9441
  },
9419
9442
  "default": "\"\"",
9420
- "description": "The value of the input component.",
9443
+ "description": "The value of the form component.",
9421
9444
  "attribute": "value"
9422
9445
  },
9423
9446
  {
9424
9447
  "kind": "field",
9425
9448
  "name": "form",
9426
9449
  "privacy": "protected",
9427
- "description": "Gets the form, if any, associated with the input element."
9450
+ "description": "Gets the form, if any, associated with the form element."
9428
9451
  }
9429
9452
  ],
9430
9453
  "attributes": [
@@ -9434,7 +9457,7 @@
9434
9457
  "text": "boolean"
9435
9458
  },
9436
9459
  "default": "false",
9437
- "description": "Makes the input component disabled.\nThis prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies.",
9460
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
9438
9461
  "fieldName": "disabled"
9439
9462
  },
9440
9463
  {
@@ -9442,7 +9465,7 @@
9442
9465
  "type": {
9443
9466
  "text": "string | undefined"
9444
9467
  },
9445
- "description": "The name of the input component.",
9468
+ "description": "The name of the form component.",
9446
9469
  "fieldName": "name"
9447
9470
  },
9448
9471
  {
@@ -9451,7 +9474,7 @@
9451
9474
  "text": "string"
9452
9475
  },
9453
9476
  "default": "\"\"",
9454
- "description": "The value of the input component.",
9477
+ "description": "The value of the form component.",
9455
9478
  "fieldName": "value"
9456
9479
  }
9457
9480
  ],