@andre-gra/oryx-ui 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 +198 -0
- package/dist/index.d.ts +622 -0
- package/dist/oryx-ui.js +5348 -0
- package/dist/oryx-ui.umd.cjs +45 -0
- package/dist/oryx.css +1 -0
- package/package.json +90 -0
package/README.md
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# Oryx UI
|
|
2
|
+
|
|
3
|
+
A React component library with intelligent theming based on Radix UI primitives. Features an AI-powered theme agent that learns your preferences and automatically applies optimal theme combinations.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install oryx-ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { OryxProvider, Accordion, Select, AlertDialog } from 'oryx-ui';
|
|
15
|
+
import 'oryx-ui/styles.css';
|
|
16
|
+
|
|
17
|
+
function App() {
|
|
18
|
+
return (
|
|
19
|
+
<OryxProvider defaultTheme="theme-amber">
|
|
20
|
+
<YourApp />
|
|
21
|
+
</OryxProvider>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Features
|
|
27
|
+
|
|
28
|
+
- 🎨 **40+ Theme Variants** - Beautiful color palettes with light and dark modes
|
|
29
|
+
- 📐 **3 Size Options** - Compact, default, and large component sizes
|
|
30
|
+
- 🤖 **AI Theme Agent** - Learns preferences and auto-applies themes based on time/context
|
|
31
|
+
- ♿ **Accessible** - Built on Radix UI primitives with full ARIA support
|
|
32
|
+
- 🎯 **TypeScript** - Complete type definitions included
|
|
33
|
+
|
|
34
|
+
## Components
|
|
35
|
+
|
|
36
|
+
### Accordion
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
import { Accordion } from 'oryx-ui';
|
|
40
|
+
|
|
41
|
+
<Accordion
|
|
42
|
+
items={[
|
|
43
|
+
{ mainText: "Section 1", collapsibleText: "Content 1" },
|
|
44
|
+
{ mainText: "Section 2", collapsibleText: "Content 2" }
|
|
45
|
+
]}
|
|
46
|
+
/>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Select
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
import { Select } from 'oryx-ui';
|
|
53
|
+
|
|
54
|
+
<Select
|
|
55
|
+
label="Choose fruit"
|
|
56
|
+
placeholder="Select..."
|
|
57
|
+
options={[
|
|
58
|
+
{ label: "Fruits", group: [{ value: "apple", label: "Apple" }] }
|
|
59
|
+
]}
|
|
60
|
+
onValueChange={(value) => console.log(value)}
|
|
61
|
+
/>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### AlertDialog
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
import { AlertDialog } from 'oryx-ui';
|
|
68
|
+
|
|
69
|
+
<AlertDialog
|
|
70
|
+
texts={{
|
|
71
|
+
buttonTrigger: "Delete",
|
|
72
|
+
content: "Are you sure?",
|
|
73
|
+
description: "This action cannot be undone.",
|
|
74
|
+
buttonCancel: "Cancel",
|
|
75
|
+
action: "Delete"
|
|
76
|
+
}}
|
|
77
|
+
onAction={() => handleDelete()}
|
|
78
|
+
/>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### NavigationMenu
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
import { NavigationMenu } from 'oryx-ui';
|
|
85
|
+
|
|
86
|
+
<NavigationMenu
|
|
87
|
+
items={[
|
|
88
|
+
{
|
|
89
|
+
title: "Products",
|
|
90
|
+
item: [
|
|
91
|
+
{ type: "card", title: "Featured", href: "/", text: "Our main product" },
|
|
92
|
+
{ type: "text", title: "Other", href: "/other", text: "Description" }
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
{ title: "About", href: "/about" }
|
|
96
|
+
]}
|
|
97
|
+
/>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Popover
|
|
101
|
+
|
|
102
|
+
```tsx
|
|
103
|
+
import { Popover } from 'oryx-ui';
|
|
104
|
+
|
|
105
|
+
<Popover
|
|
106
|
+
buttonTriggerLabel="Settings"
|
|
107
|
+
fields={[
|
|
108
|
+
{
|
|
109
|
+
fieldTitle: "Dimensions",
|
|
110
|
+
field: [{ label: "Width", htmlFor: "width", id: "width", defaultValue: "100%" }]
|
|
111
|
+
}
|
|
112
|
+
]}
|
|
113
|
+
/>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Theming
|
|
117
|
+
|
|
118
|
+
### Available Themes
|
|
119
|
+
|
|
120
|
+
Themes follow the naming pattern `theme-{color}` or `theme-{color}Dark`:
|
|
121
|
+
|
|
122
|
+
- `theme-amber`, `theme-amberDark`
|
|
123
|
+
- `theme-blue`, `theme-blueDark`
|
|
124
|
+
- `theme-crimson`, `theme-crimsonDark`
|
|
125
|
+
- `theme-cyan`, `theme-cyanDark`
|
|
126
|
+
- `theme-green`, `theme-greenDark`
|
|
127
|
+
- `theme-indigo`, `theme-indigoDark`
|
|
128
|
+
- `theme-mint`, `theme-mintDark`
|
|
129
|
+
- `theme-orange`, `theme-orangeDark`
|
|
130
|
+
- `theme-pink`, `theme-pinkDark`
|
|
131
|
+
- `theme-plum`, `theme-plumDark`
|
|
132
|
+
- `theme-purple`, `theme-purpleDark`
|
|
133
|
+
- `theme-red`, `theme-redDark`
|
|
134
|
+
- `theme-sky`, `theme-skyDark`
|
|
135
|
+
- `theme-teal`, `theme-tealDark`
|
|
136
|
+
- `theme-tomato`, `theme-tomatoDark`
|
|
137
|
+
- `theme-violet`, `theme-violetDark`
|
|
138
|
+
- `theme-yellow`, `theme-yellowDark`
|
|
139
|
+
- And more...
|
|
140
|
+
|
|
141
|
+
### Using Theme Hooks
|
|
142
|
+
|
|
143
|
+
```tsx
|
|
144
|
+
import { useTheme, useSize } from 'oryx-ui';
|
|
145
|
+
|
|
146
|
+
function MyComponent() {
|
|
147
|
+
const { theme, changeTheme } = useTheme();
|
|
148
|
+
const { size, changeSize } = useSize();
|
|
149
|
+
|
|
150
|
+
return (
|
|
151
|
+
<button onClick={() => changeTheme('theme-blueDark')}>
|
|
152
|
+
Current: {theme}
|
|
153
|
+
</button>
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## AI Theme Agent
|
|
159
|
+
|
|
160
|
+
The library includes an intelligent agent that learns from user interactions:
|
|
161
|
+
|
|
162
|
+
```tsx
|
|
163
|
+
import { OryxProvider, useThemeAgent, ThemeAgentPanel } from 'oryx-ui';
|
|
164
|
+
|
|
165
|
+
// Enable agent (on by default)
|
|
166
|
+
<OryxProvider enableAgent={true}>
|
|
167
|
+
<App />
|
|
168
|
+
</OryxProvider>
|
|
169
|
+
|
|
170
|
+
// Access agent in components
|
|
171
|
+
function Settings() {
|
|
172
|
+
const { state, recommendation, getInsights } = useThemeAgent();
|
|
173
|
+
|
|
174
|
+
return (
|
|
175
|
+
<div>
|
|
176
|
+
<p>Interactions tracked: {state.interactionCount}</p>
|
|
177
|
+
<ThemeAgentPanel /> {/* Built-in UI panel */}
|
|
178
|
+
</div>
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Peer Dependencies
|
|
184
|
+
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"react": ">=17.0.0",
|
|
188
|
+
"react-dom": ">=17.0.0"
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## License
|
|
193
|
+
|
|
194
|
+
MIT
|
|
195
|
+
|
|
196
|
+
## Author
|
|
197
|
+
|
|
198
|
+
[andre-gra](https://github.com/andre-gra)
|