@thesage/ui 0.0.10 → 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 ADDED
@@ -0,0 +1,113 @@
1
+ # Sage UI (@thesage/ui)
2
+
3
+ <div align="center">
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@thesage/ui?color=indigo&style=flat-square)](https://www.npmjs.com/package/@thesage/ui)
6
+ [![License](https://img.shields.io/npm/l/@thesage/ui?color=blue&style=flat-square)](https://github.com/shalomormsby/ecosystem/blob/main/LICENSE)
7
+ [![Downloads](https://img.shields.io/npm/dt/@thesage/ui?color=teal&style=flat-square)](https://www.npmjs.com/package/@thesage/ui)
8
+
9
+ **The Design Engine for the Solopreneur.**
10
+
11
+ [Documentation](https://thesage.dev) • [Components](https://thesage.dev/components) • [GitHub](https://github.com/shalomormsby/ecosystem)
12
+
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.
31
+
32
+ ```bash
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
+ }
83
+ ```
84
+
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.
88
+
89
+ ```tsx
90
+ // Example: Customizing the theme
91
+ import { ThemeProvider } from '@thesage/ui';
92
+
93
+ export default function App({ children }) {
94
+ return (
95
+ <ThemeProvider theme="sage" defaultMode="system">
96
+ {children}
97
+ </ThemeProvider>
98
+ );
99
+ }
100
+ ```
101
+
102
+ ## 📦 Component Categories
103
+
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
110
+
111
+ ## 📄 License
112
+
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",