@leitware/composables 1.3.2 → 1.4.0

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 (84) hide show
  1. package/README.md +41 -4
  2. package/dist/presets/brutalist.css +6 -2
  3. package/dist/presets/default.css +5 -1
  4. package/dist/presets/signal-pop.css +5 -1
  5. package/dist/styles.css +1 -1
  6. package/dist/tailwind.css +8 -0
  7. package/package.json +2 -1
  8. package/rules/composables.md +9 -7
  9. package/skills/use-composables/references/optional-dependencies.md +1 -1
  10. package/skills/use-composables/references/public-api.md +7 -2
  11. package/skills/use-composables/references/semantic-utilities.md +2 -0
  12. package/src/_internal/ai-elements/chain-of-thought.tsx +1 -1
  13. package/src/_internal/ai-elements/code-block.tsx +1 -1
  14. package/src/_internal/badge.tsx +2 -2
  15. package/src/_internal/bubble.tsx +1 -1
  16. package/src/_internal/button.tsx +1 -1
  17. package/src/_internal/calendar.tsx +1 -1
  18. package/src/_internal/checkbox.tsx +1 -1
  19. package/src/_internal/combobox.tsx +3 -3
  20. package/src/_internal/command.tsx +3 -3
  21. package/src/_internal/dropdown-menu.tsx +2 -2
  22. package/src/_internal/dropzone.tsx +3 -3
  23. package/src/_internal/field.tsx +2 -2
  24. package/src/_internal/grid-overlay.tsx +3 -3
  25. package/src/_internal/input-group.tsx +1 -1
  26. package/src/_internal/input.tsx +1 -1
  27. package/src/_internal/layout-bento.tsx +12 -12
  28. package/src/_internal/layout.tsx +11 -11
  29. package/src/_internal/marker.tsx +1 -1
  30. package/src/_internal/radio-group.tsx +2 -2
  31. package/src/_internal/resizable.tsx +1 -1
  32. package/src/_internal/select.tsx +5 -2
  33. package/src/_internal/sidebar.tsx +2 -2
  34. package/src/_internal/switch.tsx +1 -1
  35. package/src/_internal/tabs.tsx +2 -2
  36. package/src/_internal/textarea.tsx +1 -1
  37. package/src/_internal/tooltip.tsx +1 -1
  38. package/src/index.ts +5 -1
  39. package/src/lib/utils.ts +2 -2
  40. package/src/opinionated/alert.tsx +5 -5
  41. package/src/opinionated/blocks/content.tsx +247 -0
  42. package/src/opinionated/blocks/features.tsx +242 -0
  43. package/src/opinionated/blocks/heroes.tsx +711 -0
  44. package/src/opinionated/blocks/index.ts +4 -0
  45. package/src/opinionated/blocks/shared.tsx +185 -0
  46. package/src/opinionated/button.tsx +3 -1
  47. package/src/opinionated/collapsible.tsx +1 -1
  48. package/src/opinionated/form-calendar-popover.tsx +1 -1
  49. package/src/opinionated/form-checkbox.tsx +1 -1
  50. package/src/opinionated/form-combobox.tsx +1 -1
  51. package/src/opinionated/form-date-of-birth.tsx +1 -1
  52. package/src/opinionated/form-dropzone.tsx +1 -1
  53. package/src/opinionated/form-input-group.tsx +1 -1
  54. package/src/opinionated/form-input.tsx +1 -1
  55. package/src/opinionated/form-multi-combobox.tsx +1 -1
  56. package/src/opinionated/form-multi-dropzone.tsx +1 -1
  57. package/src/opinionated/form-radiogroup.tsx +1 -1
  58. package/src/opinionated/form-select.tsx +1 -1
  59. package/src/opinionated/form-slider.tsx +1 -1
  60. package/src/opinionated/form-switch.tsx +1 -1
  61. package/src/opinionated/form-textarea.tsx +1 -1
  62. package/src/opinionated/theme-injector.tsx +2 -2
  63. package/src/opinionated/token-config-panel/color-editor.tsx +1 -1
  64. package/src/opinionated/token-config-panel/json-import-export.tsx +1 -1
  65. package/src/opinionated/token-config-panel/spacing-editor.tsx +1 -1
  66. package/src/opinionated/token-config-panel/types.ts +1 -1
  67. package/src/opinionated/token-config-panel/typography-editor.tsx +1 -1
  68. package/src/opinionated/window-frame.tsx +57 -0
  69. package/src/styles/composable.css +10 -10
  70. package/src/styles/presets/brutalist.css +6 -2
  71. package/src/styles/presets/default.css +5 -1
  72. package/src/styles/presets/signal-pop.css +5 -1
  73. package/src/styles/presets-data/brutalist.ts +13 -9
  74. package/src/styles/presets-data/default.ts +7 -3
  75. package/src/styles/presets-data/signal-pop.ts +4 -0
  76. package/src/styles/tokens/base.css +1 -1
  77. package/src/styles/tokens/components.css +1 -0
  78. package/src/styles/tokens/palette.css +2 -2
  79. package/src/styles/tokens/registry.ts +15 -1
  80. package/src/styles/tokens/semantic-utilities.css +8 -0
  81. package/src/styles/tokens/semantic.css +6 -2
  82. package/src/styles/tokens/tailwind-color-adapter.css +3 -1
  83. package/src/styles/tokens/tailwind-public-utilities.css +8 -0
  84. package/src/styles/tokens/tailwind-theme.css +7 -7
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Composables
2
2
 
3
- **An opinionated React component library with a semantic design token system — built on Base UI and Tailwind CSS v4.**
3
+ **An opinionated React component library with a semantic design token system, built on Base UI and Tailwind CSS v4.**
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@leitware/composables)](https://www.npmjs.com/package/@leitware/composables)
6
6
  [![CI](https://github.com/rowanhen/composables/actions/workflows/ci.yml/badge.svg)](https://github.com/rowanhen/composables/actions/workflows/ci.yml)
@@ -134,6 +134,43 @@ import { AIMessage, AIPromptInput } from '@leitware/composables/ai'
134
134
 
135
135
  The AI libraries remain optional peer dependencies because they are a materially larger, specialised integration surface. Applications that do not import `@leitware/composables/ai` do not need to install or configure them. If you use that entrypoint, install its optional peers; see the table below.
136
136
 
137
+ ### Page blocks
138
+
139
+ The 26 page blocks cover heroes, content, features, calls to action, a bento grid, and a testimonial. They are available from the root entrypoint or the focused `/blocks` entrypoint:
140
+
141
+ ```tsx
142
+ import { Hero06, Cta01 } from '@leitware/composables/blocks'
143
+
144
+ export function LandingPage() {
145
+ return (
146
+ <>
147
+ <Hero06
148
+ title="Build together,"
149
+ highlight="from one place."
150
+ description="A clear workspace for your team."
151
+ primaryCTA={{ text: 'Get started', link: '/start' }}
152
+ />
153
+ <Cta01
154
+ title="Ready to begin?"
155
+ description="Make your next idea real."
156
+ cta={{ text: 'Start now', link: '/start' }}
157
+ />
158
+ </>
159
+ )
160
+ }
161
+ ```
162
+
163
+ Each block accepts content as typed props and supports `className`; most also accept `variant` and `animation`. Run `bun run dev` and open `/blocks` for an individual preview of every block.
164
+
165
+ The desktop-style preview chrome is also available on its own:
166
+
167
+ ```tsx
168
+ import { WindowFrame } from '@leitware/composables'
169
+ ;<WindowFrame title="Project overview" toolbar={<span>Workspace</span>}>
170
+ <div>Dashboard content</div>
171
+ </WindowFrame>
172
+ ```
173
+
137
174
  ### Consumer agent skill
138
175
 
139
176
  The npm package includes a `use-composables` agent skill at `skills/use-composables/SKILL.md`. Install or point your coding agent at that directory to give it the package workflow, semantic-styling rules, exact public entrypoints, and optional-dependency guidance. Its utility manifest is generated from the token registry by `bun scripts/generate-css.ts`; its public API manifest is generated from package metadata and public barrels by `bun scripts/generate-rules.ts`. Both generators support `--check`, keeping agent guidance aligned with the shipped contract.
@@ -268,9 +305,9 @@ Key token groups:
268
305
  | Control shape | `--button-radius`, `--badge-radius`, `--input-radius`, `--card-radius` |
269
306
  | Motion | `--motion-duration-overlay`, `--motion-duration-disclosure`, `--motion-ease-standard` |
270
307
 
271
- The entire type scale derives from `--font-size-base` and `--leading-base` — adjust those two tokens to scale all text globally.
308
+ The entire type scale derives from `--font-size-base` and `--leading-base`. Adjust those two tokens to scale all text globally.
272
309
 
273
- Control rounding is deliberately two-level. `--radius` drives the shared scale (`--radius-sm` … `--radius-4xl`) used by surfaces such as cards, dialogs, and alerts, while the component tokens `--button-radius` and `--badge-radius` decide button and badge corners independently — set `--button-radius: 9999px` for a pill-button theme without distorting anything else. For one-off exceptions, `Button` and `Badge` also accept `shape="pill"` (fully rounded; icon-size buttons become circles).
310
+ Control rounding is deliberately two-level. `--radius` drives the shared scale (`--radius-sm` … `--radius-4xl`) used by surfaces such as cards, dialogs, and alerts, while the component tokens `--button-radius` and `--badge-radius` decide button and badge corners independently. Set `--button-radius: 9999px` for a pill-button theme without distorting anything else. For one-off exceptions, `Button` and `Badge` also accept `shape="pill"` (fully rounded; icon-size buttons become circles).
274
311
 
275
312
  ### Motion Modes
276
313
 
@@ -524,4 +561,4 @@ All normal components import from `@leitware/composables`; AI components import
524
561
 
525
562
  ## License
526
563
 
527
- MIT — see [LICENSE](LICENSE) for details.
564
+ MIT. See [LICENSE](LICENSE) for details.
@@ -1,5 +1,5 @@
1
1
  /* ============================================================================
2
- @leitware/composables — Brutalist Preset
2
+ @leitware/composables - Brutalist Preset
3
3
  ============================================================================
4
4
  Raw, architectural, uncompromising. Structural honesty: things look exactly like what they are.
5
5
 
@@ -16,6 +16,7 @@
16
16
  --bg-surface-default: #ffffffff;
17
17
  --bg-surface-popover: #ffffffff;
18
18
  --bg-surface-accent: #f0f0f0ff;
19
+ --bg-surface-field: #0a0a0aff;
19
20
  --bg-surface-info: #e8f0f8ff;
20
21
  --bg-surface-success: #e8f4e8ff;
21
22
  --bg-surface-warning: #fbf4e0ff;
@@ -51,6 +52,7 @@
51
52
  --text-disabled: #aaaaaaff;
52
53
  --text-inverse: #f8f8f8ff;
53
54
  --text-on-fill-primary: #ffffffff;
55
+ --text-on-fill-brand: #ffffffff;
54
56
  --text-on-fill-secondary: #0a0a0aff;
55
57
  --text-on-surface-accent: #0a0a0aff;
56
58
  --text-info: #001e5eff;
@@ -191,12 +193,13 @@
191
193
  --bg-surface-default: #0a0a0aff;
192
194
  --bg-surface-popover: #141414ff;
193
195
  --bg-surface-accent: #1a1a1aff;
196
+ --bg-surface-field: #c0c0c0ff;
194
197
  --bg-surface-info: #0a1828ff;
195
198
  --bg-surface-success: #0a180aff;
196
199
  --bg-surface-warning: #1e1406ff;
197
200
  --bg-surface-critical: #1e0a0aff;
198
201
  --bg-surface-emphasis: #0a0a1eff;
199
- --bg-surface-inverse: #606060ff;
202
+ --bg-surface-inverse: #888888ff;
200
203
  --bg-surface-transparent: #ffffff10;
201
204
  --bg-overlay: var(--overlays-black-alpha-800);
202
205
  --bg-surface-brand: #1e0a08ff;
@@ -226,6 +229,7 @@
226
229
  --text-disabled: #444444ff;
227
230
  --text-inverse: #0a0a0aff;
228
231
  --text-on-fill-primary: #0a0a0aff;
232
+ --text-on-fill-brand: #000000ff;
229
233
  --text-on-fill-secondary: #f0f0f0ff;
230
234
  --text-on-surface-accent: #f0f0f0ff;
231
235
  --text-info: #99bbffff;
@@ -1,5 +1,5 @@
1
1
  /* ============================================================================
2
- @leitware/composables — Default Preset
2
+ @leitware/composables - Default Preset
3
3
  ============================================================================
4
4
  Clean, neutral, Inter-based. The "no opinion" starting point.
5
5
 
@@ -16,6 +16,7 @@
16
16
  --bg-surface-default: #f9f9f8ff;
17
17
  --bg-surface-popover: #f9f9f8ff;
18
18
  --bg-surface-accent: #f1f0efff;
19
+ --bg-surface-field: #dad9d6ff;
19
20
  --bg-surface-info: #f1fafdff;
20
21
  --bg-surface-success: #f5fbf5ff;
21
22
  --bg-surface-warning: #fff7edff;
@@ -51,6 +52,7 @@
51
52
  --text-disabled: #cfcecaff;
52
53
  --text-inverse: #ffffffff;
53
54
  --text-on-fill-primary: #ffffffff;
55
+ --text-on-fill-brand: #000000ff;
54
56
  --text-on-fill-secondary: #21201cff;
55
57
  --text-on-surface-accent: #21201cff;
56
58
  --text-info: #1d3e56ff;
@@ -191,6 +193,7 @@
191
193
  --bg-surface-default: #191918ff;
192
194
  --bg-surface-popover: #191918ff;
193
195
  --bg-surface-accent: #222221ff;
196
+ --bg-surface-field: #494844ff;
194
197
  --bg-surface-info: #111a27ff;
195
198
  --bg-surface-success: #141a15ff;
196
199
  --bg-surface-warning: #1e160fff;
@@ -226,6 +229,7 @@
226
229
  --text-disabled: #494844ff;
227
230
  --text-inverse: #000000ff;
228
231
  --text-on-fill-primary: #000000ff;
232
+ --text-on-fill-brand: #000000ff;
229
233
  --text-on-fill-secondary: #eeeeecff;
230
234
  --text-on-surface-accent: #eeeeecff;
231
235
  --text-info: #c2f3ffff;
@@ -1,5 +1,5 @@
1
1
  /* ============================================================================
2
- @leitware/composables — Signal Pop Preset
2
+ @leitware/composables - Signal Pop Preset
3
3
  ============================================================================
4
4
  Bright consumer-tech energy: electric modules, capsule controls, hard outlines, and codey labels.
5
5
 
@@ -16,6 +16,7 @@
16
16
  --bg-surface-default: #ffffffff;
17
17
  --bg-surface-popover: #ffffffff;
18
18
  --bg-surface-accent: #ff8bd3ff;
19
+ --bg-surface-field: #e8eef2ff;
19
20
  --bg-surface-info: #d7f0faff;
20
21
  --bg-surface-success: #def6d8ff;
21
22
  --bg-surface-warning: #ffe8b5ff;
@@ -51,6 +52,7 @@
51
52
  --text-disabled: #b9bdc6ff;
52
53
  --text-inverse: #f9faf2ff;
53
54
  --text-on-fill-primary: #ffffffff;
55
+ --text-on-fill-brand: #ffffffff;
54
56
  --text-on-fill-secondary: #050507ff;
55
57
  --text-on-surface-accent: #0b0b0fff;
56
58
  --text-info: #064864ff;
@@ -202,6 +204,7 @@
202
204
  --bg-surface-default: #050507ff;
203
205
  --bg-surface-popover: #050507ff;
204
206
  --bg-surface-accent: #351026ff;
207
+ --bg-surface-field: #17191fff;
205
208
  --bg-surface-info: #073348ff;
206
209
  --bg-surface-success: #0b3017ff;
207
210
  --bg-surface-warning: #342602ff;
@@ -237,6 +240,7 @@
237
240
  --text-disabled: #5b606aff;
238
241
  --text-inverse: #050507ff;
239
242
  --text-on-fill-primary: #ffffffff;
243
+ --text-on-fill-brand: #ffffffff;
240
244
  --text-on-fill-secondary: #050507ff;
241
245
  --text-on-surface-accent: #f7f8f2ff;
242
246
  --text-info: #9fdef2ff;