@noxickon/onyx 6.2.0 → 6.4.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/Accordion/Accordion.styles.js +1 -1
- package/dist/components/Alert/Alert.styles.js +2 -2
- package/dist/components/AlertDialog/AlertDialog.d.ts +2 -2
- package/dist/components/AlertDialog/AlertDialog.types.d.ts +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.styles.js +1 -1
- package/dist/components/Button/Button.styles.d.ts +18 -0
- package/dist/components/Button/Button.styles.js +3 -1
- package/dist/components/Card/Card.d.ts +1 -1
- package/dist/components/Card/Card.js +34 -33
- package/dist/components/Card/Card.styles.js +3 -3
- package/dist/components/Card/Card.types.d.ts +4 -1
- package/dist/components/Command/Command.styles.js +1 -1
- package/dist/components/CopyInput/CopyInput.d.ts +3 -0
- package/dist/components/CopyInput/CopyInput.js +46 -0
- package/dist/components/CopyInput/CopyInput.styles.d.ts +25 -0
- package/dist/components/CopyInput/CopyInput.styles.js +8 -0
- package/dist/components/CopyInput/CopyInput.types.d.ts +9 -0
- package/dist/components/CopyInput/index.d.ts +2 -0
- package/dist/components/DataTable/DataTable.js +282 -274
- package/dist/components/DataTable/DataTable.styles.js +2 -2
- package/dist/components/DataTable/DataTable.types.d.ts +1 -0
- package/dist/components/Dialog/Dialog.d.ts +2 -2
- package/dist/components/Dialog/Dialog.types.d.ts +1 -1
- package/dist/components/HoldToDelete/HoldToDelete.styles.js +1 -1
- package/dist/components/Pagination/Pagination.styles.js +1 -1
- package/dist/components/ResponsiveOverlay/ResponsiveOverlay.d.ts +9 -0
- package/dist/components/ResponsiveOverlay/ResponsiveOverlay.js +228 -0
- package/dist/components/ResponsiveOverlay/ResponsiveOverlay.styles.d.ts +78 -0
- package/dist/components/ResponsiveOverlay/ResponsiveOverlay.styles.js +36 -0
- package/dist/components/ResponsiveOverlay/ResponsiveOverlay.types.d.ts +45 -0
- package/dist/components/ResponsiveOverlay/index.d.ts +11 -0
- package/dist/components/ResponsiveOverlay/index.js +12 -0
- package/dist/components/Sidebar/Sidebar.styles.js +13 -6
- package/dist/components/Sidebar/Sidebar2.js +288 -287
- package/dist/components/SidebarRail/SidebarRail.styles.js +2 -2
- package/dist/components/TabBar/TabBar.styles.js +1 -1
- package/dist/components/Tabs/Tabs.styles.js +2 -2
- package/dist/components/Toggle/Toggle.styles.js +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/hooks.js +3 -3
- package/dist/index.js +44 -42
- package/dist/internal/styles/controlStyles.d.ts +1 -1
- package/dist/internal/styles/controlStyles.js +1 -1
- package/dist/internal/styles/menuSurfaceStyles.js +4 -4
- package/dist/internal/styles/overlayFrameStyles.d.ts +5 -0
- package/dist/internal/styles/overlayFrameStyles.js +8 -0
- package/dist/internal/styles/triggerSurfaceStyles.js +1 -1
- package/dist/internal/utils/getInertActivationProps/getInertActivationProps.d.ts +7 -0
- package/dist/internal/utils/getInertActivationProps/getInertActivationProps.js +12 -0
- package/dist/internal/utils/getInertActivationProps/index.d.ts +1 -0
- package/dist/internal/utils/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/code-block/onyxHighlighter.test.d.ts +0 -1
- package/dist/components/Command/commandScore.test.d.ts +0 -1
- package/dist/graphql/executors/apolloMutationExecutor.test.d.ts +0 -1
- package/dist/graphql/executors/apolloQueryExecutor.test.d.ts +0 -1
- package/dist/hooks/useForm/standardSchemaResolver.test.d.ts +0 -1
- package/dist/internal/utils/getFieldControlAttributes/getFieldControlAttributes.test.d.ts +0 -1
- package/dist/rest/executors/restExecutor.test.d.ts +0 -1
- package/dist/utils/cn.test.d.ts +0 -1
|
@@ -25,7 +25,7 @@ var t = e({
|
|
|
25
25
|
],
|
|
26
26
|
headSortIcon: "size-3.5 shrink-0 transition-colors",
|
|
27
27
|
headMenuTrigger: [
|
|
28
|
-
"inline-flex size-6 shrink-0 items-center justify-center rounded-sm text-fg-subtle",
|
|
28
|
+
"inline-flex size-6 shrink-0 items-center justify-center rounded-sm text-fg-subtle cursor-pointer",
|
|
29
29
|
"opacity-0 transition-[opacity,color,background-color] group-hover/head:opacity-100",
|
|
30
30
|
"hover:bg-fg/10 hover:text-fg data-[popup-open]:bg-fg/10 data-[popup-open]:opacity-100",
|
|
31
31
|
"focus-visible:opacity-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-ink"
|
|
@@ -41,7 +41,7 @@ var t = e({
|
|
|
41
41
|
configPanel: "flex w-64 flex-col",
|
|
42
42
|
configTitle: "px-2 pt-1.5 pb-2 text-body font-semibold text-fg",
|
|
43
43
|
configList: "flex flex-col gap-0.5 py-1",
|
|
44
|
-
configItem: "flex items-center gap-2.5 rounded-control px-2 py-1.5 hover:bg-fg/8",
|
|
44
|
+
configItem: "flex items-center gap-2.5 rounded-control px-2 py-1.5 ox-interactive:hover:bg-fg/8",
|
|
45
45
|
configHandle: "shrink-0 cursor-grab text-fg-subtle active:cursor-grabbing",
|
|
46
46
|
configHandleLocked: "shrink-0 text-fg-subtle opacity-30",
|
|
47
47
|
configLabel: "flex-1 truncate text-body",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OxDialogCloseProps, OxDialogContentProps, OxDialogDescriptionProps, OxDialogProps, OxDialogTitleProps, OxDialogTriggerProps } from './Dialog.types';
|
|
2
|
-
declare function OxDialogRoot({ modal, ...props }: OxDialogProps): import("react").JSX.Element;
|
|
3
|
-
declare function OxDialogTrigger({ children, className, ...props }: OxDialogTriggerProps): import("react").JSX.Element;
|
|
2
|
+
declare function OxDialogRoot<Payload = unknown>({ modal, ...props }: OxDialogProps<Payload>): import("react").JSX.Element;
|
|
3
|
+
declare function OxDialogTrigger<Payload = unknown>({ children, className, ...props }: OxDialogTriggerProps<Payload>): import("react").JSX.Element;
|
|
4
4
|
declare function OxDialogContent({ children, className, scroll, ...props }: OxDialogContentProps): import("react").JSX.Element;
|
|
5
5
|
declare function OxDialogTitle({ children, className, ...props }: OxDialogTitleProps): import("react").JSX.Element;
|
|
6
6
|
declare function OxDialogDescription({ children, className, ...props }: OxDialogDescriptionProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { Dialog as BaseDialog, DialogCloseProps as BaseDialogCloseProps, DialogDescriptionProps as BaseDialogDescriptionProps, DialogPopupProps as BaseDialogPopupProps, DialogRootProps as BaseDialogRootProps, DialogTitleProps as BaseDialogTitleProps, DialogTriggerProps as BaseDialogTriggerProps } from '@base-ui/react/dialog';
|
|
3
3
|
import { DialogVariants } from './Dialog.styles';
|
|
4
|
-
type DialogHandle = ReturnType<typeof BaseDialog.createHandle
|
|
4
|
+
type DialogHandle<Payload = unknown> = ReturnType<typeof BaseDialog.createHandle<Payload>>;
|
|
5
5
|
type OxDialogProps<Payload = unknown> = BaseDialogRootProps<Payload>;
|
|
6
6
|
interface OxDialogTriggerProps<Payload = unknown> extends Omit<BaseDialogTriggerProps<Payload>, 'className'> {
|
|
7
7
|
className?: string;
|
|
@@ -8,7 +8,7 @@ var t = e({ slots: {
|
|
|
8
8
|
"[&_svg:not([class*=size-])]:size-icon",
|
|
9
9
|
"transition-transform active:scale-97 will-change-transform",
|
|
10
10
|
"outline-danger-ink focus-visible:outline-2 focus-visible:outline-offset-2",
|
|
11
|
-
"ox-disabled:
|
|
11
|
+
"ox-disabled:cursor-not-allowed ox-disabled:opacity-50 ox-disabled:active:scale-100"
|
|
12
12
|
],
|
|
13
13
|
overlay: [
|
|
14
14
|
"pointer-events-none absolute inset-0",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OxResponsiveOverlayActionsProps, OxResponsiveOverlayBodyProps, OxResponsiveOverlayContentProps, OxResponsiveOverlayDescriptionProps, OxResponsiveOverlayProps, OxResponsiveOverlayTitleProps, OxResponsiveOverlayTriggerProps } from './ResponsiveOverlay.types';
|
|
2
|
+
declare function OxResponsiveOverlayRoot({ below, children, defaultOpen, headerExtra, mobile, mobileSide, onOpenChange, open, tone, }: OxResponsiveOverlayProps): import("react").JSX.Element;
|
|
3
|
+
declare function OxResponsiveOverlayTrigger({ children, className }: OxResponsiveOverlayTriggerProps): import("react").JSX.Element;
|
|
4
|
+
declare function OxResponsiveOverlayContent({ children, className }: OxResponsiveOverlayContentProps): import("react").JSX.Element;
|
|
5
|
+
declare function OxResponsiveOverlayTitle({ children, className }: OxResponsiveOverlayTitleProps): import("react").JSX.Element;
|
|
6
|
+
declare function OxResponsiveOverlayDescription({ children, className, }: OxResponsiveOverlayDescriptionProps): import("react").JSX.Element;
|
|
7
|
+
declare function OxResponsiveOverlayBody({ children, className }: OxResponsiveOverlayBodyProps): import("react").JSX.Element;
|
|
8
|
+
declare function OxResponsiveOverlayActions({ children, className }: OxResponsiveOverlayActionsProps): import("react").JSX.Element;
|
|
9
|
+
export { OxResponsiveOverlayActions, OxResponsiveOverlayBody, OxResponsiveOverlayContent, OxResponsiveOverlayDescription, OxResponsiveOverlayRoot, OxResponsiveOverlayTitle, OxResponsiveOverlayTrigger, };
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { createCompoundContext as e } from "../../internal/context/createCompoundContext/createCompoundContext.js";
|
|
2
|
+
import { OxAlertDialog as t } from "../AlertDialog/index.js";
|
|
3
|
+
import { OxDialog as n } from "../Dialog/index.js";
|
|
4
|
+
import { OxDrawer as r } from "../Drawer/index.js";
|
|
5
|
+
import { useOxBreakpointUp as i } from "../../hooks/useBreakpoint/useBreakpoint.js";
|
|
6
|
+
import { responsiveOverlayVariants as a } from "./ResponsiveOverlay.styles.js";
|
|
7
|
+
import { c as o } from "react/compiler-runtime";
|
|
8
|
+
import { useState as s } from "react";
|
|
9
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/ResponsiveOverlay/ResponsiveOverlay.tsx
|
|
11
|
+
var { Provider: u, useRequiredContext: d } = e("OxResponsiveOverlay"), f = /* @__PURE__ */ new Set([
|
|
12
|
+
"close-press",
|
|
13
|
+
"imperative-action",
|
|
14
|
+
"none"
|
|
15
|
+
]);
|
|
16
|
+
function p(e, t) {
|
|
17
|
+
return e ? "drawer" : t ? "alertDialog" : "dialog";
|
|
18
|
+
}
|
|
19
|
+
function m(e) {
|
|
20
|
+
let a = o(36), { below: l, children: d, defaultOpen: m, headerExtra: h, mobile: g, mobileSide: _, onOpenChange: v, open: y, tone: b } = e, x = l === void 0 ? "md" : l, S = g === void 0 ? "sheet" : g, C = _ === void 0 ? "bottom" : _, w = i(x), T = y !== void 0, [E, D] = s(m ?? !1), O = T ? y : E, k = !w && S === "sheet", A;
|
|
21
|
+
a[0] !== k || a[1] !== b ? (A = p(k, b), a[0] = k, a[1] = b, a[2] = A) : A = a[2];
|
|
22
|
+
let j = A, M = !w && S === "fullscreen", N = j === "drawer" && b !== void 0, P;
|
|
23
|
+
a[3] !== T || a[4] !== N || a[5] !== v ? (P = (e, t) => {
|
|
24
|
+
!e && N && !f.has(t.reason) || (T || D(e), v?.(e, t));
|
|
25
|
+
}, a[3] = T, a[4] = N, a[5] = v, a[6] = P) : P = a[6];
|
|
26
|
+
let F = P, I;
|
|
27
|
+
a[7] !== h || a[8] !== M || a[9] !== j || a[10] !== b ? (I = {
|
|
28
|
+
fullScreen: M,
|
|
29
|
+
headerExtra: h,
|
|
30
|
+
root: j,
|
|
31
|
+
tone: b
|
|
32
|
+
}, a[7] = h, a[8] = M, a[9] = j, a[10] = b, a[11] = I) : I = a[11];
|
|
33
|
+
let L = I, R;
|
|
34
|
+
a[12] !== d || a[13] !== L ? (R = /* @__PURE__ */ c(u, {
|
|
35
|
+
value: L,
|
|
36
|
+
children: d
|
|
37
|
+
}), a[12] = d, a[13] = L, a[14] = R) : R = a[14];
|
|
38
|
+
let z = R;
|
|
39
|
+
if (j === "drawer") {
|
|
40
|
+
let e;
|
|
41
|
+
a[15] === F ? e = a[16] : (e = (e, t) => F(e, { reason: t.reason }), a[15] = F, a[16] = e);
|
|
42
|
+
let t;
|
|
43
|
+
return a[17] !== O || a[18] !== z || a[19] !== N || a[20] !== C || a[21] !== e ? (t = /* @__PURE__ */ c(r, {
|
|
44
|
+
disablePointerDismissal: N,
|
|
45
|
+
open: O,
|
|
46
|
+
side: C,
|
|
47
|
+
onOpenChange: e,
|
|
48
|
+
children: z
|
|
49
|
+
}), a[17] = O, a[18] = z, a[19] = N, a[20] = C, a[21] = e, a[22] = t) : t = a[22], t;
|
|
50
|
+
}
|
|
51
|
+
if (j === "alertDialog") {
|
|
52
|
+
let e;
|
|
53
|
+
a[23] === F ? e = a[24] : (e = (e, t) => F(e, { reason: t.reason }), a[23] = F, a[24] = e);
|
|
54
|
+
let n;
|
|
55
|
+
return a[25] !== O || a[26] !== z || a[27] !== e || a[28] !== b ? (n = /* @__PURE__ */ c(t, {
|
|
56
|
+
open: O,
|
|
57
|
+
tone: b,
|
|
58
|
+
onOpenChange: e,
|
|
59
|
+
children: z
|
|
60
|
+
}), a[25] = O, a[26] = z, a[27] = e, a[28] = b, a[29] = n) : n = a[29], n;
|
|
61
|
+
}
|
|
62
|
+
let B;
|
|
63
|
+
a[30] === F ? B = a[31] : (B = (e, t) => F(e, { reason: t.reason }), a[30] = F, a[31] = B);
|
|
64
|
+
let V;
|
|
65
|
+
return a[32] !== O || a[33] !== z || a[34] !== B ? (V = /* @__PURE__ */ c(n, {
|
|
66
|
+
open: O,
|
|
67
|
+
onOpenChange: B,
|
|
68
|
+
children: z
|
|
69
|
+
}), a[32] = O, a[33] = z, a[34] = B, a[35] = V) : V = a[35], V;
|
|
70
|
+
}
|
|
71
|
+
function h(e) {
|
|
72
|
+
let i = o(9), { children: a, className: s } = e, { root: l } = d();
|
|
73
|
+
if (l === "drawer") {
|
|
74
|
+
let e;
|
|
75
|
+
return i[0] !== a || i[1] !== s ? (e = /* @__PURE__ */ c(r.Trigger, {
|
|
76
|
+
className: s,
|
|
77
|
+
children: a
|
|
78
|
+
}), i[0] = a, i[1] = s, i[2] = e) : e = i[2], e;
|
|
79
|
+
}
|
|
80
|
+
if (l === "alertDialog") {
|
|
81
|
+
let e;
|
|
82
|
+
return i[3] !== a || i[4] !== s ? (e = /* @__PURE__ */ c(t.Trigger, {
|
|
83
|
+
className: s,
|
|
84
|
+
children: a
|
|
85
|
+
}), i[3] = a, i[4] = s, i[5] = e) : e = i[5], e;
|
|
86
|
+
}
|
|
87
|
+
let u;
|
|
88
|
+
return i[6] !== a || i[7] !== s ? (u = /* @__PURE__ */ c(n.Trigger, {
|
|
89
|
+
className: s,
|
|
90
|
+
children: a
|
|
91
|
+
}), i[6] = a, i[7] = s, i[8] = u) : u = i[8], u;
|
|
92
|
+
}
|
|
93
|
+
function g(e) {
|
|
94
|
+
let i = o(14), { children: s, className: u } = e, { fullScreen: f, root: p, tone: m } = d(), h, g, _;
|
|
95
|
+
if (i[0] !== s || i[1] !== u || i[2] !== f || i[3] !== p || i[4] !== m) {
|
|
96
|
+
_ = Symbol.for("react.early_return_sentinel");
|
|
97
|
+
bb0: {
|
|
98
|
+
let e = a({
|
|
99
|
+
fullScreen: f,
|
|
100
|
+
root: p
|
|
101
|
+
});
|
|
102
|
+
if (p === "drawer") {
|
|
103
|
+
let t;
|
|
104
|
+
i[8] === m ? t = i[9] : (t = m === void 0 && /* @__PURE__ */ c(r.Handle, {}), i[8] = m, i[9] = t), _ = /* @__PURE__ */ l(r.Content, {
|
|
105
|
+
className: e.content({ class: u }),
|
|
106
|
+
children: [t, s]
|
|
107
|
+
});
|
|
108
|
+
break bb0;
|
|
109
|
+
}
|
|
110
|
+
if (p === "alertDialog") {
|
|
111
|
+
_ = /* @__PURE__ */ c(t.Content, {
|
|
112
|
+
className: e.content({ class: u }),
|
|
113
|
+
scroll: "inside",
|
|
114
|
+
children: s
|
|
115
|
+
});
|
|
116
|
+
break bb0;
|
|
117
|
+
}
|
|
118
|
+
h = n.Content, g = e.content({ class: u });
|
|
119
|
+
}
|
|
120
|
+
i[0] = s, i[1] = u, i[2] = f, i[3] = p, i[4] = m, i[5] = h, i[6] = g, i[7] = _;
|
|
121
|
+
} else h = i[5], g = i[6], _ = i[7];
|
|
122
|
+
if (_ !== Symbol.for("react.early_return_sentinel")) return _;
|
|
123
|
+
let v;
|
|
124
|
+
return i[10] !== h || i[11] !== s || i[12] !== g ? (v = /* @__PURE__ */ c(h, {
|
|
125
|
+
className: g,
|
|
126
|
+
scroll: "inside",
|
|
127
|
+
children: s
|
|
128
|
+
}), i[10] = h, i[11] = s, i[12] = g, i[13] = v) : v = i[13], v;
|
|
129
|
+
}
|
|
130
|
+
function _(e, i, a) {
|
|
131
|
+
return c(e === "drawer" ? r.Title : e === "alertDialog" ? t.Title : n.Title, {
|
|
132
|
+
className: i,
|
|
133
|
+
children: a
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
function v(e) {
|
|
137
|
+
let t = o(13), { children: n, className: r } = e, { headerExtra: i, root: s } = d(), u, f, p, m;
|
|
138
|
+
if (t[0] !== n || t[1] !== r || t[2] !== i || t[3] !== s) {
|
|
139
|
+
let e = a();
|
|
140
|
+
u = e.header(), f = "responsive-overlay-header", p = _(s, e.title({ class: r }), n), m = i ? /* @__PURE__ */ c("div", {
|
|
141
|
+
className: e.headerExtra(),
|
|
142
|
+
"data-ox-slot": "responsive-overlay-header-extra",
|
|
143
|
+
children: i
|
|
144
|
+
}) : null, t[0] = n, t[1] = r, t[2] = i, t[3] = s, t[4] = u, t[5] = f, t[6] = p, t[7] = m;
|
|
145
|
+
} else u = t[4], f = t[5], p = t[6], m = t[7];
|
|
146
|
+
let h;
|
|
147
|
+
return t[8] !== u || t[9] !== f || t[10] !== p || t[11] !== m ? (h = /* @__PURE__ */ l("div", {
|
|
148
|
+
className: u,
|
|
149
|
+
"data-ox-slot": f,
|
|
150
|
+
children: [p, m]
|
|
151
|
+
}), t[8] = u, t[9] = f, t[10] = p, t[11] = m, t[12] = h) : h = t[12], h;
|
|
152
|
+
}
|
|
153
|
+
function y(e) {
|
|
154
|
+
let i = o(10), { children: s, className: l } = e, { root: u } = d(), f, p, m;
|
|
155
|
+
if (i[0] !== s || i[1] !== l || i[2] !== u) {
|
|
156
|
+
m = Symbol.for("react.early_return_sentinel");
|
|
157
|
+
bb0: {
|
|
158
|
+
let e = a();
|
|
159
|
+
if (u === "drawer") {
|
|
160
|
+
m = /* @__PURE__ */ c(r.Description, {
|
|
161
|
+
className: e.description({ class: l }),
|
|
162
|
+
children: s
|
|
163
|
+
});
|
|
164
|
+
break bb0;
|
|
165
|
+
}
|
|
166
|
+
if (u === "alertDialog") {
|
|
167
|
+
m = /* @__PURE__ */ c(t.Description, {
|
|
168
|
+
className: e.description({ class: l }),
|
|
169
|
+
children: s
|
|
170
|
+
});
|
|
171
|
+
break bb0;
|
|
172
|
+
}
|
|
173
|
+
f = n.Description, p = e.description({ class: l });
|
|
174
|
+
}
|
|
175
|
+
i[0] = s, i[1] = l, i[2] = u, i[3] = f, i[4] = p, i[5] = m;
|
|
176
|
+
} else f = i[3], p = i[4], m = i[5];
|
|
177
|
+
if (m !== Symbol.for("react.early_return_sentinel")) return m;
|
|
178
|
+
let h;
|
|
179
|
+
return i[6] !== f || i[7] !== s || i[8] !== p ? (h = /* @__PURE__ */ c(f, {
|
|
180
|
+
className: p,
|
|
181
|
+
children: s
|
|
182
|
+
}), i[6] = f, i[7] = s, i[8] = p, i[9] = h) : h = i[9], h;
|
|
183
|
+
}
|
|
184
|
+
function b(e) {
|
|
185
|
+
let t = o(8), { children: n, className: i } = e, { root: s } = d();
|
|
186
|
+
if (s === "drawer") {
|
|
187
|
+
let e;
|
|
188
|
+
return t[0] !== n || t[1] !== i ? (e = /* @__PURE__ */ c(r.Body, {
|
|
189
|
+
className: i,
|
|
190
|
+
children: n
|
|
191
|
+
}), t[0] = n, t[1] = i, t[2] = e) : e = t[2], e;
|
|
192
|
+
}
|
|
193
|
+
let l;
|
|
194
|
+
t[3] === i ? l = t[4] : (l = a().body({ class: i }), t[3] = i, t[4] = l);
|
|
195
|
+
let u;
|
|
196
|
+
return t[5] !== n || t[6] !== l ? (u = /* @__PURE__ */ c("div", {
|
|
197
|
+
className: l,
|
|
198
|
+
"data-ox-slot": "responsive-overlay-body",
|
|
199
|
+
children: n
|
|
200
|
+
}), t[5] = n, t[6] = l, t[7] = u) : u = t[7], u;
|
|
201
|
+
}
|
|
202
|
+
function x(e) {
|
|
203
|
+
let t = o(8), { children: n, className: i } = e, { root: s } = d(), l, u;
|
|
204
|
+
if (t[0] !== n || t[1] !== i || t[2] !== s) {
|
|
205
|
+
u = Symbol.for("react.early_return_sentinel");
|
|
206
|
+
bb0: {
|
|
207
|
+
let e = a();
|
|
208
|
+
if (s === "drawer") {
|
|
209
|
+
u = /* @__PURE__ */ c(r.Footer, {
|
|
210
|
+
className: e.drawerFooter({ class: i }),
|
|
211
|
+
children: n
|
|
212
|
+
});
|
|
213
|
+
break bb0;
|
|
214
|
+
}
|
|
215
|
+
l = e.footer({ class: i });
|
|
216
|
+
}
|
|
217
|
+
t[0] = n, t[1] = i, t[2] = s, t[3] = l, t[4] = u;
|
|
218
|
+
} else l = t[3], u = t[4];
|
|
219
|
+
if (u !== Symbol.for("react.early_return_sentinel")) return u;
|
|
220
|
+
let f;
|
|
221
|
+
return t[5] !== n || t[6] !== l ? (f = /* @__PURE__ */ c("div", {
|
|
222
|
+
className: l,
|
|
223
|
+
"data-ox-slot": "responsive-overlay-actions",
|
|
224
|
+
children: n
|
|
225
|
+
}), t[5] = n, t[6] = l, t[7] = f) : f = t[7], f;
|
|
226
|
+
}
|
|
227
|
+
//#endregion
|
|
228
|
+
export { x as OxResponsiveOverlayActions, b as OxResponsiveOverlayBody, g as OxResponsiveOverlayContent, y as OxResponsiveOverlayDescription, m as OxResponsiveOverlayRoot, v as OxResponsiveOverlayTitle, h as OxResponsiveOverlayTrigger };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { VariantProps } from '../../internal/tv';
|
|
2
|
+
export declare const responsiveOverlayVariants: import('tailwind-variants').TVReturnType<{
|
|
3
|
+
root: {
|
|
4
|
+
dialog: {
|
|
5
|
+
content: string;
|
|
6
|
+
};
|
|
7
|
+
alertDialog: {
|
|
8
|
+
content: string;
|
|
9
|
+
};
|
|
10
|
+
drawer: {};
|
|
11
|
+
};
|
|
12
|
+
fullScreen: {
|
|
13
|
+
true: {
|
|
14
|
+
content: string[];
|
|
15
|
+
};
|
|
16
|
+
false: {};
|
|
17
|
+
};
|
|
18
|
+
}, {
|
|
19
|
+
content: string;
|
|
20
|
+
header: string;
|
|
21
|
+
title: string;
|
|
22
|
+
headerExtra: string;
|
|
23
|
+
description: string;
|
|
24
|
+
body: string;
|
|
25
|
+
footer: string[];
|
|
26
|
+
drawerFooter: string;
|
|
27
|
+
}, undefined, {
|
|
28
|
+
root: {
|
|
29
|
+
dialog: {
|
|
30
|
+
content: string;
|
|
31
|
+
};
|
|
32
|
+
alertDialog: {
|
|
33
|
+
content: string;
|
|
34
|
+
};
|
|
35
|
+
drawer: {};
|
|
36
|
+
};
|
|
37
|
+
fullScreen: {
|
|
38
|
+
true: {
|
|
39
|
+
content: string[];
|
|
40
|
+
};
|
|
41
|
+
false: {};
|
|
42
|
+
};
|
|
43
|
+
}, {
|
|
44
|
+
content: string;
|
|
45
|
+
header: string;
|
|
46
|
+
title: string;
|
|
47
|
+
headerExtra: string;
|
|
48
|
+
description: string;
|
|
49
|
+
body: string;
|
|
50
|
+
footer: string[];
|
|
51
|
+
drawerFooter: string;
|
|
52
|
+
}, import('tailwind-variants').TVReturnType<{
|
|
53
|
+
root: {
|
|
54
|
+
dialog: {
|
|
55
|
+
content: string;
|
|
56
|
+
};
|
|
57
|
+
alertDialog: {
|
|
58
|
+
content: string;
|
|
59
|
+
};
|
|
60
|
+
drawer: {};
|
|
61
|
+
};
|
|
62
|
+
fullScreen: {
|
|
63
|
+
true: {
|
|
64
|
+
content: string[];
|
|
65
|
+
};
|
|
66
|
+
false: {};
|
|
67
|
+
};
|
|
68
|
+
}, {
|
|
69
|
+
content: string;
|
|
70
|
+
header: string;
|
|
71
|
+
title: string;
|
|
72
|
+
headerExtra: string;
|
|
73
|
+
description: string;
|
|
74
|
+
body: string;
|
|
75
|
+
footer: string[];
|
|
76
|
+
drawerFooter: string;
|
|
77
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
78
|
+
export type ResponsiveOverlayVariants = VariantProps<typeof responsiveOverlayVariants>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { tv as e } from "../../internal/tv.js";
|
|
2
|
+
import { overlayBody as t, overlayDescription as n, overlayFooter as r, overlayFullWidthActions as i, overlayHeader as a } from "../../internal/styles/overlayFrameStyles.js";
|
|
3
|
+
//#region src/components/ResponsiveOverlay/ResponsiveOverlay.styles.ts
|
|
4
|
+
var o = e({
|
|
5
|
+
slots: {
|
|
6
|
+
content: "flex flex-col",
|
|
7
|
+
header: a,
|
|
8
|
+
title: "min-w-0 flex-1",
|
|
9
|
+
headerExtra: "shrink-0",
|
|
10
|
+
description: n,
|
|
11
|
+
body: t,
|
|
12
|
+
footer: r,
|
|
13
|
+
drawerFooter: i
|
|
14
|
+
},
|
|
15
|
+
variants: {
|
|
16
|
+
root: {
|
|
17
|
+
dialog: { content: "p-0" },
|
|
18
|
+
alertDialog: { content: "p-0" },
|
|
19
|
+
drawer: {}
|
|
20
|
+
},
|
|
21
|
+
fullScreen: {
|
|
22
|
+
true: { content: [
|
|
23
|
+
"rounded-none border-0",
|
|
24
|
+
"pointer-coarse:h-dvh pointer-coarse:w-dvw",
|
|
25
|
+
"pointer-coarse:max-h-none pointer-coarse:max-w-none"
|
|
26
|
+
] },
|
|
27
|
+
false: {}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
defaultVariants: {
|
|
31
|
+
root: "dialog",
|
|
32
|
+
fullScreen: !1
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
//#endregion
|
|
36
|
+
export { o as responsiveOverlayVariants };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DrawerSide } from '../Drawer';
|
|
3
|
+
import { OxBreakpoint } from '../../hooks/useBreakpoint/useBreakpoint.types';
|
|
4
|
+
type ResponsiveOverlayRoot = 'dialog' | 'alertDialog' | 'drawer';
|
|
5
|
+
type ResponsiveOverlayTone = 'danger' | 'warning';
|
|
6
|
+
type ResponsiveOverlayMobileMode = 'sheet' | 'fullscreen';
|
|
7
|
+
interface ResponsiveOverlayOpenChangeDetails {
|
|
8
|
+
reason: string;
|
|
9
|
+
}
|
|
10
|
+
interface OxResponsiveOverlayProps {
|
|
11
|
+
below?: OxBreakpoint;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
defaultOpen?: boolean;
|
|
14
|
+
headerExtra?: ReactNode;
|
|
15
|
+
mobile?: ResponsiveOverlayMobileMode;
|
|
16
|
+
mobileSide?: DrawerSide;
|
|
17
|
+
onOpenChange?: (open: boolean, details: ResponsiveOverlayOpenChangeDetails) => void;
|
|
18
|
+
open?: boolean;
|
|
19
|
+
tone?: ResponsiveOverlayTone;
|
|
20
|
+
}
|
|
21
|
+
interface OxResponsiveOverlayTriggerProps {
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
interface OxResponsiveOverlayContentProps {
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
interface OxResponsiveOverlayTitleProps {
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
interface OxResponsiveOverlayDescriptionProps {
|
|
34
|
+
children: ReactNode;
|
|
35
|
+
className?: string;
|
|
36
|
+
}
|
|
37
|
+
interface OxResponsiveOverlayBodyProps {
|
|
38
|
+
children: ReactNode;
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
interface OxResponsiveOverlayActionsProps {
|
|
42
|
+
children: ReactNode;
|
|
43
|
+
className?: string;
|
|
44
|
+
}
|
|
45
|
+
export type { OxResponsiveOverlayActionsProps, OxResponsiveOverlayBodyProps, OxResponsiveOverlayContentProps, OxResponsiveOverlayDescriptionProps, OxResponsiveOverlayProps, OxResponsiveOverlayTitleProps, OxResponsiveOverlayTriggerProps, ResponsiveOverlayMobileMode, ResponsiveOverlayOpenChangeDetails, ResponsiveOverlayRoot, ResponsiveOverlayTone, };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OxResponsiveOverlayActions, OxResponsiveOverlayBody, OxResponsiveOverlayContent, OxResponsiveOverlayDescription, OxResponsiveOverlayRoot, OxResponsiveOverlayTitle, OxResponsiveOverlayTrigger } from './ResponsiveOverlay';
|
|
2
|
+
declare const OxResponsiveOverlay: typeof OxResponsiveOverlayRoot & {
|
|
3
|
+
Trigger: typeof OxResponsiveOverlayTrigger;
|
|
4
|
+
Content: typeof OxResponsiveOverlayContent;
|
|
5
|
+
Title: typeof OxResponsiveOverlayTitle;
|
|
6
|
+
Description: typeof OxResponsiveOverlayDescription;
|
|
7
|
+
Body: typeof OxResponsiveOverlayBody;
|
|
8
|
+
Actions: typeof OxResponsiveOverlayActions;
|
|
9
|
+
};
|
|
10
|
+
export { OxResponsiveOverlay };
|
|
11
|
+
export type { OxResponsiveOverlayActionsProps, OxResponsiveOverlayBodyProps, OxResponsiveOverlayContentProps, OxResponsiveOverlayDescriptionProps, OxResponsiveOverlayProps, OxResponsiveOverlayTitleProps, OxResponsiveOverlayTriggerProps, ResponsiveOverlayMobileMode, ResponsiveOverlayOpenChangeDetails, ResponsiveOverlayTone, } from './ResponsiveOverlay.types';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { OxResponsiveOverlayActions as e, OxResponsiveOverlayBody as t, OxResponsiveOverlayContent as n, OxResponsiveOverlayDescription as r, OxResponsiveOverlayRoot as i, OxResponsiveOverlayTitle as a, OxResponsiveOverlayTrigger as o } from "./ResponsiveOverlay.js";
|
|
2
|
+
//#region src/components/ResponsiveOverlay/index.ts
|
|
3
|
+
var s = Object.assign(i, {
|
|
4
|
+
Trigger: o,
|
|
5
|
+
Content: n,
|
|
6
|
+
Title: a,
|
|
7
|
+
Description: r,
|
|
8
|
+
Body: t,
|
|
9
|
+
Actions: e
|
|
10
|
+
});
|
|
11
|
+
//#endregion
|
|
12
|
+
export { s as OxResponsiveOverlay };
|
|
@@ -12,9 +12,9 @@ var r = "focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:o
|
|
|
12
12
|
"border-0 bg-transparent text-body text-fg-muted",
|
|
13
13
|
"rounded-control ox-console:rounded-sm",
|
|
14
14
|
"transition-colors ease-out-quint",
|
|
15
|
-
"ox-
|
|
15
|
+
"ox-engaged:[&:not([data-active])]:bg-surface-raised ox-engaged:text-fg",
|
|
16
16
|
r,
|
|
17
|
-
"ox-disabled:opacity-50 ox-disabled:cursor-not-allowed
|
|
17
|
+
"ox-disabled:opacity-50 ox-disabled:cursor-not-allowed",
|
|
18
18
|
"data-[active]:bg-primary-soft data-[active]:font-medium data-[active]:text-fg"
|
|
19
19
|
], o = n({
|
|
20
20
|
slots: {
|
|
@@ -22,12 +22,18 @@ var r = "focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:o
|
|
|
22
22
|
header: [
|
|
23
23
|
"flex items-center shrink-0 gap-2 overflow-hidden",
|
|
24
24
|
"h-[var(--topbar-h)] px-4.5 ox-console:px-4",
|
|
25
|
+
"has-[[data-ox-slot=sidebar-menu]]:px-0",
|
|
25
26
|
"border-b border-line"
|
|
26
27
|
],
|
|
27
|
-
content: [
|
|
28
|
+
content: [
|
|
29
|
+
"flex flex-col flex-1 min-h-0 overflow-y-auto overflow-x-hidden",
|
|
30
|
+
"[&>[data-ox-slot=sidebar-menu]]:py-1.5 ox-console:[&>[data-ox-slot=sidebar-menu]]:py-1.25",
|
|
31
|
+
"[&>[data-ox-slot=sidebar-menu]:not(:first-child)]:border-t [&>[data-ox-slot=sidebar-menu]:not(:first-child)]:border-line"
|
|
32
|
+
],
|
|
28
33
|
footer: [
|
|
29
34
|
"flex items-center shrink-0 overflow-hidden mt-auto",
|
|
30
35
|
"p-3 ox-console:p-2.5",
|
|
36
|
+
"has-[[data-ox-slot=sidebar-menu]]:px-0",
|
|
31
37
|
"border-t border-line"
|
|
32
38
|
],
|
|
33
39
|
separator: "mx-2 my-1 h-px border-0 bg-line shrink-0",
|
|
@@ -48,7 +54,8 @@ var r = "focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:o
|
|
|
48
54
|
menuIcon: [
|
|
49
55
|
"inline-flex items-center justify-center shrink-0 size-4 opacity-60",
|
|
50
56
|
"transition-opacity ease-out-quint",
|
|
51
|
-
"group-hover/menu-button:opacity-100 group-data-[active]/menu-button:opacity-100",
|
|
57
|
+
"group-[&:not([data-disabled]):hover]/menu-button:opacity-100 group-data-[active]/menu-button:opacity-100",
|
|
58
|
+
"group-data-[popup-open]/menu-button:opacity-100",
|
|
52
59
|
"[&>svg]:size-full [&>svg]:shrink-0"
|
|
53
60
|
],
|
|
54
61
|
menuLabel: "flex-1 truncate min-w-0",
|
|
@@ -101,9 +108,9 @@ var r = "focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:o
|
|
|
101
108
|
"inline-flex items-center justify-center shrink-0 size-5 rounded-sm cursor-pointer",
|
|
102
109
|
"border-0 bg-transparent text-fg-subtle",
|
|
103
110
|
"transition-colors ease-out-quint",
|
|
104
|
-
"hover:text-fg hover:bg-[color-mix(in_oklab,var(--fg)_8%,transparent)]",
|
|
111
|
+
"ox-interactive:hover:text-fg ox-interactive:hover:bg-[color-mix(in_oklab,var(--fg)_8%,transparent)]",
|
|
105
112
|
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-ink",
|
|
106
|
-
"ox-disabled:
|
|
113
|
+
"ox-disabled:cursor-not-allowed ox-disabled:opacity-50",
|
|
107
114
|
"[&>svg]:size-3.5"
|
|
108
115
|
]
|
|
109
116
|
},
|