@antadesign/anta 0.1.1-dev.8 → 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 (239) hide show
  1. package/README.md +42 -3
  2. package/dist/components/Button.js +4 -3
  3. package/dist/components/Progress.module.css +0 -5
  4. package/dist/components/Tag.d.ts +55 -0
  5. package/dist/components/Tag.js +40 -0
  6. package/dist/components/Text.d.ts +4 -2
  7. package/dist/components/Text.module.css +0 -6
  8. package/dist/components/Tooltip.d.ts +4 -2
  9. package/dist/elements/a-button.css +1 -733
  10. package/dist/elements/a-icon.css +1 -43
  11. package/dist/elements/a-icon.shapes.css +1 -373
  12. package/dist/elements/a-icon.shapes.d.ts +2 -1
  13. package/dist/elements/a-icon.shapes.js +3 -1
  14. package/dist/elements/a-progress.css +1 -68
  15. package/dist/elements/a-tag.css +1 -0
  16. package/dist/elements/a-text.css +1 -86
  17. package/dist/elements/a-title.css +1 -64
  18. package/dist/elements/a-tooltip.css +1 -42
  19. package/dist/elements/a-tooltip.d.ts +7 -0
  20. package/dist/elements/a-tooltip.js +96 -19
  21. package/dist/elements/index.d.ts +2 -4
  22. package/dist/elements/index.js +1 -6
  23. package/dist/general_types.d.ts +15 -35
  24. package/dist/index.d.ts +3 -4
  25. package/dist/index.js +2 -4
  26. package/dist/jsx-runtime.d.ts +19 -16
  27. package/dist/reset.css +1 -205
  28. package/dist/tokens.css +1 -285
  29. package/package.json +15 -15
  30. package/dist/components/Button.module.css +0 -2
  31. package/dist/components/Sticker.d.ts +0 -31
  32. package/dist/components/Sticker.js +0 -17
  33. package/dist/components/StickerAnimated.d.ts +0 -23
  34. package/dist/components/StickerAnimated.js +0 -28
  35. package/dist/components/__generated__/stickers/angry-animated.d.ts +0 -3
  36. package/dist/components/__generated__/stickers/angry-animated.js +0 -7
  37. package/dist/components/__generated__/stickers/angry.d.ts +0 -3
  38. package/dist/components/__generated__/stickers/angry.js +0 -7
  39. package/dist/components/__generated__/stickers/ask-animated.d.ts +0 -3
  40. package/dist/components/__generated__/stickers/ask-animated.js +0 -7
  41. package/dist/components/__generated__/stickers/ask.d.ts +0 -3
  42. package/dist/components/__generated__/stickers/ask.js +0 -7
  43. package/dist/components/__generated__/stickers/balance-animated.d.ts +0 -3
  44. package/dist/components/__generated__/stickers/balance-animated.js +0 -7
  45. package/dist/components/__generated__/stickers/balance.d.ts +0 -3
  46. package/dist/components/__generated__/stickers/balance.js +0 -7
  47. package/dist/components/__generated__/stickers/butterfly-animated.d.ts +0 -3
  48. package/dist/components/__generated__/stickers/butterfly-animated.js +0 -7
  49. package/dist/components/__generated__/stickers/butterfly-snake-animated.d.ts +0 -3
  50. package/dist/components/__generated__/stickers/butterfly-snake-animated.js +0 -7
  51. package/dist/components/__generated__/stickers/butterfly-snake.d.ts +0 -3
  52. package/dist/components/__generated__/stickers/butterfly-snake.js +0 -7
  53. package/dist/components/__generated__/stickers/butterfly.d.ts +0 -3
  54. package/dist/components/__generated__/stickers/butterfly.js +0 -7
  55. package/dist/components/__generated__/stickers/catch-animated.d.ts +0 -3
  56. package/dist/components/__generated__/stickers/catch-animated.js +0 -7
  57. package/dist/components/__generated__/stickers/catch.d.ts +0 -3
  58. package/dist/components/__generated__/stickers/catch.js +0 -7
  59. package/dist/components/__generated__/stickers/clap-animated.d.ts +0 -3
  60. package/dist/components/__generated__/stickers/clap-animated.js +0 -7
  61. package/dist/components/__generated__/stickers/clap.d.ts +0 -3
  62. package/dist/components/__generated__/stickers/clap.js +0 -7
  63. package/dist/components/__generated__/stickers/coding-animated.d.ts +0 -3
  64. package/dist/components/__generated__/stickers/coding-animated.js +0 -7
  65. package/dist/components/__generated__/stickers/coding.d.ts +0 -3
  66. package/dist/components/__generated__/stickers/coding.js +0 -7
  67. package/dist/components/__generated__/stickers/cowboy-animated.d.ts +0 -3
  68. package/dist/components/__generated__/stickers/cowboy-animated.js +0 -7
  69. package/dist/components/__generated__/stickers/cowboy.d.ts +0 -3
  70. package/dist/components/__generated__/stickers/cowboy.js +0 -7
  71. package/dist/components/__generated__/stickers/dance-animated.d.ts +0 -3
  72. package/dist/components/__generated__/stickers/dance-animated.js +0 -7
  73. package/dist/components/__generated__/stickers/dance.d.ts +0 -3
  74. package/dist/components/__generated__/stickers/dance.js +0 -7
  75. package/dist/components/__generated__/stickers/detective-animated.d.ts +0 -3
  76. package/dist/components/__generated__/stickers/detective-animated.js +0 -7
  77. package/dist/components/__generated__/stickers/detective.d.ts +0 -3
  78. package/dist/components/__generated__/stickers/detective.js +0 -7
  79. package/dist/components/__generated__/stickers/disapprove-animated.d.ts +0 -3
  80. package/dist/components/__generated__/stickers/disapprove-animated.js +0 -7
  81. package/dist/components/__generated__/stickers/disapprove.d.ts +0 -3
  82. package/dist/components/__generated__/stickers/disapprove.js +0 -7
  83. package/dist/components/__generated__/stickers/distracted-animated.d.ts +0 -3
  84. package/dist/components/__generated__/stickers/distracted-animated.js +0 -7
  85. package/dist/components/__generated__/stickers/distracted.d.ts +0 -3
  86. package/dist/components/__generated__/stickers/distracted.js +0 -7
  87. package/dist/components/__generated__/stickers/dive-animated.d.ts +0 -3
  88. package/dist/components/__generated__/stickers/dive-animated.js +0 -7
  89. package/dist/components/__generated__/stickers/dive.d.ts +0 -3
  90. package/dist/components/__generated__/stickers/dive.js +0 -7
  91. package/dist/components/__generated__/stickers/eat-animated.d.ts +0 -3
  92. package/dist/components/__generated__/stickers/eat-animated.js +0 -7
  93. package/dist/components/__generated__/stickers/eat.d.ts +0 -3
  94. package/dist/components/__generated__/stickers/eat.js +0 -7
  95. package/dist/components/__generated__/stickers/facepalm-animated.d.ts +0 -3
  96. package/dist/components/__generated__/stickers/facepalm-animated.js +0 -7
  97. package/dist/components/__generated__/stickers/facepalm.d.ts +0 -3
  98. package/dist/components/__generated__/stickers/facepalm.js +0 -7
  99. package/dist/components/__generated__/stickers/failed-animated.d.ts +0 -3
  100. package/dist/components/__generated__/stickers/failed-animated.js +0 -7
  101. package/dist/components/__generated__/stickers/failed.d.ts +0 -3
  102. package/dist/components/__generated__/stickers/failed.js +0 -7
  103. package/dist/components/__generated__/stickers/found-animated.d.ts +0 -3
  104. package/dist/components/__generated__/stickers/found-animated.js +0 -7
  105. package/dist/components/__generated__/stickers/found.d.ts +0 -3
  106. package/dist/components/__generated__/stickers/found.js +0 -7
  107. package/dist/components/__generated__/stickers/grow-animated.d.ts +0 -3
  108. package/dist/components/__generated__/stickers/grow-animated.js +0 -7
  109. package/dist/components/__generated__/stickers/grow.d.ts +0 -3
  110. package/dist/components/__generated__/stickers/grow.js +0 -7
  111. package/dist/components/__generated__/stickers/handstand-animated.d.ts +0 -3
  112. package/dist/components/__generated__/stickers/handstand-animated.js +0 -7
  113. package/dist/components/__generated__/stickers/handstand.d.ts +0 -3
  114. package/dist/components/__generated__/stickers/handstand.js +0 -7
  115. package/dist/components/__generated__/stickers/heart-animated.d.ts +0 -3
  116. package/dist/components/__generated__/stickers/heart-animated.js +0 -7
  117. package/dist/components/__generated__/stickers/heart.d.ts +0 -3
  118. package/dist/components/__generated__/stickers/heart.js +0 -7
  119. package/dist/components/__generated__/stickers/hello-animated.d.ts +0 -3
  120. package/dist/components/__generated__/stickers/hello-animated.js +0 -7
  121. package/dist/components/__generated__/stickers/hello.d.ts +0 -3
  122. package/dist/components/__generated__/stickers/hello.js +0 -7
  123. package/dist/components/__generated__/stickers/idea-animated.d.ts +0 -3
  124. package/dist/components/__generated__/stickers/idea-animated.js +0 -7
  125. package/dist/components/__generated__/stickers/idea.d.ts +0 -3
  126. package/dist/components/__generated__/stickers/idea.js +0 -7
  127. package/dist/components/__generated__/stickers/index.d.ts +0 -99
  128. package/dist/components/__generated__/stickers/index.js +0 -198
  129. package/dist/components/__generated__/stickers/laugh-animated.d.ts +0 -3
  130. package/dist/components/__generated__/stickers/laugh-animated.js +0 -7
  131. package/dist/components/__generated__/stickers/laugh.d.ts +0 -3
  132. package/dist/components/__generated__/stickers/laugh.js +0 -7
  133. package/dist/components/__generated__/stickers/love-animated.d.ts +0 -3
  134. package/dist/components/__generated__/stickers/love-animated.js +0 -7
  135. package/dist/components/__generated__/stickers/love.d.ts +0 -3
  136. package/dist/components/__generated__/stickers/love.js +0 -7
  137. package/dist/components/__generated__/stickers/nap-animated.d.ts +0 -3
  138. package/dist/components/__generated__/stickers/nap-animated.js +0 -7
  139. package/dist/components/__generated__/stickers/nap.d.ts +0 -3
  140. package/dist/components/__generated__/stickers/nap.js +0 -7
  141. package/dist/components/__generated__/stickers/party-animated.d.ts +0 -3
  142. package/dist/components/__generated__/stickers/party-animated.js +0 -7
  143. package/dist/components/__generated__/stickers/party.d.ts +0 -3
  144. package/dist/components/__generated__/stickers/party.js +0 -7
  145. package/dist/components/__generated__/stickers/passed-animated.d.ts +0 -3
  146. package/dist/components/__generated__/stickers/passed-animated.js +0 -7
  147. package/dist/components/__generated__/stickers/passed.d.ts +0 -3
  148. package/dist/components/__generated__/stickers/passed.js +0 -7
  149. package/dist/components/__generated__/stickers/peekaboo-animated.d.ts +0 -3
  150. package/dist/components/__generated__/stickers/peekaboo-animated.js +0 -7
  151. package/dist/components/__generated__/stickers/peekaboo.d.ts +0 -3
  152. package/dist/components/__generated__/stickers/peekaboo.js +0 -7
  153. package/dist/components/__generated__/stickers/pizza-animated.d.ts +0 -3
  154. package/dist/components/__generated__/stickers/pizza-animated.js +0 -7
  155. package/dist/components/__generated__/stickers/pizza.d.ts +0 -3
  156. package/dist/components/__generated__/stickers/pizza.js +0 -7
  157. package/dist/components/__generated__/stickers/puzzle-animated.d.ts +0 -3
  158. package/dist/components/__generated__/stickers/puzzle-animated.js +0 -7
  159. package/dist/components/__generated__/stickers/puzzle.d.ts +0 -3
  160. package/dist/components/__generated__/stickers/puzzle.js +0 -7
  161. package/dist/components/__generated__/stickers/sad-animated.d.ts +0 -3
  162. package/dist/components/__generated__/stickers/sad-animated.js +0 -7
  163. package/dist/components/__generated__/stickers/sad.d.ts +0 -3
  164. package/dist/components/__generated__/stickers/sad.js +0 -7
  165. package/dist/components/__generated__/stickers/scared-animated.d.ts +0 -3
  166. package/dist/components/__generated__/stickers/scared-animated.js +0 -7
  167. package/dist/components/__generated__/stickers/scared.d.ts +0 -3
  168. package/dist/components/__generated__/stickers/scared.js +0 -7
  169. package/dist/components/__generated__/stickers/scroll-animated.d.ts +0 -3
  170. package/dist/components/__generated__/stickers/scroll-animated.js +0 -7
  171. package/dist/components/__generated__/stickers/scroll.d.ts +0 -3
  172. package/dist/components/__generated__/stickers/scroll.js +0 -7
  173. package/dist/components/__generated__/stickers/search-animated.d.ts +0 -3
  174. package/dist/components/__generated__/stickers/search-animated.js +0 -7
  175. package/dist/components/__generated__/stickers/search.d.ts +0 -3
  176. package/dist/components/__generated__/stickers/search.js +0 -7
  177. package/dist/components/__generated__/stickers/shield-animated.d.ts +0 -3
  178. package/dist/components/__generated__/stickers/shield-animated.js +0 -7
  179. package/dist/components/__generated__/stickers/shield.d.ts +0 -3
  180. package/dist/components/__generated__/stickers/shield.js +0 -7
  181. package/dist/components/__generated__/stickers/shocked-animated.d.ts +0 -3
  182. package/dist/components/__generated__/stickers/shocked-animated.js +0 -7
  183. package/dist/components/__generated__/stickers/shocked.d.ts +0 -3
  184. package/dist/components/__generated__/stickers/shocked.js +0 -7
  185. package/dist/components/__generated__/stickers/sleep-animated.d.ts +0 -3
  186. package/dist/components/__generated__/stickers/sleep-animated.js +0 -7
  187. package/dist/components/__generated__/stickers/sleep.d.ts +0 -3
  188. package/dist/components/__generated__/stickers/sleep.js +0 -7
  189. package/dist/components/__generated__/stickers/stressed-animated.d.ts +0 -3
  190. package/dist/components/__generated__/stickers/stressed-animated.js +0 -7
  191. package/dist/components/__generated__/stickers/stressed.d.ts +0 -3
  192. package/dist/components/__generated__/stickers/stressed.js +0 -7
  193. package/dist/components/__generated__/stickers/suspicious-animated.d.ts +0 -3
  194. package/dist/components/__generated__/stickers/suspicious-animated.js +0 -7
  195. package/dist/components/__generated__/stickers/suspicious.d.ts +0 -3
  196. package/dist/components/__generated__/stickers/suspicious.js +0 -7
  197. package/dist/components/__generated__/stickers/thanks-animated.d.ts +0 -3
  198. package/dist/components/__generated__/stickers/thanks-animated.js +0 -7
  199. package/dist/components/__generated__/stickers/thanks.d.ts +0 -3
  200. package/dist/components/__generated__/stickers/thanks.js +0 -7
  201. package/dist/components/__generated__/stickers/think-animated.d.ts +0 -3
  202. package/dist/components/__generated__/stickers/think-animated.js +0 -7
  203. package/dist/components/__generated__/stickers/think-of-you-animated.d.ts +0 -3
  204. package/dist/components/__generated__/stickers/think-of-you-animated.js +0 -7
  205. package/dist/components/__generated__/stickers/think-of-you.d.ts +0 -3
  206. package/dist/components/__generated__/stickers/think-of-you.js +0 -7
  207. package/dist/components/__generated__/stickers/think.d.ts +0 -3
  208. package/dist/components/__generated__/stickers/think.js +0 -7
  209. package/dist/components/__generated__/stickers/thumbs-up-animated.d.ts +0 -3
  210. package/dist/components/__generated__/stickers/thumbs-up-animated.js +0 -7
  211. package/dist/components/__generated__/stickers/thumbs-up.d.ts +0 -3
  212. package/dist/components/__generated__/stickers/thumbs-up.js +0 -7
  213. package/dist/components/__generated__/stickers/vacation-animated.d.ts +0 -3
  214. package/dist/components/__generated__/stickers/vacation-animated.js +0 -7
  215. package/dist/components/__generated__/stickers/vacation.d.ts +0 -3
  216. package/dist/components/__generated__/stickers/vacation.js +0 -7
  217. package/dist/components/__generated__/stickers/wait-animated.d.ts +0 -3
  218. package/dist/components/__generated__/stickers/wait-animated.js +0 -7
  219. package/dist/components/__generated__/stickers/wait.d.ts +0 -3
  220. package/dist/components/__generated__/stickers/wait.js +0 -7
  221. package/dist/components/__generated__/stickers/wink-animated.d.ts +0 -3
  222. package/dist/components/__generated__/stickers/wink-animated.js +0 -7
  223. package/dist/components/__generated__/stickers/wink.d.ts +0 -3
  224. package/dist/components/__generated__/stickers/wink.js +0 -7
  225. package/dist/components/__generated__/stickers/work-animated.d.ts +0 -3
  226. package/dist/components/__generated__/stickers/work-animated.js +0 -7
  227. package/dist/components/__generated__/stickers/work.d.ts +0 -3
  228. package/dist/components/__generated__/stickers/work.js +0 -7
  229. package/dist/components/__generated__/stickers/zen-animated.d.ts +0 -3
  230. package/dist/components/__generated__/stickers/zen-animated.js +0 -7
  231. package/dist/components/__generated__/stickers/zen.d.ts +0 -3
  232. package/dist/components/__generated__/stickers/zen.js +0 -7
  233. package/dist/elements/a-sticker-animated.css +0 -9
  234. package/dist/elements/a-sticker-animated.d.ts +0 -39
  235. package/dist/elements/a-sticker-animated.js +0 -81
  236. package/dist/elements/a-sticker.css +0 -9
  237. package/dist/elements/a-sticker.d.ts +0 -19
  238. package/dist/elements/a-sticker.js +0 -32
  239. package/dist/generate-stickers.mjs +0 -293
@@ -1,5 +1,5 @@
1
1
  import type { IconShapes } from '@antadesign/anta';
2
- export declare const ICON_SHAPES: readonly ["arrow-left-to-line", "arrow-left", "arrow-narrow-down", "arrow-narrow-up-down", "arrow-narrow-up", "arrow-right", "arrow-top-right", "asterisk", "book-open", "braces", "bug", "calendar", "case-sensitive", "chat", "check", "chevron-down", "chevron-left", "chevron-right", "chevron-up", "chevrons-right", "circle-check", "circle-large", "circle", "click", "clock", "cloud-upload", "copy", "corner-down-right", "cube", "dots-vertical", "download", "edit", "education-disk", "external-link", "file-down", "file", "filter", "folder-close", "folder-open", "folder-tree", "github-logo", "gitlab-logo", "hat-glasses", "heart-handshake", "help-disk", "history-tree", "history", "home", "hourglass", "info", "jira-logo", "linear-logo", "link", "list-detail-view", "maximize", "megaphone", "menu", "minimize", "minus", "moon", "more", "move-horizontal", "not-equal", "play", "plus", "pointer", "presentation", "refresh-ccw-dot", "refresh", "regex", "repeat", "rotate-ccw", "rss", "runs-history", "scroll-text", "search-check", "search", "send", "sparkles", "sun", "swatch-book", "table-2", "text-highlight", "text-initial", "timer", "trash", "trello-logo", "view", "warning-triangle", "webhook", "workflow", "x"];
2
+ export declare const ICON_SHAPES: readonly ["arrow-left-to-line", "arrow-left", "arrow-narrow-down", "arrow-narrow-up-down", "arrow-narrow-up", "arrow-right", "arrow-top-right", "asterisk", "book-open", "braces", "bug", "calendar", "case-sensitive", "chat", "check", "chevron-down", "chevron-left", "chevron-right", "chevron-up", "chevrons-right", "circle-check", "circle-large", "circle", "click", "clock", "cloud-upload", "copy", "corner-down-right", "cube", "dots-vertical", "download", "edit", "education-disk", "external-link", "file-down", "file", "filter", "folder-close", "folder-open", "folder-tree", "github-logo", "gitlab-logo", "hat-glasses", "heart-handshake", "help-disk", "history-tree", "history", "home", "hourglass", "info", "jira-logo", "linear-logo", "link", "list-detail-view", "maximize", "megaphone", "menu", "minimize", "minus", "moon", "more", "move-horizontal", "not-equal", "play", "plus", "pointer", "presentation", "refresh-ccw-dot", "refresh", "regex", "repeat", "rotate-ccw", "rss", "runs-history", "scroll-text", "search-check", "search", "send", "sparkles", "sun", "swatch-book", "table-2", "tag", "text-highlight", "text-initial", "timer", "trash", "trello-logo", "view", "warning-triangle", "webhook", "workflow", "x"];
3
3
  export declare const ICON_SYNONYMS: Readonly<Record<string, readonly string[]>>;
4
4
  declare module '@antadesign/anta' {
5
5
  interface IconShapes {
@@ -85,6 +85,7 @@ declare module '@antadesign/anta' {
85
85
  'sun': true;
86
86
  'swatch-book': true;
87
87
  'table-2': true;
88
+ 'tag': true;
88
89
  'text-highlight': true;
89
90
  'text-initial': true;
90
91
  'timer': true;
@@ -81,6 +81,7 @@ const ICON_SHAPES = [
81
81
  "sun",
82
82
  "swatch-book",
83
83
  "table-2",
84
+ "tag",
84
85
  "text-highlight",
85
86
  "text-initial",
86
87
  "timer",
@@ -178,7 +179,8 @@ const ICON_SYNONYMS = {
178
179
  "download": ["save", "import"],
179
180
  "cloud-upload": ["save", "sync", "upload", "send", "export"],
180
181
  "link": ["url", "href", "anchor"],
181
- "more": ["options", "extra"]
182
+ "more": ["options", "extra"],
183
+ "tag": ["label", "badge", "chip"]
182
184
  };
183
185
  export {
184
186
  ICON_SHAPES,
@@ -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)}}
@@ -0,0 +1 @@
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,86 +1 @@
1
- @layer anta {
2
- a-text {
3
- --text-color: var(--text-1);
4
- --text-link-color: var(--link-color);
5
- --text-link-hover: var(--link-color-hover);
6
-
7
- display: block;
8
- color: var(--text-color);
9
- font-size: 15px;
10
- line-height: 20px;
11
- }
12
-
13
- a-text[size="small"] { font-size: 13px; line-height: 16px; }
14
- a-text[size="medium"] { font-size: 15px; line-height: 20px; }
15
- a-text[size="large"] { font-size: 17px; line-height: 24px; }
16
-
17
- a-text[inline] {
18
- display: inline-block;
19
- }
20
-
21
- /* Truncation, the expandable mask, the chevron button, and the
22
- expanded-state toggle live in shadow DOM — see
23
- src/elements/a-text.ts. The one external concern is `min-width: 0`:
24
- the host needs it to shrink inside flex/grid parents so the inner
25
- clamp can actually clip content. */
26
- a-text[truncate] {
27
- min-width: 0;
28
- }
29
-
30
- /* Neutral priority overrides. Levels 1 & 2 keep the brand link color;
31
- levels 3-5 mute the link to currentColor and step the hover up by one
32
- level (3→2, 4→3, 5→4). */
33
- a-text[priority="secondary"] { --text-color: var(--text-2); }
34
- a-text[priority="tertiary"] { --text-color: var(--text-3); --text-link-color: currentColor; --text-link-hover: var(--text-2); }
35
- a-text[priority="quaternary"] { --text-color: var(--text-4); --text-link-color: currentColor; --text-link-hover: var(--text-3); }
36
- a-text[priority="quinary"] { --text-color: var(--text-5); --text-link-color: currentColor; --text-link-hover: var(--text-4); }
37
-
38
- /* Tinted — text color uses --text-{N}-{tone} tokens; links are always
39
- muted (currentColor) and hover steps up one level of the same tint.
40
- Level 1 has no level above; hover keeps the color, only the underline
41
- alpha changes. */
42
- a-text[tone="brand"] { --text-color: var(--text-1-brand); --text-link-color: currentColor; --text-link-hover: var(--text-1-brand); }
43
- a-text[tone="brand"][priority="secondary"] { --text-color: var(--text-2-brand); --text-link-hover: var(--text-1-brand); }
44
- a-text[tone="brand"][priority="tertiary"] { --text-color: var(--text-3-brand); --text-link-hover: var(--text-2-brand); }
45
- a-text[tone="brand"][priority="quaternary"] { --text-color: var(--text-4-brand); --text-link-hover: var(--text-3-brand); }
46
- a-text[tone="brand"][priority="quinary"] { --text-color: var(--text-5-brand); --text-link-hover: var(--text-4-brand); }
47
-
48
- a-text[tone="success"] { --text-color: var(--text-1-success); --text-link-color: currentColor; --text-link-hover: var(--text-1-success); }
49
- a-text[tone="success"][priority="secondary"] { --text-color: var(--text-2-success); --text-link-hover: var(--text-1-success); }
50
- a-text[tone="success"][priority="tertiary"] { --text-color: var(--text-3-success); --text-link-hover: var(--text-2-success); }
51
- a-text[tone="success"][priority="quaternary"] { --text-color: var(--text-4-success); --text-link-hover: var(--text-3-success); }
52
- a-text[tone="success"][priority="quinary"] { --text-color: var(--text-5-success); --text-link-hover: var(--text-4-success); }
53
-
54
- a-text[tone="critical"] { --text-color: var(--text-1-critical); --text-link-color: currentColor; --text-link-hover: var(--text-1-critical); }
55
- a-text[tone="critical"][priority="secondary"] { --text-color: var(--text-2-critical); --text-link-hover: var(--text-1-critical); }
56
- a-text[tone="critical"][priority="tertiary"] { --text-color: var(--text-3-critical); --text-link-hover: var(--text-2-critical); }
57
- a-text[tone="critical"][priority="quaternary"] { --text-color: var(--text-4-critical); --text-link-hover: var(--text-3-critical); }
58
- a-text[tone="critical"][priority="quinary"] { --text-color: var(--text-5-critical); --text-link-hover: var(--text-4-critical); }
59
-
60
- a-text[tone="warning"] { --text-color: var(--text-1-warning); --text-link-color: currentColor; --text-link-hover: var(--text-1-warning); }
61
- a-text[tone="warning"][priority="secondary"] { --text-color: var(--text-2-warning); --text-link-hover: var(--text-1-warning); }
62
- a-text[tone="warning"][priority="tertiary"] { --text-color: var(--text-3-warning); --text-link-hover: var(--text-2-warning); }
63
- a-text[tone="warning"][priority="quaternary"] { --text-color: var(--text-4-warning); --text-link-hover: var(--text-3-warning); }
64
- a-text[tone="warning"][priority="quinary"] { --text-color: var(--text-5-warning); --text-link-hover: var(--text-4-warning); }
65
-
66
- a-text[tone="info"] { --text-color: var(--text-1-info); --text-link-color: currentColor; --text-link-hover: var(--text-1-info); }
67
- a-text[tone="info"][priority="secondary"] { --text-color: var(--text-2-info); --text-link-hover: var(--text-1-info); }
68
- a-text[tone="info"][priority="tertiary"] { --text-color: var(--text-3-info); --text-link-hover: var(--text-2-info); }
69
- a-text[tone="info"][priority="quaternary"] { --text-color: var(--text-4-info); --text-link-hover: var(--text-3-info); }
70
- a-text[tone="info"][priority="quinary"] { --text-color: var(--text-5-info); --text-link-hover: var(--text-4-info); }
71
-
72
- /* Link colors layered on top of anta's global `a` defaults — only
73
- overriding what the priority/tone cascade dictates (color and the
74
- one-step-up hover color). Underline / thickness / offset / alpha
75
- are inherited from the global rule in reset.css.
76
- On hover the underline color is repeated so it tracks the priority
77
- color rather than the global --link-color-hover. */
78
- a-text a, a-text a:link, a-text a:visited { color: var(--text-link-color); }
79
- /* Hover only on real-pointer devices — avoids sticky hover after a tap. */
80
- @media (hover: hover) and (pointer: fine) {
81
- a-text a:hover {
82
- color: var(--text-link-hover);
83
- text-decoration-color: var(--text-link-hover);
84
- }
85
- }
86
- }
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,42 +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
- /* Tooltip exposes only the box "chrome" that lives inside the shadow
12
- popover and is therefore impossible to reach with plain consumer CSS.
13
- The bubble's content is slotted light DOM, so its font / colour / size
14
- are already styleable from the page — those are intentionally NOT
15
- tokens. These custom properties inherit across the shadow boundary
16
- into the popover container (see a-tooltip.ts). The host itself draws
17
- nothing and stays out of layout (`:host { display: contents }` in the
18
- shadow style). */
19
- a-tooltip {
20
- /* Frosted translucent surface (matches the legacy look): a mostly-
21
- opaque white that, paired with the container's `backdrop-filter:
22
- blur(8px)`, reads as a frosted bubble over the page. --bg-1 is
23
- #ffffff in light / #000000 in dark, so this flips to a dark frost
24
- automatically (alpha is dialed down in the .dark override). */
25
- --tooltip-bg: color-mix(in oklch, var(--bg-1) 80%, transparent);
26
- --tooltip-shadow:
27
- 0 1px 8px color-mix(in oklch, var(--text-1) 15%, transparent),
28
- 0 0 1px color-mix(in oklch, var(--text-1) 50%, transparent);
29
- --tooltip-radius: 3px;
30
- --tooltip-max-width: min(calc(100vw - 20px), 80ch);
31
- }
32
-
33
- /* Dark: a slightly more transparent black frost. A solid black cast shadow
34
- for lift, plus an inset 1px white ring so the bubble's edge stays crisp
35
- against dark page content. */
36
- .dark a-tooltip {
37
- --tooltip-bg: color-mix(in oklch, var(--bg-1) 70%, transparent);
38
- --tooltip-shadow:
39
- 0 2px 16px color-mix(in oklch, black 70%, transparent),
40
- inset 0 0 0 1px color-mix(in oklch, white 25%, transparent);
41
- }
42
- }
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)}}
@@ -7,6 +7,10 @@ export declare class ATooltipElement extends HTMLElementBase {
7
7
  private anchor;
8
8
  listening: boolean;
9
9
  private shown;
10
+ /** True while the current open was triggered by a touch long-press. Such a
11
+ * bubble is pinned (never cursor-follows) and biases above the anchor so the
12
+ * fingertip doesn't cover it. */
13
+ private touchOpen;
10
14
  private lastMouse?;
11
15
  private debouncedShow?;
12
16
  private teardown?;
@@ -35,6 +39,9 @@ export declare class ATooltipElement extends HTMLElementBase {
35
39
  /** Pinned under the anchor (no cursor-following). Interactive implies this —
36
40
  * you can't move into a bubble that's chasing the cursor. */
37
41
  private get isStatic();
42
+ /** Pinned to the anchor for any reason: the `static`/`interactive` attrs, or
43
+ * a touch long-press (a finger can't track a following bubble). */
44
+ private get isPinned();
38
45
  private get prefersTop();
39
46
  private get delay();
40
47
  private positionToTarget;
@@ -8,6 +8,9 @@ const DEFAULT_DELAY = 250;
8
8
  const FADE_MS = 150;
9
9
  const GRACE_MS = 300;
10
10
  const CLOSE_DELAY = 120;
11
+ const ENTER_TOUCH_DELAY = 500;
12
+ const LEAVE_TOUCH_DELAY = 1500;
13
+ const TOUCH_SLOP = 10;
11
14
  let currentOpen = null;
12
15
  let graceTimer;
13
16
  function graceActive() {
@@ -58,6 +61,10 @@ class ATooltipElement extends HTMLElementBase {
58
61
  anchor = null;
59
62
  listening = false;
60
63
  shown = false;
64
+ /** True while the current open was triggered by a touch long-press. Such a
65
+ * bubble is pinned (never cursor-follows) and biases above the anchor so the
66
+ * fingertip doesn't cover it. */
67
+ touchOpen = false;
61
68
  lastMouse;
62
69
  debouncedShow;
63
70
  teardown;
@@ -88,17 +95,34 @@ class ATooltipElement extends HTMLElementBase {
88
95
  text-align: left;
89
96
 
90
97
  background: var(--tooltip-bg, Canvas);
91
- color: var(--text-1, CanvasText);
98
+ color: var(--text-3, CanvasText);
92
99
  box-shadow: var(--tooltip-shadow, 0 1px 8px rgba(0, 0, 0, 0.2));
93
- backdrop-filter: blur(8px);
100
+ -webkit-backdrop-filter: var(--tooltip-backdrop-filter, blur(8px));
101
+ backdrop-filter: var(--tooltip-backdrop-filter, blur(8px));
94
102
  padding: 5px 8px;
95
- border: none;
103
+ border: var(--tooltip-border, none);
96
104
  border-radius: var(--tooltip-radius, 3px);
97
105
  outline: none;
98
106
 
107
+ /* The bubble establishes its own text baseline so inheritable text
108
+ properties from the anchor (e.g. a Button's condensed "wdth" 88
109
+ axis, its 0.05ch letter-spacing, an uppercase transform, a custom
110
+ font) don't bleed into the slotted content. The content is slotted
111
+ light DOM, so it inherits these *from this container* \u2014 making this
112
+ the single choke point. Values mirror Anta's body text. Consumers
113
+ still customise a single tooltip by styling their own content
114
+ element directly (a class on the content overrides what it inherits
115
+ \u2014 see the Tooltip docs). */
116
+ font-family: var(--sans-serif, system-ui, sans-serif);
99
117
  font-size: 14px;
100
- line-height: 130%;
101
118
  font-weight: 400;
119
+ font-style: normal;
120
+ font-stretch: normal;
121
+ font-variation-settings: "wdth" 100, "slnt" 0, "ital" 0;
122
+ line-height: 1.5;
123
+ letter-spacing: 0.02ch;
124
+ word-spacing: normal;
125
+ text-transform: none;
102
126
  white-space: break-spaces;
103
127
  word-break: break-word;
104
128
  overflow-wrap: break-word;
@@ -196,6 +220,11 @@ class ATooltipElement extends HTMLElementBase {
196
220
  get isStatic() {
197
221
  return this.hasAttribute("static") || this.isInteractive;
198
222
  }
223
+ /** Pinned to the anchor for any reason: the `static`/`interactive` attrs, or
224
+ * a touch long-press (a finger can't track a following bubble). */
225
+ get isPinned() {
226
+ return this.isStatic || this.touchOpen;
227
+ }
199
228
  get prefersTop() {
200
229
  return this.getAttribute("placement") === "top";
201
230
  }
@@ -218,7 +247,7 @@ class ATooltipElement extends HTMLElementBase {
218
247
  if (left + box.width > vw) left = vw - box.width - MARGIN;
219
248
  left = Math.max(MARGIN, left);
220
249
  let top;
221
- if (this.prefersTop) {
250
+ if (this.prefersTop || this.touchOpen) {
222
251
  top = a.top - box.height - MARGIN;
223
252
  if (top < MARGIN) top = a.bottom + MARGIN;
224
253
  } else {
@@ -252,7 +281,7 @@ class ATooltipElement extends HTMLElementBase {
252
281
  });
253
282
  };
254
283
  position(e) {
255
- if (!this.isStatic && e) this.positionToMouse(e);
284
+ if (!this.isPinned && e) this.positionToMouse(e);
256
285
  else this.positionToTarget();
257
286
  }
258
287
  // --- show / hide ---
@@ -284,6 +313,7 @@ class ATooltipElement extends HTMLElementBase {
284
313
  this.cancelHide();
285
314
  if (!this.shown) return;
286
315
  this.shown = false;
316
+ this.touchOpen = false;
287
317
  this.container.hidePopover();
288
318
  this.view.removeEventListener("scroll", this.hide, { capture: true });
289
319
  this.doc.removeEventListener("keydown", this.onKeyDown, true);
@@ -303,7 +333,7 @@ class ATooltipElement extends HTMLElementBase {
303
333
  * the close delay). Cursor-following only — static/interactive bubbles
304
334
  * stay pinned. */
305
335
  onDocMove = (e) => {
306
- if ((this.shown || this.fading) && !this.isStatic) {
336
+ if ((this.shown || this.fading) && !this.isPinned) {
307
337
  this.lastMouse = e;
308
338
  this.positionToMouse(e);
309
339
  }
@@ -311,12 +341,12 @@ class ATooltipElement extends HTMLElementBase {
311
341
  /** Hide after CLOSE_DELAY unless something cancels it first (re-enter, or
312
342
  * another tooltip claiming the slot). Lets the bubble bridge the gap to a
313
343
  * neighbouring anchor — and survive the trip into an interactive bubble. */
314
- scheduleHide = () => {
344
+ scheduleHide = (delay = CLOSE_DELAY) => {
315
345
  this.cancelHide();
316
346
  this.closeTimer = setTimeout(() => {
317
347
  this.closeTimer = void 0;
318
348
  this.hide();
319
- }, CLOSE_DELAY);
349
+ }, delay);
320
350
  };
321
351
  cancelHide() {
322
352
  if (this.closeTimer !== void 0) {
@@ -347,46 +377,93 @@ class ATooltipElement extends HTMLElementBase {
347
377
  const view = this.view;
348
378
  const doc = this.doc;
349
379
  this.makeDebouncedShow();
350
- const onMouseMove = (e) => {
380
+ const onPointerMove = (e) => {
381
+ if (e.pointerType !== "mouse") return;
351
382
  this.lastMouse = e;
352
383
  if (this.shown) {
353
- if (!this.isStatic) this.positionToMouse(e);
384
+ if (!this.isPinned) this.positionToMouse(e);
354
385
  } else {
355
386
  this.trigger(e);
356
387
  }
357
388
  };
358
389
  const onLeave = () => {
359
390
  this.debouncedShow?.cancel();
360
- anchor.removeEventListener("mousemove", onMouseMove);
361
- anchor.removeEventListener("mouseleave", onLeave);
391
+ anchor.removeEventListener("pointermove", onPointerMove);
392
+ anchor.removeEventListener("pointerleave", onLeave);
362
393
  anchor.removeEventListener("blur", onLeave);
363
394
  view.removeEventListener("pagehide", onLeave);
364
395
  doc.removeEventListener("visibilitychange", onLeave);
365
396
  this.scheduleHide();
366
397
  };
367
398
  const onEnter = (e) => {
399
+ if (e.pointerType !== "mouse") return;
368
400
  this.lastMouse = e;
369
- anchor.addEventListener("mousemove", onMouseMove);
370
- anchor.addEventListener("mouseleave", onLeave);
401
+ anchor.addEventListener("pointermove", onPointerMove);
402
+ anchor.addEventListener("pointerleave", onLeave);
371
403
  view.addEventListener("pagehide", onLeave);
372
404
  doc.addEventListener("visibilitychange", onLeave);
373
405
  this.trigger(e);
374
406
  };
375
407
  const onFocus = () => {
408
+ if (!anchor.matches(":focus-visible")) return;
376
409
  anchor.addEventListener("blur", onLeave);
377
410
  view.addEventListener("pagehide", onLeave);
378
411
  doc.addEventListener("visibilitychange", onLeave);
379
412
  this.trigger();
380
413
  };
381
- anchor.addEventListener("mouseenter", onEnter);
414
+ let pressTimer;
415
+ let pressStart;
416
+ const preventContext = (e) => e.preventDefault();
417
+ const clearPressTimer = () => {
418
+ if (pressTimer !== void 0) {
419
+ clearTimeout(pressTimer);
420
+ pressTimer = void 0;
421
+ }
422
+ pressStart = void 0;
423
+ };
424
+ const onPressMove = (e) => {
425
+ if (pressStart && Math.hypot(e.clientX - pressStart.x, e.clientY - pressStart.y) > TOUCH_SLOP) {
426
+ clearPressTimer();
427
+ }
428
+ };
429
+ const onPressEnd = () => {
430
+ clearPressTimer();
431
+ detachPress();
432
+ if (this.shown && this.touchOpen) this.scheduleHide(LEAVE_TOUCH_DELAY);
433
+ };
434
+ const detachPress = () => {
435
+ anchor.removeEventListener("pointermove", onPressMove);
436
+ anchor.removeEventListener("pointerup", onPressEnd);
437
+ anchor.removeEventListener("pointercancel", onPressEnd);
438
+ anchor.removeEventListener("contextmenu", preventContext);
439
+ };
440
+ const onPointerDown = (e) => {
441
+ if (e.pointerType === "mouse") return;
442
+ clearPressTimer();
443
+ pressStart = { x: e.clientX, y: e.clientY };
444
+ anchor.addEventListener("pointermove", onPressMove);
445
+ anchor.addEventListener("pointerup", onPressEnd);
446
+ anchor.addEventListener("pointercancel", onPressEnd);
447
+ anchor.addEventListener("contextmenu", preventContext);
448
+ pressTimer = setTimeout(() => {
449
+ pressTimer = void 0;
450
+ this.touchOpen = true;
451
+ this.show();
452
+ }, ENTER_TOUCH_DELAY);
453
+ };
454
+ anchor.addEventListener("pointerenter", onEnter);
382
455
  anchor.addEventListener("focus", onFocus);
456
+ anchor.addEventListener("pointerdown", onPointerDown);
383
457
  this.teardown = () => {
384
458
  this.debouncedShow?.cancel();
385
- anchor.removeEventListener("mousemove", onMouseMove);
386
- anchor.removeEventListener("mouseenter", onEnter);
387
- anchor.removeEventListener("mouseleave", onLeave);
459
+ clearPressTimer();
460
+ detachPress();
461
+ anchor.removeEventListener("pointermove", onPointerMove);
462
+ anchor.removeEventListener("pointerenter", onEnter);
463
+ anchor.removeEventListener("pointerleave", onLeave);
388
464
  anchor.removeEventListener("focus", onFocus);
389
465
  anchor.removeEventListener("blur", onLeave);
466
+ anchor.removeEventListener("pointerdown", onPointerDown);
390
467
  view.removeEventListener("pagehide", onLeave);
391
468
  doc.removeEventListener("visibilitychange", onLeave);
392
469
  this.listening = false;
@@ -8,8 +8,7 @@
8
8
  *
9
9
  * For a SMALLER footprint, import just the element(s) you use instead:
10
10
  * import '@antadesign/anta/elements/a-tooltip' // registers a-tooltip + its CSS, nothing else
11
- * That granular path pulls in only that element's code (e.g. it won't drag in
12
- * `lottie-web`, which only `a-sticker-animated` needs).
11
+ * That granular path pulls in only that element's code and CSS, nothing else.
13
12
  *
14
13
  * Must only be imported client-side — registration is guarded against missing
15
14
  * `customElements` (SSR), but there's no reason to load it server-side.
@@ -18,7 +17,6 @@ export { AProgressElement, register_a_progress } from './a-progress';
18
17
  export { ATextElement, register_a_text } from './a-text';
19
18
  export { AIconElement, register_a_icon } from './a-icon';
20
19
  export { AButtonElement, register_a_button } from './a-button';
21
- export { AStickerElement, register_a_sticker } from './a-sticker';
22
- export { AStickerAnimatedElement, register_a_sticker_animated } from './a-sticker-animated';
23
20
  export { ATooltipElement, register_a_tooltip } from './a-tooltip';
24
21
  import './a-title.css';
22
+ import './a-tag.css';
@@ -2,23 +2,18 @@ import { AProgressElement, register_a_progress } from "./a-progress";
2
2
  import { ATextElement, register_a_text } from "./a-text";
3
3
  import { AIconElement, register_a_icon } from "./a-icon";
4
4
  import { AButtonElement, register_a_button } from "./a-button";
5
- import { AStickerElement, register_a_sticker } from "./a-sticker";
6
- import { AStickerAnimatedElement, register_a_sticker_animated } from "./a-sticker-animated";
7
5
  import { ATooltipElement, register_a_tooltip } from "./a-tooltip";
8
6
  import "./a-title.css";
7
+ import "./a-tag.css";
9
8
  export {
10
9
  AButtonElement,
11
10
  AIconElement,
12
11
  AProgressElement,
13
- AStickerAnimatedElement,
14
- AStickerElement,
15
12
  ATextElement,
16
13
  ATooltipElement,
17
14
  register_a_button,
18
15
  register_a_icon,
19
16
  register_a_progress,
20
- register_a_sticker,
21
- register_a_sticker_animated,
22
17
  register_a_text,
23
18
  register_a_tooltip
24
19
  };