@luxfi/ui 7.1.0 → 7.3.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/dist/alert.cjs +22 -50
- package/dist/alert.js +22 -50
- package/dist/index.cjs +123 -179
- package/dist/index.js +123 -179
- package/dist/input.cjs +25 -36
- package/dist/input.js +25 -36
- package/dist/provider.cjs +35 -55
- package/dist/provider.js +16 -35
- package/dist/tag.cjs +15 -35
- package/dist/tag.js +15 -35
- package/dist/textarea.cjs +25 -36
- package/dist/textarea.js +25 -36
- package/package.json +6 -7
- package/src/alert.tsx +23 -51
- package/src/index.ts +1 -0
- package/src/input.tsx +27 -36
- package/src/provider.tsx +28 -6
- package/src/tag.tsx +17 -35
- package/src/textarea.tsx +27 -36
- package/dist/accordion.d.cts +0 -74
- package/dist/accordion.d.ts +0 -74
- package/dist/alert.d.cts +0 -30
- package/dist/alert.d.ts +0 -30
- package/dist/avatar.d.cts +0 -25
- package/dist/avatar.d.ts +0 -25
- package/dist/badge.d.cts +0 -19
- package/dist/badge.d.ts +0 -19
- package/dist/bank.d.cts +0 -76
- package/dist/bank.d.ts +0 -76
- package/dist/button.d.cts +0 -55
- package/dist/button.d.ts +0 -55
- package/dist/checkbox.d.cts +0 -31
- package/dist/checkbox.d.ts +0 -31
- package/dist/close-button.d.cts +0 -9
- package/dist/close-button.d.ts +0 -9
- package/dist/collapsible.d.cts +0 -23
- package/dist/collapsible.d.ts +0 -23
- package/dist/color-mode.d.cts +0 -25
- package/dist/color-mode.d.ts +0 -25
- package/dist/dialog.d.cts +0 -65
- package/dist/dialog.d.ts +0 -65
- package/dist/drawer.d.cts +0 -36
- package/dist/drawer.d.ts +0 -36
- package/dist/empty-state.d.cts +0 -13
- package/dist/empty-state.d.ts +0 -13
- package/dist/expiration-selector.d.cts +0 -16
- package/dist/expiration-selector.d.ts +0 -16
- package/dist/field.d.cts +0 -24
- package/dist/field.d.ts +0 -24
- package/dist/greeks-display.d.cts +0 -14
- package/dist/greeks-display.d.ts +0 -14
- package/dist/heading.d.cts +0 -10
- package/dist/heading.d.ts +0 -10
- package/dist/icon-button.d.cts +0 -33
- package/dist/icon-button.d.ts +0 -33
- package/dist/image.d.cts +0 -57
- package/dist/image.d.ts +0 -57
- package/dist/index.d.cts +0 -55
- package/dist/index.d.ts +0 -55
- package/dist/input-group.d.cts +0 -17
- package/dist/input-group.d.ts +0 -17
- package/dist/input.d.cts +0 -11
- package/dist/input.d.ts +0 -11
- package/dist/link.d.cts +0 -37
- package/dist/link.d.ts +0 -37
- package/dist/menu.d.cts +0 -84
- package/dist/menu.d.ts +0 -84
- package/dist/option-chain.d.cts +0 -37
- package/dist/option-chain.d.ts +0 -37
- package/dist/option-position.d.cts +0 -29
- package/dist/option-position.d.ts +0 -29
- package/dist/pin-input.d.cts +0 -25
- package/dist/pin-input.d.ts +0 -25
- package/dist/pnl-diagram.d.cts +0 -11
- package/dist/pnl-diagram.d.ts +0 -11
- package/dist/popover.d.cts +0 -73
- package/dist/popover.d.ts +0 -73
- package/dist/progress-circle.d.cts +0 -47
- package/dist/progress-circle.d.ts +0 -47
- package/dist/progress.d.cts +0 -28
- package/dist/progress.d.ts +0 -28
- package/dist/provider.d.cts +0 -7
- package/dist/provider.d.ts +0 -7
- package/dist/radio.d.cts +0 -53
- package/dist/radio.d.ts +0 -53
- package/dist/rating.d.cts +0 -14
- package/dist/rating.d.ts +0 -14
- package/dist/select.d.cts +0 -130
- package/dist/select.d.ts +0 -130
- package/dist/separator.d.cts +0 -13
- package/dist/separator.d.ts +0 -13
- package/dist/skeleton.d.cts +0 -60
- package/dist/skeleton.d.ts +0 -60
- package/dist/slider.d.cts +0 -24
- package/dist/slider.d.ts +0 -24
- package/dist/strategy-builder.d.cts +0 -26
- package/dist/strategy-builder.d.ts +0 -26
- package/dist/switch.d.cts +0 -27
- package/dist/switch.d.ts +0 -27
- package/dist/table.d.cts +0 -107
- package/dist/table.d.ts +0 -107
- package/dist/tabs.d.cts +0 -78
- package/dist/tabs.d.ts +0 -78
- package/dist/tag.d.cts +0 -21
- package/dist/tag.d.ts +0 -21
- package/dist/textarea.d.cts +0 -11
- package/dist/textarea.d.ts +0 -11
- package/dist/toaster.d.cts +0 -29
- package/dist/toaster.d.ts +0 -29
- package/dist/tooltip.d.cts +0 -38
- package/dist/tooltip.d.ts +0 -38
- package/dist/utils.d.cts +0 -5
- package/dist/utils.d.ts +0 -5
package/src/alert.tsx
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { cva } from 'class-variance-authority';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
|
|
4
3
|
import { cn } from './utils';
|
|
@@ -20,58 +19,28 @@ import { Skeleton } from './skeleton';
|
|
|
20
19
|
type AlertStatus = 'info' | 'warning' | 'warning_table' | 'success' | 'error';
|
|
21
20
|
|
|
22
21
|
/* ------------------------------------------------------------------ */
|
|
23
|
-
/* CVA
|
|
22
|
+
/* Class maps (replaced CVA) */
|
|
24
23
|
/* ------------------------------------------------------------------ */
|
|
25
24
|
|
|
26
|
-
const
|
|
27
|
-
// base
|
|
28
|
-
'w-full flex items-start relative rounded text-[var(--color-alert-fg)]',
|
|
29
|
-
{
|
|
30
|
-
variants: {
|
|
31
|
-
status: {
|
|
32
|
-
info: 'bg-[var(--color-alert-bg-info)]',
|
|
33
|
-
warning: 'bg-[var(--color-alert-bg-warning)]',
|
|
34
|
-
warning_table: 'bg-[var(--color-alert-bg-warning-table)]',
|
|
35
|
-
success: 'bg-[var(--color-alert-bg-success)]',
|
|
36
|
-
error: 'bg-[var(--color-alert-bg-error)]',
|
|
37
|
-
},
|
|
38
|
-
size: {
|
|
39
|
-
sm: 'gap-2 px-2 py-2 text-xs',
|
|
40
|
-
md: 'gap-2 px-3 py-2 text-base',
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
defaultVariants: {
|
|
44
|
-
status: 'info',
|
|
45
|
-
size: 'md',
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
);
|
|
25
|
+
const ALERT_BASE = 'w-full flex items-start relative rounded text-[var(--color-alert-fg)]';
|
|
49
26
|
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
defaultVariants: {
|
|
58
|
-
inline: true,
|
|
59
|
-
},
|
|
60
|
-
});
|
|
27
|
+
const STATUS_CLASSES: Record<AlertStatus, string> = {
|
|
28
|
+
info: 'bg-[var(--color-alert-bg-info)]',
|
|
29
|
+
warning: 'bg-[var(--color-alert-bg-warning)]',
|
|
30
|
+
warning_table: 'bg-[var(--color-alert-bg-warning-table)]',
|
|
31
|
+
success: 'bg-[var(--color-alert-bg-success)]',
|
|
32
|
+
error: 'bg-[var(--color-alert-bg-error)]',
|
|
33
|
+
};
|
|
61
34
|
|
|
62
|
-
const
|
|
35
|
+
const SIZE_CLASSES: Record<string, string> = {
|
|
36
|
+
sm: 'gap-2 px-2 py-2 text-xs',
|
|
37
|
+
md: 'gap-2 px-3 py-2 text-base',
|
|
38
|
+
};
|
|
63
39
|
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
md: 'w-5 h-5 my-[2px]',
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
defaultVariants: {
|
|
72
|
-
size: 'md',
|
|
73
|
-
},
|
|
74
|
-
});
|
|
40
|
+
const INDICATOR_SIZE_CLASSES: Record<string, string> = {
|
|
41
|
+
sm: 'w-5 h-5 my-0',
|
|
42
|
+
md: 'w-5 h-5 my-[2px]',
|
|
43
|
+
};
|
|
75
44
|
|
|
76
45
|
/* ------------------------------------------------------------------ */
|
|
77
46
|
/* Props */
|
|
@@ -153,7 +122,10 @@ export const Alert = React.forwardRef<HTMLDivElement, AlertProps>(
|
|
|
153
122
|
}
|
|
154
123
|
|
|
155
124
|
return (
|
|
156
|
-
<span className={
|
|
125
|
+
<span className={ cn(
|
|
126
|
+
'inline-flex items-center justify-center shrink-0 text-[var(--color-alert-fg)] [&>svg]:w-full [&>svg]:h-full',
|
|
127
|
+
INDICATOR_SIZE_CLASSES[resolvedSize],
|
|
128
|
+
) }>
|
|
157
129
|
{ icon || defaultIcon }
|
|
158
130
|
</span>
|
|
159
131
|
);
|
|
@@ -188,13 +160,13 @@ export const Alert = React.forwardRef<HTMLDivElement, AlertProps>(
|
|
|
188
160
|
<Skeleton loading={ loading }>
|
|
189
161
|
<div
|
|
190
162
|
ref={ ref }
|
|
191
|
-
className={ cn(
|
|
163
|
+
className={ cn(ALERT_BASE, STATUS_CLASSES[status], SIZE_CLASSES[resolvedSize], className) }
|
|
192
164
|
style={ alertStyle }
|
|
193
165
|
{ ...alertRest }
|
|
194
166
|
>
|
|
195
167
|
{ iconElement }
|
|
196
168
|
{ children ? (
|
|
197
|
-
<div className={
|
|
169
|
+
<div className={ cn('flex flex-1', inline ? 'inline-flex flex-row items-center' : 'flex flex-col') }>
|
|
198
170
|
{ title && <div className="font-semibold">{ title }</div> }
|
|
199
171
|
<div
|
|
200
172
|
className={ cn('inline-flex flex-wrap', descClassName) }
|
package/src/index.ts
CHANGED
package/src/input.tsx
CHANGED
|
@@ -1,41 +1,32 @@
|
|
|
1
|
-
import { cva } from 'class-variance-authority';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
4
3
|
import { cn } from './utils';
|
|
5
4
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
defaultVariants: {
|
|
34
|
-
size: 'md',
|
|
35
|
-
variant: 'outline',
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
);
|
|
5
|
+
const INPUT_BASE = [
|
|
6
|
+
'w-full appearance-none outline-none transition-colors',
|
|
7
|
+
'bg-[var(--color-input-bg)] text-[var(--color-input-fg)] border-[var(--color-input-border)]',
|
|
8
|
+
'placeholder:text-[var(--color-input-placeholder,theme(colors.gray.400))]',
|
|
9
|
+
'hover:border-[var(--color-input-border-hover,theme(colors.gray.400))]',
|
|
10
|
+
'focus:border-[var(--color-input-border-focus,theme(colors.blue.500))]',
|
|
11
|
+
'focus:placeholder:text-[var(--color-input-placeholder-focus,theme(colors.gray.300))]',
|
|
12
|
+
'disabled:opacity-40 disabled:cursor-not-allowed',
|
|
13
|
+
'read-only:opacity-70',
|
|
14
|
+
'data-[invalid]:border-[var(--color-input-border-invalid,theme(colors.red.500))]',
|
|
15
|
+
].join(' ');
|
|
16
|
+
|
|
17
|
+
const INPUT_SIZE_CLASSES: Record<string, string> = {
|
|
18
|
+
xs: 'h-6 px-2 text-xs rounded',
|
|
19
|
+
sm: 'h-8 px-3 text-sm rounded-md',
|
|
20
|
+
md: 'h-10 px-4 text-base rounded-md',
|
|
21
|
+
lg: 'h-12 px-4 text-lg rounded-lg',
|
|
22
|
+
'2xl': 'h-14 px-4 text-xl rounded-lg',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const INPUT_VARIANT_CLASSES: Record<string, string> = {
|
|
26
|
+
outline: 'border border-solid',
|
|
27
|
+
filled: 'border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]',
|
|
28
|
+
unstyled: 'border-0 bg-transparent p-0 h-auto',
|
|
29
|
+
};
|
|
39
30
|
|
|
40
31
|
type InputSize = 'xs' | 'sm' | 'md' | 'lg' | '2xl';
|
|
41
32
|
type InputVariant = 'outline' | 'filled' | 'unstyled';
|
|
@@ -46,11 +37,11 @@ export interface InputProps extends Omit<React.ComponentPropsWithRef<'input'>, '
|
|
|
46
37
|
}
|
|
47
38
|
|
|
48
39
|
export const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
49
|
-
({ size, variant, className, ...rest }, ref) => {
|
|
40
|
+
({ size = 'md', variant = 'outline', className, ...rest }, ref) => {
|
|
50
41
|
return (
|
|
51
42
|
<input
|
|
52
43
|
ref={ ref }
|
|
53
|
-
className={ cn(
|
|
44
|
+
className={ cn(INPUT_BASE, INPUT_SIZE_CLASSES[size], INPUT_VARIANT_CLASSES[variant], className) }
|
|
54
45
|
{ ...rest }
|
|
55
46
|
/>
|
|
56
47
|
);
|
package/src/provider.tsx
CHANGED
|
@@ -1,12 +1,34 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { createGui } from '@hanzogui/core';
|
|
4
|
+
import { QueryClient, QueryClientProvider, useQueryClient, useQuery, useMutation, useInfiniteQuery } from '@tanstack/react-query';
|
|
3
5
|
import React from 'react';
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
// Initialize @hanzogui once at module load
|
|
8
|
+
let _guiInitialized = false;
|
|
9
|
+
function ensureGui() {
|
|
10
|
+
if (_guiInitialized) return;
|
|
11
|
+
createGui({ settings: { autocompleteSpecificTokens: 'except-special' } });
|
|
12
|
+
_guiInitialized = true;
|
|
13
|
+
}
|
|
14
|
+
ensureGui();
|
|
15
|
+
|
|
16
|
+
const defaultQueryClient = new QueryClient({
|
|
17
|
+
defaultOptions: { queries: { refetchOnWindowFocus: false, retry: 1, staleTime: 30_000 } },
|
|
18
|
+
});
|
|
9
19
|
|
|
10
|
-
|
|
11
|
-
|
|
20
|
+
interface AppProviderProps {
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
queryClient?: QueryClient;
|
|
12
23
|
}
|
|
24
|
+
|
|
25
|
+
export const AppProvider = ({ children, queryClient }: AppProviderProps) => {
|
|
26
|
+
return (
|
|
27
|
+
<QueryClientProvider client={ queryClient ?? defaultQueryClient }>
|
|
28
|
+
{ children }
|
|
29
|
+
</QueryClientProvider>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// Re-export tanstack hooks so consumers never import @tanstack/react-query directly
|
|
34
|
+
export { QueryClient, useQueryClient, useQuery, useMutation, useInfiniteQuery };
|
package/src/tag.tsx
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { cva } from 'class-variance-authority';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
|
|
4
3
|
import { cn } from './utils';
|
|
@@ -22,39 +21,20 @@ function TruncatedTextTooltip({ label, children }: { readonly label: React.React
|
|
|
22
21
|
type TagVariant = 'subtle' | 'clickable' | 'filter' | 'select';
|
|
23
22
|
type TagSize = 'sm' | 'md' | 'lg';
|
|
24
23
|
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
]
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
filter: 'bg-[var(--color-tag-filter-bg)]',
|
|
40
|
-
select: [
|
|
41
|
-
'cursor-pointer',
|
|
42
|
-
'bg-[var(--color-tag-select-bg)] text-[var(--color-tag-select-fg)]',
|
|
43
|
-
'hover:text-[var(--color-hover)] hover:opacity-76',
|
|
44
|
-
].join(' '),
|
|
45
|
-
},
|
|
46
|
-
size: {
|
|
47
|
-
sm: 'px-1 py-0.5 min-h-5 gap-1 text-xs',
|
|
48
|
-
md: 'px-1 py-0.5 min-h-6 gap-1 text-sm',
|
|
49
|
-
lg: 'px-1.5 py-1.5 min-h-8 min-w-8 gap-1 text-sm',
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
defaultVariants: {
|
|
53
|
-
variant: 'subtle',
|
|
54
|
-
size: 'md',
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
);
|
|
24
|
+
const TAG_BASE = 'inline-flex items-center align-top max-w-full select-text rounded-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-500';
|
|
25
|
+
|
|
26
|
+
const TAG_VARIANT_CLASSES: Record<TagVariant, string> = {
|
|
27
|
+
subtle: 'bg-[var(--color-tag-subtle-bg)] text-[var(--color-tag-subtle-fg)]',
|
|
28
|
+
clickable: 'cursor-pointer bg-[var(--color-tag-clickable-bg)] text-[var(--color-tag-clickable-fg)] hover:opacity-76',
|
|
29
|
+
filter: 'bg-[var(--color-tag-filter-bg)]',
|
|
30
|
+
select: 'cursor-pointer bg-[var(--color-tag-select-bg)] text-[var(--color-tag-select-fg)] hover:text-[var(--color-hover)] hover:opacity-76',
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const TAG_SIZE_CLASSES: Record<TagSize, string> = {
|
|
34
|
+
sm: 'px-1 py-0.5 min-h-5 gap-1 text-xs',
|
|
35
|
+
md: 'px-1 py-0.5 min-h-6 gap-1 text-sm',
|
|
36
|
+
lg: 'px-1.5 py-1.5 min-h-8 min-w-8 gap-1 text-sm',
|
|
37
|
+
};
|
|
58
38
|
|
|
59
39
|
const TAG_SELECTED_CLASSES = [
|
|
60
40
|
'bg-[var(--color-tag-select-selected-bg)]',
|
|
@@ -121,7 +101,9 @@ export const Tag = React.forwardRef<HTMLSpanElement, TagProps>(
|
|
|
121
101
|
<span
|
|
122
102
|
ref={ ref }
|
|
123
103
|
className={ cn(
|
|
124
|
-
|
|
104
|
+
TAG_BASE,
|
|
105
|
+
TAG_VARIANT_CLASSES[variant ?? 'subtle'],
|
|
106
|
+
TAG_SIZE_CLASSES[size ?? 'md'],
|
|
125
107
|
selected && !loading && TAG_SELECTED_CLASSES,
|
|
126
108
|
disabled && TAG_DISABLED_CLASSES,
|
|
127
109
|
className,
|
package/src/textarea.tsx
CHANGED
|
@@ -1,41 +1,32 @@
|
|
|
1
|
-
import { cva } from 'class-variance-authority';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
4
3
|
import { cn } from './utils';
|
|
5
4
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
defaultVariants: {
|
|
34
|
-
size: 'md',
|
|
35
|
-
variant: 'outline',
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
);
|
|
5
|
+
const TEXTAREA_BASE = [
|
|
6
|
+
'w-full appearance-none outline-none transition-colors resize-y',
|
|
7
|
+
'bg-[var(--color-input-bg)] text-[var(--color-input-fg)] border-[var(--color-input-border)]',
|
|
8
|
+
'placeholder:text-[var(--color-input-placeholder,theme(colors.gray.400))]',
|
|
9
|
+
'hover:border-[var(--color-input-border-hover,theme(colors.gray.400))]',
|
|
10
|
+
'focus:border-[var(--color-input-border-focus,theme(colors.blue.500))]',
|
|
11
|
+
'focus:placeholder:text-[var(--color-input-placeholder-focus,theme(colors.gray.300))]',
|
|
12
|
+
'disabled:opacity-40 disabled:cursor-not-allowed',
|
|
13
|
+
'read-only:opacity-70',
|
|
14
|
+
'data-[invalid]:border-[var(--color-input-border-invalid,theme(colors.red.500))]',
|
|
15
|
+
].join(' ');
|
|
16
|
+
|
|
17
|
+
const TEXTAREA_SIZE_CLASSES: Record<string, string> = {
|
|
18
|
+
xs: 'px-2 py-1 text-xs rounded',
|
|
19
|
+
sm: 'px-3 py-2 text-sm rounded-md',
|
|
20
|
+
md: 'px-4 py-2 text-base rounded-md',
|
|
21
|
+
lg: 'px-4 py-3 text-lg rounded-lg',
|
|
22
|
+
'2xl': 'px-4 py-3 text-xl rounded-lg',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const TEXTAREA_VARIANT_CLASSES: Record<string, string> = {
|
|
26
|
+
outline: 'border border-solid',
|
|
27
|
+
filled: 'border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]',
|
|
28
|
+
unstyled: 'border-0 bg-transparent p-0',
|
|
29
|
+
};
|
|
39
30
|
|
|
40
31
|
type TextareaSize = 'xs' | 'sm' | 'md' | 'lg' | '2xl';
|
|
41
32
|
type TextareaVariant = 'outline' | 'filled' | 'unstyled';
|
|
@@ -46,11 +37,11 @@ export interface TextareaProps extends Omit<React.ComponentPropsWithRef<'textare
|
|
|
46
37
|
}
|
|
47
38
|
|
|
48
39
|
export const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
49
|
-
({ size, variant, className, ...rest }, ref) => {
|
|
40
|
+
({ size = 'md', variant = 'outline', className, ...rest }, ref) => {
|
|
50
41
|
return (
|
|
51
42
|
<textarea
|
|
52
43
|
ref={ ref }
|
|
53
|
-
className={ cn(
|
|
44
|
+
className={ cn(TEXTAREA_BASE, TEXTAREA_SIZE_CLASSES[size], TEXTAREA_VARIANT_CLASSES[variant], className) }
|
|
54
45
|
{ ...rest }
|
|
55
46
|
/>
|
|
56
47
|
);
|
package/dist/accordion.d.cts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
|
|
4
|
-
interface AccordionRootProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'defaultValue' | 'dir'> {
|
|
5
|
-
/** Open multiple items simultaneously. Defaults to true. */
|
|
6
|
-
readonly multiple?: boolean;
|
|
7
|
-
/** Controlled open items (array of `value` strings). */
|
|
8
|
-
readonly value?: Array<string>;
|
|
9
|
-
/** Uncontrolled initial open items. */
|
|
10
|
-
readonly defaultValue?: Array<string>;
|
|
11
|
-
/**
|
|
12
|
-
* Called when open items change.
|
|
13
|
-
* Wraps the value in `{ value }` to stay compatible with the Chakra callback shape
|
|
14
|
-
* that consumers already rely on.
|
|
15
|
-
*/
|
|
16
|
-
readonly onValueChange?: (details: {
|
|
17
|
-
value: Array<string>;
|
|
18
|
-
}) => void;
|
|
19
|
-
readonly variant?: 'outline' | 'faq';
|
|
20
|
-
readonly size?: 'sm' | 'md';
|
|
21
|
-
/** Accepted for compatibility; not applied visually. */
|
|
22
|
-
readonly noAnimation?: boolean;
|
|
23
|
-
/** Accepted for compatibility; Radix defers rendering internally. */
|
|
24
|
-
readonly lazyMount?: boolean;
|
|
25
|
-
readonly children?: React.ReactNode;
|
|
26
|
-
readonly position?: string;
|
|
27
|
-
readonly w?: string;
|
|
28
|
-
readonly bgColor?: string | Record<string, string>;
|
|
29
|
-
readonly borderRadius?: string;
|
|
30
|
-
}
|
|
31
|
-
declare const AccordionRoot: React.ForwardRefExoticComponent<AccordionRootProps & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
-
interface AccordionItemProps extends React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item> {
|
|
33
|
-
as?: string;
|
|
34
|
-
_first?: Record<string, unknown>;
|
|
35
|
-
_last?: Record<string, unknown>;
|
|
36
|
-
display?: string;
|
|
37
|
-
}
|
|
38
|
-
declare const AccordionItem: React.ForwardRefExoticComponent<AccordionItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
-
interface AccordionItemTriggerProps extends Omit<React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>, 'dir'> {
|
|
40
|
-
readonly indicatorPlacement?: 'start' | 'end';
|
|
41
|
-
readonly noIndicator?: boolean;
|
|
42
|
-
readonly variant?: 'outline' | 'faq';
|
|
43
|
-
px?: number | string;
|
|
44
|
-
py?: number | string;
|
|
45
|
-
_hover?: Record<string, string>;
|
|
46
|
-
wordBreak?: string;
|
|
47
|
-
textAlign?: string;
|
|
48
|
-
cursor?: string;
|
|
49
|
-
display?: string;
|
|
50
|
-
alignItems?: string;
|
|
51
|
-
columnGap?: number | string;
|
|
52
|
-
}
|
|
53
|
-
declare const AccordionItemTrigger: React.ForwardRefExoticComponent<AccordionItemTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
54
|
-
interface AccordionItemContentProps extends React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content> {
|
|
55
|
-
pb?: number | string;
|
|
56
|
-
pr?: number | string;
|
|
57
|
-
pl?: string;
|
|
58
|
-
w?: string;
|
|
59
|
-
display?: string;
|
|
60
|
-
flexDir?: string;
|
|
61
|
-
rowGap?: number | string;
|
|
62
|
-
}
|
|
63
|
-
declare const AccordionItemContent: React.ForwardRefExoticComponent<AccordionItemContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
64
|
-
declare function useAccordion(items: Array<{
|
|
65
|
-
id: string;
|
|
66
|
-
}>): {
|
|
67
|
-
value: string[];
|
|
68
|
-
onValueChange: ({ value }: {
|
|
69
|
-
value: Array<string>;
|
|
70
|
-
}) => void;
|
|
71
|
-
scrollToItemFromUrl: () => void;
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export { AccordionItem, AccordionItemContent, type AccordionItemContentProps, AccordionItemTrigger, AccordionRoot, useAccordion };
|
package/dist/accordion.d.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
|
|
4
|
-
interface AccordionRootProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'defaultValue' | 'dir'> {
|
|
5
|
-
/** Open multiple items simultaneously. Defaults to true. */
|
|
6
|
-
readonly multiple?: boolean;
|
|
7
|
-
/** Controlled open items (array of `value` strings). */
|
|
8
|
-
readonly value?: Array<string>;
|
|
9
|
-
/** Uncontrolled initial open items. */
|
|
10
|
-
readonly defaultValue?: Array<string>;
|
|
11
|
-
/**
|
|
12
|
-
* Called when open items change.
|
|
13
|
-
* Wraps the value in `{ value }` to stay compatible with the Chakra callback shape
|
|
14
|
-
* that consumers already rely on.
|
|
15
|
-
*/
|
|
16
|
-
readonly onValueChange?: (details: {
|
|
17
|
-
value: Array<string>;
|
|
18
|
-
}) => void;
|
|
19
|
-
readonly variant?: 'outline' | 'faq';
|
|
20
|
-
readonly size?: 'sm' | 'md';
|
|
21
|
-
/** Accepted for compatibility; not applied visually. */
|
|
22
|
-
readonly noAnimation?: boolean;
|
|
23
|
-
/** Accepted for compatibility; Radix defers rendering internally. */
|
|
24
|
-
readonly lazyMount?: boolean;
|
|
25
|
-
readonly children?: React.ReactNode;
|
|
26
|
-
readonly position?: string;
|
|
27
|
-
readonly w?: string;
|
|
28
|
-
readonly bgColor?: string | Record<string, string>;
|
|
29
|
-
readonly borderRadius?: string;
|
|
30
|
-
}
|
|
31
|
-
declare const AccordionRoot: React.ForwardRefExoticComponent<AccordionRootProps & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
-
interface AccordionItemProps extends React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item> {
|
|
33
|
-
as?: string;
|
|
34
|
-
_first?: Record<string, unknown>;
|
|
35
|
-
_last?: Record<string, unknown>;
|
|
36
|
-
display?: string;
|
|
37
|
-
}
|
|
38
|
-
declare const AccordionItem: React.ForwardRefExoticComponent<AccordionItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
-
interface AccordionItemTriggerProps extends Omit<React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>, 'dir'> {
|
|
40
|
-
readonly indicatorPlacement?: 'start' | 'end';
|
|
41
|
-
readonly noIndicator?: boolean;
|
|
42
|
-
readonly variant?: 'outline' | 'faq';
|
|
43
|
-
px?: number | string;
|
|
44
|
-
py?: number | string;
|
|
45
|
-
_hover?: Record<string, string>;
|
|
46
|
-
wordBreak?: string;
|
|
47
|
-
textAlign?: string;
|
|
48
|
-
cursor?: string;
|
|
49
|
-
display?: string;
|
|
50
|
-
alignItems?: string;
|
|
51
|
-
columnGap?: number | string;
|
|
52
|
-
}
|
|
53
|
-
declare const AccordionItemTrigger: React.ForwardRefExoticComponent<AccordionItemTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
54
|
-
interface AccordionItemContentProps extends React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content> {
|
|
55
|
-
pb?: number | string;
|
|
56
|
-
pr?: number | string;
|
|
57
|
-
pl?: string;
|
|
58
|
-
w?: string;
|
|
59
|
-
display?: string;
|
|
60
|
-
flexDir?: string;
|
|
61
|
-
rowGap?: number | string;
|
|
62
|
-
}
|
|
63
|
-
declare const AccordionItemContent: React.ForwardRefExoticComponent<AccordionItemContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
64
|
-
declare function useAccordion(items: Array<{
|
|
65
|
-
id: string;
|
|
66
|
-
}>): {
|
|
67
|
-
value: string[];
|
|
68
|
-
onValueChange: ({ value }: {
|
|
69
|
-
value: Array<string>;
|
|
70
|
-
}) => void;
|
|
71
|
-
scrollToItemFromUrl: () => void;
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export { AccordionItem, AccordionItemContent, type AccordionItemContentProps, AccordionItemTrigger, AccordionRoot, useAccordion };
|
package/dist/alert.d.cts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
type AlertStatus = 'info' | 'warning' | 'warning_table' | 'success' | 'error';
|
|
4
|
-
interface AlertProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'title'> {
|
|
5
|
-
readonly status?: AlertStatus;
|
|
6
|
-
readonly size?: 'sm' | 'md';
|
|
7
|
-
readonly inline?: boolean;
|
|
8
|
-
readonly startElement?: React.ReactNode;
|
|
9
|
-
readonly endElement?: React.ReactNode;
|
|
10
|
-
readonly descriptionProps?: Omit<React.ComponentPropsWithoutRef<'div'>, 'ref'> & {
|
|
11
|
-
whiteSpace?: string;
|
|
12
|
-
alignItems?: string;
|
|
13
|
-
flexDir?: string;
|
|
14
|
-
flexWrap?: string;
|
|
15
|
-
rowGap?: number | string;
|
|
16
|
-
columnGap?: number | string;
|
|
17
|
-
};
|
|
18
|
-
readonly title?: React.ReactNode;
|
|
19
|
-
readonly icon?: React.ReactElement;
|
|
20
|
-
readonly closable?: boolean;
|
|
21
|
-
readonly onClose?: () => void;
|
|
22
|
-
readonly loading?: boolean;
|
|
23
|
-
readonly showIcon?: boolean;
|
|
24
|
-
readonly whiteSpace?: string;
|
|
25
|
-
readonly mb?: number | string;
|
|
26
|
-
readonly mt?: number | string;
|
|
27
|
-
}
|
|
28
|
-
declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
-
|
|
30
|
-
export { Alert, type AlertProps };
|
package/dist/alert.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
type AlertStatus = 'info' | 'warning' | 'warning_table' | 'success' | 'error';
|
|
4
|
-
interface AlertProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'title'> {
|
|
5
|
-
readonly status?: AlertStatus;
|
|
6
|
-
readonly size?: 'sm' | 'md';
|
|
7
|
-
readonly inline?: boolean;
|
|
8
|
-
readonly startElement?: React.ReactNode;
|
|
9
|
-
readonly endElement?: React.ReactNode;
|
|
10
|
-
readonly descriptionProps?: Omit<React.ComponentPropsWithoutRef<'div'>, 'ref'> & {
|
|
11
|
-
whiteSpace?: string;
|
|
12
|
-
alignItems?: string;
|
|
13
|
-
flexDir?: string;
|
|
14
|
-
flexWrap?: string;
|
|
15
|
-
rowGap?: number | string;
|
|
16
|
-
columnGap?: number | string;
|
|
17
|
-
};
|
|
18
|
-
readonly title?: React.ReactNode;
|
|
19
|
-
readonly icon?: React.ReactElement;
|
|
20
|
-
readonly closable?: boolean;
|
|
21
|
-
readonly onClose?: () => void;
|
|
22
|
-
readonly loading?: boolean;
|
|
23
|
-
readonly showIcon?: boolean;
|
|
24
|
-
readonly whiteSpace?: string;
|
|
25
|
-
readonly mb?: number | string;
|
|
26
|
-
readonly mt?: number | string;
|
|
27
|
-
}
|
|
28
|
-
declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
-
|
|
30
|
-
export { Alert, type AlertProps };
|
package/dist/avatar.d.cts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
type ImageProps = React.ImgHTMLAttributes<HTMLImageElement>;
|
|
4
|
-
type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
5
|
-
type AvatarVariant = 'solid' | 'subtle' | 'outline';
|
|
6
|
-
interface AvatarProps extends React.ComponentPropsWithoutRef<'span'> {
|
|
7
|
-
name?: string;
|
|
8
|
-
src?: string;
|
|
9
|
-
srcSet?: string;
|
|
10
|
-
loading?: ImageProps['loading'];
|
|
11
|
-
icon?: React.ReactElement;
|
|
12
|
-
fallback?: React.ReactNode;
|
|
13
|
-
size?: AvatarSize;
|
|
14
|
-
variant?: AvatarVariant;
|
|
15
|
-
borderless?: boolean;
|
|
16
|
-
}
|
|
17
|
-
declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
|
|
18
|
-
interface AvatarGroupProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
19
|
-
size?: AvatarSize;
|
|
20
|
-
variant?: AvatarVariant;
|
|
21
|
-
borderless?: boolean;
|
|
22
|
-
}
|
|
23
|
-
declare const AvatarGroup: React.ForwardRefExoticComponent<AvatarGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
-
|
|
25
|
-
export { Avatar, AvatarGroup, type AvatarProps };
|
package/dist/avatar.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
type ImageProps = React.ImgHTMLAttributes<HTMLImageElement>;
|
|
4
|
-
type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
5
|
-
type AvatarVariant = 'solid' | 'subtle' | 'outline';
|
|
6
|
-
interface AvatarProps extends React.ComponentPropsWithoutRef<'span'> {
|
|
7
|
-
name?: string;
|
|
8
|
-
src?: string;
|
|
9
|
-
srcSet?: string;
|
|
10
|
-
loading?: ImageProps['loading'];
|
|
11
|
-
icon?: React.ReactElement;
|
|
12
|
-
fallback?: React.ReactNode;
|
|
13
|
-
size?: AvatarSize;
|
|
14
|
-
variant?: AvatarVariant;
|
|
15
|
-
borderless?: boolean;
|
|
16
|
-
}
|
|
17
|
-
declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
|
|
18
|
-
interface AvatarGroupProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
19
|
-
size?: AvatarSize;
|
|
20
|
-
variant?: AvatarVariant;
|
|
21
|
-
borderless?: boolean;
|
|
22
|
-
}
|
|
23
|
-
declare const AvatarGroup: React.ForwardRefExoticComponent<AvatarGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
-
|
|
25
|
-
export { Avatar, AvatarGroup, type AvatarProps };
|