coatx 0.0.0-stage → 0.1.0-beta.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 (117) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE.md +8 -0
  3. package/README.md +281 -2
  4. package/dist/accordion.d.ts +91 -0
  5. package/dist/accordion.js +114 -0
  6. package/dist/alert.d.ts +55 -0
  7. package/dist/alert.js +64 -0
  8. package/dist/aspect-ratio.d.ts +44 -0
  9. package/dist/aspect-ratio.js +64 -0
  10. package/dist/attrs.d.ts +43 -0
  11. package/dist/attrs.js +195 -0
  12. package/dist/avatar.d.ts +60 -0
  13. package/dist/avatar.js +76 -0
  14. package/dist/badge.d.ts +52 -0
  15. package/dist/badge.js +68 -0
  16. package/dist/breadcrumb.d.ts +70 -0
  17. package/dist/breadcrumb.js +87 -0
  18. package/dist/button-group.d.ts +56 -0
  19. package/dist/button-group.js +72 -0
  20. package/dist/button.d.ts +133 -0
  21. package/dist/button.js +175 -0
  22. package/dist/calendar.d.ts +185 -0
  23. package/dist/calendar.js +220 -0
  24. package/dist/card.d.ts +73 -0
  25. package/dist/card.js +88 -0
  26. package/dist/carousel.d.ts +134 -0
  27. package/dist/carousel.js +172 -0
  28. package/dist/chart.d.ts +135 -0
  29. package/dist/chart.js +174 -0
  30. package/dist/checkbox.d.ts +87 -0
  31. package/dist/checkbox.js +113 -0
  32. package/dist/collapsible.d.ts +76 -0
  33. package/dist/collapsible.js +96 -0
  34. package/dist/combobox.d.ts +190 -0
  35. package/dist/combobox.js +225 -0
  36. package/dist/command.d.ts +150 -0
  37. package/dist/command.js +179 -0
  38. package/dist/dialog.d.ts +132 -0
  39. package/dist/dialog.js +164 -0
  40. package/dist/drawer.d.ts +140 -0
  41. package/dist/drawer.js +171 -0
  42. package/dist/empty.d.ts +85 -0
  43. package/dist/empty.js +100 -0
  44. package/dist/field.d.ts +35 -0
  45. package/dist/field.js +43 -0
  46. package/dist/hover-card.d.ts +30 -0
  47. package/dist/hover-card.js +35 -0
  48. package/dist/index.d.ts +55 -0
  49. package/dist/index.js +54 -0
  50. package/dist/input-otp.d.ts +88 -0
  51. package/dist/input-otp.js +110 -0
  52. package/dist/input.d.ts +90 -0
  53. package/dist/input.js +112 -0
  54. package/dist/item.d.ts +147 -0
  55. package/dist/item.js +187 -0
  56. package/dist/kbd.d.ts +37 -0
  57. package/dist/kbd.js +42 -0
  58. package/dist/label.d.ts +29 -0
  59. package/dist/label.js +37 -0
  60. package/dist/menu.d.ts +203 -0
  61. package/dist/menu.js +247 -0
  62. package/dist/native-select.d.ts +75 -0
  63. package/dist/native-select.js +91 -0
  64. package/dist/navigation-menu.d.ts +173 -0
  65. package/dist/navigation-menu.js +203 -0
  66. package/dist/pagination.d.ts +94 -0
  67. package/dist/pagination.js +113 -0
  68. package/dist/popover.d.ts +58 -0
  69. package/dist/popover.js +69 -0
  70. package/dist/progress.d.ts +52 -0
  71. package/dist/progress.js +65 -0
  72. package/dist/radio.d.ts +89 -0
  73. package/dist/radio.js +114 -0
  74. package/dist/react.d.ts +16 -0
  75. package/dist/react.js +26 -0
  76. package/dist/resizable.d.ts +85 -0
  77. package/dist/resizable.js +109 -0
  78. package/dist/scroll-area.d.ts +66 -0
  79. package/dist/scroll-area.js +81 -0
  80. package/dist/segmented-control.d.ts +107 -0
  81. package/dist/segmented-control.js +128 -0
  82. package/dist/select.d.ts +164 -0
  83. package/dist/select.js +199 -0
  84. package/dist/separator.d.ts +27 -0
  85. package/dist/separator.js +34 -0
  86. package/dist/sheet.d.ts +151 -0
  87. package/dist/sheet.js +185 -0
  88. package/dist/sidebar.d.ts +317 -0
  89. package/dist/sidebar.js +371 -0
  90. package/dist/skeleton.d.ts +16 -0
  91. package/dist/skeleton.js +21 -0
  92. package/dist/slider.d.ts +88 -0
  93. package/dist/slider.js +116 -0
  94. package/dist/spinner.d.ts +40 -0
  95. package/dist/spinner.js +55 -0
  96. package/dist/styles.css +669 -0
  97. package/dist/switch.d.ts +79 -0
  98. package/dist/switch.js +100 -0
  99. package/dist/table.d.ts +87 -0
  100. package/dist/table.js +112 -0
  101. package/dist/tabs.d.ts +129 -0
  102. package/dist/tabs.js +153 -0
  103. package/dist/textarea.d.ts +49 -0
  104. package/dist/textarea.js +60 -0
  105. package/dist/themes.stylex.d.ts +106 -0
  106. package/dist/themes.stylex.js +115 -0
  107. package/dist/toast.d.ts +190 -0
  108. package/dist/toast.js +230 -0
  109. package/dist/toggle.d.ts +88 -0
  110. package/dist/toggle.js +113 -0
  111. package/dist/tokens.stylex.d.ts +59 -0
  112. package/dist/tokens.stylex.js +69 -0
  113. package/dist/tooltip.d.ts +37 -0
  114. package/dist/tooltip.js +44 -0
  115. package/dist/typography.d.ts +141 -0
  116. package/dist/typography.js +166 -0
  117. package/package.json +313 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 Ryuz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/NOTICE.md ADDED
@@ -0,0 +1,8 @@
1
+ # Third-party notices
2
+
3
+ `coatx` ports visual design tokens, proportions, and component styling recipes from the following MIT-licensed projects into StyleX:
4
+
5
+ - **shadcn/ui** — https://github.com/shadcn-ui/ui (MIT License, Copyright (c) 2023 shadcn)
6
+ - **Basecoat** — https://github.com/hunvreus/basecoat (MIT License, Copyright (c) 2025 Ronan Berder)
7
+
8
+ `coatx` is an independent StyleX implementation and does not bundle code from either project.
package/README.md CHANGED
@@ -1,3 +1,282 @@
1
- # Temporary Holding Version
1
+ # coatx
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Framework-neutral **shadcn/ui** styling ported to [StyleX](https://stylexjs.com/) — inspired by [Basecoat](https://github.com/hunvreus/basecoat) and shadcn/ui's Tailwind v4 `oklch` design tokens.
4
+
5
+ - **Zero-compiler recipes** — import `coatx/styles.css`, spread `{ class, style }` onto any element. No Babel plugin, no PostCSS setup.
6
+ - **Framework-neutral** — zero dependency on Ilha, React, Solid, or `@ilha/ui-sdk`. Recipes emit `{ class, style }` everywhere; React converts via `reactProps` from `coatx/react`.
7
+ - **Headless-ready** — stateful styles match native pseudo-classes and `data-*` / ARIA attributes from Radix, Ark, Base UI, React Aria, Headless UI, and native HTML.
8
+ - **No global CSS reset** — scoped semantic `oklch` tokens and atomic classes only, so `coatx` coexists with existing stylesheets (e.g. daisyUI).
9
+
10
+ ## Install
11
+
12
+ ```sh
13
+ bun add coatx
14
+ ```
15
+
16
+ ## Usage (any framework)
17
+
18
+ Import the pre-compiled stylesheet once, apply a scoped theme, and spread recipe attributes:
19
+
20
+ ```tsx
21
+ import "coatx/styles.css";
22
+ import { button } from "coatx/button";
23
+ import { theme } from "coatx/themes.stylex";
24
+
25
+ export function Actions() {
26
+ return (
27
+ <div {...theme("dark")}>
28
+ <button type="button" {...button({ variant: "default" })}>
29
+ Save
30
+ </button>
31
+ <button type="button" {...button({ variant: "outline" })}>
32
+ Cancel
33
+ </button>
34
+ </div>
35
+ );
36
+ ```
37
+
38
+ `coatx/styles.css` is fully layered (StyleX's standard `@layer priority1` … `priority7`), so any unlayered app CSS such as `.my-btn{padding-inline:2rem}` overrides it with no `!important`.
39
+
40
+ With Tailwind v4, import coatx into a named layer and pin the order once, so coatx sits above Tailwind's preflight (`base`) and below `utilities`:
41
+
42
+ ```css
43
+ @layer theme, base, coatx, components, utilities;
44
+ @import "tailwindcss";
45
+ @import "coatx/styles.css" layer(coatx);
46
+ ```
47
+
48
+ Without the `@layer` line, whichever stylesheet loads first declares its layers first: coatx-first lets Tailwind's preflight reset button padding and backgrounds, Tailwind-first puts coatx above your utilities. Apps that compile their own StyleX should skip `layer(coatx)` and follow the [StyleX guide](https://ilhajs.github.io/coatx/getting-started/stylex) instead.
49
+
50
+ This works as-is in plain HTML, Ilha, Preact, Solid, Vue, Svelte, Astro, Lit, and SSR strings — see [Other frameworks](https://ilhajs.github.io/coatx/getting-started/frameworks) and [Plain HTML](https://ilhajs.github.io/coatx/getting-started/vanilla-html). Native elements like `<input type="checkbox">`, `<details>`, and `<dialog>` pick up checked/open/disabled/validity styling automatically.
51
+
52
+ ## React
53
+
54
+ React needs `className` and object `style`, so convert with `reactProps` from `coatx/react`:
55
+
56
+ ```tsx
57
+ import "coatx/styles.css";
58
+ import { button } from "coatx/button";
59
+ import { reactProps } from "coatx/react";
60
+
61
+ export function SaveButton() {
62
+ return (
63
+ <button type="button" {...reactProps(button({ variant: "default" }))}>
64
+ Save changes
65
+ </button>
66
+ );
67
+ }
68
+ ```
69
+
70
+ Works with Base UI parts directly, Radix/Ark `data-state` / `data-highlighted` attributes automatically, and React Aria render props via JS boolean props — see [React](https://ilhajs.github.io/coatx/getting-started/react).
71
+
72
+ ## Preact
73
+
74
+ Preact accepts `class` natively, so recipes spread directly with no adapter:
75
+
76
+ ```tsx
77
+ import "coatx/styles.css";
78
+ import { button } from "coatx/button";
79
+
80
+ export const SaveButton = () => (
81
+ <button type="button" {...button({ variant: "outline" })}>
82
+ Save changes
83
+ </button>
84
+ );
85
+ ```
86
+
87
+ ## Solid
88
+
89
+ ```tsx
90
+ import "coatx/styles.css";
91
+ import { button } from "coatx/button";
92
+
93
+ export const SaveButton = () => (
94
+ <button type="button" {...button({ variant: "outline" })}>
95
+ Save changes
96
+ </button>
97
+ );
98
+ ```
99
+
100
+ Stateful recipes take plain JS booleans, which compose with Solid signals: `toggle({ pressed: on() })`.
101
+
102
+ ## Vue
103
+
104
+ ```vue
105
+ <script setup lang="ts">
106
+ import "coatx/styles.css";
107
+ import { button } from "coatx/button";
108
+ </script>
109
+
110
+ <template>
111
+ <button type="button" v-bind="button({ variant: 'outline' })">
112
+ Save changes
113
+ </button>
114
+ </template>
115
+ ```
116
+
117
+ ## Svelte
118
+
119
+ ```svelte
120
+ <script lang="ts">
121
+ import "coatx/styles.css";
122
+ import { button } from "coatx/button";
123
+ </script>
124
+
125
+ <button type="button" {...button({ variant: "outline" })}>Save changes</button>
126
+ ```
127
+
128
+ ## Astro
129
+
130
+ Astro templates accept `class` and `style` directly:
131
+
132
+ ```astro
133
+ ---
134
+ import "coatx/styles.css";
135
+ import { button } from "coatx/button";
136
+ ---
137
+
138
+ <button type="button" {...button({ variant: "outline" })}>Save changes</button>
139
+ ```
140
+
141
+ ## Ilha (+ @ilha/ui-sdk)
142
+
143
+ `coatx` has zero runtime coupling to `@ilha/ui-sdk`, yet every recipe maps onto its state callbacks (`state.checked`, `state.selected`, `state.highlighted`, `state.pressed`, `state.open`):
144
+
145
+ ```bash
146
+ bun add coatx ilha @ilha/ui-sdk @ui-sdk/core@0.1.0-beta.23 effect
147
+ ```
148
+
149
+ ```tsx
150
+ import "coatx/styles.css";
151
+ import {
152
+ SegmentedControl,
153
+ SegmentedControlItem,
154
+ } from "@ilha/ui-sdk/segmented-control";
155
+ import {
156
+ segmentedControl,
157
+ segmentedControlItem,
158
+ } from "coatx/segmented-control";
159
+ import { theme } from "coatx/themes.stylex";
160
+
161
+ export const Appearance = () => (
162
+ <div {...theme("dark")}>
163
+ <SegmentedControl
164
+ aria-label="Appearance"
165
+ defaultValue="system"
166
+ {...segmentedControl()}
167
+ >
168
+ <SegmentedControlItem
169
+ value="system"
170
+ class={(state) =>
171
+ segmentedControlItem({ checked: state.checked }).class
172
+ }
173
+ >
174
+ System
175
+ </SegmentedControlItem>
176
+ </SegmentedControl>
177
+ </div>
178
+ );
179
+ ```
180
+
181
+ Hydrate islands in Astro with `@ilha/astro` — see [Ilha UI SDK & Astro](https://ilhajs.github.io/coatx/getting-started/ilha-ui-sdk).
182
+
183
+ ## Theming
184
+
185
+ `theme(mode, overrides?, extra?)` scopes light/dark tokens to any container, with grouped overrides:
186
+
187
+ ```tsx
188
+ import { theme } from "coatx/themes.stylex";
189
+
190
+ export function BrandPanel() {
191
+ return (
192
+ <section
193
+ {...theme("dark", {
194
+ colors: {
195
+ primary: "oklch(0.62 0.21 255)",
196
+ ring: "oklch(0.62 0.21 255)",
197
+ },
198
+ radii: { lg: "0.75rem" },
199
+ radius: "0.625rem",
200
+ fonts: { sans: "Inter, sans-serif" },
201
+ shadows: { md: "0 4px 12px rgb(0 0 0 / 0.15)" },
202
+ motion: { easeOut: "cubic-bezier(0.22, 1, 0.36, 1)" },
203
+ })}
204
+ >
205
+ {/* Every coatx recipe inside inherits this scoped theme */}
206
+ </section>
207
+ );
208
+ }
209
+ ```
210
+
211
+ `radius` mirrors shadcn's `--radius` (explicit `radii` entries win). See [Theming](https://ilhajs.github.io/coatx/getting-started/theming).
212
+
213
+ ## StyleX compiler users
214
+
215
+ Apps that already compile StyleX import tokens from `coatx/tokens.stylex` — the `.stylex` extension is required, because the Babel plugin only resolves token files ending in `.stylex`:
216
+
217
+ ```ts
218
+ import * as stylex from "@stylexjs/stylex";
219
+ import { buttonStyles } from "coatx/button";
220
+ import { colors } from "coatx/tokens.stylex";
221
+
222
+ export const brandTheme = stylex.createTheme(colors, {
223
+ primary: "oklch(0.62 0.21 255)",
224
+ ring: "oklch(0.62 0.21 255)",
225
+ });
226
+
227
+ const custom = stylex.create({
228
+ square: { borderRadius: 0 },
229
+ });
230
+
231
+ export const squarePrimaryButton = () =>
232
+ stylex.attrs(buttonStyles.base, buttonStyles.variantDefault, custom.square);
233
+ ```
234
+
235
+ See [StyleX compiler mode](https://ilhajs.github.io/coatx/getting-started/stylex).
236
+
237
+ ## Component & token catalog
238
+
239
+ ### Foundation
240
+
241
+ - `coatx/styles.css` — pre-compiled atomic CSS (no global resets)
242
+ - `coatx/react` — `reactProps` (`class`/`style` → `className`/object `style` for React)
243
+ - `coatx/tokens.stylex` — `colors` (including `chart1`–`chart5`), `radii`, `fonts`, `shadows`, `motion`
244
+ - `coatx/themes` — `lightTheme`, `darkTheme`, `theme(mode, overrides?, extra?)`, `tokenOverrides(overrides)`, `tokenOverrideVars(overrides)`
245
+
246
+ ### Core & forms
247
+
248
+ - `coatx/button`, `coatx/button-group`, `coatx/input` (incl. `inputGroup`, `inputAddon`), `coatx/input-otp`, `coatx/textarea`, `coatx/label`, `coatx/field`
249
+ - `coatx/checkbox`, `coatx/switch`, `coatx/radio`, `coatx/select`, `coatx/native-select`, `coatx/combobox`, `coatx/calendar`, `coatx/slider`, `coatx/toggle` (incl. `toggleGroup`)
250
+ - `coatx/segmented-control`, `coatx/tabs`
251
+
252
+ ### Layout, display & feedback
253
+
254
+ - `coatx/aspect-ratio`, `coatx/card`, `coatx/carousel`, `coatx/chart`, `coatx/badge`, `coatx/separator`
255
+ - `coatx/alert`, `coatx/avatar`, `coatx/empty`, `coatx/item`, `coatx/kbd`, `coatx/progress`, `coatx/resizable`, `coatx/scroll-area`, `coatx/skeleton`, `coatx/spinner`, `coatx/table`, `coatx/typography`
256
+
257
+ ### Overlays, menus & navigation
258
+
259
+ - `coatx/dialog` (covers `AlertDialog`), `coatx/drawer`, `coatx/sheet`, `coatx/popover`, `coatx/tooltip`, `coatx/hover-card`, `coatx/toast` (covers `Sonner`)
260
+ - `coatx/menu` (covers `DropdownMenu`, `ContextMenu`, `Menubar`), `coatx/navigation-menu`, `coatx/sidebar`, `coatx/accordion`, `coatx/collapsible`, `coatx/command`, `coatx/pagination`, `coatx/breadcrumb`
261
+
262
+ ## Documentation & Sink
263
+
264
+ - Live docs: [ilhajs.github.io/coatx](https://ilhajs.github.io/coatx/) (built with [Blume](https://useblume.dev) + `@ilha/astro`)
265
+ - Interactive sink: [ilhajs.github.io/coatx/sink](https://ilhajs.github.io/coatx/sink)
266
+
267
+ `website/` hosts the Blume documentation site (with live `@ilha/astro` component previews) and the Apache-2.0 port of `ui-sdk.dev/sink` under `website/src/sink/` (excluded from npm `files`, see [website/src/sink/LICENSE](./website/src/sink/LICENSE) and [website/src/sink/NOTICE.md](./website/src/sink/NOTICE.md)):
268
+
269
+ - `bun run docs:dev` — run Blume dev server locally
270
+ - `bun run docs:validate` — validate docs links and MDX syntax
271
+ - `bun run docs:build` — build `coatx` + static docs & sink into `website/dist`
272
+
273
+ ## Development
274
+
275
+ - `bun run build` — compile StyleX recipes, `dist/styles.css`, and `.d.ts`
276
+ - `bun run test` — build + unit, dual-mode StyleX, type-anchor, and `@ilha/ui-sdk` tests
277
+ - `bun run typecheck` — `tsc --noEmit`
278
+ - `bun run check` / `bun run fix` — Ultracite (`oxlint` + `oxfmt`)
279
+
280
+ ## License
281
+
282
+ [MIT](./LICENSE) for the published `coatx` library (`src/` and `dist/`). See [NOTICE.md](./NOTICE.md) for shadcn/ui & Basecoat MIT notices. The unpublished sink demo in `website/src/sink/` carries its own Apache-2.0 [LICENSE](./website/src/sink/LICENSE) and [NOTICE.md](./website/src/sink/NOTICE.md).
@@ -0,0 +1,91 @@
1
+ import * as stylex from "@stylexjs/stylex";
2
+ import type { CoatxAttrs, CoatxExtraOptions } from "./attrs.js";
3
+ export type AccordionPartOptions = CoatxExtraOptions;
4
+ export interface AccordionTriggerOptions extends CoatxExtraOptions {
5
+ open?: boolean;
6
+ disabled?: boolean;
7
+ }
8
+ export interface AccordionContentOptions extends CoatxExtraOptions {
9
+ open?: boolean;
10
+ }
11
+ export declare const accordionStyles: Readonly<{
12
+ readonly content: Readonly<{
13
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
14
+ readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", string>;
15
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", "0.875rem">;
16
+ readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", 1.5>;
17
+ readonly overflow: stylex.StyleXClassNameFor<"overflow", "hidden">;
18
+ readonly paddingBottom: stylex.StyleXClassNameFor<"paddingBottom", "1rem">;
19
+ readonly paddingTop: stylex.StyleXClassNameFor<"paddingTop", 0>;
20
+ }>;
21
+ readonly contentClosed: Readonly<{
22
+ readonly display: stylex.StyleXClassNameFor<"display", "none">;
23
+ readonly paddingBottom: stylex.StyleXClassNameFor<"paddingBottom", 0>;
24
+ }>;
25
+ readonly disabled: Readonly<{
26
+ readonly cursor: stylex.StyleXClassNameFor<"cursor", "not-allowed">;
27
+ readonly opacity: stylex.StyleXClassNameFor<"opacity", 0.5>;
28
+ readonly pointerEvents: stylex.StyleXClassNameFor<"pointerEvents", "none">;
29
+ }>;
30
+ readonly header: Readonly<{
31
+ readonly display: stylex.StyleXClassNameFor<"display", "flex">;
32
+ readonly marginBlock: stylex.StyleXClassNameFor<"marginBlock", 0>;
33
+ }>;
34
+ readonly item: Readonly<{
35
+ readonly borderBottomColor: stylex.StyleXClassNameFor<"borderBottomColor", string>;
36
+ readonly borderBottomStyle: stylex.StyleXClassNameFor<"borderBottomStyle", "solid">;
37
+ readonly borderBottomWidth: stylex.StyleXClassNameFor<"borderBottomWidth", 1>;
38
+ }>;
39
+ readonly root: Readonly<{
40
+ readonly display: stylex.StyleXClassNameFor<"display", "flex">;
41
+ readonly flexDirection: stylex.StyleXClassNameFor<"flexDirection", "column">;
42
+ readonly width: stylex.StyleXClassNameFor<"width", "100%">;
43
+ }>;
44
+ readonly trigger: Readonly<{
45
+ readonly alignItems: stylex.StyleXClassNameFor<"alignItems", "center">;
46
+ readonly appearance: stylex.StyleXClassNameFor<"appearance", "none">;
47
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "transparent">;
48
+ readonly borderColor: stylex.StyleXClassNameFor<"borderColor", "transparent">;
49
+ readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", string>;
50
+ readonly borderStyle: stylex.StyleXClassNameFor<"borderStyle", "solid">;
51
+ readonly borderWidth: stylex.StyleXClassNameFor<"borderWidth", 0>;
52
+ readonly boxShadow: stylex.StyleXClassNameFor<"boxShadow", string>;
53
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
54
+ readonly cursor: stylex.StyleXClassNameFor<"cursor", "not-allowed" | "pointer">;
55
+ readonly display: stylex.StyleXClassNameFor<"display", "flex">;
56
+ readonly flexGrow: stylex.StyleXClassNameFor<"flexGrow", 1>;
57
+ readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", string>;
58
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", "0.875rem">;
59
+ readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", 500>;
60
+ readonly gap: stylex.StyleXClassNameFor<"gap", "1rem">;
61
+ readonly justifyContent: stylex.StyleXClassNameFor<"justifyContent", "space-between">;
62
+ readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", 1.4>;
63
+ readonly opacity: stylex.StyleXClassNameFor<"opacity", 0.5 | 1>;
64
+ readonly outlineStyle: stylex.StyleXClassNameFor<"outlineStyle", "none">;
65
+ readonly paddingBlock: stylex.StyleXClassNameFor<"paddingBlock", "1rem">;
66
+ readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", 0>;
67
+ readonly pointerEvents: stylex.StyleXClassNameFor<"pointerEvents", "auto" | "none">;
68
+ readonly textAlign: stylex.StyleXClassNameFor<"textAlign", "start">;
69
+ readonly textDecoration: stylex.StyleXClassNameFor<"textDecoration", "none" | "underline" | null>;
70
+ readonly touchAction: stylex.StyleXClassNameFor<"touchAction", "manipulation">;
71
+ readonly transitionDuration: stylex.StyleXClassNameFor<"transitionDuration", "150ms">;
72
+ readonly transitionProperty: stylex.StyleXClassNameFor<"transitionProperty", "color, box-shadow">;
73
+ readonly transitionTimingFunction: stylex.StyleXClassNameFor<"transitionTimingFunction", string>;
74
+ readonly userSelect: stylex.StyleXClassNameFor<"userSelect", "none">;
75
+ readonly WebkitTapHighlightColor: stylex.StyleXClassNameFor<"WebkitTapHighlightColor", "transparent">;
76
+ readonly width: stylex.StyleXClassNameFor<"width", "100%">;
77
+ }>;
78
+ readonly triggerOpen: Readonly<{
79
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
80
+ }>;
81
+ }>;
82
+ /** Root accordion / collapsible container. */
83
+ export declare const accordion: (options?: AccordionPartOptions) => CoatxAttrs;
84
+ /** Individual bordered accordion item wrapper. */
85
+ export declare const accordionItem: (options?: AccordionPartOptions) => CoatxAttrs;
86
+ /** Heading wrapper around `accordionTrigger()`. */
87
+ export declare const accordionHeader: (options?: AccordionPartOptions) => CoatxAttrs;
88
+ /** Expand / collapse trigger button recipe. */
89
+ export declare const accordionTrigger: (options?: AccordionTriggerOptions) => CoatxAttrs;
90
+ /** Expandable content panel (also fits `Collapsible`). */
91
+ export declare const accordionContent: (options?: AccordionContentOptions) => CoatxAttrs;
@@ -0,0 +1,114 @@
1
+ import * as stylex from "@stylexjs/stylex";
2
+ import { toAttrs } from "./attrs.js";
3
+ import "./tokens.stylex.js";
4
+ import { colors, fonts, motion, radii } from "./tokens.stylex.js";
5
+ const FOCUS_RING = `0 0 0 3px color-mix(in oklab, ${colors.ring} 50%, transparent)`;
6
+ const FINE_HOVER = "@media (hover: hover) and (pointer: fine)";
7
+ const OPEN = ":is([open], [data-state=open], [data-open])";
8
+ const EXPANDED = ":is([aria-expanded=true], [data-state=open], [data-open])";
9
+ const DISABLED = ":is(:disabled, [aria-disabled=true], [data-disabled])";
10
+ export const accordionStyles = {
11
+ content: {
12
+ kMwMTN: "x1ngb8q1",
13
+ kMv6JI: "x1afzh1k",
14
+ kGuDYH: "xkpwil5",
15
+ kLWn49: "x1evy7pa",
16
+ kVQacm: "xb3r6kr",
17
+ kGO01o: "x2yie3v xhb0t7p",
18
+ kLKAdn: "xexx8yu",
19
+ $$css: true
20
+ },
21
+ contentClosed: {
22
+ k1xSpc: "x1s85apg",
23
+ kGO01o: "x18d9i69",
24
+ $$css: true
25
+ },
26
+ disabled: {
27
+ kkrTdU: "x1h6gzvc",
28
+ kSiTet: "xbyyjgo",
29
+ kfzvcC: "x47corl",
30
+ $$css: true
31
+ },
32
+ header: {
33
+ k1xSpc: "x78zum5",
34
+ kqGvvJ: "x10im51j",
35
+ $$css: true
36
+ },
37
+ item: {
38
+ kL6WhQ: "x10ek67b x3w7546",
39
+ kfdmCh: "x1q0q8m5",
40
+ kt9PQ7: "xso031l",
41
+ $$css: true
42
+ },
43
+ root: {
44
+ k1xSpc: "x78zum5",
45
+ kXwgrk: "xdt5ytf",
46
+ kzqmXN: "xh8yej3",
47
+ $$css: true
48
+ },
49
+ trigger: {
50
+ kGNEyG: "x6s0dn4",
51
+ kysU6D: "xjyslct",
52
+ kWkggS: "xjbqb8w",
53
+ kVAM5u: "x9r1u3d",
54
+ kaIpWk: "xf2zneb",
55
+ ksu8eU: "x1y0btm7",
56
+ kMzoRj: "xc342km",
57
+ kGVxlE: "x1gnnqk1 x1qezvrj",
58
+ kMwMTN: "x1ngb8q1 xvacvqi",
59
+ kkrTdU: "x1ypdohk x1s07b3s xv0gzh9",
60
+ k1xSpc: "x78zum5",
61
+ kzQI83: "x1iyjqo2",
62
+ kMv6JI: "x1afzh1k",
63
+ kGuDYH: "xkpwil5",
64
+ k63SB2: "xk50ysn",
65
+ kOIVth: "x8fetqu",
66
+ kjj79g: "x1qughib",
67
+ kLWn49: "x37zpob",
68
+ kSiTet: "x1hc1fzr x1fulv2p",
69
+ k3XXqK: "x1t137rt",
70
+ k8WAf4: "xgepmj6",
71
+ kg3NbH: "xnjsko4",
72
+ kfzvcC: "x67bb7w x1g8zkhp",
73
+ k9WMMc: "x1yc453h",
74
+ kybGjl: "x1hl2dhg x1mlsptj",
75
+ kFalU9: "xggy1nq",
76
+ kIyJzY: "xx6bhzk",
77
+ k1ekBW: "xmsq1kp",
78
+ kAMwcw: "x1kktvmy",
79
+ kfSwDN: "x87ps6o",
80
+ kQizK7: "x1i10hfl",
81
+ kzqmXN: "xh8yej3",
82
+ $$css: true
83
+ },
84
+ triggerOpen: {
85
+ kMwMTN: "x1ngb8q1",
86
+ $$css: true
87
+ }
88
+ };
89
+
90
+ /** Root accordion / collapsible container. */
91
+ export const accordion = (options = {}) => toAttrs([accordionStyles.root], options);
92
+
93
+ /** Individual bordered accordion item wrapper. */
94
+ export const accordionItem = (options = {}) => toAttrs([accordionStyles.item], options);
95
+
96
+ /** Heading wrapper around `accordionTrigger()`. */
97
+ export const accordionHeader = (options = {}) => toAttrs([accordionStyles.header], options);
98
+
99
+ /** Expand / collapse trigger button recipe. */
100
+ export const accordionTrigger = (options = {}) => {
101
+ const {
102
+ disabled = false,
103
+ open = false
104
+ } = options;
105
+ return toAttrs([accordionStyles.trigger, open && accordionStyles.triggerOpen, disabled && accordionStyles.disabled], options);
106
+ };
107
+
108
+ /** Expandable content panel (also fits `Collapsible`). */
109
+ export const accordionContent = (options = {}) => {
110
+ const {
111
+ open = true
112
+ } = options;
113
+ return toAttrs([accordionStyles.content, !open && accordionStyles.contentClosed], options);
114
+ };
@@ -0,0 +1,55 @@
1
+ import * as stylex from "@stylexjs/stylex";
2
+ import type { CoatxAttrs, CoatxExtraOptions } from "./attrs.js";
3
+ export type AlertVariant = "default" | "destructive";
4
+ export interface AlertRecipeOptions extends CoatxExtraOptions {
5
+ variant?: AlertVariant;
6
+ }
7
+ export type AlertPartOptions = CoatxExtraOptions;
8
+ export declare const alertStyles: Readonly<{
9
+ readonly base: Readonly<{
10
+ readonly alignItems: stylex.StyleXClassNameFor<"alignItems", "start">;
11
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", string>;
12
+ readonly borderColor: stylex.StyleXClassNameFor<"borderColor", string>;
13
+ readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", string>;
14
+ readonly borderStyle: stylex.StyleXClassNameFor<"borderStyle", "solid">;
15
+ readonly borderWidth: stylex.StyleXClassNameFor<"borderWidth", 1>;
16
+ readonly boxSizing: stylex.StyleXClassNameFor<"boxSizing", "border-box">;
17
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
18
+ readonly columnGap: stylex.StyleXClassNameFor<"columnGap", "0.75rem">;
19
+ readonly display: stylex.StyleXClassNameFor<"display", "grid">;
20
+ readonly fontFamily: stylex.StyleXClassNameFor<"fontFamily", string>;
21
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", "0.875rem">;
22
+ readonly gridTemplateColumns: stylex.StyleXClassNameFor<"gridTemplateColumns", "auto 1fr">;
23
+ readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", 1.5>;
24
+ readonly paddingBlock: stylex.StyleXClassNameFor<"paddingBlock", "0.75rem">;
25
+ readonly paddingInline: stylex.StyleXClassNameFor<"paddingInline", "1rem">;
26
+ readonly position: stylex.StyleXClassNameFor<"position", "relative">;
27
+ readonly rowGap: stylex.StyleXClassNameFor<"rowGap", "0.25rem">;
28
+ readonly width: stylex.StyleXClassNameFor<"width", "100%">;
29
+ }>;
30
+ readonly description: Readonly<{
31
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
32
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", "0.875rem">;
33
+ readonly gridColumnStart: stylex.StyleXClassNameFor<"gridColumnStart", "2">;
34
+ readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", 1.5>;
35
+ readonly marginBlock: stylex.StyleXClassNameFor<"marginBlock", 0>;
36
+ }>;
37
+ readonly title: Readonly<{
38
+ readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", 500>;
39
+ readonly gridColumnStart: stylex.StyleXClassNameFor<"gridColumnStart", "2">;
40
+ readonly letterSpacing: stylex.StyleXClassNameFor<"letterSpacing", "-0.01em">;
41
+ readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", 1.25>;
42
+ readonly marginBlock: stylex.StyleXClassNameFor<"marginBlock", 0>;
43
+ readonly minHeight: stylex.StyleXClassNameFor<"minHeight", "1rem">;
44
+ }>;
45
+ readonly variantDestructive: Readonly<{
46
+ readonly borderColor: stylex.StyleXClassNameFor<"borderColor", `color-mix(in oklab, ${stylex.StyleXVar<string>} 50%, transparent)`>;
47
+ readonly color: stylex.StyleXClassNameFor<"color", string>;
48
+ }>;
49
+ }>;
50
+ /** shadcn/ui callout alert box recipe. */
51
+ export declare const alert: (options?: AlertRecipeOptions) => CoatxAttrs;
52
+ /** Alert heading slot. */
53
+ export declare const alertTitle: (options?: AlertPartOptions) => CoatxAttrs;
54
+ /** Alert body copy slot. */
55
+ export declare const alertDescription: (options?: AlertPartOptions) => CoatxAttrs;
package/dist/alert.js ADDED
@@ -0,0 +1,64 @@
1
+ import * as stylex from "@stylexjs/stylex";
2
+ import { toAttrs } from "./attrs.js";
3
+ import "./tokens.stylex.js";
4
+ import { colors, fonts, radii } from "./tokens.stylex.js";
5
+ export const alertStyles = {
6
+ base: {
7
+ kGNEyG: "x7a106z",
8
+ kWkggS: "x15oysrv",
9
+ kVAM5u: "x7j6xd0",
10
+ kaIpWk: "x128wuaa",
11
+ ksu8eU: "x1y0btm7",
12
+ kMzoRj: "xmkeg23",
13
+ kB7OPa: "x9f619",
14
+ kMwMTN: "x1oanl1j",
15
+ k1C7PZ: "xsin8gy",
16
+ k1xSpc: "xrvj5dj",
17
+ kMv6JI: "x1afzh1k",
18
+ kGuDYH: "xkpwil5",
19
+ kumcoG: "x1pmbctz",
20
+ kLWn49: "x1evy7pa",
21
+ k8WAf4: "xo0yzjp",
22
+ kg3NbH: "xnxx81d",
23
+ kVAEAm: "x1n2onr6",
24
+ khm7nJ: "x5qd032",
25
+ kzqmXN: "xh8yej3",
26
+ $$css: true
27
+ },
28
+ description: {
29
+ kMwMTN: "x19o77cb",
30
+ kGuDYH: "xkpwil5",
31
+ kEXP64: "x1xdureb",
32
+ kLWn49: "x1evy7pa",
33
+ kqGvvJ: "x10im51j",
34
+ $$css: true
35
+ },
36
+ title: {
37
+ k63SB2: "xk50ysn",
38
+ kEXP64: "x1xdureb",
39
+ kb6lSQ: "xjat59b",
40
+ kLWn49: "x132q4wb",
41
+ kqGvvJ: "x10im51j",
42
+ kAzted: "x1aewpuf",
43
+ $$css: true
44
+ },
45
+ variantDestructive: {
46
+ kVAM5u: "xipivbd",
47
+ kMwMTN: "xrjp7px",
48
+ $$css: true
49
+ }
50
+ };
51
+
52
+ /** shadcn/ui callout alert box recipe. */
53
+ export const alert = (options = {}) => {
54
+ const {
55
+ variant = "default"
56
+ } = options;
57
+ return toAttrs([alertStyles.base, variant === "destructive" && alertStyles.variantDestructive], options);
58
+ };
59
+
60
+ /** Alert heading slot. */
61
+ export const alertTitle = (options = {}) => toAttrs([alertStyles.title], options);
62
+
63
+ /** Alert body copy slot. */
64
+ export const alertDescription = (options = {}) => toAttrs([alertStyles.description], options);