@toyu-ui/solid 0.1.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.
- package/LICENSE +21 -0
- package/README.md +79 -0
- package/button.d.ts +13 -0
- package/button.js +22 -0
- package/checkbox.d.ts +12 -0
- package/checkbox.js +19 -0
- package/custom-elements.json +715 -0
- package/define/button.d.ts +1 -0
- package/define/button.js +1 -0
- package/define/center.d.ts +1 -0
- package/define/center.js +1 -0
- package/define/checkbox.d.ts +1 -0
- package/define/checkbox.js +1 -0
- package/define/cluster.d.ts +1 -0
- package/define/cluster.js +1 -0
- package/define/container.d.ts +1 -0
- package/define/container.js +1 -0
- package/define/flex.d.ts +1 -0
- package/define/flex.js +1 -0
- package/define/frame.d.ts +1 -0
- package/define/frame.js +1 -0
- package/define/grid.d.ts +1 -0
- package/define/grid.js +1 -0
- package/define/input.d.ts +1 -0
- package/define/input.js +1 -0
- package/define/radio-group.d.ts +1 -0
- package/define/radio-group.js +1 -0
- package/define/radio.d.ts +1 -0
- package/define/radio.js +1 -0
- package/define/sidebar.d.ts +1 -0
- package/define/sidebar.js +1 -0
- package/define.d.ts +1 -0
- package/define.js +1 -0
- package/helpers/index.d.ts +2 -0
- package/index.d.ts +6 -0
- package/index.js +12 -0
- package/input.d.ts +19 -0
- package/input.js +25 -0
- package/jsx.d.ts +151 -0
- package/jsx.js +1 -0
- package/package.json +123 -0
- package/radio-group.d.ts +13 -0
- package/radio-group.js +20 -0
- package/radio.d.ts +12 -0
- package/radio.js +19 -0
- package/skills/button/SKILL.md +35 -0
- package/skills/center/SKILL.md +38 -0
- package/skills/checkbox/SKILL.md +37 -0
- package/skills/cluster/SKILL.md +38 -0
- package/skills/components/SKILL.md +38 -0
- package/skills/container/SKILL.md +38 -0
- package/skills/flex/SKILL.md +38 -0
- package/skills/frame/SKILL.md +38 -0
- package/skills/grid/SKILL.md +38 -0
- package/skills/input/SKILL.md +37 -0
- package/skills/radio/SKILL.md +37 -0
- package/skills/radio-group/SKILL.md +38 -0
- package/skills/setup/SKILL.md +49 -0
- package/skills/sidebar/SKILL.md +38 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Juro Kapsiar
|
|
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 all
|
|
13
|
+
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 THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<h1><span color="blue">T</span><span color="cyan">Y</span>UI</h1>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<strong>framework-neutral component library</strong>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://github.com/jurokapsiar/tyui"><img src="https://img.shields.io/badge/version-0.0.0-blue?style=flat-square" alt="Version" /></a>
|
|
11
|
+
<a href="https://yarnpkg.com/"><img src="https://img.shields.io/badge/Yarn-4.5.0-2C8EBB?style=flat-square&logo=yarn&logoColor=white" alt="Yarn" /></a>
|
|
12
|
+
<a href="https://nx.dev/"><img src="https://img.shields.io/badge/Nx-22.6.5-143055?style=flat-square&logo=nx&logoColor=white" alt="Nx" /></a>
|
|
13
|
+
<a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-6.0.3-3178C6?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript" /></a>
|
|
14
|
+
<a href="https://vite.dev/"><img src="https://img.shields.io/badge/Vite-7.1.11-646CFF?style=flat-square&logo=vite&logoColor=white" alt="Vite" /></a>
|
|
15
|
+
<a href="https://storybook.js.org/"><img src="https://img.shields.io/badge/Storybook-10.3.5-FF4785?style=flat-square&logo=storybook&logoColor=white" alt="Storybook" /></a>
|
|
16
|
+
<a href="https://lit.dev/"><img src="https://img.shields.io/badge/Lit-3.3.2-324FFF?style=flat-square&logo=lit&logoColor=white" alt="Lit" /></a>
|
|
17
|
+
<a href="https://www.solidjs.com/"><img src="https://img.shields.io/badge/Solid-1.9.13-2C4F7C?style=flat-square&logo=solid&logoColor=white" alt="Solid" /></a>
|
|
18
|
+
<a href="https://vitest.dev/"><img src="https://img.shields.io/badge/Vitest-4.1.5-6E9F18?style=flat-square&logo=vitest&logoColor=white" alt="Vitest" /></a>
|
|
19
|
+
<a href="https://playwright.dev/"><img src="https://img.shields.io/badge/Playwright-1.59.1-2EAD33?style=flat-square&logo=playwright&logoColor=white" alt="Playwright" /></a>
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
<p align="center">
|
|
23
|
+
<a href="#availability">Availability</a> ·
|
|
24
|
+
<a href="#architecture">Architecture</a> ·
|
|
25
|
+
<a href="#commands">Commands</a> ·
|
|
26
|
+
<a href="#specs-and-decisions">Specs And Decisions</a>
|
|
27
|
+
</p>
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
**TYUI** is a framework-neutral component library. It is an experiment, not intended to be used by anybody really.
|
|
32
|
+
|
|
33
|
+
Codex interviewed me, asked bunch of interesting questions about design systems, component libraries, accessibility. Used [APG patterns](https://www.w3.org/WAI/ARIA/apg/patterns/) and [Fluent UI React v9](https://react.fluentui.dev/) as a reference for behaviors, API and other aspects. Then implemented the specs.
|
|
34
|
+
|
|
35
|
+
The library is intended to be AI firendly - agents should have access to all underlying information, component intnets, usage patterns and best practices.
|
|
36
|
+
|
|
37
|
+
Desing is proposed to be a separate layer. It should be possible to generate the design layer based on the standardized [design.md](https://github.com/google-labs-code/design.md/blob/main/docs/spec.md).
|
|
38
|
+
|
|
39
|
+
**Warning:** This is 100% AI generated and not polished. Visuals and user experience will be rough. As part of the experiment I might also want to find out if agents can fine tune the behaviors and visuals of the components so that they can be considered well crafted. But for now they are not.
|
|
40
|
+
|
|
41
|
+
## Availability
|
|
42
|
+
|
|
43
|
+
Storybook is deployed as [Github page](https://jurokapsiar.github.io/tyui/).
|
|
44
|
+
Packages are not yet available - they might be if I decide to use the library in my personal projects.
|
|
45
|
+
|
|
46
|
+
## Architecture
|
|
47
|
+
|
|
48
|
+
- `libs/core`: plain TypeScript behavior, state machines, and accessibility logic.
|
|
49
|
+
- `libs/elements`: native Custom Element implementations.
|
|
50
|
+
- `libs/define`: opt-in custom-element registration functions.
|
|
51
|
+
- `libs/solid`: Solid JSX typing and optional thin wrappers.
|
|
52
|
+
- `libs/testing`: shared testing helpers.
|
|
53
|
+
- `apps/solid-example`: Solid + Vite consumer example.
|
|
54
|
+
- `apps/vanilla-example`: vanilla + Vite consumer example.
|
|
55
|
+
|
|
56
|
+
The component implementation should remain in `core` and `elements`. Framework packages should only improve typing and ergonomics.
|
|
57
|
+
|
|
58
|
+
## Commands
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
yarn install
|
|
62
|
+
yarn build
|
|
63
|
+
yarn test
|
|
64
|
+
yarn typecheck
|
|
65
|
+
yarn playwright:image
|
|
66
|
+
yarn dev:solid
|
|
67
|
+
yarn dev:vanilla
|
|
68
|
+
yarn storybook
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Specs And Decisions
|
|
72
|
+
|
|
73
|
+
- `spec/requirements.md`
|
|
74
|
+
- `spec/architecture.md`
|
|
75
|
+
- `spec/testing.md`
|
|
76
|
+
- `spec/component-contract-template.md`
|
|
77
|
+
- `adr/0001-native-custom-elements.md`
|
|
78
|
+
- `adr/0002-solid-integration-surface.md`
|
|
79
|
+
- `ai/components/*.md`
|
package/button.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { TyuiButtonAppearance, TyuiButtonIconPosition, TyuiButtonShape, TyuiButtonSize, TyuiButtonType } from '@toyu-ui/elements/button';
|
|
3
|
+
export type ButtonProps = {
|
|
4
|
+
appearance?: TyuiButtonAppearance | undefined;
|
|
5
|
+
disabled?: boolean | undefined;
|
|
6
|
+
disabledFocusable?: boolean | undefined;
|
|
7
|
+
iconPosition?: TyuiButtonIconPosition | undefined;
|
|
8
|
+
shape?: TyuiButtonShape | undefined;
|
|
9
|
+
size?: TyuiButtonSize | undefined;
|
|
10
|
+
type?: TyuiButtonType | undefined;
|
|
11
|
+
children?: JSX.Element | undefined;
|
|
12
|
+
};
|
|
13
|
+
export declare function Button(props: ButtonProps): JSX.Element;
|
package/button.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { getOwner as s, insert as u, effect as c, template as b } from "solid-js/web";
|
|
2
|
+
var f = /* @__PURE__ */ b("<tyui-button>", !0, !1, !1);
|
|
3
|
+
function h(t) {
|
|
4
|
+
return (() => {
|
|
5
|
+
var i = f();
|
|
6
|
+
return i._$owner = s(), u(i, () => t.children), c((e) => {
|
|
7
|
+
var a = t.appearance, n = t.disabled, o = t.disabledFocusable, v = t.iconPosition, d = t.shape, l = t.size, r = t.type;
|
|
8
|
+
return a !== e.e && (i.appearance = e.e = a), n !== e.t && (i.disabled = e.t = n), o !== e.a && (i.disabledfocusable = e.a = o), v !== e.o && (i.iconposition = e.o = v), d !== e.i && (i.shape = e.i = d), l !== e.n && (i.size = e.n = l), r !== e.s && (i.type = e.s = r), e;
|
|
9
|
+
}, {
|
|
10
|
+
e: void 0,
|
|
11
|
+
t: void 0,
|
|
12
|
+
a: void 0,
|
|
13
|
+
o: void 0,
|
|
14
|
+
i: void 0,
|
|
15
|
+
n: void 0,
|
|
16
|
+
s: void 0
|
|
17
|
+
}), i;
|
|
18
|
+
})();
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
h as Button
|
|
22
|
+
};
|
package/checkbox.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export type CheckboxProps = {
|
|
3
|
+
checked?: boolean | undefined;
|
|
4
|
+
disabled?: boolean | undefined;
|
|
5
|
+
indeterminate?: boolean | undefined;
|
|
6
|
+
name?: string | undefined;
|
|
7
|
+
onChange?: ((event: Event) => void) | undefined;
|
|
8
|
+
required?: boolean | undefined;
|
|
9
|
+
value?: string | undefined;
|
|
10
|
+
children?: JSX.Element | undefined;
|
|
11
|
+
};
|
|
12
|
+
export declare function Checkbox(props: CheckboxProps): JSX.Element;
|
package/checkbox.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { addEventListener as c, getOwner as l, insert as u, effect as n, template as m } from "solid-js/web";
|
|
2
|
+
var o = /* @__PURE__ */ m("<tyui-checkbox>", !0, !1, !1);
|
|
3
|
+
function f(a) {
|
|
4
|
+
return (() => {
|
|
5
|
+
var e = o();
|
|
6
|
+
return c(e, "change", a.onChange), e._$owner = l(), u(e, () => a.children), n((t) => {
|
|
7
|
+
var i = a.disabled, d = a.indeterminate, r = a.name, v = a.required;
|
|
8
|
+
return i !== t.e && (e.disabled = t.e = i), d !== t.t && (e.indeterminate = t.t = d), r !== t.a && (e.name = t.a = r), v !== t.o && (e.required = t.o = v), t;
|
|
9
|
+
}, {
|
|
10
|
+
e: void 0,
|
|
11
|
+
t: void 0,
|
|
12
|
+
a: void 0,
|
|
13
|
+
o: void 0
|
|
14
|
+
}), n(() => e.checked = a.checked), n(() => e.value = a.value), e;
|
|
15
|
+
})();
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
f as Checkbox
|
|
19
|
+
};
|