@sqlrooms/ui 0.0.0 → 0.0.1-alpha.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/CHANGELOG.md +2 -0
- package/package.json +3 -5
- package/.turbo/turbo-build.log +0 -8
- package/.turbo/turbo-lint.log +0 -10
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/eslint.config.js +0 -4
- package/src/components/accordion.tsx +0 -55
- package/src/components/alert.tsx +0 -59
- package/src/components/badge.tsx +0 -34
- package/src/components/breadcrumb.tsx +0 -115
- package/src/components/button.tsx +0 -55
- package/src/components/card.tsx +0 -76
- package/src/components/checkbox.tsx +0 -28
- package/src/components/dialog.tsx +0 -120
- package/src/components/dropdown-menu.tsx +0 -199
- package/src/components/editable-text.tsx +0 -199
- package/src/components/error-boundary.tsx +0 -48
- package/src/components/error-pane.tsx +0 -81
- package/src/components/form.tsx +0 -176
- package/src/components/input.tsx +0 -22
- package/src/components/label.tsx +0 -24
- package/src/components/popover.tsx +0 -31
- package/src/components/progress-modal.tsx +0 -33
- package/src/components/progress.tsx +0 -26
- package/src/components/resizable.tsx +0 -43
- package/src/components/select.tsx +0 -157
- package/src/components/skeleton-pane.tsx +0 -45
- package/src/components/skeleton.tsx +0 -12
- package/src/components/spinner-pane.tsx +0 -44
- package/src/components/spinner.tsx +0 -16
- package/src/components/switch.tsx +0 -27
- package/src/components/table.tsx +0 -136
- package/src/components/tabs.tsx +0 -53
- package/src/components/textarea.tsx +0 -21
- package/src/components/toast.tsx +0 -127
- package/src/components/toaster.tsx +0 -33
- package/src/components/tooltip.tsx +0 -29
- package/src/hooks/use-toast.ts +0 -191
- package/src/hooks/useDisclosure.ts +0 -26
- package/src/index.ts +0 -35
- package/src/lib/utils.ts +0 -6
- package/src/tailwind-preset.css +0 -68
- package/src/tailwind-preset.ts +0 -55
- package/tsconfig.json +0 -12
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import {cn} from '../lib/utils';
|
|
3
|
-
|
|
4
|
-
const Textarea = React.forwardRef<
|
|
5
|
-
HTMLTextAreaElement,
|
|
6
|
-
React.ComponentProps<'textarea'>
|
|
7
|
-
>(({className, ...props}, ref) => {
|
|
8
|
-
return (
|
|
9
|
-
<textarea
|
|
10
|
-
className={cn(
|
|
11
|
-
'flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
|
|
12
|
-
className,
|
|
13
|
-
)}
|
|
14
|
-
ref={ref}
|
|
15
|
-
{...props}
|
|
16
|
-
/>
|
|
17
|
-
);
|
|
18
|
-
});
|
|
19
|
-
Textarea.displayName = 'Textarea';
|
|
20
|
-
|
|
21
|
-
export {Textarea};
|
package/src/components/toast.tsx
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as ToastPrimitives from '@radix-ui/react-toast';
|
|
3
|
-
import {cva, type VariantProps} from 'class-variance-authority';
|
|
4
|
-
import {X} from 'lucide-react';
|
|
5
|
-
|
|
6
|
-
import {cn} from '../lib/utils';
|
|
7
|
-
|
|
8
|
-
const ToastProvider = ToastPrimitives.Provider;
|
|
9
|
-
|
|
10
|
-
const ToastViewport = React.forwardRef<
|
|
11
|
-
React.ElementRef<typeof ToastPrimitives.Viewport>,
|
|
12
|
-
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>
|
|
13
|
-
>(({className, ...props}, ref) => (
|
|
14
|
-
<ToastPrimitives.Viewport
|
|
15
|
-
ref={ref}
|
|
16
|
-
className={cn(
|
|
17
|
-
'fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]',
|
|
18
|
-
className,
|
|
19
|
-
)}
|
|
20
|
-
{...props}
|
|
21
|
-
/>
|
|
22
|
-
));
|
|
23
|
-
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
24
|
-
|
|
25
|
-
const toastVariants = cva(
|
|
26
|
-
'group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full',
|
|
27
|
-
{
|
|
28
|
-
variants: {
|
|
29
|
-
variant: {
|
|
30
|
-
default: 'border bg-background text-foreground',
|
|
31
|
-
destructive:
|
|
32
|
-
'destructive group border-destructive bg-destructive text-destructive-foreground',
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
defaultVariants: {
|
|
36
|
-
variant: 'default',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
const Toast = React.forwardRef<
|
|
42
|
-
React.ElementRef<typeof ToastPrimitives.Root>,
|
|
43
|
-
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &
|
|
44
|
-
VariantProps<typeof toastVariants>
|
|
45
|
-
>(({className, variant, ...props}, ref) => {
|
|
46
|
-
return (
|
|
47
|
-
<ToastPrimitives.Root
|
|
48
|
-
ref={ref}
|
|
49
|
-
className={cn(toastVariants({variant}), className)}
|
|
50
|
-
{...props}
|
|
51
|
-
/>
|
|
52
|
-
);
|
|
53
|
-
});
|
|
54
|
-
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
55
|
-
|
|
56
|
-
const ToastAction = React.forwardRef<
|
|
57
|
-
React.ElementRef<typeof ToastPrimitives.Action>,
|
|
58
|
-
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>
|
|
59
|
-
>(({className, ...props}, ref) => (
|
|
60
|
-
<ToastPrimitives.Action
|
|
61
|
-
ref={ref}
|
|
62
|
-
className={cn(
|
|
63
|
-
'inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive',
|
|
64
|
-
className,
|
|
65
|
-
)}
|
|
66
|
-
{...props}
|
|
67
|
-
/>
|
|
68
|
-
));
|
|
69
|
-
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
70
|
-
|
|
71
|
-
const ToastClose = React.forwardRef<
|
|
72
|
-
React.ElementRef<typeof ToastPrimitives.Close>,
|
|
73
|
-
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>
|
|
74
|
-
>(({className, ...props}, ref) => (
|
|
75
|
-
<ToastPrimitives.Close
|
|
76
|
-
ref={ref}
|
|
77
|
-
className={cn(
|
|
78
|
-
'absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600',
|
|
79
|
-
className,
|
|
80
|
-
)}
|
|
81
|
-
toast-close=""
|
|
82
|
-
{...props}
|
|
83
|
-
>
|
|
84
|
-
<X className="h-4 w-4" />
|
|
85
|
-
</ToastPrimitives.Close>
|
|
86
|
-
));
|
|
87
|
-
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
88
|
-
|
|
89
|
-
const ToastTitle = React.forwardRef<
|
|
90
|
-
React.ElementRef<typeof ToastPrimitives.Title>,
|
|
91
|
-
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title>
|
|
92
|
-
>(({className, ...props}, ref) => (
|
|
93
|
-
<ToastPrimitives.Title
|
|
94
|
-
ref={ref}
|
|
95
|
-
className={cn('text-sm font-semibold [&+div]:text-xs', className)}
|
|
96
|
-
{...props}
|
|
97
|
-
/>
|
|
98
|
-
));
|
|
99
|
-
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
100
|
-
|
|
101
|
-
const ToastDescription = React.forwardRef<
|
|
102
|
-
React.ElementRef<typeof ToastPrimitives.Description>,
|
|
103
|
-
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description>
|
|
104
|
-
>(({className, ...props}, ref) => (
|
|
105
|
-
<ToastPrimitives.Description
|
|
106
|
-
ref={ref}
|
|
107
|
-
className={cn('text-sm opacity-90', className)}
|
|
108
|
-
{...props}
|
|
109
|
-
/>
|
|
110
|
-
));
|
|
111
|
-
ToastDescription.displayName = ToastPrimitives.Description.displayName;
|
|
112
|
-
|
|
113
|
-
type ToastProps = React.ComponentPropsWithoutRef<typeof Toast>;
|
|
114
|
-
|
|
115
|
-
type ToastActionElement = React.ReactElement<typeof ToastAction>;
|
|
116
|
-
|
|
117
|
-
export {
|
|
118
|
-
type ToastProps,
|
|
119
|
-
type ToastActionElement,
|
|
120
|
-
ToastProvider,
|
|
121
|
-
ToastViewport,
|
|
122
|
-
Toast,
|
|
123
|
-
ToastTitle,
|
|
124
|
-
ToastDescription,
|
|
125
|
-
ToastClose,
|
|
126
|
-
ToastAction,
|
|
127
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import {useToast} from '../hooks/use-toast';
|
|
2
|
-
import {
|
|
3
|
-
Toast,
|
|
4
|
-
ToastClose,
|
|
5
|
-
ToastDescription,
|
|
6
|
-
ToastProvider,
|
|
7
|
-
ToastTitle,
|
|
8
|
-
ToastViewport,
|
|
9
|
-
} from './toast';
|
|
10
|
-
|
|
11
|
-
export function Toaster() {
|
|
12
|
-
const {toasts} = useToast();
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<ToastProvider>
|
|
16
|
-
{toasts.map(function ({id, title, description, action, ...props}) {
|
|
17
|
-
return (
|
|
18
|
-
<Toast key={id} {...props}>
|
|
19
|
-
<div className="grid gap-1">
|
|
20
|
-
{title && <ToastTitle>{title}</ToastTitle>}
|
|
21
|
-
{description && (
|
|
22
|
-
<ToastDescription>{description}</ToastDescription>
|
|
23
|
-
)}
|
|
24
|
-
</div>
|
|
25
|
-
{action}
|
|
26
|
-
<ToastClose />
|
|
27
|
-
</Toast>
|
|
28
|
-
);
|
|
29
|
-
})}
|
|
30
|
-
<ToastViewport />
|
|
31
|
-
</ToastProvider>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
3
|
-
import {cn} from '../lib/utils';
|
|
4
|
-
|
|
5
|
-
const TooltipProvider = TooltipPrimitive.Provider;
|
|
6
|
-
|
|
7
|
-
const Tooltip = TooltipPrimitive.Root;
|
|
8
|
-
|
|
9
|
-
const TooltipTrigger = TooltipPrimitive.Trigger;
|
|
10
|
-
|
|
11
|
-
const TooltipContent = React.forwardRef<
|
|
12
|
-
React.ElementRef<typeof TooltipPrimitive.Content>,
|
|
13
|
-
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
|
|
14
|
-
>(({className, sideOffset = 4, ...props}, ref) => (
|
|
15
|
-
<TooltipPrimitive.Portal>
|
|
16
|
-
<TooltipPrimitive.Content
|
|
17
|
-
ref={ref}
|
|
18
|
-
sideOffset={sideOffset}
|
|
19
|
-
className={cn(
|
|
20
|
-
'z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
|
|
21
|
-
className,
|
|
22
|
-
)}
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
</TooltipPrimitive.Portal>
|
|
26
|
-
));
|
|
27
|
-
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
28
|
-
|
|
29
|
-
export {Tooltip, TooltipTrigger, TooltipContent, TooltipProvider};
|
package/src/hooks/use-toast.ts
DELETED
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
// Inspired by react-hot-toast library
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
|
|
6
|
-
import type {ToastActionElement, ToastProps} from '../components/toast';
|
|
7
|
-
|
|
8
|
-
const TOAST_LIMIT = 1;
|
|
9
|
-
const TOAST_REMOVE_DELAY = 1000000;
|
|
10
|
-
|
|
11
|
-
type ToasterToast = ToastProps & {
|
|
12
|
-
id: string;
|
|
13
|
-
title?: React.ReactNode;
|
|
14
|
-
description?: React.ReactNode;
|
|
15
|
-
action?: ToastActionElement;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const actionTypes = {
|
|
19
|
-
ADD_TOAST: 'ADD_TOAST',
|
|
20
|
-
UPDATE_TOAST: 'UPDATE_TOAST',
|
|
21
|
-
DISMISS_TOAST: 'DISMISS_TOAST',
|
|
22
|
-
REMOVE_TOAST: 'REMOVE_TOAST',
|
|
23
|
-
} as const;
|
|
24
|
-
|
|
25
|
-
let count = 0;
|
|
26
|
-
|
|
27
|
-
function genId() {
|
|
28
|
-
count = (count + 1) % Number.MAX_SAFE_INTEGER;
|
|
29
|
-
return count.toString();
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
type ActionType = typeof actionTypes;
|
|
33
|
-
|
|
34
|
-
type Action =
|
|
35
|
-
| {
|
|
36
|
-
type: ActionType['ADD_TOAST'];
|
|
37
|
-
toast: ToasterToast;
|
|
38
|
-
}
|
|
39
|
-
| {
|
|
40
|
-
type: ActionType['UPDATE_TOAST'];
|
|
41
|
-
toast: Partial<ToasterToast>;
|
|
42
|
-
}
|
|
43
|
-
| {
|
|
44
|
-
type: ActionType['DISMISS_TOAST'];
|
|
45
|
-
toastId?: ToasterToast['id'];
|
|
46
|
-
}
|
|
47
|
-
| {
|
|
48
|
-
type: ActionType['REMOVE_TOAST'];
|
|
49
|
-
toastId?: ToasterToast['id'];
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
interface State {
|
|
53
|
-
toasts: ToasterToast[];
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();
|
|
57
|
-
|
|
58
|
-
const addToRemoveQueue = (toastId: string) => {
|
|
59
|
-
if (toastTimeouts.has(toastId)) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const timeout = setTimeout(() => {
|
|
64
|
-
toastTimeouts.delete(toastId);
|
|
65
|
-
dispatch({
|
|
66
|
-
type: 'REMOVE_TOAST',
|
|
67
|
-
toastId: toastId,
|
|
68
|
-
});
|
|
69
|
-
}, TOAST_REMOVE_DELAY);
|
|
70
|
-
|
|
71
|
-
toastTimeouts.set(toastId, timeout);
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export const reducer = (state: State, action: Action): State => {
|
|
75
|
-
switch (action.type) {
|
|
76
|
-
case 'ADD_TOAST':
|
|
77
|
-
return {
|
|
78
|
-
...state,
|
|
79
|
-
toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
case 'UPDATE_TOAST':
|
|
83
|
-
return {
|
|
84
|
-
...state,
|
|
85
|
-
toasts: state.toasts.map((t) =>
|
|
86
|
-
t.id === action.toast.id ? {...t, ...action.toast} : t,
|
|
87
|
-
),
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
case 'DISMISS_TOAST': {
|
|
91
|
-
const {toastId} = action;
|
|
92
|
-
|
|
93
|
-
// ! Side effects ! - This could be extracted into a dismissToast() action,
|
|
94
|
-
// but I'll keep it here for simplicity
|
|
95
|
-
if (toastId) {
|
|
96
|
-
addToRemoveQueue(toastId);
|
|
97
|
-
} else {
|
|
98
|
-
state.toasts.forEach((toast) => {
|
|
99
|
-
addToRemoveQueue(toast.id);
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return {
|
|
104
|
-
...state,
|
|
105
|
-
toasts: state.toasts.map((t) =>
|
|
106
|
-
t.id === toastId || toastId === undefined
|
|
107
|
-
? {
|
|
108
|
-
...t,
|
|
109
|
-
open: false,
|
|
110
|
-
}
|
|
111
|
-
: t,
|
|
112
|
-
),
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
case 'REMOVE_TOAST':
|
|
116
|
-
if (action.toastId === undefined) {
|
|
117
|
-
return {
|
|
118
|
-
...state,
|
|
119
|
-
toasts: [],
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
return {
|
|
123
|
-
...state,
|
|
124
|
-
toasts: state.toasts.filter((t) => t.id !== action.toastId),
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
const listeners: Array<(state: State) => void> = [];
|
|
130
|
-
|
|
131
|
-
let memoryState: State = {toasts: []};
|
|
132
|
-
|
|
133
|
-
function dispatch(action: Action) {
|
|
134
|
-
memoryState = reducer(memoryState, action);
|
|
135
|
-
listeners.forEach((listener) => {
|
|
136
|
-
listener(memoryState);
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
type Toast = Omit<ToasterToast, 'id'>;
|
|
141
|
-
|
|
142
|
-
function toast({...props}: Toast) {
|
|
143
|
-
const id = genId();
|
|
144
|
-
|
|
145
|
-
const update = (props: ToasterToast) =>
|
|
146
|
-
dispatch({
|
|
147
|
-
type: 'UPDATE_TOAST',
|
|
148
|
-
toast: {...props, id},
|
|
149
|
-
});
|
|
150
|
-
const dismiss = () => dispatch({type: 'DISMISS_TOAST', toastId: id});
|
|
151
|
-
|
|
152
|
-
dispatch({
|
|
153
|
-
type: 'ADD_TOAST',
|
|
154
|
-
toast: {
|
|
155
|
-
...props,
|
|
156
|
-
id,
|
|
157
|
-
open: true,
|
|
158
|
-
onOpenChange: (open) => {
|
|
159
|
-
if (!open) dismiss();
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
return {
|
|
165
|
-
id: id,
|
|
166
|
-
dismiss,
|
|
167
|
-
update,
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
function useToast() {
|
|
172
|
-
const [state, setState] = React.useState<State>(memoryState);
|
|
173
|
-
|
|
174
|
-
React.useEffect(() => {
|
|
175
|
-
listeners.push(setState);
|
|
176
|
-
return () => {
|
|
177
|
-
const index = listeners.indexOf(setState);
|
|
178
|
-
if (index > -1) {
|
|
179
|
-
listeners.splice(index, 1);
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
}, [state]);
|
|
183
|
-
|
|
184
|
-
return {
|
|
185
|
-
...state,
|
|
186
|
-
toast,
|
|
187
|
-
dismiss: (toastId?: string) => dispatch({type: 'DISMISS_TOAST', toastId}),
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
export {useToast, toast};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import {useState, useCallback} from 'react';
|
|
2
|
-
|
|
3
|
-
interface UseDisclosureReturn {
|
|
4
|
-
isOpen: boolean;
|
|
5
|
-
onOpen: () => void;
|
|
6
|
-
onClose: () => void;
|
|
7
|
-
onToggle: () => void;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function useDisclosure(initialState = false): UseDisclosureReturn {
|
|
11
|
-
const [isOpen, setIsOpen] = useState(initialState);
|
|
12
|
-
|
|
13
|
-
const onOpen = useCallback(() => {
|
|
14
|
-
setIsOpen(true);
|
|
15
|
-
}, []);
|
|
16
|
-
|
|
17
|
-
const onClose = useCallback(() => {
|
|
18
|
-
setIsOpen(false);
|
|
19
|
-
}, []);
|
|
20
|
-
|
|
21
|
-
const onToggle = useCallback(() => {
|
|
22
|
-
setIsOpen((prev) => !prev);
|
|
23
|
-
}, []);
|
|
24
|
-
|
|
25
|
-
return {isOpen, onOpen, onClose, onToggle};
|
|
26
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export * from './components/accordion';
|
|
2
|
-
export * from './components/alert';
|
|
3
|
-
export * from './components/badge';
|
|
4
|
-
export * from './components/breadcrumb';
|
|
5
|
-
export * from './components/button';
|
|
6
|
-
export * from './components/card';
|
|
7
|
-
export * from './components/checkbox';
|
|
8
|
-
export * from './components/dialog';
|
|
9
|
-
export * from './components/dropdown-menu';
|
|
10
|
-
export * from './components/editable-text';
|
|
11
|
-
export * from './components/error-boundary';
|
|
12
|
-
export * from './components/error-pane';
|
|
13
|
-
export * from './components/form';
|
|
14
|
-
export * from './components/input';
|
|
15
|
-
export * from './components/label';
|
|
16
|
-
export * from './components/popover';
|
|
17
|
-
export * from './components/progress';
|
|
18
|
-
export * from './components/progress-modal';
|
|
19
|
-
export * from './components/resizable';
|
|
20
|
-
export * from './components/select';
|
|
21
|
-
export * from './components/skeleton';
|
|
22
|
-
export * from './components/skeleton-pane';
|
|
23
|
-
export * from './components/spinner';
|
|
24
|
-
export * from './components/spinner-pane';
|
|
25
|
-
export * from './components/switch';
|
|
26
|
-
export * from './components/table';
|
|
27
|
-
export * from './components/tabs';
|
|
28
|
-
export * from './components/textarea';
|
|
29
|
-
export * from './components/toast';
|
|
30
|
-
export * from './components/toaster';
|
|
31
|
-
export * from './components/tooltip';
|
|
32
|
-
export * from './hooks/use-toast';
|
|
33
|
-
export * from './hooks/useDisclosure';
|
|
34
|
-
export * from './lib/utils';
|
|
35
|
-
export * from './tailwind-preset';
|
package/src/lib/utils.ts
DELETED
package/src/tailwind-preset.css
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
@tailwind base;
|
|
2
|
-
@tailwind components;
|
|
3
|
-
@tailwind utilities;
|
|
4
|
-
|
|
5
|
-
@layer base {
|
|
6
|
-
:root {
|
|
7
|
-
--background: 0 0% 100%;
|
|
8
|
-
--foreground: 240 10% 3.9%;
|
|
9
|
-
--card: 0 0% 100%;
|
|
10
|
-
--card-foreground: 240 10% 3.9%;
|
|
11
|
-
--popover: 0 0% 100%;
|
|
12
|
-
--popover-foreground: 240 10% 3.9%;
|
|
13
|
-
--primary: 240 5.9% 10%;
|
|
14
|
-
--primary-foreground: 0 0% 98%;
|
|
15
|
-
--secondary: 240 4.8% 95.9%;
|
|
16
|
-
--secondary-foreground: 240 5.9% 10%;
|
|
17
|
-
--muted: 240 4.8% 95.9%;
|
|
18
|
-
--muted-foreground: 240 3.8% 46.1%;
|
|
19
|
-
--accent: 240 4.8% 95.9%;
|
|
20
|
-
--accent-foreground: 240 5.9% 10%;
|
|
21
|
-
--destructive: 0 84.2% 60.2%;
|
|
22
|
-
--destructive-foreground: 0 0% 98%;
|
|
23
|
-
--border: 240 5.9% 90%;
|
|
24
|
-
--input: 240 5.9% 90%;
|
|
25
|
-
--ring: 240 10% 3.9%;
|
|
26
|
-
--chart-1: 12 76% 61%;
|
|
27
|
-
--chart-2: 173 58% 39%;
|
|
28
|
-
--chart-3: 197 37% 24%;
|
|
29
|
-
--chart-4: 43 74% 66%;
|
|
30
|
-
--chart-5: 27 87% 67%;
|
|
31
|
-
--radius: 0.5rem;
|
|
32
|
-
}
|
|
33
|
-
.dark {
|
|
34
|
-
--background: 240 10% 3.9%;
|
|
35
|
-
--foreground: 0 0% 98%;
|
|
36
|
-
--card: 240 10% 3.9%;
|
|
37
|
-
--card-foreground: 0 0% 98%;
|
|
38
|
-
--popover: 240 10% 3.9%;
|
|
39
|
-
--popover-foreground: 0 0% 98%;
|
|
40
|
-
--primary: 0 0% 98%;
|
|
41
|
-
--primary-foreground: 240 5.9% 10%;
|
|
42
|
-
--secondary: 240 3.7% 15.9%;
|
|
43
|
-
--secondary-foreground: 0 0% 98%;
|
|
44
|
-
--muted: 240 3.7% 15.9%;
|
|
45
|
-
--muted-foreground: 240 5% 64.9%;
|
|
46
|
-
--accent: 240 3.7% 15.9%;
|
|
47
|
-
--accent-foreground: 0 0% 98%;
|
|
48
|
-
--destructive: 0 62.8% 30.6%;
|
|
49
|
-
--destructive-foreground: 0 0% 98%;
|
|
50
|
-
--border: 240 3.7% 15.9%;
|
|
51
|
-
--input: 240 3.7% 15.9%;
|
|
52
|
-
--ring: 240 4.9% 83.9%;
|
|
53
|
-
--chart-1: 220 70% 50%;
|
|
54
|
-
--chart-2: 160 60% 45%;
|
|
55
|
-
--chart-3: 30 80% 55%;
|
|
56
|
-
--chart-4: 280 65% 60%;
|
|
57
|
-
--chart-5: 340 75% 55%;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
@layer base {
|
|
62
|
-
* {
|
|
63
|
-
@apply border-border;
|
|
64
|
-
}
|
|
65
|
-
body {
|
|
66
|
-
@apply bg-background text-foreground;
|
|
67
|
-
}
|
|
68
|
-
}
|
package/src/tailwind-preset.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import {Config} from 'tailwindcss';
|
|
2
|
-
import tailwindAnimate from 'tailwindcss-animate';
|
|
3
|
-
export const sqlroomsTailwindPreset = ({
|
|
4
|
-
prefix = '',
|
|
5
|
-
}: {
|
|
6
|
-
prefix?: string;
|
|
7
|
-
}): Partial<Config> => ({
|
|
8
|
-
prefix,
|
|
9
|
-
darkMode: ['class'],
|
|
10
|
-
theme: {
|
|
11
|
-
extend: {
|
|
12
|
-
colors: {
|
|
13
|
-
border: 'hsl(var(--border))',
|
|
14
|
-
input: 'hsl(var(--input))',
|
|
15
|
-
ring: 'hsl(var(--ring))',
|
|
16
|
-
background: 'hsl(var(--background))',
|
|
17
|
-
foreground: 'hsl(var(--foreground))',
|
|
18
|
-
primary: {
|
|
19
|
-
DEFAULT: 'hsl(var(--primary))',
|
|
20
|
-
foreground: 'hsl(var(--primary-foreground))',
|
|
21
|
-
},
|
|
22
|
-
secondary: {
|
|
23
|
-
DEFAULT: 'hsl(var(--secondary))',
|
|
24
|
-
foreground: 'hsl(var(--secondary-foreground))',
|
|
25
|
-
},
|
|
26
|
-
destructive: {
|
|
27
|
-
DEFAULT: 'hsl(var(--destructive))',
|
|
28
|
-
foreground: 'hsl(var(--destructive-foreground))',
|
|
29
|
-
},
|
|
30
|
-
muted: {
|
|
31
|
-
DEFAULT: 'hsl(var(--muted))',
|
|
32
|
-
foreground: 'hsl(var(--muted-foreground))',
|
|
33
|
-
},
|
|
34
|
-
accent: {
|
|
35
|
-
DEFAULT: 'hsl(var(--accent))',
|
|
36
|
-
foreground: 'hsl(var(--accent-foreground))',
|
|
37
|
-
},
|
|
38
|
-
popover: {
|
|
39
|
-
DEFAULT: 'hsl(var(--popover))',
|
|
40
|
-
foreground: 'hsl(var(--popover-foreground))',
|
|
41
|
-
},
|
|
42
|
-
card: {
|
|
43
|
-
DEFAULT: 'hsl(var(--card))',
|
|
44
|
-
foreground: 'hsl(var(--card-foreground))',
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
borderRadius: {
|
|
48
|
-
lg: `var(--radius)`,
|
|
49
|
-
md: `calc(var(--radius) - 2px)`,
|
|
50
|
-
sm: 'calc(var(--radius) - 4px)',
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
plugins: [tailwindAnimate],
|
|
55
|
-
});
|
package/tsconfig.json
DELETED