qstd 0.3.73 → 0.3.75
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/block/drawer.d.ts.map +1 -1
- package/dist/react/index.cjs +135 -130
- package/dist/react/index.css +18 -30
- package/dist/react/index.js +135 -130
- package/package.json +1 -1
- package/styled-system/styles.css +24 -40
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../src/block/drawer.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../src/block/drawer.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AA6a9B,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,gBAAgB,2CAMxD;AAID,wBAAgB,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,mBAAmB,2CAYrD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,mBAAmB,uDAkDrD"}
|
package/dist/react/index.cjs
CHANGED
|
@@ -2670,6 +2670,7 @@ var accordion_default = Accordion;
|
|
|
2670
2670
|
var MotionDiv4 = motionTags.div;
|
|
2671
2671
|
var MotionBtn2 = motionTags.button;
|
|
2672
2672
|
var breakpoint = ["(min-width: 600px)"];
|
|
2673
|
+
var mobileOvershootCoverPx = 96;
|
|
2673
2674
|
function requirePortalRootForDrawer() {
|
|
2674
2675
|
if (typeof document === "undefined") {
|
|
2675
2676
|
throw new Error(
|
|
@@ -2707,6 +2708,7 @@ function DrawerComponent(props) {
|
|
|
2707
2708
|
const dragControls = framerMotion.useDragControls();
|
|
2708
2709
|
const { open, setOpen } = useDrawer();
|
|
2709
2710
|
const { onClose, onExitComplete, ...rest } = props;
|
|
2711
|
+
const drawerBg = rest.bg ?? { base: "neutral.100", _dark: "neutral.900" };
|
|
2710
2712
|
const [mounted, setMounted] = React3__namespace.default.useState(false);
|
|
2711
2713
|
React3__namespace.default.useEffect(() => {
|
|
2712
2714
|
setMounted(true);
|
|
@@ -2801,152 +2803,155 @@ function DrawerComponent(props) {
|
|
|
2801
2803
|
initial: false,
|
|
2802
2804
|
mode: "wait",
|
|
2803
2805
|
onExitComplete,
|
|
2804
|
-
children: open && /* @__PURE__ */ jsxRuntime.
|
|
2806
|
+
children: open && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2805
2807
|
Backdrop,
|
|
2806
2808
|
{
|
|
2807
2809
|
onClick: () => onBackdropClick(),
|
|
2808
|
-
children:
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
position: "fixed",
|
|
2814
|
-
initial: "initial",
|
|
2815
|
-
animate: "animate",
|
|
2816
|
-
exit: "exit",
|
|
2817
|
-
...isDesktop ? {
|
|
2818
|
-
drag: false,
|
|
2819
|
-
style: void 0,
|
|
2820
|
-
dragControls: null,
|
|
2821
|
-
dragConstraints: void 0,
|
|
2822
|
-
// style: null,
|
|
2823
|
-
// dragConstraints: null,
|
|
2824
|
-
height: props.height ?? "max-content!",
|
|
2825
|
-
// "min(50%, 300px)",
|
|
2826
|
-
width: props.width ?? "clamp(50%, 700px, 90%)",
|
|
2827
|
-
pt: 6,
|
|
2828
|
-
// px: 4,
|
|
2829
|
-
margin: "auto",
|
|
2830
|
-
borderRadius: 12,
|
|
2831
|
-
zIndex: 1,
|
|
2832
|
-
variants: {
|
|
2833
|
-
initial: { opacity: 0, scale: 0.5 },
|
|
2834
|
-
animate: {
|
|
2835
|
-
opacity: 1,
|
|
2836
|
-
scale: 1,
|
|
2837
|
-
transition: {
|
|
2838
|
-
type: "spring",
|
|
2839
|
-
damping: 20,
|
|
2840
|
-
stiffness: 300
|
|
2841
|
-
}
|
|
2842
|
-
},
|
|
2843
|
-
exit: {
|
|
2844
|
-
opacity: 0,
|
|
2845
|
-
scale: 0.3,
|
|
2846
|
-
transition: { type: "spring", duration: 0.45 }
|
|
2847
|
-
}
|
|
2848
|
-
}
|
|
2849
|
-
} : {
|
|
2850
|
-
w: "100vw",
|
|
2810
|
+
children: [
|
|
2811
|
+
!isDesktop && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2812
|
+
MotionDiv4,
|
|
2813
|
+
{
|
|
2814
|
+
fixed: true,
|
|
2851
2815
|
left: 0,
|
|
2852
2816
|
right: 0,
|
|
2853
2817
|
bottom: 0,
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2818
|
+
h: mobileOvershootCoverPx,
|
|
2819
|
+
pointerEvents: "none",
|
|
2820
|
+
bg: drawerBg
|
|
2821
|
+
}
|
|
2822
|
+
),
|
|
2823
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2824
|
+
MotionDiv4,
|
|
2825
|
+
{
|
|
2826
|
+
grid: true,
|
|
2827
|
+
onClick: (e) => e.stopPropagation(),
|
|
2828
|
+
position: "fixed",
|
|
2829
|
+
initial: "initial",
|
|
2830
|
+
animate: "animate",
|
|
2831
|
+
exit: "exit",
|
|
2832
|
+
...isDesktop ? {
|
|
2833
|
+
drag: false,
|
|
2834
|
+
style: void 0,
|
|
2835
|
+
dragControls: null,
|
|
2836
|
+
dragConstraints: void 0,
|
|
2837
|
+
// style: null,
|
|
2838
|
+
// dragConstraints: null,
|
|
2839
|
+
height: props.height ?? "max-content!",
|
|
2840
|
+
// "min(50%, 300px)",
|
|
2841
|
+
width: props.width ?? "clamp(50%, 700px, 90%)",
|
|
2842
|
+
pt: 6,
|
|
2843
|
+
// px: 4,
|
|
2844
|
+
margin: "auto",
|
|
2845
|
+
borderRadius: 12,
|
|
2846
|
+
zIndex: 1,
|
|
2847
|
+
variants: {
|
|
2848
|
+
initial: { opacity: 0, scale: 0.5 },
|
|
2849
|
+
animate: {
|
|
2850
|
+
opacity: 1,
|
|
2851
|
+
scale: 1,
|
|
2852
|
+
transition: {
|
|
2853
|
+
type: "spring",
|
|
2854
|
+
damping: 20,
|
|
2855
|
+
stiffness: 300
|
|
2856
|
+
}
|
|
2857
|
+
},
|
|
2858
|
+
exit: {
|
|
2859
|
+
opacity: 0,
|
|
2860
|
+
scale: 0.3,
|
|
2861
|
+
transition: { type: "spring", duration: 0.45 }
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2864
|
+
} : {
|
|
2865
|
+
w: "100vw",
|
|
2861
2866
|
left: 0,
|
|
2862
2867
|
right: 0,
|
|
2863
2868
|
bottom: 0,
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2869
|
+
borderTopLeftRadius: 12,
|
|
2870
|
+
borderTopRightRadius: 12,
|
|
2871
|
+
overflow: "hidden",
|
|
2872
|
+
// Note: Can't use framer-motion's `y` prop because it conflicts
|
|
2873
|
+
// with the drag motion value. Use CSS transform instead.
|
|
2874
|
+
variants: {
|
|
2875
|
+
initial: {
|
|
2876
|
+
transform: "translateY(100%)",
|
|
2877
|
+
opacity: 0.5
|
|
2878
|
+
},
|
|
2879
|
+
animate: {
|
|
2880
|
+
transform: "translateY(0%)",
|
|
2881
|
+
opacity: 1,
|
|
2882
|
+
transition: {
|
|
2883
|
+
type: "spring",
|
|
2884
|
+
damping: 22,
|
|
2885
|
+
stiffness: 400,
|
|
2886
|
+
mass: 0.7
|
|
2887
|
+
}
|
|
2888
|
+
},
|
|
2889
|
+
exit: {
|
|
2890
|
+
transform: "translateY(100%)",
|
|
2891
|
+
opacity: 0,
|
|
2892
|
+
transition: {
|
|
2893
|
+
type: "tween",
|
|
2894
|
+
duration: 0.2,
|
|
2895
|
+
ease: [0.4, 0, 1, 1]
|
|
2896
|
+
// ease-in for quick exit
|
|
2897
|
+
}
|
|
2883
2898
|
}
|
|
2884
2899
|
},
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2900
|
+
drag: "y",
|
|
2901
|
+
style: { y },
|
|
2902
|
+
dragControls,
|
|
2903
|
+
onPointerDown: (e) => onDragStart(e),
|
|
2904
|
+
// drag={hasBackdrop ? "y" : false}
|
|
2905
|
+
dragElastic: 0,
|
|
2906
|
+
// prevent drawer from being dragged higher than what its opened to
|
|
2907
|
+
dragConstraints: { top: 0 },
|
|
2908
|
+
onDragEnd: (_, drag) => {
|
|
2909
|
+
if (props.drag === false) return;
|
|
2910
|
+
const pageHeight = document.documentElement.scrollHeight;
|
|
2911
|
+
const yCoord = drag.point.y;
|
|
2912
|
+
const velocity = drag.velocity.y;
|
|
2913
|
+
const releaseThreshold = 0.8;
|
|
2914
|
+
const releasePct = yCoord / pageHeight;
|
|
2915
|
+
if (velocity > 25 && releasePct >= releaseThreshold || velocity > 750) {
|
|
2916
|
+
props.onClose?.();
|
|
2893
2917
|
}
|
|
2894
2918
|
}
|
|
2895
2919
|
},
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2920
|
+
boxSizing: "border-box",
|
|
2921
|
+
boxShadow: "hsl(0deg 0% 0% / 60%) 0px -4px 20px",
|
|
2922
|
+
bg: { base: "neutral.100", _dark: "neutral.900" },
|
|
2923
|
+
color: "text-primary",
|
|
2924
|
+
ref,
|
|
2925
|
+
...rest,
|
|
2926
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2927
|
+
MotionDiv4,
|
|
2928
|
+
{
|
|
2929
|
+
grid: true,
|
|
2930
|
+
...isDesktop ? { position: "relative" } : { rows: "max-content 1fr" },
|
|
2931
|
+
children: [
|
|
2932
|
+
!isDesktop && props.hideHandle !== false && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2933
|
+
MotionDiv4,
|
|
2934
|
+
{
|
|
2935
|
+
grid: true,
|
|
2936
|
+
justifySelf: "center",
|
|
2937
|
+
h: 6,
|
|
2938
|
+
w: 34,
|
|
2939
|
+
mt: "16px",
|
|
2940
|
+
mb: 4,
|
|
2941
|
+
br: 20,
|
|
2942
|
+
bg: { base: "neutral.400", _dark: "neutral.600" },
|
|
2943
|
+
cursor: props.drag ? "row-resize" : "default",
|
|
2944
|
+
ref: dragHandleRef
|
|
2945
|
+
}
|
|
2946
|
+
),
|
|
2947
|
+
props.children
|
|
2948
|
+
]
|
|
2913
2949
|
}
|
|
2914
|
-
|
|
2950
|
+
)
|
|
2915
2951
|
},
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
color: "text-primary",
|
|
2920
|
-
ref,
|
|
2921
|
-
...rest,
|
|
2922
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2923
|
-
MotionDiv4,
|
|
2924
|
-
{
|
|
2925
|
-
grid: true,
|
|
2926
|
-
...isDesktop ? { position: "relative" } : { rows: "max-content 1fr" },
|
|
2927
|
-
children: [
|
|
2928
|
-
!isDesktop && props.hideHandle !== false && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2929
|
-
MotionDiv4,
|
|
2930
|
-
{
|
|
2931
|
-
grid: true,
|
|
2932
|
-
justifySelf: "center",
|
|
2933
|
-
h: 6,
|
|
2934
|
-
w: 34,
|
|
2935
|
-
mt: "16px",
|
|
2936
|
-
mb: 4,
|
|
2937
|
-
br: 20,
|
|
2938
|
-
bg: { base: "neutral.400", _dark: "neutral.600" },
|
|
2939
|
-
cursor: props.drag ? "row-resize" : "default",
|
|
2940
|
-
ref: dragHandleRef
|
|
2941
|
-
}
|
|
2942
|
-
),
|
|
2943
|
-
props.children
|
|
2944
|
-
]
|
|
2945
|
-
}
|
|
2946
|
-
)
|
|
2947
|
-
},
|
|
2948
|
-
"drawer"
|
|
2949
|
-
)
|
|
2952
|
+
"drawer"
|
|
2953
|
+
)
|
|
2954
|
+
]
|
|
2950
2955
|
}
|
|
2951
2956
|
)
|
|
2952
2957
|
}
|
package/dist/react/index.css
CHANGED
|
@@ -996,6 +996,12 @@
|
|
|
996
996
|
.stk-w_4 path {
|
|
997
997
|
stroke-width: 4;
|
|
998
998
|
}
|
|
999
|
+
.fixed_true {
|
|
1000
|
+
position: fixed;
|
|
1001
|
+
}
|
|
1002
|
+
.pointer-events_none {
|
|
1003
|
+
pointer-events: none;
|
|
1004
|
+
}
|
|
999
1005
|
.pos_fixed {
|
|
1000
1006
|
position: fixed;
|
|
1001
1007
|
}
|
|
@@ -1109,9 +1115,6 @@
|
|
|
1109
1115
|
.grid-af_column {
|
|
1110
1116
|
grid-auto-flow: column;
|
|
1111
1117
|
}
|
|
1112
|
-
.pointer-events_none {
|
|
1113
|
-
pointer-events: none;
|
|
1114
|
-
}
|
|
1115
1118
|
.trf-o_top_left {
|
|
1116
1119
|
transform-origin: top left;
|
|
1117
1120
|
}
|
|
@@ -1236,6 +1239,18 @@
|
|
|
1236
1239
|
.w_100\% {
|
|
1237
1240
|
width: 100%;
|
|
1238
1241
|
}
|
|
1242
|
+
.left_0 {
|
|
1243
|
+
left: var(--spacing-0);
|
|
1244
|
+
}
|
|
1245
|
+
.right_0 {
|
|
1246
|
+
right: var(--spacing-0);
|
|
1247
|
+
}
|
|
1248
|
+
.bottom_0 {
|
|
1249
|
+
bottom: var(--spacing-0);
|
|
1250
|
+
}
|
|
1251
|
+
.h_96 {
|
|
1252
|
+
height: 96px;
|
|
1253
|
+
}
|
|
1239
1254
|
.h_max-content\! {
|
|
1240
1255
|
height: max-content !important;
|
|
1241
1256
|
}
|
|
@@ -1248,15 +1263,6 @@
|
|
|
1248
1263
|
.w_100vw {
|
|
1249
1264
|
width: 100vw;
|
|
1250
1265
|
}
|
|
1251
|
-
.left_0 {
|
|
1252
|
-
left: var(--spacing-0);
|
|
1253
|
-
}
|
|
1254
|
-
.right_0 {
|
|
1255
|
-
right: var(--spacing-0);
|
|
1256
|
-
}
|
|
1257
|
-
.bottom_0 {
|
|
1258
|
-
bottom: var(--spacing-0);
|
|
1259
|
-
}
|
|
1260
1266
|
.bdr-tl_12 {
|
|
1261
1267
|
border-top-left-radius: 12px;
|
|
1262
1268
|
}
|
|
@@ -1380,9 +1386,6 @@
|
|
|
1380
1386
|
[data-theme=dark] .dark\:bg_neutral\.900 {
|
|
1381
1387
|
background: var(--colors-neutral-900);
|
|
1382
1388
|
}
|
|
1383
|
-
.after\:bg_inherit::after {
|
|
1384
|
-
background: inherit;
|
|
1385
|
-
}
|
|
1386
1389
|
[data-theme=dark] .dark\:bg_neutral\.600 {
|
|
1387
1390
|
background: var(--colors-neutral-600);
|
|
1388
1391
|
}
|
|
@@ -1422,9 +1425,6 @@
|
|
|
1422
1425
|
.after\:pos_absolute::after {
|
|
1423
1426
|
position: absolute;
|
|
1424
1427
|
}
|
|
1425
|
-
.after\:trf_translateY\(100\%\)::after {
|
|
1426
|
-
transform: translateY(100%);
|
|
1427
|
-
}
|
|
1428
1428
|
.after\:scale_0::after {
|
|
1429
1429
|
scale: 0;
|
|
1430
1430
|
}
|
|
@@ -1466,18 +1466,6 @@
|
|
|
1466
1466
|
.\[\&\:\:-webkit-scrollbar-thumb\]\:bg-c_neutral\.300::-webkit-scrollbar-thumb {
|
|
1467
1467
|
background-color: var(--colors-neutral-300);
|
|
1468
1468
|
}
|
|
1469
|
-
.after\:left_0::after {
|
|
1470
|
-
left: var(--spacing-0);
|
|
1471
|
-
}
|
|
1472
|
-
.after\:right_0::after {
|
|
1473
|
-
right: var(--spacing-0);
|
|
1474
|
-
}
|
|
1475
|
-
.after\:bottom_0::after {
|
|
1476
|
-
bottom: var(--spacing-0);
|
|
1477
|
-
}
|
|
1478
|
-
.after\:h_100::after {
|
|
1479
|
-
height: 100px;
|
|
1480
|
-
}
|
|
1481
1469
|
.\[\&\:\:-webkit-scrollbar\]\:h_6::-webkit-scrollbar {
|
|
1482
1470
|
height: 6px;
|
|
1483
1471
|
}
|
package/dist/react/index.js
CHANGED
|
@@ -2647,6 +2647,7 @@ var accordion_default = Accordion;
|
|
|
2647
2647
|
var MotionDiv4 = motionTags.div;
|
|
2648
2648
|
var MotionBtn2 = motionTags.button;
|
|
2649
2649
|
var breakpoint = ["(min-width: 600px)"];
|
|
2650
|
+
var mobileOvershootCoverPx = 96;
|
|
2650
2651
|
function requirePortalRootForDrawer() {
|
|
2651
2652
|
if (typeof document === "undefined") {
|
|
2652
2653
|
throw new Error(
|
|
@@ -2684,6 +2685,7 @@ function DrawerComponent(props) {
|
|
|
2684
2685
|
const dragControls = useDragControls();
|
|
2685
2686
|
const { open, setOpen } = useDrawer();
|
|
2686
2687
|
const { onClose, onExitComplete, ...rest } = props;
|
|
2688
|
+
const drawerBg = rest.bg ?? { base: "neutral.100", _dark: "neutral.900" };
|
|
2687
2689
|
const [mounted, setMounted] = React3__default.useState(false);
|
|
2688
2690
|
React3__default.useEffect(() => {
|
|
2689
2691
|
setMounted(true);
|
|
@@ -2778,152 +2780,155 @@ function DrawerComponent(props) {
|
|
|
2778
2780
|
initial: false,
|
|
2779
2781
|
mode: "wait",
|
|
2780
2782
|
onExitComplete,
|
|
2781
|
-
children: open && /* @__PURE__ */
|
|
2783
|
+
children: open && /* @__PURE__ */ jsxs(
|
|
2782
2784
|
Backdrop,
|
|
2783
2785
|
{
|
|
2784
2786
|
onClick: () => onBackdropClick(),
|
|
2785
|
-
children:
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
position: "fixed",
|
|
2791
|
-
initial: "initial",
|
|
2792
|
-
animate: "animate",
|
|
2793
|
-
exit: "exit",
|
|
2794
|
-
...isDesktop ? {
|
|
2795
|
-
drag: false,
|
|
2796
|
-
style: void 0,
|
|
2797
|
-
dragControls: null,
|
|
2798
|
-
dragConstraints: void 0,
|
|
2799
|
-
// style: null,
|
|
2800
|
-
// dragConstraints: null,
|
|
2801
|
-
height: props.height ?? "max-content!",
|
|
2802
|
-
// "min(50%, 300px)",
|
|
2803
|
-
width: props.width ?? "clamp(50%, 700px, 90%)",
|
|
2804
|
-
pt: 6,
|
|
2805
|
-
// px: 4,
|
|
2806
|
-
margin: "auto",
|
|
2807
|
-
borderRadius: 12,
|
|
2808
|
-
zIndex: 1,
|
|
2809
|
-
variants: {
|
|
2810
|
-
initial: { opacity: 0, scale: 0.5 },
|
|
2811
|
-
animate: {
|
|
2812
|
-
opacity: 1,
|
|
2813
|
-
scale: 1,
|
|
2814
|
-
transition: {
|
|
2815
|
-
type: "spring",
|
|
2816
|
-
damping: 20,
|
|
2817
|
-
stiffness: 300
|
|
2818
|
-
}
|
|
2819
|
-
},
|
|
2820
|
-
exit: {
|
|
2821
|
-
opacity: 0,
|
|
2822
|
-
scale: 0.3,
|
|
2823
|
-
transition: { type: "spring", duration: 0.45 }
|
|
2824
|
-
}
|
|
2825
|
-
}
|
|
2826
|
-
} : {
|
|
2827
|
-
w: "100vw",
|
|
2787
|
+
children: [
|
|
2788
|
+
!isDesktop && /* @__PURE__ */ jsx(
|
|
2789
|
+
MotionDiv4,
|
|
2790
|
+
{
|
|
2791
|
+
fixed: true,
|
|
2828
2792
|
left: 0,
|
|
2829
2793
|
right: 0,
|
|
2830
2794
|
bottom: 0,
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2795
|
+
h: mobileOvershootCoverPx,
|
|
2796
|
+
pointerEvents: "none",
|
|
2797
|
+
bg: drawerBg
|
|
2798
|
+
}
|
|
2799
|
+
),
|
|
2800
|
+
/* @__PURE__ */ jsx(
|
|
2801
|
+
MotionDiv4,
|
|
2802
|
+
{
|
|
2803
|
+
grid: true,
|
|
2804
|
+
onClick: (e) => e.stopPropagation(),
|
|
2805
|
+
position: "fixed",
|
|
2806
|
+
initial: "initial",
|
|
2807
|
+
animate: "animate",
|
|
2808
|
+
exit: "exit",
|
|
2809
|
+
...isDesktop ? {
|
|
2810
|
+
drag: false,
|
|
2811
|
+
style: void 0,
|
|
2812
|
+
dragControls: null,
|
|
2813
|
+
dragConstraints: void 0,
|
|
2814
|
+
// style: null,
|
|
2815
|
+
// dragConstraints: null,
|
|
2816
|
+
height: props.height ?? "max-content!",
|
|
2817
|
+
// "min(50%, 300px)",
|
|
2818
|
+
width: props.width ?? "clamp(50%, 700px, 90%)",
|
|
2819
|
+
pt: 6,
|
|
2820
|
+
// px: 4,
|
|
2821
|
+
margin: "auto",
|
|
2822
|
+
borderRadius: 12,
|
|
2823
|
+
zIndex: 1,
|
|
2824
|
+
variants: {
|
|
2825
|
+
initial: { opacity: 0, scale: 0.5 },
|
|
2826
|
+
animate: {
|
|
2827
|
+
opacity: 1,
|
|
2828
|
+
scale: 1,
|
|
2829
|
+
transition: {
|
|
2830
|
+
type: "spring",
|
|
2831
|
+
damping: 20,
|
|
2832
|
+
stiffness: 300
|
|
2833
|
+
}
|
|
2834
|
+
},
|
|
2835
|
+
exit: {
|
|
2836
|
+
opacity: 0,
|
|
2837
|
+
scale: 0.3,
|
|
2838
|
+
transition: { type: "spring", duration: 0.45 }
|
|
2839
|
+
}
|
|
2840
|
+
}
|
|
2841
|
+
} : {
|
|
2842
|
+
w: "100vw",
|
|
2838
2843
|
left: 0,
|
|
2839
2844
|
right: 0,
|
|
2840
2845
|
bottom: 0,
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2846
|
+
borderTopLeftRadius: 12,
|
|
2847
|
+
borderTopRightRadius: 12,
|
|
2848
|
+
overflow: "hidden",
|
|
2849
|
+
// Note: Can't use framer-motion's `y` prop because it conflicts
|
|
2850
|
+
// with the drag motion value. Use CSS transform instead.
|
|
2851
|
+
variants: {
|
|
2852
|
+
initial: {
|
|
2853
|
+
transform: "translateY(100%)",
|
|
2854
|
+
opacity: 0.5
|
|
2855
|
+
},
|
|
2856
|
+
animate: {
|
|
2857
|
+
transform: "translateY(0%)",
|
|
2858
|
+
opacity: 1,
|
|
2859
|
+
transition: {
|
|
2860
|
+
type: "spring",
|
|
2861
|
+
damping: 22,
|
|
2862
|
+
stiffness: 400,
|
|
2863
|
+
mass: 0.7
|
|
2864
|
+
}
|
|
2865
|
+
},
|
|
2866
|
+
exit: {
|
|
2867
|
+
transform: "translateY(100%)",
|
|
2868
|
+
opacity: 0,
|
|
2869
|
+
transition: {
|
|
2870
|
+
type: "tween",
|
|
2871
|
+
duration: 0.2,
|
|
2872
|
+
ease: [0.4, 0, 1, 1]
|
|
2873
|
+
// ease-in for quick exit
|
|
2874
|
+
}
|
|
2860
2875
|
}
|
|
2861
2876
|
},
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2877
|
+
drag: "y",
|
|
2878
|
+
style: { y },
|
|
2879
|
+
dragControls,
|
|
2880
|
+
onPointerDown: (e) => onDragStart(e),
|
|
2881
|
+
// drag={hasBackdrop ? "y" : false}
|
|
2882
|
+
dragElastic: 0,
|
|
2883
|
+
// prevent drawer from being dragged higher than what its opened to
|
|
2884
|
+
dragConstraints: { top: 0 },
|
|
2885
|
+
onDragEnd: (_, drag) => {
|
|
2886
|
+
if (props.drag === false) return;
|
|
2887
|
+
const pageHeight = document.documentElement.scrollHeight;
|
|
2888
|
+
const yCoord = drag.point.y;
|
|
2889
|
+
const velocity = drag.velocity.y;
|
|
2890
|
+
const releaseThreshold = 0.8;
|
|
2891
|
+
const releasePct = yCoord / pageHeight;
|
|
2892
|
+
if (velocity > 25 && releasePct >= releaseThreshold || velocity > 750) {
|
|
2893
|
+
props.onClose?.();
|
|
2870
2894
|
}
|
|
2871
2895
|
}
|
|
2872
2896
|
},
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2897
|
+
boxSizing: "border-box",
|
|
2898
|
+
boxShadow: "hsl(0deg 0% 0% / 60%) 0px -4px 20px",
|
|
2899
|
+
bg: { base: "neutral.100", _dark: "neutral.900" },
|
|
2900
|
+
color: "text-primary",
|
|
2901
|
+
ref,
|
|
2902
|
+
...rest,
|
|
2903
|
+
children: /* @__PURE__ */ jsxs(
|
|
2904
|
+
MotionDiv4,
|
|
2905
|
+
{
|
|
2906
|
+
grid: true,
|
|
2907
|
+
...isDesktop ? { position: "relative" } : { rows: "max-content 1fr" },
|
|
2908
|
+
children: [
|
|
2909
|
+
!isDesktop && props.hideHandle !== false && /* @__PURE__ */ jsx(
|
|
2910
|
+
MotionDiv4,
|
|
2911
|
+
{
|
|
2912
|
+
grid: true,
|
|
2913
|
+
justifySelf: "center",
|
|
2914
|
+
h: 6,
|
|
2915
|
+
w: 34,
|
|
2916
|
+
mt: "16px",
|
|
2917
|
+
mb: 4,
|
|
2918
|
+
br: 20,
|
|
2919
|
+
bg: { base: "neutral.400", _dark: "neutral.600" },
|
|
2920
|
+
cursor: props.drag ? "row-resize" : "default",
|
|
2921
|
+
ref: dragHandleRef
|
|
2922
|
+
}
|
|
2923
|
+
),
|
|
2924
|
+
props.children
|
|
2925
|
+
]
|
|
2890
2926
|
}
|
|
2891
|
-
|
|
2927
|
+
)
|
|
2892
2928
|
},
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
color: "text-primary",
|
|
2897
|
-
ref,
|
|
2898
|
-
...rest,
|
|
2899
|
-
children: /* @__PURE__ */ jsxs(
|
|
2900
|
-
MotionDiv4,
|
|
2901
|
-
{
|
|
2902
|
-
grid: true,
|
|
2903
|
-
...isDesktop ? { position: "relative" } : { rows: "max-content 1fr" },
|
|
2904
|
-
children: [
|
|
2905
|
-
!isDesktop && props.hideHandle !== false && /* @__PURE__ */ jsx(
|
|
2906
|
-
MotionDiv4,
|
|
2907
|
-
{
|
|
2908
|
-
grid: true,
|
|
2909
|
-
justifySelf: "center",
|
|
2910
|
-
h: 6,
|
|
2911
|
-
w: 34,
|
|
2912
|
-
mt: "16px",
|
|
2913
|
-
mb: 4,
|
|
2914
|
-
br: 20,
|
|
2915
|
-
bg: { base: "neutral.400", _dark: "neutral.600" },
|
|
2916
|
-
cursor: props.drag ? "row-resize" : "default",
|
|
2917
|
-
ref: dragHandleRef
|
|
2918
|
-
}
|
|
2919
|
-
),
|
|
2920
|
-
props.children
|
|
2921
|
-
]
|
|
2922
|
-
}
|
|
2923
|
-
)
|
|
2924
|
-
},
|
|
2925
|
-
"drawer"
|
|
2926
|
-
)
|
|
2929
|
+
"drawer"
|
|
2930
|
+
)
|
|
2931
|
+
]
|
|
2927
2932
|
}
|
|
2928
2933
|
)
|
|
2929
2934
|
}
|
package/package.json
CHANGED
package/styled-system/styles.css
CHANGED
|
@@ -1017,6 +1017,14 @@
|
|
|
1017
1017
|
stroke-width: 4;
|
|
1018
1018
|
}
|
|
1019
1019
|
|
|
1020
|
+
.fixed_true {
|
|
1021
|
+
position: fixed;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
.pointer-events_none {
|
|
1025
|
+
pointer-events: none;
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1020
1028
|
.pos_fixed {
|
|
1021
1029
|
position: fixed;
|
|
1022
1030
|
}
|
|
@@ -1159,10 +1167,6 @@
|
|
|
1159
1167
|
grid-auto-flow: column;
|
|
1160
1168
|
}
|
|
1161
1169
|
|
|
1162
|
-
.pointer-events_none {
|
|
1163
|
-
pointer-events: none;
|
|
1164
|
-
}
|
|
1165
|
-
|
|
1166
1170
|
.trf-o_top_left {
|
|
1167
1171
|
transform-origin: top left;
|
|
1168
1172
|
}
|
|
@@ -1327,6 +1331,22 @@
|
|
|
1327
1331
|
width: 100%;
|
|
1328
1332
|
}
|
|
1329
1333
|
|
|
1334
|
+
.left_0 {
|
|
1335
|
+
left: var(--spacing-0);
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
.right_0 {
|
|
1339
|
+
right: var(--spacing-0);
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
.bottom_0 {
|
|
1343
|
+
bottom: var(--spacing-0);
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
.h_96 {
|
|
1347
|
+
height: 96px;
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1330
1350
|
.h_max-content\! {
|
|
1331
1351
|
height: max-content !important;
|
|
1332
1352
|
}
|
|
@@ -1343,18 +1363,6 @@
|
|
|
1343
1363
|
width: 100vw;
|
|
1344
1364
|
}
|
|
1345
1365
|
|
|
1346
|
-
.left_0 {
|
|
1347
|
-
left: var(--spacing-0);
|
|
1348
|
-
}
|
|
1349
|
-
|
|
1350
|
-
.right_0 {
|
|
1351
|
-
right: var(--spacing-0);
|
|
1352
|
-
}
|
|
1353
|
-
|
|
1354
|
-
.bottom_0 {
|
|
1355
|
-
bottom: var(--spacing-0);
|
|
1356
|
-
}
|
|
1357
|
-
|
|
1358
1366
|
.bdr-tl_12 {
|
|
1359
1367
|
border-top-left-radius: 12px;
|
|
1360
1368
|
}
|
|
@@ -1519,10 +1527,6 @@
|
|
|
1519
1527
|
background: var(--colors-neutral-900);
|
|
1520
1528
|
}
|
|
1521
1529
|
|
|
1522
|
-
.after\:bg_inherit::after {
|
|
1523
|
-
background: inherit;
|
|
1524
|
-
}
|
|
1525
|
-
|
|
1526
1530
|
[data-theme=dark] .dark\:bg_neutral\.600 {
|
|
1527
1531
|
background: var(--colors-neutral-600);
|
|
1528
1532
|
}
|
|
@@ -1575,10 +1579,6 @@
|
|
|
1575
1579
|
position: absolute;
|
|
1576
1580
|
}
|
|
1577
1581
|
|
|
1578
|
-
.after\:trf_translateY\(100\%\)::after {
|
|
1579
|
-
transform: translateY(100%);
|
|
1580
|
-
}
|
|
1581
|
-
|
|
1582
1582
|
.after\:scale_0::after {
|
|
1583
1583
|
scale: 0;
|
|
1584
1584
|
}
|
|
@@ -1623,22 +1623,6 @@
|
|
|
1623
1623
|
background-color: var(--colors-neutral-300);
|
|
1624
1624
|
}
|
|
1625
1625
|
|
|
1626
|
-
.after\:left_0::after {
|
|
1627
|
-
left: var(--spacing-0);
|
|
1628
|
-
}
|
|
1629
|
-
|
|
1630
|
-
.after\:right_0::after {
|
|
1631
|
-
right: var(--spacing-0);
|
|
1632
|
-
}
|
|
1633
|
-
|
|
1634
|
-
.after\:bottom_0::after {
|
|
1635
|
-
bottom: var(--spacing-0);
|
|
1636
|
-
}
|
|
1637
|
-
|
|
1638
|
-
.after\:h_100::after {
|
|
1639
|
-
height: 100px;
|
|
1640
|
-
}
|
|
1641
|
-
|
|
1642
1626
|
.\[\&\:\:-webkit-scrollbar\]\:h_6::-webkit-scrollbar {
|
|
1643
1627
|
height: 6px;
|
|
1644
1628
|
}
|