@optilogic/core 1.0.0-beta.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/LICENSE +21 -0
- package/README.md +107 -0
- package/dist/index.cjs +6003 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2310 -0
- package/dist/index.d.ts +2310 -0
- package/dist/index.js +5828 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +96 -0
- package/dist/tailwind-preset.cjs +106 -0
- package/dist/tailwind-preset.cjs.map +1 -0
- package/dist/tailwind-preset.d.cts +23 -0
- package/dist/tailwind-preset.d.ts +23 -0
- package/dist/tailwind-preset.js +101 -0
- package/dist/tailwind-preset.js.map +1 -0
- package/package.json +154 -0
- package/src/components/accordion.tsx +187 -0
- package/src/components/alert-dialog.tsx +143 -0
- package/src/components/autocomplete.tsx +271 -0
- package/src/components/badge.tsx +62 -0
- package/src/components/button.tsx +85 -0
- package/src/components/calendar.tsx +235 -0
- package/src/components/card.tsx +94 -0
- package/src/components/checkbox.tsx +77 -0
- package/src/components/chip.tsx +77 -0
- package/src/components/confirmation-modal.tsx +195 -0
- package/src/components/context-menu.tsx +406 -0
- package/src/components/copy-button.tsx +84 -0
- package/src/components/data-grid/DataGrid.tsx +1027 -0
- package/src/components/data-grid/components/CellEditor.tsx +346 -0
- package/src/components/data-grid/components/FilterPopover.tsx +459 -0
- package/src/components/data-grid/components/HeaderCell.tsx +207 -0
- package/src/components/data-grid/components/index.ts +14 -0
- package/src/components/data-grid/hooks/index.ts +28 -0
- package/src/components/data-grid/hooks/useColumnResize.ts +378 -0
- package/src/components/data-grid/hooks/useDataGridState.ts +346 -0
- package/src/components/data-grid/hooks/useKeyboardNavigation.ts +361 -0
- package/src/components/data-grid/index.ts +71 -0
- package/src/components/data-grid/types.ts +478 -0
- package/src/components/data-grid/utils/dataProcessing.ts +277 -0
- package/src/components/data-grid/utils/index.ts +12 -0
- package/src/components/date-picker.tsx +366 -0
- package/src/components/dropdown-menu.tsx +230 -0
- package/src/components/icon-button.tsx +157 -0
- package/src/components/input.tsx +40 -0
- package/src/components/label.tsx +37 -0
- package/src/components/loading-spinner.tsx +113 -0
- package/src/components/modal.tsx +207 -0
- package/src/components/popover.tsx +62 -0
- package/src/components/progress.tsx +41 -0
- package/src/components/resizable-panel.tsx +434 -0
- package/src/components/resize-handle.tsx +187 -0
- package/src/components/select.tsx +160 -0
- package/src/components/separator.tsx +50 -0
- package/src/components/skeleton.tsx +37 -0
- package/src/components/switch.tsx +59 -0
- package/src/components/table.tsx +136 -0
- package/src/components/tabs.tsx +102 -0
- package/src/components/textarea.tsx +36 -0
- package/src/components/theme-picker.tsx +245 -0
- package/src/components/toaster.tsx +84 -0
- package/src/components/tooltip.tsx +199 -0
- package/src/index.ts +318 -0
- package/src/styles.css +96 -0
- package/src/tailwind-preset.ts +129 -0
- package/src/theme/index.ts +41 -0
- package/src/theme/presets.ts +502 -0
- package/src/theme/types.ts +164 -0
- package/src/theme/utils.ts +309 -0
- package/src/utils/cn.ts +14 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Optilogic
|
|
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,107 @@
|
|
|
1
|
+
# @optilogic/core
|
|
2
|
+
|
|
3
|
+
Core UI components for opti-ui - A professional React component library built with Tailwind CSS and Radix UI primitives.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @optilogic/core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Peer Dependencies
|
|
12
|
+
|
|
13
|
+
Install the required peer dependencies:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Required
|
|
17
|
+
npm install react react-dom tailwindcss
|
|
18
|
+
|
|
19
|
+
# Radix UI (install based on components you use)
|
|
20
|
+
npm install @radix-ui/react-tooltip @radix-ui/react-select @radix-ui/react-dropdown-menu
|
|
21
|
+
|
|
22
|
+
# Icons
|
|
23
|
+
npm install lucide-react
|
|
24
|
+
|
|
25
|
+
# Optional (for specific components)
|
|
26
|
+
npm install @tanstack/react-virtual sonner
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Setup
|
|
30
|
+
|
|
31
|
+
### 1. Configure Tailwind CSS
|
|
32
|
+
|
|
33
|
+
Add the opti-ui preset to your Tailwind configuration:
|
|
34
|
+
|
|
35
|
+
```js
|
|
36
|
+
// tailwind.config.js
|
|
37
|
+
import { optiUiPreset } from '@optilogic/core/tailwind-preset';
|
|
38
|
+
|
|
39
|
+
export default {
|
|
40
|
+
presets: [optiUiPreset],
|
|
41
|
+
content: [
|
|
42
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
43
|
+
'./node_modules/@optilogic/core/dist/**/*.{js,mjs}',
|
|
44
|
+
],
|
|
45
|
+
};
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 2. Import Styles
|
|
49
|
+
|
|
50
|
+
Import the base styles in your app's entry point:
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
import '@optilogic/core/styles.css';
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Or define the CSS variables yourself using the reference in the styles.css file.
|
|
57
|
+
|
|
58
|
+
## Usage
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
import { Button, Input, Card, CardHeader, CardTitle, CardContent } from '@optilogic/core';
|
|
62
|
+
|
|
63
|
+
function App() {
|
|
64
|
+
return (
|
|
65
|
+
<Card>
|
|
66
|
+
<CardHeader>
|
|
67
|
+
<CardTitle>Welcome</CardTitle>
|
|
68
|
+
</CardHeader>
|
|
69
|
+
<CardContent>
|
|
70
|
+
<Input placeholder="Enter your name" />
|
|
71
|
+
<Button variant="primary">Submit</Button>
|
|
72
|
+
</CardContent>
|
|
73
|
+
</Card>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Components
|
|
79
|
+
|
|
80
|
+
### Primitives
|
|
81
|
+
- Button, Input, Label, Textarea
|
|
82
|
+
- Badge, Checkbox, Switch
|
|
83
|
+
- Progress, Separator, Skeleton
|
|
84
|
+
|
|
85
|
+
### Radix-based
|
|
86
|
+
- Select, Tabs, Accordion
|
|
87
|
+
- Tooltip, Popover, DropdownMenu
|
|
88
|
+
- AlertDialog
|
|
89
|
+
|
|
90
|
+
### Layout
|
|
91
|
+
- Card, Table, Modal
|
|
92
|
+
- ResizablePanel, ResizeHandle
|
|
93
|
+
|
|
94
|
+
### Data
|
|
95
|
+
- DataGrid (with virtualization)
|
|
96
|
+
- Autocomplete
|
|
97
|
+
|
|
98
|
+
### Feedback
|
|
99
|
+
- Chip, LoadingSpinner, Toaster
|
|
100
|
+
- ConfirmationModal
|
|
101
|
+
|
|
102
|
+
### Utility
|
|
103
|
+
- IconButton, CopyButton, ContextMenu
|
|
104
|
+
|
|
105
|
+
## License
|
|
106
|
+
|
|
107
|
+
MIT
|