@luxfi/ui 7.0.0 → 7.2.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 +184 -335
- package/dist/alert.js +184 -335
- package/dist/badge.cjs +162 -321
- package/dist/badge.d.cts +3 -7
- package/dist/badge.d.ts +3 -7
- package/dist/badge.js +162 -320
- package/dist/bank.d.cts +1 -1
- package/dist/bank.d.ts +1 -1
- package/dist/button.cjs +373 -484
- package/dist/button.d.cts +10 -7
- package/dist/button.d.ts +10 -7
- package/dist/button.js +373 -484
- package/dist/close-button.cjs +37 -18
- package/dist/close-button.d.cts +1 -1
- package/dist/close-button.d.ts +1 -1
- package/dist/close-button.js +37 -18
- package/dist/collapsible.cjs +125 -272
- package/dist/collapsible.js +125 -272
- package/dist/dialog.cjs +60 -44
- package/dist/dialog.d.cts +7 -8
- package/dist/dialog.d.ts +7 -8
- package/dist/dialog.js +60 -43
- package/dist/drawer.cjs +37 -13
- package/dist/drawer.js +37 -13
- package/dist/heading.cjs +3 -8
- package/dist/heading.js +3 -8
- package/dist/icon-button.cjs +213 -337
- package/dist/icon-button.d.cts +4 -4
- package/dist/icon-button.d.ts +4 -4
- package/dist/icon-button.js +213 -338
- package/dist/image.cjs +125 -272
- package/dist/image.js +125 -272
- package/dist/index.cjs +695 -858
- package/dist/index.d.cts +0 -3
- package/dist/index.d.ts +0 -3
- package/dist/index.js +695 -856
- package/dist/input.cjs +25 -36
- package/dist/input.js +25 -36
- package/dist/link.cjs +125 -272
- package/dist/link.js +125 -272
- package/dist/popover.cjs +55 -40
- package/dist/popover.js +55 -39
- package/dist/select.cjs +125 -272
- package/dist/select.js +125 -272
- package/dist/skeleton.cjs +125 -272
- package/dist/skeleton.js +125 -272
- package/dist/table.cjs +127 -274
- package/dist/table.js +127 -274
- package/dist/tag.cjs +199 -341
- package/dist/tag.js +199 -340
- package/dist/textarea.cjs +25 -36
- package/dist/textarea.js +25 -36
- package/dist/tooltip.cjs +22 -21
- package/dist/tooltip.d.cts +2 -3
- package/dist/tooltip.d.ts +2 -3
- package/dist/tooltip.js +22 -20
- package/package.json +9 -8
- package/src/alert.tsx +23 -51
- package/src/badge.tsx +20 -31
- package/src/button.tsx +304 -238
- package/src/close-button.tsx +48 -22
- package/src/dialog.tsx +37 -47
- package/src/heading.tsx +8 -19
- package/src/icon-button.tsx +129 -104
- package/src/input.tsx +27 -36
- package/src/popover.tsx +30 -44
- package/src/skeleton.tsx +96 -144
- package/src/tag.tsx +17 -35
- package/src/textarea.tsx +27 -36
- package/src/tooltip.tsx +54 -47
package/dist/dialog.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
|
|
4
3
|
type DialogSize = 'sm' | 'md' | 'full' | 'cover';
|
|
@@ -21,7 +20,7 @@ interface DialogRootProps {
|
|
|
21
20
|
open: boolean;
|
|
22
21
|
}) => void;
|
|
23
22
|
size?: ResponsiveSize;
|
|
24
|
-
/** Accepted for API compat but not implemented
|
|
23
|
+
/** Accepted for API compat but not implemented -- animations are CSS-only. */
|
|
25
24
|
motionPreset?: string;
|
|
26
25
|
modal?: boolean;
|
|
27
26
|
}
|
|
@@ -50,17 +49,17 @@ declare const DialogBody: React.ForwardRefExoticComponent<DialogBodyProps & Reac
|
|
|
50
49
|
interface DialogFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
51
50
|
}
|
|
52
51
|
declare const DialogFooter: React.ForwardRefExoticComponent<DialogFooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
53
|
-
declare const DialogBackdrop:
|
|
54
|
-
declare const DialogTitle:
|
|
55
|
-
declare const DialogDescription:
|
|
56
|
-
interface DialogTriggerProps extends React.ComponentPropsWithoutRef<
|
|
52
|
+
declare const DialogBackdrop: any;
|
|
53
|
+
declare const DialogTitle: any;
|
|
54
|
+
declare const DialogDescription: any;
|
|
55
|
+
interface DialogTriggerProps extends React.ComponentPropsWithoutRef<'button'> {
|
|
57
56
|
}
|
|
58
|
-
declare const DialogTrigger:
|
|
57
|
+
declare const DialogTrigger: any;
|
|
59
58
|
/**
|
|
60
59
|
* `DialogActionTrigger` renders its child and closes the dialog on click.
|
|
61
60
|
* This mirrors the Chakra `Dialog.ActionTrigger` behavior which wraps
|
|
62
61
|
* children in a close action.
|
|
63
62
|
*/
|
|
64
|
-
declare const DialogActionTrigger:
|
|
63
|
+
declare const DialogActionTrigger: any;
|
|
65
64
|
|
|
66
65
|
export { DialogActionTrigger, DialogBackdrop, DialogBody, type DialogBodyProps, DialogCloseTrigger, type DialogCloseTriggerProps, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, DialogRoot, type DialogRootProps, DialogTitle, DialogTrigger, type DialogTriggerProps };
|
package/dist/dialog.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import { Dialog } from '@hanzogui/dialog';
|
|
3
3
|
import * as React2 from 'react';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
|
+
import { styled, View } from '@hanzogui/core';
|
|
6
7
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
8
|
|
|
8
9
|
// src/dialog.tsx
|
|
@@ -10,24 +11,47 @@ function cn(...inputs) {
|
|
|
10
11
|
return twMerge(clsx(inputs));
|
|
11
12
|
}
|
|
12
13
|
var CLOSE_ICON_PATH = "M9.44 8.035a.791.791 0 0 0 1.12 0l3.802-3.803a.791.791 0 0 1 1.119 0l.287.287a.79.79 0 0 1 0 1.119L11.965 9.44a.79.79 0 0 0 0 1.118l3.803 3.803a.791.791 0 0 1 0 1.119l-.287.287a.791.791 0 0 1-1.119 0l-3.803-3.803a.79.79 0 0 0-1.118 0l-3.803 3.803a.79.79 0 0 1-1.119 0l-.287-.287a.791.791 0 0 1 0-1.119l3.803-3.803a.791.791 0 0 0 0-1.118L4.232 5.638a.791.791 0 0 1 0-1.119l.287-.287a.791.791 0 0 1 1.119 0L9.44 8.035Z";
|
|
14
|
+
var CloseButtonFrame = styled(View, {
|
|
15
|
+
name: "LuxCloseButton",
|
|
16
|
+
render: /* @__PURE__ */ jsx("button", { type: "button", "aria-label": "Close" }),
|
|
17
|
+
role: "button",
|
|
18
|
+
cursor: "pointer",
|
|
19
|
+
display: "inline-flex",
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
justifyContent: "center",
|
|
22
|
+
width: 20,
|
|
23
|
+
height: 20,
|
|
24
|
+
minWidth: 0,
|
|
25
|
+
flexShrink: 1,
|
|
26
|
+
padding: 0,
|
|
27
|
+
borderRadius: 4,
|
|
28
|
+
borderWidth: 0,
|
|
29
|
+
overflow: "hidden",
|
|
30
|
+
backgroundColor: "transparent",
|
|
31
|
+
hoverStyle: {
|
|
32
|
+
backgroundColor: "transparent"
|
|
33
|
+
},
|
|
34
|
+
variants: {
|
|
35
|
+
disabled: {
|
|
36
|
+
true: {
|
|
37
|
+
opacity: 0.4,
|
|
38
|
+
pointerEvents: "none"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
var CLOSE_BUTTON_CLASSES = [
|
|
44
|
+
"text-[var(--closeButton-fg,currentColor)]",
|
|
45
|
+
"hover:text-[var(--hover-color,currentColor)]",
|
|
46
|
+
"disabled:opacity-40"
|
|
47
|
+
].join(" ");
|
|
13
48
|
var CloseButton = React2.forwardRef(function CloseButton2(props, ref) {
|
|
14
49
|
const { variant: _variant, size: _size, className, children, ...rest } = props;
|
|
15
50
|
return /* @__PURE__ */ jsx(
|
|
16
|
-
|
|
51
|
+
CloseButtonFrame,
|
|
17
52
|
{
|
|
18
|
-
type: "button",
|
|
19
|
-
"aria-label": "Close",
|
|
20
53
|
ref,
|
|
21
|
-
className:
|
|
22
|
-
"inline-flex items-center justify-center",
|
|
23
|
-
"size-5 min-w-0 shrink-0 p-0",
|
|
24
|
-
"rounded-sm border-0 overflow-hidden",
|
|
25
|
-
"bg-transparent text-[var(--closeButton-fg,currentColor)]",
|
|
26
|
-
"hover:bg-transparent hover:text-[var(--hover-color,currentColor)]",
|
|
27
|
-
"disabled:opacity-40",
|
|
28
|
-
"cursor-pointer",
|
|
29
|
-
className
|
|
30
|
-
),
|
|
54
|
+
className: [CLOSE_BUTTON_CLASSES, className].filter(Boolean).join(" "),
|
|
31
55
|
...rest,
|
|
32
56
|
children: children ?? /* @__PURE__ */ jsx(
|
|
33
57
|
"svg",
|
|
@@ -60,9 +84,9 @@ function BackToButton({ onClick }) {
|
|
|
60
84
|
}
|
|
61
85
|
);
|
|
62
86
|
}
|
|
63
|
-
var
|
|
64
|
-
function
|
|
65
|
-
return React2.useContext(
|
|
87
|
+
var DialogSizeContext = React2.createContext({ size: "md" });
|
|
88
|
+
function useDialogSizeContext() {
|
|
89
|
+
return React2.useContext(DialogSizeContext);
|
|
66
90
|
}
|
|
67
91
|
var CONTENT_SIZE_MAP = {
|
|
68
92
|
sm: "max-w-[400px]",
|
|
@@ -92,7 +116,7 @@ var DialogRoot = ({
|
|
|
92
116
|
onOpenChange,
|
|
93
117
|
size = "md",
|
|
94
118
|
modal = true
|
|
95
|
-
// motionPreset is intentionally unused
|
|
119
|
+
// motionPreset is intentionally unused -- kept for API compat
|
|
96
120
|
}) => {
|
|
97
121
|
const handleOpenChange = React2.useCallback(
|
|
98
122
|
(nextOpen) => {
|
|
@@ -101,8 +125,8 @@ var DialogRoot = ({
|
|
|
101
125
|
[onOpenChange]
|
|
102
126
|
);
|
|
103
127
|
const ctx = React2.useMemo(() => ({ size }), [size]);
|
|
104
|
-
return /* @__PURE__ */ jsx(
|
|
105
|
-
|
|
128
|
+
return /* @__PURE__ */ jsx(DialogSizeContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx(
|
|
129
|
+
Dialog,
|
|
106
130
|
{
|
|
107
131
|
open,
|
|
108
132
|
defaultOpen,
|
|
@@ -115,8 +139,8 @@ var DialogRoot = ({
|
|
|
115
139
|
var DialogContent = React2.forwardRef(function DialogContent2(props, ref) {
|
|
116
140
|
const {
|
|
117
141
|
children,
|
|
118
|
-
portalled = true,
|
|
119
|
-
portalRef,
|
|
142
|
+
portalled: _portalled = true,
|
|
143
|
+
portalRef: _portalRef,
|
|
120
144
|
backdrop = true,
|
|
121
145
|
className,
|
|
122
146
|
paddingTop: _paddingTop,
|
|
@@ -127,21 +151,12 @@ var DialogContent = React2.forwardRef(function DialogContent2(props, ref) {
|
|
|
127
151
|
...styleProp,
|
|
128
152
|
..._paddingTop !== void 0 ? { paddingTop: typeof _paddingTop === "number" ? `${_paddingTop * 4}px` : _paddingTop } : {}
|
|
129
153
|
};
|
|
130
|
-
const { size } =
|
|
131
|
-
|
|
132
|
-
if (!portalled) {
|
|
133
|
-
portalProps = { container: void 0 };
|
|
134
|
-
} else if (portalRef) {
|
|
135
|
-
portalProps = { container: portalRef.current };
|
|
136
|
-
} else {
|
|
137
|
-
portalProps = {};
|
|
138
|
-
}
|
|
139
|
-
const Wrapper = portalled ? RadixDialog.Portal : React2.Fragment;
|
|
140
|
-
const wrapperProps = portalled ? portalProps : {};
|
|
141
|
-
return /* @__PURE__ */ jsxs(Wrapper, { ...wrapperProps, children: [
|
|
154
|
+
const { size } = useDialogSizeContext();
|
|
155
|
+
return /* @__PURE__ */ jsxs(Dialog.Portal, { children: [
|
|
142
156
|
backdrop && /* @__PURE__ */ jsx(
|
|
143
|
-
|
|
157
|
+
Dialog.Overlay,
|
|
144
158
|
{
|
|
159
|
+
unstyled: true,
|
|
145
160
|
className: "fixed inset-0 z-[1400] bg-black/80"
|
|
146
161
|
}
|
|
147
162
|
),
|
|
@@ -154,9 +169,10 @@ var DialogContent = React2.forwardRef(function DialogContent2(props, ref) {
|
|
|
154
169
|
"overflow-hidden"
|
|
155
170
|
),
|
|
156
171
|
children: /* @__PURE__ */ jsx(
|
|
157
|
-
|
|
172
|
+
Dialog.Content,
|
|
158
173
|
{
|
|
159
174
|
ref,
|
|
175
|
+
unstyled: true,
|
|
160
176
|
className: cn(
|
|
161
177
|
// Base content styles
|
|
162
178
|
"relative flex flex-col w-full p-6 outline-none text-base",
|
|
@@ -179,7 +195,7 @@ var DialogContent = React2.forwardRef(function DialogContent2(props, ref) {
|
|
|
179
195
|
});
|
|
180
196
|
var DialogCloseTrigger = React2.forwardRef(function DialogCloseTrigger2(props, ref) {
|
|
181
197
|
const { className, ...rest } = props;
|
|
182
|
-
return /* @__PURE__ */ jsx(
|
|
198
|
+
return /* @__PURE__ */ jsx(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsx(CloseButton, { ref, className, ...rest, children: props.children }) });
|
|
183
199
|
});
|
|
184
200
|
var DialogHeader = React2.forwardRef(function DialogHeader2(props, ref) {
|
|
185
201
|
const { startElement: startElementProp, onBackToClick, className, children, ...rest } = props;
|
|
@@ -196,8 +212,9 @@ var DialogHeader = React2.forwardRef(function DialogHeader2(props, ref) {
|
|
|
196
212
|
children: [
|
|
197
213
|
startElement,
|
|
198
214
|
/* @__PURE__ */ jsx(
|
|
199
|
-
|
|
215
|
+
Dialog.Title,
|
|
200
216
|
{
|
|
217
|
+
unstyled: true,
|
|
201
218
|
className: cn(
|
|
202
219
|
"text-base lg:text-lg font-medium",
|
|
203
220
|
"whitespace-nowrap overflow-hidden text-ellipsis"
|
|
@@ -237,10 +254,10 @@ var DialogFooter = React2.forwardRef(function DialogFooter2({ className, ...prop
|
|
|
237
254
|
}
|
|
238
255
|
);
|
|
239
256
|
});
|
|
240
|
-
var DialogBackdrop =
|
|
241
|
-
var DialogTitle =
|
|
242
|
-
var DialogDescription =
|
|
243
|
-
var DialogTrigger =
|
|
244
|
-
var DialogActionTrigger =
|
|
257
|
+
var DialogBackdrop = Dialog.Overlay;
|
|
258
|
+
var DialogTitle = Dialog.Title;
|
|
259
|
+
var DialogDescription = Dialog.Description;
|
|
260
|
+
var DialogTrigger = Dialog.Trigger;
|
|
261
|
+
var DialogActionTrigger = Dialog.Close;
|
|
245
262
|
|
|
246
263
|
export { DialogActionTrigger, DialogBackdrop, DialogBody, DialogCloseTrigger, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogRoot, DialogTitle, DialogTrigger };
|
package/dist/drawer.cjs
CHANGED
|
@@ -5,6 +5,7 @@ var RadixDialog = require('@radix-ui/react-dialog');
|
|
|
5
5
|
var React2 = require('react');
|
|
6
6
|
var clsx = require('clsx');
|
|
7
7
|
var tailwindMerge = require('tailwind-merge');
|
|
8
|
+
var core = require('@hanzogui/core');
|
|
8
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
10
|
|
|
10
11
|
function _interopNamespace(e) {
|
|
@@ -33,24 +34,47 @@ function cn(...inputs) {
|
|
|
33
34
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
34
35
|
}
|
|
35
36
|
var CLOSE_ICON_PATH = "M9.44 8.035a.791.791 0 0 0 1.12 0l3.802-3.803a.791.791 0 0 1 1.119 0l.287.287a.79.79 0 0 1 0 1.119L11.965 9.44a.79.79 0 0 0 0 1.118l3.803 3.803a.791.791 0 0 1 0 1.119l-.287.287a.791.791 0 0 1-1.119 0l-3.803-3.803a.79.79 0 0 0-1.118 0l-3.803 3.803a.79.79 0 0 1-1.119 0l-.287-.287a.791.791 0 0 1 0-1.119l3.803-3.803a.791.791 0 0 0 0-1.118L4.232 5.638a.791.791 0 0 1 0-1.119l.287-.287a.791.791 0 0 1 1.119 0L9.44 8.035Z";
|
|
37
|
+
var CloseButtonFrame = core.styled(core.View, {
|
|
38
|
+
name: "LuxCloseButton",
|
|
39
|
+
render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", "aria-label": "Close" }),
|
|
40
|
+
role: "button",
|
|
41
|
+
cursor: "pointer",
|
|
42
|
+
display: "inline-flex",
|
|
43
|
+
alignItems: "center",
|
|
44
|
+
justifyContent: "center",
|
|
45
|
+
width: 20,
|
|
46
|
+
height: 20,
|
|
47
|
+
minWidth: 0,
|
|
48
|
+
flexShrink: 1,
|
|
49
|
+
padding: 0,
|
|
50
|
+
borderRadius: 4,
|
|
51
|
+
borderWidth: 0,
|
|
52
|
+
overflow: "hidden",
|
|
53
|
+
backgroundColor: "transparent",
|
|
54
|
+
hoverStyle: {
|
|
55
|
+
backgroundColor: "transparent"
|
|
56
|
+
},
|
|
57
|
+
variants: {
|
|
58
|
+
disabled: {
|
|
59
|
+
true: {
|
|
60
|
+
opacity: 0.4,
|
|
61
|
+
pointerEvents: "none"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
var CLOSE_BUTTON_CLASSES = [
|
|
67
|
+
"text-[var(--closeButton-fg,currentColor)]",
|
|
68
|
+
"hover:text-[var(--hover-color,currentColor)]",
|
|
69
|
+
"disabled:opacity-40"
|
|
70
|
+
].join(" ");
|
|
36
71
|
var CloseButton = React2__namespace.forwardRef(function CloseButton2(props, ref) {
|
|
37
72
|
const { variant: _variant, size: _size, className, children, ...rest } = props;
|
|
38
73
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
39
|
-
|
|
74
|
+
CloseButtonFrame,
|
|
40
75
|
{
|
|
41
|
-
type: "button",
|
|
42
|
-
"aria-label": "Close",
|
|
43
76
|
ref,
|
|
44
|
-
className:
|
|
45
|
-
"inline-flex items-center justify-center",
|
|
46
|
-
"size-5 min-w-0 shrink-0 p-0",
|
|
47
|
-
"rounded-sm border-0 overflow-hidden",
|
|
48
|
-
"bg-transparent text-[var(--closeButton-fg,currentColor)]",
|
|
49
|
-
"hover:bg-transparent hover:text-[var(--hover-color,currentColor)]",
|
|
50
|
-
"disabled:opacity-40",
|
|
51
|
-
"cursor-pointer",
|
|
52
|
-
className
|
|
53
|
-
),
|
|
77
|
+
className: [CLOSE_BUTTON_CLASSES, className].filter(Boolean).join(" "),
|
|
54
78
|
...rest,
|
|
55
79
|
children: children ?? /* @__PURE__ */ jsxRuntime.jsx(
|
|
56
80
|
"svg",
|
package/dist/drawer.js
CHANGED
|
@@ -3,6 +3,7 @@ import * as RadixDialog from '@radix-ui/react-dialog';
|
|
|
3
3
|
import * as React2 from 'react';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
|
+
import { styled, View } from '@hanzogui/core';
|
|
6
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
8
|
|
|
8
9
|
// src/drawer.tsx
|
|
@@ -10,24 +11,47 @@ function cn(...inputs) {
|
|
|
10
11
|
return twMerge(clsx(inputs));
|
|
11
12
|
}
|
|
12
13
|
var CLOSE_ICON_PATH = "M9.44 8.035a.791.791 0 0 0 1.12 0l3.802-3.803a.791.791 0 0 1 1.119 0l.287.287a.79.79 0 0 1 0 1.119L11.965 9.44a.79.79 0 0 0 0 1.118l3.803 3.803a.791.791 0 0 1 0 1.119l-.287.287a.791.791 0 0 1-1.119 0l-3.803-3.803a.79.79 0 0 0-1.118 0l-3.803 3.803a.79.79 0 0 1-1.119 0l-.287-.287a.791.791 0 0 1 0-1.119l3.803-3.803a.791.791 0 0 0 0-1.118L4.232 5.638a.791.791 0 0 1 0-1.119l.287-.287a.791.791 0 0 1 1.119 0L9.44 8.035Z";
|
|
14
|
+
var CloseButtonFrame = styled(View, {
|
|
15
|
+
name: "LuxCloseButton",
|
|
16
|
+
render: /* @__PURE__ */ jsx("button", { type: "button", "aria-label": "Close" }),
|
|
17
|
+
role: "button",
|
|
18
|
+
cursor: "pointer",
|
|
19
|
+
display: "inline-flex",
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
justifyContent: "center",
|
|
22
|
+
width: 20,
|
|
23
|
+
height: 20,
|
|
24
|
+
minWidth: 0,
|
|
25
|
+
flexShrink: 1,
|
|
26
|
+
padding: 0,
|
|
27
|
+
borderRadius: 4,
|
|
28
|
+
borderWidth: 0,
|
|
29
|
+
overflow: "hidden",
|
|
30
|
+
backgroundColor: "transparent",
|
|
31
|
+
hoverStyle: {
|
|
32
|
+
backgroundColor: "transparent"
|
|
33
|
+
},
|
|
34
|
+
variants: {
|
|
35
|
+
disabled: {
|
|
36
|
+
true: {
|
|
37
|
+
opacity: 0.4,
|
|
38
|
+
pointerEvents: "none"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
var CLOSE_BUTTON_CLASSES = [
|
|
44
|
+
"text-[var(--closeButton-fg,currentColor)]",
|
|
45
|
+
"hover:text-[var(--hover-color,currentColor)]",
|
|
46
|
+
"disabled:opacity-40"
|
|
47
|
+
].join(" ");
|
|
13
48
|
var CloseButton = React2.forwardRef(function CloseButton2(props, ref) {
|
|
14
49
|
const { variant: _variant, size: _size, className, children, ...rest } = props;
|
|
15
50
|
return /* @__PURE__ */ jsx(
|
|
16
|
-
|
|
51
|
+
CloseButtonFrame,
|
|
17
52
|
{
|
|
18
|
-
type: "button",
|
|
19
|
-
"aria-label": "Close",
|
|
20
53
|
ref,
|
|
21
|
-
className:
|
|
22
|
-
"inline-flex items-center justify-center",
|
|
23
|
-
"size-5 min-w-0 shrink-0 p-0",
|
|
24
|
-
"rounded-sm border-0 overflow-hidden",
|
|
25
|
-
"bg-transparent text-[var(--closeButton-fg,currentColor)]",
|
|
26
|
-
"hover:bg-transparent hover:text-[var(--hover-color,currentColor)]",
|
|
27
|
-
"disabled:opacity-40",
|
|
28
|
-
"cursor-pointer",
|
|
29
|
-
className
|
|
30
|
-
),
|
|
54
|
+
className: [CLOSE_BUTTON_CLASSES, className].filter(Boolean).join(" "),
|
|
31
55
|
...rest,
|
|
32
56
|
children: children ?? /* @__PURE__ */ jsx(
|
|
33
57
|
"svg",
|
package/dist/heading.cjs
CHANGED
|
@@ -14,11 +14,7 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
14
14
|
function cn(...inputs) {
|
|
15
15
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
16
16
|
}
|
|
17
|
-
var LEVEL_TAG = {
|
|
18
|
-
"1": "h1",
|
|
19
|
-
"2": "h2",
|
|
20
|
-
"3": "h3"
|
|
21
|
-
};
|
|
17
|
+
var LEVEL_TAG = { "1": "h1", "2": "h2", "3": "h3" };
|
|
22
18
|
var LEVEL_CLASSES = {
|
|
23
19
|
"1": "text-[18px] leading-[24px] font-medium lg:text-[32px] lg:leading-[40px] lg:tracking-[-0.5px]",
|
|
24
20
|
"2": "text-[16px] leading-[24px] font-medium lg:text-[24px] lg:leading-[32px]",
|
|
@@ -29,14 +25,13 @@ var Heading = React__default.default.forwardRef(
|
|
|
29
25
|
function Heading2({ level, className, mb, size: _size, style: styleProp, ...rest }, ref) {
|
|
30
26
|
const Tag = level ? LEVEL_TAG[level] : "h2";
|
|
31
27
|
const levelClasses = level ? LEVEL_CLASSES[level] : void 0;
|
|
32
|
-
const
|
|
33
|
-
if (mb !== void 0) shimStyle.marginBottom = typeof mb === "number" ? `${mb * 4}px` : mb;
|
|
28
|
+
const mergedStyle = mb !== void 0 ? { ...styleProp, marginBottom: typeof mb === "number" ? `${mb * 4}px` : mb } : styleProp;
|
|
34
29
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
35
30
|
Tag,
|
|
36
31
|
{
|
|
37
32
|
ref,
|
|
38
33
|
className: cn(BASE_CLASSES, levelClasses, className),
|
|
39
|
-
style:
|
|
34
|
+
style: mergedStyle,
|
|
40
35
|
...rest
|
|
41
36
|
}
|
|
42
37
|
);
|
package/dist/heading.js
CHANGED
|
@@ -8,11 +8,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
8
8
|
function cn(...inputs) {
|
|
9
9
|
return twMerge(clsx(inputs));
|
|
10
10
|
}
|
|
11
|
-
var LEVEL_TAG = {
|
|
12
|
-
"1": "h1",
|
|
13
|
-
"2": "h2",
|
|
14
|
-
"3": "h3"
|
|
15
|
-
};
|
|
11
|
+
var LEVEL_TAG = { "1": "h1", "2": "h2", "3": "h3" };
|
|
16
12
|
var LEVEL_CLASSES = {
|
|
17
13
|
"1": "text-[18px] leading-[24px] font-medium lg:text-[32px] lg:leading-[40px] lg:tracking-[-0.5px]",
|
|
18
14
|
"2": "text-[16px] leading-[24px] font-medium lg:text-[24px] lg:leading-[32px]",
|
|
@@ -23,14 +19,13 @@ var Heading = React.forwardRef(
|
|
|
23
19
|
function Heading2({ level, className, mb, size: _size, style: styleProp, ...rest }, ref) {
|
|
24
20
|
const Tag = level ? LEVEL_TAG[level] : "h2";
|
|
25
21
|
const levelClasses = level ? LEVEL_CLASSES[level] : void 0;
|
|
26
|
-
const
|
|
27
|
-
if (mb !== void 0) shimStyle.marginBottom = typeof mb === "number" ? `${mb * 4}px` : mb;
|
|
22
|
+
const mergedStyle = mb !== void 0 ? { ...styleProp, marginBottom: typeof mb === "number" ? `${mb * 4}px` : mb } : styleProp;
|
|
28
23
|
return /* @__PURE__ */ jsx(
|
|
29
24
|
Tag,
|
|
30
25
|
{
|
|
31
26
|
ref,
|
|
32
27
|
className: cn(BASE_CLASSES, levelClasses, className),
|
|
33
|
-
style:
|
|
28
|
+
style: mergedStyle,
|
|
34
29
|
...rest
|
|
35
30
|
}
|
|
36
31
|
);
|