@luxfi/ui 5.5.3 → 5.6.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/accordion.cjs +213 -0
- package/dist/accordion.js +186 -0
- package/dist/alert.cjs +553 -0
- package/dist/alert.js +531 -0
- package/dist/avatar.cjs +149 -0
- package/dist/avatar.js +125 -0
- package/dist/badge.cjs +611 -0
- package/dist/badge.js +589 -0
- package/dist/button.cjs +689 -0
- package/dist/button.js +664 -0
- package/dist/checkbox.cjs +265 -0
- package/dist/checkbox.js +241 -0
- package/dist/close-button.cjs +73 -0
- package/dist/close-button.js +51 -0
- package/dist/collapsible.cjs +702 -0
- package/dist/collapsible.js +679 -0
- package/dist/color-mode.cjs +96 -0
- package/dist/color-mode.js +72 -0
- package/dist/dialog.cjs +279 -0
- package/dist/dialog.js +246 -0
- package/dist/drawer.cjs +207 -0
- package/dist/drawer.js +175 -0
- package/dist/empty-state.cjs +93 -0
- package/dist/empty-state.js +71 -0
- package/dist/field.cjs +183 -0
- package/dist/field.js +160 -0
- package/dist/heading.cjs +46 -0
- package/dist/heading.js +40 -0
- package/dist/icon-button.cjs +491 -0
- package/dist/icon-button.js +470 -0
- package/dist/image.cjs +572 -0
- package/dist/image.js +551 -0
- package/dist/index.cjs +5779 -0
- package/dist/index.js +5619 -0
- package/dist/input-group.cjs +155 -0
- package/dist/input-group.js +133 -0
- package/dist/input.cjs +65 -0
- package/dist/input.js +59 -0
- package/dist/link.cjs +630 -0
- package/dist/link.js +606 -0
- package/dist/menu.cjs +305 -0
- package/dist/menu.js +269 -0
- package/dist/pin-input.cjs +182 -0
- package/dist/pin-input.js +160 -0
- package/dist/popover.cjs +327 -0
- package/dist/popover.js +294 -0
- package/dist/progress-circle.cjs +152 -0
- package/dist/progress-circle.js +128 -0
- package/dist/progress.cjs +117 -0
- package/dist/progress.js +94 -0
- package/dist/provider.cjs +62 -0
- package/dist/provider.js +40 -0
- package/dist/radio.cjs +177 -0
- package/dist/radio.js +153 -0
- package/dist/rating.cjs +80 -0
- package/dist/rating.js +58 -0
- package/dist/select.cjs +791 -0
- package/dist/select.js +757 -0
- package/dist/separator.cjs +57 -0
- package/dist/separator.js +51 -0
- package/dist/skeleton.cjs +370 -0
- package/dist/skeleton.js +346 -0
- package/dist/slider.cjs +138 -0
- package/dist/slider.js +115 -0
- package/dist/switch.cjs +163 -0
- package/dist/switch.js +140 -0
- package/dist/table.cjs +1044 -0
- package/dist/table.js +1013 -0
- package/dist/tabs.cjs +240 -0
- package/dist/tabs.js +213 -0
- package/dist/tag.cjs +651 -0
- package/dist/tag.js +628 -0
- package/dist/textarea.cjs +65 -0
- package/dist/textarea.js +59 -0
- package/dist/toaster.cjs +99 -0
- package/dist/toaster.js +96 -0
- package/dist/tooltip.cjs +171 -0
- package/dist/tooltip.js +148 -0
- package/dist/utils.cjs +11 -0
- package/dist/utils.js +9 -0
- package/package.json +270 -65
- package/src/accordion.tsx +285 -0
- package/src/alert.tsx +221 -0
- package/src/avatar.tsx +174 -0
- package/src/badge.tsx +158 -0
- package/src/button.tsx +411 -0
- package/src/checkbox.tsx +307 -0
- package/src/close-button.tsx +51 -0
- package/src/collapsible.tsx +126 -0
- package/src/color-mode.tsx +125 -0
- package/src/dialog.tsx +356 -0
- package/src/drawer.tsx +186 -0
- package/src/empty-state.tsx +97 -0
- package/src/field.tsx +202 -0
- package/src/heading.tsx +55 -0
- package/src/icon-button.tsx +192 -0
- package/src/image.tsx +280 -0
- package/src/index.ts +192 -0
- package/src/input-group.tsx +159 -0
- package/src/input.tsx +60 -0
- package/src/link.tsx +326 -0
- package/src/menu.tsx +471 -0
- package/src/pin-input.tsx +187 -0
- package/src/popover.tsx +400 -0
- package/src/progress-circle.tsx +180 -0
- package/src/progress.tsx +109 -0
- package/src/provider.tsx +12 -0
- package/src/radio.tsx +175 -0
- package/src/rating.tsx +79 -0
- package/src/select.tsx +696 -0
- package/src/separator.tsx +59 -0
- package/src/skeleton.tsx +302 -0
- package/src/slider.tsx +152 -0
- package/src/switch.tsx +158 -0
- package/src/table.tsx +621 -0
- package/src/tabs.tsx +354 -0
- package/src/tag.tsx +159 -0
- package/src/textarea.tsx +60 -0
- package/src/toaster.tsx +117 -0
- package/src/tokens.css +438 -0
- package/src/tooltip.tsx +184 -0
- package/src/utils/cn.ts +7 -0
- package/src/utils.ts +6 -0
- package/tokens.css +438 -0
- package/commerce/ui/conf.ts +0 -13
- package/commerce/ui/context.tsx +0 -123
- package/commerce/ui/store.ts +0 -295
- package/components/access-code-input.tsx +0 -71
- package/components/analytics.tsx +0 -23
- package/components/auth/auth-listener.tsx +0 -29
- package/components/auth/auth-token/clear-auth-token.tsx +0 -12
- package/components/auth/auth-token/set-auth-token.tsx +0 -16
- package/components/auth/common-auth-domains.ts +0 -17
- package/components/auth/login-panel.tsx +0 -111
- package/components/auth/mobile-login-button.tsx +0 -107
- package/components/auth/signup-panel.tsx +0 -113
- package/components/back-button.tsx +0 -49
- package/components/chat-widget.tsx +0 -85
- package/components/commerce/bag-button.tsx +0 -98
- package/components/commerce/buy-button.tsx +0 -34
- package/components/commerce/checkout-button.tsx +0 -129
- package/components/commerce/checkout-panel/cart-accordian.tsx +0 -66
- package/components/commerce/checkout-panel/checkout-panel-props.ts +0 -10
- package/components/commerce/checkout-panel/desktop-bag-carousel.tsx +0 -36
- package/components/commerce/checkout-panel/desktop-cp.tsx +0 -83
- package/components/commerce/checkout-panel/index.tsx +0 -126
- package/components/commerce/checkout-panel/mobile-cp.tsx +0 -67
- package/components/commerce/checkout-panel/policy-links.tsx +0 -29
- package/components/commerce/checkout-panel/steps-indicator.tsx +0 -39
- package/components/commerce/checkout-panel/thank-you.tsx +0 -18
- package/components/commerce/desktop-bag-popup.tsx +0 -78
- package/components/commerce/drawer/index.tsx +0 -88
- package/components/commerce/drawer/micro.tsx +0 -145
- package/components/commerce/drawer/shell.tsx +0 -85
- package/components/contact-dialog/contact-form.tsx +0 -116
- package/components/contact-dialog/disclaimer.tsx +0 -13
- package/components/contact-dialog/index.tsx +0 -64
- package/components/copyright.tsx +0 -21
- package/components/drawer-margin.tsx +0 -28
- package/components/footer.tsx +0 -78
- package/components/header/desktop-nav-menu.tsx +0 -204
- package/components/header/desktop.tsx +0 -65
- package/components/header/index.tsx +0 -50
- package/components/header/mobile-bag-drawer.tsx +0 -51
- package/components/header/mobile-menu-toggle-button.tsx +0 -35
- package/components/header/mobile-nav-menu-ai.tsx +0 -51
- package/components/header/mobile-nav-menu-item.tsx +0 -47
- package/components/header/mobile-nav-menu.tsx +0 -102
- package/components/header/mobile.tsx +0 -170
- package/components/header/theme-toggle.tsx +0 -26
- package/components/icons/avatar.tsx +0 -11
- package/components/icons/bag-icon.tsx +0 -10
- package/components/icons/index.ts +0 -6
- package/components/icons/left-arrow.tsx +0 -11
- package/components/icons/lux-logo.tsx +0 -10
- package/components/icons/right-arrow.tsx +0 -10
- package/components/icons/social-icon.tsx +0 -35
- package/components/icons/social-svg.css +0 -3
- package/components/index.ts +0 -26
- package/components/logo.tsx +0 -92
- package/components/main.tsx +0 -27
- package/components/mini-chart/index.tsx +0 -8
- package/components/mini-chart/mini-chart-props.ts +0 -44
- package/components/mini-chart/mini-chart.tsx +0 -85
- package/components/mini-chart/wrapper.tsx +0 -23
- package/components/not-found/index.tsx +0 -28
- package/components/not-found/not-found-content.mdx +0 -5
- package/components/tooltip.tsx +0 -31
- package/environment.d.ts +0 -6
- package/next/analytics/fpixel.ts +0 -16
- package/next/analytics/google-analytics.ts +0 -14
- package/next/analytics/index.ts +0 -3
- package/next/analytics/pixel-analytics.tsx +0 -55
- package/next/font/get-app-router-font-classes.ts +0 -17
- package/next/font/load-and-return-lux-next-fonts-on-import.ts +0 -68
- package/next/font/local/Druk-Wide-Bold.ttf +0 -0
- package/next/font/local/Druk-Wide-Medium.ttf +0 -0
- package/next/font/local/InterVariable-Italic.ttf +0 -0
- package/next/font/local/InterVariable-Italic.woff2 +0 -0
- package/next/font/local/InterVariable.ttf +0 -0
- package/next/font/local/InterVariable.woff2 +0 -0
- package/next/font/next-font-desc.ts +0 -28
- package/next/font/pages-router-font-vars.tsx +0 -18
- package/next/head-metadata/from-next/metadata-types.ts +0 -158
- package/next/head-metadata/from-next/opengraph-types.ts +0 -267
- package/next/head-metadata/from-next/twitter-types.ts +0 -92
- package/next/head-metadata/index.tsx +0 -208
- package/next/index.ts +0 -2
- package/next/middleware/determine-device-mw.ts +0 -29
- package/root-layout/WHY_THIS_IS_SEPARATE.txt +0 -2
- package/root-layout/index.tsx +0 -112
- package/site-def/footer/community.tsx +0 -61
- package/site-def/footer/company.ts +0 -37
- package/site-def/footer/ecosystem.ts +0 -37
- package/site-def/footer/index.tsx +0 -26
- package/site-def/footer/legal.ts +0 -28
- package/site-def/footer/network.ts +0 -45
- package/site-def/footer/svg/warpcast-logo.svg +0 -12
- package/site-def/index.ts +0 -4
- package/site-def/main-nav.tsx +0 -460
- package/style/cart-animation.css +0 -29
- package/style/checkout-animation.css +0 -23
- package/style/drawer-handle-overrides.css +0 -160
- package/style/fonts/COPY_TO_PUBLIC_FOR_NON_NEXT.txt +0 -0
- package/style/fonts/Druk-Wide-Bold.ttf +0 -0
- package/style/fonts/Druk-Wide-Medium.ttf +0 -0
- package/style/fonts/InterVariable-Italic.ttf +0 -0
- package/style/fonts/InterVariable-Italic.woff2 +0 -0
- package/style/fonts/InterVariable.ttf +0 -0
- package/style/fonts/InterVariable.woff2 +0 -0
- package/style/lux-colors.css +0 -85
- package/style/lux-fonts.css +0 -30
- package/style/lux-global-non-next.css +0 -52
- package/style/lux-global.css +0 -51
- package/tailwind/fontFamily.tailwind.lux.ts +0 -18
- package/tailwind/index.ts +0 -2
- package/tailwind/lux-tw-fonts.ts +0 -40
- package/tailwind/tailwind.config.lux-preset.ts +0 -10
- package/tsconfig.json +0 -15
- package/types/chatbot-config.ts +0 -7
- package/types/chatbot-suggested-question.ts +0 -7
- package/types/contact-info.ts +0 -11
- package/types/index.ts +0 -4
- package/types/site-def.ts +0 -46
package/dist/drawer.cjs
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var RadixDialog = require('@radix-ui/react-dialog');
|
|
5
|
+
var React2 = 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 RadixDialog__namespace = /*#__PURE__*/_interopNamespace(RadixDialog);
|
|
29
|
+
var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
|
|
30
|
+
|
|
31
|
+
// src/drawer.tsx
|
|
32
|
+
function cn(...inputs) {
|
|
33
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
34
|
+
}
|
|
35
|
+
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";
|
|
36
|
+
var CloseButton = React2__namespace.forwardRef(function CloseButton2(props, ref) {
|
|
37
|
+
const { variant: _variant, size: _size, className, children, ...rest } = props;
|
|
38
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
39
|
+
"button",
|
|
40
|
+
{
|
|
41
|
+
type: "button",
|
|
42
|
+
"aria-label": "Close",
|
|
43
|
+
ref,
|
|
44
|
+
className: cn(
|
|
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
|
+
),
|
|
54
|
+
...rest,
|
|
55
|
+
children: children ?? /* @__PURE__ */ jsxRuntime.jsx(
|
|
56
|
+
"svg",
|
|
57
|
+
{
|
|
58
|
+
className: "size-5",
|
|
59
|
+
viewBox: "0 0 20 20",
|
|
60
|
+
fill: "none",
|
|
61
|
+
"aria-hidden": "true",
|
|
62
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
63
|
+
"path",
|
|
64
|
+
{
|
|
65
|
+
d: CLOSE_ICON_PATH,
|
|
66
|
+
fill: "currentColor"
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
});
|
|
74
|
+
var DrawerPlacementContext = React2__namespace.createContext("right");
|
|
75
|
+
var DrawerSizeContext = React2__namespace.createContext("md");
|
|
76
|
+
var DrawerRoot = (props) => {
|
|
77
|
+
const {
|
|
78
|
+
children,
|
|
79
|
+
open,
|
|
80
|
+
defaultOpen,
|
|
81
|
+
onOpenChange,
|
|
82
|
+
placement = "right",
|
|
83
|
+
modal = true,
|
|
84
|
+
size = "md"
|
|
85
|
+
} = props;
|
|
86
|
+
const handleOpenChange = React2__namespace.useCallback((nextOpen) => {
|
|
87
|
+
onOpenChange?.({ open: nextOpen });
|
|
88
|
+
}, [onOpenChange]);
|
|
89
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DrawerPlacementContext.Provider, { value: placement, children: /* @__PURE__ */ jsxRuntime.jsx(DrawerSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
90
|
+
RadixDialog__namespace.Root,
|
|
91
|
+
{
|
|
92
|
+
open,
|
|
93
|
+
defaultOpen,
|
|
94
|
+
onOpenChange: handleOpenChange,
|
|
95
|
+
modal,
|
|
96
|
+
children
|
|
97
|
+
}
|
|
98
|
+
) }) });
|
|
99
|
+
};
|
|
100
|
+
var PLACEMENT_CLASSES = {
|
|
101
|
+
right: [
|
|
102
|
+
"inset-y-0 right-0",
|
|
103
|
+
"data-[state=open]:animate-in data-[state=open]:slide-in-from-right",
|
|
104
|
+
"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right"
|
|
105
|
+
].join(" "),
|
|
106
|
+
left: [
|
|
107
|
+
"inset-y-0 left-0",
|
|
108
|
+
"data-[state=open]:animate-in data-[state=open]:slide-in-from-left",
|
|
109
|
+
"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-left"
|
|
110
|
+
].join(" "),
|
|
111
|
+
top: [
|
|
112
|
+
"inset-x-0 top-0",
|
|
113
|
+
"data-[state=open]:animate-in data-[state=open]:slide-in-from-top",
|
|
114
|
+
"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-top"
|
|
115
|
+
].join(" "),
|
|
116
|
+
bottom: [
|
|
117
|
+
"inset-x-0 bottom-0",
|
|
118
|
+
"data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom",
|
|
119
|
+
"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom"
|
|
120
|
+
].join(" ")
|
|
121
|
+
};
|
|
122
|
+
var SIZE_CLASSES = {
|
|
123
|
+
right: { xs: "w-60", sm: "w-80", md: "w-96", lg: "w-[480px]", xl: "w-[640px]", full: "w-screen" },
|
|
124
|
+
left: { xs: "w-60", sm: "w-80", md: "w-96", lg: "w-[480px]", xl: "w-[640px]", full: "w-screen" },
|
|
125
|
+
top: { xs: "h-40", sm: "h-60", md: "h-80", lg: "h-96", xl: "h-[480px]", full: "h-screen" },
|
|
126
|
+
bottom: { xs: "h-40", sm: "h-60", md: "h-80", lg: "h-96", xl: "h-[480px]", full: "h-screen" }
|
|
127
|
+
};
|
|
128
|
+
var DrawerContent = React2__namespace.forwardRef(
|
|
129
|
+
function DrawerContent2(props, ref) {
|
|
130
|
+
const { children, portalled = true, portalRef, offset: _offset, backdrop = true, className, ...rest } = props;
|
|
131
|
+
const placement = React2__namespace.useContext(DrawerPlacementContext);
|
|
132
|
+
const size = React2__namespace.useContext(DrawerSizeContext);
|
|
133
|
+
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
134
|
+
backdrop && /* @__PURE__ */ jsxRuntime.jsx(
|
|
135
|
+
RadixDialog__namespace.Overlay,
|
|
136
|
+
{
|
|
137
|
+
className: cn(
|
|
138
|
+
"fixed inset-0 z-50 bg-black/50",
|
|
139
|
+
"data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
140
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0"
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
),
|
|
144
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
145
|
+
RadixDialog__namespace.Content,
|
|
146
|
+
{
|
|
147
|
+
ref,
|
|
148
|
+
className: cn(
|
|
149
|
+
"fixed z-50 flex flex-col bg-[var(--color-drawer-bg)] shadow-[var(--shadow-drawer)] duration-300",
|
|
150
|
+
PLACEMENT_CLASSES[placement] ?? PLACEMENT_CLASSES.right,
|
|
151
|
+
SIZE_CLASSES[placement]?.[size] ?? SIZE_CLASSES.right?.md,
|
|
152
|
+
className
|
|
153
|
+
),
|
|
154
|
+
...rest,
|
|
155
|
+
children
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
] });
|
|
159
|
+
if (portalled) {
|
|
160
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Portal, { container: portalRef?.current ?? void 0, children: content });
|
|
161
|
+
}
|
|
162
|
+
return content;
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
var DrawerCloseTrigger = React2__namespace.forwardRef(function DrawerCloseTrigger2(props, ref) {
|
|
166
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
167
|
+
CloseButton,
|
|
168
|
+
{
|
|
169
|
+
ref,
|
|
170
|
+
className: cn("absolute top-7 right-5", props.className),
|
|
171
|
+
...props
|
|
172
|
+
}
|
|
173
|
+
) });
|
|
174
|
+
});
|
|
175
|
+
var DrawerTrigger = (props) => {
|
|
176
|
+
const { asChild = true, ...rest } = props;
|
|
177
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Trigger, { asChild, ...rest });
|
|
178
|
+
};
|
|
179
|
+
var DrawerHeader = React2__namespace.forwardRef(
|
|
180
|
+
function DrawerHeader2({ className, ...props }, ref) {
|
|
181
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex flex-col gap-1.5 p-6 pb-0", className), ...props });
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
var DrawerBody = React2__namespace.forwardRef(
|
|
185
|
+
function DrawerBody2({ className, ...props }, ref) {
|
|
186
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex-1 overflow-auto p-6", className), ...props });
|
|
187
|
+
}
|
|
188
|
+
);
|
|
189
|
+
var DrawerFooter = React2__namespace.forwardRef(
|
|
190
|
+
function DrawerFooter2({ className, ...props }, ref) {
|
|
191
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex items-center justify-end gap-2 p-6 pt-0", className), ...props });
|
|
192
|
+
}
|
|
193
|
+
);
|
|
194
|
+
var DrawerTitle = RadixDialog__namespace.Title;
|
|
195
|
+
var DrawerDescription = RadixDialog__namespace.Description;
|
|
196
|
+
var DrawerActionTrigger = RadixDialog__namespace.Close;
|
|
197
|
+
|
|
198
|
+
exports.DrawerActionTrigger = DrawerActionTrigger;
|
|
199
|
+
exports.DrawerBody = DrawerBody;
|
|
200
|
+
exports.DrawerCloseTrigger = DrawerCloseTrigger;
|
|
201
|
+
exports.DrawerContent = DrawerContent;
|
|
202
|
+
exports.DrawerDescription = DrawerDescription;
|
|
203
|
+
exports.DrawerFooter = DrawerFooter;
|
|
204
|
+
exports.DrawerHeader = DrawerHeader;
|
|
205
|
+
exports.DrawerRoot = DrawerRoot;
|
|
206
|
+
exports.DrawerTitle = DrawerTitle;
|
|
207
|
+
exports.DrawerTrigger = DrawerTrigger;
|
package/dist/drawer.js
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
3
|
+
import * as React2 from 'react';
|
|
4
|
+
import { clsx } from 'clsx';
|
|
5
|
+
import { twMerge } from 'tailwind-merge';
|
|
6
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
// src/drawer.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
|
+
var DrawerPlacementContext = React2.createContext("right");
|
|
52
|
+
var DrawerSizeContext = React2.createContext("md");
|
|
53
|
+
var DrawerRoot = (props) => {
|
|
54
|
+
const {
|
|
55
|
+
children,
|
|
56
|
+
open,
|
|
57
|
+
defaultOpen,
|
|
58
|
+
onOpenChange,
|
|
59
|
+
placement = "right",
|
|
60
|
+
modal = true,
|
|
61
|
+
size = "md"
|
|
62
|
+
} = props;
|
|
63
|
+
const handleOpenChange = React2.useCallback((nextOpen) => {
|
|
64
|
+
onOpenChange?.({ open: nextOpen });
|
|
65
|
+
}, [onOpenChange]);
|
|
66
|
+
return /* @__PURE__ */ jsx(DrawerPlacementContext.Provider, { value: placement, children: /* @__PURE__ */ jsx(DrawerSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsx(
|
|
67
|
+
RadixDialog.Root,
|
|
68
|
+
{
|
|
69
|
+
open,
|
|
70
|
+
defaultOpen,
|
|
71
|
+
onOpenChange: handleOpenChange,
|
|
72
|
+
modal,
|
|
73
|
+
children
|
|
74
|
+
}
|
|
75
|
+
) }) });
|
|
76
|
+
};
|
|
77
|
+
var PLACEMENT_CLASSES = {
|
|
78
|
+
right: [
|
|
79
|
+
"inset-y-0 right-0",
|
|
80
|
+
"data-[state=open]:animate-in data-[state=open]:slide-in-from-right",
|
|
81
|
+
"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right"
|
|
82
|
+
].join(" "),
|
|
83
|
+
left: [
|
|
84
|
+
"inset-y-0 left-0",
|
|
85
|
+
"data-[state=open]:animate-in data-[state=open]:slide-in-from-left",
|
|
86
|
+
"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-left"
|
|
87
|
+
].join(" "),
|
|
88
|
+
top: [
|
|
89
|
+
"inset-x-0 top-0",
|
|
90
|
+
"data-[state=open]:animate-in data-[state=open]:slide-in-from-top",
|
|
91
|
+
"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-top"
|
|
92
|
+
].join(" "),
|
|
93
|
+
bottom: [
|
|
94
|
+
"inset-x-0 bottom-0",
|
|
95
|
+
"data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom",
|
|
96
|
+
"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom"
|
|
97
|
+
].join(" ")
|
|
98
|
+
};
|
|
99
|
+
var SIZE_CLASSES = {
|
|
100
|
+
right: { xs: "w-60", sm: "w-80", md: "w-96", lg: "w-[480px]", xl: "w-[640px]", full: "w-screen" },
|
|
101
|
+
left: { xs: "w-60", sm: "w-80", md: "w-96", lg: "w-[480px]", xl: "w-[640px]", full: "w-screen" },
|
|
102
|
+
top: { xs: "h-40", sm: "h-60", md: "h-80", lg: "h-96", xl: "h-[480px]", full: "h-screen" },
|
|
103
|
+
bottom: { xs: "h-40", sm: "h-60", md: "h-80", lg: "h-96", xl: "h-[480px]", full: "h-screen" }
|
|
104
|
+
};
|
|
105
|
+
var DrawerContent = React2.forwardRef(
|
|
106
|
+
function DrawerContent2(props, ref) {
|
|
107
|
+
const { children, portalled = true, portalRef, offset: _offset, backdrop = true, className, ...rest } = props;
|
|
108
|
+
const placement = React2.useContext(DrawerPlacementContext);
|
|
109
|
+
const size = React2.useContext(DrawerSizeContext);
|
|
110
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
111
|
+
backdrop && /* @__PURE__ */ jsx(
|
|
112
|
+
RadixDialog.Overlay,
|
|
113
|
+
{
|
|
114
|
+
className: cn(
|
|
115
|
+
"fixed inset-0 z-50 bg-black/50",
|
|
116
|
+
"data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
117
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0"
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
/* @__PURE__ */ jsx(
|
|
122
|
+
RadixDialog.Content,
|
|
123
|
+
{
|
|
124
|
+
ref,
|
|
125
|
+
className: cn(
|
|
126
|
+
"fixed z-50 flex flex-col bg-[var(--color-drawer-bg)] shadow-[var(--shadow-drawer)] duration-300",
|
|
127
|
+
PLACEMENT_CLASSES[placement] ?? PLACEMENT_CLASSES.right,
|
|
128
|
+
SIZE_CLASSES[placement]?.[size] ?? SIZE_CLASSES.right?.md,
|
|
129
|
+
className
|
|
130
|
+
),
|
|
131
|
+
...rest,
|
|
132
|
+
children
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
] });
|
|
136
|
+
if (portalled) {
|
|
137
|
+
return /* @__PURE__ */ jsx(RadixDialog.Portal, { container: portalRef?.current ?? void 0, children: content });
|
|
138
|
+
}
|
|
139
|
+
return content;
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
var DrawerCloseTrigger = React2.forwardRef(function DrawerCloseTrigger2(props, ref) {
|
|
143
|
+
return /* @__PURE__ */ jsx(RadixDialog.Close, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
144
|
+
CloseButton,
|
|
145
|
+
{
|
|
146
|
+
ref,
|
|
147
|
+
className: cn("absolute top-7 right-5", props.className),
|
|
148
|
+
...props
|
|
149
|
+
}
|
|
150
|
+
) });
|
|
151
|
+
});
|
|
152
|
+
var DrawerTrigger = (props) => {
|
|
153
|
+
const { asChild = true, ...rest } = props;
|
|
154
|
+
return /* @__PURE__ */ jsx(RadixDialog.Trigger, { asChild, ...rest });
|
|
155
|
+
};
|
|
156
|
+
var DrawerHeader = React2.forwardRef(
|
|
157
|
+
function DrawerHeader2({ className, ...props }, ref) {
|
|
158
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn("flex flex-col gap-1.5 p-6 pb-0", className), ...props });
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
var DrawerBody = React2.forwardRef(
|
|
162
|
+
function DrawerBody2({ className, ...props }, ref) {
|
|
163
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn("flex-1 overflow-auto p-6", className), ...props });
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
var DrawerFooter = React2.forwardRef(
|
|
167
|
+
function DrawerFooter2({ className, ...props }, ref) {
|
|
168
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cn("flex items-center justify-end gap-2 p-6 pt-0", className), ...props });
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
var DrawerTitle = RadixDialog.Title;
|
|
172
|
+
var DrawerDescription = RadixDialog.Description;
|
|
173
|
+
var DrawerActionTrigger = RadixDialog.Close;
|
|
174
|
+
|
|
175
|
+
export { DrawerActionTrigger, DrawerBody, DrawerCloseTrigger, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerRoot, DrawerTitle, DrawerTrigger };
|
|
@@ -0,0 +1,93 @@
|
|
|
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/empty-state.tsx
|
|
30
|
+
function cn(...inputs) {
|
|
31
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
32
|
+
}
|
|
33
|
+
var apos = "\u2019";
|
|
34
|
+
function upperFirst(str) {
|
|
35
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
36
|
+
}
|
|
37
|
+
var ICONS = {};
|
|
38
|
+
var EmptyState = React__namespace.forwardRef(
|
|
39
|
+
function EmptyState2(props, ref) {
|
|
40
|
+
const { title, description, term, type = "query", icon, children, className, ...rest } = props;
|
|
41
|
+
const titleContent = (() => {
|
|
42
|
+
if (title) {
|
|
43
|
+
return title;
|
|
44
|
+
}
|
|
45
|
+
if (type === "stats") {
|
|
46
|
+
return "Collecting data";
|
|
47
|
+
}
|
|
48
|
+
if (type === "coming_soon") {
|
|
49
|
+
return "Coming soon";
|
|
50
|
+
}
|
|
51
|
+
return "No results";
|
|
52
|
+
})();
|
|
53
|
+
const descriptionContent = (() => {
|
|
54
|
+
if (description) {
|
|
55
|
+
return description;
|
|
56
|
+
}
|
|
57
|
+
if (term && type === "query") {
|
|
58
|
+
return `Couldn${apos}t find any ${term} that matches your query.`;
|
|
59
|
+
}
|
|
60
|
+
if (type === "stats") {
|
|
61
|
+
return term ? `${upperFirst(term)} stats will be added soon` : "Charts and statistics will be available soon";
|
|
62
|
+
}
|
|
63
|
+
if (type === "coming_soon") {
|
|
64
|
+
return "The information will be available soon. Stay tuned!";
|
|
65
|
+
}
|
|
66
|
+
})();
|
|
67
|
+
const iconContent = (() => {
|
|
68
|
+
const Icon = ICONS[type];
|
|
69
|
+
if (Icon) {
|
|
70
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Icon, {});
|
|
71
|
+
}
|
|
72
|
+
return icon;
|
|
73
|
+
})();
|
|
74
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
ref,
|
|
78
|
+
className: cn("flex items-center justify-center py-10", className),
|
|
79
|
+
...rest,
|
|
80
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-5", children: [
|
|
81
|
+
iconContent && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: iconContent }),
|
|
82
|
+
descriptionContent ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-2 text-center", children: [
|
|
83
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-lg font-semibold text-text-secondary", children: titleContent }),
|
|
84
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-text-secondary", children: descriptionContent })
|
|
85
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-lg font-semibold text-text-secondary", children: titleContent }),
|
|
86
|
+
children
|
|
87
|
+
] })
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
exports.EmptyState = EmptyState;
|
|
@@ -0,0 +1,71 @@
|
|
|
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/empty-state.tsx
|
|
8
|
+
function cn(...inputs) {
|
|
9
|
+
return twMerge(clsx(inputs));
|
|
10
|
+
}
|
|
11
|
+
var apos = "\u2019";
|
|
12
|
+
function upperFirst(str) {
|
|
13
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
14
|
+
}
|
|
15
|
+
var ICONS = {};
|
|
16
|
+
var EmptyState = React.forwardRef(
|
|
17
|
+
function EmptyState2(props, ref) {
|
|
18
|
+
const { title, description, term, type = "query", icon, children, className, ...rest } = props;
|
|
19
|
+
const titleContent = (() => {
|
|
20
|
+
if (title) {
|
|
21
|
+
return title;
|
|
22
|
+
}
|
|
23
|
+
if (type === "stats") {
|
|
24
|
+
return "Collecting data";
|
|
25
|
+
}
|
|
26
|
+
if (type === "coming_soon") {
|
|
27
|
+
return "Coming soon";
|
|
28
|
+
}
|
|
29
|
+
return "No results";
|
|
30
|
+
})();
|
|
31
|
+
const descriptionContent = (() => {
|
|
32
|
+
if (description) {
|
|
33
|
+
return description;
|
|
34
|
+
}
|
|
35
|
+
if (term && type === "query") {
|
|
36
|
+
return `Couldn${apos}t find any ${term} that matches your query.`;
|
|
37
|
+
}
|
|
38
|
+
if (type === "stats") {
|
|
39
|
+
return term ? `${upperFirst(term)} stats will be added soon` : "Charts and statistics will be available soon";
|
|
40
|
+
}
|
|
41
|
+
if (type === "coming_soon") {
|
|
42
|
+
return "The information will be available soon. Stay tuned!";
|
|
43
|
+
}
|
|
44
|
+
})();
|
|
45
|
+
const iconContent = (() => {
|
|
46
|
+
const Icon = ICONS[type];
|
|
47
|
+
if (Icon) {
|
|
48
|
+
return /* @__PURE__ */ jsx(Icon, {});
|
|
49
|
+
}
|
|
50
|
+
return icon;
|
|
51
|
+
})();
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
ref,
|
|
56
|
+
className: cn("flex items-center justify-center py-10", className),
|
|
57
|
+
...rest,
|
|
58
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-5", children: [
|
|
59
|
+
iconContent && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center", children: iconContent }),
|
|
60
|
+
descriptionContent ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-2 text-center", children: [
|
|
61
|
+
/* @__PURE__ */ jsx("span", { className: "text-lg font-semibold text-text-secondary", children: titleContent }),
|
|
62
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-text-secondary", children: descriptionContent })
|
|
63
|
+
] }) : /* @__PURE__ */ jsx("span", { className: "text-lg font-semibold text-text-secondary", children: titleContent }),
|
|
64
|
+
children
|
|
65
|
+
] })
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
export { EmptyState };
|