@thesage/ui 0.0.11 β 0.0.12
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 +92 -24
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,45 +1,113 @@
|
|
|
1
|
-
# Sage UI
|
|
1
|
+
# Sage UI (@thesage/ui)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<div align="center">
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@thesage/ui)
|
|
6
|
+
[](https://github.com/shalomormsby/ecosystem/blob/main/LICENSE)
|
|
7
|
+
[](https://www.npmjs.com/package/@thesage/ui)
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
**The Design Engine for the Solopreneur.**
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
- βΏ **Accessible**: rigorous adherence to WAI-ARIA standards (via Radix UI).
|
|
11
|
-
- π **Dark Mode**: First-class support for light and dark themes.
|
|
12
|
-
- π§© **Composable**: components are designed to be composed together to build complex interfaces.
|
|
13
|
-
- π **Performance**: Exported as tree-shakeable ESM modules.
|
|
11
|
+
[Documentation](https://thesage.dev) β’ [Components](https://thesage.dev/components) β’ [GitHub](https://github.com/shalomormsby/ecosystem)
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
**Sage UI** is not just a component libraryβit's a systematic design engine built for speed, consistency, and beauty. Built on top of **Radix UI** for headless accessibility and **Tailwind CSS** for styling, it provides a comprehensive suite of 45+ polished components that work together seamlessly.
|
|
18
|
+
|
|
19
|
+
## β¨ Features
|
|
20
|
+
|
|
21
|
+
- **π¨ Systematic Design**: Powered by a robust design token system (colors, typography, spacing).
|
|
22
|
+
- **βΏ Fully Accessible**: Built on WAI-ARIA standards via Radix UI primitives.
|
|
23
|
+
- **π Mode Aware**: First-class support for light and dark modes with automatic color harmonization.
|
|
24
|
+
- **π§© Composable**: Components designed to fit together like LEGO blocks.
|
|
25
|
+
- **π οΈ Type Safe**: Written in TypeScript with full type inference.
|
|
26
|
+
|
|
27
|
+
## π Installation
|
|
28
|
+
|
|
29
|
+
### 1. Install Dependencies
|
|
30
|
+
Sage UI is built on Tailwind CSS. You need to install the package and its peer dependencies.
|
|
16
31
|
|
|
17
32
|
```bash
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
33
|
+
pnpm add @thesage/ui @thesage/tokens @thesage/hooks lucide-react clsx tailwind-merge
|
|
34
|
+
pnpm add -D tailwindcss@^3.4 postcss autoprefixer
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 2. Configure Tailwind
|
|
38
|
+
Update your `tailwind.config.js` contents to use the preset and scan the component definitions.
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
/** @type {import('tailwindcss').Config} */
|
|
42
|
+
module.exports = {
|
|
43
|
+
presets: [require('@thesage/config/tailwind')],
|
|
44
|
+
content: [
|
|
45
|
+
"./src/**/*.{ts,tsx}",
|
|
46
|
+
"./node_modules/@thesage/ui/dist/**/*.{js,ts,jsx,tsx}"
|
|
47
|
+
],
|
|
48
|
+
theme: {
|
|
49
|
+
extend: {},
|
|
50
|
+
},
|
|
51
|
+
plugins: [],
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 3. Import Styles
|
|
56
|
+
Import the global CSS file (which contains the theme variables) in your root entry file (e.g., `main.tsx` or `App.tsx`).
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
import '@thesage/ui/globals.css';
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## π» Usage
|
|
63
|
+
|
|
64
|
+
Sage UI components are designed to be dropped into any React application.
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
import { Button, Card, Text, Heading } from '@thesage/ui';
|
|
68
|
+
|
|
69
|
+
export default function WelcomeCard() {
|
|
70
|
+
return (
|
|
71
|
+
<Card className="max-w-md p-6">
|
|
72
|
+
<Heading level={3} className="mb-2">Welcome to Sage</Heading>
|
|
73
|
+
<Text variant="muted" className="mb-4">
|
|
74
|
+
Build faster with components that look premium out of the box.
|
|
75
|
+
</Text>
|
|
76
|
+
<div className="flex gap-2">
|
|
77
|
+
<Button variant="primary">Get Started</Button>
|
|
78
|
+
<Button variant="ghost">Documentation</Button>
|
|
79
|
+
</div>
|
|
80
|
+
</Card>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
23
83
|
```
|
|
24
84
|
|
|
25
|
-
##
|
|
85
|
+
## ποΈ Theming
|
|
86
|
+
|
|
87
|
+
Sage UI uses a 4-layer token system. Changing a single primary color automatically updates buttons, focus rings, and chart colors across your entire application.
|
|
26
88
|
|
|
27
89
|
```tsx
|
|
28
|
-
|
|
90
|
+
// Example: Customizing the theme
|
|
91
|
+
import { ThemeProvider } from '@thesage/ui';
|
|
29
92
|
|
|
30
|
-
export default function
|
|
93
|
+
export default function App({ children }) {
|
|
31
94
|
return (
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
</
|
|
95
|
+
<ThemeProvider theme="sage" defaultMode="system">
|
|
96
|
+
{children}
|
|
97
|
+
</ThemeProvider>
|
|
35
98
|
);
|
|
36
99
|
}
|
|
37
100
|
```
|
|
38
101
|
|
|
39
|
-
##
|
|
102
|
+
## π¦ Component Categories
|
|
40
103
|
|
|
41
|
-
|
|
104
|
+
- **Actions**: Button, Toggle, ToggleGroup
|
|
105
|
+
- **Forms**: Input, Select, Checkbox, Switch, Slider, Form
|
|
106
|
+
- **Navigation**: Tabs, Menubar, Breadcrumb, Pagination
|
|
107
|
+
- **Overlays**: Dialog, Sheet, Popover, Tooltip, Toast
|
|
108
|
+
- **Data Display**: Card, Avatar, Badge, Table, ScrollArea
|
|
109
|
+
- **Feedback**: Alert, Progress, Skeleton, Sonner
|
|
42
110
|
|
|
43
|
-
## License
|
|
111
|
+
## π License
|
|
44
112
|
|
|
45
113
|
MIT Β© [Shalom Ormsby](https://github.com/shalomormsby)
|
package/dist/index.d.mts
CHANGED
|
@@ -54,7 +54,7 @@ export { F as FieldValidation, a as FormErrors, V as ValidationRule, h as hasErr
|
|
|
54
54
|
import 'clsx';
|
|
55
55
|
|
|
56
56
|
declare const buttonVariants: (props?: ({
|
|
57
|
-
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
57
|
+
variant?: "default" | "primary" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
58
58
|
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
59
59
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
60
60
|
interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
package/dist/index.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ export { F as FieldValidation, a as FormErrors, V as ValidationRule, h as hasErr
|
|
|
54
54
|
import 'clsx';
|
|
55
55
|
|
|
56
56
|
declare const buttonVariants: (props?: ({
|
|
57
|
-
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
57
|
+
variant?: "default" | "primary" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
58
58
|
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
59
59
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
60
60
|
interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
package/dist/index.js
CHANGED
|
@@ -387,6 +387,8 @@ var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
|
387
387
|
variants: {
|
|
388
388
|
variant: {
|
|
389
389
|
default: "bg-primary text-primary-foreground shadow",
|
|
390
|
+
primary: "bg-primary text-primary-foreground shadow",
|
|
391
|
+
// Alias for default
|
|
390
392
|
destructive: "bg-destructive text-destructive-foreground shadow-sm",
|
|
391
393
|
outline: "border border-input bg-transparent shadow-sm hover:bg-primary hover:text-primary-foreground hover:border-primary",
|
|
392
394
|
secondary: "bg-black/5 dark:bg-white/10 backdrop-blur-md border border-black/5 dark:border-white/10 text-secondary-foreground shadow-sm hover:bg-primary hover:text-primary-foreground dark:hover:bg-primary dark:hover:text-primary-foreground",
|