@yuva-devlab/ui 1.4.3 → 2.0.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 +172 -128
- package/dist/components/accordion/accordion.mdx +18 -0
- package/dist/components/alert/alert.css +2 -2
- package/dist/components/alert-dialog/alert-dialog.mdx +18 -0
- package/dist/components/aspect-ratio/aspect-ratio.mdx +22 -0
- package/dist/components/breadcrumb/breadcrumb.mdx +18 -0
- package/dist/components/calendar/calendar-nav.css +111 -0
- package/dist/components/calendar/calendar.css +183 -0
- package/dist/components/calendar/calendar.mdx +18 -0
- package/dist/components/card/card.css +4 -4
- package/dist/components/carousel/carousel.css +4 -4
- package/dist/components/carousel/carousel.mdx +18 -0
- package/dist/components/chart/chart.css +86 -0
- package/dist/components/chart/chart.mdx +18 -0
- package/dist/components/checkbox/checkbox.css +11 -0
- package/dist/components/collapsible/collapsible.mdx +18 -0
- package/dist/components/command/command.css +3 -3
- package/dist/components/command/command.mdx +18 -0
- package/dist/components/confirm-dialog/confirm-dialog.mdx +18 -0
- package/dist/components/context-menu/context-menu.mdx +18 -0
- package/dist/components/copy-button/copy-button.css +2 -0
- package/dist/components/copy-button/copy-button.mdx +18 -0
- package/dist/components/date-picker/date-picker.css +11 -5
- package/dist/components/date-picker/date-picker.mdx +18 -0
- package/dist/components/dialog/dialog.css +6 -6
- package/dist/components/drawer/drawer.mdx +18 -0
- package/dist/components/dropdown-menu/dropdown-menu.css +18 -0
- package/dist/components/dropdown-menu/dropdown-menu.mdx +18 -0
- package/dist/components/empty-state/empty-state.css +67 -0
- package/dist/components/empty-state/empty-state.mdx +18 -0
- package/dist/components/form/form.mdx +18 -0
- package/dist/components/hover-card/hover-card.mdx +18 -0
- package/dist/components/input-otp/input-otp.mdx +18 -0
- package/dist/components/label/label.mdx +18 -0
- package/dist/components/layout/layout.css +158 -0
- package/dist/components/layout/layout.mdx +30 -0
- package/dist/components/loading-state/loading-state.css +11 -0
- package/dist/components/loading-state/loading-state.mdx +18 -0
- package/dist/components/menubar/menubar.css +4 -4
- package/dist/components/menubar/menubar.mdx +18 -0
- package/dist/components/metric-card/metric-card.mdx +18 -0
- package/dist/components/navigation-menu/navigation-menu.css +2 -2
- package/dist/components/navigation-menu/navigation-menu.mdx +18 -0
- package/dist/components/pagination/pagination.css +8 -2
- package/dist/components/pagination/pagination.mdx +18 -0
- package/dist/components/panel/panel.mdx +18 -0
- package/dist/components/popover/popover.css +7 -2
- package/dist/components/popover/popover.mdx +18 -0
- package/dist/components/radio-group/radio-group.mdx +18 -0
- package/dist/components/resizable/resizable.mdx +18 -0
- package/dist/components/scroll-area/scroll-area.mdx +18 -0
- package/dist/components/searchable-select/searchable-select.css +26 -3
- package/dist/components/searchable-select/searchable-select.mdx +18 -0
- package/dist/components/secret-reveal-card/secret-reveal-card.css +9 -0
- package/dist/components/secret-reveal-card/secret-reveal-card.mdx +18 -0
- package/dist/components/select/select.css +16 -1
- package/dist/components/separator/separator.mdx +18 -0
- package/dist/components/sheet/sheet.css +5 -1
- package/dist/components/sheet/sheet.mdx +18 -0
- package/dist/components/sidebar/sidebar-menu.css +183 -0
- package/dist/components/sidebar/sidebar-submenu.css +69 -0
- package/dist/components/sidebar/sidebar.css +171 -4
- package/dist/components/sidebar/sidebar.mdx +18 -0
- package/dist/components/slider/slider.mdx +18 -0
- package/dist/components/status-chip/status-chip.mdx +18 -0
- package/dist/components/table/table.css +5 -3
- package/dist/components/tabs/tabs.css +3 -3
- package/dist/components/textarea/textarea.css +3 -3
- package/dist/components/textarea/textarea.mdx +18 -0
- package/dist/components/toggle/toggle.css +9 -9
- package/dist/components/toggle/toggle.mdx +18 -0
- package/dist/components/toggle-group/toggle-group.mdx +18 -0
- package/dist/components/tooltip/tooltip.mdx +18 -0
- package/dist/components/typography/heading.mdx +36 -0
- package/dist/components/typography/text.mdx +34 -0
- package/dist/components/typography/typography.css +98 -0
- package/dist/components.css +1366 -118
- package/dist/index.cjs +1239 -1008
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +662 -197
- package/dist/index.d.ts +662 -197
- package/dist/index.js +1220 -1011
- package/dist/index.js.map +1 -1
- package/dist/preset.css +2 -4
- package/dist/styles/components.css +1366 -118
- package/dist/styles/preset.css +2 -4
- package/dist/styles/styles.css +7 -4
- package/dist/styles/utilities.css +137 -0
- package/dist/styles.css +7 -4
- package/dist/utilities.css +137 -0
- package/package.json +22 -4
package/README.md
CHANGED
|
@@ -1,202 +1,246 @@
|
|
|
1
1
|
# 📦 @yuva-devlab/ui
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@yuva-devlab/ui)
|
|
4
|
-
[](https://www.npmjs.com/package/@yuva-devlab/ui)
|
|
5
4
|
[](LICENSE)
|
|
5
|
+
[](https://react.dev)
|
|
6
|
+
[](https://www.typescriptlang.org)
|
|
7
|
+
[](https://developer.mozilla.org/en-US/docs/Web/CSS/@layer)
|
|
6
8
|
|
|
7
|
-
>
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
> Production-ready, fully-typed React component library engineered for the DevLab ecosystem. Built on accessible Radix UI primitives, powered by OKLCH CSS design tokens (`@yuva-devlab/tokens`), and modular W3C Cascade Layers (`@layer dl-*`).
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## What's New in v2.0.0
|
|
14
|
+
|
|
15
|
+
- **Pure Platform CSS Architecture**: Completely eliminated Tailwind CSS runtime and utility dependencies from components. Component styling is strictly governed by W3C Cascade Layers (`@layer dl-base, dl-tokens, dl-components, dl-utilities`), eliminating CSS specificity conflicts and removing build-step plugin overhead.
|
|
16
|
+
- **First-Class Typography Primitives**: Added `<Heading>` and `<Text>` primitives with decoupled semantic HTML tags (`as="h1"`..`as="h6"`, `span`, `div`) and visual scales (`size="display" | "h1".."h6"` and `variant="body-lg" | "body" | "body-sm" | "caption" | "code" | "metric"`).
|
|
17
|
+
- **64+ Accessible UI Primitives**: Expanded catalog with Radix UI accessibility compliance and multi-brand responsiveness.
|
|
18
|
+
- **Upgraded Design Tokens Peer**: Upgraded to `@yuva-devlab/tokens@^2.0.0` with isolated brand extensions and native VS Code autocomplete.
|
|
19
|
+
|
|
20
|
+
---
|
|
10
21
|
|
|
11
22
|
## Features
|
|
12
23
|
|
|
13
|
-
- 🎨 **
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
|
|
24
|
+
- 🎨 **Multi-Brand Theme Architecture** - Seamless brand isolation across OrchestrAI, VitalAI, FinAI, Logs, and Portal.
|
|
25
|
+
- 📐 **Dynamic Theme-Driven Sizing** - Automatic adaptation across brand densities (compact telemetry logs, precision finance tables, athletic kinetic scaling).
|
|
26
|
+
- ⚡ **Pure Platform CSS** - Scoped W3C Cascade Layers (`@layer dl-components, dl-layout, dl-utilities`) and semantic design tokens.
|
|
27
|
+
- 🔤 **Typography Primitives** - First-class `<Heading>` and `<Text>` primitives with semantic decoupling.
|
|
28
|
+
- 📐 **Layout & Composition Primitives** - First-class `<Box>`, `<Flex>`, `<Stack>`, `<Grid>`, and `<Container>` primitives.
|
|
29
|
+
- ♿ **Accessible by Default** - Built on Radix UI primitives with complete WAI-ARIA and keyboard navigation compliance.
|
|
30
|
+
- 🧩 **64+ Core UI & Layout Primitives** - Buttons, Calendars, DatePickers, Drawers, Sheets, Sidebars, Menus, Modals, EmptyStates, Layouts, and more.
|
|
31
|
+
- 🔒 **End-to-End Type Safety** - First-class TypeScript definitions with full polymorphic `asChild` and `as` composition support.
|
|
32
|
+
- 📦 **Tree-Shakeable ESM & CJS** - Highly optimized builds producing clean dual artifacts.
|
|
33
|
+
|
|
34
|
+
---
|
|
22
35
|
|
|
23
36
|
## Installation
|
|
24
37
|
|
|
25
38
|
```bash
|
|
39
|
+
# pnpm (recommended)
|
|
40
|
+
pnpm add @yuva-devlab/ui @yuva-devlab/tokens lucide-react
|
|
41
|
+
|
|
26
42
|
# npm
|
|
27
|
-
npm install @yuva-devlab/ui
|
|
43
|
+
npm install @yuva-devlab/ui @yuva-devlab/tokens lucide-react
|
|
28
44
|
|
|
29
45
|
# yarn
|
|
30
|
-
yarn add @yuva-devlab/ui
|
|
31
|
-
|
|
32
|
-
# pnpm
|
|
33
|
-
pnpm add @yuva-devlab/ui
|
|
46
|
+
yarn add @yuva-devlab/ui @yuva-devlab/tokens lucide-react
|
|
34
47
|
```
|
|
35
48
|
|
|
36
49
|
### Peer Dependencies
|
|
37
50
|
|
|
51
|
+
Ensure your project has the required peer dependencies installed:
|
|
52
|
+
|
|
38
53
|
```bash
|
|
39
|
-
|
|
40
|
-
|
|
54
|
+
pnpm add react@^19.0.0 react-dom@^19.0.0 sonner@^2.0.0
|
|
55
|
+
```
|
|
41
56
|
|
|
42
|
-
|
|
43
|
-
yarn add react@^19.2.0 react-dom@^19.2.0
|
|
57
|
+
---
|
|
44
58
|
|
|
45
|
-
|
|
46
|
-
|
|
59
|
+
## Quick Start
|
|
60
|
+
|
|
61
|
+
### 1. Configure Styles
|
|
62
|
+
|
|
63
|
+
In your application's root stylesheet (e.g. `globals.css` or `app.css`), establish the W3C Cascade Layer order and import your desired tokens and styles:
|
|
64
|
+
|
|
65
|
+
```css
|
|
66
|
+
/* 1. Establish W3C Cascade Layer hierarchy */
|
|
67
|
+
@layer dl-base, dl-tokens, dl-components, dl-layout, dl-utilities, dl-app;
|
|
68
|
+
|
|
69
|
+
/* 2. Import design tokens & brand theme */
|
|
70
|
+
@import "@yuva-devlab/tokens/styles.css";
|
|
71
|
+
@import "@yuva-devlab/tokens/themes/finai.css";
|
|
72
|
+
|
|
73
|
+
/* 3. Import UI components and layout styles */
|
|
74
|
+
@import "@yuva-devlab/ui/styles.css";
|
|
47
75
|
```
|
|
48
76
|
|
|
49
|
-
|
|
77
|
+
> **Tip:** You can import any theme preset from `@yuva-devlab/tokens/themes/*` (`finai`, `vitalai`, `logs`, `orchestrai`, `portal`).
|
|
50
78
|
|
|
51
|
-
|
|
52
|
-
import { Button, Input, Stack, Container } from "@yuva-devlab/ui";
|
|
53
|
-
import "@yuva-devlab/ui/styles.css";
|
|
79
|
+
### 2. Render Components & Typography Primitives
|
|
54
80
|
|
|
55
|
-
|
|
81
|
+
```tsx
|
|
82
|
+
import {
|
|
83
|
+
Heading,
|
|
84
|
+
Text,
|
|
85
|
+
Button,
|
|
86
|
+
Card,
|
|
87
|
+
Badge,
|
|
88
|
+
Stack,
|
|
89
|
+
Flex,
|
|
90
|
+
} from "@yuva-devlab/ui";
|
|
91
|
+
import { Sparkles } from "lucide-react";
|
|
92
|
+
|
|
93
|
+
export default function DashboardCard() {
|
|
56
94
|
return (
|
|
57
|
-
<
|
|
58
|
-
<Stack gap=
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
95
|
+
<Card>
|
|
96
|
+
<Stack gap={4}>
|
|
97
|
+
<Flex justify="between" align="center">
|
|
98
|
+
{/* Decoupled semantic level and visual scale */}
|
|
99
|
+
<Heading as="h2" size="h3">
|
|
100
|
+
DevLab Portfolio
|
|
101
|
+
</Heading>
|
|
102
|
+
<Badge variant="default">Active</Badge>
|
|
103
|
+
</Flex>
|
|
104
|
+
|
|
105
|
+
<Text variant="caption">Last updated 5m ago</Text>
|
|
106
|
+
<Text variant="metric">$1,248,390.50</Text>
|
|
107
|
+
|
|
108
|
+
<Button variant="primary">
|
|
109
|
+
<Sparkles />
|
|
110
|
+
Execute Transaction
|
|
62
111
|
</Button>
|
|
63
112
|
</Stack>
|
|
64
|
-
</
|
|
113
|
+
</Card>
|
|
65
114
|
);
|
|
66
115
|
}
|
|
67
116
|
```
|
|
68
117
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
### Form Components
|
|
118
|
+
---
|
|
72
119
|
|
|
73
|
-
|
|
74
|
-
- **Input** - Text input with label, error states, and helper text
|
|
120
|
+
## Typography Primitives
|
|
75
121
|
|
|
76
|
-
###
|
|
122
|
+
### Heading Component
|
|
77
123
|
|
|
78
|
-
|
|
124
|
+
The `<Heading>` primitive decouples semantic HTML structure (`as`) from visual appearance (`size`):
|
|
79
125
|
|
|
80
|
-
|
|
126
|
+
```tsx
|
|
127
|
+
import { Heading } from "@yuva-devlab/ui";
|
|
81
128
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
- **Grid** - CSS Grid layout with responsive columns
|
|
85
|
-
- **Stack** - Vertical/horizontal stacking with consistent spacing
|
|
86
|
-
- **Container** - Responsive max-width wrapper (sm, md, lg, xl, 2xl)
|
|
129
|
+
// Semantic H1 rendered with compact H3 visual appearance
|
|
130
|
+
<Heading as="h1" size="h3">Compact Header</Heading>
|
|
87
131
|
|
|
88
|
-
|
|
132
|
+
// Display heading for landing pages
|
|
133
|
+
<Heading as="h1" size="display">DevLab Cloud</Heading>
|
|
134
|
+
```
|
|
89
135
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
136
|
+
| Prop | Type | Default | Description |
|
|
137
|
+
| :------ | :-------------------------------------------------------------------------------------- | :----------- | :------------------------------------------------------- |
|
|
138
|
+
| `as` | `"h1"` \| `"h2"` \| `"h3"` \| `"h4"` \| `"h5"` \| `"h6"` \| `"span"` \| `"div"` | `"h2"` | The semantic HTML element rendered to the DOM. |
|
|
139
|
+
| `size` | `"display"` \| `"h1"` \| `"h2"` \| `"h3"` \| `"h4"` \| `"h5"` \| `"h6"` | Matches `as` | The visual typographic scale applied via Cascade Layers. |
|
|
140
|
+
| `color` | `"default"` \| `"muted"` \| `"primary"` \| `"accent"` \| `"destructive"` \| `"success"` | `"default"` | Semantic text color token. |
|
|
95
141
|
|
|
96
|
-
|
|
142
|
+
### Text Component
|
|
97
143
|
|
|
98
|
-
|
|
144
|
+
The `<Text>` primitive handles body text, captions, inline code, and tabular metric numerals:
|
|
99
145
|
|
|
100
146
|
```tsx
|
|
101
|
-
import {
|
|
147
|
+
import { Text } from "@yuva-devlab/ui";
|
|
148
|
+
|
|
149
|
+
<Text variant="body-lg">Large intro body copy</Text>
|
|
150
|
+
<Text variant="body">Standard UI body text</Text>
|
|
151
|
+
<Text variant="body-sm">Small helper description</Text>
|
|
152
|
+
<Text variant="caption">Footnotes and timestamps</Text>
|
|
153
|
+
<Text variant="code">const token = useToken();</Text>
|
|
154
|
+
<Text variant="metric">3,492 req/s</Text>
|
|
155
|
+
```
|
|
102
156
|
|
|
103
|
-
|
|
104
|
-
<Button variant="primary">Primary Action</Button>
|
|
105
|
-
<Button variant="secondary">Secondary Action</Button>
|
|
106
|
-
<Button variant="tertiary">Tertiary Action</Button>
|
|
157
|
+
---
|
|
107
158
|
|
|
108
|
-
|
|
109
|
-
<Button size="sm">Small</Button>
|
|
110
|
-
<Button size="md">Medium</Button>
|
|
111
|
-
<Button size="lg">Large</Button>
|
|
159
|
+
## Multi-Brand Theming
|
|
112
160
|
|
|
113
|
-
|
|
114
|
-
<Button loading>Loading...</Button>
|
|
115
|
-
<Button disabled>Disabled</Button>
|
|
161
|
+
DevLab UI supports multi-brand switching at runtime using `data-brand` and `data-theme` HTML attributes:
|
|
116
162
|
|
|
117
|
-
|
|
118
|
-
|
|
163
|
+
```html
|
|
164
|
+
<!-- Switch to FinAI Spacious Theme with Dark Mode -->
|
|
165
|
+
<html data-brand="finai" class="dark">
|
|
166
|
+
...
|
|
167
|
+
</html>
|
|
119
168
|
```
|
|
120
169
|
|
|
121
|
-
###
|
|
170
|
+
### Supported Brand Themes
|
|
122
171
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
<Box>Navigation</Box>
|
|
131
|
-
</Flex>
|
|
132
|
-
|
|
133
|
-
<Grid cols={{ base: 1, md: 2, lg: 3 }} gap="md">
|
|
134
|
-
<Box p="lg">Card 1</Box>
|
|
135
|
-
<Box p="lg">Card 2</Box>
|
|
136
|
-
<Box p="lg">Card 3</Box>
|
|
137
|
-
</Grid>
|
|
138
|
-
</Stack>
|
|
139
|
-
</Container>;
|
|
140
|
-
```
|
|
172
|
+
| Brand Key | Theme Name | Primary Aesthetic | Token Import |
|
|
173
|
+
| :----------- | :---------------- | :------------------------ | :------------------------------------------ |
|
|
174
|
+
| `finai` | **FinAI** | High-Finance Emerald | `@yuva-devlab/tokens/themes/finai.css` |
|
|
175
|
+
| `vitalai` | **VitalAI** | Athletic Volt Kinetic | `@yuva-devlab/tokens/themes/vitalai.css` |
|
|
176
|
+
| `logs` | **DevLab Logs** | High-Density Matrix Amber | `@yuva-devlab/tokens/themes/logs.css` |
|
|
177
|
+
| `orchestrai` | **OrchestrAI** | Midnight Neon Violet | `@yuva-devlab/tokens/themes/orchestrai.css` |
|
|
178
|
+
| `portal` | **DevLab Portal** | Enterprise Modern Indigo | `@yuva-devlab/tokens/themes/portal.css` |
|
|
141
179
|
|
|
142
|
-
|
|
180
|
+
---
|
|
143
181
|
|
|
144
|
-
|
|
182
|
+
## Component Catalog (64 Components)
|
|
145
183
|
|
|
146
|
-
|
|
184
|
+
### Typography Primitives
|
|
147
185
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
```
|
|
186
|
+
- **Heading** - Semantic heading with decoupled visual scale (`display`, `h1`..`h6`).
|
|
187
|
+
- **Text** - Multi-variant typography primitive (`body-lg`, `body`, `body-sm`, `caption`, `code`, `metric`).
|
|
151
188
|
|
|
152
|
-
|
|
189
|
+
### Layout & Composition Primitives
|
|
153
190
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
191
|
+
- **Box** - Fundamental container with padding, border, radius, shadow, and surface backgrounds.
|
|
192
|
+
- **Flex** - 1D flexbox container (`direction`, `justify`, `align`, `wrap`, `gap`, `inline`).
|
|
193
|
+
- **Stack** - Vertical or horizontal layout flow with token-governed spacing.
|
|
194
|
+
- **Grid** - Responsive 2D grid (`cols`, `gap`, minItemWidth auto-fit).
|
|
195
|
+
- **Container** - Responsive centered layout container with max-width boundaries (`sm` to `2xl`).
|
|
196
|
+
- **AspectRatio**, **Panel**, **Resizable**, **ScrollArea**, **Separator**
|
|
158
197
|
|
|
159
|
-
###
|
|
198
|
+
### General & Display
|
|
160
199
|
|
|
161
|
-
|
|
200
|
+
- **Button**, **CopyButton**, **Card**, **MetricCard**, **SecretRevealCard**, **Badge**, **StatusBadge**, **StatusChip**, **Skeleton**, **LoadingState**, **EmptyState**
|
|
162
201
|
|
|
163
|
-
|
|
164
|
-
import { ConfigProvider } from "@yuva-devlab/ui";
|
|
202
|
+
### Form & Data Entry
|
|
165
203
|
|
|
166
|
-
|
|
167
|
-
return (
|
|
168
|
-
<ConfigProvider brand="finai" defaultTheme="system">
|
|
169
|
-
{children}
|
|
170
|
-
</ConfigProvider>
|
|
171
|
-
);
|
|
172
|
-
}
|
|
173
|
-
```
|
|
204
|
+
- **Input**, **Textarea**, **Checkbox**, **Switch**, **Slider**, **RadioGroup**, **Select**, **SearchableSelect**, **DatePicker**, **Calendar**, **InputOTP**, **Toggle**, **ToggleGroup**, **Form**
|
|
174
205
|
|
|
175
|
-
|
|
206
|
+
### Navigation
|
|
176
207
|
|
|
177
|
-
|
|
208
|
+
- **Sidebar**, **NavigationMenu**, **Menubar**, **Breadcrumb**, **Tabs**, **Pagination**
|
|
178
209
|
|
|
179
|
-
|
|
210
|
+
### Overlays & Dialogs
|
|
180
211
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
212
|
+
- **Dialog**, **AlertDialog**, **ConfirmDialog**, **Drawer**, **Sheet**, **Popover**, **Tooltip**, **HoverCard**, **DropdownMenu**, **ContextMenu**
|
|
213
|
+
|
|
214
|
+
### Feedback & Display
|
|
184
215
|
|
|
185
|
-
|
|
186
|
-
pnpm --filter @yuva-devlab/ui build
|
|
216
|
+
- **Alert**, **Progress**, **Toaster** (Sonner integration), **Avatar**, **Table**, **Accordion**, **Collapsible**, **Carousel**, **Chart**, **Command**
|
|
187
217
|
|
|
188
|
-
|
|
189
|
-
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## TypeScript & Polymorphic Support
|
|
190
221
|
|
|
191
|
-
|
|
192
|
-
|
|
222
|
+
All components export full TypeScript definitions and support polymorphic composition via the `asChild` prop:
|
|
223
|
+
|
|
224
|
+
```tsx
|
|
225
|
+
import Link from "next/link";
|
|
226
|
+
import { Button } from "@yuva-devlab/ui";
|
|
227
|
+
|
|
228
|
+
<Button asChild variant="secondary">
|
|
229
|
+
<Link href="/dashboard">Navigate to Dashboard</Link>
|
|
230
|
+
</Button>;
|
|
193
231
|
```
|
|
194
232
|
|
|
195
|
-
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Documentation & Live Previews
|
|
196
236
|
|
|
197
|
-
|
|
198
|
-
|
|
237
|
+
Explore the interactive component playground, live documentation, and API references at:
|
|
238
|
+
|
|
239
|
+
- **Documentation**: [https://github.com/yuvadevlab/devlab-shared](https://github.com/yuvadevlab/devlab-shared)
|
|
240
|
+
- **Repository**: [https://github.com/yuvadevlab/devlab-shared](https://github.com/yuvadevlab/devlab-shared)
|
|
241
|
+
|
|
242
|
+
---
|
|
199
243
|
|
|
200
244
|
## License
|
|
201
245
|
|
|
202
|
-
MIT © Yuva
|
|
246
|
+
MIT © [Yuva DevLab](https://github.com/yuvadevlab)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Meta, Title, Description, Canvas, Controls } from "@storybook/blocks";
|
|
2
|
+
import * as AccordionStories from "./accordion.stories";
|
|
3
|
+
|
|
4
|
+
<Meta of={AccordionStories} />
|
|
5
|
+
|
|
6
|
+
<Title />
|
|
7
|
+
|
|
8
|
+
# Accordion
|
|
9
|
+
|
|
10
|
+
Vertically stacked set of interactive headings that each reveal a section of content.
|
|
11
|
+
|
|
12
|
+
## Default
|
|
13
|
+
|
|
14
|
+
<Canvas of={AccordionStories.Default} />
|
|
15
|
+
|
|
16
|
+
## Component Properties
|
|
17
|
+
|
|
18
|
+
<Controls />
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
.dl-alert {
|
|
2
2
|
position: relative;
|
|
3
3
|
width: 100%;
|
|
4
|
-
border-radius: var(--radius
|
|
4
|
+
border-radius: var(--radius, 0.5rem);
|
|
5
5
|
border: 1px solid var(--border);
|
|
6
|
-
padding: 0.875rem 1rem;
|
|
6
|
+
padding: var(--space-4, 0.875rem) var(--space-5, 1rem);
|
|
7
7
|
font-size: 0.875rem;
|
|
8
8
|
display: grid;
|
|
9
9
|
grid-template-columns: 1fr;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Meta, Title, Description, Canvas, Controls } from "@storybook/blocks";
|
|
2
|
+
import * as AlertDialogStories from "./alert-dialog.stories";
|
|
3
|
+
|
|
4
|
+
<Meta of={AlertDialogStories} />
|
|
5
|
+
|
|
6
|
+
<Title />
|
|
7
|
+
|
|
8
|
+
# Alert Dialog
|
|
9
|
+
|
|
10
|
+
Modal dialog that interrupts the user with important content and expects a confirmation or cancellation action.
|
|
11
|
+
|
|
12
|
+
## Default
|
|
13
|
+
|
|
14
|
+
<Canvas of={AlertDialogStories.Default} />
|
|
15
|
+
|
|
16
|
+
## Component Properties
|
|
17
|
+
|
|
18
|
+
<Controls />
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Meta, Title, Description, Canvas, Controls } from "@storybook/blocks";
|
|
2
|
+
import * as AspectRatioStories from "./aspect-ratio.stories";
|
|
3
|
+
|
|
4
|
+
<Meta of={AspectRatioStories} />
|
|
5
|
+
|
|
6
|
+
<Title />
|
|
7
|
+
|
|
8
|
+
# Aspect Ratio
|
|
9
|
+
|
|
10
|
+
Displays content within a desired ratio, preventing layout shifts during asset loading.
|
|
11
|
+
|
|
12
|
+
## Default (16:9)
|
|
13
|
+
|
|
14
|
+
<Canvas of={AspectRatioStories.Default} />
|
|
15
|
+
|
|
16
|
+
## Square (1:1)
|
|
17
|
+
|
|
18
|
+
<Canvas of={AspectRatioStories.Square} />
|
|
19
|
+
|
|
20
|
+
## Component Properties
|
|
21
|
+
|
|
22
|
+
<Controls />
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Meta, Title, Description, Canvas, Controls } from "@storybook/blocks";
|
|
2
|
+
import * as BreadcrumbStories from "./breadcrumb.stories";
|
|
3
|
+
|
|
4
|
+
<Meta of={BreadcrumbStories} />
|
|
5
|
+
|
|
6
|
+
<Title />
|
|
7
|
+
|
|
8
|
+
# Breadcrumb
|
|
9
|
+
|
|
10
|
+
Hierarchical navigation trail indicating the current page location within a navigational hierarchy.
|
|
11
|
+
|
|
12
|
+
## Default
|
|
13
|
+
|
|
14
|
+
<Canvas of={BreadcrumbStories.Default} />
|
|
15
|
+
|
|
16
|
+
## Component Properties
|
|
17
|
+
|
|
18
|
+
<Controls />
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
.dl-calendar .rdp-month_caption,
|
|
2
|
+
.dl-calendar .dl-calendar__month-caption {
|
|
3
|
+
position: relative;
|
|
4
|
+
display: flex;
|
|
5
|
+
height: var(--cell-size, 2rem);
|
|
6
|
+
width: 100%;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
padding: 0 var(--cell-size, 2rem);
|
|
10
|
+
font-size: 0.875rem;
|
|
11
|
+
font-weight: 600;
|
|
12
|
+
color: var(--foreground);
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.dl-calendar .rdp-caption_label,
|
|
17
|
+
.dl-calendar .dl-calendar__caption-label {
|
|
18
|
+
font-size: 0.875rem;
|
|
19
|
+
font-weight: 600;
|
|
20
|
+
color: var(--foreground);
|
|
21
|
+
line-height: 1;
|
|
22
|
+
user-select: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.dl-calendar .dl-calendar__caption-label--interactive {
|
|
26
|
+
display: flex;
|
|
27
|
+
height: var(--control-height-sm, 2rem);
|
|
28
|
+
align-items: center;
|
|
29
|
+
gap: 0.25rem;
|
|
30
|
+
border-radius: var(--radius-md, 0.375rem);
|
|
31
|
+
padding-inline: 0.5rem 0.25rem;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.dl-calendar .dl-calendar__dropdowns {
|
|
35
|
+
display: flex;
|
|
36
|
+
width: 100%;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
gap: 0.375rem;
|
|
40
|
+
font-size: 0.875rem;
|
|
41
|
+
font-weight: 500;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.dl-calendar .dl-calendar__dropdown-root {
|
|
45
|
+
position: relative;
|
|
46
|
+
border-radius: var(--radius-md, 0.375rem);
|
|
47
|
+
border: 1px solid var(--border);
|
|
48
|
+
box-shadow: var(--shadow-xs, 0 1px 2px 0 rgb(0 0 0 / 0.05));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.dl-calendar .dl-calendar__dropdown {
|
|
52
|
+
position: absolute;
|
|
53
|
+
inset: 0;
|
|
54
|
+
opacity: 0;
|
|
55
|
+
background: var(--popover);
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.dl-calendar .rdp-nav,
|
|
60
|
+
.dl-calendar .dl-calendar__nav {
|
|
61
|
+
position: absolute;
|
|
62
|
+
top: 0;
|
|
63
|
+
inset-inline: 0;
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: space-between;
|
|
67
|
+
width: 100%;
|
|
68
|
+
height: var(--cell-size, 2rem);
|
|
69
|
+
pointer-events: none;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.dl-calendar .rdp-button_previous,
|
|
73
|
+
.dl-calendar .rdp-button_next,
|
|
74
|
+
.dl-calendar .dl-calendar__nav-button {
|
|
75
|
+
pointer-events: auto;
|
|
76
|
+
width: var(--cell-size, 2rem) !important;
|
|
77
|
+
height: var(--cell-size, 2rem) !important;
|
|
78
|
+
min-width: var(--cell-size, 2rem) !important;
|
|
79
|
+
padding: 0 !important;
|
|
80
|
+
display: inline-flex !important;
|
|
81
|
+
align-items: center;
|
|
82
|
+
justify-content: center;
|
|
83
|
+
border-radius: var(--radius-md, 0.375rem) !important;
|
|
84
|
+
border: 1px solid var(--border);
|
|
85
|
+
background: var(--background);
|
|
86
|
+
color: var(--muted-foreground);
|
|
87
|
+
cursor: pointer;
|
|
88
|
+
user-select: none;
|
|
89
|
+
transition: all 0.15s ease;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.dl-calendar .rdp-button_previous:hover,
|
|
93
|
+
.dl-calendar .rdp-button_next:hover,
|
|
94
|
+
.dl-calendar .dl-calendar__nav-button:hover {
|
|
95
|
+
background-color: var(--accent);
|
|
96
|
+
color: var(--accent-foreground);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.dl-calendar .rdp-button_previous[aria-disabled="true"],
|
|
100
|
+
.dl-calendar .rdp-button_next[aria-disabled="true"] {
|
|
101
|
+
opacity: 0.5;
|
|
102
|
+
pointer-events: none;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.dl-calendar .rdp-button_previous svg,
|
|
106
|
+
.dl-calendar .rdp-button_next svg,
|
|
107
|
+
.dl-calendar .dl-calendar__chevron {
|
|
108
|
+
width: 1rem;
|
|
109
|
+
height: 1rem;
|
|
110
|
+
flex-shrink: 0;
|
|
111
|
+
}
|