@antadesign/anta 0.2.0 → 0.2.1

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 (246) hide show
  1. package/README.md +40 -1
  2. package/dist/components/Progress.module.css +0 -5
  3. package/dist/components/Text.module.css +0 -6
  4. package/dist/elements/a-button.css +1 -756
  5. package/dist/elements/a-icon.css +1 -43
  6. package/dist/elements/a-icon.shapes.css +1 -377
  7. package/dist/elements/a-progress.css +1 -68
  8. package/dist/elements/a-tag.css +1 -196
  9. package/dist/elements/a-text.css +1 -90
  10. package/dist/elements/a-title.css +1 -64
  11. package/dist/elements/a-tooltip.css +1 -62
  12. package/dist/index.d.ts +1 -0
  13. package/dist/jsx-runtime.d.ts +17 -15
  14. package/dist/reset.css +1 -209
  15. package/dist/tokens.css +1 -285
  16. package/package.json +6 -4
  17. package/dist/components/Button.module.css +0 -2
  18. package/dist/components/Menu.d.ts +0 -61
  19. package/dist/components/Menu.js +0 -34
  20. package/dist/components/MenuGroup.d.ts +0 -24
  21. package/dist/components/MenuGroup.js +0 -19
  22. package/dist/components/MenuItem.d.ts +0 -49
  23. package/dist/components/MenuItem.js +0 -40
  24. package/dist/components/MenuSeparator.d.ts +0 -14
  25. package/dist/components/MenuSeparator.js +0 -7
  26. package/dist/components/Sticker.d.ts +0 -31
  27. package/dist/components/Sticker.js +0 -17
  28. package/dist/components/StickerAnimated.d.ts +0 -23
  29. package/dist/components/StickerAnimated.js +0 -28
  30. package/dist/components/__generated__/stickers/angry-animated.d.ts +0 -3
  31. package/dist/components/__generated__/stickers/angry-animated.js +0 -7
  32. package/dist/components/__generated__/stickers/angry.d.ts +0 -3
  33. package/dist/components/__generated__/stickers/angry.js +0 -7
  34. package/dist/components/__generated__/stickers/ask-animated.d.ts +0 -3
  35. package/dist/components/__generated__/stickers/ask-animated.js +0 -7
  36. package/dist/components/__generated__/stickers/ask.d.ts +0 -3
  37. package/dist/components/__generated__/stickers/ask.js +0 -7
  38. package/dist/components/__generated__/stickers/balance-animated.d.ts +0 -3
  39. package/dist/components/__generated__/stickers/balance-animated.js +0 -7
  40. package/dist/components/__generated__/stickers/balance.d.ts +0 -3
  41. package/dist/components/__generated__/stickers/balance.js +0 -7
  42. package/dist/components/__generated__/stickers/butterfly-animated.d.ts +0 -3
  43. package/dist/components/__generated__/stickers/butterfly-animated.js +0 -7
  44. package/dist/components/__generated__/stickers/butterfly-snake-animated.d.ts +0 -3
  45. package/dist/components/__generated__/stickers/butterfly-snake-animated.js +0 -7
  46. package/dist/components/__generated__/stickers/butterfly-snake.d.ts +0 -3
  47. package/dist/components/__generated__/stickers/butterfly-snake.js +0 -7
  48. package/dist/components/__generated__/stickers/butterfly.d.ts +0 -3
  49. package/dist/components/__generated__/stickers/butterfly.js +0 -7
  50. package/dist/components/__generated__/stickers/catch-animated.d.ts +0 -3
  51. package/dist/components/__generated__/stickers/catch-animated.js +0 -7
  52. package/dist/components/__generated__/stickers/catch.d.ts +0 -3
  53. package/dist/components/__generated__/stickers/catch.js +0 -7
  54. package/dist/components/__generated__/stickers/clap-animated.d.ts +0 -3
  55. package/dist/components/__generated__/stickers/clap-animated.js +0 -7
  56. package/dist/components/__generated__/stickers/clap.d.ts +0 -3
  57. package/dist/components/__generated__/stickers/clap.js +0 -7
  58. package/dist/components/__generated__/stickers/coding-animated.d.ts +0 -3
  59. package/dist/components/__generated__/stickers/coding-animated.js +0 -7
  60. package/dist/components/__generated__/stickers/coding.d.ts +0 -3
  61. package/dist/components/__generated__/stickers/coding.js +0 -7
  62. package/dist/components/__generated__/stickers/cowboy-animated.d.ts +0 -3
  63. package/dist/components/__generated__/stickers/cowboy-animated.js +0 -7
  64. package/dist/components/__generated__/stickers/cowboy.d.ts +0 -3
  65. package/dist/components/__generated__/stickers/cowboy.js +0 -7
  66. package/dist/components/__generated__/stickers/dance-animated.d.ts +0 -3
  67. package/dist/components/__generated__/stickers/dance-animated.js +0 -7
  68. package/dist/components/__generated__/stickers/dance.d.ts +0 -3
  69. package/dist/components/__generated__/stickers/dance.js +0 -7
  70. package/dist/components/__generated__/stickers/detective-animated.d.ts +0 -3
  71. package/dist/components/__generated__/stickers/detective-animated.js +0 -7
  72. package/dist/components/__generated__/stickers/detective.d.ts +0 -3
  73. package/dist/components/__generated__/stickers/detective.js +0 -7
  74. package/dist/components/__generated__/stickers/disapprove-animated.d.ts +0 -3
  75. package/dist/components/__generated__/stickers/disapprove-animated.js +0 -7
  76. package/dist/components/__generated__/stickers/disapprove.d.ts +0 -3
  77. package/dist/components/__generated__/stickers/disapprove.js +0 -7
  78. package/dist/components/__generated__/stickers/distracted-animated.d.ts +0 -3
  79. package/dist/components/__generated__/stickers/distracted-animated.js +0 -7
  80. package/dist/components/__generated__/stickers/distracted.d.ts +0 -3
  81. package/dist/components/__generated__/stickers/distracted.js +0 -7
  82. package/dist/components/__generated__/stickers/dive-animated.d.ts +0 -3
  83. package/dist/components/__generated__/stickers/dive-animated.js +0 -7
  84. package/dist/components/__generated__/stickers/dive.d.ts +0 -3
  85. package/dist/components/__generated__/stickers/dive.js +0 -7
  86. package/dist/components/__generated__/stickers/eat-animated.d.ts +0 -3
  87. package/dist/components/__generated__/stickers/eat-animated.js +0 -7
  88. package/dist/components/__generated__/stickers/eat.d.ts +0 -3
  89. package/dist/components/__generated__/stickers/eat.js +0 -7
  90. package/dist/components/__generated__/stickers/facepalm-animated.d.ts +0 -3
  91. package/dist/components/__generated__/stickers/facepalm-animated.js +0 -7
  92. package/dist/components/__generated__/stickers/facepalm.d.ts +0 -3
  93. package/dist/components/__generated__/stickers/facepalm.js +0 -7
  94. package/dist/components/__generated__/stickers/failed-animated.d.ts +0 -3
  95. package/dist/components/__generated__/stickers/failed-animated.js +0 -7
  96. package/dist/components/__generated__/stickers/failed.d.ts +0 -3
  97. package/dist/components/__generated__/stickers/failed.js +0 -7
  98. package/dist/components/__generated__/stickers/found-animated.d.ts +0 -3
  99. package/dist/components/__generated__/stickers/found-animated.js +0 -7
  100. package/dist/components/__generated__/stickers/found.d.ts +0 -3
  101. package/dist/components/__generated__/stickers/found.js +0 -7
  102. package/dist/components/__generated__/stickers/grow-animated.d.ts +0 -3
  103. package/dist/components/__generated__/stickers/grow-animated.js +0 -7
  104. package/dist/components/__generated__/stickers/grow.d.ts +0 -3
  105. package/dist/components/__generated__/stickers/grow.js +0 -7
  106. package/dist/components/__generated__/stickers/handstand-animated.d.ts +0 -3
  107. package/dist/components/__generated__/stickers/handstand-animated.js +0 -7
  108. package/dist/components/__generated__/stickers/handstand.d.ts +0 -3
  109. package/dist/components/__generated__/stickers/handstand.js +0 -7
  110. package/dist/components/__generated__/stickers/heart-animated.d.ts +0 -3
  111. package/dist/components/__generated__/stickers/heart-animated.js +0 -7
  112. package/dist/components/__generated__/stickers/heart.d.ts +0 -3
  113. package/dist/components/__generated__/stickers/heart.js +0 -7
  114. package/dist/components/__generated__/stickers/hello-animated.d.ts +0 -3
  115. package/dist/components/__generated__/stickers/hello-animated.js +0 -7
  116. package/dist/components/__generated__/stickers/hello.d.ts +0 -3
  117. package/dist/components/__generated__/stickers/hello.js +0 -7
  118. package/dist/components/__generated__/stickers/idea-animated.d.ts +0 -3
  119. package/dist/components/__generated__/stickers/idea-animated.js +0 -7
  120. package/dist/components/__generated__/stickers/idea.d.ts +0 -3
  121. package/dist/components/__generated__/stickers/idea.js +0 -7
  122. package/dist/components/__generated__/stickers/index.d.ts +0 -99
  123. package/dist/components/__generated__/stickers/index.js +0 -198
  124. package/dist/components/__generated__/stickers/laugh-animated.d.ts +0 -3
  125. package/dist/components/__generated__/stickers/laugh-animated.js +0 -7
  126. package/dist/components/__generated__/stickers/laugh.d.ts +0 -3
  127. package/dist/components/__generated__/stickers/laugh.js +0 -7
  128. package/dist/components/__generated__/stickers/love-animated.d.ts +0 -3
  129. package/dist/components/__generated__/stickers/love-animated.js +0 -7
  130. package/dist/components/__generated__/stickers/love.d.ts +0 -3
  131. package/dist/components/__generated__/stickers/love.js +0 -7
  132. package/dist/components/__generated__/stickers/nap-animated.d.ts +0 -3
  133. package/dist/components/__generated__/stickers/nap-animated.js +0 -7
  134. package/dist/components/__generated__/stickers/nap.d.ts +0 -3
  135. package/dist/components/__generated__/stickers/nap.js +0 -7
  136. package/dist/components/__generated__/stickers/party-animated.d.ts +0 -3
  137. package/dist/components/__generated__/stickers/party-animated.js +0 -7
  138. package/dist/components/__generated__/stickers/party.d.ts +0 -3
  139. package/dist/components/__generated__/stickers/party.js +0 -7
  140. package/dist/components/__generated__/stickers/passed-animated.d.ts +0 -3
  141. package/dist/components/__generated__/stickers/passed-animated.js +0 -7
  142. package/dist/components/__generated__/stickers/passed.d.ts +0 -3
  143. package/dist/components/__generated__/stickers/passed.js +0 -7
  144. package/dist/components/__generated__/stickers/peekaboo-animated.d.ts +0 -3
  145. package/dist/components/__generated__/stickers/peekaboo-animated.js +0 -7
  146. package/dist/components/__generated__/stickers/peekaboo.d.ts +0 -3
  147. package/dist/components/__generated__/stickers/peekaboo.js +0 -7
  148. package/dist/components/__generated__/stickers/pizza-animated.d.ts +0 -3
  149. package/dist/components/__generated__/stickers/pizza-animated.js +0 -7
  150. package/dist/components/__generated__/stickers/pizza.d.ts +0 -3
  151. package/dist/components/__generated__/stickers/pizza.js +0 -7
  152. package/dist/components/__generated__/stickers/puzzle-animated.d.ts +0 -3
  153. package/dist/components/__generated__/stickers/puzzle-animated.js +0 -7
  154. package/dist/components/__generated__/stickers/puzzle.d.ts +0 -3
  155. package/dist/components/__generated__/stickers/puzzle.js +0 -7
  156. package/dist/components/__generated__/stickers/sad-animated.d.ts +0 -3
  157. package/dist/components/__generated__/stickers/sad-animated.js +0 -7
  158. package/dist/components/__generated__/stickers/sad.d.ts +0 -3
  159. package/dist/components/__generated__/stickers/sad.js +0 -7
  160. package/dist/components/__generated__/stickers/scared-animated.d.ts +0 -3
  161. package/dist/components/__generated__/stickers/scared-animated.js +0 -7
  162. package/dist/components/__generated__/stickers/scared.d.ts +0 -3
  163. package/dist/components/__generated__/stickers/scared.js +0 -7
  164. package/dist/components/__generated__/stickers/scroll-animated.d.ts +0 -3
  165. package/dist/components/__generated__/stickers/scroll-animated.js +0 -7
  166. package/dist/components/__generated__/stickers/scroll.d.ts +0 -3
  167. package/dist/components/__generated__/stickers/scroll.js +0 -7
  168. package/dist/components/__generated__/stickers/search-animated.d.ts +0 -3
  169. package/dist/components/__generated__/stickers/search-animated.js +0 -7
  170. package/dist/components/__generated__/stickers/search.d.ts +0 -3
  171. package/dist/components/__generated__/stickers/search.js +0 -7
  172. package/dist/components/__generated__/stickers/shield-animated.d.ts +0 -3
  173. package/dist/components/__generated__/stickers/shield-animated.js +0 -7
  174. package/dist/components/__generated__/stickers/shield.d.ts +0 -3
  175. package/dist/components/__generated__/stickers/shield.js +0 -7
  176. package/dist/components/__generated__/stickers/shocked-animated.d.ts +0 -3
  177. package/dist/components/__generated__/stickers/shocked-animated.js +0 -7
  178. package/dist/components/__generated__/stickers/shocked.d.ts +0 -3
  179. package/dist/components/__generated__/stickers/shocked.js +0 -7
  180. package/dist/components/__generated__/stickers/sleep-animated.d.ts +0 -3
  181. package/dist/components/__generated__/stickers/sleep-animated.js +0 -7
  182. package/dist/components/__generated__/stickers/sleep.d.ts +0 -3
  183. package/dist/components/__generated__/stickers/sleep.js +0 -7
  184. package/dist/components/__generated__/stickers/stressed-animated.d.ts +0 -3
  185. package/dist/components/__generated__/stickers/stressed-animated.js +0 -7
  186. package/dist/components/__generated__/stickers/stressed.d.ts +0 -3
  187. package/dist/components/__generated__/stickers/stressed.js +0 -7
  188. package/dist/components/__generated__/stickers/suspicious-animated.d.ts +0 -3
  189. package/dist/components/__generated__/stickers/suspicious-animated.js +0 -7
  190. package/dist/components/__generated__/stickers/suspicious.d.ts +0 -3
  191. package/dist/components/__generated__/stickers/suspicious.js +0 -7
  192. package/dist/components/__generated__/stickers/thanks-animated.d.ts +0 -3
  193. package/dist/components/__generated__/stickers/thanks-animated.js +0 -7
  194. package/dist/components/__generated__/stickers/thanks.d.ts +0 -3
  195. package/dist/components/__generated__/stickers/thanks.js +0 -7
  196. package/dist/components/__generated__/stickers/think-animated.d.ts +0 -3
  197. package/dist/components/__generated__/stickers/think-animated.js +0 -7
  198. package/dist/components/__generated__/stickers/think-of-you-animated.d.ts +0 -3
  199. package/dist/components/__generated__/stickers/think-of-you-animated.js +0 -7
  200. package/dist/components/__generated__/stickers/think-of-you.d.ts +0 -3
  201. package/dist/components/__generated__/stickers/think-of-you.js +0 -7
  202. package/dist/components/__generated__/stickers/think.d.ts +0 -3
  203. package/dist/components/__generated__/stickers/think.js +0 -7
  204. package/dist/components/__generated__/stickers/thumbs-up-animated.d.ts +0 -3
  205. package/dist/components/__generated__/stickers/thumbs-up-animated.js +0 -7
  206. package/dist/components/__generated__/stickers/thumbs-up.d.ts +0 -3
  207. package/dist/components/__generated__/stickers/thumbs-up.js +0 -7
  208. package/dist/components/__generated__/stickers/vacation-animated.d.ts +0 -3
  209. package/dist/components/__generated__/stickers/vacation-animated.js +0 -7
  210. package/dist/components/__generated__/stickers/vacation.d.ts +0 -3
  211. package/dist/components/__generated__/stickers/vacation.js +0 -7
  212. package/dist/components/__generated__/stickers/wait-animated.d.ts +0 -3
  213. package/dist/components/__generated__/stickers/wait-animated.js +0 -7
  214. package/dist/components/__generated__/stickers/wait.d.ts +0 -3
  215. package/dist/components/__generated__/stickers/wait.js +0 -7
  216. package/dist/components/__generated__/stickers/wink-animated.d.ts +0 -3
  217. package/dist/components/__generated__/stickers/wink-animated.js +0 -7
  218. package/dist/components/__generated__/stickers/wink.d.ts +0 -3
  219. package/dist/components/__generated__/stickers/wink.js +0 -7
  220. package/dist/components/__generated__/stickers/work-animated.d.ts +0 -3
  221. package/dist/components/__generated__/stickers/work-animated.js +0 -7
  222. package/dist/components/__generated__/stickers/work.d.ts +0 -3
  223. package/dist/components/__generated__/stickers/work.js +0 -7
  224. package/dist/components/__generated__/stickers/zen-animated.d.ts +0 -3
  225. package/dist/components/__generated__/stickers/zen-animated.js +0 -7
  226. package/dist/components/__generated__/stickers/zen.d.ts +0 -3
  227. package/dist/components/__generated__/stickers/zen.js +0 -7
  228. package/dist/elements/a-menu-group.css +0 -21
  229. package/dist/elements/a-menu-group.d.ts +0 -13
  230. package/dist/elements/a-menu-group.js +0 -15
  231. package/dist/elements/a-menu-item.css +0 -162
  232. package/dist/elements/a-menu-item.d.ts +0 -27
  233. package/dist/elements/a-menu-item.js +0 -29
  234. package/dist/elements/a-menu-separator.css +0 -15
  235. package/dist/elements/a-menu-separator.d.ts +0 -12
  236. package/dist/elements/a-menu-separator.js +0 -15
  237. package/dist/elements/a-menu.css +0 -34
  238. package/dist/elements/a-menu.d.ts +0 -120
  239. package/dist/elements/a-menu.js +0 -649
  240. package/dist/elements/a-sticker-animated.css +0 -9
  241. package/dist/elements/a-sticker-animated.d.ts +0 -39
  242. package/dist/elements/a-sticker-animated.js +0 -81
  243. package/dist/elements/a-sticker.css +0 -9
  244. package/dist/elements/a-sticker.d.ts +0 -19
  245. package/dist/elements/a-sticker.js +0 -32
  246. package/dist/generate-stickers.mjs +0 -293
@@ -1,68 +1 @@
1
- @layer anta {
2
- a-progress {
3
- --progress-bg: var(--bg-4);
4
- --progress-border-color: var(--border-4);
5
- --progress-indicator-bg: var(--bg-5);
6
- /* Right-edge fade: from the indicator's own bg to the border
7
- colour, both opaque. Tone variants automatically re-tint because
8
- both endpoint tokens (`--progress-indicator-bg`,
9
- `--progress-border-color`) get re-aliased per tone. */
10
- --progress-indicator-edge: linear-gradient(
11
- 90deg,
12
- var(--progress-indicator-bg) 0%,
13
- var(--progress-border-color) 100%
14
- );
15
- --progress-text-color: var(--text-2);
16
- --progress-hint-color: var(--text-3);
17
-
18
- display: block;
19
- container-type: inline-size;
20
- padding: 4px 8px;
21
- min-height: 8px;
22
- background: var(--progress-bg);
23
- /* Per-component reset, same spirit as Tailwind preflight: declare
24
- width / style / colour at a known state so a consumer only has
25
- to change ONE property to opt in. Writing `border-width: 4px`
26
- in your own CSS (or via the Anta playground's CSS tab) gives a
27
- 4px solid themed border immediately — no need to also specify
28
- `border-style: solid` or `border-color`. */
29
- border: 0px solid var(--progress-border-color);
30
- border-radius: 0;
31
- }
32
-
33
- a-progress[tone="info"] {
34
- --progress-bg: var(--bg-4-info);
35
- --progress-border-color: var(--border-4-info);
36
- --progress-indicator-bg: var(--bg-5-info);
37
- --progress-text-color: var(--text-2-info);
38
- --progress-hint-color: var(--text-3-info);
39
- }
40
-
41
- a-progress-label {
42
- display: flex;
43
- align-items: flex-start;
44
- gap: 0.5ch;
45
- font-variant-numeric: tabular-nums;
46
- font-feature-settings: 'ss02', 'ss05';
47
- letter-spacing: 0.03em;
48
- font-size: 13px;
49
- line-height: 16px;
50
- }
51
-
52
- a-progress-number {
53
- flex-shrink: 0;
54
- color: var(--progress-text-color);
55
- }
56
-
57
- a-progress-text {
58
- flex: 1 1 auto;
59
- min-width: 0;
60
- color: var(--progress-text-color);
61
- }
62
-
63
- a-progress-hint {
64
- flex-shrink: 0;
65
- margin-left: auto;
66
- color: var(--progress-hint-color);
67
- }
68
- }
1
+ @layer anta{a-progress{--progress-bg: var(--bg-4);--progress-border-color: var(--border-4);--progress-indicator-bg: var(--bg-5);--progress-indicator-edge: linear-gradient( 90deg, var(--progress-indicator-bg) 0%, var(--progress-border-color) 100% );--progress-text-color: var(--text-2);--progress-hint-color: var(--text-3);display:block;container-type:inline-size;padding:4px 8px;min-height:8px;background:var(--progress-bg);border:0px solid var(--progress-border-color);border-radius:0}a-progress[tone=info]{--progress-bg: var(--bg-4-info);--progress-border-color: var(--border-4-info);--progress-indicator-bg: var(--bg-5-info);--progress-text-color: var(--text-2-info);--progress-hint-color: var(--text-3-info)}a-progress-label{display:flex;align-items:flex-start;gap:.5ch;font-variant-numeric:tabular-nums;font-feature-settings:"ss02","ss05";letter-spacing:.03em;font-size:13px;line-height:16px}a-progress-number{flex-shrink:0;color:var(--progress-text-color)}a-progress-text{flex:1 1 auto;min-width:0;color:var(--progress-text-color)}a-progress-hint{flex-shrink:0;margin-left:auto;color:var(--progress-hint-color)}}
@@ -1,196 +1 @@
1
- @layer anta {
2
- /* `<a-tag>` is intentionally CSS-only — no JS, no shadow DOM, no
3
- `customElements.define`. It's a small uppercase pill / chip styled
4
- purely from attributes; the `Tag` JSX wrapper composes its content
5
- from `icon` / `label` / `value` / `iconTrailing` props (mirroring
6
- `<a-button>`) into the light-DOM child elements styled below.
7
-
8
- Sizing is intrinsic — no fixed height. Like `<a-button>`, the pill's
9
- height falls out of `line-height` + `padding-block` + the border, so
10
- the text is never clipped and a consumer can retune the padding
11
- tokens without fighting a hard height.
12
-
13
- Color comes from Anta's theme-aware semantic tokens (`--text-*`,
14
- `--bg-*`), so the named tones need no `.dark` rules — the tokens
15
- re-theme themselves. Only the custom-tone `oklch` knobs are re-tuned
16
- for dark mode. The hairline border derives from `--tag-text`, so
17
- every tone (named or custom) gets a matching edge. */
18
-
19
- a-tag {
20
- --tag-text: var(--text-3);
21
- --tag-bg: var(--bg-4);
22
- --tag-border: color-mix(in oklch, var(--tag-text) 9%, transparent);
23
- --tag-separator: color-mix(in oklch, var(--tag-text) 30%, transparent);
24
-
25
- /* 1.5px top/bottom — the extra 0.5px each side compensates for the
26
- 0.5px (vs 1px) border, keeping the pill at its original 20px height. */
27
- --tag-padding-block: 1.5px;
28
- --tag-padding-inline: 6.5px;
29
- --tag-icon-size: 13px;
30
- --tag-label-weight: 600;
31
- --tag-gap: 0.6ch;
32
-
33
- display: inline-flex;
34
- align-items: center;
35
- gap: var(--tag-gap);
36
- box-sizing: border-box;
37
- max-width: 100%;
38
- vertical-align: middle;
39
- overflow: hidden;
40
- white-space: nowrap;
41
- -webkit-user-drag: none;
42
-
43
- color: var(--tag-text);
44
- background: var(--tag-bg);
45
- border: 0.5px solid var(--tag-border);
46
- border-radius: 22px;
47
-
48
- padding-block: var(--tag-padding-block);
49
- padding-inline: var(--tag-padding-inline);
50
-
51
- font-family: var(--sans-serif);
52
- font-weight: 450;
53
- font-size: 11px;
54
- line-height: 16px;
55
- text-transform: uppercase;
56
- letter-spacing: 0.08ch;
57
- /* Tabular figures are always on (so counts / versions / timers don't
58
- reflow), plus `ss05` alternate numerals — both layered on top of
59
- the default ss01 / case / calt set. */
60
- font-feature-settings: 'tnum' 1, 'ss05' 1, 'ss01', 'case', 'calt';
61
- }
62
-
63
- /* Icons scale to the pill (the default 16px a-icon is too big here) and
64
- don't shrink in the flex row. */
65
- a-tag a-icon {
66
- --icon-size: var(--tag-icon-size);
67
- flex: none;
68
- }
69
-
70
- /* label / value segments. Each ellipsizes independently if the pill is
71
- width-constrained. */
72
- a-tag a-tag-label,
73
- a-tag a-tag-value {
74
- display: inline-block;
75
- min-width: 0;
76
- overflow: hidden;
77
- text-overflow: ellipsis;
78
- white-space: nowrap;
79
- }
80
- /* `value` is the default, unmodified text — it just inherits the tag's
81
- color and base weight. */
82
- a-tag a-tag-value { font-weight: 450; }
83
- /* `label` is the bold "key" placed before the value: same color, just
84
- heavier (weight 600). It only renders as <a-tag-label> when paired
85
- with a value — the JSX wrapper drops a lone label into <a-tag-value>
86
- so a standalone tag keeps the default styling. No divider; the weight
87
- contrast does the separating. */
88
- a-tag a-tag-label { font-weight: var(--tag-label-weight); }
89
-
90
- /* Optical edge padding: an icon at an edge needs less room than a text
91
- edge, so trim ~2px on whichever side a leading / trailing icon sits.
92
- `max(0px, …)` keeps it from going negative at small sizes. */
93
- a-tag:has(> a-icon:first-child) { padding-inline-start: max(0px, var(--tag-padding-inline) - 2px); }
94
- a-tag:has(> a-icon:last-child) { padding-inline-end: max(0px, var(--tag-padding-inline) - 2px); }
95
-
96
- /* Segmented children — when raw children (not the structured label /
97
- value) are passed, each segment after the first gets a hairline
98
- divider, the legacy multi-part style. Icons and the label / value
99
- elements are excluded, so `label` + `value` stay divider-less and a
100
- leading / trailing icon sits flush. The flex `gap` sits to the left
101
- of the border and `padding-left` balances it on the right. */
102
- a-tag
103
- > :not(a-icon, a-tag-label, a-tag-value)
104
- ~ :not(a-icon, a-tag-label, a-tag-value) {
105
- padding-left: var(--tag-gap);
106
- border-left: 0.5px solid var(--tag-separator);
107
- }
108
-
109
- /* Named tones — re-point text + bg only; the border re-derives, and
110
- dark mode falls out of the semantic tokens for free. */
111
- a-tag[tone="brand"] { --tag-text: var(--text-2-brand); --tag-bg: var(--bg-4-brand); }
112
- a-tag[tone="info"] { --tag-text: var(--text-2-info); --tag-bg: var(--bg-4-info); }
113
- a-tag[tone="success"] { --tag-text: var(--text-2-success); --tag-bg: var(--bg-4-success); }
114
- a-tag[tone="warning"] { --tag-text: var(--text-2-warning); --tag-bg: var(--bg-4-warning); }
115
- a-tag[tone="critical"] { --tag-text: var(--text-2-critical); --tag-bg: var(--bg-4-critical); }
116
-
117
- /* Custom tone — any non-named `tone` value. Keep the source hue;
118
- pin lightness/chroma so any input reads like a sibling of the named
119
- tones. Knobs are the only numbers to tune; the dark block re-tunes
120
- them and the formulas resolve against whichever value computes.
121
- The JSX wrapper writes `--tag-tone-source` inline; the typed
122
- `attr()` fallback picks up raw `<a-tag tone="…">` on modern engines.
123
- (oklch relative color: Chrome 119+, Safari 16.4+, Firefox 128+.) */
124
- a-tag[tone]:not(
125
- [tone="neutral"],
126
- [tone="brand"],
127
- [tone="info"],
128
- [tone="success"],
129
- [tone="warning"],
130
- [tone="critical"]
131
- ) {
132
- --tag-tone-source: attr(tone type(<color>), currentColor);
133
-
134
- --_tag-text-l: 0.46; /* fg lightness */
135
- --_tag-text-c: 0.17; /* fg chroma */
136
- --_tag-bg-l: 0.96; /* tinted-bg lightness — a hair above the named --bg-4 so the tint reads light */
137
- --_tag-bg-c: 0.04; /* tinted-bg chroma — light pastel, like --bg-4-{tone} */
138
-
139
- --tag-text: oklch(from var(--tag-tone-source) var(--_tag-text-l) var(--_tag-text-c) h);
140
- --tag-bg: oklch(from var(--tag-tone-source) var(--_tag-bg-l) var(--_tag-bg-c) h);
141
- }
142
-
143
- /* Custom tone, dark mode — lighter fg; the tint sits a touch above the
144
- dark --bg-4-{tone} lightness so it doesn't read pitch-black. */
145
- .dark a-tag[tone]:not(
146
- [tone="neutral"],
147
- [tone="brand"],
148
- [tone="info"],
149
- [tone="success"],
150
- [tone="warning"],
151
- [tone="critical"]
152
- ) {
153
- --_tag-text-l: 0.80;
154
- --_tag-text-c: 0.11;
155
- --_tag-bg-l: 0.21;
156
- --_tag-bg-c: 0.05;
157
- }
158
-
159
- a-tag[size="small"] {
160
- --tag-padding-block: 0.5px;
161
- --tag-padding-inline: 4.5px;
162
- --tag-icon-size: 11px;
163
-
164
- font-size: 10px;
165
- line-height: 14px;
166
- }
167
-
168
- /* Large — 24px tall (line-height 18 + 2×2.5 padding + 2×0.5 border),
169
- on par with Button's large. */
170
- a-tag[size="large"] {
171
- --tag-padding-block: 2.5px;
172
- --tag-padding-inline: 8.5px;
173
- --tag-icon-size: 15px;
174
-
175
- font-size: 12px;
176
- line-height: 18px;
177
- }
178
-
179
- /* Normal-case opt-out: drop the uppercase transform for proportional,
180
- mixed-case text. Keep a small body-text tracking (Anta's 0.02ch)
181
- rather than zero — uppercase just needs more (0.08ch). Tabular
182
- figures + `ss05` stay on (only the case / stylistic-set extras
183
- change). */
184
- a-tag[nocaps] {
185
- font-size: 12px;
186
- text-transform: none;
187
- letter-spacing: 0.02ch;
188
- font-feature-settings: 'tnum' 1, 'ss05' 1, 'lnum', 'ss01', 'ss04', 'case', 'calt';
189
- }
190
- /* Large + nocaps reads larger too — bump to 13px (one over the 12px
191
- uppercase large), keeping the same +1px over-uppercase relationship
192
- medium has. Height is unchanged (driven by line-height + padding). */
193
- a-tag[size="large"][nocaps] {
194
- font-size: 13px;
195
- }
196
- }
1
+ @layer anta{a-tag{--tag-text: var(--text-3);--tag-bg: var(--bg-4);--tag-border: color-mix(in oklch, var(--tag-text) 9%, transparent);--tag-separator: color-mix(in oklch, var(--tag-text) 30%, transparent);--tag-padding-block: 1.5px;--tag-padding-inline: 6.5px;--tag-icon-size: 13px;--tag-label-weight: 600;--tag-gap: .6ch;display:inline-flex;align-items:center;gap:var(--tag-gap);box-sizing:border-box;max-width:100%;vertical-align:middle;overflow:hidden;white-space:nowrap;-webkit-user-drag:none;color:var(--tag-text);background:var(--tag-bg);border:.5px solid var(--tag-border);border-radius:22px;padding-block:var(--tag-padding-block);padding-inline:var(--tag-padding-inline);font-family:var(--sans-serif);font-weight:450;font-size:11px;line-height:16px;text-transform:uppercase;letter-spacing:.08ch;font-feature-settings:"tnum" 1,"ss05" 1,"ss01","case","calt"}a-tag a-icon{--icon-size: var(--tag-icon-size);flex:none}a-tag a-tag-label,a-tag a-tag-value{display:inline-block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}a-tag a-tag-value{font-weight:450}a-tag a-tag-label{font-weight:var(--tag-label-weight)}a-tag:has(>a-icon:first-child){padding-inline-start:max(0px,var(--tag-padding-inline) - 2px)}a-tag:has(>a-icon:last-child){padding-inline-end:max(0px,var(--tag-padding-inline) - 2px)}a-tag>:not(a-icon,a-tag-label,a-tag-value)~:not(a-icon,a-tag-label,a-tag-value){padding-left:var(--tag-gap);border-left:.5px solid var(--tag-separator)}a-tag[tone=brand]{--tag-text: var(--text-2-brand);--tag-bg: var(--bg-4-brand)}a-tag[tone=info]{--tag-text: var(--text-2-info);--tag-bg: var(--bg-4-info)}a-tag[tone=success]{--tag-text: var(--text-2-success);--tag-bg: var(--bg-4-success)}a-tag[tone=warning]{--tag-text: var(--text-2-warning);--tag-bg: var(--bg-4-warning)}a-tag[tone=critical]{--tag-text: var(--text-2-critical);--tag-bg: var(--bg-4-critical)}a-tag[tone]:not([tone=neutral],[tone=brand],[tone=info],[tone=success],[tone=warning],[tone=critical]){--tag-tone-source: attr(tone type(<color>), currentColor);--_tag-text-l: .46;--_tag-text-c: .17;--_tag-bg-l: .96;--_tag-bg-c: .04;--tag-text: oklch(from var(--tag-tone-source) var(--_tag-text-l) var(--_tag-text-c) h);--tag-bg: oklch(from var(--tag-tone-source) var(--_tag-bg-l) var(--_tag-bg-c) h)}.dark a-tag[tone]:not([tone=neutral],[tone=brand],[tone=info],[tone=success],[tone=warning],[tone=critical]){--_tag-text-l: .8;--_tag-text-c: .11;--_tag-bg-l: .21;--_tag-bg-c: .05}a-tag[size=small]{--tag-padding-block: .5px;--tag-padding-inline: 4.5px;--tag-icon-size: 11px;font-size:10px;line-height:14px}a-tag[size=large]{--tag-padding-block: 2.5px;--tag-padding-inline: 8.5px;--tag-icon-size: 15px;font-size:12px;line-height:18px}a-tag[nocaps]{font-size:12px;text-transform:none;letter-spacing:.02ch;font-feature-settings:"tnum" 1,"ss05" 1,"lnum","ss01","ss04","case","calt"}a-tag[size=large][nocaps]{font-size:13px}}
@@ -1,90 +1 @@
1
- @layer anta {
2
- a-text {
3
- /* Default (no `priority`) is the SECONDARY level — body text reads at
4
- --text-2; `priority="primary"` opts into the strongest --text-1. */
5
- --text-color: var(--text-2);
6
- --text-link-color: var(--link-color);
7
- --text-link-hover: var(--link-color-hover);
8
-
9
- display: block;
10
- color: var(--text-color);
11
- font-size: 15px;
12
- line-height: 20px;
13
- }
14
-
15
- a-text[size="small"] { font-size: 13px; line-height: 16px; }
16
- a-text[size="medium"] { font-size: 15px; line-height: 20px; }
17
- a-text[size="large"] { font-size: 17px; line-height: 24px; }
18
-
19
- a-text[inline] {
20
- display: inline-block;
21
- }
22
-
23
- /* Truncation, the expandable mask, the chevron button, and the
24
- expanded-state toggle live in shadow DOM — see
25
- src/elements/a-text.ts. The one external concern is `min-width: 0`:
26
- the host needs it to shrink inside flex/grid parents so the inner
27
- clamp can actually clip content. */
28
- a-text[truncate] {
29
- min-width: 0;
30
- }
31
-
32
- /* Neutral priority overrides. The default (no `priority`) is the
33
- secondary level (--text-2, on the base rule above); `primary` opts
34
- into the strongest --text-1. Levels 1 & 2 keep the brand link color;
35
- levels 3-5 mute the link to currentColor and step the hover up by one
36
- level (3→2, 4→3, 5→4). */
37
- a-text[priority="primary"] { --text-color: var(--text-1); }
38
- a-text[priority="tertiary"] { --text-color: var(--text-3); --text-link-color: currentColor; --text-link-hover: var(--text-2); }
39
- a-text[priority="quaternary"] { --text-color: var(--text-4); --text-link-color: currentColor; --text-link-hover: var(--text-3); }
40
- a-text[priority="quinary"] { --text-color: var(--text-5); --text-link-color: currentColor; --text-link-hover: var(--text-4); }
41
-
42
- /* Tinted — text color uses --text-{N}-{tone} tokens; links are always
43
- muted (currentColor) and hover steps up one level of the same tint.
44
- Level 1 has no level above; hover keeps the color, only the underline
45
- alpha changes. */
46
- a-text[tone="brand"] { --text-color: var(--text-2-brand); --text-link-color: currentColor; --text-link-hover: var(--text-1-brand); }
47
- a-text[tone="brand"][priority="primary"] { --text-color: var(--text-1-brand); }
48
- a-text[tone="brand"][priority="tertiary"] { --text-color: var(--text-3-brand); --text-link-hover: var(--text-2-brand); }
49
- a-text[tone="brand"][priority="quaternary"] { --text-color: var(--text-4-brand); --text-link-hover: var(--text-3-brand); }
50
- a-text[tone="brand"][priority="quinary"] { --text-color: var(--text-5-brand); --text-link-hover: var(--text-4-brand); }
51
-
52
- a-text[tone="success"] { --text-color: var(--text-2-success); --text-link-color: currentColor; --text-link-hover: var(--text-1-success); }
53
- a-text[tone="success"][priority="primary"] { --text-color: var(--text-1-success); }
54
- a-text[tone="success"][priority="tertiary"] { --text-color: var(--text-3-success); --text-link-hover: var(--text-2-success); }
55
- a-text[tone="success"][priority="quaternary"] { --text-color: var(--text-4-success); --text-link-hover: var(--text-3-success); }
56
- a-text[tone="success"][priority="quinary"] { --text-color: var(--text-5-success); --text-link-hover: var(--text-4-success); }
57
-
58
- a-text[tone="critical"] { --text-color: var(--text-2-critical); --text-link-color: currentColor; --text-link-hover: var(--text-1-critical); }
59
- a-text[tone="critical"][priority="primary"] { --text-color: var(--text-1-critical); }
60
- a-text[tone="critical"][priority="tertiary"] { --text-color: var(--text-3-critical); --text-link-hover: var(--text-2-critical); }
61
- a-text[tone="critical"][priority="quaternary"] { --text-color: var(--text-4-critical); --text-link-hover: var(--text-3-critical); }
62
- a-text[tone="critical"][priority="quinary"] { --text-color: var(--text-5-critical); --text-link-hover: var(--text-4-critical); }
63
-
64
- a-text[tone="warning"] { --text-color: var(--text-2-warning); --text-link-color: currentColor; --text-link-hover: var(--text-1-warning); }
65
- a-text[tone="warning"][priority="primary"] { --text-color: var(--text-1-warning); }
66
- a-text[tone="warning"][priority="tertiary"] { --text-color: var(--text-3-warning); --text-link-hover: var(--text-2-warning); }
67
- a-text[tone="warning"][priority="quaternary"] { --text-color: var(--text-4-warning); --text-link-hover: var(--text-3-warning); }
68
- a-text[tone="warning"][priority="quinary"] { --text-color: var(--text-5-warning); --text-link-hover: var(--text-4-warning); }
69
-
70
- a-text[tone="info"] { --text-color: var(--text-2-info); --text-link-color: currentColor; --text-link-hover: var(--text-1-info); }
71
- a-text[tone="info"][priority="primary"] { --text-color: var(--text-1-info); }
72
- a-text[tone="info"][priority="tertiary"] { --text-color: var(--text-3-info); --text-link-hover: var(--text-2-info); }
73
- a-text[tone="info"][priority="quaternary"] { --text-color: var(--text-4-info); --text-link-hover: var(--text-3-info); }
74
- a-text[tone="info"][priority="quinary"] { --text-color: var(--text-5-info); --text-link-hover: var(--text-4-info); }
75
-
76
- /* Link colors layered on top of anta's global `a` defaults — only
77
- overriding what the priority/tone cascade dictates (color and the
78
- one-step-up hover color). Underline / thickness / offset / alpha
79
- are inherited from the global rule in reset.css.
80
- On hover the underline color is repeated so it tracks the priority
81
- color rather than the global --link-color-hover. */
82
- a-text a, a-text a:link, a-text a:visited { color: var(--text-link-color); }
83
- /* Hover only on real-pointer devices — avoids sticky hover after a tap. */
84
- @media (hover: hover) and (pointer: fine) {
85
- a-text a:hover {
86
- color: var(--text-link-hover);
87
- text-decoration-color: var(--text-link-hover);
88
- }
89
- }
90
- }
1
+ @layer anta{a-text{--text-color: var(--text-2);--text-link-color: var(--link-color);--text-link-hover: var(--link-color-hover);display:block;color:var(--text-color);font-size:15px;line-height:20px}a-text[size=small]{font-size:13px;line-height:16px}a-text[size=medium]{font-size:15px;line-height:20px}a-text[size=large]{font-size:17px;line-height:24px}a-text[inline]{display:inline-block}a-text[truncate]{min-width:0}a-text[priority=primary]{--text-color: var(--text-1)}a-text[priority=tertiary]{--text-color: var(--text-3);--text-link-color: currentColor;--text-link-hover: var(--text-2)}a-text[priority=quaternary]{--text-color: var(--text-4);--text-link-color: currentColor;--text-link-hover: var(--text-3)}a-text[priority=quinary]{--text-color: var(--text-5);--text-link-color: currentColor;--text-link-hover: var(--text-4)}a-text[tone=brand]{--text-color: var(--text-2-brand);--text-link-color: currentColor;--text-link-hover: var(--text-1-brand)}a-text[tone=brand][priority=primary]{--text-color: var(--text-1-brand)}a-text[tone=brand][priority=tertiary]{--text-color: var(--text-3-brand);--text-link-hover: var(--text-2-brand)}a-text[tone=brand][priority=quaternary]{--text-color: var(--text-4-brand);--text-link-hover: var(--text-3-brand)}a-text[tone=brand][priority=quinary]{--text-color: var(--text-5-brand);--text-link-hover: var(--text-4-brand)}a-text[tone=success]{--text-color: var(--text-2-success);--text-link-color: currentColor;--text-link-hover: var(--text-1-success)}a-text[tone=success][priority=primary]{--text-color: var(--text-1-success)}a-text[tone=success][priority=tertiary]{--text-color: var(--text-3-success);--text-link-hover: var(--text-2-success)}a-text[tone=success][priority=quaternary]{--text-color: var(--text-4-success);--text-link-hover: var(--text-3-success)}a-text[tone=success][priority=quinary]{--text-color: var(--text-5-success);--text-link-hover: var(--text-4-success)}a-text[tone=critical]{--text-color: var(--text-2-critical);--text-link-color: currentColor;--text-link-hover: var(--text-1-critical)}a-text[tone=critical][priority=primary]{--text-color: var(--text-1-critical)}a-text[tone=critical][priority=tertiary]{--text-color: var(--text-3-critical);--text-link-hover: var(--text-2-critical)}a-text[tone=critical][priority=quaternary]{--text-color: var(--text-4-critical);--text-link-hover: var(--text-3-critical)}a-text[tone=critical][priority=quinary]{--text-color: var(--text-5-critical);--text-link-hover: var(--text-4-critical)}a-text[tone=warning]{--text-color: var(--text-2-warning);--text-link-color: currentColor;--text-link-hover: var(--text-1-warning)}a-text[tone=warning][priority=primary]{--text-color: var(--text-1-warning)}a-text[tone=warning][priority=tertiary]{--text-color: var(--text-3-warning);--text-link-hover: var(--text-2-warning)}a-text[tone=warning][priority=quaternary]{--text-color: var(--text-4-warning);--text-link-hover: var(--text-3-warning)}a-text[tone=warning][priority=quinary]{--text-color: var(--text-5-warning);--text-link-hover: var(--text-4-warning)}a-text[tone=info]{--text-color: var(--text-2-info);--text-link-color: currentColor;--text-link-hover: var(--text-1-info)}a-text[tone=info][priority=primary]{--text-color: var(--text-1-info)}a-text[tone=info][priority=tertiary]{--text-color: var(--text-3-info);--text-link-hover: var(--text-2-info)}a-text[tone=info][priority=quaternary]{--text-color: var(--text-4-info);--text-link-hover: var(--text-3-info)}a-text[tone=info][priority=quinary]{--text-color: var(--text-5-info);--text-link-hover: var(--text-4-info)}a-text a,a-text a:link,a-text a:visited{color:var(--text-link-color)}@media(hover:hover)and (pointer:fine){a-text a:hover{color:var(--text-link-hover);text-decoration-color:var(--text-link-hover)}}}
@@ -1,64 +1 @@
1
- @layer anta {
2
- /* `<a-title>` is intentionally CSS-only — no JS, no shadow DOM, no
3
- `customElements.define`. The browser treats it as a generic unknown
4
- element; the rules below give it block layout, the demi-bold
5
- variable-font weight, and a per-level type scale + vertical rhythm.
6
- The matching `h1`-`h6` rules in `src/reset.css` are kept in lockstep
7
- so raw markup looks the same as `<Title level={n}>`. */
8
-
9
- a-title {
10
- display: block;
11
- color: var(--text-1);
12
- font-weight: 584.62;
13
- letter-spacing: 0;
14
- text-wrap: balance;
15
- }
16
-
17
- a-title a-icon {
18
- transform: translateY(-0.05em);
19
- }
20
-
21
- a-title[level="1"] { font-size: 28px; line-height: 32px; margin-block-start: 0; margin-block-end: 16px; }
22
- a-title[level="2"] { font-size: 24px; line-height: 28px; margin-block-start: 32px; margin-block-end: 12px; }
23
- a-title[level="3"] { font-size: 20px; line-height: 24px; margin-block-start: 24px; margin-block-end: 12px; }
24
- a-title[level="4"] { font-size: 17px; line-height: 20px; margin-block-start: 20px; margin-block-end: 8px; }
25
- a-title[level="5"] { font-size: 15px; line-height: 20px; margin-block-start: 16px; margin-block-end: 8px; }
26
- a-title[level="6"] { font-size: 13px; line-height: 16px; margin-block-start: 16px; margin-block-end: 4px; }
27
-
28
- /* Neutral priority overrides. */
29
- a-title[priority="secondary"] { color: var(--text-2); }
30
- a-title[priority="tertiary"] { color: var(--text-3); }
31
- a-title[priority="quaternary"] { color: var(--text-4); }
32
- a-title[priority="quinary"] { color: var(--text-5); }
33
-
34
- /* Tinted — same shape as a-text's tone × priority matrix. */
35
- a-title[tone="brand"] { color: var(--text-1-brand); }
36
- a-title[tone="brand"][priority="secondary"] { color: var(--text-2-brand); }
37
- a-title[tone="brand"][priority="tertiary"] { color: var(--text-3-brand); }
38
- a-title[tone="brand"][priority="quaternary"] { color: var(--text-4-brand); }
39
- a-title[tone="brand"][priority="quinary"] { color: var(--text-5-brand); }
40
-
41
- a-title[tone="success"] { color: var(--text-1-success); }
42
- a-title[tone="success"][priority="secondary"] { color: var(--text-2-success); }
43
- a-title[tone="success"][priority="tertiary"] { color: var(--text-3-success); }
44
- a-title[tone="success"][priority="quaternary"] { color: var(--text-4-success); }
45
- a-title[tone="success"][priority="quinary"] { color: var(--text-5-success); }
46
-
47
- a-title[tone="critical"] { color: var(--text-1-critical); }
48
- a-title[tone="critical"][priority="secondary"] { color: var(--text-2-critical); }
49
- a-title[tone="critical"][priority="tertiary"] { color: var(--text-3-critical); }
50
- a-title[tone="critical"][priority="quaternary"] { color: var(--text-4-critical); }
51
- a-title[tone="critical"][priority="quinary"] { color: var(--text-5-critical); }
52
-
53
- a-title[tone="warning"] { color: var(--text-1-warning); }
54
- a-title[tone="warning"][priority="secondary"] { color: var(--text-2-warning); }
55
- a-title[tone="warning"][priority="tertiary"] { color: var(--text-3-warning); }
56
- a-title[tone="warning"][priority="quaternary"] { color: var(--text-4-warning); }
57
- a-title[tone="warning"][priority="quinary"] { color: var(--text-5-warning); }
58
-
59
- a-title[tone="info"] { color: var(--text-1-info); }
60
- a-title[tone="info"][priority="secondary"] { color: var(--text-2-info); }
61
- a-title[tone="info"][priority="tertiary"] { color: var(--text-3-info); }
62
- a-title[tone="info"][priority="quaternary"] { color: var(--text-4-info); }
63
- a-title[tone="info"][priority="quinary"] { color: var(--text-5-info); }
64
- }
1
+ @layer anta{a-title{display:block;color:var(--text-1);font-weight:584.62;letter-spacing:0;text-wrap:balance}a-title a-icon{transform:translateY(-.05em)}a-title[level="1"]{font-size:28px;line-height:32px;margin-block-start:0;margin-block-end:16px}a-title[level="2"]{font-size:24px;line-height:28px;margin-block-start:32px;margin-block-end:12px}a-title[level="3"]{font-size:20px;line-height:24px;margin-block-start:24px;margin-block-end:12px}a-title[level="4"]{font-size:17px;line-height:20px;margin-block-start:20px;margin-block-end:8px}a-title[level="5"]{font-size:15px;line-height:20px;margin-block-start:16px;margin-block-end:8px}a-title[level="6"]{font-size:13px;line-height:16px;margin-block-start:16px;margin-block-end:4px}a-title[priority=secondary]{color:var(--text-2)}a-title[priority=tertiary]{color:var(--text-3)}a-title[priority=quaternary]{color:var(--text-4)}a-title[priority=quinary]{color:var(--text-5)}a-title[tone=brand]{color:var(--text-1-brand)}a-title[tone=brand][priority=secondary]{color:var(--text-2-brand)}a-title[tone=brand][priority=tertiary]{color:var(--text-3-brand)}a-title[tone=brand][priority=quaternary]{color:var(--text-4-brand)}a-title[tone=brand][priority=quinary]{color:var(--text-5-brand)}a-title[tone=success]{color:var(--text-1-success)}a-title[tone=success][priority=secondary]{color:var(--text-2-success)}a-title[tone=success][priority=tertiary]{color:var(--text-3-success)}a-title[tone=success][priority=quaternary]{color:var(--text-4-success)}a-title[tone=success][priority=quinary]{color:var(--text-5-success)}a-title[tone=critical]{color:var(--text-1-critical)}a-title[tone=critical][priority=secondary]{color:var(--text-2-critical)}a-title[tone=critical][priority=tertiary]{color:var(--text-3-critical)}a-title[tone=critical][priority=quaternary]{color:var(--text-4-critical)}a-title[tone=critical][priority=quinary]{color:var(--text-5-critical)}a-title[tone=warning]{color:var(--text-1-warning)}a-title[tone=warning][priority=secondary]{color:var(--text-2-warning)}a-title[tone=warning][priority=tertiary]{color:var(--text-3-warning)}a-title[tone=warning][priority=quaternary]{color:var(--text-4-warning)}a-title[tone=warning][priority=quinary]{color:var(--text-5-warning)}a-title[tone=info]{color:var(--text-1-info)}a-title[tone=info][priority=secondary]{color:var(--text-2-info)}a-title[tone=info][priority=tertiary]{color:var(--text-3-info)}a-title[tone=info][priority=quaternary]{color:var(--text-4-info)}a-title[tone=info][priority=quinary]{color:var(--text-5-info)}}
@@ -1,62 +1 @@
1
- @layer anta {
2
- /* Before the custom element upgrades on the client, <a-tooltip> is an
3
- unknown inline element and its content would flash *inside the anchor*.
4
- Hide it until defined; once defined this stops matching and the shadow
5
- `:host { display: contents }` governs (content renders only in the
6
- popover via the slot). */
7
- a-tooltip:not(:defined) {
8
- display: none;
9
- }
10
-
11
- /* On touch devices, an anchor that owns a tooltip suppresses the long-press
12
- text-selection and the iOS callout, so press-and-hold cleanly reveals the
13
- bubble (see the long-press handling in a-tooltip.ts) instead of selecting
14
- text or popping the system menu. Scoped to coarse/no-hover pointers, so
15
- fine-pointer devices keep normal text selection. The anchor is always
16
- <a-tooltip>'s direct parent (set in connectedCallback), so `:has(> …)`
17
- targets exactly it; `:where()` keeps specificity at 0 for easy override. */
18
- @media (hover: none) and (pointer: coarse) {
19
- :where(:has(> a-tooltip)) {
20
- -webkit-touch-callout: none;
21
- user-select: none;
22
- }
23
- }
24
-
25
- /* Tooltip exposes only the box "chrome" that lives inside the shadow
26
- popover and is therefore impossible to reach with plain consumer CSS.
27
- The bubble's content is slotted light DOM, so its font / colour / size
28
- are already styleable from the page — those are intentionally NOT
29
- tokens. These custom properties inherit across the shadow boundary
30
- into the popover container (see a-tooltip.ts). The host itself draws
31
- nothing and stays out of layout (`:host { display: contents }` in the
32
- shadow style). */
33
- a-tooltip {
34
- /* Frosted translucent surface (matches the legacy look): a mostly-
35
- opaque white that, paired with the container's `backdrop-filter:
36
- blur(8px)`, reads as a frosted bubble over the page. --bg-1 is
37
- #ffffff in light / #000000 in dark, so this flips to a dark frost
38
- automatically (alpha is dialed down in the .dark override). */
39
- --tooltip-bg: color-mix(in oklch, var(--bg-1) 80%, transparent);
40
- --tooltip-shadow:
41
- 0 1px 8px color-mix(in oklch, var(--text-1) 15%, transparent),
42
- 0 0 1px color-mix(in oklch, var(--text-1) 50%, transparent);
43
- --tooltip-radius: 3px;
44
- --tooltip-max-width: min(calc(100vw - 20px), 80ch);
45
- /* No real border by default — the hairline edge comes from --tooltip-shadow.
46
- Set e.g. `1px solid var(--border-5)` for an actual border. */
47
- --tooltip-border: none;
48
- /* The frost. Set to `none` (with --tooltip-bg: transparent) for a fully
49
- see-through bubble. */
50
- --tooltip-backdrop-filter: blur(8px);
51
- }
52
-
53
- /* Dark: a slightly more transparent black frost. A solid black cast shadow
54
- for lift, plus an inset 1px white ring so the bubble's edge stays crisp
55
- against dark page content. */
56
- .dark a-tooltip {
57
- --tooltip-bg: color-mix(in oklch, var(--bg-1) 70%, transparent);
58
- --tooltip-shadow:
59
- 0 2px 16px color-mix(in oklch, black 70%, transparent),
60
- inset 0 0 0 1px color-mix(in oklch, white 15%, transparent);
61
- }
62
- }
1
+ @layer anta{a-tooltip:not(:defined){display:none}@media(hover:none)and (pointer:coarse){:where(:has(>a-tooltip)){-webkit-touch-callout:none;user-select:none}}a-tooltip{--tooltip-bg: color-mix(in oklch, var(--bg-1) 80%, transparent);--tooltip-shadow: 0 1px 8px color-mix(in oklch, var(--text-1) 15%, transparent), 0 0 1px color-mix(in oklch, var(--text-1) 50%, transparent);--tooltip-radius: 3px;--tooltip-max-width: min( calc(100vw - 20px) , 80ch);--tooltip-border: none;--tooltip-backdrop-filter: blur(8px)}.dark a-tooltip{--tooltip-bg: color-mix(in oklch, var(--bg-1) 70%, transparent);--tooltip-shadow: 0 2px 16px color-mix(in oklch, black 70%, transparent), inset 0 0 0 1px color-mix(in oklch, white 15%, transparent)}}
package/dist/index.d.ts CHANGED
@@ -33,6 +33,7 @@ export { Tooltip } from './components/Tooltip';
33
33
  export type { TooltipProps } from './components/Tooltip';
34
34
  export type { BaseProps, BaseAttributes } from './general_types';
35
35
  export { configure } from './jsx-runtime';
36
+ export type { AntaIntrinsicElements } from './jsx-runtime';
36
37
  /**
37
38
  * Seed interface for the icon shape registry. The generated
38
39
  * `a-icon.shapes.d.ts` augments this interface with one key per
@@ -24,20 +24,22 @@ export declare function jsxs(type: ComponentType, props: Record<string, unknown>
24
24
  export { _Fragment as Fragment };
25
25
  import type { AProgressAttributes, ATextAttributes, ATitleAttributes, ATagAttributes, AIconAttributes, AButtonAttributes, ATooltipAttributes, BaseAttributes } from './general_types';
26
26
  export declare namespace JSX {
27
- interface IntrinsicElements extends React.JSX.IntrinsicElements {
28
- 'a-progress': AProgressAttributes;
29
- 'a-progress-label': BaseAttributes;
30
- 'a-progress-number': BaseAttributes;
31
- 'a-progress-text': BaseAttributes;
32
- 'a-progress-hint': BaseAttributes;
33
- 'a-text': ATextAttributes;
34
- 'a-title': ATitleAttributes;
35
- 'a-tag': ATagAttributes;
36
- 'a-tag-label': BaseAttributes;
37
- 'a-tag-value': BaseAttributes;
38
- 'a-icon': AIconAttributes;
39
- 'a-button': AButtonAttributes;
40
- 'a-button-label': BaseAttributes;
41
- 'a-tooltip': ATooltipAttributes;
27
+ interface IntrinsicElements extends React.JSX.IntrinsicElements, AntaIntrinsicElements {
42
28
  }
43
29
  }
30
+ export interface AntaIntrinsicElements {
31
+ 'a-progress': AProgressAttributes;
32
+ 'a-progress-label': BaseAttributes;
33
+ 'a-progress-number': BaseAttributes;
34
+ 'a-progress-text': BaseAttributes;
35
+ 'a-progress-hint': BaseAttributes;
36
+ 'a-text': ATextAttributes;
37
+ 'a-title': ATitleAttributes;
38
+ 'a-tag': ATagAttributes;
39
+ 'a-tag-label': BaseAttributes;
40
+ 'a-tag-value': BaseAttributes;
41
+ 'a-icon': AIconAttributes;
42
+ 'a-button': AButtonAttributes;
43
+ 'a-button-label': BaseAttributes;
44
+ 'a-tooltip': ATooltipAttributes;
45
+ }