@jacshuo/onyx 1.2.0 → 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 +19 -6
- package/dist/DataDisplay/CodeBlock.cjs +2 -2
- package/dist/DataDisplay/CodeBlock.js +2 -2
- package/dist/DataDisplay/index.cjs +2 -2
- package/dist/DataDisplay/index.js +2 -2
- package/dist/index.cjs +5 -5
- package/dist/index.js +5 -5
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -114,10 +114,17 @@ import '@jacshuo/onyx/styles.css';
|
|
|
114
114
|
|
|
115
115
|
Import each component from its own subpath. This guarantees only the code you use is included, even with bundlers that don't tree-shake well.
|
|
116
116
|
|
|
117
|
+
Components are organized under category subpaths (`Primitives`, `Overlay`, `Disclosure`, `DataDisplay`, `Navigation`, `Layout`, `Feedback`, `Forms`, `Extras`):
|
|
118
|
+
|
|
117
119
|
```tsx
|
|
118
|
-
|
|
119
|
-
import {
|
|
120
|
-
import {
|
|
120
|
+
// Individual component
|
|
121
|
+
import { Button } from '@jacshuo/onyx/Primitives/Button';
|
|
122
|
+
import { Dialog, DialogContent } from '@jacshuo/onyx/Overlay/Dialog';
|
|
123
|
+
import { Tabs, TabList, TabTrigger } from '@jacshuo/onyx/Disclosure/Tabs';
|
|
124
|
+
|
|
125
|
+
// Or import everything from a category at once
|
|
126
|
+
import { Button, Input, Badge } from '@jacshuo/onyx/Primitives';
|
|
127
|
+
import { Alert } from '@jacshuo/onyx/Feedback';
|
|
121
128
|
```
|
|
122
129
|
|
|
123
130
|
### CSS options
|
|
@@ -155,7 +162,7 @@ If your project already runs Tailwind CSS v4 and you want to import only the tok
|
|
|
155
162
|
```tsx
|
|
156
163
|
import '@jacshuo/onyx/styles/base.css';
|
|
157
164
|
import '@jacshuo/onyx/styles/CinePlayer.css';
|
|
158
|
-
import { CinePlayer } from '@jacshuo/onyx/CinePlayer';
|
|
165
|
+
import { CinePlayer } from '@jacshuo/onyx/Extras/CinePlayer';
|
|
159
166
|
```
|
|
160
167
|
|
|
161
168
|
---
|
|
@@ -338,14 +345,15 @@ import { Header } from '@jacshuo/onyx';
|
|
|
338
345
|
// On ≥md screens: full nav bar + action buttons
|
|
339
346
|
// On <md screens: hamburger menu (nav) + overflow menu (actions) — automatic
|
|
340
347
|
<Header
|
|
341
|
-
|
|
348
|
+
brand="My App"
|
|
349
|
+
mobileMenu
|
|
342
350
|
navItems={[
|
|
343
351
|
{ label: 'Home', href: '/' },
|
|
344
352
|
{ label: 'Docs', href: '/docs' },
|
|
345
353
|
{ label: 'Changelog', href: '/changelog' },
|
|
346
354
|
]}
|
|
347
355
|
actions={[
|
|
348
|
-
<
|
|
356
|
+
{ icon: <UserIcon />, 'aria-label': 'Sign in', onClick: () => navigate('/login') },
|
|
349
357
|
]}
|
|
350
358
|
/>
|
|
351
359
|
```
|
|
@@ -566,6 +574,11 @@ import { NavLink } from '@jacshuo/onyx';
|
|
|
566
574
|
|
|
567
575
|
### CodeBlock
|
|
568
576
|
|
|
577
|
+
> **Note:** `CodeBlock` uses [Shiki](https://shiki.style/) for syntax highlighting. Install it as a peer dependency if you use this component:
|
|
578
|
+
> ```sh
|
|
579
|
+
> npm install shiki
|
|
580
|
+
> ```
|
|
581
|
+
|
|
569
582
|
```tsx
|
|
570
583
|
import { CodeBlock } from '@jacshuo/onyx';
|
|
571
584
|
|