@ac-kit/ui-common 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/CHANGELOG.md +155 -0
  2. package/README.md +327 -9
  3. package/dist/anchored/anchored.d.ts +19 -0
  4. package/dist/anchored/anchored.d.ts.map +1 -0
  5. package/dist/anchored/anchored.js +2 -0
  6. package/dist/anchored/anchored.js.map +1 -0
  7. package/dist/focus/typeahead.d.ts +112 -0
  8. package/dist/focus/typeahead.d.ts.map +1 -0
  9. package/dist/focus/typeahead.js +178 -0
  10. package/dist/focus/typeahead.js.map +1 -0
  11. package/dist/index.d.ts +10 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +10 -0
  14. package/dist/index.js.map +1 -1
  15. package/dist/menu/menu.d.ts +157 -0
  16. package/dist/menu/menu.d.ts.map +1 -0
  17. package/dist/menu/menu.js +162 -0
  18. package/dist/menu/menu.js.map +1 -0
  19. package/dist/preact/_anchor.d.ts +13 -0
  20. package/dist/preact/_anchor.d.ts.map +1 -0
  21. package/dist/preact/_anchor.js +39 -0
  22. package/dist/preact/_anchor.js.map +1 -0
  23. package/dist/preact/_dom.d.ts +14 -0
  24. package/dist/preact/_dom.d.ts.map +1 -0
  25. package/dist/preact/_dom.js +31 -0
  26. package/dist/preact/_dom.js.map +1 -0
  27. package/dist/preact/_live-announcer.d.ts +26 -0
  28. package/dist/preact/_live-announcer.d.ts.map +1 -0
  29. package/dist/preact/_live-announcer.js +101 -0
  30. package/dist/preact/_live-announcer.js.map +1 -0
  31. package/dist/preact/index.d.ts +7 -0
  32. package/dist/preact/index.d.ts.map +1 -1
  33. package/dist/preact/index.js +7 -0
  34. package/dist/preact/index.js.map +1 -1
  35. package/dist/preact/knob.d.ts.map +1 -1
  36. package/dist/preact/knob.js +5 -13
  37. package/dist/preact/knob.js.map +1 -1
  38. package/dist/preact/menu-button.d.ts +117 -0
  39. package/dist/preact/menu-button.d.ts.map +1 -0
  40. package/dist/preact/menu-button.js +330 -0
  41. package/dist/preact/menu-button.js.map +1 -0
  42. package/dist/preact/progress-ring.d.ts +42 -0
  43. package/dist/preact/progress-ring.d.ts.map +1 -0
  44. package/dist/preact/progress-ring.js +26 -0
  45. package/dist/preact/progress-ring.js.map +1 -0
  46. package/dist/preact/slider.d.ts.map +1 -1
  47. package/dist/preact/slider.js +6 -4
  48. package/dist/preact/slider.js.map +1 -1
  49. package/dist/preact/spin-button.d.ts +67 -0
  50. package/dist/preact/spin-button.d.ts.map +1 -0
  51. package/dist/preact/spin-button.js +132 -0
  52. package/dist/preact/spin-button.js.map +1 -0
  53. package/dist/preact/tabs.d.ts +97 -0
  54. package/dist/preact/tabs.d.ts.map +1 -0
  55. package/dist/preact/tabs.js +264 -0
  56. package/dist/preact/tabs.js.map +1 -0
  57. package/dist/preact/toaster.d.ts +43 -0
  58. package/dist/preact/toaster.d.ts.map +1 -0
  59. package/dist/preact/toaster.js +356 -0
  60. package/dist/preact/toaster.js.map +1 -0
  61. package/dist/preact/toolbar.d.ts.map +1 -1
  62. package/dist/preact/toolbar.js +2 -8
  63. package/dist/preact/toolbar.js.map +1 -1
  64. package/dist/preact/tooltip.d.ts +67 -0
  65. package/dist/preact/tooltip.d.ts.map +1 -0
  66. package/dist/preact/tooltip.js +165 -0
  67. package/dist/preact/tooltip.js.map +1 -0
  68. package/dist/preact/tree.d.ts +93 -0
  69. package/dist/preact/tree.d.ts.map +1 -0
  70. package/dist/preact/tree.js +399 -0
  71. package/dist/preact/tree.js.map +1 -0
  72. package/dist/progress/progress.d.ts +51 -0
  73. package/dist/progress/progress.d.ts.map +1 -0
  74. package/dist/progress/progress.js +43 -0
  75. package/dist/progress/progress.js.map +1 -0
  76. package/dist/spin-button/spin-button.d.ts +110 -0
  77. package/dist/spin-button/spin-button.d.ts.map +1 -0
  78. package/dist/spin-button/spin-button.js +179 -0
  79. package/dist/spin-button/spin-button.js.map +1 -0
  80. package/dist/tabs/tabs.d.ts +157 -0
  81. package/dist/tabs/tabs.d.ts.map +1 -0
  82. package/dist/tabs/tabs.js +120 -0
  83. package/dist/tabs/tabs.js.map +1 -0
  84. package/dist/toast/toast-queue.d.ts +212 -0
  85. package/dist/toast/toast-queue.d.ts.map +1 -0
  86. package/dist/toast/toast-queue.js +290 -0
  87. package/dist/toast/toast-queue.js.map +1 -0
  88. package/dist/toast/toasts-obscure.d.ts +25 -0
  89. package/dist/toast/toasts-obscure.d.ts.map +1 -0
  90. package/dist/toast/toasts-obscure.js +30 -0
  91. package/dist/toast/toasts-obscure.js.map +1 -0
  92. package/dist/tooltip/tooltip.d.ts +183 -0
  93. package/dist/tooltip/tooltip.d.ts.map +1 -0
  94. package/dist/tooltip/tooltip.js +185 -0
  95. package/dist/tooltip/tooltip.js.map +1 -0
  96. package/dist/tree/tree.d.ts +302 -0
  97. package/dist/tree/tree.d.ts.map +1 -0
  98. package/dist/tree/tree.js +439 -0
  99. package/dist/tree/tree.js.map +1 -0
  100. package/package.json +22 -12
  101. package/styles.css +894 -3
package/styles.css CHANGED
@@ -38,8 +38,8 @@
38
38
  --ack-lit: var(--ack-tone-negative, #c4372e);
39
39
  }
40
40
 
41
- /* A readout and a meter are displays, not targets. */
42
- .ack-control:not(.ack-readout, .ack-meter) {
41
+ /* A readout, a meter and a progress ring are displays, not targets. */
42
+ .ack-control:not(.ack-readout, .ack-meter, .ack-progress-ring) {
43
43
  min-width: var(--ack-target, 44px);
44
44
  min-height: var(--ack-target, 44px);
45
45
  }
@@ -978,6 +978,882 @@
978
978
  stroke-linecap: round;
979
979
  }
980
980
 
981
+ /* Anchored popovers: a menu and a tooltip sit in the top layer against
982
+ their trigger by CSS anchor positioning (the components link them by
983
+ inline anchor names). `data-side` picks the side, `data-align` the line;
984
+ they flip to the other side when the viewport has no room, and shift
985
+ inside it when they would overflow it. */
986
+
987
+ :where(.ack-menu, .ack-tooltip) {
988
+ inset: auto;
989
+ margin: 0;
990
+ position-try-fallbacks:
991
+ flip-block,
992
+ flip-inline,
993
+ flip-block flip-inline;
994
+ }
995
+
996
+ :where(.ack-menu, .ack-tooltip)[data-side="block-end"] {
997
+ margin-block-start: var(--ack-popover-offset);
998
+ }
999
+
1000
+ :where(.ack-menu, .ack-tooltip)[data-side="block-start"] {
1001
+ margin-block-end: var(--ack-popover-offset);
1002
+ }
1003
+
1004
+ :where(.ack-menu, .ack-tooltip)[data-side="inline-end"] {
1005
+ margin-inline-start: var(--ack-popover-offset);
1006
+ }
1007
+
1008
+ :where(.ack-menu, .ack-tooltip)[data-side="inline-start"] {
1009
+ margin-inline-end: var(--ack-popover-offset);
1010
+ }
1011
+
1012
+ :where(.ack-menu, .ack-tooltip)[data-side="block-end"][data-align="start"] {
1013
+ position-area: block-end span-inline-end;
1014
+ }
1015
+
1016
+ :where(.ack-menu, .ack-tooltip)[data-side="block-end"][data-align="center"] {
1017
+ position-area: block-end;
1018
+ }
1019
+
1020
+ :where(.ack-menu, .ack-tooltip)[data-side="block-end"][data-align="end"] {
1021
+ position-area: block-end span-inline-start;
1022
+ }
1023
+
1024
+ :where(.ack-menu, .ack-tooltip)[data-side="block-start"][data-align="start"] {
1025
+ position-area: block-start span-inline-end;
1026
+ }
1027
+
1028
+ :where(
1029
+ .ack-menu,
1030
+ .ack-tooltip
1031
+ )[data-side="block-start"][data-align="center"] {
1032
+ position-area: block-start;
1033
+ }
1034
+
1035
+ :where(.ack-menu, .ack-tooltip)[data-side="block-start"][data-align="end"] {
1036
+ position-area: block-start span-inline-start;
1037
+ }
1038
+
1039
+ :where(.ack-menu, .ack-tooltip)[data-side="inline-end"][data-align="start"] {
1040
+ position-area: inline-end span-block-end;
1041
+ }
1042
+
1043
+ :where(.ack-menu, .ack-tooltip)[data-side="inline-end"][data-align="center"] {
1044
+ position-area: inline-end;
1045
+ }
1046
+
1047
+ :where(.ack-menu, .ack-tooltip)[data-side="inline-end"][data-align="end"] {
1048
+ position-area: inline-end span-block-start;
1049
+ }
1050
+
1051
+ :where(
1052
+ .ack-menu,
1053
+ .ack-tooltip
1054
+ )[data-side="inline-start"][data-align="start"] {
1055
+ position-area: inline-start span-block-end;
1056
+ }
1057
+
1058
+ :where(
1059
+ .ack-menu,
1060
+ .ack-tooltip
1061
+ )[data-side="inline-start"][data-align="center"] {
1062
+ position-area: inline-start;
1063
+ }
1064
+
1065
+ :where(.ack-menu, .ack-tooltip)[data-side="inline-start"][data-align="end"] {
1066
+ position-area: inline-start span-block-start;
1067
+ }
1068
+
1069
+ /* Without anchor positioning (or its polyfill), the popover keeps the
1070
+ browser's place: the middle of the viewport. */
1071
+ @supports not (anchor-name: --ack-anchor) {
1072
+ :where(.ack-menu, .ack-tooltip)[data-side] {
1073
+ inset: 0;
1074
+ margin: auto;
1075
+ }
1076
+ }
1077
+
1078
+ /* Menu button and menu */
1079
+
1080
+ .ack-menu-button-chevron {
1081
+ display: inline-flex;
1082
+ width: 12px;
1083
+ height: 12px;
1084
+ transition: transform var(--ack-motion, 120ms ease-out);
1085
+ }
1086
+
1087
+ .ack-menu-button-chevron > svg {
1088
+ width: 100%;
1089
+ height: 100%;
1090
+ fill: none;
1091
+ stroke: currentColor;
1092
+ stroke-width: 2;
1093
+ stroke-linecap: round;
1094
+ stroke-linejoin: round;
1095
+ }
1096
+
1097
+ .ack-menu-button[aria-expanded="true"] .ack-menu-button-chevron {
1098
+ transform: rotate(180deg);
1099
+ }
1100
+
1101
+ .ack-menu {
1102
+ --ack-popover-offset: var(--ack-menu-offset, 4px);
1103
+
1104
+ box-sizing: border-box;
1105
+ min-inline-size: var(--ack-menu-min-width, 10rem);
1106
+ min-inline-size: max(var(--ack-menu-min-width, 10rem), anchor-size(inline));
1107
+ max-inline-size: calc(100vw - 16px);
1108
+ max-block-size: min(var(--ack-menu-max-height, 24rem), 100%);
1109
+ overflow-y: auto;
1110
+ overscroll-behavior: contain;
1111
+ padding: 4px;
1112
+ border: 1px solid
1113
+ var(--ack-line, color-mix(in srgb, currentColor 28%, transparent));
1114
+ border-radius: var(--ack-radius, 6px);
1115
+ background: var(--ack-menu-background, Canvas);
1116
+ color: var(--ack-menu-text, CanvasText);
1117
+ box-shadow: var(--ack-menu-shadow, 0 6px 24px rgb(0 0 0 / 0.18));
1118
+ opacity: 0;
1119
+ transition:
1120
+ opacity var(--ack-motion, 120ms ease-out),
1121
+ overlay var(--ack-motion, 120ms ease-out) allow-discrete,
1122
+ display var(--ack-motion, 120ms ease-out) allow-discrete;
1123
+ }
1124
+
1125
+ .ack-menu:popover-open {
1126
+ opacity: 1;
1127
+ }
1128
+
1129
+ @starting-style {
1130
+ .ack-menu:popover-open {
1131
+ opacity: 0;
1132
+ }
1133
+ }
1134
+
1135
+ .ack-menu:focus {
1136
+ outline: none;
1137
+ }
1138
+
1139
+ .ack-menu-item {
1140
+ display: flex;
1141
+ align-items: center;
1142
+ gap: 8px;
1143
+ box-sizing: border-box;
1144
+ min-block-size: var(--ack-target, 44px);
1145
+ padding-inline: 8px 12px;
1146
+ border-radius: var(--ack-radius-small, 4px);
1147
+ cursor: default;
1148
+ user-select: none;
1149
+ -webkit-user-select: none;
1150
+ }
1151
+
1152
+ /* A mouse focuses the item it moves over, so focus is the highlight. */
1153
+ .ack-menu-item:focus {
1154
+ outline: none;
1155
+ background: var(
1156
+ --ack-menu-item-focus,
1157
+ color-mix(in srgb, currentColor 12%, transparent)
1158
+ );
1159
+ }
1160
+
1161
+ .ack-menu-item:focus-visible {
1162
+ outline: 2px solid var(--ack-focus-ring, var(--ack-accent, #2563c9));
1163
+ outline-offset: -2px;
1164
+ }
1165
+
1166
+ .ack-menu-item[aria-disabled="true"] {
1167
+ opacity: 0.45;
1168
+ }
1169
+
1170
+ .ack-menu-item-indicator,
1171
+ .ack-menu-item-icon {
1172
+ display: inline-flex;
1173
+ flex: none;
1174
+ width: 16px;
1175
+ height: 16px;
1176
+ }
1177
+
1178
+ .ack-menu-item-indicator > svg {
1179
+ width: 100%;
1180
+ height: 100%;
1181
+ fill: none;
1182
+ stroke: currentColor;
1183
+ stroke-width: 2;
1184
+ stroke-linecap: round;
1185
+ stroke-linejoin: round;
1186
+ }
1187
+
1188
+ .ack-menu-item[data-kind="radio"] .ack-menu-item-indicator > svg {
1189
+ fill: currentColor;
1190
+ }
1191
+
1192
+ .ack-menu-item[aria-checked="false"] .ack-menu-item-indicator {
1193
+ visibility: hidden;
1194
+ }
1195
+
1196
+ .ack-menu-item-icon > svg {
1197
+ width: 100%;
1198
+ height: 100%;
1199
+ }
1200
+
1201
+ .ack-menu-item-label {
1202
+ flex: 1;
1203
+ min-inline-size: 0;
1204
+ }
1205
+
1206
+ .ack-menu-group-label {
1207
+ padding: 8px 12px 4px;
1208
+ font-size: 12px;
1209
+ color: var(--ack-muted, color-mix(in srgb, currentColor 65%, transparent));
1210
+ }
1211
+
1212
+ .ack-menu-separator {
1213
+ block-size: 1px;
1214
+ margin: 4px 0;
1215
+ background: var(
1216
+ --ack-line,
1217
+ color-mix(in srgb, currentColor 28%, transparent)
1218
+ );
1219
+ }
1220
+
1221
+ /* Tooltip: short text above its trigger, in the page's colours inverted. */
1222
+
1223
+ .ack-tooltip {
1224
+ --ack-popover-offset: var(--ack-tooltip-offset, 6px);
1225
+
1226
+ box-sizing: border-box;
1227
+ max-inline-size: min(
1228
+ var(--ack-tooltip-max-width, 18rem),
1229
+ calc(100vw - 16px)
1230
+ );
1231
+ padding: 4px 8px;
1232
+ /* Transparent, until forced colours draw it. */
1233
+ border: 1px solid transparent;
1234
+ border-radius: var(--ack-radius-small, 4px);
1235
+ background: var(--ack-tooltip-background, CanvasText);
1236
+ color: var(--ack-tooltip-text, Canvas);
1237
+ font-size: 13px;
1238
+ line-height: 1.35;
1239
+ overflow: visible;
1240
+ overflow-wrap: anywhere;
1241
+ opacity: 0;
1242
+ transition:
1243
+ opacity var(--ack-motion, 120ms ease-out),
1244
+ overlay var(--ack-motion, 120ms ease-out) allow-discrete,
1245
+ display var(--ack-motion, 120ms ease-out) allow-discrete;
1246
+ }
1247
+
1248
+ .ack-tooltip:popover-open {
1249
+ opacity: 1;
1250
+ }
1251
+
1252
+ @starting-style {
1253
+ .ack-tooltip:popover-open {
1254
+ opacity: 0;
1255
+ }
1256
+ }
1257
+
1258
+ /* Toaster: a manual popover at an edge of the viewport, holding a list of
1259
+ toasts. Only the toasts take the pointer. */
1260
+
1261
+ .ack-toaster {
1262
+ box-sizing: border-box;
1263
+ inset: auto;
1264
+ inline-size: min(
1265
+ var(--ack-toast-width, 24rem),
1266
+ calc(100vw - 2 * var(--ack-toaster-inset, 16px))
1267
+ );
1268
+ margin: 0;
1269
+ padding: 0;
1270
+ border: 0;
1271
+ background: transparent;
1272
+ color: inherit;
1273
+ overflow: visible;
1274
+ pointer-events: none;
1275
+ }
1276
+
1277
+ .ack-toaster:focus-visible {
1278
+ outline: 2px solid var(--ack-focus-ring, var(--ack-accent, #2563c9));
1279
+ outline-offset: 4px;
1280
+ }
1281
+
1282
+ .ack-toaster[data-position^="top"] {
1283
+ top: max(var(--ack-toaster-inset, 16px), env(safe-area-inset-top, 0px));
1284
+ }
1285
+
1286
+ .ack-toaster[data-position^="bottom"] {
1287
+ bottom: max(
1288
+ var(--ack-toaster-inset, 16px),
1289
+ env(safe-area-inset-bottom, 0px)
1290
+ );
1291
+ }
1292
+
1293
+ .ack-toaster[data-position$="-start"] {
1294
+ left: max(var(--ack-toaster-inset, 16px), env(safe-area-inset-left, 0px));
1295
+ }
1296
+
1297
+ .ack-toaster[data-position$="-end"] {
1298
+ right: max(var(--ack-toaster-inset, 16px), env(safe-area-inset-right, 0px));
1299
+ }
1300
+
1301
+ .ack-toaster[data-position$="-start"]:dir(rtl) {
1302
+ right: max(var(--ack-toaster-inset, 16px), env(safe-area-inset-right, 0px));
1303
+ left: auto;
1304
+ }
1305
+
1306
+ .ack-toaster[data-position$="-end"]:dir(rtl) {
1307
+ left: max(var(--ack-toaster-inset, 16px), env(safe-area-inset-left, 0px));
1308
+ right: auto;
1309
+ }
1310
+
1311
+ .ack-toaster[data-position$="-center"] {
1312
+ right: 0;
1313
+ left: 0;
1314
+ margin-inline: auto;
1315
+ }
1316
+
1317
+ .ack-toaster-list {
1318
+ display: flex;
1319
+ flex-direction: column;
1320
+ gap: var(--ack-toast-gap, 8px);
1321
+ margin: 0;
1322
+ padding: 0;
1323
+ list-style: none;
1324
+ }
1325
+
1326
+ .ack-toast {
1327
+ --ack-toast-accent: var(--ack-accent, #2563c9);
1328
+ --ack-toast-shift: 8px;
1329
+
1330
+ display: flex;
1331
+ align-items: center;
1332
+ gap: 8px;
1333
+ padding-block: 4px;
1334
+ padding-inline: 12px 4px;
1335
+ border: 1px solid
1336
+ var(--ack-line, color-mix(in srgb, currentColor 28%, transparent));
1337
+ border-inline-start: 4px solid var(--ack-toast-accent);
1338
+ border-radius: var(--ack-radius, 6px);
1339
+ background: var(--ack-toast-background, Canvas);
1340
+ color: var(--ack-toast-text, CanvasText);
1341
+ box-shadow: var(--ack-toast-shadow, 0 6px 24px rgb(0 0 0 / 0.18));
1342
+ pointer-events: auto;
1343
+ transition:
1344
+ opacity var(--ack-motion, 120ms ease-out),
1345
+ transform var(--ack-motion, 120ms ease-out);
1346
+ }
1347
+
1348
+ .ack-toaster[data-position^="top"] .ack-toast {
1349
+ --ack-toast-shift: -8px;
1350
+ }
1351
+
1352
+ .ack-toast[data-tone="positive"] {
1353
+ --ack-toast-accent: var(--ack-tone-positive, #1f7a45);
1354
+ }
1355
+
1356
+ .ack-toast[data-tone="warning"] {
1357
+ --ack-toast-accent: var(--ack-tone-warning, #e08a12);
1358
+ }
1359
+
1360
+ .ack-toast[data-tone="negative"] {
1361
+ --ack-toast-accent: var(--ack-tone-negative, #c4372e);
1362
+ }
1363
+
1364
+ @starting-style {
1365
+ .ack-toast {
1366
+ opacity: 0;
1367
+ transform: translateY(var(--ack-toast-shift));
1368
+ }
1369
+ }
1370
+
1371
+ .ack-toast[data-state="closing"] {
1372
+ opacity: 0;
1373
+ transform: translateY(var(--ack-toast-shift));
1374
+ }
1375
+
1376
+ /* Over the focused control, toasts fade until hovered, so focus stays in
1377
+ sight. */
1378
+ .ack-toaster[data-obscuring]
1379
+ .ack-toast[data-state="open"]:not(:hover, :focus-within) {
1380
+ opacity: var(--ack-toast-obscuring-opacity, 0.2);
1381
+ }
1382
+
1383
+ .ack-toast-text {
1384
+ flex: 1;
1385
+ min-inline-size: 0;
1386
+ padding-block: 6px;
1387
+ }
1388
+
1389
+ .ack-toast-title,
1390
+ .ack-toast-description {
1391
+ margin: 0;
1392
+ }
1393
+
1394
+ .ack-toast-title {
1395
+ font-weight: 600;
1396
+ }
1397
+
1398
+ .ack-toast-description {
1399
+ color: var(--ack-muted, color-mix(in srgb, currentColor 65%, transparent));
1400
+ }
1401
+
1402
+ .ack-toast-close .ack-button-icon > svg {
1403
+ width: 16px;
1404
+ height: 16px;
1405
+ fill: none;
1406
+ stroke: currentColor;
1407
+ stroke-width: 2;
1408
+ stroke-linecap: round;
1409
+ }
1410
+
1411
+ /* Tabs: a row (or a column) of tabs over their panels. The selected tab
1412
+ carries a bar in its tone along the panel's edge, besides its text
1413
+ colour. */
1414
+
1415
+ .ack-tabs {
1416
+ display: flex;
1417
+ flex-direction: column;
1418
+ gap: var(--ack-tabs-gap, 12px);
1419
+ }
1420
+
1421
+ .ack-tabs[data-orientation="vertical"] {
1422
+ flex-direction: row;
1423
+ }
1424
+
1425
+ .ack-tab-list {
1426
+ display: flex;
1427
+ gap: 2px;
1428
+ overflow: auto hidden;
1429
+ scrollbar-width: thin;
1430
+ border-block-end: 1px solid
1431
+ var(--ack-line, color-mix(in srgb, currentColor 28%, transparent));
1432
+ }
1433
+
1434
+ .ack-tab-list:focus {
1435
+ outline: none;
1436
+ }
1437
+
1438
+ .ack-tab-list[data-orientation="vertical"] {
1439
+ flex: none;
1440
+ flex-direction: column;
1441
+ overflow: visible auto;
1442
+ border-block-end: 0;
1443
+ border-inline-end: 1px solid
1444
+ var(--ack-line, color-mix(in srgb, currentColor 28%, transparent));
1445
+ }
1446
+
1447
+ .ack-tab {
1448
+ position: relative;
1449
+ display: inline-flex;
1450
+ flex: none;
1451
+ align-items: center;
1452
+ justify-content: center;
1453
+ gap: 8px;
1454
+ box-sizing: border-box;
1455
+ min-inline-size: var(--ack-target, 44px);
1456
+ min-block-size: var(--ack-target, 44px);
1457
+ padding: 0 16px;
1458
+ border: 0;
1459
+ background: none;
1460
+ color: var(--ack-muted, color-mix(in srgb, currentColor 65%, transparent));
1461
+ font: inherit;
1462
+ font-size: 14px;
1463
+ font-weight: 600;
1464
+ white-space: nowrap;
1465
+ cursor: pointer;
1466
+ touch-action: manipulation;
1467
+ transition: color var(--ack-motion, 120ms ease-out);
1468
+ }
1469
+
1470
+ .ack-tab::after {
1471
+ position: absolute;
1472
+ inset-inline: 8px;
1473
+ inset-block-end: 0;
1474
+ block-size: var(--ack-tab-indicator-thickness, 3px);
1475
+ border-radius: var(--ack-tab-indicator-thickness, 3px);
1476
+ background: transparent;
1477
+ content: "";
1478
+ }
1479
+
1480
+ .ack-tab-list[data-orientation="vertical"] .ack-tab {
1481
+ justify-content: flex-start;
1482
+ }
1483
+
1484
+ .ack-tab-list[data-orientation="vertical"] .ack-tab::after {
1485
+ inset-block: 8px;
1486
+ inset-inline: auto 0;
1487
+ inline-size: var(--ack-tab-indicator-thickness, 3px);
1488
+ block-size: auto;
1489
+ }
1490
+
1491
+ .ack-tab:is(:hover, [aria-selected="true"]):not([aria-disabled="true"]) {
1492
+ color: inherit;
1493
+ }
1494
+
1495
+ .ack-tab[aria-selected="true"]::after {
1496
+ background: var(--ack-tab-indicator, var(--ack-lit));
1497
+ }
1498
+
1499
+ .ack-tab:focus-visible {
1500
+ outline: 2px solid var(--ack-focus-ring, var(--ack-lit));
1501
+ outline-offset: -2px;
1502
+ border-radius: var(--ack-radius-small, 4px);
1503
+ }
1504
+
1505
+ .ack-tab[aria-disabled="true"] {
1506
+ opacity: 0.45;
1507
+ cursor: default;
1508
+ }
1509
+
1510
+ .ack-tab-icon {
1511
+ display: inline-flex;
1512
+ flex: none;
1513
+ width: var(--ack-button-icon-size, 20px);
1514
+ height: var(--ack-button-icon-size, 20px);
1515
+ }
1516
+
1517
+ .ack-tab-icon > :is(svg, img) {
1518
+ width: 100%;
1519
+ height: 100%;
1520
+ }
1521
+
1522
+ .ack-tab-panel {
1523
+ flex: 1;
1524
+ min-inline-size: 0;
1525
+ }
1526
+
1527
+ .ack-tab-panel:focus-visible {
1528
+ outline: 2px solid var(--ack-focus-ring, var(--ack-lit));
1529
+ outline-offset: 2px;
1530
+ }
1531
+
1532
+ /* Progress ring: an arc filled clockwise from twelve o'clock to
1533
+ `--ack-progress-fraction`, which the component sets from 0 to 1; a turning
1534
+ quarter while indeterminate. */
1535
+
1536
+ .ack-progress-ring {
1537
+ --ack-progress-fraction: 0;
1538
+ display: inline-grid;
1539
+ place-items: center;
1540
+ inline-size: var(--ack-progress-ring-size, 48px);
1541
+ block-size: var(--ack-progress-ring-size, 48px);
1542
+ vertical-align: middle;
1543
+ }
1544
+
1545
+ .ack-progress-ring-dial {
1546
+ grid-area: 1 / 1;
1547
+ inline-size: 100%;
1548
+ block-size: 100%;
1549
+ overflow: visible;
1550
+ transform: rotate(-90deg);
1551
+ }
1552
+
1553
+ .ack-progress-ring-track,
1554
+ .ack-progress-ring-indicator {
1555
+ fill: none;
1556
+ stroke-width: var(--ack-progress-ring-thickness, 4);
1557
+ }
1558
+
1559
+ .ack-progress-ring-track {
1560
+ stroke: var(
1561
+ --ack-progress-ring-track,
1562
+ var(
1563
+ --ack-surface-raised,
1564
+ color-mix(in srgb, currentColor 18%, transparent)
1565
+ )
1566
+ );
1567
+ }
1568
+
1569
+ .ack-progress-ring-indicator {
1570
+ stroke: var(--ack-lit);
1571
+ stroke-dasharray: var(--ack-progress-fraction) 1;
1572
+ transition: stroke-dasharray var(--ack-motion, 120ms ease-out);
1573
+ }
1574
+
1575
+ .ack-progress-ring[data-state="indeterminate"] .ack-progress-ring-indicator {
1576
+ stroke-dasharray: 0.25 1;
1577
+ stroke-linecap: round;
1578
+ }
1579
+
1580
+ .ack-progress-ring[data-state="indeterminate"] .ack-progress-ring-dial {
1581
+ animation: ack-progress-ring-turn 1s linear infinite;
1582
+ }
1583
+
1584
+ @keyframes ack-progress-ring-turn {
1585
+ from {
1586
+ transform: rotate(-90deg);
1587
+ }
1588
+
1589
+ to {
1590
+ transform: rotate(270deg);
1591
+ }
1592
+ }
1593
+
1594
+ .ack-progress-ring-value {
1595
+ grid-area: 1 / 1;
1596
+ font-family: var(--ack-font-mono, ui-monospace, monospace);
1597
+ font-size: var(--ack-progress-ring-value-size, 12px);
1598
+ font-variant-numeric: tabular-nums;
1599
+ }
1600
+
1601
+ /* Spin button: the value between its − and + buttons, each a full target. */
1602
+
1603
+ .ack-spin-button {
1604
+ display: inline-flex;
1605
+ flex-direction: column;
1606
+ gap: 4px;
1607
+ }
1608
+
1609
+ .ack-spin-button-label {
1610
+ font-size: 13px;
1611
+ }
1612
+
1613
+ .ack-spin-button-body {
1614
+ display: inline-flex;
1615
+ align-items: stretch;
1616
+ align-self: flex-start;
1617
+ border: 1px solid
1618
+ var(--ack-line, color-mix(in srgb, currentColor 28%, transparent));
1619
+ border-radius: var(--ack-radius, 6px);
1620
+ background: var(
1621
+ --ack-spin-button-background,
1622
+ var(--ack-surface, color-mix(in srgb, currentColor 10%, transparent))
1623
+ );
1624
+ }
1625
+
1626
+ .ack-spin-button-field {
1627
+ display: inline-flex;
1628
+ align-items: center;
1629
+ justify-content: center;
1630
+ box-sizing: border-box;
1631
+ inline-size: var(--ack-spin-button-field-width, 5em);
1632
+ min-block-size: var(--ack-target, 44px);
1633
+ margin: 0;
1634
+ padding: 0 8px;
1635
+ border: 0;
1636
+ border-inline: 1px solid
1637
+ var(--ack-line, color-mix(in srgb, currentColor 28%, transparent));
1638
+ background: transparent;
1639
+ color: inherit;
1640
+ font-family: var(--ack-font-mono, ui-monospace, monospace);
1641
+ font-size: 15px;
1642
+ font-variant-numeric: tabular-nums;
1643
+ text-align: center;
1644
+ }
1645
+
1646
+ .ack-spin-button-field:focus-visible {
1647
+ outline: 2px solid var(--ack-focus-ring, var(--ack-lit));
1648
+ outline-offset: -2px;
1649
+ }
1650
+
1651
+ /* Not a number: an outline and a wavy underline, not the colour alone. */
1652
+ .ack-spin-button-field[aria-invalid="true"] {
1653
+ outline: 2px solid var(--ack-tone-negative, #c4372e);
1654
+ outline-offset: -2px;
1655
+ text-decoration: underline wavy var(--ack-tone-negative, #c4372e);
1656
+ }
1657
+
1658
+ .ack-spin-button-step {
1659
+ display: inline-flex;
1660
+ flex: none;
1661
+ align-items: center;
1662
+ justify-content: center;
1663
+ box-sizing: border-box;
1664
+ inline-size: var(--ack-target, 44px);
1665
+ min-block-size: var(--ack-target, 44px);
1666
+ padding: 0;
1667
+ border: 0;
1668
+ background: transparent;
1669
+ color: inherit;
1670
+ cursor: pointer;
1671
+ touch-action: manipulation;
1672
+ transition: background var(--ack-motion, 120ms ease-out);
1673
+ }
1674
+
1675
+ .ack-spin-button-step:not(:disabled):hover {
1676
+ background: var(
1677
+ --ack-surface-raised,
1678
+ color-mix(in srgb, currentColor 18%, transparent)
1679
+ );
1680
+ }
1681
+
1682
+ .ack-spin-button-step:disabled {
1683
+ opacity: 0.45;
1684
+ cursor: default;
1685
+ }
1686
+
1687
+ /* The whole control is dimmed already. */
1688
+ .ack-spin-button[data-disabled] .ack-spin-button-step:disabled {
1689
+ opacity: 1;
1690
+ }
1691
+
1692
+ .ack-spin-button-icon {
1693
+ display: inline-flex;
1694
+ width: 16px;
1695
+ height: 16px;
1696
+ }
1697
+
1698
+ .ack-spin-button-icon > svg {
1699
+ width: 100%;
1700
+ height: 100%;
1701
+ fill: none;
1702
+ stroke: currentColor;
1703
+ stroke-width: 2;
1704
+ stroke-linecap: round;
1705
+ }
1706
+
1707
+ /* Tree view: one flat list of rows, each indented by its level
1708
+ (`--ack-tree-level`, set by the component). A selected row carries a bar
1709
+ in its tone at its start, besides its background. */
1710
+
1711
+ .ack-tree {
1712
+ margin: 0;
1713
+ padding: 0;
1714
+ list-style: none;
1715
+ }
1716
+
1717
+ .ack-tree-item {
1718
+ position: relative;
1719
+ display: flex;
1720
+ align-items: center;
1721
+ gap: 4px;
1722
+ box-sizing: border-box;
1723
+ min-block-size: var(--ack-tree-item-height, var(--ack-target, 44px));
1724
+ padding-inline: calc(
1725
+ 4px + var(--ack-tree-indent, 1.25rem) * (var(--ack-tree-level, 1) - 1)
1726
+ )
1727
+ 8px;
1728
+ border-radius: var(--ack-radius-small, 4px);
1729
+ cursor: default;
1730
+ user-select: none;
1731
+ -webkit-user-select: none;
1732
+ }
1733
+
1734
+ .ack-tree-item:hover {
1735
+ background: var(
1736
+ --ack-tree-item-hover,
1737
+ color-mix(in srgb, currentColor 6%, transparent)
1738
+ );
1739
+ }
1740
+
1741
+ .ack-tree-item[data-selected] {
1742
+ background: var(
1743
+ --ack-tree-item-selected,
1744
+ color-mix(in srgb, var(--ack-lit) 16%, transparent)
1745
+ );
1746
+ }
1747
+
1748
+ .ack-tree-item[data-selected]::before {
1749
+ position: absolute;
1750
+ inset-block: 4px;
1751
+ inset-inline-start: 0;
1752
+ inline-size: 3px;
1753
+ border-radius: 3px;
1754
+ background: var(--ack-lit);
1755
+ content: "";
1756
+ }
1757
+
1758
+ .ack-tree-item:focus {
1759
+ outline: none;
1760
+ }
1761
+
1762
+ .ack-tree-item:focus-visible {
1763
+ outline: 2px solid var(--ack-focus-ring, var(--ack-lit));
1764
+ outline-offset: -2px;
1765
+ }
1766
+
1767
+ .ack-tree-item[aria-disabled="true"] {
1768
+ opacity: 0.45;
1769
+ }
1770
+
1771
+ .ack-tree-item-toggle {
1772
+ display: inline-flex;
1773
+ flex: none;
1774
+ align-items: center;
1775
+ justify-content: center;
1776
+ inline-size: var(--ack-tree-toggle-size, 24px);
1777
+ block-size: var(--ack-tree-toggle-size, 24px);
1778
+ border-radius: var(--ack-radius-small, 4px);
1779
+ }
1780
+
1781
+ .ack-tree-item[aria-expanded] > .ack-tree-item-toggle {
1782
+ cursor: pointer;
1783
+ }
1784
+
1785
+ .ack-tree-item-toggle > svg {
1786
+ width: 16px;
1787
+ height: 16px;
1788
+ fill: none;
1789
+ stroke: currentColor;
1790
+ stroke-width: 2;
1791
+ stroke-linecap: round;
1792
+ stroke-linejoin: round;
1793
+ transition: transform var(--ack-motion, 120ms ease-out);
1794
+ }
1795
+
1796
+ .ack-tree-item-toggle:dir(rtl) > svg {
1797
+ transform: scaleX(-1);
1798
+ }
1799
+
1800
+ .ack-tree-item[aria-expanded="true"] > .ack-tree-item-toggle > svg {
1801
+ transform: rotate(90deg);
1802
+ }
1803
+
1804
+ /* Children loading: a turning arc in place of the mark. */
1805
+ .ack-tree-item-toggle[data-loading] > svg {
1806
+ display: none;
1807
+ }
1808
+
1809
+ .ack-tree-item-toggle[data-loading]::after {
1810
+ box-sizing: border-box;
1811
+ inline-size: 14px;
1812
+ block-size: 14px;
1813
+ border: 2px solid currentColor;
1814
+ border-block-start-color: transparent;
1815
+ border-radius: 50%;
1816
+ animation: ack-progress-ring-turn 1s linear infinite;
1817
+ content: "";
1818
+ }
1819
+
1820
+ .ack-tree-item-content {
1821
+ flex: 1;
1822
+ min-inline-size: 0;
1823
+ }
1824
+
1825
+ /* Forced colours drop backgrounds: the focused item keeps a visible mark. */
1826
+ @media (forced-colors: active) {
1827
+ .ack-menu-item:focus {
1828
+ outline: 2px solid Highlight;
1829
+ outline-offset: -2px;
1830
+ }
1831
+
1832
+ .ack-tab[aria-selected="true"]::after,
1833
+ .ack-tree-item[data-selected]::before {
1834
+ forced-color-adjust: none;
1835
+ background: SelectedItem;
1836
+ }
1837
+
1838
+ .ack-tree-item[data-selected] {
1839
+ forced-color-adjust: none;
1840
+ background: SelectedItem;
1841
+ color: SelectedItemText;
1842
+ }
1843
+
1844
+ .ack-progress-ring-dial {
1845
+ forced-color-adjust: none;
1846
+ }
1847
+
1848
+ .ack-progress-ring-track {
1849
+ stroke: GrayText;
1850
+ }
1851
+
1852
+ .ack-progress-ring-indicator {
1853
+ stroke: Highlight;
1854
+ }
1855
+ }
1856
+
981
1857
  @media (prefers-reduced-motion: reduce) {
982
1858
  .ack-toggle-button,
983
1859
  .ack-button,
@@ -985,8 +1861,23 @@
985
1861
  .ack-switch-thumb,
986
1862
  .ack-radio,
987
1863
  .ack-dialog,
988
- .ack-dialog::backdrop {
1864
+ .ack-dialog::backdrop,
1865
+ .ack-menu,
1866
+ .ack-menu-button-chevron,
1867
+ .ack-tooltip,
1868
+ .ack-toast,
1869
+ .ack-tab,
1870
+ .ack-progress-ring-indicator,
1871
+ .ack-spin-button-step,
1872
+ .ack-tree-item-toggle > svg {
989
1873
  transition: none;
990
1874
  }
1875
+
1876
+ /* Still: an indeterminate ring keeps its quarter arc, and a loading
1877
+ branch its arc, without turning. */
1878
+ .ack-progress-ring[data-state="indeterminate"] .ack-progress-ring-dial,
1879
+ .ack-tree-item-toggle[data-loading]::after {
1880
+ animation: none;
1881
+ }
991
1882
  }
992
1883
  }