@sankhyatronics/sankhya-cms 0.1.15 → 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 +202 -166
- 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-HO44NKJ5.js +0 -68
- package/dist/chunk-HO44NKJ5.js.map +0 -1
package/custom-elements.json
CHANGED
|
@@ -1031,375 +1031,375 @@
|
|
|
1031
1031
|
},
|
|
1032
1032
|
{
|
|
1033
1033
|
"kind": "javascript-module",
|
|
1034
|
-
"path": "src/
|
|
1034
|
+
"path": "src/cookie-consent/CookieConsent.ts",
|
|
1035
1035
|
"declarations": [
|
|
1036
1036
|
{
|
|
1037
1037
|
"kind": "class",
|
|
1038
|
-
"description": "
|
|
1039
|
-
"name": "
|
|
1038
|
+
"description": "Fixed bottom consent bar. The source read/wrote consent through a React `UserContext`; here the\nelement persists the choice itself in localStorage (`storage-key`, default the source's\n`sankhya_ui_cookie_consent`; storage errors are ignored) and renders nothing once a choice\nexists. Fires `cookie-consent-accept` / `cookie-consent-refuse` (detail `{ status }`). The\ndefault slot replaces the message text.",
|
|
1039
|
+
"name": "CookieConsent",
|
|
1040
1040
|
"cssProperties": [
|
|
1041
1041
|
{
|
|
1042
|
-
"description": "Overrides the
|
|
1043
|
-
"name": "--st-
|
|
1042
|
+
"description": "Overrides the bar's padding.",
|
|
1043
|
+
"name": "--st-cookie-consent-padding"
|
|
1044
1044
|
}
|
|
1045
1045
|
],
|
|
1046
1046
|
"members": [
|
|
1047
1047
|
{
|
|
1048
1048
|
"kind": "field",
|
|
1049
|
-
"name": "
|
|
1049
|
+
"name": "message",
|
|
1050
1050
|
"type": {
|
|
1051
1051
|
"text": "string"
|
|
1052
1052
|
},
|
|
1053
1053
|
"default": "''",
|
|
1054
|
-
"attribute": "
|
|
1054
|
+
"attribute": "message"
|
|
1055
1055
|
},
|
|
1056
1056
|
{
|
|
1057
1057
|
"kind": "field",
|
|
1058
|
-
"name": "
|
|
1058
|
+
"name": "acceptButtonText",
|
|
1059
1059
|
"type": {
|
|
1060
1060
|
"text": "string"
|
|
1061
1061
|
},
|
|
1062
|
-
"default": "''",
|
|
1063
|
-
"attribute": "
|
|
1062
|
+
"default": "'Accept'",
|
|
1063
|
+
"attribute": "accept-button-text"
|
|
1064
1064
|
},
|
|
1065
1065
|
{
|
|
1066
1066
|
"kind": "field",
|
|
1067
|
-
"name": "
|
|
1067
|
+
"name": "refuseButtonText",
|
|
1068
1068
|
"type": {
|
|
1069
1069
|
"text": "string"
|
|
1070
1070
|
},
|
|
1071
|
-
"default": "''",
|
|
1072
|
-
"
|
|
1073
|
-
"attribute": "content-src"
|
|
1071
|
+
"default": "'Refuse'",
|
|
1072
|
+
"attribute": "refuse-button-text"
|
|
1074
1073
|
},
|
|
1075
1074
|
{
|
|
1076
1075
|
"kind": "field",
|
|
1077
|
-
"name": "
|
|
1076
|
+
"name": "privacyPolicyLink",
|
|
1078
1077
|
"type": {
|
|
1079
1078
|
"text": "string"
|
|
1080
1079
|
},
|
|
1081
1080
|
"default": "''",
|
|
1082
|
-
"
|
|
1083
|
-
"attribute": "content"
|
|
1081
|
+
"attribute": "privacy-policy-link"
|
|
1084
1082
|
},
|
|
1085
1083
|
{
|
|
1086
1084
|
"kind": "field",
|
|
1087
|
-
"name": "
|
|
1085
|
+
"name": "privacyPolicyText",
|
|
1088
1086
|
"type": {
|
|
1089
1087
|
"text": "string"
|
|
1090
1088
|
},
|
|
1091
|
-
"default": "''",
|
|
1092
|
-
"attribute": "
|
|
1089
|
+
"default": "'Privacy Policy'",
|
|
1090
|
+
"attribute": "privacy-policy-text"
|
|
1093
1091
|
},
|
|
1094
1092
|
{
|
|
1095
1093
|
"kind": "field",
|
|
1096
|
-
"name": "
|
|
1094
|
+
"name": "storageKey",
|
|
1095
|
+
"default": "'sankhya_ui_cookie_consent'",
|
|
1096
|
+
"attribute": "storage-key",
|
|
1097
1097
|
"type": {
|
|
1098
1098
|
"text": "string"
|
|
1099
|
-
}
|
|
1100
|
-
"default": "''",
|
|
1101
|
-
"attribute": "image-alt"
|
|
1099
|
+
}
|
|
1102
1100
|
},
|
|
1103
1101
|
{
|
|
1104
1102
|
"kind": "field",
|
|
1105
|
-
"name": "
|
|
1103
|
+
"name": "consent",
|
|
1106
1104
|
"type": {
|
|
1107
|
-
"text": "
|
|
1105
|
+
"text": "CookieConsentStatus | null"
|
|
1108
1106
|
},
|
|
1109
|
-
"
|
|
1110
|
-
"
|
|
1107
|
+
"privacy": "private",
|
|
1108
|
+
"default": "null",
|
|
1109
|
+
"description": "The stored choice, or `null` while undecided (the bar is only shown then)."
|
|
1111
1110
|
},
|
|
1112
1111
|
{
|
|
1113
|
-
"kind": "
|
|
1114
|
-
"name": "
|
|
1115
|
-
"
|
|
1116
|
-
|
|
1112
|
+
"kind": "method",
|
|
1113
|
+
"name": "readStored",
|
|
1114
|
+
"privacy": "private",
|
|
1115
|
+
"return": {
|
|
1116
|
+
"type": {
|
|
1117
|
+
"text": "CookieConsentStatus | null"
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
},
|
|
1121
|
+
{
|
|
1122
|
+
"kind": "method",
|
|
1123
|
+
"name": "choose",
|
|
1124
|
+
"privacy": "private",
|
|
1125
|
+
"return": {
|
|
1126
|
+
"type": {
|
|
1127
|
+
"text": "void"
|
|
1128
|
+
}
|
|
1117
1129
|
},
|
|
1118
|
-
"
|
|
1119
|
-
|
|
1120
|
-
|
|
1130
|
+
"parameters": [
|
|
1131
|
+
{
|
|
1132
|
+
"name": "status",
|
|
1133
|
+
"type": {
|
|
1134
|
+
"text": "CookieConsentStatus"
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
]
|
|
1121
1138
|
}
|
|
1122
1139
|
],
|
|
1123
|
-
"
|
|
1124
|
-
{
|
|
1125
|
-
"name": "title",
|
|
1126
|
-
"type": {
|
|
1127
|
-
"text": "string"
|
|
1128
|
-
},
|
|
1129
|
-
"default": "''",
|
|
1130
|
-
"fieldName": "title"
|
|
1131
|
-
},
|
|
1140
|
+
"events": [
|
|
1132
1141
|
{
|
|
1133
|
-
"name": "subtitle",
|
|
1134
1142
|
"type": {
|
|
1135
|
-
"text": "
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1143
|
+
"text": "CustomEvent"
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
],
|
|
1147
|
+
"attributes": [
|
|
1140
1148
|
{
|
|
1141
|
-
"name": "
|
|
1149
|
+
"name": "message",
|
|
1142
1150
|
"type": {
|
|
1143
1151
|
"text": "string"
|
|
1144
1152
|
},
|
|
1145
1153
|
"default": "''",
|
|
1146
|
-
"
|
|
1147
|
-
"fieldName": "contentSrc"
|
|
1154
|
+
"fieldName": "message"
|
|
1148
1155
|
},
|
|
1149
1156
|
{
|
|
1150
|
-
"name": "
|
|
1157
|
+
"name": "accept-button-text",
|
|
1151
1158
|
"type": {
|
|
1152
1159
|
"text": "string"
|
|
1153
1160
|
},
|
|
1154
|
-
"default": "''",
|
|
1155
|
-
"
|
|
1156
|
-
"fieldName": "content"
|
|
1161
|
+
"default": "'Accept'",
|
|
1162
|
+
"fieldName": "acceptButtonText"
|
|
1157
1163
|
},
|
|
1158
1164
|
{
|
|
1159
|
-
"name": "
|
|
1165
|
+
"name": "refuse-button-text",
|
|
1160
1166
|
"type": {
|
|
1161
1167
|
"text": "string"
|
|
1162
1168
|
},
|
|
1163
|
-
"default": "''",
|
|
1164
|
-
"fieldName": "
|
|
1169
|
+
"default": "'Refuse'",
|
|
1170
|
+
"fieldName": "refuseButtonText"
|
|
1165
1171
|
},
|
|
1166
1172
|
{
|
|
1167
|
-
"name": "
|
|
1173
|
+
"name": "privacy-policy-link",
|
|
1168
1174
|
"type": {
|
|
1169
1175
|
"text": "string"
|
|
1170
1176
|
},
|
|
1171
1177
|
"default": "''",
|
|
1172
|
-
"fieldName": "
|
|
1178
|
+
"fieldName": "privacyPolicyLink"
|
|
1173
1179
|
},
|
|
1174
1180
|
{
|
|
1175
|
-
"name": "
|
|
1181
|
+
"name": "privacy-policy-text",
|
|
1176
1182
|
"type": {
|
|
1177
1183
|
"text": "string"
|
|
1178
1184
|
},
|
|
1179
|
-
"default": "''",
|
|
1180
|
-
"fieldName": "
|
|
1185
|
+
"default": "'Privacy Policy'",
|
|
1186
|
+
"fieldName": "privacyPolicyText"
|
|
1181
1187
|
},
|
|
1182
1188
|
{
|
|
1183
|
-
"name": "
|
|
1184
|
-
"
|
|
1185
|
-
|
|
1186
|
-
},
|
|
1187
|
-
"default": "false",
|
|
1188
|
-
"fieldName": "inverted"
|
|
1189
|
+
"name": "storage-key",
|
|
1190
|
+
"default": "DEFAULT_STORAGE_KEY",
|
|
1191
|
+
"fieldName": "storageKey"
|
|
1189
1192
|
}
|
|
1190
1193
|
],
|
|
1191
1194
|
"superclass": {
|
|
1192
1195
|
"name": "LitElement",
|
|
1193
1196
|
"package": "lit"
|
|
1194
1197
|
},
|
|
1195
|
-
"tagName": "st-
|
|
1198
|
+
"tagName": "st-cookie-consent",
|
|
1196
1199
|
"customElement": true
|
|
1197
1200
|
}
|
|
1198
1201
|
],
|
|
1199
1202
|
"exports": [
|
|
1200
1203
|
{
|
|
1201
1204
|
"kind": "js",
|
|
1202
|
-
"name": "
|
|
1205
|
+
"name": "CookieConsent",
|
|
1203
1206
|
"declaration": {
|
|
1204
|
-
"name": "
|
|
1205
|
-
"module": "src/
|
|
1207
|
+
"name": "CookieConsent",
|
|
1208
|
+
"module": "src/cookie-consent/CookieConsent.ts"
|
|
1206
1209
|
}
|
|
1207
1210
|
},
|
|
1208
1211
|
{
|
|
1209
1212
|
"kind": "custom-element-definition",
|
|
1210
|
-
"name": "st-
|
|
1213
|
+
"name": "st-cookie-consent",
|
|
1211
1214
|
"declaration": {
|
|
1212
|
-
"name": "
|
|
1213
|
-
"module": "src/
|
|
1215
|
+
"name": "CookieConsent",
|
|
1216
|
+
"module": "src/cookie-consent/CookieConsent.ts"
|
|
1214
1217
|
}
|
|
1215
1218
|
}
|
|
1216
1219
|
]
|
|
1217
1220
|
},
|
|
1218
1221
|
{
|
|
1219
1222
|
"kind": "javascript-module",
|
|
1220
|
-
"path": "src/
|
|
1223
|
+
"path": "src/content-block/ContentBlock.ts",
|
|
1221
1224
|
"declarations": [
|
|
1222
1225
|
{
|
|
1223
1226
|
"kind": "class",
|
|
1224
|
-
"description": "
|
|
1225
|
-
"name": "
|
|
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",
|
|
1226
1229
|
"cssProperties": [
|
|
1227
1230
|
{
|
|
1228
|
-
"description": "Overrides the
|
|
1229
|
-
"name": "--st-
|
|
1231
|
+
"description": "Overrides the block's padding.",
|
|
1232
|
+
"name": "--st-content-block-padding"
|
|
1230
1233
|
}
|
|
1231
1234
|
],
|
|
1232
1235
|
"members": [
|
|
1233
1236
|
{
|
|
1234
1237
|
"kind": "field",
|
|
1235
|
-
"name": "
|
|
1238
|
+
"name": "title",
|
|
1236
1239
|
"type": {
|
|
1237
1240
|
"text": "string"
|
|
1238
1241
|
},
|
|
1239
1242
|
"default": "''",
|
|
1240
|
-
"attribute": "
|
|
1243
|
+
"attribute": "title"
|
|
1241
1244
|
},
|
|
1242
1245
|
{
|
|
1243
1246
|
"kind": "field",
|
|
1244
|
-
"name": "
|
|
1247
|
+
"name": "subtitle",
|
|
1245
1248
|
"type": {
|
|
1246
1249
|
"text": "string"
|
|
1247
1250
|
},
|
|
1248
|
-
"default": "'
|
|
1249
|
-
"attribute": "
|
|
1251
|
+
"default": "''",
|
|
1252
|
+
"attribute": "subtitle"
|
|
1250
1253
|
},
|
|
1251
1254
|
{
|
|
1252
1255
|
"kind": "field",
|
|
1253
|
-
"name": "
|
|
1256
|
+
"name": "contentSrc",
|
|
1254
1257
|
"type": {
|
|
1255
1258
|
"text": "string"
|
|
1256
1259
|
},
|
|
1257
|
-
"default": "'
|
|
1258
|
-
"
|
|
1260
|
+
"default": "''",
|
|
1261
|
+
"description": "URL of a Markdown file.",
|
|
1262
|
+
"attribute": "content-src"
|
|
1259
1263
|
},
|
|
1260
1264
|
{
|
|
1261
1265
|
"kind": "field",
|
|
1262
|
-
"name": "
|
|
1266
|
+
"name": "content",
|
|
1263
1267
|
"type": {
|
|
1264
1268
|
"text": "string"
|
|
1265
1269
|
},
|
|
1266
1270
|
"default": "''",
|
|
1267
|
-
"
|
|
1271
|
+
"description": "Inline Markdown, used when `content-src` is not set.",
|
|
1272
|
+
"attribute": "content"
|
|
1268
1273
|
},
|
|
1269
1274
|
{
|
|
1270
1275
|
"kind": "field",
|
|
1271
|
-
"name": "
|
|
1276
|
+
"name": "imageSrc",
|
|
1272
1277
|
"type": {
|
|
1273
1278
|
"text": "string"
|
|
1274
1279
|
},
|
|
1275
|
-
"default": "'
|
|
1276
|
-
"attribute": "
|
|
1280
|
+
"default": "''",
|
|
1281
|
+
"attribute": "image-src"
|
|
1277
1282
|
},
|
|
1278
1283
|
{
|
|
1279
1284
|
"kind": "field",
|
|
1280
|
-
"name": "
|
|
1281
|
-
"default": "'sankhya_ui_cookie_consent'",
|
|
1282
|
-
"attribute": "storage-key",
|
|
1285
|
+
"name": "imageAlt",
|
|
1283
1286
|
"type": {
|
|
1284
1287
|
"text": "string"
|
|
1285
|
-
}
|
|
1288
|
+
},
|
|
1289
|
+
"default": "''",
|
|
1290
|
+
"attribute": "image-alt"
|
|
1286
1291
|
},
|
|
1287
1292
|
{
|
|
1288
1293
|
"kind": "field",
|
|
1289
|
-
"name": "
|
|
1294
|
+
"name": "imageCaption",
|
|
1290
1295
|
"type": {
|
|
1291
|
-
"text": "
|
|
1296
|
+
"text": "string"
|
|
1292
1297
|
},
|
|
1293
|
-
"
|
|
1294
|
-
"
|
|
1295
|
-
"description": "The stored choice, or `null` while undecided (the bar is only shown then)."
|
|
1296
|
-
},
|
|
1297
|
-
{
|
|
1298
|
-
"kind": "method",
|
|
1299
|
-
"name": "readStored",
|
|
1300
|
-
"privacy": "private",
|
|
1301
|
-
"return": {
|
|
1302
|
-
"type": {
|
|
1303
|
-
"text": "CookieConsentStatus | null"
|
|
1304
|
-
}
|
|
1305
|
-
}
|
|
1298
|
+
"default": "''",
|
|
1299
|
+
"attribute": "image-caption"
|
|
1306
1300
|
},
|
|
1307
1301
|
{
|
|
1308
|
-
"kind": "
|
|
1309
|
-
"name": "
|
|
1310
|
-
"
|
|
1311
|
-
|
|
1312
|
-
"type": {
|
|
1313
|
-
"text": "void"
|
|
1314
|
-
}
|
|
1302
|
+
"kind": "field",
|
|
1303
|
+
"name": "inverted",
|
|
1304
|
+
"type": {
|
|
1305
|
+
"text": "boolean"
|
|
1315
1306
|
},
|
|
1316
|
-
"
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
"type": {
|
|
1320
|
-
"text": "CookieConsentStatus"
|
|
1321
|
-
}
|
|
1322
|
-
}
|
|
1323
|
-
]
|
|
1307
|
+
"default": "false",
|
|
1308
|
+
"attribute": "inverted",
|
|
1309
|
+
"reflects": true
|
|
1324
1310
|
}
|
|
1325
1311
|
],
|
|
1326
|
-
"
|
|
1312
|
+
"attributes": [
|
|
1327
1313
|
{
|
|
1314
|
+
"name": "title",
|
|
1328
1315
|
"type": {
|
|
1329
|
-
"text": "
|
|
1330
|
-
}
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1316
|
+
"text": "string"
|
|
1317
|
+
},
|
|
1318
|
+
"default": "''",
|
|
1319
|
+
"fieldName": "title"
|
|
1320
|
+
},
|
|
1334
1321
|
{
|
|
1335
|
-
"name": "
|
|
1322
|
+
"name": "subtitle",
|
|
1336
1323
|
"type": {
|
|
1337
1324
|
"text": "string"
|
|
1338
1325
|
},
|
|
1339
1326
|
"default": "''",
|
|
1340
|
-
"fieldName": "
|
|
1327
|
+
"fieldName": "subtitle"
|
|
1341
1328
|
},
|
|
1342
1329
|
{
|
|
1343
|
-
"name": "
|
|
1330
|
+
"name": "content-src",
|
|
1344
1331
|
"type": {
|
|
1345
1332
|
"text": "string"
|
|
1346
1333
|
},
|
|
1347
|
-
"default": "'
|
|
1348
|
-
"
|
|
1334
|
+
"default": "''",
|
|
1335
|
+
"description": "URL of a Markdown file.",
|
|
1336
|
+
"fieldName": "contentSrc"
|
|
1349
1337
|
},
|
|
1350
1338
|
{
|
|
1351
|
-
"name": "
|
|
1339
|
+
"name": "content",
|
|
1352
1340
|
"type": {
|
|
1353
1341
|
"text": "string"
|
|
1354
1342
|
},
|
|
1355
|
-
"default": "'
|
|
1356
|
-
"
|
|
1343
|
+
"default": "''",
|
|
1344
|
+
"description": "Inline Markdown, used when `content-src` is not set.",
|
|
1345
|
+
"fieldName": "content"
|
|
1357
1346
|
},
|
|
1358
1347
|
{
|
|
1359
|
-
"name": "
|
|
1348
|
+
"name": "image-src",
|
|
1360
1349
|
"type": {
|
|
1361
1350
|
"text": "string"
|
|
1362
1351
|
},
|
|
1363
1352
|
"default": "''",
|
|
1364
|
-
"fieldName": "
|
|
1353
|
+
"fieldName": "imageSrc"
|
|
1365
1354
|
},
|
|
1366
1355
|
{
|
|
1367
|
-
"name": "
|
|
1356
|
+
"name": "image-alt",
|
|
1368
1357
|
"type": {
|
|
1369
1358
|
"text": "string"
|
|
1370
1359
|
},
|
|
1371
|
-
"default": "'
|
|
1372
|
-
"fieldName": "
|
|
1360
|
+
"default": "''",
|
|
1361
|
+
"fieldName": "imageAlt"
|
|
1373
1362
|
},
|
|
1374
1363
|
{
|
|
1375
|
-
"name": "
|
|
1376
|
-
"
|
|
1377
|
-
|
|
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
1378
|
}
|
|
1379
1379
|
],
|
|
1380
1380
|
"superclass": {
|
|
1381
1381
|
"name": "LitElement",
|
|
1382
1382
|
"package": "lit"
|
|
1383
1383
|
},
|
|
1384
|
-
"tagName": "st-
|
|
1384
|
+
"tagName": "st-content-block",
|
|
1385
1385
|
"customElement": true
|
|
1386
1386
|
}
|
|
1387
1387
|
],
|
|
1388
1388
|
"exports": [
|
|
1389
1389
|
{
|
|
1390
1390
|
"kind": "js",
|
|
1391
|
-
"name": "
|
|
1391
|
+
"name": "ContentBlock",
|
|
1392
1392
|
"declaration": {
|
|
1393
|
-
"name": "
|
|
1394
|
-
"module": "src/
|
|
1393
|
+
"name": "ContentBlock",
|
|
1394
|
+
"module": "src/content-block/ContentBlock.ts"
|
|
1395
1395
|
}
|
|
1396
1396
|
},
|
|
1397
1397
|
{
|
|
1398
1398
|
"kind": "custom-element-definition",
|
|
1399
|
-
"name": "st-
|
|
1399
|
+
"name": "st-content-block",
|
|
1400
1400
|
"declaration": {
|
|
1401
|
-
"name": "
|
|
1402
|
-
"module": "src/
|
|
1401
|
+
"name": "ContentBlock",
|
|
1402
|
+
"module": "src/content-block/ContentBlock.ts"
|
|
1403
1403
|
}
|
|
1404
1404
|
}
|
|
1405
1405
|
]
|
|
@@ -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\" part=\"bubble\" aria-hidden=\"true\">${this.text}</span>`;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,YAAY,KAAK,YAAY;AACtC,SAAS,eAAe,gBAAgB;AAKxC,IAAM,iBAAiB;AAchB,IAAM,UAAN,cAAsB,WAAW;AAAA,EAAjC;AAAA;AA2CL,gBAAO;AA0BP,SAAQ,iBAAiB,MAAM;AAC7B,WAAK,OAAO;AACZ,WAAK,QAAQ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AAA;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;AA2HL,mBAAU;AAIV,uBAAc;AAId,2BAAkB;AAIlB,mBAAU;AAED,SAAQ,cAAc;AACtB,SAAQ,gBAAgB;AACxB,SAAQ,cAAc;AAE/B,SAAQ,sBAAsB,CAAC,UAAuB;AACpD,WAAK,cAAc,KAAK,IAAI,GAAI,MAAM,OAA2B,iBAAiB,EAAE,SAAS,KAAK,CAAC,EAAE,MAAM;AAAA,IAC7G;AAEA,SAAQ,oBA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A,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,mBAAU;AAED,SAAQ,cAAc;AACtB,SAAQ,gBAAgB;AACxB,SAAQ,cAAc;AAE/B,SAAQ,sBAAsB,CAAC,UAAuB;AACpD,WAAK,cAAc,KAAK,IAAI,GAAI,MAAM,OAA2B,iBAAiB,EAAE,SAAS,KAAK,CAAC,EAAE,MAAM;AAAA,IAC7G;AAEA,SAAQ,oBAAoB,CAAC,UAAuB;AAClD,WAAK,gBAAiB,MAAM,OAA2B,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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-HO44NKJ5.js
DELETED
|
@@ -1,68 +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
|
-
:host(:hover) .bubble,
|
|
48
|
-
:host(:focus-within) .bubble {
|
|
49
|
-
opacity: 1;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
@media (prefers-reduced-motion: reduce) {
|
|
53
|
-
.bubble {
|
|
54
|
-
transition: none;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
`;
|
|
58
|
-
__decorateClass([
|
|
59
|
-
property({ type: String })
|
|
60
|
-
], Tooltip.prototype, "text", 2);
|
|
61
|
-
Tooltip = __decorateClass([
|
|
62
|
-
customElement("st-tooltip")
|
|
63
|
-
], Tooltip);
|
|
64
|
-
|
|
65
|
-
export {
|
|
66
|
-
Tooltip
|
|
67
|
-
};
|
|
68
|
-
//# sourceMappingURL=chunk-HO44NKJ5.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 :host(:hover) .bubble,\n :host(:focus-within) .bubble {\n opacity: 1;\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;AA0CL,gBAAO;AAAA;AAAA,EAEP,SAAS;AACP,WAAO,0EAA0E,KAAK,IAAI;AAAA,EAC5F;AACF;AA/Ca,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;AAwCpB;AAAA,EADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAzCf,QA0CX;AA1CW,UAAN;AAAA,EADN,cAAc,YAAY;AAAA,GACd;","names":[]}
|