@rockshin/tao-ui 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/LICENSE +21 -0
- package/README.md +65 -0
- package/dist/components/button/button.css +1055 -0
- package/dist/components/button/button.d.ts +15 -0
- package/dist/components/button/button.js +93 -0
- package/dist/components/checkbox/checkbox.css +1035 -0
- package/dist/components/checkbox/checkbox.d.ts +33 -0
- package/dist/components/checkbox/checkbox.js +312 -0
- package/dist/components/date-picker/calendar/calendar-grid.d.ts +18 -0
- package/dist/components/date-picker/calendar/calendar-grid.js +173 -0
- package/dist/components/date-picker/calendar/calendar-header.d.ts +10 -0
- package/dist/components/date-picker/calendar/calendar-header.js +336 -0
- package/dist/components/date-picker/calendar/month-grid.d.ts +9 -0
- package/dist/components/date-picker/calendar/month-grid.js +61 -0
- package/dist/components/date-picker/calendar/time-panel.d.ts +12 -0
- package/dist/components/date-picker/calendar/time-panel.js +233 -0
- package/dist/components/date-picker/calendar/use-calendar.d.ts +15 -0
- package/dist/components/date-picker/calendar/use-calendar.js +24 -0
- package/dist/components/date-picker/calendar/year-grid.d.ts +9 -0
- package/dist/components/date-picker/calendar/year-grid.js +60 -0
- package/dist/components/date-picker/date-picker.css +1799 -0
- package/dist/components/date-picker/date-picker.d.ts +29 -0
- package/dist/components/date-picker/date-picker.js +663 -0
- package/dist/components/date-picker/presets.d.ts +9 -0
- package/dist/components/date-picker/presets.js +36 -0
- package/dist/components/date-picker/range-picker.d.ts +30 -0
- package/dist/components/date-picker/range-picker.js +432 -0
- package/dist/components/date-picker/types.d.ts +39 -0
- package/dist/components/date-picker/types.js +7 -0
- package/dist/components/drawer/drawer.css +1112 -0
- package/dist/components/drawer/drawer.d.ts +17 -0
- package/dist/components/drawer/drawer.js +184 -0
- package/dist/components/form-actions/form-actions.d.ts +12 -0
- package/dist/components/form-actions/form-actions.js +42 -0
- package/dist/components/form-field/form-field.d.ts +17 -0
- package/dist/components/form-field/form-field.js +101 -0
- package/dist/components/form-field/form.css +1036 -0
- package/dist/components/form-section/form-section.d.ts +14 -0
- package/dist/components/form-section/form-section.js +92 -0
- package/dist/components/input/input.css +1185 -0
- package/dist/components/input/input.d.ts +15 -0
- package/dist/components/input/input.js +143 -0
- package/dist/components/pagination/pagination.css +1099 -0
- package/dist/components/pagination/pagination.d.ts +22 -0
- package/dist/components/pagination/pagination.js +310 -0
- package/dist/components/radio/radio.css +1045 -0
- package/dist/components/radio/radio.d.ts +34 -0
- package/dist/components/radio/radio.js +215 -0
- package/dist/components/scroll-area/scroll-area.css +1099 -0
- package/dist/components/scroll-area/scroll-area.d.ts +33 -0
- package/dist/components/scroll-area/scroll-area.js +375 -0
- package/dist/components/select/mobile-select.css +1044 -0
- package/dist/components/select/mobile-select.d.ts +19 -0
- package/dist/components/select/mobile-select.js +224 -0
- package/dist/components/select/select.css +1327 -0
- package/dist/components/select/select.d.ts +32 -0
- package/dist/components/select/select.js +532 -0
- package/dist/components/select/use-is-mobile.d.ts +1 -0
- package/dist/components/select/use-is-mobile.js +30 -0
- package/dist/components/splitter/splitter.css +1104 -0
- package/dist/components/splitter/splitter.d.ts +33 -0
- package/dist/components/splitter/splitter.js +451 -0
- package/dist/components/switch/switch.css +1170 -0
- package/dist/components/switch/switch.d.ts +19 -0
- package/dist/components/switch/switch.js +143 -0
- package/dist/components/table/table.css +1255 -0
- package/dist/components/table/table.d.ts +73 -0
- package/dist/components/table/table.js +1022 -0
- package/dist/components/tabs/tabs.css +1076 -0
- package/dist/components/tabs/tabs.d.ts +24 -0
- package/dist/components/tabs/tabs.js +256 -0
- package/dist/components/tag/tag.css +1124 -0
- package/dist/components/tag/tag.d.ts +33 -0
- package/dist/components/tag/tag.js +237 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +23 -0
- package/dist/layouts/form-layout/form-layout.d.ts +6 -0
- package/dist/layouts/form-layout/form-layout.js +18 -0
- package/dist/layouts/stack/layout.css +1003 -0
- package/dist/layouts/stack/stack.d.ts +9 -0
- package/dist/layouts/stack/stack.js +27 -0
- package/dist/number-input/cursor.d.ts +9 -0
- package/dist/number-input/cursor.js +44 -0
- package/dist/number-input/format.d.ts +5 -0
- package/dist/number-input/format.js +50 -0
- package/dist/number-input/index.d.ts +5 -0
- package/dist/number-input/index.js +2 -0
- package/dist/number-input/number-input.d.ts +9 -0
- package/dist/number-input/number-input.js +101 -0
- package/dist/number-input/percentage.d.ts +3 -0
- package/dist/number-input/percentage.js +28 -0
- package/dist/number-input/types.d.ts +5 -0
- package/dist/number-input/types.js +0 -0
- package/dist/number-input/use-number-input.d.ts +30 -0
- package/dist/number-input/use-number-input.js +211 -0
- package/dist/number-input/validate.d.ts +3 -0
- package/dist/number-input/validate.js +17 -0
- package/dist/provider/tao-provider.d.ts +42 -0
- package/dist/provider/tao-provider.js +67 -0
- package/dist/theme/control.css +1061 -0
- package/dist/theme/theme.css +957 -0
- package/dist/utils/semantic.d.ts +10 -0
- package/dist/utils/semantic.js +5 -0
- package/llms.txt +67 -0
- package/package.json +97 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Semantic DOM type utilities.
|
|
4
|
+
* Each component defines its own SemanticPart union and uses these
|
|
5
|
+
* generic types for the classNames / styles props.
|
|
6
|
+
*/
|
|
7
|
+
export type SemanticClassNames<T extends string> = Partial<Record<T, string>>;
|
|
8
|
+
export type SemanticStyles<T extends string> = Partial<Record<T, CSSProperties>>;
|
|
9
|
+
/** Join class names, filtering out falsy values. */
|
|
10
|
+
export declare function cx(...classes: (string | undefined | false | null)[]): string | undefined;
|
package/llms.txt
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# @rockshin/tao-ui
|
|
2
|
+
|
|
3
|
+
> A modern React 19 component library with semantic DOM customization and OKLCH-based theming. Every component exposes `classNames`/`styles` props to target internal parts by semantic name, and inherits `size`/`disabled`/`variant` from a `TaoProvider` whose theme is derived from a small OKLCH seed token set.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @rockshin/tao-ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Peer dependencies: `react >=19`, `react-dom >=19`, `dayjs >=1.11` (only needed for `DatePicker`/`RangePicker`).
|
|
12
|
+
Module format: ESM only. Types and CSS ship alongside the JS; component CSS is imported as a side effect, so keep tree-shaking aware of CSS (`sideEffects` is declared in package.json).
|
|
13
|
+
|
|
14
|
+
## Core concepts
|
|
15
|
+
|
|
16
|
+
- **TaoProvider**: wrap the app once. Provides `size` (`'small' | 'middle' | 'large'`), `disabled`, and `variant` defaults to all descendants, plus theme tokens. A local prop on a component overrides the provider value. Hook: `useTaoConfig()`.
|
|
17
|
+
- **Theming**: a small seed token set (`TaoSeedToken`) is expanded into a full theme. Pure-CSS-computable values use `calc()`/`color-mix()` with OKLCH; non-linear values (radius steps, font-size log scale, control heights) are computed in JS and injected by `TaoProvider`. CSS variables are prefixed `--tao-*`; data attributes are `data-tao-*`.
|
|
18
|
+
- **Semantic DOM**: every component takes optional `classNames?: SemanticClassNames<Part>` and `styles?: SemanticStyles<Part>`, where `Part` is a component-specific union (e.g. `'root' | 'header' | 'body'`, dotted for nested parts like `'header.cell'`). The top-level `className` prop merges into the `root` part. Helper `cx` is exported.
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import { TaoProvider, Input, Select, Switch } from '@rockshin/tao-ui';
|
|
24
|
+
|
|
25
|
+
function App() {
|
|
26
|
+
return (
|
|
27
|
+
<TaoProvider size="middle">
|
|
28
|
+
<Input placeholder="Search" />
|
|
29
|
+
<Select options={[{ label: 'A', value: 'a' }]} />
|
|
30
|
+
<Switch defaultChecked />
|
|
31
|
+
</TaoProvider>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Style internal parts by semantic name:
|
|
36
|
+
<Drawer classNames={{ root: 'd', header: 'd-h' }} styles={{ body: { padding: 24 } }} />
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Exported API
|
|
40
|
+
|
|
41
|
+
Provider & utilities:
|
|
42
|
+
- `TaoProvider`, `useTaoConfig`
|
|
43
|
+
- Types: `TaoProviderProps`, `TaoThemeConfig`, `TaoSeedToken`, `TaoSize`, `TaoVariant`
|
|
44
|
+
- `cx`, types `SemanticClassNames<Part>`, `SemanticStyles<Part>`
|
|
45
|
+
|
|
46
|
+
Components (each exports `<Name>Props` and, where applicable, `<Name>SemanticPart`):
|
|
47
|
+
- General: `Button`
|
|
48
|
+
- Layout: `Stack`, `FormLayout`, `Splitter` (+ `SplitterPanelProps`)
|
|
49
|
+
- Navigation: `Tabs` (+ `TabItem`), `Pagination`
|
|
50
|
+
- Data Entry: `Input`, `Select` (+ `SelectOption`), `Checkbox` / `CheckboxGroup` (+ `CheckboxOptionType`), `Radio` / `RadioGroup` (+ `RadioOptionType`), `Switch`, `DatePicker`, `RangePicker`, `FormField`, `FormSection`, `FormActions`
|
|
51
|
+
- Data Display: `Table` (+ `TableColumn`, `TableRowSelection`, `TableFilterItem`, `TablePagination`, `SortOrder`, `SorterResult`), `Tag` / `CheckableTag` (+ `TagColor`, `TagVariant`), `ScrollArea` (+ `ScrollAreaType`)
|
|
52
|
+
- Feedback: `Drawer` (+ `DrawerPlacement`)
|
|
53
|
+
|
|
54
|
+
Headless:
|
|
55
|
+
- `useNumberInput`, `NumberInput` (+ `NumberInputProps`, `UseNumberInputOptions`, `UseNumberInputReturn`, `FormatOptions`, `PadDecimalsOnBlur`)
|
|
56
|
+
|
|
57
|
+
## Notes for code generation
|
|
58
|
+
|
|
59
|
+
- Import everything from the package root `@rockshin/tao-ui`; there are no deep sub-path entry points.
|
|
60
|
+
- Do not hand-write internal class names; customize via `classNames`/`styles` semantic parts.
|
|
61
|
+
- Prefer setting `size`/`disabled`/`variant` on `TaoProvider` for app-wide defaults; override per-component only when needed.
|
|
62
|
+
- Override theme by passing a partial seed to `TaoProvider`'s theme config rather than overriding `--tao-*` variables directly.
|
|
63
|
+
|
|
64
|
+
## Source
|
|
65
|
+
|
|
66
|
+
- Repository: https://github.com/rickyshin93/tao-ui
|
|
67
|
+
- License: MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rockshin/tao-ui",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "A modern React 19 component library with semantic DOM customization and OKLCH-based theming.",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"react",
|
|
8
|
+
"react19",
|
|
9
|
+
"component-library",
|
|
10
|
+
"ui",
|
|
11
|
+
"design-system",
|
|
12
|
+
"tao-ui",
|
|
13
|
+
"oklch"
|
|
14
|
+
],
|
|
15
|
+
"author": "rickyshin",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/rickyshin93/tao-ui.git"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://github.com/rickyshin93/tao-ui#readme",
|
|
22
|
+
"bugs": "https://github.com/rickyshin93/tao-ui/issues",
|
|
23
|
+
"sideEffects": [
|
|
24
|
+
"**/*.css"
|
|
25
|
+
],
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"import": "./dist/index.js"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"files": [
|
|
34
|
+
"dist",
|
|
35
|
+
"llms.txt"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "rslib",
|
|
39
|
+
"build:storybook": "storybook build",
|
|
40
|
+
"check": "biome check --write",
|
|
41
|
+
"dev": "rslib --watch",
|
|
42
|
+
"doc": "rspress dev",
|
|
43
|
+
"doc:build": "rspress build",
|
|
44
|
+
"doc:preview": "rspress preview",
|
|
45
|
+
"format": "biome format --write",
|
|
46
|
+
"storybook": "storybook dev",
|
|
47
|
+
"test": "rstest",
|
|
48
|
+
"test:watch": "rstest --watch"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@biomejs/biome": "2.4.14",
|
|
52
|
+
"@rsbuild/core": "~2.0.6",
|
|
53
|
+
"@rsbuild/plugin-babel": "^1.1.2",
|
|
54
|
+
"@rsbuild/plugin-react": "^2.0.0",
|
|
55
|
+
"@rslib/core": "^0.21.5",
|
|
56
|
+
"@rspress/core": "^2.0.11",
|
|
57
|
+
"@rspress/plugin-api-docgen": "^2.0.11",
|
|
58
|
+
"@rspress/plugin-preview": "^2.0.11",
|
|
59
|
+
"@rstest/adapter-rslib": "^0.2.2",
|
|
60
|
+
"@rstest/core": "^0.9.10",
|
|
61
|
+
"@storybook/addon-docs": "^10.3.6",
|
|
62
|
+
"@storybook/addon-onboarding": "^10.3.6",
|
|
63
|
+
"@storybook/react": "^10.3.6",
|
|
64
|
+
"@tailwindcss/postcss": "^4.3.0",
|
|
65
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
66
|
+
"@testing-library/react": "^16.3.2",
|
|
67
|
+
"@types/node": "^24.12.4",
|
|
68
|
+
"@types/react": "^19.2.14",
|
|
69
|
+
"babel-plugin-react-compiler": "^1.0.0",
|
|
70
|
+
"happy-dom": "^20.9.0",
|
|
71
|
+
"postcss": "^8.5.15",
|
|
72
|
+
"react": "^19.2.6",
|
|
73
|
+
"react-dom": "^19.2.6",
|
|
74
|
+
"rsbuild-plugin-workspace-dev": "^0.1.4",
|
|
75
|
+
"storybook": "^10.3.6",
|
|
76
|
+
"storybook-addon-rslib": "^3.3.3",
|
|
77
|
+
"storybook-react-rsbuild": "^3.3.3",
|
|
78
|
+
"tailwindcss": "^4.3.0",
|
|
79
|
+
"typescript": "^6.0.3"
|
|
80
|
+
},
|
|
81
|
+
"peerDependencies": {
|
|
82
|
+
"dayjs": ">=1.11.0",
|
|
83
|
+
"react": ">=19.0.0",
|
|
84
|
+
"react-dom": ">=19.0.0"
|
|
85
|
+
},
|
|
86
|
+
"publishConfig": {
|
|
87
|
+
"access": "public",
|
|
88
|
+
"registry": "https://registry.npmjs.org/"
|
|
89
|
+
},
|
|
90
|
+
"dependencies": {
|
|
91
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
92
|
+
"@radix-ui/react-popover": "^1.1.15",
|
|
93
|
+
"@radix-ui/react-select": "^2.2.6",
|
|
94
|
+
"@tanstack/react-virtual": "^3.14.2",
|
|
95
|
+
"dayjs": "^1.11.21"
|
|
96
|
+
}
|
|
97
|
+
}
|