@antadesign/anta 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/README.md +40 -1
  2. package/dist/components/Progress.module.css +0 -5
  3. package/dist/components/Text.module.css +0 -6
  4. package/dist/elements/a-button.css +1 -756
  5. package/dist/elements/a-icon.css +1 -43
  6. package/dist/elements/a-icon.shapes.css +1 -377
  7. package/dist/elements/a-progress.css +1 -68
  8. package/dist/elements/a-tag.css +1 -196
  9. package/dist/elements/a-text.css +1 -90
  10. package/dist/elements/a-title.css +1 -64
  11. package/dist/elements/a-tooltip.css +1 -62
  12. package/dist/index.d.ts +1 -0
  13. package/dist/jsx-runtime.d.ts +17 -15
  14. package/dist/reset.css +1 -209
  15. package/dist/tokens.css +1 -285
  16. package/package.json +6 -4
  17. package/dist/components/Button.module.css +0 -2
  18. package/dist/components/Menu.d.ts +0 -61
  19. package/dist/components/Menu.js +0 -34
  20. package/dist/components/MenuGroup.d.ts +0 -24
  21. package/dist/components/MenuGroup.js +0 -19
  22. package/dist/components/MenuItem.d.ts +0 -49
  23. package/dist/components/MenuItem.js +0 -40
  24. package/dist/components/MenuSeparator.d.ts +0 -14
  25. package/dist/components/MenuSeparator.js +0 -7
  26. package/dist/components/Sticker.d.ts +0 -31
  27. package/dist/components/Sticker.js +0 -17
  28. package/dist/components/StickerAnimated.d.ts +0 -23
  29. package/dist/components/StickerAnimated.js +0 -28
  30. package/dist/components/__generated__/stickers/angry-animated.d.ts +0 -3
  31. package/dist/components/__generated__/stickers/angry-animated.js +0 -7
  32. package/dist/components/__generated__/stickers/angry.d.ts +0 -3
  33. package/dist/components/__generated__/stickers/angry.js +0 -7
  34. package/dist/components/__generated__/stickers/ask-animated.d.ts +0 -3
  35. package/dist/components/__generated__/stickers/ask-animated.js +0 -7
  36. package/dist/components/__generated__/stickers/ask.d.ts +0 -3
  37. package/dist/components/__generated__/stickers/ask.js +0 -7
  38. package/dist/components/__generated__/stickers/balance-animated.d.ts +0 -3
  39. package/dist/components/__generated__/stickers/balance-animated.js +0 -7
  40. package/dist/components/__generated__/stickers/balance.d.ts +0 -3
  41. package/dist/components/__generated__/stickers/balance.js +0 -7
  42. package/dist/components/__generated__/stickers/butterfly-animated.d.ts +0 -3
  43. package/dist/components/__generated__/stickers/butterfly-animated.js +0 -7
  44. package/dist/components/__generated__/stickers/butterfly-snake-animated.d.ts +0 -3
  45. package/dist/components/__generated__/stickers/butterfly-snake-animated.js +0 -7
  46. package/dist/components/__generated__/stickers/butterfly-snake.d.ts +0 -3
  47. package/dist/components/__generated__/stickers/butterfly-snake.js +0 -7
  48. package/dist/components/__generated__/stickers/butterfly.d.ts +0 -3
  49. package/dist/components/__generated__/stickers/butterfly.js +0 -7
  50. package/dist/components/__generated__/stickers/catch-animated.d.ts +0 -3
  51. package/dist/components/__generated__/stickers/catch-animated.js +0 -7
  52. package/dist/components/__generated__/stickers/catch.d.ts +0 -3
  53. package/dist/components/__generated__/stickers/catch.js +0 -7
  54. package/dist/components/__generated__/stickers/clap-animated.d.ts +0 -3
  55. package/dist/components/__generated__/stickers/clap-animated.js +0 -7
  56. package/dist/components/__generated__/stickers/clap.d.ts +0 -3
  57. package/dist/components/__generated__/stickers/clap.js +0 -7
  58. package/dist/components/__generated__/stickers/coding-animated.d.ts +0 -3
  59. package/dist/components/__generated__/stickers/coding-animated.js +0 -7
  60. package/dist/components/__generated__/stickers/coding.d.ts +0 -3
  61. package/dist/components/__generated__/stickers/coding.js +0 -7
  62. package/dist/components/__generated__/stickers/cowboy-animated.d.ts +0 -3
  63. package/dist/components/__generated__/stickers/cowboy-animated.js +0 -7
  64. package/dist/components/__generated__/stickers/cowboy.d.ts +0 -3
  65. package/dist/components/__generated__/stickers/cowboy.js +0 -7
  66. package/dist/components/__generated__/stickers/dance-animated.d.ts +0 -3
  67. package/dist/components/__generated__/stickers/dance-animated.js +0 -7
  68. package/dist/components/__generated__/stickers/dance.d.ts +0 -3
  69. package/dist/components/__generated__/stickers/dance.js +0 -7
  70. package/dist/components/__generated__/stickers/detective-animated.d.ts +0 -3
  71. package/dist/components/__generated__/stickers/detective-animated.js +0 -7
  72. package/dist/components/__generated__/stickers/detective.d.ts +0 -3
  73. package/dist/components/__generated__/stickers/detective.js +0 -7
  74. package/dist/components/__generated__/stickers/disapprove-animated.d.ts +0 -3
  75. package/dist/components/__generated__/stickers/disapprove-animated.js +0 -7
  76. package/dist/components/__generated__/stickers/disapprove.d.ts +0 -3
  77. package/dist/components/__generated__/stickers/disapprove.js +0 -7
  78. package/dist/components/__generated__/stickers/distracted-animated.d.ts +0 -3
  79. package/dist/components/__generated__/stickers/distracted-animated.js +0 -7
  80. package/dist/components/__generated__/stickers/distracted.d.ts +0 -3
  81. package/dist/components/__generated__/stickers/distracted.js +0 -7
  82. package/dist/components/__generated__/stickers/dive-animated.d.ts +0 -3
  83. package/dist/components/__generated__/stickers/dive-animated.js +0 -7
  84. package/dist/components/__generated__/stickers/dive.d.ts +0 -3
  85. package/dist/components/__generated__/stickers/dive.js +0 -7
  86. package/dist/components/__generated__/stickers/eat-animated.d.ts +0 -3
  87. package/dist/components/__generated__/stickers/eat-animated.js +0 -7
  88. package/dist/components/__generated__/stickers/eat.d.ts +0 -3
  89. package/dist/components/__generated__/stickers/eat.js +0 -7
  90. package/dist/components/__generated__/stickers/facepalm-animated.d.ts +0 -3
  91. package/dist/components/__generated__/stickers/facepalm-animated.js +0 -7
  92. package/dist/components/__generated__/stickers/facepalm.d.ts +0 -3
  93. package/dist/components/__generated__/stickers/facepalm.js +0 -7
  94. package/dist/components/__generated__/stickers/failed-animated.d.ts +0 -3
  95. package/dist/components/__generated__/stickers/failed-animated.js +0 -7
  96. package/dist/components/__generated__/stickers/failed.d.ts +0 -3
  97. package/dist/components/__generated__/stickers/failed.js +0 -7
  98. package/dist/components/__generated__/stickers/found-animated.d.ts +0 -3
  99. package/dist/components/__generated__/stickers/found-animated.js +0 -7
  100. package/dist/components/__generated__/stickers/found.d.ts +0 -3
  101. package/dist/components/__generated__/stickers/found.js +0 -7
  102. package/dist/components/__generated__/stickers/grow-animated.d.ts +0 -3
  103. package/dist/components/__generated__/stickers/grow-animated.js +0 -7
  104. package/dist/components/__generated__/stickers/grow.d.ts +0 -3
  105. package/dist/components/__generated__/stickers/grow.js +0 -7
  106. package/dist/components/__generated__/stickers/handstand-animated.d.ts +0 -3
  107. package/dist/components/__generated__/stickers/handstand-animated.js +0 -7
  108. package/dist/components/__generated__/stickers/handstand.d.ts +0 -3
  109. package/dist/components/__generated__/stickers/handstand.js +0 -7
  110. package/dist/components/__generated__/stickers/heart-animated.d.ts +0 -3
  111. package/dist/components/__generated__/stickers/heart-animated.js +0 -7
  112. package/dist/components/__generated__/stickers/heart.d.ts +0 -3
  113. package/dist/components/__generated__/stickers/heart.js +0 -7
  114. package/dist/components/__generated__/stickers/hello-animated.d.ts +0 -3
  115. package/dist/components/__generated__/stickers/hello-animated.js +0 -7
  116. package/dist/components/__generated__/stickers/hello.d.ts +0 -3
  117. package/dist/components/__generated__/stickers/hello.js +0 -7
  118. package/dist/components/__generated__/stickers/idea-animated.d.ts +0 -3
  119. package/dist/components/__generated__/stickers/idea-animated.js +0 -7
  120. package/dist/components/__generated__/stickers/idea.d.ts +0 -3
  121. package/dist/components/__generated__/stickers/idea.js +0 -7
  122. package/dist/components/__generated__/stickers/index.d.ts +0 -99
  123. package/dist/components/__generated__/stickers/index.js +0 -198
  124. package/dist/components/__generated__/stickers/laugh-animated.d.ts +0 -3
  125. package/dist/components/__generated__/stickers/laugh-animated.js +0 -7
  126. package/dist/components/__generated__/stickers/laugh.d.ts +0 -3
  127. package/dist/components/__generated__/stickers/laugh.js +0 -7
  128. package/dist/components/__generated__/stickers/love-animated.d.ts +0 -3
  129. package/dist/components/__generated__/stickers/love-animated.js +0 -7
  130. package/dist/components/__generated__/stickers/love.d.ts +0 -3
  131. package/dist/components/__generated__/stickers/love.js +0 -7
  132. package/dist/components/__generated__/stickers/nap-animated.d.ts +0 -3
  133. package/dist/components/__generated__/stickers/nap-animated.js +0 -7
  134. package/dist/components/__generated__/stickers/nap.d.ts +0 -3
  135. package/dist/components/__generated__/stickers/nap.js +0 -7
  136. package/dist/components/__generated__/stickers/party-animated.d.ts +0 -3
  137. package/dist/components/__generated__/stickers/party-animated.js +0 -7
  138. package/dist/components/__generated__/stickers/party.d.ts +0 -3
  139. package/dist/components/__generated__/stickers/party.js +0 -7
  140. package/dist/components/__generated__/stickers/passed-animated.d.ts +0 -3
  141. package/dist/components/__generated__/stickers/passed-animated.js +0 -7
  142. package/dist/components/__generated__/stickers/passed.d.ts +0 -3
  143. package/dist/components/__generated__/stickers/passed.js +0 -7
  144. package/dist/components/__generated__/stickers/peekaboo-animated.d.ts +0 -3
  145. package/dist/components/__generated__/stickers/peekaboo-animated.js +0 -7
  146. package/dist/components/__generated__/stickers/peekaboo.d.ts +0 -3
  147. package/dist/components/__generated__/stickers/peekaboo.js +0 -7
  148. package/dist/components/__generated__/stickers/pizza-animated.d.ts +0 -3
  149. package/dist/components/__generated__/stickers/pizza-animated.js +0 -7
  150. package/dist/components/__generated__/stickers/pizza.d.ts +0 -3
  151. package/dist/components/__generated__/stickers/pizza.js +0 -7
  152. package/dist/components/__generated__/stickers/puzzle-animated.d.ts +0 -3
  153. package/dist/components/__generated__/stickers/puzzle-animated.js +0 -7
  154. package/dist/components/__generated__/stickers/puzzle.d.ts +0 -3
  155. package/dist/components/__generated__/stickers/puzzle.js +0 -7
  156. package/dist/components/__generated__/stickers/sad-animated.d.ts +0 -3
  157. package/dist/components/__generated__/stickers/sad-animated.js +0 -7
  158. package/dist/components/__generated__/stickers/sad.d.ts +0 -3
  159. package/dist/components/__generated__/stickers/sad.js +0 -7
  160. package/dist/components/__generated__/stickers/scared-animated.d.ts +0 -3
  161. package/dist/components/__generated__/stickers/scared-animated.js +0 -7
  162. package/dist/components/__generated__/stickers/scared.d.ts +0 -3
  163. package/dist/components/__generated__/stickers/scared.js +0 -7
  164. package/dist/components/__generated__/stickers/scroll-animated.d.ts +0 -3
  165. package/dist/components/__generated__/stickers/scroll-animated.js +0 -7
  166. package/dist/components/__generated__/stickers/scroll.d.ts +0 -3
  167. package/dist/components/__generated__/stickers/scroll.js +0 -7
  168. package/dist/components/__generated__/stickers/search-animated.d.ts +0 -3
  169. package/dist/components/__generated__/stickers/search-animated.js +0 -7
  170. package/dist/components/__generated__/stickers/search.d.ts +0 -3
  171. package/dist/components/__generated__/stickers/search.js +0 -7
  172. package/dist/components/__generated__/stickers/shield-animated.d.ts +0 -3
  173. package/dist/components/__generated__/stickers/shield-animated.js +0 -7
  174. package/dist/components/__generated__/stickers/shield.d.ts +0 -3
  175. package/dist/components/__generated__/stickers/shield.js +0 -7
  176. package/dist/components/__generated__/stickers/shocked-animated.d.ts +0 -3
  177. package/dist/components/__generated__/stickers/shocked-animated.js +0 -7
  178. package/dist/components/__generated__/stickers/shocked.d.ts +0 -3
  179. package/dist/components/__generated__/stickers/shocked.js +0 -7
  180. package/dist/components/__generated__/stickers/sleep-animated.d.ts +0 -3
  181. package/dist/components/__generated__/stickers/sleep-animated.js +0 -7
  182. package/dist/components/__generated__/stickers/sleep.d.ts +0 -3
  183. package/dist/components/__generated__/stickers/sleep.js +0 -7
  184. package/dist/components/__generated__/stickers/stressed-animated.d.ts +0 -3
  185. package/dist/components/__generated__/stickers/stressed-animated.js +0 -7
  186. package/dist/components/__generated__/stickers/stressed.d.ts +0 -3
  187. package/dist/components/__generated__/stickers/stressed.js +0 -7
  188. package/dist/components/__generated__/stickers/suspicious-animated.d.ts +0 -3
  189. package/dist/components/__generated__/stickers/suspicious-animated.js +0 -7
  190. package/dist/components/__generated__/stickers/suspicious.d.ts +0 -3
  191. package/dist/components/__generated__/stickers/suspicious.js +0 -7
  192. package/dist/components/__generated__/stickers/thanks-animated.d.ts +0 -3
  193. package/dist/components/__generated__/stickers/thanks-animated.js +0 -7
  194. package/dist/components/__generated__/stickers/thanks.d.ts +0 -3
  195. package/dist/components/__generated__/stickers/thanks.js +0 -7
  196. package/dist/components/__generated__/stickers/think-animated.d.ts +0 -3
  197. package/dist/components/__generated__/stickers/think-animated.js +0 -7
  198. package/dist/components/__generated__/stickers/think-of-you-animated.d.ts +0 -3
  199. package/dist/components/__generated__/stickers/think-of-you-animated.js +0 -7
  200. package/dist/components/__generated__/stickers/think-of-you.d.ts +0 -3
  201. package/dist/components/__generated__/stickers/think-of-you.js +0 -7
  202. package/dist/components/__generated__/stickers/think.d.ts +0 -3
  203. package/dist/components/__generated__/stickers/think.js +0 -7
  204. package/dist/components/__generated__/stickers/thumbs-up-animated.d.ts +0 -3
  205. package/dist/components/__generated__/stickers/thumbs-up-animated.js +0 -7
  206. package/dist/components/__generated__/stickers/thumbs-up.d.ts +0 -3
  207. package/dist/components/__generated__/stickers/thumbs-up.js +0 -7
  208. package/dist/components/__generated__/stickers/vacation-animated.d.ts +0 -3
  209. package/dist/components/__generated__/stickers/vacation-animated.js +0 -7
  210. package/dist/components/__generated__/stickers/vacation.d.ts +0 -3
  211. package/dist/components/__generated__/stickers/vacation.js +0 -7
  212. package/dist/components/__generated__/stickers/wait-animated.d.ts +0 -3
  213. package/dist/components/__generated__/stickers/wait-animated.js +0 -7
  214. package/dist/components/__generated__/stickers/wait.d.ts +0 -3
  215. package/dist/components/__generated__/stickers/wait.js +0 -7
  216. package/dist/components/__generated__/stickers/wink-animated.d.ts +0 -3
  217. package/dist/components/__generated__/stickers/wink-animated.js +0 -7
  218. package/dist/components/__generated__/stickers/wink.d.ts +0 -3
  219. package/dist/components/__generated__/stickers/wink.js +0 -7
  220. package/dist/components/__generated__/stickers/work-animated.d.ts +0 -3
  221. package/dist/components/__generated__/stickers/work-animated.js +0 -7
  222. package/dist/components/__generated__/stickers/work.d.ts +0 -3
  223. package/dist/components/__generated__/stickers/work.js +0 -7
  224. package/dist/components/__generated__/stickers/zen-animated.d.ts +0 -3
  225. package/dist/components/__generated__/stickers/zen-animated.js +0 -7
  226. package/dist/components/__generated__/stickers/zen.d.ts +0 -3
  227. package/dist/components/__generated__/stickers/zen.js +0 -7
  228. package/dist/elements/a-menu-group.css +0 -21
  229. package/dist/elements/a-menu-group.d.ts +0 -13
  230. package/dist/elements/a-menu-group.js +0 -15
  231. package/dist/elements/a-menu-item.css +0 -162
  232. package/dist/elements/a-menu-item.d.ts +0 -27
  233. package/dist/elements/a-menu-item.js +0 -29
  234. package/dist/elements/a-menu-separator.css +0 -15
  235. package/dist/elements/a-menu-separator.d.ts +0 -12
  236. package/dist/elements/a-menu-separator.js +0 -15
  237. package/dist/elements/a-menu.css +0 -34
  238. package/dist/elements/a-menu.d.ts +0 -120
  239. package/dist/elements/a-menu.js +0 -649
  240. package/dist/elements/a-sticker-animated.css +0 -9
  241. package/dist/elements/a-sticker-animated.d.ts +0 -39
  242. package/dist/elements/a-sticker-animated.js +0 -81
  243. package/dist/elements/a-sticker.css +0 -9
  244. package/dist/elements/a-sticker.d.ts +0 -19
  245. package/dist/elements/a-sticker.js +0 -32
  246. package/dist/generate-stickers.mjs +0 -293
package/dist/reset.css CHANGED
@@ -1,209 +1 @@
1
- /* Anta's reset + typography defaults. All rules live in `@layer anta`
2
- so consumer-owned components (in `@layer components`) and utility
3
- frameworks (in `@layer utilities`) can override on demand. The
4
- layer-order declaration in `tokens.css` (`@layer base, anta,
5
- components, utilities;`) keeps Anta above any preflight resets in
6
- `@layer base` so a Tailwind import doesn't wipe Anta's typography. */
7
-
8
- @layer anta {
9
- /* ───── Structural reset ─────────────────────────────────────── */
10
-
11
- /* Modern box-sizing — pads and borders count inside the declared
12
- width/height. Universal selectors so `::before` / `::after`
13
- pseudo-elements follow the host. */
14
- *, *::before, *::after {
15
- box-sizing: border-box;
16
- }
17
-
18
- /* Zero out browser-default margins on every element. Apps build
19
- up their own spacing from explicit values rather than fighting
20
- the user-agent stylesheet. */
21
- * {
22
- margin: 0;
23
- }
24
-
25
- /* Replaced elements as block-level by default + cap to their
26
- container so a misplaced large image doesn't blow out the
27
- layout. Consumers re-inline them with `display: inline-block`
28
- where needed. */
29
- img, picture, video, canvas, svg {
30
- display: block;
31
- max-width: 100%;
32
- }
33
-
34
- /* Inherit typography into form controls — by default browsers
35
- reset font on these. */
36
- input, button, textarea, select {
37
- font: inherit;
38
- }
39
-
40
- /* Wrap long words rather than overflow; `text-wrap: pretty`
41
- balances widows on paragraphs, `text-wrap: balance` evens
42
- headlines across lines. */
43
- p, h1, h2, h3, h4, h5, h6 {
44
- overflow-wrap: break-word;
45
- }
46
- p {
47
- text-wrap: pretty;
48
- }
49
- h1, h2, h3, h4, h5, h6 {
50
- text-wrap: balance;
51
- }
52
-
53
- /* ───── Typography defaults — Anta opinion ───────────────────── */
54
-
55
- /* Raw headings adopt the same visual scale as `<Title level={n}>`
56
- so plain markup matches the component. Values are duplicated in
57
- `src/elements/a-title.css`; keep the two in lockstep. */
58
- h1, h2, h3, h4, h5, h6 {
59
- color: var(--text-1);
60
- font-weight: 584.62;
61
- letter-spacing: 0;
62
- }
63
-
64
- h1 { font-size: 28px; line-height: 32px; margin-block: 0 16px; }
65
- h2 { font-size: 24px; line-height: 28px; margin-block: 32px 12px; }
66
- h3 { font-size: 20px; line-height: 24px; margin-block: 24px 12px; }
67
- h4 { font-size: 17px; line-height: 20px; margin-block: 20px 8px; }
68
- h5 { font-size: 15px; line-height: 20px; margin-block: 16px 8px; }
69
- h6 { font-size: 13px; line-height: 16px; margin-block: 16px 4px; }
70
-
71
- strong {
72
- font-weight: 600;
73
- }
74
-
75
- /* Keep inline `<code>` from inflating the line box of the prose it
76
- sits in — `1em` pins its line height to its own font size. */
77
- code {
78
- line-height: 1em;
79
- }
80
-
81
- /* Prose lists (ul, ol) get a tight 3ch left padding so markers
82
- hug the text, and items get a small bottom margin so
83
- consecutive ones breathe. Markers are toned all the way down
84
- to --text-5 since they are visual scaffolding, not content. */
85
- ul, ol {
86
- padding-left: 3ch;
87
- }
88
- :is(ul, ol) > li {
89
- margin-bottom: 0.5em;
90
- }
91
- :is(ul, ol) > li::marker {
92
- color: var(--text-5);
93
- }
94
-
95
- /* `<menu>` is for command/option lists, not prose. By default
96
- browsers render it like a `<ul>` (disc markers, 40px padding);
97
- strip all of that so it's a clean semantic container ready to
98
- be styled. */
99
- menu {
100
- list-style: none;
101
- padding: 0;
102
- margin: 0;
103
- }
104
- menu > li {
105
- margin: 0;
106
- }
107
-
108
- /* Global link defaults. Hairline underline at 75% alpha;
109
- underline goes to currentColor (100%) and 1px on hover. Color
110
- comes from --link-color tokens, which auto-flip in dark mode.
111
- `:not(:where([role="button"]))` excludes anchor-buttons (`<a role="button">`,
112
- e.g. `<Button href>`): `a:link`/`a:visited` are pseudo-classes with the
113
- same (0,1,1) specificity as `a[role="button"]`, so without the exclusion
114
- they'd tie and win on source order, giving buttons link colour +
115
- underline. The `:where()` keeps the exclusion specificity-neutral so this
116
- base rule stays at (0,0,1)/(0,1,1) — a bare `:not([role="button"])` would
117
- add an attribute selector's weight and out-specify prose-link overrides
118
- like `a-text a` / the <Button> prose-link rule, leaving their links stuck
119
- on the global blue. Other contexts (nav, headings) still override as needed. */
120
- a:not(:where([role="button"])),
121
- a:not(:where([role="button"])):link,
122
- a:not(:where([role="button"])):visited {
123
- color: var(--link-color);
124
- text-decoration: underline;
125
- text-decoration-style: solid;
126
- text-decoration-color: color-mix(in srgb, currentColor 75%, transparent);
127
- text-decoration-thickness: 0.5px;
128
- text-underline-offset: 3px;
129
- }
130
- /* Hover only on real-pointer devices — gating avoids the sticky hover
131
- color that lingers after a tap on touch screens. */
132
- @media (hover: hover) and (pointer: fine) {
133
- a:not(:where([role="button"])):hover {
134
- color: var(--link-color-hover);
135
- /* Underline color is left as the resting hairline (the base rule's
136
- `currentColor` mix) — only the thickness grows on hover. */
137
- text-decoration-thickness: 1px;
138
- }
139
- }
140
- a:not(:where([role="button"])):active {
141
- text-decoration-color: color-mix(in srgb, currentColor 75%, transparent);
142
- }
143
-
144
- /* Text selection — brand color at 15% alpha. */
145
- ::selection {
146
- background: color-mix(in srgb, var(--text-1-brand), transparent 85%);
147
- }
148
-
149
- /* ───── Tables ───────────────────────────────────────────────── */
150
-
151
- /* Polite, element-level baseline. Rules live in `@layer anta`, so
152
- any consumer rule outside a layer — or in `components` /
153
- `utilities` — overrides without effort. Width is intentionally
154
- left untouched so app tables stay inline-sized; full-bleed is a
155
- decision for the surrounding page. */
156
- table {
157
- border-collapse: collapse;
158
- font-variant-numeric: tabular-nums;
159
- }
160
-
161
- caption {
162
- text-align: left;
163
- color: var(--text-3);
164
- padding-left: 10px;
165
- margin-bottom: 0.25em;
166
- }
167
-
168
- th, td {
169
- padding: 5px 10px;
170
- text-align: left;
171
- vertical-align: top;
172
- border-bottom: 1px solid var(--border-5);
173
- }
174
-
175
- thead th {
176
- font-weight: 600;
177
- }
178
-
179
- /* Drop the trailing hairline under the table's last row so the
180
- table doesn't end with an orphan line. Handles both "tbody is
181
- the final section" and "tfoot is the final section". */
182
- tfoot tr:last-child > :is(th, td),
183
- table:not(:has(tfoot)) tbody tr:last-child > :is(th, td) {
184
- border-bottom: none;
185
- }
186
-
187
- /* Opt-in: outer frame + vertical column dividers + 3px rounded
188
- corners. Switches to separate borders because `border-radius`
189
- doesn't render reliably under `border-collapse: collapse` — the
190
- collapsed borders override the radius. Cells draw their own
191
- right edges to build the internal grid; the last cell in each
192
- row drops its right border so the table's own border supplies
193
- the outer frame. Row separators come from the baseline
194
- `border-bottom` and continue to work under separate-collapse. */
195
- table[data-bordered] {
196
- border-collapse: separate;
197
- border-spacing: 0;
198
- border: 1px solid var(--border-5);
199
- border-radius: 3px;
200
- }
201
-
202
- table[data-bordered] :is(th, td) {
203
- border-right: 1px solid var(--border-5);
204
- }
205
-
206
- table[data-bordered] tr > :is(th, td):last-child {
207
- border-right: 0;
208
- }
209
- }
1
+ @layer anta{*,*:before,*:after{box-sizing:border-box}*{margin:0}img,picture,video,canvas,svg{display:block;max-width:100%}input,button,textarea,select{font:inherit}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word}p{text-wrap:pretty}h1,h2,h3,h4,h5,h6{text-wrap:balance}h1,h2,h3,h4,h5,h6{color:var(--text-1);font-weight:584.62;letter-spacing:0}h1{font-size:28px;line-height:32px;margin-block:0 16px}h2{font-size:24px;line-height:28px;margin-block:32px 12px}h3{font-size:20px;line-height:24px;margin-block:24px 12px}h4{font-size:17px;line-height:20px;margin-block:20px 8px}h5{font-size:15px;line-height:20px;margin-block:16px 8px}h6{font-size:13px;line-height:16px;margin-block:16px 4px}strong{font-weight:600}code{line-height:1em}code,kbd,samp,pre{letter-spacing:0}ul,ol{padding-left:3ch}:is(ul,ol)>li{margin-bottom:.5em}:is(ul,ol)>li::marker{color:var(--text-5)}menu{list-style:none;padding:0;margin:0}menu>li{margin:0}a:not(:where([role=button])),a:not(:where([role=button])):link,a:not(:where([role=button])):visited{color:var(--link-color);text-decoration:underline;text-decoration-style:solid;text-decoration-color:color-mix(in srgb,currentColor 75%,transparent);text-decoration-thickness:.5px;text-underline-offset:3px}@media(hover:hover)and (pointer:fine){a:not(:where([role=button])):hover{color:var(--link-color-hover);text-decoration-thickness:1px}}a:not(:where([role=button])):active{text-decoration-color:color-mix(in srgb,currentColor 75%,transparent)}::selection{background:color-mix(in srgb,var(--text-1-brand),transparent 85%)}table{border-collapse:collapse;font-variant-numeric:tabular-nums}caption{text-align:left;color:var(--text-3);padding-left:10px;margin-bottom:.25em}th,td{padding:5px 10px;text-align:left;vertical-align:top;border-bottom:1px solid var(--border-4)}thead th{font-weight:600}tfoot tr:last-child>:is(th,td),table:not(:has(tfoot)) tbody tr:last-child>:is(th,td){border-bottom:none}table[data-bordered]{border-collapse:separate;border-spacing:0;border:1px solid var(--border-4);border-radius:3px}table[data-bordered] :is(th,td){border-right:1px solid var(--border-4)}table[data-bordered] tr>:is(th,td):last-child{border-right:0}}
package/dist/tokens.css CHANGED
@@ -1,285 +1 @@
1
- /* Anta declares its layer order so consumers don't have to.
2
- `base` is below — typically used by resets like Tailwind's
3
- preflight (`@layer base`) — so Anta's reset + element styles
4
- beat resets but lose to a consumer's own `@layer components`
5
- rules. `utilities` sits above everything so utility-class
6
- frameworks like Tailwind (`@layer utilities`) can still
7
- override single properties when needed. Consumers who load
8
- their own layer-order declaration earlier in the cascade
9
- override this one — first mention of each layer name wins. */
10
- @layer base, anta, components, utilities;
11
-
12
- :root, .light {
13
- --sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
14
- --monospace: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
15
-
16
- font-size: 15px;
17
- font-weight: 400;
18
- font-feature-settings: 'ss02' on, 'ss05' on;
19
-
20
- /* Colors imported from Figma library "Anta 0.2" → "Dynamic colors" collection.
21
- See FIGMA.md for the full extraction procedure (figma.variables Plugin
22
- API + alias resolution). */
23
-
24
- /* Backgrounds — light, neutral. Numeric elevation scale: 1 = deepest /
25
- recessed (was bg-section), 5 = most raised (was bg-spot). */
26
- --bg-1: #ffffff;
27
- --bg-2: #fbfafb;
28
- --bg-3: #f6f4f6;
29
- --bg-4: #f1eff1;
30
- --bg-5: #ece9ec;
31
-
32
- /* Backgrounds — light, Brand (no --bg-1-brand; bg-1 is neutral-only) */
33
- --bg-2-brand: #fcfcfe;
34
- --bg-3-brand: #f7f6fd;
35
- --bg-4-brand: #efeefc;
36
- --bg-5-brand: #e9e5fa;
37
-
38
- /* Backgrounds — light, Success */
39
- --bg-2-success: #f7fcf9;
40
- --bg-3-success: #ecf9f0;
41
- --bg-4-success: #e2f5e8;
42
- --bg-5-success: #d9f2e0;
43
-
44
- /* Backgrounds — light, Critical */
45
- --bg-2-critical: #fefbfb;
46
- --bg-3-critical: #fdf2f2;
47
- --bg-4-critical: #fcebeb;
48
- --bg-5-critical: #fae5e5;
49
-
50
- /* Backgrounds — light, Warning */
51
- --bg-2-warning: #fefbf6;
52
- --bg-3-warning: #fcf4e8;
53
- --bg-4-warning: #fbeeda;
54
- --bg-5-warning: #f9e7cd;
55
-
56
- /* Backgrounds — light, Info */
57
- --bg-2-info: #fbfcfe;
58
- --bg-3-info: #f2f7fd;
59
- --bg-4-info: #e9f3fb;
60
- --bg-5-info: #e1eefa;
61
-
62
- /* Text — light, neutral */
63
- --text-1: #050306;
64
- --text-2: #302b31;
65
- --text-3: #635b65;
66
- --text-4: #878089;
67
- --text-5: #9f99a1;
68
-
69
- /* Text — light, Brand */
70
- --text-1-brand: #2e1e7b;
71
- --text-2-brand: #483493;
72
- --text-3-brand: #483493cc;
73
- --text-4-brand: #48349399;
74
- --text-5-brand: #48349366;
75
-
76
- /* Text — light, Success */
77
- --text-1-success: #004618;
78
- --text-2-success: #1f5c31;
79
- --text-3-success: #1f5c31cc;
80
- --text-4-success: #1f5c3199;
81
- --text-5-success: #1f5c3166;
82
-
83
- /* Text — light, Critical */
84
- --text-1-critical: #8f1014;
85
- --text-2-critical: #a01c1c;
86
- --text-3-critical: #a01c1ccc;
87
- --text-4-critical: #a01c1c99;
88
- --text-5-critical: #a01c1c66;
89
-
90
- /* Text — light, Warning */
91
- --text-1-warning: #7f410b;
92
- --text-2-warning: #995200;
93
- --text-3-warning: #995200cc;
94
- --text-4-warning: #99520099;
95
- --text-5-warning: #99520066;
96
-
97
- /* Text — light, Info */
98
- --text-1-info: #003969;
99
- --text-2-info: #175082;
100
- --text-3-info: #175082cc;
101
- --text-4-info: #175082b2;
102
- --text-5-info: #17508280;
103
-
104
- /* Borders — light, neutral */
105
- --border-1: #938d96;
106
- --border-2: #c1b9c1;
107
- --border-3: #d4ced4;
108
- --border-4: #e0dce0;
109
- --border-5: #ece9ec;
110
-
111
- /* Borders — light, Brand */
112
- --border-1-brand: #9081df;
113
- --border-2-brand: #bcb1f1;
114
- --border-3-brand: #d2cbf6;
115
- --border-4-brand: #ddd8f8;
116
- --border-5-brand: #e9e5fa;
117
-
118
- /* Borders — light, Success */
119
- --border-1-success: #44c169;
120
- --border-2-success: #88d7a0;
121
- --border-3-success: #b3e5c2;
122
- --border-4-success: #c6ecd1;
123
- --border-5-success: #d9f2e0;
124
-
125
- /* Borders — light, Critical */
126
- --border-1-critical: #e56c6c;
127
- --border-2-critical: #efa4a4;
128
- --border-3-critical: #f4c2c2;
129
- --border-4-critical: #f7d4d4;
130
- --border-5-critical: #fae5e5;
131
-
132
- /* Borders — light, Warning */
133
- --border-1-warning: #d88118;
134
- --border-2-warning: #edb25a;
135
- --border-3-warning: #f3cc91;
136
- --border-4-warning: #f6dbb1;
137
- --border-5-warning: #f9e7cd;
138
-
139
- /* Borders — light, Info */
140
- --border-1-info: #56a1e1;
141
- --border-2-info: #93c5ec;
142
- --border-3-info: #bad6f3;
143
- --border-4-info: #cfe3f7;
144
- --border-5-info: #e1eefa;
145
-
146
- /* Prose link colors — used by <a-text> for priorities 1 & 2 and by
147
- consumers wiring their own prose contexts. */
148
- --link-color: #1466d4;
149
- --link-color-hover: #2674e6;
150
- }
151
-
152
-
153
- .dark {
154
- font-weight: 400;
155
-
156
- /* Backgrounds — dark, neutral. Numeric elevation scale: 1 = deepest /
157
- recessed (was bg-section), 5 = most raised (was bg-spot). */
158
- --bg-1: #000000;
159
- --bg-2: #0e0d0f;
160
- --bg-3: #121014;
161
- --bg-4: #161316;
162
- --bg-5: #1a171b;
163
-
164
- /* Backgrounds — dark, tinted. The Anta 0.2 values,
165
- each a touch deeper for dark mode. (No --bg-1-tone; bg-1 is neutral-only.) */
166
-
167
- /* Backgrounds — dark, Brand */
168
- --bg-2-brand: #08060e;
169
- --bg-3-brand: #0f0c1d;
170
- --bg-4-brand: #130f24;
171
- --bg-5-brand: #16132b;
172
-
173
- /* Backgrounds — dark, Success */
174
- --bg-2-success: #030b06;
175
- --bg-3-success: #051209;
176
- --bg-4-success: #06160b;
177
- --bg-5-success: #081b0e;
178
-
179
- /* Backgrounds — dark, Critical */
180
- --bg-2-critical: #120303;
181
- --bg-3-critical: #210606;
182
- --bg-4-critical: #260808;
183
- --bg-5-critical: #2e0a0b;
184
-
185
- /* Backgrounds — dark, Warning */
186
- --bg-2-warning: #110a03;
187
- --bg-3-warning: #1c1105;
188
- --bg-4-warning: #231406;
189
- --bg-5-warning: #2b1a08;
190
-
191
- /* Backgrounds — dark, Info */
192
- --bg-2-info: #020a12;
193
- --bg-3-info: #05131f;
194
- --bg-4-info: #071725;
195
- --bg-5-info: #0c2337;
196
-
197
- /* Text — dark, neutral */
198
- --text-1: #ece9ec;
199
- --text-2: #c1b9c1;
200
- --text-3: #9f99a1;
201
- --text-4: #776e77;
202
- --text-5: #635b65;
203
-
204
- /* Text — dark, Brand */
205
- --text-1-brand: #c5baff;
206
- --text-2-brand: #ada0ee;
207
- --text-3-brand: #ada0eecc;
208
- --text-4-brand: #ada0ee99;
209
- --text-5-brand: #ada0ee66;
210
-
211
- /* Text — dark, Success */
212
- --text-1-success: #9ddeb1;
213
- --text-2-success: #74cd8e;
214
- --text-3-success: #74cd8ecc;
215
- --text-4-success: #74cd8e99;
216
- --text-5-success: #74cd8e66;
217
-
218
- /* Text — dark, Critical */
219
- --text-1-critical: #ffabac;
220
- --text-2-critical: #e78e90;
221
- --text-3-critical: #e78e90cc;
222
- --text-4-critical: #e78e9099;
223
- --text-5-critical: #e78e9066;
224
-
225
- /* Text — dark, Warning */
226
- --text-1-warning: #f0bf75;
227
- --text-2-warning: #e1a452;
228
- --text-3-warning: #e1a452cc;
229
- --text-4-warning: #e1a45299;
230
- --text-5-warning: #e1a45266;
231
-
232
- /* Text — dark, Info */
233
- --text-1-info: #9ed2ff;
234
- --text-2-info: #7db6e8;
235
- --text-3-info: #7db6e8cc;
236
- --text-4-info: #7db6e899;
237
- --text-5-info: #7db6e866;
238
-
239
- /* Borders — dark, neutral */
240
- --border-1: hsl(288deg 5.21% 42%);
241
- --border-2: hsl(282deg 7.04% 28%);
242
- --border-3: hsl(277.5deg 6.56% 20%);
243
- --border-4: hsl(290deg 6.52% 13%);
244
- --border-5: hsl(285deg 7.14% 10%);
245
-
246
- /* Borders — dark, Brand */
247
- --border-1-brand: hsl(250.08deg 59.8% 58%);
248
- --border-2-brand: hsl(250deg 50% 42%);
249
- --border-3-brand: hsl(252.63deg 47.74% 30%);
250
- --border-4-brand: hsl(249.8deg 39.84% 19%);
251
- --border-5-brand: hsl(249deg 39.22% 14%);
252
-
253
- /* Borders — dark, Success */
254
- --border-1-success: hsl(138.18deg 49.75% 29%);
255
- --border-2-success: hsl(138.26deg 50.36% 20%);
256
- --border-3-success: hsl(137.7deg 49.59% 16%);
257
- --border-4-success: hsl(138.46deg 52% 10%);
258
- --border-5-success: hsl(138.86deg 53.85% 7.5%);
259
-
260
- /* Borders — dark, Critical */
261
- --border-1-critical: hsl(0deg 56% 46%);
262
- --border-2-critical: hsl(0.42deg 63% 30%);
263
- --border-3-critical: hsl(0deg 62.21% 23%);
264
- --border-4-critical: hsl(359.13deg 59% 15%);
265
- --border-5-critical: hsl(359.06deg 63% 11%);
266
-
267
- /* Borders — dark, Warning */
268
- --border-1-warning: hsl(32.13deg 80.31% 34%);
269
- --border-2-warning: hsl(27.93deg 84.06% 24%);
270
- --border-3-warning: hsl(30deg 79.66% 17%);
271
- --border-4-warning: hsl(28.75deg 63.16% 12%);
272
- --border-5-warning: hsl(28.64deg 66.67% 9%);
273
-
274
- /* Borders — dark, Info */
275
- --border-1-info: hsl(207.82deg 70.2% 40%);
276
- --border-2-info: hsl(207.77deg 69.94% 29%);
277
- --border-3-info: hsl(208.04deg 69.93% 21%);
278
- --border-4-info: hsl(208.52deg 62.89% 14%);
279
- --border-5-info: hsl(207.78deg 65.85% 10.5%);
280
-
281
- /* Prose link colors — dark mode */
282
- --link-color: #7baee9;
283
- --link-color-hover: #90bdee;
284
- }
285
-
1
+ @layer base,anta,components,utilities;:root,.light{--sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;--monospace: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;font-size:15px;font-weight:400;font-feature-settings:"ss02" on,"ss05" on;--bg-1: #ffffff;--bg-2: #fbfafb;--bg-3: #f6f4f6;--bg-4: #f1eff1;--bg-5: #ece9ec;--bg-2-brand: #fcfcfe;--bg-3-brand: #f7f6fd;--bg-4-brand: #efeefc;--bg-5-brand: #e9e5fa;--bg-2-success: #f7fcf9;--bg-3-success: #ecf9f0;--bg-4-success: #e2f5e8;--bg-5-success: #d9f2e0;--bg-2-critical: #fefbfb;--bg-3-critical: #fdf2f2;--bg-4-critical: #fcebeb;--bg-5-critical: #fae5e5;--bg-2-warning: #fefbf6;--bg-3-warning: #fcf4e8;--bg-4-warning: #fbeeda;--bg-5-warning: #f9e7cd;--bg-2-info: #fbfcfe;--bg-3-info: #f2f7fd;--bg-4-info: #e9f3fb;--bg-5-info: #e1eefa;--text-1: #050306;--text-2: #302b31;--text-3: #635b65;--text-4: #878089;--text-5: #9f99a1;--text-1-brand: #2e1e7b;--text-2-brand: #483493;--text-3-brand: #483493cc;--text-4-brand: #48349399;--text-5-brand: #48349366;--text-1-success: #004618;--text-2-success: #1f5c31;--text-3-success: #1f5c31cc;--text-4-success: #1f5c3199;--text-5-success: #1f5c3166;--text-1-critical: #8f1014;--text-2-critical: #a01c1c;--text-3-critical: #a01c1ccc;--text-4-critical: #a01c1c99;--text-5-critical: #a01c1c66;--text-1-warning: #7f410b;--text-2-warning: #995200;--text-3-warning: #995200cc;--text-4-warning: #99520099;--text-5-warning: #99520066;--text-1-info: #003969;--text-2-info: #175082;--text-3-info: #175082cc;--text-4-info: #175082b2;--text-5-info: #17508280;--border-1: #938d96;--border-2: #c1b9c1;--border-3: #d4ced4;--border-4: #e0dce0;--border-5: #ece9ec;--border-1-brand: #9081df;--border-2-brand: #bcb1f1;--border-3-brand: #d2cbf6;--border-4-brand: #ddd8f8;--border-5-brand: #e9e5fa;--border-1-success: #44c169;--border-2-success: #88d7a0;--border-3-success: #b3e5c2;--border-4-success: #c6ecd1;--border-5-success: #d9f2e0;--border-1-critical: #e56c6c;--border-2-critical: #efa4a4;--border-3-critical: #f4c2c2;--border-4-critical: #f7d4d4;--border-5-critical: #fae5e5;--border-1-warning: #d88118;--border-2-warning: #edb25a;--border-3-warning: #f3cc91;--border-4-warning: #f6dbb1;--border-5-warning: #f9e7cd;--border-1-info: #56a1e1;--border-2-info: #93c5ec;--border-3-info: #bad6f3;--border-4-info: #cfe3f7;--border-5-info: #e1eefa;--link-color: #1466d4;--link-color-hover: #2674e6}.dark{font-weight:400;--bg-1: #000000;--bg-2: #0e0d0f;--bg-3: #121014;--bg-4: #161316;--bg-5: #1a171b;--bg-2-brand: #08060e;--bg-3-brand: #0f0c1d;--bg-4-brand: #130f24;--bg-5-brand: #16132b;--bg-2-success: #030b06;--bg-3-success: #051209;--bg-4-success: #06160b;--bg-5-success: #081b0e;--bg-2-critical: #120303;--bg-3-critical: #210606;--bg-4-critical: #260808;--bg-5-critical: #2e0a0b;--bg-2-warning: #110a03;--bg-3-warning: #1c1105;--bg-4-warning: #231406;--bg-5-warning: #2b1a08;--bg-2-info: #020a12;--bg-3-info: #05131f;--bg-4-info: #071725;--bg-5-info: #0c2337;--text-1: #ece9ec;--text-2: #c1b9c1;--text-3: #9f99a1;--text-4: #776e77;--text-5: #635b65;--text-1-brand: #c5baff;--text-2-brand: #ada0ee;--text-3-brand: #ada0eecc;--text-4-brand: #ada0ee99;--text-5-brand: #ada0ee66;--text-1-success: #9ddeb1;--text-2-success: #74cd8e;--text-3-success: #74cd8ecc;--text-4-success: #74cd8e99;--text-5-success: #74cd8e66;--text-1-critical: #ffabac;--text-2-critical: #e78e90;--text-3-critical: #e78e90cc;--text-4-critical: #e78e9099;--text-5-critical: #e78e9066;--text-1-warning: #f0bf75;--text-2-warning: #e1a452;--text-3-warning: #e1a452cc;--text-4-warning: #e1a45299;--text-5-warning: #e1a45266;--text-1-info: #9ed2ff;--text-2-info: #7db6e8;--text-3-info: #7db6e8cc;--text-4-info: #7db6e899;--text-5-info: #7db6e866;--border-1: hsl(288deg 5.21% 42%);--border-2: hsl(282deg 7.04% 28%);--border-3: hsl(277.5deg 6.56% 20%);--border-4: hsl(290deg 6.52% 13%);--border-5: hsl(285deg 7.14% 10%);--border-1-brand: hsl(250.08deg 59.8% 58%);--border-2-brand: hsl(250deg 50% 42%);--border-3-brand: hsl(252.63deg 47.74% 30%);--border-4-brand: hsl(249.8deg 39.84% 19%);--border-5-brand: hsl(249deg 39.22% 14%);--border-1-success: hsl(138.18deg 49.75% 29%);--border-2-success: hsl(138.26deg 50.36% 20%);--border-3-success: hsl(137.7deg 49.59% 16%);--border-4-success: hsl(138.46deg 52% 10%);--border-5-success: hsl(138.86deg 53.85% 7.5%);--border-1-critical: hsl(0deg 56% 46%);--border-2-critical: hsl(.42deg 63% 30%);--border-3-critical: hsl(0deg 62.21% 23%);--border-4-critical: hsl(359.13deg 59% 15%);--border-5-critical: hsl(359.06deg 63% 11%);--border-1-warning: hsl(32.13deg 80.31% 34%);--border-2-warning: hsl(27.93deg 84.06% 24%);--border-3-warning: hsl(30deg 79.66% 17%);--border-4-warning: hsl(28.75deg 63.16% 12%);--border-5-warning: hsl(28.64deg 66.67% 9%);--border-1-info: hsl(207.82deg 70.2% 40%);--border-2-info: hsl(207.77deg 69.94% 29%);--border-3-info: hsl(208.04deg 69.93% 21%);--border-4-info: hsl(208.52deg 62.89% 14%);--border-5-info: hsl(207.78deg 65.85% 10.5%);--link-color: #7baee9;--link-color-hover: #90bdee}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antadesign/anta",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -44,10 +44,12 @@
44
44
  },
45
45
  "scripts": {
46
46
  "build": "pnpm run build:js && pnpm run build:css && pnpm run build:types",
47
- "build:css": "find src -name '*.css' | while IFS= read -r f; do d=\"dist/${f#src/}\"; mkdir -p \"$(dirname \"$d\")\"; cp \"$f\" \"$d\"; done && cp scripts/generate-icons.mjs dist/",
47
+ "build:dev": "pnpm run build:js && pnpm run build:css:dev && pnpm run build:types",
48
+ "build:css": "esbuild $(find src -name '*.css') --minify --loader:.module.css=css --outdir=dist --outbase=src && cp scripts/generate-icons.mjs dist/",
49
+ "build:css:dev": "find src -name '*.css' | while IFS= read -r f; do d=\"dist/${f#src/}\"; mkdir -p \"$(dirname \"$d\")\"; cp \"$f\" \"$d\"; done && cp scripts/generate-icons.mjs dist/",
48
50
  "build:js": "esbuild $(find src \\( -name '*.ts' -o -name '*.tsx' \\) ! -name '*.d.ts') --outdir=dist --outbase=src --jsx=automatic --jsx-import-source=@antadesign/anta --format=esm --target=ES2022 --loader:.module.css=local-css --loader:.css=global-css",
49
51
  "build:types": "tsc -p src/tsconfig.json",
50
- "dev": "echo $$ > .dev.pid; trap 'rm -f .dev.pid' EXIT; nodemon -w src -w stickers/src -e ts,tsx,css -x 'pnpm run build && pnpm --filter @antadesign/stickers run build && pnpm --filter anta-site run docs' & pnpm --filter anta-site run dev & wait",
52
+ "dev": "echo $$ > .dev.pid; trap 'rm -f .dev.pid' EXIT; nodemon -w src -w stickers/src -e ts,tsx,css -x 'pnpm run build:dev && pnpm --filter @antadesign/stickers run build:dev && pnpm --filter anta-site run docs' & pnpm --filter anta-site run dev & wait",
51
53
  "stop": "node scripts/dev-stop.mjs",
52
54
  "typecheck": "tsc --noEmit -p src/tsconfig.json",
53
55
  "icons": "node scripts/generate-icons.mjs --input src/elements/icons --output src/elements --name a-icon.shapes --internal",
@@ -63,7 +65,7 @@
63
65
  },
64
66
  "dependencies": {
65
67
  "clsx": "^2.1.0",
66
- "es-toolkit": "^1.47.0"
68
+ "es-toolkit": "1.47.0"
67
69
  },
68
70
  "peerDependencies": {
69
71
  "react": "^18.0.0 || ^19.0.0"
@@ -1,2 +0,0 @@
1
- /* Layout lives in src/elements/a-button.css. Stub kept for symmetry
2
- * with the other wrappers and as a landing pad for wrapper-only styles. */
@@ -1,61 +0,0 @@
1
- import type { BaseProps } from '../general_types';
2
- export interface MenuProps extends BaseProps {
3
- /** Preferred placement relative to the trigger. The cross-axis suffix
4
- * (`-start` / `-end`) aligns the left / right edges; the menu auto-flips
5
- * vertically and clamps horizontally when there isn't room.
6
- * @defaultValue bottom-start */
7
- placement?: 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end';
8
- /** Open on right-click (the `contextmenu` event) of the trigger region
9
- * instead of a left click, positioned at the pointer. */
10
- context?: boolean;
11
- /** Open at the pointer coordinates rather than aligned to the trigger box.
12
- * Pairs naturally with `context`; on its own it positions a left-click
13
- * menu at the cursor. */
14
- coord?: boolean;
15
- /** Marks this menu as a submenu of the enclosing `MenuItem`. Set by passing
16
- * it as a `MenuItem`'s `submenu`; rarely written by hand. */
17
- submenu?: boolean;
18
- /** For a submenu: also open it on hover (with intent timing), not only on
19
- * click. No effect on a root menu. */
20
- hover?: boolean;
21
- /** Gap in pixels between the trigger and the menu.
22
- * @defaultValue 4 */
23
- offset?: number;
24
- /** Controlled open state. Omit for the default **uncontrolled** menu (it
25
- * opens/closes itself). Pass `'opened'` / `'closed'` to **control** it: the
26
- * menu's visibility follows this value, and user dismiss (Esc, outside-click,
27
- * select) fires `openchange` *without* self-closing — you update `state` in
28
- * response. A string (not a boolean) so there's no `"false"`-as-truthy
29
- * footgun. Submenus are always uncontrolled regardless of this. */
30
- state?: 'opened' | 'closed';
31
- /** The menu's contents: `MenuItem`, `MenuSeparator`, `MenuGroup`, or any
32
- * custom element. */
33
- children?: React.ReactNode;
34
- }
35
- /**
36
- * Menu — a dropdown / context menu that anchors to any target and "just
37
- * works". Place `<Menu>` immediately after the trigger element (a button,
38
- * say); it opens on click by default. For a whole-area right-click menu, put
39
- * it after the region and pass `context`.
40
- *
41
- * Open state is uncontrolled by default — listen for the `openchange` event
42
- * (`detail: { open, previousState }`) to observe it, or pass `state` to control
43
- * it. You can also grab a `ref` and call `.open()` / `.close()` / `.toggle()`.
44
- * Selecting a `MenuItem` closes the menu;
45
- * arbitrary injected content does not. Add `data-menu-open` to any item /
46
- * container to keep it open, or `data-menu-close` to a custom element to let it
47
- * close.
48
- *
49
- * Requires `@antadesign/anta/elements` to be imported (client-side only).
50
- *
51
- * @example Dropdown from a button
52
- * ```tsx
53
- * <a-button>Actions</a-button>
54
- * <Menu>
55
- * <MenuItem icon="edit" label="Edit" kbd="⌘E" onSelect={onEdit} />
56
- * <MenuSeparator />
57
- * <MenuItem tone="critical" icon="trash" label="Delete" onSelect={onDelete} />
58
- * </Menu>
59
- * ```
60
- */
61
- export declare const Menu: ({ placement, context, coord, submenu, hover, offset, state, className, children, ...rest }: MenuProps) => any;
@@ -1,34 +0,0 @@
1
- import { jsx } from "@antadesign/anta/jsx-runtime";
2
- const Menu = ({
3
- placement,
4
- context,
5
- coord,
6
- submenu,
7
- hover,
8
- offset,
9
- state,
10
- className,
11
- children,
12
- ...rest
13
- }) => {
14
- return /* @__PURE__ */ jsx(
15
- "a-menu",
16
- {
17
- placement: placement && placement !== "bottom-start" ? placement : void 0,
18
- context: context ? "" : void 0,
19
- coord: coord ? "" : void 0,
20
- submenu: submenu ? "" : void 0,
21
- hover: hover ? "" : void 0,
22
- offset: offset != null ? String(offset) : void 0,
23
- state,
24
- role: "menu",
25
- "aria-orientation": "vertical",
26
- class: className,
27
- ...rest,
28
- children
29
- }
30
- );
31
- };
32
- export {
33
- Menu
34
- };
@@ -1,24 +0,0 @@
1
- import type { BaseProps } from '../general_types';
2
- export interface MenuGroupProps extends BaseProps {
3
- /** The section heading shown above the grouped items (also the group's
4
- * accessible name). */
5
- label?: string;
6
- /** The grouped `MenuItem`s. */
7
- children?: React.ReactNode;
8
- }
9
- /**
10
- * MenuGroup — a titled section that organises related `MenuItem`s. Keyboard
11
- * navigation flattens items across groups, skipping the heading.
12
- *
13
- * Add `data-menu-open` to keep the menu open after any item in the group is
14
- * chosen (it forwards to the element).
15
- *
16
- * @example
17
- * ```tsx
18
- * <MenuGroup label="Edit">
19
- * <MenuItem icon="copy" label="Copy" />
20
- * <MenuItem icon="cut" label="Cut" />
21
- * </MenuGroup>
22
- * ```
23
- */
24
- export declare const MenuGroup: ({ label, className, children, ...rest }: MenuGroupProps) => any;
@@ -1,19 +0,0 @@
1
- import { jsx, jsxs } from "@antadesign/anta/jsx-runtime";
2
- const MenuGroup = ({ label, className, children, ...rest }) => {
3
- return /* @__PURE__ */ jsxs(
4
- "a-menu-group",
5
- {
6
- role: "group",
7
- "aria-label": label,
8
- class: className,
9
- ...rest,
10
- children: [
11
- label != null && /* @__PURE__ */ jsx("a-menu-group-label", { "aria-hidden": "true", children: label }),
12
- children
13
- ]
14
- }
15
- );
16
- };
17
- export {
18
- MenuGroup
19
- };