@luxfi/ui 5.6.0 → 6.1.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/components/Badge.d.ts.map +1 -0
- package/dist/components/Badge.js +91 -0
- package/dist/components/Button.d.ts.map +1 -0
- package/dist/components/Button.js +137 -0
- package/dist/components/Card.d.ts.map +1 -0
- package/dist/components/Card.js +86 -0
- package/dist/components/IconButton.d.ts.map +1 -0
- package/dist/components/IconButton.js +64 -0
- package/dist/components/Input.d.ts.map +1 -0
- package/dist/components/Input.js +71 -0
- package/dist/components/Modal.d.ts.map +1 -0
- package/dist/components/Modal.js +98 -0
- package/dist/components/Skeleton.d.ts.map +1 -0
- package/dist/components/Skeleton.js +44 -0
- package/dist/components/Spinner.d.ts.map +1 -0
- package/dist/components/Spinner.js +42 -0
- package/dist/components/Switch.d.ts.map +1 -0
- package/dist/components/Switch.js +10 -0
- package/dist/components/TokenLogo.d.ts.map +1 -0
- package/dist/components/TokenLogo.js +57 -0
- package/dist/components/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip.js +34 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +35 -5618
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +6 -0
- package/dist/theme/themes.d.ts.map +1 -0
- package/dist/theme/themes.js +73 -0
- package/dist/theme/tokens.d.ts.map +1 -0
- package/dist/theme/tokens.js +101 -0
- package/package.json +81 -278
- package/dist/accordion.cjs +0 -213
- package/dist/accordion.js +0 -186
- package/dist/alert.cjs +0 -553
- package/dist/alert.js +0 -531
- package/dist/avatar.cjs +0 -149
- package/dist/avatar.js +0 -125
- package/dist/badge.cjs +0 -611
- package/dist/badge.js +0 -589
- package/dist/button.cjs +0 -689
- package/dist/button.js +0 -664
- package/dist/checkbox.cjs +0 -265
- package/dist/checkbox.js +0 -241
- package/dist/close-button.cjs +0 -73
- package/dist/close-button.js +0 -51
- package/dist/collapsible.cjs +0 -702
- package/dist/collapsible.js +0 -679
- package/dist/color-mode.cjs +0 -96
- package/dist/color-mode.js +0 -72
- package/dist/dialog.cjs +0 -279
- package/dist/dialog.js +0 -246
- package/dist/drawer.cjs +0 -207
- package/dist/drawer.js +0 -175
- package/dist/empty-state.cjs +0 -93
- package/dist/empty-state.js +0 -71
- package/dist/field.cjs +0 -183
- package/dist/field.js +0 -160
- package/dist/heading.cjs +0 -46
- package/dist/heading.js +0 -40
- package/dist/icon-button.cjs +0 -491
- package/dist/icon-button.js +0 -470
- package/dist/image.cjs +0 -572
- package/dist/image.js +0 -551
- package/dist/index.cjs +0 -5779
- package/dist/input-group.cjs +0 -155
- package/dist/input-group.js +0 -133
- package/dist/input.cjs +0 -65
- package/dist/input.js +0 -59
- package/dist/link.cjs +0 -630
- package/dist/link.js +0 -606
- package/dist/menu.cjs +0 -305
- package/dist/menu.js +0 -269
- package/dist/pin-input.cjs +0 -182
- package/dist/pin-input.js +0 -160
- package/dist/popover.cjs +0 -327
- package/dist/popover.js +0 -294
- package/dist/progress-circle.cjs +0 -152
- package/dist/progress-circle.js +0 -128
- package/dist/progress.cjs +0 -117
- package/dist/progress.js +0 -94
- package/dist/provider.cjs +0 -62
- package/dist/provider.js +0 -40
- package/dist/radio.cjs +0 -177
- package/dist/radio.js +0 -153
- package/dist/rating.cjs +0 -80
- package/dist/rating.js +0 -58
- package/dist/select.cjs +0 -791
- package/dist/select.js +0 -757
- package/dist/separator.cjs +0 -57
- package/dist/separator.js +0 -51
- package/dist/skeleton.cjs +0 -370
- package/dist/skeleton.js +0 -346
- package/dist/slider.cjs +0 -138
- package/dist/slider.js +0 -115
- package/dist/switch.cjs +0 -163
- package/dist/switch.js +0 -140
- package/dist/table.cjs +0 -1044
- package/dist/table.js +0 -1013
- package/dist/tabs.cjs +0 -240
- package/dist/tabs.js +0 -213
- package/dist/tag.cjs +0 -651
- package/dist/tag.js +0 -628
- package/dist/textarea.cjs +0 -65
- package/dist/textarea.js +0 -59
- package/dist/toaster.cjs +0 -99
- package/dist/toaster.js +0 -96
- package/dist/tooltip.cjs +0 -171
- package/dist/tooltip.js +0 -148
- package/dist/utils.cjs +0 -11
- package/dist/utils.js +0 -9
- package/src/accordion.tsx +0 -285
- package/src/alert.tsx +0 -221
- package/src/avatar.tsx +0 -174
- package/src/badge.tsx +0 -158
- package/src/button.tsx +0 -411
- package/src/checkbox.tsx +0 -307
- package/src/close-button.tsx +0 -51
- package/src/collapsible.tsx +0 -126
- package/src/color-mode.tsx +0 -125
- package/src/dialog.tsx +0 -356
- package/src/drawer.tsx +0 -186
- package/src/empty-state.tsx +0 -97
- package/src/field.tsx +0 -202
- package/src/heading.tsx +0 -55
- package/src/icon-button.tsx +0 -192
- package/src/image.tsx +0 -280
- package/src/index.ts +0 -192
- package/src/input-group.tsx +0 -159
- package/src/input.tsx +0 -60
- package/src/link.tsx +0 -326
- package/src/menu.tsx +0 -471
- package/src/pin-input.tsx +0 -187
- package/src/popover.tsx +0 -400
- package/src/progress-circle.tsx +0 -180
- package/src/progress.tsx +0 -109
- package/src/provider.tsx +0 -12
- package/src/radio.tsx +0 -175
- package/src/rating.tsx +0 -79
- package/src/select.tsx +0 -696
- package/src/separator.tsx +0 -59
- package/src/skeleton.tsx +0 -302
- package/src/slider.tsx +0 -152
- package/src/switch.tsx +0 -158
- package/src/table.tsx +0 -621
- package/src/tabs.tsx +0 -354
- package/src/tag.tsx +0 -159
- package/src/textarea.tsx +0 -60
- package/src/toaster.tsx +0 -117
- package/src/tokens.css +0 -438
- package/src/tooltip.tsx +0 -184
- package/src/utils/cn.ts +0 -7
- package/src/utils.ts +0 -6
- package/tokens.css +0 -438
package/dist/popover.js
DELETED
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import * as RadixPopover from '@radix-ui/react-popover';
|
|
3
|
-
import * as React2 from 'react';
|
|
4
|
-
import { clsx } from 'clsx';
|
|
5
|
-
import { twMerge } from 'tailwind-merge';
|
|
6
|
-
import { jsx } from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
// src/popover.tsx
|
|
9
|
-
function cn(...inputs) {
|
|
10
|
-
return twMerge(clsx(inputs));
|
|
11
|
-
}
|
|
12
|
-
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";
|
|
13
|
-
var CloseButton = React2.forwardRef(function CloseButton2(props, ref) {
|
|
14
|
-
const { variant: _variant, size: _size, className, children, ...rest } = props;
|
|
15
|
-
return /* @__PURE__ */ jsx(
|
|
16
|
-
"button",
|
|
17
|
-
{
|
|
18
|
-
type: "button",
|
|
19
|
-
"aria-label": "Close",
|
|
20
|
-
ref,
|
|
21
|
-
className: cn(
|
|
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
|
-
),
|
|
31
|
-
...rest,
|
|
32
|
-
children: children ?? /* @__PURE__ */ jsx(
|
|
33
|
-
"svg",
|
|
34
|
-
{
|
|
35
|
-
className: "size-5",
|
|
36
|
-
viewBox: "0 0 20 20",
|
|
37
|
-
fill: "none",
|
|
38
|
-
"aria-hidden": "true",
|
|
39
|
-
children: /* @__PURE__ */ jsx(
|
|
40
|
-
"path",
|
|
41
|
-
{
|
|
42
|
-
d: CLOSE_ICON_PATH,
|
|
43
|
-
fill: "currentColor"
|
|
44
|
-
}
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
)
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
});
|
|
51
|
-
function parsePlacement(placement) {
|
|
52
|
-
if (!placement) {
|
|
53
|
-
return { side: "bottom", align: "start" };
|
|
54
|
-
}
|
|
55
|
-
const parts = placement.split("-");
|
|
56
|
-
const side = parts[0] ?? "bottom";
|
|
57
|
-
const alignPart = parts[1];
|
|
58
|
-
let align = "center";
|
|
59
|
-
if (alignPart === "start") {
|
|
60
|
-
align = "start";
|
|
61
|
-
} else if (alignPart === "end") {
|
|
62
|
-
align = "end";
|
|
63
|
-
}
|
|
64
|
-
return { side, align };
|
|
65
|
-
}
|
|
66
|
-
var PositioningContext = React2.createContext({
|
|
67
|
-
side: "bottom",
|
|
68
|
-
align: "start",
|
|
69
|
-
sideOffset: 4,
|
|
70
|
-
alignOffset: 0,
|
|
71
|
-
collisionPadding: 4,
|
|
72
|
-
autoFocus: false,
|
|
73
|
-
closeOnInteractOutside: true
|
|
74
|
-
});
|
|
75
|
-
var PopoverRoot = (props) => {
|
|
76
|
-
const {
|
|
77
|
-
children,
|
|
78
|
-
open,
|
|
79
|
-
defaultOpen,
|
|
80
|
-
onOpenChange,
|
|
81
|
-
positioning,
|
|
82
|
-
autoFocus = false,
|
|
83
|
-
closeOnInteractOutside = true,
|
|
84
|
-
modal = false,
|
|
85
|
-
// lazyMount and unmountOnExit are handled via forceMount on Portal/Content
|
|
86
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
87
|
-
lazyMount: _lazyMount,
|
|
88
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
89
|
-
unmountOnExit: _unmountOnExit
|
|
90
|
-
} = props;
|
|
91
|
-
const mergedPositioning = {
|
|
92
|
-
placement: "bottom-start",
|
|
93
|
-
overflowPadding: 4,
|
|
94
|
-
...positioning,
|
|
95
|
-
offset: {
|
|
96
|
-
mainAxis: 4,
|
|
97
|
-
...positioning?.offset
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
const { side, align } = parsePlacement(mergedPositioning.placement);
|
|
101
|
-
const positioningValue = React2.useMemo(() => ({
|
|
102
|
-
side,
|
|
103
|
-
align,
|
|
104
|
-
sideOffset: mergedPositioning.offset?.mainAxis ?? 4,
|
|
105
|
-
alignOffset: mergedPositioning.offset?.crossAxis ?? 0,
|
|
106
|
-
collisionPadding: mergedPositioning.overflowPadding ?? 4,
|
|
107
|
-
autoFocus,
|
|
108
|
-
closeOnInteractOutside
|
|
109
|
-
}), [
|
|
110
|
-
side,
|
|
111
|
-
align,
|
|
112
|
-
mergedPositioning.offset?.mainAxis,
|
|
113
|
-
mergedPositioning.offset?.crossAxis,
|
|
114
|
-
mergedPositioning.overflowPadding,
|
|
115
|
-
autoFocus,
|
|
116
|
-
closeOnInteractOutside
|
|
117
|
-
]);
|
|
118
|
-
const handleOpenChange = React2.useCallback((isOpen) => {
|
|
119
|
-
onOpenChange?.({ open: isOpen });
|
|
120
|
-
}, [onOpenChange]);
|
|
121
|
-
return /* @__PURE__ */ jsx(PositioningContext.Provider, { value: positioningValue, children: /* @__PURE__ */ jsx(
|
|
122
|
-
RadixPopover.Root,
|
|
123
|
-
{
|
|
124
|
-
open,
|
|
125
|
-
defaultOpen,
|
|
126
|
-
onOpenChange: handleOpenChange,
|
|
127
|
-
modal,
|
|
128
|
-
children
|
|
129
|
-
}
|
|
130
|
-
) });
|
|
131
|
-
};
|
|
132
|
-
var PopoverTrigger = React2.forwardRef(function PopoverTrigger2(props, ref) {
|
|
133
|
-
const { asChild = true, ...rest } = props;
|
|
134
|
-
return /* @__PURE__ */ jsx(RadixPopover.Trigger, { asChild, ref, ...rest });
|
|
135
|
-
});
|
|
136
|
-
var PopoverContent = React2.forwardRef(function PopoverContent2(props, ref) {
|
|
137
|
-
const { portalled = true, portalRef, className, w, minW, maxW, paddingTop, style: styleProp, ...rest } = props;
|
|
138
|
-
const resolvedW = typeof w === "object" ? w.base ?? w.lg : w;
|
|
139
|
-
const contentStyle = {
|
|
140
|
-
...styleProp,
|
|
141
|
-
...resolvedW ? { width: resolvedW } : {},
|
|
142
|
-
...minW ? { minWidth: minW } : {},
|
|
143
|
-
...maxW ? { maxWidth: maxW } : {},
|
|
144
|
-
...paddingTop !== void 0 ? { paddingTop: typeof paddingTop === "number" ? `${paddingTop * 4}px` : paddingTop } : {}
|
|
145
|
-
};
|
|
146
|
-
const positioning = React2.useContext(PositioningContext);
|
|
147
|
-
const preventFocus = React2.useCallback((e) => e.preventDefault(), []);
|
|
148
|
-
const preventInteract = React2.useCallback((e) => e.preventDefault(), []);
|
|
149
|
-
const content = /* @__PURE__ */ jsx(
|
|
150
|
-
RadixPopover.Content,
|
|
151
|
-
{
|
|
152
|
-
ref,
|
|
153
|
-
side: positioning.side,
|
|
154
|
-
align: positioning.align,
|
|
155
|
-
sideOffset: positioning.sideOffset,
|
|
156
|
-
alignOffset: positioning.alignOffset,
|
|
157
|
-
collisionPadding: positioning.collisionPadding,
|
|
158
|
-
onOpenAutoFocus: positioning.autoFocus ? void 0 : preventFocus,
|
|
159
|
-
onInteractOutside: positioning.closeOnInteractOutside ? void 0 : preventInteract,
|
|
160
|
-
className: cn(
|
|
161
|
-
"z-50 rounded-lg border border-[var(--color-popover-border,var(--color-border-divider))]",
|
|
162
|
-
"bg-[var(--color-popover-bg,var(--color-dialog-bg))]",
|
|
163
|
-
"shadow-[var(--shadow-popover,var(--shadow-lg))]",
|
|
164
|
-
"outline-none",
|
|
165
|
-
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
166
|
-
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
167
|
-
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
|
|
168
|
-
"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
169
|
-
className
|
|
170
|
-
),
|
|
171
|
-
style: Object.keys(contentStyle).length > 0 ? contentStyle : void 0,
|
|
172
|
-
...rest
|
|
173
|
-
}
|
|
174
|
-
);
|
|
175
|
-
if (!portalled) {
|
|
176
|
-
return content;
|
|
177
|
-
}
|
|
178
|
-
return /* @__PURE__ */ jsx(RadixPopover.Portal, { container: portalRef?.current ?? void 0, children: content });
|
|
179
|
-
});
|
|
180
|
-
var PopoverArrow = React2.forwardRef(function PopoverArrow2(props, ref) {
|
|
181
|
-
const { className, ...rest } = props;
|
|
182
|
-
return /* @__PURE__ */ jsx(
|
|
183
|
-
RadixPopover.Arrow,
|
|
184
|
-
{
|
|
185
|
-
ref,
|
|
186
|
-
className: cn("fill-[var(--color-popover-bg,var(--color-dialog-bg))]", className),
|
|
187
|
-
...rest
|
|
188
|
-
}
|
|
189
|
-
);
|
|
190
|
-
});
|
|
191
|
-
var PopoverCloseTrigger = React2.forwardRef(function PopoverCloseTrigger2(props, ref) {
|
|
192
|
-
const { className, ...rest } = props;
|
|
193
|
-
return /* @__PURE__ */ jsx(
|
|
194
|
-
RadixPopover.Close,
|
|
195
|
-
{
|
|
196
|
-
className: cn("absolute top-1 right-1", className),
|
|
197
|
-
...rest,
|
|
198
|
-
asChild: true,
|
|
199
|
-
ref,
|
|
200
|
-
children: /* @__PURE__ */ jsx(CloseButton, {})
|
|
201
|
-
}
|
|
202
|
-
);
|
|
203
|
-
});
|
|
204
|
-
var PopoverCloseTriggerWrapper = React2.forwardRef(function PopoverCloseTriggerWrapper2(props, ref) {
|
|
205
|
-
const { disabled, children, ...rest } = props;
|
|
206
|
-
if (disabled) {
|
|
207
|
-
return children;
|
|
208
|
-
}
|
|
209
|
-
return /* @__PURE__ */ jsx(RadixPopover.Close, { ref, ...rest, asChild: true, children });
|
|
210
|
-
});
|
|
211
|
-
var PopoverBody = React2.forwardRef(function PopoverBody2(props, ref) {
|
|
212
|
-
const {
|
|
213
|
-
className,
|
|
214
|
-
style: styleProp,
|
|
215
|
-
display: _display,
|
|
216
|
-
flexDir: _flexDir,
|
|
217
|
-
rowGap: _rowGap,
|
|
218
|
-
px: _px,
|
|
219
|
-
py: _py,
|
|
220
|
-
textStyle: _textStyle,
|
|
221
|
-
alignItems: _alignItems,
|
|
222
|
-
...rest
|
|
223
|
-
} = props;
|
|
224
|
-
const bodyStyle = {
|
|
225
|
-
...styleProp,
|
|
226
|
-
..._display ? { display: _display } : {},
|
|
227
|
-
..._flexDir ? { flexDirection: _flexDir } : {},
|
|
228
|
-
..._rowGap !== void 0 ? { rowGap: typeof _rowGap === "number" ? `${_rowGap * 4}px` : _rowGap } : {},
|
|
229
|
-
..._px !== void 0 ? {
|
|
230
|
-
paddingLeft: typeof _px === "number" ? `${_px * 4}px` : _px,
|
|
231
|
-
paddingRight: typeof _px === "number" ? `${_px * 4}px` : _px
|
|
232
|
-
} : {},
|
|
233
|
-
..._py !== void 0 ? {
|
|
234
|
-
paddingTop: typeof _py === "number" ? `${_py * 4}px` : _py,
|
|
235
|
-
paddingBottom: typeof _py === "number" ? `${_py * 4}px` : _py
|
|
236
|
-
} : {},
|
|
237
|
-
..._alignItems ? { alignItems: _alignItems } : {}
|
|
238
|
-
};
|
|
239
|
-
return /* @__PURE__ */ jsx(
|
|
240
|
-
"div",
|
|
241
|
-
{
|
|
242
|
-
ref,
|
|
243
|
-
className: cn("p-4", className),
|
|
244
|
-
style: Object.keys(bodyStyle).length > 0 ? bodyStyle : void 0,
|
|
245
|
-
...rest
|
|
246
|
-
}
|
|
247
|
-
);
|
|
248
|
-
});
|
|
249
|
-
var PopoverHeader = React2.forwardRef(function PopoverHeader2(props, ref) {
|
|
250
|
-
const { className, ...rest } = props;
|
|
251
|
-
return /* @__PURE__ */ jsx(
|
|
252
|
-
"div",
|
|
253
|
-
{
|
|
254
|
-
ref,
|
|
255
|
-
className: cn("px-4 pt-4 pb-0 font-semibold", className),
|
|
256
|
-
...rest
|
|
257
|
-
}
|
|
258
|
-
);
|
|
259
|
-
});
|
|
260
|
-
var PopoverFooter = React2.forwardRef(function PopoverFooter2(props, ref) {
|
|
261
|
-
const { className, ...rest } = props;
|
|
262
|
-
return /* @__PURE__ */ jsx(
|
|
263
|
-
"div",
|
|
264
|
-
{
|
|
265
|
-
ref,
|
|
266
|
-
className: cn("px-4 pb-4 pt-0", className),
|
|
267
|
-
...rest
|
|
268
|
-
}
|
|
269
|
-
);
|
|
270
|
-
});
|
|
271
|
-
var PopoverTitle = React2.forwardRef(function PopoverTitle2(props, ref) {
|
|
272
|
-
const { className, ...rest } = props;
|
|
273
|
-
return /* @__PURE__ */ jsx(
|
|
274
|
-
"h3",
|
|
275
|
-
{
|
|
276
|
-
ref,
|
|
277
|
-
className: cn("text-base font-semibold", className),
|
|
278
|
-
...rest
|
|
279
|
-
}
|
|
280
|
-
);
|
|
281
|
-
});
|
|
282
|
-
var PopoverDescription = React2.forwardRef(function PopoverDescription2(props, ref) {
|
|
283
|
-
const { className, ...rest } = props;
|
|
284
|
-
return /* @__PURE__ */ jsx(
|
|
285
|
-
"p",
|
|
286
|
-
{
|
|
287
|
-
ref,
|
|
288
|
-
className: cn("text-sm", className),
|
|
289
|
-
...rest
|
|
290
|
-
}
|
|
291
|
-
);
|
|
292
|
-
});
|
|
293
|
-
|
|
294
|
-
export { PopoverArrow, PopoverBody, PopoverCloseTrigger, PopoverCloseTriggerWrapper, PopoverContent, PopoverDescription, PopoverFooter, PopoverHeader, PopoverRoot, PopoverTitle, PopoverTrigger };
|
package/dist/progress-circle.cjs
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var clsx = require('clsx');
|
|
6
|
-
var tailwindMerge = require('tailwind-merge');
|
|
7
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
-
|
|
9
|
-
function _interopNamespace(e) {
|
|
10
|
-
if (e && e.__esModule) return e;
|
|
11
|
-
var n = Object.create(null);
|
|
12
|
-
if (e) {
|
|
13
|
-
Object.keys(e).forEach(function (k) {
|
|
14
|
-
if (k !== 'default') {
|
|
15
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function () { return e[k]; }
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
n.default = e;
|
|
24
|
-
return Object.freeze(n);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
28
|
-
|
|
29
|
-
// src/progress-circle.tsx
|
|
30
|
-
function cn(...inputs) {
|
|
31
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
32
|
-
}
|
|
33
|
-
var SIZE_MAP = {
|
|
34
|
-
xs: { size: 24, thickness: 4, textClass: "text-[10px]" },
|
|
35
|
-
sm: { size: 32, thickness: 5, textClass: "text-[10px]" },
|
|
36
|
-
md: { size: 40, thickness: 6, textClass: "text-xs" },
|
|
37
|
-
lg: { size: 48, thickness: 7, textClass: "text-sm" },
|
|
38
|
-
xl: { size: 64, thickness: 8, textClass: "text-sm" }
|
|
39
|
-
};
|
|
40
|
-
var Ctx = React__namespace.createContext({
|
|
41
|
-
value: 0,
|
|
42
|
-
size: "md",
|
|
43
|
-
colorPalette: "blue"
|
|
44
|
-
});
|
|
45
|
-
var ProgressCircleRoot = React__namespace.forwardRef(function ProgressCircleRoot2(props, ref) {
|
|
46
|
-
const {
|
|
47
|
-
value = 0,
|
|
48
|
-
size = "md",
|
|
49
|
-
colorPalette = "blue",
|
|
50
|
-
className,
|
|
51
|
-
children,
|
|
52
|
-
...rest
|
|
53
|
-
} = props;
|
|
54
|
-
const ctx = React__namespace.useMemo(
|
|
55
|
-
() => ({ value: value ?? null, size, colorPalette }),
|
|
56
|
-
[value, size, colorPalette]
|
|
57
|
-
);
|
|
58
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Ctx.Provider, { value: ctx, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
59
|
-
"div",
|
|
60
|
-
{
|
|
61
|
-
ref,
|
|
62
|
-
role: "progressbar",
|
|
63
|
-
"aria-valuenow": value ?? void 0,
|
|
64
|
-
"aria-valuemin": 0,
|
|
65
|
-
"aria-valuemax": 100,
|
|
66
|
-
className: cn("relative inline-flex text-sm", className),
|
|
67
|
-
...rest,
|
|
68
|
-
children
|
|
69
|
-
}
|
|
70
|
-
) });
|
|
71
|
-
});
|
|
72
|
-
var ProgressCircleRing = React__namespace.forwardRef(function ProgressCircleRing2(props, ref) {
|
|
73
|
-
const { trackColor, cap, color, className, ...rest } = props;
|
|
74
|
-
const { value, size: sizeKey } = React__namespace.useContext(Ctx);
|
|
75
|
-
const { size, thickness } = SIZE_MAP[sizeKey];
|
|
76
|
-
const radius = size / 2 - thickness / 2;
|
|
77
|
-
const circumference = 2 * Math.PI * radius;
|
|
78
|
-
const percent = value ?? 0;
|
|
79
|
-
const offset = circumference * ((100 - percent) / 100);
|
|
80
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
81
|
-
"svg",
|
|
82
|
-
{
|
|
83
|
-
ref,
|
|
84
|
-
width: size,
|
|
85
|
-
height: size,
|
|
86
|
-
viewBox: `0 0 ${size} ${size}`,
|
|
87
|
-
className: cn(
|
|
88
|
-
value === null && "animate-spin",
|
|
89
|
-
className
|
|
90
|
-
),
|
|
91
|
-
...rest,
|
|
92
|
-
children: [
|
|
93
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
94
|
-
"circle",
|
|
95
|
-
{
|
|
96
|
-
cx: size / 2,
|
|
97
|
-
cy: size / 2,
|
|
98
|
-
r: radius,
|
|
99
|
-
fill: "transparent",
|
|
100
|
-
strokeWidth: thickness,
|
|
101
|
-
stroke: trackColor ?? "currentColor",
|
|
102
|
-
className: !trackColor ? "opacity-20" : void 0
|
|
103
|
-
}
|
|
104
|
-
),
|
|
105
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
106
|
-
"circle",
|
|
107
|
-
{
|
|
108
|
-
cx: size / 2,
|
|
109
|
-
cy: size / 2,
|
|
110
|
-
r: radius,
|
|
111
|
-
fill: "transparent",
|
|
112
|
-
strokeWidth: thickness,
|
|
113
|
-
stroke: color ?? "currentColor",
|
|
114
|
-
strokeLinecap: cap,
|
|
115
|
-
strokeDasharray: circumference,
|
|
116
|
-
strokeDashoffset: offset,
|
|
117
|
-
style: {
|
|
118
|
-
transformOrigin: "center",
|
|
119
|
-
transform: "rotate(-90deg)",
|
|
120
|
-
transition: "stroke-dashoffset 0.6s, stroke-dasharray 0.6s",
|
|
121
|
-
opacity: percent === 0 ? 0 : void 0
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
)
|
|
125
|
-
]
|
|
126
|
-
}
|
|
127
|
-
);
|
|
128
|
-
});
|
|
129
|
-
var ProgressCircleValueText = React__namespace.forwardRef(function ProgressCircleValueText2(props, ref) {
|
|
130
|
-
const { className, children, ...rest } = props;
|
|
131
|
-
const { value, size: sizeKey } = React__namespace.useContext(Ctx);
|
|
132
|
-
const { textClass } = SIZE_MAP[sizeKey];
|
|
133
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
134
|
-
"div",
|
|
135
|
-
{
|
|
136
|
-
ref,
|
|
137
|
-
"aria-live": "polite",
|
|
138
|
-
className: cn(
|
|
139
|
-
"absolute inset-0 flex items-center justify-center",
|
|
140
|
-
"font-medium tracking-tight tabular-nums leading-none",
|
|
141
|
-
textClass,
|
|
142
|
-
className
|
|
143
|
-
),
|
|
144
|
-
...rest,
|
|
145
|
-
children: children ?? `${Math.round(value ?? 0)}%`
|
|
146
|
-
}
|
|
147
|
-
);
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
exports.ProgressCircleRing = ProgressCircleRing;
|
|
151
|
-
exports.ProgressCircleRoot = ProgressCircleRoot;
|
|
152
|
-
exports.ProgressCircleValueText = ProgressCircleValueText;
|
package/dist/progress-circle.js
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { clsx } from 'clsx';
|
|
4
|
-
import { twMerge } from 'tailwind-merge';
|
|
5
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
// src/progress-circle.tsx
|
|
8
|
-
function cn(...inputs) {
|
|
9
|
-
return twMerge(clsx(inputs));
|
|
10
|
-
}
|
|
11
|
-
var SIZE_MAP = {
|
|
12
|
-
xs: { size: 24, thickness: 4, textClass: "text-[10px]" },
|
|
13
|
-
sm: { size: 32, thickness: 5, textClass: "text-[10px]" },
|
|
14
|
-
md: { size: 40, thickness: 6, textClass: "text-xs" },
|
|
15
|
-
lg: { size: 48, thickness: 7, textClass: "text-sm" },
|
|
16
|
-
xl: { size: 64, thickness: 8, textClass: "text-sm" }
|
|
17
|
-
};
|
|
18
|
-
var Ctx = React.createContext({
|
|
19
|
-
value: 0,
|
|
20
|
-
size: "md",
|
|
21
|
-
colorPalette: "blue"
|
|
22
|
-
});
|
|
23
|
-
var ProgressCircleRoot = React.forwardRef(function ProgressCircleRoot2(props, ref) {
|
|
24
|
-
const {
|
|
25
|
-
value = 0,
|
|
26
|
-
size = "md",
|
|
27
|
-
colorPalette = "blue",
|
|
28
|
-
className,
|
|
29
|
-
children,
|
|
30
|
-
...rest
|
|
31
|
-
} = props;
|
|
32
|
-
const ctx = React.useMemo(
|
|
33
|
-
() => ({ value: value ?? null, size, colorPalette }),
|
|
34
|
-
[value, size, colorPalette]
|
|
35
|
-
);
|
|
36
|
-
return /* @__PURE__ */ jsx(Ctx.Provider, { value: ctx, children: /* @__PURE__ */ jsx(
|
|
37
|
-
"div",
|
|
38
|
-
{
|
|
39
|
-
ref,
|
|
40
|
-
role: "progressbar",
|
|
41
|
-
"aria-valuenow": value ?? void 0,
|
|
42
|
-
"aria-valuemin": 0,
|
|
43
|
-
"aria-valuemax": 100,
|
|
44
|
-
className: cn("relative inline-flex text-sm", className),
|
|
45
|
-
...rest,
|
|
46
|
-
children
|
|
47
|
-
}
|
|
48
|
-
) });
|
|
49
|
-
});
|
|
50
|
-
var ProgressCircleRing = React.forwardRef(function ProgressCircleRing2(props, ref) {
|
|
51
|
-
const { trackColor, cap, color, className, ...rest } = props;
|
|
52
|
-
const { value, size: sizeKey } = React.useContext(Ctx);
|
|
53
|
-
const { size, thickness } = SIZE_MAP[sizeKey];
|
|
54
|
-
const radius = size / 2 - thickness / 2;
|
|
55
|
-
const circumference = 2 * Math.PI * radius;
|
|
56
|
-
const percent = value ?? 0;
|
|
57
|
-
const offset = circumference * ((100 - percent) / 100);
|
|
58
|
-
return /* @__PURE__ */ jsxs(
|
|
59
|
-
"svg",
|
|
60
|
-
{
|
|
61
|
-
ref,
|
|
62
|
-
width: size,
|
|
63
|
-
height: size,
|
|
64
|
-
viewBox: `0 0 ${size} ${size}`,
|
|
65
|
-
className: cn(
|
|
66
|
-
value === null && "animate-spin",
|
|
67
|
-
className
|
|
68
|
-
),
|
|
69
|
-
...rest,
|
|
70
|
-
children: [
|
|
71
|
-
/* @__PURE__ */ jsx(
|
|
72
|
-
"circle",
|
|
73
|
-
{
|
|
74
|
-
cx: size / 2,
|
|
75
|
-
cy: size / 2,
|
|
76
|
-
r: radius,
|
|
77
|
-
fill: "transparent",
|
|
78
|
-
strokeWidth: thickness,
|
|
79
|
-
stroke: trackColor ?? "currentColor",
|
|
80
|
-
className: !trackColor ? "opacity-20" : void 0
|
|
81
|
-
}
|
|
82
|
-
),
|
|
83
|
-
/* @__PURE__ */ jsx(
|
|
84
|
-
"circle",
|
|
85
|
-
{
|
|
86
|
-
cx: size / 2,
|
|
87
|
-
cy: size / 2,
|
|
88
|
-
r: radius,
|
|
89
|
-
fill: "transparent",
|
|
90
|
-
strokeWidth: thickness,
|
|
91
|
-
stroke: color ?? "currentColor",
|
|
92
|
-
strokeLinecap: cap,
|
|
93
|
-
strokeDasharray: circumference,
|
|
94
|
-
strokeDashoffset: offset,
|
|
95
|
-
style: {
|
|
96
|
-
transformOrigin: "center",
|
|
97
|
-
transform: "rotate(-90deg)",
|
|
98
|
-
transition: "stroke-dashoffset 0.6s, stroke-dasharray 0.6s",
|
|
99
|
-
opacity: percent === 0 ? 0 : void 0
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
)
|
|
103
|
-
]
|
|
104
|
-
}
|
|
105
|
-
);
|
|
106
|
-
});
|
|
107
|
-
var ProgressCircleValueText = React.forwardRef(function ProgressCircleValueText2(props, ref) {
|
|
108
|
-
const { className, children, ...rest } = props;
|
|
109
|
-
const { value, size: sizeKey } = React.useContext(Ctx);
|
|
110
|
-
const { textClass } = SIZE_MAP[sizeKey];
|
|
111
|
-
return /* @__PURE__ */ jsx(
|
|
112
|
-
"div",
|
|
113
|
-
{
|
|
114
|
-
ref,
|
|
115
|
-
"aria-live": "polite",
|
|
116
|
-
className: cn(
|
|
117
|
-
"absolute inset-0 flex items-center justify-center",
|
|
118
|
-
"font-medium tracking-tight tabular-nums leading-none",
|
|
119
|
-
textClass,
|
|
120
|
-
className
|
|
121
|
-
),
|
|
122
|
-
...rest,
|
|
123
|
-
children: children ?? `${Math.round(value ?? 0)}%`
|
|
124
|
-
}
|
|
125
|
-
);
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
export { ProgressCircleRing, ProgressCircleRoot, ProgressCircleValueText };
|
package/dist/progress.cjs
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
var RadixProgress = require('@radix-ui/react-progress');
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var clsx = require('clsx');
|
|
7
|
-
var tailwindMerge = require('tailwind-merge');
|
|
8
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
-
|
|
10
|
-
function _interopNamespace(e) {
|
|
11
|
-
if (e && e.__esModule) return e;
|
|
12
|
-
var n = Object.create(null);
|
|
13
|
-
if (e) {
|
|
14
|
-
Object.keys(e).forEach(function (k) {
|
|
15
|
-
if (k !== 'default') {
|
|
16
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
17
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function () { return e[k]; }
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
n.default = e;
|
|
25
|
-
return Object.freeze(n);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
var RadixProgress__namespace = /*#__PURE__*/_interopNamespace(RadixProgress);
|
|
29
|
-
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
30
|
-
|
|
31
|
-
// src/progress.tsx
|
|
32
|
-
function cn(...inputs) {
|
|
33
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
34
|
-
}
|
|
35
|
-
var SIZE_CLASSES = {
|
|
36
|
-
sm: "h-1",
|
|
37
|
-
md: "h-2",
|
|
38
|
-
lg: "h-3",
|
|
39
|
-
xl: "h-4"
|
|
40
|
-
};
|
|
41
|
-
function normalizeValue(value, min, max) {
|
|
42
|
-
if (value == null) return 0;
|
|
43
|
-
if (max <= min) return 0;
|
|
44
|
-
return Math.round((value - min) / (max - min) * 100);
|
|
45
|
-
}
|
|
46
|
-
var Progress = React__namespace.forwardRef(
|
|
47
|
-
function Progress2(props, ref) {
|
|
48
|
-
const {
|
|
49
|
-
value,
|
|
50
|
-
min = 0,
|
|
51
|
-
max = 100,
|
|
52
|
-
size = "md",
|
|
53
|
-
color,
|
|
54
|
-
trackProps,
|
|
55
|
-
className,
|
|
56
|
-
style,
|
|
57
|
-
w,
|
|
58
|
-
flex,
|
|
59
|
-
...rest
|
|
60
|
-
} = props;
|
|
61
|
-
const percent = normalizeValue(value, min, max);
|
|
62
|
-
const trackStyle = {
|
|
63
|
-
...trackProps?.style,
|
|
64
|
-
...trackProps?.borderStartRadius !== void 0 && {
|
|
65
|
-
borderStartStartRadius: trackProps.borderStartRadius,
|
|
66
|
-
borderEndStartRadius: trackProps.borderStartRadius
|
|
67
|
-
},
|
|
68
|
-
...trackProps?.borderEndRadius !== void 0 && {
|
|
69
|
-
borderStartEndRadius: trackProps.borderEndRadius,
|
|
70
|
-
borderEndEndRadius: trackProps.borderEndRadius
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
const rootStyle = {
|
|
74
|
-
...style,
|
|
75
|
-
...w !== void 0 && { width: w === "full" ? "100%" : w },
|
|
76
|
-
...flex !== void 0 && { flex }
|
|
77
|
-
};
|
|
78
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
79
|
-
"div",
|
|
80
|
-
{
|
|
81
|
-
ref,
|
|
82
|
-
className: cn("relative", className),
|
|
83
|
-
style: rootStyle,
|
|
84
|
-
...rest,
|
|
85
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
86
|
-
RadixProgress__namespace.Root,
|
|
87
|
-
{
|
|
88
|
-
value: percent,
|
|
89
|
-
max: 100,
|
|
90
|
-
className: cn(
|
|
91
|
-
"w-full overflow-hidden rounded-full",
|
|
92
|
-
"bg-[var(--color-progress-track)]",
|
|
93
|
-
SIZE_CLASSES[size],
|
|
94
|
-
trackProps?.className
|
|
95
|
-
),
|
|
96
|
-
style: trackStyle,
|
|
97
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
98
|
-
RadixProgress__namespace.Indicator,
|
|
99
|
-
{
|
|
100
|
-
className: cn(
|
|
101
|
-
"h-full rounded-full transition-transform duration-500 ease-out",
|
|
102
|
-
!color && "bg-[var(--color-progress-indicator)]"
|
|
103
|
-
),
|
|
104
|
-
style: {
|
|
105
|
-
width: `${percent}%`,
|
|
106
|
-
...color && { backgroundColor: `var(--color-${color.replace(".", "-")}, ${color})` }
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
)
|
|
110
|
-
}
|
|
111
|
-
)
|
|
112
|
-
}
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
);
|
|
116
|
-
|
|
117
|
-
exports.Progress = Progress;
|