@nordhealth/components 4.0.0-alpha.0 → 4.0.0-alpha.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.
Files changed (2) hide show
  1. package/custom-elements.json +931 -931
  2. package/package.json +5 -5
@@ -1284,6 +1284,123 @@
1284
1284
  }
1285
1285
  ]
1286
1286
  },
1287
+ {
1288
+ "kind": "javascript-module",
1289
+ "path": "src/badge/Badge.ts",
1290
+ "declarations": [
1291
+ {
1292
+ "kind": "class",
1293
+ "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.",
1294
+ "name": "Badge",
1295
+ "slots": [
1296
+ {
1297
+ "description": "The badge content.",
1298
+ "name": ""
1299
+ },
1300
+ {
1301
+ "description": "Used to place an icon at the start of badge.",
1302
+ "name": "icon"
1303
+ }
1304
+ ],
1305
+ "members": [
1306
+ {
1307
+ "kind": "field",
1308
+ "name": "type",
1309
+ "type": {
1310
+ "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | \"neutral\" | \"progress\" | undefined"
1311
+ },
1312
+ "description": "The type of badge.\nDetermines the background color of the badge.",
1313
+ "deprecated": "Use `variant` instead. If you previously used `\"progress\"`, use `\"info\"` instead.",
1314
+ "default": "\"neutral\"",
1315
+ "attribute": "type",
1316
+ "reflects": true
1317
+ },
1318
+ {
1319
+ "kind": "field",
1320
+ "name": "variant",
1321
+ "type": {
1322
+ "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"neutral\" | \"info\" | undefined"
1323
+ },
1324
+ "description": "The style variant of the badge.\nDetermines the background color of the badge.",
1325
+ "default": "\"neutral\"",
1326
+ "attribute": "variant",
1327
+ "reflects": true
1328
+ },
1329
+ {
1330
+ "kind": "field",
1331
+ "name": "strong",
1332
+ "type": {
1333
+ "text": "boolean"
1334
+ },
1335
+ "default": "false",
1336
+ "description": "Strong badges are a secondary style for badges.\nThey provide more visual prominence and emphasize them.",
1337
+ "attribute": "strong",
1338
+ "reflects": true
1339
+ }
1340
+ ],
1341
+ "attributes": [
1342
+ {
1343
+ "name": "type",
1344
+ "type": {
1345
+ "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | \"neutral\" | \"progress\" | undefined"
1346
+ },
1347
+ "description": "The type of badge.\nDetermines the background color of the badge.",
1348
+ "deprecated": "Use `variant` instead. If you previously used `\"progress\"`, use `\"info\"` instead.",
1349
+ "default": "\"neutral\"",
1350
+ "fieldName": "type"
1351
+ },
1352
+ {
1353
+ "name": "variant",
1354
+ "type": {
1355
+ "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"neutral\" | \"info\" | undefined"
1356
+ },
1357
+ "description": "The style variant of the badge.\nDetermines the background color of the badge.",
1358
+ "default": "\"neutral\"",
1359
+ "fieldName": "variant"
1360
+ },
1361
+ {
1362
+ "name": "strong",
1363
+ "type": {
1364
+ "text": "boolean"
1365
+ },
1366
+ "default": "false",
1367
+ "description": "Strong badges are a secondary style for badges.\nThey provide more visual prominence and emphasize them.",
1368
+ "fieldName": "strong"
1369
+ }
1370
+ ],
1371
+ "superclass": {
1372
+ "name": "LitElement",
1373
+ "package": "lit"
1374
+ },
1375
+ "localization": [],
1376
+ "status": "ready",
1377
+ "category": "text",
1378
+ "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 easy 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- Don't use badges for labeling, categorizing, or organizing objects. Use the [tag component](/components/tag/) instead.\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",
1379
+ "examples": [],
1380
+ "dependencies": [],
1381
+ "tagName": "nord-badge",
1382
+ "customElement": true
1383
+ }
1384
+ ],
1385
+ "exports": [
1386
+ {
1387
+ "kind": "js",
1388
+ "name": "default",
1389
+ "declaration": {
1390
+ "name": "Badge",
1391
+ "module": "src/badge/Badge.ts"
1392
+ }
1393
+ },
1394
+ {
1395
+ "kind": "custom-element-definition",
1396
+ "name": "nord-badge",
1397
+ "declaration": {
1398
+ "name": "Badge",
1399
+ "module": "src/badge/Badge.ts"
1400
+ }
1401
+ }
1402
+ ]
1403
+ },
1287
1404
  {
1288
1405
  "kind": "javascript-module",
1289
1406
  "path": "src/banner/Banner.ts",
@@ -2732,123 +2849,6 @@
2732
2849
  }
2733
2850
  ]
2734
2851
  },
2735
- {
2736
- "kind": "javascript-module",
2737
- "path": "src/badge/Badge.ts",
2738
- "declarations": [
2739
- {
2740
- "kind": "class",
2741
- "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.",
2742
- "name": "Badge",
2743
- "slots": [
2744
- {
2745
- "description": "The badge content.",
2746
- "name": ""
2747
- },
2748
- {
2749
- "description": "Used to place an icon at the start of badge.",
2750
- "name": "icon"
2751
- }
2752
- ],
2753
- "members": [
2754
- {
2755
- "kind": "field",
2756
- "name": "type",
2757
- "type": {
2758
- "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | \"neutral\" | \"progress\" | undefined"
2759
- },
2760
- "description": "The type of badge.\nDetermines the background color of the badge.",
2761
- "deprecated": "Use `variant` instead. If you previously used `\"progress\"`, use `\"info\"` instead.",
2762
- "default": "\"neutral\"",
2763
- "attribute": "type",
2764
- "reflects": true
2765
- },
2766
- {
2767
- "kind": "field",
2768
- "name": "variant",
2769
- "type": {
2770
- "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"neutral\" | \"info\" | undefined"
2771
- },
2772
- "description": "The style variant of the badge.\nDetermines the background color of the badge.",
2773
- "default": "\"neutral\"",
2774
- "attribute": "variant",
2775
- "reflects": true
2776
- },
2777
- {
2778
- "kind": "field",
2779
- "name": "strong",
2780
- "type": {
2781
- "text": "boolean"
2782
- },
2783
- "default": "false",
2784
- "description": "Strong badges are a secondary style for badges.\nThey provide more visual prominence and emphasize them.",
2785
- "attribute": "strong",
2786
- "reflects": true
2787
- }
2788
- ],
2789
- "attributes": [
2790
- {
2791
- "name": "type",
2792
- "type": {
2793
- "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | \"neutral\" | \"progress\" | undefined"
2794
- },
2795
- "description": "The type of badge.\nDetermines the background color of the badge.",
2796
- "deprecated": "Use `variant` instead. If you previously used `\"progress\"`, use `\"info\"` instead.",
2797
- "default": "\"neutral\"",
2798
- "fieldName": "type"
2799
- },
2800
- {
2801
- "name": "variant",
2802
- "type": {
2803
- "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"neutral\" | \"info\" | undefined"
2804
- },
2805
- "description": "The style variant of the badge.\nDetermines the background color of the badge.",
2806
- "default": "\"neutral\"",
2807
- "fieldName": "variant"
2808
- },
2809
- {
2810
- "name": "strong",
2811
- "type": {
2812
- "text": "boolean"
2813
- },
2814
- "default": "false",
2815
- "description": "Strong badges are a secondary style for badges.\nThey provide more visual prominence and emphasize them.",
2816
- "fieldName": "strong"
2817
- }
2818
- ],
2819
- "superclass": {
2820
- "name": "LitElement",
2821
- "package": "lit"
2822
- },
2823
- "localization": [],
2824
- "status": "ready",
2825
- "category": "text",
2826
- "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 easy 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- Don't use badges for labeling, categorizing, or organizing objects. Use the [tag component](/components/tag/) instead.\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",
2827
- "examples": [],
2828
- "dependencies": [],
2829
- "tagName": "nord-badge",
2830
- "customElement": true
2831
- }
2832
- ],
2833
- "exports": [
2834
- {
2835
- "kind": "js",
2836
- "name": "default",
2837
- "declaration": {
2838
- "name": "Badge",
2839
- "module": "src/badge/Badge.ts"
2840
- }
2841
- },
2842
- {
2843
- "kind": "custom-element-definition",
2844
- "name": "nord-badge",
2845
- "declaration": {
2846
- "name": "Badge",
2847
- "module": "src/badge/Badge.ts"
2848
- }
2849
- }
2850
- ]
2851
- },
2852
2852
  {
2853
2853
  "kind": "javascript-module",
2854
2854
  "path": "src/button-group/ButtonGroup.ts",
@@ -14548,17 +14548,97 @@
14548
14548
  },
14549
14549
  {
14550
14550
  "kind": "javascript-module",
14551
- "path": "src/spinner/Spinner.ts",
14551
+ "path": "src/skeleton/Skeleton.ts",
14552
14552
  "declarations": [
14553
14553
  {
14554
14554
  "kind": "class",
14555
- "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.",
14556
- "name": "Spinner",
14555
+ "description": "Skeletons are used to provide a low fidelity representation of content\nbefore it appears in a view. This improves the perceived loading time\nfor our users.",
14556
+ "name": "Skeleton",
14557
14557
  "cssProperties": [
14558
14558
  {
14559
- "description": "Controls the color the spinner.",
14560
- "name": "--n-spinner-color",
14561
- "default": "var(--n-color-accent)"
14559
+ "description": "Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).",
14560
+ "name": "--n-skeleton-border-radius",
14561
+ "default": "var(--n-border-radius)"
14562
+ },
14563
+ {
14564
+ "description": "Controls the main color of the skeleton, using our [color tokens](/tokens/#color).",
14565
+ "name": "--n-skeleton-color",
14566
+ "default": "var(--n-color-border)"
14567
+ },
14568
+ {
14569
+ "description": "Controls the sheen color of the skeleton, using our [color tokens](/tokens/#color).",
14570
+ "name": "--n-skeleton-sheen-color",
14571
+ "default": "var(--n-color-border-strong)"
14572
+ }
14573
+ ],
14574
+ "members": [
14575
+ {
14576
+ "kind": "field",
14577
+ "name": "effect",
14578
+ "type": {
14579
+ "text": "\"pulse\" | \"sheen\" | undefined"
14580
+ },
14581
+ "description": "Determines which animation effect the skeleton will use.\nThe default is no animation.",
14582
+ "attribute": "effect",
14583
+ "reflects": true
14584
+ }
14585
+ ],
14586
+ "attributes": [
14587
+ {
14588
+ "name": "effect",
14589
+ "type": {
14590
+ "text": "\"pulse\" | \"sheen\" | undefined"
14591
+ },
14592
+ "description": "Determines which animation effect the skeleton will use.\nThe default is no animation.",
14593
+ "fieldName": "effect"
14594
+ }
14595
+ ],
14596
+ "superclass": {
14597
+ "name": "LitElement",
14598
+ "package": "lit"
14599
+ },
14600
+ "localization": [],
14601
+ "status": "ready",
14602
+ "category": "feedback",
14603
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use skeleton component for dynamic content only.\n- Use to give the user an indication of what the page layout will be like once loaded.\n- Mimick the actual layout using multiple Skeleton components.\n- Use `aria-busy=\"true\"` to indicate which area on the screen is currently loading and remove it or set it to `false` once loaded.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use Skeleton component for static content.\n- Don’t show placeholder content after Skeleton disappears that will change when the page fully loads.\n\n</div>\n",
14604
+ "examples": [],
14605
+ "dependencies": [],
14606
+ "tagName": "nord-skeleton",
14607
+ "customElement": true
14608
+ }
14609
+ ],
14610
+ "exports": [
14611
+ {
14612
+ "kind": "js",
14613
+ "name": "default",
14614
+ "declaration": {
14615
+ "name": "Skeleton",
14616
+ "module": "src/skeleton/Skeleton.ts"
14617
+ }
14618
+ },
14619
+ {
14620
+ "kind": "custom-element-definition",
14621
+ "name": "nord-skeleton",
14622
+ "declaration": {
14623
+ "name": "Skeleton",
14624
+ "module": "src/skeleton/Skeleton.ts"
14625
+ }
14626
+ }
14627
+ ]
14628
+ },
14629
+ {
14630
+ "kind": "javascript-module",
14631
+ "path": "src/spinner/Spinner.ts",
14632
+ "declarations": [
14633
+ {
14634
+ "kind": "class",
14635
+ "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.",
14636
+ "name": "Spinner",
14637
+ "cssProperties": [
14638
+ {
14639
+ "description": "Controls the color the spinner.",
14640
+ "name": "--n-spinner-color",
14641
+ "default": "var(--n-color-accent)"
14562
14642
  }
14563
14643
  ],
14564
14644
  "members": [
@@ -14654,86 +14734,6 @@
14654
14734
  }
14655
14735
  ]
14656
14736
  },
14657
- {
14658
- "kind": "javascript-module",
14659
- "path": "src/skeleton/Skeleton.ts",
14660
- "declarations": [
14661
- {
14662
- "kind": "class",
14663
- "description": "Skeletons are used to provide a low fidelity representation of content\nbefore it appears in a view. This improves the perceived loading time\nfor our users.",
14664
- "name": "Skeleton",
14665
- "cssProperties": [
14666
- {
14667
- "description": "Controls how rounded the corners are, using [border radius tokens](/tokens/#border-radius).",
14668
- "name": "--n-skeleton-border-radius",
14669
- "default": "var(--n-border-radius)"
14670
- },
14671
- {
14672
- "description": "Controls the main color of the skeleton, using our [color tokens](/tokens/#color).",
14673
- "name": "--n-skeleton-color",
14674
- "default": "var(--n-color-border)"
14675
- },
14676
- {
14677
- "description": "Controls the sheen color of the skeleton, using our [color tokens](/tokens/#color).",
14678
- "name": "--n-skeleton-sheen-color",
14679
- "default": "var(--n-color-border-strong)"
14680
- }
14681
- ],
14682
- "members": [
14683
- {
14684
- "kind": "field",
14685
- "name": "effect",
14686
- "type": {
14687
- "text": "\"pulse\" | \"sheen\" | undefined"
14688
- },
14689
- "description": "Determines which animation effect the skeleton will use.\nThe default is no animation.",
14690
- "attribute": "effect",
14691
- "reflects": true
14692
- }
14693
- ],
14694
- "attributes": [
14695
- {
14696
- "name": "effect",
14697
- "type": {
14698
- "text": "\"pulse\" | \"sheen\" | undefined"
14699
- },
14700
- "description": "Determines which animation effect the skeleton will use.\nThe default is no animation.",
14701
- "fieldName": "effect"
14702
- }
14703
- ],
14704
- "superclass": {
14705
- "name": "LitElement",
14706
- "package": "lit"
14707
- },
14708
- "localization": [],
14709
- "status": "ready",
14710
- "category": "feedback",
14711
- "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use skeleton component for dynamic content only.\n- Use to give the user an indication of what the page layout will be like once loaded.\n- Mimick the actual layout using multiple Skeleton components.\n- Use `aria-busy=\"true\"` to indicate which area on the screen is currently loading and remove it or set it to `false` once loaded.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use Skeleton component for static content.\n- Don’t show placeholder content after Skeleton disappears that will change when the page fully loads.\n\n</div>\n",
14712
- "examples": [],
14713
- "dependencies": [],
14714
- "tagName": "nord-skeleton",
14715
- "customElement": true
14716
- }
14717
- ],
14718
- "exports": [
14719
- {
14720
- "kind": "js",
14721
- "name": "default",
14722
- "declaration": {
14723
- "name": "Skeleton",
14724
- "module": "src/skeleton/Skeleton.ts"
14725
- }
14726
- },
14727
- {
14728
- "kind": "custom-element-definition",
14729
- "name": "nord-skeleton",
14730
- "declaration": {
14731
- "name": "Skeleton",
14732
- "module": "src/skeleton/Skeleton.ts"
14733
- }
14734
- }
14735
- ]
14736
- },
14737
14737
  {
14738
14738
  "kind": "javascript-module",
14739
14739
  "path": "src/stack/Stack.ts",
@@ -17339,405 +17339,231 @@
17339
17339
  },
17340
17340
  {
17341
17341
  "kind": "javascript-module",
17342
- "path": "src/tooltip/Tooltip.ts",
17342
+ "path": "src/toggle/Toggle.ts",
17343
17343
  "declarations": [
17344
17344
  {
17345
17345
  "kind": "class",
17346
- "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.",
17347
- "name": "Tooltip",
17346
+ "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.",
17347
+ "name": "Toggle",
17348
17348
  "cssProperties": [
17349
17349
  {
17350
- "description": "Controls the maximum inline size, or width, of the tooltip.",
17351
- "name": "--n-tooltip-max-size",
17352
- "default": "50ch"
17350
+ "description": "Controls the text color of the label, using our [color tokens](/tokens/#color).",
17351
+ "name": "--n-label-color",
17352
+ "default": "var(--n-color-text)"
17353
17353
  }
17354
17354
  ],
17355
17355
  "slots": [
17356
17356
  {
17357
- "description": "The tooltip content",
17358
- "name": ""
17357
+ "description": "Use when a label requires more than plain text.",
17358
+ "name": "label"
17359
17359
  },
17360
17360
  {
17361
- "description": "Optional slot that holds shortcut keys to access the subject",
17362
- "name": "shortcut"
17361
+ "description": "Optional slot that holds hint text for the input.",
17362
+ "name": "hint"
17363
+ },
17364
+ {
17365
+ "description": "Optional slot that holds error text for the input.",
17366
+ "name": "error"
17363
17367
  }
17364
17368
  ],
17365
17369
  "members": [
17366
17370
  {
17367
17371
  "kind": "field",
17368
- "name": "lastOpened",
17369
- "type": {
17370
- "text": "Tooltip | undefined"
17371
- },
17372
- "privacy": "private",
17373
- "static": true
17374
- },
17375
- {
17376
- "kind": "field",
17377
- "name": "shortcutSlot",
17378
- "privacy": "private",
17379
- "default": "new SlotController(this, \"shortcut\")"
17380
- },
17381
- {
17382
- "kind": "field",
17383
- "name": "events",
17384
- "privacy": "private",
17385
- "default": "new EventController(this)"
17372
+ "name": "formValue",
17373
+ "privacy": "protected",
17374
+ "readonly": true,
17375
+ "inheritedFrom": {
17376
+ "name": "FormAssociatedMixin",
17377
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
17378
+ }
17386
17379
  },
17387
17380
  {
17388
17381
  "kind": "field",
17389
- "name": "currentElement",
17382
+ "name": "checked",
17390
17383
  "type": {
17391
- "text": "FocusableElement | undefined"
17384
+ "text": "boolean"
17392
17385
  },
17393
- "privacy": "private"
17386
+ "default": "false",
17387
+ "description": "Controls whether the toggle is checked or not.",
17388
+ "attribute": "checked",
17389
+ "reflects": true
17394
17390
  },
17395
17391
  {
17396
17392
  "kind": "field",
17397
- "name": "timeoutId",
17393
+ "name": "reverse",
17398
17394
  "type": {
17399
- "text": "ReturnType<typeof setTimeout> | undefined"
17395
+ "text": "boolean"
17400
17396
  },
17401
- "privacy": "private"
17397
+ "default": "false",
17398
+ "description": "Controls whether the contents are displayed in reverse order,\nputting the label before the toggle.",
17399
+ "attribute": "reverse",
17400
+ "reflects": true
17402
17401
  },
17403
17402
  {
17404
17403
  "kind": "field",
17405
- "name": "proxy",
17404
+ "name": "size",
17406
17405
  "type": {
17407
- "text": "HTMLSpanElement | undefined"
17406
+ "text": "\"s\" | \"m\" | \"l\""
17408
17407
  },
17409
- "privacy": "private",
17410
- "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."
17408
+ "default": "\"m\"",
17409
+ "description": "The size of the toggle switch.",
17410
+ "attribute": "size",
17411
+ "reflects": true
17411
17412
  },
17412
17413
  {
17413
- "kind": "field",
17414
- "name": "state",
17415
- "type": {
17416
- "text": "TooltipStates"
17414
+ "kind": "method",
17415
+ "name": "handleChange",
17416
+ "privacy": "protected",
17417
+ "parameters": [
17418
+ {
17419
+ "name": "e",
17420
+ "type": {
17421
+ "text": "Event"
17422
+ }
17423
+ }
17424
+ ],
17425
+ "return": {
17426
+ "type": {
17427
+ "text": "void"
17428
+ }
17417
17429
  },
17418
- "privacy": "private",
17419
- "default": "\"hidden\"",
17420
- "description": "The current state of the tooltip, dependent on the state machine"
17430
+ "inheritedFrom": {
17431
+ "name": "FormAssociatedMixin",
17432
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
17433
+ }
17421
17434
  },
17422
17435
  {
17423
17436
  "kind": "field",
17424
- "name": "coords",
17425
- "type": {
17426
- "text": "[number, number]"
17427
- },
17428
- "privacy": "private",
17429
- "default": "[0, 0]"
17437
+ "name": "labelSlot",
17438
+ "privacy": "protected",
17439
+ "default": "new SlotController(this, \"label\")",
17440
+ "inheritedFrom": {
17441
+ "name": "FormAssociatedMixin",
17442
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
17443
+ }
17430
17444
  },
17431
17445
  {
17432
17446
  "kind": "field",
17433
- "name": "position",
17434
- "type": {
17435
- "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\""
17436
- },
17437
- "default": "\"block-start\"",
17438
- "description": "Control the position of the tooltip component.\nWhen set to \"none\", the tooltip will be shown above\nbut accommodate for browser boundaries.",
17439
- "attribute": "position",
17440
- "reflects": true
17447
+ "name": "errorSlot",
17448
+ "privacy": "protected",
17449
+ "default": "new SlotController(this, \"error\")",
17450
+ "inheritedFrom": {
17451
+ "name": "FormAssociatedMixin",
17452
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
17453
+ }
17441
17454
  },
17442
17455
  {
17443
17456
  "kind": "field",
17444
- "name": "role",
17445
- "type": {
17446
- "text": "string"
17447
- },
17448
- "default": "\"tooltip\"",
17449
- "description": "The tooltip role, set on the component by default.",
17450
- "attribute": "role",
17451
- "reflects": true
17457
+ "name": "hintSlot",
17458
+ "privacy": "protected",
17459
+ "default": "new SlotController(this, \"hint\")",
17460
+ "inheritedFrom": {
17461
+ "name": "FormAssociatedMixin",
17462
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
17463
+ }
17452
17464
  },
17453
17465
  {
17454
17466
  "kind": "field",
17455
- "name": "id",
17456
- "type": {
17457
- "text": "string"
17458
- },
17459
- "default": "\"\"",
17460
- "description": "The id for the active element to reference via aria-describedby.",
17461
- "attribute": "id",
17462
- "reflects": true
17467
+ "name": "formData",
17468
+ "privacy": "protected",
17469
+ "default": "new FormDataController(this, { value: () => this.formValue })",
17470
+ "inheritedFrom": {
17471
+ "name": "FormAssociatedMixin",
17472
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
17473
+ }
17463
17474
  },
17464
17475
  {
17465
17476
  "kind": "field",
17466
- "name": "delay",
17477
+ "name": "inputId",
17467
17478
  "type": {
17468
- "text": "number"
17479
+ "text": "string"
17469
17480
  },
17470
- "default": "500",
17471
- "description": "The delay in milliseconds before the tooltip is opened.",
17472
- "attribute": "delay",
17473
- "reflects": true
17474
- },
17475
- {
17476
- "kind": "method",
17477
- "name": "handleIdChange",
17478
- "privacy": "protected"
17479
- },
17480
- {
17481
- "kind": "method",
17482
- "name": "handleStateChange",
17483
- "privacy": "private",
17484
- "parameters": [
17485
- {
17486
- "name": "prevState",
17487
- "type": {
17488
- "text": "TooltipStates"
17489
- }
17490
- }
17491
- ]
17492
- },
17493
- {
17494
- "kind": "field",
17495
- "name": "updatePosition",
17496
- "privacy": "private",
17497
- "description": "Setting and updating the position of the tooltip"
17498
- },
17499
- {
17500
- "kind": "field",
17501
- "name": "hideTooltip",
17502
- "privacy": "private"
17503
- },
17504
- {
17505
- "kind": "field",
17506
- "name": "reposition",
17507
- "privacy": "private"
17508
- },
17509
- {
17510
- "kind": "field",
17511
- "name": "handleShow",
17512
- "privacy": "private"
17513
- },
17514
- {
17515
- "kind": "field",
17516
- "name": "handleHide",
17517
- "privacy": "private"
17518
- },
17519
- {
17520
- "kind": "field",
17521
- "name": "hideOnEscape",
17522
- "privacy": "private"
17523
- },
17524
- {
17525
- "kind": "field",
17526
- "name": "addDescribedBy",
17527
- "privacy": "private"
17481
+ "privacy": "protected",
17482
+ "default": "\"input\"",
17483
+ "inheritedFrom": {
17484
+ "name": "FormAssociatedMixin",
17485
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
17486
+ }
17528
17487
  },
17529
17488
  {
17530
17489
  "kind": "field",
17531
- "name": "removeDescribedBy",
17532
- "privacy": "private"
17533
- }
17534
- ],
17535
- "attributes": [
17536
- {
17537
- "name": "position",
17490
+ "name": "errorId",
17538
17491
  "type": {
17539
- "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\""
17492
+ "text": "string"
17540
17493
  },
17541
- "default": "\"block-start\"",
17542
- "description": "Control the position of the tooltip component.\nWhen set to \"none\", the tooltip will be shown above\nbut accommodate for browser boundaries.",
17543
- "fieldName": "position"
17494
+ "privacy": "protected",
17495
+ "default": "\"error\"",
17496
+ "inheritedFrom": {
17497
+ "name": "FormAssociatedMixin",
17498
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
17499
+ }
17544
17500
  },
17545
17501
  {
17546
- "name": "role",
17502
+ "kind": "field",
17503
+ "name": "hintId",
17547
17504
  "type": {
17548
17505
  "text": "string"
17549
17506
  },
17550
- "default": "\"tooltip\"",
17551
- "description": "The tooltip role, set on the component by default.",
17552
- "fieldName": "role"
17507
+ "privacy": "protected",
17508
+ "default": "\"hint\"",
17509
+ "inheritedFrom": {
17510
+ "name": "FormAssociatedMixin",
17511
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
17512
+ }
17553
17513
  },
17554
17514
  {
17555
- "name": "id",
17515
+ "kind": "field",
17516
+ "name": "label",
17556
17517
  "type": {
17557
17518
  "text": "string"
17558
17519
  },
17559
17520
  "default": "\"\"",
17560
- "description": "The id for the active element to reference via aria-describedby.",
17561
- "fieldName": "id"
17562
- },
17563
- {
17564
- "name": "delay",
17565
- "type": {
17566
- "text": "number"
17567
- },
17568
- "default": "500",
17569
- "description": "The delay in milliseconds before the tooltip is opened.",
17570
- "fieldName": "delay"
17571
- }
17572
- ],
17573
- "superclass": {
17574
- "name": "LitElement",
17575
- "package": "lit"
17576
- },
17577
- "localization": [],
17578
- "status": "ready",
17579
- "category": "overlay",
17580
- "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",
17581
- "examples": [],
17582
- "dependencies": [],
17583
- "tagName": "nord-tooltip",
17584
- "customElement": true
17585
- }
17586
- ],
17587
- "exports": [
17588
- {
17589
- "kind": "js",
17590
- "name": "default",
17591
- "declaration": {
17592
- "name": "Tooltip",
17593
- "module": "src/tooltip/Tooltip.ts"
17594
- }
17595
- },
17596
- {
17597
- "kind": "custom-element-definition",
17598
- "name": "nord-tooltip",
17599
- "declaration": {
17600
- "name": "Tooltip",
17601
- "module": "src/tooltip/Tooltip.ts"
17602
- }
17603
- }
17604
- ]
17605
- },
17606
- {
17607
- "kind": "javascript-module",
17608
- "path": "src/top-bar/TopBar.ts",
17609
- "declarations": [
17610
- {
17611
- "kind": "class",
17612
- "description": "Top bar is a header component that is always visible at the top of the interface. Top bar allows functionality such as search and contextual menus to be placed at the top of the interface.",
17613
- "name": "TopBar",
17614
- "slots": [
17615
- {
17616
- "description": "Used for the main content of the top bar. We recommend placing your application’s global search functionality into this slot.",
17617
- "name": ""
17618
- },
17619
- {
17620
- "description": "Optional slot for menus, buttons, toggles, etc.",
17621
- "name": "end"
17622
- }
17623
- ],
17624
- "members": [],
17625
- "superclass": {
17626
- "name": "LitElement",
17627
- "package": "lit"
17628
- },
17629
- "localization": [],
17630
- "status": "ready",
17631
- "category": "structure",
17632
- "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- Applications that utilize the top bar can allow users to customize the color of the top bar to match their preference. [View an example](/components/top-bar/?example=color).\n- If your application allows it, include search to help users find resources and navigate.\n- Include a user menu in the end slot of the top bar.\n- Use the [layout component](/components/layout/?example=top-bar) to provide structure for the top bar component. We’ve also created [an example which shows full theming capabilities](/components/layout/?example=theming).\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for global navigation. Use the [navigation component](/components/navigation/) instead.\n- Don’t allow the user to set a top bar color that doesn’t provide enough contrast with the content.\n- Don’t allow the user to freely pick a hex code as the top bar color. Instead, offer a choice from a predefined palette of colors which provides sufficient contrast with the content. [View an example](/components/top-bar/?example=color).\n\n</div>\n\n---\n\n## Theming\n\nPlease see the [Top Bar theming](/themes/#top-bar-theming) section in our theming documentation for detailed guidelines.\n\n<nord-button variant=\"primary\" href=\"/themes/#top-bar-theming\">Theming Guidelines</nord-button>\n",
17633
- "examples": [],
17634
- "dependencies": [],
17635
- "tagName": "nord-top-bar",
17636
- "customElement": true
17637
- }
17638
- ],
17639
- "exports": [
17640
- {
17641
- "kind": "js",
17642
- "name": "default",
17643
- "declaration": {
17644
- "name": "TopBar",
17645
- "module": "src/top-bar/TopBar.ts"
17646
- }
17647
- },
17648
- {
17649
- "kind": "custom-element-definition",
17650
- "name": "nord-top-bar",
17651
- "declaration": {
17652
- "name": "TopBar",
17653
- "module": "src/top-bar/TopBar.ts"
17654
- }
17655
- }
17656
- ]
17657
- },
17658
- {
17659
- "kind": "javascript-module",
17660
- "path": "src/visually-hidden/VisuallyHidden.ts",
17661
- "declarations": [
17662
- {
17663
- "kind": "class",
17664
- "description": "Visually hidden is used when an element needs to be available\nto assistive technologies like screen readers, but be otherwise\nhidden.",
17665
- "name": "VisuallyHidden",
17666
- "slots": [
17667
- {
17668
- "description": "The visually hidden content.",
17669
- "name": ""
17670
- }
17671
- ],
17672
- "members": [],
17673
- "superclass": {
17674
- "name": "LitElement",
17675
- "package": "lit"
17676
- },
17677
- "localization": [],
17678
- "status": "ready",
17679
- "category": "text",
17680
- "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",
17681
- "examples": [],
17682
- "dependencies": [],
17683
- "tagName": "nord-visually-hidden",
17684
- "customElement": true
17685
- }
17686
- ],
17687
- "exports": [
17688
- {
17689
- "kind": "js",
17690
- "name": "default",
17691
- "declaration": {
17692
- "name": "VisuallyHidden",
17693
- "module": "src/visually-hidden/VisuallyHidden.ts"
17694
- }
17695
- },
17696
- {
17697
- "kind": "custom-element-definition",
17698
- "name": "nord-visually-hidden",
17699
- "declaration": {
17700
- "name": "VisuallyHidden",
17701
- "module": "src/visually-hidden/VisuallyHidden.ts"
17702
- }
17703
- }
17704
- ]
17705
- },
17706
- {
17707
- "kind": "javascript-module",
17708
- "path": "src/toggle/Toggle.ts",
17709
- "declarations": [
17710
- {
17711
- "kind": "class",
17712
- "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.",
17713
- "name": "Toggle",
17714
- "cssProperties": [
17715
- {
17716
- "description": "Controls the text color of the label, using our [color tokens](/tokens/#color).",
17717
- "name": "--n-label-color",
17718
- "default": "var(--n-color-text)"
17719
- }
17720
- ],
17721
- "slots": [
17722
- {
17723
- "description": "Use when a label requires more than plain text.",
17724
- "name": "label"
17521
+ "description": "Label for the input.",
17522
+ "attribute": "label",
17523
+ "reflects": true,
17524
+ "inheritedFrom": {
17525
+ "name": "FormAssociatedMixin",
17526
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
17527
+ }
17725
17528
  },
17726
17529
  {
17727
- "description": "Optional slot that holds hint text for the input.",
17728
- "name": "hint"
17530
+ "kind": "field",
17531
+ "name": "hint",
17532
+ "type": {
17533
+ "text": "string | undefined"
17534
+ },
17535
+ "description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
17536
+ "attribute": "hint",
17537
+ "reflects": true,
17538
+ "inheritedFrom": {
17539
+ "name": "FormAssociatedMixin",
17540
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
17541
+ }
17729
17542
  },
17730
17543
  {
17731
- "description": "Optional slot that holds error text for the input.",
17732
- "name": "error"
17733
- }
17734
- ],
17735
- "members": [
17544
+ "kind": "field",
17545
+ "name": "hideLabel",
17546
+ "type": {
17547
+ "text": "boolean"
17548
+ },
17549
+ "default": "false",
17550
+ "description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
17551
+ "attribute": "hide-label",
17552
+ "reflects": true,
17553
+ "inheritedFrom": {
17554
+ "name": "FormAssociatedMixin",
17555
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
17556
+ }
17557
+ },
17736
17558
  {
17737
17559
  "kind": "field",
17738
- "name": "formValue",
17739
- "privacy": "protected",
17740
- "readonly": true,
17560
+ "name": "placeholder",
17561
+ "type": {
17562
+ "text": "string | undefined"
17563
+ },
17564
+ "description": "Placeholder text to display within the input.",
17565
+ "attribute": "placeholder",
17566
+ "reflects": true,
17741
17567
  "inheritedFrom": {
17742
17568
  "name": "FormAssociatedMixin",
17743
17569
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -17745,40 +17571,51 @@
17745
17571
  },
17746
17572
  {
17747
17573
  "kind": "field",
17748
- "name": "checked",
17574
+ "name": "error",
17749
17575
  "type": {
17750
- "text": "boolean"
17576
+ "text": "string | undefined"
17751
17577
  },
17752
- "default": "false",
17753
- "description": "Controls whether the toggle is checked or not.",
17754
- "attribute": "checked",
17755
- "reflects": true
17578
+ "description": "Optional error to be shown with the input. Alternatively use the error slot.",
17579
+ "attribute": "error",
17580
+ "reflects": true,
17581
+ "inheritedFrom": {
17582
+ "name": "FormAssociatedMixin",
17583
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
17584
+ }
17756
17585
  },
17757
17586
  {
17758
17587
  "kind": "field",
17759
- "name": "reverse",
17588
+ "name": "required",
17760
17589
  "type": {
17761
17590
  "text": "boolean"
17762
17591
  },
17763
17592
  "default": "false",
17764
- "description": "Controls whether the contents are displayed in reverse order,\nputting the label before the toggle.",
17765
- "attribute": "reverse",
17766
- "reflects": true
17593
+ "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.",
17594
+ "attribute": "required",
17595
+ "reflects": true,
17596
+ "inheritedFrom": {
17597
+ "name": "FormAssociatedMixin",
17598
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
17599
+ }
17767
17600
  },
17768
17601
  {
17769
17602
  "kind": "field",
17770
- "name": "size",
17603
+ "name": "hideRequired",
17771
17604
  "type": {
17772
- "text": "\"s\" | \"m\" | \"l\""
17605
+ "text": "boolean"
17773
17606
  },
17774
- "default": "\"m\"",
17775
- "description": "The size of the toggle switch.",
17776
- "attribute": "size",
17777
- "reflects": true
17607
+ "default": "false",
17608
+ "description": "Visually hide the required indicator, but still show\nrequired attribute to assistive technologies like screen readers.",
17609
+ "attribute": "hide-required",
17610
+ "reflects": true,
17611
+ "inheritedFrom": {
17612
+ "name": "FormAssociatedMixin",
17613
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
17614
+ }
17778
17615
  },
17779
17616
  {
17780
17617
  "kind": "method",
17781
- "name": "handleChange",
17618
+ "name": "handleInput",
17782
17619
  "privacy": "protected",
17783
17620
  "parameters": [
17784
17621
  {
@@ -17788,11 +17625,51 @@
17788
17625
  }
17789
17626
  }
17790
17627
  ],
17791
- "return": {
17792
- "type": {
17793
- "text": "void"
17628
+ "inheritedFrom": {
17629
+ "name": "FormAssociatedMixin",
17630
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
17631
+ }
17632
+ },
17633
+ {
17634
+ "kind": "method",
17635
+ "name": "renderLabel",
17636
+ "privacy": "protected",
17637
+ "parameters": [
17638
+ {
17639
+ "name": "additionalContent",
17640
+ "optional": true,
17641
+ "type": {
17642
+ "text": "TemplateResult"
17643
+ }
17794
17644
  }
17795
- },
17645
+ ],
17646
+ "inheritedFrom": {
17647
+ "name": "FormAssociatedMixin",
17648
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
17649
+ }
17650
+ },
17651
+ {
17652
+ "kind": "method",
17653
+ "name": "renderError",
17654
+ "privacy": "protected",
17655
+ "inheritedFrom": {
17656
+ "name": "FormAssociatedMixin",
17657
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
17658
+ }
17659
+ },
17660
+ {
17661
+ "kind": "method",
17662
+ "name": "getDescribedBy",
17663
+ "privacy": "protected",
17664
+ "inheritedFrom": {
17665
+ "name": "FormAssociatedMixin",
17666
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
17667
+ }
17668
+ },
17669
+ {
17670
+ "kind": "method",
17671
+ "name": "getInvalid",
17672
+ "privacy": "protected",
17796
17673
  "inheritedFrom": {
17797
17674
  "name": "FormAssociatedMixin",
17798
17675
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -17800,9 +17677,9 @@
17800
17677
  },
17801
17678
  {
17802
17679
  "kind": "field",
17803
- "name": "labelSlot",
17680
+ "name": "hasHint",
17804
17681
  "privacy": "protected",
17805
- "default": "new SlotController(this, \"label\")",
17682
+ "readonly": true,
17806
17683
  "inheritedFrom": {
17807
17684
  "name": "FormAssociatedMixin",
17808
17685
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -17810,602 +17687,725 @@
17810
17687
  },
17811
17688
  {
17812
17689
  "kind": "field",
17813
- "name": "errorSlot",
17690
+ "name": "hasError",
17814
17691
  "privacy": "protected",
17815
- "default": "new SlotController(this, \"error\")",
17692
+ "readonly": true,
17693
+ "inheritedFrom": {
17694
+ "name": "FormAssociatedMixin",
17695
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
17696
+ }
17697
+ },
17698
+ {
17699
+ "kind": "field",
17700
+ "name": "disabled",
17701
+ "type": {
17702
+ "text": "boolean"
17703
+ },
17704
+ "default": "false",
17705
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
17706
+ "attribute": "disabled",
17707
+ "reflects": true,
17708
+ "inheritedFrom": {
17709
+ "name": "InputMixin",
17710
+ "module": "src/common/mixins/InputMixin.ts"
17711
+ }
17712
+ },
17713
+ {
17714
+ "kind": "field",
17715
+ "name": "name",
17716
+ "type": {
17717
+ "text": "string | undefined"
17718
+ },
17719
+ "description": "The name of the form component.",
17720
+ "attribute": "name",
17721
+ "reflects": true,
17722
+ "inheritedFrom": {
17723
+ "name": "InputMixin",
17724
+ "module": "src/common/mixins/InputMixin.ts"
17725
+ }
17726
+ },
17727
+ {
17728
+ "kind": "field",
17729
+ "name": "value",
17730
+ "type": {
17731
+ "text": "string"
17732
+ },
17733
+ "default": "\"\"",
17734
+ "description": "The value of the form component.",
17735
+ "attribute": "value",
17736
+ "inheritedFrom": {
17737
+ "name": "InputMixin",
17738
+ "module": "src/common/mixins/InputMixin.ts"
17739
+ }
17740
+ },
17741
+ {
17742
+ "kind": "field",
17743
+ "name": "formAncestor",
17744
+ "type": {
17745
+ "text": "HTMLFormElement | null"
17746
+ },
17747
+ "privacy": "private",
17748
+ "default": "null",
17749
+ "inheritedFrom": {
17750
+ "name": "InputMixin",
17751
+ "module": "src/common/mixins/InputMixin.ts"
17752
+ }
17753
+ },
17754
+ {
17755
+ "kind": "field",
17756
+ "name": "_formId",
17757
+ "type": {
17758
+ "text": "string | undefined"
17759
+ },
17760
+ "privacy": "protected",
17761
+ "inheritedFrom": {
17762
+ "name": "InputMixin",
17763
+ "module": "src/common/mixins/InputMixin.ts"
17764
+ }
17765
+ },
17766
+ {
17767
+ "kind": "field",
17768
+ "name": "form",
17769
+ "type": {
17770
+ "text": "HTMLFormElement | null"
17771
+ },
17772
+ "description": "Gets the form, if any, associated with the form element.\nThe setter accepts a string, which is the id of the form.",
17773
+ "attribute": "form",
17774
+ "inheritedFrom": {
17775
+ "name": "InputMixin",
17776
+ "module": "src/common/mixins/InputMixin.ts"
17777
+ }
17778
+ },
17779
+ {
17780
+ "kind": "field",
17781
+ "name": "focusableRef",
17782
+ "privacy": "protected",
17783
+ "inheritedFrom": {
17784
+ "name": "FocusableMixin",
17785
+ "module": "src/common/mixins/FocusableMixin.ts"
17786
+ }
17787
+ },
17788
+ {
17789
+ "kind": "method",
17790
+ "name": "focus",
17791
+ "parameters": [
17792
+ {
17793
+ "name": "options",
17794
+ "optional": true,
17795
+ "type": {
17796
+ "text": "FocusOptions"
17797
+ },
17798
+ "description": "An object which controls aspects of the focusing process."
17799
+ }
17800
+ ],
17801
+ "description": "Programmatically move focus to the component.",
17816
17802
  "inheritedFrom": {
17817
- "name": "FormAssociatedMixin",
17818
- "module": "src/common/mixins/FormAssociatedMixin.ts"
17803
+ "name": "FocusableMixin",
17804
+ "module": "src/common/mixins/FocusableMixin.ts"
17819
17805
  }
17820
17806
  },
17821
17807
  {
17822
- "kind": "field",
17823
- "name": "hintSlot",
17824
- "privacy": "protected",
17825
- "default": "new SlotController(this, \"hint\")",
17808
+ "kind": "method",
17809
+ "name": "blur",
17810
+ "description": "Programmatically remove focus from the component.",
17826
17811
  "inheritedFrom": {
17827
- "name": "FormAssociatedMixin",
17828
- "module": "src/common/mixins/FormAssociatedMixin.ts"
17812
+ "name": "FocusableMixin",
17813
+ "module": "src/common/mixins/FocusableMixin.ts"
17829
17814
  }
17830
17815
  },
17831
17816
  {
17832
- "kind": "field",
17833
- "name": "formData",
17834
- "privacy": "protected",
17835
- "default": "new FormDataController(this, { value: () => this.formValue })",
17817
+ "kind": "method",
17818
+ "name": "click",
17819
+ "description": "Programmatically simulates a click on the component.",
17836
17820
  "inheritedFrom": {
17837
- "name": "FormAssociatedMixin",
17838
- "module": "src/common/mixins/FormAssociatedMixin.ts"
17821
+ "name": "FocusableMixin",
17822
+ "module": "src/common/mixins/FocusableMixin.ts"
17839
17823
  }
17840
- },
17824
+ }
17825
+ ],
17826
+ "attributes": [
17841
17827
  {
17842
- "kind": "field",
17843
- "name": "inputId",
17828
+ "name": "checked",
17844
17829
  "type": {
17845
- "text": "string"
17830
+ "text": "boolean"
17846
17831
  },
17847
- "privacy": "protected",
17848
- "default": "\"input\"",
17849
- "inheritedFrom": {
17850
- "name": "FormAssociatedMixin",
17851
- "module": "src/common/mixins/FormAssociatedMixin.ts"
17852
- }
17832
+ "default": "false",
17833
+ "description": "Controls whether the toggle is checked or not.",
17834
+ "fieldName": "checked"
17853
17835
  },
17854
17836
  {
17855
- "kind": "field",
17856
- "name": "errorId",
17837
+ "name": "reverse",
17857
17838
  "type": {
17858
- "text": "string"
17839
+ "text": "boolean"
17859
17840
  },
17860
- "privacy": "protected",
17861
- "default": "\"error\"",
17862
- "inheritedFrom": {
17863
- "name": "FormAssociatedMixin",
17864
- "module": "src/common/mixins/FormAssociatedMixin.ts"
17865
- }
17841
+ "default": "false",
17842
+ "description": "Controls whether the contents are displayed in reverse order,\nputting the label before the toggle.",
17843
+ "fieldName": "reverse"
17866
17844
  },
17867
17845
  {
17868
- "kind": "field",
17869
- "name": "hintId",
17846
+ "name": "size",
17870
17847
  "type": {
17871
- "text": "string"
17848
+ "text": "\"s\" | \"m\" | \"l\""
17872
17849
  },
17873
- "privacy": "protected",
17874
- "default": "\"hint\"",
17875
- "inheritedFrom": {
17876
- "name": "FormAssociatedMixin",
17877
- "module": "src/common/mixins/FormAssociatedMixin.ts"
17878
- }
17850
+ "default": "\"m\"",
17851
+ "description": "The size of the toggle switch.",
17852
+ "fieldName": "size"
17879
17853
  },
17880
17854
  {
17881
- "kind": "field",
17882
17855
  "name": "label",
17883
17856
  "type": {
17884
17857
  "text": "string"
17885
17858
  },
17886
17859
  "default": "\"\"",
17887
17860
  "description": "Label for the input.",
17888
- "attribute": "label",
17889
- "reflects": true,
17861
+ "fieldName": "label",
17890
17862
  "inheritedFrom": {
17891
17863
  "name": "FormAssociatedMixin",
17892
17864
  "module": "src/common/mixins/FormAssociatedMixin.ts"
17893
17865
  }
17894
17866
  },
17895
17867
  {
17896
- "kind": "field",
17897
17868
  "name": "hint",
17898
17869
  "type": {
17899
17870
  "text": "string | undefined"
17900
17871
  },
17901
17872
  "description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
17902
- "attribute": "hint",
17903
- "reflects": true,
17873
+ "fieldName": "hint",
17904
17874
  "inheritedFrom": {
17905
17875
  "name": "FormAssociatedMixin",
17906
17876
  "module": "src/common/mixins/FormAssociatedMixin.ts"
17907
17877
  }
17908
17878
  },
17909
17879
  {
17910
- "kind": "field",
17911
- "name": "hideLabel",
17880
+ "name": "hide-label",
17912
17881
  "type": {
17913
17882
  "text": "boolean"
17914
17883
  },
17915
17884
  "default": "false",
17916
17885
  "description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
17917
- "attribute": "hide-label",
17918
- "reflects": true,
17886
+ "fieldName": "hideLabel",
17919
17887
  "inheritedFrom": {
17920
17888
  "name": "FormAssociatedMixin",
17921
17889
  "module": "src/common/mixins/FormAssociatedMixin.ts"
17922
17890
  }
17923
17891
  },
17924
17892
  {
17925
- "kind": "field",
17926
17893
  "name": "placeholder",
17927
17894
  "type": {
17928
17895
  "text": "string | undefined"
17929
17896
  },
17930
17897
  "description": "Placeholder text to display within the input.",
17931
- "attribute": "placeholder",
17932
- "reflects": true,
17898
+ "fieldName": "placeholder",
17933
17899
  "inheritedFrom": {
17934
17900
  "name": "FormAssociatedMixin",
17935
17901
  "module": "src/common/mixins/FormAssociatedMixin.ts"
17936
17902
  }
17937
17903
  },
17938
17904
  {
17939
- "kind": "field",
17940
17905
  "name": "error",
17941
17906
  "type": {
17942
17907
  "text": "string | undefined"
17943
17908
  },
17944
17909
  "description": "Optional error to be shown with the input. Alternatively use the error slot.",
17945
- "attribute": "error",
17946
- "reflects": true,
17910
+ "fieldName": "error",
17947
17911
  "inheritedFrom": {
17948
17912
  "name": "FormAssociatedMixin",
17949
17913
  "module": "src/common/mixins/FormAssociatedMixin.ts"
17950
17914
  }
17951
17915
  },
17952
17916
  {
17953
- "kind": "field",
17954
17917
  "name": "required",
17955
17918
  "type": {
17956
17919
  "text": "boolean"
17957
17920
  },
17958
17921
  "default": "false",
17959
17922
  "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.",
17960
- "attribute": "required",
17961
- "reflects": true,
17923
+ "fieldName": "required",
17962
17924
  "inheritedFrom": {
17963
17925
  "name": "FormAssociatedMixin",
17964
17926
  "module": "src/common/mixins/FormAssociatedMixin.ts"
17965
17927
  }
17966
17928
  },
17967
17929
  {
17968
- "kind": "field",
17969
- "name": "hideRequired",
17930
+ "name": "hide-required",
17970
17931
  "type": {
17971
17932
  "text": "boolean"
17972
17933
  },
17973
17934
  "default": "false",
17974
17935
  "description": "Visually hide the required indicator, but still show\nrequired attribute to assistive technologies like screen readers.",
17975
- "attribute": "hide-required",
17976
- "reflects": true,
17936
+ "fieldName": "hideRequired",
17977
17937
  "inheritedFrom": {
17978
17938
  "name": "FormAssociatedMixin",
17979
17939
  "module": "src/common/mixins/FormAssociatedMixin.ts"
17980
17940
  }
17981
17941
  },
17982
17942
  {
17983
- "kind": "method",
17984
- "name": "handleInput",
17985
- "privacy": "protected",
17986
- "parameters": [
17987
- {
17988
- "name": "e",
17989
- "type": {
17990
- "text": "Event"
17991
- }
17992
- }
17993
- ],
17943
+ "name": "disabled",
17944
+ "type": {
17945
+ "text": "boolean"
17946
+ },
17947
+ "default": "false",
17948
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
17949
+ "fieldName": "disabled",
17994
17950
  "inheritedFrom": {
17995
- "name": "FormAssociatedMixin",
17996
- "module": "src/common/mixins/FormAssociatedMixin.ts"
17951
+ "name": "InputMixin",
17952
+ "module": "src/common/mixins/InputMixin.ts"
17997
17953
  }
17998
17954
  },
17999
17955
  {
18000
- "kind": "method",
18001
- "name": "renderLabel",
18002
- "privacy": "protected",
18003
- "parameters": [
18004
- {
18005
- "name": "additionalContent",
18006
- "optional": true,
18007
- "type": {
18008
- "text": "TemplateResult"
18009
- }
18010
- }
18011
- ],
17956
+ "name": "name",
17957
+ "type": {
17958
+ "text": "string | undefined"
17959
+ },
17960
+ "description": "The name of the form component.",
17961
+ "fieldName": "name",
18012
17962
  "inheritedFrom": {
18013
- "name": "FormAssociatedMixin",
18014
- "module": "src/common/mixins/FormAssociatedMixin.ts"
17963
+ "name": "InputMixin",
17964
+ "module": "src/common/mixins/InputMixin.ts"
18015
17965
  }
18016
17966
  },
18017
17967
  {
18018
- "kind": "method",
18019
- "name": "renderError",
18020
- "privacy": "protected",
17968
+ "name": "value",
17969
+ "type": {
17970
+ "text": "string"
17971
+ },
17972
+ "default": "\"\"",
17973
+ "description": "The value of the form component.",
17974
+ "fieldName": "value",
17975
+ "inheritedFrom": {
17976
+ "name": "InputMixin",
17977
+ "module": "src/common/mixins/InputMixin.ts"
17978
+ }
17979
+ },
17980
+ {
17981
+ "name": "form",
17982
+ "type": {
17983
+ "text": "HTMLFormElement | null"
17984
+ },
17985
+ "description": "Gets the form, if any, associated with the form element.\nThe setter accepts a string, which is the id of the form.",
17986
+ "fieldName": "form",
17987
+ "inheritedFrom": {
17988
+ "name": "InputMixin",
17989
+ "module": "src/common/mixins/InputMixin.ts"
17990
+ }
17991
+ }
17992
+ ],
17993
+ "mixins": [
17994
+ {
17995
+ "name": "FormAssociatedMixin",
17996
+ "module": "/src/common/mixins/FormAssociatedMixin.js"
17997
+ },
17998
+ {
17999
+ "name": "InputMixin",
18000
+ "module": "/src/common/mixins/InputMixin.js"
18001
+ },
18002
+ {
18003
+ "name": "FocusableMixin",
18004
+ "module": "/src/common/mixins/FocusableMixin.js"
18005
+ }
18006
+ ],
18007
+ "superclass": {
18008
+ "name": "LitElement",
18009
+ "package": "lit"
18010
+ },
18011
+ "localization": [],
18012
+ "status": "ready",
18013
+ "category": "form",
18014
+ "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",
18015
+ "examples": [],
18016
+ "dependencies": [],
18017
+ "tagName": "nord-toggle",
18018
+ "customElement": true,
18019
+ "events": [
18020
+ {
18021
+ "name": "input",
18022
+ "type": {
18023
+ "text": "NordEvent"
18024
+ },
18025
+ "description": "Fired as the user types into the input.",
18021
18026
  "inheritedFrom": {
18022
18027
  "name": "FormAssociatedMixin",
18023
18028
  "module": "src/common/mixins/FormAssociatedMixin.ts"
18024
18029
  }
18025
18030
  },
18026
18031
  {
18027
- "kind": "method",
18028
- "name": "getDescribedBy",
18029
- "privacy": "protected",
18032
+ "name": "change",
18033
+ "type": {
18034
+ "text": "NordEvent"
18035
+ },
18036
+ "description": "Fired whenever the input's value is changed via user interaction.",
18030
18037
  "inheritedFrom": {
18031
18038
  "name": "FormAssociatedMixin",
18032
18039
  "module": "src/common/mixins/FormAssociatedMixin.ts"
18033
18040
  }
18041
+ }
18042
+ ]
18043
+ }
18044
+ ],
18045
+ "exports": [
18046
+ {
18047
+ "kind": "js",
18048
+ "name": "default",
18049
+ "declaration": {
18050
+ "name": "Toggle",
18051
+ "module": "src/toggle/Toggle.ts"
18052
+ }
18053
+ },
18054
+ {
18055
+ "kind": "custom-element-definition",
18056
+ "name": "nord-toggle",
18057
+ "declaration": {
18058
+ "name": "Toggle",
18059
+ "module": "src/toggle/Toggle.ts"
18060
+ }
18061
+ }
18062
+ ]
18063
+ },
18064
+ {
18065
+ "kind": "javascript-module",
18066
+ "path": "src/tooltip/Tooltip.ts",
18067
+ "declarations": [
18068
+ {
18069
+ "kind": "class",
18070
+ "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.",
18071
+ "name": "Tooltip",
18072
+ "cssProperties": [
18073
+ {
18074
+ "description": "Controls the maximum inline size, or width, of the tooltip.",
18075
+ "name": "--n-tooltip-max-size",
18076
+ "default": "50ch"
18077
+ }
18078
+ ],
18079
+ "slots": [
18080
+ {
18081
+ "description": "The tooltip content",
18082
+ "name": ""
18034
18083
  },
18035
18084
  {
18036
- "kind": "method",
18037
- "name": "getInvalid",
18038
- "privacy": "protected",
18039
- "inheritedFrom": {
18040
- "name": "FormAssociatedMixin",
18041
- "module": "src/common/mixins/FormAssociatedMixin.ts"
18042
- }
18085
+ "description": "Optional slot that holds shortcut keys to access the subject",
18086
+ "name": "shortcut"
18087
+ }
18088
+ ],
18089
+ "members": [
18090
+ {
18091
+ "kind": "field",
18092
+ "name": "lastOpened",
18093
+ "type": {
18094
+ "text": "Tooltip | undefined"
18095
+ },
18096
+ "privacy": "private",
18097
+ "static": true
18043
18098
  },
18044
18099
  {
18045
18100
  "kind": "field",
18046
- "name": "hasHint",
18047
- "privacy": "protected",
18048
- "readonly": true,
18049
- "inheritedFrom": {
18050
- "name": "FormAssociatedMixin",
18051
- "module": "src/common/mixins/FormAssociatedMixin.ts"
18052
- }
18101
+ "name": "shortcutSlot",
18102
+ "privacy": "private",
18103
+ "default": "new SlotController(this, \"shortcut\")"
18053
18104
  },
18054
18105
  {
18055
18106
  "kind": "field",
18056
- "name": "hasError",
18057
- "privacy": "protected",
18058
- "readonly": true,
18059
- "inheritedFrom": {
18060
- "name": "FormAssociatedMixin",
18061
- "module": "src/common/mixins/FormAssociatedMixin.ts"
18062
- }
18107
+ "name": "events",
18108
+ "privacy": "private",
18109
+ "default": "new EventController(this)"
18063
18110
  },
18064
18111
  {
18065
18112
  "kind": "field",
18066
- "name": "disabled",
18113
+ "name": "currentElement",
18067
18114
  "type": {
18068
- "text": "boolean"
18115
+ "text": "FocusableElement | undefined"
18069
18116
  },
18070
- "default": "false",
18071
- "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
18072
- "attribute": "disabled",
18073
- "reflects": true,
18074
- "inheritedFrom": {
18075
- "name": "InputMixin",
18076
- "module": "src/common/mixins/InputMixin.ts"
18077
- }
18117
+ "privacy": "private"
18078
18118
  },
18079
18119
  {
18080
18120
  "kind": "field",
18081
- "name": "name",
18121
+ "name": "timeoutId",
18082
18122
  "type": {
18083
- "text": "string | undefined"
18123
+ "text": "ReturnType<typeof setTimeout> | undefined"
18084
18124
  },
18085
- "description": "The name of the form component.",
18086
- "attribute": "name",
18087
- "reflects": true,
18088
- "inheritedFrom": {
18089
- "name": "InputMixin",
18090
- "module": "src/common/mixins/InputMixin.ts"
18091
- }
18125
+ "privacy": "private"
18092
18126
  },
18093
18127
  {
18094
18128
  "kind": "field",
18095
- "name": "value",
18129
+ "name": "proxy",
18096
18130
  "type": {
18097
- "text": "string"
18131
+ "text": "HTMLSpanElement | undefined"
18098
18132
  },
18099
- "default": "\"\"",
18100
- "description": "The value of the form component.",
18101
- "attribute": "value",
18102
- "inheritedFrom": {
18103
- "name": "InputMixin",
18104
- "module": "src/common/mixins/InputMixin.ts"
18105
- }
18133
+ "privacy": "private",
18134
+ "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."
18106
18135
  },
18107
18136
  {
18108
18137
  "kind": "field",
18109
- "name": "formAncestor",
18138
+ "name": "state",
18110
18139
  "type": {
18111
- "text": "HTMLFormElement | null"
18140
+ "text": "TooltipStates"
18112
18141
  },
18113
18142
  "privacy": "private",
18114
- "default": "null",
18115
- "inheritedFrom": {
18116
- "name": "InputMixin",
18117
- "module": "src/common/mixins/InputMixin.ts"
18118
- }
18143
+ "default": "\"hidden\"",
18144
+ "description": "The current state of the tooltip, dependent on the state machine"
18119
18145
  },
18120
18146
  {
18121
18147
  "kind": "field",
18122
- "name": "_formId",
18148
+ "name": "coords",
18123
18149
  "type": {
18124
- "text": "string | undefined"
18150
+ "text": "[number, number]"
18125
18151
  },
18126
- "privacy": "protected",
18127
- "inheritedFrom": {
18128
- "name": "InputMixin",
18129
- "module": "src/common/mixins/InputMixin.ts"
18130
- }
18152
+ "privacy": "private",
18153
+ "default": "[0, 0]"
18131
18154
  },
18132
18155
  {
18133
18156
  "kind": "field",
18134
- "name": "form",
18157
+ "name": "position",
18135
18158
  "type": {
18136
- "text": "HTMLFormElement | null"
18159
+ "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\""
18137
18160
  },
18138
- "description": "Gets the form, if any, associated with the form element.\nThe setter accepts a string, which is the id of the form.",
18139
- "attribute": "form",
18140
- "inheritedFrom": {
18141
- "name": "InputMixin",
18142
- "module": "src/common/mixins/InputMixin.ts"
18143
- }
18161
+ "default": "\"block-start\"",
18162
+ "description": "Control the position of the tooltip component.\nWhen set to \"none\", the tooltip will be shown above\nbut accommodate for browser boundaries.",
18163
+ "attribute": "position",
18164
+ "reflects": true
18144
18165
  },
18145
18166
  {
18146
18167
  "kind": "field",
18147
- "name": "focusableRef",
18148
- "privacy": "protected",
18149
- "inheritedFrom": {
18150
- "name": "FocusableMixin",
18151
- "module": "src/common/mixins/FocusableMixin.ts"
18152
- }
18153
- },
18154
- {
18155
- "kind": "method",
18156
- "name": "focus",
18157
- "parameters": [
18158
- {
18159
- "name": "options",
18160
- "optional": true,
18161
- "type": {
18162
- "text": "FocusOptions"
18163
- },
18164
- "description": "An object which controls aspects of the focusing process."
18165
- }
18166
- ],
18167
- "description": "Programmatically move focus to the component.",
18168
- "inheritedFrom": {
18169
- "name": "FocusableMixin",
18170
- "module": "src/common/mixins/FocusableMixin.ts"
18171
- }
18172
- },
18173
- {
18174
- "kind": "method",
18175
- "name": "blur",
18176
- "description": "Programmatically remove focus from the component.",
18177
- "inheritedFrom": {
18178
- "name": "FocusableMixin",
18179
- "module": "src/common/mixins/FocusableMixin.ts"
18180
- }
18181
- },
18182
- {
18183
- "kind": "method",
18184
- "name": "click",
18185
- "description": "Programmatically simulates a click on the component.",
18186
- "inheritedFrom": {
18187
- "name": "FocusableMixin",
18188
- "module": "src/common/mixins/FocusableMixin.ts"
18189
- }
18190
- }
18191
- ],
18192
- "attributes": [
18193
- {
18194
- "name": "checked",
18168
+ "name": "role",
18195
18169
  "type": {
18196
- "text": "boolean"
18170
+ "text": "string"
18197
18171
  },
18198
- "default": "false",
18199
- "description": "Controls whether the toggle is checked or not.",
18200
- "fieldName": "checked"
18172
+ "default": "\"tooltip\"",
18173
+ "description": "The tooltip role, set on the component by default.",
18174
+ "attribute": "role",
18175
+ "reflects": true
18201
18176
  },
18202
18177
  {
18203
- "name": "reverse",
18178
+ "kind": "field",
18179
+ "name": "id",
18204
18180
  "type": {
18205
- "text": "boolean"
18181
+ "text": "string"
18206
18182
  },
18207
- "default": "false",
18208
- "description": "Controls whether the contents are displayed in reverse order,\nputting the label before the toggle.",
18209
- "fieldName": "reverse"
18183
+ "default": "\"\"",
18184
+ "description": "The id for the active element to reference via aria-describedby.",
18185
+ "attribute": "id",
18186
+ "reflects": true
18210
18187
  },
18211
18188
  {
18212
- "name": "size",
18189
+ "kind": "field",
18190
+ "name": "delay",
18213
18191
  "type": {
18214
- "text": "\"s\" | \"m\" | \"l\""
18192
+ "text": "number"
18215
18193
  },
18216
- "default": "\"m\"",
18217
- "description": "The size of the toggle switch.",
18218
- "fieldName": "size"
18194
+ "default": "500",
18195
+ "description": "The delay in milliseconds before the tooltip is opened.",
18196
+ "attribute": "delay",
18197
+ "reflects": true
18219
18198
  },
18220
18199
  {
18221
- "name": "label",
18222
- "type": {
18223
- "text": "string"
18224
- },
18225
- "default": "\"\"",
18226
- "description": "Label for the input.",
18227
- "fieldName": "label",
18228
- "inheritedFrom": {
18229
- "name": "FormAssociatedMixin",
18230
- "module": "src/common/mixins/FormAssociatedMixin.ts"
18231
- }
18200
+ "kind": "method",
18201
+ "name": "handleIdChange",
18202
+ "privacy": "protected"
18232
18203
  },
18233
18204
  {
18234
- "name": "hint",
18235
- "type": {
18236
- "text": "string | undefined"
18237
- },
18238
- "description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
18239
- "fieldName": "hint",
18240
- "inheritedFrom": {
18241
- "name": "FormAssociatedMixin",
18242
- "module": "src/common/mixins/FormAssociatedMixin.ts"
18243
- }
18205
+ "kind": "method",
18206
+ "name": "handleStateChange",
18207
+ "privacy": "private",
18208
+ "parameters": [
18209
+ {
18210
+ "name": "prevState",
18211
+ "type": {
18212
+ "text": "TooltipStates"
18213
+ }
18214
+ }
18215
+ ]
18244
18216
  },
18245
18217
  {
18246
- "name": "hide-label",
18247
- "type": {
18248
- "text": "boolean"
18249
- },
18250
- "default": "false",
18251
- "description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
18252
- "fieldName": "hideLabel",
18253
- "inheritedFrom": {
18254
- "name": "FormAssociatedMixin",
18255
- "module": "src/common/mixins/FormAssociatedMixin.ts"
18256
- }
18218
+ "kind": "field",
18219
+ "name": "updatePosition",
18220
+ "privacy": "private",
18221
+ "description": "Setting and updating the position of the tooltip"
18222
+ },
18223
+ {
18224
+ "kind": "field",
18225
+ "name": "hideTooltip",
18226
+ "privacy": "private"
18227
+ },
18228
+ {
18229
+ "kind": "field",
18230
+ "name": "reposition",
18231
+ "privacy": "private"
18257
18232
  },
18258
18233
  {
18259
- "name": "placeholder",
18260
- "type": {
18261
- "text": "string | undefined"
18262
- },
18263
- "description": "Placeholder text to display within the input.",
18264
- "fieldName": "placeholder",
18265
- "inheritedFrom": {
18266
- "name": "FormAssociatedMixin",
18267
- "module": "src/common/mixins/FormAssociatedMixin.ts"
18268
- }
18234
+ "kind": "field",
18235
+ "name": "handleShow",
18236
+ "privacy": "private"
18269
18237
  },
18270
18238
  {
18271
- "name": "error",
18272
- "type": {
18273
- "text": "string | undefined"
18274
- },
18275
- "description": "Optional error to be shown with the input. Alternatively use the error slot.",
18276
- "fieldName": "error",
18277
- "inheritedFrom": {
18278
- "name": "FormAssociatedMixin",
18279
- "module": "src/common/mixins/FormAssociatedMixin.ts"
18280
- }
18239
+ "kind": "field",
18240
+ "name": "handleHide",
18241
+ "privacy": "private"
18281
18242
  },
18282
18243
  {
18283
- "name": "required",
18284
- "type": {
18285
- "text": "boolean"
18286
- },
18287
- "default": "false",
18288
- "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.",
18289
- "fieldName": "required",
18290
- "inheritedFrom": {
18291
- "name": "FormAssociatedMixin",
18292
- "module": "src/common/mixins/FormAssociatedMixin.ts"
18293
- }
18244
+ "kind": "field",
18245
+ "name": "hideOnEscape",
18246
+ "privacy": "private"
18294
18247
  },
18295
18248
  {
18296
- "name": "hide-required",
18297
- "type": {
18298
- "text": "boolean"
18299
- },
18300
- "default": "false",
18301
- "description": "Visually hide the required indicator, but still show\nrequired attribute to assistive technologies like screen readers.",
18302
- "fieldName": "hideRequired",
18303
- "inheritedFrom": {
18304
- "name": "FormAssociatedMixin",
18305
- "module": "src/common/mixins/FormAssociatedMixin.ts"
18306
- }
18249
+ "kind": "field",
18250
+ "name": "addDescribedBy",
18251
+ "privacy": "private"
18307
18252
  },
18308
18253
  {
18309
- "name": "disabled",
18254
+ "kind": "field",
18255
+ "name": "removeDescribedBy",
18256
+ "privacy": "private"
18257
+ }
18258
+ ],
18259
+ "attributes": [
18260
+ {
18261
+ "name": "position",
18310
18262
  "type": {
18311
- "text": "boolean"
18263
+ "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\""
18312
18264
  },
18313
- "default": "false",
18314
- "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
18315
- "fieldName": "disabled",
18316
- "inheritedFrom": {
18317
- "name": "InputMixin",
18318
- "module": "src/common/mixins/InputMixin.ts"
18319
- }
18265
+ "default": "\"block-start\"",
18266
+ "description": "Control the position of the tooltip component.\nWhen set to \"none\", the tooltip will be shown above\nbut accommodate for browser boundaries.",
18267
+ "fieldName": "position"
18320
18268
  },
18321
18269
  {
18322
- "name": "name",
18270
+ "name": "role",
18323
18271
  "type": {
18324
- "text": "string | undefined"
18272
+ "text": "string"
18325
18273
  },
18326
- "description": "The name of the form component.",
18327
- "fieldName": "name",
18328
- "inheritedFrom": {
18329
- "name": "InputMixin",
18330
- "module": "src/common/mixins/InputMixin.ts"
18331
- }
18274
+ "default": "\"tooltip\"",
18275
+ "description": "The tooltip role, set on the component by default.",
18276
+ "fieldName": "role"
18332
18277
  },
18333
18278
  {
18334
- "name": "value",
18279
+ "name": "id",
18335
18280
  "type": {
18336
18281
  "text": "string"
18337
18282
  },
18338
18283
  "default": "\"\"",
18339
- "description": "The value of the form component.",
18340
- "fieldName": "value",
18341
- "inheritedFrom": {
18342
- "name": "InputMixin",
18343
- "module": "src/common/mixins/InputMixin.ts"
18344
- }
18284
+ "description": "The id for the active element to reference via aria-describedby.",
18285
+ "fieldName": "id"
18345
18286
  },
18346
18287
  {
18347
- "name": "form",
18288
+ "name": "delay",
18348
18289
  "type": {
18349
- "text": "HTMLFormElement | null"
18290
+ "text": "number"
18350
18291
  },
18351
- "description": "Gets the form, if any, associated with the form element.\nThe setter accepts a string, which is the id of the form.",
18352
- "fieldName": "form",
18353
- "inheritedFrom": {
18354
- "name": "InputMixin",
18355
- "module": "src/common/mixins/InputMixin.ts"
18356
- }
18292
+ "default": "500",
18293
+ "description": "The delay in milliseconds before the tooltip is opened.",
18294
+ "fieldName": "delay"
18357
18295
  }
18358
18296
  ],
18359
- "mixins": [
18360
- {
18361
- "name": "FormAssociatedMixin",
18362
- "module": "/src/common/mixins/FormAssociatedMixin.js"
18363
- },
18297
+ "superclass": {
18298
+ "name": "LitElement",
18299
+ "package": "lit"
18300
+ },
18301
+ "localization": [],
18302
+ "status": "ready",
18303
+ "category": "overlay",
18304
+ "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",
18305
+ "examples": [],
18306
+ "dependencies": [],
18307
+ "tagName": "nord-tooltip",
18308
+ "customElement": true
18309
+ }
18310
+ ],
18311
+ "exports": [
18312
+ {
18313
+ "kind": "js",
18314
+ "name": "default",
18315
+ "declaration": {
18316
+ "name": "Tooltip",
18317
+ "module": "src/tooltip/Tooltip.ts"
18318
+ }
18319
+ },
18320
+ {
18321
+ "kind": "custom-element-definition",
18322
+ "name": "nord-tooltip",
18323
+ "declaration": {
18324
+ "name": "Tooltip",
18325
+ "module": "src/tooltip/Tooltip.ts"
18326
+ }
18327
+ }
18328
+ ]
18329
+ },
18330
+ {
18331
+ "kind": "javascript-module",
18332
+ "path": "src/top-bar/TopBar.ts",
18333
+ "declarations": [
18334
+ {
18335
+ "kind": "class",
18336
+ "description": "Top bar is a header component that is always visible at the top of the interface. Top bar allows functionality such as search and contextual menus to be placed at the top of the interface.",
18337
+ "name": "TopBar",
18338
+ "slots": [
18364
18339
  {
18365
- "name": "InputMixin",
18366
- "module": "/src/common/mixins/InputMixin.js"
18340
+ "description": "Used for the main content of the top bar. We recommend placing your application’s global search functionality into this slot.",
18341
+ "name": ""
18367
18342
  },
18368
18343
  {
18369
- "name": "FocusableMixin",
18370
- "module": "/src/common/mixins/FocusableMixin.js"
18344
+ "description": "Optional slot for menus, buttons, toggles, etc.",
18345
+ "name": "end"
18371
18346
  }
18372
18347
  ],
18348
+ "members": [],
18373
18349
  "superclass": {
18374
18350
  "name": "LitElement",
18375
18351
  "package": "lit"
18376
18352
  },
18377
18353
  "localization": [],
18378
18354
  "status": "ready",
18379
- "category": "form",
18380
- "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",
18355
+ "category": "structure",
18356
+ "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- Applications that utilize the top bar can allow users to customize the color of the top bar to match their preference. [View an example](/components/top-bar/?example=color).\n- If your application allows it, include search to help users find resources and navigate.\n- Include a user menu in the end slot of the top bar.\n- Use the [layout component](/components/layout/?example=top-bar) to provide structure for the top bar component. We’ve also created [an example which shows full theming capabilities](/components/layout/?example=theming).\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for global navigation. Use the [navigation component](/components/navigation/) instead.\n- Don’t allow the user to set a top bar color that doesn’t provide enough contrast with the content.\n- Don’t allow the user to freely pick a hex code as the top bar color. Instead, offer a choice from a predefined palette of colors which provides sufficient contrast with the content. [View an example](/components/top-bar/?example=color).\n\n</div>\n\n---\n\n## Theming\n\nPlease see the [Top Bar theming](/themes/#top-bar-theming) section in our theming documentation for detailed guidelines.\n\n<nord-button variant=\"primary\" href=\"/themes/#top-bar-theming\">Theming Guidelines</nord-button>\n",
18381
18357
  "examples": [],
18382
18358
  "dependencies": [],
18383
- "tagName": "nord-toggle",
18384
- "customElement": true,
18385
- "events": [
18386
- {
18387
- "name": "input",
18388
- "type": {
18389
- "text": "NordEvent"
18390
- },
18391
- "description": "Fired as the user types into the input.",
18392
- "inheritedFrom": {
18393
- "name": "FormAssociatedMixin",
18394
- "module": "src/common/mixins/FormAssociatedMixin.ts"
18395
- }
18396
- },
18359
+ "tagName": "nord-top-bar",
18360
+ "customElement": true
18361
+ }
18362
+ ],
18363
+ "exports": [
18364
+ {
18365
+ "kind": "js",
18366
+ "name": "default",
18367
+ "declaration": {
18368
+ "name": "TopBar",
18369
+ "module": "src/top-bar/TopBar.ts"
18370
+ }
18371
+ },
18372
+ {
18373
+ "kind": "custom-element-definition",
18374
+ "name": "nord-top-bar",
18375
+ "declaration": {
18376
+ "name": "TopBar",
18377
+ "module": "src/top-bar/TopBar.ts"
18378
+ }
18379
+ }
18380
+ ]
18381
+ },
18382
+ {
18383
+ "kind": "javascript-module",
18384
+ "path": "src/visually-hidden/VisuallyHidden.ts",
18385
+ "declarations": [
18386
+ {
18387
+ "kind": "class",
18388
+ "description": "Visually hidden is used when an element needs to be available\nto assistive technologies like screen readers, but be otherwise\nhidden.",
18389
+ "name": "VisuallyHidden",
18390
+ "slots": [
18397
18391
  {
18398
- "name": "change",
18399
- "type": {
18400
- "text": "NordEvent"
18401
- },
18402
- "description": "Fired whenever the input's value is changed via user interaction.",
18403
- "inheritedFrom": {
18404
- "name": "FormAssociatedMixin",
18405
- "module": "src/common/mixins/FormAssociatedMixin.ts"
18406
- }
18392
+ "description": "The visually hidden content.",
18393
+ "name": ""
18407
18394
  }
18408
- ]
18395
+ ],
18396
+ "members": [],
18397
+ "superclass": {
18398
+ "name": "LitElement",
18399
+ "package": "lit"
18400
+ },
18401
+ "localization": [],
18402
+ "status": "ready",
18403
+ "category": "text",
18404
+ "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",
18405
+ "examples": [],
18406
+ "dependencies": [],
18407
+ "tagName": "nord-visually-hidden",
18408
+ "customElement": true
18409
18409
  }
18410
18410
  ],
18411
18411
  "exports": [
@@ -18413,16 +18413,16 @@
18413
18413
  "kind": "js",
18414
18414
  "name": "default",
18415
18415
  "declaration": {
18416
- "name": "Toggle",
18417
- "module": "src/toggle/Toggle.ts"
18416
+ "name": "VisuallyHidden",
18417
+ "module": "src/visually-hidden/VisuallyHidden.ts"
18418
18418
  }
18419
18419
  },
18420
18420
  {
18421
18421
  "kind": "custom-element-definition",
18422
- "name": "nord-toggle",
18422
+ "name": "nord-visually-hidden",
18423
18423
  "declaration": {
18424
- "name": "Toggle",
18425
- "module": "src/toggle/Toggle.ts"
18424
+ "name": "VisuallyHidden",
18425
+ "module": "src/visually-hidden/VisuallyHidden.ts"
18426
18426
  }
18427
18427
  }
18428
18428
  ]