@nordhealth/components 2.0.0 → 2.0.1

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.
@@ -512,52 +512,57 @@
512
512
  },
513
513
  {
514
514
  "kind": "javascript-module",
515
- "path": "src/banner/Banner.ts",
515
+ "path": "src/badge/Badge.ts",
516
516
  "declarations": [
517
517
  {
518
518
  "kind": "class",
519
- "description": "Banner informs users about important changes or conditions in the\ninterface. Use this component if you need to communicate to users\nin a prominent way.",
520
- "name": "Banner",
521
- "cssProperties": [
522
- {
523
- "description": "Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).",
524
- "name": "--n-banner-border-radius",
525
- "default": "var(--n-border-radius)"
526
- },
527
- {
528
- "description": "Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).",
529
- "name": "--n-banner-box-shadow",
530
- "default": "var(--n-box-shadow-card)"
531
- }
532
- ],
519
+ "description": "Badges are used to inform users of the status of an object\nor of an action that’s been taken. Commonly used in tabular\ndata to indicate status.",
520
+ "name": "Badge",
533
521
  "slots": [
534
522
  {
535
- "description": "default slot",
523
+ "description": "The badge content.",
536
524
  "name": ""
537
525
  }
538
526
  ],
539
527
  "members": [
540
528
  {
541
529
  "kind": "field",
542
- "name": "variant",
530
+ "name": "type",
543
531
  "type": {
544
- "text": "\"info\" | \"danger\" | \"success\" | \"warning\""
532
+ "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | \"neutral\" | \"progress\" | undefined"
545
533
  },
546
- "default": "\"info\"",
547
- "description": "The style variant of the banner.",
548
- "attribute": "variant",
534
+ "default": "\"neutral\"",
535
+ "description": "The type of badge.\nDetermines the background color of the badge.",
536
+ "attribute": "type",
549
537
  "reflects": true
538
+ },
539
+ {
540
+ "kind": "field",
541
+ "name": "progress",
542
+ "type": {
543
+ "text": "\"cancelled\" | \"complete\" | \"incomplete\" | \"partially-complete\" | undefined"
544
+ },
545
+ "description": "The progress of the badge. Displays a progress\nindicator next to the label.",
546
+ "attribute": "progress"
550
547
  }
551
548
  ],
552
549
  "attributes": [
553
550
  {
554
- "name": "variant",
551
+ "name": "type",
555
552
  "type": {
556
- "text": "\"info\" | \"danger\" | \"success\" | \"warning\""
553
+ "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | \"neutral\" | \"progress\" | undefined"
557
554
  },
558
- "default": "\"info\"",
559
- "description": "The style variant of the banner.",
560
- "fieldName": "variant"
555
+ "default": "\"neutral\"",
556
+ "description": "The type of badge.\nDetermines the background color of the badge.",
557
+ "fieldName": "type"
558
+ },
559
+ {
560
+ "name": "progress",
561
+ "type": {
562
+ "text": "\"cancelled\" | \"complete\" | \"incomplete\" | \"partially-complete\" | undefined"
563
+ },
564
+ "description": "The progress of the badge. Displays a progress\nindicator next to the label.",
565
+ "fieldName": "progress"
561
566
  }
562
567
  ],
563
568
  "superclass": {
@@ -565,9 +570,9 @@
565
570
  "package": "lit"
566
571
  },
567
572
  "status": "ready",
568
- "category": "feedback",
573
+ "category": "text",
569
574
  "displayName": null,
570
- "tagName": "nord-banner",
575
+ "tagName": "nord-badge",
571
576
  "customElement": true
572
577
  }
573
578
  ],
@@ -576,20 +581,20 @@
576
581
  "kind": "js",
577
582
  "name": "default",
578
583
  "declaration": {
579
- "name": "Banner",
580
- "module": "src/banner/Banner.ts"
584
+ "name": "Badge",
585
+ "module": "src/badge/Badge.ts"
581
586
  }
582
587
  },
583
588
  {
584
589
  "kind": "custom-element-definition",
585
- "name": "nord-banner",
590
+ "name": "nord-badge",
586
591
  "declaration": {
587
- "name": "Banner",
588
- "module": "src/banner/Banner.ts"
592
+ "name": "Badge",
593
+ "module": "src/badge/Badge.ts"
589
594
  }
590
595
  }
591
596
  ],
592
- "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use this component if you need to communicate in a prominent way.\n- Place banner at the top of the section it applies to.\n- Use for highlighting errors and success statuses.\n- Put banner close to the context it’s referring to.\n- Move focus to the banner if it’s relevant to the current workflow.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Move focus to banner if it appears on page load.\n- Use for highlighting general content or as a banner.\n- Use to replace an error page.\n\n</div>\n\n---\n\n## Content guidelines\n\nBanner content should be clear, accurate and easy to understand:\n\n<div class=\"n-usage n-usage-do\">We’re experiencing an incident. Please see our status page for more details.</div>\n<div class=\"n-usage n-usage-dont\">There was an error.</div>\n\nWhen writing banner content, always write it in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">We’re experiencing an incident.</div>\n<div class=\"n-usage n-usage-dont\">We’re Experiencing An Incident.</div>\n\nAlways end in punctuation:\n\n<div class=\"n-usage n-usage-do\">We’re experiencing an incident.</div>\n<div class=\"n-usage n-usage-dont\">Were experiencing an incident</div>\n"
597
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use established variants and color patterns so that users can clearly identify the importance level.\n- Use to show a status update on a piece of information or action.\n- Use to mark something as a “draft” or “new”.\n- Use when you want to highlight something that has been added recently.\n- Always position badge so that it’s clear to understand what object it’s related to.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make badges clickable. Instead use button component’s small variant.\n- Don’t use alternatives to existing badge variants.\n\n</div>\n\n---\n\n## Content guidelines\n\nBadge labels should use a single word to describe the status of an object. Only use two words if you need to describe a complex state:\n\n<div class=\"n-usage n-usage-do\">Complete</div>\n<div class=\"n-usage n-usage-dont\">Action completed</div>\n\nWhen writing badge labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">Partially refunded</div>\n<div class=\"n-usage n-usage-dont\">Partially Refunded</div>\n\nAvoid unnecessary words and articles in badge labels, such as “is”, “the”, “an or “a”:\n\n<div class=\"n-usage n-usage-do\">Pending</div>\n<div class=\"n-usage n-usage-dont\">Item is pending</div>\n\nAlways describe the status in the past tense:\n\n<div class=\"n-usage n-usage-do\">Refunded</div>\n<div class=\"n-usage n-usage-dont\">Refund</div>\n\n---\n\n## Variants\n\nThis section describes the different component variants, their purpose, and when to use each variant.\n\n| Name | Purpose |\n| ----------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| `neutral` | The default style variant. |\n| `info` | Used to convey general information that isnt critical. |\n| `success` | Used to convey success states. For example, you might want to show a badge that tells the user a payment was successful. |\n| `highlight` | Used to highlight specific items in the interface, like notifications. |\n| `danger` | Used to communicate problems that have to be resolved so that user can continue forward. Should always be used for highlighting errors. |\n| `warning` | Used to display information that needs a user’s attention attention and may require further steps. |\n| `progress` | Used to convey something that’s in progress. |\n"
593
598
  },
594
599
  {
595
600
  "kind": "javascript-module",
@@ -1621,6 +1626,127 @@
1621
1626
  ],
1622
1627
  "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Only use one primary button per section, as a main call-to-action.\n- Use clear and accurate labels.\n- Use established button colors appropriately. For example, only use a danger button style for an action that’s difficult or impossible to undo.\n- Prioritize the most important actions. Too many buttons will cause confusion.\n- Be consistent with positioning of buttons in the user interface.\n- Use strong, actionable verbs in labels such as “Add”, “Close”, “Cancel”, or “Save”.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don't use a primary button in every row of a table.\n- Don’t use buttons to link to other pages. Use regular link or a plain style instead where necessary.\n- Don’t use buttons for navigation where the link appears within or following a sentence.\n- Don’t use labels such as “Read more”, “Click here” or “More”.\n\n</div>\n\n---\n\n## Content guidelines\n\nButton labels should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they click a button:\n\n<div class=\"n-usage n-usage-do\">View user settings</div>\n<div class=\"n-usage n-usage-dont\">Click here</div>\n\nWhen writing button labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">My tasks</div>\n<div class=\"n-usage n-usage-dont\">My Tasks</div>\n\nAvoid unnecessary words and articles in button labels, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Add item</div>\n<div class=\"n-usage n-usage-dont\">Add an item</div>\n\n---\n\n## Variants\n\nThis section describes the different component variants, their purpose, and when to use each variant.\n\n| Name | Purpose |\n| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `default` | Default style is the most common button variant. Only switch to another variant if you need to adjust the visual weight of the element. |\n| `primary` | Primary style is reserved for main call-to-actions. Should be used only once per content area or panel, e.g. for a “Save” action. |\n| `dashed` | Dashed style should be used for actions that trigger filtering. |\n| `danger` | Danger style should be used for actions that delete data or otherwise make it hard to undo the action. |\n| `plain` | Used for less important or less common actions. Can be also used for linking to other pages. |\n| `disabled` | Used for actions that aren’t currently available or not available anymore. Also prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies. |\n| `switch` | Switch style is reserved for the clinic switcher in the top left corner of an application. |\n\n---\n\n## Additional considerations\n\n- Users of assistive technology expect a button to submit data or do an action. If you need the button to navigate into another view, use the `href` property which will output `<a>` tag instead of a `<button>`.\n- When you need to disable a button, use `disabled` property as it conveys this information correctly to assistive technologies like screen readers.\n- Button component provides 3 size variants; small, medium and large. The large size should only be used for marketing purposes or on areas such as an empty space/content notice.\n"
1623
1628
  },
1629
+ {
1630
+ "kind": "javascript-module",
1631
+ "path": "src/card/Card.ts",
1632
+ "declarations": [
1633
+ {
1634
+ "kind": "class",
1635
+ "description": "Cards are shadowed surfaces that display content and actions on a\nsingle topic. They should be easy to scan for relevant and\nactionable information.",
1636
+ "name": "Card",
1637
+ "cssProperties": [
1638
+ {
1639
+ "description": "Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).",
1640
+ "name": "--n-card-border-radius",
1641
+ "default": "var(--n-border-radius)"
1642
+ },
1643
+ {
1644
+ "description": "Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).",
1645
+ "name": "--n-card-box-shadow",
1646
+ "default": "var(--n-box-shadow-popout)"
1647
+ },
1648
+ {
1649
+ "description": "Controls the padding on all sides of the card.",
1650
+ "name": "--n-card-padding",
1651
+ "default": "var(--n-space-m)"
1652
+ },
1653
+ {
1654
+ "description": "Controls the padding of items slotted within the card. This does not affect the block padding of items slotted into the header.",
1655
+ "name": "--n-card-slot-padding",
1656
+ "default": "var(--n-space-m)"
1657
+ }
1658
+ ],
1659
+ "slots": [
1660
+ {
1661
+ "description": "The card content.",
1662
+ "name": ""
1663
+ },
1664
+ {
1665
+ "description": "Optional slot that holds a header for the card.",
1666
+ "name": "header"
1667
+ },
1668
+ {
1669
+ "description": "Optional slot that positions content at the end of the header. Useful for actions or additional info.",
1670
+ "name": "header-end"
1671
+ },
1672
+ {
1673
+ "description": "Optional slot that holds footer content for the card.",
1674
+ "name": "footer"
1675
+ }
1676
+ ],
1677
+ "members": [
1678
+ {
1679
+ "kind": "field",
1680
+ "name": "headerSlot",
1681
+ "privacy": "private",
1682
+ "default": "new SlotController(this, \"header\")"
1683
+ },
1684
+ {
1685
+ "kind": "field",
1686
+ "name": "headerEndSlot",
1687
+ "privacy": "private",
1688
+ "default": "new SlotController(this, \"header-end\")"
1689
+ },
1690
+ {
1691
+ "kind": "field",
1692
+ "name": "footerSlot",
1693
+ "privacy": "private",
1694
+ "default": "new SlotController(this, \"footer\")"
1695
+ },
1696
+ {
1697
+ "kind": "field",
1698
+ "name": "padding",
1699
+ "type": {
1700
+ "text": "\"m\" | \"l\" | \"none\""
1701
+ },
1702
+ "default": "\"m\"",
1703
+ "description": "Controls the padding of the card component. When set to “none”,\nthe header and footer slots will still have padding.",
1704
+ "attribute": "padding",
1705
+ "reflects": true
1706
+ }
1707
+ ],
1708
+ "attributes": [
1709
+ {
1710
+ "name": "padding",
1711
+ "type": {
1712
+ "text": "\"m\" | \"l\" | \"none\""
1713
+ },
1714
+ "default": "\"m\"",
1715
+ "description": "Controls the padding of the card component. When set to “none”,\nthe header and footer slots will still have padding.",
1716
+ "fieldName": "padding"
1717
+ }
1718
+ ],
1719
+ "superclass": {
1720
+ "name": "LitElement",
1721
+ "package": "lit"
1722
+ },
1723
+ "status": "ready",
1724
+ "category": "structure",
1725
+ "displayName": null,
1726
+ "tagName": "nord-card",
1727
+ "customElement": true
1728
+ }
1729
+ ],
1730
+ "exports": [
1731
+ {
1732
+ "kind": "js",
1733
+ "name": "default",
1734
+ "declaration": {
1735
+ "name": "Card",
1736
+ "module": "src/card/Card.ts"
1737
+ }
1738
+ },
1739
+ {
1740
+ "kind": "custom-element-definition",
1741
+ "name": "nord-card",
1742
+ "declaration": {
1743
+ "name": "Card",
1744
+ "module": "src/card/Card.ts"
1745
+ }
1746
+ }
1747
+ ],
1748
+ "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"
1749
+ },
1624
1750
  {
1625
1751
  "kind": "javascript-module",
1626
1752
  "path": "src/checkbox/Checkbox.ts",
@@ -2228,260 +2354,53 @@
2228
2354
  },
2229
2355
  {
2230
2356
  "kind": "javascript-module",
2231
- "path": "src/card/Card.ts",
2357
+ "path": "src/command-menu/CommandMenu.ts",
2232
2358
  "declarations": [
2233
2359
  {
2234
2360
  "kind": "class",
2235
- "description": "Cards are shadowed surfaces that display content and actions on a\nsingle topic. They should be easy to scan for relevant and\nactionable information.",
2236
- "name": "Card",
2361
+ "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.",
2362
+ "name": "CommandMenu",
2237
2363
  "cssProperties": [
2238
2364
  {
2239
- "description": "Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).",
2240
- "name": "--n-card-border-radius",
2241
- "default": "var(--n-border-radius)"
2242
- },
2243
- {
2244
- "description": "Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).",
2245
- "name": "--n-card-box-shadow",
2246
- "default": "var(--n-box-shadow-popout)"
2365
+ "description": "Controls the max inline size, or width, of the command menu.",
2366
+ "name": "--n-command-menu-inline-size",
2367
+ "default": "640px"
2247
2368
  },
2248
2369
  {
2249
- "description": "Controls the padding on all sides of the card.",
2250
- "name": "--n-card-padding",
2251
- "default": "var(--n-space-m)"
2370
+ "description": "Controls the max block size, or height, of the command menu.",
2371
+ "name": "--n-command-menu-block-size",
2372
+ "default": "290px"
2252
2373
  },
2253
2374
  {
2254
- "description": "Controls the padding of items slotted within the card. This does not affect the block padding of items slotted into the header.",
2255
- "name": "--n-card-slot-padding",
2256
- "default": "var(--n-space-m)"
2375
+ "description": "Controls the command menu offset from the block start, or top, of the screen.",
2376
+ "name": "--n-command-menu-block-start",
2377
+ "default": "16%"
2257
2378
  }
2258
2379
  ],
2259
2380
  "slots": [
2260
2381
  {
2261
- "description": "The card content.",
2262
- "name": ""
2263
- },
2264
- {
2265
- "description": "Optional slot that holds a header for the card.",
2266
- "name": "header"
2267
- },
2268
- {
2269
- "description": "Optional slot that positions content at the end of the header. Useful for actions or additional info.",
2270
- "name": "header-end"
2271
- },
2272
- {
2273
- "description": "Optional slot that holds footer content for the card.",
2382
+ "description": "Used to replace the default footer contents.",
2274
2383
  "name": "footer"
2275
2384
  }
2276
2385
  ],
2277
2386
  "members": [
2278
2387
  {
2279
2388
  "kind": "field",
2280
- "name": "headerSlot",
2281
- "privacy": "private",
2282
- "default": "new SlotController(this, \"header\")"
2389
+ "name": "inputRef",
2390
+ "privacy": "private"
2283
2391
  },
2284
2392
  {
2285
2393
  "kind": "field",
2286
- "name": "headerEndSlot",
2287
- "privacy": "private",
2288
- "default": "new SlotController(this, \"header-end\")"
2394
+ "name": "listRef",
2395
+ "privacy": "private"
2289
2396
  },
2290
2397
  {
2291
2398
  "kind": "field",
2292
- "name": "footerSlot",
2293
- "privacy": "private",
2294
- "default": "new SlotController(this, \"footer\")"
2295
- },
2296
- {
2297
- "kind": "field",
2298
- "name": "padding",
2299
- "type": {
2300
- "text": "\"m\" | \"l\" | \"none\""
2301
- },
2302
- "default": "\"m\"",
2303
- "description": "Controls the padding of the card component. When set to “none”,\nthe header and footer slots will still have padding.",
2304
- "attribute": "padding",
2305
- "reflects": true
2306
- }
2307
- ],
2308
- "attributes": [
2309
- {
2310
- "name": "padding",
2311
- "type": {
2312
- "text": "\"m\" | \"l\" | \"none\""
2313
- },
2314
- "default": "\"m\"",
2315
- "description": "Controls the padding of the card component. When set to “none”,\nthe header and footer slots will still have padding.",
2316
- "fieldName": "padding"
2317
- }
2318
- ],
2319
- "superclass": {
2320
- "name": "LitElement",
2321
- "package": "lit"
2322
- },
2323
- "status": "ready",
2324
- "category": "structure",
2325
- "displayName": null,
2326
- "tagName": "nord-card",
2327
- "customElement": true
2328
- }
2329
- ],
2330
- "exports": [
2331
- {
2332
- "kind": "js",
2333
- "name": "default",
2334
- "declaration": {
2335
- "name": "Card",
2336
- "module": "src/card/Card.ts"
2337
- }
2338
- },
2339
- {
2340
- "kind": "custom-element-definition",
2341
- "name": "nord-card",
2342
- "declaration": {
2343
- "name": "Card",
2344
- "module": "src/card/Card.ts"
2345
- }
2346
- }
2347
- ],
2348
- "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"
2349
- },
2350
- {
2351
- "kind": "javascript-module",
2352
- "path": "src/badge/Badge.ts",
2353
- "declarations": [
2354
- {
2355
- "kind": "class",
2356
- "description": "Badges are used to inform users of the status of an object\nor of an action that’s been taken. Commonly used in tabular\ndata to indicate status.",
2357
- "name": "Badge",
2358
- "slots": [
2359
- {
2360
- "description": "The badge content.",
2361
- "name": ""
2362
- }
2363
- ],
2364
- "members": [
2365
- {
2366
- "kind": "field",
2367
- "name": "type",
2368
- "type": {
2369
- "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | \"neutral\" | \"progress\" | undefined"
2370
- },
2371
- "default": "\"neutral\"",
2372
- "description": "The type of badge.\nDetermines the background color of the badge.",
2373
- "attribute": "type",
2374
- "reflects": true
2375
- },
2376
- {
2377
- "kind": "field",
2378
- "name": "progress",
2379
- "type": {
2380
- "text": "\"cancelled\" | \"complete\" | \"incomplete\" | \"partially-complete\" | undefined"
2381
- },
2382
- "description": "The progress of the badge. Displays a progress\nindicator next to the label.",
2383
- "attribute": "progress"
2384
- }
2385
- ],
2386
- "attributes": [
2387
- {
2388
- "name": "type",
2389
- "type": {
2390
- "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | \"neutral\" | \"progress\" | undefined"
2391
- },
2392
- "default": "\"neutral\"",
2393
- "description": "The type of badge.\nDetermines the background color of the badge.",
2394
- "fieldName": "type"
2395
- },
2396
- {
2397
- "name": "progress",
2398
- "type": {
2399
- "text": "\"cancelled\" | \"complete\" | \"incomplete\" | \"partially-complete\" | undefined"
2400
- },
2401
- "description": "The progress of the badge. Displays a progress\nindicator next to the label.",
2402
- "fieldName": "progress"
2403
- }
2404
- ],
2405
- "superclass": {
2406
- "name": "LitElement",
2407
- "package": "lit"
2408
- },
2409
- "status": "ready",
2410
- "category": "text",
2411
- "displayName": null,
2412
- "tagName": "nord-badge",
2413
- "customElement": true
2414
- }
2415
- ],
2416
- "exports": [
2417
- {
2418
- "kind": "js",
2419
- "name": "default",
2420
- "declaration": {
2421
- "name": "Badge",
2422
- "module": "src/badge/Badge.ts"
2423
- }
2424
- },
2425
- {
2426
- "kind": "custom-element-definition",
2427
- "name": "nord-badge",
2428
- "declaration": {
2429
- "name": "Badge",
2430
- "module": "src/badge/Badge.ts"
2431
- }
2432
- }
2433
- ],
2434
- "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use established variants and color patterns so that users can clearly identify the importance level.\n- Use to show a status update on a piece of information or action.\n- Use to mark something as a “draft” or “new”.\n- Use when you want to highlight something that has been added recently.\n- Always position badge so that it’s clear to understand what object it’s related to.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make badges clickable. Instead use button component’s small variant.\n- Don’t use alternatives to existing badge variants.\n\n</div>\n\n---\n\n## Content guidelines\n\nBadge labels should use a single word to describe the status of an object. Only use two words if you need to describe a complex state:\n\n<div class=\"n-usage n-usage-do\">Complete</div>\n<div class=\"n-usage n-usage-dont\">Action completed</div>\n\nWhen writing badge labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">Partially refunded</div>\n<div class=\"n-usage n-usage-dont\">Partially Refunded</div>\n\nAvoid unnecessary words and articles in badge labels, such as “is”, “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Pending</div>\n<div class=\"n-usage n-usage-dont\">Item is pending</div>\n\nAlways describe the status in the past tense:\n\n<div class=\"n-usage n-usage-do\">Refunded</div>\n<div class=\"n-usage n-usage-dont\">Refund</div>\n\n---\n\n## Variants\n\nThis section describes the different component variants, their purpose, and when to use each variant.\n\n| Name | Purpose |\n| ----------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| `neutral` | The default style variant. |\n| `info` | Used to convey general information that isn’t critical. |\n| `success` | Used to convey success states. For example, you might want to show a badge that tells the user a payment was successful. |\n| `highlight` | Used to highlight specific items in the interface, like notifications. |\n| `danger` | Used to communicate problems that have to be resolved so that user can continue forward. Should always be used for highlighting errors. |\n| `warning` | Used to display information that needs a user’s attention attention and may require further steps. |\n| `progress` | Used to convey something that’s in progress. |\n"
2435
- },
2436
- {
2437
- "kind": "javascript-module",
2438
- "path": "src/command-menu/CommandMenu.ts",
2439
- "declarations": [
2440
- {
2441
- "kind": "class",
2442
- "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.",
2443
- "name": "CommandMenu",
2444
- "cssProperties": [
2445
- {
2446
- "description": "Controls the max inline size, or width, of the command menu.",
2447
- "name": "--n-command-menu-inline-size",
2448
- "default": "640px"
2449
- },
2450
- {
2451
- "description": "Controls the max block size, or height, of the command menu.",
2452
- "name": "--n-command-menu-block-size",
2453
- "default": "290px"
2454
- },
2455
- {
2456
- "description": "Controls the command menu offset from the block start, or top, of the screen.",
2457
- "name": "--n-command-menu-block-start",
2458
- "default": "16%"
2459
- }
2460
- ],
2461
- "slots": [
2462
- {
2463
- "description": "Used to replace the default footer contents.",
2464
- "name": "footer"
2465
- }
2466
- ],
2467
- "members": [
2468
- {
2469
- "kind": "field",
2470
- "name": "inputRef",
2471
- "privacy": "private"
2472
- },
2473
- {
2474
- "kind": "field",
2475
- "name": "listRef",
2476
- "privacy": "private"
2477
- },
2478
- {
2479
- "kind": "field",
2480
- "name": "previousFocus",
2481
- "type": {
2482
- "text": "HTMLElement | undefined"
2483
- },
2484
- "privacy": "private"
2399
+ "name": "previousFocus",
2400
+ "type": {
2401
+ "text": "HTMLElement | undefined"
2402
+ },
2403
+ "privacy": "private"
2485
2404
  },
2486
2405
  {
2487
2406
  "kind": "field",
@@ -3043,60 +2962,141 @@
3043
2962
  },
3044
2963
  {
3045
2964
  "kind": "javascript-module",
3046
- "path": "src/common/attribute.ts",
2965
+ "path": "src/banner/Banner.ts",
3047
2966
  "declarations": [
3048
2967
  {
3049
- "kind": "function",
3050
- "name": "add",
3051
- "parameters": [
3052
- {
3053
- "name": "element",
3054
- "type": {
3055
- "text": "Element"
3056
- }
3057
- },
2968
+ "kind": "class",
2969
+ "description": "Banner informs users about important changes or conditions in the\ninterface. Use this component if you need to communicate to users\nin a prominent way.",
2970
+ "name": "Banner",
2971
+ "cssProperties": [
3058
2972
  {
3059
- "name": "attr",
3060
- "type": {
3061
- "text": "string"
3062
- }
2973
+ "description": "Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).",
2974
+ "name": "--n-banner-border-radius",
2975
+ "default": "var(--n-border-radius)"
3063
2976
  },
3064
2977
  {
3065
- "name": "token",
3066
- "type": {
3067
- "text": "string"
3068
- }
2978
+ "description": "Controls the surrounding shadow, using [box shadow tokens](/tokens/#box-shadow).",
2979
+ "name": "--n-banner-box-shadow",
2980
+ "default": "var(--n-box-shadow-card)"
3069
2981
  }
3070
2982
  ],
3071
- "description": "Carefully adds a token to a space-separated attribute\nSimilar to classList, but for any attribute."
3072
- },
3073
- {
3074
- "kind": "function",
3075
- "name": "remove",
3076
- "parameters": [
3077
- {
3078
- "name": "element",
3079
- "type": {
3080
- "text": "Element"
3081
- }
3082
- },
2983
+ "slots": [
3083
2984
  {
3084
- "name": "attr",
3085
- "type": {
3086
- "text": "string"
3087
- }
3088
- },
2985
+ "description": "default slot",
2986
+ "name": ""
2987
+ }
2988
+ ],
2989
+ "members": [
3089
2990
  {
3090
- "name": "token",
2991
+ "kind": "field",
2992
+ "name": "variant",
3091
2993
  "type": {
3092
- "text": "string"
3093
- }
2994
+ "text": "\"info\" | \"danger\" | \"success\" | \"warning\""
2995
+ },
2996
+ "default": "\"info\"",
2997
+ "description": "The style variant of the banner.",
2998
+ "attribute": "variant",
2999
+ "reflects": true
3094
3000
  }
3095
3001
  ],
3096
- "description": "Carefully removes a token from a space-separated attribute.\nSimilar to classList, but for any attribute."
3097
- }
3098
- ],
3099
- "exports": [
3002
+ "attributes": [
3003
+ {
3004
+ "name": "variant",
3005
+ "type": {
3006
+ "text": "\"info\" | \"danger\" | \"success\" | \"warning\""
3007
+ },
3008
+ "default": "\"info\"",
3009
+ "description": "The style variant of the banner.",
3010
+ "fieldName": "variant"
3011
+ }
3012
+ ],
3013
+ "superclass": {
3014
+ "name": "LitElement",
3015
+ "package": "lit"
3016
+ },
3017
+ "status": "ready",
3018
+ "category": "feedback",
3019
+ "displayName": null,
3020
+ "tagName": "nord-banner",
3021
+ "customElement": true
3022
+ }
3023
+ ],
3024
+ "exports": [
3025
+ {
3026
+ "kind": "js",
3027
+ "name": "default",
3028
+ "declaration": {
3029
+ "name": "Banner",
3030
+ "module": "src/banner/Banner.ts"
3031
+ }
3032
+ },
3033
+ {
3034
+ "kind": "custom-element-definition",
3035
+ "name": "nord-banner",
3036
+ "declaration": {
3037
+ "name": "Banner",
3038
+ "module": "src/banner/Banner.ts"
3039
+ }
3040
+ }
3041
+ ],
3042
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use this component if you need to communicate in a prominent way.\n- Place banner at the top of the section it applies to.\n- Use for highlighting errors and success statuses.\n- Put banner close to the context it’s referring to.\n- Move focus to the banner if it’s relevant to the current workflow.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Move focus to banner if it appears on page load.\n- Use for highlighting general content or as a banner.\n- Use to replace an error page.\n\n</div>\n\n---\n\n## Content guidelines\n\nBanner content should be clear, accurate and easy to understand:\n\n<div class=\"n-usage n-usage-do\">We’re experiencing an incident. Please see our status page for more details.</div>\n<div class=\"n-usage n-usage-dont\">There was an error.</div>\n\nWhen writing banner content, always write it in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">We’re experiencing an incident.</div>\n<div class=\"n-usage n-usage-dont\">We’re Experiencing An Incident.</div>\n\nAlways end in punctuation:\n\n<div class=\"n-usage n-usage-do\">We’re experiencing an incident.</div>\n<div class=\"n-usage n-usage-dont\">We’re experiencing an incident</div>\n"
3043
+ },
3044
+ {
3045
+ "kind": "javascript-module",
3046
+ "path": "src/common/attribute.ts",
3047
+ "declarations": [
3048
+ {
3049
+ "kind": "function",
3050
+ "name": "add",
3051
+ "parameters": [
3052
+ {
3053
+ "name": "element",
3054
+ "type": {
3055
+ "text": "Element"
3056
+ }
3057
+ },
3058
+ {
3059
+ "name": "attr",
3060
+ "type": {
3061
+ "text": "string"
3062
+ }
3063
+ },
3064
+ {
3065
+ "name": "token",
3066
+ "type": {
3067
+ "text": "string"
3068
+ }
3069
+ }
3070
+ ],
3071
+ "description": "Carefully adds a token to a space-separated attribute\nSimilar to classList, but for any attribute."
3072
+ },
3073
+ {
3074
+ "kind": "function",
3075
+ "name": "remove",
3076
+ "parameters": [
3077
+ {
3078
+ "name": "element",
3079
+ "type": {
3080
+ "text": "Element"
3081
+ }
3082
+ },
3083
+ {
3084
+ "name": "attr",
3085
+ "type": {
3086
+ "text": "string"
3087
+ }
3088
+ },
3089
+ {
3090
+ "name": "token",
3091
+ "type": {
3092
+ "text": "string"
3093
+ }
3094
+ }
3095
+ ],
3096
+ "description": "Carefully removes a token from a space-separated attribute.\nSimilar to classList, but for any attribute."
3097
+ }
3098
+ ],
3099
+ "exports": [
3100
3100
  {
3101
3101
  "kind": "js",
3102
3102
  "name": "add",
@@ -11817,217 +11817,285 @@
11817
11817
  },
11818
11818
  {
11819
11819
  "kind": "javascript-module",
11820
- "path": "src/toggle/Toggle.ts",
11820
+ "path": "src/tooltip/Tooltip.ts",
11821
11821
  "declarations": [
11822
11822
  {
11823
11823
  "kind": "class",
11824
- "description": "Toggle switch gives control over a feature or option that can be\nturned on or off. If a physical switch would work for the action, a\ntoggle is probably the best component to use.",
11825
- "name": "Toggle",
11824
+ "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.",
11825
+ "name": "Tooltip",
11826
11826
  "slots": [
11827
11827
  {
11828
- "description": "Use when a label requires more than plain text.",
11829
- "name": "label"
11830
- },
11831
- {
11832
- "description": "Optional slot that holds hint text for the input.",
11833
- "name": "hint"
11828
+ "description": "The tooltip content",
11829
+ "name": ""
11834
11830
  },
11835
11831
  {
11836
- "description": "Optional slot that holds error text for the input.",
11837
- "name": "error"
11832
+ "description": "Optional slot that holds shortcut keys to access the subject",
11833
+ "name": "shortcut"
11838
11834
  }
11839
11835
  ],
11840
11836
  "members": [
11841
11837
  {
11842
11838
  "kind": "field",
11843
- "name": "formValue",
11844
- "privacy": "protected",
11845
- "inheritedFrom": {
11846
- "name": "FormAssociatedMixin",
11847
- "module": "src/common/mixins/FormAssociatedMixin.ts"
11848
- }
11849
- },
11850
- {
11851
- "kind": "field",
11852
- "name": "checked",
11839
+ "name": "lastOpened",
11853
11840
  "type": {
11854
- "text": "boolean"
11841
+ "text": "Tooltip | undefined"
11855
11842
  },
11856
- "default": "false",
11857
- "description": "Controls whether the toggle is checked or not.",
11858
- "attribute": "checked"
11843
+ "privacy": "private",
11844
+ "static": true
11859
11845
  },
11860
11846
  {
11861
11847
  "kind": "field",
11862
- "name": "reverse",
11863
- "type": {
11864
- "text": "boolean"
11865
- },
11866
- "default": "false",
11867
- "description": "Controls whether the contents are displayed in reverse order,\nputting the label before the toggle.",
11868
- "attribute": "reverse"
11848
+ "name": "shortcutSlot",
11849
+ "privacy": "private",
11850
+ "default": "new SlotController(this, \"shortcut\")"
11869
11851
  },
11870
11852
  {
11871
11853
  "kind": "field",
11872
- "name": "size",
11873
- "type": {
11874
- "text": "\"s\" | \"m\" | \"l\""
11875
- },
11876
- "default": "\"m\"",
11877
- "description": "The size of the toggle switch.",
11878
- "attribute": "size",
11879
- "reflects": true
11854
+ "name": "events",
11855
+ "privacy": "private",
11856
+ "default": "new EventController(this)"
11880
11857
  },
11881
11858
  {
11882
- "kind": "method",
11883
- "name": "handleChange",
11884
- "privacy": "protected",
11885
- "parameters": [
11886
- {
11887
- "name": "e",
11888
- "type": {
11889
- "text": "Event"
11890
- }
11891
- }
11892
- ],
11893
- "return": {
11894
- "type": {
11895
- "text": "void"
11896
- }
11859
+ "kind": "field",
11860
+ "name": "currentElement",
11861
+ "type": {
11862
+ "text": "FocusableElement | undefined"
11897
11863
  },
11898
- "inheritedFrom": {
11899
- "name": "FormAssociatedMixin",
11900
- "module": "src/common/mixins/FormAssociatedMixin.ts"
11901
- }
11864
+ "privacy": "private"
11902
11865
  },
11903
11866
  {
11904
11867
  "kind": "field",
11905
- "name": "labelSlot",
11906
- "privacy": "protected",
11907
- "default": "new SlotController(this, \"label\")",
11908
- "inheritedFrom": {
11909
- "name": "FormAssociatedMixin",
11910
- "module": "src/common/mixins/FormAssociatedMixin.ts"
11911
- }
11868
+ "name": "timeoutId",
11869
+ "type": {
11870
+ "text": "ReturnType<typeof setTimeout> | undefined"
11871
+ },
11872
+ "privacy": "private"
11912
11873
  },
11913
11874
  {
11914
11875
  "kind": "field",
11915
- "name": "errorSlot",
11916
- "privacy": "protected",
11917
- "default": "new SlotController(this, \"error\")",
11918
- "inheritedFrom": {
11919
- "name": "FormAssociatedMixin",
11920
- "module": "src/common/mixins/FormAssociatedMixin.ts"
11921
- }
11876
+ "name": "proxy",
11877
+ "privacy": "private",
11878
+ "description": "the proxy element is for cases where the targetElement is a web component,\nand the WC has a focusable child in its shadow root e.g. a button component.\nin this case, when the tooltip is shown, we inject the proxy into targetElement's shadow root\nand wire up aria-describedby from the focusable element to the proxy.\nwhen the tooltip is hidden, we remove the proxy and remove the aria-describedby relationship."
11922
11879
  },
11923
11880
  {
11924
11881
  "kind": "field",
11925
- "name": "hintSlot",
11926
- "privacy": "protected",
11927
- "default": "new SlotController(this, \"hint\")",
11928
- "inheritedFrom": {
11929
- "name": "FormAssociatedMixin",
11930
- "module": "src/common/mixins/FormAssociatedMixin.ts"
11931
- }
11882
+ "name": "state",
11883
+ "type": {
11884
+ "text": "TooltipStates"
11885
+ },
11886
+ "privacy": "private",
11887
+ "default": "\"hidden\"",
11888
+ "description": "The current state of the tooltip, dependent on the state machine"
11932
11889
  },
11933
11890
  {
11934
11891
  "kind": "field",
11935
- "name": "formData",
11936
- "privacy": "protected",
11937
- "default": "new FormDataController(this, { value: () => this.formValue })",
11938
- "inheritedFrom": {
11939
- "name": "FormAssociatedMixin",
11940
- "module": "src/common/mixins/FormAssociatedMixin.ts"
11941
- }
11892
+ "name": "coords",
11893
+ "type": {
11894
+ "text": "[number, number]"
11895
+ },
11896
+ "privacy": "private",
11897
+ "default": "[0, 0]"
11942
11898
  },
11943
11899
  {
11944
11900
  "kind": "field",
11945
- "name": "inputId",
11901
+ "name": "position",
11946
11902
  "type": {
11947
- "text": "string"
11903
+ "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\""
11948
11904
  },
11949
- "privacy": "protected",
11950
- "default": "\"input\"",
11951
- "inheritedFrom": {
11952
- "name": "FormAssociatedMixin",
11953
- "module": "src/common/mixins/FormAssociatedMixin.ts"
11954
- }
11905
+ "default": "\"block-start\"",
11906
+ "description": "Control the position of the tooltip component.\nWhen set to \"none\", the tooltip will be shown above\nbut accommodate for browser boundaries.",
11907
+ "attribute": "position",
11908
+ "reflects": true
11955
11909
  },
11956
11910
  {
11957
11911
  "kind": "field",
11958
- "name": "errorId",
11912
+ "name": "role",
11959
11913
  "type": {
11960
11914
  "text": "string"
11961
11915
  },
11962
- "privacy": "protected",
11963
- "default": "\"error\"",
11964
- "inheritedFrom": {
11965
- "name": "FormAssociatedMixin",
11966
- "module": "src/common/mixins/FormAssociatedMixin.ts"
11967
- }
11916
+ "default": "\"tooltip\"",
11917
+ "description": "The tooltip role, set on the component by default.",
11918
+ "attribute": "role",
11919
+ "reflects": true
11968
11920
  },
11969
11921
  {
11970
11922
  "kind": "field",
11971
- "name": "hintId",
11923
+ "name": "id",
11972
11924
  "type": {
11973
11925
  "text": "string"
11974
11926
  },
11975
- "privacy": "protected",
11976
- "default": "\"hint\"",
11977
- "inheritedFrom": {
11978
- "name": "FormAssociatedMixin",
11979
- "module": "src/common/mixins/FormAssociatedMixin.ts"
11980
- }
11927
+ "default": "\"\"",
11928
+ "description": "The id for the active element to reference via aria-describedby.",
11929
+ "attribute": "id",
11930
+ "reflects": true
11981
11931
  },
11982
11932
  {
11983
11933
  "kind": "field",
11984
- "name": "label",
11934
+ "name": "delay",
11985
11935
  "type": {
11986
- "text": "string"
11936
+ "text": "number"
11987
11937
  },
11988
- "default": "\"\"",
11989
- "description": "Label for the input.",
11990
- "attribute": "label",
11991
- "inheritedFrom": {
11992
- "name": "FormAssociatedMixin",
11993
- "module": "src/common/mixins/FormAssociatedMixin.ts"
11994
- }
11938
+ "default": "500",
11939
+ "description": "The delay in milliseconds before the tooltip is opened.",
11940
+ "attribute": "delay",
11941
+ "reflects": true
11942
+ },
11943
+ {
11944
+ "kind": "method",
11945
+ "name": "handleIdChange",
11946
+ "privacy": "protected"
11947
+ },
11948
+ {
11949
+ "kind": "method",
11950
+ "name": "handleStateChange",
11951
+ "privacy": "private",
11952
+ "parameters": [
11953
+ {
11954
+ "name": "prevState",
11955
+ "type": {
11956
+ "text": "TooltipStates"
11957
+ }
11958
+ }
11959
+ ]
11995
11960
  },
11996
11961
  {
11997
11962
  "kind": "field",
11998
- "name": "hint",
11963
+ "name": "updatePosition",
11964
+ "privacy": "private",
11965
+ "description": "Setting and updating the position of the tooltip"
11966
+ },
11967
+ {
11968
+ "kind": "field",
11969
+ "name": "hideTooltip",
11970
+ "privacy": "private"
11971
+ },
11972
+ {
11973
+ "kind": "field",
11974
+ "name": "reposition",
11975
+ "privacy": "private"
11976
+ },
11977
+ {
11978
+ "kind": "field",
11979
+ "name": "handleShow",
11980
+ "privacy": "private"
11981
+ },
11982
+ {
11983
+ "kind": "field",
11984
+ "name": "handleHide",
11985
+ "privacy": "private"
11986
+ },
11987
+ {
11988
+ "kind": "field",
11989
+ "name": "hideOnEscape",
11990
+ "privacy": "private"
11991
+ },
11992
+ {
11993
+ "kind": "field",
11994
+ "name": "addDescribedBy",
11995
+ "privacy": "private"
11996
+ },
11997
+ {
11998
+ "kind": "field",
11999
+ "name": "removeDescribedBy",
12000
+ "privacy": "private"
12001
+ }
12002
+ ],
12003
+ "attributes": [
12004
+ {
12005
+ "name": "position",
11999
12006
  "type": {
12000
- "text": "string | undefined"
12007
+ "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\""
12001
12008
  },
12002
- "description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
12003
- "attribute": "hint",
12004
- "inheritedFrom": {
12005
- "name": "FormAssociatedMixin",
12006
- "module": "src/common/mixins/FormAssociatedMixin.ts"
12007
- }
12009
+ "default": "\"block-start\"",
12010
+ "description": "Control the position of the tooltip component.\nWhen set to \"none\", the tooltip will be shown above\nbut accommodate for browser boundaries.",
12011
+ "fieldName": "position"
12008
12012
  },
12009
12013
  {
12010
- "kind": "field",
12011
- "name": "hideLabel",
12014
+ "name": "role",
12012
12015
  "type": {
12013
- "text": "boolean"
12016
+ "text": "string"
12014
12017
  },
12015
- "default": "false",
12016
- "description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
12017
- "attribute": "hide-label",
12018
- "inheritedFrom": {
12019
- "name": "FormAssociatedMixin",
12020
- "module": "src/common/mixins/FormAssociatedMixin.ts"
12021
- }
12018
+ "default": "\"tooltip\"",
12019
+ "description": "The tooltip role, set on the component by default.",
12020
+ "fieldName": "role"
12022
12021
  },
12023
12022
  {
12024
- "kind": "field",
12025
- "name": "placeholder",
12023
+ "name": "id",
12026
12024
  "type": {
12027
- "text": "string | undefined"
12025
+ "text": "string"
12028
12026
  },
12029
- "description": "Placeholder text to display within the input.",
12030
- "attribute": "placeholder",
12027
+ "default": "\"\"",
12028
+ "description": "The id for the active element to reference via aria-describedby.",
12029
+ "fieldName": "id"
12030
+ },
12031
+ {
12032
+ "name": "delay",
12033
+ "type": {
12034
+ "text": "number"
12035
+ },
12036
+ "default": "500",
12037
+ "description": "The delay in milliseconds before the tooltip is opened.",
12038
+ "fieldName": "delay"
12039
+ }
12040
+ ],
12041
+ "superclass": {
12042
+ "name": "LitElement",
12043
+ "package": "lit"
12044
+ },
12045
+ "status": "ready",
12046
+ "category": "overlay",
12047
+ "displayName": null,
12048
+ "tagName": "nord-tooltip",
12049
+ "customElement": true
12050
+ }
12051
+ ],
12052
+ "exports": [
12053
+ {
12054
+ "kind": "js",
12055
+ "name": "default",
12056
+ "declaration": {
12057
+ "name": "Tooltip",
12058
+ "module": "src/tooltip/Tooltip.ts"
12059
+ }
12060
+ },
12061
+ {
12062
+ "kind": "custom-element-definition",
12063
+ "name": "nord-tooltip",
12064
+ "declaration": {
12065
+ "name": "Tooltip",
12066
+ "module": "src/tooltip/Tooltip.ts"
12067
+ }
12068
+ }
12069
+ ],
12070
+ "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 tooltip if an interactive element requires more explanation.\n- Use a tooltip to provide additional information, such as UI shortcuts.\n- Use the `label` attribute on icons used for shortcuts for accessibility.\n- Use clear and accurate phrasing.\n- Be consistent with positioning of tooltips in the user interface.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use interactive elements such as links or buttons inside a tooltip.\n- Don’t rely on tooltips when you have room to provide more explanation.\n- Don’t depend on tooltips for vital information.\n\n</div>\n\n---\n\n## Content guidelines\n\nTooltips should be clear and informative, but not imperative to using the interface they refer to. They should not contain interactive elements such as buttons or links.\n\n<div class=\"n-usage n-usage-do\">Export – Export data as a spreadsheet</div>\n<div class=\"n-usage n-usage-dont\">Export – Export data as a CSV, <u>more information on CSVs</u></div>\n\nTooltips should provide useful information and not repeat information that is already present.\n\n<div class=\"n-usage n-usage-do\">Export – Export data as a spreadsheet</div>\n<div class=\"n-usage n-usage-dont\">Export – Export data</div>\n\nWhen writing tooltips, 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\">Export data as a spreadsheet</div>\n<div class=\"n-usage n-usage-dont\">Export Data As a Spreadsheet</div>\n\nUse tooltips sparingly. If your UI is requiring a lot of tooltips, consider revising the interface to provide better explanations and better labelling.\n\n---\n\n## Additional considerations\n\n- Always provide a tooltip for icon-only buttons or a button with an associated keyboard shortcut.\n- Don’t use tooltip to communicate critical information, including errors.\n- Use sparingly. If you’re building something that requires a lot of tooltips, take a step back and work on clarifying the design and the language used instead.\n"
12071
+ },
12072
+ {
12073
+ "kind": "javascript-module",
12074
+ "path": "src/toggle/Toggle.ts",
12075
+ "declarations": [
12076
+ {
12077
+ "kind": "class",
12078
+ "description": "Toggle switch gives control over a feature or option that can be\nturned on or off. If a physical switch would work for the action, a\ntoggle is probably the best component to use.",
12079
+ "name": "Toggle",
12080
+ "slots": [
12081
+ {
12082
+ "description": "Use when a label requires more than plain text.",
12083
+ "name": "label"
12084
+ },
12085
+ {
12086
+ "description": "Optional slot that holds hint text for the input.",
12087
+ "name": "hint"
12088
+ },
12089
+ {
12090
+ "description": "Optional slot that holds error text for the input.",
12091
+ "name": "error"
12092
+ }
12093
+ ],
12094
+ "members": [
12095
+ {
12096
+ "kind": "field",
12097
+ "name": "formValue",
12098
+ "privacy": "protected",
12031
12099
  "inheritedFrom": {
12032
12100
  "name": "FormAssociatedMixin",
12033
12101
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -12035,34 +12103,38 @@
12035
12103
  },
12036
12104
  {
12037
12105
  "kind": "field",
12038
- "name": "error",
12106
+ "name": "checked",
12039
12107
  "type": {
12040
- "text": "string | undefined"
12108
+ "text": "boolean"
12041
12109
  },
12042
- "description": "Optional error to be shown with the input. Alternatively use the error slot.",
12043
- "attribute": "error",
12044
- "inheritedFrom": {
12045
- "name": "FormAssociatedMixin",
12046
- "module": "src/common/mixins/FormAssociatedMixin.ts"
12047
- }
12110
+ "default": "false",
12111
+ "description": "Controls whether the toggle is checked or not.",
12112
+ "attribute": "checked"
12048
12113
  },
12049
12114
  {
12050
12115
  "kind": "field",
12051
- "name": "required",
12116
+ "name": "reverse",
12052
12117
  "type": {
12053
12118
  "text": "boolean"
12054
12119
  },
12055
12120
  "default": "false",
12056
- "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.",
12057
- "attribute": "required",
12058
- "inheritedFrom": {
12059
- "name": "FormAssociatedMixin",
12060
- "module": "src/common/mixins/FormAssociatedMixin.ts"
12061
- }
12121
+ "description": "Controls whether the contents are displayed in reverse order,\nputting the label before the toggle.",
12122
+ "attribute": "reverse"
12123
+ },
12124
+ {
12125
+ "kind": "field",
12126
+ "name": "size",
12127
+ "type": {
12128
+ "text": "\"s\" | \"m\" | \"l\""
12129
+ },
12130
+ "default": "\"m\"",
12131
+ "description": "The size of the toggle switch.",
12132
+ "attribute": "size",
12133
+ "reflects": true
12062
12134
  },
12063
12135
  {
12064
12136
  "kind": "method",
12065
- "name": "handleInput",
12137
+ "name": "handleChange",
12066
12138
  "privacy": "protected",
12067
12139
  "parameters": [
12068
12140
  {
@@ -12072,42 +12144,51 @@
12072
12144
  }
12073
12145
  }
12074
12146
  ],
12147
+ "return": {
12148
+ "type": {
12149
+ "text": "void"
12150
+ }
12151
+ },
12075
12152
  "inheritedFrom": {
12076
12153
  "name": "FormAssociatedMixin",
12077
12154
  "module": "src/common/mixins/FormAssociatedMixin.ts"
12078
12155
  }
12079
12156
  },
12080
12157
  {
12081
- "kind": "method",
12082
- "name": "renderLabel",
12158
+ "kind": "field",
12159
+ "name": "labelSlot",
12083
12160
  "privacy": "protected",
12161
+ "default": "new SlotController(this, \"label\")",
12084
12162
  "inheritedFrom": {
12085
12163
  "name": "FormAssociatedMixin",
12086
12164
  "module": "src/common/mixins/FormAssociatedMixin.ts"
12087
12165
  }
12088
12166
  },
12089
12167
  {
12090
- "kind": "method",
12091
- "name": "renderError",
12168
+ "kind": "field",
12169
+ "name": "errorSlot",
12092
12170
  "privacy": "protected",
12171
+ "default": "new SlotController(this, \"error\")",
12093
12172
  "inheritedFrom": {
12094
12173
  "name": "FormAssociatedMixin",
12095
12174
  "module": "src/common/mixins/FormAssociatedMixin.ts"
12096
12175
  }
12097
12176
  },
12098
12177
  {
12099
- "kind": "method",
12100
- "name": "getDescribedBy",
12178
+ "kind": "field",
12179
+ "name": "hintSlot",
12101
12180
  "privacy": "protected",
12181
+ "default": "new SlotController(this, \"hint\")",
12102
12182
  "inheritedFrom": {
12103
12183
  "name": "FormAssociatedMixin",
12104
12184
  "module": "src/common/mixins/FormAssociatedMixin.ts"
12105
12185
  }
12106
12186
  },
12107
12187
  {
12108
- "kind": "method",
12109
- "name": "getInvalid",
12188
+ "kind": "field",
12189
+ "name": "formData",
12110
12190
  "privacy": "protected",
12191
+ "default": "new FormDataController(this, { value: () => this.formValue })",
12111
12192
  "inheritedFrom": {
12112
12193
  "name": "FormAssociatedMixin",
12113
12194
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -12115,17 +12196,12 @@
12115
12196
  },
12116
12197
  {
12117
12198
  "kind": "field",
12118
- "name": "hasHint",
12119
- "privacy": "protected",
12120
- "inheritedFrom": {
12121
- "name": "FormAssociatedMixin",
12122
- "module": "src/common/mixins/FormAssociatedMixin.ts"
12123
- }
12124
- },
12125
- {
12126
- "kind": "field",
12127
- "name": "hasError",
12199
+ "name": "inputId",
12200
+ "type": {
12201
+ "text": "string"
12202
+ },
12128
12203
  "privacy": "protected",
12204
+ "default": "\"input\"",
12129
12205
  "inheritedFrom": {
12130
12206
  "name": "FormAssociatedMixin",
12131
12207
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -12133,545 +12209,469 @@
12133
12209
  },
12134
12210
  {
12135
12211
  "kind": "field",
12136
- "name": "disabled",
12137
- "type": {
12138
- "text": "boolean"
12139
- },
12140
- "default": "false",
12141
- "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
12142
- "attribute": "disabled",
12143
- "reflects": true,
12144
- "inheritedFrom": {
12145
- "name": "InputMixin",
12146
- "module": "src/common/mixins/InputMixin.ts"
12147
- }
12148
- },
12149
- {
12150
- "kind": "field",
12151
- "name": "name",
12212
+ "name": "errorId",
12152
12213
  "type": {
12153
- "text": "string | undefined"
12214
+ "text": "string"
12154
12215
  },
12155
- "description": "The name of the form component.",
12156
- "attribute": "name",
12216
+ "privacy": "protected",
12217
+ "default": "\"error\"",
12157
12218
  "inheritedFrom": {
12158
- "name": "InputMixin",
12159
- "module": "src/common/mixins/InputMixin.ts"
12219
+ "name": "FormAssociatedMixin",
12220
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
12160
12221
  }
12161
12222
  },
12162
12223
  {
12163
12224
  "kind": "field",
12164
- "name": "value",
12225
+ "name": "hintId",
12165
12226
  "type": {
12166
12227
  "text": "string"
12167
12228
  },
12168
- "default": "\"\"",
12169
- "description": "The value of the form component.",
12170
- "attribute": "value",
12171
- "inheritedFrom": {
12172
- "name": "InputMixin",
12173
- "module": "src/common/mixins/InputMixin.ts"
12174
- }
12175
- },
12176
- {
12177
- "kind": "field",
12178
- "name": "form",
12179
- "description": "Gets the form, if any, associated with the form element.",
12180
- "inheritedFrom": {
12181
- "name": "InputMixin",
12182
- "module": "src/common/mixins/InputMixin.ts"
12183
- }
12184
- },
12185
- {
12186
- "kind": "field",
12187
- "name": "focusableRef",
12188
12229
  "privacy": "protected",
12230
+ "default": "\"hint\"",
12189
12231
  "inheritedFrom": {
12190
- "name": "FocusableMixin",
12191
- "module": "src/common/mixins/FocusableMixin.ts"
12192
- }
12193
- },
12194
- {
12195
- "kind": "method",
12196
- "name": "focus",
12197
- "parameters": [
12198
- {
12199
- "name": "options",
12200
- "optional": true,
12201
- "type": {
12202
- "text": "FocusOptions"
12203
- },
12204
- "description": "An object which controls aspects of the focusing process."
12205
- }
12206
- ],
12207
- "description": "Programmatically move focus to the component.",
12208
- "inheritedFrom": {
12209
- "name": "FocusableMixin",
12210
- "module": "src/common/mixins/FocusableMixin.ts"
12211
- }
12212
- },
12213
- {
12214
- "kind": "method",
12215
- "name": "blur",
12216
- "description": "Programmatically remove focus from the component.",
12217
- "inheritedFrom": {
12218
- "name": "FocusableMixin",
12219
- "module": "src/common/mixins/FocusableMixin.ts"
12220
- }
12221
- },
12222
- {
12223
- "kind": "method",
12224
- "name": "click",
12225
- "description": "Programmatically simulates a click on the component.",
12226
- "inheritedFrom": {
12227
- "name": "FocusableMixin",
12228
- "module": "src/common/mixins/FocusableMixin.ts"
12232
+ "name": "FormAssociatedMixin",
12233
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
12229
12234
  }
12230
- }
12231
- ],
12232
- "attributes": [
12233
- {
12234
- "name": "checked",
12235
- "type": {
12236
- "text": "boolean"
12237
- },
12238
- "default": "false",
12239
- "description": "Controls whether the toggle is checked or not.",
12240
- "fieldName": "checked"
12241
- },
12242
- {
12243
- "name": "reverse",
12244
- "type": {
12245
- "text": "boolean"
12246
- },
12247
- "default": "false",
12248
- "description": "Controls whether the contents are displayed in reverse order,\nputting the label before the toggle.",
12249
- "fieldName": "reverse"
12250
- },
12251
- {
12252
- "name": "size",
12253
- "type": {
12254
- "text": "\"s\" | \"m\" | \"l\""
12255
- },
12256
- "default": "\"m\"",
12257
- "description": "The size of the toggle switch.",
12258
- "fieldName": "size"
12259
12235
  },
12260
12236
  {
12237
+ "kind": "field",
12261
12238
  "name": "label",
12262
12239
  "type": {
12263
12240
  "text": "string"
12264
12241
  },
12265
12242
  "default": "\"\"",
12266
12243
  "description": "Label for the input.",
12267
- "fieldName": "label",
12244
+ "attribute": "label",
12268
12245
  "inheritedFrom": {
12269
12246
  "name": "FormAssociatedMixin",
12270
12247
  "module": "src/common/mixins/FormAssociatedMixin.ts"
12271
12248
  }
12272
12249
  },
12273
12250
  {
12251
+ "kind": "field",
12274
12252
  "name": "hint",
12275
12253
  "type": {
12276
12254
  "text": "string | undefined"
12277
12255
  },
12278
12256
  "description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
12279
- "fieldName": "hint",
12257
+ "attribute": "hint",
12280
12258
  "inheritedFrom": {
12281
12259
  "name": "FormAssociatedMixin",
12282
12260
  "module": "src/common/mixins/FormAssociatedMixin.ts"
12283
12261
  }
12284
12262
  },
12285
12263
  {
12286
- "name": "hide-label",
12264
+ "kind": "field",
12265
+ "name": "hideLabel",
12287
12266
  "type": {
12288
12267
  "text": "boolean"
12289
12268
  },
12290
12269
  "default": "false",
12291
12270
  "description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
12292
- "fieldName": "hideLabel",
12271
+ "attribute": "hide-label",
12293
12272
  "inheritedFrom": {
12294
12273
  "name": "FormAssociatedMixin",
12295
12274
  "module": "src/common/mixins/FormAssociatedMixin.ts"
12296
12275
  }
12297
12276
  },
12298
12277
  {
12278
+ "kind": "field",
12299
12279
  "name": "placeholder",
12300
12280
  "type": {
12301
12281
  "text": "string | undefined"
12302
12282
  },
12303
12283
  "description": "Placeholder text to display within the input.",
12304
- "fieldName": "placeholder",
12284
+ "attribute": "placeholder",
12305
12285
  "inheritedFrom": {
12306
12286
  "name": "FormAssociatedMixin",
12307
12287
  "module": "src/common/mixins/FormAssociatedMixin.ts"
12308
12288
  }
12309
12289
  },
12310
12290
  {
12291
+ "kind": "field",
12311
12292
  "name": "error",
12312
12293
  "type": {
12313
12294
  "text": "string | undefined"
12314
12295
  },
12315
12296
  "description": "Optional error to be shown with the input. Alternatively use the error slot.",
12316
- "fieldName": "error",
12297
+ "attribute": "error",
12317
12298
  "inheritedFrom": {
12318
12299
  "name": "FormAssociatedMixin",
12319
12300
  "module": "src/common/mixins/FormAssociatedMixin.ts"
12320
12301
  }
12321
12302
  },
12322
12303
  {
12304
+ "kind": "field",
12323
12305
  "name": "required",
12324
12306
  "type": {
12325
12307
  "text": "boolean"
12326
12308
  },
12327
12309
  "default": "false",
12328
12310
  "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.",
12329
- "fieldName": "required",
12311
+ "attribute": "required",
12330
12312
  "inheritedFrom": {
12331
12313
  "name": "FormAssociatedMixin",
12332
12314
  "module": "src/common/mixins/FormAssociatedMixin.ts"
12333
12315
  }
12334
12316
  },
12335
12317
  {
12336
- "name": "disabled",
12337
- "type": {
12338
- "text": "boolean"
12339
- },
12340
- "default": "false",
12341
- "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
12342
- "fieldName": "disabled",
12318
+ "kind": "method",
12319
+ "name": "handleInput",
12320
+ "privacy": "protected",
12321
+ "parameters": [
12322
+ {
12323
+ "name": "e",
12324
+ "type": {
12325
+ "text": "Event"
12326
+ }
12327
+ }
12328
+ ],
12343
12329
  "inheritedFrom": {
12344
- "name": "InputMixin",
12345
- "module": "src/common/mixins/InputMixin.ts"
12330
+ "name": "FormAssociatedMixin",
12331
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
12346
12332
  }
12347
12333
  },
12348
12334
  {
12349
- "name": "name",
12350
- "type": {
12351
- "text": "string | undefined"
12352
- },
12353
- "description": "The name of the form component.",
12354
- "fieldName": "name",
12335
+ "kind": "method",
12336
+ "name": "renderLabel",
12337
+ "privacy": "protected",
12355
12338
  "inheritedFrom": {
12356
- "name": "InputMixin",
12357
- "module": "src/common/mixins/InputMixin.ts"
12339
+ "name": "FormAssociatedMixin",
12340
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
12358
12341
  }
12359
12342
  },
12360
12343
  {
12361
- "name": "value",
12362
- "type": {
12363
- "text": "string"
12364
- },
12365
- "default": "\"\"",
12366
- "description": "The value of the form component.",
12367
- "fieldName": "value",
12344
+ "kind": "method",
12345
+ "name": "renderError",
12346
+ "privacy": "protected",
12368
12347
  "inheritedFrom": {
12369
- "name": "InputMixin",
12370
- "module": "src/common/mixins/InputMixin.ts"
12348
+ "name": "FormAssociatedMixin",
12349
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
12371
12350
  }
12372
- }
12373
- ],
12374
- "mixins": [
12375
- {
12376
- "name": "FormAssociatedMixin",
12377
- "module": "/src/common/mixins/FormAssociatedMixin.js"
12378
- },
12379
- {
12380
- "name": "InputMixin",
12381
- "module": "/src/common/mixins/InputMixin.js"
12382
12351
  },
12383
12352
  {
12384
- "name": "FocusableMixin",
12385
- "module": "/src/common/mixins/FocusableMixin.js"
12386
- }
12387
- ],
12388
- "superclass": {
12389
- "name": "LitElement",
12390
- "package": "lit"
12391
- },
12392
- "status": "new",
12393
- "category": "form",
12394
- "displayName": null,
12395
- "tagName": "nord-toggle",
12396
- "customElement": true,
12397
- "events": [
12398
- {
12399
- "name": "input",
12400
- "type": {
12401
- "text": "NordEvent"
12402
- },
12403
- "description": "Fired as the user types into the input.",
12353
+ "kind": "method",
12354
+ "name": "getDescribedBy",
12355
+ "privacy": "protected",
12404
12356
  "inheritedFrom": {
12405
12357
  "name": "FormAssociatedMixin",
12406
12358
  "module": "src/common/mixins/FormAssociatedMixin.ts"
12407
12359
  }
12408
12360
  },
12409
12361
  {
12410
- "name": "change",
12411
- "type": {
12412
- "text": "NordEvent"
12413
- },
12414
- "description": "Fired whenever the input's value is changed via user interaction.",
12362
+ "kind": "method",
12363
+ "name": "getInvalid",
12364
+ "privacy": "protected",
12415
12365
  "inheritedFrom": {
12416
12366
  "name": "FormAssociatedMixin",
12417
12367
  "module": "src/common/mixins/FormAssociatedMixin.ts"
12418
12368
  }
12419
- }
12420
- ]
12421
- }
12422
- ],
12423
- "exports": [
12424
- {
12425
- "kind": "js",
12426
- "name": "default",
12427
- "declaration": {
12428
- "name": "Toggle",
12429
- "module": "src/toggle/Toggle.ts"
12430
- }
12431
- },
12432
- {
12433
- "kind": "custom-element-definition",
12434
- "name": "nord-toggle",
12435
- "declaration": {
12436
- "name": "Toggle",
12437
- "module": "src/toggle/Toggle.ts"
12438
- }
12439
- }
12440
- ],
12441
- "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 toggles when your intent is to turn something on or off instantly.\n- Use for any feature or option that can be turned on or off.\n- If a physical switch would work for the action, the toggle is probably the best component to use.\n- Use for making it possible to choose one or more options from a limited number of options.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Toggles should never require users to click a button to apply or save the setting.\n- Avoid using when you have more than 10 options to choose from.\n- Don’t change the selection of another toggle when another one is clicked. Only exception is when a toggle is used to make a bulk selection of multiple items.\n\n</div>\n\n---\n\n## Content guidelines\n\nToggle 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 toggle 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"
12442
- },
12443
- {
12444
- "kind": "javascript-module",
12445
- "path": "src/tooltip/Tooltip.ts",
12446
- "declarations": [
12447
- {
12448
- "kind": "class",
12449
- "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.",
12450
- "name": "Tooltip",
12451
- "slots": [
12452
- {
12453
- "description": "The tooltip content",
12454
- "name": ""
12455
12369
  },
12456
- {
12457
- "description": "Optional slot that holds shortcut keys to access the subject",
12458
- "name": "shortcut"
12459
- }
12460
- ],
12461
- "members": [
12462
12370
  {
12463
12371
  "kind": "field",
12464
- "name": "lastOpened",
12465
- "type": {
12466
- "text": "Tooltip | undefined"
12467
- },
12468
- "privacy": "private",
12469
- "static": true
12372
+ "name": "hasHint",
12373
+ "privacy": "protected",
12374
+ "inheritedFrom": {
12375
+ "name": "FormAssociatedMixin",
12376
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
12377
+ }
12470
12378
  },
12471
12379
  {
12472
12380
  "kind": "field",
12473
- "name": "shortcutSlot",
12474
- "privacy": "private",
12475
- "default": "new SlotController(this, \"shortcut\")"
12381
+ "name": "hasError",
12382
+ "privacy": "protected",
12383
+ "inheritedFrom": {
12384
+ "name": "FormAssociatedMixin",
12385
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
12386
+ }
12476
12387
  },
12477
12388
  {
12478
12389
  "kind": "field",
12479
- "name": "events",
12480
- "privacy": "private",
12481
- "default": "new EventController(this)"
12390
+ "name": "disabled",
12391
+ "type": {
12392
+ "text": "boolean"
12393
+ },
12394
+ "default": "false",
12395
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
12396
+ "attribute": "disabled",
12397
+ "reflects": true,
12398
+ "inheritedFrom": {
12399
+ "name": "InputMixin",
12400
+ "module": "src/common/mixins/InputMixin.ts"
12401
+ }
12482
12402
  },
12483
12403
  {
12484
12404
  "kind": "field",
12485
- "name": "currentElement",
12405
+ "name": "name",
12486
12406
  "type": {
12487
- "text": "FocusableElement | undefined"
12407
+ "text": "string | undefined"
12488
12408
  },
12489
- "privacy": "private"
12409
+ "description": "The name of the form component.",
12410
+ "attribute": "name",
12411
+ "inheritedFrom": {
12412
+ "name": "InputMixin",
12413
+ "module": "src/common/mixins/InputMixin.ts"
12414
+ }
12490
12415
  },
12491
12416
  {
12492
12417
  "kind": "field",
12493
- "name": "timeoutId",
12418
+ "name": "value",
12494
12419
  "type": {
12495
- "text": "ReturnType<typeof setTimeout> | undefined"
12420
+ "text": "string"
12496
12421
  },
12497
- "privacy": "private"
12422
+ "default": "\"\"",
12423
+ "description": "The value of the form component.",
12424
+ "attribute": "value",
12425
+ "inheritedFrom": {
12426
+ "name": "InputMixin",
12427
+ "module": "src/common/mixins/InputMixin.ts"
12428
+ }
12498
12429
  },
12499
12430
  {
12500
12431
  "kind": "field",
12501
- "name": "proxy",
12502
- "privacy": "private",
12503
- "description": "the proxy element is for cases where the targetElement is a web component,\nand the WC has a focusable child in its shadow root e.g. a button component.\nin this case, when the tooltip is shown, we inject the proxy into targetElement's shadow root\nand wire up aria-describedby from the focusable element to the proxy.\nwhen the tooltip is hidden, we remove the proxy and remove the aria-describedby relationship."
12432
+ "name": "form",
12433
+ "description": "Gets the form, if any, associated with the form element.",
12434
+ "inheritedFrom": {
12435
+ "name": "InputMixin",
12436
+ "module": "src/common/mixins/InputMixin.ts"
12437
+ }
12504
12438
  },
12505
12439
  {
12506
12440
  "kind": "field",
12507
- "name": "state",
12508
- "type": {
12509
- "text": "TooltipStates"
12510
- },
12511
- "privacy": "private",
12512
- "default": "\"hidden\"",
12513
- "description": "The current state of the tooltip, dependent on the state machine"
12441
+ "name": "focusableRef",
12442
+ "privacy": "protected",
12443
+ "inheritedFrom": {
12444
+ "name": "FocusableMixin",
12445
+ "module": "src/common/mixins/FocusableMixin.ts"
12446
+ }
12514
12447
  },
12515
12448
  {
12516
- "kind": "field",
12517
- "name": "coords",
12518
- "type": {
12519
- "text": "[number, number]"
12520
- },
12521
- "privacy": "private",
12522
- "default": "[0, 0]"
12449
+ "kind": "method",
12450
+ "name": "focus",
12451
+ "parameters": [
12452
+ {
12453
+ "name": "options",
12454
+ "optional": true,
12455
+ "type": {
12456
+ "text": "FocusOptions"
12457
+ },
12458
+ "description": "An object which controls aspects of the focusing process."
12459
+ }
12460
+ ],
12461
+ "description": "Programmatically move focus to the component.",
12462
+ "inheritedFrom": {
12463
+ "name": "FocusableMixin",
12464
+ "module": "src/common/mixins/FocusableMixin.ts"
12465
+ }
12523
12466
  },
12524
12467
  {
12525
- "kind": "field",
12526
- "name": "position",
12527
- "type": {
12528
- "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\""
12529
- },
12530
- "default": "\"block-start\"",
12531
- "description": "Control the position of the tooltip component.\nWhen set to \"none\", the tooltip will be shown above\nbut accommodate for browser boundaries.",
12532
- "attribute": "position",
12533
- "reflects": true
12468
+ "kind": "method",
12469
+ "name": "blur",
12470
+ "description": "Programmatically remove focus from the component.",
12471
+ "inheritedFrom": {
12472
+ "name": "FocusableMixin",
12473
+ "module": "src/common/mixins/FocusableMixin.ts"
12474
+ }
12534
12475
  },
12535
12476
  {
12536
- "kind": "field",
12537
- "name": "role",
12477
+ "kind": "method",
12478
+ "name": "click",
12479
+ "description": "Programmatically simulates a click on the component.",
12480
+ "inheritedFrom": {
12481
+ "name": "FocusableMixin",
12482
+ "module": "src/common/mixins/FocusableMixin.ts"
12483
+ }
12484
+ }
12485
+ ],
12486
+ "attributes": [
12487
+ {
12488
+ "name": "checked",
12538
12489
  "type": {
12539
- "text": "string"
12490
+ "text": "boolean"
12540
12491
  },
12541
- "default": "\"tooltip\"",
12542
- "description": "The tooltip role, set on the component by default.",
12543
- "attribute": "role",
12544
- "reflects": true
12492
+ "default": "false",
12493
+ "description": "Controls whether the toggle is checked or not.",
12494
+ "fieldName": "checked"
12545
12495
  },
12546
12496
  {
12547
- "kind": "field",
12548
- "name": "id",
12497
+ "name": "reverse",
12549
12498
  "type": {
12550
- "text": "string"
12499
+ "text": "boolean"
12551
12500
  },
12552
- "default": "\"\"",
12553
- "description": "The id for the active element to reference via aria-describedby.",
12554
- "attribute": "id",
12555
- "reflects": true
12501
+ "default": "false",
12502
+ "description": "Controls whether the contents are displayed in reverse order,\nputting the label before the toggle.",
12503
+ "fieldName": "reverse"
12556
12504
  },
12557
12505
  {
12558
- "kind": "field",
12559
- "name": "delay",
12506
+ "name": "size",
12560
12507
  "type": {
12561
- "text": "number"
12508
+ "text": "\"s\" | \"m\" | \"l\""
12562
12509
  },
12563
- "default": "500",
12564
- "description": "The delay in milliseconds before the tooltip is opened.",
12565
- "attribute": "delay",
12566
- "reflects": true
12567
- },
12568
- {
12569
- "kind": "method",
12570
- "name": "handleIdChange",
12571
- "privacy": "protected"
12572
- },
12573
- {
12574
- "kind": "method",
12575
- "name": "handleStateChange",
12576
- "privacy": "private",
12577
- "parameters": [
12578
- {
12579
- "name": "prevState",
12580
- "type": {
12581
- "text": "TooltipStates"
12582
- }
12583
- }
12584
- ]
12585
- },
12586
- {
12587
- "kind": "field",
12588
- "name": "updatePosition",
12589
- "privacy": "private",
12590
- "description": "Setting and updating the position of the tooltip"
12591
- },
12592
- {
12593
- "kind": "field",
12594
- "name": "hideTooltip",
12595
- "privacy": "private"
12510
+ "default": "\"m\"",
12511
+ "description": "The size of the toggle switch.",
12512
+ "fieldName": "size"
12596
12513
  },
12597
12514
  {
12598
- "kind": "field",
12599
- "name": "reposition",
12600
- "privacy": "private"
12515
+ "name": "label",
12516
+ "type": {
12517
+ "text": "string"
12518
+ },
12519
+ "default": "\"\"",
12520
+ "description": "Label for the input.",
12521
+ "fieldName": "label",
12522
+ "inheritedFrom": {
12523
+ "name": "FormAssociatedMixin",
12524
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
12525
+ }
12601
12526
  },
12602
12527
  {
12603
- "kind": "field",
12604
- "name": "handleShow",
12605
- "privacy": "private"
12528
+ "name": "hint",
12529
+ "type": {
12530
+ "text": "string | undefined"
12531
+ },
12532
+ "description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
12533
+ "fieldName": "hint",
12534
+ "inheritedFrom": {
12535
+ "name": "FormAssociatedMixin",
12536
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
12537
+ }
12606
12538
  },
12607
12539
  {
12608
- "kind": "field",
12609
- "name": "handleHide",
12610
- "privacy": "private"
12540
+ "name": "hide-label",
12541
+ "type": {
12542
+ "text": "boolean"
12543
+ },
12544
+ "default": "false",
12545
+ "description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
12546
+ "fieldName": "hideLabel",
12547
+ "inheritedFrom": {
12548
+ "name": "FormAssociatedMixin",
12549
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
12550
+ }
12611
12551
  },
12612
12552
  {
12613
- "kind": "field",
12614
- "name": "hideOnEscape",
12615
- "privacy": "private"
12553
+ "name": "placeholder",
12554
+ "type": {
12555
+ "text": "string | undefined"
12556
+ },
12557
+ "description": "Placeholder text to display within the input.",
12558
+ "fieldName": "placeholder",
12559
+ "inheritedFrom": {
12560
+ "name": "FormAssociatedMixin",
12561
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
12562
+ }
12616
12563
  },
12617
12564
  {
12618
- "kind": "field",
12619
- "name": "addDescribedBy",
12620
- "privacy": "private"
12565
+ "name": "error",
12566
+ "type": {
12567
+ "text": "string | undefined"
12568
+ },
12569
+ "description": "Optional error to be shown with the input. Alternatively use the error slot.",
12570
+ "fieldName": "error",
12571
+ "inheritedFrom": {
12572
+ "name": "FormAssociatedMixin",
12573
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
12574
+ }
12621
12575
  },
12622
12576
  {
12623
- "kind": "field",
12624
- "name": "removeDescribedBy",
12625
- "privacy": "private"
12626
- }
12627
- ],
12628
- "attributes": [
12577
+ "name": "required",
12578
+ "type": {
12579
+ "text": "boolean"
12580
+ },
12581
+ "default": "false",
12582
+ "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.",
12583
+ "fieldName": "required",
12584
+ "inheritedFrom": {
12585
+ "name": "FormAssociatedMixin",
12586
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
12587
+ }
12588
+ },
12629
12589
  {
12630
- "name": "position",
12590
+ "name": "disabled",
12631
12591
  "type": {
12632
- "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\""
12592
+ "text": "boolean"
12633
12593
  },
12634
- "default": "\"block-start\"",
12635
- "description": "Control the position of the tooltip component.\nWhen set to \"none\", the tooltip will be shown above\nbut accommodate for browser boundaries.",
12636
- "fieldName": "position"
12594
+ "default": "false",
12595
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
12596
+ "fieldName": "disabled",
12597
+ "inheritedFrom": {
12598
+ "name": "InputMixin",
12599
+ "module": "src/common/mixins/InputMixin.ts"
12600
+ }
12637
12601
  },
12638
12602
  {
12639
- "name": "role",
12603
+ "name": "name",
12640
12604
  "type": {
12641
- "text": "string"
12605
+ "text": "string | undefined"
12642
12606
  },
12643
- "default": "\"tooltip\"",
12644
- "description": "The tooltip role, set on the component by default.",
12645
- "fieldName": "role"
12607
+ "description": "The name of the form component.",
12608
+ "fieldName": "name",
12609
+ "inheritedFrom": {
12610
+ "name": "InputMixin",
12611
+ "module": "src/common/mixins/InputMixin.ts"
12612
+ }
12646
12613
  },
12647
12614
  {
12648
- "name": "id",
12615
+ "name": "value",
12649
12616
  "type": {
12650
12617
  "text": "string"
12651
12618
  },
12652
12619
  "default": "\"\"",
12653
- "description": "The id for the active element to reference via aria-describedby.",
12654
- "fieldName": "id"
12620
+ "description": "The value of the form component.",
12621
+ "fieldName": "value",
12622
+ "inheritedFrom": {
12623
+ "name": "InputMixin",
12624
+ "module": "src/common/mixins/InputMixin.ts"
12625
+ }
12626
+ }
12627
+ ],
12628
+ "mixins": [
12629
+ {
12630
+ "name": "FormAssociatedMixin",
12631
+ "module": "/src/common/mixins/FormAssociatedMixin.js"
12655
12632
  },
12656
12633
  {
12657
- "name": "delay",
12658
- "type": {
12659
- "text": "number"
12660
- },
12661
- "default": "500",
12662
- "description": "The delay in milliseconds before the tooltip is opened.",
12663
- "fieldName": "delay"
12634
+ "name": "InputMixin",
12635
+ "module": "/src/common/mixins/InputMixin.js"
12636
+ },
12637
+ {
12638
+ "name": "FocusableMixin",
12639
+ "module": "/src/common/mixins/FocusableMixin.js"
12664
12640
  }
12665
12641
  ],
12666
12642
  "superclass": {
12667
12643
  "name": "LitElement",
12668
12644
  "package": "lit"
12669
12645
  },
12670
- "status": "ready",
12671
- "category": "overlay",
12646
+ "status": "new",
12647
+ "category": "form",
12672
12648
  "displayName": null,
12673
- "tagName": "nord-tooltip",
12674
- "customElement": true
12649
+ "tagName": "nord-toggle",
12650
+ "customElement": true,
12651
+ "events": [
12652
+ {
12653
+ "name": "input",
12654
+ "type": {
12655
+ "text": "NordEvent"
12656
+ },
12657
+ "description": "Fired as the user types into the input.",
12658
+ "inheritedFrom": {
12659
+ "name": "FormAssociatedMixin",
12660
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
12661
+ }
12662
+ },
12663
+ {
12664
+ "name": "change",
12665
+ "type": {
12666
+ "text": "NordEvent"
12667
+ },
12668
+ "description": "Fired whenever the input's value is changed via user interaction.",
12669
+ "inheritedFrom": {
12670
+ "name": "FormAssociatedMixin",
12671
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
12672
+ }
12673
+ }
12674
+ ]
12675
12675
  }
12676
12676
  ],
12677
12677
  "exports": [
@@ -12679,20 +12679,20 @@
12679
12679
  "kind": "js",
12680
12680
  "name": "default",
12681
12681
  "declaration": {
12682
- "name": "Tooltip",
12683
- "module": "src/tooltip/Tooltip.ts"
12682
+ "name": "Toggle",
12683
+ "module": "src/toggle/Toggle.ts"
12684
12684
  }
12685
12685
  },
12686
12686
  {
12687
12687
  "kind": "custom-element-definition",
12688
- "name": "nord-tooltip",
12688
+ "name": "nord-toggle",
12689
12689
  "declaration": {
12690
- "name": "Tooltip",
12691
- "module": "src/tooltip/Tooltip.ts"
12690
+ "name": "Toggle",
12691
+ "module": "src/toggle/Toggle.ts"
12692
12692
  }
12693
12693
  }
12694
12694
  ],
12695
- "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 tooltip if an interactive element requires more explanation.\n- Use a tooltip to provide additional information, such as UI shortcuts.\n- Use the `label` attribute on icons used for shortcuts for accessibility.\n- Use clear and accurate phrasing.\n- Be consistent with positioning of tooltips in the user interface.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use interactive elements such as links or buttons inside a tooltip.\n- Don’t rely on tooltips when you have room to provide more explanation.\n- Don’t depend on tooltips for vital information.\n\n</div>\n\n---\n\n## Content guidelines\n\nTooltips should be clear and informative, but not imperative to using the interface they refer to. They should not contain interactive elements such as buttons or links.\n\n<div class=\"n-usage n-usage-do\">Export – Export data as a spreadsheet</div>\n<div class=\"n-usage n-usage-dont\">Export Export data as a CSV, <u>more information on CSVs</u></div>\n\nTooltips should provide useful information and not repeat information that is already present.\n\n<div class=\"n-usage n-usage-do\">Export – Export data as a spreadsheet</div>\n<div class=\"n-usage n-usage-dont\">Export – Export data</div>\n\nWhen writing tooltips, 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\">Export data as a spreadsheet</div>\n<div class=\"n-usage n-usage-dont\">Export Data As a Spreadsheet</div>\n\nUse tooltips sparingly. If your UI is requiring a lot of tooltips, consider revising the interface to provide better explanations and better labelling.\n\n---\n\n## Additional considerations\n\n- Always provide a tooltip for icon-only buttons or a button with an associated keyboard shortcut.\n- Don’t use tooltip to communicate critical information, including errors.\n- Use sparingly. If you’re building something that requires a lot of tooltips, take a step back and work on clarifying the design and the language used instead.\n"
12695
+ "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 toggles when your intent is to turn something on or off instantly.\n- Use for any feature or option that can be turned on or off.\n- If a physical switch would work for the action, the toggle is probably the best component to use.\n- Use for making it possible to choose one or more options from a limited number of options.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Toggles should never require users to click a button to apply or save the setting.\n- Avoid using when you have more than 10 options to choose from.\n- Don’t change the selection of another toggle when another one is clicked. Only exception is when a toggle is used to make a bulk selection of multiple items.\n\n</div>\n\n---\n\n## Content guidelines\n\nToggle 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 toggle 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"
12696
12696
  },
12697
12697
  {
12698
12698
  "kind": "javascript-module",
@@ -12740,6 +12740,41 @@
12740
12740
  ],
12741
12741
  "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"
12742
12742
  },
12743
+ {
12744
+ "kind": "javascript-module",
12745
+ "path": "src/common/decorators/observe.ts",
12746
+ "declarations": [
12747
+ {
12748
+ "kind": "function",
12749
+ "name": "observe",
12750
+ "parameters": [
12751
+ {
12752
+ "name": "propertyName",
12753
+ "type": {
12754
+ "text": "string"
12755
+ }
12756
+ },
12757
+ {
12758
+ "name": "lifecycle",
12759
+ "default": "\"update\"",
12760
+ "type": {
12761
+ "text": "ObserveLifecycle"
12762
+ }
12763
+ }
12764
+ ]
12765
+ }
12766
+ ],
12767
+ "exports": [
12768
+ {
12769
+ "kind": "js",
12770
+ "name": "observe",
12771
+ "declaration": {
12772
+ "name": "observe",
12773
+ "module": "src/common/decorators/observe.ts"
12774
+ }
12775
+ }
12776
+ ]
12777
+ },
12743
12778
  {
12744
12779
  "kind": "javascript-module",
12745
12780
  "path": "src/common/controllers/DirectionController.ts",
@@ -13760,41 +13795,6 @@
13760
13795
  }
13761
13796
  ]
13762
13797
  },
13763
- {
13764
- "kind": "javascript-module",
13765
- "path": "src/common/decorators/observe.ts",
13766
- "declarations": [
13767
- {
13768
- "kind": "function",
13769
- "name": "observe",
13770
- "parameters": [
13771
- {
13772
- "name": "propertyName",
13773
- "type": {
13774
- "text": "string"
13775
- }
13776
- },
13777
- {
13778
- "name": "lifecycle",
13779
- "default": "\"update\"",
13780
- "type": {
13781
- "text": "ObserveLifecycle"
13782
- }
13783
- }
13784
- ]
13785
- }
13786
- ],
13787
- "exports": [
13788
- {
13789
- "kind": "js",
13790
- "name": "observe",
13791
- "declaration": {
13792
- "name": "observe",
13793
- "module": "src/common/decorators/observe.ts"
13794
- }
13795
- }
13796
- ]
13797
- },
13798
13798
  {
13799
13799
  "kind": "javascript-module",
13800
13800
  "path": "src/common/directives/cond.ts",