@pathscale/ui 1.2.11 → 1.3.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/README.md +98 -25
- package/dist/components/language-switcher/createI18n.d.ts +2 -1
- package/dist/purge-manifest.json +16333 -16333
- package/package.json +16 -7
package/README.md
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
# @pathscale/ui
|
|
2
2
|
|
|
3
|
-
Highly opinionated SolidJS component library — batteries and kitchen sink
|
|
4
|
-
|
|
3
|
+
Highly opinionated SolidJS component library — batteries and kitchen sink included, but
|
|
4
|
+
optimized and shiny.
|
|
5
|
+
|
|
6
|
+
**103 components.** HeroUI-parity API, daisyUI-style theming, Tailwind v4 tokens, light and
|
|
7
|
+
dark themes built in.
|
|
8
|
+
|
|
9
|
+
**[→ Browse every component, live](https://js.software)**
|
|
5
10
|
|
|
6
11
|
## Install
|
|
7
12
|
|
|
@@ -9,51 +14,119 @@ included, but optimized and shiny.
|
|
|
9
14
|
bun add @pathscale/ui
|
|
10
15
|
```
|
|
11
16
|
|
|
12
|
-
|
|
17
|
+
<details>
|
|
18
|
+
<summary>npm · pnpm · yarn</summary>
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
npm install @pathscale/ui
|
|
22
|
+
pnpm add @pathscale/ui
|
|
23
|
+
yarn add @pathscale/ui
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
</details>
|
|
27
|
+
|
|
28
|
+
## Setup
|
|
29
|
+
|
|
30
|
+
Two imports. Everything comes from the root barrel, and **one stylesheet is all you need** —
|
|
31
|
+
`index.css` pulls in the base styles, both themes and the icon set:
|
|
13
32
|
|
|
14
33
|
```tsx
|
|
15
34
|
import { Button, Flex } from "@pathscale/ui";
|
|
35
|
+
import "@pathscale/ui/index.css";
|
|
16
36
|
|
|
17
37
|
export const Example = () => (
|
|
18
38
|
<Flex direction="col" gap="sm">
|
|
19
|
-
<Button color="primary">Primary</Button>
|
|
39
|
+
<Button color="primary" size="md">Primary</Button>
|
|
20
40
|
</Flex>
|
|
21
41
|
);
|
|
22
42
|
```
|
|
23
43
|
|
|
24
|
-
##
|
|
44
|
+
## Theming
|
|
25
45
|
|
|
26
|
-
|
|
27
|
-
|
|
46
|
+
Two themes ship with the library: `light` (the default when no attribute is set) and `dark`.
|
|
47
|
+
Switch globally by setting an attribute on the document:
|
|
28
48
|
|
|
29
49
|
```ts
|
|
30
|
-
|
|
31
|
-
import "@pathscale/ui/dist/styles/icons/generated-icons.css";
|
|
50
|
+
document.documentElement.setAttribute("data-theme", "dark");
|
|
32
51
|
```
|
|
33
52
|
|
|
34
|
-
|
|
53
|
+
Every component also accepts a `dataTheme` prop, rendered as `data-theme` on that element —
|
|
54
|
+
use it to scope a theme to one subtree.
|
|
35
55
|
|
|
36
|
-
|
|
37
|
-
|
|
56
|
+
Tokens are CSS custom properties: `--color-primary`, `--color-base-100`, `--radius-field`,
|
|
57
|
+
and a glass set among others. `index.css` includes a Tailwind v4 `@theme` block, so in a
|
|
58
|
+
Tailwind v4 app the usual utilities — `bg-primary`, `text-base-content`, `bg-base-100` —
|
|
59
|
+
work against them directly.
|
|
38
60
|
|
|
39
|
-
##
|
|
61
|
+
## Components
|
|
40
62
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
63
|
+
| family | components |
|
|
64
|
+
|---|---|
|
|
65
|
+
| **Layout** | Flex, Grid, Join, Surface, Card, GlassPanel, Separator, ScrollShadow, Skeleton, EmptyState, Footer, Header, Navbar, Toolbar, FloatingDock |
|
|
66
|
+
| **Typography & misc** | Text, Link, Kbd, Badge, Chip, Tag, TagGroup, Avatar, Icon, Tooltip, Breadcrumbs, Pagination, Meter, ProgressBar, ProgressCircle, Spinner |
|
|
67
|
+
| **Inputs** | Input, InputGroup, InputOTP, TextField, TextArea, NumberField, SearchField, PasswordField, ColorField, Checkbox, CheckboxGroup, Radio, RadioGroup, Toggle, Slider, Select, ComboBox, ListBox, SizePicker |
|
|
68
|
+
| **Forms** | Form, Fieldset, Label, Description, ErrorMessage, FieldError, PasswordRequirements |
|
|
69
|
+
| **Dates** | Calendar, RangeCalendar, DatePicker, DateRangePicker, DateField, TimeField |
|
|
70
|
+
| **Color** | ColorPicker, ColorArea, ColorSlider, ColorSwatch, ColorSwatchPicker, ColorWheelFlower, ThemeColorPicker |
|
|
71
|
+
| **Overlays** | Modal, Drawer, Popover, Dropdown, Menu, Toast, Alert, Disclosure, DisclosureGroup, Accordion |
|
|
72
|
+
| **Data** | Table (headless compound + hooks), Tabs |
|
|
73
|
+
| **Auth kit** | AuthForm, AuthCard, AuthFieldGroup, AuthSubmitButton, AuthFooterLinks, AuthPoweredBy, AuthErrorMessage, AuthSuccessMessage |
|
|
74
|
+
| **Visual FX** | MetalBorder, GlowCard, NoiseBackground, ImmersiveLanding, VideoPreview, LiveChat, ChatBubble, LanguageSwitcher |
|
|
44
75
|
|
|
45
|
-
|
|
76
|
+
All of them rendered and interactive at **[js.software](https://js.software)**.
|
|
46
77
|
|
|
47
|
-
|
|
48
|
-
- `bun run lint`
|
|
49
|
-
- `bun run format`
|
|
78
|
+
## Conventions
|
|
50
79
|
|
|
51
|
-
|
|
80
|
+
The rules that hold across every component — worth two minutes before your first hour:
|
|
52
81
|
|
|
53
|
-
|
|
82
|
+
- **Booleans are HeroUI-style `is*`**: `isDisabled`, `isOpen`, `isInvalid`, `isPending`,
|
|
83
|
+
`isIconOnly`. Native `disabled` is honored too.
|
|
84
|
+
- **Sizes** are `xs | sm | md | lg | xl`. **Colors** are
|
|
85
|
+
`neutral | primary | secondary | accent | info | success | warning | error | ghost`.
|
|
86
|
+
- **Both `class` and `className` work** everywhere, and your classes win — they are merged
|
|
87
|
+
last via twMerge.
|
|
88
|
+
- **Controlled/uncontrolled come in triples**: `isOpen/defaultOpen/onOpenChange`,
|
|
89
|
+
`value/defaultValue/onChange`. Callbacks pass **values, not events**.
|
|
90
|
+
- **Compound components** (`Modal.Trigger`, `Tabs.List`, `Select.Option`) are also exported
|
|
91
|
+
flat. Parts are styleable via `data-slot` and state attributes such as `data-open`.
|
|
92
|
+
- There is **no polymorphic `as` prop**.
|
|
54
93
|
|
|
55
|
-
|
|
56
|
-
|
|
94
|
+
Forms are TanStack Form plus any Standard Schema validator; Table is headless and assembled
|
|
95
|
+
from hooks. Both, with toasts, icons and dates, are covered in
|
|
96
|
+
**[docs/ui-usage.md](https://github.com/pathscale/ui/blob/master/docs/ui-usage.md)**.
|
|
97
|
+
|
|
98
|
+
## Requirements
|
|
99
|
+
|
|
100
|
+
- **SolidJS ^1.9**
|
|
101
|
+
- **Tailwind v4** — optional, but required for the `@theme` token utilities
|
|
102
|
+
|
|
103
|
+
Peers include `@solid-primitives/*`, `@tanstack/solid-form` and `@tanstack/solid-table`.
|
|
104
|
+
Two are optional and only needed for the features they back: `popmotion` (JS animation
|
|
105
|
+
driver) and `@standard-schema/spec` (schema validation).
|
|
106
|
+
|
|
107
|
+
## Subpath exports
|
|
108
|
+
|
|
109
|
+
Everything is available from the root barrel. These exist when you want to be narrower:
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
import { Button } from "@pathscale/ui/components/button";
|
|
113
|
+
import { useVirtualRows } from "@pathscale/ui/primitives/virtualizer";
|
|
114
|
+
import { runMotion, enablePopmotion } from "@pathscale/ui/motion";
|
|
57
115
|
```
|
|
58
116
|
|
|
59
|
-
|
|
117
|
+
Also `@pathscale/ui/hooks/*` and `@pathscale/ui/styles/*`.
|
|
118
|
+
|
|
119
|
+
The package declares `"sideEffects": ["**/*.css"]`, so bundlers tree-shake what you don't
|
|
120
|
+
import — the published size is the whole library, not what ships to your users.
|
|
121
|
+
|
|
122
|
+
## Documentation
|
|
123
|
+
|
|
124
|
+
| | |
|
|
125
|
+
|---|---|
|
|
126
|
+
| **[Live showcase](https://js.software)** | every component, rendered and interactive |
|
|
127
|
+
| **[Usage reference](https://github.com/pathscale/ui/blob/master/docs/ui-usage.md)** | theming, conventions, forms, table, toast, icons, dates |
|
|
128
|
+
| **[Contributing](https://github.com/pathscale/ui/blob/master/CONTRIBUTING.md)** | local setup, playground, component checklist, proposal template |
|
|
129
|
+
|
|
130
|
+
## License
|
|
131
|
+
|
|
132
|
+
MIT
|
|
@@ -63,7 +63,8 @@ export interface I18nStore {
|
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
* Creates an i18n store with configurable options.
|
|
66
|
-
* API matches
|
|
66
|
+
* API matches the i18nStore pattern used across consuming apps, so migrating
|
|
67
|
+
* an existing store to this one is a drop-in.
|
|
67
68
|
*
|
|
68
69
|
* @example
|
|
69
70
|
* ```tsx
|