@datum-cloud/datum-ui 0.1.0 → 0.1.1
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 +201 -21
- package/README.md +0 -8
- package/dist/index.d.mts +44 -6
- package/dist/index.d.ts +44 -6
- package/dist/index.js +266 -30
- package/dist/index.mjs +260 -30
- package/package.json +6 -3
- package/src/styles/theme.css +3 -0
- package/src/styles/themes/alpha.css +12 -0
package/LICENSE
CHANGED
|
@@ -1,21 +1,201 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [2026] [Datum Technology, Inc.]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -8,14 +8,6 @@ A React component library by Datum.
|
|
|
8
8
|
npm install @datum-cloud/datum-ui
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
## Local Development
|
|
12
|
-
|
|
13
|
-
From this folder
|
|
14
|
-
```bun link```
|
|
15
|
-
|
|
16
|
-
From your project folder
|
|
17
|
-
```bun link @datum-cloud/datum-ui```
|
|
18
|
-
|
|
19
11
|
## Usage
|
|
20
12
|
|
|
21
13
|
Import components and the base styles in your app entry point:
|
package/dist/index.d.mts
CHANGED
|
@@ -1,15 +1,35 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
-
import * as React$1 from 'react';
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import * as React$1 from 'react';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
4
6
|
import { LinkProps } from 'react-router';
|
|
5
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
7
|
import { LucideProps, LucideIcon } from 'lucide-react';
|
|
8
|
+
import * as TooltipPrimitiveRadix from '@radix-ui/react-tooltip';
|
|
7
9
|
export { cn } from '@repo/shadcn/lib/utils';
|
|
8
10
|
|
|
11
|
+
declare const alertVariants: (props?: ({
|
|
12
|
+
variant?: "default" | "secondary" | "outline" | "destructive" | "success" | "info" | "warning" | null | undefined;
|
|
13
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
14
|
+
interface AlertProps extends React$1.ComponentProps<'div'>, VariantProps<typeof alertVariants> {
|
|
15
|
+
/**
|
|
16
|
+
* Whether the alert can be closed. When true, a close button is displayed.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
closable?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Callback function called when the close button is clicked.
|
|
22
|
+
*/
|
|
23
|
+
onClose?: () => void;
|
|
24
|
+
}
|
|
25
|
+
declare const Alert: ({ className, variant, closable, onClose, ...props }: AlertProps) => react_jsx_runtime.JSX.Element | null;
|
|
26
|
+
declare const AlertTitle: ({ className, ...props }: React$1.ComponentProps<"div">) => react_jsx_runtime.JSX.Element;
|
|
27
|
+
declare const AlertDescription: ({ className, ...props }: React$1.ComponentProps<"div">) => react_jsx_runtime.JSX.Element;
|
|
28
|
+
|
|
9
29
|
declare const buttonVariants: (props?: ({
|
|
10
|
-
type?: "
|
|
11
|
-
theme?: "
|
|
12
|
-
size?: "
|
|
30
|
+
type?: "secondary" | "success" | "warning" | "primary" | "tertiary" | "quaternary" | "danger" | null | undefined;
|
|
31
|
+
theme?: "outline" | "link" | "solid" | "light" | "borderless" | null | undefined;
|
|
32
|
+
size?: "default" | "link" | "small" | "icon" | "xs" | "large" | null | undefined;
|
|
13
33
|
block?: boolean | null | undefined;
|
|
14
34
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
35
|
interface ButtonProps extends Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, 'type'>, VariantProps<typeof buttonVariants> {
|
|
@@ -49,4 +69,22 @@ declare const CloseIcon: ({ className, fill, }: {
|
|
|
49
69
|
fill?: string;
|
|
50
70
|
}) => react_jsx_runtime.JSX.Element;
|
|
51
71
|
|
|
52
|
-
|
|
72
|
+
interface TooltipProps {
|
|
73
|
+
message: string | ReactNode;
|
|
74
|
+
children: ReactNode;
|
|
75
|
+
delayDuration?: number;
|
|
76
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
77
|
+
align?: 'start' | 'center' | 'end';
|
|
78
|
+
sideOffset?: number;
|
|
79
|
+
hidden?: boolean;
|
|
80
|
+
open?: boolean;
|
|
81
|
+
onOpenChange?: (open: boolean) => void;
|
|
82
|
+
contentClassName?: string;
|
|
83
|
+
arrowClassName?: string;
|
|
84
|
+
}
|
|
85
|
+
declare const TooltipContent: ({ className, arrowClassName, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitiveRadix.Content> & {
|
|
86
|
+
arrowClassName?: string;
|
|
87
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
88
|
+
declare const Tooltip: ({ message, children, delayDuration, side, align, sideOffset, hidden, open, onOpenChange, contentClassName, arrowClassName, }: TooltipProps) => react_jsx_runtime.JSX.Element;
|
|
89
|
+
|
|
90
|
+
export { Alert, AlertDescription, type AlertProps, AlertTitle, Button, type ButtonProps, CloseIcon, Icon, LinkButton, type LinkButtonProps, SpinnerIcon, type SpinnerIconProps, Tooltip, TooltipContent, type TooltipProps, alertVariants, buttonVariants };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,35 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
-
import * as React$1 from 'react';
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import * as React$1 from 'react';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
4
6
|
import { LinkProps } from 'react-router';
|
|
5
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
7
|
import { LucideProps, LucideIcon } from 'lucide-react';
|
|
8
|
+
import * as TooltipPrimitiveRadix from '@radix-ui/react-tooltip';
|
|
7
9
|
export { cn } from '@repo/shadcn/lib/utils';
|
|
8
10
|
|
|
11
|
+
declare const alertVariants: (props?: ({
|
|
12
|
+
variant?: "default" | "secondary" | "outline" | "destructive" | "success" | "info" | "warning" | null | undefined;
|
|
13
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
14
|
+
interface AlertProps extends React$1.ComponentProps<'div'>, VariantProps<typeof alertVariants> {
|
|
15
|
+
/**
|
|
16
|
+
* Whether the alert can be closed. When true, a close button is displayed.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
closable?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Callback function called when the close button is clicked.
|
|
22
|
+
*/
|
|
23
|
+
onClose?: () => void;
|
|
24
|
+
}
|
|
25
|
+
declare const Alert: ({ className, variant, closable, onClose, ...props }: AlertProps) => react_jsx_runtime.JSX.Element | null;
|
|
26
|
+
declare const AlertTitle: ({ className, ...props }: React$1.ComponentProps<"div">) => react_jsx_runtime.JSX.Element;
|
|
27
|
+
declare const AlertDescription: ({ className, ...props }: React$1.ComponentProps<"div">) => react_jsx_runtime.JSX.Element;
|
|
28
|
+
|
|
9
29
|
declare const buttonVariants: (props?: ({
|
|
10
|
-
type?: "
|
|
11
|
-
theme?: "
|
|
12
|
-
size?: "
|
|
30
|
+
type?: "secondary" | "success" | "warning" | "primary" | "tertiary" | "quaternary" | "danger" | null | undefined;
|
|
31
|
+
theme?: "outline" | "link" | "solid" | "light" | "borderless" | null | undefined;
|
|
32
|
+
size?: "default" | "link" | "small" | "icon" | "xs" | "large" | null | undefined;
|
|
13
33
|
block?: boolean | null | undefined;
|
|
14
34
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
35
|
interface ButtonProps extends Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, 'type'>, VariantProps<typeof buttonVariants> {
|
|
@@ -49,4 +69,22 @@ declare const CloseIcon: ({ className, fill, }: {
|
|
|
49
69
|
fill?: string;
|
|
50
70
|
}) => react_jsx_runtime.JSX.Element;
|
|
51
71
|
|
|
52
|
-
|
|
72
|
+
interface TooltipProps {
|
|
73
|
+
message: string | ReactNode;
|
|
74
|
+
children: ReactNode;
|
|
75
|
+
delayDuration?: number;
|
|
76
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
77
|
+
align?: 'start' | 'center' | 'end';
|
|
78
|
+
sideOffset?: number;
|
|
79
|
+
hidden?: boolean;
|
|
80
|
+
open?: boolean;
|
|
81
|
+
onOpenChange?: (open: boolean) => void;
|
|
82
|
+
contentClassName?: string;
|
|
83
|
+
arrowClassName?: string;
|
|
84
|
+
}
|
|
85
|
+
declare const TooltipContent: ({ className, arrowClassName, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitiveRadix.Content> & {
|
|
86
|
+
arrowClassName?: string;
|
|
87
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
88
|
+
declare const Tooltip: ({ message, children, delayDuration, side, align, sideOffset, hidden, open, onOpenChange, contentClassName, arrowClassName, }: TooltipProps) => react_jsx_runtime.JSX.Element;
|
|
89
|
+
|
|
90
|
+
export { Alert, AlertDescription, type AlertProps, AlertTitle, Button, type ButtonProps, CloseIcon, Icon, LinkButton, type LinkButtonProps, SpinnerIcon, type SpinnerIconProps, Tooltip, TooltipContent, type TooltipProps, alertVariants, buttonVariants };
|
package/dist/index.js
CHANGED
|
@@ -59,19 +59,22 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
59
59
|
// src/index.ts
|
|
60
60
|
var index_exports = {};
|
|
61
61
|
__export(index_exports, {
|
|
62
|
+
Alert: () => Alert,
|
|
63
|
+
AlertDescription: () => AlertDescription,
|
|
64
|
+
AlertTitle: () => AlertTitle,
|
|
62
65
|
Button: () => Button,
|
|
63
66
|
CloseIcon: () => CloseIcon,
|
|
64
67
|
Icon: () => Icon,
|
|
65
68
|
LinkButton: () => LinkButton,
|
|
66
69
|
SpinnerIcon: () => SpinnerIcon,
|
|
70
|
+
Tooltip: () => Tooltip2,
|
|
71
|
+
TooltipContent: () => TooltipContent,
|
|
72
|
+
alertVariants: () => alertVariants,
|
|
67
73
|
buttonVariants: () => buttonVariants,
|
|
68
74
|
cn: () => cn
|
|
69
75
|
});
|
|
70
76
|
module.exports = __toCommonJS(index_exports);
|
|
71
77
|
|
|
72
|
-
// src/button/button.tsx
|
|
73
|
-
var React = __toESM(require("react"));
|
|
74
|
-
|
|
75
78
|
// ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
76
79
|
function r(e) {
|
|
77
80
|
var t, f, n = "";
|
|
@@ -3100,11 +3103,136 @@ function cn(...inputs) {
|
|
|
3100
3103
|
return twMerge(clsx(inputs));
|
|
3101
3104
|
}
|
|
3102
3105
|
|
|
3106
|
+
// src/alert/alert.tsx
|
|
3107
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
3108
|
+
var import_lucide_react = require("lucide-react");
|
|
3109
|
+
var React = __toESM(require("react"));
|
|
3110
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
3111
|
+
var variantDefinitions = {
|
|
3112
|
+
default: {
|
|
3113
|
+
classes: "bg-background text-foreground",
|
|
3114
|
+
closeButtonColor: "text-foreground"
|
|
3115
|
+
},
|
|
3116
|
+
secondary: {
|
|
3117
|
+
classes: "bg-muted text-primary [&>svg]:text-primary",
|
|
3118
|
+
closeButtonColor: "text-primary"
|
|
3119
|
+
},
|
|
3120
|
+
outline: {
|
|
3121
|
+
classes: "border-muted text-muted-foreground",
|
|
3122
|
+
closeButtonColor: "text-muted-foreground"
|
|
3123
|
+
},
|
|
3124
|
+
destructive: {
|
|
3125
|
+
classes: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
|
|
3126
|
+
closeButtonColor: "text-destructive"
|
|
3127
|
+
},
|
|
3128
|
+
success: {
|
|
3129
|
+
classes: "border-success-300 bg-success-100 text-success-500",
|
|
3130
|
+
closeButtonColor: "text-success-500"
|
|
3131
|
+
},
|
|
3132
|
+
info: {
|
|
3133
|
+
classes: "border-info-300 bg-info-100 text-info-500! [&>svg]:text-info-500",
|
|
3134
|
+
closeButtonColor: "text-info-500"
|
|
3135
|
+
},
|
|
3136
|
+
warning: {
|
|
3137
|
+
classes: "border-yellow-500 bg-yellow-50 text-yellow-700! [&>svg]:text-yellow-700",
|
|
3138
|
+
closeButtonColor: "text-yellow-700"
|
|
3139
|
+
}
|
|
3140
|
+
};
|
|
3141
|
+
var alertVariants = (0, import_class_variance_authority.cva)(
|
|
3142
|
+
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
|
|
3143
|
+
{
|
|
3144
|
+
variants: {
|
|
3145
|
+
variant: {
|
|
3146
|
+
default: variantDefinitions.default.classes,
|
|
3147
|
+
secondary: variantDefinitions.secondary.classes,
|
|
3148
|
+
outline: variantDefinitions.outline.classes,
|
|
3149
|
+
destructive: variantDefinitions.destructive.classes,
|
|
3150
|
+
success: variantDefinitions.success.classes,
|
|
3151
|
+
info: variantDefinitions.info.classes,
|
|
3152
|
+
warning: variantDefinitions.warning.classes
|
|
3153
|
+
}
|
|
3154
|
+
},
|
|
3155
|
+
defaultVariants: {
|
|
3156
|
+
variant: "default"
|
|
3157
|
+
}
|
|
3158
|
+
}
|
|
3159
|
+
);
|
|
3160
|
+
var Alert = (_a) => {
|
|
3161
|
+
var _b = _a, { className, variant, closable = false, onClose } = _b, props = __objRest(_b, ["className", "variant", "closable", "onClose"]);
|
|
3162
|
+
var _a2;
|
|
3163
|
+
const [isVisible, setIsVisible] = React.useState(true);
|
|
3164
|
+
const handleClose = () => {
|
|
3165
|
+
if (onClose) {
|
|
3166
|
+
onClose();
|
|
3167
|
+
} else {
|
|
3168
|
+
setIsVisible(false);
|
|
3169
|
+
}
|
|
3170
|
+
};
|
|
3171
|
+
if (!isVisible) {
|
|
3172
|
+
return null;
|
|
3173
|
+
}
|
|
3174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
3175
|
+
"div",
|
|
3176
|
+
__spreadProps(__spreadValues({
|
|
3177
|
+
role: "alert",
|
|
3178
|
+
className: cn(alertVariants({ variant }), closable && "pr-10", className)
|
|
3179
|
+
}, props), {
|
|
3180
|
+
children: [
|
|
3181
|
+
props.children,
|
|
3182
|
+
closable && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
3183
|
+
"span",
|
|
3184
|
+
{
|
|
3185
|
+
onClick: handleClose,
|
|
3186
|
+
role: "button",
|
|
3187
|
+
tabIndex: 0,
|
|
3188
|
+
onKeyDown: (e) => {
|
|
3189
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
3190
|
+
e.preventDefault();
|
|
3191
|
+
handleClose();
|
|
3192
|
+
}
|
|
3193
|
+
},
|
|
3194
|
+
className: "absolute top-4 right-4 z-10 cursor-pointer opacity-70 transition-opacity hover:opacity-100",
|
|
3195
|
+
"aria-label": "Close alert",
|
|
3196
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
3197
|
+
import_lucide_react.CircleXIcon,
|
|
3198
|
+
{
|
|
3199
|
+
className: cn("size-4", variant && ((_a2 = variantDefinitions[variant]) == null ? void 0 : _a2.closeButtonColor))
|
|
3200
|
+
}
|
|
3201
|
+
)
|
|
3202
|
+
}
|
|
3203
|
+
)
|
|
3204
|
+
]
|
|
3205
|
+
})
|
|
3206
|
+
);
|
|
3207
|
+
};
|
|
3208
|
+
var AlertTitle = (_a) => {
|
|
3209
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
3211
|
+
"div",
|
|
3212
|
+
__spreadValues({
|
|
3213
|
+
className: cn("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight", className)
|
|
3214
|
+
}, props)
|
|
3215
|
+
);
|
|
3216
|
+
};
|
|
3217
|
+
var AlertDescription = (_a) => {
|
|
3218
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
3220
|
+
"div",
|
|
3221
|
+
__spreadValues({
|
|
3222
|
+
className: cn(
|
|
3223
|
+
"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
|
|
3224
|
+
className
|
|
3225
|
+
)
|
|
3226
|
+
}, props)
|
|
3227
|
+
);
|
|
3228
|
+
};
|
|
3229
|
+
|
|
3103
3230
|
// src/button/button.tsx
|
|
3104
|
-
var
|
|
3231
|
+
var React2 = __toESM(require("react"));
|
|
3232
|
+
var import_class_variance_authority3 = require("class-variance-authority");
|
|
3105
3233
|
|
|
3106
3234
|
// src/icons/icon-wrapper.tsx
|
|
3107
|
-
var
|
|
3235
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
3108
3236
|
function Icon(_a) {
|
|
3109
3237
|
var _b = _a, {
|
|
3110
3238
|
icon: IconComponent,
|
|
@@ -3117,7 +3245,7 @@ function Icon(_a) {
|
|
|
3117
3245
|
"absoluteStrokeWidth",
|
|
3118
3246
|
"size"
|
|
3119
3247
|
]);
|
|
3120
|
-
return /* @__PURE__ */ (0,
|
|
3248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
3121
3249
|
IconComponent,
|
|
3122
3250
|
__spreadProps(__spreadValues({}, props), {
|
|
3123
3251
|
strokeWidth,
|
|
@@ -3128,9 +3256,9 @@ function Icon(_a) {
|
|
|
3128
3256
|
}
|
|
3129
3257
|
|
|
3130
3258
|
// src/icons/spinner-icon.tsx
|
|
3131
|
-
var
|
|
3132
|
-
var
|
|
3133
|
-
var spinnerVariants = (0,
|
|
3259
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
|
3260
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
3261
|
+
var spinnerVariants = (0, import_class_variance_authority2.cva)("animate-spin", {
|
|
3134
3262
|
variants: {
|
|
3135
3263
|
size: {
|
|
3136
3264
|
xs: "size-3",
|
|
@@ -3164,7 +3292,7 @@ var SpinnerIcon = (_a) => {
|
|
|
3164
3292
|
"trackClassName",
|
|
3165
3293
|
"indicatorClassName"
|
|
3166
3294
|
]);
|
|
3167
|
-
return /* @__PURE__ */ (0,
|
|
3295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
3168
3296
|
"svg",
|
|
3169
3297
|
__spreadProps(__spreadValues({
|
|
3170
3298
|
viewBox: "0 0 64 64",
|
|
@@ -3173,7 +3301,7 @@ var SpinnerIcon = (_a) => {
|
|
|
3173
3301
|
className: cn(spinnerVariants({ size }), className)
|
|
3174
3302
|
}, props), {
|
|
3175
3303
|
children: [
|
|
3176
|
-
/* @__PURE__ */ (0,
|
|
3304
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3177
3305
|
"path",
|
|
3178
3306
|
{
|
|
3179
3307
|
d: "M32 3C35.8083 3 39.5794 3.75011 43.0978 5.20749C46.6163 6.66488 49.8132 8.80101 52.5061 11.4939C55.199 14.1868 57.3351 17.3837 58.7925 20.9022C60.2499 24.4206 61 28.1917 61 32C61 35.8083 60.2499 39.5794 58.7925 43.0978C57.3351 46.6163 55.199 49.8132 52.5061 52.5061C49.8132 55.199 46.6163 57.3351 43.0978 58.7925C39.5794 60.2499 35.8083 61 32 61C28.1917 61 24.4206 60.2499 20.9022 58.7925C17.3837 57.3351 14.1868 55.199 11.4939 52.5061C8.801 49.8132 6.66487 46.6163 5.20749 43.0978C3.7501 39.5794 3 35.8083 3 32C3 28.1917 3.75011 24.4206 5.2075 20.9022C6.66489 17.3837 8.80101 14.1868 11.4939 11.4939C14.1868 8.80099 17.3838 6.66487 20.9022 5.20749C24.4206 3.7501 28.1917 3 32 3L32 3Z",
|
|
@@ -3184,7 +3312,7 @@ var SpinnerIcon = (_a) => {
|
|
|
3184
3312
|
className: trackClassName
|
|
3185
3313
|
}
|
|
3186
3314
|
),
|
|
3187
|
-
/* @__PURE__ */ (0,
|
|
3315
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3188
3316
|
"path",
|
|
3189
3317
|
{
|
|
3190
3318
|
d: "M32 3C36.5778 3 41.0906 4.08374 45.1692 6.16256C49.2477 8.24138 52.7762 11.2562 55.466 14.9605C58.1558 18.6647 59.9304 22.9531 60.6448 27.4748C61.3591 31.9965 60.9928 36.6232 59.5759 40.9762",
|
|
@@ -3201,12 +3329,12 @@ var SpinnerIcon = (_a) => {
|
|
|
3201
3329
|
};
|
|
3202
3330
|
|
|
3203
3331
|
// src/icons/close-icon.tsx
|
|
3204
|
-
var
|
|
3332
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
3205
3333
|
var CloseIcon = ({
|
|
3206
3334
|
className,
|
|
3207
3335
|
fill = "fill-foreground"
|
|
3208
3336
|
}) => {
|
|
3209
|
-
return /* @__PURE__ */ (0,
|
|
3337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3210
3338
|
"svg",
|
|
3211
3339
|
{
|
|
3212
3340
|
width: "17",
|
|
@@ -3215,7 +3343,7 @@ var CloseIcon = ({
|
|
|
3215
3343
|
fill: "none",
|
|
3216
3344
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3217
3345
|
className: cn("transition-opacity hover:opacity-90", className),
|
|
3218
|
-
children: /* @__PURE__ */ (0,
|
|
3346
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3219
3347
|
"path",
|
|
3220
3348
|
{
|
|
3221
3349
|
opacity: "0.2",
|
|
@@ -3228,8 +3356,8 @@ var CloseIcon = ({
|
|
|
3228
3356
|
};
|
|
3229
3357
|
|
|
3230
3358
|
// src/button/button.tsx
|
|
3231
|
-
var
|
|
3232
|
-
var buttonVariants = (0,
|
|
3359
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
3360
|
+
var buttonVariants = (0, import_class_variance_authority3.cva)(
|
|
3233
3361
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",
|
|
3234
3362
|
{
|
|
3235
3363
|
variants: {
|
|
@@ -3419,7 +3547,7 @@ var buttonVariants = (0, import_class_variance_authority2.cva)(
|
|
|
3419
3547
|
}
|
|
3420
3548
|
}
|
|
3421
3549
|
);
|
|
3422
|
-
var Button =
|
|
3550
|
+
var Button = React2.forwardRef(
|
|
3423
3551
|
(_a, ref) => {
|
|
3424
3552
|
var _b = _a, {
|
|
3425
3553
|
className,
|
|
@@ -3452,30 +3580,30 @@ var Button = React.forwardRef(
|
|
|
3452
3580
|
const isIconOnly = (icon || loading) && !children;
|
|
3453
3581
|
const showIcon = !loading && icon;
|
|
3454
3582
|
const getLoadingIcon = () => {
|
|
3455
|
-
return loadingIcon || /* @__PURE__ */ (0,
|
|
3583
|
+
return loadingIcon || /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
3456
3584
|
SpinnerIcon,
|
|
3457
3585
|
{
|
|
3458
|
-
|
|
3459
|
-
"
|
|
3586
|
+
"aria-hidden": "true",
|
|
3587
|
+
size: size === "small" ? "xs" : size === "large" ? "sm" : "md"
|
|
3460
3588
|
}
|
|
3461
3589
|
);
|
|
3462
3590
|
};
|
|
3463
|
-
const showLoadingIcon = loading && (isIconOnly ? getLoadingIcon() : /* @__PURE__ */ (0,
|
|
3591
|
+
const showLoadingIcon = loading && (isIconOnly ? getLoadingIcon() : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SpinnerIcon, { size: "sm", "aria-hidden": "true" }));
|
|
3464
3592
|
const getIconOnlyClass = () => {
|
|
3465
3593
|
if (!isIconOnly || size === "icon") return "";
|
|
3466
3594
|
if (size === "small") return "w-8 px-0";
|
|
3467
3595
|
if (size === "large") return "w-11 px-0";
|
|
3468
3596
|
return "w-9 px-0";
|
|
3469
3597
|
};
|
|
3470
|
-
return /* @__PURE__ */ (0,
|
|
3598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
3471
3599
|
"button",
|
|
3472
3600
|
__spreadProps(__spreadValues({
|
|
3473
3601
|
className: cn(buttonVariants({ type, theme, size, block }), getIconOnlyClass(), className),
|
|
3474
|
-
ref,
|
|
3475
3602
|
disabled: isDisabled,
|
|
3603
|
+
ref,
|
|
3476
3604
|
type: htmlType
|
|
3477
3605
|
}, props), {
|
|
3478
|
-
children: isIconOnly ? loading ? showLoadingIcon : showIcon && icon : /* @__PURE__ */ (0,
|
|
3606
|
+
children: isIconOnly ? loading ? showLoadingIcon : showIcon && icon : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
3479
3607
|
showLoadingIcon && showLoadingIcon,
|
|
3480
3608
|
showIcon && iconPosition === "left" && icon,
|
|
3481
3609
|
children,
|
|
@@ -3488,10 +3616,10 @@ var Button = React.forwardRef(
|
|
|
3488
3616
|
Button.displayName = "Button";
|
|
3489
3617
|
|
|
3490
3618
|
// src/button/link-button.tsx
|
|
3491
|
-
var
|
|
3619
|
+
var React3 = __toESM(require("react"));
|
|
3492
3620
|
var import_react_router = require("react-router");
|
|
3493
|
-
var
|
|
3494
|
-
var LinkButton =
|
|
3621
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
3622
|
+
var LinkButton = React3.forwardRef(
|
|
3495
3623
|
(_a, ref) => {
|
|
3496
3624
|
var _b = _a, { className, type, theme, size, block, icon, iconPosition = "left", children } = _b, props = __objRest(_b, ["className", "type", "theme", "size", "block", "icon", "iconPosition", "children"]);
|
|
3497
3625
|
const isIconOnly = icon && !children;
|
|
@@ -3501,13 +3629,13 @@ var LinkButton = React2.forwardRef(
|
|
|
3501
3629
|
if (size === "large") return "w-11 px-0";
|
|
3502
3630
|
return "w-9 px-0";
|
|
3503
3631
|
};
|
|
3504
|
-
return /* @__PURE__ */ (0,
|
|
3632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3505
3633
|
import_react_router.Link,
|
|
3506
3634
|
__spreadProps(__spreadValues({
|
|
3507
3635
|
className: cn(buttonVariants({ type, theme, size, block }), getIconOnlyClass(), className),
|
|
3508
3636
|
ref
|
|
3509
3637
|
}, props), {
|
|
3510
|
-
children: isIconOnly ? icon : /* @__PURE__ */ (0,
|
|
3638
|
+
children: isIconOnly ? icon : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
3511
3639
|
icon && iconPosition === "left" && icon,
|
|
3512
3640
|
children,
|
|
3513
3641
|
icon && iconPosition === "right" && icon
|
|
@@ -3517,13 +3645,121 @@ var LinkButton = React2.forwardRef(
|
|
|
3517
3645
|
}
|
|
3518
3646
|
);
|
|
3519
3647
|
LinkButton.displayName = "LinkButton";
|
|
3648
|
+
|
|
3649
|
+
// src/tooltip/tooltip.tsx
|
|
3650
|
+
var TooltipPrimitiveRadix = __toESM(require("@radix-ui/react-tooltip"));
|
|
3651
|
+
|
|
3652
|
+
// ../shadcn/ui/tooltip.tsx
|
|
3653
|
+
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
3654
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
3655
|
+
var TooltipProvider = (_a) => {
|
|
3656
|
+
var _b = _a, {
|
|
3657
|
+
delayDuration = 0
|
|
3658
|
+
} = _b, props = __objRest(_b, [
|
|
3659
|
+
"delayDuration"
|
|
3660
|
+
]);
|
|
3661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
3662
|
+
TooltipPrimitive.Provider,
|
|
3663
|
+
__spreadValues({
|
|
3664
|
+
"data-slot": "tooltip-provider",
|
|
3665
|
+
delayDuration
|
|
3666
|
+
}, props)
|
|
3667
|
+
);
|
|
3668
|
+
};
|
|
3669
|
+
var Tooltip = (_a) => {
|
|
3670
|
+
var props = __objRest(_a, []);
|
|
3671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TooltipPrimitive.Root, __spreadValues({ "data-slot": "tooltip" }, props)) });
|
|
3672
|
+
};
|
|
3673
|
+
var TooltipTrigger = (_a) => {
|
|
3674
|
+
var props = __objRest(_a, []);
|
|
3675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TooltipPrimitive.Trigger, __spreadValues({ "data-slot": "tooltip-trigger" }, props));
|
|
3676
|
+
};
|
|
3677
|
+
|
|
3678
|
+
// src/tooltip/tooltip.tsx
|
|
3679
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
3680
|
+
var TooltipContent = (_a) => {
|
|
3681
|
+
var _b = _a, {
|
|
3682
|
+
className,
|
|
3683
|
+
arrowClassName,
|
|
3684
|
+
sideOffset = 0,
|
|
3685
|
+
children
|
|
3686
|
+
} = _b, props = __objRest(_b, [
|
|
3687
|
+
"className",
|
|
3688
|
+
"arrowClassName",
|
|
3689
|
+
"sideOffset",
|
|
3690
|
+
"children"
|
|
3691
|
+
]);
|
|
3692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TooltipPrimitiveRadix.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
3693
|
+
TooltipPrimitiveRadix.Content,
|
|
3694
|
+
__spreadProps(__spreadValues({
|
|
3695
|
+
"data-slot": "tooltip-content",
|
|
3696
|
+
sideOffset,
|
|
3697
|
+
className: cn(
|
|
3698
|
+
"tooltip-content",
|
|
3699
|
+
"bg-secondary text-secondary-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 z-50 w-fit rounded-md px-3 py-1.5 text-xs text-balance",
|
|
3700
|
+
className
|
|
3701
|
+
)
|
|
3702
|
+
}, props), {
|
|
3703
|
+
children: [
|
|
3704
|
+
children,
|
|
3705
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3706
|
+
TooltipPrimitiveRadix.Arrow,
|
|
3707
|
+
{
|
|
3708
|
+
className: cn(
|
|
3709
|
+
"fill-secondary -my-px border-none drop-shadow-[0_1px_0_secondary]",
|
|
3710
|
+
arrowClassName
|
|
3711
|
+
),
|
|
3712
|
+
width: 12,
|
|
3713
|
+
height: 7,
|
|
3714
|
+
"aria-hidden": "true"
|
|
3715
|
+
}
|
|
3716
|
+
)
|
|
3717
|
+
]
|
|
3718
|
+
})
|
|
3719
|
+
) });
|
|
3720
|
+
};
|
|
3721
|
+
var Tooltip2 = ({
|
|
3722
|
+
message,
|
|
3723
|
+
children,
|
|
3724
|
+
delayDuration = 200,
|
|
3725
|
+
side,
|
|
3726
|
+
align,
|
|
3727
|
+
sideOffset,
|
|
3728
|
+
hidden,
|
|
3729
|
+
open,
|
|
3730
|
+
onOpenChange,
|
|
3731
|
+
contentClassName,
|
|
3732
|
+
arrowClassName
|
|
3733
|
+
}) => {
|
|
3734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Tooltip, { delayDuration, open, onOpenChange, children: [
|
|
3735
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TooltipTrigger, { asChild: true, children }),
|
|
3736
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3737
|
+
TooltipContent,
|
|
3738
|
+
{
|
|
3739
|
+
side,
|
|
3740
|
+
align,
|
|
3741
|
+
sideOffset,
|
|
3742
|
+
hidden,
|
|
3743
|
+
className: contentClassName,
|
|
3744
|
+
arrowClassName,
|
|
3745
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: message })
|
|
3746
|
+
}
|
|
3747
|
+
)
|
|
3748
|
+
] });
|
|
3749
|
+
};
|
|
3520
3750
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3521
3751
|
0 && (module.exports = {
|
|
3752
|
+
Alert,
|
|
3753
|
+
AlertDescription,
|
|
3754
|
+
AlertTitle,
|
|
3522
3755
|
Button,
|
|
3523
3756
|
CloseIcon,
|
|
3524
3757
|
Icon,
|
|
3525
3758
|
LinkButton,
|
|
3526
3759
|
SpinnerIcon,
|
|
3760
|
+
Tooltip,
|
|
3761
|
+
TooltipContent,
|
|
3762
|
+
alertVariants,
|
|
3527
3763
|
buttonVariants,
|
|
3528
3764
|
cn
|
|
3529
3765
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -30,9 +30,6 @@ var __objRest = (source, exclude) => {
|
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
// src/button/button.tsx
|
|
34
|
-
import * as React from "react";
|
|
35
|
-
|
|
36
33
|
// ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
37
34
|
function r(e) {
|
|
38
35
|
var t, f, n = "";
|
|
@@ -3061,11 +3058,136 @@ function cn(...inputs) {
|
|
|
3061
3058
|
return twMerge(clsx(inputs));
|
|
3062
3059
|
}
|
|
3063
3060
|
|
|
3061
|
+
// src/alert/alert.tsx
|
|
3062
|
+
import { cva } from "class-variance-authority";
|
|
3063
|
+
import { CircleXIcon } from "lucide-react";
|
|
3064
|
+
import * as React from "react";
|
|
3065
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3066
|
+
var variantDefinitions = {
|
|
3067
|
+
default: {
|
|
3068
|
+
classes: "bg-background text-foreground",
|
|
3069
|
+
closeButtonColor: "text-foreground"
|
|
3070
|
+
},
|
|
3071
|
+
secondary: {
|
|
3072
|
+
classes: "bg-muted text-primary [&>svg]:text-primary",
|
|
3073
|
+
closeButtonColor: "text-primary"
|
|
3074
|
+
},
|
|
3075
|
+
outline: {
|
|
3076
|
+
classes: "border-muted text-muted-foreground",
|
|
3077
|
+
closeButtonColor: "text-muted-foreground"
|
|
3078
|
+
},
|
|
3079
|
+
destructive: {
|
|
3080
|
+
classes: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
|
|
3081
|
+
closeButtonColor: "text-destructive"
|
|
3082
|
+
},
|
|
3083
|
+
success: {
|
|
3084
|
+
classes: "border-success-300 bg-success-100 text-success-500",
|
|
3085
|
+
closeButtonColor: "text-success-500"
|
|
3086
|
+
},
|
|
3087
|
+
info: {
|
|
3088
|
+
classes: "border-info-300 bg-info-100 text-info-500! [&>svg]:text-info-500",
|
|
3089
|
+
closeButtonColor: "text-info-500"
|
|
3090
|
+
},
|
|
3091
|
+
warning: {
|
|
3092
|
+
classes: "border-yellow-500 bg-yellow-50 text-yellow-700! [&>svg]:text-yellow-700",
|
|
3093
|
+
closeButtonColor: "text-yellow-700"
|
|
3094
|
+
}
|
|
3095
|
+
};
|
|
3096
|
+
var alertVariants = cva(
|
|
3097
|
+
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
|
|
3098
|
+
{
|
|
3099
|
+
variants: {
|
|
3100
|
+
variant: {
|
|
3101
|
+
default: variantDefinitions.default.classes,
|
|
3102
|
+
secondary: variantDefinitions.secondary.classes,
|
|
3103
|
+
outline: variantDefinitions.outline.classes,
|
|
3104
|
+
destructive: variantDefinitions.destructive.classes,
|
|
3105
|
+
success: variantDefinitions.success.classes,
|
|
3106
|
+
info: variantDefinitions.info.classes,
|
|
3107
|
+
warning: variantDefinitions.warning.classes
|
|
3108
|
+
}
|
|
3109
|
+
},
|
|
3110
|
+
defaultVariants: {
|
|
3111
|
+
variant: "default"
|
|
3112
|
+
}
|
|
3113
|
+
}
|
|
3114
|
+
);
|
|
3115
|
+
var Alert = (_a) => {
|
|
3116
|
+
var _b = _a, { className, variant, closable = false, onClose } = _b, props = __objRest(_b, ["className", "variant", "closable", "onClose"]);
|
|
3117
|
+
var _a2;
|
|
3118
|
+
const [isVisible, setIsVisible] = React.useState(true);
|
|
3119
|
+
const handleClose = () => {
|
|
3120
|
+
if (onClose) {
|
|
3121
|
+
onClose();
|
|
3122
|
+
} else {
|
|
3123
|
+
setIsVisible(false);
|
|
3124
|
+
}
|
|
3125
|
+
};
|
|
3126
|
+
if (!isVisible) {
|
|
3127
|
+
return null;
|
|
3128
|
+
}
|
|
3129
|
+
return /* @__PURE__ */ jsxs(
|
|
3130
|
+
"div",
|
|
3131
|
+
__spreadProps(__spreadValues({
|
|
3132
|
+
role: "alert",
|
|
3133
|
+
className: cn(alertVariants({ variant }), closable && "pr-10", className)
|
|
3134
|
+
}, props), {
|
|
3135
|
+
children: [
|
|
3136
|
+
props.children,
|
|
3137
|
+
closable && /* @__PURE__ */ jsx(
|
|
3138
|
+
"span",
|
|
3139
|
+
{
|
|
3140
|
+
onClick: handleClose,
|
|
3141
|
+
role: "button",
|
|
3142
|
+
tabIndex: 0,
|
|
3143
|
+
onKeyDown: (e) => {
|
|
3144
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
3145
|
+
e.preventDefault();
|
|
3146
|
+
handleClose();
|
|
3147
|
+
}
|
|
3148
|
+
},
|
|
3149
|
+
className: "absolute top-4 right-4 z-10 cursor-pointer opacity-70 transition-opacity hover:opacity-100",
|
|
3150
|
+
"aria-label": "Close alert",
|
|
3151
|
+
children: /* @__PURE__ */ jsx(
|
|
3152
|
+
CircleXIcon,
|
|
3153
|
+
{
|
|
3154
|
+
className: cn("size-4", variant && ((_a2 = variantDefinitions[variant]) == null ? void 0 : _a2.closeButtonColor))
|
|
3155
|
+
}
|
|
3156
|
+
)
|
|
3157
|
+
}
|
|
3158
|
+
)
|
|
3159
|
+
]
|
|
3160
|
+
})
|
|
3161
|
+
);
|
|
3162
|
+
};
|
|
3163
|
+
var AlertTitle = (_a) => {
|
|
3164
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3165
|
+
return /* @__PURE__ */ jsx(
|
|
3166
|
+
"div",
|
|
3167
|
+
__spreadValues({
|
|
3168
|
+
className: cn("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight", className)
|
|
3169
|
+
}, props)
|
|
3170
|
+
);
|
|
3171
|
+
};
|
|
3172
|
+
var AlertDescription = (_a) => {
|
|
3173
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
3174
|
+
return /* @__PURE__ */ jsx(
|
|
3175
|
+
"div",
|
|
3176
|
+
__spreadValues({
|
|
3177
|
+
className: cn(
|
|
3178
|
+
"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
|
|
3179
|
+
className
|
|
3180
|
+
)
|
|
3181
|
+
}, props)
|
|
3182
|
+
);
|
|
3183
|
+
};
|
|
3184
|
+
|
|
3064
3185
|
// src/button/button.tsx
|
|
3065
|
-
import
|
|
3186
|
+
import * as React2 from "react";
|
|
3187
|
+
import { cva as cva3 } from "class-variance-authority";
|
|
3066
3188
|
|
|
3067
3189
|
// src/icons/icon-wrapper.tsx
|
|
3068
|
-
import { jsx } from "react/jsx-runtime";
|
|
3190
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
3069
3191
|
function Icon(_a) {
|
|
3070
3192
|
var _b = _a, {
|
|
3071
3193
|
icon: IconComponent,
|
|
@@ -3078,7 +3200,7 @@ function Icon(_a) {
|
|
|
3078
3200
|
"absoluteStrokeWidth",
|
|
3079
3201
|
"size"
|
|
3080
3202
|
]);
|
|
3081
|
-
return /* @__PURE__ */
|
|
3203
|
+
return /* @__PURE__ */ jsx2(
|
|
3082
3204
|
IconComponent,
|
|
3083
3205
|
__spreadProps(__spreadValues({}, props), {
|
|
3084
3206
|
strokeWidth,
|
|
@@ -3089,9 +3211,9 @@ function Icon(_a) {
|
|
|
3089
3211
|
}
|
|
3090
3212
|
|
|
3091
3213
|
// src/icons/spinner-icon.tsx
|
|
3092
|
-
import { cva } from "class-variance-authority";
|
|
3093
|
-
import { jsx as
|
|
3094
|
-
var spinnerVariants =
|
|
3214
|
+
import { cva as cva2 } from "class-variance-authority";
|
|
3215
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
3216
|
+
var spinnerVariants = cva2("animate-spin", {
|
|
3095
3217
|
variants: {
|
|
3096
3218
|
size: {
|
|
3097
3219
|
xs: "size-3",
|
|
@@ -3125,7 +3247,7 @@ var SpinnerIcon = (_a) => {
|
|
|
3125
3247
|
"trackClassName",
|
|
3126
3248
|
"indicatorClassName"
|
|
3127
3249
|
]);
|
|
3128
|
-
return /* @__PURE__ */
|
|
3250
|
+
return /* @__PURE__ */ jsxs2(
|
|
3129
3251
|
"svg",
|
|
3130
3252
|
__spreadProps(__spreadValues({
|
|
3131
3253
|
viewBox: "0 0 64 64",
|
|
@@ -3134,7 +3256,7 @@ var SpinnerIcon = (_a) => {
|
|
|
3134
3256
|
className: cn(spinnerVariants({ size }), className)
|
|
3135
3257
|
}, props), {
|
|
3136
3258
|
children: [
|
|
3137
|
-
/* @__PURE__ */
|
|
3259
|
+
/* @__PURE__ */ jsx3(
|
|
3138
3260
|
"path",
|
|
3139
3261
|
{
|
|
3140
3262
|
d: "M32 3C35.8083 3 39.5794 3.75011 43.0978 5.20749C46.6163 6.66488 49.8132 8.80101 52.5061 11.4939C55.199 14.1868 57.3351 17.3837 58.7925 20.9022C60.2499 24.4206 61 28.1917 61 32C61 35.8083 60.2499 39.5794 58.7925 43.0978C57.3351 46.6163 55.199 49.8132 52.5061 52.5061C49.8132 55.199 46.6163 57.3351 43.0978 58.7925C39.5794 60.2499 35.8083 61 32 61C28.1917 61 24.4206 60.2499 20.9022 58.7925C17.3837 57.3351 14.1868 55.199 11.4939 52.5061C8.801 49.8132 6.66487 46.6163 5.20749 43.0978C3.7501 39.5794 3 35.8083 3 32C3 28.1917 3.75011 24.4206 5.2075 20.9022C6.66489 17.3837 8.80101 14.1868 11.4939 11.4939C14.1868 8.80099 17.3838 6.66487 20.9022 5.20749C24.4206 3.7501 28.1917 3 32 3L32 3Z",
|
|
@@ -3145,7 +3267,7 @@ var SpinnerIcon = (_a) => {
|
|
|
3145
3267
|
className: trackClassName
|
|
3146
3268
|
}
|
|
3147
3269
|
),
|
|
3148
|
-
/* @__PURE__ */
|
|
3270
|
+
/* @__PURE__ */ jsx3(
|
|
3149
3271
|
"path",
|
|
3150
3272
|
{
|
|
3151
3273
|
d: "M32 3C36.5778 3 41.0906 4.08374 45.1692 6.16256C49.2477 8.24138 52.7762 11.2562 55.466 14.9605C58.1558 18.6647 59.9304 22.9531 60.6448 27.4748C61.3591 31.9965 60.9928 36.6232 59.5759 40.9762",
|
|
@@ -3162,12 +3284,12 @@ var SpinnerIcon = (_a) => {
|
|
|
3162
3284
|
};
|
|
3163
3285
|
|
|
3164
3286
|
// src/icons/close-icon.tsx
|
|
3165
|
-
import { jsx as
|
|
3287
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
3166
3288
|
var CloseIcon = ({
|
|
3167
3289
|
className,
|
|
3168
3290
|
fill = "fill-foreground"
|
|
3169
3291
|
}) => {
|
|
3170
|
-
return /* @__PURE__ */
|
|
3292
|
+
return /* @__PURE__ */ jsx4(
|
|
3171
3293
|
"svg",
|
|
3172
3294
|
{
|
|
3173
3295
|
width: "17",
|
|
@@ -3176,7 +3298,7 @@ var CloseIcon = ({
|
|
|
3176
3298
|
fill: "none",
|
|
3177
3299
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3178
3300
|
className: cn("transition-opacity hover:opacity-90", className),
|
|
3179
|
-
children: /* @__PURE__ */
|
|
3301
|
+
children: /* @__PURE__ */ jsx4(
|
|
3180
3302
|
"path",
|
|
3181
3303
|
{
|
|
3182
3304
|
opacity: "0.2",
|
|
@@ -3189,8 +3311,8 @@ var CloseIcon = ({
|
|
|
3189
3311
|
};
|
|
3190
3312
|
|
|
3191
3313
|
// src/button/button.tsx
|
|
3192
|
-
import { Fragment, jsx as
|
|
3193
|
-
var buttonVariants =
|
|
3314
|
+
import { Fragment, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
3315
|
+
var buttonVariants = cva3(
|
|
3194
3316
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50",
|
|
3195
3317
|
{
|
|
3196
3318
|
variants: {
|
|
@@ -3380,7 +3502,7 @@ var buttonVariants = cva2(
|
|
|
3380
3502
|
}
|
|
3381
3503
|
}
|
|
3382
3504
|
);
|
|
3383
|
-
var Button =
|
|
3505
|
+
var Button = React2.forwardRef(
|
|
3384
3506
|
(_a, ref) => {
|
|
3385
3507
|
var _b = _a, {
|
|
3386
3508
|
className,
|
|
@@ -3413,30 +3535,30 @@ var Button = React.forwardRef(
|
|
|
3413
3535
|
const isIconOnly = (icon || loading) && !children;
|
|
3414
3536
|
const showIcon = !loading && icon;
|
|
3415
3537
|
const getLoadingIcon = () => {
|
|
3416
|
-
return loadingIcon || /* @__PURE__ */
|
|
3538
|
+
return loadingIcon || /* @__PURE__ */ jsx5(
|
|
3417
3539
|
SpinnerIcon,
|
|
3418
3540
|
{
|
|
3419
|
-
|
|
3420
|
-
"
|
|
3541
|
+
"aria-hidden": "true",
|
|
3542
|
+
size: size === "small" ? "xs" : size === "large" ? "sm" : "md"
|
|
3421
3543
|
}
|
|
3422
3544
|
);
|
|
3423
3545
|
};
|
|
3424
|
-
const showLoadingIcon = loading && (isIconOnly ? getLoadingIcon() : /* @__PURE__ */
|
|
3546
|
+
const showLoadingIcon = loading && (isIconOnly ? getLoadingIcon() : /* @__PURE__ */ jsx5(SpinnerIcon, { size: "sm", "aria-hidden": "true" }));
|
|
3425
3547
|
const getIconOnlyClass = () => {
|
|
3426
3548
|
if (!isIconOnly || size === "icon") return "";
|
|
3427
3549
|
if (size === "small") return "w-8 px-0";
|
|
3428
3550
|
if (size === "large") return "w-11 px-0";
|
|
3429
3551
|
return "w-9 px-0";
|
|
3430
3552
|
};
|
|
3431
|
-
return /* @__PURE__ */
|
|
3553
|
+
return /* @__PURE__ */ jsx5(
|
|
3432
3554
|
"button",
|
|
3433
3555
|
__spreadProps(__spreadValues({
|
|
3434
3556
|
className: cn(buttonVariants({ type, theme, size, block }), getIconOnlyClass(), className),
|
|
3435
|
-
ref,
|
|
3436
3557
|
disabled: isDisabled,
|
|
3558
|
+
ref,
|
|
3437
3559
|
type: htmlType
|
|
3438
3560
|
}, props), {
|
|
3439
|
-
children: isIconOnly ? loading ? showLoadingIcon : showIcon && icon : /* @__PURE__ */
|
|
3561
|
+
children: isIconOnly ? loading ? showLoadingIcon : showIcon && icon : /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
3440
3562
|
showLoadingIcon && showLoadingIcon,
|
|
3441
3563
|
showIcon && iconPosition === "left" && icon,
|
|
3442
3564
|
children,
|
|
@@ -3449,10 +3571,10 @@ var Button = React.forwardRef(
|
|
|
3449
3571
|
Button.displayName = "Button";
|
|
3450
3572
|
|
|
3451
3573
|
// src/button/link-button.tsx
|
|
3452
|
-
import * as
|
|
3574
|
+
import * as React3 from "react";
|
|
3453
3575
|
import { Link } from "react-router";
|
|
3454
|
-
import { Fragment as Fragment2, jsx as
|
|
3455
|
-
var LinkButton =
|
|
3576
|
+
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
3577
|
+
var LinkButton = React3.forwardRef(
|
|
3456
3578
|
(_a, ref) => {
|
|
3457
3579
|
var _b = _a, { className, type, theme, size, block, icon, iconPosition = "left", children } = _b, props = __objRest(_b, ["className", "type", "theme", "size", "block", "icon", "iconPosition", "children"]);
|
|
3458
3580
|
const isIconOnly = icon && !children;
|
|
@@ -3462,13 +3584,13 @@ var LinkButton = React2.forwardRef(
|
|
|
3462
3584
|
if (size === "large") return "w-11 px-0";
|
|
3463
3585
|
return "w-9 px-0";
|
|
3464
3586
|
};
|
|
3465
|
-
return /* @__PURE__ */
|
|
3587
|
+
return /* @__PURE__ */ jsx6(
|
|
3466
3588
|
Link,
|
|
3467
3589
|
__spreadProps(__spreadValues({
|
|
3468
3590
|
className: cn(buttonVariants({ type, theme, size, block }), getIconOnlyClass(), className),
|
|
3469
3591
|
ref
|
|
3470
3592
|
}, props), {
|
|
3471
|
-
children: isIconOnly ? icon : /* @__PURE__ */
|
|
3593
|
+
children: isIconOnly ? icon : /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
3472
3594
|
icon && iconPosition === "left" && icon,
|
|
3473
3595
|
children,
|
|
3474
3596
|
icon && iconPosition === "right" && icon
|
|
@@ -3478,12 +3600,120 @@ var LinkButton = React2.forwardRef(
|
|
|
3478
3600
|
}
|
|
3479
3601
|
);
|
|
3480
3602
|
LinkButton.displayName = "LinkButton";
|
|
3603
|
+
|
|
3604
|
+
// src/tooltip/tooltip.tsx
|
|
3605
|
+
import * as TooltipPrimitiveRadix from "@radix-ui/react-tooltip";
|
|
3606
|
+
|
|
3607
|
+
// ../shadcn/ui/tooltip.tsx
|
|
3608
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
3609
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
3610
|
+
var TooltipProvider = (_a) => {
|
|
3611
|
+
var _b = _a, {
|
|
3612
|
+
delayDuration = 0
|
|
3613
|
+
} = _b, props = __objRest(_b, [
|
|
3614
|
+
"delayDuration"
|
|
3615
|
+
]);
|
|
3616
|
+
return /* @__PURE__ */ jsx7(
|
|
3617
|
+
TooltipPrimitive.Provider,
|
|
3618
|
+
__spreadValues({
|
|
3619
|
+
"data-slot": "tooltip-provider",
|
|
3620
|
+
delayDuration
|
|
3621
|
+
}, props)
|
|
3622
|
+
);
|
|
3623
|
+
};
|
|
3624
|
+
var Tooltip = (_a) => {
|
|
3625
|
+
var props = __objRest(_a, []);
|
|
3626
|
+
return /* @__PURE__ */ jsx7(TooltipProvider, { children: /* @__PURE__ */ jsx7(TooltipPrimitive.Root, __spreadValues({ "data-slot": "tooltip" }, props)) });
|
|
3627
|
+
};
|
|
3628
|
+
var TooltipTrigger = (_a) => {
|
|
3629
|
+
var props = __objRest(_a, []);
|
|
3630
|
+
return /* @__PURE__ */ jsx7(TooltipPrimitive.Trigger, __spreadValues({ "data-slot": "tooltip-trigger" }, props));
|
|
3631
|
+
};
|
|
3632
|
+
|
|
3633
|
+
// src/tooltip/tooltip.tsx
|
|
3634
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
3635
|
+
var TooltipContent = (_a) => {
|
|
3636
|
+
var _b = _a, {
|
|
3637
|
+
className,
|
|
3638
|
+
arrowClassName,
|
|
3639
|
+
sideOffset = 0,
|
|
3640
|
+
children
|
|
3641
|
+
} = _b, props = __objRest(_b, [
|
|
3642
|
+
"className",
|
|
3643
|
+
"arrowClassName",
|
|
3644
|
+
"sideOffset",
|
|
3645
|
+
"children"
|
|
3646
|
+
]);
|
|
3647
|
+
return /* @__PURE__ */ jsx8(TooltipPrimitiveRadix.Portal, { children: /* @__PURE__ */ jsxs6(
|
|
3648
|
+
TooltipPrimitiveRadix.Content,
|
|
3649
|
+
__spreadProps(__spreadValues({
|
|
3650
|
+
"data-slot": "tooltip-content",
|
|
3651
|
+
sideOffset,
|
|
3652
|
+
className: cn(
|
|
3653
|
+
"tooltip-content",
|
|
3654
|
+
"bg-secondary text-secondary-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 z-50 w-fit rounded-md px-3 py-1.5 text-xs text-balance",
|
|
3655
|
+
className
|
|
3656
|
+
)
|
|
3657
|
+
}, props), {
|
|
3658
|
+
children: [
|
|
3659
|
+
children,
|
|
3660
|
+
/* @__PURE__ */ jsx8(
|
|
3661
|
+
TooltipPrimitiveRadix.Arrow,
|
|
3662
|
+
{
|
|
3663
|
+
className: cn(
|
|
3664
|
+
"fill-secondary -my-px border-none drop-shadow-[0_1px_0_secondary]",
|
|
3665
|
+
arrowClassName
|
|
3666
|
+
),
|
|
3667
|
+
width: 12,
|
|
3668
|
+
height: 7,
|
|
3669
|
+
"aria-hidden": "true"
|
|
3670
|
+
}
|
|
3671
|
+
)
|
|
3672
|
+
]
|
|
3673
|
+
})
|
|
3674
|
+
) });
|
|
3675
|
+
};
|
|
3676
|
+
var Tooltip2 = ({
|
|
3677
|
+
message,
|
|
3678
|
+
children,
|
|
3679
|
+
delayDuration = 200,
|
|
3680
|
+
side,
|
|
3681
|
+
align,
|
|
3682
|
+
sideOffset,
|
|
3683
|
+
hidden,
|
|
3684
|
+
open,
|
|
3685
|
+
onOpenChange,
|
|
3686
|
+
contentClassName,
|
|
3687
|
+
arrowClassName
|
|
3688
|
+
}) => {
|
|
3689
|
+
return /* @__PURE__ */ jsxs6(Tooltip, { delayDuration, open, onOpenChange, children: [
|
|
3690
|
+
/* @__PURE__ */ jsx8(TooltipTrigger, { asChild: true, children }),
|
|
3691
|
+
/* @__PURE__ */ jsx8(
|
|
3692
|
+
TooltipContent,
|
|
3693
|
+
{
|
|
3694
|
+
side,
|
|
3695
|
+
align,
|
|
3696
|
+
sideOffset,
|
|
3697
|
+
hidden,
|
|
3698
|
+
className: contentClassName,
|
|
3699
|
+
arrowClassName,
|
|
3700
|
+
children: /* @__PURE__ */ jsx8("span", { children: message })
|
|
3701
|
+
}
|
|
3702
|
+
)
|
|
3703
|
+
] });
|
|
3704
|
+
};
|
|
3481
3705
|
export {
|
|
3706
|
+
Alert,
|
|
3707
|
+
AlertDescription,
|
|
3708
|
+
AlertTitle,
|
|
3482
3709
|
Button,
|
|
3483
3710
|
CloseIcon,
|
|
3484
3711
|
Icon,
|
|
3485
3712
|
LinkButton,
|
|
3486
3713
|
SpinnerIcon,
|
|
3714
|
+
Tooltip2 as Tooltip,
|
|
3715
|
+
TooltipContent,
|
|
3716
|
+
alertVariants,
|
|
3487
3717
|
buttonVariants,
|
|
3488
3718
|
cn
|
|
3489
3719
|
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datum-cloud/datum-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"**/*.css"
|
|
6
6
|
],
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "./dist/index.js",
|
|
9
9
|
"module": "./dist/index.mjs",
|
|
10
|
+
"repository": {
|
|
11
|
+
"url": "https://github.com/datum-cloud/datum-ui"
|
|
12
|
+
},
|
|
10
13
|
"types": "./dist/index.d.ts",
|
|
11
14
|
"exports": {
|
|
12
15
|
".": {
|
|
@@ -42,9 +45,9 @@
|
|
|
42
45
|
"tsup": "^8.5.1",
|
|
43
46
|
"typescript": "5.9.3",
|
|
44
47
|
"@repo/eslint-config": "0.0.0",
|
|
45
|
-
"@repo/
|
|
48
|
+
"@repo/tailwind-config": "0.0.0",
|
|
46
49
|
"@repo/shadcn": "0.0.0",
|
|
47
|
-
"@repo/
|
|
50
|
+
"@repo/typescript-config": "0.0.0"
|
|
48
51
|
},
|
|
49
52
|
"dependencies": {
|
|
50
53
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
@@ -158,6 +158,7 @@ Scope variables to the theme class so we can swap themes by class
|
|
|
158
158
|
--icon-tertiary: var(--app-dark-utility-5);
|
|
159
159
|
--icon-quaternary: var(--app-dark-utility-2);
|
|
160
160
|
--icon-quinary: var(--app-dark-utility-1);
|
|
161
|
+
--icon-header: var(--canyon-clay-links);
|
|
161
162
|
|
|
162
163
|
--stepper-line: var(--glacier-mist-800);
|
|
163
164
|
--stepper-label: var(--app-dark-utility-4);
|
|
@@ -305,6 +306,7 @@ Scope variables to the theme class so we can swap themes by class
|
|
|
305
306
|
--icon-tertiary: var(--app-dark-utility-3);
|
|
306
307
|
--icon-quaternary: var(--app-dark-utility-2);
|
|
307
308
|
--icon-quinary: var(--app-dark-utility-1);
|
|
309
|
+
--icon-header: var(--aurora-moss);
|
|
308
310
|
|
|
309
311
|
--stepper-line: var(--app-dark-utility-2);
|
|
310
312
|
--stepper-label: var(--app-dark-utility-3);
|
|
@@ -352,6 +354,7 @@ TAILWIND CUSTOM UTILITIES FOR THEME
|
|
|
352
354
|
--color-icon-tertiary: var(--icon-tertiary);
|
|
353
355
|
--color-icon-quaternary: var(--icon-quaternary);
|
|
354
356
|
--color-icon-quinary: var(--icon-quinary);
|
|
357
|
+
--color-icon-header: var(--icon-header);
|
|
355
358
|
|
|
356
359
|
/* Toast */
|
|
357
360
|
--color-toast-error-background: var(--toast-error-background);
|
|
@@ -410,6 +413,15 @@ TAILWIND CUSTOM UTILITIES FOR THEME
|
|
|
410
413
|
|
|
411
414
|
--color-stepper-line: var(--stepper-line);
|
|
412
415
|
--color-stepper-label: var(--stepper-label);
|
|
416
|
+
|
|
417
|
+
/* Alert / Status colors */
|
|
418
|
+
--color-success-100: var(--success-100);
|
|
419
|
+
--color-success-300: var(--success-300);
|
|
420
|
+
--color-success-500: var(--success-500);
|
|
421
|
+
|
|
422
|
+
--color-info-100: var(--info-100);
|
|
423
|
+
--color-info-300: var(--info-300);
|
|
424
|
+
--color-info-500: var(--info-500);
|
|
413
425
|
}
|
|
414
426
|
|
|
415
427
|
/* ========================================
|