@gamecrafters/base-ui 0.0.13 → 0.0.15
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/build/components/caret/Caret.d.ts +11 -0
- package/build/components/caret/Caret.types.d.ts +11 -0
- package/build/components/caret/index.d.ts +2 -0
- package/build/components/header/Header.d.ts +7 -0
- package/build/components/header/Header.types.d.ts +12 -0
- package/build/components/header/HeaderItem.d.ts +6 -0
- package/build/components/header/HeaderLink.d.ts +7 -0
- package/build/components/header/index.d.ts +19 -0
- package/build/components/index.d.ts +2 -0
- package/build/hooks/useIsClipped.d.ts +1 -1
- package/build/main.cjs.js +30 -9
- package/build/main.esm.js +12 -9
- package/build/providers/index.d.ts +1 -0
- package/build/providers/overflow-observer/OverflowObserver.types.d.ts +6 -0
- package/build/providers/overflow-observer/OverflowObserverContext.d.ts +2 -0
- package/build/providers/overflow-observer/OverflowObserverProvider.d.ts +7 -0
- package/build/providers/overflow-observer/index.d.ts +4 -0
- package/build/providers/overflow-observer/useOverflowObserver.d.ts +1 -0
- package/build/styles/main.css +2 -2
- package/package.json +15 -36
- package/LICENSE +0 -21
- package/README.md +0 -204
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gamecrafters/base-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "An implementation of GameCrafters' Base UI Design System using React.",
|
|
5
5
|
"main": "build/main.cjs.js",
|
|
6
6
|
"module": "build/main.esm.js",
|
|
@@ -21,28 +21,30 @@
|
|
|
21
21
|
"*.css"
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
|
-
"build": "
|
|
25
|
-
"test": "
|
|
24
|
+
"build": "tsc --emitDeclarationOnly --noEmit false && rolldown -c",
|
|
25
|
+
"test": "vitest run --config ../config/vitest/vitest.config.mts",
|
|
26
26
|
"storybook": "storybook dev -p 9000",
|
|
27
27
|
"storybook:build": "storybook build",
|
|
28
|
-
"lint": "npx eslint src
|
|
28
|
+
"lint": "npx eslint src",
|
|
29
29
|
"lint:fix": "npm run lint -- --fix",
|
|
30
|
-
"prettier": "npx prettier src
|
|
30
|
+
"prettier": "npx prettier src --check",
|
|
31
31
|
"prettier:fix": "npm run prettier -- --write",
|
|
32
32
|
"format": "npm run lint:fix && npm run prettier:fix",
|
|
33
33
|
"clean": "rm -rf build"
|
|
34
34
|
},
|
|
35
35
|
"repository": {
|
|
36
36
|
"type": "git",
|
|
37
|
-
"url": "git+https://github.com/donaldturinglee/base-ui.git"
|
|
37
|
+
"url": "git+https://github.com/donaldturinglee/base-ui.git",
|
|
38
|
+
"directory": "packages/base-ui"
|
|
38
39
|
},
|
|
39
40
|
"keywords": [
|
|
40
41
|
"base-ui",
|
|
41
42
|
"react",
|
|
42
43
|
"typescript",
|
|
43
|
-
"
|
|
44
|
+
"rolldown",
|
|
44
45
|
"storybook",
|
|
45
|
-
"
|
|
46
|
+
"vitest",
|
|
47
|
+
"playwright"
|
|
46
48
|
],
|
|
47
49
|
"author": "donaldturinglee <donaldturinglee@gmail.com>",
|
|
48
50
|
"license": "MIT",
|
|
@@ -55,15 +57,7 @@
|
|
|
55
57
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
56
58
|
},
|
|
57
59
|
"devDependencies": {
|
|
58
|
-
"@
|
|
59
|
-
"@babel/preset-react": "^7.27.1",
|
|
60
|
-
"@babel/preset-typescript": "^7.27.1",
|
|
61
|
-
"@eslint/js": "^9.37.0",
|
|
62
|
-
"@rollup/plugin-commonjs": "^28.0.6",
|
|
63
|
-
"@rollup/plugin-json": "^6.1.0",
|
|
64
|
-
"@rollup/plugin-node-resolve": "^16.0.2",
|
|
65
|
-
"@rollup/plugin-terser": "^0.4.4",
|
|
66
|
-
"@rollup/plugin-typescript": "^12.1.4",
|
|
60
|
+
"@gamecrafters/config": "*",
|
|
67
61
|
"@storybook/addon-a11y": "^10.4.2",
|
|
68
62
|
"@storybook/addon-docs": "^10.4.2",
|
|
69
63
|
"@storybook/addon-themes": "^10.4.2",
|
|
@@ -71,37 +65,22 @@
|
|
|
71
65
|
"@tailwindcss/postcss": "^4.3.2",
|
|
72
66
|
"@testing-library/jest-dom": "^6.9.1",
|
|
73
67
|
"@testing-library/react": "^16.3.0",
|
|
74
|
-
"@types/jest": "^30.0.0",
|
|
75
|
-
"@types/jest-axe": "^3.5.9",
|
|
76
68
|
"@types/react-dom": "^19.2.3",
|
|
77
69
|
"@types/react-is": "^19.2.0",
|
|
78
|
-
"@typescript-eslint/eslint-plugin": "^8.46.0",
|
|
79
|
-
"@typescript-eslint/parser": "^8.46.0",
|
|
80
|
-
"babel-jest": "^30.2.0",
|
|
81
|
-
"eslint": "^9.37.0",
|
|
82
|
-
"eslint-config-prettier": "^10.1.8",
|
|
83
|
-
"eslint-plugin-prettier": "^5.5.4",
|
|
84
|
-
"eslint-plugin-storybook": "10.4.2",
|
|
85
|
-
"identity-obj-proxy": "^3.0.0",
|
|
86
|
-
"jest": "^30.2.0",
|
|
87
|
-
"jest-axe": "^10.0.0",
|
|
88
|
-
"jest-environment-jsdom": "^30.2.0",
|
|
89
70
|
"jiti": "^2.6.1",
|
|
90
71
|
"postcss": "^8.5.15",
|
|
91
|
-
"
|
|
92
|
-
"rollup": "^4.52.4",
|
|
72
|
+
"rolldown": "^1.2.3",
|
|
93
73
|
"rollup-plugin-postcss": "^4.0.2",
|
|
94
74
|
"rollup-plugin-visualizer": "^6.0.4",
|
|
95
75
|
"storybook": "^10.4.2",
|
|
96
76
|
"tailwindcss": "^4.3.2",
|
|
97
|
-
"tslib": "^2.8.1",
|
|
98
77
|
"tw-animate-css": "^1.4.0",
|
|
99
78
|
"typescript": "^6.0.3",
|
|
100
|
-
"
|
|
101
|
-
"
|
|
79
|
+
"vite": "^8.1.4",
|
|
80
|
+
"vitest": "^4.1.10"
|
|
102
81
|
},
|
|
103
82
|
"dependencies": {
|
|
104
|
-
"@gamecrafters/base-ui-icons": "^0.0.
|
|
83
|
+
"@gamecrafters/base-ui-icons": "^0.0.9",
|
|
105
84
|
"@lexical/code-core": "^0.49.0",
|
|
106
85
|
"@lexical/link": "^0.49.0",
|
|
107
86
|
"@lexical/list": "^0.49.0",
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Donald Lee
|
|
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
DELETED
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
<a id="readme-top"></a>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<br />
|
|
6
|
-
<div align="center">
|
|
7
|
-
|
|
8
|
-
<h3 align="center">Base UI</h3>
|
|
9
|
-
|
|
10
|
-
<p align="center">
|
|
11
|
-
An implementation of GameCrafters' Base UI Design System using React.
|
|
12
|
-
</p>
|
|
13
|
-
|
|
14
|
-
[![npm][npm-shield]][npm-url]
|
|
15
|
-
[![Contributors][contributors-shield]][contributors-url]
|
|
16
|
-
[![Last Commit][last-commit-shield]][last-commit-url]
|
|
17
|
-
[![MIT License][license-shield]][license-url]
|
|
18
|
-
|
|
19
|
-
<p align="center">
|
|
20
|
-
<a href="https://www.npmjs.com/package/@gamecrafters/base-ui">View Package</a>
|
|
21
|
-
·
|
|
22
|
-
<a href="https://github.com/donaldturinglee/base-ui/issues/new?labels=bug">Report Bug</a>
|
|
23
|
-
·
|
|
24
|
-
<a href="https://github.com/donaldturinglee/base-ui/issues/new?labels=enhancement">Request Feature</a>
|
|
25
|
-
</p>
|
|
26
|
-
</div>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<details>
|
|
31
|
-
<summary>Table of Contents</summary>
|
|
32
|
-
<ol>
|
|
33
|
-
<li>
|
|
34
|
-
<a href="#getting-started">Getting Started</a>
|
|
35
|
-
<ul>
|
|
36
|
-
<li><a href="#installation">Installation</a></li>
|
|
37
|
-
</ul>
|
|
38
|
-
</li>
|
|
39
|
-
<li><a href="#usage">Usage</a></li>
|
|
40
|
-
<li><a href="#roadmap">Roadmap</a></li>
|
|
41
|
-
<li><a href="#contributing">Contributing</a></li>
|
|
42
|
-
<li><a href="#license">License</a></li>
|
|
43
|
-
<li><a href="#contact">Contact</a></li>
|
|
44
|
-
</ol>
|
|
45
|
-
</details>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
## Getting Started
|
|
50
|
-
|
|
51
|
-
To use Base UI in an application, install the package and import its stylesheet. To work on the library itself, clone the repository and run Storybook.
|
|
52
|
-
|
|
53
|
-
### Installation
|
|
54
|
-
|
|
55
|
-
To use the library in an application:
|
|
56
|
-
|
|
57
|
-
1. Install the package
|
|
58
|
-
```sh
|
|
59
|
-
npm install @gamecrafters/base-ui
|
|
60
|
-
```
|
|
61
|
-
2. Import the stylesheet once, at the root of the application
|
|
62
|
-
```js
|
|
63
|
-
import '@gamecrafters/base-ui/main.css';
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
To work on the library itself:
|
|
67
|
-
|
|
68
|
-
1. Clone the repo
|
|
69
|
-
```sh
|
|
70
|
-
git clone https://github.com/donaldturinglee/base-ui.git
|
|
71
|
-
```
|
|
72
|
-
2. Install NPM packages
|
|
73
|
-
```sh
|
|
74
|
-
npm install
|
|
75
|
-
```
|
|
76
|
-
3. Start Storybook, which is where the components are developed and read
|
|
77
|
-
```sh
|
|
78
|
-
npm run storybook
|
|
79
|
-
```
|
|
80
|
-
4. Working from a fork, change the git remote url to avoid accidental pushes to the base project
|
|
81
|
-
```sh
|
|
82
|
-
git remote set-url origin https://github.com/your_username/base-ui.git
|
|
83
|
-
git remote -v # confirm the changes
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
## Usage
|
|
91
|
-
|
|
92
|
-
Wrap the application in a `ThemeProvider` so the tokens resolve, then reach for the components:
|
|
93
|
-
|
|
94
|
-
```jsx
|
|
95
|
-
import { Box, Button, FormControl, Stack, TextInput, ThemeProvider } from '@gamecrafters/base-ui';
|
|
96
|
-
import '@gamecrafters/base-ui/main.css';
|
|
97
|
-
|
|
98
|
-
const App = () => (
|
|
99
|
-
<ThemeProvider colorMode="auto">
|
|
100
|
-
<Box padding="normal" background="muted" border="default" radius="medium">
|
|
101
|
-
<Stack gap="normal">
|
|
102
|
-
<FormControl required>
|
|
103
|
-
<FormControl.Label>Name</FormControl.Label>
|
|
104
|
-
<TextInput block />
|
|
105
|
-
<FormControl.Caption>The name people will know you by</FormControl.Caption>
|
|
106
|
-
</FormControl>
|
|
107
|
-
<Button variant="primary">Save</Button>
|
|
108
|
-
</Stack>
|
|
109
|
-
</Box>
|
|
110
|
-
</ThemeProvider>
|
|
111
|
-
);
|
|
112
|
-
|
|
113
|
-
export default App;
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
`colorMode` takes `day`, `night` or `auto`; `auto` follows the operating system. A nested `ThemeProvider` only has to say what it changes, so a subtree can hold a scheme of its own.
|
|
117
|
-
|
|
118
|
-
For a right-to-left subtree, wrap it in a `DirectionProvider`:
|
|
119
|
-
|
|
120
|
-
```jsx
|
|
121
|
-
import { DirectionProvider } from '@gamecrafters/base-ui';
|
|
122
|
-
|
|
123
|
-
<DirectionProvider direction="rtl">{children}</DirectionProvider>;
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
The scripts the repository is worked with:
|
|
127
|
-
|
|
128
|
-
| Script | What it does |
|
|
129
|
-
| --- | --- |
|
|
130
|
-
| `npm run storybook` | Runs Storybook on port 9000 |
|
|
131
|
-
| `npm run storybook:build` | Builds the static Storybook |
|
|
132
|
-
| `npm test` | Runs the Jest suites |
|
|
133
|
-
| `npm run build` | Builds the package with Rollup into `build/` |
|
|
134
|
-
| `npm run lint` | Lints `src` and `tests` with ESLint |
|
|
135
|
-
| `npm run format` | Applies both the ESLint and Prettier fixes |
|
|
136
|
-
| `npm run clean` | Removes the build output |
|
|
137
|
-
|
|
138
|
-
_Every component has a page in Storybook, with a Playground story for its props and a Features section for what it can do._
|
|
139
|
-
|
|
140
|
-
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
## Roadmap
|
|
145
|
-
|
|
146
|
-
See the [open issues](https://github.com/donaldturinglee/base-ui/issues) for a full list of proposed features (and known issues).
|
|
147
|
-
|
|
148
|
-
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
## Contributing
|
|
153
|
-
|
|
154
|
-
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
|
|
155
|
-
|
|
156
|
-
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
|
|
157
|
-
Don't forget to give the project a star! Thanks again!
|
|
158
|
-
|
|
159
|
-
1. Fork the Project
|
|
160
|
-
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
|
|
161
|
-
3. Run `npm run lint` and `npm test`
|
|
162
|
-
4. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
|
|
163
|
-
5. Push to the Branch (`git push origin feature/AmazingFeature`)
|
|
164
|
-
6. Open a Pull Request
|
|
165
|
-
|
|
166
|
-
A new component follows the shape of the ones already there: a `ComponentName.tsx`, a `ComponentName.types.ts`, an `index.ts`, a Jest suite and two Storybook files under `src/components/<component-name>`, with its stylesheet under `src/styles/components` and one line added to each of the two barrels.
|
|
167
|
-
|
|
168
|
-
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
|
169
|
-
|
|
170
|
-
### Top contributors:
|
|
171
|
-
|
|
172
|
-
<a href="https://github.com/donaldturinglee/base-ui/graphs/contributors">
|
|
173
|
-
<img src="https://contrib.rocks/image?repo=donaldturinglee/base-ui" alt="contrib.rocks image" />
|
|
174
|
-
</a>
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
## License
|
|
179
|
-
|
|
180
|
-
Distributed under the MIT License. See `LICENSE` for more information.
|
|
181
|
-
|
|
182
|
-
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
## Contact
|
|
187
|
-
|
|
188
|
-
[](https://www.linkedin.com/in/donaldturinglee/)
|
|
189
|
-
[](https://discord.gg/YsteKRjrSH)
|
|
190
|
-
[](https://x.com/donaldturinglee)
|
|
191
|
-
[](https://www.youtube.com/channel/UCOHOUOsJjGPBlov7FuwPDbA)
|
|
192
|
-
|
|
193
|
-
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
[npm-shield]: https://img.shields.io/npm/v/%40gamecrafters%2Fbase-ui.svg?style=for-the-badge
|
|
198
|
-
[npm-url]: https://www.npmjs.com/package/@gamecrafters/base-ui
|
|
199
|
-
[contributors-shield]: https://img.shields.io/github/contributors/donaldturinglee/base-ui.svg?style=for-the-badge
|
|
200
|
-
[contributors-url]: https://github.com/donaldturinglee/base-ui/graphs/contributors
|
|
201
|
-
[last-commit-shield]: https://img.shields.io/github/last-commit/donaldturinglee/base-ui.svg?style=for-the-badge
|
|
202
|
-
[last-commit-url]: https://github.com/donaldturinglee/base-ui/commits/main
|
|
203
|
-
[license-shield]: https://img.shields.io/github/license/donaldturinglee/base-ui.svg?style=for-the-badge
|
|
204
|
-
[license-url]: https://github.com/donaldturinglee/base-ui/blob/main/LICENSE
|