@cognitap/radiant 0.0.0-stage → 0.0.2
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 +16 -0
- package/LICENSE +21 -0
- package/README.md +106 -2
- package/RELEASE_POLICY.md +82 -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,16 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
See the [release policy](RELEASE_POLICY.md) for versioning and migration rules.
|
|
4
|
+
|
|
5
|
+
## Unreleased
|
|
6
|
+
|
|
7
|
+
## 0.0.2
|
|
8
|
+
|
|
9
|
+
- Documentation and maintainer tooling cleanup. The Button API, styles and
|
|
10
|
+
dependency requirements are unchanged; no migration is needed.
|
|
11
|
+
- Still experimental, with a single native Button. Automated package checks do
|
|
12
|
+
not replace manual keyboard, focus and screen reader verification.
|
|
13
|
+
|
|
14
|
+
## 0.0.1
|
|
15
|
+
|
|
16
|
+
- Public package identity for the first, `0.0.1` release. Do not expect granular updates until package is mature enough to be used by third parties.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Cserei Zoltán
|
|
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,107 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Radiant
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React interaction components and presentation primitives, published as
|
|
4
|
+
[`@cognitap/radiant`](https://www.npmjs.com/package/@cognitap/radiant) under the
|
|
5
|
+
[MIT license](LICENSE). Radiant is experimental: `0.0.2` contains a single native
|
|
6
|
+
Button.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
pnpm add --save-exact @cognitap/radiant@0.0.2
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Import the stylesheet once in your application. It needs no Tailwind and only
|
|
15
|
+
styles Radiant components:
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import '@cognitap/radiant/styles.css'
|
|
19
|
+
import { Button } from '@cognitap/radiant'
|
|
20
|
+
|
|
21
|
+
<Button onClick={handleContinue}>Continue</Button>
|
|
22
|
+
<Button disabled>Unavailable</Button>
|
|
23
|
+
<Button type="submit">Save</Button>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
For a global reset (Tailwind Preflight), also import `@cognitap/radiant/reset.css`
|
|
27
|
+
before `styles.css`. React 19.3+ is a peer dependency.
|
|
28
|
+
|
|
29
|
+
`Button` takes native button props, including `ref`, `aria-*` and form attributes,
|
|
30
|
+
and defaults to `type="button"`. Give every button an accessible name through its
|
|
31
|
+
text or `aria-label`, and use a link for navigation. There are no variants, sizes,
|
|
32
|
+
or loading state yet.
|
|
33
|
+
|
|
34
|
+
Components use semantic tokens such as `bg-primary` and `rounded-control`.
|
|
35
|
+
Override their CSS variables to theme an application or a subtree; the defaults
|
|
36
|
+
are a light theme. Unlayered application CSS takes precedence over Radiant's
|
|
37
|
+
styles.
|
|
38
|
+
|
|
39
|
+
### With Tailwind
|
|
40
|
+
|
|
41
|
+
Applications on Tailwind 4.3.3+ can import the source entry instead of
|
|
42
|
+
`styles.css`, so their own build generates Radiant's utilities. Use one route,
|
|
43
|
+
not both, or the utilities are duplicated:
|
|
44
|
+
|
|
45
|
+
```css
|
|
46
|
+
@import 'tailwindcss';
|
|
47
|
+
@import '@cognitap/radiant/tailwind.css';
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
To skip Preflight, replace `@import 'tailwindcss'` with
|
|
51
|
+
[Tailwind's separate imports](https://tailwindcss.com/docs/preflight#disabling-preflight).
|
|
52
|
+
Utilities passed in `className` replace matching defaults, including `hover:` and
|
|
53
|
+
`disabled:` variants: `<Button className="rounded-full hover:bg-red-500">`.
|
|
54
|
+
|
|
55
|
+
## Development
|
|
56
|
+
|
|
57
|
+
Use the Node.js version in `.nvmrc`. Any recent pnpm switches itself to the version
|
|
58
|
+
pinned in `package.json`:
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
nvm install && nvm use
|
|
62
|
+
npm install --global pnpm
|
|
63
|
+
pnpm install --frozen-lockfile
|
|
64
|
+
pnpm storybook
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Storybook runs at [localhost:6006](http://localhost:6006) and needs no Cognitap
|
|
68
|
+
checkout.
|
|
69
|
+
|
|
70
|
+
| Command | Purpose |
|
|
71
|
+
| ---------------------- | --------------------------------------------------------------- |
|
|
72
|
+
| `pnpm storybook` | Develop components in Storybook. |
|
|
73
|
+
| `pnpm build` | Build JavaScript, declarations, and CSS into `dist/library`. |
|
|
74
|
+
| `pnpm watch` | Rebuild on change, except `reset.css` (run `pnpm build` first). |
|
|
75
|
+
| `pnpm build:storybook` | Build static Storybook into `dist/storybook`. |
|
|
76
|
+
| `pnpm lint` | Run Oxlint, including accessibility rules. |
|
|
77
|
+
| `pnpm format` | Format with Oxfmt (`format:check` to check only). |
|
|
78
|
+
| `pnpm typecheck` | Check TypeScript. |
|
|
79
|
+
| `pnpm test` | Run style tests and verify the packed, installed package. |
|
|
80
|
+
| `pnpm test:package` | Verify the packed, installed package only. |
|
|
81
|
+
| `pnpm check` | Run formatting, lint, types, tests, and builds, as CI does. |
|
|
82
|
+
| `pnpm release:prepare` | Pack and verify a release candidate, then dry-run publishing. |
|
|
83
|
+
|
|
84
|
+
Package verification installs the archive with npm, so it needs network access.
|
|
85
|
+
A Husky pre-commit hook formats staged files with Oxfmt.
|
|
86
|
+
[CI](.github/workflows/ci.yml) runs `pnpm check`.
|
|
87
|
+
|
|
88
|
+
Modules must stay free of import-time side effects, and client-dependent modules
|
|
89
|
+
need their own `use client` directive. Add `*.stories.tsx` next to each component,
|
|
90
|
+
like `src/Button.stories.tsx`. Storybook's Accessibility panel runs axe checks on
|
|
91
|
+
every story, but automated checks cover only part of WCAG, so still test keyboard,
|
|
92
|
+
focus, and screen reader behavior by hand.
|
|
93
|
+
|
|
94
|
+
## Live development in Cognitap
|
|
95
|
+
|
|
96
|
+
With this checkout at `../radiant` and its dependencies installed, `pnpm dev` in
|
|
97
|
+
Cognitap builds and watches it, points both apps at it, and starts this Storybook.
|
|
98
|
+
Cognitap's installed package, manifests, and lockfile stay untouched. See
|
|
99
|
+
[Cognitap's guide](https://github.com/cognitap/cognitap#live-radiant-development)
|
|
100
|
+
for other checkouts and type checking.
|
|
101
|
+
|
|
102
|
+
## Further reading
|
|
103
|
+
|
|
104
|
+
- [Release policy](RELEASE_POLICY.md): versioning, compatibility, and the release workflow
|
|
105
|
+
- [Changelog](CHANGELOG.md): consumer-facing changes per release
|
|
106
|
+
- [CONTRIBUTING.md](CONTRIBUTING.md): maintainer workflow and bug reports
|
|
107
|
+
- [AGENTS.md](AGENTS.md): component and styling conventions
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Radiant release policy
|
|
2
|
+
|
|
3
|
+
Radiant releases independently of Cognitap deployments.
|
|
4
|
+
|
|
5
|
+
## Versions
|
|
6
|
+
|
|
7
|
+
Releases follow [SemVer](https://semver.org/). `0.x` releases are experimental
|
|
8
|
+
and publish under `latest`; say so in the README and release notes. `1.0.0`
|
|
9
|
+
follows once the full catalog, its documentation, and accessibility
|
|
10
|
+
and compatibility verification are complete.
|
|
11
|
+
|
|
12
|
+
Use the largest applicable bump. A fix that requires consumers to adapt is
|
|
13
|
+
breaking, even for accessibility or security. Published versions are immutable.
|
|
14
|
+
Prereleases use a version suffix and their own npm tag, never `latest`.
|
|
15
|
+
|
|
16
|
+
## Public contract
|
|
17
|
+
|
|
18
|
+
The contract covers documented props and types, package exports, behavior,
|
|
19
|
+
semantic tokens, named parts, state attributes and functional CSS requirements.
|
|
20
|
+
Breaking changes include incompatible changes to any of these, sizing or layout
|
|
21
|
+
changes consumers must adapt to, raised peer dependency ranges and narrowed
|
|
22
|
+
environment support.
|
|
23
|
+
|
|
24
|
+
## Support
|
|
25
|
+
|
|
26
|
+
Only the latest release is maintained: the latest `0.x` before `1.0.0`, then the
|
|
27
|
+
current major. There are no backports or response deadlines.
|
|
28
|
+
|
|
29
|
+
Every published version gets a changelog entry covering consumer-facing changes
|
|
30
|
+
and known verification gaps. Mark breaking changes and include migration steps.
|
|
31
|
+
From `1.0.0`, deprecate in a minor before removing in a major; during `0.x`,
|
|
32
|
+
direct removal is allowed.
|
|
33
|
+
|
|
34
|
+
## Release workflow
|
|
35
|
+
|
|
36
|
+
Releases use native pnpm versioning and reviewed changelog notes. In a pull
|
|
37
|
+
request, run `pnpm version patch --no-git-tag-version` (or `minor`, following
|
|
38
|
+
the rules above), move the applicable Unreleased notes under a `## <version>`
|
|
39
|
+
heading in `CHANGELOG.md` and commit both. The first release keeps `0.0.1`.
|
|
40
|
+
|
|
41
|
+
From a clean checkout, `pnpm release:prepare` checks the version and notes,
|
|
42
|
+
builds and packs once, runs the installed consumer check against that archive
|
|
43
|
+
and dry-runs its publication. It writes `dist/release/radiant.tgz` and a
|
|
44
|
+
`release.json` receipt recording the version, source commit and SHA-512
|
|
45
|
+
integrity. Source checks are left to CI, which must pass before merging to
|
|
46
|
+
`main`.
|
|
47
|
+
|
|
48
|
+
Only experimental `0.x` versions are accepted. Enabling `1.0.0` requires a
|
|
49
|
+
reviewed change to the release script backed by the complete catalog,
|
|
50
|
+
documentation and accessibility/compatibility audit.
|
|
51
|
+
|
|
52
|
+
The manual **Release Radiant** workflow prepares and uploads a candidate. With
|
|
53
|
+
`publish` selected on `main`, a separate job holding npm OIDC permission
|
|
54
|
+
publishes that same archive and checks that npm's integrity matches the
|
|
55
|
+
receipt. Preparation refuses to publish while the manifest is `private`.
|
|
56
|
+
|
|
57
|
+
### First publication (DEV-94)
|
|
58
|
+
|
|
59
|
+
Confirm the npm account can publish to the `@cognitap` scope and recheck the MIT
|
|
60
|
+
notice, then remove `private` in a reviewed change. Publish the first candidate
|
|
61
|
+
manually, since trusted publishing needs an existing package. When the next
|
|
62
|
+
release is ready, add an npm trusted publisher for repository
|
|
63
|
+
`cognitap/radiant`, workflow `release.yml` and environment `npm`, enable direct
|
|
64
|
+
publishing, restrict that GitHub environment to `main`, and publish through it
|
|
65
|
+
within two days before the unused configuration expires. Published versions cannot be republished to test
|
|
66
|
+
the setup. Later releases publish from the workflow with provenance and no
|
|
67
|
+
stored token; the first authenticated local publication has no CI provenance.
|
|
68
|
+
|
|
69
|
+
### Failed publication and fixes
|
|
70
|
+
|
|
71
|
+
Fix the cause, such as scope access or trusted-publisher configuration, and
|
|
72
|
+
rerun the failed publish job; it reuses the original candidate. Never change
|
|
73
|
+
source or regenerate a candidate to retry. After a timeout, check whether npm
|
|
74
|
+
accepted the upload before retrying:
|
|
75
|
+
|
|
76
|
+
```sh
|
|
77
|
+
pnpm view @cognitap/radiant@<version> dist.integrity
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
If it matches the receipt, the release succeeded; if it differs, stop and
|
|
81
|
+
investigate. Published versions are immutable, so fixes ship as a new version
|
|
82
|
+
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.2",
|
|
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
|
+
"format": "oxfmt",
|
|
97
|
+
"format:check": "oxfmt --check",
|
|
98
|
+
"check": "pnpm format: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' {}
|