@antadesign/anta 0.3.26 → 0.3.28

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 (133) hide show
  1. package/README.md +26 -28
  2. package/dist/anta_helpers.d.ts +8 -0
  3. package/dist/anta_helpers.js +18 -0
  4. package/dist/box-types.d.ts +1 -1
  5. package/dist/bundle.css +1 -1
  6. package/dist/bundle.js +36 -42
  7. package/dist/capture-types.d.ts +156 -0
  8. package/dist/components/Banner.js +2 -2
  9. package/dist/components/Box.d.ts +15 -0
  10. package/dist/components/Box.js +3 -11
  11. package/dist/components/Button.js +2 -2
  12. package/dist/components/Capture.d.ts +39 -0
  13. package/dist/components/Capture.js +36 -0
  14. package/dist/components/Card.js +2 -2
  15. package/dist/components/Checkbox.d.ts +10 -11
  16. package/dist/components/Checkbox.js +5 -13
  17. package/dist/components/Expander.js +2 -2
  18. package/dist/components/Input.js +2 -2
  19. package/dist/components/InputTime.js +2 -2
  20. package/dist/components/Loader.js +2 -1
  21. package/dist/components/MenuItem.d.ts +7 -8
  22. package/dist/components/MenuItem.js +4 -4
  23. package/dist/components/Progress.js +2 -2
  24. package/dist/components/RadioGroup.d.ts +12 -13
  25. package/dist/components/RadioGroup.js +7 -23
  26. package/dist/components/Select.d.ts +12 -7
  27. package/dist/components/Select.js +4 -3
  28. package/dist/components/SelectFaceted.d.ts +7 -5
  29. package/dist/components/SelectFaceted.js +4 -3
  30. package/dist/components/Slider.js +3 -3
  31. package/dist/components/Steps.css +1 -1
  32. package/dist/components/Switch.d.ts +7 -8
  33. package/dist/components/Switch.js +3 -11
  34. package/dist/components/Tabs.js +2 -2
  35. package/dist/components/Tag.d.ts +7 -9
  36. package/dist/components/Tag.js +2 -2
  37. package/dist/components/Text.js +2 -2
  38. package/dist/components/Title.js +2 -2
  39. package/dist/components/capture-props.d.ts +30 -0
  40. package/dist/components/capture-props.js +44 -0
  41. package/dist/elements/a-avatar.css +1 -1
  42. package/dist/elements/a-banner.css +1 -1
  43. package/dist/elements/a-box.d.ts +1 -1
  44. package/dist/elements/a-box.js +11 -3
  45. package/dist/elements/a-button.css +1 -1
  46. package/dist/elements/a-button.d.ts +7 -9
  47. package/dist/elements/a-calendar.css +1 -1
  48. package/dist/elements/a-capture.css +1 -0
  49. package/dist/elements/a-capture.d.ts +10 -0
  50. package/dist/elements/a-capture.js +24 -0
  51. package/dist/elements/a-card.css +1 -1
  52. package/dist/elements/a-checkbox.css +1 -1
  53. package/dist/elements/a-checkbox.js +4 -4
  54. package/dist/elements/a-dialog.css +1 -1
  55. package/dist/elements/a-expander.css +1 -1
  56. package/dist/elements/a-expander.js +1 -0
  57. package/dist/elements/a-input-time.css +1 -1
  58. package/dist/elements/a-input-time.js +5 -7
  59. package/dist/elements/a-input.css +1 -1
  60. package/dist/elements/a-input.js +4 -6
  61. package/dist/elements/a-menu-item.css +1 -1
  62. package/dist/elements/a-menu.css +1 -1
  63. package/dist/elements/a-progress.css +1 -1
  64. package/dist/elements/a-radio.css +1 -1
  65. package/dist/elements/a-slider.css +1 -1
  66. package/dist/elements/a-slider.js +6 -9
  67. package/dist/elements/a-switch.css +1 -1
  68. package/dist/elements/a-tab.css +1 -1
  69. package/dist/elements/a-tabs.css +1 -1
  70. package/dist/elements/a-tag.css +1 -1
  71. package/dist/elements/a-text.css +1 -1
  72. package/dist/elements/a-text.js +1 -0
  73. package/dist/elements/a-title.css +1 -1
  74. package/dist/elements/a-tooltip.css +1 -1
  75. package/dist/elements/a-tooltip.d.ts +3 -4
  76. package/dist/elements/a-tooltip.js +0 -1
  77. package/dist/elements/capture-input.d.ts +5 -0
  78. package/dist/elements/capture-input.js +609 -0
  79. package/dist/elements/index.d.ts +1 -0
  80. package/dist/elements/index.js +3 -0
  81. package/dist/general_types.d.ts +56 -23
  82. package/dist/index.d.ts +4 -1
  83. package/dist/index.js +2 -0
  84. package/dist/jsx-runtime.d.ts +2 -1
  85. package/dist/reset.css +1 -1
  86. package/dist/theme-antithesis.css +1 -0
  87. package/dist/theme-antune.css +1 -0
  88. package/dist/tokens.css +1 -1
  89. package/docs/accessibility.md +24 -0
  90. package/docs/changelog.md +79 -0
  91. package/docs/colors.md +141 -0
  92. package/docs/comparison.md +463 -28
  93. package/docs/components/avatar.md +13 -17
  94. package/docs/components/banner.md +13 -27
  95. package/docs/components/box.md +226 -154
  96. package/docs/components/breadcrumbs.md +49 -12
  97. package/docs/components/button.md +48 -37
  98. package/docs/components/capture.md +345 -0
  99. package/docs/components/card.md +17 -38
  100. package/docs/components/checkbox.md +27 -50
  101. package/docs/components/dialog.md +14 -36
  102. package/docs/components/expander.md +15 -40
  103. package/docs/components/icon.md +111 -9
  104. package/docs/components/input-autocomplete.md +9 -11
  105. package/docs/components/input-date.md +33 -23
  106. package/docs/components/input-time.md +15 -23
  107. package/docs/components/input.md +27 -76
  108. package/docs/components/loader.md +7 -5
  109. package/docs/components/menu.md +75 -80
  110. package/docs/components/progress.md +10 -14
  111. package/docs/components/radio.md +28 -46
  112. package/docs/components/select-faceted.md +8 -25
  113. package/docs/components/select.md +33 -105
  114. package/docs/components/slider.md +16 -21
  115. package/docs/components/steps.md +38 -8
  116. package/docs/components/switch.md +16 -19
  117. package/docs/components/tabs.md +52 -40
  118. package/docs/components/tag.md +15 -24
  119. package/docs/components/text.md +10 -23
  120. package/docs/components/title.md +7 -8
  121. package/docs/components/toaster.md +6 -3
  122. package/docs/components/tooltip.md +13 -23
  123. package/docs/index.md +3 -1
  124. package/docs/install-config.md +42 -8
  125. package/docs/normalization.md +48 -3
  126. package/docs/packages/stickers.md +56 -0
  127. package/docs/theming.md +362 -14
  128. package/package.json +7 -4
  129. package/dist/components/InputDate.module.css +0 -1
  130. package/dist/components/Select.module.css +0 -1
  131. package/dist/components/SelectFaceted.module.css +0 -1
  132. package/dist/theme-anta.css +0 -1
  133. /package/dist/{search-index.json → capture-types.js} +0 -0
@@ -16,9 +16,9 @@ import '@antadesign/anta/elements' // web components (client-side only)
16
16
 
17
17
  ### Structural reset
18
18
 
19
- - `html` uses `--sans-serif`, `--text-2`, 22px leading, and `color-scheme`.
20
- `.dark` selects dark mode; `.light` restores it in a dark subtree. `body` paints
21
- `--bg-2`, including the browser canvas.
19
+ - `html` uses `--sans-serif`, `--text-2`, and 22px leading. `body` paints
20
+ `--bg-2`, including the browser canvas. `color-scheme` comes from `tokens.css`,
21
+ where `.dark` selects dark mode and `.light` restores it in a dark subtree.
22
22
  - `box-sizing: border-box` on every element (and `::before` / `::after`).
23
23
  - `margin: 0` on everything — apps build spacing from explicit values.
24
24
  - Replaced elements (`img`, `picture`, `video`, `canvas`, `svg`) → `display: block` + `max-width: 100%`, so a stray large asset can't blow out the layout.
@@ -105,7 +105,52 @@ Or import both and override only the pieces you want (unlayered, or in a later l
105
105
  The reset gives headings, lists, links, and tables the same baseline as Anta
106
106
  components. Omit it when your own reset should control them.
107
107
 
108
+ ## Default HTML tags
109
+
108
110
  Tags styled by the reset, rendered live.
109
111
 
112
+ This specimen shows the native tags styled by `reset.css`:
113
+
114
+ ```html
115
+ <div class="specimen">
116
+ <h2>Heading two</h2>
117
+ <h3>Heading three</h3>
118
+ <h4>Heading four</h4>
119
+ <p>
120
+ Body text with <a href="/normalization">a link</a>, <strong>strong</strong>,
121
+ <em>em</em>, <code>inline code</code>, <kbd>Ctrl</kbd>, <samp>samp output</samp>,
122
+ <dfn>a defined term</dfn>, <small>small print</small>, <mark>mark</mark>,
123
+ <abbr title="Cascading Style Sheets">abbr</abbr>, <del>deleted</del>,
124
+ <ins>inserted</ins>, the variable <var>w</var>, H<sub>2</sub>O and x<sup>2</sup>.
125
+ </p>
126
+ <blockquote>A blockquote, marked by a rule rather than an indent.</blockquote>
127
+ <ul>
128
+ <li>Unordered item</li>
129
+ <li>Second item</li>
130
+ </ul>
131
+ <ol>
132
+ <li>Ordered item</li>
133
+ <li>Second item</li>
134
+ </ol>
135
+ <dl>
136
+ <dt>Term</dt>
137
+ <dd>Definition</dd>
138
+ </dl>
139
+ <pre><code>a code block</code></pre>
140
+ <table>
141
+ <caption>Table caption</caption>
142
+ <thead>
143
+ <tr><th>Header</th><th>Another</th></tr>
144
+ </thead>
145
+ <tbody>
146
+ <tr><td>Cell</td><td>Cell</td></tr>
147
+ <tr><td>Cell</td><td>Cell</td></tr>
148
+ </tbody>
149
+ </table>
150
+ <figure><figcaption>A figcaption</figcaption></figure>
151
+ <hr />
152
+ </div>
153
+ ```
154
+
110
155
  `abbr`, `q`, and `cite` keep browser typographic styles. `dd` has no browser indent
111
156
  because the reset clears margins. The reset adds no `kbd` typography.
@@ -21,6 +21,60 @@ npm install @antadesign/stickers # pulls @antadesign/anta + lottie-web
21
21
 
22
22
  The full set is also published as a [Telegram sticker pack](https://t.me/addstickers/SnoutyAntithesis).
23
23
 
24
+ ## Available stickers
25
+
26
+ | Name | Static export | Animated export | Asset imports |
27
+ | --- | --- | --- | --- |
28
+ | Angry | `StickerAngry` | `StickerAngryAnimated` | `@antadesign/stickers/angry`, `@antadesign/stickers/angry-animated` |
29
+ | Ask | `StickerAsk` | `StickerAskAnimated` | `@antadesign/stickers/ask`, `@antadesign/stickers/ask-animated` |
30
+ | Balance | `StickerBalance` | `StickerBalanceAnimated` | `@antadesign/stickers/balance`, `@antadesign/stickers/balance-animated` |
31
+ | Butterfly | `StickerButterfly` | `StickerButterflyAnimated` | `@antadesign/stickers/butterfly`, `@antadesign/stickers/butterfly-animated` |
32
+ | ButterflySnake | `StickerButterflySnake` | `StickerButterflySnakeAnimated` | `@antadesign/stickers/butterfly-snake`, `@antadesign/stickers/butterfly-snake-animated` |
33
+ | Catch | `StickerCatch` | `StickerCatchAnimated` | `@antadesign/stickers/catch`, `@antadesign/stickers/catch-animated` |
34
+ | Clap | `StickerClap` | `StickerClapAnimated` | `@antadesign/stickers/clap`, `@antadesign/stickers/clap-animated` |
35
+ | Coding | `StickerCoding` | `StickerCodingAnimated` | `@antadesign/stickers/coding`, `@antadesign/stickers/coding-animated` |
36
+ | Cowboy | `StickerCowboy` | `StickerCowboyAnimated` | `@antadesign/stickers/cowboy`, `@antadesign/stickers/cowboy-animated` |
37
+ | Dance | `StickerDance` | `StickerDanceAnimated` | `@antadesign/stickers/dance`, `@antadesign/stickers/dance-animated` |
38
+ | Detective | `StickerDetective` | `StickerDetectiveAnimated` | `@antadesign/stickers/detective`, `@antadesign/stickers/detective-animated` |
39
+ | Disapprove | `StickerDisapprove` | `StickerDisapproveAnimated` | `@antadesign/stickers/disapprove`, `@antadesign/stickers/disapprove-animated` |
40
+ | Distracted | `StickerDistracted` | `StickerDistractedAnimated` | `@antadesign/stickers/distracted`, `@antadesign/stickers/distracted-animated` |
41
+ | Dive | `StickerDive` | `StickerDiveAnimated` | `@antadesign/stickers/dive`, `@antadesign/stickers/dive-animated` |
42
+ | Eat | `StickerEat` | `StickerEatAnimated` | `@antadesign/stickers/eat`, `@antadesign/stickers/eat-animated` |
43
+ | Facepalm | `StickerFacepalm` | `StickerFacepalmAnimated` | `@antadesign/stickers/facepalm`, `@antadesign/stickers/facepalm-animated` |
44
+ | Failed | `StickerFailed` | `StickerFailedAnimated` | `@antadesign/stickers/failed`, `@antadesign/stickers/failed-animated` |
45
+ | Found | `StickerFound` | `StickerFoundAnimated` | `@antadesign/stickers/found`, `@antadesign/stickers/found-animated` |
46
+ | Grow | `StickerGrow` | `StickerGrowAnimated` | `@antadesign/stickers/grow`, `@antadesign/stickers/grow-animated` |
47
+ | Handstand | `StickerHandstand` | `StickerHandstandAnimated` | `@antadesign/stickers/handstand`, `@antadesign/stickers/handstand-animated` |
48
+ | Heart | `StickerHeart` | `StickerHeartAnimated` | `@antadesign/stickers/heart`, `@antadesign/stickers/heart-animated` |
49
+ | Hello | `StickerHello` | `StickerHelloAnimated` | `@antadesign/stickers/hello`, `@antadesign/stickers/hello-animated` |
50
+ | Idea | `StickerIdea` | `StickerIdeaAnimated` | `@antadesign/stickers/idea`, `@antadesign/stickers/idea-animated` |
51
+ | Laugh | `StickerLaugh` | `StickerLaughAnimated` | `@antadesign/stickers/laugh`, `@antadesign/stickers/laugh-animated` |
52
+ | Love | `StickerLove` | `StickerLoveAnimated` | `@antadesign/stickers/love`, `@antadesign/stickers/love-animated` |
53
+ | Nap | `StickerNap` | `StickerNapAnimated` | `@antadesign/stickers/nap`, `@antadesign/stickers/nap-animated` |
54
+ | Party | `StickerParty` | `StickerPartyAnimated` | `@antadesign/stickers/party`, `@antadesign/stickers/party-animated` |
55
+ | Passed | `StickerPassed` | `StickerPassedAnimated` | `@antadesign/stickers/passed`, `@antadesign/stickers/passed-animated` |
56
+ | Peekaboo | `StickerPeekaboo` | `StickerPeekabooAnimated` | `@antadesign/stickers/peekaboo`, `@antadesign/stickers/peekaboo-animated` |
57
+ | Pizza | `StickerPizza` | `StickerPizzaAnimated` | `@antadesign/stickers/pizza`, `@antadesign/stickers/pizza-animated` |
58
+ | Puzzle | `StickerPuzzle` | `StickerPuzzleAnimated` | `@antadesign/stickers/puzzle`, `@antadesign/stickers/puzzle-animated` |
59
+ | Sad | `StickerSad` | `StickerSadAnimated` | `@antadesign/stickers/sad`, `@antadesign/stickers/sad-animated` |
60
+ | Scared | `StickerScared` | `StickerScaredAnimated` | `@antadesign/stickers/scared`, `@antadesign/stickers/scared-animated` |
61
+ | Scroll | `StickerScroll` | `StickerScrollAnimated` | `@antadesign/stickers/scroll`, `@antadesign/stickers/scroll-animated` |
62
+ | Search | `StickerSearch` | `StickerSearchAnimated` | `@antadesign/stickers/search`, `@antadesign/stickers/search-animated` |
63
+ | Shield | `StickerShield` | `StickerShieldAnimated` | `@antadesign/stickers/shield`, `@antadesign/stickers/shield-animated` |
64
+ | Shocked | `StickerShocked` | `StickerShockedAnimated` | `@antadesign/stickers/shocked`, `@antadesign/stickers/shocked-animated` |
65
+ | Sleep | `StickerSleep` | `StickerSleepAnimated` | `@antadesign/stickers/sleep`, `@antadesign/stickers/sleep-animated` |
66
+ | Stressed | `StickerStressed` | `StickerStressedAnimated` | `@antadesign/stickers/stressed`, `@antadesign/stickers/stressed-animated` |
67
+ | Suspicious | `StickerSuspicious` | `StickerSuspiciousAnimated` | `@antadesign/stickers/suspicious`, `@antadesign/stickers/suspicious-animated` |
68
+ | Thanks | `StickerThanks` | `StickerThanksAnimated` | `@antadesign/stickers/thanks`, `@antadesign/stickers/thanks-animated` |
69
+ | Think | `StickerThink` | `StickerThinkAnimated` | `@antadesign/stickers/think`, `@antadesign/stickers/think-animated` |
70
+ | ThinkOfYou | `StickerThinkOfYou` | `StickerThinkOfYouAnimated` | `@antadesign/stickers/think-of-you`, `@antadesign/stickers/think-of-you-animated` |
71
+ | ThumbsUp | `StickerThumbsUp` | `StickerThumbsUpAnimated` | `@antadesign/stickers/thumbs-up`, `@antadesign/stickers/thumbs-up-animated` |
72
+ | Vacation | `StickerVacation` | `StickerVacationAnimated` | `@antadesign/stickers/vacation`, `@antadesign/stickers/vacation-animated` |
73
+ | Wait | `StickerWait` | `StickerWaitAnimated` | `@antadesign/stickers/wait`, `@antadesign/stickers/wait-animated` |
74
+ | Wink | `StickerWink` | `StickerWinkAnimated` | `@antadesign/stickers/wink`, `@antadesign/stickers/wink-animated` |
75
+ | Work | `StickerWork` | `StickerWorkAnimated` | `@antadesign/stickers/work`, `@antadesign/stickers/work-animated` |
76
+ | Zen | `StickerZen` | `StickerZenAnimated` | `@antadesign/stickers/zen`, `@antadesign/stickers/zen-animated` |
77
+
24
78
  ## Props
25
79
 
26
80
  Both flavors share the same base props; the animated flavor adds playback props.
@@ -45,6 +99,8 @@ Same as the static base, plus:
45
99
  | `playOnce?` | `boolean` | Plays once and holds the final frame instead of looping. |
46
100
  | `replayOnClick?` | `boolean` | With `playOnce`, lets people click or press Enter/Space to replay the animation. The sticker becomes a labeled button. |
47
101
 
102
+ ## Web Component
103
+
48
104
  Use the web component directly when you are not using React or Preact and a native control does not fit.
49
105
 
50
106
  Pass the generated SVG payload to `<a-sticker>` and set a size through
package/docs/theming.md CHANGED
@@ -1,21 +1,86 @@
1
1
  # Theming
2
2
 
3
- ## Reference palette
3
+ Anta works without a theme. Customize individual components through their props
4
+ or with classes in your application CSS.
4
5
 
5
- `@antadesign/anta` ships an optional hand-tuned reference palette at
6
- `@antadesign/anta/theme-anta.css`. Import it after the tokens, reset, and element
7
- registration imports to replace the seed-derived default:
6
+ When an application needs many customizations or a global change to Anta's look
7
+ and feel, add a theme stylesheet. Import one theme after the package styles:
8
8
 
9
9
  ```ts
10
- import '@antadesign/anta/tokens.css'
11
- import '@antadesign/anta/reset.css'
12
- import '@antadesign/anta/elements'
13
- import '@antadesign/anta/theme-anta.css'
10
+ import '@antadesign/anta/theme-antune.css' // Choose one theme included in the package.
14
11
  ```
15
12
 
16
- Omit the final import to use the default palette, or define your own theme.
13
+ <a id="fonts-in-a-theme"></a>
17
14
 
18
- Anta's palette is generative. Every color in the system derives from six tone seeds (`--anta-seed-neutral`, `--anta-seed-brand`, `--anta-seed-info`, …), and a seed contributes only its hue: the lightness and chroma of every background, text, border, and component state come from Anta's formulas, tuned per role and per theme. Reskinning a tone is one custom property, and the whole scale re-derives in both light and dark:
15
+ ## Fonts in a theme
16
+
17
+ Without a reference theme, `tokens.css` defines three system font stacks:
18
+
19
+ ```css
20
+ :root, .light {
21
+ --sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
22
+ Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
23
+ --serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
24
+ --monospace: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco,
25
+ Consolas, "Liberation Mono", monospace;
26
+ }
27
+ ```
28
+
29
+ Components and theme rules choose which variable to use. For example, body text
30
+ can use `--sans-serif` while a particular title style uses `--serif`. Without a
31
+ theme, Anta does not force font-specific stylistic sets or variable-font axes.
32
+
33
+ You can register your fonts and redefine the stacks in a custom theme stylesheet
34
+ such as `theme.css`:
35
+
36
+ ```css
37
+ /* theme.css */
38
+ @font-face {
39
+ font-family: "App Sans";
40
+ src: url("/fonts/app-sans.woff2") format("woff2");
41
+ font-style: normal;
42
+ font-weight: 100 900;
43
+ font-display: swap;
44
+ }
45
+
46
+ :root {
47
+ --sans-serif: "App Sans", system-ui, sans-serif;
48
+ --serif: Georgia, serif;
49
+ --monospace: ui-monospace, monospace;
50
+ }
51
+ ```
52
+
53
+ The **Antune** and **Antithesis** themes included with Anta use custom fonts that
54
+ require separate licenses. If your application does not have those licenses,
55
+ redefine all three font variables as shown above.
56
+
57
+ ```css
58
+ /* theme.css */
59
+ @import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=JetBrains+Mono:wght@400;600&family=Source+Serif+4:wght@400;600&display=swap");
60
+
61
+ :root {
62
+ --sans-serif: "Inter", sans-serif;
63
+ --serif: "Source Serif 4", serif;
64
+ --monospace: "JetBrains Mono", monospace;
65
+ }
66
+ ```
67
+
68
+ After you redefine these three variables, the theme fonts are not used or
69
+ downloaded (exactly what we want in this case).
70
+
71
+ <a id="color-seeds"></a>
72
+
73
+ ## Color seeds
74
+
75
+ In your custom theme, override any of Anta's six seed color tokens to recolor
76
+ components. These overrides can live in any application stylesheet:
77
+
78
+ - `--anta-seed-neutral`
79
+ - `--anta-seed-brand`
80
+ - `--anta-seed-info`
81
+ - `--anta-seed-success`
82
+ - `--anta-seed-warning`
83
+ - `--anta-seed-critical`
19
84
 
20
85
  ```css
21
86
  :root {
@@ -23,9 +88,292 @@ Anta's palette is generative. Every color in the system derives from six tone se
23
88
  }
24
89
  ```
25
90
 
26
- Anta's styles use ordered child layers inside `@layer anta`. Your unlayered CSS
27
- overrides them without `!important`, and shadow-DOM components expose
28
- `::part(...)`. A component's `tone` accepts a named tone or CSS color and derives
29
- its rest, hover, and active values. Each component page lists its styling hooks.
91
+ For more control, customize the `--text-*`, `--bg-*`, and `--border-*` tokens
92
+ separately for light and dark modes.
93
+
94
+ Anta's styles use ordered child layers inside `@layer anta`. Your regular
95
+ unlayered CSS overrides them without `!important`.
96
+
97
+ <a id="themes"></a>
98
+
99
+ ## Themes
100
+
101
+ Compare the same components across themes. Select a tab to preview the theme and
102
+ read its stylesheet.
103
+
104
+ <a id="theming-lab"></a>
105
+
106
+ ## Theming lab
30
107
 
31
108
  The lab below shows the derivation live. For each toned component, the shipped Default sits next to a Custom preview driven by the seed picker, with the formula constants editable and the resolved CSS shown.
109
+
110
+
111
+ ## Theming lab reference
112
+
113
+ The lab varies a tone seed and formula inputs in light and dark mode. These inputs describe the lab's calculations. For application styling, use tone props, global role tokens, CSS, and the parts documented on each component page.
114
+
115
+ | Tone | Seed property | Initial lab seed |
116
+ | --- | --- | --- |
117
+ | neutral | `--anta-seed-neutral` | `#635b65` |
118
+ | brand | `--anta-seed-brand` | `#5f4bc3` |
119
+ | info | `--anta-seed-info` | `#1f6eb2` |
120
+ | success | `--anta-seed-success` | `#2a7e43` |
121
+ | warning | `--anta-seed-warning` | `#c37416` |
122
+ | critical | `--anta-seed-critical` | `#c9302c` |
123
+
124
+ ### Background and Borders
125
+
126
+ The container background and border role scales, derived from the source hue. Backgrounds sit near the page lightness with a faint tint that grows per step; borders step down in lightness from a saturated edge (border-1) to the faint bg-5, chroma easing off as they lighten. Neutral zeroes chroma to stay grey.
127
+
128
+ #### Background
129
+
130
+ | Input | Toned light | Toned dark | Neutral light | Neutral dark | Range | Step | Meaning |
131
+ | --- | --- | --- | --- | --- | --- | --- | --- |
132
+ | bg-1 L | 1 | 0 | 1 | 0 | 0–1 | 0.005 | |
133
+ | bg-2 L | 0.99 | 0.13 | 0.985 | 0.16 | 0–1 | 0.005 | |
134
+ | bg-2 C | 0.004 | 0.02 | 0.002 | 0.002 | 0–0.4 | 0.005 | |
135
+ | bg-3 L | 0.972 | 0.17 | 0.97 | 0.177 | 0–1 | 0.005 | |
136
+ | bg-3 C | 0.011 | 0.035 | 0.004 | 0.005 | 0–0.4 | 0.005 | |
137
+ | bg-4 L | 0.955 | 0.185 | 0.954 | 0.191 | 0–1 | 0.005 | |
138
+ | bg-4 C | 0.02 | 0.05 | 0.004 | 0.006 | 0–0.4 | 0.005 | |
139
+ | bg-5 L | 0.935 | 0.205 | 0.935 | 0.2 | 0–1 | 0.005 | |
140
+ | bg-5 C | 0.03 | 0.055 | 0.006 | 0.009 | 0–0.4 | 0.005 | |
141
+
142
+ #### Border
143
+
144
+ | Input | Toned light | Toned dark | Neutral light | Neutral dark | Range | Step | Meaning |
145
+ | --- | --- | --- | --- | --- | --- | --- | --- |
146
+ | border-1 L | 0.67 | 0.52 | 0.67 | 0.52 | 0–1 | 0.005 | |
147
+ | border-1 C | 0.13 | 0.15 | 0.008 | 0.008 | 0–0.4 | 0.005 | |
148
+ | border-2 L | 0.8 | 0.41 | 0.8 | 0.41 | 0–1 | 0.005 | |
149
+ | border-2 C | 0.09 | 0.12 | 0.008 | 0.008 | 0–0.4 | 0.005 | |
150
+ | border-3 L | 0.86 | 0.33 | 0.86 | 0.33 | 0–1 | 0.005 | |
151
+ | border-3 C | 0.055 | 0.09 | 0.008 | 0.008 | 0–0.4 | 0.005 | |
152
+ | border-4 L | 0.9 | 0.26 | 0.9 | 0.26 | 0–1 | 0.005 | |
153
+ | border-4 C | 0.04 | 0.06 | 0.008 | 0.008 | 0–0.4 | 0.005 | |
154
+ | border-5 L | 0.935 | 0.21 | 0.935 | 0.21 | 0–1 | 0.005 | |
155
+ | border-5 C | 0.028 | 0.045 | 0.008 | 0.008 | 0–0.4 | 0.005 | |
156
+
157
+ ### Text
158
+
159
+ The text color role scale, derived from the source hue. text-1 is the strong primary; text-2 the base (secondary); text-3/4 step text-2 down by alpha — Title and Text read text-1..4 as their priorities. text-5 is the faintest step (text-2 at a lower alpha), used for disabled / hint text across components, not a Title/Text priority.
160
+
161
+ #### Primary
162
+
163
+ text-1.
164
+
165
+ | Input | Toned light | Toned dark | Neutral light | Neutral dark | Range | Step | Meaning |
166
+ | --- | --- | --- | --- | --- | --- | --- | --- |
167
+ | text-1 L | 0.38 | 0.85 | 0.1 | 0.94 | 0–1 | 0.005 | |
168
+ | text-1 C | 0.11 | 0.1 | 0.01 | 0.008 | 0–0.4 | 0.005 | |
169
+
170
+ #### Secondary
171
+
172
+ text-2 base.
173
+
174
+ | Input | Toned light | Toned dark | Neutral light | Neutral dark | Range | Step | Meaning |
175
+ | --- | --- | --- | --- | --- | --- | --- | --- |
176
+ | text-2 L | 0.43 | 0.77 | 0.3 | 0.8 | 0–1 | 0.005 | |
177
+ | text-2 C | 0.15 | 0.11 | 0.015 | 0.015 | 0–0.4 | 0.005 | |
178
+
179
+ #### Tertiary
180
+
181
+ text-2 base at this alpha (→ text-3).
182
+
183
+ | Input | Toned light | Toned dark | Neutral light | Neutral dark | Range | Step | Meaning |
184
+ | --- | --- | --- | --- | --- | --- | --- | --- |
185
+ | text-3 α % | 82 | 80 | 82 | 80 | 0–100 | 1 | |
186
+
187
+ #### Quaternary
188
+
189
+ text-2 base at this alpha (→ text-4).
190
+
191
+ | Input | Toned light | Toned dark | Neutral light | Neutral dark | Range | Step | Meaning |
192
+ | --- | --- | --- | --- | --- | --- | --- | --- |
193
+ | text-4 α % | 60 | 60 | 60 | 60 | 0–100 | 1 | |
194
+
195
+ #### Faint (text-5)
196
+
197
+ text-2 base at this alpha (→ text-5) — the disabled / hint step, not a Title/Text priority.
198
+
199
+ | Input | Toned light | Toned dark | Neutral light | Neutral dark | Range | Step | Meaning |
200
+ | --- | --- | --- | --- | --- | --- | --- | --- |
201
+ | text-5 α % | 40 | 40 | 40 | 40 | 0–100 | 1 | |
202
+
203
+ ### Buttons
204
+
205
+ Primary is the source fill at three lightnesses. Secondary, tertiary, and quaternary share one foreground; secondary and tertiary share an alpha-tinted fill (tertiary a step softer, transparent at rest), quaternary has none. Secondary’s label subtracts an l-shift to read a step stronger than its tint.
206
+
207
+ #### Primary
208
+
209
+ | Input | Toned light | Toned dark | Neutral light | Neutral dark | Range | Step | Meaning |
210
+ | --- | --- | --- | --- | --- | --- | --- | --- |
211
+ | L rest | 0.51 | 0.4 | 0.5 | 0.4 | 0–1 | 0.005 | |
212
+ | L hover | 0.46 | 0.44 | 0.45 | 0.44 | 0–1 | 0.005 | |
213
+ | L active | 0.41 | 0.48 | 0.4 | 0.48 | 0–1 | 0.005 | |
214
+ | fill C | 0.17 | 0.16 | 0.02 | 0.015 | 0–0.4 | 0.005 | One chroma for the primary fill across rest/hover/active. Neutral pins it near-grey; toned versions set the saturation here instead of inheriting the seed’s own chroma. |
215
+
216
+ #### Secondary
217
+
218
+ | Input | Toned light | Toned dark | Neutral light | Neutral dark | Range | Step | Meaning |
219
+ | --- | --- | --- | --- | --- | --- | --- | --- |
220
+ | fg L | 0.46 | 0.86 | 0.46 | 0.86 | 0–1 | 0.005 | |
221
+ | fg L hover | 0.4 | 0.86 | 0.4 | 0.86 | 0–1 | 0.005 | |
222
+ | fg C | 0.17 | 0.13 | 0.008 | 0.015 | 0–0.4 | 0.005 | |
223
+ | fg l-shift | 0.05 | 0 | 0.05 | 0 | 0–0.3 | 0.005 | Subtracted from the secondary label’s OKLCH lightness so it reads one step stronger than the tint behind it. |
224
+ | tint L | 0.54 | 0.58 | 0.54 | 0.44 | 0–1 | 0.005 | |
225
+ | tint C | 0.17 | 0.16 | 0.03 | 0.01 | 0–0.4 | 0.005 | |
226
+ | α rest | 0.1 | 0.215 | 0.1 | 0.24 | 0–1 | 0.005 | |
227
+ | α hover | 0.15 | 0.29 | 0.15 | 0.34 | 0–1 | 0.005 | |
228
+ | α active | 0.2 | 0.34 | 0.2 | 0.44 | 0–1 | 0.005 | |
229
+
230
+ #### Tertiary
231
+
232
+ Reuses the secondary foreground + tint (no separate Anta constant).
233
+
234
+ | Input | Toned light | Toned dark | Neutral light | Neutral dark | Range | Step | Meaning |
235
+ | --- | --- | --- | --- | --- | --- | --- | --- |
236
+ | fg L | 0.46 | 0.86 | 0.46 | 0.86 | 0–1 | 0.005 | |
237
+ | fg L hover | 0.4 | 0.86 | 0.4 | 0.86 | 0–1 | 0.005 | |
238
+ | fg C | 0.17 | 0.13 | 0.008 | 0.015 | 0–0.4 | 0.005 | |
239
+ | tint L | 0.54 | 0.58 | 0.54 | 0.44 | 0–1 | 0.005 | |
240
+ | tint C | 0.17 | 0.16 | 0.03 | 0.01 | 0–0.4 | 0.005 | |
241
+ | α rest | 0.1 | 0.215 | 0.1 | 0.24 | 0–1 | 0.005 | |
242
+ | α hover | 0.15 | 0.29 | 0.15 | 0.34 | 0–1 | 0.005 | |
243
+
244
+ #### Quaternary
245
+
246
+ Rest (and active) is the tertiary foreground at the rest α; hover uses its own detached lightness at full opacity. No fill.
247
+
248
+ | Input | Toned light | Toned dark | Neutral light | Neutral dark | Range | Step | Meaning |
249
+ | --- | --- | --- | --- | --- | --- | --- | --- |
250
+ | fg L | 0.46 | 0.86 | 0.46 | 0.86 | 0–1 | 0.005 | |
251
+ | fg C | 0.17 | 0.13 | 0.008 | 0.015 | 0–0.4 | 0.005 | |
252
+ | hover L | 0.38 | 0.9 | 0.38 | 0.9 | 0–1 | 0.005 | Quaternary hover lightness, detached from tertiary — its own value, not the shared secondary fg-hover. Rest and active carry the rest α; hover is opaque. |
253
+ | α rest | 0.85 | 0.85 | 0.85 | 0.85 | 0–1 | 0.005 | Alpha on the quaternary rest (and active) foreground. Light-mode neutral needs ≈0.83 to clear WCAG AA (4.5:1) over bg-2. |
254
+
255
+ ### Tags
256
+
257
+ Primary is a solid fill; secondary an alpha tint of the tint hue; tertiary an outline. The label and edge are the Text scale — edge = --text-2, label = --text-2 at the label α (80 → --text-3), tunable per Tag (e.g. raise it for small-text contrast). The tint and solid fill are the Tag’s own (source hue at these L/C); alphas set each priority’s strength.
258
+
259
+ #### Primary
260
+
261
+ Solid fill; white label.
262
+
263
+ | Input | Toned light | Toned dark | Neutral light | Neutral dark | Range | Step | Meaning |
264
+ | --- | --- | --- | --- | --- | --- | --- | --- |
265
+ | solid L | 0.58 | 0.46 | 0.55 | 0.48 | 0–1 | 0.005 | |
266
+ | solid C | 0.175 | 0.165 | 0.015 | 0.015 | 0–0.4 | 0.005 | Chroma of the primary solid fill, independent of the secondary tint’s C. Neutral pins it near-grey. |
267
+
268
+ #### Secondary
269
+
270
+ | Input | Toned light | Toned dark | Neutral light | Neutral dark | Range | Step | Meaning |
271
+ | --- | --- | --- | --- | --- | --- | --- | --- |
272
+ | tint L | 0.57 | 0.63 | 0.55 | 0.63 | 0–1 | 0.005 | |
273
+ | tint C | 0.16 | 0.17 | 0.03 | 0.04 | 0–0.4 | 0.005 | |
274
+ | fill α % | 10 | 20 | 10 | 20 | 0–100 | 1 | |
275
+ | border α % | 15 | 25 | 15 | 25 | 0–100 | 1 | |
276
+
277
+ #### Tertiary
278
+
279
+ Outline alpha; the edge color is --text-2.
280
+
281
+ | Input | Toned light | Toned dark | Neutral light | Neutral dark | Range | Step | Meaning |
282
+ | --- | --- | --- | --- | --- | --- | --- | --- |
283
+ | edge α % | 20 | 30 | 20 | 30 | 0–100 | 1 | |
284
+
285
+ #### Label
286
+
287
+ Label = --text-2 at this alpha (80 → --text-3). Raise for small-text contrast.
288
+
289
+ | Input | Toned light | Toned dark | Neutral light | Neutral dark | Range | Step | Meaning |
290
+ | --- | --- | --- | --- | --- | --- | --- | --- |
291
+ | label α % | 80 | 80 | 80 | 80 | 0–100 | 1 | |
292
+
293
+ ### Tabs
294
+
295
+ The strip’s primary/secondary/tertiary differ structurally (filled track vs subtle vs underline). Labels and rings are the role scale: selected/hover = --text-1, rest = --text-2 at the rest α (80 → --text-3), tertiary hover = --text-2, track ring = --border-4, selected ring = --border-2, selected pill = --bg-1. Only the recessed track tint, secondary fill, and the rest α are the Tabs’ own — the knobs below.
296
+
297
+ #### Track & fill
298
+
299
+ The recessed track tint (primary) and the selected secondary fill — a faint overlay of the source hue.
300
+
301
+ | Input | Toned light | Toned dark | Neutral light | Neutral dark | Range | Step | Meaning |
302
+ | --- | --- | --- | --- | --- | --- | --- | --- |
303
+ | fill L | 0.55 | 0.8 | 0.55 | 0.8 | 0–1 | 0.005 | |
304
+ | fill C | 0.14 | 0.12 | 0.008 | 0.008 | 0–0.4 | 0.005 | |
305
+ | track α | 0.06 | 0.07 | 0.06 | 0.07 | 0–1 | 0.005 | |
306
+ | fill α | 0.03 | 0.08 | 0.03 | 0.08 | 0–1 | 0.005 | |
307
+
308
+ #### Rest label
309
+
310
+ Non-selected label = --text-2 at this alpha (80 → --text-3). Selected/hover use full --text-1.
311
+
312
+ | Input | Toned light | Toned dark | Neutral light | Neutral dark | Range | Step | Meaning |
313
+ | --- | --- | --- | --- | --- | --- | --- | --- |
314
+ | rest α % | 80 | 80 | 80 | 80 | 0–100 | 1 | |
315
+
316
+ ### Checkboxes
317
+
318
+ Hoisted to --_tone-l-* inputs: the checked fill is the source at three lightnesses. In all scope, the off-state box border ramps off that fill mixed toward neutral grey; selected scope keeps it neutral.
319
+
320
+ #### Fill
321
+
322
+ | Input | Toned light | Toned dark | Neutral light | Neutral dark | Range | Step | Meaning |
323
+ | --- | --- | --- | --- | --- | --- | --- | --- |
324
+ | L rest | 0.5 | 0.45 | 0.6 | 0.42 | 0–1 | 0.005 | |
325
+ | L hover | 0.45 | 0.5 | 0.45 | 0.45 | 0–1 | 0.005 | |
326
+ | L active | 0.4 | 0.57 | 0.4 | 0.5 | 0–1 | 0.005 | |
327
+
328
+ ### Radio
329
+
330
+ Identical fill curve to Checkbox: --_tone-l-* set the selected dot at three lightnesses. All scope also ramps the off-ring border from it; selected scope keeps unpicked options neutral.
331
+
332
+ #### Fill
333
+
334
+ | Input | Toned light | Toned dark | Neutral light | Neutral dark | Range | Step | Meaning |
335
+ | --- | --- | --- | --- | --- | --- | --- | --- |
336
+ | L rest | 0.5 | 0.45 | 0.6 | 0.42 | 0–1 | 0.005 | |
337
+ | L hover | 0.45 | 0.5 | 0.45 | 0.45 | 0–1 | 0.005 | |
338
+ | L active | 0.4 | 0.57 | 0.4 | 0.5 | 0–1 | 0.005 | |
339
+
340
+ ### Expander
341
+
342
+ Every color is a role token; the Expander defines none of its own. Label: rest --text-2, hover --text-1 (Title’s secondary/primary). Fill and border are the surface scale (secondary --bg-2 / --border-5, primary --bg-4 / --border-4), and the fill lightens a step on hover. Tertiary is text only, all themed per tone.
343
+
344
+ ### Input
345
+
346
+ One border color from the seed hue at a tunable L/C — the goal is a single L/C per theme that works across every tone. Hover thickens the edge 0.5→1px (no recolor). Neutral overrides pin it grey (≈ --border-2). Applies to Input and the InputDate trigger (both compose <a-input>).
347
+
348
+ #### Border
349
+
350
+ Seed hue at this L/C (hover thickens the edge, no recolor). Toned starts at the average of today’s per-status literals; neutral pins grey ≈ --border-2.
351
+
352
+ | Input | Toned light | Toned dark | Neutral light | Neutral dark | Range | Step | Meaning |
353
+ | --- | --- | --- | --- | --- | --- | --- | --- |
354
+ | border L | 0.58 | 0.52 | 0.8 | 0.4 | 0–1 | 0.005 | |
355
+ | border C | 0.18 | 0.15 | 0.015 | 0.019 | 0–0.4 | 0.005 | |
356
+
357
+ ### Menu items
358
+
359
+ The item label is --text-2; the hint and icon are --text-2 at the hint α (80 → --text-3), so the text follows the Text spec while the hint strength stays tunable. The selected row holds a persistent tint of the label color — its alpha is the Menu’s own knob too.
360
+
361
+ #### Text
362
+
363
+ Label is full --text-2; hint + icon are --text-2 at this alpha (80 → --text-3).
364
+
365
+ | Input | Toned light | Toned dark | Neutral light | Neutral dark | Range | Step | Meaning |
366
+ | --- | --- | --- | --- | --- | --- | --- | --- |
367
+ | hint α % | 80 | 80 | 80 | 80 | 0–100 | 1 | |
368
+
369
+ #### Selected
370
+
371
+ Tint held on the selected row — a % of the item color (--text-2).
372
+
373
+ | Input | Toned light | Toned dark | Neutral light | Neutral dark | Range | Step | Meaning |
374
+ | --- | --- | --- | --- | --- | --- | --- | --- |
375
+ | selected α % | 9 | 12 | 9 | 12 | 0–100 | 1 | |
376
+
377
+ ### Progress
378
+
379
+ Every color is a role token; Progress defines none of its own. Track = --bg-4, border = --border-4, the fill indicator = --bg-5, the label = --text-2, and the right-aligned hint = --text-3. Named tones swap in the matching -{tone} role variant (so dark mode is free), and the fill’s right-edge fades from --bg-5 to --border-4. Follows the Text and Background & Borders panels live.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antadesign/anta",
3
- "version": "0.3.26",
3
+ "version": "0.3.28",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -42,7 +42,8 @@
42
42
  "./tokens.css": "./dist/tokens.css",
43
43
  "./reset.css": "./dist/reset.css",
44
44
  "./bundle.css": "./dist/bundle.css",
45
- "./theme-anta.css": "./dist/theme-anta.css",
45
+ "./theme-antune.css": "./dist/theme-antune.css",
46
+ "./theme-antithesis.css": "./dist/theme-antithesis.css",
46
47
  "./generate-icons.mjs": "./dist/generate-icons.mjs",
47
48
  "./*": {
48
49
  "types": "./dist/*.d.ts",
@@ -50,7 +51,7 @@
50
51
  }
51
52
  },
52
53
  "scripts": {
53
- "build": "pnpm run build:js && pnpm run build:css && pnpm run build:bundle && pnpm run build:types && pnpm run build:docs",
54
+ "build": "rm -rf dist && pnpm run build:js && pnpm run build:css && pnpm run build:bundle && pnpm run build:types && pnpm run build:docs",
54
55
  "build:dev": "pnpm run build:js && pnpm run build:css:dev && pnpm run build:bundle && pnpm run build:types",
55
56
  "build:css": "esbuild $(find src -name '*.css') --minify --outdir=dist --outbase=src && cp scripts/generate-icons.mjs dist/",
56
57
  "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/",
@@ -59,9 +60,11 @@
59
60
  "build:types": "tsc -p src/tsconfig.json",
60
61
  "build:docs": "pnpm --filter anta-site run docs:api && pnpm --filter anta-site run docs:pages && node scripts/generate-package-docs.mjs",
61
62
  "dev": "node scripts/dev.mjs",
62
- "dev:run": "echo $$ > \"$ANTA_DEV_PID_FILE\"; trap 'rm -f \"$ANTA_DEV_PID_FILE\"' EXIT; pnpm run build:dev && pnpm --filter @antadesign/stickers run build:dev && pnpm --filter anta-site run docs && (node scripts/dev-watch.mjs & pnpm --filter anta-site run dev:server & wait)",
63
+ "dev:run": "echo $$ > \"$ANTA_DEV_PID_FILE\"; trap 'rm -f \"$ANTA_DEV_PID_FILE\"' EXIT; pnpm run build:dev && pnpm --filter @antadesign/stickers run build:dev && pnpm --filter @antadesign/plot run build:dev && pnpm --filter anta-site run docs && (node scripts/dev-watch.mjs & pnpm --filter anta-site run dev:server & pnpm --filter anta-site run dev:search & wait)",
63
64
  "stop": "node scripts/dev-stop.mjs",
64
65
  "typecheck": "tsc --noEmit -p src/tsconfig.json",
66
+ "test": "node --test tests/*.test.mjs",
67
+ "test:capture-input": "node --test tests/capture-input.test.mjs",
65
68
  "lint": "node scripts/lint-getters.mjs && node scripts/lint-css-layers.mjs",
66
69
  "verify": "pnpm run lint && pnpm run typecheck && pnpm --filter anta-site run docs:api",
67
70
  "icons": "node scripts/generate-icons.mjs --input src/elements/icons --output src/elements --name a-icon.shapes --internal",
@@ -1 +0,0 @@
1
- .calendarMenu{--menu-padding: 8px}.timeRow{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:6px;padding-top:8px;border-top:1px solid var(--border-3)}.dateField::part(input){text-overflow:ellipsis}
@@ -1 +0,0 @@
1
- .chevron{transition:transform .15s ease}.chevron.open{transform:rotate(180deg)}.filter{padding:4px 4px 0}.footer{padding:var(--menu-padding, 4px);border-top:1px solid var(--border-4)}
@@ -1 +0,0 @@
1
- .search{padding:var(--menu-padding, 4px)}.summary{display:block;max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.footer{padding:var(--menu-padding, 4px);border-top:1px solid var(--border-4)}