@luxfi/ui 7.3.2 → 7.4.2
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 +2 -2
- package/dist/alert.js +1 -1
- package/dist/avatar.cjs +7 -6
- package/dist/avatar.js +7 -5
- package/dist/badge.cjs +36 -38
- package/dist/badge.js +31 -33
- package/dist/bank.cjs +13 -13
- package/dist/bank.d.cts +31 -24
- package/dist/bank.d.ts +31 -24
- package/dist/bank.js +1 -1
- package/dist/button.cjs +3 -3
- package/dist/button.js +1 -1
- package/dist/checkbox.cjs +4 -4
- package/dist/checkbox.d.cts +3 -2
- package/dist/checkbox.d.ts +3 -2
- package/dist/checkbox.js +5 -4
- package/dist/chrome.cjs +950 -0
- package/dist/chrome.d.cts +93 -0
- package/dist/chrome.d.ts +93 -0
- package/dist/chrome.js +921 -0
- package/dist/close-button.cjs +2 -2
- package/dist/close-button.js +1 -1
- package/dist/dialog.cjs +13 -14
- package/dist/dialog.d.cts +58 -5
- package/dist/dialog.d.ts +58 -5
- package/dist/dialog.js +1 -2
- package/dist/drawer.cjs +87 -21
- package/dist/drawer.js +85 -19
- package/dist/expiration-selector.cjs +3 -2
- package/dist/expiration-selector.js +3 -2
- package/dist/greeks-display.cjs +6 -6
- package/dist/greeks-display.js +6 -6
- package/dist/gui.cjs +13 -0
- package/dist/gui.d.cts +2 -0
- package/dist/gui.d.ts +2 -0
- package/dist/gui.js +2 -0
- package/dist/heading.cjs +4 -2
- package/dist/heading.js +4 -2
- package/dist/iam.cjs +206 -0
- package/dist/iam.d.cts +65 -0
- package/dist/iam.d.ts +65 -0
- package/dist/iam.js +201 -0
- package/dist/icon-button.cjs +2 -2
- package/dist/icon-button.js +1 -1
- package/dist/icons.cjs +13 -0
- package/dist/icons.d.cts +1 -0
- package/dist/icons.d.ts +1 -0
- package/dist/icons.js +2 -0
- package/dist/identity.cjs +420 -0
- package/dist/identity.d.cts +64 -0
- package/dist/identity.d.ts +64 -0
- package/dist/identity.js +398 -0
- package/dist/index.cjs +1699 -860
- package/dist/index.d.cts +12 -4
- package/dist/index.d.ts +12 -4
- package/dist/index.js +1618 -802
- package/dist/input.cjs +13 -3
- package/dist/input.d.cts +6 -0
- package/dist/input.d.ts +6 -0
- package/dist/input.js +13 -3
- package/dist/lux.config.cjs +77 -0
- package/dist/lux.config.d.cts +433 -0
- package/dist/lux.config.d.ts +433 -0
- package/dist/lux.config.js +69 -0
- package/dist/menu.cjs +4 -4
- package/dist/menu.js +4 -4
- package/dist/next.cjs +99 -0
- package/dist/next.d.cts +29 -0
- package/dist/next.d.ts +29 -0
- package/dist/next.js +96 -0
- package/dist/option-chain.cjs +1 -1
- package/dist/option-chain.js +1 -1
- package/dist/option-position.cjs +2 -1
- package/dist/option-position.js +2 -1
- package/dist/pnl-diagram.cjs +8 -6
- package/dist/pnl-diagram.js +8 -6
- package/dist/popover.cjs +8 -9
- package/dist/popover.js +1 -2
- package/dist/progress.cjs +7 -6
- package/dist/progress.js +7 -5
- package/dist/provider.cjs +199 -5
- package/dist/provider.d.cts +16 -3
- package/dist/provider.d.ts +16 -3
- package/dist/provider.js +195 -6
- package/dist/radio.cjs +9 -7
- package/dist/radio.js +10 -7
- package/dist/separator.cjs +3 -1
- package/dist/separator.js +3 -1
- package/dist/slider.cjs +28 -16
- package/dist/slider.js +28 -15
- package/dist/strategy-builder.cjs +2 -1
- package/dist/strategy-builder.js +2 -1
- package/dist/switch.cjs +11 -12
- package/dist/switch.js +12 -12
- package/dist/tag.cjs +38 -41
- package/dist/tag.js +31 -34
- package/dist/textarea.cjs +13 -3
- package/dist/textarea.d.cts +2 -0
- package/dist/textarea.d.ts +2 -0
- package/dist/textarea.js +13 -3
- package/dist/tooltip.cjs +31 -33
- package/dist/tooltip.js +25 -27
- package/dist/use-narrow.cjs +46 -0
- package/dist/use-narrow.d.cts +12 -0
- package/dist/use-narrow.d.ts +12 -0
- package/dist/use-narrow.js +20 -0
- package/dist/vite.cjs +40 -0
- package/dist/vite.d.cts +29 -0
- package/dist/vite.d.ts +29 -0
- package/dist/vite.js +38 -0
- package/dist/white-label.cjs +132 -0
- package/dist/white-label.d.cts +59 -0
- package/dist/white-label.d.ts +59 -0
- package/dist/white-label.js +124 -0
- package/package.json +95 -17
- package/src/avatar.tsx +22 -16
- package/src/bank.tsx +2 -2
- package/src/button.tsx +1 -1
- package/src/checkbox.tsx +15 -10
- package/src/chrome.tsx +459 -0
- package/src/close-button.tsx +1 -1
- package/src/dialog.tsx +1 -1
- package/src/drawer.tsx +83 -10
- package/src/expiration-selector.tsx +3 -2
- package/src/greeks-display.tsx +9 -6
- package/src/gui.ts +17 -0
- package/src/heading.tsx +12 -8
- package/src/iam.ts +170 -0
- package/src/icon-button.tsx +1 -1
- package/src/icons.ts +18 -0
- package/src/identity.tsx +318 -0
- package/src/index.ts +50 -1
- package/src/input.tsx +24 -4
- package/src/lux.config.ts +82 -0
- package/src/menu.tsx +4 -4
- package/src/next.ts +142 -0
- package/src/option-chain.tsx +1 -1
- package/src/option-position.tsx +2 -1
- package/src/pnl-diagram.tsx +11 -6
- package/src/popover.tsx +1 -1
- package/src/progress.tsx +15 -8
- package/src/provider.tsx +92 -12
- package/src/radio.tsx +15 -11
- package/src/separator.tsx +8 -3
- package/src/slider.tsx +35 -19
- package/src/strategy-builder.tsx +3 -2
- package/src/switch.tsx +17 -16
- package/src/textarea.tsx +18 -4
- package/src/tooltip.tsx +4 -23
- package/src/use-narrow.ts +40 -0
- package/src/vite.ts +78 -0
- package/src/white-label.ts +240 -0
- package/tokens.css +544 -319
- package/src/tokens.css +0 -438
package/dist/close-button.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var gui = require('@hanzo/gui');
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
|
|
@@ -27,7 +27,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
|
27
27
|
|
|
28
28
|
// src/close-button.tsx
|
|
29
29
|
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";
|
|
30
|
-
var CloseButtonFrame =
|
|
30
|
+
var CloseButtonFrame = gui.styled(gui.View, {
|
|
31
31
|
name: "LuxCloseButton",
|
|
32
32
|
render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", "aria-label": "Close" }),
|
|
33
33
|
role: "button",
|
package/dist/close-button.js
CHANGED
package/dist/dialog.cjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var gui = require('@hanzo/gui');
|
|
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');
|
|
9
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
9
|
|
|
11
10
|
function _interopNamespace(e) {
|
|
@@ -33,7 +32,7 @@ function cn(...inputs) {
|
|
|
33
32
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
34
33
|
}
|
|
35
34
|
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 CloseButtonFrame =
|
|
35
|
+
var CloseButtonFrame = gui.styled(gui.View, {
|
|
37
36
|
name: "LuxCloseButton",
|
|
38
37
|
render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", "aria-label": "Close" }),
|
|
39
38
|
role: "button",
|
|
@@ -148,7 +147,7 @@ var DialogRoot = ({
|
|
|
148
147
|
);
|
|
149
148
|
const ctx = React2__namespace.useMemo(() => ({ size }), [size]);
|
|
150
149
|
return /* @__PURE__ */ jsxRuntime.jsx(DialogSizeContext.Provider, { value: ctx, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
151
|
-
|
|
150
|
+
gui.Dialog,
|
|
152
151
|
{
|
|
153
152
|
open,
|
|
154
153
|
defaultOpen,
|
|
@@ -174,9 +173,9 @@ var DialogContent = React2__namespace.forwardRef(function DialogContent2(props,
|
|
|
174
173
|
..._paddingTop !== void 0 ? { paddingTop: typeof _paddingTop === "number" ? `${_paddingTop * 4}px` : _paddingTop } : {}
|
|
175
174
|
};
|
|
176
175
|
const { size } = useDialogSizeContext();
|
|
177
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
176
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(gui.Dialog.Portal, { children: [
|
|
178
177
|
backdrop && /* @__PURE__ */ jsxRuntime.jsx(
|
|
179
|
-
|
|
178
|
+
gui.Dialog.Overlay,
|
|
180
179
|
{
|
|
181
180
|
unstyled: true,
|
|
182
181
|
className: "fixed inset-0 z-[1400] bg-black/80"
|
|
@@ -191,7 +190,7 @@ var DialogContent = React2__namespace.forwardRef(function DialogContent2(props,
|
|
|
191
190
|
"overflow-hidden"
|
|
192
191
|
),
|
|
193
192
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
194
|
-
|
|
193
|
+
gui.Dialog.Content,
|
|
195
194
|
{
|
|
196
195
|
ref,
|
|
197
196
|
unstyled: true,
|
|
@@ -217,7 +216,7 @@ var DialogContent = React2__namespace.forwardRef(function DialogContent2(props,
|
|
|
217
216
|
});
|
|
218
217
|
var DialogCloseTrigger = React2__namespace.forwardRef(function DialogCloseTrigger2(props, ref) {
|
|
219
218
|
const { className, ...rest } = props;
|
|
220
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
219
|
+
return /* @__PURE__ */ jsxRuntime.jsx(gui.Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { ref, className, ...rest, children: props.children }) });
|
|
221
220
|
});
|
|
222
221
|
var DialogHeader = React2__namespace.forwardRef(function DialogHeader2(props, ref) {
|
|
223
222
|
const { startElement: startElementProp, onBackToClick, className, children, ...rest } = props;
|
|
@@ -234,7 +233,7 @@ var DialogHeader = React2__namespace.forwardRef(function DialogHeader2(props, re
|
|
|
234
233
|
children: [
|
|
235
234
|
startElement,
|
|
236
235
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
237
|
-
|
|
236
|
+
gui.Dialog.Title,
|
|
238
237
|
{
|
|
239
238
|
unstyled: true,
|
|
240
239
|
className: cn(
|
|
@@ -276,11 +275,11 @@ var DialogFooter = React2__namespace.forwardRef(function DialogFooter2({ classNa
|
|
|
276
275
|
}
|
|
277
276
|
);
|
|
278
277
|
});
|
|
279
|
-
var DialogBackdrop =
|
|
280
|
-
var DialogTitle =
|
|
281
|
-
var DialogDescription =
|
|
282
|
-
var DialogTrigger =
|
|
283
|
-
var DialogActionTrigger =
|
|
278
|
+
var DialogBackdrop = gui.Dialog.Overlay;
|
|
279
|
+
var DialogTitle = gui.Dialog.Title;
|
|
280
|
+
var DialogDescription = gui.Dialog.Description;
|
|
281
|
+
var DialogTrigger = gui.Dialog.Trigger;
|
|
282
|
+
var DialogActionTrigger = gui.Dialog.Close;
|
|
284
283
|
|
|
285
284
|
exports.DialogActionTrigger = DialogActionTrigger;
|
|
286
285
|
exports.DialogBackdrop = DialogBackdrop;
|
package/dist/dialog.d.cts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import * as _hanzo_gui from '@hanzo/gui';
|
|
2
|
+
import * as _hanzogui_web from '@hanzogui/web';
|
|
3
|
+
import * as _hanzogui_core from '@hanzogui/core';
|
|
1
4
|
import * as React from 'react';
|
|
2
5
|
|
|
3
6
|
type DialogSize = 'sm' | 'md' | 'full' | 'cover';
|
|
@@ -49,17 +52,67 @@ declare const DialogBody: React.ForwardRefExoticComponent<DialogBodyProps & Reac
|
|
|
49
52
|
interface DialogFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
50
53
|
}
|
|
51
54
|
declare const DialogFooter: React.ForwardRefExoticComponent<DialogFooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
52
|
-
declare const DialogBackdrop:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
declare const DialogBackdrop: _hanzogui_web.GuiComponent<Omit<_hanzogui_web.GetFinalProps<_hanzogui_core.RNViewNonStyleProps, _hanzogui_web.StackStyleBase, {
|
|
56
|
+
open?: boolean | undefined;
|
|
57
|
+
unstyled?: boolean | undefined;
|
|
58
|
+
elevation?: number | _hanzogui_web.SizeTokens | undefined;
|
|
59
|
+
fullscreen?: boolean | undefined;
|
|
60
|
+
}>, "forceMount" | "scope"> & {
|
|
61
|
+
forceMount?: boolean;
|
|
62
|
+
} & {
|
|
63
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
64
|
+
}, _hanzogui_web.GuiElement, _hanzogui_core.RNViewNonStyleProps & {
|
|
65
|
+
forceMount?: boolean;
|
|
66
|
+
} & {
|
|
67
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
68
|
+
}, _hanzogui_web.StackStyleBase, {
|
|
69
|
+
open?: boolean | undefined;
|
|
70
|
+
unstyled?: boolean | undefined;
|
|
71
|
+
elevation?: number | _hanzogui_web.SizeTokens | undefined;
|
|
72
|
+
fullscreen?: boolean | undefined;
|
|
73
|
+
}, _hanzogui_web.StaticConfigPublic>;
|
|
74
|
+
declare const DialogTitle: _hanzogui_web.GuiComponent<Omit<_hanzogui_web.GetFinalProps<_hanzogui_web.TextNonStyleProps, _hanzogui_web.TextStylePropsBase, {
|
|
75
|
+
unstyled?: boolean | undefined;
|
|
76
|
+
size?: _hanzogui_web.FontSizeTokens | undefined;
|
|
77
|
+
}>, "scope"> & {
|
|
78
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
79
|
+
}, _hanzogui_web.GuiTextElement, _hanzogui_web.TextNonStyleProps & {
|
|
80
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
81
|
+
}, _hanzogui_web.TextStylePropsBase, {
|
|
82
|
+
unstyled?: boolean | undefined;
|
|
83
|
+
size?: _hanzogui_web.FontSizeTokens | undefined;
|
|
84
|
+
}, _hanzogui_web.StaticConfigPublic>;
|
|
85
|
+
declare const DialogDescription: _hanzogui_web.GuiComponent<Omit<_hanzogui_web.GetFinalProps<_hanzogui_web.TextNonStyleProps, _hanzogui_web.TextStylePropsBase, {
|
|
86
|
+
unstyled?: boolean | undefined;
|
|
87
|
+
size?: _hanzogui_web.FontSizeTokens | undefined;
|
|
88
|
+
}>, "scope"> & {
|
|
89
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
90
|
+
}, _hanzogui_web.GuiTextElement, _hanzogui_web.TextNonStyleProps & {
|
|
91
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
92
|
+
}, _hanzogui_web.TextStylePropsBase, {
|
|
93
|
+
unstyled?: boolean | undefined;
|
|
94
|
+
size?: _hanzogui_web.FontSizeTokens | undefined;
|
|
95
|
+
}, _hanzogui_web.StaticConfigPublic>;
|
|
55
96
|
interface DialogTriggerProps extends React.ComponentPropsWithoutRef<'button'> {
|
|
56
97
|
}
|
|
57
|
-
declare const DialogTrigger:
|
|
98
|
+
declare const DialogTrigger: _hanzogui_web.GuiComponent<Omit<_hanzogui_web.GetFinalProps<_hanzogui_core.RNViewNonStyleProps, _hanzogui_web.StackStyleBase, {}>, "scope"> & {
|
|
99
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
100
|
+
}, _hanzogui_web.GuiElement, _hanzogui_core.RNViewNonStyleProps & {
|
|
101
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
102
|
+
}, _hanzogui_web.StackStyleBase, {}, _hanzogui_web.StaticConfigPublic>;
|
|
58
103
|
/**
|
|
59
104
|
* `DialogActionTrigger` renders its child and closes the dialog on click.
|
|
60
105
|
* This mirrors the Chakra `Dialog.ActionTrigger` behavior which wraps
|
|
61
106
|
* children in a close action.
|
|
62
107
|
*/
|
|
63
|
-
declare const DialogActionTrigger:
|
|
108
|
+
declare const DialogActionTrigger: _hanzogui_web.GuiComponent<Omit<_hanzogui_web.GetFinalProps<_hanzogui_core.RNViewNonStyleProps, _hanzogui_web.StackStyleBase, {}>, "scope" | "displayWhenAdapted"> & {
|
|
109
|
+
displayWhenAdapted?: boolean;
|
|
110
|
+
} & {
|
|
111
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
112
|
+
}, _hanzogui_web.GuiElement, _hanzogui_core.RNViewNonStyleProps & {
|
|
113
|
+
displayWhenAdapted?: boolean;
|
|
114
|
+
} & {
|
|
115
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
116
|
+
}, _hanzogui_web.StackStyleBase, {}, _hanzogui_web.StaticConfigPublic>;
|
|
64
117
|
|
|
65
118
|
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.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import * as _hanzo_gui from '@hanzo/gui';
|
|
2
|
+
import * as _hanzogui_web from '@hanzogui/web';
|
|
3
|
+
import * as _hanzogui_core from '@hanzogui/core';
|
|
1
4
|
import * as React from 'react';
|
|
2
5
|
|
|
3
6
|
type DialogSize = 'sm' | 'md' | 'full' | 'cover';
|
|
@@ -49,17 +52,67 @@ declare const DialogBody: React.ForwardRefExoticComponent<DialogBodyProps & Reac
|
|
|
49
52
|
interface DialogFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
50
53
|
}
|
|
51
54
|
declare const DialogFooter: React.ForwardRefExoticComponent<DialogFooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
52
|
-
declare const DialogBackdrop:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
declare const DialogBackdrop: _hanzogui_web.GuiComponent<Omit<_hanzogui_web.GetFinalProps<_hanzogui_core.RNViewNonStyleProps, _hanzogui_web.StackStyleBase, {
|
|
56
|
+
open?: boolean | undefined;
|
|
57
|
+
unstyled?: boolean | undefined;
|
|
58
|
+
elevation?: number | _hanzogui_web.SizeTokens | undefined;
|
|
59
|
+
fullscreen?: boolean | undefined;
|
|
60
|
+
}>, "forceMount" | "scope"> & {
|
|
61
|
+
forceMount?: boolean;
|
|
62
|
+
} & {
|
|
63
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
64
|
+
}, _hanzogui_web.GuiElement, _hanzogui_core.RNViewNonStyleProps & {
|
|
65
|
+
forceMount?: boolean;
|
|
66
|
+
} & {
|
|
67
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
68
|
+
}, _hanzogui_web.StackStyleBase, {
|
|
69
|
+
open?: boolean | undefined;
|
|
70
|
+
unstyled?: boolean | undefined;
|
|
71
|
+
elevation?: number | _hanzogui_web.SizeTokens | undefined;
|
|
72
|
+
fullscreen?: boolean | undefined;
|
|
73
|
+
}, _hanzogui_web.StaticConfigPublic>;
|
|
74
|
+
declare const DialogTitle: _hanzogui_web.GuiComponent<Omit<_hanzogui_web.GetFinalProps<_hanzogui_web.TextNonStyleProps, _hanzogui_web.TextStylePropsBase, {
|
|
75
|
+
unstyled?: boolean | undefined;
|
|
76
|
+
size?: _hanzogui_web.FontSizeTokens | undefined;
|
|
77
|
+
}>, "scope"> & {
|
|
78
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
79
|
+
}, _hanzogui_web.GuiTextElement, _hanzogui_web.TextNonStyleProps & {
|
|
80
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
81
|
+
}, _hanzogui_web.TextStylePropsBase, {
|
|
82
|
+
unstyled?: boolean | undefined;
|
|
83
|
+
size?: _hanzogui_web.FontSizeTokens | undefined;
|
|
84
|
+
}, _hanzogui_web.StaticConfigPublic>;
|
|
85
|
+
declare const DialogDescription: _hanzogui_web.GuiComponent<Omit<_hanzogui_web.GetFinalProps<_hanzogui_web.TextNonStyleProps, _hanzogui_web.TextStylePropsBase, {
|
|
86
|
+
unstyled?: boolean | undefined;
|
|
87
|
+
size?: _hanzogui_web.FontSizeTokens | undefined;
|
|
88
|
+
}>, "scope"> & {
|
|
89
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
90
|
+
}, _hanzogui_web.GuiTextElement, _hanzogui_web.TextNonStyleProps & {
|
|
91
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
92
|
+
}, _hanzogui_web.TextStylePropsBase, {
|
|
93
|
+
unstyled?: boolean | undefined;
|
|
94
|
+
size?: _hanzogui_web.FontSizeTokens | undefined;
|
|
95
|
+
}, _hanzogui_web.StaticConfigPublic>;
|
|
55
96
|
interface DialogTriggerProps extends React.ComponentPropsWithoutRef<'button'> {
|
|
56
97
|
}
|
|
57
|
-
declare const DialogTrigger:
|
|
98
|
+
declare const DialogTrigger: _hanzogui_web.GuiComponent<Omit<_hanzogui_web.GetFinalProps<_hanzogui_core.RNViewNonStyleProps, _hanzogui_web.StackStyleBase, {}>, "scope"> & {
|
|
99
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
100
|
+
}, _hanzogui_web.GuiElement, _hanzogui_core.RNViewNonStyleProps & {
|
|
101
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
102
|
+
}, _hanzogui_web.StackStyleBase, {}, _hanzogui_web.StaticConfigPublic>;
|
|
58
103
|
/**
|
|
59
104
|
* `DialogActionTrigger` renders its child and closes the dialog on click.
|
|
60
105
|
* This mirrors the Chakra `Dialog.ActionTrigger` behavior which wraps
|
|
61
106
|
* children in a close action.
|
|
62
107
|
*/
|
|
63
|
-
declare const DialogActionTrigger:
|
|
108
|
+
declare const DialogActionTrigger: _hanzogui_web.GuiComponent<Omit<_hanzogui_web.GetFinalProps<_hanzogui_core.RNViewNonStyleProps, _hanzogui_web.StackStyleBase, {}>, "scope" | "displayWhenAdapted"> & {
|
|
109
|
+
displayWhenAdapted?: boolean;
|
|
110
|
+
} & {
|
|
111
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
112
|
+
}, _hanzogui_web.GuiElement, _hanzogui_core.RNViewNonStyleProps & {
|
|
113
|
+
displayWhenAdapted?: boolean;
|
|
114
|
+
} & {
|
|
115
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
116
|
+
}, _hanzogui_web.StackStyleBase, {}, _hanzogui_web.StaticConfigPublic>;
|
|
64
117
|
|
|
65
118
|
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,9 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Dialog } from '@
|
|
2
|
+
import { styled, View, Dialog } from '@hanzo/gui';
|
|
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';
|
|
7
6
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
7
|
|
|
9
8
|
// src/dialog.tsx
|
package/dist/drawer.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
var gui = require('@hanzo/gui');
|
|
4
5
|
var RadixDialog = require('@radix-ui/react-dialog');
|
|
5
|
-
var
|
|
6
|
+
var React3 = require('react');
|
|
6
7
|
var clsx = require('clsx');
|
|
7
8
|
var tailwindMerge = require('tailwind-merge');
|
|
8
|
-
var core = require('@hanzogui/core');
|
|
9
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
10
|
|
|
11
11
|
function _interopNamespace(e) {
|
|
@@ -27,14 +27,27 @@ function _interopNamespace(e) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
var RadixDialog__namespace = /*#__PURE__*/_interopNamespace(RadixDialog);
|
|
30
|
-
var
|
|
30
|
+
var React3__namespace = /*#__PURE__*/_interopNamespace(React3);
|
|
31
31
|
|
|
32
32
|
// src/drawer.tsx
|
|
33
|
+
var NARROW_PX = 640;
|
|
34
|
+
function useBelow(px) {
|
|
35
|
+
const [below, setBelow] = React3__namespace.useState(false);
|
|
36
|
+
React3__namespace.useEffect(() => {
|
|
37
|
+
const mql = window.matchMedia(`(max-width: ${px - 1}px)`);
|
|
38
|
+
const apply = () => setBelow(mql.matches);
|
|
39
|
+
apply();
|
|
40
|
+
mql.addEventListener("change", apply);
|
|
41
|
+
return () => mql.removeEventListener("change", apply);
|
|
42
|
+
}, [px]);
|
|
43
|
+
return below;
|
|
44
|
+
}
|
|
45
|
+
var useIsNarrow = () => useBelow(NARROW_PX);
|
|
33
46
|
function cn(...inputs) {
|
|
34
47
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
35
48
|
}
|
|
36
49
|
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 =
|
|
50
|
+
var CloseButtonFrame = gui.styled(gui.View, {
|
|
38
51
|
name: "LuxCloseButton",
|
|
39
52
|
render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", "aria-label": "Close" }),
|
|
40
53
|
role: "button",
|
|
@@ -68,7 +81,7 @@ var CLOSE_BUTTON_CLASSES = [
|
|
|
68
81
|
"hover:text-[var(--hover-color,currentColor)]",
|
|
69
82
|
"disabled:opacity-40"
|
|
70
83
|
].join(" ");
|
|
71
|
-
var CloseButton =
|
|
84
|
+
var CloseButton = React3__namespace.forwardRef(function CloseButton2(props, ref) {
|
|
72
85
|
const { variant: _variant, size: _size, className, children, ...rest } = props;
|
|
73
86
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
74
87
|
CloseButtonFrame,
|
|
@@ -95,8 +108,14 @@ var CloseButton = React2__namespace.forwardRef(function CloseButton2(props, ref)
|
|
|
95
108
|
}
|
|
96
109
|
);
|
|
97
110
|
});
|
|
98
|
-
var DrawerPlacementContext =
|
|
99
|
-
var DrawerSizeContext =
|
|
111
|
+
var DrawerPlacementContext = React3__namespace.createContext("right");
|
|
112
|
+
var DrawerSizeContext = React3__namespace.createContext("md");
|
|
113
|
+
var DrawerStateContext = React3__namespace.createContext({
|
|
114
|
+
open: false,
|
|
115
|
+
setOpen: () => {
|
|
116
|
+
},
|
|
117
|
+
modal: true
|
|
118
|
+
});
|
|
100
119
|
var DrawerRoot = (props) => {
|
|
101
120
|
const {
|
|
102
121
|
children,
|
|
@@ -107,19 +126,26 @@ var DrawerRoot = (props) => {
|
|
|
107
126
|
modal = true,
|
|
108
127
|
size = "md"
|
|
109
128
|
} = props;
|
|
110
|
-
const
|
|
129
|
+
const [uncontrolled, setUncontrolled] = React3__namespace.useState(defaultOpen ?? false);
|
|
130
|
+
const isControlled = open !== void 0;
|
|
131
|
+
const isOpen = isControlled ? open : uncontrolled;
|
|
132
|
+
const setOpen = React3__namespace.useCallback((nextOpen) => {
|
|
133
|
+
if (!isControlled) setUncontrolled(nextOpen);
|
|
111
134
|
onOpenChange?.({ open: nextOpen });
|
|
112
|
-
}, [onOpenChange]);
|
|
113
|
-
|
|
135
|
+
}, [isControlled, onOpenChange]);
|
|
136
|
+
const state = React3__namespace.useMemo(
|
|
137
|
+
() => ({ open: isOpen, setOpen, modal }),
|
|
138
|
+
[isOpen, setOpen, modal]
|
|
139
|
+
);
|
|
140
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DrawerPlacementContext.Provider, { value: placement, children: /* @__PURE__ */ jsxRuntime.jsx(DrawerSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsxRuntime.jsx(DrawerStateContext.Provider, { value: state, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
114
141
|
RadixDialog__namespace.Root,
|
|
115
142
|
{
|
|
116
|
-
open,
|
|
117
|
-
|
|
118
|
-
onOpenChange: handleOpenChange,
|
|
143
|
+
open: isOpen,
|
|
144
|
+
onOpenChange: setOpen,
|
|
119
145
|
modal,
|
|
120
146
|
children
|
|
121
147
|
}
|
|
122
|
-
) }) });
|
|
148
|
+
) }) }) });
|
|
123
149
|
};
|
|
124
150
|
var PLACEMENT_CLASSES = {
|
|
125
151
|
right: [
|
|
@@ -149,11 +175,51 @@ var SIZE_CLASSES = {
|
|
|
149
175
|
top: { xs: "h-40", sm: "h-60", md: "h-80", lg: "h-96", xl: "h-[480px]", full: "h-screen" },
|
|
150
176
|
bottom: { xs: "h-40", sm: "h-60", md: "h-80", lg: "h-96", xl: "h-[480px]", full: "h-screen" }
|
|
151
177
|
};
|
|
152
|
-
var DrawerContent =
|
|
178
|
+
var DrawerContent = React3__namespace.forwardRef(
|
|
153
179
|
function DrawerContent2(props, ref) {
|
|
154
180
|
const { children, portalled = true, portalRef, offset: _offset, backdrop = true, className, ...rest } = props;
|
|
155
|
-
const placement =
|
|
156
|
-
const size =
|
|
181
|
+
const placement = React3__namespace.useContext(DrawerPlacementContext);
|
|
182
|
+
const size = React3__namespace.useContext(DrawerSizeContext);
|
|
183
|
+
const { open, setOpen, modal } = React3__namespace.useContext(DrawerStateContext);
|
|
184
|
+
const isNarrow = useIsNarrow();
|
|
185
|
+
if (isNarrow) {
|
|
186
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
187
|
+
gui.Sheet,
|
|
188
|
+
{
|
|
189
|
+
open,
|
|
190
|
+
onOpenChange: setOpen,
|
|
191
|
+
modal,
|
|
192
|
+
dismissOnSnapToBottom: true,
|
|
193
|
+
snapPointsMode: "percent",
|
|
194
|
+
snapPoints: [88],
|
|
195
|
+
transition: "medium",
|
|
196
|
+
children: [
|
|
197
|
+
backdrop && /* @__PURE__ */ jsxRuntime.jsx(
|
|
198
|
+
gui.Sheet.Overlay,
|
|
199
|
+
{
|
|
200
|
+
transition: "lazy",
|
|
201
|
+
enterStyle: { opacity: 0 },
|
|
202
|
+
exitStyle: { opacity: 0 },
|
|
203
|
+
className: "bg-black/50"
|
|
204
|
+
}
|
|
205
|
+
),
|
|
206
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.Sheet.Handle, {}),
|
|
207
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
208
|
+
gui.Sheet.Frame,
|
|
209
|
+
{
|
|
210
|
+
unstyled: true,
|
|
211
|
+
className: cn(
|
|
212
|
+
"flex flex-col rounded-t-2xl bg-[var(--color-drawer-bg)] shadow-[var(--shadow-drawer)]",
|
|
213
|
+
className
|
|
214
|
+
),
|
|
215
|
+
...rest,
|
|
216
|
+
children
|
|
217
|
+
}
|
|
218
|
+
)
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
);
|
|
222
|
+
}
|
|
157
223
|
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
158
224
|
backdrop && /* @__PURE__ */ jsxRuntime.jsx(
|
|
159
225
|
RadixDialog__namespace.Overlay,
|
|
@@ -186,7 +252,7 @@ var DrawerContent = React2__namespace.forwardRef(
|
|
|
186
252
|
return content;
|
|
187
253
|
}
|
|
188
254
|
);
|
|
189
|
-
var DrawerCloseTrigger =
|
|
255
|
+
var DrawerCloseTrigger = React3__namespace.forwardRef(function DrawerCloseTrigger2(props, ref) {
|
|
190
256
|
return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
191
257
|
CloseButton,
|
|
192
258
|
{
|
|
@@ -200,17 +266,17 @@ var DrawerTrigger = (props) => {
|
|
|
200
266
|
const { asChild = true, ...rest } = props;
|
|
201
267
|
return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Trigger, { asChild, ...rest });
|
|
202
268
|
};
|
|
203
|
-
var DrawerHeader =
|
|
269
|
+
var DrawerHeader = React3__namespace.forwardRef(
|
|
204
270
|
function DrawerHeader2({ className, ...props }, ref) {
|
|
205
271
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex flex-col gap-1.5 p-6 pb-0", className), ...props });
|
|
206
272
|
}
|
|
207
273
|
);
|
|
208
|
-
var DrawerBody =
|
|
274
|
+
var DrawerBody = React3__namespace.forwardRef(
|
|
209
275
|
function DrawerBody2({ className, ...props }, ref) {
|
|
210
276
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex-1 overflow-auto p-6", className), ...props });
|
|
211
277
|
}
|
|
212
278
|
);
|
|
213
|
-
var DrawerFooter =
|
|
279
|
+
var DrawerFooter = React3__namespace.forwardRef(
|
|
214
280
|
function DrawerFooter2({ className, ...props }, ref) {
|
|
215
281
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex items-center justify-end gap-2 p-6 pt-0", className), ...props });
|
|
216
282
|
}
|
package/dist/drawer.js
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { styled, View, Sheet } from '@hanzo/gui';
|
|
2
3
|
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
3
|
-
import * as
|
|
4
|
+
import * as React3 from 'react';
|
|
4
5
|
import { clsx } from 'clsx';
|
|
5
6
|
import { twMerge } from 'tailwind-merge';
|
|
6
|
-
import { styled, View } from '@hanzogui/core';
|
|
7
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
9
|
// src/drawer.tsx
|
|
10
|
+
var NARROW_PX = 640;
|
|
11
|
+
function useBelow(px) {
|
|
12
|
+
const [below, setBelow] = React3.useState(false);
|
|
13
|
+
React3.useEffect(() => {
|
|
14
|
+
const mql = window.matchMedia(`(max-width: ${px - 1}px)`);
|
|
15
|
+
const apply = () => setBelow(mql.matches);
|
|
16
|
+
apply();
|
|
17
|
+
mql.addEventListener("change", apply);
|
|
18
|
+
return () => mql.removeEventListener("change", apply);
|
|
19
|
+
}, [px]);
|
|
20
|
+
return below;
|
|
21
|
+
}
|
|
22
|
+
var useIsNarrow = () => useBelow(NARROW_PX);
|
|
10
23
|
function cn(...inputs) {
|
|
11
24
|
return twMerge(clsx(inputs));
|
|
12
25
|
}
|
|
@@ -45,7 +58,7 @@ var CLOSE_BUTTON_CLASSES = [
|
|
|
45
58
|
"hover:text-[var(--hover-color,currentColor)]",
|
|
46
59
|
"disabled:opacity-40"
|
|
47
60
|
].join(" ");
|
|
48
|
-
var CloseButton =
|
|
61
|
+
var CloseButton = React3.forwardRef(function CloseButton2(props, ref) {
|
|
49
62
|
const { variant: _variant, size: _size, className, children, ...rest } = props;
|
|
50
63
|
return /* @__PURE__ */ jsx(
|
|
51
64
|
CloseButtonFrame,
|
|
@@ -72,8 +85,14 @@ var CloseButton = React2.forwardRef(function CloseButton2(props, ref) {
|
|
|
72
85
|
}
|
|
73
86
|
);
|
|
74
87
|
});
|
|
75
|
-
var DrawerPlacementContext =
|
|
76
|
-
var DrawerSizeContext =
|
|
88
|
+
var DrawerPlacementContext = React3.createContext("right");
|
|
89
|
+
var DrawerSizeContext = React3.createContext("md");
|
|
90
|
+
var DrawerStateContext = React3.createContext({
|
|
91
|
+
open: false,
|
|
92
|
+
setOpen: () => {
|
|
93
|
+
},
|
|
94
|
+
modal: true
|
|
95
|
+
});
|
|
77
96
|
var DrawerRoot = (props) => {
|
|
78
97
|
const {
|
|
79
98
|
children,
|
|
@@ -84,19 +103,26 @@ var DrawerRoot = (props) => {
|
|
|
84
103
|
modal = true,
|
|
85
104
|
size = "md"
|
|
86
105
|
} = props;
|
|
87
|
-
const
|
|
106
|
+
const [uncontrolled, setUncontrolled] = React3.useState(defaultOpen ?? false);
|
|
107
|
+
const isControlled = open !== void 0;
|
|
108
|
+
const isOpen = isControlled ? open : uncontrolled;
|
|
109
|
+
const setOpen = React3.useCallback((nextOpen) => {
|
|
110
|
+
if (!isControlled) setUncontrolled(nextOpen);
|
|
88
111
|
onOpenChange?.({ open: nextOpen });
|
|
89
|
-
}, [onOpenChange]);
|
|
90
|
-
|
|
112
|
+
}, [isControlled, onOpenChange]);
|
|
113
|
+
const state = React3.useMemo(
|
|
114
|
+
() => ({ open: isOpen, setOpen, modal }),
|
|
115
|
+
[isOpen, setOpen, modal]
|
|
116
|
+
);
|
|
117
|
+
return /* @__PURE__ */ jsx(DrawerPlacementContext.Provider, { value: placement, children: /* @__PURE__ */ jsx(DrawerSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsx(DrawerStateContext.Provider, { value: state, children: /* @__PURE__ */ jsx(
|
|
91
118
|
RadixDialog.Root,
|
|
92
119
|
{
|
|
93
|
-
open,
|
|
94
|
-
|
|
95
|
-
onOpenChange: handleOpenChange,
|
|
120
|
+
open: isOpen,
|
|
121
|
+
onOpenChange: setOpen,
|
|
96
122
|
modal,
|
|
97
123
|
children
|
|
98
124
|
}
|
|
99
|
-
) }) });
|
|
125
|
+
) }) }) });
|
|
100
126
|
};
|
|
101
127
|
var PLACEMENT_CLASSES = {
|
|
102
128
|
right: [
|
|
@@ -126,11 +152,51 @@ var SIZE_CLASSES = {
|
|
|
126
152
|
top: { xs: "h-40", sm: "h-60", md: "h-80", lg: "h-96", xl: "h-[480px]", full: "h-screen" },
|
|
127
153
|
bottom: { xs: "h-40", sm: "h-60", md: "h-80", lg: "h-96", xl: "h-[480px]", full: "h-screen" }
|
|
128
154
|
};
|
|
129
|
-
var DrawerContent =
|
|
155
|
+
var DrawerContent = React3.forwardRef(
|
|
130
156
|
function DrawerContent2(props, ref) {
|
|
131
157
|
const { children, portalled = true, portalRef, offset: _offset, backdrop = true, className, ...rest } = props;
|
|
132
|
-
const placement =
|
|
133
|
-
const size =
|
|
158
|
+
const placement = React3.useContext(DrawerPlacementContext);
|
|
159
|
+
const size = React3.useContext(DrawerSizeContext);
|
|
160
|
+
const { open, setOpen, modal } = React3.useContext(DrawerStateContext);
|
|
161
|
+
const isNarrow = useIsNarrow();
|
|
162
|
+
if (isNarrow) {
|
|
163
|
+
return /* @__PURE__ */ jsxs(
|
|
164
|
+
Sheet,
|
|
165
|
+
{
|
|
166
|
+
open,
|
|
167
|
+
onOpenChange: setOpen,
|
|
168
|
+
modal,
|
|
169
|
+
dismissOnSnapToBottom: true,
|
|
170
|
+
snapPointsMode: "percent",
|
|
171
|
+
snapPoints: [88],
|
|
172
|
+
transition: "medium",
|
|
173
|
+
children: [
|
|
174
|
+
backdrop && /* @__PURE__ */ jsx(
|
|
175
|
+
Sheet.Overlay,
|
|
176
|
+
{
|
|
177
|
+
transition: "lazy",
|
|
178
|
+
enterStyle: { opacity: 0 },
|
|
179
|
+
exitStyle: { opacity: 0 },
|
|
180
|
+
className: "bg-black/50"
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
/* @__PURE__ */ jsx(Sheet.Handle, {}),
|
|
184
|
+
/* @__PURE__ */ jsx(
|
|
185
|
+
Sheet.Frame,
|
|
186
|
+
{
|
|
187
|
+
unstyled: true,
|
|
188
|
+
className: cn(
|
|
189
|
+
"flex flex-col rounded-t-2xl bg-[var(--color-drawer-bg)] shadow-[var(--shadow-drawer)]",
|
|
190
|
+
className
|
|
191
|
+
),
|
|
192
|
+
...rest,
|
|
193
|
+
children
|
|
194
|
+
}
|
|
195
|
+
)
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
}
|
|
134
200
|
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
135
201
|
backdrop && /* @__PURE__ */ jsx(
|
|
136
202
|
RadixDialog.Overlay,
|
|
@@ -163,7 +229,7 @@ var DrawerContent = React2.forwardRef(
|
|
|
163
229
|
return content;
|
|
164
230
|
}
|
|
165
231
|
);
|
|
166
|
-
var DrawerCloseTrigger =
|
|
232
|
+
var DrawerCloseTrigger = React3.forwardRef(function DrawerCloseTrigger2(props, ref) {
|
|
167
233
|
return /* @__PURE__ */ jsx(RadixDialog.Close, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
168
234
|
CloseButton,
|
|
169
235
|
{
|
|
@@ -177,17 +243,17 @@ var DrawerTrigger = (props) => {
|
|
|
177
243
|
const { asChild = true, ...rest } = props;
|
|
178
244
|
return /* @__PURE__ */ jsx(RadixDialog.Trigger, { asChild, ...rest });
|
|
179
245
|
};
|
|
180
|
-
var DrawerHeader =
|
|
246
|
+
var DrawerHeader = React3.forwardRef(
|
|
181
247
|
function DrawerHeader2({ className, ...props }, ref) {
|
|
182
248
|
return /* @__PURE__ */ jsx("div", { ref, className: cn("flex flex-col gap-1.5 p-6 pb-0", className), ...props });
|
|
183
249
|
}
|
|
184
250
|
);
|
|
185
|
-
var DrawerBody =
|
|
251
|
+
var DrawerBody = React3.forwardRef(
|
|
186
252
|
function DrawerBody2({ className, ...props }, ref) {
|
|
187
253
|
return /* @__PURE__ */ jsx("div", { ref, className: cn("flex-1 overflow-auto p-6", className), ...props });
|
|
188
254
|
}
|
|
189
255
|
);
|
|
190
|
-
var DrawerFooter =
|
|
256
|
+
var DrawerFooter = React3.forwardRef(
|
|
191
257
|
function DrawerFooter2({ className, ...props }, ref) {
|
|
192
258
|
return /* @__PURE__ */ jsx("div", { ref, className: cn("flex items-center justify-end gap-2 p-6 pt-0", className), ...props });
|
|
193
259
|
}
|
|
@@ -54,8 +54,9 @@ function ExpirationPill({ exp, isSelected, onClick }) {
|
|
|
54
54
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium whitespace-nowrap", children: formatExpDate(exp.date) }),
|
|
55
55
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn(
|
|
56
56
|
"font-mono tabular-nums text-[10px]",
|
|
57
|
-
isSelected ? "text-
|
|
58
|
-
|
|
57
|
+
isSelected ? "text-[var(--foreground)]" : "text-[var(--muted-foreground)]",
|
|
58
|
+
// Near expiry is a notice, and a notice in Lux is the loudest neutral.
|
|
59
|
+
exp.dte <= 7 && !isSelected && "text-[var(--color-status-warn)]"
|
|
59
60
|
), children: [
|
|
60
61
|
exp.dte,
|
|
61
62
|
"d"
|