@withnicer/ui 0.0.0-stage → 1.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/README.md +68 -2
- package/dist/index.d.ts +919 -0
- package/dist/index.js +5521 -0
- package/package.json +92 -4
- package/src/assets/avatar-placeholder-dark.svg +4 -0
- package/src/assets/avatar-placeholder-light.svg +4 -0
- package/src/assets/dropdown-black.svg +5 -0
- package/src/assets/dropdown-white.svg +5 -0
- package/src/assets/image-placeholder-dark.svg +12 -0
- package/src/assets/image-placeholder-light.svg +12 -0
- package/src/assets/lodging-placeholder.jpg +0 -0
- package/src/assets/spinner-black.png +0 -0
- package/src/assets/spinner-white.png +0 -0
- package/src/styles/fonts/TheSeasons-Regular.ttf +0 -0
- package/src/styles/fonts/TheSeasons-Regular.woff +0 -0
- package/src/styles/fonts/TheSeasons-Regular.woff2 +0 -0
- package/src/styles/icons/Icomoon.json +4117 -0
- package/src/styles/icons/fonts/icomoon.eot +0 -0
- package/src/styles/icons/fonts/icomoon.svg +221 -0
- package/src/styles/icons/fonts/icomoon.ttf +0 -0
- package/src/styles/icons/fonts/icomoon.woff +0 -0
- package/src/styles/icons/style.css +677 -0
- package/src/styles/reset.css +35 -0
- package/src/styles/styles.sass +2719 -0
- package/src/utils/dial-codes.json +1454 -0
package/README.md
CHANGED
|
@@ -1,3 +1,69 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @withnicer/ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/withnicer/ui/actions/workflows/release.yml) [](https://www.npmjs.com/package/@withnicer/ui)
|
|
4
|
+
|
|
5
|
+
Nicer's design system: the React 19 components, design tokens and global styles behind the advisor portal, the traveler booking site, Pay and Octopus.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
bun add @withnicer/ui react react-dom styled-components
|
|
11
|
+
bun add -d sass
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
React, React DOM and styled-components are peer dependencies, so the app and the kit share one copy of each (one React context, one theme).
|
|
15
|
+
|
|
16
|
+
## Use
|
|
17
|
+
|
|
18
|
+
Load the styles once, at the app root, then import components:
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
import "@withnicer/ui/styles.sass";
|
|
22
|
+
import { Button, ThemeProvider } from "@withnicer/ui";
|
|
23
|
+
|
|
24
|
+
export const App = () => (
|
|
25
|
+
<ThemeProvider>
|
|
26
|
+
<Button>Book</Button>
|
|
27
|
+
</ThemeProvider>
|
|
28
|
+
);
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### What is exported
|
|
32
|
+
|
|
33
|
+
| Entry | Contents |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| `@withnicer/ui` | Components, contexts, hooks and utilities, all listed in [`src/index.ts`](src/index.ts) |
|
|
36
|
+
| `@withnicer/ui/styles.sass` | Tokens, typography, dark mode, the reset, the icon font and The Seasons and Inter fonts |
|
|
37
|
+
| `@withnicer/ui/dial-codes.json` | Country dial codes with flags, for phone inputs |
|
|
38
|
+
| `@withnicer/ui/fonts/<file>` | The Seasons font files (for PDFs and canvases that need a URL) |
|
|
39
|
+
|
|
40
|
+
Components: Actions, AgencyMark, Autocomplete, Button, Calendar, CardInput, Check, DateInput, DetailDrawer, Dialog, Dropdown, EmptyState, ErrorBoundary, FileInput, Grip, Icon, IconButton, MaintenanceGate, Modal, NavButton, NumberInput, Overlay, Paginator, PhoneInput, PriceInput, RadioButton, RangeSlider, Select, Separator, SideNav, SignInCard, Spinner, StatusManager, Switch, Tabs, Tag, TextArea, TextInput, ThemeProvider, ThemeSwitch, TimeInput, Toast, Toggle, Tooltip and Tour.
|
|
41
|
+
|
|
42
|
+
Tokens and `.ui-*` classes live in [`src/styles/styles.sass`](src/styles/styles.sass); icon names in [`src/styles/icons/style.css`](src/styles/icons/style.css).
|
|
43
|
+
|
|
44
|
+
## Develop
|
|
45
|
+
|
|
46
|
+
Everything runs through [Vite+](https://viteplus.dev) (`vp`), configured in [`vite.config.ts`](vite.config.ts). Vite+ pins and installs the Node.js and bun versions itself; bun stays the package manager (`packageManager` in `package.json`), so `vp install` runs `bun install` on `bun.lock`.
|
|
47
|
+
|
|
48
|
+
| Command | What it does |
|
|
49
|
+
| --- | --- |
|
|
50
|
+
| `vp install` | Install dependencies and the git hooks |
|
|
51
|
+
| `vp check` | Format check ([Oxfmt](https://oxc.rs/docs/guide/usage/formatter.html)), lint ([Oxlint](https://oxc.rs/docs/guide/usage/linter.html) with [Ultracite](https://www.ultracite.ai) rules) and type check |
|
|
52
|
+
| `vp check --fix` | Format and apply safe lint fixes |
|
|
53
|
+
| `vp pack` | Build `dist/`: one ES module and its bundled type declarations |
|
|
54
|
+
| `vp test` | Run the unit tests |
|
|
55
|
+
|
|
56
|
+
Git hooks live in [`.vite-hooks`](.vite-hooks): before a commit, `vp staged` runs `vp check --fix` on the staged files; the commit message must follow Conventional Commits, since releases are picked from it.
|
|
57
|
+
|
|
58
|
+
## Release
|
|
59
|
+
|
|
60
|
+
Releases are automatic. Every push to `main` runs the [Release workflow](.github/workflows/release.yml): `vp check`, the build, then [semantic-release](https://semantic-release.gitbook.io), which picks the next version from the [Conventional Commits](https://www.conventionalcommits.org) since the last release, publishes to npm and writes the GitHub release.
|
|
61
|
+
|
|
62
|
+
| Commit | Release |
|
|
63
|
+
| ------------------------------------------------------------------ | ------- |
|
|
64
|
+
| `fix(button): Keep the focus ring on Safari` | patch |
|
|
65
|
+
| `feat(tabs): Add a vertical layout` | minor |
|
|
66
|
+
| `feat!: Rename Toggle's value prop` or a `BREAKING CHANGE:` footer | major |
|
|
67
|
+
| `docs:`, `chore:`, `ci:`, `test:`, `refactor:` | none |
|
|
68
|
+
|
|
69
|
+
Publishing uses npm [trusted publishing](https://docs.npmjs.com/trusted-publishers): npm trusts this repository's `release.yml` through OpenID Connect, so there is no npm token to store or rotate.
|