@antadesign/anta 0.1.1-dev.5 → 0.1.1-dev.7

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 +15 -2
  2. package/dist/components/Button.d.ts +113 -0
  3. package/dist/components/Button.js +100 -0
  4. package/dist/components/Button.module.css +2 -0
  5. package/dist/components/Icon.d.ts +2 -1
  6. package/dist/components/Progress.d.ts +4 -2
  7. package/dist/components/Sticker.d.ts +31 -0
  8. package/dist/components/Sticker.js +17 -0
  9. package/dist/components/StickerAnimated.d.ts +23 -0
  10. package/dist/components/StickerAnimated.js +28 -0
  11. package/dist/components/Text.d.ts +6 -2
  12. package/dist/components/Text.js +2 -1
  13. package/dist/components/Title.d.ts +43 -0
  14. package/dist/components/Title.js +20 -0
  15. package/dist/components/__generated__/stickers/angry-animated.d.ts +3 -0
  16. package/dist/components/__generated__/stickers/angry-animated.js +7 -0
  17. package/dist/components/__generated__/stickers/angry.d.ts +3 -0
  18. package/dist/components/__generated__/stickers/angry.js +7 -0
  19. package/dist/components/__generated__/stickers/ask-animated.d.ts +3 -0
  20. package/dist/components/__generated__/stickers/ask-animated.js +7 -0
  21. package/dist/components/__generated__/stickers/ask.d.ts +3 -0
  22. package/dist/components/__generated__/stickers/ask.js +7 -0
  23. package/dist/components/__generated__/stickers/balance-animated.d.ts +3 -0
  24. package/dist/components/__generated__/stickers/balance-animated.js +7 -0
  25. package/dist/components/__generated__/stickers/balance.d.ts +3 -0
  26. package/dist/components/__generated__/stickers/balance.js +7 -0
  27. package/dist/components/__generated__/stickers/butterfly-animated.d.ts +3 -0
  28. package/dist/components/__generated__/stickers/butterfly-animated.js +7 -0
  29. package/dist/components/__generated__/stickers/butterfly-snake-animated.d.ts +3 -0
  30. package/dist/components/__generated__/stickers/butterfly-snake-animated.js +7 -0
  31. package/dist/components/__generated__/stickers/butterfly-snake.d.ts +3 -0
  32. package/dist/components/__generated__/stickers/butterfly-snake.js +7 -0
  33. package/dist/components/__generated__/stickers/butterfly.d.ts +3 -0
  34. package/dist/components/__generated__/stickers/butterfly.js +7 -0
  35. package/dist/components/__generated__/stickers/catch-animated.d.ts +3 -0
  36. package/dist/components/__generated__/stickers/catch-animated.js +7 -0
  37. package/dist/components/__generated__/stickers/catch.d.ts +3 -0
  38. package/dist/components/__generated__/stickers/catch.js +7 -0
  39. package/dist/components/__generated__/stickers/clap-animated.d.ts +3 -0
  40. package/dist/components/__generated__/stickers/clap-animated.js +7 -0
  41. package/dist/components/__generated__/stickers/clap.d.ts +3 -0
  42. package/dist/components/__generated__/stickers/clap.js +7 -0
  43. package/dist/components/__generated__/stickers/coding-animated.d.ts +3 -0
  44. package/dist/components/__generated__/stickers/coding-animated.js +7 -0
  45. package/dist/components/__generated__/stickers/coding.d.ts +3 -0
  46. package/dist/components/__generated__/stickers/coding.js +7 -0
  47. package/dist/components/__generated__/stickers/cowboy-animated.d.ts +3 -0
  48. package/dist/components/__generated__/stickers/cowboy-animated.js +7 -0
  49. package/dist/components/__generated__/stickers/cowboy.d.ts +3 -0
  50. package/dist/components/__generated__/stickers/cowboy.js +7 -0
  51. package/dist/components/__generated__/stickers/dance-animated.d.ts +3 -0
  52. package/dist/components/__generated__/stickers/dance-animated.js +7 -0
  53. package/dist/components/__generated__/stickers/dance.d.ts +3 -0
  54. package/dist/components/__generated__/stickers/dance.js +7 -0
  55. package/dist/components/__generated__/stickers/detective-animated.d.ts +3 -0
  56. package/dist/components/__generated__/stickers/detective-animated.js +7 -0
  57. package/dist/components/__generated__/stickers/detective.d.ts +3 -0
  58. package/dist/components/__generated__/stickers/detective.js +7 -0
  59. package/dist/components/__generated__/stickers/disapprove-animated.d.ts +3 -0
  60. package/dist/components/__generated__/stickers/disapprove-animated.js +7 -0
  61. package/dist/components/__generated__/stickers/disapprove.d.ts +3 -0
  62. package/dist/components/__generated__/stickers/disapprove.js +7 -0
  63. package/dist/components/__generated__/stickers/distracted-animated.d.ts +3 -0
  64. package/dist/components/__generated__/stickers/distracted-animated.js +7 -0
  65. package/dist/components/__generated__/stickers/distracted.d.ts +3 -0
  66. package/dist/components/__generated__/stickers/distracted.js +7 -0
  67. package/dist/components/__generated__/stickers/dive-animated.d.ts +3 -0
  68. package/dist/components/__generated__/stickers/dive-animated.js +7 -0
  69. package/dist/components/__generated__/stickers/dive.d.ts +3 -0
  70. package/dist/components/__generated__/stickers/dive.js +7 -0
  71. package/dist/components/__generated__/stickers/eat-animated.d.ts +3 -0
  72. package/dist/components/__generated__/stickers/eat-animated.js +7 -0
  73. package/dist/components/__generated__/stickers/eat.d.ts +3 -0
  74. package/dist/components/__generated__/stickers/eat.js +7 -0
  75. package/dist/components/__generated__/stickers/facepalm-animated.d.ts +3 -0
  76. package/dist/components/__generated__/stickers/facepalm-animated.js +7 -0
  77. package/dist/components/__generated__/stickers/facepalm.d.ts +3 -0
  78. package/dist/components/__generated__/stickers/facepalm.js +7 -0
  79. package/dist/components/__generated__/stickers/failed-animated.d.ts +3 -0
  80. package/dist/components/__generated__/stickers/failed-animated.js +7 -0
  81. package/dist/components/__generated__/stickers/failed.d.ts +3 -0
  82. package/dist/components/__generated__/stickers/failed.js +7 -0
  83. package/dist/components/__generated__/stickers/found-animated.d.ts +3 -0
  84. package/dist/components/__generated__/stickers/found-animated.js +7 -0
  85. package/dist/components/__generated__/stickers/found.d.ts +3 -0
  86. package/dist/components/__generated__/stickers/found.js +7 -0
  87. package/dist/components/__generated__/stickers/grow-animated.d.ts +3 -0
  88. package/dist/components/__generated__/stickers/grow-animated.js +7 -0
  89. package/dist/components/__generated__/stickers/grow.d.ts +3 -0
  90. package/dist/components/__generated__/stickers/grow.js +7 -0
  91. package/dist/components/__generated__/stickers/handstand-animated.d.ts +3 -0
  92. package/dist/components/__generated__/stickers/handstand-animated.js +7 -0
  93. package/dist/components/__generated__/stickers/handstand.d.ts +3 -0
  94. package/dist/components/__generated__/stickers/handstand.js +7 -0
  95. package/dist/components/__generated__/stickers/heart-animated.d.ts +3 -0
  96. package/dist/components/__generated__/stickers/heart-animated.js +7 -0
  97. package/dist/components/__generated__/stickers/heart.d.ts +3 -0
  98. package/dist/components/__generated__/stickers/heart.js +7 -0
  99. package/dist/components/__generated__/stickers/hello-animated.d.ts +3 -0
  100. package/dist/components/__generated__/stickers/hello-animated.js +7 -0
  101. package/dist/components/__generated__/stickers/hello.d.ts +3 -0
  102. package/dist/components/__generated__/stickers/hello.js +7 -0
  103. package/dist/components/__generated__/stickers/idea-animated.d.ts +3 -0
  104. package/dist/components/__generated__/stickers/idea-animated.js +7 -0
  105. package/dist/components/__generated__/stickers/idea.d.ts +3 -0
  106. package/dist/components/__generated__/stickers/idea.js +7 -0
  107. package/dist/components/__generated__/stickers/index.d.ts +99 -0
  108. package/dist/components/__generated__/stickers/index.js +198 -0
  109. package/dist/components/__generated__/stickers/laugh-animated.d.ts +3 -0
  110. package/dist/components/__generated__/stickers/laugh-animated.js +7 -0
  111. package/dist/components/__generated__/stickers/laugh.d.ts +3 -0
  112. package/dist/components/__generated__/stickers/laugh.js +7 -0
  113. package/dist/components/__generated__/stickers/love-animated.d.ts +3 -0
  114. package/dist/components/__generated__/stickers/love-animated.js +7 -0
  115. package/dist/components/__generated__/stickers/love.d.ts +3 -0
  116. package/dist/components/__generated__/stickers/love.js +7 -0
  117. package/dist/components/__generated__/stickers/nap-animated.d.ts +3 -0
  118. package/dist/components/__generated__/stickers/nap-animated.js +7 -0
  119. package/dist/components/__generated__/stickers/nap.d.ts +3 -0
  120. package/dist/components/__generated__/stickers/nap.js +7 -0
  121. package/dist/components/__generated__/stickers/party-animated.d.ts +3 -0
  122. package/dist/components/__generated__/stickers/party-animated.js +7 -0
  123. package/dist/components/__generated__/stickers/party.d.ts +3 -0
  124. package/dist/components/__generated__/stickers/party.js +7 -0
  125. package/dist/components/__generated__/stickers/passed-animated.d.ts +3 -0
  126. package/dist/components/__generated__/stickers/passed-animated.js +7 -0
  127. package/dist/components/__generated__/stickers/passed.d.ts +3 -0
  128. package/dist/components/__generated__/stickers/passed.js +7 -0
  129. package/dist/components/__generated__/stickers/peekaboo-animated.d.ts +3 -0
  130. package/dist/components/__generated__/stickers/peekaboo-animated.js +7 -0
  131. package/dist/components/__generated__/stickers/peekaboo.d.ts +3 -0
  132. package/dist/components/__generated__/stickers/peekaboo.js +7 -0
  133. package/dist/components/__generated__/stickers/pizza-animated.d.ts +3 -0
  134. package/dist/components/__generated__/stickers/pizza-animated.js +7 -0
  135. package/dist/components/__generated__/stickers/pizza.d.ts +3 -0
  136. package/dist/components/__generated__/stickers/pizza.js +7 -0
  137. package/dist/components/__generated__/stickers/puzzle-animated.d.ts +3 -0
  138. package/dist/components/__generated__/stickers/puzzle-animated.js +7 -0
  139. package/dist/components/__generated__/stickers/puzzle.d.ts +3 -0
  140. package/dist/components/__generated__/stickers/puzzle.js +7 -0
  141. package/dist/components/__generated__/stickers/sad-animated.d.ts +3 -0
  142. package/dist/components/__generated__/stickers/sad-animated.js +7 -0
  143. package/dist/components/__generated__/stickers/sad.d.ts +3 -0
  144. package/dist/components/__generated__/stickers/sad.js +7 -0
  145. package/dist/components/__generated__/stickers/scared-animated.d.ts +3 -0
  146. package/dist/components/__generated__/stickers/scared-animated.js +7 -0
  147. package/dist/components/__generated__/stickers/scared.d.ts +3 -0
  148. package/dist/components/__generated__/stickers/scared.js +7 -0
  149. package/dist/components/__generated__/stickers/scroll-animated.d.ts +3 -0
  150. package/dist/components/__generated__/stickers/scroll-animated.js +7 -0
  151. package/dist/components/__generated__/stickers/scroll.d.ts +3 -0
  152. package/dist/components/__generated__/stickers/scroll.js +7 -0
  153. package/dist/components/__generated__/stickers/search-animated.d.ts +3 -0
  154. package/dist/components/__generated__/stickers/search-animated.js +7 -0
  155. package/dist/components/__generated__/stickers/search.d.ts +3 -0
  156. package/dist/components/__generated__/stickers/search.js +7 -0
  157. package/dist/components/__generated__/stickers/shield-animated.d.ts +3 -0
  158. package/dist/components/__generated__/stickers/shield-animated.js +7 -0
  159. package/dist/components/__generated__/stickers/shield.d.ts +3 -0
  160. package/dist/components/__generated__/stickers/shield.js +7 -0
  161. package/dist/components/__generated__/stickers/shocked-animated.d.ts +3 -0
  162. package/dist/components/__generated__/stickers/shocked-animated.js +7 -0
  163. package/dist/components/__generated__/stickers/shocked.d.ts +3 -0
  164. package/dist/components/__generated__/stickers/shocked.js +7 -0
  165. package/dist/components/__generated__/stickers/sleep-animated.d.ts +3 -0
  166. package/dist/components/__generated__/stickers/sleep-animated.js +7 -0
  167. package/dist/components/__generated__/stickers/sleep.d.ts +3 -0
  168. package/dist/components/__generated__/stickers/sleep.js +7 -0
  169. package/dist/components/__generated__/stickers/stressed-animated.d.ts +3 -0
  170. package/dist/components/__generated__/stickers/stressed-animated.js +7 -0
  171. package/dist/components/__generated__/stickers/stressed.d.ts +3 -0
  172. package/dist/components/__generated__/stickers/stressed.js +7 -0
  173. package/dist/components/__generated__/stickers/suspicious-animated.d.ts +3 -0
  174. package/dist/components/__generated__/stickers/suspicious-animated.js +7 -0
  175. package/dist/components/__generated__/stickers/suspicious.d.ts +3 -0
  176. package/dist/components/__generated__/stickers/suspicious.js +7 -0
  177. package/dist/components/__generated__/stickers/thanks-animated.d.ts +3 -0
  178. package/dist/components/__generated__/stickers/thanks-animated.js +7 -0
  179. package/dist/components/__generated__/stickers/thanks.d.ts +3 -0
  180. package/dist/components/__generated__/stickers/thanks.js +7 -0
  181. package/dist/components/__generated__/stickers/think-animated.d.ts +3 -0
  182. package/dist/components/__generated__/stickers/think-animated.js +7 -0
  183. package/dist/components/__generated__/stickers/think-of-you-animated.d.ts +3 -0
  184. package/dist/components/__generated__/stickers/think-of-you-animated.js +7 -0
  185. package/dist/components/__generated__/stickers/think-of-you.d.ts +3 -0
  186. package/dist/components/__generated__/stickers/think-of-you.js +7 -0
  187. package/dist/components/__generated__/stickers/think.d.ts +3 -0
  188. package/dist/components/__generated__/stickers/think.js +7 -0
  189. package/dist/components/__generated__/stickers/thumbs-up-animated.d.ts +3 -0
  190. package/dist/components/__generated__/stickers/thumbs-up-animated.js +7 -0
  191. package/dist/components/__generated__/stickers/thumbs-up.d.ts +3 -0
  192. package/dist/components/__generated__/stickers/thumbs-up.js +7 -0
  193. package/dist/components/__generated__/stickers/vacation-animated.d.ts +3 -0
  194. package/dist/components/__generated__/stickers/vacation-animated.js +7 -0
  195. package/dist/components/__generated__/stickers/vacation.d.ts +3 -0
  196. package/dist/components/__generated__/stickers/vacation.js +7 -0
  197. package/dist/components/__generated__/stickers/wait-animated.d.ts +3 -0
  198. package/dist/components/__generated__/stickers/wait-animated.js +7 -0
  199. package/dist/components/__generated__/stickers/wait.d.ts +3 -0
  200. package/dist/components/__generated__/stickers/wait.js +7 -0
  201. package/dist/components/__generated__/stickers/wink-animated.d.ts +3 -0
  202. package/dist/components/__generated__/stickers/wink-animated.js +7 -0
  203. package/dist/components/__generated__/stickers/wink.d.ts +3 -0
  204. package/dist/components/__generated__/stickers/wink.js +7 -0
  205. package/dist/components/__generated__/stickers/work-animated.d.ts +3 -0
  206. package/dist/components/__generated__/stickers/work-animated.js +7 -0
  207. package/dist/components/__generated__/stickers/work.d.ts +3 -0
  208. package/dist/components/__generated__/stickers/work.js +7 -0
  209. package/dist/components/__generated__/stickers/zen-animated.d.ts +3 -0
  210. package/dist/components/__generated__/stickers/zen-animated.js +7 -0
  211. package/dist/components/__generated__/stickers/zen.d.ts +3 -0
  212. package/dist/components/__generated__/stickers/zen.js +7 -0
  213. package/dist/elements/a-button.css +733 -0
  214. package/dist/elements/a-button.d.ts +10 -0
  215. package/dist/elements/a-button.js +76 -0
  216. package/dist/elements/a-icon.css +31 -6
  217. package/dist/elements/a-icon.shapes.css +9 -1
  218. package/dist/elements/a-icon.shapes.d.ts +5 -2
  219. package/dist/elements/a-icon.shapes.js +2 -0
  220. package/dist/elements/a-progress.css +7 -9
  221. package/dist/elements/a-sticker-animated.css +9 -0
  222. package/dist/elements/a-sticker-animated.d.ts +38 -0
  223. package/dist/elements/a-sticker-animated.js +79 -0
  224. package/dist/elements/a-sticker.css +9 -0
  225. package/dist/elements/a-sticker.d.ts +18 -0
  226. package/dist/elements/a-sticker.js +30 -0
  227. package/dist/elements/a-text.css +14 -5
  228. package/dist/elements/a-title.css +64 -0
  229. package/dist/elements/index.d.ts +7 -0
  230. package/dist/elements/index.js +19 -0
  231. package/dist/general_types.d.ts +120 -4
  232. package/dist/generate-icons.mjs +5 -3
  233. package/dist/generate-stickers.mjs +293 -0
  234. package/dist/index.d.ts +8 -0
  235. package/dist/index.js +8 -0
  236. package/dist/jsx-runtime.d.ts +6 -1
  237. package/dist/reset.css +96 -11
  238. package/dist/tokens.css +186 -182
  239. package/package.json +17 -4
@@ -0,0 +1,10 @@
1
+ import { HTMLElementBase } from "../anta_helpers";
2
+ declare global {
3
+ interface Document {
4
+ hasKeyListenerForAButton?: boolean;
5
+ }
6
+ }
7
+ export declare class AButtonElement extends HTMLElementBase {
8
+ connectedCallback(): void;
9
+ }
10
+ export declare function register_a_button(): void;
@@ -0,0 +1,76 @@
1
+ import { HTMLElementBase } from "../anta_helpers";
2
+ class AButtonElement extends HTMLElementBase {
3
+ connectedCallback() {
4
+ if (!document.hasKeyListenerForAButton) {
5
+ document.addEventListener("keydown", handleKeyDown, true);
6
+ document.addEventListener("click", handleClick, true);
7
+ document.hasKeyListenerForAButton = true;
8
+ }
9
+ }
10
+ }
11
+ function findForm(el) {
12
+ const formId = el.getAttribute("form");
13
+ if (formId) {
14
+ return document.getElementById(formId);
15
+ }
16
+ return el.closest("form");
17
+ }
18
+ function handleKeyDown(e) {
19
+ if (e.key !== "Enter" && e.key !== " ") return;
20
+ const el = e.target.closest(
21
+ "a-button"
22
+ );
23
+ if (!el) return;
24
+ e.preventDefault();
25
+ el.click();
26
+ }
27
+ function handleClick(e) {
28
+ const el = e.target.closest(
29
+ "a-button"
30
+ );
31
+ if (!el) return;
32
+ const customEvent = el.getAttribute("data-custom-event");
33
+ if (customEvent) {
34
+ el.dispatchEvent(
35
+ new CustomEvent(customEvent, { bubbles: true, cancelable: true })
36
+ );
37
+ }
38
+ const type = el.getAttribute("type") || "button";
39
+ const form = findForm(el);
40
+ if (!form) return;
41
+ if (type === "submit") {
42
+ if (form.requestSubmit) {
43
+ form.requestSubmit();
44
+ } else {
45
+ form.submit();
46
+ }
47
+ const formData = new FormData(form);
48
+ form.dispatchEvent(
49
+ new CustomEvent("submitdetailed", {
50
+ bubbles: true,
51
+ cancelable: true,
52
+ detail: {
53
+ formData: Object.fromEntries(formData.entries()),
54
+ submitter: {
55
+ tag: el.tagName.toLowerCase(),
56
+ attrs: Object.fromEntries(
57
+ Array.from(el.attributes).map((a) => [a.name, a.value])
58
+ )
59
+ }
60
+ }
61
+ })
62
+ );
63
+ } else if (type === "reset") {
64
+ form.reset();
65
+ }
66
+ }
67
+ function register_a_button() {
68
+ if (typeof customElements === "undefined") return;
69
+ if (!customElements.get("a-button")) {
70
+ customElements.define("a-button", AButtonElement);
71
+ }
72
+ }
73
+ export {
74
+ AButtonElement,
75
+ register_a_button
76
+ };
@@ -1,18 +1,43 @@
1
1
  @layer anta {
2
2
  a-icon {
3
+ /* Default lives in a plain declaration — never in `attr()`. Safari
4
+ doesn't support typed `attr()` for `<length>` (MDN: "No" across
5
+ all Safari versions), so an `attr(size px, …)` value can't
6
+ resolve there and the var-substituted `width` ends up invalid →
7
+ auto → 0 on an empty inline-block. Keeping the default off the
8
+ attr() path means every browser lands on 16px when no `size`
9
+ attribute is set. */
10
+ --icon-size: 16px;
11
+
3
12
  display: inline-block;
4
13
  vertical-align: middle;
5
- width: var(--icon-size, 16px);
6
- height: var(--icon-size, 16px);
14
+ width: var(--icon-size);
15
+ height: var(--icon-size);
7
16
  flex-shrink: 0;
8
17
  background-color: currentColor;
9
18
  -webkit-mask-image: var(--icon);
10
- mask-image: var(--icon);
19
+ mask-image: var(--icon);
11
20
  -webkit-mask-position: center;
12
- mask-position: center;
21
+ mask-position: center;
13
22
  -webkit-mask-repeat: no-repeat;
14
- mask-repeat: no-repeat;
23
+ mask-repeat: no-repeat;
15
24
  -webkit-mask-size: contain;
16
- mask-size: contain;
25
+ mask-size: contain;
26
+ }
27
+
28
+ /* `<a-icon size="N">` only — typed `attr()` (CSS Values 5, Chrome
29
+ 133+). Safari/Firefox don't support the typed form, but a custom
30
+ property parses permissively, so without the `@supports` guard the
31
+ invalid `attr()` would still land on `--icon-size` and only fail
32
+ later when `width: var(--icon-size)` substitutes it — collapsing the
33
+ icon to `auto` → 0×0. The guard keeps the override off unsupported
34
+ engines so the plain `--icon-size: 16px` base wins (visible 16px
35
+ icon, not 0). Consumers that need an exact custom size everywhere
36
+ should route through the `<Icon size={N}>` JSX wrapper, which sets
37
+ `--icon-size` inline as a plain length. */
38
+ @supports (width: attr(size px, 16px)) {
39
+ a-icon[size] {
40
+ --icon-size: attr(size px, 16px);
41
+ }
17
42
  }
18
43
  }
@@ -1,4 +1,4 @@
1
- /* Auto-generated by scripts/generate-icons.mjs. Do not edit by hand. */
1
+ /* Auto-generated by @antadesign/anta. Do not edit by hand. */
2
2
 
3
3
  @layer anta {
4
4
 
@@ -262,6 +262,10 @@
262
262
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3v10M3 8h10'/%3E%3C/svg%3E%0A");
263
263
  }
264
264
 
265
+ a-icon[shape="pointer"] {
266
+ --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='lucide lucide-pointer-icon lucide-pointer'%3E%3Cpath d='M22 14a8 8 0 0 1-8 8'/%3E%3Cpath d='M18 11v-1a2 2 0 0 0-2-2a2 2 0 0 0-2 2'/%3E%3Cpath d='M14 10V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1'/%3E%3Cpath d='M10 9.5V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v10'/%3E%3Cpath d='M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15'/%3E%3C/svg%3E");
267
+ }
268
+
265
269
  a-icon[shape="presentation"] {
266
270
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3h20'/%3E%3Cpath d='M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3'/%3E%3Cpath d='m7 21 5-5 5 5'/%3E%3C/svg%3E%0A");
267
271
  }
@@ -282,6 +286,10 @@
282
286
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg transform='scale(-1 1) translate(-24 0)'%3E%3Cpath d='M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3C/g%3E%3C/svg%3E%0A");
283
287
  }
284
288
 
289
+ a-icon[shape="rotate-ccw"] {
290
+ --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3C/svg%3E%0A");
291
+ }
292
+
285
293
  a-icon[shape="rss"] {
286
294
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%0A %3Cpath stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.33' d='M2.67 7.33a6 6 0 0 1 6 6m-6-10.66a10.67 10.67 0 0 1 10.66 10.66M4 12.67a.67.67 0 1 1-1.33 0 .67.67 0 0 1 1.33 0Z'/%3E%0A%3C/svg%3E%0A");
287
295
  }
@@ -1,4 +1,5 @@
1
- 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", "presentation", "refresh-ccw-dot", "refresh", "regex", "repeat", "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"];
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
3
  export declare const ICON_SYNONYMS: Readonly<Record<string, readonly string[]>>;
3
4
  declare module '@antadesign/anta' {
4
5
  interface IconShapes {
@@ -67,11 +68,13 @@ declare module '@antadesign/anta' {
67
68
  'not-equal': true;
68
69
  'play': true;
69
70
  'plus': true;
71
+ 'pointer': true;
70
72
  'presentation': true;
71
73
  'refresh-ccw-dot': true;
72
74
  'refresh': true;
73
75
  'regex': true;
74
76
  'repeat': true;
77
+ 'rotate-ccw': true;
75
78
  'rss': true;
76
79
  'runs-history': true;
77
80
  'scroll-text': true;
@@ -94,4 +97,4 @@ declare module '@antadesign/anta' {
94
97
  'x': true;
95
98
  }
96
99
  }
97
- export type IconShape = keyof import('@antadesign/anta').IconShapes;
100
+ export type IconShape = keyof IconShapes;
@@ -64,11 +64,13 @@ const ICON_SHAPES = [
64
64
  "not-equal",
65
65
  "play",
66
66
  "plus",
67
+ "pointer",
67
68
  "presentation",
68
69
  "refresh-ccw-dot",
69
70
  "refresh",
70
71
  "regex",
71
72
  "repeat",
73
+ "rotate-ccw",
72
74
  "rss",
73
75
  "runs-history",
74
76
  "scroll-text",
@@ -1,16 +1,14 @@
1
1
  @layer anta {
2
2
  a-progress {
3
- --progress-bg: var(--bg-block);
3
+ --progress-bg: var(--bg-4);
4
4
  --progress-border-color: var(--border-4);
5
- --progress-indicator-bg: var(--bg-spot);
5
+ --progress-indicator-bg: var(--bg-5);
6
6
  /* Right-edge fade: from the indicator's own bg to the border
7
- colour, both opaque. Two opaque endpoints + `in oklch`
8
- interpolation give a perceptually-uniform fade with no alpha
9
- pre-multiplication artefacts. Tone variants automatically
10
- re-tint because both endpoint tokens (`--progress-indicator-bg`,
7
+ colour, both opaque. Tone variants automatically re-tint because
8
+ both endpoint tokens (`--progress-indicator-bg`,
11
9
  `--progress-border-color`) get re-aliased per tone. */
12
10
  --progress-indicator-edge: linear-gradient(
13
- 90deg in oklch,
11
+ 90deg,
14
12
  var(--progress-indicator-bg) 0%,
15
13
  var(--progress-border-color) 100%
16
14
  );
@@ -33,9 +31,9 @@
33
31
  }
34
32
 
35
33
  a-progress[tone="info"] {
36
- --progress-bg: var(--bg-block-info);
34
+ --progress-bg: var(--bg-4-info);
37
35
  --progress-border-color: var(--border-4-info);
38
- --progress-indicator-bg: var(--bg-spot-info);
36
+ --progress-indicator-bg: var(--bg-5-info);
39
37
  --progress-text-color: var(--text-2-info);
40
38
  --progress-hint-color: var(--text-3-info);
41
39
  }
@@ -0,0 +1,9 @@
1
+ @layer anta {
2
+ a-sticker-animated {
3
+ --sticker-size: 256px;
4
+
5
+ display: inline-block;
6
+ width: var(--sticker-size);
7
+ height: var(--sticker-size);
8
+ }
9
+ }
@@ -0,0 +1,38 @@
1
+ import { type AnimationItem } from 'lottie-web';
2
+ import { HTMLElementBase } from '../anta_helpers';
3
+ /**
4
+ * `<a-sticker-animated>` — Lottie-driven sticker carrier.
5
+ *
6
+ * Receives the Lottie payload as the `animation` attribute (a JSON
7
+ * string). On change, parses the JSON once and instantiates a
8
+ * `lottie-web` player against a shadow-DOM container. The renderer is
9
+ * SVG — `lottie-web` creates real `<svg>` elements in the shadow root
10
+ * and updates path / transform attributes each frame. Rasterisation
11
+ * goes through the browser's native SVG renderer (Skia / Core
12
+ * Graphics), giving the same crispness as static `<svg>` content.
13
+ *
14
+ * Observed attributes:
15
+ * - `animation` — JSON string for `lottie-web`. Reset to null/missing
16
+ * tears the player down.
17
+ * - `paused` — present: freeze at current frame. Numeric value
18
+ * (seconds): seek to that time, then freeze. Absent: play.
19
+ *
20
+ * Sizing comes from external CSS reading `--sticker-size` (set by the
21
+ * JSX wrapper or the consumer).
22
+ *
23
+ * The static counterpart is `<a-sticker>`.
24
+ */
25
+ export declare class AStickerAnimatedElement extends HTMLElementBase {
26
+ static observedAttributes: string[];
27
+ container: HTMLDivElement;
28
+ player: AnimationItem | null;
29
+ _animation: Record<string, unknown> | null;
30
+ constructor();
31
+ connectedCallback(): void;
32
+ disconnectedCallback(): void;
33
+ attributeChangedCallback(name: string): void;
34
+ rebuild(): void;
35
+ applyPaused(): void;
36
+ teardown(): void;
37
+ }
38
+ export declare function register_a_sticker_animated(): void;
@@ -0,0 +1,79 @@
1
+ import lottie from "lottie-web";
2
+ import { HTMLElementBase } from "../anta_helpers";
3
+ class AStickerAnimatedElement extends HTMLElementBase {
4
+ static observedAttributes = ["animation", "paused"];
5
+ container;
6
+ player = null;
7
+ _animation = null;
8
+ constructor() {
9
+ super();
10
+ const shadow = this.attachShadow({ mode: "open" });
11
+ const style = document.createElement("style");
12
+ style.textContent = `
13
+ :host { display: inline-block; }
14
+ div { width: 100%; height: 100%; }
15
+ div > svg { display: block; width: 100%; height: 100%; }
16
+ `;
17
+ this.container = document.createElement("div");
18
+ shadow.append(style, this.container);
19
+ }
20
+ connectedCallback() {
21
+ if (this._animation != null && this.player == null) this.rebuild();
22
+ }
23
+ disconnectedCallback() {
24
+ this.teardown();
25
+ }
26
+ attributeChangedCallback(name) {
27
+ if (name === "animation") {
28
+ const value = this.getAttribute("animation");
29
+ this._animation = value ? JSON.parse(value) : null;
30
+ if (this.isConnected) this.rebuild();
31
+ } else if (name === "paused") {
32
+ this.applyPaused();
33
+ }
34
+ }
35
+ rebuild() {
36
+ this.teardown();
37
+ if (this._animation == null) return;
38
+ this.player = lottie.loadAnimation({
39
+ container: this.container,
40
+ renderer: "svg",
41
+ loop: true,
42
+ autoplay: !this.hasAttribute("paused"),
43
+ animationData: this._animation
44
+ });
45
+ this.applyPaused();
46
+ }
47
+ applyPaused() {
48
+ if (!this.player) return;
49
+ const attr = this.getAttribute("paused");
50
+ if (attr === null) {
51
+ this.player.play();
52
+ return;
53
+ }
54
+ const seconds = Number(attr);
55
+ if (Number.isFinite(seconds) && seconds > 0) {
56
+ const frame = seconds * this.player.frameRate;
57
+ const clamped = Math.min(this.player.totalFrames - 1, Math.max(0, frame));
58
+ this.player.goToAndStop(clamped, true);
59
+ } else {
60
+ this.player.pause();
61
+ }
62
+ }
63
+ teardown() {
64
+ if (this.player) {
65
+ this.player.destroy();
66
+ this.player = null;
67
+ }
68
+ }
69
+ }
70
+ function register_a_sticker_animated() {
71
+ if (typeof customElements === "undefined") return;
72
+ if (!customElements.get("a-sticker-animated")) {
73
+ customElements.define("a-sticker-animated", AStickerAnimatedElement);
74
+ }
75
+ }
76
+ export {
77
+ AStickerAnimatedElement,
78
+ register_a_sticker_animated
79
+ };
@@ -0,0 +1,9 @@
1
+ @layer anta {
2
+ a-sticker {
3
+ --sticker-size: 256px;
4
+
5
+ display: inline-block;
6
+ width: var(--sticker-size);
7
+ height: var(--sticker-size);
8
+ }
9
+ }
@@ -0,0 +1,18 @@
1
+ import { HTMLElementBase } from '../anta_helpers';
2
+ /**
3
+ * `<a-sticker>` — static sticker carrier.
4
+ *
5
+ * Receives SVG markup as the `svg` attribute. On change, drops it into
6
+ * a shadow-DOM container so the host's light DOM stays untouched.
7
+ * Sizing comes from external CSS reading `--sticker-size` (set by the
8
+ * JSX wrapper, or by the consumer directly).
9
+ *
10
+ * The animated counterpart is `<a-sticker-animated>`.
11
+ */
12
+ export declare class AStickerElement extends HTMLElementBase {
13
+ static observedAttributes: string[];
14
+ container: HTMLDivElement;
15
+ constructor();
16
+ attributeChangedCallback(): void;
17
+ }
18
+ export declare function register_a_sticker(): void;
@@ -0,0 +1,30 @@
1
+ import { HTMLElementBase } from "../anta_helpers";
2
+ class AStickerElement extends HTMLElementBase {
3
+ static observedAttributes = ["svg"];
4
+ container;
5
+ constructor() {
6
+ super();
7
+ const shadow = this.attachShadow({ mode: "open" });
8
+ const style = document.createElement("style");
9
+ style.textContent = `
10
+ :host { display: inline-block; }
11
+ div { width: 100%; height: 100%; }
12
+ div > svg { display: block; width: 100%; height: 100%; }
13
+ `;
14
+ this.container = document.createElement("div");
15
+ shadow.append(style, this.container);
16
+ }
17
+ attributeChangedCallback() {
18
+ this.container.innerHTML = this.getAttribute("svg") ?? "";
19
+ }
20
+ }
21
+ function register_a_sticker() {
22
+ if (typeof customElements === "undefined") return;
23
+ if (!customElements.get("a-sticker")) {
24
+ customElements.define("a-sticker", AStickerElement);
25
+ }
26
+ }
27
+ export {
28
+ AStickerElement,
29
+ register_a_sticker
30
+ };
@@ -3,11 +3,17 @@
3
3
  --text-color: var(--text-1);
4
4
  --text-link-color: var(--link-color);
5
5
  --text-link-hover: var(--link-color-hover);
6
-
6
+
7
7
  display: block;
8
8
  color: var(--text-color);
9
+ font-size: 15px;
10
+ line-height: 20px;
9
11
  }
10
-
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
+
11
17
  a-text[inline] {
12
18
  display: inline-block;
13
19
  }
@@ -70,8 +76,11 @@
70
76
  On hover the underline color is repeated so it tracks the priority
71
77
  color rather than the global --link-color-hover. */
72
78
  a-text a, a-text a:link, a-text a:visited { color: var(--text-link-color); }
73
- a-text a:hover {
74
- color: var(--text-link-hover);
75
- text-decoration-color: var(--text-link-hover);
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
+ }
76
85
  }
77
86
  }
@@ -0,0 +1,64 @@
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,7 +1,14 @@
1
1
  import './a-progress.css';
2
2
  import './a-text.css';
3
+ import './a-title.css';
3
4
  import './a-icon.css';
4
5
  import './a-icon.shapes.css';
6
+ import './a-button.css';
7
+ import './a-sticker.css';
8
+ import './a-sticker-animated.css';
5
9
  export { AProgressElement, register_a_progress } from './a-progress';
6
10
  export { ATextElement, register_a_text } from './a-text';
7
11
  export { AIconElement, register_a_icon } from './a-icon';
12
+ export { AButtonElement, register_a_button } from './a-button';
13
+ export { AStickerElement, register_a_sticker } from './a-sticker';
14
+ export { AStickerAnimatedElement, register_a_sticker_animated } from './a-sticker-animated';
@@ -1,23 +1,42 @@
1
1
  import { register_a_progress } from "./a-progress";
2
2
  import { register_a_text } from "./a-text";
3
3
  import { register_a_icon } from "./a-icon";
4
+ import { register_a_button } from "./a-button";
5
+ import { register_a_sticker } from "./a-sticker";
6
+ import { register_a_sticker_animated } from "./a-sticker-animated";
4
7
  import "./a-progress.css";
5
8
  import "./a-text.css";
9
+ import "./a-title.css";
6
10
  import "./a-icon.css";
7
11
  import "./a-icon.shapes.css";
12
+ import "./a-button.css";
13
+ import "./a-sticker.css";
14
+ import "./a-sticker-animated.css";
8
15
  import { AProgressElement, register_a_progress as register_a_progress2 } from "./a-progress";
9
16
  import { ATextElement, register_a_text as register_a_text2 } from "./a-text";
10
17
  import { AIconElement, register_a_icon as register_a_icon2 } from "./a-icon";
18
+ import { AButtonElement, register_a_button as register_a_button2 } from "./a-button";
19
+ import { AStickerElement, register_a_sticker as register_a_sticker2 } from "./a-sticker";
20
+ import { AStickerAnimatedElement, register_a_sticker_animated as register_a_sticker_animated2 } from "./a-sticker-animated";
11
21
  if (typeof customElements !== "undefined") {
12
22
  register_a_progress();
13
23
  register_a_text();
14
24
  register_a_icon();
25
+ register_a_button();
26
+ register_a_sticker();
27
+ register_a_sticker_animated();
15
28
  }
16
29
  export {
30
+ AButtonElement,
17
31
  AIconElement,
18
32
  AProgressElement,
33
+ AStickerAnimatedElement,
34
+ AStickerElement,
19
35
  ATextElement,
36
+ register_a_button2 as register_a_button,
20
37
  register_a_icon2 as register_a_icon,
21
38
  register_a_progress2 as register_a_progress,
39
+ register_a_sticker2 as register_a_sticker,
40
+ register_a_sticker_animated2 as register_a_sticker_animated,
22
41
  register_a_text2 as register_a_text
23
42
  };