@loykin/designkit 0.0.1-dev.3 → 0.0.1-dev.4
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 +47 -14
- package/dist/index.cjs +187 -109
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +43 -5
- package/dist/index.d.ts +43 -5
- package/dist/index.js +187 -111
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -204,15 +204,15 @@ handle stays inside the clipped panel corner:
|
|
|
204
204
|
|
|
205
205
|
```css
|
|
206
206
|
.layout-dashboard .react-grid-item:not(.react-grid-placeholder) {
|
|
207
|
-
--
|
|
208
|
-
--
|
|
209
|
-
--
|
|
210
|
-
--
|
|
211
|
-
--
|
|
207
|
+
--designkit-resize-handle-size: clamp(20px, calc(var(--radius) * 1.6), 40px);
|
|
208
|
+
--designkit-resize-handle-inset: clamp(4px, calc(var(--radius) * 0.45), 16px);
|
|
209
|
+
--designkit-resize-handle-mark-size: clamp(6px, calc(var(--radius) * 0.55), 12px);
|
|
210
|
+
--designkit-resize-handle-color: rgba(0, 0, 0, 0.35);
|
|
211
|
+
--designkit-resize-handle-mark-radius: min(var(--radius), var(--designkit-resize-handle-mark-size));
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
.dark .layout-dashboard .react-grid-item:not(.react-grid-placeholder) {
|
|
215
|
-
--
|
|
215
|
+
--designkit-resize-handle-color: rgba(255, 255, 255, 0.4);
|
|
216
216
|
}
|
|
217
217
|
```
|
|
218
218
|
|
|
@@ -453,6 +453,39 @@ import {
|
|
|
453
453
|
} from '@loykin/designkit'
|
|
454
454
|
```
|
|
455
455
|
|
|
456
|
+
### PageTopBar
|
|
457
|
+
|
|
458
|
+
Top breadcrumb / action bar placed at the top of a page template via the `topBar` prop.
|
|
459
|
+
|
|
460
|
+
```tsx
|
|
461
|
+
import { PageTopBar } from '@loykin/designkit'
|
|
462
|
+
|
|
463
|
+
<PageTopBar left="Admin / Users" right={<Button size="sm">Add</Button>} />
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
| Prop | Type | Default | Description |
|
|
467
|
+
|---|---|---|---|
|
|
468
|
+
| `left` | `ReactNode` | — | Left content. A plain string is parsed as `/`-separated breadcrumbs. |
|
|
469
|
+
| `right` | `ReactNode` | — | Right-aligned actions |
|
|
470
|
+
| `variant` | `'ghost' \| 'default'` | `'ghost'` | `'default'` adds a bottom border |
|
|
471
|
+
| `sidebarTrigger` | `false \| ReactNode` | auto | Mobile sidebar open button. `undefined` auto-detects SidebarProvider context; `false` suppresses; pass a `ReactNode` for a custom trigger. |
|
|
472
|
+
| `height` | `string` | `var(--designkit-toolbar-height)` | Bar height |
|
|
473
|
+
| `className` | `string` | — | Class applied to the bar root |
|
|
474
|
+
|
|
475
|
+
**Mobile sidebar trigger**
|
|
476
|
+
|
|
477
|
+
When `PageTopBar` is rendered inside a `SidebarShell` on a mobile viewport, it automatically prepends a hamburger trigger to open the sidebar drawer — no extra code required. To suppress this (e.g. when the left slot already has a back button), pass `sidebarTrigger={false}`:
|
|
478
|
+
|
|
479
|
+
```tsx
|
|
480
|
+
// Back-button detail page — suppress auto trigger
|
|
481
|
+
<PageTopBar sidebarTrigger={false} left={<BackButton />} />
|
|
482
|
+
|
|
483
|
+
// Custom trigger
|
|
484
|
+
<PageTopBar sidebarTrigger={<MyTrigger />} left="Settings" />
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
---
|
|
488
|
+
|
|
456
489
|
### EmptyState
|
|
457
490
|
|
|
458
491
|
```tsx
|
|
@@ -471,20 +504,20 @@ import { Users } from 'lucide-react'
|
|
|
471
504
|
|
|
472
505
|
## Theming
|
|
473
506
|
|
|
474
|
-
Designkit maps shadcn/ui CSS variables onto its own `--
|
|
507
|
+
Designkit maps shadcn/ui CSS variables onto its own `--designkit-*` tokens. Changing your shadcn theme automatically updates all designkit components.
|
|
475
508
|
|
|
476
509
|
| What | How |
|
|
477
510
|
|---|---|
|
|
478
511
|
| Colors, radius, typography | shadcn/ui theme variables (`--primary`, `--radius`, etc.) |
|
|
479
|
-
| Spacing, density, padding | `--
|
|
512
|
+
| Spacing, density, padding | `--designkit-density`, `--designkit-page-padding-*`, `--designkit-panel-gap` |
|
|
480
513
|
| Per-page overrides | `className` or `theme` prop |
|
|
481
514
|
|
|
482
515
|
```css
|
|
483
516
|
:root {
|
|
484
|
-
--
|
|
485
|
-
--
|
|
486
|
-
--
|
|
487
|
-
--
|
|
517
|
+
--designkit-density: 1; /* 0.85 compact / 1 default / 1.15 comfortable */
|
|
518
|
+
--designkit-page-padding-x: 1.5rem;
|
|
519
|
+
--designkit-page-padding-y: 1rem;
|
|
520
|
+
--designkit-panel-gap: 1rem;
|
|
488
521
|
}
|
|
489
522
|
```
|
|
490
523
|
|
|
@@ -492,7 +525,7 @@ Per-page override via `className`:
|
|
|
492
525
|
|
|
493
526
|
```css
|
|
494
527
|
.layout-dashboard {
|
|
495
|
-
--
|
|
528
|
+
--designkit-density: 0.85;
|
|
496
529
|
}
|
|
497
530
|
```
|
|
498
531
|
|
|
@@ -504,7 +537,7 @@ Or via `theme` prop:
|
|
|
504
537
|
|
|
505
538
|
```tsx
|
|
506
539
|
<DataBodyTemplate
|
|
507
|
-
theme={{ '--
|
|
540
|
+
theme={{ '--designkit-density': '1.15' } as React.CSSProperties}
|
|
508
541
|
title="Settings"
|
|
509
542
|
>
|
|
510
543
|
```
|