@cognitap/radiant 0.0.0-stage → 0.0.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.
- package/CHANGELOG.md +23 -0
- package/LICENSE +21 -0
- package/README.md +274 -2
- package/RELEASE_POLICY.md +154 -0
- package/dist/library/Button.d.ts +4 -0
- package/dist/library/Button.d.ts.map +1 -0
- package/dist/library/Button.js +6 -0
- package/dist/library/Button.js.map +1 -0
- package/dist/library/cn.d.ts +3 -0
- package/dist/library/cn.d.ts.map +1 -0
- package/dist/library/cn.js +9 -0
- package/dist/library/cn.js.map +1 -0
- package/dist/library/index.d.ts +3 -0
- package/dist/library/index.d.ts.map +1 -0
- package/dist/library/index.js +2 -0
- package/dist/library/index.js.map +1 -0
- package/dist/library/reset.css +2 -0
- package/dist/library/styles.css +2 -0
- package/package.json +98 -3
- package/src/Button.tsx +21 -0
- package/src/cn.ts +10 -0
- package/src/index.ts +2 -0
- package/src/styles.css +17 -0
- package/src/styles.d.ts +1 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
See the [release policy](RELEASE_POLICY.md) for versioning and migration rules.
|
|
4
|
+
|
|
5
|
+
## Unreleased
|
|
6
|
+
|
|
7
|
+
## 0.0.1
|
|
8
|
+
|
|
9
|
+
- Compiled `styles.css` for consumers without Tailwind, an optional compiled
|
|
10
|
+
`reset.css` and a source `tailwind.css` customization entry. Tailwind is now
|
|
11
|
+
an optional peer dependency.
|
|
12
|
+
- Button inherits application fonts and sets its own box sizing and border
|
|
13
|
+
style, so its default appearance does not require a global reset.
|
|
14
|
+
- Migration for Tailwind consumers: replace the old source `styles.css` import
|
|
15
|
+
with `tailwind.css` alongside your own Tailwind entry. Ordinary consumers
|
|
16
|
+
retain the `styles.css` import. Choose one route to avoid duplicate utilities;
|
|
17
|
+
import `reset.css` separately if you want Preflight.
|
|
18
|
+
- Public source under MIT, with the copyright notice naming Zoltán Cserei and
|
|
19
|
+
a documented maintainer workflow and public bug/accessibility reporting.
|
|
20
|
+
- Initial experimental Button with ESM JavaScript, TypeScript declarations and
|
|
21
|
+
source maps.
|
|
22
|
+
- Public package identity, release policy and publishing metadata prepared for
|
|
23
|
+
the first `0.0.1` release.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Zoltán Cserei
|
|
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/README.md
CHANGED
|
@@ -1,3 +1,275 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Radiant
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Reusable React interaction components and presentation primitives, maintained in
|
|
4
|
+
this standalone repository.
|
|
5
|
+
|
|
6
|
+
Radiant's source is available under the [MIT license](LICENSE). The library is
|
|
7
|
+
experimental: version `0.0.1` is a native Button proof of concept. The build
|
|
8
|
+
includes standalone component CSS, a separate optional reset and a Tailwind
|
|
9
|
+
customization entry.
|
|
10
|
+
See the
|
|
11
|
+
[release policy](RELEASE_POLICY.md) for identity, compatibility, support and
|
|
12
|
+
publication requirements, and the [changelog](CHANGELOG.md) for release changes.
|
|
13
|
+
|
|
14
|
+
Install the experimental package in a React application:
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
pnpm add --save-exact @cognitap/radiant@0.0.1
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Import `@cognitap/radiant/styles.css` once; see [Button](#button) for usage.
|
|
21
|
+
|
|
22
|
+
## Getting started
|
|
23
|
+
|
|
24
|
+
Use the Node version in `.nvmrc` and the pnpm version in `package.json`:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
nvm install
|
|
28
|
+
nvm use
|
|
29
|
+
npm install --global "$(node -p 'require("./package.json").packageManager')"
|
|
30
|
+
pnpm install --frozen-lockfile
|
|
31
|
+
pnpm storybook
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Open [Storybook](http://localhost:6006) for the primary component development
|
|
35
|
+
loop. No Cognitap checkout or private configuration is required.
|
|
36
|
+
|
|
37
|
+
| Command | Purpose |
|
|
38
|
+
| ------------------------------------------- | ------------------------------------------------------------ |
|
|
39
|
+
| `pnpm storybook` | Edit components in the local workshop |
|
|
40
|
+
| `pnpm build` | Build library JavaScript, declarations, maps and CSS |
|
|
41
|
+
| `pnpm watch` | Watch JavaScript, declarations and compiled component styles |
|
|
42
|
+
| `pnpm build:storybook` | Build the separate static workshop |
|
|
43
|
+
| `pnpm typecheck` | Check source and Storybook types |
|
|
44
|
+
| `pnpm test` | Verify builds and an independently installed archive |
|
|
45
|
+
| `pnpm test:package` | Build, pack and verify an isolated installed package |
|
|
46
|
+
| `pnpm lint` | Check correctness and accessibility lint rules |
|
|
47
|
+
| `pnpm fmt` | Format repository files |
|
|
48
|
+
| `pnpm fmt:check` | Check formatting |
|
|
49
|
+
| `pnpm check` | Run all checks, including the Storybook build |
|
|
50
|
+
| `pnpm release:prepare` | Pack and verify a release candidate; dry-run publication |
|
|
51
|
+
| `pnpm pack --pack-destination dist/package` | Create a package archive locally |
|
|
52
|
+
|
|
53
|
+
CI installs the pinned dependencies with the committed lockfile and runs
|
|
54
|
+
`pnpm check` and package creation. Installing dependencies registers the
|
|
55
|
+
pre-commit hook, which formats staged files. See
|
|
56
|
+
[CONTRIBUTING.md](CONTRIBUTING.md) for the maintainer workflow.
|
|
57
|
+
|
|
58
|
+
Releases are independent of Cognitap; see the
|
|
59
|
+
[release workflow](RELEASE_POLICY.md#release-workflow).
|
|
60
|
+
|
|
61
|
+
## Library build
|
|
62
|
+
|
|
63
|
+
From the repository root:
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
pnpm build
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The build removes `dist/library`, compiles JavaScript and declarations with
|
|
70
|
+
`tsc`, and compiles the two stylesheets with the Tailwind CLI. These are
|
|
71
|
+
development tools; ordinary consumers need only React and the packaged CSS.
|
|
72
|
+
|
|
73
|
+
TypeScript emits separate ES2022 ESM modules, `.d.ts` declarations, JavaScript
|
|
74
|
+
maps with embedded source, and declaration maps into `dist/library`. Keeping
|
|
75
|
+
modules separate preserves `use client` directives and external runtime imports:
|
|
76
|
+
React is a peer dependency and `cn` is a runtime dependency. Relative source
|
|
77
|
+
imports use `.js` extensions so emitted JavaScript and declarations work in Node
|
|
78
|
+
and bundlers, following [TypeScript's library guidance](https://www.typescriptlang.org/docs/handbook/modules/guides/choosing-compiler-options#im-writing-a-library).
|
|
79
|
+
|
|
80
|
+
The package root and three stylesheet entries are public exports. JavaScript,
|
|
81
|
+
types, component styles and the reset resolve to compiled artifacts. Sources ship for editor
|
|
82
|
+
navigation through declaration maps; stories, tests and Storybook output stay
|
|
83
|
+
out of the archive. Rebuilding cleans only `dist/library`.
|
|
84
|
+
|
|
85
|
+
JavaScript modules must remain free of import-time side effects. Bundlers can
|
|
86
|
+
discard unused modules; CSS is explicitly marked as having side effects so
|
|
87
|
+
stylesheet imports are retained. Browser interactions belong in the component's
|
|
88
|
+
lifecycle, and client-dependent modules need their own `use client` directive.
|
|
89
|
+
|
|
90
|
+
`pnpm test` builds the library, checks the Tailwind customization route locally,
|
|
91
|
+
and verifies the public package through an isolated installation.
|
|
92
|
+
|
|
93
|
+
### Installed archive verification
|
|
94
|
+
|
|
95
|
+
`pnpm test:package` builds Radiant, packs it into a temporary directory and
|
|
96
|
+
installs the archive there with npm. The small `tests/consumer` fixture owns
|
|
97
|
+
the public import/SSR, CSS, map, metadata and React-peer checks, plus independent
|
|
98
|
+
NodeNext and bundler declaration checks. It uses the repository's pinned React
|
|
99
|
+
and TypeScript versions, with no Tailwind or source aliases. Public package
|
|
100
|
+
checks run once, against installed artifacts. The directory and archive are
|
|
101
|
+
removed after success or failure.
|
|
102
|
+
|
|
103
|
+
`pnpm test` and `pnpm check` include this verification; npm and registry access
|
|
104
|
+
are required. Use `node scripts/verify-package.mjs /absolute/path/to/candidate.tgz`
|
|
105
|
+
to verify an existing release candidate without rebuilding or repacking it.
|
|
106
|
+
Browser interaction/hydration evidence and registry publication remain separate.
|
|
107
|
+
|
|
108
|
+
Storybook reads component source directly for rapid editing. `pnpm watch` uses
|
|
109
|
+
TypeScript and Tailwind's native watchers to update JavaScript, declarations and
|
|
110
|
+
the compiled component stylesheet. Run `pnpm build` first when using the watcher
|
|
111
|
+
on its own. The initial build also generates the optional reset; rerun
|
|
112
|
+
`pnpm build:css` after editing `styles/reset.css`. The watcher does not start Storybook.
|
|
113
|
+
|
|
114
|
+
For live integration, install dependencies in this checkout and Cognitap once,
|
|
115
|
+
then run `pnpm dev` from Cognitap. It automatically selects a sibling `../radiant`
|
|
116
|
+
checkout when present; `pnpm dev /path/to/radiant` selects another location, and
|
|
117
|
+
`pnpm dev --installed` selects the installed dependency explicitly. Without a
|
|
118
|
+
sibling checkout, development uses the installed dependency.
|
|
119
|
+
|
|
120
|
+
Cognitap builds the selected package, then starts its watchers and Storybook,
|
|
121
|
+
both frontend apps and Trantor together through Nx. The frontend processes resolve
|
|
122
|
+
this checkout's public exports through temporary aliases. The apps consume
|
|
123
|
+
compiled JavaScript and the documented Tailwind entry. Local Next.js development
|
|
124
|
+
uses Webpack for external package watching; ordinary development keeps Turbopack.
|
|
125
|
+
`Ctrl+C` stops the session.
|
|
126
|
+
Installed dependencies, manifests and lockfiles stay unchanged; ordinary Cognitap
|
|
127
|
+
checks and builds use its installed dependency even during a local session.
|
|
128
|
+
|
|
129
|
+
Run `pnpm dev --typecheck [checkout-path]` from Cognitap to refresh JavaScript,
|
|
130
|
+
declarations and maps with the `build:js` helper and check both apps against the
|
|
131
|
+
public declarations. The helper preserves the output directory and compiled
|
|
132
|
+
stylesheets during a watch session. Local commands select temporary type
|
|
133
|
+
configurations; editors normally read the ordinary app configurations, so use
|
|
134
|
+
this command to validate new public types. See
|
|
135
|
+
[Cognitap's development guide](https://github.com/cognitap/cognitap#live-radiant-development)
|
|
136
|
+
for the full workflow and Trantor setup.
|
|
137
|
+
|
|
138
|
+
Independent Storybook development needs no Cognitap checkout. Live integration
|
|
139
|
+
complements installed-archive and registry verification; it does not replace them.
|
|
140
|
+
|
|
141
|
+
## Button
|
|
142
|
+
|
|
143
|
+
```tsx
|
|
144
|
+
import { Button } from '@cognitap/radiant'
|
|
145
|
+
|
|
146
|
+
<Button onClick={handleContinue}>Continue</Button>
|
|
147
|
+
<Button disabled>Unavailable</Button>
|
|
148
|
+
<Button type="submit">Save</Button>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
`Button` accepts native React button props (`ButtonProps`), including `ref`,
|
|
152
|
+
`className`, `aria-*`, and form attributes. It defaults to `type="button"` to
|
|
153
|
+
avoid accidental form submission. Import its stylesheet once in your application:
|
|
154
|
+
|
|
155
|
+
```tsx
|
|
156
|
+
import '@cognitap/radiant/styles.css'
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
This route needs no Tailwind installation or CSS compiler. Components do not
|
|
160
|
+
import CSS themselves. The stylesheet contains component utilities and tokens;
|
|
161
|
+
it does not reset headings, body margins or unrelated native controls. Button
|
|
162
|
+
sets its own border style and box sizing and inherits the application's font.
|
|
163
|
+
|
|
164
|
+
The optional reset is a separate, application-wide choice:
|
|
165
|
+
|
|
166
|
+
```tsx
|
|
167
|
+
import '@cognitap/radiant/reset.css'
|
|
168
|
+
import '@cognitap/radiant/styles.css'
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
`reset.css` contains Tailwind Preflight, compiled and self-contained. It changes
|
|
172
|
+
global element defaults; importing it is not required for Radiant components.
|
|
173
|
+
|
|
174
|
+
Native button semantics provide keyboard activation and disabled behavior. Give
|
|
175
|
+
every button an accessible name through its text or `aria-label`. Focus indicators
|
|
176
|
+
and forced-colors borders are included. Use a link for navigation.
|
|
177
|
+
|
|
178
|
+
This PoC has one visual treatment, with no variants, sizes, loading state, or
|
|
179
|
+
polymorphic rendering. The consumer owns actions and state. React 19.3+ is a peer
|
|
180
|
+
dependency.
|
|
181
|
+
|
|
182
|
+
## Tailwind customization
|
|
183
|
+
|
|
184
|
+
For an application with Tailwind 4.3.3+, use the source customization entry
|
|
185
|
+
instead of the compiled component sheet. It provides the semantic theme and
|
|
186
|
+
registers Radiant's shipped component sources for scanning; your application
|
|
187
|
+
generates the utilities once with its own Tailwind integration:
|
|
188
|
+
|
|
189
|
+
```css
|
|
190
|
+
@import 'tailwindcss';
|
|
191
|
+
@import '@cognitap/radiant/tailwind.css';
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
The application's `tailwindcss` import includes Preflight. To keep the reset
|
|
195
|
+
disabled, use [Tailwind's separate imports](https://tailwindcss.com/docs/preflight#disabling-preflight):
|
|
196
|
+
|
|
197
|
+
```css
|
|
198
|
+
@layer theme, base, components, utilities;
|
|
199
|
+
@import 'tailwindcss/theme.css' layer(theme);
|
|
200
|
+
@import 'tailwindcss/utilities.css' layer(utilities);
|
|
201
|
+
@import '@cognitap/radiant/tailwind.css';
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Choose one component-style route: compiled `styles.css` or generated
|
|
205
|
+
`tailwind.css`. Combining them duplicates the component utilities. The source
|
|
206
|
+
entry does not import Tailwind or generate a second utility sheet. Its `@source`
|
|
207
|
+
is relative to the installed source entry, so library scanning works inside
|
|
208
|
+
`node_modules`; stories and tests are excluded. Application scanning belongs to
|
|
209
|
+
your Tailwind setup. Configure its source base or add an application-relative
|
|
210
|
+
`@source` when automatic scanning does not cover your files. See
|
|
211
|
+
[Tailwind's source detection guide](https://tailwindcss.com/docs/detecting-classes-in-source-files).
|
|
212
|
+
|
|
213
|
+
Tokens provide background, foreground, border, primary action states and foreground,
|
|
214
|
+
disabled background and foreground, focus color, and control radius. Components
|
|
215
|
+
use semantic utilities such as `bg-primary`, `text-primary-foreground`, and
|
|
216
|
+
`rounded-control`. Override the corresponding CSS variables to theme an application
|
|
217
|
+
or a subtree; these defaults currently define a light theme.
|
|
218
|
+
|
|
219
|
+
`src/cn.ts` registers the semantic control radius with `cn` so it participates in
|
|
220
|
+
class conflict resolution. Components merge classes with this helper, passing the
|
|
221
|
+
caller's `className` last so matching utilities override defaults. In a Tailwind app, for example,
|
|
222
|
+
`<Button className="rounded-full px-8 hover:bg-red-500">Continue</Button>` replaces
|
|
223
|
+
the default corner radius, horizontal padding, and hover color. Disabled
|
|
224
|
+
overrides use the same prefix, such as `disabled:bg-slate-300`. The compiled
|
|
225
|
+
sheet only includes utilities used by library components; arbitrary caller
|
|
226
|
+
utilities need your own generated CSS. Without Tailwind, use ordinary CSS
|
|
227
|
+
classes or override the semantic variables. Unlayered application CSS takes
|
|
228
|
+
precedence over Radiant's layered utilities.
|
|
229
|
+
|
|
230
|
+
## Storybook
|
|
231
|
+
|
|
232
|
+
Storybook uses React and Vite and lives in this package. From the repository root:
|
|
233
|
+
|
|
234
|
+
```sh
|
|
235
|
+
pnpm storybook
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Open http://localhost:6006. The server binds to localhost.
|
|
239
|
+
|
|
240
|
+
Build a static site:
|
|
241
|
+
|
|
242
|
+
```sh
|
|
243
|
+
pnpm build:storybook
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Output goes to `dist/storybook`, separate from the library build.
|
|
247
|
+
`pnpm check` validates both the library and the static workshop. Each build
|
|
248
|
+
preserves the other's output.
|
|
249
|
+
|
|
250
|
+
### Accessibility checks
|
|
251
|
+
|
|
252
|
+
Start Storybook, open a story under **Components → Button** (including **Disabled**),
|
|
253
|
+
and select the **Accessibility** panel. The official `@storybook/addon-a11y` addon
|
|
254
|
+
runs axe-core checks automatically for each story, including new stories. Use
|
|
255
|
+
**Rerun accessibility scan** after changing controls to check the updated state.
|
|
256
|
+
|
|
257
|
+
Review **Violations** for detected issues, **Passes** for successful checks, and
|
|
258
|
+
**Inconclusive** for checks that need human judgment. Expand a result to see the
|
|
259
|
+
rule, affected elements, and guidance; highlighting elements helps locate them
|
|
260
|
+
in the canvas. A disabled button may be exempt from checks such as color contrast.
|
|
261
|
+
|
|
262
|
+
Automated checks cover only part of WCAG. A clean result does not establish WCAG
|
|
263
|
+
conformance: manually review keyboard navigation, focus visibility, screen reader
|
|
264
|
+
behavior, and interaction states in the consuming application as well.
|
|
265
|
+
See [Storybook's accessibility testing guide](https://storybook.js.org/docs/writing-tests/accessibility-testing).
|
|
266
|
+
|
|
267
|
+
## Adding stories
|
|
268
|
+
|
|
269
|
+
Add `*.stories.tsx` beside a component in `src/`. Import `Meta` and `StoryObj`
|
|
270
|
+
from `@storybook/react-vite`, define metadata with `satisfies Meta<typeof Component>`,
|
|
271
|
+
and export a `StoryObj<typeof meta>` for each supported state. Preview configuration
|
|
272
|
+
enables generated documentation globally. Use `fn()` from `storybook/test` for
|
|
273
|
+
callback args, so interactions appear in the Actions panel.
|
|
274
|
+
|
|
275
|
+
`src/Button.stories.tsx` demonstrates the real Button in enabled and disabled states.
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Radiant release policy
|
|
2
|
+
|
|
3
|
+
Confirmed in DEV-84 on 13 October 2026. Radiant releases independently of Cognitap
|
|
4
|
+
deployments; the owner and trusted maintainers control development and merges.
|
|
5
|
+
|
|
6
|
+
## Identity and licensing
|
|
7
|
+
|
|
8
|
+
This repository is the authoritative Radiant source. Its selected GitHub identity
|
|
9
|
+
is `cognitap/radiant`; the npm package is `@cognitap/radiant`.
|
|
10
|
+
|
|
11
|
+
The source is licensed under MIT. [LICENSE](LICENSE) contains the complete text
|
|
12
|
+
and names Zoltán Cserei as the copyright holder. Corporate formation is not a
|
|
13
|
+
prerequisite for source opening or npm publication. This decision supersedes
|
|
14
|
+
DEV-84's initial incorporation gate.
|
|
15
|
+
|
|
16
|
+
Keep `private: true` in the package manifest until npm publication prerequisites
|
|
17
|
+
pass. This prevents package publication while public source development proceeds.
|
|
18
|
+
|
|
19
|
+
## Versions
|
|
20
|
+
|
|
21
|
+
Start with ordinary `0.0.1` and publish experimental `0.x` releases under
|
|
22
|
+
`latest`. Make experimental status clear in the README and release notes.
|
|
23
|
+
The first stable release is `1.0.0`, after the complete 31-family catalog,
|
|
24
|
+
documentation and agreed accessibility and compatibility verification pass.
|
|
25
|
+
|
|
26
|
+
| Change | During `0.x` | From `1.0.0` |
|
|
27
|
+
| --------------------------------------------------- | ------------ | ------------ |
|
|
28
|
+
| Compatible correction | Patch | Patch |
|
|
29
|
+
| Compatible addition, cosmetic change or deprecation | Minor | Minor |
|
|
30
|
+
| Breaking change | Minor | Major |
|
|
31
|
+
|
|
32
|
+
Use the largest applicable bump. A correction that requires consumers to adapt
|
|
33
|
+
is breaking, including accessibility or security corrections. Pure internal
|
|
34
|
+
changes can use a patch when they preserve the public contract. Published
|
|
35
|
+
versions are immutable; follow-up fixes receive a new version.
|
|
36
|
+
|
|
37
|
+
Future previews can use prerelease suffixes and separate tags without replacing
|
|
38
|
+
the ordinary release under `latest`. Version numbers follow
|
|
39
|
+
[SemVer](https://semver.org/); [npm tags](https://docs.npmjs.com/cli/v11/commands/npm-dist-tag/)
|
|
40
|
+
select distribution channels independently.
|
|
41
|
+
|
|
42
|
+
## Compatibility and consumer requirements
|
|
43
|
+
|
|
44
|
+
The public contract includes documented props and types, exports, behavior,
|
|
45
|
+
semantic tokens, named parts, state attributes and functional CSS requirements.
|
|
46
|
+
Incompatible changes to these, or sizing/layout changes requiring consumer
|
|
47
|
+
adaptation, are breaking.
|
|
48
|
+
|
|
49
|
+
Raising consumer dependency requirements or narrowing the declared environment
|
|
50
|
+
support policy is also breaking. Versions aging out of an unchanged rolling
|
|
51
|
+
browser or OS support target do not themselves require a breaking release.
|
|
52
|
+
Record tested combinations separately from support targets.
|
|
53
|
+
|
|
54
|
+
Generated utility strings and foundation internals remain private. Package
|
|
55
|
+
exports define the supported import surface; shipping source for editor
|
|
56
|
+
navigation does not make internal imports supported.
|
|
57
|
+
|
|
58
|
+
React remains a peer dependency. Keep the current range initially; changes need
|
|
59
|
+
installed-package verification. The [package manifest](package.json) declares
|
|
60
|
+
current peer ranges and runtime dependencies. Contributor Node, pnpm and
|
|
61
|
+
TypeScript pins belong to development configuration and do not establish
|
|
62
|
+
consumer runtime or declaration requirements.
|
|
63
|
+
|
|
64
|
+
Ordinary consumers use compiled `styles.css` without Tailwind. The optional
|
|
65
|
+
`reset.css` is a separate, global opt-in; importing components loads neither
|
|
66
|
+
stylesheet automatically. Tailwind belongs to the optional `tailwind.css`
|
|
67
|
+
customization route, which registers the library theme and sources for the
|
|
68
|
+
application's own CSS generation. Choose one component stylesheet route.
|
|
69
|
+
|
|
70
|
+
Cognitap pins exact published versions after its migration. Optional local
|
|
71
|
+
development watches this package's public build and selects its exports through
|
|
72
|
+
process-only aliases. The apps use compiled JavaScript/types and the supported
|
|
73
|
+
Tailwind entry. Installed dependencies stay unchanged, so stopping needs no
|
|
74
|
+
restore step. Normal consumption after migration requires
|
|
75
|
+
only the published package. Local updates complement archive and registry
|
|
76
|
+
verification and do not replace publication readiness checks.
|
|
77
|
+
|
|
78
|
+
## Support and upgrades
|
|
79
|
+
|
|
80
|
+
Maintain the current stable major through its latest minor and patch releases.
|
|
81
|
+
Before `1.0.0`, fixes land in the latest experimental release. There is no
|
|
82
|
+
standing commitment to older release branches or response deadlines.
|
|
83
|
+
|
|
84
|
+
Every published version has a changelog entry describing its consumer-facing
|
|
85
|
+
changes and relevant verification limits. Identify breaking changes and include
|
|
86
|
+
actionable migration instructions. After `1.0.0`, normally deprecate in a minor
|
|
87
|
+
before removal in a major, without a fixed waiting period. During `0.x`, direct
|
|
88
|
+
removal is allowed with migration guidance.
|
|
89
|
+
|
|
90
|
+
## Publication readiness
|
|
91
|
+
|
|
92
|
+
Public source opening requires the finalized MIT notice, repository control and
|
|
93
|
+
verified standalone tooling. Initial npm publication additionally
|
|
94
|
+
requires scope permissions, compiled CSS, verified installed archives and an
|
|
95
|
+
independent release workflow.
|
|
96
|
+
|
|
97
|
+
Archives include the public build, stylesheet, editor-navigation sources, README,
|
|
98
|
+
LICENSE, changelog and this policy; exclude tests, stories and Storybook output.
|
|
99
|
+
The manifest's allowlist and exports define what ships and what is public.
|
|
100
|
+
|
|
101
|
+
The selected publishing configuration uses public npm access and `latest`.
|
|
102
|
+
Keep publication disabled until its prerequisites pass. Neither public source
|
|
103
|
+
nor an experimental package establishes stable catalog readiness or conformance
|
|
104
|
+
for an entire consumer application.
|
|
105
|
+
|
|
106
|
+
## Release workflow
|
|
107
|
+
|
|
108
|
+
Releases use native pnpm versioning and reviewed changelog notes. In a pull
|
|
109
|
+
request, run `pnpm version patch --no-git-tag-version` (or `minor`, following
|
|
110
|
+
the table above), move the applicable Unreleased notes under a `## <version>`
|
|
111
|
+
heading in `CHANGELOG.md` and commit both. The first release keeps `0.0.1`.
|
|
112
|
+
|
|
113
|
+
From a clean checkout, `pnpm release:prepare` checks the version and notes,
|
|
114
|
+
builds and packs once, runs the installed consumer check against that archive
|
|
115
|
+
and dry-runs its publication. It writes `dist/release/radiant.tgz` and a
|
|
116
|
+
`release.json` receipt recording the version, source commit and SHA-512
|
|
117
|
+
integrity. Source checks are left to CI, which must pass before merging to
|
|
118
|
+
`main`.
|
|
119
|
+
|
|
120
|
+
Only experimental `0.x` versions are accepted. Enabling `1.0.0` requires a
|
|
121
|
+
reviewed change to the release script backed by the complete catalog,
|
|
122
|
+
documentation and accessibility/compatibility audit.
|
|
123
|
+
|
|
124
|
+
The manual **Release Radiant** workflow prepares and uploads a candidate. With
|
|
125
|
+
`publish` selected on `main`, a separate job holding npm OIDC permission
|
|
126
|
+
publishes that same archive and checks that npm's integrity matches the
|
|
127
|
+
receipt. Preparation refuses to publish while the manifest is `private`.
|
|
128
|
+
|
|
129
|
+
### First publication (DEV-94)
|
|
130
|
+
|
|
131
|
+
Confirm the npm account can publish to the `@cognitap` scope and recheck the MIT
|
|
132
|
+
notice, then remove `private` in a reviewed change. Publish the first candidate
|
|
133
|
+
manually, since trusted publishing needs an existing package. When the next
|
|
134
|
+
release is ready, add an npm trusted publisher for repository
|
|
135
|
+
`cognitap/radiant`, workflow `release.yml` and environment `npm`, enable direct
|
|
136
|
+
publishing, restrict that GitHub environment to `main`, and publish through it
|
|
137
|
+
within two days before the unused configuration expires. Published versions cannot be republished to test
|
|
138
|
+
the setup. Later releases publish from the workflow with provenance and no
|
|
139
|
+
stored token; the first authenticated local publication has no CI provenance.
|
|
140
|
+
|
|
141
|
+
### Failed publication and fixes
|
|
142
|
+
|
|
143
|
+
Fix the cause, such as scope access or trusted-publisher configuration, and
|
|
144
|
+
rerun the failed publish job; it reuses the original candidate. Never change
|
|
145
|
+
source or regenerate a candidate to retry. After a timeout, check whether npm
|
|
146
|
+
accepted the upload before retrying:
|
|
147
|
+
|
|
148
|
+
```sh
|
|
149
|
+
pnpm view @cognitap/radiant@<version> dist.integrity
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
If it matches the receipt, the release succeeded; if it differs, stop and
|
|
153
|
+
investigate. Published versions are immutable, so fixes ship as a new version
|
|
154
|
+
with new notes.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAG3C,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;AAElD,wBAAgB,MAAM,CAAC,EAAE,IAAe,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,+BAe3E"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from './cn.js';
|
|
3
|
+
export function Button({ type = 'button', className, ...props }) {
|
|
4
|
+
return (_jsx("button", { type: type, className: cn('box-border inline-flex min-h-11 items-center justify-center rounded-control border border-solid border-transparent bg-primary px-5 py-2.5 text-center font-[family-name:inherit] text-[length:inherit] font-semibold leading-6 text-primary-foreground', 'cursor-pointer hover:bg-primary-hover active:bg-primary-active', 'focus-visible:outline-3 focus-visible:outline-offset-3 focus-visible:outline-focus', 'disabled:cursor-not-allowed disabled:bg-disabled disabled:text-disabled-foreground', 'forced-colors:border-[ButtonText] forced-colors:disabled:border-[GrayText] forced-colors:disabled:text-[GrayText]', className), ...props }));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/Button.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AAI5B,MAAM,UAAU,MAAM,CAAC,EAAE,IAAI,GAAG,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAe;IAC1E,OAAO,CACL,iBACE,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,EAAE,CACX,wPAAwP,EACxP,gEAAgE,EAChE,oFAAoF,EACpF,oFAAoF,EACpF,mHAAmH,EACnH,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC","sourcesContent":["import type { ComponentProps } from 'react'\nimport { cn } from './cn.js'\n\nexport type ButtonProps = ComponentProps<'button'>\n\nexport function Button({ type = 'button', className, ...props }: ButtonProps) {\n return (\n <button\n type={type}\n className={cn(\n 'box-border inline-flex min-h-11 items-center justify-center rounded-control border border-solid border-transparent bg-primary px-5 py-2.5 text-center font-[family-name:inherit] text-[length:inherit] font-semibold leading-6 text-primary-foreground',\n 'cursor-pointer hover:bg-primary-hover active:bg-primary-active',\n 'focus-visible:outline-3 focus-visible:outline-offset-3 focus-visible:outline-focus',\n 'disabled:cursor-not-allowed disabled:bg-disabled disabled:text-disabled-foreground',\n 'forced-colors:border-[ButtonText] forced-colors:disabled:border-[GrayText] forced-colors:disabled:text-[GrayText]',\n className\n )}\n {...props}\n />\n )\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/cn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,IAAI,CAAA;AAGpC,eAAO,MAAM,EAAE,EAAE,UAMf,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cn.js","sourceRoot":"","sources":["../../src/cn.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEpC,MAAM,CAAC,MAAM,EAAE,GAAe,QAAQ,CAAC;IACrC,MAAM,EAAE;QACN,WAAW,EAAE;YACX,OAAO,EAAE,CAAC,iBAAiB,CAAC;SAC7B;KACF;CACF,CAAC,CAAA","sourcesContent":["import type { CnFunction } from 'cn'\nimport { createCn } from 'cn/config'\n\nexport const cn: CnFunction = createCn({\n extend: {\n classGroups: {\n rounded: ['rounded-control']\n }\n }\n})\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA","sourcesContent":["export { Button } from './Button.js'\nexport type { ButtonProps } from './Button.js'\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer theme;@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-feature-settings:normal;font-variation-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components,utilities;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-outline-style:solid}}}@layer theme{:root,:host{--spacing:.25rem;--font-weight-semibold:600;--color-background:#fff;--color-foreground:#0f172a;--color-border:#cbd5e1;--color-primary:#1e293b;--color-primary-hover:#0f172a;--color-primary-active:#020617;--color-primary-foreground:#fff;--color-disabled:#e2e8f0;--color-disabled-foreground:#475569;--color-focus:#2563eb;--radius-control:.5rem}}@layer base,components;@layer utilities{.box-border{box-sizing:border-box}.inline-flex{display:inline-flex}.min-h-11{min-height:calc(var(--spacing) * 11)}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-center{justify-content:center}.rounded{border-radius:.25rem}.rounded-control{border-radius:var(--radius-control)}.border{border-style:var(--tw-border-style);border-width:1px}.border-solid{--tw-border-style:solid;border-style:solid}.border-transparent{border-color:#0000}.bg-primary{background-color:var(--color-primary)}.px-5{padding-inline:calc(var(--spacing) * 5)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.text-center{text-align:center}.font-\[family-name\:inherit\]{font-family:inherit}.text-\[length\:inherit\]{font-size:inherit}.leading-6{--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-primary-foreground{color:var(--color-primary-foreground)}@media (hover:hover){.hover\:bg-primary-hover:hover{background-color:var(--color-primary-hover)}}.focus-visible\:outline-3:focus-visible{outline-style:var(--tw-outline-style);outline-width:3px}.focus-visible\:outline-offset-3:focus-visible{outline-offset:3px}.focus-visible\:outline-focus:focus-visible{outline-color:var(--color-focus)}.active\:bg-primary-active:active{background-color:var(--color-primary-active)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-disabled:disabled{background-color:var(--color-disabled)}.disabled\:text-disabled-foreground:disabled{color:var(--color-disabled-foreground)}@media (forced-colors:active){.forced-colors\:border-\[ButtonText\]{border-color:buttontext}.forced-colors\:disabled\:border-\[GrayText\]:disabled{border-color:graytext}.forced-colors\:disabled\:text-\[GrayText\]:disabled{color:graytext}}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}
|
package/package.json
CHANGED
|
@@ -1,6 +1,101 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognitap/radiant",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "React interaction components and presentation primitives",
|
|
5
|
+
"homepage": "https://github.com/cognitap/radiant#readme",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/cognitap/radiant/issues"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/cognitap/radiant.git"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"LICENSE",
|
|
16
|
+
"CHANGELOG.md",
|
|
17
|
+
"RELEASE_POLICY.md",
|
|
18
|
+
"dist/library",
|
|
19
|
+
"src/**/*.ts",
|
|
20
|
+
"src/**/*.tsx",
|
|
21
|
+
"src/styles.css",
|
|
22
|
+
"!src/**/*.stories.*",
|
|
23
|
+
"!src/**/*.test.*"
|
|
24
|
+
],
|
|
25
|
+
"type": "module",
|
|
26
|
+
"sideEffects": [
|
|
27
|
+
"**/*.css"
|
|
28
|
+
],
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/library/index.d.ts",
|
|
32
|
+
"default": "./dist/library/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./styles.css": "./dist/library/styles.css",
|
|
35
|
+
"./reset.css": "./dist/library/reset.css",
|
|
36
|
+
"./tailwind.css": "./src/styles.css"
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public",
|
|
40
|
+
"registry": "https://registry.npmjs.org/",
|
|
41
|
+
"tag": "latest"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"cn": "0.4.0"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@storybook/addon-a11y": "10.6.1",
|
|
48
|
+
"@storybook/addon-docs": "10.6.1",
|
|
49
|
+
"@storybook/react-vite": "10.6.1",
|
|
50
|
+
"@tailwindcss/cli": "4.3.3",
|
|
51
|
+
"@tailwindcss/vite": "4.3.3",
|
|
52
|
+
"@types/node": "26.6.5",
|
|
53
|
+
"@types/react": "19.3.0",
|
|
54
|
+
"@types/react-dom": "19.3.0",
|
|
55
|
+
"husky": "9.1.7",
|
|
56
|
+
"lint-staged": "17.6.0",
|
|
57
|
+
"oxfmt": "0.72.0",
|
|
58
|
+
"oxlint": "1.87.0",
|
|
59
|
+
"react": "19.3.0",
|
|
60
|
+
"react-dom": "19.3.0",
|
|
61
|
+
"rimraf": "6.1.3",
|
|
62
|
+
"storybook": "10.6.1",
|
|
63
|
+
"tailwindcss": "4.3.3",
|
|
64
|
+
"typescript": "6.0.3",
|
|
65
|
+
"vite": "8.3.4"
|
|
66
|
+
},
|
|
67
|
+
"peerDependencies": {
|
|
68
|
+
"react": "^19.3.0",
|
|
69
|
+
"tailwindcss": "^4.3.3"
|
|
70
|
+
},
|
|
71
|
+
"peerDependenciesMeta": {
|
|
72
|
+
"tailwindcss": {
|
|
73
|
+
"optional": true
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"devEngines": {
|
|
77
|
+
"runtime": {
|
|
78
|
+
"name": "node",
|
|
79
|
+
"version": "26.11.1",
|
|
80
|
+
"onFail": "download"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"scripts": {
|
|
84
|
+
"storybook": "storybook dev --host 127.0.0.1 --port 6006 --no-open --disable-telemetry",
|
|
85
|
+
"build": "rimraf dist/library && pnpm build:js && pnpm build:css",
|
|
86
|
+
"build:js": "tsc -p tsconfig.build.json",
|
|
87
|
+
"build:css": "tailwindcss -i styles/library.css -o dist/library/styles.css --minify && tailwindcss -i styles/reset.css -o dist/library/reset.css --minify",
|
|
88
|
+
"watch": "pnpm run --parallel '/^watch:/'",
|
|
89
|
+
"watch:js": "tsc -p tsconfig.build.json --watch --preserveWatchOutput",
|
|
90
|
+
"watch:styles": "tailwindcss -i styles/library.css -o dist/library/styles.css --watch=always",
|
|
91
|
+
"build:storybook": "storybook build --output-dir dist/storybook --disable-telemetry",
|
|
92
|
+
"test": "pnpm build && node --test tests/*.test.mjs && node scripts/verify-package.mjs",
|
|
93
|
+
"test:package": "pnpm build && node scripts/verify-package.mjs",
|
|
94
|
+
"typecheck": "tsc --noEmit",
|
|
95
|
+
"lint": "oxlint --deny-warnings",
|
|
96
|
+
"fmt": "oxfmt",
|
|
97
|
+
"fmt:check": "oxfmt --check",
|
|
98
|
+
"check": "pnpm fmt:check && pnpm lint && pnpm typecheck && pnpm test && pnpm build:storybook",
|
|
99
|
+
"release:prepare": "node scripts/prepare-release.mjs"
|
|
100
|
+
}
|
|
6
101
|
}
|
package/src/Button.tsx
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react'
|
|
2
|
+
import { cn } from './cn.js'
|
|
3
|
+
|
|
4
|
+
export type ButtonProps = ComponentProps<'button'>
|
|
5
|
+
|
|
6
|
+
export function Button({ type = 'button', className, ...props }: ButtonProps) {
|
|
7
|
+
return (
|
|
8
|
+
<button
|
|
9
|
+
type={type}
|
|
10
|
+
className={cn(
|
|
11
|
+
'box-border inline-flex min-h-11 items-center justify-center rounded-control border border-solid border-transparent bg-primary px-5 py-2.5 text-center font-[family-name:inherit] text-[length:inherit] font-semibold leading-6 text-primary-foreground',
|
|
12
|
+
'cursor-pointer hover:bg-primary-hover active:bg-primary-active',
|
|
13
|
+
'focus-visible:outline-3 focus-visible:outline-offset-3 focus-visible:outline-focus',
|
|
14
|
+
'disabled:cursor-not-allowed disabled:bg-disabled disabled:text-disabled-foreground',
|
|
15
|
+
'forced-colors:border-[ButtonText] forced-colors:disabled:border-[GrayText] forced-colors:disabled:text-[GrayText]',
|
|
16
|
+
className
|
|
17
|
+
)}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
)
|
|
21
|
+
}
|
package/src/cn.ts
ADDED
package/src/index.ts
ADDED
package/src/styles.css
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@source '.';
|
|
2
|
+
@source not './**/*.stories.*';
|
|
3
|
+
@source not './**/*.test.*';
|
|
4
|
+
|
|
5
|
+
@theme static {
|
|
6
|
+
--color-background: #fff;
|
|
7
|
+
--color-foreground: #0f172a;
|
|
8
|
+
--color-border: #cbd5e1;
|
|
9
|
+
--color-primary: #1e293b;
|
|
10
|
+
--color-primary-hover: #0f172a;
|
|
11
|
+
--color-primary-active: #020617;
|
|
12
|
+
--color-primary-foreground: #fff;
|
|
13
|
+
--color-disabled: #e2e8f0;
|
|
14
|
+
--color-disabled-foreground: #475569;
|
|
15
|
+
--color-focus: #2563eb;
|
|
16
|
+
--radius-control: 0.5rem;
|
|
17
|
+
}
|
package/src/styles.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module '*.css' {}
|