atlasui-lib 0.1.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +157 -0
  2. package/LICENSE +21 -0
  3. package/README.md +253 -0
  4. package/dist/cli/index.js +364 -0
  5. package/dist/index.d.mts +1027 -0
  6. package/dist/index.d.ts +1027 -0
  7. package/dist/index.js +3954 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/index.mjs +3733 -0
  10. package/dist/index.mjs.map +1 -0
  11. package/dist/provider.d.mts +15 -0
  12. package/dist/provider.d.ts +15 -0
  13. package/dist/provider.js +816 -0
  14. package/dist/provider.js.map +1 -0
  15. package/dist/provider.mjs +780 -0
  16. package/dist/provider.mjs.map +1 -0
  17. package/dist/tailwind.d.ts +25 -0
  18. package/dist/tailwind.js +129 -0
  19. package/package.json +138 -0
  20. package/src/cli/index.ts +301 -0
  21. package/src/cli/registry.ts +139 -0
  22. package/src/components/advanced-forms/index.tsx +567 -0
  23. package/src/components/basic/Button.tsx +135 -0
  24. package/src/components/basic/IconButton.tsx +69 -0
  25. package/src/components/basic/index.tsx +446 -0
  26. package/src/components/data-display/index.tsx +608 -0
  27. package/src/components/feedback/index.tsx +554 -0
  28. package/src/components/forms/index.tsx +476 -0
  29. package/src/components/layout/index.tsx +296 -0
  30. package/src/components/media/index.tsx +437 -0
  31. package/src/components/navigation/index.tsx +484 -0
  32. package/src/components/overlay/index.tsx +473 -0
  33. package/src/components/utility/index.tsx +411 -0
  34. package/src/hooks/index.ts +271 -0
  35. package/src/hooks/use-toast.tsx +74 -0
  36. package/src/index.ts +353 -0
  37. package/src/provider.tsx +54 -0
  38. package/src/styles/atlas.css +252 -0
  39. package/src/tailwind.ts +124 -0
  40. package/src/types/index.ts +95 -0
  41. package/src/utils/cn.ts +66 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,157 @@
1
+ # Changelog
2
+
3
+ All notable changes to AtlasUI are documented here.
4
+ Project by [JohnDev19](https://github.com/JohnDev19) Β· [GitHub](https://github.com/JohnDev19/AtlasUI) Β· [atlasui.vercel.app](https://atlasui.vercel.app/)
5
+
6
+ This project follows [Semantic Versioning](https://semver.org).
7
+
8
+ ---
9
+
10
+ ## [0.1.0] β€” 2025-06-28
11
+ ## [0.1.0] β€” 2025-03-13 (UPDATED)
12
+
13
+ ### πŸŽ‰ Initial Release
14
+
15
+ First public release of AtlasUI. 90 components, a full CLI, 10 hooks, a Tailwind
16
+ plugin, and a complete CSS token system with light + dark mode.
17
+
18
+ ---
19
+
20
+ #### atlasui-lib
21
+
22
+ **Basic (10)**
23
+ - `Button` β€” solid, outline, ghost, soft, link, danger variants Β· sizes xs–xl Β· loading state Β· left/right icon slots
24
+ - `IconButton` β€” square or circular icon-only button with all button variants
25
+ - `Link` β€” anchor with external link indicator and underline control
26
+ - `Badge` β€” compact label with 5 color variants and optional dot
27
+ - `Avatar` β€” image with fallback initials, online/offline status ring, 6 sizes
28
+ - `AvatarGroup` β€” stacked avatar row with overflow count
29
+ - `Divider` β€” horizontal/vertical with optional center label
30
+ - `Tag` β€” closable colored tag with icon slot
31
+ - `Chip` β€” toggleable with avatar/icon support and remove button
32
+ - `Tooltip` β€” Radix-powered, all four sides, configurable delay
33
+
34
+ **Layout (10)**
35
+ - `Container` β€” responsive max-width wrapper with padding control
36
+ - `Stack` β€” flex column/row with gap, align, justify, and divider support
37
+ - `Grid` β€” CSS Grid with column/row/gap config
38
+ - `Flex` β€” inline flex with full directional control
39
+ - `Section` β€” semantic `<section>` with vertical padding presets
40
+ - `Spacer` β€” invisible spacer
41
+ - `AspectRatio` β€” Radix aspect-ratio wrapper
42
+ - `Center` β€” flex centering helper
43
+ - `ScrollArea` β€” custom scrollbar via Radix ScrollArea
44
+ - `Masonry` β€” CSS multi-column masonry grid
45
+
46
+ **Navigation (10)**
47
+ - `Navbar` β€” sticky + glass-blur top bar
48
+ - `Sidebar` β€” collapsible with width transition
49
+ - `Menu` / `MenuItem` β€” vertical nav with active/disabled states
50
+ - `DropdownMenu` β€” full Radix Dropdown with all sub-primitives
51
+ - `Breadcrumb` β€” accessible trail with custom separator
52
+ - `Pagination` β€” page numbers, ellipsis, prev/next
53
+ - `Tabs` β€” line, pills, enclosed variants Β· Radix powered
54
+ - `Stepper` β€” horizontal/vertical multi-step progress indicator
55
+ - `CommandDialog` β€” ⌘K command palette via cmdk
56
+
57
+ **Forms (10)**
58
+ - `Input` β€” left/right icon slots, sizes, error state
59
+ - `TextArea` β€” resize control, error state
60
+ - `Select` β€” full Radix Select with all sub-primitives
61
+ - `Checkbox` β€” with label, description, error state
62
+ - `RadioGroup` β€” per-option labels and descriptions
63
+ - `Switch` β€” three sizes, label, description
64
+ - `Slider` β€” range slider
65
+ - `RangeSlider` β€” dual-thumb slider
66
+ - `DatePicker` β€” native date input wrapper
67
+ - `TimePicker` β€” native time input wrapper
68
+
69
+ **Advanced Forms (10)**
70
+ - `FileUpload` β€” drag-and-drop zone with click-to-upload fallback
71
+ - `OTPInput` β€” PIN/OTP with auto-advance and paste support
72
+ - `ColorPicker` β€” swatches + hex input
73
+ - `SearchInput` β€” search with loading state and clear button
74
+ - `PasswordInput` β€” toggle show/hide
75
+ - `Combobox` β€” searchable single-value select
76
+ - `MultiSelect` β€” multi-value select with chips
77
+ - `FormField` / `FormLabel` / `FormError` β€” composable form primitives
78
+
79
+ **Data Display (10)**
80
+ - `Card` β€” surface with header/content/footer slots Β· 5 variants
81
+ - `Table` + sub-primitives β€” full HTML table system
82
+ - `DataTable` β€” sortable data table with loading and empty states
83
+ - `List` / `ListItem` β€” simple, bordered, and divided lists
84
+ - `Statistic` β€” key metric with trend indicator
85
+ - `Timeline` β€” vertical events with color-coded icons
86
+ - `Calendar` β€” month picker with highlighted dates
87
+ - `CodeBlock` β€” code display with copy button and line numbers
88
+ - `Chart` β€” chart wrapper (bring your own chart library)
89
+
90
+ **Feedback (10)**
91
+ - `Alert` β€” info/success/warning/danger with optional dismiss
92
+ - `Toast` β€” Radix Toast with all sub-primitives
93
+ - `Snackbar` β€” positioned message with action
94
+ - `Progress` β€” linear bar with color variants
95
+ - `CircularProgress` β€” SVG ring with indeterminate mode
96
+ - `Skeleton` β€” pulse placeholder for text, rect, circle
97
+ - `LoadingSpinner` β€” accessible SVG spinner
98
+ - `EmptyState` β€” icon + title + description + action slot
99
+ - `StatusIndicator` β€” online/offline/busy/away dot with pulse
100
+ - `Notification` β€” notification item with avatar, timestamp, unread dot
101
+
102
+ **Overlay (10)**
103
+ - `Modal` β€” preset dialog with size variants (sm β†’ full)
104
+ - `Dialog` β€” full Radix Dialog primitive suite
105
+ - `Drawer` β€” slide-in from any edge (left/right/top/bottom)
106
+ - `Sheet` β€” Drawer alias
107
+ - `Popover` β€” floating panel
108
+ - `HoverCard` β€” rich hover preview
109
+ - `ContextMenu` β€” right-click menu
110
+ - `CommandDialog` β€” ⌘K palette
111
+ - `Lightbox` / `ImageViewer` β€” full-screen image overlay
112
+
113
+ **Media (5)**
114
+ - `Image` β€” fallback, aspect ratio, object-fit, rounded, caption
115
+ - `VideoPlayer` β€” HTML5 video with captions/subtitles track support
116
+ - `AudioPlayer` β€” custom UI with seek bar, cover art
117
+ - `Carousel` β€” autoplay, dots, arrows, loop, slidesPerView
118
+ - `Gallery` β€” responsive image grid with click handler
119
+
120
+ **Utility (5)**
121
+ - `ThemeSwitcher` β€” icon / toggle / select variants
122
+ - `CopyButton` β€” icon or labelled button with success feedback
123
+ - `KeyboardShortcut` β€” styled `<kbd>` shortcut display
124
+ - `ResizablePanel` β€” drag-to-resize with min/max constraints
125
+ - `DragDropArea` β€” accessible file drop zone
126
+
127
+ #### Hooks
128
+ - `useDisclosure` β€” open/close state management
129
+ - `useMediaQuery` β€” window media query subscription
130
+ - `useBreakpoint` β€” Tailwind breakpoint helper
131
+ - `useClipboard` β€” clipboard copy with timeout feedback
132
+ - `useLocalStorage` β€” persistent state
133
+ - `useTheme` β€” theme switching (persists to localStorage)
134
+ - `useDebounce` β€” debounced value
135
+ - `useOnClickOutside` β€” outside click detection
136
+ - `useKeydown` β€” keyboard shortcut listener with modifier support
137
+ - `useMounted` β€” SSR-safe mount check
138
+ - `useToast` β€” programmatic toast notifications
139
+
140
+ #### Infrastructure
141
+ - Tailwind CSS plugin + preset (`atlasPlugin`, `atlasPreset`)
142
+ - Full CSS design token system β€” light and dark themes
143
+ - `AtlasProvider` for Next.js App Router
144
+ - TypeScript strict throughout β€” full named type exports
145
+ - Tree-shakeable ESM + CJS dual build via tsup
146
+ - Turbo monorepo setup
147
+
148
+ #### atlasui-lib CLI
149
+ - `init` β€” project setup wizard (detects Next.js, writes atlas.config.json)
150
+ - `add` β€” copies components + installs npm deps, resolves AtlasUI peer deps
151
+ - `list` β€” browse all 90 components filtered by category
152
+ - `diff` β€” compare local copy to latest (registry fetch, coming soon)
153
+ - Auto-detects npm / pnpm / yarn / bun
154
+
155
+ ---
156
+
157
+ [0.1.0]: https://github.com/JohnDev19/AtlasUI/releases/tag/v0.1.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 JohnDev19
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,253 @@
1
+ <div align="center">
2
+
3
+ <br/>
4
+
5
+ ```
6
+ ╔═╗╔╦╗╦ ╔═╗╔═╗╦ ╦╦
7
+ ╠═╣ β•‘ β•‘ β• β•β•£β•šβ•β•—β•‘ β•‘β•‘
8
+ β•© β•© β•© ╩═╝╩ β•©β•šβ•β•β•šβ•β•β•©
9
+ ```
10
+
11
+ ### **Build anything. Ship faster.**
12
+
13
+ 90+ production-ready React components β€” accessible, composable, dark-mode ready.
14
+ Works with Tailwind CSS and Next.js out of the box.
15
+
16
+ [![npm](https://img.shields.io/npm/v/atlasui-lib?color=0ea5e9&label=atlasui-lib)](https://www.npmjs.com/package/atlasui-lib)
17
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
18
+ [![TypeScript](https://img.shields.io/badge/TypeScript-Ready-3178c6)](https://www.typescriptlang.org)
19
+ [![GitHub](https://img.shields.io/github/stars/JohnDev19/AtlasUI?style=social)](https://github.com/JohnDev19/AtlasUI)
20
+
21
+ **[Docs](https://atlasui.vercel.app/)** Β· **[Components](https://atlasui.vercel.app/components)** Β· **[Issues](https://github.com/JohnDev19/AtlasUI/issues)** Β· **[Changelog](CHANGELOG.md)**
22
+
23
+ </div>
24
+
25
+ ---
26
+
27
+ ## Install
28
+
29
+ ```bash
30
+ npm install atlasui-lib
31
+ # pnpm add atlasui-lib
32
+ # bun add atlasui-lib
33
+ ```
34
+
35
+ ---
36
+
37
+ ## Setup
38
+
39
+ ### 1. Import the stylesheet
40
+
41
+ ```tsx
42
+ // app/layout.tsx
43
+ import "atlasui-lib/styles";
44
+ ```
45
+
46
+ ### 2. Add the Tailwind plugin
47
+
48
+ ```ts
49
+ // tailwind.config.ts
50
+ import { atlasPlugin } from "atlasui-lib/tailwind";
51
+
52
+ export default {
53
+ darkMode: ["class"],
54
+ content: ["./app/**/*.{ts,tsx}", "./components/**/*.{ts,tsx}"],
55
+ plugins: [atlasPlugin],
56
+ };
57
+ ```
58
+
59
+ ### 3. Wrap your app
60
+
61
+ ```tsx
62
+ // app/layout.tsx
63
+ import { AtlasProvider } from "atlasui-lib/provider";
64
+
65
+ export default function RootLayout({ children }) {
66
+ return (
67
+ <html lang="en">
68
+ <body>
69
+ <AtlasProvider>{children}</AtlasProvider>
70
+ </body>
71
+ </html>
72
+ );
73
+ }
74
+ ```
75
+
76
+ ### 4. Start building
77
+
78
+ ```tsx
79
+ import { Button, Card, CardContent, Input, Badge } from "atlasui-lib";
80
+
81
+ export default function Page() {
82
+ return (
83
+ <Card>
84
+ <CardContent className="flex flex-col gap-4 p-6">
85
+ <Badge variant="soft" color="success">New</Badge>
86
+ <Input placeholder="Email address" type="email" />
87
+ <Button variant="solid" size="lg">Get started</Button>
88
+ </CardContent>
89
+ </Card>
90
+ );
91
+ }
92
+ ```
93
+
94
+ ---
95
+
96
+ ## CLI
97
+
98
+ atlasui-lib ships with a CLI that copies components straight into your project β€” shadcn-style. You own the code.
99
+
100
+ ```bash
101
+ # Set up atlasui-lib in your project (writes atlas.config.json)
102
+ npx atlasui-lib init
103
+
104
+ # Add components
105
+ npx atlasui-lib add button
106
+ npx atlasui-lib add card modal drawer toast
107
+
108
+ # Browse all 90 components
109
+ npx atlasui-lib list
110
+ npx atlasui-lib list --category forms
111
+
112
+ # Compare your local copy to the latest version
113
+ npx atlasui-lib diff button
114
+ ```
115
+
116
+ After running `add`, a file like `components/ui/button/index.tsx` appears in your project. It re-exports from `atlasui-lib` by default, or you can paste the full source in and go wild.
117
+
118
+ ---
119
+
120
+ ## Components (90)
121
+
122
+ ### Basic (10)
123
+ `Button` `IconButton` `Link` `Badge` `Avatar` `AvatarGroup` `Divider` `Tag` `Chip` `Tooltip`
124
+
125
+ ### Layout (10)
126
+ `Container` `Stack` `Grid` `Flex` `Section` `Spacer` `AspectRatio` `Center` `ScrollArea` `Masonry`
127
+
128
+ ### Navigation (10)
129
+ `Navbar` `Sidebar` `Menu` `DropdownMenu` `Breadcrumb` `Pagination` `Tabs` `CommandPalette` `NavigationMenu` `Stepper`
130
+
131
+ ### Forms (10)
132
+ `Input` `TextArea` `Select` `Checkbox` `RadioGroup` `Switch` `Slider` `RangeSlider` `DatePicker` `TimePicker`
133
+
134
+ ### Advanced Forms (10)
135
+ `FileUpload` `OTPInput` `ColorPicker` `SearchInput` `PasswordInput` `Combobox` `MultiSelect` `FormField` `FormLabel` `FormError`
136
+
137
+ ### Data Display (10)
138
+ `Card` `Table` `DataTable` `List` `ListItem` `Statistic` `Timeline` `Calendar` `Chart` `CodeBlock`
139
+
140
+ ### Feedback (10)
141
+ `Alert` `Toast` `Snackbar` `Progress` `CircularProgress` `Skeleton` `LoadingSpinner` `EmptyState` `StatusIndicator` `Notification`
142
+
143
+ ### Overlay (10)
144
+ `Modal` `Dialog` `Drawer` `Popover` `HoverCard` `ContextMenu` `CommandDialog` `Sheet` `Lightbox` `ImageViewer`
145
+
146
+ ### Media (5)
147
+ `Image` `VideoPlayer` `AudioPlayer` `Carousel` `Gallery`
148
+
149
+ ### Utility (5)
150
+ `ThemeSwitcher` `CopyButton` `KeyboardShortcut` `ResizablePanel` `DragDropArea`
151
+
152
+ ---
153
+
154
+ ## Hooks
155
+
156
+ ```tsx
157
+ import {
158
+ useDisclosure, // open/close state for modals, drawers, anything toggle
159
+ useMediaQuery, // subscribe to any CSS media query
160
+ useBreakpoint, // Tailwind breakpoint detection (sm, md, lg, xl, 2xl)
161
+ useClipboard, // clipboard copy with "copied!" feedback
162
+ useLocalStorage, // useState that persists to localStorage
163
+ useTheme, // read/set light Β· dark Β· system theme
164
+ useDebounce, // debounce any value β€” perfect for search inputs
165
+ useOnClickOutside, // detect clicks outside a ref'd element
166
+ useKeydown, // keyboard shortcut listener with modifier support
167
+ useMounted, // SSR-safe mount check
168
+ useToast, // fire toasts programmatically
169
+ } from "atlasui-lib";
170
+ ```
171
+
172
+ ---
173
+
174
+ ## Theming
175
+
176
+ All colors are CSS custom properties. Override them in your global CSS:
177
+
178
+ ```css
179
+ :root {
180
+ /* swap in your brand color */
181
+ --primary: 262 83% 58%;
182
+ --primary-foreground: 0 0% 100%;
183
+
184
+ /* rounder corners */
185
+ --radius: 0.75rem;
186
+ }
187
+ ```
188
+
189
+ Full token list: `--background` `--foreground` `--primary` `--secondary` `--muted` `--accent` `--destructive` `--success` `--warning` `--info` `--border` `--input` `--ring` `--radius`.
190
+
191
+ ---
192
+
193
+ ## Dark Mode
194
+
195
+ Uses the `class` strategy β€” add `dark` to `<html>` and everything flips automatically.
196
+
197
+ ```tsx
198
+ import { useTheme, ThemeSwitcher } from "atlasui-lib";
199
+
200
+ function Header() {
201
+ const { theme, setTheme } = useTheme();
202
+ return <ThemeSwitcher value={theme} onChange={setTheme} variant="toggle" />;
203
+ }
204
+ ```
205
+
206
+ ---
207
+
208
+ ## Package Structure
209
+
210
+ ```
211
+ atlasui-lib/
212
+ β”œβ”€β”€ src/
213
+ β”‚ β”œβ”€β”€ components/
214
+ β”‚ β”‚ β”œβ”€β”€ basic/ Button, IconButton, Badge, Avatar, Tooltip…
215
+ β”‚ β”‚ β”œβ”€β”€ layout/ Container, Stack, Grid, ScrollArea, Masonry…
216
+ β”‚ β”‚ β”œβ”€β”€ navigation/ Navbar, Tabs, DropdownMenu, Stepper…
217
+ β”‚ β”‚ β”œβ”€β”€ forms/ Input, Select, Checkbox, Slider, Switch…
218
+ β”‚ β”‚ β”œβ”€β”€ advanced-forms/ OTPInput, ColorPicker, Combobox, MultiSelect…
219
+ β”‚ β”‚ β”œβ”€β”€ data-display/ Card, DataTable, Timeline, Calendar, CodeBlock…
220
+ β”‚ β”‚ β”œβ”€β”€ feedback/ Alert, Toast, Skeleton, EmptyState, Progress…
221
+ β”‚ β”‚ β”œβ”€β”€ overlay/ Modal, Drawer, CommandDialog, Lightbox…
222
+ β”‚ β”‚ β”œβ”€β”€ media/ VideoPlayer, AudioPlayer, Carousel, Gallery…
223
+ β”‚ β”‚ └── utility/ ThemeSwitcher, CopyButton, ResizablePanel…
224
+ β”‚ β”œβ”€β”€ hooks/ 10 utility hooks
225
+ β”‚ β”œβ”€β”€ styles/ atlas.css β€” full design token system
226
+ β”‚ β”œβ”€β”€ types/ shared TypeScript types
227
+ β”‚ β”œβ”€β”€ utils/ cn() and helpers
228
+ β”‚ β”œβ”€β”€ cli/ atlasui-lib CLI (add, init, list, diff)
229
+ β”‚ β”œβ”€β”€ provider.tsx AtlasProvider for Next.js
230
+ β”‚ └── tailwind.ts atlasPlugin + atlasPreset
231
+ β”œβ”€β”€ package.json
232
+ β”œβ”€β”€ tsup.config.ts
233
+ └── tsconfig.json
234
+ ```
235
+
236
+ ---
237
+
238
+ ## Contributing
239
+
240
+ Issues and PRs welcome.
241
+ β†’ [github.com/JohnDev19/AtlasUI/issues](https://github.com/JohnDev19/AtlasUI/issues)
242
+
243
+ ---
244
+
245
+ ## License
246
+
247
+ MIT Β© [JohnDev19](https://github.com/JohnDev19)
248
+
249
+ ---
250
+
251
+ <div align="center">
252
+ <sub>Built by JohnDev19.</sub>
253
+ </div>