@optilogic/core 1.0.0-beta.0 → 1.0.0-beta.10

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/dist/styles.css CHANGED
@@ -94,3 +94,64 @@
94
94
  @apply bg-background text-foreground;
95
95
  }
96
96
  }
97
+
98
+ @layer utilities {
99
+ /* Thin scrollbar - apply per-element
100
+ * Uses theme variables for automatic theme matching:
101
+ * - Track: transparent (blends with background)
102
+ * - Thumb: muted-foreground with transparency
103
+ */
104
+ .scrollbar-thin {
105
+ scrollbar-width: thin;
106
+ scrollbar-color: hsl(var(--muted-foreground) / 0.3) transparent;
107
+ }
108
+
109
+ .scrollbar-thin::-webkit-scrollbar {
110
+ width: 8px;
111
+ height: 8px;
112
+ }
113
+
114
+ .scrollbar-thin::-webkit-scrollbar-track {
115
+ background: transparent;
116
+ border-radius: 4px;
117
+ }
118
+
119
+ .scrollbar-thin::-webkit-scrollbar-thumb {
120
+ background: hsl(var(--muted-foreground) / 0.3);
121
+ border-radius: 4px;
122
+ }
123
+
124
+ .scrollbar-thin::-webkit-scrollbar-thumb:hover {
125
+ background: hsl(var(--muted-foreground) / 0.5);
126
+ }
127
+
128
+ /* Global thin scrollbar - apply to html/body to style all descendants */
129
+ .scrollbar-thin-all,
130
+ .scrollbar-thin-all * {
131
+ scrollbar-width: thin;
132
+ scrollbar-color: hsl(var(--muted-foreground) / 0.3) transparent;
133
+ }
134
+
135
+ .scrollbar-thin-all ::-webkit-scrollbar,
136
+ .scrollbar-thin-all::-webkit-scrollbar {
137
+ width: 8px;
138
+ height: 8px;
139
+ }
140
+
141
+ .scrollbar-thin-all ::-webkit-scrollbar-track,
142
+ .scrollbar-thin-all::-webkit-scrollbar-track {
143
+ background: transparent;
144
+ border-radius: 4px;
145
+ }
146
+
147
+ .scrollbar-thin-all ::-webkit-scrollbar-thumb,
148
+ .scrollbar-thin-all::-webkit-scrollbar-thumb {
149
+ background: hsl(var(--muted-foreground) / 0.3);
150
+ border-radius: 4px;
151
+ }
152
+
153
+ .scrollbar-thin-all ::-webkit-scrollbar-thumb:hover,
154
+ .scrollbar-thin-all::-webkit-scrollbar-thumb:hover {
155
+ background: hsl(var(--muted-foreground) / 0.5);
156
+ }
157
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optilogic/core",
3
- "version": "1.0.0-beta.0",
3
+ "version": "1.0.0-beta.10",
4
4
  "description": "Core UI components for Optilogic - A professional React component library",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -38,27 +38,27 @@
38
38
  "README.md"
39
39
  ],
40
40
  "dependencies": {
41
+ "@radix-ui/react-accordion": "^1.2.2",
42
+ "@radix-ui/react-alert-dialog": "^1.1.4",
43
+ "@radix-ui/react-checkbox": "^1.1.3",
44
+ "@radix-ui/react-dropdown-menu": "^2.1.4",
45
+ "@radix-ui/react-label": "^2.1.1",
46
+ "@radix-ui/react-popover": "^1.1.4",
47
+ "@radix-ui/react-progress": "^1.1.1",
48
+ "@radix-ui/react-select": "^2.1.4",
49
+ "@radix-ui/react-separator": "^1.1.1",
50
+ "@radix-ui/react-slot": "^1.2.4",
51
+ "@radix-ui/react-switch": "^1.1.2",
52
+ "@radix-ui/react-tabs": "^1.1.2",
53
+ "@radix-ui/react-tooltip": "^1.1.5",
41
54
  "class-variance-authority": "^0.7.1",
42
55
  "clsx": "^2.1.1",
56
+ "lucide-react": "^0.563.0",
43
57
  "tailwind-merge": "^3.0.1"
44
58
  },
45
59
  "peerDependencies": {
46
- "@radix-ui/react-accordion": "^1.2.0",
47
- "@radix-ui/react-alert-dialog": "^1.1.0",
48
- "@radix-ui/react-checkbox": "^1.1.0",
49
- "@radix-ui/react-dropdown-menu": "^2.1.0",
50
- "@radix-ui/react-label": "^2.1.0",
51
- "@radix-ui/react-popover": "^1.1.0",
52
- "@radix-ui/react-progress": "^1.1.0",
53
- "@radix-ui/react-select": "^2.1.0",
54
- "@radix-ui/react-separator": "^1.1.0",
55
- "@radix-ui/react-slot": "^1.1.0",
56
- "@radix-ui/react-switch": "^1.1.0",
57
- "@radix-ui/react-tabs": "^1.1.0",
58
- "@radix-ui/react-tooltip": "^1.1.0",
59
60
  "@tanstack/react-virtual": "^3.10.0",
60
61
  "date-fns": "^3.0.0 || ^4.0.0",
61
- "lucide-react": "^0.400.0",
62
62
  "react": "^18.0.0 || ^19.0.0",
63
63
  "react-day-picker": "^9.0.0",
64
64
  "react-dom": "^18.0.0 || ^19.0.0",
@@ -66,42 +66,6 @@
66
66
  "tailwindcss": "^3.4.0"
67
67
  },
68
68
  "peerDependenciesMeta": {
69
- "@radix-ui/react-accordion": {
70
- "optional": true
71
- },
72
- "@radix-ui/react-alert-dialog": {
73
- "optional": true
74
- },
75
- "@radix-ui/react-checkbox": {
76
- "optional": true
77
- },
78
- "@radix-ui/react-dropdown-menu": {
79
- "optional": true
80
- },
81
- "@radix-ui/react-label": {
82
- "optional": true
83
- },
84
- "@radix-ui/react-popover": {
85
- "optional": true
86
- },
87
- "@radix-ui/react-progress": {
88
- "optional": true
89
- },
90
- "@radix-ui/react-select": {
91
- "optional": true
92
- },
93
- "@radix-ui/react-separator": {
94
- "optional": true
95
- },
96
- "@radix-ui/react-switch": {
97
- "optional": true
98
- },
99
- "@radix-ui/react-tabs": {
100
- "optional": true
101
- },
102
- "@radix-ui/react-tooltip": {
103
- "optional": true
104
- },
105
69
  "@tanstack/react-virtual": {
106
70
  "optional": true
107
71
  },
@@ -116,15 +80,15 @@
116
80
  }
117
81
  },
118
82
  "devDependencies": {
119
- "@types/react": "^18.3.0",
120
- "@types/react-dom": "^18.3.0",
83
+ "@types/react": "^19.0.0",
84
+ "@types/react-dom": "^19.0.0",
121
85
  "autoprefixer": "^10.4.20",
122
86
  "date-fns": "^4.1.0",
123
87
  "postcss": "^8.4.49",
124
- "react": "^18.3.1",
88
+ "react": "^19.0.0",
125
89
  "react-day-picker": "^9.13.0",
126
- "react-dom": "^18.3.1",
127
- "tailwindcss": "^3.4.16",
90
+ "react-dom": "^19.0.0",
91
+ "tailwindcss": "^3.4.19",
128
92
  "tsup": "^8.3.5",
129
93
  "typescript": "^5.7.2"
130
94
  },
@@ -0,0 +1,251 @@
1
+ import * as React from "react";
2
+ import { cva, type VariantProps } from "class-variance-authority";
3
+
4
+ import { cn } from "../utils/cn";
5
+
6
+ // =============================================================================
7
+ // Board Variants
8
+ // =============================================================================
9
+
10
+ /**
11
+ * Board variant styles using class-variance-authority.
12
+ * Provides elevation (shadow), border, padding, radius, background, and hover options.
13
+ */
14
+ const boardVariants = cva("text-card-foreground", {
15
+ variants: {
16
+ /**
17
+ * Elevation (shadow depth) - similar to MUI Paper
18
+ */
19
+ elevation: {
20
+ none: "",
21
+ sm: "shadow-sm",
22
+ md: "shadow",
23
+ lg: "shadow-lg",
24
+ xl: "shadow-xl",
25
+ },
26
+ /**
27
+ * Border style
28
+ */
29
+ border: {
30
+ none: "",
31
+ default: "border",
32
+ muted: "border border-muted",
33
+ },
34
+ /**
35
+ * Padding size
36
+ */
37
+ padding: {
38
+ none: "",
39
+ sm: "p-2",
40
+ md: "p-4",
41
+ lg: "p-6",
42
+ xl: "p-8",
43
+ },
44
+ /**
45
+ * Border radius
46
+ */
47
+ radius: {
48
+ none: "rounded-none",
49
+ sm: "rounded-sm",
50
+ md: "rounded-md",
51
+ lg: "rounded-lg",
52
+ xl: "rounded-xl",
53
+ full: "rounded-full",
54
+ },
55
+ /**
56
+ * Background color
57
+ */
58
+ background: {
59
+ default: "bg-card",
60
+ muted: "bg-muted",
61
+ transparent: "bg-transparent",
62
+ },
63
+ /**
64
+ * Hover effect styles
65
+ */
66
+ hover: {
67
+ none: "",
68
+ border: "transition-colors duration-200 hover:border-accent",
69
+ elevate: "transition-shadow duration-200 hover:shadow-lg",
70
+ "border-success": "transition-colors duration-200 hover:border-success",
71
+ "border-warning": "transition-colors duration-200 hover:border-warning",
72
+ "border-destructive":
73
+ "transition-colors duration-200 hover:border-destructive",
74
+ },
75
+ },
76
+ defaultVariants: {
77
+ elevation: "none",
78
+ border: "default",
79
+ padding: "none",
80
+ radius: "lg",
81
+ background: "default",
82
+ hover: "none",
83
+ },
84
+ });
85
+
86
+ // =============================================================================
87
+ // Board Component
88
+ // =============================================================================
89
+
90
+ export interface BoardProps
91
+ extends React.HTMLAttributes<HTMLDivElement>,
92
+ VariantProps<typeof boardVariants> {
93
+ /**
94
+ * Custom CSS class for hover border color.
95
+ * Use Tailwind classes like "hover:border-blue-500" or custom CSS variables.
96
+ * This overrides the hover variant's border color if specified.
97
+ */
98
+ hoverBorderClass?: string;
99
+ }
100
+
101
+ /**
102
+ * Board - General-purpose container component with elevation support
103
+ *
104
+ * A flexible container similar to MUI's Paper component. Supports configurable
105
+ * elevation (shadows), borders, padding, border radius, background colors,
106
+ * and hover effects. Use with BoardHeader and BoardContent for structured layouts.
107
+ *
108
+ * @example
109
+ * // Simple container
110
+ * <Board elevation="md" padding="md">
111
+ * <p>Content here</p>
112
+ * </Board>
113
+ *
114
+ * @example
115
+ * // With header and content
116
+ * <Board elevation="lg" border="default">
117
+ * <BoardHeader>
118
+ * <span className="font-semibold">Section Title</span>
119
+ * </BoardHeader>
120
+ * <BoardContent>
121
+ * Main content goes here
122
+ * </BoardContent>
123
+ * </Board>
124
+ *
125
+ * @example
126
+ * // Transparent background with hover effect
127
+ * <Board background="transparent" hover="border" border="muted">
128
+ * <BoardContent>Hoverable content</BoardContent>
129
+ * </Board>
130
+ */
131
+ const Board = React.forwardRef<HTMLDivElement, BoardProps>(
132
+ (
133
+ {
134
+ className,
135
+ elevation,
136
+ border,
137
+ padding,
138
+ radius,
139
+ background,
140
+ hover,
141
+ hoverBorderClass,
142
+ ...props
143
+ },
144
+ ref
145
+ ) => {
146
+ return (
147
+ <div
148
+ ref={ref}
149
+ className={cn(
150
+ boardVariants({
151
+ elevation,
152
+ border,
153
+ padding,
154
+ radius,
155
+ background,
156
+ hover,
157
+ }),
158
+ // Custom hover border color overrides variant if provided
159
+ hoverBorderClass && "transition-colors duration-200",
160
+ hoverBorderClass,
161
+ className
162
+ )}
163
+ {...props}
164
+ />
165
+ );
166
+ }
167
+ );
168
+ Board.displayName = "Board";
169
+
170
+ // =============================================================================
171
+ // BoardHeader Component
172
+ // =============================================================================
173
+
174
+ export interface BoardHeaderProps
175
+ extends React.HTMLAttributes<HTMLDivElement> {}
176
+
177
+ /**
178
+ * BoardHeader - Header section with bottom separator
179
+ *
180
+ * Renders a header area with a bottom border divider. Accepts any children
181
+ * including text, icons, badges, or custom layouts.
182
+ *
183
+ * @example
184
+ * <Board>
185
+ * <BoardHeader>
186
+ * <span className="font-semibold">Title</span>
187
+ * </BoardHeader>
188
+ * <BoardContent>Content</BoardContent>
189
+ * </Board>
190
+ *
191
+ * @example
192
+ * // With custom layout
193
+ * <BoardHeader className="flex items-center justify-between">
194
+ * <div className="flex items-center gap-2">
195
+ * <FileIcon />
196
+ * <span>Documents</span>
197
+ * </div>
198
+ * <Badge>12</Badge>
199
+ * </BoardHeader>
200
+ */
201
+ const BoardHeader = React.forwardRef<HTMLDivElement, BoardHeaderProps>(
202
+ ({ className, ...props }, ref) => (
203
+ <div
204
+ ref={ref}
205
+ className={cn("flex items-center p-4 border-b", className)}
206
+ {...props}
207
+ />
208
+ )
209
+ );
210
+ BoardHeader.displayName = "BoardHeader";
211
+
212
+ // =============================================================================
213
+ // BoardContent Component
214
+ // =============================================================================
215
+
216
+ export interface BoardContentProps
217
+ extends React.HTMLAttributes<HTMLDivElement> {}
218
+
219
+ /**
220
+ * BoardContent - Main content area with consistent padding
221
+ *
222
+ * Provides a padded container for the main content. Useful when using
223
+ * BoardHeader to maintain proper spacing.
224
+ *
225
+ * @example
226
+ * <Board>
227
+ * <BoardHeader>Title</BoardHeader>
228
+ * <BoardContent>
229
+ * Main content goes here
230
+ * </BoardContent>
231
+ * </Board>
232
+ */
233
+ const BoardContent = React.forwardRef<HTMLDivElement, BoardContentProps>(
234
+ ({ className, ...props }, ref) => (
235
+ <div ref={ref} className={cn("p-4", className)} {...props} />
236
+ )
237
+ );
238
+ BoardContent.displayName = "BoardContent";
239
+
240
+ // =============================================================================
241
+ // Exports
242
+ // =============================================================================
243
+
244
+ export {
245
+ // Components
246
+ Board,
247
+ BoardHeader,
248
+ BoardContent,
249
+ // Variants (for advanced customization)
250
+ boardVariants,
251
+ };