@sankhyatronics/sankhya-cms 0.1.16 → 0.1.18
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 +229 -193
- package/dist/chunk-FML6AG2V.js +107 -0
- package/dist/chunk-FML6AG2V.js.map +1 -0
- package/dist/{chunk-G3CF7MBO.js → chunk-J6EO4R73.js} +27 -1
- package/dist/{chunk-G3CF7MBO.js.map → chunk-J6EO4R73.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/mega-menu/index.d.ts +2 -2
- package/dist/mega-menu/index.js +1 -1
- package/dist/tooltip/index.d.ts +18 -6
- package/dist/tooltip/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-XCA3XFFG.js +0 -74
- package/dist/chunk-XCA3XFFG.js.map +0 -1
package/custom-elements.json
CHANGED
|
@@ -910,192 +910,6 @@
|
|
|
910
910
|
}
|
|
911
911
|
]
|
|
912
912
|
},
|
|
913
|
-
{
|
|
914
|
-
"kind": "javascript-module",
|
|
915
|
-
"path": "src/content-block/ContentBlock.ts",
|
|
916
|
-
"declarations": [
|
|
917
|
-
{
|
|
918
|
-
"kind": "class",
|
|
919
|
-
"description": "A long-form article section: centered title/subtitle, an optional featured image with caption,\nthen Markdown body text. Ports `SankhyaUI`'s React `ContentBlock`. The body comes from\n`content-src` (a Markdown URL, as in the source) or an inline `content` string (added so the\nblock works without a fetch); `content-src` wins when both are set.",
|
|
920
|
-
"name": "ContentBlock",
|
|
921
|
-
"cssProperties": [
|
|
922
|
-
{
|
|
923
|
-
"description": "Overrides the block's padding.",
|
|
924
|
-
"name": "--st-content-block-padding"
|
|
925
|
-
}
|
|
926
|
-
],
|
|
927
|
-
"members": [
|
|
928
|
-
{
|
|
929
|
-
"kind": "field",
|
|
930
|
-
"name": "title",
|
|
931
|
-
"type": {
|
|
932
|
-
"text": "string"
|
|
933
|
-
},
|
|
934
|
-
"default": "''",
|
|
935
|
-
"attribute": "title"
|
|
936
|
-
},
|
|
937
|
-
{
|
|
938
|
-
"kind": "field",
|
|
939
|
-
"name": "subtitle",
|
|
940
|
-
"type": {
|
|
941
|
-
"text": "string"
|
|
942
|
-
},
|
|
943
|
-
"default": "''",
|
|
944
|
-
"attribute": "subtitle"
|
|
945
|
-
},
|
|
946
|
-
{
|
|
947
|
-
"kind": "field",
|
|
948
|
-
"name": "contentSrc",
|
|
949
|
-
"type": {
|
|
950
|
-
"text": "string"
|
|
951
|
-
},
|
|
952
|
-
"default": "''",
|
|
953
|
-
"description": "URL of a Markdown file.",
|
|
954
|
-
"attribute": "content-src"
|
|
955
|
-
},
|
|
956
|
-
{
|
|
957
|
-
"kind": "field",
|
|
958
|
-
"name": "content",
|
|
959
|
-
"type": {
|
|
960
|
-
"text": "string"
|
|
961
|
-
},
|
|
962
|
-
"default": "''",
|
|
963
|
-
"description": "Inline Markdown, used when `content-src` is not set.",
|
|
964
|
-
"attribute": "content"
|
|
965
|
-
},
|
|
966
|
-
{
|
|
967
|
-
"kind": "field",
|
|
968
|
-
"name": "imageSrc",
|
|
969
|
-
"type": {
|
|
970
|
-
"text": "string"
|
|
971
|
-
},
|
|
972
|
-
"default": "''",
|
|
973
|
-
"attribute": "image-src"
|
|
974
|
-
},
|
|
975
|
-
{
|
|
976
|
-
"kind": "field",
|
|
977
|
-
"name": "imageAlt",
|
|
978
|
-
"type": {
|
|
979
|
-
"text": "string"
|
|
980
|
-
},
|
|
981
|
-
"default": "''",
|
|
982
|
-
"attribute": "image-alt"
|
|
983
|
-
},
|
|
984
|
-
{
|
|
985
|
-
"kind": "field",
|
|
986
|
-
"name": "imageCaption",
|
|
987
|
-
"type": {
|
|
988
|
-
"text": "string"
|
|
989
|
-
},
|
|
990
|
-
"default": "''",
|
|
991
|
-
"attribute": "image-caption"
|
|
992
|
-
},
|
|
993
|
-
{
|
|
994
|
-
"kind": "field",
|
|
995
|
-
"name": "inverted",
|
|
996
|
-
"type": {
|
|
997
|
-
"text": "boolean"
|
|
998
|
-
},
|
|
999
|
-
"default": "false",
|
|
1000
|
-
"attribute": "inverted",
|
|
1001
|
-
"reflects": true
|
|
1002
|
-
}
|
|
1003
|
-
],
|
|
1004
|
-
"attributes": [
|
|
1005
|
-
{
|
|
1006
|
-
"name": "title",
|
|
1007
|
-
"type": {
|
|
1008
|
-
"text": "string"
|
|
1009
|
-
},
|
|
1010
|
-
"default": "''",
|
|
1011
|
-
"fieldName": "title"
|
|
1012
|
-
},
|
|
1013
|
-
{
|
|
1014
|
-
"name": "subtitle",
|
|
1015
|
-
"type": {
|
|
1016
|
-
"text": "string"
|
|
1017
|
-
},
|
|
1018
|
-
"default": "''",
|
|
1019
|
-
"fieldName": "subtitle"
|
|
1020
|
-
},
|
|
1021
|
-
{
|
|
1022
|
-
"name": "content-src",
|
|
1023
|
-
"type": {
|
|
1024
|
-
"text": "string"
|
|
1025
|
-
},
|
|
1026
|
-
"default": "''",
|
|
1027
|
-
"description": "URL of a Markdown file.",
|
|
1028
|
-
"fieldName": "contentSrc"
|
|
1029
|
-
},
|
|
1030
|
-
{
|
|
1031
|
-
"name": "content",
|
|
1032
|
-
"type": {
|
|
1033
|
-
"text": "string"
|
|
1034
|
-
},
|
|
1035
|
-
"default": "''",
|
|
1036
|
-
"description": "Inline Markdown, used when `content-src` is not set.",
|
|
1037
|
-
"fieldName": "content"
|
|
1038
|
-
},
|
|
1039
|
-
{
|
|
1040
|
-
"name": "image-src",
|
|
1041
|
-
"type": {
|
|
1042
|
-
"text": "string"
|
|
1043
|
-
},
|
|
1044
|
-
"default": "''",
|
|
1045
|
-
"fieldName": "imageSrc"
|
|
1046
|
-
},
|
|
1047
|
-
{
|
|
1048
|
-
"name": "image-alt",
|
|
1049
|
-
"type": {
|
|
1050
|
-
"text": "string"
|
|
1051
|
-
},
|
|
1052
|
-
"default": "''",
|
|
1053
|
-
"fieldName": "imageAlt"
|
|
1054
|
-
},
|
|
1055
|
-
{
|
|
1056
|
-
"name": "image-caption",
|
|
1057
|
-
"type": {
|
|
1058
|
-
"text": "string"
|
|
1059
|
-
},
|
|
1060
|
-
"default": "''",
|
|
1061
|
-
"fieldName": "imageCaption"
|
|
1062
|
-
},
|
|
1063
|
-
{
|
|
1064
|
-
"name": "inverted",
|
|
1065
|
-
"type": {
|
|
1066
|
-
"text": "boolean"
|
|
1067
|
-
},
|
|
1068
|
-
"default": "false",
|
|
1069
|
-
"fieldName": "inverted"
|
|
1070
|
-
}
|
|
1071
|
-
],
|
|
1072
|
-
"superclass": {
|
|
1073
|
-
"name": "LitElement",
|
|
1074
|
-
"package": "lit"
|
|
1075
|
-
},
|
|
1076
|
-
"tagName": "st-content-block",
|
|
1077
|
-
"customElement": true
|
|
1078
|
-
}
|
|
1079
|
-
],
|
|
1080
|
-
"exports": [
|
|
1081
|
-
{
|
|
1082
|
-
"kind": "js",
|
|
1083
|
-
"name": "ContentBlock",
|
|
1084
|
-
"declaration": {
|
|
1085
|
-
"name": "ContentBlock",
|
|
1086
|
-
"module": "src/content-block/ContentBlock.ts"
|
|
1087
|
-
}
|
|
1088
|
-
},
|
|
1089
|
-
{
|
|
1090
|
-
"kind": "custom-element-definition",
|
|
1091
|
-
"name": "st-content-block",
|
|
1092
|
-
"declaration": {
|
|
1093
|
-
"name": "ContentBlock",
|
|
1094
|
-
"module": "src/content-block/ContentBlock.ts"
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
1097
|
-
]
|
|
1098
|
-
},
|
|
1099
913
|
{
|
|
1100
914
|
"kind": "javascript-module",
|
|
1101
915
|
"path": "src/chip/Chip.ts",
|
|
@@ -1404,6 +1218,192 @@
|
|
|
1404
1218
|
}
|
|
1405
1219
|
]
|
|
1406
1220
|
},
|
|
1221
|
+
{
|
|
1222
|
+
"kind": "javascript-module",
|
|
1223
|
+
"path": "src/content-block/ContentBlock.ts",
|
|
1224
|
+
"declarations": [
|
|
1225
|
+
{
|
|
1226
|
+
"kind": "class",
|
|
1227
|
+
"description": "A long-form article section: centered title/subtitle, an optional featured image with caption,\nthen Markdown body text. Ports `SankhyaUI`'s React `ContentBlock`. The body comes from\n`content-src` (a Markdown URL, as in the source) or an inline `content` string (added so the\nblock works without a fetch); `content-src` wins when both are set.",
|
|
1228
|
+
"name": "ContentBlock",
|
|
1229
|
+
"cssProperties": [
|
|
1230
|
+
{
|
|
1231
|
+
"description": "Overrides the block's padding.",
|
|
1232
|
+
"name": "--st-content-block-padding"
|
|
1233
|
+
}
|
|
1234
|
+
],
|
|
1235
|
+
"members": [
|
|
1236
|
+
{
|
|
1237
|
+
"kind": "field",
|
|
1238
|
+
"name": "title",
|
|
1239
|
+
"type": {
|
|
1240
|
+
"text": "string"
|
|
1241
|
+
},
|
|
1242
|
+
"default": "''",
|
|
1243
|
+
"attribute": "title"
|
|
1244
|
+
},
|
|
1245
|
+
{
|
|
1246
|
+
"kind": "field",
|
|
1247
|
+
"name": "subtitle",
|
|
1248
|
+
"type": {
|
|
1249
|
+
"text": "string"
|
|
1250
|
+
},
|
|
1251
|
+
"default": "''",
|
|
1252
|
+
"attribute": "subtitle"
|
|
1253
|
+
},
|
|
1254
|
+
{
|
|
1255
|
+
"kind": "field",
|
|
1256
|
+
"name": "contentSrc",
|
|
1257
|
+
"type": {
|
|
1258
|
+
"text": "string"
|
|
1259
|
+
},
|
|
1260
|
+
"default": "''",
|
|
1261
|
+
"description": "URL of a Markdown file.",
|
|
1262
|
+
"attribute": "content-src"
|
|
1263
|
+
},
|
|
1264
|
+
{
|
|
1265
|
+
"kind": "field",
|
|
1266
|
+
"name": "content",
|
|
1267
|
+
"type": {
|
|
1268
|
+
"text": "string"
|
|
1269
|
+
},
|
|
1270
|
+
"default": "''",
|
|
1271
|
+
"description": "Inline Markdown, used when `content-src` is not set.",
|
|
1272
|
+
"attribute": "content"
|
|
1273
|
+
},
|
|
1274
|
+
{
|
|
1275
|
+
"kind": "field",
|
|
1276
|
+
"name": "imageSrc",
|
|
1277
|
+
"type": {
|
|
1278
|
+
"text": "string"
|
|
1279
|
+
},
|
|
1280
|
+
"default": "''",
|
|
1281
|
+
"attribute": "image-src"
|
|
1282
|
+
},
|
|
1283
|
+
{
|
|
1284
|
+
"kind": "field",
|
|
1285
|
+
"name": "imageAlt",
|
|
1286
|
+
"type": {
|
|
1287
|
+
"text": "string"
|
|
1288
|
+
},
|
|
1289
|
+
"default": "''",
|
|
1290
|
+
"attribute": "image-alt"
|
|
1291
|
+
},
|
|
1292
|
+
{
|
|
1293
|
+
"kind": "field",
|
|
1294
|
+
"name": "imageCaption",
|
|
1295
|
+
"type": {
|
|
1296
|
+
"text": "string"
|
|
1297
|
+
},
|
|
1298
|
+
"default": "''",
|
|
1299
|
+
"attribute": "image-caption"
|
|
1300
|
+
},
|
|
1301
|
+
{
|
|
1302
|
+
"kind": "field",
|
|
1303
|
+
"name": "inverted",
|
|
1304
|
+
"type": {
|
|
1305
|
+
"text": "boolean"
|
|
1306
|
+
},
|
|
1307
|
+
"default": "false",
|
|
1308
|
+
"attribute": "inverted",
|
|
1309
|
+
"reflects": true
|
|
1310
|
+
}
|
|
1311
|
+
],
|
|
1312
|
+
"attributes": [
|
|
1313
|
+
{
|
|
1314
|
+
"name": "title",
|
|
1315
|
+
"type": {
|
|
1316
|
+
"text": "string"
|
|
1317
|
+
},
|
|
1318
|
+
"default": "''",
|
|
1319
|
+
"fieldName": "title"
|
|
1320
|
+
},
|
|
1321
|
+
{
|
|
1322
|
+
"name": "subtitle",
|
|
1323
|
+
"type": {
|
|
1324
|
+
"text": "string"
|
|
1325
|
+
},
|
|
1326
|
+
"default": "''",
|
|
1327
|
+
"fieldName": "subtitle"
|
|
1328
|
+
},
|
|
1329
|
+
{
|
|
1330
|
+
"name": "content-src",
|
|
1331
|
+
"type": {
|
|
1332
|
+
"text": "string"
|
|
1333
|
+
},
|
|
1334
|
+
"default": "''",
|
|
1335
|
+
"description": "URL of a Markdown file.",
|
|
1336
|
+
"fieldName": "contentSrc"
|
|
1337
|
+
},
|
|
1338
|
+
{
|
|
1339
|
+
"name": "content",
|
|
1340
|
+
"type": {
|
|
1341
|
+
"text": "string"
|
|
1342
|
+
},
|
|
1343
|
+
"default": "''",
|
|
1344
|
+
"description": "Inline Markdown, used when `content-src` is not set.",
|
|
1345
|
+
"fieldName": "content"
|
|
1346
|
+
},
|
|
1347
|
+
{
|
|
1348
|
+
"name": "image-src",
|
|
1349
|
+
"type": {
|
|
1350
|
+
"text": "string"
|
|
1351
|
+
},
|
|
1352
|
+
"default": "''",
|
|
1353
|
+
"fieldName": "imageSrc"
|
|
1354
|
+
},
|
|
1355
|
+
{
|
|
1356
|
+
"name": "image-alt",
|
|
1357
|
+
"type": {
|
|
1358
|
+
"text": "string"
|
|
1359
|
+
},
|
|
1360
|
+
"default": "''",
|
|
1361
|
+
"fieldName": "imageAlt"
|
|
1362
|
+
},
|
|
1363
|
+
{
|
|
1364
|
+
"name": "image-caption",
|
|
1365
|
+
"type": {
|
|
1366
|
+
"text": "string"
|
|
1367
|
+
},
|
|
1368
|
+
"default": "''",
|
|
1369
|
+
"fieldName": "imageCaption"
|
|
1370
|
+
},
|
|
1371
|
+
{
|
|
1372
|
+
"name": "inverted",
|
|
1373
|
+
"type": {
|
|
1374
|
+
"text": "boolean"
|
|
1375
|
+
},
|
|
1376
|
+
"default": "false",
|
|
1377
|
+
"fieldName": "inverted"
|
|
1378
|
+
}
|
|
1379
|
+
],
|
|
1380
|
+
"superclass": {
|
|
1381
|
+
"name": "LitElement",
|
|
1382
|
+
"package": "lit"
|
|
1383
|
+
},
|
|
1384
|
+
"tagName": "st-content-block",
|
|
1385
|
+
"customElement": true
|
|
1386
|
+
}
|
|
1387
|
+
],
|
|
1388
|
+
"exports": [
|
|
1389
|
+
{
|
|
1390
|
+
"kind": "js",
|
|
1391
|
+
"name": "ContentBlock",
|
|
1392
|
+
"declaration": {
|
|
1393
|
+
"name": "ContentBlock",
|
|
1394
|
+
"module": "src/content-block/ContentBlock.ts"
|
|
1395
|
+
}
|
|
1396
|
+
},
|
|
1397
|
+
{
|
|
1398
|
+
"kind": "custom-element-definition",
|
|
1399
|
+
"name": "st-content-block",
|
|
1400
|
+
"declaration": {
|
|
1401
|
+
"name": "ContentBlock",
|
|
1402
|
+
"module": "src/content-block/ContentBlock.ts"
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
]
|
|
1406
|
+
},
|
|
1407
1407
|
{
|
|
1408
1408
|
"kind": "javascript-module",
|
|
1409
1409
|
"path": "src/date-tile/DateTile.ts",
|
|
@@ -4777,10 +4777,10 @@
|
|
|
4777
4777
|
"kind": "field",
|
|
4778
4778
|
"name": "variant",
|
|
4779
4779
|
"type": {
|
|
4780
|
-
"text": "'story' | 'overlay'"
|
|
4780
|
+
"text": "'story' | 'overlay' | 'tip'"
|
|
4781
4781
|
},
|
|
4782
4782
|
"default": "'story'",
|
|
4783
|
-
"description": "`story` (default) or `
|
|
4783
|
+
"description": "`story` (default), `overlay` (dark, over an image or gradient) or `tip` (light blue, for a hint).",
|
|
4784
4784
|
"attribute": "variant",
|
|
4785
4785
|
"reflects": true
|
|
4786
4786
|
},
|
|
@@ -4904,10 +4904,10 @@
|
|
|
4904
4904
|
{
|
|
4905
4905
|
"name": "variant",
|
|
4906
4906
|
"type": {
|
|
4907
|
-
"text": "'story' | 'overlay'"
|
|
4907
|
+
"text": "'story' | 'overlay' | 'tip'"
|
|
4908
4908
|
},
|
|
4909
4909
|
"default": "'story'",
|
|
4910
|
-
"description": "`story` (default) or `
|
|
4910
|
+
"description": "`story` (default), `overlay` (dark, over an image or gradient) or `tip` (light blue, for a hint).",
|
|
4911
4911
|
"fieldName": "variant"
|
|
4912
4912
|
},
|
|
4913
4913
|
{
|
|
@@ -6678,7 +6678,7 @@
|
|
|
6678
6678
|
"declarations": [
|
|
6679
6679
|
{
|
|
6680
6680
|
"kind": "class",
|
|
6681
|
-
"description": "A small label that shows above a control on hover and on keyboard focus
|
|
6681
|
+
"description": "A small label that shows above a control: after a short rest on hover, and at once on keyboard focus.\nWrap the control (a button or an icon button) in it and pass the same words as its accessible name in\n`text`. The control is still the thing that's announced; the bubble is decorative (`aria-hidden`), so the\nwords aren't read twice.\n\nThe bubble is `position: fixed` and placed from the wrapper's position when it shows, so a clipping\nancestor (a card or panel with `overflow: hidden`) can't cut it off. It shows around a control that\ncan't act right now too, as long as that control is focusable or hoverable (use `aria-disabled`, not\nthe native `disabled`, which takes a control out of focus and pointer events).",
|
|
6682
6682
|
"name": "Tooltip",
|
|
6683
6683
|
"members": [
|
|
6684
6684
|
{
|
|
@@ -6688,8 +6688,44 @@
|
|
|
6688
6688
|
"text": "string"
|
|
6689
6689
|
},
|
|
6690
6690
|
"default": "''",
|
|
6691
|
-
"description": "The words shown in the bubble: the same words as the control's accessible name.",
|
|
6691
|
+
"description": "The words shown in the bubble: the same words as the control's accessible name, or the reason the\ncontrol can't act right now.",
|
|
6692
6692
|
"attribute": "text"
|
|
6693
|
+
},
|
|
6694
|
+
{
|
|
6695
|
+
"kind": "field",
|
|
6696
|
+
"name": "bubble",
|
|
6697
|
+
"type": {
|
|
6698
|
+
"text": "HTMLElement | undefined"
|
|
6699
|
+
},
|
|
6700
|
+
"privacy": "private"
|
|
6701
|
+
},
|
|
6702
|
+
{
|
|
6703
|
+
"kind": "field",
|
|
6704
|
+
"name": "timer",
|
|
6705
|
+
"type": {
|
|
6706
|
+
"text": "number | undefined"
|
|
6707
|
+
},
|
|
6708
|
+
"privacy": "private"
|
|
6709
|
+
},
|
|
6710
|
+
{
|
|
6711
|
+
"kind": "field",
|
|
6712
|
+
"name": "onPointerEnter",
|
|
6713
|
+
"privacy": "private"
|
|
6714
|
+
},
|
|
6715
|
+
{
|
|
6716
|
+
"kind": "method",
|
|
6717
|
+
"name": "cancel",
|
|
6718
|
+
"privacy": "private"
|
|
6719
|
+
},
|
|
6720
|
+
{
|
|
6721
|
+
"kind": "field",
|
|
6722
|
+
"name": "show",
|
|
6723
|
+
"privacy": "private"
|
|
6724
|
+
},
|
|
6725
|
+
{
|
|
6726
|
+
"kind": "field",
|
|
6727
|
+
"name": "hide",
|
|
6728
|
+
"privacy": "private"
|
|
6693
6729
|
}
|
|
6694
6730
|
],
|
|
6695
6731
|
"attributes": [
|
|
@@ -6699,7 +6735,7 @@
|
|
|
6699
6735
|
"text": "string"
|
|
6700
6736
|
},
|
|
6701
6737
|
"default": "''",
|
|
6702
|
-
"description": "The words shown in the bubble: the same words as the control's accessible name.",
|
|
6738
|
+
"description": "The words shown in the bubble: the same words as the control's accessible name, or the reason the\ncontrol can't act right now.",
|
|
6703
6739
|
"fieldName": "text"
|
|
6704
6740
|
}
|
|
6705
6741
|
],
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fontFamilyStyles
|
|
3
|
+
} from "./chunk-KMU6ABQF.js";
|
|
4
|
+
import {
|
|
5
|
+
__decorateClass
|
|
6
|
+
} from "./chunk-EUXUH3YW.js";
|
|
7
|
+
|
|
8
|
+
// src/tooltip/Tooltip.ts
|
|
9
|
+
import { LitElement, css, html } from "lit";
|
|
10
|
+
import { customElement, property } from "lit/decorators.js";
|
|
11
|
+
var HOVER_DELAY_MS = 300;
|
|
12
|
+
var Tooltip = class extends LitElement {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.text = "";
|
|
16
|
+
this.onPointerEnter = () => {
|
|
17
|
+
this.cancel();
|
|
18
|
+
this.timer = window.setTimeout(this.show, HOVER_DELAY_MS);
|
|
19
|
+
};
|
|
20
|
+
this.show = () => {
|
|
21
|
+
this.cancel();
|
|
22
|
+
if (!this.bubble || !this.text) return;
|
|
23
|
+
const box = this.getBoundingClientRect();
|
|
24
|
+
this.bubble.style.left = `${box.left + box.width / 2}px`;
|
|
25
|
+
this.bubble.style.top = `${box.top}px`;
|
|
26
|
+
this.bubble.setAttribute("data-open", "");
|
|
27
|
+
};
|
|
28
|
+
this.hide = () => {
|
|
29
|
+
this.cancel();
|
|
30
|
+
this.bubble?.removeAttribute("data-open");
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
connectedCallback() {
|
|
34
|
+
super.connectedCallback();
|
|
35
|
+
this.addEventListener("pointerenter", this.onPointerEnter);
|
|
36
|
+
this.addEventListener("pointerleave", this.hide);
|
|
37
|
+
this.addEventListener("focusin", this.show);
|
|
38
|
+
this.addEventListener("focusout", this.hide);
|
|
39
|
+
}
|
|
40
|
+
disconnectedCallback() {
|
|
41
|
+
super.disconnectedCallback();
|
|
42
|
+
this.removeEventListener("pointerenter", this.onPointerEnter);
|
|
43
|
+
this.removeEventListener("pointerleave", this.hide);
|
|
44
|
+
this.removeEventListener("focusin", this.show);
|
|
45
|
+
this.removeEventListener("focusout", this.hide);
|
|
46
|
+
this.cancel();
|
|
47
|
+
}
|
|
48
|
+
firstUpdated() {
|
|
49
|
+
this.bubble = this.renderRoot.querySelector(".bubble") ?? void 0;
|
|
50
|
+
}
|
|
51
|
+
cancel() {
|
|
52
|
+
if (this.timer !== void 0) window.clearTimeout(this.timer);
|
|
53
|
+
this.timer = void 0;
|
|
54
|
+
}
|
|
55
|
+
render() {
|
|
56
|
+
return html`<slot></slot><span class="bubble" part="bubble" aria-hidden="true">${this.text}</span>`;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
Tooltip.styles = css`
|
|
60
|
+
${fontFamilyStyles}
|
|
61
|
+
|
|
62
|
+
:host {
|
|
63
|
+
display: inline-flex;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.bubble {
|
|
67
|
+
position: fixed;
|
|
68
|
+
z-index: 1000;
|
|
69
|
+
left: 0;
|
|
70
|
+
top: 0;
|
|
71
|
+
transform: translate(-50%, calc(-100% - 6px));
|
|
72
|
+
padding: var(--st-space-4) var(--st-space-8);
|
|
73
|
+
border-radius: var(--st-radius-xs);
|
|
74
|
+
background: var(--st-color-text-strong);
|
|
75
|
+
color: var(--st-color-on-solid);
|
|
76
|
+
font-size: var(--st-text-xs);
|
|
77
|
+
font-weight: var(--st-font-weight-medium);
|
|
78
|
+
line-height: 1.3;
|
|
79
|
+
white-space: nowrap;
|
|
80
|
+
pointer-events: none;
|
|
81
|
+
opacity: 0;
|
|
82
|
+
visibility: hidden;
|
|
83
|
+
transition: opacity 0.12s ease;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.bubble[data-open] {
|
|
87
|
+
opacity: 1;
|
|
88
|
+
visibility: visible;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@media (prefers-reduced-motion: reduce) {
|
|
92
|
+
.bubble {
|
|
93
|
+
transition: none;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
`;
|
|
97
|
+
__decorateClass([
|
|
98
|
+
property({ type: String })
|
|
99
|
+
], Tooltip.prototype, "text", 2);
|
|
100
|
+
Tooltip = __decorateClass([
|
|
101
|
+
customElement("st-tooltip")
|
|
102
|
+
], Tooltip);
|
|
103
|
+
|
|
104
|
+
export {
|
|
105
|
+
Tooltip
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=chunk-FML6AG2V.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tooltip/Tooltip.ts"],"sourcesContent":["import { LitElement, css, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { fontFamilyStyles } from '../shared/styles';\n\n/** How long a pointer must rest on the control before its label shows. Keyboard focus shows it at once. */\nconst HOVER_DELAY_MS = 300;\n\n/**\n * A small label that shows above a control: after a short rest on hover, and at once on keyboard focus.\n * Wrap the control (a button or an icon button) in it and pass the same words as its accessible name in\n * `text`. The control is still the thing that's announced; the bubble is decorative (`aria-hidden`), so the\n * words aren't read twice.\n *\n * The bubble is `position: fixed` and placed from the wrapper's position when it shows, so a clipping\n * ancestor (a card or panel with `overflow: hidden`) can't cut it off. It shows around a control that\n * can't act right now too, as long as that control is focusable or hoverable (use `aria-disabled`, not\n * the native `disabled`, which takes a control out of focus and pointer events).\n */\n@customElement('st-tooltip')\nexport class Tooltip extends LitElement {\n static styles = css`\n ${fontFamilyStyles}\n\n :host {\n display: inline-flex;\n }\n\n .bubble {\n position: fixed;\n z-index: 1000;\n left: 0;\n top: 0;\n transform: translate(-50%, calc(-100% - 6px));\n padding: var(--st-space-4) var(--st-space-8);\n border-radius: var(--st-radius-xs);\n background: var(--st-color-text-strong);\n color: var(--st-color-on-solid);\n font-size: var(--st-text-xs);\n font-weight: var(--st-font-weight-medium);\n line-height: 1.3;\n white-space: nowrap;\n pointer-events: none;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.12s ease;\n }\n\n .bubble[data-open] {\n opacity: 1;\n visibility: visible;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .bubble {\n transition: none;\n }\n }\n `;\n\n /** The words shown in the bubble: the same words as the control's accessible name, or the reason the\n * control can't act right now. */\n @property({ type: String })\n text = '';\n\n private bubble?: HTMLElement;\n private timer?: number;\n\n connectedCallback() {\n super.connectedCallback();\n this.addEventListener('pointerenter', this.onPointerEnter);\n this.addEventListener('pointerleave', this.hide);\n this.addEventListener('focusin', this.show);\n this.addEventListener('focusout', this.hide);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('pointerenter', this.onPointerEnter);\n this.removeEventListener('pointerleave', this.hide);\n this.removeEventListener('focusin', this.show);\n this.removeEventListener('focusout', this.hide);\n this.cancel();\n }\n\n firstUpdated() {\n this.bubble = this.renderRoot.querySelector<HTMLElement>('.bubble') ?? undefined;\n }\n\n private onPointerEnter = () => {\n this.cancel();\n this.timer = window.setTimeout(this.show, HOVER_DELAY_MS);\n };\n\n private cancel() {\n if (this.timer !== undefined) window.clearTimeout(this.timer);\n this.timer = undefined;\n }\n\n private show = () => {\n this.cancel();\n if (!this.bubble || !this.text) return;\n const box = this.getBoundingClientRect();\n this.bubble.style.left = `${box.left + box.width / 2}px`;\n this.bubble.style.top = `${box.top}px`;\n this.bubble.setAttribute('data-open', '');\n };\n\n private hide = () => {\n this.cancel();\n this.bubble?.removeAttribute('data-open');\n };\n\n render() {\n return html`<slot></slot><span class=\"bubble\"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AAAA,EAOQ,SAAS;AACf,QAAI,KAAK,UAAU,OAAW,QAAO,aAAa,KAAK,KAAK;AAC5D,SAAK,QAAQ;AAAA,EACf;AAAA,EAgBA,SAAS;AACP,WAAO,0EAA0E,KAAK,IAAI;AAAA,EAC5F;AACF;AAhGa,QACJ,SAAS;AAAA,MACZ,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyCpB;AAAA,EADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GA1Cf,QA2CX;AA3CW,UAAN;AAAA,EADN,cAAc,YAAY;AAAA,GACd;","names":[]}
|
|
@@ -555,6 +555,32 @@ MegaMenuFeature.styles = css3`
|
|
|
555
555
|
color: inherit;
|
|
556
556
|
}
|
|
557
557
|
|
|
558
|
+
/* tip: a light-blue card with dark text, like a tip panel on a page. */
|
|
559
|
+
:host([variant='tip']) .card {
|
|
560
|
+
gap: 0.5rem;
|
|
561
|
+
padding: 1.25rem;
|
|
562
|
+
border-radius: var(--st-radius-md);
|
|
563
|
+
border: 1px solid var(--st-color-accent-border);
|
|
564
|
+
background: var(--st-color-accent-subtle);
|
|
565
|
+
color: var(--st-color-text);
|
|
566
|
+
transition: border-color 0.2s ease;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
:host([variant='tip']) .card:hover {
|
|
570
|
+
border-color: var(--st-color-accent-muted);
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
:host([variant='tip']) .title {
|
|
574
|
+
font-size: var(--st-text-lg);
|
|
575
|
+
font-weight: var(--st-font-weight-semibold);
|
|
576
|
+
color: var(--st-color-text-strong);
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
:host([variant='tip']) .eyebrow,
|
|
580
|
+
:host([variant='tip']) .cta {
|
|
581
|
+
color: var(--st-color-accent-text);
|
|
582
|
+
}
|
|
583
|
+
|
|
558
584
|
@media (prefers-reduced-motion: reduce) {
|
|
559
585
|
.image,
|
|
560
586
|
:host([variant='overlay']) .card {
|
|
@@ -604,4 +630,4 @@ export {
|
|
|
604
630
|
MegaMenuColumn,
|
|
605
631
|
MegaMenuFeature
|
|
606
632
|
};
|
|
607
|
-
//# sourceMappingURL=chunk-
|
|
633
|
+
//# sourceMappingURL=chunk-J6EO4R73.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/mega-menu/MegaMenu.ts","../src/mega-menu/MegaMenuColumn.ts","../src/mega-menu/MegaMenuFeature.ts"],"sourcesContent":["import { LitElement, css, html, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\n\nimport { controlBaseStyles, fontFamilyStyles } from '../shared/styles';\n\n/**\n * The rich layout of a mega-menu panel, after okta.com: an optional intro column on the left (a\n * large `heading`, a `description` and, under a divider, quick links in `slot=\"intro\"`), then the\n * link columns side by side (`st-mega-menu-column`s in the default slot), then an optional\n * featured column on the right (`featured-heading` over the `st-mega-menu-feature` cards in\n * `slot=\"featured\"`). Slot it into an `st-dropdown` with `mega` set.\n *\n * The layout follows the width it is given, not the viewport (a container query): side by side\n * when there is room; intro and featured column above/below two link columns on a medium panel;\n * everything stacked in the narrow drill-down panel `st-header` shows on a phone (where the intro\n * heading is left out — the drill-down already shows the section's name).\n *\n * @slot - The link columns (`st-mega-menu-column`s, or any blocks).\n * @slot intro - Quick links under the intro text, e.g. `st-menu-item`s with an icon.\n * @slot featured - Promo cards (`st-mega-menu-feature`s), stacked.\n * @csspart inner - The grid holding every area.\n * @csspart intro - The intro column.\n * @csspart columns - The grid holding the link columns.\n * @csspart featured - The featured column.\n */\n@customElement('st-mega-menu')\nexport class MegaMenu extends LitElement {\n static styles = css`\n ${controlBaseStyles}\n\n :host {\n display: block;\n container-type: inline-size;\n ${fontFamilyStyles}\n }\n\n .inner {\n display: grid;\n gap: 3rem;\n padding: 3rem 3.5rem;\n box-sizing: border-box;\n }\n\n .columns {\n display: grid;\n grid-template-columns: repeat(var(--st-mega-menu-columns, 3), minmax(0, 1fr));\n gap: 3rem;\n align-items: stretch;\n }\n\n .intro,\n .featured {\n display: flex;\n flex-direction: column;\n min-width: 0;\n }\n\n .intro-heading {\n margin: 0 0 1rem;\n font-size: 2rem;\n font-weight: 400;\n line-height: 1.15;\n color: var(--st-color-text-strong);\n }\n\n .intro-description {\n margin: 0;\n font-size: 1rem;\n line-height: 1.55;\n color: var(--st-color-text);\n }\n\n .intro-links {\n display: flex;\n flex-direction: column;\n gap: 2px;\n margin-top: 2.5rem;\n padding-top: 2rem;\n border-top: 1px solid var(--st-color-border);\n }\n\n .intro-links.no-text {\n margin-top: 0;\n padding-top: 0;\n border-top: 0;\n }\n\n .featured-heading {\n margin: 0 0 1rem;\n font-size: 1.125rem;\n font-weight: 500;\n line-height: 1.35;\n color: var(--st-color-text-strong);\n }\n\n .featured-items {\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n }\n\n [hidden] {\n display: none !important;\n }\n\n /* Medium panel: intro on top, two link columns, featured cards side by side underneath. */\n @container (max-width: 960px) {\n .inner {\n grid-template-columns: minmax(0, 1fr) !important;\n gap: 2rem;\n padding: 2rem;\n }\n\n .columns {\n grid-template-columns: repeat(var(--st-mega-menu-columns-md, 2), minmax(0, 1fr));\n gap: 2rem;\n }\n\n .intro-links {\n margin-top: 1.5rem;\n padding-top: 1.5rem;\n }\n\n .featured-items {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));\n }\n }\n\n /* Narrow panel (the phone drill-down): everything stacked. */\n @container (max-width: 560px) {\n .inner {\n gap: 1.75rem;\n padding: 0.5rem 0 1.5rem;\n }\n\n .columns {\n grid-template-columns: minmax(0, 1fr);\n gap: 1.75rem;\n }\n\n .intro-heading {\n display: none;\n }\n }\n `;\n\n /** Large title of the intro column. */\n @property({ type: String })\n heading = '';\n\n /** Text under the intro title. */\n @property({ type: String })\n description = '';\n\n /** Heading over the featured cards. */\n @property({ type: String, attribute: 'featured-heading' })\n featuredHeading = '';\n\n /** Number of link columns side by side at full width. `0` (the default) uses one per slotted column. */\n @property({ type: Number })\n columns = 0;\n\n @state() private columnCount = 1;\n @state() private hasIntroLinks = false;\n @state() private hasFeatured = false;\n\n private onColumnsSlotChange = (event: Event): void => {\n this.columnCount = Math.max(1, (event.target as HTMLSlotElement).assignedElements({ flatten: true }).length);\n };\n\n private onIntroSlotChange = (event: Event): void => {\n this.hasIntroLinks = (event.target as HTMLSlotElement).assignedElements({ flatten: true }).length > 0;\n };\n\n private onFeaturedSlotChange = (event: Event): void => {\n this.hasFeatured = (event.target as HTMLSlotElement).assignedElements({ flatten: true }).length > 0;\n };\n\n render() {\n const columns = Math.min(6, Math.max(1, Math.round(this.columns) || this.columnCount));\n const hasIntroText = !!(this.heading || this.description);\n const hasIntro = hasIntroText || this.hasIntroLinks;\n const hasFeatured = this.hasFeatured || !!this.featuredHeading;\n // Every column — intro, each link column, featured — gets the same share of the width.\n const tracks = [hasIntro ? 'minmax(0, 1fr)' : '', `minmax(0, ${columns}fr)`, hasFeatured ? 'minmax(0, 1fr)' : '']\n .filter(Boolean)\n .join(' ');\n return html`\n <div\n part=\"inner\"\n class=\"inner\"\n style=\"grid-template-columns:${tracks};--st-mega-menu-columns:${columns};--st-mega-menu-columns-md:${Math.min(2, columns)}\"\n >\n <div part=\"intro\" class=\"intro\" ?hidden=${!hasIntro}>\n ${this.heading ? html`<p part=\"heading\" class=\"intro-heading\">${this.heading}</p>` : nothing}\n ${this.description ? html`<p part=\"description\" class=\"intro-description\">${this.description}</p>` : nothing}\n <div part=\"intro-links\" class=\"intro-links ${hasIntroText ? '' : 'no-text'}\" ?hidden=${!this.hasIntroLinks}>\n <slot name=\"intro\" @slotchange=${this.onIntroSlotChange}></slot>\n </div>\n </div>\n <div part=\"columns\" class=\"columns\"><slot @slotchange=${this.onColumnsSlotChange}></slot></div>\n <div part=\"featured\" class=\"featured\" ?hidden=${!hasFeatured}>\n ${this.featuredHeading ? html`<p part=\"featured-heading\" class=\"featured-heading\">${this.featuredHeading}</p>` : nothing}\n <div class=\"featured-items\"><slot name=\"featured\" @slotchange=${this.onFeaturedSlotChange}></slot></div>\n </div>\n </div>\n `;\n }\n}\n","import { LitElement, css, html, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { arrowUpRightIcon } from '../shared/icons';\nimport { controlBaseStyles, fontFamilyStyles } from '../shared/styles';\nimport type { MegaMenuSelectEventDetail } from './MegaMenuEvents';\n\n/**\n * One column (or one group within a column) of an `st-mega-menu`: a heading, an optional line of\n * description, then its links stacked — usually `st-menu-item`s with `variant=\"link\"`. Nest\n * columns to stack several headed groups in one column, as okta.com does.\n *\n * `variant=\"card\"` puts the column on a tinted rounded tile and `variant=\"accent\"` on a solid\n * accent tile with light text; both suit a row of equal columns without intro or featured area.\n * `cta-label` + `cta-href` add a pill button at the bottom of the column.\n *\n * The heading (when `href` is set) and the button fire a *cancelable* `mega-menu-select` event\n * (detail: `{ href }`) before navigating; a host doing client-side routing calls\n * `event.preventDefault()` on it.\n *\n * @slot - The column's links, or nested `st-mega-menu-column` groups.\n * @fires mega-menu-select - The heading link or the button was clicked (cancelable; detail `{ href }`).\n * @csspart heading - The heading text or link.\n * @csspart description - The line under the heading.\n * @csspart items - The box holding the links.\n * @csspart cta - The pill button.\n * @cssprop --st-mega-menu-column-padding - Overrides the padding of a `card`/`accent` column.\n */\n@customElement('st-mega-menu-column')\nexport class MegaMenuColumn extends LitElement {\n static styles = css`\n ${controlBaseStyles}\n\n :host {\n display: flex;\n flex-direction: column;\n min-width: 0;\n box-sizing: border-box;\n ${fontFamilyStyles}\n }\n\n :host([variant='card']),\n :host([variant='accent']) {\n /* !important: a page-level reset (e.g. Tailwind Preflight) otherwise zeroes a shadow host's\n padding; override with --st-mega-menu-column-padding instead. */\n padding: var(--st-mega-menu-column-padding, 2rem 1.75rem 1.75rem) !important;\n border-radius: 20px;\n background: color-mix(in oklch, var(--st-color-text-strong) 5%, var(--st-color-surface));\n }\n\n :host([variant='accent']) {\n background: var(--st-color-accent);\n color: var(--st-color-on-solid);\n /* Read by the st-menu-item links inside. */\n --st-nav-color: var(--st-color-on-solid);\n --st-nav-hover-bg: transparent;\n }\n\n .heading {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n margin: 0 0 0.75rem;\n font-size: 1.125rem;\n font-weight: 500;\n line-height: 1.35;\n color: var(--st-color-text-strong);\n text-decoration: none;\n }\n\n :host([variant='card']) .heading,\n :host([variant='accent']) .heading {\n font-size: 1.375rem;\n }\n\n :host([variant='accent']) .heading {\n color: inherit;\n }\n\n a.heading:hover,\n a.heading:focus-visible {\n text-decoration: underline;\n text-underline-offset: 4px;\n }\n\n .description {\n margin: -0.25rem 0 0.75rem;\n font-size: 0.875rem;\n line-height: 1.5;\n color: var(--st-color-text-muted);\n }\n\n :host([variant='accent']) .description {\n color: inherit;\n opacity: 0.85;\n }\n\n .items {\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n\n /* Nested groups stack with room between them (!important for the same page-reset reason). */\n ::slotted(st-mega-menu-column:not(:first-child)) {\n margin-top: 2rem !important;\n }\n\n .cta {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: 0.875rem 1.5rem;\n border-radius: 9999px;\n background: var(--st-color-surface);\n color: var(--st-color-text-strong);\n font-size: 1rem;\n font-weight: 500;\n text-align: center;\n text-decoration: none;\n transition: box-shadow 0.2s ease;\n }\n\n .cta-spacer {\n flex: 1;\n min-height: 1.75rem;\n }\n\n .cta:hover,\n .cta:focus-visible {\n box-shadow: 0 0 0 2px currentColor;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .cta {\n transition: none;\n }\n }\n `;\n\n @property({ type: String })\n heading = '';\n\n /** Makes the heading a link (e.g. to the section's overview page). */\n @property({ type: String })\n href = '';\n\n @property({ type: String })\n description = '';\n\n /** `plain` (default), `card` (tinted tile) or `accent` (solid accent tile, light text). */\n @property({ type: String, reflect: true })\n variant: 'plain' | 'card' | 'accent' = 'plain';\n\n /** Text of a pill button at the bottom of the column; needs `cta-href`. */\n @property({ type: String, attribute: 'cta-label' })\n ctaLabel = '';\n\n @property({ type: String, attribute: 'cta-href' })\n ctaHref = '';\n\n private select(event: MouseEvent, href: string): void {\n if (href.startsWith('http')) return;\n const selectEvent = new CustomEvent<MegaMenuSelectEventDetail>('mega-menu-select', {\n detail: { href },\n bubbles: true,\n composed: true,\n cancelable: true\n });\n this.dispatchEvent(selectEvent);\n if (selectEvent.defaultPrevented) event.preventDefault();\n }\n\n private renderHeading() {\n if (!this.heading) return nothing;\n return this.href\n ? html`<a part=\"heading\" class=\"heading\" href=${this.href} @click=${(event: MouseEvent) => this.select(event, this.href)}\n >${this.heading}</a\n >`\n : html`<p part=\"heading\" class=\"heading\">${this.heading}</p>`;\n }\n\n private renderCta() {\n if (!this.ctaLabel || !this.ctaHref) return nothing;\n const external = this.ctaHref.startsWith('http');\n return html`\n <span class=\"cta-spacer\"></span>\n <a\n part=\"cta\"\n class=\"cta\"\n href=${this.ctaHref}\n target=${external ? '_blank' : '_self'}\n rel=${external ? 'noopener noreferrer' : nothing}\n @click=${(event: MouseEvent) => this.select(event, this.ctaHref)}\n >${this.ctaLabel} ${external ? arrowUpRightIcon(14) : nothing}</a\n >\n `;\n }\n\n render() {\n return html`\n ${this.renderHeading()}\n ${this.description ? html`<p part=\"description\" class=\"description\">${this.description}</p>` : nothing}\n <div part=\"items\" class=\"items\" role=\"group\" aria-label=${this.heading || nothing}><slot></slot></div>\n ${this.renderCta()}\n `;\n }\n}\n","import { LitElement, css, html, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { controlBaseStyles, fontFamilyStyles } from '../shared/styles';\nimport type { MegaMenuSelectEventDetail } from './MegaMenuEvents';\n\n/**\n * A promo card for the featured column of an `st-mega-menu` (`slot=\"featured\"`). The whole card\n * is one link. Two looks, after okta.com:\n *\n * - `story` (default): a rounded image on top, then the description and an underlined\n * call-to-action line — a customer story or announcement.\n * - `overlay`: a tile with light text over `image-url` (darkened), or over an accent gradient when\n * there is no image — an optional `logo-url` top left, the title and description at the bottom.\n *\n * An `http(s)` `href` opens in a new tab unless `target` says otherwise. Any other `href` fires a\n * *cancelable* `mega-menu-select` event (detail: `{ href }`) first; a host doing client-side\n * routing calls `event.preventDefault()` on it.\n *\n * @fires mega-menu-select - The card was clicked (cancelable; detail `{ href }`).\n * @csspart card - The card link.\n * @csspart image - The image (`story`).\n * @csspart logo - The logo (`overlay`).\n * @csspart eyebrow - The small label above the title.\n * @csspart title - The title.\n * @csspart description - The description.\n * @csspart cta - The call-to-action line.\n * @cssprop --st-mega-menu-feature-from - Start colour of the `overlay` gradient (default: the accent colour).\n * @cssprop --st-mega-menu-feature-to - End colour of the `overlay` gradient.\n */\n@customElement('st-mega-menu-feature')\nexport class MegaMenuFeature extends LitElement {\n /** `focus()` on the element focuses its link, so `st-dropdown` can arrow-key to it. */\n static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };\n\n static styles = css`\n ${controlBaseStyles}\n\n :host {\n display: block;\n ${fontFamilyStyles}\n }\n\n .card {\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n box-sizing: border-box;\n color: var(--st-color-text-strong);\n text-decoration: none;\n }\n\n .image {\n display: block;\n width: 100%;\n aspect-ratio: 9 / 8;\n object-fit: cover;\n border-radius: 20px;\n transition: transform 0.3s ease;\n }\n\n .card:hover .image {\n transform: scale(1.015);\n }\n\n .eyebrow {\n font-size: 0.75rem;\n font-weight: 600;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n color: var(--st-color-accent-text);\n }\n\n .title {\n margin: 0;\n font-size: 1.125rem;\n font-weight: 500;\n line-height: 1.3;\n }\n\n .description {\n margin: 0;\n font-size: 0.9375rem;\n line-height: 1.5;\n }\n\n .cta {\n align-self: flex-start;\n margin-top: 0.75rem;\n font-size: 0.9375rem;\n font-weight: 500;\n text-decoration: underline;\n text-underline-offset: 5px;\n text-decoration-thickness: 1px;\n }\n\n .card:hover .cta,\n .card:focus-visible .cta {\n text-decoration-thickness: 2px;\n }\n\n /* overlay */\n :host([variant='overlay']) .card {\n justify-content: flex-end;\n gap: 0.5rem;\n min-height: 15rem;\n padding: 1.75rem;\n border-radius: 20px;\n color: #fff;\n background-color: var(--st-color-accent);\n background-image:\n linear-gradient(to top, rgb(0 0 0 / 0.55), rgb(0 0 0 / 0.05)),\n var(--st-mega-menu-feature-image, linear-gradient(160deg, var(--st-mega-menu-feature-from, var(--st-color-accent)), var(--st-mega-menu-feature-to, oklch(0.25 0.12 280))));\n background-size: cover;\n background-position: center;\n transition: transform 0.2s ease;\n }\n\n :host([variant='overlay']) .card:hover {\n transform: translateY(-2px);\n }\n\n :host([variant='overlay']) .logo {\n height: 2.25rem;\n width: auto;\n max-width: 70%;\n margin-bottom: auto;\n align-self: flex-start;\n object-fit: contain;\n }\n\n :host([variant='overlay']) .title {\n font-size: 1.75rem;\n font-weight: 400;\n }\n\n :host([variant='overlay']) .eyebrow,\n :host([variant='overlay']) .cta {\n color: inherit;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .image,\n :host([variant='overlay']) .card {\n transition: none;\n }\n }\n `;\n\n /** `story` (default) or `overlay` — see the element description. */\n @property({ type: String, reflect: true })\n variant: 'story' | 'overlay' = 'story';\n\n @property({ type: String })\n title = '';\n\n @property({ type: String })\n description = '';\n\n /** Small label above the title, e.g. \"New\" or \"Report\". */\n @property({ type: String })\n eyebrow = '';\n\n @property({ type: String })\n href = '';\n\n /** `target` for the link. Defaults to `_blank` for an `http(s)` `href`, `_self` otherwise. */\n @property({ type: String })\n target = '';\n\n /** Image on top (`story`) or behind the text (`overlay`). */\n @property({ type: String, attribute: 'image-url' })\n imageUrl = '';\n\n @property({ type: String, attribute: 'image-alt' })\n imageAlt = '';\n\n /** Logo at the top of an `overlay` card. */\n @property({ type: String, attribute: 'logo-url' })\n logoUrl = '';\n\n @property({ type: String, attribute: 'logo-alt' })\n logoAlt = '';\n\n /** Call-to-action text at the bottom of the card; empty hides it. */\n @property({ type: String, attribute: 'cta-label' })\n ctaLabel = '';\n\n private get isExternal(): boolean {\n return this.href.startsWith('http');\n }\n\n private onClick = (event: MouseEvent): void => {\n if (this.isExternal) return;\n const selectEvent = new CustomEvent<MegaMenuSelectEventDetail>('mega-menu-select', {\n detail: { href: this.href },\n bubbles: true,\n composed: true,\n cancelable: true\n });\n this.dispatchEvent(selectEvent);\n if (selectEvent.defaultPrevented) event.preventDefault();\n };\n\n render() {\n const target = this.target || (this.isExternal ? '_blank' : '_self');\n const overlay = this.variant === 'overlay';\n const style = overlay && this.imageUrl ? `--st-mega-menu-feature-image:url(${JSON.stringify(this.imageUrl)})` : '';\n return html`\n <a\n part=\"card\"\n class=\"card\"\n style=${style}\n href=${this.href || nothing}\n target=${target}\n rel=${target === '_blank' ? 'noopener noreferrer' : nothing}\n @click=${this.onClick}\n >\n ${overlay && this.logoUrl ? html`<img part=\"logo\" class=\"logo\" src=${this.logoUrl} alt=${this.logoAlt} />` : nothing}\n ${!overlay && this.imageUrl\n ? html`<img part=\"image\" class=\"image\" src=${this.imageUrl} alt=${this.imageAlt} loading=\"lazy\" />`\n : nothing}\n ${this.eyebrow ? html`<span part=\"eyebrow\" class=\"eyebrow\">${this.eyebrow}</span>` : nothing}\n ${this.title ? html`<p part=\"title\" class=\"title\">${this.title}</p>` : nothing}\n ${this.description ? html`<p part=\"description\" class=\"description\">${this.description}</p>` : nothing}\n ${this.ctaLabel ? html`<span part=\"cta\" class=\"cta\">${this.ctaLabel}</span>` : nothing}\n </a>\n `;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,YAAY,KAAK,MAAM,eAAe;AAC/C,SAAS,eAAe,UAAU,aAAa;AAyBxC,IAAM,WAAN,cAAuB,WAAW;AAAA,EAAlC;AAAA;A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AA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+GtB;AAAA,EADCC,UAAS,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AAAA,GAvH9B,gBAwHX;AAGA;AAAA,EADCA,UAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GA1Hf,gBA2HX;AAGA;AAAA,EADCA,UAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GA7Hf,gBA8HX;AAIA;AAAA,EADCA,UAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAjIf,gBAkIX;AAGA;AAAA,EADCA,UAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GApIf,gBAqIX;AAIA;AAAA,EADCA,UAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAxIf,gBAyIX;AAIA;AAAA,EADCA,UAAS,EAAE,MAAM,QAAQ,WAAW,YAAY,CAAC;AAAA,GA5IvC,gBA6IX;AAGA;AAAA,EADCA,UAAS,EAAE,MAAM,QAAQ,WAAW,YAAY,CAAC;AAAA,GA/IvC,gBAgJX;AAIA;AAAA,EADCA,UAAS,EAAE,MAAM,QAAQ,WAAW,WAAW,CAAC;AAAA,GAnJtC,gBAoJX;AAGA;AAAA,EADCA,UAAS,EAAE,MAAM,QAAQ,WAAW,WAAW,CAAC;AAAA,GAtJtC,gBAuJX;AAIA;AAAA,EADCA,UAAS,EAAE,MAAM,QAAQ,WAAW,YAAY,CAAC;AAAA,GA1JvC,gBA2JX;AA3JW,kBAAN;AAAA,EADNC,eAAc,sBAAsB;AAAA,GACxB;","names":["LitElement","css","html","nothing","customElement","property","LitElement","nothing","html","css","property","customElement","LitElement","css","html","nothing","customElement","property","LitElement","html","nothing","css","property","customElement"]}
|
|
1
|
+
{"version":3,"sources":["../src/mega-menu/MegaMenu.ts","../src/mega-menu/MegaMenuColumn.ts","../src/mega-menu/MegaMenuFeature.ts"],"sourcesContent":["import { LitElement, css, html, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\n\nimport { controlBaseStyles, fontFamilyStyles } from '../shared/styles';\n\n/**\n * The rich layout of a mega-menu panel, after okta.com: an optional intro column on the left (a\n * large `heading`, a `description` and, under a divider, quick links in `slot=\"intro\"`), then the\n * link columns side by side (`st-mega-menu-column`s in the default slot), then an optional\n * featured column on the right (`featured-heading` over the `st-mega-menu-feature` cards in\n * `slot=\"featured\"`). Slot it into an `st-dropdown` with `mega` set.\n *\n * The layout follows the width it is given, not the viewport (a container query): side by side\n * when there is room; intro and featured column above/below two link columns on a medium panel;\n * everything stacked in the narrow drill-down panel `st-header` shows on a phone (where the intro\n * heading is left out — the drill-down already shows the section's name).\n *\n * @slot - The link columns (`st-mega-menu-column`s, or any blocks).\n * @slot intro - Quick links under the intro text, e.g. `st-menu-item`s with an icon.\n * @slot featured - Promo cards (`st-mega-menu-feature`s), stacked.\n * @csspart inner - The grid holding every area.\n * @csspart intro - The intro column.\n * @csspart columns - The grid holding the link columns.\n * @csspart featured - The featured column.\n */\n@customElement('st-mega-menu')\nexport class MegaMenu extends LitElement {\n static styles = css`\n ${controlBaseStyles}\n\n :host {\n display: block;\n container-type: inline-size;\n ${fontFamilyStyles}\n }\n\n .inner {\n display: grid;\n gap: 3rem;\n padding: 3rem 3.5rem;\n box-sizing: border-box;\n }\n\n .columns {\n display: grid;\n grid-template-columns: repeat(var(--st-mega-menu-columns, 3), minmax(0, 1fr));\n gap: 3rem;\n align-items: stretch;\n }\n\n .intro,\n .featured {\n display: flex;\n flex-direction: column;\n min-width: 0;\n }\n\n .intro-heading {\n margin: 0 0 1rem;\n font-size: 2rem;\n font-weight: 400;\n line-height: 1.15;\n color: var(--st-color-text-strong);\n }\n\n .intro-description {\n margin: 0;\n font-size: 1rem;\n line-height: 1.55;\n color: var(--st-color-text);\n }\n\n .intro-links {\n display: flex;\n flex-direction: column;\n gap: 2px;\n margin-top: 2.5rem;\n padding-top: 2rem;\n border-top: 1px solid var(--st-color-border);\n }\n\n .intro-links.no-text {\n margin-top: 0;\n padding-top: 0;\n border-top: 0;\n }\n\n .featured-heading {\n margin: 0 0 1rem;\n font-size: 1.125rem;\n font-weight: 500;\n line-height: 1.35;\n color: var(--st-color-text-strong);\n }\n\n .featured-items {\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n }\n\n [hidden] {\n display: none !important;\n }\n\n /* Medium panel: intro on top, two link columns, featured cards side by side underneath. */\n @container (max-width: 960px) {\n .inner {\n grid-template-columns: minmax(0, 1fr) !important;\n gap: 2rem;\n padding: 2rem;\n }\n\n .columns {\n grid-template-columns: repeat(var(--st-mega-menu-columns-md, 2), minmax(0, 1fr));\n gap: 2rem;\n }\n\n .intro-links {\n margin-top: 1.5rem;\n padding-top: 1.5rem;\n }\n\n .featured-items {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));\n }\n }\n\n /* Narrow panel (the phone drill-down): everything stacked. */\n @container (max-width: 560px) {\n .inner {\n gap: 1.75rem;\n padding: 0.5rem 0 1.5rem;\n }\n\n .columns {\n grid-template-columns: minmax(0, 1fr);\n gap: 1.75rem;\n }\n\n .intro-heading {\n display: none;\n }\n }\n `;\n\n /** Large title of the intro column. */\n @property({ type: String })\n heading = '';\n\n /** Text under the intro title. */\n @property({ type: String })\n description = '';\n\n /** Heading over the featured cards. */\n @property({ type: String, attribute: 'featured-heading' })\n featuredHeading = '';\n\n /** Number of link columns side by side at full width. `0` (the default) uses one per slotted column. */\n @property({ type: Number })\n columns = 0;\n\n @state() private columnCount = 1;\n @state() private hasIntroLinks = false;\n @state() private hasFeatured = false;\n\n private onColumnsSlotChange = (event: Event): void => {\n this.columnCount = Math.max(1, (event.target as HTMLSlotElement).assignedElements({ flatten: true }).length);\n };\n\n private onIntroSlotChange = (event: Event): void => {\n this.hasIntroLinks = (event.target as HTMLSlotElement).assignedElements({ flatten: true }).length > 0;\n };\n\n private onFeaturedSlotChange = (event: Event): void => {\n this.hasFeatured = (event.target as HTMLSlotElement).assignedElements({ flatten: true }).length > 0;\n };\n\n render() {\n const columns = Math.min(6, Math.max(1, Math.round(this.columns) || this.columnCount));\n const hasIntroText = !!(this.heading || this.description);\n const hasIntro = hasIntroText || this.hasIntroLinks;\n const hasFeatured = this.hasFeatured || !!this.featuredHeading;\n // Every column — intro, each link column, featured — gets the same share of the width.\n const tracks = [hasIntro ? 'minmax(0, 1fr)' : '', `minmax(0, ${columns}fr)`, hasFeatured ? 'minmax(0, 1fr)' : '']\n .filter(Boolean)\n .join(' ');\n return html`\n <div\n part=\"inner\"\n class=\"inner\"\n style=\"grid-template-columns:${tracks};--st-mega-menu-columns:${columns};--st-mega-menu-columns-md:${Math.min(2, columns)}\"\n >\n <div part=\"intro\" class=\"intro\" ?hidden=${!hasIntro}>\n ${this.heading ? html`<p part=\"heading\" class=\"intro-heading\">${this.heading}</p>` : nothing}\n ${this.description ? html`<p part=\"description\" class=\"intro-description\">${this.description}</p>` : nothing}\n <div part=\"intro-links\" class=\"intro-links ${hasIntroText ? '' : 'no-text'}\" ?hidden=${!this.hasIntroLinks}>\n <slot name=\"intro\" @slotchange=${this.onIntroSlotChange}></slot>\n </div>\n </div>\n <div part=\"columns\" class=\"columns\"><slot @slotchange=${this.onColumnsSlotChange}></slot></div>\n <div part=\"featured\" class=\"featured\" ?hidden=${!hasFeatured}>\n ${this.featuredHeading ? html`<p part=\"featured-heading\" class=\"featured-heading\">${this.featuredHeading}</p>` : nothing}\n <div class=\"featured-items\"><slot name=\"featured\" @slotchange=${this.onFeaturedSlotChange}></slot></div>\n </div>\n </div>\n `;\n }\n}\n","import { LitElement, css, html, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { arrowUpRightIcon } from '../shared/icons';\nimport { controlBaseStyles, fontFamilyStyles } from '../shared/styles';\nimport type { MegaMenuSelectEventDetail } from './MegaMenuEvents';\n\n/**\n * One column (or one group within a column) of an `st-mega-menu`: a heading, an optional line of\n * description, then its links stacked — usually `st-menu-item`s with `variant=\"link\"`. Nest\n * columns to stack several headed groups in one column, as okta.com does.\n *\n * `variant=\"card\"` puts the column on a tinted rounded tile and `variant=\"accent\"` on a solid\n * accent tile with light text; both suit a row of equal columns without intro or featured area.\n * `cta-label` + `cta-href` add a pill button at the bottom of the column.\n *\n * The heading (when `href` is set) and the button fire a *cancelable* `mega-menu-select` event\n * (detail: `{ href }`) before navigating; a host doing client-side routing calls\n * `event.preventDefault()` on it.\n *\n * @slot - The column's links, or nested `st-mega-menu-column` groups.\n * @fires mega-menu-select - The heading link or the button was clicked (cancelable; detail `{ href }`).\n * @csspart heading - The heading text or link.\n * @csspart description - The line under the heading.\n * @csspart items - The box holding the links.\n * @csspart cta - The pill button.\n * @cssprop --st-mega-menu-column-padding - Overrides the padding of a `card`/`accent` column.\n */\n@customElement('st-mega-menu-column')\nexport class MegaMenuColumn extends LitElement {\n static styles = css`\n ${controlBaseStyles}\n\n :host {\n display: flex;\n flex-direction: column;\n min-width: 0;\n box-sizing: border-box;\n ${fontFamilyStyles}\n }\n\n :host([variant='card']),\n :host([variant='accent']) {\n /* !important: a page-level reset (e.g. Tailwind Preflight) otherwise zeroes a shadow host's\n padding; override with --st-mega-menu-column-padding instead. */\n padding: var(--st-mega-menu-column-padding, 2rem 1.75rem 1.75rem) !important;\n border-radius: 20px;\n background: color-mix(in oklch, var(--st-color-text-strong) 5%, var(--st-color-surface));\n }\n\n :host([variant='accent']) {\n background: var(--st-color-accent);\n color: var(--st-color-on-solid);\n /* Read by the st-menu-item links inside. */\n --st-nav-color: var(--st-color-on-solid);\n --st-nav-hover-bg: transparent;\n }\n\n .heading {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n margin: 0 0 0.75rem;\n font-size: 1.125rem;\n font-weight: 500;\n line-height: 1.35;\n color: var(--st-color-text-strong);\n text-decoration: none;\n }\n\n :host([variant='card']) .heading,\n :host([variant='accent']) .heading {\n font-size: 1.375rem;\n }\n\n :host([variant='accent']) .heading {\n color: inherit;\n }\n\n a.heading:hover,\n a.heading:focus-visible {\n text-decoration: underline;\n text-underline-offset: 4px;\n }\n\n .description {\n margin: -0.25rem 0 0.75rem;\n font-size: 0.875rem;\n line-height: 1.5;\n color: var(--st-color-text-muted);\n }\n\n :host([variant='accent']) .description {\n color: inherit;\n opacity: 0.85;\n }\n\n .items {\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n\n /* Nested groups stack with room between them (!important for the same page-reset reason). */\n ::slotted(st-mega-menu-column:not(:first-child)) {\n margin-top: 2rem !important;\n }\n\n .cta {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: 0.875rem 1.5rem;\n border-radius: 9999px;\n background: var(--st-color-surface);\n color: var(--st-color-text-strong);\n font-size: 1rem;\n font-weight: 500;\n text-align: center;\n text-decoration: none;\n transition: box-shadow 0.2s ease;\n }\n\n .cta-spacer {\n flex: 1;\n min-height: 1.75rem;\n }\n\n .cta:hover,\n .cta:focus-visible {\n box-shadow: 0 0 0 2px currentColor;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .cta {\n transition: none;\n }\n }\n `;\n\n @property({ type: String })\n heading = '';\n\n /** Makes the heading a link (e.g. to the section's overview page). */\n @property({ type: String })\n href = '';\n\n @property({ type: String })\n description = '';\n\n /** `plain` (default), `card` (tinted tile) or `accent` (solid accent tile, light text). */\n @property({ type: String, reflect: true })\n variant: 'plain' | 'card' | 'accent' = 'plain';\n\n /** Text of a pill button at the bottom of the column; needs `cta-href`. */\n @property({ type: String, attribute: 'cta-label' })\n ctaLabel = '';\n\n @property({ type: String, attribute: 'cta-href' })\n ctaHref = '';\n\n private select(event: MouseEvent, href: string): void {\n if (href.startsWith('http')) return;\n const selectEvent = new CustomEvent<MegaMenuSelectEventDetail>('mega-menu-select', {\n detail: { href },\n bubbles: true,\n composed: true,\n cancelable: true\n });\n this.dispatchEvent(selectEvent);\n if (selectEvent.defaultPrevented) event.preventDefault();\n }\n\n private renderHeading() {\n if (!this.heading) return nothing;\n return this.href\n ? html`<a part=\"heading\" class=\"heading\" href=${this.href} @click=${(event: MouseEvent) => this.select(event, this.href)}\n >${this.heading}</a\n >`\n : html`<p part=\"heading\" class=\"heading\">${this.heading}</p>`;\n }\n\n private renderCta() {\n if (!this.ctaLabel || !this.ctaHref) return nothing;\n const external = this.ctaHref.startsWith('http');\n return html`\n <span class=\"cta-spacer\"></span>\n <a\n part=\"cta\"\n class=\"cta\"\n href=${this.ctaHref}\n target=${external ? '_blank' : '_self'}\n rel=${external ? 'noopener noreferrer' : nothing}\n @click=${(event: MouseEvent) => this.select(event, this.ctaHref)}\n >${this.ctaLabel} ${external ? arrowUpRightIcon(14) : nothing}</a\n >\n `;\n }\n\n render() {\n return html`\n ${this.renderHeading()}\n ${this.description ? html`<p part=\"description\" class=\"description\">${this.description}</p>` : nothing}\n <div part=\"items\" class=\"items\" role=\"group\" aria-label=${this.heading || nothing}><slot></slot></div>\n ${this.renderCta()}\n `;\n }\n}\n","import { LitElement, css, html, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { controlBaseStyles, fontFamilyStyles } from '../shared/styles';\nimport type { MegaMenuSelectEventDetail } from './MegaMenuEvents';\n\n/**\n * A promo card for the featured column of an `st-mega-menu` (`slot=\"featured\"`). The whole card\n * is one link. Two looks, after okta.com:\n *\n * - `story` (default): a rounded image on top, then the description and an underlined\n * call-to-action line — a customer story or announcement.\n * - `overlay`: a tile with light text over `image-url` (darkened), or over an accent gradient when\n * there is no image — an optional `logo-url` top left, the title and description at the bottom.\n *\n * An `http(s)` `href` opens in a new tab unless `target` says otherwise. Any other `href` fires a\n * *cancelable* `mega-menu-select` event (detail: `{ href }`) first; a host doing client-side\n * routing calls `event.preventDefault()` on it.\n *\n * @fires mega-menu-select - The card was clicked (cancelable; detail `{ href }`).\n * @csspart card - The card link.\n * @csspart image - The image (`story`).\n * @csspart logo - The logo (`overlay`).\n * @csspart eyebrow - The small label above the title.\n * @csspart title - The title.\n * @csspart description - The description.\n * @csspart cta - The call-to-action line.\n * @cssprop --st-mega-menu-feature-from - Start colour of the `overlay` gradient (default: the accent colour).\n * @cssprop --st-mega-menu-feature-to - End colour of the `overlay` gradient.\n */\n@customElement('st-mega-menu-feature')\nexport class MegaMenuFeature extends LitElement {\n /** `focus()` on the element focuses its link, so `st-dropdown` can arrow-key to it. */\n static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };\n\n static styles = css`\n ${controlBaseStyles}\n\n :host {\n display: block;\n ${fontFamilyStyles}\n }\n\n .card {\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n box-sizing: border-box;\n color: var(--st-color-text-strong);\n text-decoration: none;\n }\n\n .image {\n display: block;\n width: 100%;\n aspect-ratio: 9 / 8;\n object-fit: cover;\n border-radius: 20px;\n transition: transform 0.3s ease;\n }\n\n .card:hover .image {\n transform: scale(1.015);\n }\n\n .eyebrow {\n font-size: 0.75rem;\n font-weight: 600;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n color: var(--st-color-accent-text);\n }\n\n .title {\n margin: 0;\n font-size: 1.125rem;\n font-weight: 500;\n line-height: 1.3;\n }\n\n .description {\n margin: 0;\n font-size: 0.9375rem;\n line-height: 1.5;\n }\n\n .cta {\n align-self: flex-start;\n margin-top: 0.75rem;\n font-size: 0.9375rem;\n font-weight: 500;\n text-decoration: underline;\n text-underline-offset: 5px;\n text-decoration-thickness: 1px;\n }\n\n .card:hover .cta,\n .card:focus-visible .cta {\n text-decoration-thickness: 2px;\n }\n\n /* overlay */\n :host([variant='overlay']) .card {\n justify-content: flex-end;\n gap: 0.5rem;\n min-height: 15rem;\n padding: 1.75rem;\n border-radius: 20px;\n color: #fff;\n background-color: var(--st-color-accent);\n background-image:\n linear-gradient(to top, rgb(0 0 0 / 0.55), rgb(0 0 0 / 0.05)),\n var(--st-mega-menu-feature-image, linear-gradient(160deg, var(--st-mega-menu-feature-from, var(--st-color-accent)), var(--st-mega-menu-feature-to, oklch(0.25 0.12 280))));\n background-size: cover;\n background-position: center;\n transition: transform 0.2s ease;\n }\n\n :host([variant='overlay']) .card:hover {\n transform: translateY(-2px);\n }\n\n :host([variant='overlay']) .logo {\n height: 2.25rem;\n width: auto;\n max-width: 70%;\n margin-bottom: auto;\n align-self: flex-start;\n object-fit: contain;\n }\n\n :host([variant='overlay']) .title {\n font-size: 1.75rem;\n font-weight: 400;\n }\n\n :host([variant='overlay']) .eyebrow,\n :host([variant='overlay']) .cta {\n color: inherit;\n }\n\n /* tip: a light-blue card with dark text, like a tip panel on a page. */\n :host([variant='tip']) .card {\n gap: 0.5rem;\n padding: 1.25rem;\n border-radius: var(--st-radius-md);\n border: 1px solid var(--st-color-accent-border);\n background: var(--st-color-accent-subtle);\n color: var(--st-color-text);\n transition: border-color 0.2s ease;\n }\n\n :host([variant='tip']) .card:hover {\n border-color: var(--st-color-accent-muted);\n }\n\n :host([variant='tip']) .title {\n font-size: var(--st-text-lg);\n font-weight: var(--st-font-weight-semibold);\n color: var(--st-color-text-strong);\n }\n\n :host([variant='tip']) .eyebrow,\n :host([variant='tip']) .cta {\n color: var(--st-color-accent-text);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .image,\n :host([variant='overlay']) .card {\n transition: none;\n }\n }\n `;\n\n /** `story` (default), `overlay` (dark, over an image or gradient) or `tip` (light blue, for a hint). */\n @property({ type: String, reflect: true })\n variant: 'story' | 'overlay' | 'tip' = 'story';\n\n @property({ type: String })\n title = '';\n\n @property({ type: String })\n description = '';\n\n /** Small label above the title, e.g. \"New\" or \"Report\". */\n @property({ type: String })\n eyebrow = '';\n\n @property({ type: String })\n href = '';\n\n /** `target` for the link. Defaults to `_blank` for an `http(s)` `href`, `_self` otherwise. */\n @property({ type: String })\n target = '';\n\n /** Image on top (`story`) or behind the text (`overlay`). */\n @property({ type: String, attribute: 'image-url' })\n imageUrl = '';\n\n @property({ type: String, attribute: 'image-alt' })\n imageAlt = '';\n\n /** Logo at the top of an `overlay` card. */\n @property({ type: String, attribute: 'logo-url' })\n logoUrl = '';\n\n @property({ type: String, attribute: 'logo-alt' })\n logoAlt = '';\n\n /** Call-to-action text at the bottom of the card; empty hides it. */\n @property({ type: String, attribute: 'cta-label' })\n ctaLabel = '';\n\n private get isExternal(): boolean {\n return this.href.startsWith('http');\n }\n\n private onClick = (event: MouseEvent): void => {\n if (this.isExternal) return;\n const selectEvent = new CustomEvent<MegaMenuSelectEventDetail>('mega-menu-select', {\n detail: { href: this.href },\n bubbles: true,\n composed: true,\n cancelable: true\n });\n this.dispatchEvent(selectEvent);\n if (selectEvent.defaultPrevented) event.preventDefault();\n };\n\n render() {\n const target = this.target || (this.isExternal ? '_blank' : '_self');\n const overlay = this.variant === 'overlay';\n const style = overlay && this.imageUrl ? `--st-mega-menu-feature-image:url(${JSON.stringify(this.imageUrl)})` : '';\n return html`\n <a\n part=\"card\"\n class=\"card\"\n style=${style}\n href=${this.href || nothing}\n target=${target}\n rel=${target === '_blank' ? 'noopener noreferrer' : nothing}\n @click=${this.onClick}\n >\n ${overlay && this.logoUrl ? html`<img part=\"logo\" class=\"logo\" src=${this.logoUrl} alt=${this.logoAlt} />` : nothing}\n ${!overlay && this.imageUrl\n ? html`<img part=\"image\" class=\"image\" src=${this.imageUrl} alt=${this.imageAlt} loading=\"lazy\" />`\n : nothing}\n ${this.eyebrow ? html`<span part=\"eyebrow\" class=\"eyebrow\">${this.eyebrow}</span>` : nothing}\n ${this.title ? html`<p part=\"title\" class=\"title\">${this.title}</p>` : nothing}\n ${this.description ? html`<p part=\"description\" class=\"description\">${this.description}</p>` : nothing}\n ${this.ctaLabel ? html`<span part=\"cta\" class=\"cta\">${this.ctaLabel}</span>` : nothing}\n </a>\n `;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,YAAY,KAAK,MAAM,eAAe;AAC/C,SAAS,eAAe,UAAU,aAAa;AAyBxC,IAAM,WAAN,cAAuB,WAAW;AAAA,EAAlC;AAAA;AA2HL,mBAAU;AAIV,uBAAc;AAId,2BAAkB;AAIlB,mBAA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AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyItB;AAAA,EADCC,UAAS,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AAAA,GAjJ9B,gBAkJX;AAGA;AAAA,EADCA,UAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GApJf,gBAqJX;AAGA;AAAA,EADCA,UAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAvJf,gBAwJX;AAIA;AAAA,EADCA,UAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GA3Jf,gBA4JX;AAGA;AAAA,EADCA,UAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GA9Jf,gBA+JX;AAIA;AAAA,EADCA,UAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAlKf,gBAmKX;AAIA;AAAA,EADCA,UAAS,EAAE,MAAM,QAAQ,WAAW,YAAY,CAAC;AAAA,GAtKvC,gBAuKX;AAGA;AAAA,EADCA,UAAS,EAAE,MAAM,QAAQ,WAAW,YAAY,CAAC;AAAA,GAzKvC,gBA0KX;AAIA;AAAA,EADCA,UAAS,EAAE,MAAM,QAAQ,WAAW,WAAW,CAAC;AAAA,GA7KtC,gBA8KX;AAGA;AAAA,EADCA,UAAS,EAAE,MAAM,QAAQ,WAAW,WAAW,CAAC;AAAA,GAhLtC,gBAiLX;AAIA;AAAA,EADCA,UAAS,EAAE,MAAM,QAAQ,WAAW,YAAY,CAAC;AAAA,GApLvC,gBAqLX;AArLW,kBAAN;AAAA,EADNC,eAAc,sBAAsB;AAAA,GACxB;","names":["LitElement","css","html","nothing","customElement","property","LitElement","nothing","html","css","property","customElement","LitElement","css","html","nothing","customElement","property","LitElement","html","nothing","css","property","customElement"]}
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-DH53HZPB.js";
|
|
4
4
|
import {
|
|
5
5
|
Tooltip
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FML6AG2V.js";
|
|
7
7
|
import {
|
|
8
8
|
PromoBanner
|
|
9
9
|
} from "./chunk-VWS53WY4.js";
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
MegaMenu,
|
|
33
33
|
MegaMenuColumn,
|
|
34
34
|
MegaMenuFeature
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-J6EO4R73.js";
|
|
36
36
|
import {
|
|
37
37
|
MenuGrid
|
|
38
38
|
} from "./chunk-SMLR736E.js";
|
|
@@ -113,8 +113,8 @@ declare class MegaMenuFeature extends LitElement {
|
|
|
113
113
|
slotAssignment?: SlotAssignmentMode;
|
|
114
114
|
};
|
|
115
115
|
static styles: lit.CSSResult;
|
|
116
|
-
/** `story` (default) or `
|
|
117
|
-
variant: 'story' | 'overlay';
|
|
116
|
+
/** `story` (default), `overlay` (dark, over an image or gradient) or `tip` (light blue, for a hint). */
|
|
117
|
+
variant: 'story' | 'overlay' | 'tip';
|
|
118
118
|
title: string;
|
|
119
119
|
description: string;
|
|
120
120
|
/** Small label above the title, e.g. "New" or "Report". */
|
package/dist/mega-menu/index.js
CHANGED
package/dist/tooltip/index.d.ts
CHANGED
|
@@ -2,18 +2,30 @@ import * as lit from 'lit';
|
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* A small label that shows above a control on hover and on keyboard focus.
|
|
6
|
-
* or an icon button) in it and pass the same words as its accessible name in
|
|
7
|
-
*
|
|
5
|
+
* A small label that shows above a control: after a short rest on hover, and at once on keyboard focus.
|
|
6
|
+
* Wrap the control (a button or an icon button) in it and pass the same words as its accessible name in
|
|
7
|
+
* `text`. The control is still the thing that's announced; the bubble is decorative (`aria-hidden`), so the
|
|
8
8
|
* words aren't read twice.
|
|
9
9
|
*
|
|
10
|
-
* The bubble is
|
|
11
|
-
*
|
|
10
|
+
* The bubble is `position: fixed` and placed from the wrapper's position when it shows, so a clipping
|
|
11
|
+
* ancestor (a card or panel with `overflow: hidden`) can't cut it off. It shows around a control that
|
|
12
|
+
* can't act right now too, as long as that control is focusable or hoverable (use `aria-disabled`, not
|
|
13
|
+
* the native `disabled`, which takes a control out of focus and pointer events).
|
|
12
14
|
*/
|
|
13
15
|
declare class Tooltip extends LitElement {
|
|
14
16
|
static styles: lit.CSSResult;
|
|
15
|
-
/** The words shown in the bubble: the same words as the control's accessible name
|
|
17
|
+
/** The words shown in the bubble: the same words as the control's accessible name, or the reason the
|
|
18
|
+
* control can't act right now. */
|
|
16
19
|
text: string;
|
|
20
|
+
private bubble?;
|
|
21
|
+
private timer?;
|
|
22
|
+
connectedCallback(): void;
|
|
23
|
+
disconnectedCallback(): void;
|
|
24
|
+
firstUpdated(): void;
|
|
25
|
+
private onPointerEnter;
|
|
26
|
+
private cancel;
|
|
27
|
+
private show;
|
|
28
|
+
private hide;
|
|
17
29
|
render(): lit.TemplateResult<1>;
|
|
18
30
|
}
|
|
19
31
|
|
package/dist/tooltip/index.js
CHANGED
package/package.json
CHANGED
package/dist/chunk-XCA3XFFG.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
fontFamilyStyles
|
|
3
|
-
} from "./chunk-KMU6ABQF.js";
|
|
4
|
-
import {
|
|
5
|
-
__decorateClass
|
|
6
|
-
} from "./chunk-EUXUH3YW.js";
|
|
7
|
-
|
|
8
|
-
// src/tooltip/Tooltip.ts
|
|
9
|
-
import { LitElement, css, html } from "lit";
|
|
10
|
-
import { customElement, property } from "lit/decorators.js";
|
|
11
|
-
var Tooltip = class extends LitElement {
|
|
12
|
-
constructor() {
|
|
13
|
-
super(...arguments);
|
|
14
|
-
this.text = "";
|
|
15
|
-
}
|
|
16
|
-
render() {
|
|
17
|
-
return html`<slot></slot><span class="bubble" part="bubble" aria-hidden="true">${this.text}</span>`;
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
Tooltip.styles = css`
|
|
21
|
-
${fontFamilyStyles}
|
|
22
|
-
|
|
23
|
-
:host {
|
|
24
|
-
position: relative;
|
|
25
|
-
display: inline-flex;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.bubble {
|
|
29
|
-
position: absolute;
|
|
30
|
-
bottom: calc(100% + 6px);
|
|
31
|
-
left: 50%;
|
|
32
|
-
transform: translateX(-50%);
|
|
33
|
-
z-index: 20;
|
|
34
|
-
padding: var(--st-space-4) var(--st-space-8);
|
|
35
|
-
border-radius: var(--st-radius-xs);
|
|
36
|
-
background: var(--st-color-text-strong);
|
|
37
|
-
color: var(--st-color-on-solid);
|
|
38
|
-
font-size: var(--st-text-xs);
|
|
39
|
-
font-weight: var(--st-font-weight-medium);
|
|
40
|
-
line-height: 1.3;
|
|
41
|
-
white-space: nowrap;
|
|
42
|
-
pointer-events: none;
|
|
43
|
-
opacity: 0;
|
|
44
|
-
transition: opacity 0.12s ease;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/* Hover waits a moment, so a passing pointer doesn't flash a label; keyboard focus shows it at once. */
|
|
48
|
-
:host(:hover) .bubble {
|
|
49
|
-
opacity: 1;
|
|
50
|
-
transition-delay: var(--st-tooltip-delay, 300ms);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
:host(:focus-within) .bubble {
|
|
54
|
-
opacity: 1;
|
|
55
|
-
transition-delay: 0s;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
@media (prefers-reduced-motion: reduce) {
|
|
59
|
-
.bubble {
|
|
60
|
-
transition: none;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
`;
|
|
64
|
-
__decorateClass([
|
|
65
|
-
property({ type: String })
|
|
66
|
-
], Tooltip.prototype, "text", 2);
|
|
67
|
-
Tooltip = __decorateClass([
|
|
68
|
-
customElement("st-tooltip")
|
|
69
|
-
], Tooltip);
|
|
70
|
-
|
|
71
|
-
export {
|
|
72
|
-
Tooltip
|
|
73
|
-
};
|
|
74
|
-
//# sourceMappingURL=chunk-XCA3XFFG.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tooltip/Tooltip.ts"],"sourcesContent":["import { LitElement, css, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { fontFamilyStyles } from '../shared/styles';\n\n/**\n * A small label that shows above a control on hover and on keyboard focus. Wrap the control (a button\n * or an icon button) in it and pass the same words as its accessible name in `text`. The bubble is\n * decorative (`aria-hidden`): the control's own `aria-label` is what a screen reader announces, so the\n * words aren't read twice.\n *\n * The bubble is positioned by the wrapper, so put the tooltip where it has room above: it's not\n * clipped by the wrapper's own box, but it is clipped by an ancestor with `overflow: hidden`.\n */\n@customElement('st-tooltip')\nexport class Tooltip extends LitElement {\n static styles = css`\n ${fontFamilyStyles}\n\n :host {\n position: relative;\n display: inline-flex;\n }\n\n .bubble {\n position: absolute;\n bottom: calc(100% + 6px);\n left: 50%;\n transform: translateX(-50%);\n z-index: 20;\n padding: var(--st-space-4) var(--st-space-8);\n border-radius: var(--st-radius-xs);\n background: var(--st-color-text-strong);\n color: var(--st-color-on-solid);\n font-size: var(--st-text-xs);\n font-weight: var(--st-font-weight-medium);\n line-height: 1.3;\n white-space: nowrap;\n pointer-events: none;\n opacity: 0;\n transition: opacity 0.12s ease;\n }\n\n /* Hover waits a moment, so a passing pointer doesn't flash a label; keyboard focus shows it at once. */\n :host(:hover) .bubble {\n opacity: 1;\n transition-delay: var(--st-tooltip-delay, 300ms);\n }\n\n :host(:focus-within) .bubble {\n opacity: 1;\n transition-delay: 0s;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .bubble {\n transition: none;\n }\n }\n `;\n\n /** The words shown in the bubble: the same words as the control's accessible name. */\n @property({ type: String })\n text = '';\n\n render() {\n return html`<slot></slot><span class=\"bubble\" part=\"bubble\" aria-hidden=\"true\">${this.text}</span>`;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,YAAY,KAAK,YAAY;AACtC,SAAS,eAAe,gBAAgB;AAcjC,IAAM,UAAN,cAAsB,WAAW;AAAA,EAAjC;AAAA;AAgDL,gBAAO;AAAA;AAAA,EAEP,SAAS;AACP,WAAO,0EAA0E,KAAK,IAAI;AAAA,EAC5F;AACF;AArDa,QACJ,SAAS;AAAA,MACZ,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8CpB;AAAA,EADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GA/Cf,QAgDX;AAhDW,UAAN;AAAA,EADN,cAAc,YAAY;AAAA,GACd;","names":[]}
|