@nordhealth/components 3.20.0 → 3.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -673,6 +673,123 @@
673
673
  }
674
674
  ]
675
675
  },
676
+ {
677
+ "kind": "javascript-module",
678
+ "path": "src/badge/Badge.ts",
679
+ "declarations": [
680
+ {
681
+ "kind": "class",
682
+ "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.",
683
+ "name": "Badge",
684
+ "slots": [
685
+ {
686
+ "description": "The badge content.",
687
+ "name": ""
688
+ },
689
+ {
690
+ "description": "Used to place an icon at the start of badge.",
691
+ "name": "icon"
692
+ }
693
+ ],
694
+ "members": [
695
+ {
696
+ "kind": "field",
697
+ "name": "type",
698
+ "type": {
699
+ "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | \"neutral\" | \"progress\" | undefined"
700
+ },
701
+ "description": "The type of badge.\nDetermines the background color of the badge.",
702
+ "deprecated": "Use `variant` instead. If you previously used `\"progress\"`, use `\"info\"` instead.",
703
+ "default": "\"neutral\"",
704
+ "attribute": "type",
705
+ "reflects": true
706
+ },
707
+ {
708
+ "kind": "field",
709
+ "name": "variant",
710
+ "type": {
711
+ "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"neutral\" | \"info\" | undefined"
712
+ },
713
+ "description": "The style variant of the badge.\nDetermines the background color of the badge.",
714
+ "default": "\"neutral\"",
715
+ "attribute": "variant",
716
+ "reflects": true
717
+ },
718
+ {
719
+ "kind": "field",
720
+ "name": "strong",
721
+ "type": {
722
+ "text": "boolean"
723
+ },
724
+ "default": "false",
725
+ "description": "Strong badges are a secondary style for badges.\nThey provide more visual prominence and emphasize them.",
726
+ "attribute": "strong",
727
+ "reflects": true
728
+ }
729
+ ],
730
+ "attributes": [
731
+ {
732
+ "name": "type",
733
+ "type": {
734
+ "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | \"neutral\" | \"progress\" | undefined"
735
+ },
736
+ "description": "The type of badge.\nDetermines the background color of the badge.",
737
+ "deprecated": "Use `variant` instead. If you previously used `\"progress\"`, use `\"info\"` instead.",
738
+ "default": "\"neutral\"",
739
+ "fieldName": "type"
740
+ },
741
+ {
742
+ "name": "variant",
743
+ "type": {
744
+ "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"neutral\" | \"info\" | undefined"
745
+ },
746
+ "description": "The style variant of the badge.\nDetermines the background color of the badge.",
747
+ "default": "\"neutral\"",
748
+ "fieldName": "variant"
749
+ },
750
+ {
751
+ "name": "strong",
752
+ "type": {
753
+ "text": "boolean"
754
+ },
755
+ "default": "false",
756
+ "description": "Strong badges are a secondary style for badges.\nThey provide more visual prominence and emphasize them.",
757
+ "fieldName": "strong"
758
+ }
759
+ ],
760
+ "superclass": {
761
+ "name": "LitElement",
762
+ "package": "lit"
763
+ },
764
+ "localization": [],
765
+ "status": "ready",
766
+ "category": "text",
767
+ "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",
768
+ "examples": [],
769
+ "dependencies": [],
770
+ "tagName": "nord-badge",
771
+ "customElement": true
772
+ }
773
+ ],
774
+ "exports": [
775
+ {
776
+ "kind": "js",
777
+ "name": "default",
778
+ "declaration": {
779
+ "name": "Badge",
780
+ "module": "src/badge/Badge.ts"
781
+ }
782
+ },
783
+ {
784
+ "kind": "custom-element-definition",
785
+ "name": "nord-badge",
786
+ "declaration": {
787
+ "name": "Badge",
788
+ "module": "src/badge/Badge.ts"
789
+ }
790
+ }
791
+ ]
792
+ },
676
793
  {
677
794
  "kind": "javascript-module",
678
795
  "path": "src/button/Button.ts",
@@ -1369,123 +1486,6 @@
1369
1486
  }
1370
1487
  ]
1371
1488
  },
1372
- {
1373
- "kind": "javascript-module",
1374
- "path": "src/badge/Badge.ts",
1375
- "declarations": [
1376
- {
1377
- "kind": "class",
1378
- "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.",
1379
- "name": "Badge",
1380
- "slots": [
1381
- {
1382
- "description": "The badge content.",
1383
- "name": ""
1384
- },
1385
- {
1386
- "description": "Used to place an icon at the start of badge.",
1387
- "name": "icon"
1388
- }
1389
- ],
1390
- "members": [
1391
- {
1392
- "kind": "field",
1393
- "name": "type",
1394
- "type": {
1395
- "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | \"neutral\" | \"progress\" | undefined"
1396
- },
1397
- "description": "The type of badge.\nDetermines the background color of the badge.",
1398
- "deprecated": "Use `variant` instead. If you previously used `\"progress\"`, use `\"info\"` instead.",
1399
- "default": "\"neutral\"",
1400
- "attribute": "type",
1401
- "reflects": true
1402
- },
1403
- {
1404
- "kind": "field",
1405
- "name": "variant",
1406
- "type": {
1407
- "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"neutral\" | \"info\" | undefined"
1408
- },
1409
- "description": "The style variant of the badge.\nDetermines the background color of the badge.",
1410
- "default": "\"neutral\"",
1411
- "attribute": "variant",
1412
- "reflects": true
1413
- },
1414
- {
1415
- "kind": "field",
1416
- "name": "strong",
1417
- "type": {
1418
- "text": "boolean"
1419
- },
1420
- "default": "false",
1421
- "description": "Strong badges are a secondary style for badges.\nThey provide more visual prominence and emphasize them.",
1422
- "attribute": "strong",
1423
- "reflects": true
1424
- }
1425
- ],
1426
- "attributes": [
1427
- {
1428
- "name": "type",
1429
- "type": {
1430
- "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | \"neutral\" | \"progress\" | undefined"
1431
- },
1432
- "description": "The type of badge.\nDetermines the background color of the badge.",
1433
- "deprecated": "Use `variant` instead. If you previously used `\"progress\"`, use `\"info\"` instead.",
1434
- "default": "\"neutral\"",
1435
- "fieldName": "type"
1436
- },
1437
- {
1438
- "name": "variant",
1439
- "type": {
1440
- "text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"neutral\" | \"info\" | undefined"
1441
- },
1442
- "description": "The style variant of the badge.\nDetermines the background color of the badge.",
1443
- "default": "\"neutral\"",
1444
- "fieldName": "variant"
1445
- },
1446
- {
1447
- "name": "strong",
1448
- "type": {
1449
- "text": "boolean"
1450
- },
1451
- "default": "false",
1452
- "description": "Strong badges are a secondary style for badges.\nThey provide more visual prominence and emphasize them.",
1453
- "fieldName": "strong"
1454
- }
1455
- ],
1456
- "superclass": {
1457
- "name": "LitElement",
1458
- "package": "lit"
1459
- },
1460
- "localization": [],
1461
- "status": "ready",
1462
- "category": "text",
1463
- "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",
1464
- "examples": [],
1465
- "dependencies": [],
1466
- "tagName": "nord-badge",
1467
- "customElement": true
1468
- }
1469
- ],
1470
- "exports": [
1471
- {
1472
- "kind": "js",
1473
- "name": "default",
1474
- "declaration": {
1475
- "name": "Badge",
1476
- "module": "src/badge/Badge.ts"
1477
- }
1478
- },
1479
- {
1480
- "kind": "custom-element-definition",
1481
- "name": "nord-badge",
1482
- "declaration": {
1483
- "name": "Badge",
1484
- "module": "src/badge/Badge.ts"
1485
- }
1486
- }
1487
- ]
1488
- },
1489
1489
  {
1490
1490
  "kind": "javascript-module",
1491
1491
  "path": "src/button-group/ButtonGroup.ts",
@@ -6466,10 +6466,10 @@
6466
6466
  "kind": "field",
6467
6467
  "name": "position",
6468
6468
  "type": {
6469
- "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\""
6469
+ "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\" | \"auto\""
6470
6470
  },
6471
6471
  "default": "\"block-end\"",
6472
- "description": "Set the position in relation to the toggle (or anchor).\nOptions follow logical properties.\n`block-start` and `block-end` referring to top and bottom respectively,\n`inline-start` and `inline-end` referring to left and right respectively.",
6472
+ "description": "Set the position in relation to the toggle (or anchor).\nOptions follow logical properties.\n`block-start` and `block-end` referring to top and bottom respectively,\n`inline-start` and `inline-end` referring to left and right respectively.\nYou can also set it to `auto` for automatic positioning depending on\nwhich side has the most space available.",
6473
6473
  "attribute": "position",
6474
6474
  "reflects": true,
6475
6475
  "inheritedFrom": {
@@ -6542,10 +6542,10 @@
6542
6542
  {
6543
6543
  "name": "position",
6544
6544
  "type": {
6545
- "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\""
6545
+ "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\" | \"auto\""
6546
6546
  },
6547
6547
  "default": "\"block-end\"",
6548
- "description": "Set the position in relation to the toggle (or anchor).\nOptions follow logical properties.\n`block-start` and `block-end` referring to top and bottom respectively,\n`inline-start` and `inline-end` referring to left and right respectively.",
6548
+ "description": "Set the position in relation to the toggle (or anchor).\nOptions follow logical properties.\n`block-start` and `block-end` referring to top and bottom respectively,\n`inline-start` and `inline-end` referring to left and right respectively.\nYou can also set it to `auto` for automatic positioning depending on\nwhich side has the most space available.",
6549
6549
  "fieldName": "position",
6550
6550
  "inheritedFrom": {
6551
6551
  "name": "FloatingMixin",
@@ -7240,106 +7240,25 @@
7240
7240
  },
7241
7241
  {
7242
7242
  "kind": "javascript-module",
7243
- "path": "src/header/Header.ts",
7243
+ "path": "src/icon/Icon.ts",
7244
7244
  "declarations": [
7245
7245
  {
7246
7246
  "kind": "class",
7247
- "description": "The header is a block of designated space for labelling the currently\nviewed context as well as providing primary actions.",
7248
- "name": "Header",
7247
+ "description": "Icons are used to provide additional meaning or in places where text label doesn’t fit.\nIcon component allows you to display an icon from the Nordicons library.",
7248
+ "name": "Icon",
7249
7249
  "slots": [
7250
7250
  {
7251
- "description": "The header content.",
7251
+ "description": "The default slot used for placing a custom SVG icon.",
7252
7252
  "name": ""
7253
- },
7254
- {
7255
- "description": "Optional slot for buttons, toggles, etc.",
7256
- "name": "end"
7257
7253
  }
7258
7254
  ],
7259
7255
  "members": [
7260
7256
  {
7261
7257
  "kind": "field",
7262
- "name": "endSlot",
7258
+ "name": "manager",
7263
7259
  "privacy": "private",
7264
- "default": "new SlotController(this, \"end\")"
7265
- },
7266
- {
7267
- "kind": "field",
7268
- "name": "size",
7269
- "type": {
7270
- "text": "\"m\" | \"s\""
7271
- },
7272
- "default": "\"m\"",
7273
- "description": "Controls the size of the header component.",
7274
- "attribute": "size",
7275
- "reflects": true
7276
- }
7277
- ],
7278
- "attributes": [
7279
- {
7280
- "name": "size",
7281
- "type": {
7282
- "text": "\"m\" | \"s\""
7283
- },
7284
- "default": "\"m\"",
7285
- "description": "Controls the size of the header component.",
7286
- "fieldName": "size"
7287
- }
7288
- ],
7289
- "superclass": {
7290
- "name": "LitElement",
7291
- "package": "lit"
7292
- },
7293
- "localization": [],
7294
- "status": "ready",
7295
- "category": "structure",
7296
- "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use the header component to show a heading to describe the current view.\n- Use the header component to hold primary actions.\n- Use the header component at a visual high position at full width.\n- Utilise the [`n-truncate`](/css/#miscellaneous-utilities) CSS helper to prevent long headings from wrapping.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t overcrowd the header component with too many actions or information.\n- Don’t nest the header component too deeply and restrict its available space.\n- Don’t add large amounts of content or long headings. Aim for headings that are short and concise.\n\n</div>\n\n---\n\n## Content guidelines\n\nThe header component should be a containing element placed high on the page to present high level controls and to describe the page itself. It shouldn’t be overcrowded with controls or information.\n\n<div class=\"n-usage n-usage-do\">[Menu] Dashboard [Account] [Log out]</div>\n<div class=\"n-usage n-usage-dont\">[Menu] Use the cards below to view various information [Export] [Save] [Edit Profile] [Log out] [Preferences]</div>\n",
7297
- "examples": [],
7298
- "dependencies": [],
7299
- "tagName": "nord-header",
7300
- "customElement": true
7301
- }
7302
- ],
7303
- "exports": [
7304
- {
7305
- "kind": "js",
7306
- "name": "default",
7307
- "declaration": {
7308
- "name": "Header",
7309
- "module": "src/header/Header.ts"
7310
- }
7311
- },
7312
- {
7313
- "kind": "custom-element-definition",
7314
- "name": "nord-header",
7315
- "declaration": {
7316
- "name": "Header",
7317
- "module": "src/header/Header.ts"
7318
- }
7319
- }
7320
- ]
7321
- },
7322
- {
7323
- "kind": "javascript-module",
7324
- "path": "src/icon/Icon.ts",
7325
- "declarations": [
7326
- {
7327
- "kind": "class",
7328
- "description": "Icons are used to provide additional meaning or in places where text label doesn’t fit.\nIcon component allows you to display an icon from the Nordicons library.",
7329
- "name": "Icon",
7330
- "slots": [
7331
- {
7332
- "description": "The default slot used for placing a custom SVG icon.",
7333
- "name": ""
7334
- }
7335
- ],
7336
- "members": [
7337
- {
7338
- "kind": "field",
7339
- "name": "manager",
7340
- "privacy": "private",
7341
- "static": true,
7342
- "default": "new IconManager()"
7260
+ "static": true,
7261
+ "default": "new IconManager()"
7343
7262
  },
7344
7263
  {
7345
7264
  "kind": "method",
@@ -9197,6 +9116,87 @@
9197
9116
  }
9198
9117
  ]
9199
9118
  },
9119
+ {
9120
+ "kind": "javascript-module",
9121
+ "path": "src/header/Header.ts",
9122
+ "declarations": [
9123
+ {
9124
+ "kind": "class",
9125
+ "description": "The header is a block of designated space for labelling the currently\nviewed context as well as providing primary actions.",
9126
+ "name": "Header",
9127
+ "slots": [
9128
+ {
9129
+ "description": "The header content.",
9130
+ "name": ""
9131
+ },
9132
+ {
9133
+ "description": "Optional slot for buttons, toggles, etc.",
9134
+ "name": "end"
9135
+ }
9136
+ ],
9137
+ "members": [
9138
+ {
9139
+ "kind": "field",
9140
+ "name": "endSlot",
9141
+ "privacy": "private",
9142
+ "default": "new SlotController(this, \"end\")"
9143
+ },
9144
+ {
9145
+ "kind": "field",
9146
+ "name": "size",
9147
+ "type": {
9148
+ "text": "\"m\" | \"s\""
9149
+ },
9150
+ "default": "\"m\"",
9151
+ "description": "Controls the size of the header component.",
9152
+ "attribute": "size",
9153
+ "reflects": true
9154
+ }
9155
+ ],
9156
+ "attributes": [
9157
+ {
9158
+ "name": "size",
9159
+ "type": {
9160
+ "text": "\"m\" | \"s\""
9161
+ },
9162
+ "default": "\"m\"",
9163
+ "description": "Controls the size of the header component.",
9164
+ "fieldName": "size"
9165
+ }
9166
+ ],
9167
+ "superclass": {
9168
+ "name": "LitElement",
9169
+ "package": "lit"
9170
+ },
9171
+ "localization": [],
9172
+ "status": "ready",
9173
+ "category": "structure",
9174
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use the header component to show a heading to describe the current view.\n- Use the header component to hold primary actions.\n- Use the header component at a visual high position at full width.\n- Utilise the [`n-truncate`](/css/#miscellaneous-utilities) CSS helper to prevent long headings from wrapping.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t overcrowd the header component with too many actions or information.\n- Don’t nest the header component too deeply and restrict its available space.\n- Don’t add large amounts of content or long headings. Aim for headings that are short and concise.\n\n</div>\n\n---\n\n## Content guidelines\n\nThe header component should be a containing element placed high on the page to present high level controls and to describe the page itself. It shouldn’t be overcrowded with controls or information.\n\n<div class=\"n-usage n-usage-do\">[Menu] Dashboard [Account] [Log out]</div>\n<div class=\"n-usage n-usage-dont\">[Menu] Use the cards below to view various information [Export] [Save] [Edit Profile] [Log out] [Preferences]</div>\n",
9175
+ "examples": [],
9176
+ "dependencies": [],
9177
+ "tagName": "nord-header",
9178
+ "customElement": true
9179
+ }
9180
+ ],
9181
+ "exports": [
9182
+ {
9183
+ "kind": "js",
9184
+ "name": "default",
9185
+ "declaration": {
9186
+ "name": "Header",
9187
+ "module": "src/header/Header.ts"
9188
+ }
9189
+ },
9190
+ {
9191
+ "kind": "custom-element-definition",
9192
+ "name": "nord-header",
9193
+ "declaration": {
9194
+ "name": "Header",
9195
+ "module": "src/header/Header.ts"
9196
+ }
9197
+ }
9198
+ ]
9199
+ },
9200
9200
  {
9201
9201
  "kind": "javascript-module",
9202
9202
  "path": "src/localization/LocalizeController.ts",
@@ -9672,7 +9672,7 @@
9672
9672
  "default": "var(--n-space-m)"
9673
9673
  },
9674
9674
  {
9675
- "description": "Controls the padding above and below the modal, using our [spacing tokens](/tokens/#space).",
9675
+ "description": "Controls the padding above and below the header of the modal, using our [spacing tokens](/tokens/#space).",
9676
9676
  "name": "--n-modal-padding-block",
9677
9677
  "default": "var(--n-space-m)"
9678
9678
  },
@@ -9691,6 +9691,10 @@
9691
9691
  "description": "Slot which holds the header of the modal, positioned next to the close button.",
9692
9692
  "name": "header"
9693
9693
  },
9694
+ {
9695
+ "description": "Slot for full bleed content like an image.",
9696
+ "name": "feature"
9697
+ },
9694
9698
  {
9695
9699
  "description": "Slot which is typically used to hold call to action buttons, but can also be used to build custom footers.",
9696
9700
  "name": "footer"
@@ -9713,6 +9717,12 @@
9713
9717
  },
9714
9718
  "privacy": "private"
9715
9719
  },
9720
+ {
9721
+ "kind": "field",
9722
+ "name": "defaultSlot",
9723
+ "privacy": "private",
9724
+ "default": "new SlotController(this)"
9725
+ },
9716
9726
  {
9717
9727
  "kind": "field",
9718
9728
  "name": "headerSlot",
@@ -10454,98 +10464,112 @@
10454
10464
  },
10455
10465
  {
10456
10466
  "kind": "javascript-module",
10457
- "path": "src/nav-toggle/NavToggle.ts",
10467
+ "path": "src/navigation/Navigation.ts",
10458
10468
  "declarations": [
10459
10469
  {
10460
10470
  "kind": "class",
10461
- "description": "Nav toggle is meant for hiding and showing the primary navigation.\nThis component is used internally in the Layout component, but can also be\nused separate to further customize the behavior.",
10462
- "name": "NavToggle",
10471
+ "description": "Navigation is used to display the primary navigation in the sidebar\nof an application. Navigation includes a list of links that users\nuse to move between sections of the application.",
10472
+ "name": "Navigation",
10473
+ "cssProperties": [
10474
+ {
10475
+ "description": "Controls the background color of the navigation element.",
10476
+ "name": "--n-navigation-background-color",
10477
+ "default": "var(--n-color-nav-surface)"
10478
+ }
10479
+ ],
10480
+ "slots": [
10481
+ {
10482
+ "description": "The main section of the sidebar, for holding nav components.",
10483
+ "name": ""
10484
+ },
10485
+ {
10486
+ "description": "The top section of the sidebar.",
10487
+ "name": "header"
10488
+ },
10489
+ {
10490
+ "description": "The bottom section of the sidebar.",
10491
+ "name": "footer"
10492
+ }
10493
+ ],
10463
10494
  "members": [
10464
10495
  {
10465
10496
  "kind": "field",
10466
- "name": "direction",
10497
+ "name": "headerSlot",
10467
10498
  "privacy": "private",
10468
- "default": "new DirectionController(this)"
10499
+ "default": "new SlotController(this, \"header\")"
10469
10500
  },
10470
10501
  {
10471
10502
  "kind": "field",
10472
- "name": "localization",
10503
+ "name": "events",
10473
10504
  "privacy": "private",
10474
- "default": "new LocalizeController<\"nord-nav-toggle\">(this)"
10505
+ "default": "new EventController(this)"
10475
10506
  },
10476
10507
  {
10477
10508
  "kind": "field",
10478
- "name": "focusableRef",
10479
- "privacy": "protected",
10480
- "inheritedFrom": {
10481
- "name": "FocusableMixin",
10482
- "module": "src/common/mixins/FocusableMixin.ts"
10483
- }
10484
- },
10485
- {
10486
- "kind": "method",
10487
- "name": "focus",
10488
- "parameters": [
10489
- {
10490
- "name": "options",
10491
- "optional": true,
10492
- "type": {
10493
- "text": "FocusOptions"
10494
- },
10495
- "description": "An object which controls aspects of the focusing process."
10496
- }
10497
- ],
10498
- "description": "Programmatically move focus to the component.",
10499
- "inheritedFrom": {
10500
- "name": "FocusableMixin",
10501
- "module": "src/common/mixins/FocusableMixin.ts"
10502
- }
10509
+ "name": "allowItemsToRemainOpen",
10510
+ "type": {
10511
+ "text": "boolean"
10512
+ },
10513
+ "privacy": "private",
10514
+ "default": "false"
10503
10515
  },
10504
10516
  {
10505
- "kind": "method",
10506
- "name": "blur",
10507
- "description": "Programmatically remove focus from the component.",
10508
- "inheritedFrom": {
10509
- "name": "FocusableMixin",
10510
- "module": "src/common/mixins/FocusableMixin.ts"
10511
- }
10517
+ "kind": "field",
10518
+ "name": "stickyFooter",
10519
+ "type": {
10520
+ "text": "boolean"
10521
+ },
10522
+ "default": "false",
10523
+ "description": "Controls whether the navigations's footer has sticky positioning.",
10524
+ "attribute": "sticky-footer",
10525
+ "reflects": true
10512
10526
  },
10513
10527
  {
10514
- "kind": "method",
10515
- "name": "click",
10516
- "description": "Programmatically simulates a click on the component.",
10517
- "inheritedFrom": {
10518
- "name": "FocusableMixin",
10519
- "module": "src/common/mixins/FocusableMixin.ts"
10520
- }
10528
+ "kind": "field",
10529
+ "name": "handleActivate",
10530
+ "privacy": "private"
10521
10531
  }
10522
10532
  ],
10523
- "mixins": [
10533
+ "events": [
10524
10534
  {
10525
- "name": "FocusableMixin",
10526
- "module": "/src/common/mixins/FocusableMixin.js"
10535
+ "type": {
10536
+ "text": "NordEvent"
10537
+ },
10538
+ "description": "Dispatched whenever a nav item's state changes between open and closed.",
10539
+ "name": "toggle"
10540
+ },
10541
+ {
10542
+ "type": {
10543
+ "text": "NordEvent"
10544
+ },
10545
+ "description": "Dispatched whenever a nav item has been marked as active",
10546
+ "name": "activate"
10547
+ }
10548
+ ],
10549
+ "attributes": [
10550
+ {
10551
+ "name": "sticky-footer",
10552
+ "type": {
10553
+ "text": "boolean"
10554
+ },
10555
+ "default": "false",
10556
+ "description": "Controls whether the navigations's footer has sticky positioning.",
10557
+ "fieldName": "stickyFooter"
10527
10558
  }
10528
10559
  ],
10529
10560
  "superclass": {
10530
10561
  "name": "LitElement",
10531
10562
  "package": "lit"
10532
10563
  },
10533
- "localization": [
10534
- {
10535
- "name": "label",
10536
- "description": "Accessible label for the nav toggle button."
10537
- }
10538
- ],
10564
+ "localization": [],
10539
10565
  "status": "ready",
10540
- "category": "action",
10541
- "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 with the toggle that’s labelled as `Toggle navigation`.\n- We recommend setting a keyboard shortcut that toggles the navigation.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use as a generic button or toggle. Use the [Button component](/components/button/) instead.\n\n</div>\n",
10566
+ "category": "navigation",
10567
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use for primary navigation items that perform an action when clicked. Each action should navigate to a URL or trigger another action like a modal overlay.\n- Group navigation items into navigation groups based on related categories.\n- Use group headings to clarify the category of a section.\n- Use icons for all top level navigation items.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t place a `<nav>` element inside the navigation component, as it already contains one internally.\n\n</div>\n\n---\n\n## Content guidelines\n\nWhen writing navigation item labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">My tasks</div>\n<div class=\"n-usage n-usage-dont\">My Tasks</div>\n\nAvoid unnecessary words and articles in item labels, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending item labels in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse as few words as possible to describe each item label:\n\n<div class=\"n-usage n-usage-do\">Payments</div>\n<div class=\"n-usage n-usage-dont\">Payments in your clinic</div>\n\nAvoid all caps for item labels and group titles:\n\n<div class=\"n-usage n-usage-do\">Dashboard</div>\n<div class=\"n-usage n-usage-dont\">DASHBOARD</div>\n",
10542
10568
  "examples": [],
10543
10569
  "dependencies": [
10544
- "button",
10545
- "icon",
10546
- "visually-hidden"
10570
+ "nav-item"
10547
10571
  ],
10548
- "tagName": "nord-nav-toggle",
10572
+ "tagName": "nord-navigation",
10549
10573
  "customElement": true
10550
10574
  }
10551
10575
  ],
@@ -10554,152 +10578,114 @@
10554
10578
  "kind": "js",
10555
10579
  "name": "default",
10556
10580
  "declaration": {
10557
- "name": "NavToggle",
10558
- "module": "src/nav-toggle/NavToggle.ts"
10581
+ "name": "Navigation",
10582
+ "module": "src/navigation/Navigation.ts"
10559
10583
  }
10560
10584
  },
10561
10585
  {
10562
10586
  "kind": "custom-element-definition",
10563
- "name": "nord-nav-toggle",
10564
- "declaration": {
10565
- "name": "NavToggle",
10566
- "module": "src/nav-toggle/NavToggle.ts"
10567
- }
10568
- }
10569
- ]
10570
- },
10571
- {
10572
- "kind": "javascript-module",
10573
- "path": "src/nav-toggle/localization.ts",
10574
- "declarations": [
10575
- {
10576
- "kind": "variable",
10577
- "name": "localization",
10578
- "type": {
10579
- "text": "object"
10580
- },
10581
- "default": "{ label: \"Toggle navigation\", }"
10582
- }
10583
- ],
10584
- "exports": [
10585
- {
10586
- "kind": "js",
10587
- "name": "default",
10587
+ "name": "nord-navigation",
10588
10588
  "declaration": {
10589
- "name": "localization",
10590
- "module": "src/nav-toggle/localization.ts"
10589
+ "name": "Navigation",
10590
+ "module": "src/navigation/Navigation.ts"
10591
10591
  }
10592
10592
  }
10593
10593
  ]
10594
10594
  },
10595
10595
  {
10596
10596
  "kind": "javascript-module",
10597
- "path": "src/navigation/Navigation.ts",
10597
+ "path": "src/nav-toggle/NavToggle.ts",
10598
10598
  "declarations": [
10599
10599
  {
10600
10600
  "kind": "class",
10601
- "description": "Navigation is used to display the primary navigation in the sidebar\nof an application. Navigation includes a list of links that users\nuse to move between sections of the application.",
10602
- "name": "Navigation",
10603
- "cssProperties": [
10604
- {
10605
- "description": "Controls the background color of the navigation element.",
10606
- "name": "--n-navigation-background-color",
10607
- "default": "var(--n-color-nav-surface)"
10608
- }
10609
- ],
10610
- "slots": [
10611
- {
10612
- "description": "The main section of the sidebar, for holding nav components.",
10613
- "name": ""
10614
- },
10615
- {
10616
- "description": "The top section of the sidebar.",
10617
- "name": "header"
10618
- },
10619
- {
10620
- "description": "The bottom section of the sidebar.",
10621
- "name": "footer"
10622
- }
10623
- ],
10601
+ "description": "Nav toggle is meant for hiding and showing the primary navigation.\nThis component is used internally in the Layout component, but can also be\nused separate to further customize the behavior.",
10602
+ "name": "NavToggle",
10624
10603
  "members": [
10625
10604
  {
10626
10605
  "kind": "field",
10627
- "name": "headerSlot",
10606
+ "name": "direction",
10628
10607
  "privacy": "private",
10629
- "default": "new SlotController(this, \"header\")"
10608
+ "default": "new DirectionController(this)"
10630
10609
  },
10631
10610
  {
10632
10611
  "kind": "field",
10633
- "name": "events",
10612
+ "name": "localization",
10634
10613
  "privacy": "private",
10635
- "default": "new EventController(this)"
10614
+ "default": "new LocalizeController<\"nord-nav-toggle\">(this)"
10636
10615
  },
10637
10616
  {
10638
10617
  "kind": "field",
10639
- "name": "allowItemsToRemainOpen",
10640
- "type": {
10641
- "text": "boolean"
10642
- },
10643
- "privacy": "private",
10644
- "default": "false"
10618
+ "name": "focusableRef",
10619
+ "privacy": "protected",
10620
+ "inheritedFrom": {
10621
+ "name": "FocusableMixin",
10622
+ "module": "src/common/mixins/FocusableMixin.ts"
10623
+ }
10645
10624
  },
10646
10625
  {
10647
- "kind": "field",
10648
- "name": "stickyFooter",
10649
- "type": {
10650
- "text": "boolean"
10651
- },
10652
- "default": "false",
10653
- "description": "Controls whether the navigations's footer has sticky positioning.",
10654
- "attribute": "sticky-footer",
10655
- "reflects": true
10626
+ "kind": "method",
10627
+ "name": "focus",
10628
+ "parameters": [
10629
+ {
10630
+ "name": "options",
10631
+ "optional": true,
10632
+ "type": {
10633
+ "text": "FocusOptions"
10634
+ },
10635
+ "description": "An object which controls aspects of the focusing process."
10636
+ }
10637
+ ],
10638
+ "description": "Programmatically move focus to the component.",
10639
+ "inheritedFrom": {
10640
+ "name": "FocusableMixin",
10641
+ "module": "src/common/mixins/FocusableMixin.ts"
10642
+ }
10656
10643
  },
10657
10644
  {
10658
- "kind": "field",
10659
- "name": "handleActivate",
10660
- "privacy": "private"
10661
- }
10662
- ],
10663
- "events": [
10664
- {
10665
- "type": {
10666
- "text": "NordEvent"
10667
- },
10668
- "description": "Dispatched whenever a nav item's state changes between open and closed.",
10669
- "name": "toggle"
10645
+ "kind": "method",
10646
+ "name": "blur",
10647
+ "description": "Programmatically remove focus from the component.",
10648
+ "inheritedFrom": {
10649
+ "name": "FocusableMixin",
10650
+ "module": "src/common/mixins/FocusableMixin.ts"
10651
+ }
10670
10652
  },
10671
10653
  {
10672
- "type": {
10673
- "text": "NordEvent"
10674
- },
10675
- "description": "Dispatched whenever a nav item has been marked as active",
10676
- "name": "activate"
10654
+ "kind": "method",
10655
+ "name": "click",
10656
+ "description": "Programmatically simulates a click on the component.",
10657
+ "inheritedFrom": {
10658
+ "name": "FocusableMixin",
10659
+ "module": "src/common/mixins/FocusableMixin.ts"
10660
+ }
10677
10661
  }
10678
10662
  ],
10679
- "attributes": [
10663
+ "mixins": [
10680
10664
  {
10681
- "name": "sticky-footer",
10682
- "type": {
10683
- "text": "boolean"
10684
- },
10685
- "default": "false",
10686
- "description": "Controls whether the navigations's footer has sticky positioning.",
10687
- "fieldName": "stickyFooter"
10665
+ "name": "FocusableMixin",
10666
+ "module": "/src/common/mixins/FocusableMixin.js"
10688
10667
  }
10689
10668
  ],
10690
10669
  "superclass": {
10691
10670
  "name": "LitElement",
10692
10671
  "package": "lit"
10693
10672
  },
10694
- "localization": [],
10673
+ "localization": [
10674
+ {
10675
+ "name": "label",
10676
+ "description": "Accessible label for the nav toggle button."
10677
+ }
10678
+ ],
10695
10679
  "status": "ready",
10696
- "category": "navigation",
10697
- "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use for primary navigation items that perform an action when clicked. Each action should navigate to a URL or trigger another action like a modal overlay.\n- Group navigation items into navigation groups based on related categories.\n- Use group headings to clarify the category of a section.\n- Use icons for all top level navigation items.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t place a `<nav>` element inside the navigation component, as it already contains one internally.\n\n</div>\n\n---\n\n## Content guidelines\n\nWhen writing navigation item labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">My tasks</div>\n<div class=\"n-usage n-usage-dont\">My Tasks</div>\n\nAvoid unnecessary words and articles in item labels, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending item labels in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse as few words as possible to describe each item label:\n\n<div class=\"n-usage n-usage-do\">Payments</div>\n<div class=\"n-usage n-usage-dont\">Payments in your clinic</div>\n\nAvoid all caps for item labels and group titles:\n\n<div class=\"n-usage n-usage-do\">Dashboard</div>\n<div class=\"n-usage n-usage-dont\">DASHBOARD</div>\n",
10680
+ "category": "action",
10681
+ "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 with the toggle that’s labelled as `Toggle navigation`.\n- We recommend setting a keyboard shortcut that toggles the navigation.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use as a generic button or toggle. Use the [Button component](/components/button/) instead.\n\n</div>\n",
10698
10682
  "examples": [],
10699
10683
  "dependencies": [
10700
- "nav-item"
10684
+ "button",
10685
+ "icon",
10686
+ "visually-hidden"
10701
10687
  ],
10702
- "tagName": "nord-navigation",
10688
+ "tagName": "nord-nav-toggle",
10703
10689
  "customElement": true
10704
10690
  }
10705
10691
  ],
@@ -10708,16 +10694,40 @@
10708
10694
  "kind": "js",
10709
10695
  "name": "default",
10710
10696
  "declaration": {
10711
- "name": "Navigation",
10712
- "module": "src/navigation/Navigation.ts"
10697
+ "name": "NavToggle",
10698
+ "module": "src/nav-toggle/NavToggle.ts"
10713
10699
  }
10714
10700
  },
10715
10701
  {
10716
10702
  "kind": "custom-element-definition",
10717
- "name": "nord-navigation",
10703
+ "name": "nord-nav-toggle",
10718
10704
  "declaration": {
10719
- "name": "Navigation",
10720
- "module": "src/navigation/Navigation.ts"
10705
+ "name": "NavToggle",
10706
+ "module": "src/nav-toggle/NavToggle.ts"
10707
+ }
10708
+ }
10709
+ ]
10710
+ },
10711
+ {
10712
+ "kind": "javascript-module",
10713
+ "path": "src/nav-toggle/localization.ts",
10714
+ "declarations": [
10715
+ {
10716
+ "kind": "variable",
10717
+ "name": "localization",
10718
+ "type": {
10719
+ "text": "object"
10720
+ },
10721
+ "default": "{ label: \"Toggle navigation\", }"
10722
+ }
10723
+ ],
10724
+ "exports": [
10725
+ {
10726
+ "kind": "js",
10727
+ "name": "default",
10728
+ "declaration": {
10729
+ "name": "localization",
10730
+ "module": "src/nav-toggle/localization.ts"
10721
10731
  }
10722
10732
  }
10723
10733
  ]
@@ -11138,10 +11148,10 @@
11138
11148
  "kind": "field",
11139
11149
  "name": "position",
11140
11150
  "type": {
11141
- "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\""
11151
+ "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\" | \"auto\""
11142
11152
  },
11143
11153
  "default": "\"block-end\"",
11144
- "description": "Set the position in relation to the toggle (or anchor).\nOptions follow logical properties.\n`block-start` and `block-end` referring to top and bottom respectively,\n`inline-start` and `inline-end` referring to left and right respectively.",
11154
+ "description": "Set the position in relation to the toggle (or anchor).\nOptions follow logical properties.\n`block-start` and `block-end` referring to top and bottom respectively,\n`inline-start` and `inline-end` referring to left and right respectively.\nYou can also set it to `auto` for automatic positioning depending on\nwhich side has the most space available.",
11145
11155
  "attribute": "position",
11146
11156
  "reflects": true,
11147
11157
  "inheritedFrom": {
@@ -11213,10 +11223,10 @@
11213
11223
  {
11214
11224
  "name": "position",
11215
11225
  "type": {
11216
- "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\""
11226
+ "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\" | \"auto\""
11217
11227
  },
11218
11228
  "default": "\"block-end\"",
11219
- "description": "Set the position in relation to the toggle (or anchor).\nOptions follow logical properties.\n`block-start` and `block-end` referring to top and bottom respectively,\n`inline-start` and `inline-end` referring to left and right respectively.",
11229
+ "description": "Set the position in relation to the toggle (or anchor).\nOptions follow logical properties.\n`block-start` and `block-end` referring to top and bottom respectively,\n`inline-start` and `inline-end` referring to left and right respectively.\nYou can also set it to `auto` for automatic positioning depending on\nwhich side has the most space available.",
11220
11230
  "fieldName": "position",
11221
11231
  "inheritedFrom": {
11222
11232
  "name": "FloatingMixin",
@@ -11624,18 +11634,33 @@
11624
11634
  },
11625
11635
  {
11626
11636
  "kind": "javascript-module",
11627
- "path": "src/radio/Radio.ts",
11637
+ "path": "src/range/Range.ts",
11628
11638
  "declarations": [
11629
11639
  {
11630
11640
  "kind": "class",
11631
- "description": "Radio buttons are graphical user interface elements that allow user to choose only one option from\na predefined set of mutually exclusive options.",
11632
- "name": "Radio",
11641
+ "description": "Range input lets user specify a numeric value using a slider which\nmust be no less than a given value, and no more than another given value.",
11642
+ "name": "Range",
11633
11643
  "cssProperties": [
11634
11644
  {
11635
- "description": "Controls the text color of the label, using our [color tokens](/tokens/#color).",
11636
- "name": "--n-label-color",
11637
- "default": "var(--n-color-text)"
11638
- }
11645
+ "description": "Controls the size of the thumb.",
11646
+ "name": "--n-range-thumb-size",
11647
+ "default": "20px"
11648
+ },
11649
+ {
11650
+ "description": "Controls the color of the portion of the track that represents the current value.",
11651
+ "name": "--n-range-track-color-active",
11652
+ "default": "var(--n-color-accent)"
11653
+ },
11654
+ {
11655
+ "description": "Controls the color of the portion of the track that represents the remaining value.",
11656
+ "name": "--n-range-track-color-inactive",
11657
+ "default": "var(--n-color-border-strong)"
11658
+ },
11659
+ {
11660
+ "description": "Controls the height of the track.",
11661
+ "name": "--n-range-track-size",
11662
+ "default": "3px"
11663
+ }
11639
11664
  ],
11640
11665
  "slots": [
11641
11666
  {
@@ -11654,38 +11679,66 @@
11654
11679
  "members": [
11655
11680
  {
11656
11681
  "kind": "field",
11657
- "name": "inputId",
11682
+ "name": "direction",
11683
+ "privacy": "private",
11684
+ "default": "new DirectionController(this)"
11685
+ },
11686
+ {
11687
+ "kind": "field",
11688
+ "name": "min",
11658
11689
  "type": {
11659
- "text": "string"
11690
+ "text": "number"
11660
11691
  },
11661
- "privacy": "protected",
11662
- "default": "\"input\"",
11663
- "inheritedFrom": {
11664
- "name": "FormAssociatedMixin",
11665
- "module": "src/common/mixins/FormAssociatedMixin.ts"
11666
- }
11692
+ "default": "0",
11693
+ "description": "Minimum value for the range slider.",
11694
+ "attribute": "min",
11695
+ "reflects": true
11667
11696
  },
11668
11697
  {
11669
11698
  "kind": "field",
11670
- "name": "hintId",
11699
+ "name": "max",
11671
11700
  "type": {
11672
- "text": "string"
11701
+ "text": "number"
11673
11702
  },
11674
- "privacy": "protected",
11675
- "default": "\"hint\"",
11676
- "inheritedFrom": {
11677
- "name": "FormAssociatedMixin",
11678
- "module": "src/common/mixins/FormAssociatedMixin.ts"
11679
- }
11703
+ "default": "10",
11704
+ "description": "Maximum value for the range slider.",
11705
+ "attribute": "max",
11706
+ "reflects": true
11680
11707
  },
11681
11708
  {
11682
11709
  "kind": "field",
11683
- "name": "errorId",
11710
+ "name": "step",
11684
11711
  "type": {
11685
- "text": "string"
11712
+ "text": "number"
11713
+ },
11714
+ "default": "1",
11715
+ "description": "Step amount for the range slider.",
11716
+ "attribute": "step",
11717
+ "reflects": true
11718
+ },
11719
+ {
11720
+ "kind": "field",
11721
+ "name": "expand",
11722
+ "type": {
11723
+ "text": "boolean"
11686
11724
  },
11725
+ "default": "false",
11726
+ "description": "Controls whether the input expands to fill the width of its container.",
11727
+ "attribute": "expand",
11728
+ "reflects": true
11729
+ },
11730
+ {
11731
+ "kind": "method",
11732
+ "name": "handleInput",
11687
11733
  "privacy": "protected",
11688
- "default": "\"error\"",
11734
+ "parameters": [
11735
+ {
11736
+ "name": "e",
11737
+ "type": {
11738
+ "text": "Event"
11739
+ }
11740
+ }
11741
+ ],
11689
11742
  "inheritedFrom": {
11690
11743
  "name": "FormAssociatedMixin",
11691
11744
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -11693,10 +11746,9 @@
11693
11746
  },
11694
11747
  {
11695
11748
  "kind": "field",
11696
- "name": "hintSlot",
11749
+ "name": "labelSlot",
11697
11750
  "privacy": "protected",
11698
- "default": "new LightSlotController(this, { slotName: \"hint\", render: () => (this.hint ? html`<div slot=\"hint-internal\" id=${this.hintId}>${this.hint}</div>` : nothing), syncLightDom: element => { element.id = this.hintId }, })",
11699
- "description": "For accessibility reasons, we render some parts of the component to the light DOM.",
11751
+ "default": "new SlotController(this, \"label\")",
11700
11752
  "inheritedFrom": {
11701
11753
  "name": "FormAssociatedMixin",
11702
11754
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -11704,9 +11756,9 @@
11704
11756
  },
11705
11757
  {
11706
11758
  "kind": "field",
11707
- "name": "labelSlot",
11759
+ "name": "errorSlot",
11708
11760
  "privacy": "protected",
11709
- "default": "new LightSlotController(this, { slotName: \"label\", render: () => (this.label ? html`<label slot=\"label-internal\" for=${this.inputId}>${this.label}</label>` : nothing), syncLightDom: element => { if (!isLabel(element)) { // eslint-disable-next-line no-console console.warn(`NORD: Only <label> elements should be placed in radio's \"label\" slot`) } else { element.htmlFor = this.inputId } }, })",
11761
+ "default": "new SlotController(this, \"error\")",
11710
11762
  "inheritedFrom": {
11711
11763
  "name": "FormAssociatedMixin",
11712
11764
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -11714,9 +11766,9 @@
11714
11766
  },
11715
11767
  {
11716
11768
  "kind": "field",
11717
- "name": "errorSlot",
11769
+ "name": "hintSlot",
11718
11770
  "privacy": "protected",
11719
- "default": "new LightSlotController(this, { slotName: \"error\", render: () => (this.error ? html`<div slot=\"error-internal\" id=${this.errorId}>${this.error}</div>` : nothing), syncLightDom: element => { element.id = this.hintId }, })",
11771
+ "default": "new SlotController(this, \"hint\")",
11720
11772
  "inheritedFrom": {
11721
11773
  "name": "FormAssociatedMixin",
11722
11774
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -11724,9 +11776,13 @@
11724
11776
  },
11725
11777
  {
11726
11778
  "kind": "field",
11727
- "name": "inputSlot",
11779
+ "name": "formData",
11728
11780
  "privacy": "protected",
11729
- "default": "new LightDomController(this, { render: () => html` <input slot=\"input\" @blur=${this.handleBlur} @focus=${this.handleFocus} ${ref(this.focusableRef)} class=\"n-input\" id=${this.inputId} type=\"radio\" name=${cond(this.name)} .value=${cond(this.value)} .checked=${this.checked} ?disabled=${this.disabled} ?required=${this.required} aria-describedby=${cond(this.getDescribedBy())} aria-invalid=${cond(this.getInvalid())} form=${cond(this._formId)} /> `, })"
11781
+ "default": "new FormDataController(this, { value: () => this.formValue })",
11782
+ "inheritedFrom": {
11783
+ "name": "FormAssociatedMixin",
11784
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
11785
+ }
11730
11786
  },
11731
11787
  {
11732
11788
  "kind": "field",
@@ -11740,50 +11796,12 @@
11740
11796
  },
11741
11797
  {
11742
11798
  "kind": "field",
11743
- "name": "checked",
11799
+ "name": "inputId",
11744
11800
  "type": {
11745
- "text": "boolean"
11801
+ "text": "string"
11746
11802
  },
11747
- "default": "false",
11748
- "description": "Controls whether the checkbox is checked or not.",
11749
- "attribute": "checked",
11750
- "reflects": true
11751
- },
11752
- {
11753
- "kind": "method",
11754
- "name": "handleCheckedChange",
11755
- "privacy": "protected",
11756
- "parameters": [
11757
- {
11758
- "name": "previousChecked",
11759
- "type": {
11760
- "text": "boolean"
11761
- }
11762
- }
11763
- ]
11764
- },
11765
- {
11766
- "kind": "method",
11767
- "name": "uncheckSiblings",
11768
- "privacy": "private"
11769
- },
11770
- {
11771
- "kind": "method",
11772
- "name": "handleChange",
11773
11803
  "privacy": "protected",
11774
- "parameters": [
11775
- {
11776
- "name": "e",
11777
- "type": {
11778
- "text": "Event"
11779
- }
11780
- }
11781
- ],
11782
- "return": {
11783
- "type": {
11784
- "text": "void"
11785
- }
11786
- },
11804
+ "default": "\"input\"",
11787
11805
  "inheritedFrom": {
11788
11806
  "name": "FormAssociatedMixin",
11789
11807
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -11791,34 +11809,25 @@
11791
11809
  },
11792
11810
  {
11793
11811
  "kind": "field",
11794
- "name": "handleBlur",
11795
- "privacy": "private"
11796
- },
11797
- {
11798
- "kind": "field",
11799
- "name": "handleFocus",
11800
- "privacy": "private"
11801
- },
11802
- {
11803
- "kind": "field",
11804
- "name": "size",
11812
+ "name": "errorId",
11805
11813
  "type": {
11806
- "text": "\"s\" | \"m\" | \"l\""
11814
+ "text": "string"
11807
11815
  },
11808
- "default": "\"m\"",
11809
- "description": "The size of the component.",
11810
- "attribute": "size",
11811
- "reflects": true,
11816
+ "privacy": "protected",
11817
+ "default": "\"error\"",
11812
11818
  "inheritedFrom": {
11813
- "name": "SizeMixin",
11814
- "module": "src/common/mixins/SizeMixin.ts"
11819
+ "name": "FormAssociatedMixin",
11820
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
11815
11821
  }
11816
11822
  },
11817
11823
  {
11818
11824
  "kind": "field",
11819
- "name": "formData",
11825
+ "name": "hintId",
11826
+ "type": {
11827
+ "text": "string"
11828
+ },
11820
11829
  "privacy": "protected",
11821
- "default": "new FormDataController(this, { value: () => this.formValue })",
11830
+ "default": "\"hint\"",
11822
11831
  "inheritedFrom": {
11823
11832
  "name": "FormAssociatedMixin",
11824
11833
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -11928,7 +11937,7 @@
11928
11937
  },
11929
11938
  {
11930
11939
  "kind": "method",
11931
- "name": "handleInput",
11940
+ "name": "handleChange",
11932
11941
  "privacy": "protected",
11933
11942
  "parameters": [
11934
11943
  {
@@ -12008,6 +12017,35 @@
12008
12017
  "module": "src/common/mixins/FormAssociatedMixin.ts"
12009
12018
  }
12010
12019
  },
12020
+ {
12021
+ "kind": "field",
12022
+ "name": "autocomplete",
12023
+ "type": {
12024
+ "text": "AutocompleteAttribute"
12025
+ },
12026
+ "default": "\"off\"",
12027
+ "description": "Specifies the data type of the field, so that the browser may attempt to fill out the field automatically on behalf of the user.",
12028
+ "attribute": "autocomplete",
12029
+ "inheritedFrom": {
12030
+ "name": "AutocompleteMixin",
12031
+ "module": "src/common/mixins/AutocompleteMixin.ts"
12032
+ }
12033
+ },
12034
+ {
12035
+ "kind": "field",
12036
+ "name": "readonly",
12037
+ "type": {
12038
+ "text": "boolean"
12039
+ },
12040
+ "default": "false",
12041
+ "description": "Makes the component readonly, so that it is not editable.\nReadonly differs from disabled in that readonly fields are still focusable and will be submitted with a form.",
12042
+ "attribute": "readonly",
12043
+ "reflects": true,
12044
+ "inheritedFrom": {
12045
+ "name": "ReadonlyMixin",
12046
+ "module": "src/common/mixins/ReadonlyMixin.ts"
12047
+ }
12048
+ },
12011
12049
  {
12012
12050
  "kind": "field",
12013
12051
  "name": "disabled",
@@ -12136,56 +12174,94 @@
12136
12174
  }
12137
12175
  }
12138
12176
  ],
12139
- "attributes": [
12140
- {
12141
- "name": "checked",
12142
- "type": {
12143
- "text": "boolean"
12144
- },
12145
- "default": "false",
12146
- "description": "Controls whether the checkbox is checked or not.",
12147
- "fieldName": "checked"
12148
- },
12149
- {
12150
- "name": "size",
12151
- "type": {
12152
- "text": "\"s\" | \"m\" | \"l\""
12153
- },
12154
- "default": "\"m\"",
12155
- "description": "The size of the component.",
12156
- "fieldName": "size",
12157
- "inheritedFrom": {
12158
- "name": "SizeMixin",
12159
- "module": "src/common/mixins/SizeMixin.ts"
12160
- }
12161
- },
12177
+ "events": [
12162
12178
  {
12163
- "name": "label",
12179
+ "name": "input",
12164
12180
  "type": {
12165
- "text": "string"
12181
+ "text": "NordEvent"
12166
12182
  },
12167
- "default": "\"\"",
12168
- "description": "Label for the input.",
12169
- "fieldName": "label",
12183
+ "description": "Fired as the user types into the input.",
12170
12184
  "inheritedFrom": {
12171
12185
  "name": "FormAssociatedMixin",
12172
12186
  "module": "src/common/mixins/FormAssociatedMixin.ts"
12173
12187
  }
12174
12188
  },
12175
12189
  {
12176
- "name": "hint",
12190
+ "name": "change",
12177
12191
  "type": {
12178
- "text": "string | undefined"
12192
+ "text": "NordEvent"
12179
12193
  },
12180
- "description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
12181
- "fieldName": "hint",
12194
+ "description": "Fired whenever the input's value is changed via user interaction.",
12182
12195
  "inheritedFrom": {
12183
12196
  "name": "FormAssociatedMixin",
12184
12197
  "module": "src/common/mixins/FormAssociatedMixin.ts"
12185
12198
  }
12186
- },
12199
+ }
12200
+ ],
12201
+ "attributes": [
12187
12202
  {
12188
- "name": "hide-label",
12203
+ "name": "min",
12204
+ "type": {
12205
+ "text": "number"
12206
+ },
12207
+ "default": "0",
12208
+ "description": "Minimum value for the range slider.",
12209
+ "fieldName": "min"
12210
+ },
12211
+ {
12212
+ "name": "max",
12213
+ "type": {
12214
+ "text": "number"
12215
+ },
12216
+ "default": "10",
12217
+ "description": "Maximum value for the range slider.",
12218
+ "fieldName": "max"
12219
+ },
12220
+ {
12221
+ "name": "step",
12222
+ "type": {
12223
+ "text": "number"
12224
+ },
12225
+ "default": "1",
12226
+ "description": "Step amount for the range slider.",
12227
+ "fieldName": "step"
12228
+ },
12229
+ {
12230
+ "name": "expand",
12231
+ "type": {
12232
+ "text": "boolean"
12233
+ },
12234
+ "default": "false",
12235
+ "description": "Controls whether the input expands to fill the width of its container.",
12236
+ "fieldName": "expand"
12237
+ },
12238
+ {
12239
+ "name": "label",
12240
+ "type": {
12241
+ "text": "string"
12242
+ },
12243
+ "default": "\"\"",
12244
+ "description": "Label for the input.",
12245
+ "fieldName": "label",
12246
+ "inheritedFrom": {
12247
+ "name": "FormAssociatedMixin",
12248
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
12249
+ }
12250
+ },
12251
+ {
12252
+ "name": "hint",
12253
+ "type": {
12254
+ "text": "string | undefined"
12255
+ },
12256
+ "description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
12257
+ "fieldName": "hint",
12258
+ "inheritedFrom": {
12259
+ "name": "FormAssociatedMixin",
12260
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
12261
+ }
12262
+ },
12263
+ {
12264
+ "name": "hide-label",
12189
12265
  "type": {
12190
12266
  "text": "boolean"
12191
12267
  },
@@ -12247,6 +12323,32 @@
12247
12323
  "module": "src/common/mixins/FormAssociatedMixin.ts"
12248
12324
  }
12249
12325
  },
12326
+ {
12327
+ "name": "autocomplete",
12328
+ "type": {
12329
+ "text": "AutocompleteAttribute"
12330
+ },
12331
+ "default": "\"off\"",
12332
+ "description": "Specifies the data type of the field, so that the browser may attempt to fill out the field automatically on behalf of the user.",
12333
+ "fieldName": "autocomplete",
12334
+ "inheritedFrom": {
12335
+ "name": "AutocompleteMixin",
12336
+ "module": "src/common/mixins/AutocompleteMixin.ts"
12337
+ }
12338
+ },
12339
+ {
12340
+ "name": "readonly",
12341
+ "type": {
12342
+ "text": "boolean"
12343
+ },
12344
+ "default": "false",
12345
+ "description": "Makes the component readonly, so that it is not editable.\nReadonly differs from disabled in that readonly fields are still focusable and will be submitted with a form.",
12346
+ "fieldName": "readonly",
12347
+ "inheritedFrom": {
12348
+ "name": "ReadonlyMixin",
12349
+ "module": "src/common/mixins/ReadonlyMixin.ts"
12350
+ }
12351
+ },
12250
12352
  {
12251
12353
  "name": "disabled",
12252
12354
  "type": {
@@ -12299,14 +12401,18 @@
12299
12401
  }
12300
12402
  ],
12301
12403
  "mixins": [
12302
- {
12303
- "name": "SizeMixin",
12304
- "module": "/src/common/mixins/SizeMixin.js"
12305
- },
12306
12404
  {
12307
12405
  "name": "FormAssociatedMixin",
12308
12406
  "module": "/src/common/mixins/FormAssociatedMixin.js"
12309
12407
  },
12408
+ {
12409
+ "name": "AutocompleteMixin",
12410
+ "module": "/src/common/mixins/AutocompleteMixin.js"
12411
+ },
12412
+ {
12413
+ "name": "ReadonlyMixin",
12414
+ "module": "/src/common/mixins/ReadonlyMixin.js"
12415
+ },
12310
12416
  {
12311
12417
  "name": "InputMixin",
12312
12418
  "module": "/src/common/mixins/InputMixin.js"
@@ -12323,35 +12429,11 @@
12323
12429
  "localization": [],
12324
12430
  "status": "ready",
12325
12431
  "category": "form",
12326
- "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use a radio component when users can only select one option from a list.\n- Favor radios over a select component when there are a small number of options. This reduces the number of clicks a user has to make, increasing efficiency.\n- Radio buttons are grouped by their `name` attribute. Therefore, it is crucial that the same `name` is used for a group of radios.\n- Give each radio within a group a unique `value`.\n- Radios **must** be used in combination with a fieldset component.\n- In most cases, a stack component should be used to layout a group of radio buttons.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t place interactive content (buttons, links etc) inside the label.\n- Don’t use when a user can select more than one option. In this case, use a checkbox instead.\n- Don’t use for “accepting terms of service” and similar functionality. Use a checkbox instead.\n- When you have more than 10 options to choose from. Consider using a select instead.\n\n</div>\n\n---\n\n## Content guidelines\n\nRadio button labels should be clear, accurate and predictable. It should be possible for the user to understand what they are enabling or disabling:\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">Option 1</div>\n\nWhen writing radio button labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">My tasks</div>\n<div class=\"n-usage n-usage-dont\">My Tasks</div>\n\nAvoid ending in punctuation if it’s a single sentence, word, or a fragment:\n\n<div class=\"n-usage n-usage-do\">Blue</div>\n<div class=\"n-usage n-usage-dont\">Blue.</div>\n\nDo not use commas or semicolons at the end of each line\n\n<div class=\"n-usage n-usage-do\">Patient</div>\n<div class=\"n-usage n-usage-dont\">Patient;</div>\n\n---\n\n## Additional considerations\n\n- Hint text can be used to offer further information or explanation for an option.\n- Once a radio has been selected, users cannot return to having no radios selected without refreshing their browser window. Therefore, you should include \"None of the above\" or \"I do not know\" if they are valid options.\n- In most cases, radio buttons should be stacked vertically. However, radio buttons can be stacked horizontally when there are only two options with short labels. An example might be a yes/no question.\n",
12432
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to let user specify a numeric value using a slider.\n- Use when the accuracy of the numeric value entered isn’t important.\n- Always use with a label, even if that label is hidden.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use when the accuracy of the numeric value entered is important.\n- For entering arbitrary numeric values. Use [input component](/components/input/) instead.\n\n</div>\n\n---\n\n## Content guidelines\n\nRange labels act as a title for the range input. Labels should typically be short and in noun form:\n\n<div class=\"n-usage n-usage-do\">Lightness percentage</div>\n<div class=\"n-usage n-usage-dont\">What is the lightness percentage?</div>\n\nWhen writing range 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\">Item price</div>\n<div class=\"n-usage n-usage-dont\">Item Price</div>\n\nDo not use colons in range label:\n\n<div class=\"n-usage n-usage-do\">Color depth</div>\n<div class=\"n-usage n-usage-dont\">Color depth:</div>\n",
12327
12433
  "examples": [],
12328
12434
  "dependencies": [],
12329
- "tagName": "nord-radio",
12330
- "customElement": true,
12331
- "events": [
12332
- {
12333
- "name": "input",
12334
- "type": {
12335
- "text": "NordEvent"
12336
- },
12337
- "description": "Fired as the user types into the input.",
12338
- "inheritedFrom": {
12339
- "name": "FormAssociatedMixin",
12340
- "module": "src/common/mixins/FormAssociatedMixin.ts"
12341
- }
12342
- },
12343
- {
12344
- "name": "change",
12345
- "type": {
12346
- "text": "NordEvent"
12347
- },
12348
- "description": "Fired whenever the input's value is changed via user interaction.",
12349
- "inheritedFrom": {
12350
- "name": "FormAssociatedMixin",
12351
- "module": "src/common/mixins/FormAssociatedMixin.ts"
12352
- }
12353
- }
12354
- ]
12435
+ "tagName": "nord-range",
12436
+ "customElement": true
12355
12437
  }
12356
12438
  ],
12357
12439
  "exports": [
@@ -12359,48 +12441,33 @@
12359
12441
  "kind": "js",
12360
12442
  "name": "default",
12361
12443
  "declaration": {
12362
- "name": "Radio",
12363
- "module": "src/radio/Radio.ts"
12444
+ "name": "Range",
12445
+ "module": "src/range/Range.ts"
12364
12446
  }
12365
12447
  },
12366
12448
  {
12367
12449
  "kind": "custom-element-definition",
12368
- "name": "nord-radio",
12450
+ "name": "nord-range",
12369
12451
  "declaration": {
12370
- "name": "Radio",
12371
- "module": "src/radio/Radio.ts"
12452
+ "name": "Range",
12453
+ "module": "src/range/Range.ts"
12372
12454
  }
12373
12455
  }
12374
12456
  ]
12375
12457
  },
12376
12458
  {
12377
12459
  "kind": "javascript-module",
12378
- "path": "src/range/Range.ts",
12460
+ "path": "src/radio/Radio.ts",
12379
12461
  "declarations": [
12380
12462
  {
12381
12463
  "kind": "class",
12382
- "description": "Range input lets user specify a numeric value using a slider which\nmust be no less than a given value, and no more than another given value.",
12383
- "name": "Range",
12464
+ "description": "Radio buttons are graphical user interface elements that allow user to choose only one option from\na predefined set of mutually exclusive options.",
12465
+ "name": "Radio",
12384
12466
  "cssProperties": [
12385
12467
  {
12386
- "description": "Controls the size of the thumb.",
12387
- "name": "--n-range-thumb-size",
12388
- "default": "20px"
12389
- },
12390
- {
12391
- "description": "Controls the color of the portion of the track that represents the current value.",
12392
- "name": "--n-range-track-color-active",
12393
- "default": "var(--n-color-accent)"
12394
- },
12395
- {
12396
- "description": "Controls the color of the portion of the track that represents the remaining value.",
12397
- "name": "--n-range-track-color-inactive",
12398
- "default": "var(--n-color-border-strong)"
12399
- },
12400
- {
12401
- "description": "Controls the height of the track.",
12402
- "name": "--n-range-track-size",
12403
- "default": "3px"
12468
+ "description": "Controls the text color of the label, using our [color tokens](/tokens/#color).",
12469
+ "name": "--n-label-color",
12470
+ "default": "var(--n-color-text)"
12404
12471
  }
12405
12472
  ],
12406
12473
  "slots": [
@@ -12420,66 +12487,38 @@
12420
12487
  "members": [
12421
12488
  {
12422
12489
  "kind": "field",
12423
- "name": "direction",
12424
- "privacy": "private",
12425
- "default": "new DirectionController(this)"
12426
- },
12427
- {
12428
- "kind": "field",
12429
- "name": "min",
12430
- "type": {
12431
- "text": "number"
12432
- },
12433
- "default": "0",
12434
- "description": "Minimum value for the range slider.",
12435
- "attribute": "min",
12436
- "reflects": true
12437
- },
12438
- {
12439
- "kind": "field",
12440
- "name": "max",
12490
+ "name": "inputId",
12441
12491
  "type": {
12442
- "text": "number"
12492
+ "text": "string"
12443
12493
  },
12444
- "default": "10",
12445
- "description": "Maximum value for the range slider.",
12446
- "attribute": "max",
12447
- "reflects": true
12494
+ "privacy": "protected",
12495
+ "default": "\"input\"",
12496
+ "inheritedFrom": {
12497
+ "name": "FormAssociatedMixin",
12498
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
12499
+ }
12448
12500
  },
12449
12501
  {
12450
12502
  "kind": "field",
12451
- "name": "step",
12503
+ "name": "hintId",
12452
12504
  "type": {
12453
- "text": "number"
12505
+ "text": "string"
12454
12506
  },
12455
- "default": "1",
12456
- "description": "Step amount for the range slider.",
12457
- "attribute": "step",
12458
- "reflects": true
12507
+ "privacy": "protected",
12508
+ "default": "\"hint\"",
12509
+ "inheritedFrom": {
12510
+ "name": "FormAssociatedMixin",
12511
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
12512
+ }
12459
12513
  },
12460
12514
  {
12461
12515
  "kind": "field",
12462
- "name": "expand",
12516
+ "name": "errorId",
12463
12517
  "type": {
12464
- "text": "boolean"
12518
+ "text": "string"
12465
12519
  },
12466
- "default": "false",
12467
- "description": "Controls whether the input expands to fill the width of its container.",
12468
- "attribute": "expand",
12469
- "reflects": true
12470
- },
12471
- {
12472
- "kind": "method",
12473
- "name": "handleInput",
12474
12520
  "privacy": "protected",
12475
- "parameters": [
12476
- {
12477
- "name": "e",
12478
- "type": {
12479
- "text": "Event"
12480
- }
12481
- }
12482
- ],
12521
+ "default": "\"error\"",
12483
12522
  "inheritedFrom": {
12484
12523
  "name": "FormAssociatedMixin",
12485
12524
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -12487,9 +12526,10 @@
12487
12526
  },
12488
12527
  {
12489
12528
  "kind": "field",
12490
- "name": "labelSlot",
12529
+ "name": "hintSlot",
12491
12530
  "privacy": "protected",
12492
- "default": "new SlotController(this, \"label\")",
12531
+ "default": "new LightSlotController(this, { slotName: \"hint\", render: () => (this.hint ? html`<div slot=\"hint-internal\" id=${this.hintId}>${this.hint}</div>` : nothing), syncLightDom: element => { element.id = this.hintId }, })",
12532
+ "description": "For accessibility reasons, we render some parts of the component to the light DOM.",
12493
12533
  "inheritedFrom": {
12494
12534
  "name": "FormAssociatedMixin",
12495
12535
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -12497,9 +12537,9 @@
12497
12537
  },
12498
12538
  {
12499
12539
  "kind": "field",
12500
- "name": "errorSlot",
12540
+ "name": "labelSlot",
12501
12541
  "privacy": "protected",
12502
- "default": "new SlotController(this, \"error\")",
12542
+ "default": "new LightSlotController(this, { slotName: \"label\", render: () => (this.label ? html`<label slot=\"label-internal\" for=${this.inputId}>${this.label}</label>` : nothing), syncLightDom: element => { if (!isLabel(element)) { // eslint-disable-next-line no-console console.warn(`NORD: Only <label> elements should be placed in radio's \"label\" slot`) } else { element.htmlFor = this.inputId } }, })",
12503
12543
  "inheritedFrom": {
12504
12544
  "name": "FormAssociatedMixin",
12505
12545
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -12507,9 +12547,9 @@
12507
12547
  },
12508
12548
  {
12509
12549
  "kind": "field",
12510
- "name": "hintSlot",
12550
+ "name": "errorSlot",
12511
12551
  "privacy": "protected",
12512
- "default": "new SlotController(this, \"hint\")",
12552
+ "default": "new LightSlotController(this, { slotName: \"error\", render: () => (this.error ? html`<div slot=\"error-internal\" id=${this.errorId}>${this.error}</div>` : nothing), syncLightDom: element => { element.id = this.hintId }, })",
12513
12553
  "inheritedFrom": {
12514
12554
  "name": "FormAssociatedMixin",
12515
12555
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -12517,13 +12557,9 @@
12517
12557
  },
12518
12558
  {
12519
12559
  "kind": "field",
12520
- "name": "formData",
12560
+ "name": "inputSlot",
12521
12561
  "privacy": "protected",
12522
- "default": "new FormDataController(this, { value: () => this.formValue })",
12523
- "inheritedFrom": {
12524
- "name": "FormAssociatedMixin",
12525
- "module": "src/common/mixins/FormAssociatedMixin.ts"
12526
- }
12562
+ "default": "new LightDomController(this, { render: () => html` <input slot=\"input\" @blur=${this.handleBlur} @focus=${this.handleFocus} ${ref(this.focusableRef)} class=\"n-input\" id=${this.inputId} type=\"radio\" name=${cond(this.name)} .value=${cond(this.value)} .checked=${this.checked} ?disabled=${this.disabled} ?required=${this.required} aria-describedby=${cond(this.getDescribedBy())} aria-invalid=${cond(this.getInvalid())} form=${cond(this._formId)} /> `, })"
12527
12563
  },
12528
12564
  {
12529
12565
  "kind": "field",
@@ -12537,12 +12573,50 @@
12537
12573
  },
12538
12574
  {
12539
12575
  "kind": "field",
12540
- "name": "inputId",
12576
+ "name": "checked",
12541
12577
  "type": {
12542
- "text": "string"
12578
+ "text": "boolean"
12543
12579
  },
12580
+ "default": "false",
12581
+ "description": "Controls whether the checkbox is checked or not.",
12582
+ "attribute": "checked",
12583
+ "reflects": true
12584
+ },
12585
+ {
12586
+ "kind": "method",
12587
+ "name": "handleCheckedChange",
12544
12588
  "privacy": "protected",
12545
- "default": "\"input\"",
12589
+ "parameters": [
12590
+ {
12591
+ "name": "previousChecked",
12592
+ "type": {
12593
+ "text": "boolean"
12594
+ }
12595
+ }
12596
+ ]
12597
+ },
12598
+ {
12599
+ "kind": "method",
12600
+ "name": "uncheckSiblings",
12601
+ "privacy": "private"
12602
+ },
12603
+ {
12604
+ "kind": "method",
12605
+ "name": "handleChange",
12606
+ "privacy": "protected",
12607
+ "parameters": [
12608
+ {
12609
+ "name": "e",
12610
+ "type": {
12611
+ "text": "Event"
12612
+ }
12613
+ }
12614
+ ],
12615
+ "return": {
12616
+ "type": {
12617
+ "text": "void"
12618
+ }
12619
+ },
12546
12620
  "inheritedFrom": {
12547
12621
  "name": "FormAssociatedMixin",
12548
12622
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -12550,25 +12624,34 @@
12550
12624
  },
12551
12625
  {
12552
12626
  "kind": "field",
12553
- "name": "errorId",
12627
+ "name": "handleBlur",
12628
+ "privacy": "private"
12629
+ },
12630
+ {
12631
+ "kind": "field",
12632
+ "name": "handleFocus",
12633
+ "privacy": "private"
12634
+ },
12635
+ {
12636
+ "kind": "field",
12637
+ "name": "size",
12554
12638
  "type": {
12555
- "text": "string"
12639
+ "text": "\"s\" | \"m\" | \"l\""
12556
12640
  },
12557
- "privacy": "protected",
12558
- "default": "\"error\"",
12641
+ "default": "\"m\"",
12642
+ "description": "The size of the component.",
12643
+ "attribute": "size",
12644
+ "reflects": true,
12559
12645
  "inheritedFrom": {
12560
- "name": "FormAssociatedMixin",
12561
- "module": "src/common/mixins/FormAssociatedMixin.ts"
12646
+ "name": "SizeMixin",
12647
+ "module": "src/common/mixins/SizeMixin.ts"
12562
12648
  }
12563
12649
  },
12564
12650
  {
12565
12651
  "kind": "field",
12566
- "name": "hintId",
12567
- "type": {
12568
- "text": "string"
12569
- },
12652
+ "name": "formData",
12570
12653
  "privacy": "protected",
12571
- "default": "\"hint\"",
12654
+ "default": "new FormDataController(this, { value: () => this.formValue })",
12572
12655
  "inheritedFrom": {
12573
12656
  "name": "FormAssociatedMixin",
12574
12657
  "module": "src/common/mixins/FormAssociatedMixin.ts"
@@ -12678,7 +12761,7 @@
12678
12761
  },
12679
12762
  {
12680
12763
  "kind": "method",
12681
- "name": "handleChange",
12764
+ "name": "handleInput",
12682
12765
  "privacy": "protected",
12683
12766
  "parameters": [
12684
12767
  {
@@ -12758,35 +12841,6 @@
12758
12841
  "module": "src/common/mixins/FormAssociatedMixin.ts"
12759
12842
  }
12760
12843
  },
12761
- {
12762
- "kind": "field",
12763
- "name": "autocomplete",
12764
- "type": {
12765
- "text": "AutocompleteAttribute"
12766
- },
12767
- "default": "\"off\"",
12768
- "description": "Specifies the data type of the field, so that the browser may attempt to fill out the field automatically on behalf of the user.",
12769
- "attribute": "autocomplete",
12770
- "inheritedFrom": {
12771
- "name": "AutocompleteMixin",
12772
- "module": "src/common/mixins/AutocompleteMixin.ts"
12773
- }
12774
- },
12775
- {
12776
- "kind": "field",
12777
- "name": "readonly",
12778
- "type": {
12779
- "text": "boolean"
12780
- },
12781
- "default": "false",
12782
- "description": "Makes the component readonly, so that it is not editable.\nReadonly differs from disabled in that readonly fields are still focusable and will be submitted with a form.",
12783
- "attribute": "readonly",
12784
- "reflects": true,
12785
- "inheritedFrom": {
12786
- "name": "ReadonlyMixin",
12787
- "module": "src/common/mixins/ReadonlyMixin.ts"
12788
- }
12789
- },
12790
12844
  {
12791
12845
  "kind": "field",
12792
12846
  "name": "disabled",
@@ -12915,66 +12969,28 @@
12915
12969
  }
12916
12970
  }
12917
12971
  ],
12918
- "events": [
12972
+ "attributes": [
12919
12973
  {
12920
- "name": "input",
12974
+ "name": "checked",
12921
12975
  "type": {
12922
- "text": "NordEvent"
12976
+ "text": "boolean"
12923
12977
  },
12924
- "description": "Fired as the user types into the input.",
12925
- "inheritedFrom": {
12926
- "name": "FormAssociatedMixin",
12927
- "module": "src/common/mixins/FormAssociatedMixin.ts"
12928
- }
12978
+ "default": "false",
12979
+ "description": "Controls whether the checkbox is checked or not.",
12980
+ "fieldName": "checked"
12929
12981
  },
12930
12982
  {
12931
- "name": "change",
12983
+ "name": "size",
12932
12984
  "type": {
12933
- "text": "NordEvent"
12985
+ "text": "\"s\" | \"m\" | \"l\""
12934
12986
  },
12935
- "description": "Fired whenever the input's value is changed via user interaction.",
12987
+ "default": "\"m\"",
12988
+ "description": "The size of the component.",
12989
+ "fieldName": "size",
12936
12990
  "inheritedFrom": {
12937
- "name": "FormAssociatedMixin",
12938
- "module": "src/common/mixins/FormAssociatedMixin.ts"
12991
+ "name": "SizeMixin",
12992
+ "module": "src/common/mixins/SizeMixin.ts"
12939
12993
  }
12940
- }
12941
- ],
12942
- "attributes": [
12943
- {
12944
- "name": "min",
12945
- "type": {
12946
- "text": "number"
12947
- },
12948
- "default": "0",
12949
- "description": "Minimum value for the range slider.",
12950
- "fieldName": "min"
12951
- },
12952
- {
12953
- "name": "max",
12954
- "type": {
12955
- "text": "number"
12956
- },
12957
- "default": "10",
12958
- "description": "Maximum value for the range slider.",
12959
- "fieldName": "max"
12960
- },
12961
- {
12962
- "name": "step",
12963
- "type": {
12964
- "text": "number"
12965
- },
12966
- "default": "1",
12967
- "description": "Step amount for the range slider.",
12968
- "fieldName": "step"
12969
- },
12970
- {
12971
- "name": "expand",
12972
- "type": {
12973
- "text": "boolean"
12974
- },
12975
- "default": "false",
12976
- "description": "Controls whether the input expands to fill the width of its container.",
12977
- "fieldName": "expand"
12978
12994
  },
12979
12995
  {
12980
12996
  "name": "label",
@@ -13064,32 +13080,6 @@
13064
13080
  "module": "src/common/mixins/FormAssociatedMixin.ts"
13065
13081
  }
13066
13082
  },
13067
- {
13068
- "name": "autocomplete",
13069
- "type": {
13070
- "text": "AutocompleteAttribute"
13071
- },
13072
- "default": "\"off\"",
13073
- "description": "Specifies the data type of the field, so that the browser may attempt to fill out the field automatically on behalf of the user.",
13074
- "fieldName": "autocomplete",
13075
- "inheritedFrom": {
13076
- "name": "AutocompleteMixin",
13077
- "module": "src/common/mixins/AutocompleteMixin.ts"
13078
- }
13079
- },
13080
- {
13081
- "name": "readonly",
13082
- "type": {
13083
- "text": "boolean"
13084
- },
13085
- "default": "false",
13086
- "description": "Makes the component readonly, so that it is not editable.\nReadonly differs from disabled in that readonly fields are still focusable and will be submitted with a form.",
13087
- "fieldName": "readonly",
13088
- "inheritedFrom": {
13089
- "name": "ReadonlyMixin",
13090
- "module": "src/common/mixins/ReadonlyMixin.ts"
13091
- }
13092
- },
13093
13083
  {
13094
13084
  "name": "disabled",
13095
13085
  "type": {
@@ -13143,16 +13133,12 @@
13143
13133
  ],
13144
13134
  "mixins": [
13145
13135
  {
13146
- "name": "FormAssociatedMixin",
13147
- "module": "/src/common/mixins/FormAssociatedMixin.js"
13148
- },
13149
- {
13150
- "name": "AutocompleteMixin",
13151
- "module": "/src/common/mixins/AutocompleteMixin.js"
13136
+ "name": "SizeMixin",
13137
+ "module": "/src/common/mixins/SizeMixin.js"
13152
13138
  },
13153
13139
  {
13154
- "name": "ReadonlyMixin",
13155
- "module": "/src/common/mixins/ReadonlyMixin.js"
13140
+ "name": "FormAssociatedMixin",
13141
+ "module": "/src/common/mixins/FormAssociatedMixin.js"
13156
13142
  },
13157
13143
  {
13158
13144
  "name": "InputMixin",
@@ -13170,11 +13156,35 @@
13170
13156
  "localization": [],
13171
13157
  "status": "ready",
13172
13158
  "category": "form",
13173
- "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to let user specify a numeric value using a slider.\n- Use when the accuracy of the numeric value entered isn’t important.\n- Always use with a label, even if that label is hidden.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use when the accuracy of the numeric value entered is important.\n- For entering arbitrary numeric values. Use [input component](/components/input/) instead.\n\n</div>\n\n---\n\n## Content guidelines\n\nRange labels act as a title for the range input. Labels should typically be short and in noun form:\n\n<div class=\"n-usage n-usage-do\">Lightness percentage</div>\n<div class=\"n-usage n-usage-dont\">What is the lightness percentage?</div>\n\nWhen writing range 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\">Item price</div>\n<div class=\"n-usage n-usage-dont\">Item Price</div>\n\nDo not use colons in range label:\n\n<div class=\"n-usage n-usage-do\">Color depth</div>\n<div class=\"n-usage n-usage-dont\">Color depth:</div>\n",
13159
+ "readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use a radio component when users can only select one option from a list.\n- Favor radios over a select component when there are a small number of options. This reduces the number of clicks a user has to make, increasing efficiency.\n- Radio buttons are grouped by their `name` attribute. Therefore, it is crucial that the same `name` is used for a group of radios.\n- Give each radio within a group a unique `value`.\n- Radios **must** be used in combination with a fieldset component.\n- In most cases, a stack component should be used to layout a group of radio buttons.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t place interactive content (buttons, links etc) inside the label.\n- Don’t use when a user can select more than one option. In this case, use a checkbox instead.\n- Don’t use for “accepting terms of service” and similar functionality. Use a checkbox instead.\n- When you have more than 10 options to choose from. Consider using a select instead.\n\n</div>\n\n---\n\n## Content guidelines\n\nRadio button labels should be clear, accurate and predictable. It should be possible for the user to understand what they are enabling or disabling:\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">Option 1</div>\n\nWhen writing radio button labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">My tasks</div>\n<div class=\"n-usage n-usage-dont\">My Tasks</div>\n\nAvoid ending in punctuation if it’s a single sentence, word, or a fragment:\n\n<div class=\"n-usage n-usage-do\">Blue</div>\n<div class=\"n-usage n-usage-dont\">Blue.</div>\n\nDo not use commas or semicolons at the end of each line\n\n<div class=\"n-usage n-usage-do\">Patient</div>\n<div class=\"n-usage n-usage-dont\">Patient;</div>\n\n---\n\n## Additional considerations\n\n- Hint text can be used to offer further information or explanation for an option.\n- Once a radio has been selected, users cannot return to having no radios selected without refreshing their browser window. Therefore, you should include \"None of the above\" or \"I do not know\" if they are valid options.\n- In most cases, radio buttons should be stacked vertically. However, radio buttons can be stacked horizontally when there are only two options with short labels. An example might be a yes/no question.\n",
13174
13160
  "examples": [],
13175
13161
  "dependencies": [],
13176
- "tagName": "nord-range",
13177
- "customElement": true
13162
+ "tagName": "nord-radio",
13163
+ "customElement": true,
13164
+ "events": [
13165
+ {
13166
+ "name": "input",
13167
+ "type": {
13168
+ "text": "NordEvent"
13169
+ },
13170
+ "description": "Fired as the user types into the input.",
13171
+ "inheritedFrom": {
13172
+ "name": "FormAssociatedMixin",
13173
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
13174
+ }
13175
+ },
13176
+ {
13177
+ "name": "change",
13178
+ "type": {
13179
+ "text": "NordEvent"
13180
+ },
13181
+ "description": "Fired whenever the input's value is changed via user interaction.",
13182
+ "inheritedFrom": {
13183
+ "name": "FormAssociatedMixin",
13184
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
13185
+ }
13186
+ }
13187
+ ]
13178
13188
  }
13179
13189
  ],
13180
13190
  "exports": [
@@ -13182,115 +13192,29 @@
13182
13192
  "kind": "js",
13183
13193
  "name": "default",
13184
13194
  "declaration": {
13185
- "name": "Range",
13186
- "module": "src/range/Range.ts"
13195
+ "name": "Radio",
13196
+ "module": "src/radio/Radio.ts"
13187
13197
  }
13188
13198
  },
13189
13199
  {
13190
13200
  "kind": "custom-element-definition",
13191
- "name": "nord-range",
13201
+ "name": "nord-radio",
13192
13202
  "declaration": {
13193
- "name": "Range",
13194
- "module": "src/range/Range.ts"
13203
+ "name": "Radio",
13204
+ "module": "src/radio/Radio.ts"
13195
13205
  }
13196
13206
  }
13197
13207
  ]
13198
13208
  },
13199
13209
  {
13200
13210
  "kind": "javascript-module",
13201
- "path": "src/segmented-control/SegmentedControl.ts",
13211
+ "path": "src/segmented-control-item/SegmentedControlItem.ts",
13202
13212
  "declarations": [
13203
13213
  {
13204
13214
  "kind": "class",
13205
- "description": "Segmented control is used to pick one choice from a set of\nclosely related choices, and immediately apply that selection.",
13206
- "name": "SegmentedControl",
13207
- "slots": [
13208
- {
13209
- "description": "Default slot.",
13210
- "name": ""
13211
- }
13212
- ],
13213
- "members": [
13214
- {
13215
- "kind": "field",
13216
- "name": "defaultSlot",
13217
- "privacy": "private",
13218
- "default": "new SlotController(this)"
13219
- },
13220
- {
13221
- "kind": "field",
13222
- "name": "expand",
13223
- "type": {
13224
- "text": "boolean"
13225
- },
13226
- "default": "false",
13227
- "description": "Controls whether the segmented control expands to fill the width of its container.",
13228
- "attribute": "expand",
13229
- "reflects": true
13230
- }
13231
- ],
13232
- "events": [
13233
- {
13234
- "type": {
13235
- "text": "NordEvent"
13236
- },
13237
- "description": "Fired whenever a segmented control item has been checked.",
13238
- "name": "change"
13239
- }
13240
- ],
13241
- "attributes": [
13242
- {
13243
- "name": "expand",
13244
- "type": {
13245
- "text": "boolean"
13246
- },
13247
- "default": "false",
13248
- "description": "Controls whether the segmented control expands to fill the width of its container.",
13249
- "fieldName": "expand"
13250
- }
13251
- ],
13252
- "superclass": {
13253
- "name": "LitElement",
13254
- "package": "lit"
13255
- },
13256
- "localization": [],
13257
- "status": "new",
13258
- "category": "action",
13259
- "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 segmented control to allow users to pick one choice from a set of closely related choices, and immediately apply that selection.\n- Favor segmented control or [radio component](/components/radio/) over a select component when there are a small number of options. This reduces the number of clicks a user has to make, increasing efficiency.\n- Segmented control items are grouped by their `name` attribute. Therefore, it is crucial that the same `name` is used for a group of segmented control items.\n- Give each segmented control item within a group a unique `value`.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t place interactive content (buttons, links etc) inside the label.\n- Don’t use when a user can select more than one option. In this case, use a [checkbox](/components/checkbox/) or [selectable tag](/components/tag/?example=selectable) instead.\n- Don’t use for “accepting terms of service” and similar functionality. Use a [checkbox](/components/checkbox/) instead.\n- When you have more than 5 options to choose from. Consider using a [select](/components/select/) instead.\n\n</div>\n\n---\n\n## Content guidelines\n\nSegmented control labels should be clear, accurate and predictable. It should be possible for the user to understand what they are enabling or disabling:\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">Option 1</div>\n\nWhen writing segmented control labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">My tasks</div>\n<div class=\"n-usage n-usage-dont\">My Tasks</div>\n\nAvoid ending in punctuation if it’s a single sentence, word, or a fragment:\n\n<div class=\"n-usage n-usage-do\">Blue</div>\n<div class=\"n-usage n-usage-dont\">Blue.</div>\n\nDo not use commas or semicolons at the end of each line\n\n<div class=\"n-usage n-usage-do\">Patient</div>\n<div class=\"n-usage n-usage-dont\">Patient;</div>\n\n---\n\n## Additional considerations\n\n- Once a segmented control item has been selected, users cannot return to having no items selected without refreshing their browser window. Therefore, you should always make sure one of the items is pre-selected.\n",
13260
- "examples": [],
13261
- "dependencies": [],
13262
- "tagName": "nord-segmented-control",
13263
- "customElement": true
13264
- }
13265
- ],
13266
- "exports": [
13267
- {
13268
- "kind": "js",
13269
- "name": "default",
13270
- "declaration": {
13271
- "name": "SegmentedControl",
13272
- "module": "src/segmented-control/SegmentedControl.ts"
13273
- }
13274
- },
13275
- {
13276
- "kind": "custom-element-definition",
13277
- "name": "nord-segmented-control",
13278
- "declaration": {
13279
- "name": "SegmentedControl",
13280
- "module": "src/segmented-control/SegmentedControl.ts"
13281
- }
13282
- }
13283
- ]
13284
- },
13285
- {
13286
- "kind": "javascript-module",
13287
- "path": "src/segmented-control-item/SegmentedControlItem.ts",
13288
- "declarations": [
13289
- {
13290
- "kind": "class",
13291
- "description": "Segmented control items populate a segmented control with options.\nEvery item should be placed inside a segmented control.",
13292
- "name": "SegmentedControlItem",
13293
- "cssProperties": [
13215
+ "description": "Segmented control items populate a segmented control with options.\nEvery item should be placed inside a segmented control.",
13216
+ "name": "SegmentedControlItem",
13217
+ "cssProperties": [
13294
13218
  {
13295
13219
  "description": "Controls the rounded corners of the item, using [border radius tokens](/tokens/#border-radius).",
13296
13220
  "name": "--n-segmented-control-item-border-radius",
@@ -13730,6 +13654,92 @@
13730
13654
  }
13731
13655
  ]
13732
13656
  },
13657
+ {
13658
+ "kind": "javascript-module",
13659
+ "path": "src/segmented-control/SegmentedControl.ts",
13660
+ "declarations": [
13661
+ {
13662
+ "kind": "class",
13663
+ "description": "Segmented control is used to pick one choice from a set of\nclosely related choices, and immediately apply that selection.",
13664
+ "name": "SegmentedControl",
13665
+ "slots": [
13666
+ {
13667
+ "description": "Default slot.",
13668
+ "name": ""
13669
+ }
13670
+ ],
13671
+ "members": [
13672
+ {
13673
+ "kind": "field",
13674
+ "name": "defaultSlot",
13675
+ "privacy": "private",
13676
+ "default": "new SlotController(this)"
13677
+ },
13678
+ {
13679
+ "kind": "field",
13680
+ "name": "expand",
13681
+ "type": {
13682
+ "text": "boolean"
13683
+ },
13684
+ "default": "false",
13685
+ "description": "Controls whether the segmented control expands to fill the width of its container.",
13686
+ "attribute": "expand",
13687
+ "reflects": true
13688
+ }
13689
+ ],
13690
+ "events": [
13691
+ {
13692
+ "type": {
13693
+ "text": "NordEvent"
13694
+ },
13695
+ "description": "Fired whenever a segmented control item has been checked.",
13696
+ "name": "change"
13697
+ }
13698
+ ],
13699
+ "attributes": [
13700
+ {
13701
+ "name": "expand",
13702
+ "type": {
13703
+ "text": "boolean"
13704
+ },
13705
+ "default": "false",
13706
+ "description": "Controls whether the segmented control expands to fill the width of its container.",
13707
+ "fieldName": "expand"
13708
+ }
13709
+ ],
13710
+ "superclass": {
13711
+ "name": "LitElement",
13712
+ "package": "lit"
13713
+ },
13714
+ "localization": [],
13715
+ "status": "new",
13716
+ "category": "action",
13717
+ "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 segmented control to allow users to pick one choice from a set of closely related choices, and immediately apply that selection.\n- Favor segmented control or [radio component](/components/radio/) over a select component when there are a small number of options. This reduces the number of clicks a user has to make, increasing efficiency.\n- Segmented control items are grouped by their `name` attribute. Therefore, it is crucial that the same `name` is used for a group of segmented control items.\n- Give each segmented control item within a group a unique `value`.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t place interactive content (buttons, links etc) inside the label.\n- Don’t use when a user can select more than one option. In this case, use a [checkbox](/components/checkbox/) or [selectable tag](/components/tag/?example=selectable) instead.\n- Don’t use for “accepting terms of service” and similar functionality. Use a [checkbox](/components/checkbox/) instead.\n- When you have more than 5 options to choose from. Consider using a [select](/components/select/) instead.\n\n</div>\n\n---\n\n## Content guidelines\n\nSegmented control labels should be clear, accurate and predictable. It should be possible for the user to understand what they are enabling or disabling:\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">Option 1</div>\n\nWhen writing segmented control labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">My tasks</div>\n<div class=\"n-usage n-usage-dont\">My Tasks</div>\n\nAvoid ending in punctuation if it’s a single sentence, word, or a fragment:\n\n<div class=\"n-usage n-usage-do\">Blue</div>\n<div class=\"n-usage n-usage-dont\">Blue.</div>\n\nDo not use commas or semicolons at the end of each line\n\n<div class=\"n-usage n-usage-do\">Patient</div>\n<div class=\"n-usage n-usage-dont\">Patient;</div>\n\n---\n\n## Additional considerations\n\n- Once a segmented control item has been selected, users cannot return to having no items selected without refreshing their browser window. Therefore, you should always make sure one of the items is pre-selected.\n",
13718
+ "examples": [],
13719
+ "dependencies": [],
13720
+ "tagName": "nord-segmented-control",
13721
+ "customElement": true
13722
+ }
13723
+ ],
13724
+ "exports": [
13725
+ {
13726
+ "kind": "js",
13727
+ "name": "default",
13728
+ "declaration": {
13729
+ "name": "SegmentedControl",
13730
+ "module": "src/segmented-control/SegmentedControl.ts"
13731
+ }
13732
+ },
13733
+ {
13734
+ "kind": "custom-element-definition",
13735
+ "name": "nord-segmented-control",
13736
+ "declaration": {
13737
+ "name": "SegmentedControl",
13738
+ "module": "src/segmented-control/SegmentedControl.ts"
13739
+ }
13740
+ }
13741
+ ]
13742
+ },
13733
13743
  {
13734
13744
  "kind": "javascript-module",
13735
13745
  "path": "src/select/Select.ts",
@@ -17329,80 +17339,343 @@
17329
17339
  },
17330
17340
  {
17331
17341
  "kind": "javascript-module",
17332
- "path": "src/toggle/Toggle.ts",
17342
+ "path": "src/tooltip/Tooltip.ts",
17333
17343
  "declarations": [
17334
17344
  {
17335
17345
  "kind": "class",
17336
- "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.",
17337
- "name": "Toggle",
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",
17338
17348
  "cssProperties": [
17339
17349
  {
17340
- "description": "Controls the text color of the label, using our [color tokens](/tokens/#color).",
17341
- "name": "--n-label-color",
17342
- "default": "var(--n-color-text)"
17350
+ "description": "Controls the maximum inline size, or width, of the tooltip.",
17351
+ "name": "--n-tooltip-max-size",
17352
+ "default": "50ch"
17343
17353
  }
17344
17354
  ],
17345
17355
  "slots": [
17346
17356
  {
17347
- "description": "Use when a label requires more than plain text.",
17348
- "name": "label"
17349
- },
17350
- {
17351
- "description": "Optional slot that holds hint text for the input.",
17352
- "name": "hint"
17357
+ "description": "The tooltip content",
17358
+ "name": ""
17353
17359
  },
17354
17360
  {
17355
- "description": "Optional slot that holds error text for the input.",
17356
- "name": "error"
17361
+ "description": "Optional slot that holds shortcut keys to access the subject",
17362
+ "name": "shortcut"
17357
17363
  }
17358
17364
  ],
17359
17365
  "members": [
17360
17366
  {
17361
17367
  "kind": "field",
17362
- "name": "formValue",
17363
- "privacy": "protected",
17364
- "readonly": true,
17365
- "inheritedFrom": {
17366
- "name": "FormAssociatedMixin",
17367
- "module": "src/common/mixins/FormAssociatedMixin.ts"
17368
- }
17368
+ "name": "lastOpened",
17369
+ "type": {
17370
+ "text": "Tooltip | undefined"
17371
+ },
17372
+ "privacy": "private",
17373
+ "static": true
17369
17374
  },
17370
17375
  {
17371
17376
  "kind": "field",
17372
- "name": "checked",
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)"
17386
+ },
17387
+ {
17388
+ "kind": "field",
17389
+ "name": "currentElement",
17373
17390
  "type": {
17374
- "text": "boolean"
17391
+ "text": "FocusableElement | undefined"
17375
17392
  },
17376
- "default": "false",
17377
- "description": "Controls whether the toggle is checked or not.",
17378
- "attribute": "checked",
17379
- "reflects": true
17393
+ "privacy": "private"
17380
17394
  },
17381
17395
  {
17382
17396
  "kind": "field",
17383
- "name": "reverse",
17397
+ "name": "timeoutId",
17384
17398
  "type": {
17385
- "text": "boolean"
17399
+ "text": "ReturnType<typeof setTimeout> | undefined"
17386
17400
  },
17387
- "default": "false",
17388
- "description": "Controls whether the contents are displayed in reverse order,\nputting the label before the toggle.",
17389
- "attribute": "reverse",
17390
- "reflects": true
17401
+ "privacy": "private"
17391
17402
  },
17392
17403
  {
17393
17404
  "kind": "field",
17394
- "name": "size",
17405
+ "name": "proxy",
17406
+ "privacy": "private",
17407
+ "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
+ },
17409
+ {
17410
+ "kind": "field",
17411
+ "name": "state",
17395
17412
  "type": {
17396
- "text": "\"s\" | \"m\" | \"l\""
17413
+ "text": "TooltipStates"
17397
17414
  },
17398
- "default": "\"m\"",
17399
- "description": "The size of the toggle switch.",
17400
- "attribute": "size",
17401
- "reflects": true
17415
+ "privacy": "private",
17416
+ "default": "\"hidden\"",
17417
+ "description": "The current state of the tooltip, dependent on the state machine"
17402
17418
  },
17403
17419
  {
17404
- "kind": "method",
17405
- "name": "handleChange",
17420
+ "kind": "field",
17421
+ "name": "coords",
17422
+ "type": {
17423
+ "text": "[number, number]"
17424
+ },
17425
+ "privacy": "private",
17426
+ "default": "[0, 0]"
17427
+ },
17428
+ {
17429
+ "kind": "field",
17430
+ "name": "position",
17431
+ "type": {
17432
+ "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\""
17433
+ },
17434
+ "default": "\"block-start\"",
17435
+ "description": "Control the position of the tooltip component.\nWhen set to \"none\", the tooltip will be shown above\nbut accommodate for browser boundaries.",
17436
+ "attribute": "position",
17437
+ "reflects": true
17438
+ },
17439
+ {
17440
+ "kind": "field",
17441
+ "name": "role",
17442
+ "type": {
17443
+ "text": "string"
17444
+ },
17445
+ "default": "\"tooltip\"",
17446
+ "description": "The tooltip role, set on the component by default.",
17447
+ "attribute": "role",
17448
+ "reflects": true
17449
+ },
17450
+ {
17451
+ "kind": "field",
17452
+ "name": "id",
17453
+ "type": {
17454
+ "text": "string"
17455
+ },
17456
+ "default": "\"\"",
17457
+ "description": "The id for the active element to reference via aria-describedby.",
17458
+ "attribute": "id",
17459
+ "reflects": true
17460
+ },
17461
+ {
17462
+ "kind": "field",
17463
+ "name": "delay",
17464
+ "type": {
17465
+ "text": "number"
17466
+ },
17467
+ "default": "500",
17468
+ "description": "The delay in milliseconds before the tooltip is opened.",
17469
+ "attribute": "delay",
17470
+ "reflects": true
17471
+ },
17472
+ {
17473
+ "kind": "method",
17474
+ "name": "handleIdChange",
17475
+ "privacy": "protected"
17476
+ },
17477
+ {
17478
+ "kind": "method",
17479
+ "name": "handleStateChange",
17480
+ "privacy": "private",
17481
+ "parameters": [
17482
+ {
17483
+ "name": "prevState",
17484
+ "type": {
17485
+ "text": "TooltipStates"
17486
+ }
17487
+ }
17488
+ ]
17489
+ },
17490
+ {
17491
+ "kind": "field",
17492
+ "name": "updatePosition",
17493
+ "privacy": "private",
17494
+ "description": "Setting and updating the position of the tooltip"
17495
+ },
17496
+ {
17497
+ "kind": "field",
17498
+ "name": "hideTooltip",
17499
+ "privacy": "private"
17500
+ },
17501
+ {
17502
+ "kind": "field",
17503
+ "name": "reposition",
17504
+ "privacy": "private"
17505
+ },
17506
+ {
17507
+ "kind": "field",
17508
+ "name": "handleShow",
17509
+ "privacy": "private"
17510
+ },
17511
+ {
17512
+ "kind": "field",
17513
+ "name": "handleHide",
17514
+ "privacy": "private"
17515
+ },
17516
+ {
17517
+ "kind": "field",
17518
+ "name": "hideOnEscape",
17519
+ "privacy": "private"
17520
+ },
17521
+ {
17522
+ "kind": "field",
17523
+ "name": "addDescribedBy",
17524
+ "privacy": "private"
17525
+ },
17526
+ {
17527
+ "kind": "field",
17528
+ "name": "removeDescribedBy",
17529
+ "privacy": "private"
17530
+ }
17531
+ ],
17532
+ "attributes": [
17533
+ {
17534
+ "name": "position",
17535
+ "type": {
17536
+ "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\""
17537
+ },
17538
+ "default": "\"block-start\"",
17539
+ "description": "Control the position of the tooltip component.\nWhen set to \"none\", the tooltip will be shown above\nbut accommodate for browser boundaries.",
17540
+ "fieldName": "position"
17541
+ },
17542
+ {
17543
+ "name": "role",
17544
+ "type": {
17545
+ "text": "string"
17546
+ },
17547
+ "default": "\"tooltip\"",
17548
+ "description": "The tooltip role, set on the component by default.",
17549
+ "fieldName": "role"
17550
+ },
17551
+ {
17552
+ "name": "id",
17553
+ "type": {
17554
+ "text": "string"
17555
+ },
17556
+ "default": "\"\"",
17557
+ "description": "The id for the active element to reference via aria-describedby.",
17558
+ "fieldName": "id"
17559
+ },
17560
+ {
17561
+ "name": "delay",
17562
+ "type": {
17563
+ "text": "number"
17564
+ },
17565
+ "default": "500",
17566
+ "description": "The delay in milliseconds before the tooltip is opened.",
17567
+ "fieldName": "delay"
17568
+ }
17569
+ ],
17570
+ "superclass": {
17571
+ "name": "LitElement",
17572
+ "package": "lit"
17573
+ },
17574
+ "localization": [],
17575
+ "status": "ready",
17576
+ "category": "overlay",
17577
+ "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",
17578
+ "examples": [],
17579
+ "dependencies": [],
17580
+ "tagName": "nord-tooltip",
17581
+ "customElement": true
17582
+ }
17583
+ ],
17584
+ "exports": [
17585
+ {
17586
+ "kind": "js",
17587
+ "name": "default",
17588
+ "declaration": {
17589
+ "name": "Tooltip",
17590
+ "module": "src/tooltip/Tooltip.ts"
17591
+ }
17592
+ },
17593
+ {
17594
+ "kind": "custom-element-definition",
17595
+ "name": "nord-tooltip",
17596
+ "declaration": {
17597
+ "name": "Tooltip",
17598
+ "module": "src/tooltip/Tooltip.ts"
17599
+ }
17600
+ }
17601
+ ]
17602
+ },
17603
+ {
17604
+ "kind": "javascript-module",
17605
+ "path": "src/toggle/Toggle.ts",
17606
+ "declarations": [
17607
+ {
17608
+ "kind": "class",
17609
+ "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.",
17610
+ "name": "Toggle",
17611
+ "cssProperties": [
17612
+ {
17613
+ "description": "Controls the text color of the label, using our [color tokens](/tokens/#color).",
17614
+ "name": "--n-label-color",
17615
+ "default": "var(--n-color-text)"
17616
+ }
17617
+ ],
17618
+ "slots": [
17619
+ {
17620
+ "description": "Use when a label requires more than plain text.",
17621
+ "name": "label"
17622
+ },
17623
+ {
17624
+ "description": "Optional slot that holds hint text for the input.",
17625
+ "name": "hint"
17626
+ },
17627
+ {
17628
+ "description": "Optional slot that holds error text for the input.",
17629
+ "name": "error"
17630
+ }
17631
+ ],
17632
+ "members": [
17633
+ {
17634
+ "kind": "field",
17635
+ "name": "formValue",
17636
+ "privacy": "protected",
17637
+ "readonly": true,
17638
+ "inheritedFrom": {
17639
+ "name": "FormAssociatedMixin",
17640
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
17641
+ }
17642
+ },
17643
+ {
17644
+ "kind": "field",
17645
+ "name": "checked",
17646
+ "type": {
17647
+ "text": "boolean"
17648
+ },
17649
+ "default": "false",
17650
+ "description": "Controls whether the toggle is checked or not.",
17651
+ "attribute": "checked",
17652
+ "reflects": true
17653
+ },
17654
+ {
17655
+ "kind": "field",
17656
+ "name": "reverse",
17657
+ "type": {
17658
+ "text": "boolean"
17659
+ },
17660
+ "default": "false",
17661
+ "description": "Controls whether the contents are displayed in reverse order,\nputting the label before the toggle.",
17662
+ "attribute": "reverse",
17663
+ "reflects": true
17664
+ },
17665
+ {
17666
+ "kind": "field",
17667
+ "name": "size",
17668
+ "type": {
17669
+ "text": "\"s\" | \"m\" | \"l\""
17670
+ },
17671
+ "default": "\"m\"",
17672
+ "description": "The size of the toggle switch.",
17673
+ "attribute": "size",
17674
+ "reflects": true
17675
+ },
17676
+ {
17677
+ "kind": "method",
17678
+ "name": "handleChange",
17406
17679
  "privacy": "protected",
17407
17680
  "parameters": [
17408
17681
  {
@@ -17648,637 +17921,350 @@
17648
17921
  }
17649
17922
  },
17650
17923
  {
17651
- "kind": "method",
17652
- "name": "getDescribedBy",
17653
- "privacy": "protected",
17654
- "inheritedFrom": {
17655
- "name": "FormAssociatedMixin",
17656
- "module": "src/common/mixins/FormAssociatedMixin.ts"
17657
- }
17658
- },
17659
- {
17660
- "kind": "method",
17661
- "name": "getInvalid",
17662
- "privacy": "protected",
17663
- "inheritedFrom": {
17664
- "name": "FormAssociatedMixin",
17665
- "module": "src/common/mixins/FormAssociatedMixin.ts"
17666
- }
17667
- },
17668
- {
17669
- "kind": "field",
17670
- "name": "hasHint",
17671
- "privacy": "protected",
17672
- "readonly": true,
17673
- "inheritedFrom": {
17674
- "name": "FormAssociatedMixin",
17675
- "module": "src/common/mixins/FormAssociatedMixin.ts"
17676
- }
17677
- },
17678
- {
17679
- "kind": "field",
17680
- "name": "hasError",
17681
- "privacy": "protected",
17682
- "readonly": true,
17683
- "inheritedFrom": {
17684
- "name": "FormAssociatedMixin",
17685
- "module": "src/common/mixins/FormAssociatedMixin.ts"
17686
- }
17687
- },
17688
- {
17689
- "kind": "field",
17690
- "name": "disabled",
17691
- "type": {
17692
- "text": "boolean"
17693
- },
17694
- "default": "false",
17695
- "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
17696
- "attribute": "disabled",
17697
- "reflects": true,
17698
- "inheritedFrom": {
17699
- "name": "InputMixin",
17700
- "module": "src/common/mixins/InputMixin.ts"
17701
- }
17702
- },
17703
- {
17704
- "kind": "field",
17705
- "name": "name",
17706
- "type": {
17707
- "text": "string | undefined"
17708
- },
17709
- "description": "The name of the form component.",
17710
- "attribute": "name",
17711
- "reflects": true,
17712
- "inheritedFrom": {
17713
- "name": "InputMixin",
17714
- "module": "src/common/mixins/InputMixin.ts"
17715
- }
17716
- },
17717
- {
17718
- "kind": "field",
17719
- "name": "value",
17720
- "type": {
17721
- "text": "string"
17722
- },
17723
- "default": "\"\"",
17724
- "description": "The value of the form component.",
17725
- "attribute": "value",
17726
- "inheritedFrom": {
17727
- "name": "InputMixin",
17728
- "module": "src/common/mixins/InputMixin.ts"
17729
- }
17730
- },
17731
- {
17732
- "kind": "field",
17733
- "name": "formAncestor",
17734
- "type": {
17735
- "text": "HTMLFormElement | null"
17736
- },
17737
- "privacy": "private",
17738
- "default": "null",
17739
- "inheritedFrom": {
17740
- "name": "InputMixin",
17741
- "module": "src/common/mixins/InputMixin.ts"
17742
- }
17743
- },
17744
- {
17745
- "kind": "field",
17746
- "name": "_formId",
17747
- "type": {
17748
- "text": "string | undefined"
17749
- },
17750
- "privacy": "protected",
17751
- "inheritedFrom": {
17752
- "name": "InputMixin",
17753
- "module": "src/common/mixins/InputMixin.ts"
17754
- }
17755
- },
17756
- {
17757
- "kind": "field",
17758
- "name": "form",
17759
- "type": {
17760
- "text": "HTMLFormElement | null"
17761
- },
17762
- "description": "Gets the form, if any, associated with the form element.\nThe setter accepts a string, which is the id of the form.",
17763
- "attribute": "form",
17764
- "inheritedFrom": {
17765
- "name": "InputMixin",
17766
- "module": "src/common/mixins/InputMixin.ts"
17767
- }
17768
- },
17769
- {
17770
- "kind": "field",
17771
- "name": "focusableRef",
17772
- "privacy": "protected",
17773
- "inheritedFrom": {
17774
- "name": "FocusableMixin",
17775
- "module": "src/common/mixins/FocusableMixin.ts"
17776
- }
17777
- },
17778
- {
17779
- "kind": "method",
17780
- "name": "focus",
17781
- "parameters": [
17782
- {
17783
- "name": "options",
17784
- "optional": true,
17785
- "type": {
17786
- "text": "FocusOptions"
17787
- },
17788
- "description": "An object which controls aspects of the focusing process."
17789
- }
17790
- ],
17791
- "description": "Programmatically move focus to the component.",
17792
- "inheritedFrom": {
17793
- "name": "FocusableMixin",
17794
- "module": "src/common/mixins/FocusableMixin.ts"
17795
- }
17796
- },
17797
- {
17798
- "kind": "method",
17799
- "name": "blur",
17800
- "description": "Programmatically remove focus from the component.",
17801
- "inheritedFrom": {
17802
- "name": "FocusableMixin",
17803
- "module": "src/common/mixins/FocusableMixin.ts"
17804
- }
17805
- },
17806
- {
17807
- "kind": "method",
17808
- "name": "click",
17809
- "description": "Programmatically simulates a click on the component.",
17810
- "inheritedFrom": {
17811
- "name": "FocusableMixin",
17812
- "module": "src/common/mixins/FocusableMixin.ts"
17813
- }
17814
- }
17815
- ],
17816
- "attributes": [
17817
- {
17818
- "name": "checked",
17819
- "type": {
17820
- "text": "boolean"
17821
- },
17822
- "default": "false",
17823
- "description": "Controls whether the toggle is checked or not.",
17824
- "fieldName": "checked"
17825
- },
17826
- {
17827
- "name": "reverse",
17828
- "type": {
17829
- "text": "boolean"
17830
- },
17831
- "default": "false",
17832
- "description": "Controls whether the contents are displayed in reverse order,\nputting the label before the toggle.",
17833
- "fieldName": "reverse"
17834
- },
17835
- {
17836
- "name": "size",
17837
- "type": {
17838
- "text": "\"s\" | \"m\" | \"l\""
17839
- },
17840
- "default": "\"m\"",
17841
- "description": "The size of the toggle switch.",
17842
- "fieldName": "size"
17843
- },
17844
- {
17845
- "name": "label",
17846
- "type": {
17847
- "text": "string"
17848
- },
17849
- "default": "\"\"",
17850
- "description": "Label for the input.",
17851
- "fieldName": "label",
17852
- "inheritedFrom": {
17853
- "name": "FormAssociatedMixin",
17854
- "module": "src/common/mixins/FormAssociatedMixin.ts"
17855
- }
17856
- },
17857
- {
17858
- "name": "hint",
17859
- "type": {
17860
- "text": "string | undefined"
17861
- },
17862
- "description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
17863
- "fieldName": "hint",
17864
- "inheritedFrom": {
17865
- "name": "FormAssociatedMixin",
17866
- "module": "src/common/mixins/FormAssociatedMixin.ts"
17867
- }
17868
- },
17869
- {
17870
- "name": "hide-label",
17871
- "type": {
17872
- "text": "boolean"
17873
- },
17874
- "default": "false",
17875
- "description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
17876
- "fieldName": "hideLabel",
17877
- "inheritedFrom": {
17878
- "name": "FormAssociatedMixin",
17879
- "module": "src/common/mixins/FormAssociatedMixin.ts"
17880
- }
17881
- },
17882
- {
17883
- "name": "placeholder",
17884
- "type": {
17885
- "text": "string | undefined"
17886
- },
17887
- "description": "Placeholder text to display within the input.",
17888
- "fieldName": "placeholder",
17924
+ "kind": "method",
17925
+ "name": "getDescribedBy",
17926
+ "privacy": "protected",
17889
17927
  "inheritedFrom": {
17890
17928
  "name": "FormAssociatedMixin",
17891
17929
  "module": "src/common/mixins/FormAssociatedMixin.ts"
17892
17930
  }
17893
17931
  },
17894
17932
  {
17895
- "name": "error",
17896
- "type": {
17897
- "text": "string | undefined"
17898
- },
17899
- "description": "Optional error to be shown with the input. Alternatively use the error slot.",
17900
- "fieldName": "error",
17933
+ "kind": "method",
17934
+ "name": "getInvalid",
17935
+ "privacy": "protected",
17901
17936
  "inheritedFrom": {
17902
17937
  "name": "FormAssociatedMixin",
17903
17938
  "module": "src/common/mixins/FormAssociatedMixin.ts"
17904
17939
  }
17905
17940
  },
17906
17941
  {
17907
- "name": "required",
17908
- "type": {
17909
- "text": "boolean"
17910
- },
17911
- "default": "false",
17912
- "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.",
17913
- "fieldName": "required",
17942
+ "kind": "field",
17943
+ "name": "hasHint",
17944
+ "privacy": "protected",
17945
+ "readonly": true,
17914
17946
  "inheritedFrom": {
17915
17947
  "name": "FormAssociatedMixin",
17916
17948
  "module": "src/common/mixins/FormAssociatedMixin.ts"
17917
17949
  }
17918
17950
  },
17919
17951
  {
17920
- "name": "hide-required",
17921
- "type": {
17922
- "text": "boolean"
17923
- },
17924
- "default": "false",
17925
- "description": "Visually hide the required indicator, but still show\nrequired attribute to assistive technologies like screen readers.",
17926
- "fieldName": "hideRequired",
17952
+ "kind": "field",
17953
+ "name": "hasError",
17954
+ "privacy": "protected",
17955
+ "readonly": true,
17927
17956
  "inheritedFrom": {
17928
17957
  "name": "FormAssociatedMixin",
17929
17958
  "module": "src/common/mixins/FormAssociatedMixin.ts"
17930
17959
  }
17931
17960
  },
17932
17961
  {
17962
+ "kind": "field",
17933
17963
  "name": "disabled",
17934
17964
  "type": {
17935
17965
  "text": "boolean"
17936
17966
  },
17937
17967
  "default": "false",
17938
17968
  "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
17939
- "fieldName": "disabled",
17969
+ "attribute": "disabled",
17970
+ "reflects": true,
17940
17971
  "inheritedFrom": {
17941
17972
  "name": "InputMixin",
17942
17973
  "module": "src/common/mixins/InputMixin.ts"
17943
17974
  }
17944
17975
  },
17945
17976
  {
17977
+ "kind": "field",
17946
17978
  "name": "name",
17947
17979
  "type": {
17948
17980
  "text": "string | undefined"
17949
17981
  },
17950
17982
  "description": "The name of the form component.",
17951
- "fieldName": "name",
17983
+ "attribute": "name",
17984
+ "reflects": true,
17952
17985
  "inheritedFrom": {
17953
17986
  "name": "InputMixin",
17954
17987
  "module": "src/common/mixins/InputMixin.ts"
17955
17988
  }
17956
17989
  },
17957
17990
  {
17991
+ "kind": "field",
17958
17992
  "name": "value",
17959
17993
  "type": {
17960
17994
  "text": "string"
17961
17995
  },
17962
17996
  "default": "\"\"",
17963
17997
  "description": "The value of the form component.",
17964
- "fieldName": "value",
17998
+ "attribute": "value",
17965
17999
  "inheritedFrom": {
17966
18000
  "name": "InputMixin",
17967
18001
  "module": "src/common/mixins/InputMixin.ts"
17968
18002
  }
17969
18003
  },
17970
18004
  {
17971
- "name": "form",
18005
+ "kind": "field",
18006
+ "name": "formAncestor",
17972
18007
  "type": {
17973
18008
  "text": "HTMLFormElement | null"
17974
18009
  },
17975
- "description": "Gets the form, if any, associated with the form element.\nThe setter accepts a string, which is the id of the form.",
17976
- "fieldName": "form",
18010
+ "privacy": "private",
18011
+ "default": "null",
17977
18012
  "inheritedFrom": {
17978
18013
  "name": "InputMixin",
17979
18014
  "module": "src/common/mixins/InputMixin.ts"
17980
18015
  }
17981
- }
17982
- ],
17983
- "mixins": [
17984
- {
17985
- "name": "FormAssociatedMixin",
17986
- "module": "/src/common/mixins/FormAssociatedMixin.js"
17987
- },
17988
- {
17989
- "name": "InputMixin",
17990
- "module": "/src/common/mixins/InputMixin.js"
17991
18016
  },
17992
18017
  {
17993
- "name": "FocusableMixin",
17994
- "module": "/src/common/mixins/FocusableMixin.js"
17995
- }
17996
- ],
17997
- "superclass": {
17998
- "name": "LitElement",
17999
- "package": "lit"
18000
- },
18001
- "localization": [],
18002
- "status": "ready",
18003
- "category": "form",
18004
- "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",
18005
- "examples": [],
18006
- "dependencies": [],
18007
- "tagName": "nord-toggle",
18008
- "customElement": true,
18009
- "events": [
18010
- {
18011
- "name": "input",
18018
+ "kind": "field",
18019
+ "name": "_formId",
18012
18020
  "type": {
18013
- "text": "NordEvent"
18021
+ "text": "string | undefined"
18014
18022
  },
18015
- "description": "Fired as the user types into the input.",
18023
+ "privacy": "protected",
18016
18024
  "inheritedFrom": {
18017
- "name": "FormAssociatedMixin",
18018
- "module": "src/common/mixins/FormAssociatedMixin.ts"
18025
+ "name": "InputMixin",
18026
+ "module": "src/common/mixins/InputMixin.ts"
18019
18027
  }
18020
18028
  },
18021
18029
  {
18022
- "name": "change",
18030
+ "kind": "field",
18031
+ "name": "form",
18023
18032
  "type": {
18024
- "text": "NordEvent"
18033
+ "text": "HTMLFormElement | null"
18025
18034
  },
18026
- "description": "Fired whenever the input's value is changed via user interaction.",
18035
+ "description": "Gets the form, if any, associated with the form element.\nThe setter accepts a string, which is the id of the form.",
18036
+ "attribute": "form",
18027
18037
  "inheritedFrom": {
18028
- "name": "FormAssociatedMixin",
18029
- "module": "src/common/mixins/FormAssociatedMixin.ts"
18038
+ "name": "InputMixin",
18039
+ "module": "src/common/mixins/InputMixin.ts"
18030
18040
  }
18031
- }
18032
- ]
18033
- }
18034
- ],
18035
- "exports": [
18036
- {
18037
- "kind": "js",
18038
- "name": "default",
18039
- "declaration": {
18040
- "name": "Toggle",
18041
- "module": "src/toggle/Toggle.ts"
18042
- }
18043
- },
18044
- {
18045
- "kind": "custom-element-definition",
18046
- "name": "nord-toggle",
18047
- "declaration": {
18048
- "name": "Toggle",
18049
- "module": "src/toggle/Toggle.ts"
18050
- }
18051
- }
18052
- ]
18053
- },
18054
- {
18055
- "kind": "javascript-module",
18056
- "path": "src/tooltip/Tooltip.ts",
18057
- "declarations": [
18058
- {
18059
- "kind": "class",
18060
- "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.",
18061
- "name": "Tooltip",
18062
- "cssProperties": [
18063
- {
18064
- "description": "Controls the maximum inline size, or width, of the tooltip.",
18065
- "name": "--n-tooltip-max-size",
18066
- "default": "50ch"
18067
- }
18068
- ],
18069
- "slots": [
18070
- {
18071
- "description": "The tooltip content",
18072
- "name": ""
18073
- },
18074
- {
18075
- "description": "Optional slot that holds shortcut keys to access the subject",
18076
- "name": "shortcut"
18077
- }
18078
- ],
18079
- "members": [
18080
- {
18081
- "kind": "field",
18082
- "name": "lastOpened",
18083
- "type": {
18084
- "text": "Tooltip | undefined"
18085
- },
18086
- "privacy": "private",
18087
- "static": true
18088
18041
  },
18089
18042
  {
18090
18043
  "kind": "field",
18091
- "name": "shortcutSlot",
18092
- "privacy": "private",
18093
- "default": "new SlotController(this, \"shortcut\")"
18094
- },
18095
- {
18096
- "kind": "field",
18097
- "name": "events",
18098
- "privacy": "private",
18099
- "default": "new EventController(this)"
18100
- },
18101
- {
18102
- "kind": "field",
18103
- "name": "currentElement",
18104
- "type": {
18105
- "text": "FocusableElement | undefined"
18106
- },
18107
- "privacy": "private"
18044
+ "name": "focusableRef",
18045
+ "privacy": "protected",
18046
+ "inheritedFrom": {
18047
+ "name": "FocusableMixin",
18048
+ "module": "src/common/mixins/FocusableMixin.ts"
18049
+ }
18108
18050
  },
18109
18051
  {
18110
- "kind": "field",
18111
- "name": "timeoutId",
18112
- "type": {
18113
- "text": "ReturnType<typeof setTimeout> | undefined"
18114
- },
18115
- "privacy": "private"
18052
+ "kind": "method",
18053
+ "name": "focus",
18054
+ "parameters": [
18055
+ {
18056
+ "name": "options",
18057
+ "optional": true,
18058
+ "type": {
18059
+ "text": "FocusOptions"
18060
+ },
18061
+ "description": "An object which controls aspects of the focusing process."
18062
+ }
18063
+ ],
18064
+ "description": "Programmatically move focus to the component.",
18065
+ "inheritedFrom": {
18066
+ "name": "FocusableMixin",
18067
+ "module": "src/common/mixins/FocusableMixin.ts"
18068
+ }
18116
18069
  },
18117
18070
  {
18118
- "kind": "field",
18119
- "name": "proxy",
18120
- "privacy": "private",
18121
- "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."
18071
+ "kind": "method",
18072
+ "name": "blur",
18073
+ "description": "Programmatically remove focus from the component.",
18074
+ "inheritedFrom": {
18075
+ "name": "FocusableMixin",
18076
+ "module": "src/common/mixins/FocusableMixin.ts"
18077
+ }
18122
18078
  },
18123
18079
  {
18124
- "kind": "field",
18125
- "name": "state",
18126
- "type": {
18127
- "text": "TooltipStates"
18128
- },
18129
- "privacy": "private",
18130
- "default": "\"hidden\"",
18131
- "description": "The current state of the tooltip, dependent on the state machine"
18132
- },
18080
+ "kind": "method",
18081
+ "name": "click",
18082
+ "description": "Programmatically simulates a click on the component.",
18083
+ "inheritedFrom": {
18084
+ "name": "FocusableMixin",
18085
+ "module": "src/common/mixins/FocusableMixin.ts"
18086
+ }
18087
+ }
18088
+ ],
18089
+ "attributes": [
18133
18090
  {
18134
- "kind": "field",
18135
- "name": "coords",
18091
+ "name": "checked",
18136
18092
  "type": {
18137
- "text": "[number, number]"
18093
+ "text": "boolean"
18138
18094
  },
18139
- "privacy": "private",
18140
- "default": "[0, 0]"
18095
+ "default": "false",
18096
+ "description": "Controls whether the toggle is checked or not.",
18097
+ "fieldName": "checked"
18141
18098
  },
18142
18099
  {
18143
- "kind": "field",
18144
- "name": "position",
18100
+ "name": "reverse",
18145
18101
  "type": {
18146
- "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\""
18147
- },
18148
- "default": "\"block-start\"",
18149
- "description": "Control the position of the tooltip component.\nWhen set to \"none\", the tooltip will be shown above\nbut accommodate for browser boundaries.",
18150
- "attribute": "position",
18151
- "reflects": true
18102
+ "text": "boolean"
18103
+ },
18104
+ "default": "false",
18105
+ "description": "Controls whether the contents are displayed in reverse order,\nputting the label before the toggle.",
18106
+ "fieldName": "reverse"
18152
18107
  },
18153
18108
  {
18154
- "kind": "field",
18155
- "name": "role",
18109
+ "name": "size",
18156
18110
  "type": {
18157
- "text": "string"
18111
+ "text": "\"s\" | \"m\" | \"l\""
18158
18112
  },
18159
- "default": "\"tooltip\"",
18160
- "description": "The tooltip role, set on the component by default.",
18161
- "attribute": "role",
18162
- "reflects": true
18113
+ "default": "\"m\"",
18114
+ "description": "The size of the toggle switch.",
18115
+ "fieldName": "size"
18163
18116
  },
18164
18117
  {
18165
- "kind": "field",
18166
- "name": "id",
18118
+ "name": "label",
18167
18119
  "type": {
18168
18120
  "text": "string"
18169
18121
  },
18170
18122
  "default": "\"\"",
18171
- "description": "The id for the active element to reference via aria-describedby.",
18172
- "attribute": "id",
18173
- "reflects": true
18123
+ "description": "Label for the input.",
18124
+ "fieldName": "label",
18125
+ "inheritedFrom": {
18126
+ "name": "FormAssociatedMixin",
18127
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
18128
+ }
18174
18129
  },
18175
18130
  {
18176
- "kind": "field",
18177
- "name": "delay",
18131
+ "name": "hint",
18178
18132
  "type": {
18179
- "text": "number"
18133
+ "text": "string | undefined"
18180
18134
  },
18181
- "default": "500",
18182
- "description": "The delay in milliseconds before the tooltip is opened.",
18183
- "attribute": "delay",
18184
- "reflects": true
18185
- },
18186
- {
18187
- "kind": "method",
18188
- "name": "handleIdChange",
18189
- "privacy": "protected"
18190
- },
18191
- {
18192
- "kind": "method",
18193
- "name": "handleStateChange",
18194
- "privacy": "private",
18195
- "parameters": [
18196
- {
18197
- "name": "prevState",
18198
- "type": {
18199
- "text": "TooltipStates"
18200
- }
18201
- }
18202
- ]
18203
- },
18204
- {
18205
- "kind": "field",
18206
- "name": "updatePosition",
18207
- "privacy": "private",
18208
- "description": "Setting and updating the position of the tooltip"
18209
- },
18210
- {
18211
- "kind": "field",
18212
- "name": "hideTooltip",
18213
- "privacy": "private"
18135
+ "description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
18136
+ "fieldName": "hint",
18137
+ "inheritedFrom": {
18138
+ "name": "FormAssociatedMixin",
18139
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
18140
+ }
18214
18141
  },
18215
18142
  {
18216
- "kind": "field",
18217
- "name": "reposition",
18218
- "privacy": "private"
18143
+ "name": "hide-label",
18144
+ "type": {
18145
+ "text": "boolean"
18146
+ },
18147
+ "default": "false",
18148
+ "description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
18149
+ "fieldName": "hideLabel",
18150
+ "inheritedFrom": {
18151
+ "name": "FormAssociatedMixin",
18152
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
18153
+ }
18219
18154
  },
18220
18155
  {
18221
- "kind": "field",
18222
- "name": "handleShow",
18223
- "privacy": "private"
18156
+ "name": "placeholder",
18157
+ "type": {
18158
+ "text": "string | undefined"
18159
+ },
18160
+ "description": "Placeholder text to display within the input.",
18161
+ "fieldName": "placeholder",
18162
+ "inheritedFrom": {
18163
+ "name": "FormAssociatedMixin",
18164
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
18165
+ }
18224
18166
  },
18225
18167
  {
18226
- "kind": "field",
18227
- "name": "handleHide",
18228
- "privacy": "private"
18168
+ "name": "error",
18169
+ "type": {
18170
+ "text": "string | undefined"
18171
+ },
18172
+ "description": "Optional error to be shown with the input. Alternatively use the error slot.",
18173
+ "fieldName": "error",
18174
+ "inheritedFrom": {
18175
+ "name": "FormAssociatedMixin",
18176
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
18177
+ }
18229
18178
  },
18230
18179
  {
18231
- "kind": "field",
18232
- "name": "hideOnEscape",
18233
- "privacy": "private"
18180
+ "name": "required",
18181
+ "type": {
18182
+ "text": "boolean"
18183
+ },
18184
+ "default": "false",
18185
+ "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.",
18186
+ "fieldName": "required",
18187
+ "inheritedFrom": {
18188
+ "name": "FormAssociatedMixin",
18189
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
18190
+ }
18234
18191
  },
18235
18192
  {
18236
- "kind": "field",
18237
- "name": "addDescribedBy",
18238
- "privacy": "private"
18193
+ "name": "hide-required",
18194
+ "type": {
18195
+ "text": "boolean"
18196
+ },
18197
+ "default": "false",
18198
+ "description": "Visually hide the required indicator, but still show\nrequired attribute to assistive technologies like screen readers.",
18199
+ "fieldName": "hideRequired",
18200
+ "inheritedFrom": {
18201
+ "name": "FormAssociatedMixin",
18202
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
18203
+ }
18239
18204
  },
18240
18205
  {
18241
- "kind": "field",
18242
- "name": "removeDescribedBy",
18243
- "privacy": "private"
18244
- }
18245
- ],
18246
- "attributes": [
18247
- {
18248
- "name": "position",
18206
+ "name": "disabled",
18249
18207
  "type": {
18250
- "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\""
18208
+ "text": "boolean"
18251
18209
  },
18252
- "default": "\"block-start\"",
18253
- "description": "Control the position of the tooltip component.\nWhen set to \"none\", the tooltip will be shown above\nbut accommodate for browser boundaries.",
18254
- "fieldName": "position"
18210
+ "default": "false",
18211
+ "description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
18212
+ "fieldName": "disabled",
18213
+ "inheritedFrom": {
18214
+ "name": "InputMixin",
18215
+ "module": "src/common/mixins/InputMixin.ts"
18216
+ }
18255
18217
  },
18256
18218
  {
18257
- "name": "role",
18219
+ "name": "name",
18258
18220
  "type": {
18259
- "text": "string"
18221
+ "text": "string | undefined"
18260
18222
  },
18261
- "default": "\"tooltip\"",
18262
- "description": "The tooltip role, set on the component by default.",
18263
- "fieldName": "role"
18223
+ "description": "The name of the form component.",
18224
+ "fieldName": "name",
18225
+ "inheritedFrom": {
18226
+ "name": "InputMixin",
18227
+ "module": "src/common/mixins/InputMixin.ts"
18228
+ }
18264
18229
  },
18265
18230
  {
18266
- "name": "id",
18231
+ "name": "value",
18267
18232
  "type": {
18268
18233
  "text": "string"
18269
18234
  },
18270
18235
  "default": "\"\"",
18271
- "description": "The id for the active element to reference via aria-describedby.",
18272
- "fieldName": "id"
18236
+ "description": "The value of the form component.",
18237
+ "fieldName": "value",
18238
+ "inheritedFrom": {
18239
+ "name": "InputMixin",
18240
+ "module": "src/common/mixins/InputMixin.ts"
18241
+ }
18273
18242
  },
18274
18243
  {
18275
- "name": "delay",
18244
+ "name": "form",
18276
18245
  "type": {
18277
- "text": "number"
18246
+ "text": "HTMLFormElement | null"
18278
18247
  },
18279
- "default": "500",
18280
- "description": "The delay in milliseconds before the tooltip is opened.",
18281
- "fieldName": "delay"
18248
+ "description": "Gets the form, if any, associated with the form element.\nThe setter accepts a string, which is the id of the form.",
18249
+ "fieldName": "form",
18250
+ "inheritedFrom": {
18251
+ "name": "InputMixin",
18252
+ "module": "src/common/mixins/InputMixin.ts"
18253
+ }
18254
+ }
18255
+ ],
18256
+ "mixins": [
18257
+ {
18258
+ "name": "FormAssociatedMixin",
18259
+ "module": "/src/common/mixins/FormAssociatedMixin.js"
18260
+ },
18261
+ {
18262
+ "name": "InputMixin",
18263
+ "module": "/src/common/mixins/InputMixin.js"
18264
+ },
18265
+ {
18266
+ "name": "FocusableMixin",
18267
+ "module": "/src/common/mixins/FocusableMixin.js"
18282
18268
  }
18283
18269
  ],
18284
18270
  "superclass": {
@@ -18287,12 +18273,36 @@
18287
18273
  },
18288
18274
  "localization": [],
18289
18275
  "status": "ready",
18290
- "category": "overlay",
18291
- "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",
18276
+ "category": "form",
18277
+ "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",
18292
18278
  "examples": [],
18293
18279
  "dependencies": [],
18294
- "tagName": "nord-tooltip",
18295
- "customElement": true
18280
+ "tagName": "nord-toggle",
18281
+ "customElement": true,
18282
+ "events": [
18283
+ {
18284
+ "name": "input",
18285
+ "type": {
18286
+ "text": "NordEvent"
18287
+ },
18288
+ "description": "Fired as the user types into the input.",
18289
+ "inheritedFrom": {
18290
+ "name": "FormAssociatedMixin",
18291
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
18292
+ }
18293
+ },
18294
+ {
18295
+ "name": "change",
18296
+ "type": {
18297
+ "text": "NordEvent"
18298
+ },
18299
+ "description": "Fired whenever the input's value is changed via user interaction.",
18300
+ "inheritedFrom": {
18301
+ "name": "FormAssociatedMixin",
18302
+ "module": "src/common/mixins/FormAssociatedMixin.ts"
18303
+ }
18304
+ }
18305
+ ]
18296
18306
  }
18297
18307
  ],
18298
18308
  "exports": [
@@ -18300,16 +18310,16 @@
18300
18310
  "kind": "js",
18301
18311
  "name": "default",
18302
18312
  "declaration": {
18303
- "name": "Tooltip",
18304
- "module": "src/tooltip/Tooltip.ts"
18313
+ "name": "Toggle",
18314
+ "module": "src/toggle/Toggle.ts"
18305
18315
  }
18306
18316
  },
18307
18317
  {
18308
18318
  "kind": "custom-element-definition",
18309
- "name": "nord-tooltip",
18319
+ "name": "nord-toggle",
18310
18320
  "declaration": {
18311
- "name": "Tooltip",
18312
- "module": "src/tooltip/Tooltip.ts"
18321
+ "name": "Toggle",
18322
+ "module": "src/toggle/Toggle.ts"
18313
18323
  }
18314
18324
  }
18315
18325
  ]
@@ -20287,7 +20297,7 @@
20287
20297
  "kind": "field",
20288
20298
  "name": "position",
20289
20299
  "type": {
20290
- "text": "LogicalSide"
20300
+ "text": "LogicalSide | \"auto\""
20291
20301
  }
20292
20302
  }
20293
20303
  ]
@@ -20323,10 +20333,10 @@
20323
20333
  "kind": "field",
20324
20334
  "name": "position",
20325
20335
  "type": {
20326
- "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\""
20336
+ "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\" | \"auto\""
20327
20337
  },
20328
20338
  "default": "\"block-end\"",
20329
- "description": "Set the position in relation to the toggle (or anchor).\nOptions follow logical properties.\n`block-start` and `block-end` referring to top and bottom respectively,\n`inline-start` and `inline-end` referring to left and right respectively.",
20339
+ "description": "Set the position in relation to the toggle (or anchor).\nOptions follow logical properties.\n`block-start` and `block-end` referring to top and bottom respectively,\n`inline-start` and `inline-end` referring to left and right respectively.\nYou can also set it to `auto` for automatic positioning depending on\nwhich side has the most space available.",
20330
20340
  "attribute": "position",
20331
20341
  "reflects": true
20332
20342
  }
@@ -20353,10 +20363,10 @@
20353
20363
  {
20354
20364
  "name": "position",
20355
20365
  "type": {
20356
- "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\""
20366
+ "text": "\"block-end\" | \"block-start\" | \"inline-start\" | \"inline-end\" | \"auto\""
20357
20367
  },
20358
20368
  "default": "\"block-end\"",
20359
- "description": "Set the position in relation to the toggle (or anchor).\nOptions follow logical properties.\n`block-start` and `block-end` referring to top and bottom respectively,\n`inline-start` and `inline-end` referring to left and right respectively.",
20369
+ "description": "Set the position in relation to the toggle (or anchor).\nOptions follow logical properties.\n`block-start` and `block-end` referring to top and bottom respectively,\n`inline-start` and `inline-end` referring to left and right respectively.\nYou can also set it to `auto` for automatic positioning depending on\nwhich side has the most space available.",
20360
20370
  "fieldName": "position"
20361
20371
  }
20362
20372
  ],