qstd 0.3.74 → 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 +116 -115
- package/dist/react/index.css +23 -23
- package/dist/react/index.js +116 -115
- package/package.json +1 -1
- package/styled-system/styles.css +30 -29
|
@@ -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,115 +2803,127 @@ 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
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
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",
|
|
2866
|
+
left: 0,
|
|
2867
|
+
right: 0,
|
|
2868
|
+
bottom: 0,
|
|
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
|
+
}
|
|
2872
2898
|
}
|
|
2873
2899
|
},
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
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?.();
|
|
2882
2917
|
}
|
|
2883
2918
|
}
|
|
2884
2919
|
},
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
dragConstraints: { top: 0 },
|
|
2893
|
-
onDragEnd: (_, drag) => {
|
|
2894
|
-
if (props.drag === false) return;
|
|
2895
|
-
const pageHeight = document.documentElement.scrollHeight;
|
|
2896
|
-
const yCoord = drag.point.y;
|
|
2897
|
-
const velocity = drag.velocity.y;
|
|
2898
|
-
const releaseThreshold = 0.8;
|
|
2899
|
-
const releasePct = yCoord / pageHeight;
|
|
2900
|
-
if (velocity > 25 && releasePct >= releaseThreshold || velocity > 750) {
|
|
2901
|
-
props.onClose?.();
|
|
2902
|
-
}
|
|
2903
|
-
}
|
|
2904
|
-
},
|
|
2905
|
-
boxSizing: "border-box",
|
|
2906
|
-
boxShadow: "hsl(0deg 0% 0% / 60%) 0px -4px 20px",
|
|
2907
|
-
bg: { base: "neutral.100", _dark: "neutral.900" },
|
|
2908
|
-
color: "text-primary",
|
|
2909
|
-
ref,
|
|
2910
|
-
...rest,
|
|
2911
|
-
children: [
|
|
2912
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
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(
|
|
2913
2927
|
MotionDiv4,
|
|
2914
2928
|
{
|
|
2915
2929
|
grid: true,
|
|
@@ -2933,24 +2947,11 @@ function DrawerComponent(props) {
|
|
|
2933
2947
|
props.children
|
|
2934
2948
|
]
|
|
2935
2949
|
}
|
|
2936
|
-
),
|
|
2937
|
-
!isDesktop && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2938
|
-
MotionDiv4,
|
|
2939
|
-
{
|
|
2940
|
-
position: "absolute",
|
|
2941
|
-
left: 0,
|
|
2942
|
-
right: 0,
|
|
2943
|
-
bottom: 0,
|
|
2944
|
-
h: 100,
|
|
2945
|
-
transform: "translateY(100%)",
|
|
2946
|
-
bg: { base: "neutral.100", _dark: "neutral.900" },
|
|
2947
|
-
pointerEvents: "none"
|
|
2948
|
-
}
|
|
2949
2950
|
)
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2951
|
+
},
|
|
2952
|
+
"drawer"
|
|
2953
|
+
)
|
|
2954
|
+
]
|
|
2954
2955
|
}
|
|
2955
2956
|
)
|
|
2956
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
|
}
|
|
@@ -1020,24 +1026,18 @@
|
|
|
1020
1026
|
.justify-self_center {
|
|
1021
1027
|
justify-self: center;
|
|
1022
1028
|
}
|
|
1023
|
-
.pos_absolute {
|
|
1024
|
-
position: absolute;
|
|
1025
|
-
}
|
|
1026
|
-
.trf_translateY\(100\%\) {
|
|
1027
|
-
transform: translateY(100%);
|
|
1028
|
-
}
|
|
1029
|
-
.pointer-events_none {
|
|
1030
|
-
pointer-events: none;
|
|
1031
|
-
}
|
|
1032
1029
|
.rg_14 {
|
|
1033
1030
|
row-gap: 14px;
|
|
1034
1031
|
}
|
|
1035
|
-
.place-i_true
|
|
1036
|
-
.center_true {
|
|
1032
|
+
.place-i_true {
|
|
1037
1033
|
place-items: center;
|
|
1038
1034
|
}
|
|
1035
|
+
.pos_absolute {
|
|
1036
|
+
position: absolute;
|
|
1037
|
+
}
|
|
1039
1038
|
.center_true {
|
|
1040
1039
|
place-content: center;
|
|
1040
|
+
place-items: center;
|
|
1041
1041
|
}
|
|
1042
1042
|
.fs_16 {
|
|
1043
1043
|
font-size: 16px;
|
|
@@ -1239,6 +1239,18 @@
|
|
|
1239
1239
|
.w_100\% {
|
|
1240
1240
|
width: 100%;
|
|
1241
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
|
+
}
|
|
1242
1254
|
.h_max-content\! {
|
|
1243
1255
|
height: max-content !important;
|
|
1244
1256
|
}
|
|
@@ -1251,15 +1263,6 @@
|
|
|
1251
1263
|
.w_100vw {
|
|
1252
1264
|
width: 100vw;
|
|
1253
1265
|
}
|
|
1254
|
-
.left_0 {
|
|
1255
|
-
left: var(--spacing-0);
|
|
1256
|
-
}
|
|
1257
|
-
.right_0 {
|
|
1258
|
-
right: var(--spacing-0);
|
|
1259
|
-
}
|
|
1260
|
-
.bottom_0 {
|
|
1261
|
-
bottom: var(--spacing-0);
|
|
1262
|
-
}
|
|
1263
1266
|
.bdr-tl_12 {
|
|
1264
1267
|
border-top-left-radius: 12px;
|
|
1265
1268
|
}
|
|
@@ -1278,9 +1281,6 @@
|
|
|
1278
1281
|
.mb_4 {
|
|
1279
1282
|
margin-bottom: var(--spacing-4);
|
|
1280
1283
|
}
|
|
1281
|
-
.h_100 {
|
|
1282
|
-
height: 100px;
|
|
1283
|
-
}
|
|
1284
1284
|
.top_0 {
|
|
1285
1285
|
top: var(--spacing-0);
|
|
1286
1286
|
}
|
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,115 +2780,127 @@ 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
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
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",
|
|
2843
|
+
left: 0,
|
|
2844
|
+
right: 0,
|
|
2845
|
+
bottom: 0,
|
|
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
|
+
}
|
|
2849
2875
|
}
|
|
2850
2876
|
},
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
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?.();
|
|
2859
2894
|
}
|
|
2860
2895
|
}
|
|
2861
2896
|
},
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
dragConstraints: { top: 0 },
|
|
2870
|
-
onDragEnd: (_, drag) => {
|
|
2871
|
-
if (props.drag === false) return;
|
|
2872
|
-
const pageHeight = document.documentElement.scrollHeight;
|
|
2873
|
-
const yCoord = drag.point.y;
|
|
2874
|
-
const velocity = drag.velocity.y;
|
|
2875
|
-
const releaseThreshold = 0.8;
|
|
2876
|
-
const releasePct = yCoord / pageHeight;
|
|
2877
|
-
if (velocity > 25 && releasePct >= releaseThreshold || velocity > 750) {
|
|
2878
|
-
props.onClose?.();
|
|
2879
|
-
}
|
|
2880
|
-
}
|
|
2881
|
-
},
|
|
2882
|
-
boxSizing: "border-box",
|
|
2883
|
-
boxShadow: "hsl(0deg 0% 0% / 60%) 0px -4px 20px",
|
|
2884
|
-
bg: { base: "neutral.100", _dark: "neutral.900" },
|
|
2885
|
-
color: "text-primary",
|
|
2886
|
-
ref,
|
|
2887
|
-
...rest,
|
|
2888
|
-
children: [
|
|
2889
|
-
/* @__PURE__ */ jsxs(
|
|
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(
|
|
2890
2904
|
MotionDiv4,
|
|
2891
2905
|
{
|
|
2892
2906
|
grid: true,
|
|
@@ -2910,24 +2924,11 @@ function DrawerComponent(props) {
|
|
|
2910
2924
|
props.children
|
|
2911
2925
|
]
|
|
2912
2926
|
}
|
|
2913
|
-
),
|
|
2914
|
-
!isDesktop && /* @__PURE__ */ jsx(
|
|
2915
|
-
MotionDiv4,
|
|
2916
|
-
{
|
|
2917
|
-
position: "absolute",
|
|
2918
|
-
left: 0,
|
|
2919
|
-
right: 0,
|
|
2920
|
-
bottom: 0,
|
|
2921
|
-
h: 100,
|
|
2922
|
-
transform: "translateY(100%)",
|
|
2923
|
-
bg: { base: "neutral.100", _dark: "neutral.900" },
|
|
2924
|
-
pointerEvents: "none"
|
|
2925
|
-
}
|
|
2926
2927
|
)
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2928
|
+
},
|
|
2929
|
+
"drawer"
|
|
2930
|
+
)
|
|
2931
|
+
]
|
|
2931
2932
|
}
|
|
2932
2933
|
)
|
|
2933
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
|
}
|
|
@@ -1049,28 +1057,21 @@
|
|
|
1049
1057
|
justify-self: center;
|
|
1050
1058
|
}
|
|
1051
1059
|
|
|
1052
|
-
.pos_absolute {
|
|
1053
|
-
position: absolute;
|
|
1054
|
-
}
|
|
1055
|
-
|
|
1056
|
-
.trf_translateY\(100\%\) {
|
|
1057
|
-
transform: translateY(100%);
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
.pointer-events_none {
|
|
1061
|
-
pointer-events: none;
|
|
1062
|
-
}
|
|
1063
|
-
|
|
1064
1060
|
.rg_14 {
|
|
1065
1061
|
row-gap: 14px;
|
|
1066
1062
|
}
|
|
1067
1063
|
|
|
1068
|
-
.place-i_true
|
|
1064
|
+
.place-i_true {
|
|
1069
1065
|
place-items: center;
|
|
1070
1066
|
}
|
|
1071
1067
|
|
|
1068
|
+
.pos_absolute {
|
|
1069
|
+
position: absolute;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
1072
|
.center_true {
|
|
1073
1073
|
place-content: center;
|
|
1074
|
+
place-items: center;
|
|
1074
1075
|
}
|
|
1075
1076
|
|
|
1076
1077
|
.fs_16 {
|
|
@@ -1330,6 +1331,22 @@
|
|
|
1330
1331
|
width: 100%;
|
|
1331
1332
|
}
|
|
1332
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
|
+
|
|
1333
1350
|
.h_max-content\! {
|
|
1334
1351
|
height: max-content !important;
|
|
1335
1352
|
}
|
|
@@ -1346,18 +1363,6 @@
|
|
|
1346
1363
|
width: 100vw;
|
|
1347
1364
|
}
|
|
1348
1365
|
|
|
1349
|
-
.left_0 {
|
|
1350
|
-
left: var(--spacing-0);
|
|
1351
|
-
}
|
|
1352
|
-
|
|
1353
|
-
.right_0 {
|
|
1354
|
-
right: var(--spacing-0);
|
|
1355
|
-
}
|
|
1356
|
-
|
|
1357
|
-
.bottom_0 {
|
|
1358
|
-
bottom: var(--spacing-0);
|
|
1359
|
-
}
|
|
1360
|
-
|
|
1361
1366
|
.bdr-tl_12 {
|
|
1362
1367
|
border-top-left-radius: 12px;
|
|
1363
1368
|
}
|
|
@@ -1382,10 +1387,6 @@
|
|
|
1382
1387
|
margin-bottom: var(--spacing-4);
|
|
1383
1388
|
}
|
|
1384
1389
|
|
|
1385
|
-
.h_100 {
|
|
1386
|
-
height: 100px;
|
|
1387
|
-
}
|
|
1388
|
-
|
|
1389
1390
|
.top_0 {
|
|
1390
1391
|
top: var(--spacing-0);
|
|
1391
1392
|
}
|