@nordhealth/components 1.0.0-beta.1 → 1.0.0-beta.2
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.
- package/custom-elements.json +1036 -962
- package/lib/EmptyState.js +2 -0
- package/lib/EmptyState.js.map +1 -0
- package/lib/bundle.js +5 -5
- package/lib/bundle.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/src/empty-state/EmptyState.d.ts +21 -0
- package/lib/src/empty-state/EmptyState.test.d.ts +3 -0
- package/lib/src/index.d.ts +1 -0
- package/package.json +2 -2
package/custom-elements.json
CHANGED
|
@@ -198,6 +198,14 @@
|
|
|
198
198
|
"name": "default",
|
|
199
199
|
"module": "\"./layout/Layout.js\""
|
|
200
200
|
}
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"kind": "js",
|
|
204
|
+
"name": "EmptyState",
|
|
205
|
+
"declaration": {
|
|
206
|
+
"name": "default",
|
|
207
|
+
"module": "\"./empty-state/EmptyState.js\""
|
|
208
|
+
}
|
|
201
209
|
}
|
|
202
210
|
]
|
|
203
211
|
},
|
|
@@ -1175,445 +1183,577 @@
|
|
|
1175
1183
|
},
|
|
1176
1184
|
{
|
|
1177
1185
|
"kind": "javascript-module",
|
|
1178
|
-
"path": "src/
|
|
1186
|
+
"path": "src/checkbox/Checkbox.ts",
|
|
1179
1187
|
"declarations": [
|
|
1180
1188
|
{
|
|
1181
1189
|
"kind": "class",
|
|
1182
|
-
"description": "
|
|
1183
|
-
"name": "
|
|
1190
|
+
"description": "Checkboxes allow user to choose one or more options from a limited set of options.\nIf you have more than 10 options, please use Select component instead.",
|
|
1191
|
+
"name": "Checkbox",
|
|
1184
1192
|
"slots": [
|
|
1185
1193
|
{
|
|
1186
|
-
"description": "
|
|
1187
|
-
"name": ""
|
|
1194
|
+
"description": "Use when a label requires more than plain text.",
|
|
1195
|
+
"name": "label"
|
|
1188
1196
|
},
|
|
1189
1197
|
{
|
|
1190
|
-
"description": "Optional slot that holds
|
|
1191
|
-
"name": "
|
|
1198
|
+
"description": "Optional slot that holds hint text for the input.",
|
|
1199
|
+
"name": "hint"
|
|
1192
1200
|
},
|
|
1193
1201
|
{
|
|
1194
|
-
"description": "Optional slot that holds
|
|
1195
|
-
"name": "
|
|
1202
|
+
"description": "Optional slot that holds error text for the input.",
|
|
1203
|
+
"name": "error"
|
|
1196
1204
|
}
|
|
1197
1205
|
],
|
|
1198
1206
|
"members": [
|
|
1199
1207
|
{
|
|
1200
1208
|
"kind": "field",
|
|
1201
|
-
"name": "
|
|
1202
|
-
"privacy": "
|
|
1203
|
-
"
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
"name": "footerSlot",
|
|
1208
|
-
"privacy": "private",
|
|
1209
|
-
"default": "new SlotController(this, \"footer\")"
|
|
1209
|
+
"name": "formValue",
|
|
1210
|
+
"privacy": "protected",
|
|
1211
|
+
"inheritedFrom": {
|
|
1212
|
+
"name": "FormAssociatedMixin",
|
|
1213
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1214
|
+
}
|
|
1210
1215
|
},
|
|
1211
1216
|
{
|
|
1212
1217
|
"kind": "field",
|
|
1213
|
-
"name": "
|
|
1218
|
+
"name": "checked",
|
|
1214
1219
|
"type": {
|
|
1215
|
-
"text": "
|
|
1220
|
+
"text": "boolean"
|
|
1216
1221
|
},
|
|
1217
|
-
"default": "
|
|
1218
|
-
"description": "Controls the
|
|
1219
|
-
"attribute": "
|
|
1220
|
-
"reflects": true
|
|
1222
|
+
"default": "false",
|
|
1223
|
+
"description": "Controls whether the checkbox is checked or not.",
|
|
1224
|
+
"attribute": "checked"
|
|
1221
1225
|
},
|
|
1222
1226
|
{
|
|
1223
|
-
"kind": "
|
|
1224
|
-
"name": "
|
|
1225
|
-
"
|
|
1226
|
-
|
|
1227
|
+
"kind": "method",
|
|
1228
|
+
"name": "handleChange",
|
|
1229
|
+
"privacy": "protected",
|
|
1230
|
+
"return": {
|
|
1231
|
+
"type": {
|
|
1232
|
+
"text": "void"
|
|
1233
|
+
}
|
|
1227
1234
|
},
|
|
1228
|
-
"
|
|
1229
|
-
|
|
1230
|
-
|
|
1235
|
+
"parameters": [
|
|
1236
|
+
{
|
|
1237
|
+
"name": "e",
|
|
1238
|
+
"type": {
|
|
1239
|
+
"text": "Event"
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
],
|
|
1231
1243
|
"inheritedFrom": {
|
|
1232
|
-
"name": "
|
|
1233
|
-
"module": "src/common/mixins/
|
|
1244
|
+
"name": "FormAssociatedMixin",
|
|
1245
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1234
1246
|
}
|
|
1235
|
-
}
|
|
1236
|
-
],
|
|
1237
|
-
"attributes": [
|
|
1238
|
-
{
|
|
1239
|
-
"name": "padding",
|
|
1240
|
-
"type": {
|
|
1241
|
-
"text": "\"m\" | \"l\" | \"none\""
|
|
1242
|
-
},
|
|
1243
|
-
"default": "\"m\"",
|
|
1244
|
-
"description": "Controls the padding of card component. When set to “none”,\nthe header and footer slots will still have padding.",
|
|
1245
|
-
"fieldName": "padding"
|
|
1246
|
-
}
|
|
1247
|
-
],
|
|
1248
|
-
"mixins": [
|
|
1249
|
-
{
|
|
1250
|
-
"name": "DraftComponentMixin",
|
|
1251
|
-
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
1252
|
-
}
|
|
1253
|
-
],
|
|
1254
|
-
"superclass": {
|
|
1255
|
-
"name": "LitElement",
|
|
1256
|
-
"package": "lit"
|
|
1257
|
-
},
|
|
1258
|
-
"status": "draft",
|
|
1259
|
-
"category": "structure",
|
|
1260
|
-
"tagName": "nord-card",
|
|
1261
|
-
"customElement": true
|
|
1262
|
-
}
|
|
1263
|
-
],
|
|
1264
|
-
"exports": [
|
|
1265
|
-
{
|
|
1266
|
-
"kind": "js",
|
|
1267
|
-
"name": "default",
|
|
1268
|
-
"declaration": {
|
|
1269
|
-
"name": "Card",
|
|
1270
|
-
"module": "src/card/Card.ts"
|
|
1271
|
-
}
|
|
1272
|
-
},
|
|
1273
|
-
{
|
|
1274
|
-
"kind": "custom-element-definition",
|
|
1275
|
-
"name": "nord-card",
|
|
1276
|
-
"declaration": {
|
|
1277
|
-
"name": "Card",
|
|
1278
|
-
"module": "src/card/Card.ts"
|
|
1279
|
-
}
|
|
1280
|
-
}
|
|
1281
|
-
],
|
|
1282
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to display content and actions on a single topic inside a container.\n- Use to visually separate specific parts of content in an application view.\n- Use to wrap a form into a container, for example a login form.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use when you need to capture user’s attention in a prominent way.\n- Don’t use to inform user about important changes or conditions in the interface.\n- Don’t use multiple primary buttons inside a card. A card should only contain a single primary action.\n\n</div>\n"
|
|
1283
|
-
},
|
|
1284
|
-
{
|
|
1285
|
-
"kind": "javascript-module",
|
|
1286
|
-
"path": "src/command-menu/CommandMenu.ts",
|
|
1287
|
-
"declarations": [
|
|
1288
|
-
{
|
|
1289
|
-
"kind": "class",
|
|
1290
|
-
"description": "Command Menu allows users to navigate and use an app without\ntouching the mouse and helps them transform into “power users”\nwho can harness more advanced features far faster.",
|
|
1291
|
-
"name": "CommandMenu",
|
|
1292
|
-
"slots": [
|
|
1293
|
-
{
|
|
1294
|
-
"description": "Used to replace the default footer contents.",
|
|
1295
|
-
"name": "footer"
|
|
1296
|
-
}
|
|
1297
|
-
],
|
|
1298
|
-
"members": [
|
|
1299
|
-
{
|
|
1300
|
-
"kind": "field",
|
|
1301
|
-
"name": "inputRef",
|
|
1302
|
-
"privacy": "private"
|
|
1303
1247
|
},
|
|
1304
1248
|
{
|
|
1305
1249
|
"kind": "field",
|
|
1306
|
-
"name": "
|
|
1307
|
-
"privacy": "
|
|
1250
|
+
"name": "labelSlot",
|
|
1251
|
+
"privacy": "protected",
|
|
1252
|
+
"default": "new SlotController(this, \"label\")",
|
|
1253
|
+
"inheritedFrom": {
|
|
1254
|
+
"name": "FormAssociatedMixin",
|
|
1255
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1256
|
+
}
|
|
1308
1257
|
},
|
|
1309
1258
|
{
|
|
1310
1259
|
"kind": "field",
|
|
1311
|
-
"name": "
|
|
1312
|
-
"
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1260
|
+
"name": "errorSlot",
|
|
1261
|
+
"privacy": "protected",
|
|
1262
|
+
"default": "new SlotController(this, \"error\")",
|
|
1263
|
+
"inheritedFrom": {
|
|
1264
|
+
"name": "FormAssociatedMixin",
|
|
1265
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1266
|
+
}
|
|
1316
1267
|
},
|
|
1317
1268
|
{
|
|
1318
1269
|
"kind": "field",
|
|
1319
|
-
"name": "
|
|
1320
|
-
"privacy": "
|
|
1321
|
-
"default": "new
|
|
1270
|
+
"name": "hintSlot",
|
|
1271
|
+
"privacy": "protected",
|
|
1272
|
+
"default": "new SlotController(this, \"hint\")",
|
|
1273
|
+
"inheritedFrom": {
|
|
1274
|
+
"name": "FormAssociatedMixin",
|
|
1275
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1276
|
+
}
|
|
1322
1277
|
},
|
|
1323
1278
|
{
|
|
1324
1279
|
"kind": "field",
|
|
1325
|
-
"name": "
|
|
1326
|
-
"privacy": "
|
|
1327
|
-
"default": "new
|
|
1280
|
+
"name": "formData",
|
|
1281
|
+
"privacy": "protected",
|
|
1282
|
+
"default": "new FormDataController(this, { value: () => this.formValue })",
|
|
1283
|
+
"inheritedFrom": {
|
|
1284
|
+
"name": "FormAssociatedMixin",
|
|
1285
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1286
|
+
}
|
|
1328
1287
|
},
|
|
1329
1288
|
{
|
|
1330
1289
|
"kind": "field",
|
|
1331
|
-
"name": "
|
|
1290
|
+
"name": "inputId",
|
|
1332
1291
|
"type": {
|
|
1333
|
-
"text": "
|
|
1292
|
+
"text": "string"
|
|
1334
1293
|
},
|
|
1335
|
-
"
|
|
1336
|
-
"
|
|
1337
|
-
"
|
|
1294
|
+
"privacy": "protected",
|
|
1295
|
+
"default": "\"input\"",
|
|
1296
|
+
"inheritedFrom": {
|
|
1297
|
+
"name": "FormAssociatedMixin",
|
|
1298
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1299
|
+
}
|
|
1338
1300
|
},
|
|
1339
1301
|
{
|
|
1340
1302
|
"kind": "field",
|
|
1341
|
-
"name": "
|
|
1303
|
+
"name": "errorId",
|
|
1342
1304
|
"type": {
|
|
1343
1305
|
"text": "string"
|
|
1344
1306
|
},
|
|
1345
|
-
"
|
|
1346
|
-
"
|
|
1347
|
-
"
|
|
1307
|
+
"privacy": "protected",
|
|
1308
|
+
"default": "\"error\"",
|
|
1309
|
+
"inheritedFrom": {
|
|
1310
|
+
"name": "FormAssociatedMixin",
|
|
1311
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1312
|
+
}
|
|
1348
1313
|
},
|
|
1349
1314
|
{
|
|
1350
1315
|
"kind": "field",
|
|
1351
|
-
"name": "
|
|
1316
|
+
"name": "hintId",
|
|
1352
1317
|
"type": {
|
|
1353
|
-
"text": "
|
|
1318
|
+
"text": "string"
|
|
1354
1319
|
},
|
|
1355
|
-
"
|
|
1356
|
-
"
|
|
1320
|
+
"privacy": "protected",
|
|
1321
|
+
"default": "\"hint\"",
|
|
1322
|
+
"inheritedFrom": {
|
|
1323
|
+
"name": "FormAssociatedMixin",
|
|
1324
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1325
|
+
}
|
|
1357
1326
|
},
|
|
1358
1327
|
{
|
|
1359
1328
|
"kind": "field",
|
|
1360
|
-
"name": "
|
|
1329
|
+
"name": "label",
|
|
1361
1330
|
"type": {
|
|
1362
|
-
"text": "string
|
|
1331
|
+
"text": "string"
|
|
1363
1332
|
},
|
|
1364
|
-
"
|
|
1333
|
+
"default": "\"\"",
|
|
1334
|
+
"description": "Label for the input.",
|
|
1335
|
+
"attribute": "label",
|
|
1336
|
+
"inheritedFrom": {
|
|
1337
|
+
"name": "FormAssociatedMixin",
|
|
1338
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1339
|
+
}
|
|
1365
1340
|
},
|
|
1366
1341
|
{
|
|
1367
1342
|
"kind": "field",
|
|
1368
|
-
"name": "
|
|
1343
|
+
"name": "hint",
|
|
1369
1344
|
"type": {
|
|
1370
|
-
"text": "string"
|
|
1345
|
+
"text": "string | undefined"
|
|
1371
1346
|
},
|
|
1372
|
-
"
|
|
1373
|
-
"
|
|
1347
|
+
"description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
|
|
1348
|
+
"attribute": "hint",
|
|
1349
|
+
"inheritedFrom": {
|
|
1350
|
+
"name": "FormAssociatedMixin",
|
|
1351
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1352
|
+
}
|
|
1374
1353
|
},
|
|
1375
1354
|
{
|
|
1376
1355
|
"kind": "field",
|
|
1377
|
-
"name": "
|
|
1356
|
+
"name": "hideLabel",
|
|
1378
1357
|
"type": {
|
|
1379
1358
|
"text": "boolean"
|
|
1380
1359
|
},
|
|
1381
|
-
"
|
|
1382
|
-
"
|
|
1360
|
+
"default": "false",
|
|
1361
|
+
"description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
|
|
1362
|
+
"attribute": "hide-label",
|
|
1363
|
+
"inheritedFrom": {
|
|
1364
|
+
"name": "FormAssociatedMixin",
|
|
1365
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1366
|
+
}
|
|
1383
1367
|
},
|
|
1384
1368
|
{
|
|
1385
1369
|
"kind": "field",
|
|
1386
|
-
"name": "
|
|
1370
|
+
"name": "placeholder",
|
|
1387
1371
|
"type": {
|
|
1388
|
-
"text": "
|
|
1372
|
+
"text": "string | undefined"
|
|
1389
1373
|
},
|
|
1390
|
-
"
|
|
1391
|
-
"
|
|
1374
|
+
"description": "Placeholder text to display within the input.",
|
|
1375
|
+
"attribute": "placeholder",
|
|
1376
|
+
"inheritedFrom": {
|
|
1377
|
+
"name": "FormAssociatedMixin",
|
|
1378
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1379
|
+
}
|
|
1392
1380
|
},
|
|
1393
1381
|
{
|
|
1394
1382
|
"kind": "field",
|
|
1395
|
-
"name": "
|
|
1383
|
+
"name": "error",
|
|
1396
1384
|
"type": {
|
|
1397
|
-
"text": "
|
|
1385
|
+
"text": "string | undefined"
|
|
1398
1386
|
},
|
|
1399
|
-
"
|
|
1400
|
-
"
|
|
1387
|
+
"description": "Optional error to be shown with the input. Alternatively use the error slot.",
|
|
1388
|
+
"attribute": "error",
|
|
1389
|
+
"inheritedFrom": {
|
|
1390
|
+
"name": "FormAssociatedMixin",
|
|
1391
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1392
|
+
}
|
|
1401
1393
|
},
|
|
1402
1394
|
{
|
|
1403
1395
|
"kind": "field",
|
|
1404
|
-
"name": "
|
|
1396
|
+
"name": "required",
|
|
1405
1397
|
"type": {
|
|
1406
|
-
"text": "
|
|
1398
|
+
"text": "boolean"
|
|
1407
1399
|
},
|
|
1408
|
-
"
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
"
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
"name": "options",
|
|
1416
|
-
"default": "{}",
|
|
1417
|
-
"type": {
|
|
1418
|
-
"text": "{ parent?: string }"
|
|
1419
|
-
},
|
|
1420
|
-
"description": "allows you to open the menu filtered to a specific parent command."
|
|
1421
|
-
}
|
|
1422
|
-
],
|
|
1423
|
-
"description": "Show the command menu programmatically."
|
|
1424
|
-
},
|
|
1425
|
-
{
|
|
1426
|
-
"kind": "method",
|
|
1427
|
-
"name": "close",
|
|
1428
|
-
"description": "Close the command menu programmatically."
|
|
1429
|
-
},
|
|
1430
|
-
{
|
|
1431
|
-
"kind": "method",
|
|
1432
|
-
"name": "toggleOpen",
|
|
1433
|
-
"description": "Toggle the open state programmatically."
|
|
1434
|
-
},
|
|
1435
|
-
{
|
|
1436
|
-
"kind": "method",
|
|
1437
|
-
"name": "focus",
|
|
1438
|
-
"description": "Focus the command menu's input."
|
|
1439
|
-
},
|
|
1440
|
-
{
|
|
1441
|
-
"kind": "method",
|
|
1442
|
-
"name": "renderNoResults",
|
|
1443
|
-
"privacy": "private"
|
|
1444
|
-
},
|
|
1445
|
-
{
|
|
1446
|
-
"kind": "method",
|
|
1447
|
-
"name": "renderSection",
|
|
1448
|
-
"privacy": "private",
|
|
1449
|
-
"parameters": [
|
|
1450
|
-
{
|
|
1451
|
-
"name": "section",
|
|
1452
|
-
"type": {
|
|
1453
|
-
"text": "string | undefined"
|
|
1454
|
-
}
|
|
1455
|
-
},
|
|
1456
|
-
{
|
|
1457
|
-
"name": "commands",
|
|
1458
|
-
"type": {
|
|
1459
|
-
"text": "ICommandMenuAction[]"
|
|
1460
|
-
}
|
|
1461
|
-
}
|
|
1462
|
-
]
|
|
1463
|
-
},
|
|
1464
|
-
{
|
|
1465
|
-
"kind": "method",
|
|
1466
|
-
"name": "handleAnimationEnd",
|
|
1467
|
-
"privacy": "private"
|
|
1400
|
+
"default": "false",
|
|
1401
|
+
"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.",
|
|
1402
|
+
"attribute": "required",
|
|
1403
|
+
"inheritedFrom": {
|
|
1404
|
+
"name": "FormAssociatedMixin",
|
|
1405
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1406
|
+
}
|
|
1468
1407
|
},
|
|
1469
1408
|
{
|
|
1470
|
-
"kind": "
|
|
1471
|
-
"name": "
|
|
1472
|
-
"
|
|
1409
|
+
"kind": "field",
|
|
1410
|
+
"name": "expand",
|
|
1411
|
+
"type": {
|
|
1412
|
+
"text": "boolean"
|
|
1413
|
+
},
|
|
1414
|
+
"default": "false",
|
|
1415
|
+
"description": "Controls whether the input expands to fill the width of its container.",
|
|
1416
|
+
"attribute": "expand",
|
|
1417
|
+
"reflects": true,
|
|
1418
|
+
"inheritedFrom": {
|
|
1419
|
+
"name": "FormAssociatedMixin",
|
|
1420
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1421
|
+
}
|
|
1473
1422
|
},
|
|
1474
1423
|
{
|
|
1475
1424
|
"kind": "method",
|
|
1476
1425
|
"name": "handleInput",
|
|
1477
|
-
"privacy": "
|
|
1478
|
-
"parameters": [
|
|
1479
|
-
{
|
|
1480
|
-
"name": "event",
|
|
1481
|
-
"type": {
|
|
1482
|
-
"text": "KeyboardEvent"
|
|
1483
|
-
}
|
|
1484
|
-
}
|
|
1485
|
-
]
|
|
1486
|
-
},
|
|
1487
|
-
{
|
|
1488
|
-
"kind": "method",
|
|
1489
|
-
"name": "select",
|
|
1490
|
-
"privacy": "private",
|
|
1426
|
+
"privacy": "protected",
|
|
1491
1427
|
"parameters": [
|
|
1492
1428
|
{
|
|
1493
|
-
"name": "
|
|
1494
|
-
"default": "this.selected",
|
|
1429
|
+
"name": "e",
|
|
1495
1430
|
"type": {
|
|
1496
|
-
"text": "
|
|
1431
|
+
"text": "Event"
|
|
1497
1432
|
}
|
|
1498
1433
|
}
|
|
1499
|
-
]
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
"privacy": "private"
|
|
1505
|
-
},
|
|
1506
|
-
{
|
|
1507
|
-
"kind": "method",
|
|
1508
|
-
"name": "end",
|
|
1509
|
-
"privacy": "private"
|
|
1434
|
+
],
|
|
1435
|
+
"inheritedFrom": {
|
|
1436
|
+
"name": "FormAssociatedMixin",
|
|
1437
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1438
|
+
}
|
|
1510
1439
|
},
|
|
1511
1440
|
{
|
|
1512
1441
|
"kind": "method",
|
|
1513
|
-
"name": "
|
|
1514
|
-
"privacy": "
|
|
1442
|
+
"name": "renderLabel",
|
|
1443
|
+
"privacy": "protected",
|
|
1444
|
+
"inheritedFrom": {
|
|
1445
|
+
"name": "FormAssociatedMixin",
|
|
1446
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1447
|
+
}
|
|
1515
1448
|
},
|
|
1516
1449
|
{
|
|
1517
1450
|
"kind": "method",
|
|
1518
|
-
"name": "
|
|
1519
|
-
"privacy": "
|
|
1451
|
+
"name": "renderError",
|
|
1452
|
+
"privacy": "protected",
|
|
1453
|
+
"inheritedFrom": {
|
|
1454
|
+
"name": "FormAssociatedMixin",
|
|
1455
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1456
|
+
}
|
|
1520
1457
|
},
|
|
1521
1458
|
{
|
|
1522
1459
|
"kind": "method",
|
|
1523
|
-
"name": "
|
|
1524
|
-
"privacy": "
|
|
1460
|
+
"name": "getDescribedBy",
|
|
1461
|
+
"privacy": "protected",
|
|
1462
|
+
"inheritedFrom": {
|
|
1463
|
+
"name": "FormAssociatedMixin",
|
|
1464
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1465
|
+
}
|
|
1525
1466
|
},
|
|
1526
1467
|
{
|
|
1527
1468
|
"kind": "method",
|
|
1528
|
-
"name": "
|
|
1529
|
-
"privacy": "
|
|
1530
|
-
"
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
"type": {
|
|
1535
|
-
"text": "string"
|
|
1536
|
-
}
|
|
1537
|
-
}
|
|
1538
|
-
]
|
|
1469
|
+
"name": "getInvalid",
|
|
1470
|
+
"privacy": "protected",
|
|
1471
|
+
"inheritedFrom": {
|
|
1472
|
+
"name": "FormAssociatedMixin",
|
|
1473
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1474
|
+
}
|
|
1539
1475
|
},
|
|
1540
1476
|
{
|
|
1541
|
-
"kind": "
|
|
1542
|
-
"name": "
|
|
1543
|
-
"privacy": "
|
|
1544
|
-
"
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
"text": "string"
|
|
1549
|
-
}
|
|
1550
|
-
}
|
|
1551
|
-
]
|
|
1477
|
+
"kind": "field",
|
|
1478
|
+
"name": "hasHint",
|
|
1479
|
+
"privacy": "protected",
|
|
1480
|
+
"inheritedFrom": {
|
|
1481
|
+
"name": "FormAssociatedMixin",
|
|
1482
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1483
|
+
}
|
|
1552
1484
|
},
|
|
1553
1485
|
{
|
|
1554
|
-
"kind": "
|
|
1555
|
-
"name": "
|
|
1556
|
-
"privacy": "
|
|
1486
|
+
"kind": "field",
|
|
1487
|
+
"name": "hasError",
|
|
1488
|
+
"privacy": "protected",
|
|
1489
|
+
"inheritedFrom": {
|
|
1490
|
+
"name": "FormAssociatedMixin",
|
|
1491
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1492
|
+
}
|
|
1557
1493
|
},
|
|
1558
1494
|
{
|
|
1559
1495
|
"kind": "field",
|
|
1560
|
-
"name": "
|
|
1496
|
+
"name": "disabled",
|
|
1561
1497
|
"type": {
|
|
1562
1498
|
"text": "boolean"
|
|
1563
1499
|
},
|
|
1564
|
-
"privacy": "private",
|
|
1565
|
-
"static": true,
|
|
1566
1500
|
"default": "false",
|
|
1501
|
+
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
1502
|
+
"attribute": "disabled",
|
|
1503
|
+
"reflects": true,
|
|
1567
1504
|
"inheritedFrom": {
|
|
1568
|
-
"name": "
|
|
1569
|
-
"module": "src/common/mixins/
|
|
1505
|
+
"name": "InputMixin",
|
|
1506
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1570
1507
|
}
|
|
1571
|
-
}
|
|
1572
|
-
],
|
|
1573
|
-
"events": [
|
|
1508
|
+
},
|
|
1574
1509
|
{
|
|
1575
|
-
"
|
|
1510
|
+
"kind": "field",
|
|
1511
|
+
"name": "name",
|
|
1576
1512
|
"type": {
|
|
1577
|
-
"text": "
|
|
1513
|
+
"text": "string | undefined"
|
|
1578
1514
|
},
|
|
1579
|
-
"description": "The
|
|
1515
|
+
"description": "The name of the form component.",
|
|
1516
|
+
"attribute": "name",
|
|
1517
|
+
"inheritedFrom": {
|
|
1518
|
+
"name": "InputMixin",
|
|
1519
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1520
|
+
}
|
|
1580
1521
|
},
|
|
1581
1522
|
{
|
|
1582
|
-
"
|
|
1523
|
+
"kind": "field",
|
|
1524
|
+
"name": "value",
|
|
1583
1525
|
"type": {
|
|
1584
|
-
"text": "
|
|
1526
|
+
"text": "string"
|
|
1585
1527
|
},
|
|
1586
|
-
"
|
|
1528
|
+
"default": "\"\"",
|
|
1529
|
+
"description": "The value of the form component.",
|
|
1530
|
+
"attribute": "value",
|
|
1531
|
+
"inheritedFrom": {
|
|
1532
|
+
"name": "InputMixin",
|
|
1533
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1534
|
+
}
|
|
1587
1535
|
},
|
|
1588
1536
|
{
|
|
1537
|
+
"kind": "field",
|
|
1538
|
+
"name": "form",
|
|
1539
|
+
"privacy": "protected",
|
|
1540
|
+
"description": "Gets the form, if any, associated with the form element.",
|
|
1541
|
+
"inheritedFrom": {
|
|
1542
|
+
"name": "InputMixin",
|
|
1543
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1544
|
+
}
|
|
1545
|
+
},
|
|
1546
|
+
{
|
|
1547
|
+
"kind": "field",
|
|
1548
|
+
"name": "focusableRef",
|
|
1549
|
+
"privacy": "protected",
|
|
1550
|
+
"inheritedFrom": {
|
|
1551
|
+
"name": "FocusableMixin",
|
|
1552
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
1553
|
+
}
|
|
1554
|
+
},
|
|
1555
|
+
{
|
|
1556
|
+
"kind": "method",
|
|
1557
|
+
"name": "focus",
|
|
1558
|
+
"parameters": [
|
|
1559
|
+
{
|
|
1560
|
+
"name": "options",
|
|
1561
|
+
"optional": true,
|
|
1562
|
+
"type": {
|
|
1563
|
+
"text": "FocusOptions"
|
|
1564
|
+
},
|
|
1565
|
+
"description": "An object which controls aspects of the focusing process."
|
|
1566
|
+
}
|
|
1567
|
+
],
|
|
1568
|
+
"description": "Programmatically move focus to the component.",
|
|
1569
|
+
"inheritedFrom": {
|
|
1570
|
+
"name": "FocusableMixin",
|
|
1571
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
1572
|
+
}
|
|
1573
|
+
},
|
|
1574
|
+
{
|
|
1575
|
+
"kind": "method",
|
|
1576
|
+
"name": "blur",
|
|
1577
|
+
"description": "Programmatically remove focus from the component.",
|
|
1578
|
+
"inheritedFrom": {
|
|
1579
|
+
"name": "FocusableMixin",
|
|
1580
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
1581
|
+
}
|
|
1582
|
+
},
|
|
1583
|
+
{
|
|
1584
|
+
"kind": "method",
|
|
1585
|
+
"name": "click",
|
|
1586
|
+
"description": "Programmatically simulates a click on the component.",
|
|
1587
|
+
"inheritedFrom": {
|
|
1588
|
+
"name": "FocusableMixin",
|
|
1589
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
1590
|
+
}
|
|
1591
|
+
},
|
|
1592
|
+
{
|
|
1593
|
+
"kind": "field",
|
|
1594
|
+
"name": "_warningLogged",
|
|
1589
1595
|
"type": {
|
|
1590
|
-
"text": "
|
|
1596
|
+
"text": "boolean"
|
|
1591
1597
|
},
|
|
1592
|
-
"
|
|
1593
|
-
"
|
|
1598
|
+
"privacy": "private",
|
|
1599
|
+
"static": true,
|
|
1600
|
+
"default": "false",
|
|
1601
|
+
"inheritedFrom": {
|
|
1602
|
+
"name": "DraftComponentMixin",
|
|
1603
|
+
"module": "src/common/mixins/DraftComponentMixin.ts"
|
|
1604
|
+
}
|
|
1594
1605
|
}
|
|
1595
1606
|
],
|
|
1596
1607
|
"attributes": [
|
|
1597
1608
|
{
|
|
1598
|
-
"name": "
|
|
1609
|
+
"name": "checked",
|
|
1599
1610
|
"type": {
|
|
1600
1611
|
"text": "boolean"
|
|
1601
1612
|
},
|
|
1602
1613
|
"default": "false",
|
|
1603
|
-
"description": "
|
|
1604
|
-
"fieldName": "
|
|
1614
|
+
"description": "Controls whether the checkbox is checked or not.",
|
|
1615
|
+
"fieldName": "checked"
|
|
1616
|
+
},
|
|
1617
|
+
{
|
|
1618
|
+
"name": "label",
|
|
1619
|
+
"type": {
|
|
1620
|
+
"text": "string"
|
|
1621
|
+
},
|
|
1622
|
+
"default": "\"\"",
|
|
1623
|
+
"description": "Label for the input.",
|
|
1624
|
+
"fieldName": "label",
|
|
1625
|
+
"inheritedFrom": {
|
|
1626
|
+
"name": "FormAssociatedMixin",
|
|
1627
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1628
|
+
}
|
|
1629
|
+
},
|
|
1630
|
+
{
|
|
1631
|
+
"name": "hint",
|
|
1632
|
+
"type": {
|
|
1633
|
+
"text": "string | undefined"
|
|
1634
|
+
},
|
|
1635
|
+
"description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
|
|
1636
|
+
"fieldName": "hint",
|
|
1637
|
+
"inheritedFrom": {
|
|
1638
|
+
"name": "FormAssociatedMixin",
|
|
1639
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1640
|
+
}
|
|
1641
|
+
},
|
|
1642
|
+
{
|
|
1643
|
+
"name": "hide-label",
|
|
1644
|
+
"type": {
|
|
1645
|
+
"text": "boolean"
|
|
1646
|
+
},
|
|
1647
|
+
"default": "false",
|
|
1648
|
+
"description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
|
|
1649
|
+
"fieldName": "hideLabel",
|
|
1650
|
+
"inheritedFrom": {
|
|
1651
|
+
"name": "FormAssociatedMixin",
|
|
1652
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1653
|
+
}
|
|
1605
1654
|
},
|
|
1606
1655
|
{
|
|
1607
1656
|
"name": "placeholder",
|
|
1657
|
+
"type": {
|
|
1658
|
+
"text": "string | undefined"
|
|
1659
|
+
},
|
|
1660
|
+
"description": "Placeholder text to display within the input.",
|
|
1661
|
+
"fieldName": "placeholder",
|
|
1662
|
+
"inheritedFrom": {
|
|
1663
|
+
"name": "FormAssociatedMixin",
|
|
1664
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1665
|
+
}
|
|
1666
|
+
},
|
|
1667
|
+
{
|
|
1668
|
+
"name": "error",
|
|
1669
|
+
"type": {
|
|
1670
|
+
"text": "string | undefined"
|
|
1671
|
+
},
|
|
1672
|
+
"description": "Optional error to be shown with the input. Alternatively use the error slot.",
|
|
1673
|
+
"fieldName": "error",
|
|
1674
|
+
"inheritedFrom": {
|
|
1675
|
+
"name": "FormAssociatedMixin",
|
|
1676
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1677
|
+
}
|
|
1678
|
+
},
|
|
1679
|
+
{
|
|
1680
|
+
"name": "required",
|
|
1681
|
+
"type": {
|
|
1682
|
+
"text": "boolean"
|
|
1683
|
+
},
|
|
1684
|
+
"default": "false",
|
|
1685
|
+
"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.",
|
|
1686
|
+
"fieldName": "required",
|
|
1687
|
+
"inheritedFrom": {
|
|
1688
|
+
"name": "FormAssociatedMixin",
|
|
1689
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1690
|
+
}
|
|
1691
|
+
},
|
|
1692
|
+
{
|
|
1693
|
+
"name": "expand",
|
|
1694
|
+
"type": {
|
|
1695
|
+
"text": "boolean"
|
|
1696
|
+
},
|
|
1697
|
+
"default": "false",
|
|
1698
|
+
"description": "Controls whether the input expands to fill the width of its container.",
|
|
1699
|
+
"fieldName": "expand",
|
|
1700
|
+
"inheritedFrom": {
|
|
1701
|
+
"name": "FormAssociatedMixin",
|
|
1702
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1703
|
+
}
|
|
1704
|
+
},
|
|
1705
|
+
{
|
|
1706
|
+
"name": "disabled",
|
|
1707
|
+
"type": {
|
|
1708
|
+
"text": "boolean"
|
|
1709
|
+
},
|
|
1710
|
+
"default": "false",
|
|
1711
|
+
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
1712
|
+
"fieldName": "disabled",
|
|
1713
|
+
"inheritedFrom": {
|
|
1714
|
+
"name": "InputMixin",
|
|
1715
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1716
|
+
}
|
|
1717
|
+
},
|
|
1718
|
+
{
|
|
1719
|
+
"name": "name",
|
|
1720
|
+
"type": {
|
|
1721
|
+
"text": "string | undefined"
|
|
1722
|
+
},
|
|
1723
|
+
"description": "The name of the form component.",
|
|
1724
|
+
"fieldName": "name",
|
|
1725
|
+
"inheritedFrom": {
|
|
1726
|
+
"name": "InputMixin",
|
|
1727
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1728
|
+
}
|
|
1729
|
+
},
|
|
1730
|
+
{
|
|
1731
|
+
"name": "value",
|
|
1608
1732
|
"type": {
|
|
1609
1733
|
"text": "string"
|
|
1610
1734
|
},
|
|
1611
|
-
"default": "\"
|
|
1612
|
-
"description": "
|
|
1613
|
-
"fieldName": "
|
|
1735
|
+
"default": "\"\"",
|
|
1736
|
+
"description": "The value of the form component.",
|
|
1737
|
+
"fieldName": "value",
|
|
1738
|
+
"inheritedFrom": {
|
|
1739
|
+
"name": "InputMixin",
|
|
1740
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1741
|
+
}
|
|
1614
1742
|
}
|
|
1615
1743
|
],
|
|
1616
1744
|
"mixins": [
|
|
1745
|
+
{
|
|
1746
|
+
"name": "FormAssociatedMixin",
|
|
1747
|
+
"module": "/src/common/mixins/FormAssociatedMixin.js"
|
|
1748
|
+
},
|
|
1749
|
+
{
|
|
1750
|
+
"name": "InputMixin",
|
|
1751
|
+
"module": "/src/common/mixins/InputMixin.js"
|
|
1752
|
+
},
|
|
1753
|
+
{
|
|
1754
|
+
"name": "FocusableMixin",
|
|
1755
|
+
"module": "/src/common/mixins/FocusableMixin.js"
|
|
1756
|
+
},
|
|
1617
1757
|
{
|
|
1618
1758
|
"name": "DraftComponentMixin",
|
|
1619
1759
|
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
@@ -1624,9 +1764,33 @@
|
|
|
1624
1764
|
"package": "lit"
|
|
1625
1765
|
},
|
|
1626
1766
|
"status": "draft",
|
|
1627
|
-
"category": "
|
|
1628
|
-
"tagName": "nord-
|
|
1629
|
-
"customElement": true
|
|
1767
|
+
"category": "form",
|
|
1768
|
+
"tagName": "nord-checkbox",
|
|
1769
|
+
"customElement": true,
|
|
1770
|
+
"events": [
|
|
1771
|
+
{
|
|
1772
|
+
"name": "input",
|
|
1773
|
+
"type": {
|
|
1774
|
+
"text": "NordEvent"
|
|
1775
|
+
},
|
|
1776
|
+
"description": "Fired as the user types into the input.",
|
|
1777
|
+
"inheritedFrom": {
|
|
1778
|
+
"name": "FormAssociatedMixin",
|
|
1779
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1780
|
+
}
|
|
1781
|
+
},
|
|
1782
|
+
{
|
|
1783
|
+
"name": "change",
|
|
1784
|
+
"type": {
|
|
1785
|
+
"text": "NordEvent"
|
|
1786
|
+
},
|
|
1787
|
+
"description": "Fired whenever the input's value is changed via user interaction.",
|
|
1788
|
+
"inheritedFrom": {
|
|
1789
|
+
"name": "FormAssociatedMixin",
|
|
1790
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1793
|
+
]
|
|
1630
1794
|
}
|
|
1631
1795
|
],
|
|
1632
1796
|
"exports": [
|
|
@@ -1634,83 +1798,106 @@
|
|
|
1634
1798
|
"kind": "js",
|
|
1635
1799
|
"name": "default",
|
|
1636
1800
|
"declaration": {
|
|
1637
|
-
"name": "
|
|
1638
|
-
"module": "src/
|
|
1801
|
+
"name": "Checkbox",
|
|
1802
|
+
"module": "src/checkbox/Checkbox.ts"
|
|
1639
1803
|
}
|
|
1640
1804
|
},
|
|
1641
1805
|
{
|
|
1642
1806
|
"kind": "custom-element-definition",
|
|
1643
|
-
"name": "nord-
|
|
1807
|
+
"name": "nord-checkbox",
|
|
1644
1808
|
"declaration": {
|
|
1645
|
-
"name": "
|
|
1646
|
-
"module": "src/
|
|
1809
|
+
"name": "Checkbox",
|
|
1810
|
+
"module": "src/checkbox/Checkbox.ts"
|
|
1647
1811
|
}
|
|
1648
1812
|
}
|
|
1649
1813
|
],
|
|
1650
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
1814
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use for making it possible to choose one or more options from a limited number of options.\n- Use for “accepting terms of service” and similar functionality.\n- Use in forms to toggle something on or off.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use when you have more than 10 options to choose from.\n- Don’t change the selection of another checkbox when another one is clicked. Only exception is when a checkbox is used to make a bulk selection of multiple items.\n\n</div>\n\n---\n\n## Content guidelines\n\nCheckbox labels should be clear, accurate and predictable. It should be possible for the user to understand what they are selecting:\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">Option 1</div>\n\nWhen writing checkbox labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">User Settings</div>\n\nAvoid ending in punctuation if it’s a single sentence, word, or a fragment:\n\n<div class=\"n-usage n-usage-do\">Show dashboard</div>\n<div class=\"n-usage n-usage-dont\">Show dashboard.</div>\n\nDo not use commas or semicolons at the end of each line\n\n<div class=\"n-usage n-usage-do\">Patients</div>\n<div class=\"n-usage n-usage-dont\">Patients;</div>\n"
|
|
1651
1815
|
},
|
|
1652
1816
|
{
|
|
1653
1817
|
"kind": "javascript-module",
|
|
1654
|
-
"path": "src/
|
|
1818
|
+
"path": "src/card/Card.ts",
|
|
1655
1819
|
"declarations": [
|
|
1656
1820
|
{
|
|
1657
1821
|
"kind": "class",
|
|
1658
|
-
"description": "
|
|
1659
|
-
"name": "
|
|
1822
|
+
"description": "Cards are shadowed surfaces that display content and actions on a\nsingle topic. They should be easy to scan for relevant and\nactionable information.",
|
|
1823
|
+
"name": "Card",
|
|
1824
|
+
"slots": [
|
|
1825
|
+
{
|
|
1826
|
+
"description": "The card content.",
|
|
1827
|
+
"name": ""
|
|
1828
|
+
},
|
|
1829
|
+
{
|
|
1830
|
+
"description": "Optional slot that holds a header for the card.",
|
|
1831
|
+
"name": "header"
|
|
1832
|
+
},
|
|
1833
|
+
{
|
|
1834
|
+
"description": "Optional slot that holds footer content for the card.",
|
|
1835
|
+
"name": "footer"
|
|
1836
|
+
}
|
|
1837
|
+
],
|
|
1660
1838
|
"members": [
|
|
1661
1839
|
{
|
|
1662
1840
|
"kind": "field",
|
|
1663
|
-
"name": "
|
|
1841
|
+
"name": "headerSlot",
|
|
1842
|
+
"privacy": "private",
|
|
1843
|
+
"default": "new SlotController(this, \"header\")"
|
|
1844
|
+
},
|
|
1845
|
+
{
|
|
1846
|
+
"kind": "field",
|
|
1847
|
+
"name": "footerSlot",
|
|
1848
|
+
"privacy": "private",
|
|
1849
|
+
"default": "new SlotController(this, \"footer\")"
|
|
1850
|
+
},
|
|
1851
|
+
{
|
|
1852
|
+
"kind": "field",
|
|
1853
|
+
"name": "padding",
|
|
1664
1854
|
"type": {
|
|
1665
|
-
"text": "
|
|
1855
|
+
"text": "\"m\" | \"l\" | \"none\""
|
|
1666
1856
|
},
|
|
1667
|
-
"
|
|
1857
|
+
"default": "\"m\"",
|
|
1858
|
+
"description": "Controls the padding of card component. When set to “none”,\nthe header and footer slots will still have padding.",
|
|
1859
|
+
"attribute": "padding",
|
|
1860
|
+
"reflects": true
|
|
1668
1861
|
},
|
|
1669
1862
|
{
|
|
1670
1863
|
"kind": "field",
|
|
1671
|
-
"name": "
|
|
1864
|
+
"name": "_warningLogged",
|
|
1672
1865
|
"type": {
|
|
1673
1866
|
"text": "boolean"
|
|
1674
1867
|
},
|
|
1675
|
-
"default": "false",
|
|
1676
|
-
"attribute": "selected"
|
|
1677
|
-
},
|
|
1678
|
-
{
|
|
1679
|
-
"kind": "method",
|
|
1680
|
-
"name": "ensureInView",
|
|
1681
1868
|
"privacy": "private",
|
|
1682
|
-
"
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1869
|
+
"static": true,
|
|
1870
|
+
"default": "false",
|
|
1871
|
+
"inheritedFrom": {
|
|
1872
|
+
"name": "DraftComponentMixin",
|
|
1873
|
+
"module": "src/common/mixins/DraftComponentMixin.ts"
|
|
1874
|
+
}
|
|
1688
1875
|
}
|
|
1689
1876
|
],
|
|
1690
1877
|
"attributes": [
|
|
1691
1878
|
{
|
|
1692
|
-
"name": "
|
|
1879
|
+
"name": "padding",
|
|
1693
1880
|
"type": {
|
|
1694
|
-
"text": "
|
|
1881
|
+
"text": "\"m\" | \"l\" | \"none\""
|
|
1695
1882
|
},
|
|
1696
|
-
"
|
|
1697
|
-
|
|
1883
|
+
"default": "\"m\"",
|
|
1884
|
+
"description": "Controls the padding of card component. When set to “none”,\nthe header and footer slots will still have padding.",
|
|
1885
|
+
"fieldName": "padding"
|
|
1886
|
+
}
|
|
1887
|
+
],
|
|
1888
|
+
"mixins": [
|
|
1698
1889
|
{
|
|
1699
|
-
"name": "
|
|
1700
|
-
"
|
|
1701
|
-
"text": "boolean"
|
|
1702
|
-
},
|
|
1703
|
-
"default": "false",
|
|
1704
|
-
"fieldName": "selected"
|
|
1890
|
+
"name": "DraftComponentMixin",
|
|
1891
|
+
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
1705
1892
|
}
|
|
1706
1893
|
],
|
|
1707
1894
|
"superclass": {
|
|
1708
1895
|
"name": "LitElement",
|
|
1709
1896
|
"package": "lit"
|
|
1710
1897
|
},
|
|
1711
|
-
"status": "
|
|
1712
|
-
"category":
|
|
1713
|
-
"tagName": "nord-
|
|
1898
|
+
"status": "draft",
|
|
1899
|
+
"category": "structure",
|
|
1900
|
+
"tagName": "nord-card",
|
|
1714
1901
|
"customElement": true
|
|
1715
1902
|
}
|
|
1716
1903
|
],
|
|
@@ -1719,544 +1906,294 @@
|
|
|
1719
1906
|
"kind": "js",
|
|
1720
1907
|
"name": "default",
|
|
1721
1908
|
"declaration": {
|
|
1722
|
-
"name": "
|
|
1723
|
-
"module": "src/
|
|
1909
|
+
"name": "Card",
|
|
1910
|
+
"module": "src/card/Card.ts"
|
|
1724
1911
|
}
|
|
1725
1912
|
},
|
|
1726
1913
|
{
|
|
1727
1914
|
"kind": "custom-element-definition",
|
|
1728
|
-
"name": "nord-
|
|
1915
|
+
"name": "nord-card",
|
|
1729
1916
|
"declaration": {
|
|
1730
|
-
"name": "
|
|
1731
|
-
"module": "src/
|
|
1917
|
+
"name": "Card",
|
|
1918
|
+
"module": "src/card/Card.ts"
|
|
1732
1919
|
}
|
|
1733
1920
|
}
|
|
1734
1921
|
],
|
|
1735
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
1736
|
-
},
|
|
1737
|
-
{
|
|
1738
|
-
"kind": "javascript-module",
|
|
1739
|
-
"path": "src/command-menu/ICommandMenuAction.ts",
|
|
1740
|
-
"declarations": [],
|
|
1741
|
-
"exports": [],
|
|
1742
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
1922
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to display content and actions on a single topic inside a container.\n- Use to visually separate specific parts of content in an application view.\n- Use to wrap a form into a container, for example a login form.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use when you need to capture user’s attention in a prominent way.\n- Don’t use to inform user about important changes or conditions in the interface.\n- Don’t use multiple primary buttons inside a card. A card should only contain a single primary action.\n\n</div>\n"
|
|
1743
1923
|
},
|
|
1744
1924
|
{
|
|
1745
1925
|
"kind": "javascript-module",
|
|
1746
|
-
"path": "src/command-menu/
|
|
1926
|
+
"path": "src/command-menu/CommandMenu.ts",
|
|
1747
1927
|
"declarations": [
|
|
1748
1928
|
{
|
|
1749
1929
|
"kind": "class",
|
|
1750
|
-
"description": "",
|
|
1751
|
-
"name": "
|
|
1930
|
+
"description": "Command Menu allows users to navigate and use an app without\ntouching the mouse and helps them transform into “power users”\nwho can harness more advanced features far faster.",
|
|
1931
|
+
"name": "CommandMenu",
|
|
1932
|
+
"slots": [
|
|
1933
|
+
{
|
|
1934
|
+
"description": "Used to replace the default footer contents.",
|
|
1935
|
+
"name": "footer"
|
|
1936
|
+
}
|
|
1937
|
+
],
|
|
1752
1938
|
"members": [
|
|
1753
1939
|
{
|
|
1754
1940
|
"kind": "field",
|
|
1755
|
-
"name": "
|
|
1756
|
-
"
|
|
1757
|
-
"text": "CommandMenu"
|
|
1758
|
-
},
|
|
1759
|
-
"privacy": "private",
|
|
1760
|
-
"default": "host"
|
|
1941
|
+
"name": "inputRef",
|
|
1942
|
+
"privacy": "private"
|
|
1761
1943
|
},
|
|
1762
1944
|
{
|
|
1763
1945
|
"kind": "field",
|
|
1764
|
-
"name": "
|
|
1946
|
+
"name": "listRef",
|
|
1947
|
+
"privacy": "private"
|
|
1948
|
+
},
|
|
1949
|
+
{
|
|
1950
|
+
"kind": "field",
|
|
1951
|
+
"name": "previousFocus",
|
|
1765
1952
|
"type": {
|
|
1766
|
-
"text": "
|
|
1953
|
+
"text": "HTMLElement | undefined"
|
|
1767
1954
|
},
|
|
1955
|
+
"privacy": "private"
|
|
1956
|
+
},
|
|
1957
|
+
{
|
|
1958
|
+
"kind": "field",
|
|
1959
|
+
"name": "dismissController",
|
|
1768
1960
|
"privacy": "private",
|
|
1769
|
-
"default": "new
|
|
1961
|
+
"default": "new LightDismissController(this, {\n isOpen: () => this.open,\n onDismiss: () => this.close(),\n })"
|
|
1770
1962
|
},
|
|
1771
1963
|
{
|
|
1772
1964
|
"kind": "field",
|
|
1773
|
-
"name": "
|
|
1774
|
-
"type": {
|
|
1775
|
-
"text": "ShortcutController"
|
|
1776
|
-
},
|
|
1965
|
+
"name": "keyboardController",
|
|
1777
1966
|
"privacy": "private",
|
|
1778
|
-
"default": "new
|
|
1967
|
+
"default": "new KeyboardController(this, {\n trigger: () => this.select(),\n goBack: () => this.goBack(),\n end: () => this.end(),\n start: () => this.start(),\n next: () => this.next(),\n previous: () => this.previous(),\n toggleOpen: () => this.toggleOpen(),\n })"
|
|
1779
1968
|
},
|
|
1780
1969
|
{
|
|
1781
1970
|
"kind": "field",
|
|
1782
|
-
"name": "
|
|
1971
|
+
"name": "open",
|
|
1783
1972
|
"type": {
|
|
1784
|
-
"text": "
|
|
1973
|
+
"text": "boolean"
|
|
1785
1974
|
},
|
|
1786
|
-
"
|
|
1787
|
-
"
|
|
1975
|
+
"default": "false",
|
|
1976
|
+
"description": "Show or hide the command menu.",
|
|
1977
|
+
"attribute": "open"
|
|
1788
1978
|
},
|
|
1789
|
-
{
|
|
1790
|
-
"kind": "method",
|
|
1791
|
-
"name": "registerCommandShortcuts"
|
|
1792
|
-
}
|
|
1793
|
-
]
|
|
1794
|
-
}
|
|
1795
|
-
],
|
|
1796
|
-
"exports": [
|
|
1797
|
-
{
|
|
1798
|
-
"kind": "js",
|
|
1799
|
-
"name": "KeyboardController",
|
|
1800
|
-
"declaration": {
|
|
1801
|
-
"name": "KeyboardController",
|
|
1802
|
-
"module": "src/command-menu/KeyboardController.ts"
|
|
1803
|
-
}
|
|
1804
|
-
}
|
|
1805
|
-
],
|
|
1806
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
1807
|
-
},
|
|
1808
|
-
{
|
|
1809
|
-
"kind": "javascript-module",
|
|
1810
|
-
"path": "src/command-menu/SelectEvent.ts",
|
|
1811
|
-
"declarations": [
|
|
1812
|
-
{
|
|
1813
|
-
"kind": "class",
|
|
1814
|
-
"description": "",
|
|
1815
|
-
"name": "SelectEvent",
|
|
1816
|
-
"members": [
|
|
1817
1979
|
{
|
|
1818
1980
|
"kind": "field",
|
|
1819
|
-
"name": "
|
|
1981
|
+
"name": "placeholder",
|
|
1820
1982
|
"type": {
|
|
1821
1983
|
"text": "string"
|
|
1822
1984
|
},
|
|
1823
|
-
"
|
|
1824
|
-
"
|
|
1985
|
+
"default": "\"Type a command or search...\"",
|
|
1986
|
+
"description": "Hint text to display in the Command Menu search field.",
|
|
1987
|
+
"attribute": "placeholder"
|
|
1825
1988
|
},
|
|
1826
1989
|
{
|
|
1827
1990
|
"kind": "field",
|
|
1828
|
-
"name": "
|
|
1991
|
+
"name": "commands",
|
|
1829
1992
|
"type": {
|
|
1830
|
-
"text": "ICommandMenuAction"
|
|
1993
|
+
"text": "Array<ICommandMenuAction>"
|
|
1831
1994
|
},
|
|
1832
|
-
"default": "
|
|
1833
|
-
|
|
1834
|
-
],
|
|
1835
|
-
"superclass": {
|
|
1836
|
-
"name": "NordEvent",
|
|
1837
|
-
"module": "/src/common/events.js"
|
|
1838
|
-
}
|
|
1839
|
-
}
|
|
1840
|
-
],
|
|
1841
|
-
"exports": [
|
|
1842
|
-
{
|
|
1843
|
-
"kind": "js",
|
|
1844
|
-
"name": "SelectEvent",
|
|
1845
|
-
"declaration": {
|
|
1846
|
-
"name": "SelectEvent",
|
|
1847
|
-
"module": "src/command-menu/SelectEvent.ts"
|
|
1848
|
-
}
|
|
1849
|
-
}
|
|
1850
|
-
],
|
|
1851
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
1852
|
-
},
|
|
1853
|
-
{
|
|
1854
|
-
"kind": "javascript-module",
|
|
1855
|
-
"path": "src/checkbox/Checkbox.ts",
|
|
1856
|
-
"declarations": [
|
|
1857
|
-
{
|
|
1858
|
-
"kind": "class",
|
|
1859
|
-
"description": "Checkboxes allow user to choose one or more options from a limited set of options.\nIf you have more than 10 options, please use Select component instead.",
|
|
1860
|
-
"name": "Checkbox",
|
|
1861
|
-
"slots": [
|
|
1862
|
-
{
|
|
1863
|
-
"description": "Use when a label requires more than plain text.",
|
|
1864
|
-
"name": "label"
|
|
1995
|
+
"default": "[]",
|
|
1996
|
+
"description": "Array of commands to be included in the menu.\nPlease see “Commands data” section for more documentation."
|
|
1865
1997
|
},
|
|
1866
1998
|
{
|
|
1867
|
-
"
|
|
1868
|
-
"name": "
|
|
1999
|
+
"kind": "field",
|
|
2000
|
+
"name": "parent",
|
|
2001
|
+
"type": {
|
|
2002
|
+
"text": "string | undefined"
|
|
2003
|
+
},
|
|
2004
|
+
"privacy": "private"
|
|
1869
2005
|
},
|
|
1870
|
-
{
|
|
1871
|
-
"description": "Optional slot that holds error text for the input.",
|
|
1872
|
-
"name": "error"
|
|
1873
|
-
}
|
|
1874
|
-
],
|
|
1875
|
-
"members": [
|
|
1876
2006
|
{
|
|
1877
2007
|
"kind": "field",
|
|
1878
|
-
"name": "
|
|
1879
|
-
"
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
2008
|
+
"name": "search",
|
|
2009
|
+
"type": {
|
|
2010
|
+
"text": "string"
|
|
2011
|
+
},
|
|
2012
|
+
"privacy": "private",
|
|
2013
|
+
"default": "\"\""
|
|
1884
2014
|
},
|
|
1885
2015
|
{
|
|
1886
2016
|
"kind": "field",
|
|
1887
|
-
"name": "
|
|
2017
|
+
"name": "bump",
|
|
1888
2018
|
"type": {
|
|
1889
2019
|
"text": "boolean"
|
|
1890
2020
|
},
|
|
1891
|
-
"
|
|
1892
|
-
"
|
|
1893
|
-
"attribute": "checked"
|
|
1894
|
-
},
|
|
1895
|
-
{
|
|
1896
|
-
"kind": "method",
|
|
1897
|
-
"name": "handleChange",
|
|
1898
|
-
"privacy": "protected",
|
|
1899
|
-
"return": {
|
|
1900
|
-
"type": {
|
|
1901
|
-
"text": "void"
|
|
1902
|
-
}
|
|
1903
|
-
},
|
|
1904
|
-
"parameters": [
|
|
1905
|
-
{
|
|
1906
|
-
"name": "e",
|
|
1907
|
-
"type": {
|
|
1908
|
-
"text": "Event"
|
|
1909
|
-
}
|
|
1910
|
-
}
|
|
1911
|
-
],
|
|
1912
|
-
"inheritedFrom": {
|
|
1913
|
-
"name": "FormAssociatedMixin",
|
|
1914
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1915
|
-
}
|
|
1916
|
-
},
|
|
1917
|
-
{
|
|
1918
|
-
"kind": "field",
|
|
1919
|
-
"name": "labelSlot",
|
|
1920
|
-
"privacy": "protected",
|
|
1921
|
-
"default": "new SlotController(this, \"label\")",
|
|
1922
|
-
"inheritedFrom": {
|
|
1923
|
-
"name": "FormAssociatedMixin",
|
|
1924
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1925
|
-
}
|
|
1926
|
-
},
|
|
1927
|
-
{
|
|
1928
|
-
"kind": "field",
|
|
1929
|
-
"name": "errorSlot",
|
|
1930
|
-
"privacy": "protected",
|
|
1931
|
-
"default": "new SlotController(this, \"error\")",
|
|
1932
|
-
"inheritedFrom": {
|
|
1933
|
-
"name": "FormAssociatedMixin",
|
|
1934
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1935
|
-
}
|
|
1936
|
-
},
|
|
1937
|
-
{
|
|
1938
|
-
"kind": "field",
|
|
1939
|
-
"name": "hintSlot",
|
|
1940
|
-
"privacy": "protected",
|
|
1941
|
-
"default": "new SlotController(this, \"hint\")",
|
|
1942
|
-
"inheritedFrom": {
|
|
1943
|
-
"name": "FormAssociatedMixin",
|
|
1944
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1945
|
-
}
|
|
1946
|
-
},
|
|
1947
|
-
{
|
|
1948
|
-
"kind": "field",
|
|
1949
|
-
"name": "formData",
|
|
1950
|
-
"privacy": "protected",
|
|
1951
|
-
"default": "new FormDataController(this, { value: () => this.formValue })",
|
|
1952
|
-
"inheritedFrom": {
|
|
1953
|
-
"name": "FormAssociatedMixin",
|
|
1954
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1955
|
-
}
|
|
1956
|
-
},
|
|
1957
|
-
{
|
|
1958
|
-
"kind": "field",
|
|
1959
|
-
"name": "inputId",
|
|
1960
|
-
"type": {
|
|
1961
|
-
"text": "string"
|
|
1962
|
-
},
|
|
1963
|
-
"privacy": "protected",
|
|
1964
|
-
"default": "\"input\"",
|
|
1965
|
-
"inheritedFrom": {
|
|
1966
|
-
"name": "FormAssociatedMixin",
|
|
1967
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1968
|
-
}
|
|
1969
|
-
},
|
|
1970
|
-
{
|
|
1971
|
-
"kind": "field",
|
|
1972
|
-
"name": "errorId",
|
|
1973
|
-
"type": {
|
|
1974
|
-
"text": "string"
|
|
1975
|
-
},
|
|
1976
|
-
"privacy": "protected",
|
|
1977
|
-
"default": "\"error\"",
|
|
1978
|
-
"inheritedFrom": {
|
|
1979
|
-
"name": "FormAssociatedMixin",
|
|
1980
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1981
|
-
}
|
|
2021
|
+
"privacy": "private",
|
|
2022
|
+
"default": "true"
|
|
1982
2023
|
},
|
|
1983
2024
|
{
|
|
1984
2025
|
"kind": "field",
|
|
1985
|
-
"name": "
|
|
2026
|
+
"name": "selectedIndex",
|
|
1986
2027
|
"type": {
|
|
1987
|
-
"text": "
|
|
2028
|
+
"text": "number"
|
|
1988
2029
|
},
|
|
1989
|
-
"privacy": "
|
|
1990
|
-
"default": "
|
|
1991
|
-
"inheritedFrom": {
|
|
1992
|
-
"name": "FormAssociatedMixin",
|
|
1993
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1994
|
-
}
|
|
2030
|
+
"privacy": "private",
|
|
2031
|
+
"default": "0"
|
|
1995
2032
|
},
|
|
1996
2033
|
{
|
|
1997
2034
|
"kind": "field",
|
|
1998
|
-
"name": "
|
|
2035
|
+
"name": "filteredCommands",
|
|
1999
2036
|
"type": {
|
|
2000
|
-
"text": "
|
|
2037
|
+
"text": "Array<ICommandMenuAction>"
|
|
2001
2038
|
},
|
|
2002
|
-
"
|
|
2003
|
-
"
|
|
2004
|
-
"attribute": "label",
|
|
2005
|
-
"inheritedFrom": {
|
|
2006
|
-
"name": "FormAssociatedMixin",
|
|
2007
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2008
|
-
}
|
|
2039
|
+
"privacy": "private",
|
|
2040
|
+
"default": "[]"
|
|
2009
2041
|
},
|
|
2010
2042
|
{
|
|
2011
2043
|
"kind": "field",
|
|
2012
|
-
"name": "
|
|
2044
|
+
"name": "selected",
|
|
2013
2045
|
"type": {
|
|
2014
|
-
"text": "
|
|
2046
|
+
"text": "ICommandMenuAction"
|
|
2015
2047
|
},
|
|
2016
|
-
"
|
|
2017
|
-
"attribute": "hint",
|
|
2018
|
-
"inheritedFrom": {
|
|
2019
|
-
"name": "FormAssociatedMixin",
|
|
2020
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2021
|
-
}
|
|
2048
|
+
"privacy": "private"
|
|
2022
2049
|
},
|
|
2023
2050
|
{
|
|
2024
|
-
"kind": "
|
|
2025
|
-
"name": "
|
|
2026
|
-
"
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2051
|
+
"kind": "method",
|
|
2052
|
+
"name": "show",
|
|
2053
|
+
"parameters": [
|
|
2054
|
+
{
|
|
2055
|
+
"name": "options",
|
|
2056
|
+
"default": "{}",
|
|
2057
|
+
"type": {
|
|
2058
|
+
"text": "{ parent?: string }"
|
|
2059
|
+
},
|
|
2060
|
+
"description": "allows you to open the menu filtered to a specific parent command."
|
|
2061
|
+
}
|
|
2062
|
+
],
|
|
2063
|
+
"description": "Show the command menu programmatically."
|
|
2036
2064
|
},
|
|
2037
2065
|
{
|
|
2038
|
-
"kind": "
|
|
2039
|
-
"name": "
|
|
2040
|
-
"
|
|
2041
|
-
"text": "string | undefined"
|
|
2042
|
-
},
|
|
2043
|
-
"description": "Placeholder text to display within the input.",
|
|
2044
|
-
"attribute": "placeholder",
|
|
2045
|
-
"inheritedFrom": {
|
|
2046
|
-
"name": "FormAssociatedMixin",
|
|
2047
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2048
|
-
}
|
|
2066
|
+
"kind": "method",
|
|
2067
|
+
"name": "close",
|
|
2068
|
+
"description": "Close the command menu programmatically."
|
|
2049
2069
|
},
|
|
2050
2070
|
{
|
|
2051
|
-
"kind": "
|
|
2052
|
-
"name": "
|
|
2053
|
-
"
|
|
2054
|
-
"text": "string | undefined"
|
|
2055
|
-
},
|
|
2056
|
-
"description": "Optional error to be shown with the input. Alternatively use the error slot.",
|
|
2057
|
-
"attribute": "error",
|
|
2058
|
-
"inheritedFrom": {
|
|
2059
|
-
"name": "FormAssociatedMixin",
|
|
2060
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2061
|
-
}
|
|
2071
|
+
"kind": "method",
|
|
2072
|
+
"name": "toggleOpen",
|
|
2073
|
+
"description": "Toggle the open state programmatically."
|
|
2062
2074
|
},
|
|
2063
2075
|
{
|
|
2064
|
-
"kind": "
|
|
2065
|
-
"name": "
|
|
2066
|
-
"
|
|
2067
|
-
"text": "boolean"
|
|
2068
|
-
},
|
|
2069
|
-
"default": "false",
|
|
2070
|
-
"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.",
|
|
2071
|
-
"attribute": "required",
|
|
2072
|
-
"inheritedFrom": {
|
|
2073
|
-
"name": "FormAssociatedMixin",
|
|
2074
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2075
|
-
}
|
|
2076
|
+
"kind": "method",
|
|
2077
|
+
"name": "focus",
|
|
2078
|
+
"description": "Focus the command menu's input."
|
|
2076
2079
|
},
|
|
2077
2080
|
{
|
|
2078
|
-
"kind": "
|
|
2079
|
-
"name": "
|
|
2080
|
-
"
|
|
2081
|
-
"text": "boolean"
|
|
2082
|
-
},
|
|
2083
|
-
"default": "false",
|
|
2084
|
-
"description": "Controls whether the input expands to fill the width of its container.",
|
|
2085
|
-
"attribute": "expand",
|
|
2086
|
-
"reflects": true,
|
|
2087
|
-
"inheritedFrom": {
|
|
2088
|
-
"name": "FormAssociatedMixin",
|
|
2089
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2090
|
-
}
|
|
2081
|
+
"kind": "method",
|
|
2082
|
+
"name": "renderNoResults",
|
|
2083
|
+
"privacy": "private"
|
|
2091
2084
|
},
|
|
2092
2085
|
{
|
|
2093
2086
|
"kind": "method",
|
|
2094
|
-
"name": "
|
|
2095
|
-
"privacy": "
|
|
2087
|
+
"name": "renderSection",
|
|
2088
|
+
"privacy": "private",
|
|
2096
2089
|
"parameters": [
|
|
2097
2090
|
{
|
|
2098
|
-
"name": "
|
|
2091
|
+
"name": "section",
|
|
2099
2092
|
"type": {
|
|
2100
|
-
"text": "
|
|
2093
|
+
"text": "string | undefined"
|
|
2094
|
+
}
|
|
2095
|
+
},
|
|
2096
|
+
{
|
|
2097
|
+
"name": "commands",
|
|
2098
|
+
"type": {
|
|
2099
|
+
"text": "ICommandMenuAction[]"
|
|
2101
2100
|
}
|
|
2102
2101
|
}
|
|
2103
|
-
]
|
|
2104
|
-
"inheritedFrom": {
|
|
2105
|
-
"name": "FormAssociatedMixin",
|
|
2106
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2107
|
-
}
|
|
2102
|
+
]
|
|
2108
2103
|
},
|
|
2109
2104
|
{
|
|
2110
2105
|
"kind": "method",
|
|
2111
|
-
"name": "
|
|
2112
|
-
"privacy": "
|
|
2113
|
-
"inheritedFrom": {
|
|
2114
|
-
"name": "FormAssociatedMixin",
|
|
2115
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2116
|
-
}
|
|
2106
|
+
"name": "handleAnimationEnd",
|
|
2107
|
+
"privacy": "private"
|
|
2117
2108
|
},
|
|
2118
2109
|
{
|
|
2119
2110
|
"kind": "method",
|
|
2120
|
-
"name": "
|
|
2121
|
-
"privacy": "
|
|
2122
|
-
"inheritedFrom": {
|
|
2123
|
-
"name": "FormAssociatedMixin",
|
|
2124
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2125
|
-
}
|
|
2111
|
+
"name": "handleBlur",
|
|
2112
|
+
"privacy": "private"
|
|
2126
2113
|
},
|
|
2127
2114
|
{
|
|
2128
2115
|
"kind": "method",
|
|
2129
|
-
"name": "
|
|
2130
|
-
"privacy": "
|
|
2131
|
-
"
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
"privacy": "protected",
|
|
2140
|
-
"inheritedFrom": {
|
|
2141
|
-
"name": "FormAssociatedMixin",
|
|
2142
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2143
|
-
}
|
|
2144
|
-
},
|
|
2145
|
-
{
|
|
2146
|
-
"kind": "field",
|
|
2147
|
-
"name": "hasHint",
|
|
2148
|
-
"privacy": "protected",
|
|
2149
|
-
"inheritedFrom": {
|
|
2150
|
-
"name": "FormAssociatedMixin",
|
|
2151
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2152
|
-
}
|
|
2116
|
+
"name": "handleInput",
|
|
2117
|
+
"privacy": "private",
|
|
2118
|
+
"parameters": [
|
|
2119
|
+
{
|
|
2120
|
+
"name": "event",
|
|
2121
|
+
"type": {
|
|
2122
|
+
"text": "KeyboardEvent"
|
|
2123
|
+
}
|
|
2124
|
+
}
|
|
2125
|
+
]
|
|
2153
2126
|
},
|
|
2154
2127
|
{
|
|
2155
|
-
"kind": "
|
|
2156
|
-
"name": "
|
|
2157
|
-
"privacy": "
|
|
2158
|
-
"
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2128
|
+
"kind": "method",
|
|
2129
|
+
"name": "select",
|
|
2130
|
+
"privacy": "private",
|
|
2131
|
+
"parameters": [
|
|
2132
|
+
{
|
|
2133
|
+
"name": "command",
|
|
2134
|
+
"default": "this.selected",
|
|
2135
|
+
"type": {
|
|
2136
|
+
"text": "ICommandMenuAction"
|
|
2137
|
+
}
|
|
2138
|
+
}
|
|
2139
|
+
]
|
|
2162
2140
|
},
|
|
2163
2141
|
{
|
|
2164
|
-
"kind": "
|
|
2165
|
-
"name": "
|
|
2166
|
-
"
|
|
2167
|
-
"text": "boolean"
|
|
2168
|
-
},
|
|
2169
|
-
"default": "false",
|
|
2170
|
-
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
2171
|
-
"attribute": "disabled",
|
|
2172
|
-
"reflects": true,
|
|
2173
|
-
"inheritedFrom": {
|
|
2174
|
-
"name": "InputMixin",
|
|
2175
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
2176
|
-
}
|
|
2142
|
+
"kind": "method",
|
|
2143
|
+
"name": "start",
|
|
2144
|
+
"privacy": "private"
|
|
2177
2145
|
},
|
|
2178
2146
|
{
|
|
2179
|
-
"kind": "
|
|
2180
|
-
"name": "
|
|
2181
|
-
"
|
|
2182
|
-
"text": "string | undefined"
|
|
2183
|
-
},
|
|
2184
|
-
"description": "The name of the form component.",
|
|
2185
|
-
"attribute": "name",
|
|
2186
|
-
"inheritedFrom": {
|
|
2187
|
-
"name": "InputMixin",
|
|
2188
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
2189
|
-
}
|
|
2147
|
+
"kind": "method",
|
|
2148
|
+
"name": "end",
|
|
2149
|
+
"privacy": "private"
|
|
2190
2150
|
},
|
|
2191
2151
|
{
|
|
2192
|
-
"kind": "
|
|
2193
|
-
"name": "
|
|
2194
|
-
"
|
|
2195
|
-
"text": "string"
|
|
2196
|
-
},
|
|
2197
|
-
"default": "\"\"",
|
|
2198
|
-
"description": "The value of the form component.",
|
|
2199
|
-
"attribute": "value",
|
|
2200
|
-
"inheritedFrom": {
|
|
2201
|
-
"name": "InputMixin",
|
|
2202
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
2203
|
-
}
|
|
2152
|
+
"kind": "method",
|
|
2153
|
+
"name": "next",
|
|
2154
|
+
"privacy": "private"
|
|
2204
2155
|
},
|
|
2205
2156
|
{
|
|
2206
|
-
"kind": "
|
|
2207
|
-
"name": "
|
|
2208
|
-
"privacy": "
|
|
2209
|
-
"description": "Gets the form, if any, associated with the form element.",
|
|
2210
|
-
"inheritedFrom": {
|
|
2211
|
-
"name": "InputMixin",
|
|
2212
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
2213
|
-
}
|
|
2157
|
+
"kind": "method",
|
|
2158
|
+
"name": "previous",
|
|
2159
|
+
"privacy": "private"
|
|
2214
2160
|
},
|
|
2215
2161
|
{
|
|
2216
|
-
"kind": "
|
|
2217
|
-
"name": "
|
|
2218
|
-
"privacy": "
|
|
2219
|
-
"inheritedFrom": {
|
|
2220
|
-
"name": "FocusableMixin",
|
|
2221
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2222
|
-
}
|
|
2162
|
+
"kind": "method",
|
|
2163
|
+
"name": "goBack",
|
|
2164
|
+
"privacy": "private"
|
|
2223
2165
|
},
|
|
2224
2166
|
{
|
|
2225
2167
|
"kind": "method",
|
|
2226
|
-
"name": "
|
|
2168
|
+
"name": "setParent",
|
|
2169
|
+
"privacy": "private",
|
|
2227
2170
|
"parameters": [
|
|
2228
2171
|
{
|
|
2229
|
-
"name": "
|
|
2172
|
+
"name": "parent",
|
|
2230
2173
|
"optional": true,
|
|
2231
2174
|
"type": {
|
|
2232
|
-
"text": "
|
|
2233
|
-
}
|
|
2234
|
-
"description": "An object which controls aspects of the focusing process."
|
|
2175
|
+
"text": "string"
|
|
2176
|
+
}
|
|
2235
2177
|
}
|
|
2236
|
-
]
|
|
2237
|
-
"description": "Programmatically move focus to the component.",
|
|
2238
|
-
"inheritedFrom": {
|
|
2239
|
-
"name": "FocusableMixin",
|
|
2240
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2241
|
-
}
|
|
2178
|
+
]
|
|
2242
2179
|
},
|
|
2243
2180
|
{
|
|
2244
2181
|
"kind": "method",
|
|
2245
|
-
"name": "
|
|
2246
|
-
"
|
|
2247
|
-
"
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2182
|
+
"name": "setSearch",
|
|
2183
|
+
"privacy": "private",
|
|
2184
|
+
"parameters": [
|
|
2185
|
+
{
|
|
2186
|
+
"name": "str",
|
|
2187
|
+
"type": {
|
|
2188
|
+
"text": "string"
|
|
2189
|
+
}
|
|
2190
|
+
}
|
|
2191
|
+
]
|
|
2251
2192
|
},
|
|
2252
2193
|
{
|
|
2253
2194
|
"kind": "method",
|
|
2254
|
-
"name": "
|
|
2255
|
-
"
|
|
2256
|
-
"inheritedFrom": {
|
|
2257
|
-
"name": "FocusableMixin",
|
|
2258
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2259
|
-
}
|
|
2195
|
+
"name": "filterCommands",
|
|
2196
|
+
"privacy": "private"
|
|
2260
2197
|
},
|
|
2261
2198
|
{
|
|
2262
2199
|
"kind": "field",
|
|
@@ -2273,214 +2210,285 @@
|
|
|
2273
2210
|
}
|
|
2274
2211
|
}
|
|
2275
2212
|
],
|
|
2276
|
-
"
|
|
2213
|
+
"events": [
|
|
2277
2214
|
{
|
|
2278
|
-
"name": "
|
|
2215
|
+
"name": "open",
|
|
2279
2216
|
"type": {
|
|
2280
|
-
"text": "
|
|
2217
|
+
"text": "NordEvent"
|
|
2281
2218
|
},
|
|
2282
|
-
"
|
|
2283
|
-
"description": "Controls whether the checkbox is checked or not.",
|
|
2284
|
-
"fieldName": "checked"
|
|
2219
|
+
"description": "The command menu was opened."
|
|
2285
2220
|
},
|
|
2286
2221
|
{
|
|
2287
|
-
"name": "
|
|
2222
|
+
"name": "close",
|
|
2288
2223
|
"type": {
|
|
2289
|
-
"text": "
|
|
2224
|
+
"text": "NordEvent"
|
|
2290
2225
|
},
|
|
2291
|
-
"
|
|
2292
|
-
"description": "Label for the input.",
|
|
2293
|
-
"fieldName": "label",
|
|
2294
|
-
"inheritedFrom": {
|
|
2295
|
-
"name": "FormAssociatedMixin",
|
|
2296
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2297
|
-
}
|
|
2226
|
+
"description": "The command menu was closed."
|
|
2298
2227
|
},
|
|
2299
2228
|
{
|
|
2300
|
-
"name": "hint",
|
|
2301
2229
|
"type": {
|
|
2302
|
-
"text": "
|
|
2230
|
+
"text": "SelectEvent"
|
|
2303
2231
|
},
|
|
2304
|
-
"description": "
|
|
2305
|
-
"
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
}
|
|
2310
|
-
},
|
|
2232
|
+
"description": "User selected a command from the menu.",
|
|
2233
|
+
"name": "nord-select"
|
|
2234
|
+
}
|
|
2235
|
+
],
|
|
2236
|
+
"attributes": [
|
|
2311
2237
|
{
|
|
2312
|
-
"name": "
|
|
2238
|
+
"name": "open",
|
|
2313
2239
|
"type": {
|
|
2314
2240
|
"text": "boolean"
|
|
2315
2241
|
},
|
|
2316
2242
|
"default": "false",
|
|
2317
|
-
"description": "
|
|
2318
|
-
"fieldName": "
|
|
2319
|
-
"inheritedFrom": {
|
|
2320
|
-
"name": "FormAssociatedMixin",
|
|
2321
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2322
|
-
}
|
|
2243
|
+
"description": "Show or hide the command menu.",
|
|
2244
|
+
"fieldName": "open"
|
|
2323
2245
|
},
|
|
2324
2246
|
{
|
|
2325
2247
|
"name": "placeholder",
|
|
2326
2248
|
"type": {
|
|
2327
|
-
"text": "string
|
|
2249
|
+
"text": "string"
|
|
2328
2250
|
},
|
|
2329
|
-
"
|
|
2330
|
-
"
|
|
2331
|
-
"
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
},
|
|
2251
|
+
"default": "\"Type a command or search...\"",
|
|
2252
|
+
"description": "Hint text to display in the Command Menu search field.",
|
|
2253
|
+
"fieldName": "placeholder"
|
|
2254
|
+
}
|
|
2255
|
+
],
|
|
2256
|
+
"mixins": [
|
|
2336
2257
|
{
|
|
2337
|
-
"name": "
|
|
2258
|
+
"name": "DraftComponentMixin",
|
|
2259
|
+
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
2260
|
+
}
|
|
2261
|
+
],
|
|
2262
|
+
"superclass": {
|
|
2263
|
+
"name": "LitElement",
|
|
2264
|
+
"package": "lit"
|
|
2265
|
+
},
|
|
2266
|
+
"status": "draft",
|
|
2267
|
+
"category": "action",
|
|
2268
|
+
"tagName": "nord-command-menu",
|
|
2269
|
+
"customElement": true
|
|
2270
|
+
}
|
|
2271
|
+
],
|
|
2272
|
+
"exports": [
|
|
2273
|
+
{
|
|
2274
|
+
"kind": "js",
|
|
2275
|
+
"name": "default",
|
|
2276
|
+
"declaration": {
|
|
2277
|
+
"name": "CommandMenu",
|
|
2278
|
+
"module": "src/command-menu/CommandMenu.ts"
|
|
2279
|
+
}
|
|
2280
|
+
},
|
|
2281
|
+
{
|
|
2282
|
+
"kind": "custom-element-definition",
|
|
2283
|
+
"name": "nord-command-menu",
|
|
2284
|
+
"declaration": {
|
|
2285
|
+
"name": "CommandMenu",
|
|
2286
|
+
"module": "src/command-menu/CommandMenu.ts"
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
],
|
|
2290
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
2291
|
+
},
|
|
2292
|
+
{
|
|
2293
|
+
"kind": "javascript-module",
|
|
2294
|
+
"path": "src/command-menu/CommandMenuAction.ts",
|
|
2295
|
+
"declarations": [
|
|
2296
|
+
{
|
|
2297
|
+
"kind": "class",
|
|
2298
|
+
"description": "Command Menu Action displays a single action that can be executed by the user. For usage examples, please see Command Menu component.",
|
|
2299
|
+
"name": "CommandMenuAction",
|
|
2300
|
+
"members": [
|
|
2301
|
+
{
|
|
2302
|
+
"kind": "field",
|
|
2303
|
+
"name": "command",
|
|
2338
2304
|
"type": {
|
|
2339
|
-
"text": "
|
|
2305
|
+
"text": "ICommandMenuAction"
|
|
2340
2306
|
},
|
|
2341
|
-
"
|
|
2342
|
-
"fieldName": "error",
|
|
2343
|
-
"inheritedFrom": {
|
|
2344
|
-
"name": "FormAssociatedMixin",
|
|
2345
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2346
|
-
}
|
|
2307
|
+
"attribute": "command"
|
|
2347
2308
|
},
|
|
2348
2309
|
{
|
|
2349
|
-
"
|
|
2310
|
+
"kind": "field",
|
|
2311
|
+
"name": "selected",
|
|
2350
2312
|
"type": {
|
|
2351
2313
|
"text": "boolean"
|
|
2352
2314
|
},
|
|
2353
2315
|
"default": "false",
|
|
2354
|
-
"
|
|
2355
|
-
"fieldName": "required",
|
|
2356
|
-
"inheritedFrom": {
|
|
2357
|
-
"name": "FormAssociatedMixin",
|
|
2358
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2359
|
-
}
|
|
2316
|
+
"attribute": "selected"
|
|
2360
2317
|
},
|
|
2361
2318
|
{
|
|
2362
|
-
"
|
|
2319
|
+
"kind": "method",
|
|
2320
|
+
"name": "ensureInView",
|
|
2321
|
+
"privacy": "private",
|
|
2322
|
+
"description": "Scroll to show element"
|
|
2323
|
+
},
|
|
2324
|
+
{
|
|
2325
|
+
"kind": "method",
|
|
2326
|
+
"name": "renderShortcut",
|
|
2327
|
+
"privacy": "private"
|
|
2328
|
+
}
|
|
2329
|
+
],
|
|
2330
|
+
"attributes": [
|
|
2331
|
+
{
|
|
2332
|
+
"name": "command",
|
|
2363
2333
|
"type": {
|
|
2364
|
-
"text": "
|
|
2334
|
+
"text": "ICommandMenuAction"
|
|
2365
2335
|
},
|
|
2366
|
-
"
|
|
2367
|
-
"description": "Controls whether the input expands to fill the width of its container.",
|
|
2368
|
-
"fieldName": "expand",
|
|
2369
|
-
"inheritedFrom": {
|
|
2370
|
-
"name": "FormAssociatedMixin",
|
|
2371
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2372
|
-
}
|
|
2336
|
+
"fieldName": "command"
|
|
2373
2337
|
},
|
|
2374
2338
|
{
|
|
2375
|
-
"name": "
|
|
2339
|
+
"name": "selected",
|
|
2376
2340
|
"type": {
|
|
2377
2341
|
"text": "boolean"
|
|
2378
2342
|
},
|
|
2379
2343
|
"default": "false",
|
|
2380
|
-
"
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2344
|
+
"fieldName": "selected"
|
|
2345
|
+
}
|
|
2346
|
+
],
|
|
2347
|
+
"superclass": {
|
|
2348
|
+
"name": "LitElement",
|
|
2349
|
+
"package": "lit"
|
|
2350
|
+
},
|
|
2351
|
+
"status": "internal",
|
|
2352
|
+
"category": null,
|
|
2353
|
+
"tagName": "nord-command-menu-action",
|
|
2354
|
+
"customElement": true
|
|
2355
|
+
}
|
|
2356
|
+
],
|
|
2357
|
+
"exports": [
|
|
2358
|
+
{
|
|
2359
|
+
"kind": "js",
|
|
2360
|
+
"name": "default",
|
|
2361
|
+
"declaration": {
|
|
2362
|
+
"name": "CommandMenuAction",
|
|
2363
|
+
"module": "src/command-menu/CommandMenuAction.ts"
|
|
2364
|
+
}
|
|
2365
|
+
},
|
|
2366
|
+
{
|
|
2367
|
+
"kind": "custom-element-definition",
|
|
2368
|
+
"name": "nord-command-menu-action",
|
|
2369
|
+
"declaration": {
|
|
2370
|
+
"name": "CommandMenuAction",
|
|
2371
|
+
"module": "src/command-menu/CommandMenuAction.ts"
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
],
|
|
2375
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
2376
|
+
},
|
|
2377
|
+
{
|
|
2378
|
+
"kind": "javascript-module",
|
|
2379
|
+
"path": "src/command-menu/ICommandMenuAction.ts",
|
|
2380
|
+
"declarations": [],
|
|
2381
|
+
"exports": [],
|
|
2382
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
2383
|
+
},
|
|
2384
|
+
{
|
|
2385
|
+
"kind": "javascript-module",
|
|
2386
|
+
"path": "src/command-menu/KeyboardController.ts",
|
|
2387
|
+
"declarations": [
|
|
2388
|
+
{
|
|
2389
|
+
"kind": "class",
|
|
2390
|
+
"description": "",
|
|
2391
|
+
"name": "KeyboardController",
|
|
2392
|
+
"members": [
|
|
2387
2393
|
{
|
|
2388
|
-
"
|
|
2394
|
+
"kind": "field",
|
|
2395
|
+
"name": "host",
|
|
2389
2396
|
"type": {
|
|
2390
|
-
"text": "
|
|
2397
|
+
"text": "CommandMenu"
|
|
2391
2398
|
},
|
|
2392
|
-
"
|
|
2393
|
-
"
|
|
2394
|
-
"inheritedFrom": {
|
|
2395
|
-
"name": "InputMixin",
|
|
2396
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
2397
|
-
}
|
|
2399
|
+
"privacy": "private",
|
|
2400
|
+
"default": "host"
|
|
2398
2401
|
},
|
|
2399
2402
|
{
|
|
2400
|
-
"
|
|
2403
|
+
"kind": "field",
|
|
2404
|
+
"name": "globalShortcuts",
|
|
2401
2405
|
"type": {
|
|
2402
|
-
"text": "
|
|
2406
|
+
"text": "ShortcutController"
|
|
2403
2407
|
},
|
|
2404
|
-
"
|
|
2405
|
-
"
|
|
2406
|
-
"fieldName": "value",
|
|
2407
|
-
"inheritedFrom": {
|
|
2408
|
-
"name": "InputMixin",
|
|
2409
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
2410
|
-
}
|
|
2411
|
-
}
|
|
2412
|
-
],
|
|
2413
|
-
"mixins": [
|
|
2414
|
-
{
|
|
2415
|
-
"name": "FormAssociatedMixin",
|
|
2416
|
-
"module": "/src/common/mixins/FormAssociatedMixin.js"
|
|
2408
|
+
"privacy": "private",
|
|
2409
|
+
"default": "new ShortcutController(host, { \"$mod+k\": preventDefault(actions.toggleOpen) })"
|
|
2417
2410
|
},
|
|
2418
2411
|
{
|
|
2419
|
-
"
|
|
2420
|
-
"
|
|
2412
|
+
"kind": "field",
|
|
2413
|
+
"name": "navigationShortcuts",
|
|
2414
|
+
"type": {
|
|
2415
|
+
"text": "ShortcutController"
|
|
2416
|
+
},
|
|
2417
|
+
"privacy": "private",
|
|
2418
|
+
"default": "new ShortcutController(\n host,\n {\n Enter: preventDefault(actions.trigger),\n Backspace: actions.goBack, // we don't want to prevent default, since that would stop backspace deleting chars\n End: preventDefault(actions.end),\n Home: preventDefault(actions.start),\n ArrowDown: preventDefault(actions.next),\n ArrowUp: preventDefault(actions.previous),\n },\n host\n )"
|
|
2421
2419
|
},
|
|
2422
2420
|
{
|
|
2423
|
-
"
|
|
2424
|
-
"
|
|
2421
|
+
"kind": "field",
|
|
2422
|
+
"name": "commandShortcuts",
|
|
2423
|
+
"type": {
|
|
2424
|
+
"text": "ShortcutController"
|
|
2425
|
+
},
|
|
2426
|
+
"privacy": "private",
|
|
2427
|
+
"default": "new ShortcutController(host)"
|
|
2425
2428
|
},
|
|
2426
2429
|
{
|
|
2427
|
-
"
|
|
2428
|
-
"
|
|
2430
|
+
"kind": "method",
|
|
2431
|
+
"name": "registerCommandShortcuts"
|
|
2429
2432
|
}
|
|
2430
|
-
]
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
"
|
|
2436
|
-
"
|
|
2437
|
-
"
|
|
2438
|
-
|
|
2439
|
-
|
|
2433
|
+
]
|
|
2434
|
+
}
|
|
2435
|
+
],
|
|
2436
|
+
"exports": [
|
|
2437
|
+
{
|
|
2438
|
+
"kind": "js",
|
|
2439
|
+
"name": "KeyboardController",
|
|
2440
|
+
"declaration": {
|
|
2441
|
+
"name": "KeyboardController",
|
|
2442
|
+
"module": "src/command-menu/KeyboardController.ts"
|
|
2443
|
+
}
|
|
2444
|
+
}
|
|
2445
|
+
],
|
|
2446
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
2447
|
+
},
|
|
2448
|
+
{
|
|
2449
|
+
"kind": "javascript-module",
|
|
2450
|
+
"path": "src/command-menu/SelectEvent.ts",
|
|
2451
|
+
"declarations": [
|
|
2452
|
+
{
|
|
2453
|
+
"kind": "class",
|
|
2454
|
+
"description": "",
|
|
2455
|
+
"name": "SelectEvent",
|
|
2456
|
+
"members": [
|
|
2440
2457
|
{
|
|
2441
|
-
"
|
|
2458
|
+
"kind": "field",
|
|
2459
|
+
"name": "eventName",
|
|
2442
2460
|
"type": {
|
|
2443
|
-
"text": "
|
|
2461
|
+
"text": "string"
|
|
2444
2462
|
},
|
|
2445
|
-
"
|
|
2446
|
-
"
|
|
2447
|
-
"name": "FormAssociatedMixin",
|
|
2448
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2449
|
-
}
|
|
2463
|
+
"static": true,
|
|
2464
|
+
"default": "\"nord-select\""
|
|
2450
2465
|
},
|
|
2451
2466
|
{
|
|
2452
|
-
"
|
|
2467
|
+
"kind": "field",
|
|
2468
|
+
"name": "command",
|
|
2453
2469
|
"type": {
|
|
2454
|
-
"text": "
|
|
2470
|
+
"text": "ICommandMenuAction"
|
|
2455
2471
|
},
|
|
2456
|
-
"
|
|
2457
|
-
"inheritedFrom": {
|
|
2458
|
-
"name": "FormAssociatedMixin",
|
|
2459
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2460
|
-
}
|
|
2472
|
+
"default": "command"
|
|
2461
2473
|
}
|
|
2462
|
-
]
|
|
2474
|
+
],
|
|
2475
|
+
"superclass": {
|
|
2476
|
+
"name": "NordEvent",
|
|
2477
|
+
"module": "/src/common/events.js"
|
|
2478
|
+
}
|
|
2463
2479
|
}
|
|
2464
2480
|
],
|
|
2465
2481
|
"exports": [
|
|
2466
2482
|
{
|
|
2467
2483
|
"kind": "js",
|
|
2468
|
-
"name": "
|
|
2469
|
-
"declaration": {
|
|
2470
|
-
"name": "Checkbox",
|
|
2471
|
-
"module": "src/checkbox/Checkbox.ts"
|
|
2472
|
-
}
|
|
2473
|
-
},
|
|
2474
|
-
{
|
|
2475
|
-
"kind": "custom-element-definition",
|
|
2476
|
-
"name": "nord-checkbox",
|
|
2484
|
+
"name": "SelectEvent",
|
|
2477
2485
|
"declaration": {
|
|
2478
|
-
"name": "
|
|
2479
|
-
"module": "src/
|
|
2486
|
+
"name": "SelectEvent",
|
|
2487
|
+
"module": "src/command-menu/SelectEvent.ts"
|
|
2480
2488
|
}
|
|
2481
2489
|
}
|
|
2482
2490
|
],
|
|
2483
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use for making it possible to choose one or more options from a limited number of options.\n- Use for “accepting terms of service” and similar functionality.\n- Use in forms to toggle something on or off.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use when you have more than 10 options to choose from.\n- Don’t change the selection of another checkbox when another one is clicked. Only exception is when a checkbox is used to make a bulk selection of multiple items.\n\n</div>\n\n---\n\n## Content guidelines\n\nCheckbox labels should be clear, accurate and predictable. It should be possible for the user to understand what they are selecting:\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">Option 1</div>\n\nWhen writing checkbox labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">User Settings</div>\n\nAvoid ending in punctuation if it’s a single sentence, word, or a fragment:\n\n<div class=\"n-usage n-usage-do\">Show dashboard</div>\n<div class=\"n-usage n-usage-dont\">Show dashboard.</div>\n\nDo not use commas or semicolons at the end of each line\n\n<div class=\"n-usage n-usage-do\">Patients</div>\n<div class=\"n-usage n-usage-dont\">Patients;</div>\n"
|
|
2491
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
2484
2492
|
},
|
|
2485
2493
|
{
|
|
2486
2494
|
"kind": "javascript-module",
|
|
@@ -4350,6 +4358,72 @@
|
|
|
4350
4358
|
],
|
|
4351
4359
|
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use to choose a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nDate picker is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Choose date button\n\n- `Space, Enter`: Opens the date picker dialog and moves focus to the first select menu in the dialog.\n\n### Date picker dialog\n\n- `Esc`: Closes the date picker dialog and moves focus back to the “choose date” button.\n- `Tab`: Moves focus to the next element in the dialog. Please note since the calendar uses `role=\"grid\"`, only one button in the calendar grid is in the tab sequence. Additionally, if focus is on the last focusable element, focus is next moved back to the first focusable element inside the date picker dialog.\n- `Shift + Tab`: Same as above, but in reverse order.\n\n### Date picker dialog: Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Date picker dialog: Date grid\n\n- `Space, Enter`: Selects a date, closes the dialog, and moves focus back to the “Choose Date” button. Additionally updates the value of the date picker input with the selected date, and adds selected date to “Choose Date” button label.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n\n#### Date picker dialog: Close button\n\n- `Space, Enter`: Closes the dialog, moves focus to “choose date” button, but does not update the date in input.\n"
|
|
4352
4360
|
},
|
|
4361
|
+
{
|
|
4362
|
+
"kind": "javascript-module",
|
|
4363
|
+
"path": "src/empty-state/EmptyState.ts",
|
|
4364
|
+
"declarations": [
|
|
4365
|
+
{
|
|
4366
|
+
"kind": "class",
|
|
4367
|
+
"description": "Empty state can be used when there is no data to display to\ndescribe what the user can do next. Empty state should provide\nexplanation or guidance to help user progress.",
|
|
4368
|
+
"name": "EmptyState",
|
|
4369
|
+
"slots": [
|
|
4370
|
+
{
|
|
4371
|
+
"description": "default slot",
|
|
4372
|
+
"name": ""
|
|
4373
|
+
}
|
|
4374
|
+
],
|
|
4375
|
+
"members": [
|
|
4376
|
+
{
|
|
4377
|
+
"kind": "field",
|
|
4378
|
+
"name": "_warningLogged",
|
|
4379
|
+
"type": {
|
|
4380
|
+
"text": "boolean"
|
|
4381
|
+
},
|
|
4382
|
+
"privacy": "private",
|
|
4383
|
+
"static": true,
|
|
4384
|
+
"default": "false",
|
|
4385
|
+
"inheritedFrom": {
|
|
4386
|
+
"name": "DraftComponentMixin",
|
|
4387
|
+
"module": "src/common/mixins/DraftComponentMixin.ts"
|
|
4388
|
+
}
|
|
4389
|
+
}
|
|
4390
|
+
],
|
|
4391
|
+
"mixins": [
|
|
4392
|
+
{
|
|
4393
|
+
"name": "DraftComponentMixin",
|
|
4394
|
+
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
4395
|
+
}
|
|
4396
|
+
],
|
|
4397
|
+
"superclass": {
|
|
4398
|
+
"name": "LitElement",
|
|
4399
|
+
"package": "lit"
|
|
4400
|
+
},
|
|
4401
|
+
"status": "draft",
|
|
4402
|
+
"category": "feedback",
|
|
4403
|
+
"tagName": "nord-empty-state",
|
|
4404
|
+
"customElement": true
|
|
4405
|
+
}
|
|
4406
|
+
],
|
|
4407
|
+
"exports": [
|
|
4408
|
+
{
|
|
4409
|
+
"kind": "js",
|
|
4410
|
+
"name": "default",
|
|
4411
|
+
"declaration": {
|
|
4412
|
+
"name": "EmptyState",
|
|
4413
|
+
"module": "src/empty-state/EmptyState.ts"
|
|
4414
|
+
}
|
|
4415
|
+
},
|
|
4416
|
+
{
|
|
4417
|
+
"kind": "custom-element-definition",
|
|
4418
|
+
"name": "nord-empty-state",
|
|
4419
|
+
"declaration": {
|
|
4420
|
+
"name": "EmptyState",
|
|
4421
|
+
"module": "src/empty-state/EmptyState.ts"
|
|
4422
|
+
}
|
|
4423
|
+
}
|
|
4424
|
+
],
|
|
4425
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when another component or part of UI has no items or data to show.\n- Help users by clearly explaining the benefit and utility of a product or feature.\n- Be encouraging and never make users feel unsuccessful or guilty.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use as a generic banner to highlight specific content.\n\n</div>\n\n---\n\n## Content guidelines\n\nEmpty state headings should state to the user what’s wrong or why there’s no content:\n\n<div class=\"n-usage n-usage-do\">No results found</div>\n<div class=\"n-usage n-usage-dont\">Error</div>\n\nWhen writing empty state headings, 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\">You don’t have access to this content</div>\n<div class=\"n-usage n-usage-dont\">You Don’t Have Access To This Content</div>\n\nDescriptions in empty states should add useful and relevant additional information:\n\n<div class=\"n-usage n-usage-do\">We were unable to connect to the service. Click Retry to try again or View log to learn what happened.</div>\n<div class=\"n-usage n-usage-dont\">No connection.</div>\n\nButton labels should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they click a button:\n\n<div class=\"n-usage n-usage-do\">Clear filters</div>\n<div class=\"n-usage n-usage-dont\">Clear</div>\n\nWhen writing button labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">View log</div>\n<div class=\"n-usage n-usage-dont\">View Log</div>\n\nAvoid unnecessary words and articles in button labels, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Request access</div>\n<div class=\"n-usage n-usage-dont\">Request an access</div>\n"
|
|
4426
|
+
},
|
|
4353
4427
|
{
|
|
4354
4428
|
"kind": "javascript-module",
|
|
4355
4429
|
"path": "src/fieldset/Fieldset.ts",
|
|
@@ -4501,6 +4575,82 @@
|
|
|
4501
4575
|
],
|
|
4502
4576
|
"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 fieldset component when you need to create a relationship between multiple form inputs.\n- It is especially important to use with a group of radio components.\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 with a checkbox component when there is **only one** checkbox. For example, when accepting terms and conditions.\n\n</div>\n\n-------\n\n## Content guidelines\n\nFieldset label should be clear, accurate and predictable. It should help the user to understand how the items in the fieldset are grouped together, or what kind of choice the user is making:\n\n<div class=\"n-usage n-usage-do\">Pick a color</div>\n<div class=\"n-usage n-usage-dont\">Choose</div>\n\nWhen writing fieldset 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\">Pick a color</div>\n<div class=\"n-usage n-usage-dont\">Pick A Color</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\">Pick a color</div>\n<div class=\"n-usage n-usage-dont\">Pick a color.</div>\n\nDo not use colons in fieldset label:\n\n<div class=\"n-usage n-usage-do\">Payment details</div>\n<div class=\"n-usage n-usage-dont\">Payment details:</div>\n\n-------\n\n## Additional considerations\n\n- A label (which becomes to `<legend>` inside the fieldset) is always required.\n- Hint text can be used to offer further information or explanation for an option.\n"
|
|
4503
4577
|
},
|
|
4578
|
+
{
|
|
4579
|
+
"kind": "javascript-module",
|
|
4580
|
+
"path": "src/header/Header.ts",
|
|
4581
|
+
"declarations": [
|
|
4582
|
+
{
|
|
4583
|
+
"kind": "class",
|
|
4584
|
+
"description": "The header is a block of designated space for labelling the currently\nviewed context as well as providing primary actions.",
|
|
4585
|
+
"name": "Header",
|
|
4586
|
+
"slots": [
|
|
4587
|
+
{
|
|
4588
|
+
"description": "The header content.",
|
|
4589
|
+
"name": ""
|
|
4590
|
+
},
|
|
4591
|
+
{
|
|
4592
|
+
"description": "Optional slot for buttons, toggles, etc.",
|
|
4593
|
+
"name": "action"
|
|
4594
|
+
}
|
|
4595
|
+
],
|
|
4596
|
+
"members": [
|
|
4597
|
+
{
|
|
4598
|
+
"kind": "field",
|
|
4599
|
+
"name": "actionSlot",
|
|
4600
|
+
"privacy": "private",
|
|
4601
|
+
"default": "new SlotController(this, \"action\")"
|
|
4602
|
+
},
|
|
4603
|
+
{
|
|
4604
|
+
"kind": "field",
|
|
4605
|
+
"name": "_warningLogged",
|
|
4606
|
+
"type": {
|
|
4607
|
+
"text": "boolean"
|
|
4608
|
+
},
|
|
4609
|
+
"privacy": "private",
|
|
4610
|
+
"static": true,
|
|
4611
|
+
"default": "false",
|
|
4612
|
+
"inheritedFrom": {
|
|
4613
|
+
"name": "DraftComponentMixin",
|
|
4614
|
+
"module": "src/common/mixins/DraftComponentMixin.ts"
|
|
4615
|
+
}
|
|
4616
|
+
}
|
|
4617
|
+
],
|
|
4618
|
+
"mixins": [
|
|
4619
|
+
{
|
|
4620
|
+
"name": "DraftComponentMixin",
|
|
4621
|
+
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
4622
|
+
}
|
|
4623
|
+
],
|
|
4624
|
+
"superclass": {
|
|
4625
|
+
"name": "LitElement",
|
|
4626
|
+
"package": "lit"
|
|
4627
|
+
},
|
|
4628
|
+
"status": "draft",
|
|
4629
|
+
"category": "structure",
|
|
4630
|
+
"tagName": "nord-header",
|
|
4631
|
+
"customElement": true
|
|
4632
|
+
}
|
|
4633
|
+
],
|
|
4634
|
+
"exports": [
|
|
4635
|
+
{
|
|
4636
|
+
"kind": "js",
|
|
4637
|
+
"name": "default",
|
|
4638
|
+
"declaration": {
|
|
4639
|
+
"name": "Header",
|
|
4640
|
+
"module": "src/header/Header.ts"
|
|
4641
|
+
}
|
|
4642
|
+
},
|
|
4643
|
+
{
|
|
4644
|
+
"kind": "custom-element-definition",
|
|
4645
|
+
"name": "nord-header",
|
|
4646
|
+
"declaration": {
|
|
4647
|
+
"name": "Header",
|
|
4648
|
+
"module": "src/header/Header.ts"
|
|
4649
|
+
}
|
|
4650
|
+
}
|
|
4651
|
+
],
|
|
4652
|
+
"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\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\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"
|
|
4653
|
+
},
|
|
4504
4654
|
{
|
|
4505
4655
|
"kind": "javascript-module",
|
|
4506
4656
|
"path": "src/icon/Icon.ts",
|
|
@@ -4756,82 +4906,6 @@
|
|
|
4756
4906
|
],
|
|
4757
4907
|
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide additional meaning in addition to a text label.\n- Use to help users who have difficulties with reading and attention.\n- Use in places where text label doesn’t fit (remember to add an accessible label for the icon).\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for decorative purposes alone.\n- Don’t use when a button’s action is already clear based on the text label.\n- Don’t use the same icon for differing purposes, as users will come to associate icons with specific types of actions.\n\n</div>\n\n---\n\n## Additional considerations\n\n- Icon components are hidden from assistive technologies by default.\n- Use `label` property to give an accessible label for the icon and to make it visible to assistive technologies.\n"
|
|
4758
4908
|
},
|
|
4759
|
-
{
|
|
4760
|
-
"kind": "javascript-module",
|
|
4761
|
-
"path": "src/header/Header.ts",
|
|
4762
|
-
"declarations": [
|
|
4763
|
-
{
|
|
4764
|
-
"kind": "class",
|
|
4765
|
-
"description": "The header is a block of designated space for labelling the currently\nviewed context as well as providing primary actions.",
|
|
4766
|
-
"name": "Header",
|
|
4767
|
-
"slots": [
|
|
4768
|
-
{
|
|
4769
|
-
"description": "The header content.",
|
|
4770
|
-
"name": ""
|
|
4771
|
-
},
|
|
4772
|
-
{
|
|
4773
|
-
"description": "Optional slot for buttons, toggles, etc.",
|
|
4774
|
-
"name": "action"
|
|
4775
|
-
}
|
|
4776
|
-
],
|
|
4777
|
-
"members": [
|
|
4778
|
-
{
|
|
4779
|
-
"kind": "field",
|
|
4780
|
-
"name": "actionSlot",
|
|
4781
|
-
"privacy": "private",
|
|
4782
|
-
"default": "new SlotController(this, \"action\")"
|
|
4783
|
-
},
|
|
4784
|
-
{
|
|
4785
|
-
"kind": "field",
|
|
4786
|
-
"name": "_warningLogged",
|
|
4787
|
-
"type": {
|
|
4788
|
-
"text": "boolean"
|
|
4789
|
-
},
|
|
4790
|
-
"privacy": "private",
|
|
4791
|
-
"static": true,
|
|
4792
|
-
"default": "false",
|
|
4793
|
-
"inheritedFrom": {
|
|
4794
|
-
"name": "DraftComponentMixin",
|
|
4795
|
-
"module": "src/common/mixins/DraftComponentMixin.ts"
|
|
4796
|
-
}
|
|
4797
|
-
}
|
|
4798
|
-
],
|
|
4799
|
-
"mixins": [
|
|
4800
|
-
{
|
|
4801
|
-
"name": "DraftComponentMixin",
|
|
4802
|
-
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
4803
|
-
}
|
|
4804
|
-
],
|
|
4805
|
-
"superclass": {
|
|
4806
|
-
"name": "LitElement",
|
|
4807
|
-
"package": "lit"
|
|
4808
|
-
},
|
|
4809
|
-
"status": "draft",
|
|
4810
|
-
"category": "structure",
|
|
4811
|
-
"tagName": "nord-header",
|
|
4812
|
-
"customElement": true
|
|
4813
|
-
}
|
|
4814
|
-
],
|
|
4815
|
-
"exports": [
|
|
4816
|
-
{
|
|
4817
|
-
"kind": "js",
|
|
4818
|
-
"name": "default",
|
|
4819
|
-
"declaration": {
|
|
4820
|
-
"name": "Header",
|
|
4821
|
-
"module": "src/header/Header.ts"
|
|
4822
|
-
}
|
|
4823
|
-
},
|
|
4824
|
-
{
|
|
4825
|
-
"kind": "custom-element-definition",
|
|
4826
|
-
"name": "nord-header",
|
|
4827
|
-
"declaration": {
|
|
4828
|
-
"name": "Header",
|
|
4829
|
-
"module": "src/header/Header.ts"
|
|
4830
|
-
}
|
|
4831
|
-
}
|
|
4832
|
-
],
|
|
4833
|
-
"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\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\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"
|
|
4834
|
-
},
|
|
4835
4909
|
{
|
|
4836
4910
|
"kind": "javascript-module",
|
|
4837
4911
|
"path": "src/input/Input.ts",
|