@work-rjkashyap/unified-ui 0.1.1 → 0.2.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/CHANGELOG.md +140 -46
- package/README.md +21 -21
- package/bin/cli.mjs +721 -0
- package/dist/{chunk-QXR4VY7Q.cjs → chunk-33QEKXRQ.cjs} +1 -1
- package/dist/chunk-3EHT6IOA.cjs +49 -0
- package/dist/{chunk-EO4WROWH.mjs → chunk-3OZJ4JLW.mjs} +116 -2
- package/dist/{chunk-BIW2RPDU.cjs → chunk-4ON3M3OM.cjs} +4 -4
- package/dist/{chunk-SSGN5QDC.mjs → chunk-5NZDQWRV.mjs} +1 -1
- package/dist/chunk-B3CW2WZS.cjs +20748 -0
- package/dist/chunk-CTWNFFLB.mjs +20438 -0
- package/dist/{chunk-3HHJAYQI.cjs → chunk-FUWXGHWQ.cjs} +30 -31
- package/dist/{chunk-ZPIPKY2J.cjs → chunk-HITTFB2U.cjs} +127 -1
- package/dist/chunk-MBYCK2JJ.mjs +37 -0
- package/dist/{chunk-CWETOWRM.mjs → chunk-OHEH57BV.mjs} +24 -25
- package/dist/chunk-QEFOXYBO.cjs +398 -0
- package/dist/chunk-TESKVASH.cjs +1766 -0
- package/dist/chunk-TVCJRD3S.mjs +379 -0
- package/dist/chunk-YFH5JPAA.mjs +1735 -0
- package/dist/{chunk-M2LNQWOB.mjs → chunk-ZT3PCXDF.mjs} +4 -4
- package/dist/components.cjs +797 -123
- package/dist/components.d.cts +5211 -1499
- package/dist/components.d.ts +5211 -1499
- package/dist/components.mjs +5 -3
- package/dist/index.cjs +1062 -250
- package/dist/index.d.cts +10 -16
- package/dist/index.d.ts +10 -16
- package/dist/index.mjs +9 -9
- package/dist/motion.cjs +94 -46
- package/dist/motion.d.cts +53 -2
- package/dist/motion.d.ts +53 -2
- package/dist/motion.mjs +1 -1
- package/dist/primitives.cjs +14 -14
- package/dist/primitives.d.cts +1 -1
- package/dist/primitives.d.ts +1 -1
- package/dist/primitives.mjs +2 -2
- package/dist/theme.cjs +102 -9
- package/dist/theme.d.cts +312 -15
- package/dist/theme.d.ts +312 -15
- package/dist/theme.mjs +3 -2
- package/dist/tokens.cjs +19 -19
- package/dist/tokens.d.cts +1 -1
- package/dist/tokens.d.ts +1 -1
- package/dist/tokens.mjs +1 -1
- package/dist/utils.cjs +42 -42
- package/dist/utils.d.cts +42 -38
- package/dist/utils.d.ts +42 -38
- package/dist/utils.mjs +3 -3
- package/dist/z-index-G0PBTHL2.d.cts +466 -0
- package/dist/z-index-G0PBTHL2.d.ts +466 -0
- package/package.json +11 -23
- package/styles.css +660 -404
- package/dist/chunk-2RGLRX6K.cjs +0 -279
- package/dist/chunk-6A7ID2CO.mjs +0 -9916
- package/dist/chunk-F37GRFSW.cjs +0 -10066
- package/dist/chunk-I74E52C5.mjs +0 -271
- package/dist/chunk-IWJ5VMZ7.mjs +0 -323
- package/dist/chunk-KHON2AEM.cjs +0 -342
- package/dist/chunk-LSNKPQP7.cjs +0 -58
- package/dist/chunk-ZBN26FLO.mjs +0 -46
- package/dist/z-index-B_nTQ3qo.d.cts +0 -422
- package/dist/z-index-B_nTQ3qo.d.ts +0 -422
package/CHANGELOG.md
CHANGED
|
@@ -1,31 +1,156 @@
|
|
|
1
1
|
# Unified UI Changelog
|
|
2
|
-
|
|
3
2
|
All notable changes to the Unified UI design system will be documented in this file.
|
|
4
|
-
|
|
5
3
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
4
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
8
5
|
---
|
|
9
|
-
|
|
10
6
|
## [Unreleased]
|
|
11
|
-
|
|
12
7
|
### Planned
|
|
13
|
-
|
|
14
|
-
- Documentation site overhaul (Phase 6) — MDX pages with interactive component previews
|
|
15
|
-
- Motion & accessibility hardening (Phase 7) — focus ring standardization, WCAG AA contrast audit, `prefers-reduced-motion` audit
|
|
16
|
-
- Migration guide (Phase 9) — mapping from legacy `fd-*` tokens to `ds-*` tokens, component replacement strategy
|
|
8
|
+
- Migration guide — mapping from legacy `--ds-*` tokens to new plain `--*` tokens
|
|
17
9
|
- CI/CD pipeline for automated publishing on git tags
|
|
18
10
|
- `UnifiedUIProvider` component for optional auto CSS injection
|
|
19
11
|
- Component tests with Vitest + Testing Library
|
|
20
|
-
|
|
21
12
|
---
|
|
22
13
|
|
|
23
|
-
## [0.
|
|
24
|
-
|
|
14
|
+
## [0.2.0] — 2026-03-05
|
|
25
15
|
### Added
|
|
16
|
+
#### 40 New Components
|
|
17
|
+
- **AlertDialog** — Radix-based modal confirmation dialog with composable header/body/footer
|
|
18
|
+
- **AspectRatio** — Radix-based responsive aspect-ratio container
|
|
19
|
+
- **Banner** — Full-width notification banner with variants
|
|
20
|
+
- **Calendar** — Date calendar component for date selection
|
|
21
|
+
- **Callout** — Highlighted contextual message block with icon support
|
|
22
|
+
- **Carousel** — Scrollable content carousel with navigation controls
|
|
23
|
+
- **Code** — Styled code block with syntax formatting
|
|
24
|
+
- **Collapsible** — Radix-based expandable/collapsible content region
|
|
25
|
+
- **Combobox** — Searchable dropdown with keyboard navigation and filtering
|
|
26
|
+
- **Command** — Command palette / search interface (cmdk-style)
|
|
27
|
+
- **ConfirmDialog** — Simplified confirmation dialog with accept/cancel actions
|
|
28
|
+
- **ContextMenu** — Radix-based right-click context menu with items, sub-menus, and shortcuts
|
|
29
|
+
- **CopyButton** — Click-to-copy button with success feedback
|
|
30
|
+
- **DataList** — Key-value display list for structured data
|
|
31
|
+
- **DatePicker** — Calendar-powered date input with popover picker
|
|
32
|
+
- **EmptyState** — Placeholder for empty content areas with icon, title, description, and action
|
|
33
|
+
- **FileUpload** — Drag-and-drop file upload zone with file list management
|
|
34
|
+
- **FormField** — Form field wrapper with label, description, error message, and validation state
|
|
35
|
+
- **HoverCard** — Radix-based hover-triggered floating card
|
|
36
|
+
- **InputGroup** — Grouped input with addon/prefix/suffix slots
|
|
37
|
+
- **Kbd** — Keyboard shortcut key display
|
|
38
|
+
- **Label** — Standalone form label component (extracted from primitives)
|
|
39
|
+
- **Menubar** — Radix-based horizontal menu bar with dropdowns, checkbox items, and radio items
|
|
40
|
+
- **NavigationMenu** — Radix-based site navigation with flyout content panels
|
|
41
|
+
- **NumberInput** — Numeric input with increment/decrement controls
|
|
42
|
+
- **PinInput** — Multi-digit OTP / PIN code input with auto-focus advancement
|
|
43
|
+
- **Progress** — Determinate and indeterminate progress bar with label
|
|
44
|
+
- **Resizable** — Resizable panel layout powered by `react-resizable-panels`
|
|
45
|
+
- **ScrollArea** — Radix-based custom scrollbar container (vertical + horizontal)
|
|
46
|
+
- **SearchInput** — Input with search icon, clear button, and keyboard shortcut hint
|
|
47
|
+
- **Sidebar** — Collapsible application sidebar with sections, items, and nested groups
|
|
48
|
+
- **Slider** — Radix-based range slider with single and multi-thumb support
|
|
49
|
+
- **Spinner** — Loading spinner with size variants
|
|
50
|
+
- **Stat** — Statistic display with label, value, and trend indicator
|
|
51
|
+
- **Steps** — Multi-step progress indicator with vertical/horizontal orientation
|
|
52
|
+
- **Tag** — Compact label/tag with removable action
|
|
53
|
+
- **Timeline** — Vertical timeline with customizable markers and connectors
|
|
54
|
+
- **Toggle** — Radix-based toggle button with multiple visual variants, sizes, and icon support
|
|
55
|
+
- **ToggleGroup** — Radix-based single/multi toggle group with shared styling
|
|
56
|
+
- **VisuallyHidden** — Accessible screen-reader-only content wrapper
|
|
57
|
+
|
|
58
|
+
#### 13 New Motion Presets
|
|
59
|
+
- **`shakeX`** — Horizontal shake for invalid input feedback
|
|
60
|
+
- **`springHover`** — Spring-based hover micro-interaction
|
|
61
|
+
- **`springPress`** — Spring-based press micro-interaction
|
|
62
|
+
- **`countUp`** — Animated number count-up
|
|
63
|
+
- **`crossfade`** — Crossfade transition between elements
|
|
64
|
+
- **`dragDismiss`** — Drag-to-dismiss gesture preset
|
|
65
|
+
- **`numberRoll`** — Rolling number transition
|
|
66
|
+
- **`revealMask`** — Mask-based content reveal
|
|
67
|
+
- **`slidePanelTop`** — Directional slide panel from top
|
|
68
|
+
- **`slidePanelBottom`** — Directional slide panel from bottom
|
|
69
|
+
- **`slidePanelLeft`** — Directional slide panel from left
|
|
70
|
+
- **`slidePanelRight`** — Directional slide panel from right
|
|
26
71
|
|
|
72
|
+
### Changed
|
|
73
|
+
#### Component Refactors
|
|
74
|
+
- **Accordion** — Major rewrite with improved variant composition and accessibility
|
|
75
|
+
- **Breadcrumb** — Refactored with enhanced composability and truncation logic
|
|
76
|
+
- **Button** — Expanded with new variants and improved styles (618 lines changed)
|
|
77
|
+
- **Card** — Restructured composable sub-components
|
|
78
|
+
- **Checkbox** — Overhauled with `CheckboxGroup` improvements
|
|
79
|
+
- **DataTable** — Major refactor with enhanced filtering, sorting, and pagination (3480 lines changed)
|
|
80
|
+
- **Dialog** — Restructured with improved sizing and scroll behavior
|
|
81
|
+
- **DropdownMenu** — Refactored sub-component exports and styling
|
|
82
|
+
- **Input** — Enhanced with new slot patterns and error states
|
|
83
|
+
- **Pagination** — Rewritten with improved responsive behavior
|
|
84
|
+
- **Popover** — Cleaned up code structure and formatting
|
|
85
|
+
- **Radio** — Refactored `RadioGroup` / `RadioGroupItem` / `RadioCard` styling
|
|
86
|
+
- **Select** — Updated compositional sub-component pattern
|
|
87
|
+
- **Sheet** — Improved directional slide-out behavior
|
|
88
|
+
- **Switch** — Enhanced with new size and label options
|
|
89
|
+
- **Table** — Expanded density and styling options
|
|
90
|
+
- **Tabs** — Reworked variant composition for underline/segment/pills
|
|
91
|
+
- **Textarea** — Improved auto-resize and character count logic
|
|
92
|
+
- **Toast** — Major refactor with improved stacking and animations (1209 lines changed)
|
|
93
|
+
|
|
94
|
+
#### Code Cleanup
|
|
95
|
+
- Cleaned up formatting and structure in **NavigationMenu**, **Popover**, and **ScrollArea** components
|
|
96
|
+
- Updated `styles.css` with restructured CSS custom properties and new token categories
|
|
97
|
+
- Improved `tokens/colors.ts` with expanded palette definitions
|
|
98
|
+
- Updated `utils/contrast.ts` with refined WCAG checking utilities
|
|
99
|
+
- Updated `motion/presets.ts` — `reduceMotion()` signature cleaned up (unused parameter prefixed with `_`)
|
|
100
|
+
|
|
101
|
+
#### Other
|
|
102
|
+
- Updated `UNIFIED_UI_VERSION` exported constant from `"0.1.2"` to `"0.2.0"`
|
|
103
|
+
- Component count increased from 23 to 63+
|
|
104
|
+
- Barrel exports in `components/index.ts` and `src/index.ts` expanded for all new components
|
|
105
|
+
---
|
|
106
|
+
## [0.1.2] — 2026-03-03
|
|
107
|
+
### Added
|
|
108
|
+
#### Theme Customizer System
|
|
109
|
+
- **`ThemeCustomizerProvider`** — React context provider for runtime theme management with `localStorage` persistence and cross-tab sync via `StorageEvent`
|
|
110
|
+
- **`useThemeCustomizer()`** — hook exposing `config`, `setColorPreset`, `setRadius`, `setFont`, `setShadow`, `setSurfaceStyle`, `resetConfig`, `isDefault`, `generateCSS`
|
|
111
|
+
- **`ThemeCustomizer`** — drop-in UI component with color swatch picker, radius preview, font preview, shadow/surface style toggles, "Copy CSS" button, and reset
|
|
112
|
+
- **13 color presets**: 5 neutral (`Zinc`, `Slate`, `Gray`, `Stone`, `Neutral`) + 8 chromatic (`Blue`, `Green`, `Violet`, `Rose`, `Orange`, `Red`, `Teal`, `Brand`)
|
|
113
|
+
- **7 radius presets**: None (0px) through XL (16px), default 10px
|
|
114
|
+
- **5 font presets**: Outfit, Inter, System, Serif, Mono
|
|
115
|
+
- **4 shadow presets**: None, Subtle, Default, Heavy (each with light/dark scales)
|
|
116
|
+
- **3 surface style presets**: Bordered, Elevated, Mixed
|
|
117
|
+
- `ThemeConfig` type, `DEFAULT_THEME_CONFIG`, `buildThemeOverrides()`, `generateThemeCSS()` utilities
|
|
118
|
+
- `COLOR_PRESET_KEYS`, `COLOR_PRESETS`, `getColorPreset`, `getFontPreset`, `getRadiusPreset`, `getShadowPreset` helpers
|
|
119
|
+
- Exported types: `ColorPreset`, `ColorPresetKey`, `FontPreset`, `RadiusPreset`, `ShadowPreset`, `SurfaceStylePreset`, `PresetSemanticColors`, `ThemeCustomizerContextValue`, `ThemeCustomizerProps`, `ThemeCustomizerProviderProps`
|
|
120
|
+
#### New Tokens
|
|
121
|
+
- `neutral` color palette added to `tokens/colors`
|
|
122
|
+
- New CSS custom properties: `--card`, `--card-foreground`, `--popover`, `--popover-foreground`, `--accent`, `--accent-foreground`, `--destructive`, `--destructive-foreground`, `--ring`, `--radius`, `--chart-1` through `--chart-5`, `--sidebar-*` (8 tokens)
|
|
123
|
+
#### Select Sub-component Exports
|
|
124
|
+
- Newly exported: `SelectContent`, `SelectContentProps`, `SelectTrigger`, `SelectTriggerProps`, `SelectValue`, `SelectScrollUpButton`, `SelectScrollUpButtonProps`, `SelectScrollDownButton`, `SelectScrollDownButtonProps`
|
|
125
|
+
### Changed
|
|
126
|
+
#### Color Format: RGB → oklch
|
|
127
|
+
- All color tokens migrated from RGB channel strings (e.g. `"79 70 229"`) to complete `oklch()` values (e.g. `"oklch(0.585 0.233 277.117)"`)
|
|
128
|
+
- Affects all palettes: `slate`, `gray`, `zinc`, `brand`, `blue`, `green`, `red`, `amber`, `teal`
|
|
129
|
+
- Semantic colors (light + dark) updated to use oklch values
|
|
130
|
+
- Shadow tokens updated from `rgba()` to `oklch()` syntax
|
|
131
|
+
- `dsColorVar()` now returns `var(--{name})` and uses `color-mix(in oklch, ...)` for alpha variants instead of `rgb(... / alpha)`
|
|
132
|
+
#### CSS Variable Prefix Removal (`--ds-*` → `--*`)
|
|
133
|
+
- Removed the `PREFIX` constant from `contract.ts`
|
|
134
|
+
- All CSS custom properties simplified: `--ds-color-primary` → `--primary`, `--ds-radius-md` → `--radius-md`, `--ds-shadow-lg` → `--shadow-lg`, `--ds-z-modal` → `--z-modal`, `--ds-duration-fast` → `--duration-fast`, `--ds-easing-standard` → `--easing-standard`, `--ds-font-sans` → `--font-sans`
|
|
135
|
+
- All Tailwind utility classes updated: `bg-ds-primary` → `bg-primary`, `text-ds-foreground` → `text-foreground`, `rounded-ds-md` → `rounded-md`, etc.
|
|
136
|
+
- All 25 components, 3 primitives, and all utilities updated for the new naming
|
|
137
|
+
#### Focus Ring System Overhaul
|
|
138
|
+
- Redesigned from ring-based (`focus-visible:ring-2 focus-visible:ring-ds-focus-ring focus-visible:ring-offset-2`) to border-based (`focus-visible:border-border-strong`) focus indicators
|
|
139
|
+
- All focus ring variants updated: `focusRingClasses`, `focusRingInsetClasses`, `focusRingCompactClasses`, `focusWithinRingClasses`, `focusRingGroupRingClasses`, `focusRingGroupTriggerClasses`
|
|
140
|
+
#### Component Updates
|
|
141
|
+
- **Button** — Added `not-prose no-underline` to base styles to prevent prose typography overrides on `<a>` buttons
|
|
142
|
+
- **Select** — Refactored to compositional sub-component pattern; removed `SelectProps` type (use sub-component props instead)
|
|
143
|
+
- **DropdownMenu** — Major refactor (618 lines changed)
|
|
144
|
+
- **Popover** — Major refactor (332 lines changed)
|
|
145
|
+
- **DataTable** — Updated for new token naming and focus styles
|
|
146
|
+
#### Other
|
|
147
|
+
- Updated `UNIFIED_UI_VERSION` exported constant from `"0.1.1"` to `"0.1.2"`
|
|
148
|
+
- `@theme` block in `styles.css` completely rewritten with plain `--{name}` properties and new token categories
|
|
149
|
+
- `dsVar()` now generates `--{category}-{name}` (was `--ds-{category}-{name}`)
|
|
150
|
+
---
|
|
151
|
+
## [0.1.1] — 2026-02-28
|
|
152
|
+
### Added
|
|
27
153
|
#### DataTable Component
|
|
28
|
-
|
|
29
154
|
- **DataTable** — Full-featured data table powered by TanStack Table (`@tanstack/react-table` ≥ 8.0.0)
|
|
30
155
|
- Column sorting, filtering (text + faceted), row selection, column visibility toggles
|
|
31
156
|
- Built-in pagination with configurable page sizes
|
|
@@ -33,36 +158,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
33
158
|
- `createColumnHelper` re-export for type-safe column definitions
|
|
34
159
|
- Exported types: `DataTableProps`, `DataTableColumnMeta`, `DataTableFacetedFilter`, `UseDataTableOptions`, `UseDataTableReturn`, `ColumnDef`, `ColumnFiltersState`, `PaginationState`, `Row`, `RowSelectionState`, `SortingState`, `VisibilityState`
|
|
35
160
|
- `@tanstack/react-table` added as an optional peer dependency
|
|
36
|
-
|
|
37
161
|
#### Motion Hooks
|
|
38
|
-
|
|
39
162
|
- `useMotion()` — hook for accessing motion presets with reduced-motion awareness
|
|
40
163
|
- `useMotionProps()` — hook that returns spread-ready motion props
|
|
41
164
|
- `useMotionSpringConfig()` — hook for accessing spring configuration tokens
|
|
42
165
|
- `useReducedMotion()` — hook for detecting `prefers-reduced-motion` user preference
|
|
43
166
|
- `MotionSafe` — wrapper component that conditionally renders motion based on user preference
|
|
44
|
-
|
|
45
167
|
### Changed
|
|
46
|
-
|
|
47
168
|
- Updated `UNIFIED_UI_VERSION` exported constant from `"0.1.0"` to `"0.1.1"`
|
|
48
169
|
- Component count updated from 22 to 23 across documentation and metadata
|
|
49
170
|
- Package description updated to reflect 23+ components
|
|
50
|
-
|
|
51
171
|
### Fixed
|
|
52
|
-
|
|
53
172
|
- Removed self-referential dependency (`@work-rjkashyap/unified-ui` depending on itself) from `package.json`
|
|
54
173
|
- Added missing `homepage` and `bugs` fields to `package.json`
|
|
55
174
|
- Added `funding` field to `package.json`
|
|
56
175
|
- Expanded `keywords` in `package.json` for better npm discoverability (`tailwind-css-v4`, `design-tokens`, `css-variables`, `theming`, `dark-mode`, `typescript`, `tree-shakeable`)
|
|
57
|
-
|
|
58
176
|
---
|
|
59
|
-
|
|
60
177
|
## [0.1.0] — 2026-02-27
|
|
61
|
-
|
|
62
178
|
### Added
|
|
63
|
-
|
|
64
179
|
#### Design Tokens
|
|
65
|
-
|
|
66
180
|
- Color palettes: `slate`, `gray`, `zinc`, `neutral`, `red`, `green`, `blue`, `amber`, `teal`, `brand`, `pure`
|
|
67
181
|
- Semantic color mappings for light and dark themes (`semanticLight`, `semanticDark`)
|
|
68
182
|
- Spacing scale (0–96 + custom values)
|
|
@@ -71,17 +185,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
71
185
|
- Shadow scale with light and dark variants
|
|
72
186
|
- Z-index scale (`hide`, `base`, `dropdown`, `sticky`, `overlay`, `modal`, `popover`, `toast`, `max`)
|
|
73
187
|
- Motion tokens: `duration`, `easing`, `spring`, `stagger` (with CSS and seconds variants)
|
|
74
|
-
|
|
75
188
|
#### Theme System
|
|
76
|
-
|
|
77
|
-
- CSS variable contract using `--ds-` prefix for all tokens
|
|
189
|
+
- CSS variable contract mapping all tokens to plain CSS custom properties
|
|
78
190
|
- `DSThemeProvider` component with light/dark/system mode support
|
|
79
191
|
- `useDSTheme()` hook for programmatic theme access
|
|
80
192
|
- `buildLightThemeVars()` / `buildDarkThemeVars()` / `buildThemeCSS()` utilities
|
|
81
193
|
- `cssVar()` helper for type-safe CSS variable references
|
|
82
|
-
|
|
83
194
|
#### Typography System
|
|
84
|
-
|
|
85
195
|
- Multi-font architecture with four font families:
|
|
86
196
|
- **Outfit** (`--font-outfit`) — primary sans-serif UI typeface
|
|
87
197
|
- **Inter** (`--font-inter`) — display / headings
|
|
@@ -89,15 +199,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
89
199
|
- **JetBrains Mono** (`--font-jetbrains`) — monospace / code
|
|
90
200
|
- `font` prop on `Typography` component for runtime font switching
|
|
91
201
|
- Graceful fallback to system font stacks when web fonts are unavailable
|
|
92
|
-
|
|
93
202
|
#### Tailwind CSS v4 Integration
|
|
94
|
-
|
|
95
203
|
- `styles.css` with full `@theme` block mapping all tokens to Tailwind utilities
|
|
96
|
-
-
|
|
204
|
+
- Direct Tailwind utilities for colors, radius, shadows, transitions, fonts (no prefix)
|
|
97
205
|
- Font CSS custom properties (`--font-outfit`, `--font-inter`, `--font-lora`, `--font-jetbrains`)
|
|
98
|
-
|
|
99
206
|
#### Primitive Components
|
|
100
|
-
|
|
101
207
|
- **Typography** — polymorphic text component with `variant`, `font`, `color`, `align`, `truncate` props
|
|
102
208
|
- **Heading** — semantic heading (h1–h6) with automatic size mapping
|
|
103
209
|
- **Subheading** — secondary heading variant
|
|
@@ -110,9 +216,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
110
216
|
- **Stack** — flexbox layout with `direction`, `gap`, `align`, `justify`
|
|
111
217
|
- **Grid** — CSS grid layout with responsive column configuration
|
|
112
218
|
- **Divider** — horizontal/vertical separator with label support
|
|
113
|
-
|
|
114
219
|
#### Composite Components (22 total)
|
|
115
|
-
|
|
116
220
|
- **Button** — primary, secondary, outline, ghost, danger, link variants; sm/md/lg sizes; icon-only mode; loading state
|
|
117
221
|
- **Input** — text input with prefix/suffix slots, error state, disabled state
|
|
118
222
|
- **Textarea** — auto-resize support, character count, error state
|
|
@@ -136,9 +240,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
136
240
|
- **Table** — semantic table with striped rows, hover highlight, sticky header, responsive wrapper; compact/default/relaxed density
|
|
137
241
|
- **Pagination** — page numbers with ellipsis, prev/next, compact variant, controlled/uncontrolled
|
|
138
242
|
- **Breadcrumb** — composable sub-components + `BreadcrumbNav` shorthand; truncation with ellipsis
|
|
139
|
-
|
|
140
243
|
#### Motion System
|
|
141
|
-
|
|
142
244
|
- Fade presets: `fadeIn`, `fadeInFast`, `fadeInSlow`
|
|
143
245
|
- Slide presets: `slideUp`, `slideUpSm`, `slideUpLg`, `slideUpSpring`, `slideDown`, `slideDownSm`, `slideLeft`, `slideRight`, `slideInFromLeft`, `slideInFromRight`, `slideInFromBottom`
|
|
144
246
|
- Scale presets: `scaleIn`, `scaleInLg`, `scaleInSpring`
|
|
@@ -151,9 +253,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
151
253
|
- Stagger containers: `staggerContainer`, `staggerContainerFast`, `staggerContainerSlow`
|
|
152
254
|
- `motionProps()` spread helper for clean JSX usage
|
|
153
255
|
- `reduceMotion` / `withReducedMotion()` utilities for `prefers-reduced-motion` support
|
|
154
|
-
|
|
155
256
|
#### Utilities
|
|
156
|
-
|
|
157
257
|
- `cn()` — class name merger (clsx + tailwind-merge)
|
|
158
258
|
- `mergeSlots()` — slot-based class merging for composite components
|
|
159
259
|
- `composeRefs()` — compose multiple React refs into one
|
|
@@ -167,9 +267,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
167
267
|
- Polymorphic component types: `AsProp`, `PolymorphicProps`, `PolymorphicPropsWithRef`, `PolymorphicRef`, `PolymorphicComponent`
|
|
168
268
|
- Slot types: `SlotClasses`, `SlotConfig`, `SlotDefinition`, `SlotRenderFn`, `Slots`
|
|
169
269
|
- Component types: `ComponentSize`, `ComponentIntent`, `ChildrenProps`, `OptionalChildrenProps`
|
|
170
|
-
|
|
171
270
|
#### Package & Build
|
|
172
|
-
|
|
173
271
|
- `tsup` build pipeline producing ESM (`.mjs`) and CJS (`.cjs`) with TypeScript declarations (`.d.ts` / `.d.cts`)
|
|
174
272
|
- 7 entry points: `index`, `tokens`, `theme`, `primitives`, `components`, `motion`, `utils`
|
|
175
273
|
- Selective `"use client"` directive — applied only to client entry points (not tokens/utils)
|
|
@@ -177,17 +275,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
177
275
|
- Tree-shakeable with code splitting enabled
|
|
178
276
|
- `styles.css` exported as `@work-rjkashyap/unified-ui/styles.css` for Tailwind `@theme` integration
|
|
179
277
|
- `@unified-ui/*` TypeScript path aliases (zero relative cross-directory imports)
|
|
180
|
-
|
|
181
278
|
#### Infrastructure
|
|
182
|
-
|
|
183
279
|
- `UNIFIED_UI_VERSION` exported constant for runtime version checking
|
|
184
280
|
- `.npmignore` for clean package distribution
|
|
185
281
|
- `sideEffects` field for optimal tree-shaking
|
|
186
282
|
- Conditional `exports` map with full `import`/`require`/`types` resolution
|
|
187
283
|
- `typesVersions` fallback for older TypeScript resolvers
|
|
188
|
-
|
|
189
284
|
---
|
|
190
|
-
|
|
191
285
|
_Design system: Unified UI_
|
|
192
286
|
_Maintainer: Rajeshwar Kashyap_
|
|
193
287
|
_Repository: [github.com/imrj05/unified-ui](https://github.com/imrj05/unified-ui)_
|
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
- **Token-driven** — Every color, spacing, radius, shadow, and motion value flows from a single source of truth
|
|
16
16
|
- **23+ components** — Production-ready composites built on Radix UI primitives
|
|
17
|
-
- **Tailwind CSS v4** — First-class integration via `@theme`
|
|
17
|
+
- **Tailwind CSS v4** — First-class integration via `@theme` with direct utility classes
|
|
18
18
|
- **Framer Motion** — Consistent animation presets with `prefers-reduced-motion` support
|
|
19
19
|
- **Accessible** — WCAG AA contrast, keyboard navigation, ARIA attributes, and focus management
|
|
20
20
|
- **Tree-shakeable** — 7 independent entry points with ESM/CJS dual output and code splitting
|
|
@@ -57,7 +57,7 @@ npm install @radix-ui/react-dialog @radix-ui/react-select @radix-ui/react-tabs
|
|
|
57
57
|
|
|
58
58
|
### 1. Import the CSS
|
|
59
59
|
|
|
60
|
-
Add the stylesheet to your global CSS file **before** any component usage. This registers all
|
|
60
|
+
Add the stylesheet to your global CSS file **before** any component usage. This registers all CSS custom properties and Tailwind `@theme` utilities.
|
|
61
61
|
|
|
62
62
|
```css
|
|
63
63
|
/* src/app/globals.css */
|
|
@@ -183,10 +183,10 @@ Raw design values: colors, spacing, typography, radius, shadows, z-index, and mo
|
|
|
183
183
|
|
|
184
184
|
Bridges tokens to runtime via CSS custom properties and React context.
|
|
185
185
|
|
|
186
|
-
| File | Contents
|
|
187
|
-
| -------------- |
|
|
188
|
-
| `contract.ts` | Maps token keys → CSS variable names
|
|
189
|
-
| `provider.tsx` | `DSThemeProvider` + `useDSTheme` hook
|
|
186
|
+
| File | Contents |
|
|
187
|
+
| -------------- | ----------------------------------------------------------- |
|
|
188
|
+
| `contract.ts` | Maps token keys → CSS variable names, `cssVar` helper |
|
|
189
|
+
| `provider.tsx` | `DSThemeProvider` + `useDSTheme` hook |
|
|
190
190
|
|
|
191
191
|
### Layer 3 — Primitives (`primitives/`)
|
|
192
192
|
|
|
@@ -232,33 +232,33 @@ Hooks: `useMotion`, `useMotionProps`, `useMotionSpringConfig`, `useReducedMotion
|
|
|
232
232
|
|
|
233
233
|
## CSS Variable Prefix
|
|
234
234
|
|
|
235
|
-
All CSS custom properties use
|
|
235
|
+
All CSS custom properties use plain `--` prefix with no namespace infix:
|
|
236
236
|
|
|
237
237
|
```
|
|
238
|
-
--
|
|
239
|
-
--
|
|
240
|
-
--
|
|
241
|
-
--
|
|
242
|
-
--
|
|
243
|
-
--
|
|
238
|
+
--primary
|
|
239
|
+
--radius-md
|
|
240
|
+
--shadow-lg
|
|
241
|
+
--duration-normal
|
|
242
|
+
--easing-standard
|
|
243
|
+
--font-sans
|
|
244
244
|
```
|
|
245
245
|
|
|
246
246
|
### Tailwind Utility Classes
|
|
247
247
|
|
|
248
|
-
After importing the CSS, use
|
|
248
|
+
After importing the CSS, use standard Tailwind utilities:
|
|
249
249
|
|
|
250
250
|
```html
|
|
251
251
|
<!-- Colors (supports opacity modifier) -->
|
|
252
|
-
<div class="bg-
|
|
253
|
-
<div class="bg-
|
|
252
|
+
<div class="bg-primary text-primary-foreground">Primary</div>
|
|
253
|
+
<div class="bg-muted/50">Semi-transparent muted</div>
|
|
254
254
|
|
|
255
255
|
<!-- Radius, shadows, transitions -->
|
|
256
|
-
<div class="rounded-
|
|
257
|
-
<button class="duration-
|
|
256
|
+
<div class="rounded-md shadow-lg">Elevated card</div>
|
|
257
|
+
<button class="duration-fast ease-standard">Animated</button>
|
|
258
258
|
|
|
259
259
|
<!-- Fonts -->
|
|
260
|
-
<p class="font-
|
|
261
|
-
<code class="font-
|
|
260
|
+
<p class="font-serif">Editorial text</p>
|
|
261
|
+
<code class="font-mono">console.log("hello")</code>
|
|
262
262
|
```
|
|
263
263
|
|
|
264
264
|
### Data Attributes
|
|
@@ -351,7 +351,7 @@ console.log(UNIFIED_UI_VERSION); // "0.1.1"
|
|
|
351
351
|
|
|
352
352
|
## Troubleshooting
|
|
353
353
|
|
|
354
|
-
### `bg-
|
|
354
|
+
### `bg-primary` and other Tailwind utilities aren't working
|
|
355
355
|
|
|
356
356
|
Make sure you import the CSS **after** `@import "tailwindcss"` in your global stylesheet. The `@theme` block must be processed by Tailwind.
|
|
357
357
|
|