@nordhealth/components 1.0.0-alpha.38 → 1.0.0-alpha.39
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 +307 -307
- package/lib/Button.js +1 -1
- package/lib/Button.js.map +1 -1
- package/lib/Input.js +1 -1
- package/lib/Input.js.map +1 -1
- package/lib/TextField-bfdc253c.js +2 -0
- package/lib/TextField-bfdc253c.js.map +1 -0
- package/lib/Textarea.js +1 -1
- package/lib/Textarea.js.map +1 -1
- package/lib/index.js +1 -1
- package/package.json +2 -2
- package/lib/TextField-afe4d64f.js +0 -2
- package/lib/TextField-afe4d64f.js.map +0 -1
package/custom-elements.json
CHANGED
|
@@ -671,6 +671,184 @@
|
|
|
671
671
|
}
|
|
672
672
|
]
|
|
673
673
|
},
|
|
674
|
+
{
|
|
675
|
+
"kind": "javascript-module",
|
|
676
|
+
"path": "src/common/collection.ts",
|
|
677
|
+
"declarations": [
|
|
678
|
+
{
|
|
679
|
+
"kind": "function",
|
|
680
|
+
"name": "groupBy",
|
|
681
|
+
"parameters": [
|
|
682
|
+
{
|
|
683
|
+
"name": "array",
|
|
684
|
+
"type": {
|
|
685
|
+
"text": "Array<TObject>"
|
|
686
|
+
},
|
|
687
|
+
"description": "the collection of objects to group"
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
"name": "key",
|
|
691
|
+
"type": {
|
|
692
|
+
"text": "TKey"
|
|
693
|
+
},
|
|
694
|
+
"description": "the property to group by"
|
|
695
|
+
}
|
|
696
|
+
],
|
|
697
|
+
"description": "Groups an array objects by property value",
|
|
698
|
+
"return": {
|
|
699
|
+
"type": {
|
|
700
|
+
"text": ""
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
],
|
|
705
|
+
"exports": [
|
|
706
|
+
{
|
|
707
|
+
"kind": "js",
|
|
708
|
+
"name": "groupBy",
|
|
709
|
+
"declaration": {
|
|
710
|
+
"name": "groupBy",
|
|
711
|
+
"module": "src/common/collection.ts"
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
]
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
"kind": "javascript-module",
|
|
718
|
+
"path": "src/common/events.ts",
|
|
719
|
+
"declarations": [
|
|
720
|
+
{
|
|
721
|
+
"kind": "class",
|
|
722
|
+
"description": "A base class for events which defaults to bubbling and composed",
|
|
723
|
+
"name": "NordEvent",
|
|
724
|
+
"superclass": {
|
|
725
|
+
"name": "Event",
|
|
726
|
+
"module": "src/common/events.ts"
|
|
727
|
+
},
|
|
728
|
+
"status": null,
|
|
729
|
+
"category": null
|
|
730
|
+
}
|
|
731
|
+
],
|
|
732
|
+
"exports": [
|
|
733
|
+
{
|
|
734
|
+
"kind": "js",
|
|
735
|
+
"name": "NordEvent",
|
|
736
|
+
"declaration": {
|
|
737
|
+
"name": "NordEvent",
|
|
738
|
+
"module": "src/common/events.ts"
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
]
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
"kind": "javascript-module",
|
|
745
|
+
"path": "src/common/focus.ts",
|
|
746
|
+
"declarations": [
|
|
747
|
+
{
|
|
748
|
+
"kind": "function",
|
|
749
|
+
"name": "getFocusedElement",
|
|
750
|
+
"return": {
|
|
751
|
+
"type": {
|
|
752
|
+
"text": "Element | undefined"
|
|
753
|
+
}
|
|
754
|
+
},
|
|
755
|
+
"parameters": [
|
|
756
|
+
{
|
|
757
|
+
"name": "root",
|
|
758
|
+
"type": {
|
|
759
|
+
"text": "Document | ShadowRoot"
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
],
|
|
763
|
+
"description": "Gets the currently focused element, taking shadow roots into account."
|
|
764
|
+
}
|
|
765
|
+
],
|
|
766
|
+
"exports": [
|
|
767
|
+
{
|
|
768
|
+
"kind": "js",
|
|
769
|
+
"name": "getFocusedElement",
|
|
770
|
+
"declaration": {
|
|
771
|
+
"name": "getFocusedElement",
|
|
772
|
+
"module": "src/common/focus.ts"
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
]
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
"kind": "javascript-module",
|
|
779
|
+
"path": "src/common/number.ts",
|
|
780
|
+
"declarations": [
|
|
781
|
+
{
|
|
782
|
+
"kind": "function",
|
|
783
|
+
"name": "wrap",
|
|
784
|
+
"parameters": [
|
|
785
|
+
{
|
|
786
|
+
"name": "val",
|
|
787
|
+
"type": {
|
|
788
|
+
"text": "number"
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
"name": "min",
|
|
793
|
+
"type": {
|
|
794
|
+
"text": "number"
|
|
795
|
+
}
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
"name": "max",
|
|
799
|
+
"type": {
|
|
800
|
+
"text": "number"
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
],
|
|
804
|
+
"description": "Wraps a value so that it always falls within min/max,\nwhere a value greater than max gets set to min, and vice versa"
|
|
805
|
+
}
|
|
806
|
+
],
|
|
807
|
+
"exports": [
|
|
808
|
+
{
|
|
809
|
+
"kind": "js",
|
|
810
|
+
"name": "wrap",
|
|
811
|
+
"declaration": {
|
|
812
|
+
"name": "wrap",
|
|
813
|
+
"module": "src/common/number.ts"
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
]
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
"kind": "javascript-module",
|
|
820
|
+
"path": "src/common/ref.ts",
|
|
821
|
+
"declarations": [
|
|
822
|
+
{
|
|
823
|
+
"kind": "function",
|
|
824
|
+
"name": "mergeRefs",
|
|
825
|
+
"return": {
|
|
826
|
+
"type": {
|
|
827
|
+
"text": "RefCallback"
|
|
828
|
+
}
|
|
829
|
+
},
|
|
830
|
+
"parameters": [
|
|
831
|
+
{
|
|
832
|
+
"name": "refs",
|
|
833
|
+
"type": {
|
|
834
|
+
"text": "Ref[]"
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
],
|
|
838
|
+
"description": "Creates a ref callback which will assign the element to every given ref"
|
|
839
|
+
}
|
|
840
|
+
],
|
|
841
|
+
"exports": [
|
|
842
|
+
{
|
|
843
|
+
"kind": "js",
|
|
844
|
+
"name": "mergeRefs",
|
|
845
|
+
"declaration": {
|
|
846
|
+
"name": "mergeRefs",
|
|
847
|
+
"module": "src/common/ref.ts"
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
]
|
|
851
|
+
},
|
|
674
852
|
{
|
|
675
853
|
"kind": "javascript-module",
|
|
676
854
|
"path": "src/command-menu/CommandMenu.ts",
|
|
@@ -1162,244 +1340,66 @@
|
|
|
1162
1340
|
"text": "ShortcutController"
|
|
1163
1341
|
},
|
|
1164
1342
|
"privacy": "private",
|
|
1165
|
-
"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 )"
|
|
1166
|
-
},
|
|
1167
|
-
{
|
|
1168
|
-
"kind": "field",
|
|
1169
|
-
"name": "commandShortcuts",
|
|
1170
|
-
"type": {
|
|
1171
|
-
"text": "ShortcutController"
|
|
1172
|
-
},
|
|
1173
|
-
"privacy": "private",
|
|
1174
|
-
"default": "new ShortcutController(host)"
|
|
1175
|
-
},
|
|
1176
|
-
{
|
|
1177
|
-
"kind": "method",
|
|
1178
|
-
"name": "registerCommandShortcuts"
|
|
1179
|
-
}
|
|
1180
|
-
]
|
|
1181
|
-
}
|
|
1182
|
-
],
|
|
1183
|
-
"exports": [
|
|
1184
|
-
{
|
|
1185
|
-
"kind": "js",
|
|
1186
|
-
"name": "KeyboardController",
|
|
1187
|
-
"declaration": {
|
|
1188
|
-
"name": "KeyboardController",
|
|
1189
|
-
"module": "src/command-menu/KeyboardController.ts"
|
|
1190
|
-
}
|
|
1191
|
-
}
|
|
1192
|
-
]
|
|
1193
|
-
},
|
|
1194
|
-
{
|
|
1195
|
-
"kind": "javascript-module",
|
|
1196
|
-
"path": "src/command-menu/events.ts",
|
|
1197
|
-
"declarations": [
|
|
1198
|
-
{
|
|
1199
|
-
"kind": "class",
|
|
1200
|
-
"description": "",
|
|
1201
|
-
"name": "SelectEvent",
|
|
1202
|
-
"members": [
|
|
1203
|
-
{
|
|
1204
|
-
"kind": "field",
|
|
1205
|
-
"name": "command",
|
|
1206
|
-
"type": {
|
|
1207
|
-
"text": "ICommandMenuAction"
|
|
1208
|
-
},
|
|
1209
|
-
"default": "command"
|
|
1210
|
-
}
|
|
1211
|
-
],
|
|
1212
|
-
"superclass": {
|
|
1213
|
-
"name": "NordEvent",
|
|
1214
|
-
"module": "/src/common/events.js"
|
|
1215
|
-
}
|
|
1216
|
-
}
|
|
1217
|
-
],
|
|
1218
|
-
"exports": [
|
|
1219
|
-
{
|
|
1220
|
-
"kind": "js",
|
|
1221
|
-
"name": "SelectEvent",
|
|
1222
|
-
"declaration": {
|
|
1223
|
-
"name": "SelectEvent",
|
|
1224
|
-
"module": "src/command-menu/events.ts"
|
|
1225
|
-
}
|
|
1226
|
-
}
|
|
1227
|
-
]
|
|
1228
|
-
},
|
|
1229
|
-
{
|
|
1230
|
-
"kind": "javascript-module",
|
|
1231
|
-
"path": "src/common/collection.ts",
|
|
1232
|
-
"declarations": [
|
|
1233
|
-
{
|
|
1234
|
-
"kind": "function",
|
|
1235
|
-
"name": "groupBy",
|
|
1236
|
-
"parameters": [
|
|
1237
|
-
{
|
|
1238
|
-
"name": "array",
|
|
1239
|
-
"type": {
|
|
1240
|
-
"text": "Array<TObject>"
|
|
1241
|
-
},
|
|
1242
|
-
"description": "the collection of objects to group"
|
|
1243
|
-
},
|
|
1244
|
-
{
|
|
1245
|
-
"name": "key",
|
|
1246
|
-
"type": {
|
|
1247
|
-
"text": "TKey"
|
|
1248
|
-
},
|
|
1249
|
-
"description": "the property to group by"
|
|
1250
|
-
}
|
|
1251
|
-
],
|
|
1252
|
-
"description": "Groups an array objects by property value",
|
|
1253
|
-
"return": {
|
|
1254
|
-
"type": {
|
|
1255
|
-
"text": ""
|
|
1256
|
-
}
|
|
1257
|
-
}
|
|
1258
|
-
}
|
|
1259
|
-
],
|
|
1260
|
-
"exports": [
|
|
1261
|
-
{
|
|
1262
|
-
"kind": "js",
|
|
1263
|
-
"name": "groupBy",
|
|
1264
|
-
"declaration": {
|
|
1265
|
-
"name": "groupBy",
|
|
1266
|
-
"module": "src/common/collection.ts"
|
|
1267
|
-
}
|
|
1268
|
-
}
|
|
1269
|
-
]
|
|
1270
|
-
},
|
|
1271
|
-
{
|
|
1272
|
-
"kind": "javascript-module",
|
|
1273
|
-
"path": "src/common/events.ts",
|
|
1274
|
-
"declarations": [
|
|
1275
|
-
{
|
|
1276
|
-
"kind": "class",
|
|
1277
|
-
"description": "A base class for events which defaults to bubbling and composed",
|
|
1278
|
-
"name": "NordEvent",
|
|
1279
|
-
"superclass": {
|
|
1280
|
-
"name": "Event",
|
|
1281
|
-
"module": "src/common/events.ts"
|
|
1282
|
-
},
|
|
1283
|
-
"status": null,
|
|
1284
|
-
"category": null
|
|
1285
|
-
}
|
|
1286
|
-
],
|
|
1287
|
-
"exports": [
|
|
1288
|
-
{
|
|
1289
|
-
"kind": "js",
|
|
1290
|
-
"name": "NordEvent",
|
|
1291
|
-
"declaration": {
|
|
1292
|
-
"name": "NordEvent",
|
|
1293
|
-
"module": "src/common/events.ts"
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
]
|
|
1297
|
-
},
|
|
1298
|
-
{
|
|
1299
|
-
"kind": "javascript-module",
|
|
1300
|
-
"path": "src/common/focus.ts",
|
|
1301
|
-
"declarations": [
|
|
1302
|
-
{
|
|
1303
|
-
"kind": "function",
|
|
1304
|
-
"name": "getFocusedElement",
|
|
1305
|
-
"return": {
|
|
1306
|
-
"type": {
|
|
1307
|
-
"text": "Element | undefined"
|
|
1308
|
-
}
|
|
1309
|
-
},
|
|
1310
|
-
"parameters": [
|
|
1311
|
-
{
|
|
1312
|
-
"name": "root",
|
|
1313
|
-
"type": {
|
|
1314
|
-
"text": "Document | ShadowRoot"
|
|
1315
|
-
}
|
|
1316
|
-
}
|
|
1317
|
-
],
|
|
1318
|
-
"description": "Gets the currently focused element, taking shadow roots into account."
|
|
1319
|
-
}
|
|
1320
|
-
],
|
|
1321
|
-
"exports": [
|
|
1322
|
-
{
|
|
1323
|
-
"kind": "js",
|
|
1324
|
-
"name": "getFocusedElement",
|
|
1325
|
-
"declaration": {
|
|
1326
|
-
"name": "getFocusedElement",
|
|
1327
|
-
"module": "src/common/focus.ts"
|
|
1328
|
-
}
|
|
1329
|
-
}
|
|
1330
|
-
]
|
|
1331
|
-
},
|
|
1332
|
-
{
|
|
1333
|
-
"kind": "javascript-module",
|
|
1334
|
-
"path": "src/common/number.ts",
|
|
1335
|
-
"declarations": [
|
|
1336
|
-
{
|
|
1337
|
-
"kind": "function",
|
|
1338
|
-
"name": "wrap",
|
|
1339
|
-
"parameters": [
|
|
1340
|
-
{
|
|
1341
|
-
"name": "val",
|
|
1342
|
-
"type": {
|
|
1343
|
-
"text": "number"
|
|
1344
|
-
}
|
|
1343
|
+
"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 )"
|
|
1345
1344
|
},
|
|
1346
1345
|
{
|
|
1347
|
-
"
|
|
1346
|
+
"kind": "field",
|
|
1347
|
+
"name": "commandShortcuts",
|
|
1348
1348
|
"type": {
|
|
1349
|
-
"text": "
|
|
1350
|
-
}
|
|
1349
|
+
"text": "ShortcutController"
|
|
1350
|
+
},
|
|
1351
|
+
"privacy": "private",
|
|
1352
|
+
"default": "new ShortcutController(host)"
|
|
1351
1353
|
},
|
|
1352
1354
|
{
|
|
1353
|
-
"
|
|
1354
|
-
"
|
|
1355
|
-
"text": "number"
|
|
1356
|
-
}
|
|
1355
|
+
"kind": "method",
|
|
1356
|
+
"name": "registerCommandShortcuts"
|
|
1357
1357
|
}
|
|
1358
|
-
]
|
|
1359
|
-
"description": "Wraps a value so that it always falls within min/max,\nwhere a value greater than max gets set to min, and vice versa"
|
|
1358
|
+
]
|
|
1360
1359
|
}
|
|
1361
1360
|
],
|
|
1362
1361
|
"exports": [
|
|
1363
1362
|
{
|
|
1364
1363
|
"kind": "js",
|
|
1365
|
-
"name": "
|
|
1364
|
+
"name": "KeyboardController",
|
|
1366
1365
|
"declaration": {
|
|
1367
|
-
"name": "
|
|
1368
|
-
"module": "src/
|
|
1366
|
+
"name": "KeyboardController",
|
|
1367
|
+
"module": "src/command-menu/KeyboardController.ts"
|
|
1369
1368
|
}
|
|
1370
1369
|
}
|
|
1371
1370
|
]
|
|
1372
1371
|
},
|
|
1373
1372
|
{
|
|
1374
1373
|
"kind": "javascript-module",
|
|
1375
|
-
"path": "src/
|
|
1374
|
+
"path": "src/command-menu/events.ts",
|
|
1376
1375
|
"declarations": [
|
|
1377
1376
|
{
|
|
1378
|
-
"kind": "
|
|
1379
|
-
"
|
|
1380
|
-
"
|
|
1381
|
-
|
|
1382
|
-
"text": "RefCallback"
|
|
1383
|
-
}
|
|
1384
|
-
},
|
|
1385
|
-
"parameters": [
|
|
1377
|
+
"kind": "class",
|
|
1378
|
+
"description": "",
|
|
1379
|
+
"name": "SelectEvent",
|
|
1380
|
+
"members": [
|
|
1386
1381
|
{
|
|
1387
|
-
"
|
|
1382
|
+
"kind": "field",
|
|
1383
|
+
"name": "command",
|
|
1388
1384
|
"type": {
|
|
1389
|
-
"text": "
|
|
1390
|
-
}
|
|
1385
|
+
"text": "ICommandMenuAction"
|
|
1386
|
+
},
|
|
1387
|
+
"default": "command"
|
|
1391
1388
|
}
|
|
1392
1389
|
],
|
|
1393
|
-
"
|
|
1390
|
+
"superclass": {
|
|
1391
|
+
"name": "NordEvent",
|
|
1392
|
+
"module": "/src/common/events.js"
|
|
1393
|
+
}
|
|
1394
1394
|
}
|
|
1395
1395
|
],
|
|
1396
1396
|
"exports": [
|
|
1397
1397
|
{
|
|
1398
1398
|
"kind": "js",
|
|
1399
|
-
"name": "
|
|
1399
|
+
"name": "SelectEvent",
|
|
1400
1400
|
"declaration": {
|
|
1401
|
-
"name": "
|
|
1402
|
-
"module": "src/
|
|
1401
|
+
"name": "SelectEvent",
|
|
1402
|
+
"module": "src/command-menu/events.ts"
|
|
1403
1403
|
}
|
|
1404
1404
|
}
|
|
1405
1405
|
]
|
|
@@ -2904,105 +2904,6 @@
|
|
|
2904
2904
|
}
|
|
2905
2905
|
]
|
|
2906
2906
|
},
|
|
2907
|
-
{
|
|
2908
|
-
"kind": "javascript-module",
|
|
2909
|
-
"path": "src/table/Table.ts",
|
|
2910
|
-
"declarations": [
|
|
2911
|
-
{
|
|
2912
|
-
"kind": "class",
|
|
2913
|
-
"description": "Table is used to organize and display information from a data set.\nProvides table styles in addition to features like sticky\nheaders and support for narrow viewports.",
|
|
2914
|
-
"name": "Table",
|
|
2915
|
-
"slots": [
|
|
2916
|
-
{
|
|
2917
|
-
"description": "The table.",
|
|
2918
|
-
"name": ""
|
|
2919
|
-
}
|
|
2920
|
-
],
|
|
2921
|
-
"members": [
|
|
2922
|
-
{
|
|
2923
|
-
"kind": "field",
|
|
2924
|
-
"name": "density",
|
|
2925
|
-
"type": {
|
|
2926
|
-
"text": "\"condensed\" | \"default\" | \"relaxed\""
|
|
2927
|
-
},
|
|
2928
|
-
"default": "\"default\"",
|
|
2929
|
-
"description": "Controls the density of the table's rows and headers.\nRelaxed increases space, condensed reduces space.",
|
|
2930
|
-
"attribute": "density",
|
|
2931
|
-
"reflects": true
|
|
2932
|
-
},
|
|
2933
|
-
{
|
|
2934
|
-
"kind": "method",
|
|
2935
|
-
"name": "renderStyles",
|
|
2936
|
-
"privacy": "private",
|
|
2937
|
-
"description": "renders table styles into nearest root.\nthis is necessary since we do not use shadow dom."
|
|
2938
|
-
},
|
|
2939
|
-
{
|
|
2940
|
-
"kind": "method",
|
|
2941
|
-
"name": "createRenderRoot",
|
|
2942
|
-
"privacy": "protected",
|
|
2943
|
-
"description": "opt out of shadow dom"
|
|
2944
|
-
},
|
|
2945
|
-
{
|
|
2946
|
-
"kind": "field",
|
|
2947
|
-
"name": "_warningLogged",
|
|
2948
|
-
"type": {
|
|
2949
|
-
"text": "boolean"
|
|
2950
|
-
},
|
|
2951
|
-
"privacy": "private",
|
|
2952
|
-
"static": true,
|
|
2953
|
-
"default": "false",
|
|
2954
|
-
"inheritedFrom": {
|
|
2955
|
-
"name": "DraftComponentMixin",
|
|
2956
|
-
"module": "src/common/mixins/DraftComponentMixin.ts"
|
|
2957
|
-
}
|
|
2958
|
-
}
|
|
2959
|
-
],
|
|
2960
|
-
"attributes": [
|
|
2961
|
-
{
|
|
2962
|
-
"name": "density",
|
|
2963
|
-
"type": {
|
|
2964
|
-
"text": "\"condensed\" | \"default\" | \"relaxed\""
|
|
2965
|
-
},
|
|
2966
|
-
"default": "\"default\"",
|
|
2967
|
-
"description": "Controls the density of the table's rows and headers.\nRelaxed increases space, condensed reduces space.",
|
|
2968
|
-
"fieldName": "density"
|
|
2969
|
-
}
|
|
2970
|
-
],
|
|
2971
|
-
"mixins": [
|
|
2972
|
-
{
|
|
2973
|
-
"name": "DraftComponentMixin",
|
|
2974
|
-
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
2975
|
-
}
|
|
2976
|
-
],
|
|
2977
|
-
"superclass": {
|
|
2978
|
-
"name": "LitElement",
|
|
2979
|
-
"package": "lit"
|
|
2980
|
-
},
|
|
2981
|
-
"status": "draft",
|
|
2982
|
-
"category": "list",
|
|
2983
|
-
"tagName": "nord-table",
|
|
2984
|
-
"customElement": true
|
|
2985
|
-
}
|
|
2986
|
-
],
|
|
2987
|
-
"exports": [
|
|
2988
|
-
{
|
|
2989
|
-
"kind": "js",
|
|
2990
|
-
"name": "default",
|
|
2991
|
-
"declaration": {
|
|
2992
|
-
"name": "Table",
|
|
2993
|
-
"module": "src/table/Table.ts"
|
|
2994
|
-
}
|
|
2995
|
-
},
|
|
2996
|
-
{
|
|
2997
|
-
"kind": "custom-element-definition",
|
|
2998
|
-
"name": "nord-table",
|
|
2999
|
-
"declaration": {
|
|
3000
|
-
"name": "Table",
|
|
3001
|
-
"module": "src/table/Table.ts"
|
|
3002
|
-
}
|
|
3003
|
-
}
|
|
3004
|
-
]
|
|
3005
|
-
},
|
|
3006
2907
|
{
|
|
3007
2908
|
"kind": "javascript-module",
|
|
3008
2909
|
"path": "src/textarea/Textarea.ts",
|
|
@@ -3557,6 +3458,105 @@
|
|
|
3557
3458
|
}
|
|
3558
3459
|
]
|
|
3559
3460
|
},
|
|
3461
|
+
{
|
|
3462
|
+
"kind": "javascript-module",
|
|
3463
|
+
"path": "src/table/Table.ts",
|
|
3464
|
+
"declarations": [
|
|
3465
|
+
{
|
|
3466
|
+
"kind": "class",
|
|
3467
|
+
"description": "Table is used to organize and display information from a data set.\nProvides table styles in addition to features like sticky\nheaders and support for narrow viewports.",
|
|
3468
|
+
"name": "Table",
|
|
3469
|
+
"slots": [
|
|
3470
|
+
{
|
|
3471
|
+
"description": "The table.",
|
|
3472
|
+
"name": ""
|
|
3473
|
+
}
|
|
3474
|
+
],
|
|
3475
|
+
"members": [
|
|
3476
|
+
{
|
|
3477
|
+
"kind": "field",
|
|
3478
|
+
"name": "density",
|
|
3479
|
+
"type": {
|
|
3480
|
+
"text": "\"condensed\" | \"default\" | \"relaxed\""
|
|
3481
|
+
},
|
|
3482
|
+
"default": "\"default\"",
|
|
3483
|
+
"description": "Controls the density of the table's rows and headers.\nRelaxed increases space, condensed reduces space.",
|
|
3484
|
+
"attribute": "density",
|
|
3485
|
+
"reflects": true
|
|
3486
|
+
},
|
|
3487
|
+
{
|
|
3488
|
+
"kind": "method",
|
|
3489
|
+
"name": "renderStyles",
|
|
3490
|
+
"privacy": "private",
|
|
3491
|
+
"description": "renders table styles into nearest root.\nthis is necessary since we do not use shadow dom."
|
|
3492
|
+
},
|
|
3493
|
+
{
|
|
3494
|
+
"kind": "method",
|
|
3495
|
+
"name": "createRenderRoot",
|
|
3496
|
+
"privacy": "protected",
|
|
3497
|
+
"description": "opt out of shadow dom"
|
|
3498
|
+
},
|
|
3499
|
+
{
|
|
3500
|
+
"kind": "field",
|
|
3501
|
+
"name": "_warningLogged",
|
|
3502
|
+
"type": {
|
|
3503
|
+
"text": "boolean"
|
|
3504
|
+
},
|
|
3505
|
+
"privacy": "private",
|
|
3506
|
+
"static": true,
|
|
3507
|
+
"default": "false",
|
|
3508
|
+
"inheritedFrom": {
|
|
3509
|
+
"name": "DraftComponentMixin",
|
|
3510
|
+
"module": "src/common/mixins/DraftComponentMixin.ts"
|
|
3511
|
+
}
|
|
3512
|
+
}
|
|
3513
|
+
],
|
|
3514
|
+
"attributes": [
|
|
3515
|
+
{
|
|
3516
|
+
"name": "density",
|
|
3517
|
+
"type": {
|
|
3518
|
+
"text": "\"condensed\" | \"default\" | \"relaxed\""
|
|
3519
|
+
},
|
|
3520
|
+
"default": "\"default\"",
|
|
3521
|
+
"description": "Controls the density of the table's rows and headers.\nRelaxed increases space, condensed reduces space.",
|
|
3522
|
+
"fieldName": "density"
|
|
3523
|
+
}
|
|
3524
|
+
],
|
|
3525
|
+
"mixins": [
|
|
3526
|
+
{
|
|
3527
|
+
"name": "DraftComponentMixin",
|
|
3528
|
+
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
3529
|
+
}
|
|
3530
|
+
],
|
|
3531
|
+
"superclass": {
|
|
3532
|
+
"name": "LitElement",
|
|
3533
|
+
"package": "lit"
|
|
3534
|
+
},
|
|
3535
|
+
"status": "draft",
|
|
3536
|
+
"category": "list",
|
|
3537
|
+
"tagName": "nord-table",
|
|
3538
|
+
"customElement": true
|
|
3539
|
+
}
|
|
3540
|
+
],
|
|
3541
|
+
"exports": [
|
|
3542
|
+
{
|
|
3543
|
+
"kind": "js",
|
|
3544
|
+
"name": "default",
|
|
3545
|
+
"declaration": {
|
|
3546
|
+
"name": "Table",
|
|
3547
|
+
"module": "src/table/Table.ts"
|
|
3548
|
+
}
|
|
3549
|
+
},
|
|
3550
|
+
{
|
|
3551
|
+
"kind": "custom-element-definition",
|
|
3552
|
+
"name": "nord-table",
|
|
3553
|
+
"declaration": {
|
|
3554
|
+
"name": "Table",
|
|
3555
|
+
"module": "src/table/Table.ts"
|
|
3556
|
+
}
|
|
3557
|
+
}
|
|
3558
|
+
]
|
|
3559
|
+
},
|
|
3560
3560
|
{
|
|
3561
3561
|
"kind": "javascript-module",
|
|
3562
3562
|
"path": "src/visually-hidden/VisuallyHidden.ts",
|
package/lib/Button.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,D as o,p as n,_ as r,n as e,s as a}from"./DraftComponentMixin-4bb26f5d.js";import{e as s}from"./property-03f59dce.js";import{l as i}from"./directive-40a31ee2.js";import{n as l}from"./ref-857246ae.js";import{I as c,F as d}from"./InputMixin-3e737480.js";const b=t`:host{all:initial;display:inline-block}*,::after,::before{box-sizing:border-box;margin:0;padding:0}.n-button{-webkit-appearance:none;align-items:center;appearance:none;background:var(--n-button-background-color,var(--n-color-button));border-radius:var(--n-button-border-radius,var(--n-border-radius-s));border:1px var(--n-button-border-style,solid) var(--n-button-border-color,var(--n-color-border-strong));box-shadow:var(--n-button-box-shadow,var(--n-box-shadow));color:var(--n-button-color,var(--n-color-text));cursor:pointer;display:flex;gap:var(--n-button-gap,var(--n-space-s));font-family:var(--n-font-family);font-feature-settings:var(--n-font-features);font-size:var(--n-button-font-size,var(--n-font-size-m));font-weight:var(--n-button-font-weight,var(--n-font-weight));line-height:var(--n-line-height-form);margin:0;min-block-size:var(--n-button-min-height,var(--n-space-xl));padding:var(--n-button-padding-y,calc(var(--n-space-s)/ 1.6)) var(--n-button-padding-x,calc(var(--n-space-m)/ 1.2));text-align:var(--n-button-text-align,center);text-decoration:none;transition:all .1s ease;-webkit-user-select:none;user-select:none;inline-size:var(--n-button-width,fit-content)}:host([expand]){--n-button-width:100%;display:block}.n-content{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(:hover){--n-button-background-color:var(--n-color-button-hover);--n-button-border-color:var(--n-color-border-hover)}:host([disabled]){--n-button-background-color:var(--n-color-border);--n-button-box-shadow:none;--n-button-border-color:var(--n-button-background-color);--n-button-color:var(--n-color-text-weaker);opacity:.5;pointer-events:none}.n-button:focus{--n-button-border-color:var(--n-color-primary);--n-button-border-style:solid;--n-button-box-shadow:0 0 0 1px var(--n-button-border-color);outline:0}.n-button:active{opacity:.8;transform:translateY(1px);transition:none}:host([variant=primary]){--n-button-background-color:var(--n-color-primary);--n-button-border-color:transparent;--n-button-box-shadow:none;--n-button-color:var(--n-color-text-inverse);--n-button-font-weight:var(--n-font-weight-active)}:host([variant=primary]:hover){--n-button-background-color:var(--n-color-primary-strong)}:host([variant=dashed]){--n-button-color:var(--n-color-text-weaker);--n-button-border-color:var(--n-color-border-hover);--n-button-border-style:dashed;--n-button-box-shadow:none}:host([variant=dashed]:hover){--n-button-color:var(--n-color-text)}:host([variant=plain]){--n-button-border-color:transparent;--n-button-box-shadow:none}:host([variant=danger]){--n-button-border-color:var(--n-color-status-danger);--n-button-color:var(--n-color-text-error);--n-button-font-weight:var(--n-font-weight-active)}:host([size="s"]){--n-button-font-size:var(--n-font-size-s);--n-button-min-height:var(--n-space-l);--n-button-padding-y:calc(var(--n-space-s) / 1.5);--n-button-padding-x:var(--n-space-s);--n-button-gap:calc(var(--n-space-s) / 2)}:host([size="s"]) .n-button{line-height:var(--n-line-height-tight)}:host([size="l"]){--n-button-border-radius:var(--n-border-radius);--n-button-font-size:var(--n-font-size-l);--n-button-min-height:calc(var(--n-space-xxl) - var(--n-space-l));--n-button-padding-x:calc(var(--n-space-l) / 1.3);--n-button-font-weight:var(--n-font-weight-active)}::slotted(*){color:inherit;pointer-events:none}::slotted(svg){color:var(--n-color-icon)}::slotted(button[slot=proxy]){display:none}
|
|
1
|
+
import{r as t,D as o,p as n,_ as r,n as e,s as a}from"./DraftComponentMixin-4bb26f5d.js";import{e as s}from"./property-03f59dce.js";import{l as i}from"./directive-40a31ee2.js";import{n as l}from"./ref-857246ae.js";import{I as c,F as d}from"./InputMixin-3e737480.js";const b=t`:host{all:initial;display:inline-block}*,::after,::before{box-sizing:border-box;margin:0;padding:0}.n-button{-webkit-appearance:none;align-items:center;appearance:none;background:var(--n-button-background-color,var(--n-color-button));border-radius:var(--n-button-border-radius,var(--n-border-radius-s));border:1px var(--n-button-border-style,solid) var(--n-button-border-color,var(--n-color-border-strong));box-shadow:var(--n-button-box-shadow,var(--n-box-shadow));color:var(--n-button-color,var(--n-color-text));cursor:pointer;display:flex;gap:var(--n-button-gap,var(--n-space-s));font-family:var(--n-font-family);font-feature-settings:var(--n-font-features);font-size:var(--n-button-font-size,var(--n-font-size-m));font-weight:var(--n-button-font-weight,var(--n-font-weight));line-height:var(--n-line-height-form);margin:0;min-block-size:var(--n-button-min-height,var(--n-space-xl));padding:var(--n-button-padding-y,calc(var(--n-space-s)/ 1.6)) var(--n-button-padding-x,calc(var(--n-space-m)/ 1.2));text-align:var(--n-button-text-align,center);text-decoration:none;transition:all .1s ease;-webkit-user-select:none;user-select:none;inline-size:var(--n-button-width,fit-content)}:host([expand]){--n-button-width:100%;display:block}.n-content{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(:hover){--n-button-background-color:var(--n-color-button-hover);--n-button-border-color:var(--n-color-border-hover)}:host([disabled]){--n-button-background-color:var(--n-color-border);--n-button-box-shadow:none;--n-button-border-color:var(--n-button-background-color);--n-button-color:var(--n-color-text-weaker);opacity:.5;pointer-events:none}.n-button:focus{--n-button-border-color:var(--n-color-primary);--n-button-border-style:solid;--n-button-box-shadow:0 0 0 1px var(--n-button-border-color);outline:0}.n-button:active{opacity:.8;transform:translateY(1px);transition:none}:host([variant=primary]){--n-button-background-color:var(--n-color-primary);--n-button-border-color:transparent;--n-button-box-shadow:none;--n-button-color:var(--n-color-text-inverse);--n-button-font-weight:var(--n-font-weight-active)}:host([variant=primary]:hover){--n-button-background-color:var(--n-color-primary-strong)}:host([variant=dashed]){--n-button-color:var(--n-color-text-weaker);--n-button-border-color:var(--n-color-border-hover);--n-button-border-style:dashed;--n-button-box-shadow:none}:host([variant=dashed]:hover){--n-button-color:var(--n-color-text)}:host([variant=plain]){--n-button-border-color:transparent;--n-button-box-shadow:none}:host([variant=danger]){--n-button-border-color:var(--n-color-status-danger);--n-button-color:var(--n-color-text-error);--n-button-font-weight:var(--n-font-weight-active)}:host([size="s"]){--n-button-font-size:var(--n-font-size-s);--n-button-min-height:var(--n-space-l);--n-button-padding-y:calc(var(--n-space-s) / 1.5);--n-button-padding-x:var(--n-space-s);--n-button-gap:calc(var(--n-space-s) / 2)}:host([size="s"]) .n-button{line-height:var(--n-line-height-tight)}:host([size="l"]){--n-button-border-radius:var(--n-border-radius);--n-button-font-size:var(--n-font-size-l);--n-button-min-height:calc(var(--n-space-xxl) - var(--n-space-l));--n-button-padding-x:calc(var(--n-space-l) / 1.3);--n-button-font-weight:var(--n-font-weight-active)}::slotted(*){color:inherit;pointer-events:none}::slotted(svg){color:var(--n-color-icon)}::slotted(button[slot=proxy]){display:none}`;let u=class extends(c(d(o(a)))){constructor(){super(...arguments),this._proxyButton=document.createElement("button"),this.variant="default",this.type="submit",this.size="m",this.download=!1,this.target="_self",this.expand=!1}connectedCallback(){super.connectedCallback(),this.syncProxyButton()}disconnectedCallback(){super.disconnectedCallback(),this.cleanupProxyButton()}updated(){this.syncProxyButton()}render(){const t=n`<slot name="before"></slot><div class="n-content"><slot></slot></div><slot name="after"></slot>`;return this.href?n`<a ${l(this.focusableRef)} class="n-button" target="${this.target}" ?download="${this.download}" href="${this.href}">${t}</a>`:n`<slot name="proxy"></slot><button ${l(this.focusableRef)} class="n-button" ?disabled="${this.disabled}" name="${i(this.name)}" value="${i(this.value)}" @click="${this.handleClick}">${t}</button>`}handleClick(){this._proxyButton.click()}get isFormAssociated(){return!this.href&&this.form}syncProxyButton(){const t=this._proxyButton;t.slot="proxy",t.className="n-button-proxy",t.disabled=this.disabled,t.type=this.type,this.name?t.name=this.name:t.removeAttribute("name"),this.value?t.value=this.value:t.removeAttribute("value"),this.isFormAssociated?this.appendChild(t):this.cleanupProxyButton()}cleanupProxyButton(){this._proxyButton.remove()}};u.styles=b,r([s({reflect:!0})],u.prototype,"variant",void 0),r([s({reflect:!0})],u.prototype,"type",void 0),r([s({reflect:!0})],u.prototype,"size",void 0),r([s({reflect:!0})],u.prototype,"href",void 0),r([s({type:Boolean})],u.prototype,"download",void 0),r([s({reflect:!0})],u.prototype,"target",void 0),r([s({reflect:!0,type:Boolean})],u.prototype,"expand",void 0),u=r([e("nord-button")],u);var v=u;export{v as default};
|
|
2
2
|
//# sourceMappingURL=Button.js.map
|
package/lib/Button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../src/button/Button.ts"],"sourcesContent":["import { LitElement, html } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport { ifDefined } from \"lit/directives/if-defined.js\"\nimport { ref } from \"lit/directives/ref.js\"\n\nimport { DraftComponentMixin } from \"../common/mixins/DraftComponentMixin.js\"\nimport { FocusableMixin } from \"../common/mixins/FocusableMixin.js\"\nimport { InputMixin } from \"../common/mixins/InputMixin.js\"\nimport style from \"./Button.css\"\n\n/**\n * Buttons are used for interface actions. Primary style should be\n * used only once per section for main call-to-action, while other\n * styles can appear more frequently.\n *\n * @status draft\n * @category action\n * @slot - The button content\n * @slot before - Used to place content before button text. Typically used for icons.\n * @slot after - Used to place content after button text. Typically used for icons.\n */\n@customElement(\"nord-button\")\nexport default class Button extends InputMixin(FocusableMixin(DraftComponentMixin(LitElement))) {\n static styles = style\n\n private _proxyButton = document.createElement(\"button\")\n\n /**\n * The style variant of the button.\n */\n @property({ reflect: true }) variant: \"default\" | \"primary\" | \"dashed\" | \"plain\" | \"danger\" = \"default\"\n\n /**\n * The type of the button.\n */\n @property({ reflect: true }) type: \"button\" | \"submit\" | \"reset\" = \"submit\"\n\n /**\n * The size of the button.\n * This affects font-size and padding.\n */\n @property({ reflect: true }) size: \"s\" | \"m\" | \"l\" = \"m\"\n\n /**\n * When provided, renders the button as a link,\n * with it's href attribute set to the given value.\n */\n @property({ reflect: true }) href?: string\n\n /**\n * When provided together with a href property, the button will\n * trigger a file download instead of a page visit.\n */\n @property({ type: Boolean }) download = false\n\n /**\n * When provided together with a href property, determines where\n * to open the linked URL. The keywords have special meanings for\n * where to load the URL: “_self” means the current browsing context,\n * “_blank” usually a new tab but users can configure browsers this to\n * open a new window instead, “_parent” means the parent browsing\n * context of the current one, but if no parent exists, behaves as\n * _self, and finally “top” means the topmost browsing context.\n */\n @property({ reflect: true }) target: \"_self\" | \"_blank\" | \"_parent\" | \"_top\" = \"_self\"\n\n /**\n * Controls whether the button expands to fill the width of its container.\n */\n @property({ reflect: true, type: Boolean }) expand = false\n\n connectedCallback() {\n super.connectedCallback()\n this.syncProxyButton()\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this.cleanupProxyButton()\n }\n\n updated() {\n this.syncProxyButton()\n }\n\n render() {\n const innards = html`\n <slot name=\"before\"></slot>\n <div class=\"n-content\">\n <slot></slot>\n </div>\n <slot name=\"after\"></slot>\n `\n\n return this.href\n ? html`<a\n ${ref(this.focusableRef)}\n class=\"n-button\"\n target=${this.target}\n ?download=${this.download}\n href=${this.href}\n >${innards}</a\n >`\n : html`\n <slot name=\"proxy\"></slot>\n <button\n ${ref(this.focusableRef)}\n class=\"n-button\"\n ?disabled=${this.disabled}\n name=${ifDefined(this.name)}\n value=${ifDefined(this.value)}\n @click=${this.handleClick}\n >\n ${innards}\n </button>\n `\n }\n\n private handleClick() {\n this._proxyButton.click()\n }\n\n private get isFormAssociated() {\n return !this.href && this.form\n }\n\n private syncProxyButton() {\n const proxy = this._proxyButton\n\n proxy.slot = \"proxy\"\n proxy.className = \"n-button-proxy\"\n proxy.disabled = this.disabled\n proxy.type = this.type\n\n if (this.name) {\n proxy.name = this.name\n } else {\n proxy.removeAttribute(\"name\")\n }\n if (this.value) {\n proxy.value = this.value\n } else {\n proxy.removeAttribute(\"value\")\n }\n\n if (this.isFormAssociated) {\n this.appendChild(proxy)\n } else {\n this.cleanupProxyButton()\n }\n }\n\n private cleanupProxyButton() {\n this._proxyButton.remove()\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"nord-button\": Button\n }\n}\n"],"names":["Button","InputMixin","FocusableMixin","DraftComponentMixin","LitElement","constructor","this","document","createElement","connectedCallback","super","syncProxyButton","disconnectedCallback","cleanupProxyButton","updated","render","innards","html","href","ref","focusableRef","target","download","disabled","ifDefined","name","value","handleClick","_proxyButton","click","isFormAssociated","form","proxy","slot","className","type","removeAttribute","appendChild","remove","style","__decorate","property","reflect","Boolean","customElement"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../src/button/Button.ts"],"sourcesContent":["import { LitElement, html } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport { ifDefined } from \"lit/directives/if-defined.js\"\nimport { ref } from \"lit/directives/ref.js\"\n\nimport { DraftComponentMixin } from \"../common/mixins/DraftComponentMixin.js\"\nimport { FocusableMixin } from \"../common/mixins/FocusableMixin.js\"\nimport { InputMixin } from \"../common/mixins/InputMixin.js\"\nimport style from \"./Button.css\"\n\n/**\n * Buttons are used for interface actions. Primary style should be\n * used only once per section for main call-to-action, while other\n * styles can appear more frequently.\n *\n * @status draft\n * @category action\n * @slot - The button content\n * @slot before - Used to place content before button text. Typically used for icons.\n * @slot after - Used to place content after button text. Typically used for icons.\n */\n@customElement(\"nord-button\")\nexport default class Button extends InputMixin(FocusableMixin(DraftComponentMixin(LitElement))) {\n static styles = style\n\n private _proxyButton = document.createElement(\"button\")\n\n /**\n * The style variant of the button.\n */\n @property({ reflect: true }) variant: \"default\" | \"primary\" | \"dashed\" | \"plain\" | \"danger\" = \"default\"\n\n /**\n * The type of the button.\n */\n @property({ reflect: true }) type: \"button\" | \"submit\" | \"reset\" = \"submit\"\n\n /**\n * The size of the button.\n * This affects font-size and padding.\n */\n @property({ reflect: true }) size: \"s\" | \"m\" | \"l\" = \"m\"\n\n /**\n * When provided, renders the button as a link,\n * with it's href attribute set to the given value.\n */\n @property({ reflect: true }) href?: string\n\n /**\n * When provided together with a href property, the button will\n * trigger a file download instead of a page visit.\n */\n @property({ type: Boolean }) download = false\n\n /**\n * When provided together with a href property, determines where\n * to open the linked URL. The keywords have special meanings for\n * where to load the URL: “_self” means the current browsing context,\n * “_blank” usually a new tab but users can configure browsers this to\n * open a new window instead, “_parent” means the parent browsing\n * context of the current one, but if no parent exists, behaves as\n * _self, and finally “top” means the topmost browsing context.\n */\n @property({ reflect: true }) target: \"_self\" | \"_blank\" | \"_parent\" | \"_top\" = \"_self\"\n\n /**\n * Controls whether the button expands to fill the width of its container.\n */\n @property({ reflect: true, type: Boolean }) expand = false\n\n connectedCallback() {\n super.connectedCallback()\n this.syncProxyButton()\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this.cleanupProxyButton()\n }\n\n updated() {\n this.syncProxyButton()\n }\n\n render() {\n const innards = html`\n <slot name=\"before\"></slot>\n <div class=\"n-content\">\n <slot></slot>\n </div>\n <slot name=\"after\"></slot>\n `\n\n return this.href\n ? html`<a\n ${ref(this.focusableRef)}\n class=\"n-button\"\n target=${this.target}\n ?download=${this.download}\n href=${this.href}\n >${innards}</a\n >`\n : html`\n <slot name=\"proxy\"></slot>\n <button\n ${ref(this.focusableRef)}\n class=\"n-button\"\n ?disabled=${this.disabled}\n name=${ifDefined(this.name)}\n value=${ifDefined(this.value)}\n @click=${this.handleClick}\n >\n ${innards}\n </button>\n `\n }\n\n private handleClick() {\n this._proxyButton.click()\n }\n\n private get isFormAssociated() {\n return !this.href && this.form\n }\n\n private syncProxyButton() {\n const proxy = this._proxyButton\n\n proxy.slot = \"proxy\"\n proxy.className = \"n-button-proxy\"\n proxy.disabled = this.disabled\n proxy.type = this.type\n\n if (this.name) {\n proxy.name = this.name\n } else {\n proxy.removeAttribute(\"name\")\n }\n if (this.value) {\n proxy.value = this.value\n } else {\n proxy.removeAttribute(\"value\")\n }\n\n if (this.isFormAssociated) {\n this.appendChild(proxy)\n } else {\n this.cleanupProxyButton()\n }\n }\n\n private cleanupProxyButton() {\n this._proxyButton.remove()\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"nord-button\": Button\n }\n}\n"],"names":["Button","InputMixin","FocusableMixin","DraftComponentMixin","LitElement","constructor","this","document","createElement","connectedCallback","super","syncProxyButton","disconnectedCallback","cleanupProxyButton","updated","render","innards","html","href","ref","focusableRef","target","download","disabled","ifDefined","name","value","handleClick","_proxyButton","click","isFormAssociated","form","proxy","slot","className","type","removeAttribute","appendChild","remove","style","__decorate","property","reflect","Boolean","customElement"],"mappings":"gnHAsBA,IAAqBA,EAArB,cAAoCC,EAAWC,EAAeC,EAAoBC,MAAlFC,kCAGUC,kBAAeC,SAASC,cAAc,UAKjBF,aAAiE,UAKjEA,UAAsC,SAMtCA,UAAwB,IAYxBA,eAAW,EAWXA,YAAkD,QAKnCA,aAAS,EAErDG,oBACEC,MAAMD,oBACNH,KAAKK,kBAGPC,uBACEF,MAAME,uBACNN,KAAKO,qBAGPC,UACER,KAAKK,kBAGPI,SACE,MAAMC,EAAUC,CAAI,kGAQpB,OAAOX,KAAKY,KACRD,CAAI,MACAE,EAAIb,KAAKc,0CAEFd,KAAKe,sBACFf,KAAKgB,mBACVhB,KAAKY,SACTF,QAELC,CAAI,qCAGEE,EAAIb,KAAKc,6CAECd,KAAKiB,mBACVC,EAAUlB,KAAKmB,iBACdD,EAAUlB,KAAKoB,mBACdpB,KAAKqB,gBAEZX,aAKJW,cACNrB,KAAKsB,aAAaC,QAGRC,uBACV,OAAQxB,KAAKY,MAAQZ,KAAKyB,KAGpBpB,kBACN,MAAMqB,EAAQ1B,KAAKsB,aAEnBI,EAAMC,KAAO,QACbD,EAAME,UAAY,iBAClBF,EAAMT,SAAWjB,KAAKiB,SACtBS,EAAMG,KAAO7B,KAAK6B,KAEd7B,KAAKmB,KACPO,EAAMP,KAAOnB,KAAKmB,KAElBO,EAAMI,gBAAgB,QAEpB9B,KAAKoB,MACPM,EAAMN,MAAQpB,KAAKoB,MAEnBM,EAAMI,gBAAgB,SAGpB9B,KAAKwB,iBACPxB,KAAK+B,YAAYL,GAEjB1B,KAAKO,qBAIDA,qBACNP,KAAKsB,aAAaU,WAlIbtC,SAASuC,EAOaC,GAA5BC,EAAS,CAAEC,SAAS,mCAKQF,GAA5BC,EAAS,CAAEC,SAAS,gCAMQF,GAA5BC,EAAS,CAAEC,SAAS,gCAMQF,GAA5BC,EAAS,CAAEC,SAAS,gCAMQF,GAA5BC,EAAS,CAAEN,KAAMQ,0CAWWH,GAA5BC,EAAS,CAAEC,SAAS,kCAKuBF,GAA3CC,EAAS,CAAEC,SAAS,EAAMP,KAAMQ,wCA/Cd3C,KADpB4C,EAAc,gBACM5C,SAAAA"}
|
package/lib/Input.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,D as t,T as
|
|
1
|
+
import{r as e,D as t,T as s,p as i,_ as r,n,s as o}from"./DraftComponentMixin-4bb26f5d.js";import{e as a}from"./property-03f59dce.js";import{l}from"./directive-40a31ee2.js";import{n as p}from"./ref-857246ae.js";import{o as d}from"./unsafe-html-7028f0a1.js";import{I as c,F as m}from"./InputMixin-3e737480.js";import{F as h,s as u}from"./FormField-02dd3b4f.js";import"./VisuallyHidden.js";import{s as f}from"./TextField-bfdc253c.js";import"./SlotController-fda28afb.js";import"./events-731d0007.js";const v=e`.n-input::-webkit-search-cancel-button,.n-input::-webkit-search-decoration{-webkit-appearance:none;appearance:none}slot[name=before]{display:flex;align-items:center;position:absolute;margin-inline-start:var(--n-space-m);block-size:100%;pointer-events:none;color:var(--n-color-icon)}slot[name=before]+.n-input{padding-inline-start:var(--n-space-xl)}::slotted(svg),svg{block-size:var(--n-size-icon-s);inline-size:var(--n-size-icon-s)}`;let b=class extends(h(c(m(t(o))))){constructor(){super(...arguments),this.type="text"}render(){var e;const t="search"===this.type||this.slots.hasSlottedContent("before"),r="number"===this.type,n="search"===this.type?d('<svg viewBox="0 0 140 140" xmlns="http://www.w3.org/2000/svg"><path d="M7 59.5a52.5 52.5 0 1 0 105 0 52.5 52.5 0 1 0-105 0zM133 133 96.628 96.628" stroke-width="14" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/></svg>'):s;return i`${this.renderLabel()}<div class="n-input-container">${t?i`<slot name="before">${n}</slot>`:s} <input ${p(this.focusableRef)} id="${this.inputId}" class="n-input" type="${r?"text":this.type}" inputmode="${l(r?"numeric":void 0)}" pattern="${l(r?"[0-9]*":void 0)}" ?disabled="${this.disabled}" ?required="${this.required}" name="${l(this.name)}" .value="${null!==(e=this.value)&&void 0!==e?e:""}" placeholder="${l(this.placeholder)}" @change="${this.handleChange}" aria-describedby="${l(this.getDescribedBy())}" aria-invalid="${l(this.getInvalid())}" spellcheck="false"></div>${this.renderError()}`}};b.styles=[u,f,v],r([a()],b.prototype,"type",void 0),b=r([n("nord-input")],b);var $=b;export{$ as default};
|
|
2
2
|
//# sourceMappingURL=Input.js.map
|
package/lib/Input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sources":["../src/input/Input.ts","../../icons/lib/assets/navigation-search.js"],"sourcesContent":["import { LitElement, html, nothing } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport { ifDefined } from \"lit/directives/if-defined.js\"\nimport { ref } from \"lit/directives/ref.js\"\nimport { unsafeHTML } from \"lit/directives/unsafe-html.js\"\n\nimport searchIcon from \"@nordhealth/icons/lib/assets/navigation-search.js\"\nimport { FocusableMixin } from \"../common/mixins/FocusableMixin.js\"\nimport { FormAssociatedMixin } from \"../common/mixins/FormAssociatedMixin.js\"\nimport { InputMixin } from \"../common/mixins/InputMixin.js\"\nimport { DraftComponentMixin } from \"../common/mixins/DraftComponentMixin.js\"\nimport \"../visually-hidden/VisuallyHidden.js\"\n\nimport formFieldStyle from \"../common/styles/FormField.css\"\nimport textFieldStyle from \"../common/styles/TextField.css\"\nimport style from \"./Input.css\"\n\n/**\n * Inputs are used to allow users to provide text input when the expected input is short.\n * As well as plain text, Input supports various types of text, including passwords and numbers.\n *\n * @status draft\n * @category form\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Optional slot that holds hint text for the input.\n * @slot error - Optional slot that holds error text for the input.\n * @slot before - Optional slot that holds an icon for the input.\n */\n@customElement(\"nord-input\")\nexport default class Input extends FormAssociatedMixin(InputMixin(FocusableMixin(DraftComponentMixin(LitElement)))) {\n static styles = [formFieldStyle, textFieldStyle, style]\n\n /**\n * The type of the input.\n */\n @property() type: \"text\" | \"email\" | \"password\" | \"tel\" | \"url\" | \"search\" | \"number\" = \"text\"\n\n render() {\n const hasIcon = this.type === \"search\" || this.slots.hasSlottedContent(\"before\")\n const isNumber = this.type === \"number\"\n const defaultIcon = this.type === \"search\" ? unsafeHTML(searchIcon) : nothing\n\n return html`\n ${this.renderLabel()}\n\n <div class=\"n-input-container\">\n ${hasIcon ? html`<slot name=\"before\">${defaultIcon}</slot>` : nothing}\n <input\n ${ref(this.focusableRef)}\n id=${this.inputId}\n class=\"n-input\"\n type=${isNumber ? \"text\" : this.type}\n inputmode=${ifDefined(isNumber ? \"numeric\" : undefined)}\n pattern=${ifDefined(isNumber ? \"[0-9]*\" : undefined)}\n ?disabled=${this.disabled}\n ?required=${this.required}\n name=${ifDefined(this.name)}\n .value=${this.value ?? \"\"}\n placeholder=${ifDefined(this.placeholder)}\n @change=${this.handleChange}\n aria-describedby=${ifDefined(this.getDescribedBy())}\n aria-invalid=${ifDefined(this.getInvalid())}\n />\n </div>\n\n ${this.renderError()}\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"nord-input\": Input\n }\n}\n","export default '<svg viewBox=\"0 0 140 140\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7 59.5a52.5 52.5 0 1 0 105 0 52.5 52.5 0 1 0-105 0zM133 133 96.628 96.628\" stroke-width=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>'\nexport const title = \"navigation-search\"\nexport const tags = \"nordicon navigation menu find search magnifying glass\"\n"],"names":["Input","FormAssociatedMixin","InputMixin","FocusableMixin","DraftComponentMixin","LitElement","constructor","this","render","hasIcon","type","slots","hasSlottedContent","isNumber","defaultIcon","unsafeHTML","nothing","html","renderLabel","ref","focusableRef","inputId","ifDefined","undefined","disabled","required","name","value","placeholder","handleChange","getDescribedBy","getInvalid","renderError","formFieldStyle","textFieldStyle","style","__decorate","property","customElement"],"mappings":"86BA6BA,IAAqBA,EAArB,cAAmCC,EAAoBC,EAAWC,EAAeC,EAAoBC,OAArGC,kCAMcC,UAA4E,OAExFC,eACE,MAAMC,EAAwB,WAAdF,KAAKG,MAAqBH,KAAKI,MAAMC,kBAAkB,UACjEC,EAAyB,WAAdN,KAAKG,KAChBI,EAA4B,WAAdP,KAAKG,KAAoBK,ECxClC,iQDwC2DC,EAEtE,OAAOC,CAAI,GACPV,KAAKW,+CAGHT,EAAUQ,CAAI,uBAAuBH,WAAuBE,YAE1DG,EAAIZ,KAAKa,qBACNb,KAAKc,kCAEHR,EAAW,OAASN,KAAKG,oBACpBY,EAAUT,EAAW,eAAYU,gBACnCD,EAAUT,EAAW,cAAWU,kBAC9BhB,KAAKiB,wBACLjB,KAAKkB,mBACVH,EAAUf,KAAKmB,4BACbnB,KAAKoB,qBAAS,oBACTL,EAAUf,KAAKqB,0BACnBrB,KAAKsB,mCACIP,EAAUf,KAAKuB,oCACnBR,EAAUf,KAAKwB,
|
|
1
|
+
{"version":3,"file":"Input.js","sources":["../src/input/Input.ts","../../icons/lib/assets/navigation-search.js"],"sourcesContent":["import { LitElement, html, nothing } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport { ifDefined } from \"lit/directives/if-defined.js\"\nimport { ref } from \"lit/directives/ref.js\"\nimport { unsafeHTML } from \"lit/directives/unsafe-html.js\"\n\nimport searchIcon from \"@nordhealth/icons/lib/assets/navigation-search.js\"\nimport { FocusableMixin } from \"../common/mixins/FocusableMixin.js\"\nimport { FormAssociatedMixin } from \"../common/mixins/FormAssociatedMixin.js\"\nimport { InputMixin } from \"../common/mixins/InputMixin.js\"\nimport { DraftComponentMixin } from \"../common/mixins/DraftComponentMixin.js\"\nimport \"../visually-hidden/VisuallyHidden.js\"\n\nimport formFieldStyle from \"../common/styles/FormField.css\"\nimport textFieldStyle from \"../common/styles/TextField.css\"\nimport style from \"./Input.css\"\n\n/**\n * Inputs are used to allow users to provide text input when the expected input is short.\n * As well as plain text, Input supports various types of text, including passwords and numbers.\n *\n * @status draft\n * @category form\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Optional slot that holds hint text for the input.\n * @slot error - Optional slot that holds error text for the input.\n * @slot before - Optional slot that holds an icon for the input.\n */\n@customElement(\"nord-input\")\nexport default class Input extends FormAssociatedMixin(InputMixin(FocusableMixin(DraftComponentMixin(LitElement)))) {\n static styles = [formFieldStyle, textFieldStyle, style]\n\n /**\n * The type of the input.\n */\n @property() type: \"text\" | \"email\" | \"password\" | \"tel\" | \"url\" | \"search\" | \"number\" = \"text\"\n\n render() {\n const hasIcon = this.type === \"search\" || this.slots.hasSlottedContent(\"before\")\n const isNumber = this.type === \"number\"\n const defaultIcon = this.type === \"search\" ? unsafeHTML(searchIcon) : nothing\n\n return html`\n ${this.renderLabel()}\n\n <div class=\"n-input-container\">\n ${hasIcon ? html`<slot name=\"before\">${defaultIcon}</slot>` : nothing}\n <input\n ${ref(this.focusableRef)}\n id=${this.inputId}\n class=\"n-input\"\n type=${isNumber ? \"text\" : this.type}\n inputmode=${ifDefined(isNumber ? \"numeric\" : undefined)}\n pattern=${ifDefined(isNumber ? \"[0-9]*\" : undefined)}\n ?disabled=${this.disabled}\n ?required=${this.required}\n name=${ifDefined(this.name)}\n .value=${this.value ?? \"\"}\n placeholder=${ifDefined(this.placeholder)}\n @change=${this.handleChange}\n aria-describedby=${ifDefined(this.getDescribedBy())}\n aria-invalid=${ifDefined(this.getInvalid())}\n spellcheck=\"false\"\n />\n </div>\n\n ${this.renderError()}\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"nord-input\": Input\n }\n}\n","export default '<svg viewBox=\"0 0 140 140\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7 59.5a52.5 52.5 0 1 0 105 0 52.5 52.5 0 1 0-105 0zM133 133 96.628 96.628\" stroke-width=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>'\nexport const title = \"navigation-search\"\nexport const tags = \"nordicon navigation menu find search magnifying glass\"\n"],"names":["Input","FormAssociatedMixin","InputMixin","FocusableMixin","DraftComponentMixin","LitElement","constructor","this","render","hasIcon","type","slots","hasSlottedContent","isNumber","defaultIcon","unsafeHTML","nothing","html","renderLabel","ref","focusableRef","inputId","ifDefined","undefined","disabled","required","name","value","placeholder","handleChange","getDescribedBy","getInvalid","renderError","formFieldStyle","textFieldStyle","style","__decorate","property","customElement"],"mappings":"86BA6BA,IAAqBA,EAArB,cAAmCC,EAAoBC,EAAWC,EAAeC,EAAoBC,OAArGC,kCAMcC,UAA4E,OAExFC,eACE,MAAMC,EAAwB,WAAdF,KAAKG,MAAqBH,KAAKI,MAAMC,kBAAkB,UACjEC,EAAyB,WAAdN,KAAKG,KAChBI,EAA4B,WAAdP,KAAKG,KAAoBK,ECxClC,iQDwC2DC,EAEtE,OAAOC,CAAI,GACPV,KAAKW,+CAGHT,EAAUQ,CAAI,uBAAuBH,WAAuBE,YAE1DG,EAAIZ,KAAKa,qBACNb,KAAKc,kCAEHR,EAAW,OAASN,KAAKG,oBACpBY,EAAUT,EAAW,eAAYU,gBACnCD,EAAUT,EAAW,cAAWU,kBAC9BhB,KAAKiB,wBACLjB,KAAKkB,mBACVH,EAAUf,KAAKmB,4BACbnB,KAAKoB,qBAAS,oBACTL,EAAUf,KAAKqB,0BACnBrB,KAAKsB,mCACIP,EAAUf,KAAKuB,oCACnBR,EAAUf,KAAKwB,2CAKhCxB,KAAKyB,kBApCJhC,SAAS,CAACiC,EAAgBC,EAAgBC,GAKrCC,GAAXC,gCANkBrC,KADpBsC,EAAc,eACMtC,SAAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as n}from"./DraftComponentMixin-4bb26f5d.js";const r=n`.n-input-container{position:relative}.n-input{background:var(--n-color-active);color:var(--n-color-text);padding-block-start:calc(var(--n-space-s) - 1px);padding-block-end:calc(var(--n-space-s) - 1px);padding-inline-start:calc(var(--n-space-s) * 1.6);padding-inline-end:calc(var(--n-space-s) * 1.6);border-radius:var(--n-border-radius-s);border:1px solid var(--n-input-border-color,var(--n-color-border-strong));font-family:var(--n-font-family);font-size:var(--n-font-size-m);line-height:var(--n-line-height-form);min-inline-size:250px;transition:border var(--n-transition-slowly),box-shadow var(--n-transition-slowly),background var(--n-transition-slowly)}@media (max-width:480px){.n-input{font-size:var(--n-font-size-l)}}:host([expand]) .n-input{display:block;inline-size:100%}.n-input:hover,.n-label-container:hover+.n-input-container .n-input{--n-input-border-color:var(--n-color-border-hover)}.n-input:focus{--n-input-border-color:var(--n-color-primary);background:var(--n-color-surface);outline:0;box-shadow:0 0 0 1px var(--n-input-border-color)}.n-input::placeholder{color:var(--n-color-text-weaker)}.n-input:focus::placeholder{color:var(--n-color-text-weakest)}.n-input:disabled{--n-input-border-color:var(--n-color-active);color:var(--n-color-text-weakest)}.n-input[aria-invalid=true]{--n-input-border-color:var(--n-color-status-danger)!important}`;export{r as s};
|
|
2
|
+
//# sourceMappingURL=TextField-bfdc253c.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextField-bfdc253c.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/lib/Textarea.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,D as t,p as i,_ as s,n as r,s as a}from"./DraftComponentMixin-4bb26f5d.js";import{e as o}from"./property-03f59dce.js";import{l as n}from"./directive-40a31ee2.js";import{n as l}from"./ref-857246ae.js";import{I as d,F as h}from"./InputMixin-3e737480.js";import{F as p,s as u}from"./FormField-02dd3b4f.js";import"./VisuallyHidden.js";import{s as c}from"./TextField-
|
|
1
|
+
import{r as e,D as t,p as i,_ as s,n as r,s as a}from"./DraftComponentMixin-4bb26f5d.js";import{e as o}from"./property-03f59dce.js";import{l as n}from"./directive-40a31ee2.js";import{n as l}from"./ref-857246ae.js";import{I as d,F as h}from"./InputMixin-3e737480.js";import{F as p,s as u}from"./FormField-02dd3b4f.js";import"./VisuallyHidden.js";import{s as c}from"./TextField-bfdc253c.js";import"./SlotController-fda28afb.js";import"./events-731d0007.js";const f=e`.n-input{resize:none;min-block-size:var(--n-textarea-height,76px);transition:border var(--n-transition-slowly),box-shadow var(--n-transition-slowly),background var(--n-transition-slowly);display:block}:host([resize=vertical]) .n-input{resize:vertical}:host([resize=auto]) .n-input{overflow:hidden}`;let m=class extends(p(d(h(t(a))))){constructor(){super(...arguments),this.inputId="textarea",this.resize="vertical"}updated(e){(e.has("resize")||e.has("value"))&&this.resizeToFitContent()}render(){var e;return i`${this.renderLabel()}<div class="n-input-container"><textarea ${l(this.focusableRef)} id="${this.inputId}" class="n-input" ?disabled="${this.disabled}" ?required="${this.required}" name="${n(this.name)}" .value="${null!==(e=this.value)&&void 0!==e?e:""}" placeholder="${n(this.placeholder)}" @change="${this.handleChange}" @input="${this.resizeToFitContent}" aria-describedby="${n(this.getDescribedBy())}" aria-invalid="${n(this.getInvalid())}"></textarea></div>${this.renderError()}`}resizeToFitContent(){const e=this.focusableRef.value;e&&("auto"===this.resize?(e.style.height="auto",e.style.height=`${e.scrollHeight}px`):e.style.height=null)}};m.styles=[u,c,f],s([o({reflect:!0})],m.prototype,"resize",void 0),m=s([r("nord-textarea")],m);var v=m;export{v as default};
|
|
2
2
|
//# sourceMappingURL=Textarea.js.map
|
package/lib/Textarea.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.js","sources":["../src/textarea/Textarea.ts"],"sourcesContent":["import { LitElement, html, PropertyValues } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport { ifDefined } from \"lit/directives/if-defined.js\"\nimport { ref } from \"lit/directives/ref.js\"\n\nimport { DraftComponentMixin } from \"../common/mixins/DraftComponentMixin.js\"\nimport { FocusableMixin } from \"../common/mixins/FocusableMixin.js\"\nimport { FormAssociatedMixin } from \"../common/mixins/FormAssociatedMixin.js\"\nimport { InputMixin } from \"../common/mixins/InputMixin.js\"\nimport \"../visually-hidden/VisuallyHidden.js\"\n\nimport formFieldStyle from \"../common/styles/FormField.css\"\nimport textFieldStyle from \"../common/styles/TextField.css\"\nimport style from \"./Textarea.css\"\n\n/**\n * Textarea is a component that allows user to write text over\n * multiple rows. Used when the expected user input is long.\n * For shorter input, use the Input component.\n *\n * @status draft\n * @category form\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Optional slot that holds hint text for the textarea.\n * @slot error - Optional slot that holds error text for the textarea.\n */\n@customElement(\"nord-textarea\")\nexport default class Textarea extends FormAssociatedMixin(InputMixin(FocusableMixin(DraftComponentMixin(LitElement)))) {\n static styles = [formFieldStyle, textFieldStyle, style]\n\n protected inputId = \"textarea\"\n\n /**\n * Controls whether the textarea is resizable.\n * By default is manually resizable vertically.\n * Set to \"auto\" to enable auto-resizing as content grows.\n */\n @property({ reflect: true }) resize: \"vertical\" | \"auto\" = \"vertical\"\n\n updated(changedProperties: PropertyValues<this>) {\n if (changedProperties.has(\"resize\") || changedProperties.has(\"value\")) {\n this.resizeToFitContent()\n }\n }\n\n render() {\n return html`\n ${this.renderLabel()}\n\n <div class=\"n-input-container\">\n <textarea\n ${ref(this.focusableRef)}\n id=${this.inputId}\n class=\"n-input\"\n ?disabled=${this.disabled}\n ?required=${this.required}\n name=${ifDefined(this.name)}\n .value=${this.value ?? \"\"}\n placeholder=${ifDefined(this.placeholder)}\n @change=${this.handleChange}\n @input=${this.resizeToFitContent}\n aria-describedby=${ifDefined(this.getDescribedBy())}\n aria-invalid=${ifDefined(this.getInvalid())}\n ></textarea>\n </div>\n\n ${this.renderError()}\n `\n }\n\n private resizeToFitContent() {\n const textarea = this.focusableRef.value\n\n if (!textarea) {\n return\n }\n\n if (this.resize === \"auto\") {\n textarea.style.height = \"auto\"\n textarea.style.height = `${textarea.scrollHeight}px`\n } else {\n // @ts-expect-error this is actually fine, and removes the style value\n textarea.style.height = null\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"nord-textarea\": Textarea\n }\n}\n"],"names":["Textarea","FormAssociatedMixin","InputMixin","FocusableMixin","DraftComponentMixin","LitElement","constructor","this","updated","changedProperties","has","resizeToFitContent","render","html","renderLabel","ref","focusableRef","inputId","disabled","required","ifDefined","name","value","placeholder","handleChange","getDescribedBy","getInvalid","renderError","textarea","resize","style","height","scrollHeight","formFieldStyle","textFieldStyle","__decorate","property","reflect","customElement"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Textarea.js","sources":["../src/textarea/Textarea.ts"],"sourcesContent":["import { LitElement, html, PropertyValues } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport { ifDefined } from \"lit/directives/if-defined.js\"\nimport { ref } from \"lit/directives/ref.js\"\n\nimport { DraftComponentMixin } from \"../common/mixins/DraftComponentMixin.js\"\nimport { FocusableMixin } from \"../common/mixins/FocusableMixin.js\"\nimport { FormAssociatedMixin } from \"../common/mixins/FormAssociatedMixin.js\"\nimport { InputMixin } from \"../common/mixins/InputMixin.js\"\nimport \"../visually-hidden/VisuallyHidden.js\"\n\nimport formFieldStyle from \"../common/styles/FormField.css\"\nimport textFieldStyle from \"../common/styles/TextField.css\"\nimport style from \"./Textarea.css\"\n\n/**\n * Textarea is a component that allows user to write text over\n * multiple rows. Used when the expected user input is long.\n * For shorter input, use the Input component.\n *\n * @status draft\n * @category form\n * @slot label - Use when a label requires more than plain text.\n * @slot hint - Optional slot that holds hint text for the textarea.\n * @slot error - Optional slot that holds error text for the textarea.\n */\n@customElement(\"nord-textarea\")\nexport default class Textarea extends FormAssociatedMixin(InputMixin(FocusableMixin(DraftComponentMixin(LitElement)))) {\n static styles = [formFieldStyle, textFieldStyle, style]\n\n protected inputId = \"textarea\"\n\n /**\n * Controls whether the textarea is resizable.\n * By default is manually resizable vertically.\n * Set to \"auto\" to enable auto-resizing as content grows.\n */\n @property({ reflect: true }) resize: \"vertical\" | \"auto\" = \"vertical\"\n\n updated(changedProperties: PropertyValues<this>) {\n if (changedProperties.has(\"resize\") || changedProperties.has(\"value\")) {\n this.resizeToFitContent()\n }\n }\n\n render() {\n return html`\n ${this.renderLabel()}\n\n <div class=\"n-input-container\">\n <textarea\n ${ref(this.focusableRef)}\n id=${this.inputId}\n class=\"n-input\"\n ?disabled=${this.disabled}\n ?required=${this.required}\n name=${ifDefined(this.name)}\n .value=${this.value ?? \"\"}\n placeholder=${ifDefined(this.placeholder)}\n @change=${this.handleChange}\n @input=${this.resizeToFitContent}\n aria-describedby=${ifDefined(this.getDescribedBy())}\n aria-invalid=${ifDefined(this.getInvalid())}\n ></textarea>\n </div>\n\n ${this.renderError()}\n `\n }\n\n private resizeToFitContent() {\n const textarea = this.focusableRef.value\n\n if (!textarea) {\n return\n }\n\n if (this.resize === \"auto\") {\n textarea.style.height = \"auto\"\n textarea.style.height = `${textarea.scrollHeight}px`\n } else {\n // @ts-expect-error this is actually fine, and removes the style value\n textarea.style.height = null\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"nord-textarea\": Textarea\n }\n}\n"],"names":["Textarea","FormAssociatedMixin","InputMixin","FocusableMixin","DraftComponentMixin","LitElement","constructor","this","updated","changedProperties","has","resizeToFitContent","render","html","renderLabel","ref","focusableRef","inputId","disabled","required","ifDefined","name","value","placeholder","handleChange","getDescribedBy","getInvalid","renderError","textarea","resize","style","height","scrollHeight","formFieldStyle","textFieldStyle","__decorate","property","reflect","customElement"],"mappings":"4vBA2BA,IAAqBA,EAArB,cAAsCC,EAAoBC,EAAWC,EAAeC,EAAoBC,OAAxGC,kCAGYC,aAAU,WAOSA,YAA8B,WAE3DC,QAAQC,IACFA,EAAkBC,IAAI,WAAaD,EAAkBC,IAAI,WAC3DH,KAAKI,qBAITC,eACE,OAAOC,CAAI,GACPN,KAAKO,yDAIDC,EAAIR,KAAKS,qBACNT,KAAKU,uCAEEV,KAAKW,wBACLX,KAAKY,mBACVC,EAAUb,KAAKc,4BACbd,KAAKe,qBAAS,oBACTF,EAAUb,KAAKgB,0BACnBhB,KAAKiB,yBACNjB,KAAKI,yCACKS,EAAUb,KAAKkB,oCACnBL,EAAUb,KAAKmB,mCAIhCnB,KAAKoB,gBAIHhB,qBACN,MAAMiB,EAAWrB,KAAKS,aAAaM,MAE9BM,IAIe,SAAhBrB,KAAKsB,QACPD,EAASE,MAAMC,OAAS,OACxBH,EAASE,MAAMC,OAAS,GAAGH,EAASI,kBAGpCJ,EAASE,MAAMC,OAAS,QAtDrB/B,SAAS,CAACiC,EAAgBC,EAAgBJ,GASpBK,GAA5BC,EAAS,CAAEC,SAAS,kCAVFrC,KADpBsC,EAAc,kBACMtC,SAAAA"}
|
package/lib/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{default as Badge}from"./Badge.js";export{default as Button}from"./Button.js";export{default as Card}from"./Card.js";export{default as Input}from"./Input.js";export{I as Icon}from"./Icon-f6f1c764.js";export{default as CommandMenu}from"./CommandMenu.js";export{C as CommandMenuAction}from"./CommandMenuAction-879382c7.js";export{default as Select}from"./Select.js";export{default as Stack}from"./Stack.js";export{default as Table}from"./Table.js";export{default as VisuallyHidden}from"./VisuallyHidden.js";export{default as Textarea}from"./Textarea.js";import"./DraftComponentMixin-4bb26f5d.js";import"./property-03f59dce.js";import"./directive-40a31ee2.js";import"./ref-857246ae.js";import"./InputMixin-3e737480.js";import"./SlotController-fda28afb.js";import"./unsafe-html-7028f0a1.js";import"./FormField-02dd3b4f.js";import"./events-731d0007.js";import"./TextField-
|
|
1
|
+
export{default as Badge}from"./Badge.js";export{default as Button}from"./Button.js";export{default as Card}from"./Card.js";export{default as Input}from"./Input.js";export{I as Icon}from"./Icon-f6f1c764.js";export{default as CommandMenu}from"./CommandMenu.js";export{C as CommandMenuAction}from"./CommandMenuAction-879382c7.js";export{default as Select}from"./Select.js";export{default as Stack}from"./Stack.js";export{default as Table}from"./Table.js";export{default as VisuallyHidden}from"./VisuallyHidden.js";export{default as Textarea}from"./Textarea.js";import"./DraftComponentMixin-4bb26f5d.js";import"./property-03f59dce.js";import"./directive-40a31ee2.js";import"./ref-857246ae.js";import"./InputMixin-3e737480.js";import"./SlotController-fda28afb.js";import"./unsafe-html-7028f0a1.js";import"./FormField-02dd3b4f.js";import"./events-731d0007.js";import"./TextField-bfdc253c.js";import"./KeyboardController-28c7135b.js";import"./events.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nordhealth/components",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.39",
|
|
4
4
|
"description": "This package includes Nord Design System web components",
|
|
5
5
|
"author": "Nordhealth <info@nordhealth.com>",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -137,5 +137,5 @@
|
|
|
137
137
|
}
|
|
138
138
|
]
|
|
139
139
|
},
|
|
140
|
-
"gitHead": "
|
|
140
|
+
"gitHead": "cb6356b6f7298342706acb9579bca63544383daa"
|
|
141
141
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as n}from"./DraftComponentMixin-4bb26f5d.js";const r=n`.n-input-container{position:relative}.n-input{background:var(--n-color-active);color:var(--n-color-text);padding-block-start:calc(var(--n-space-s) - 1px);padding-block-end:calc(var(--n-space-s) - 1px);padding-inline-start:calc(var(--n-space-s) * 1.6);padding-inline-end:calc(var(--n-space-s) * 1.6);border-radius:var(--n-border-radius-s);border:1px solid var(--n-input-border-color,var(--n-color-border-strong));font-family:var(--n-font-family);font-size:var(--n-font-size-m);line-height:var(--n-line-height-form);min-inline-size:250px;transition:var(--n-transition-slowly)}@media (max-width:480px){.n-input{font-size:var(--n-font-size-l)}}:host([expand]) .n-input{display:block;inline-size:100%}.n-input:hover,.n-label-container:hover+.n-input-container .n-input{--n-input-border-color:var(--n-color-border-hover)}.n-input:focus{--n-input-border-color:var(--n-color-primary);background:var(--n-color-surface);outline:0;box-shadow:0 0 0 1px var(--n-input-border-color)}.n-input::placeholder{color:var(--n-color-text-weaker)}.n-input:focus::placeholder{color:var(--n-color-text-weakest)}.n-input:disabled{--n-input-border-color:var(--n-color-active);color:var(--n-color-text-weakest)}.n-input[aria-invalid=true]{--n-input-border-color:var(--n-color-status-danger)!important}`;export{r as s};
|
|
2
|
-
//# sourceMappingURL=TextField-afe4d64f.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TextField-afe4d64f.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|