@postxl/ui-components 1.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 ADDED
@@ -0,0 +1,172 @@
1
+ # @postxl/ui-components
2
+
3
+ A React UI component library built on Radix UI primitives with Tailwind CSS v4 styling.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @postxl/ui-components
9
+ # or
10
+ pnpm add @postxl/ui-components
11
+ # or
12
+ yarn add @postxl/ui-components
13
+ ```
14
+
15
+ ## Requirements
16
+
17
+ - React 18+
18
+ - Tailwind CSS 4+
19
+
20
+ ## Setup
21
+
22
+ ### 1. Import the theme CSS
23
+
24
+ In your main CSS file (e.g., `globals.css` or `index.css`), import the theme:
25
+
26
+ ```css
27
+ @import 'tailwindcss';
28
+ @import '@postxl/ui-components/theme.css';
29
+ ```
30
+
31
+ Or if you're using a bundler that supports CSS imports in JS:
32
+
33
+ ```js
34
+ import '@postxl/ui-components/theme.css'
35
+ ```
36
+
37
+ ### 2. Configure dark mode (optional)
38
+
39
+ The components support dark mode via the `.dark` class on the HTML element. You can use the included `ThemeProvider`:
40
+
41
+ ```tsx
42
+ import { ThemeProvider } from '@postxl/ui-components'
43
+
44
+ function App() {
45
+ return (
46
+ <ThemeProvider defaultTheme="system">
47
+ {/* Your app */}
48
+ </ThemeProvider>
49
+ )
50
+ }
51
+ ```
52
+
53
+ ## Usage
54
+
55
+ ```tsx
56
+ import { Button, Card, Input } from '@postxl/ui-components'
57
+
58
+ function MyComponent() {
59
+ return (
60
+ <Card>
61
+ <Input placeholder="Enter your name" />
62
+ <Button variant="primary">Submit</Button>
63
+ </Card>
64
+ )
65
+ }
66
+ ```
67
+
68
+ ## Available Components
69
+
70
+ ### Basic Components
71
+ - `Accordion` - Collapsible content sections
72
+ - `Alert` - Notification messages
73
+ - `AlertDialog` - Modal confirmation dialogs
74
+ - `Avatar` - User profile images
75
+ - `Badge` - Status indicators
76
+ - `Breadcrumb` - Navigation breadcrumbs
77
+ - `Button` - Interactive buttons with variants
78
+ - `Card` / `CardHover` - Content containers
79
+ - `Checkbox` / `ShadcnCheckbox` - Checkable inputs
80
+ - `Label` - Form labels
81
+ - `Separator` - Visual dividers
82
+ - `Skeleton` - Loading placeholders
83
+ - `Spinner` / `Loader` - Loading indicators
84
+ - `Switch` - Toggle switches
85
+ - `Toggle` - Toggle buttons
86
+ - `ToggleGroup` - Grouped toggle buttons
87
+
88
+ ### Input Components
89
+ - `Input` - Text inputs
90
+ - `Textarea` - Multi-line text inputs
91
+ - `Combobox` - Searchable select
92
+ - `Select` - Dropdown selects
93
+ - `Slider` - Range sliders
94
+ - `RadioGroup` - Radio button groups
95
+ - `DatePicker` - Date selection
96
+
97
+ ### Layout Components
98
+ - `ContentFrame` - Content wrapper with header
99
+ - `Resizable` - Resizable panels
100
+ - `ScrollArea` - Scrollable containers
101
+ - `Collapse` - Collapsible sections
102
+
103
+ ### Navigation Components
104
+ - `NavigationMenu` - Site navigation
105
+ - `Menubar` - Menu bars
106
+ - `Pagination` - Page navigation
107
+ - `CommandPalette` / `Command` - Command palette (⌘K)
108
+
109
+ ### Overlay Components
110
+ - `Dialog` - Modal dialogs
111
+ - `Drawer` - Slide-out panels
112
+ - `Modal` - Modal containers
113
+ - `Popover` - Floating content
114
+ - `Sheet` - Side sheets
115
+ - `Tooltip` - Hover tooltips
116
+ - `DropdownMenu` - Dropdown menus
117
+ - `ContextMenu` - Right-click menus
118
+
119
+ ### Data Display
120
+ - `Calendar` - Calendar display
121
+ - `Carousel` - Image carousels
122
+ - `Progress` - Progress indicators
123
+ - `MarkValueRenderer` - Value highlighting
124
+
125
+ ### Toast Notifications
126
+ - `Toaster` / `toast` - Toast notifications (via Sonner)
127
+
128
+ ## Utilities
129
+
130
+ ### `cn()` - Class name merger
131
+ Combines Tailwind classes intelligently:
132
+
133
+ ```tsx
134
+ import { cn } from '@postxl/ui-components'
135
+
136
+ const className = cn('p-4', isActive && 'bg-primary', className)
137
+ ```
138
+
139
+ ### `useTheme()` - Theme hook
140
+ Access and modify the current theme:
141
+
142
+ ```tsx
143
+ import { useTheme } from '@postxl/ui-components'
144
+
145
+ function ThemeToggle() {
146
+ const { theme, setTheme } = useTheme()
147
+ return <button onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}>Toggle</button>
148
+ }
149
+ ```
150
+
151
+ ## Customizing Theme Colors
152
+
153
+ Override CSS variables in your stylesheet:
154
+
155
+ ```css
156
+ :root {
157
+ --primary: #your-color;
158
+ --primary-foreground: #your-color;
159
+ /* ... other variables */
160
+ }
161
+
162
+ .dark {
163
+ --primary: #your-dark-color;
164
+ /* ... dark theme overrides */
165
+ }
166
+ ```
167
+
168
+ See `@postxl/ui-components/theme.css` for all available CSS variables.
169
+
170
+ ## License
171
+
172
+ See LICENSE in the repository root.