@modul/mbui 0.0.10-beta-pv-52970-8c953d22 → 0.0.10-beta-drawer-6c00d984
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/Drawer/Drawer.js
CHANGED
|
@@ -8,7 +8,7 @@ const utils_1 = require("../@/lib/utils");
|
|
|
8
8
|
const react_1 = require("react");
|
|
9
9
|
const DrawerContext = React.createContext('bottom');
|
|
10
10
|
const Drawer = ({ ...props }) => {
|
|
11
|
-
return (React.createElement(DrawerContext.Provider, { value: props.direction },
|
|
11
|
+
return (React.createElement(DrawerContext.Provider, { value: props.direction || 'bottom' },
|
|
12
12
|
React.createElement(vaul_1.Drawer.Root, { ...props })));
|
|
13
13
|
};
|
|
14
14
|
exports.Drawer = Drawer;
|
|
@@ -24,12 +24,14 @@ exports.DrawerTitle = DrawerTitle;
|
|
|
24
24
|
DrawerTitle.displayName = vaul_1.Drawer.Title.displayName;
|
|
25
25
|
const DrawerContent = React.forwardRef(({ className, children, ...props }, ref) => {
|
|
26
26
|
const direction = (0, react_1.useContext)(DrawerContext);
|
|
27
|
+
console.log("direction.>>>", direction);
|
|
27
28
|
return (React.createElement(DrawerPortal, null,
|
|
28
|
-
React.createElement(
|
|
29
|
-
|
|
29
|
+
React.createElement(DrawerOverlay, { className: 'fixed inset-0 bg-slate-600' }),
|
|
30
|
+
React.createElement(vaul_1.Drawer.Content, { ref: ref, className: (0, utils_1.cn)(`z-50 fixed inset-x-0 ${direction}-0 flex flex-col bg-page drop-shadow-1 max-h-[94%] sm:container`, direction === 'top' ? 'rounded-b-md' : 'rounded-t-md', className), ...props },
|
|
31
|
+
direction !== 'top' && (React.createElement("div", { className: "pt-[4px] pb-[16px]" },
|
|
30
32
|
React.createElement("span", { className: "block bg-[#cbcdd1] mx-auto rounded-full w-[36px] h-[5px]" }))),
|
|
31
33
|
children,
|
|
32
|
-
direction === 'top' && (React.createElement(
|
|
34
|
+
direction === 'top' && (React.createElement("div", { className: "pt-[24px] pb-[16px]" },
|
|
33
35
|
React.createElement("svg", { className: "mx-auto", width: "38", height: "10", viewBox: "0 0 38 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
34
36
|
React.createElement("path", { d: "M0 7.39774C0 8.68678 1.25226 9.60455 2.48147 9.21638L17.7955 4.38038C18.5794 4.13282 19.4206 4.13282 20.2045 4.38038L35.5185 9.21638C36.7477 9.60455 38 8.68678 38 7.39774C38 6.56568 37.4606 5.82966 36.6671 5.5791L20.2045 0.380377C19.4206 0.132817 18.5794 0.132817 17.7955 0.380377L1.33286 5.5791C0.539422 5.82966 0 6.56568 0 7.39774Z", fill: "#cbcdd1" })))))));
|
|
35
37
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../src/Drawer/Drawer.tsx"],"names":[],"mappings":";;;;AAAA,0DAA8B;AAC9B,+BAAgD;AAChD,0CAAmC;AACnC,iCAAkC;AAElC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;AAEnD,MAAM,MAAM,GAAG,CAAC,EAAE,GAAG,KAAK,EAAqD,EAAE,EAAE;IAClF,OAAO,CACN,oBAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,CAAC,SAAS;
|
|
1
|
+
{"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../src/Drawer/Drawer.tsx"],"names":[],"mappings":";;;;AAAA,0DAA8B;AAC9B,+BAAgD;AAChD,0CAAmC;AACnC,iCAAkC;AAElC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;AAEnD,MAAM,MAAM,GAAG,CAAC,EAAE,GAAG,KAAK,EAAqD,EAAE,EAAE;IAClF,OAAO,CACN,oBAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,CAAC,SAAS,IAAI,QAAQ;QACzD,oBAAC,aAAe,CAAC,IAAI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KAAK;YAER,SAAS,KAAK,KAAK,IAAI,CACvB,6BAAK,SAAS,EAAC,oBAAoB;gBAClC,8BAAM,SAAS,EAAC,0DAA0D,GAAG,CACxE,CACN;YAEA,QAAQ;YAER,SAAS,KAAK,KAAK,IAAI,CACvB,6BAAK,SAAS,EAAC,qBAAqB;gBACnC,6BACC,SAAS,EAAC,SAAS,EACnB,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B;oBAElC,8BACC,CAAC,EAAC,+UAA+U,EACjV,IAAI,EAAC,SAAS,GACb,CACG,CACD,CACN,CACwB,CACZ,CACf,CAAA;AACF,CAAC,CAAC,CAAA;AAG8B,sCAAa;AAF7C,aAAa,CAAC,WAAW,GAAG,eAAe,CAAA"}
|
package/package.json
CHANGED
package/src/@/config/index.ts
CHANGED
|
@@ -14,26 +14,21 @@ export default {
|
|
|
14
14
|
dark: 'var(--dark)',
|
|
15
15
|
primary: {
|
|
16
16
|
DEFAULT: 'var(--primary)',
|
|
17
|
-
hover: 'var(--primary-hover)',
|
|
18
|
-
focus: 'var(var(--primary-focus)',
|
|
19
|
-
active: 'var(--primary-active)',
|
|
20
17
|
light: {
|
|
21
18
|
DEFAULT: 'var(--primary-light)'
|
|
22
19
|
}
|
|
23
20
|
},
|
|
24
21
|
success: {
|
|
25
22
|
DEFAULT: 'var(--success)',
|
|
26
|
-
hover: 'var(--success-hover)',
|
|
27
|
-
focus: 'var(var(--success-focus)',
|
|
28
|
-
active: 'var(--success-active)',
|
|
29
23
|
},
|
|
30
24
|
secondary: {
|
|
31
25
|
DEFAULT: 'var(--secondary)',
|
|
32
|
-
hover: 'var(--secondary-hover)',
|
|
33
|
-
focus: 'var(var(--secondary-focus)',
|
|
34
|
-
active: 'var(--secondary-active)',
|
|
35
26
|
},
|
|
36
|
-
|
|
27
|
+
critical: {
|
|
28
|
+
DEFAULT: 'var(--critical)',
|
|
29
|
+
light: 'var(--critical-light)',
|
|
30
|
+
},
|
|
31
|
+
disabled: 'var(--disabled)',
|
|
37
32
|
transparent: 'transparent',
|
|
38
33
|
current: 'currentColor',
|
|
39
34
|
},
|
|
@@ -57,7 +52,8 @@ export default {
|
|
|
57
52
|
...button.borderColor
|
|
58
53
|
},
|
|
59
54
|
borderRadius: {
|
|
60
|
-
'
|
|
55
|
+
'sm': 'var(--border-radius-sm)',
|
|
56
|
+
'md': 'var(--border-radius-md)',
|
|
61
57
|
},
|
|
62
58
|
keyframes: {
|
|
63
59
|
'accordion-down': {
|
package/src/Drawer/Drawer.tsx
CHANGED
|
@@ -7,7 +7,7 @@ const DrawerContext = React.createContext('bottom')
|
|
|
7
7
|
|
|
8
8
|
const Drawer = ({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) => {
|
|
9
9
|
return (
|
|
10
|
-
<DrawerContext.Provider value={props.direction}>
|
|
10
|
+
<DrawerContext.Provider value={props.direction || 'bottom'}>
|
|
11
11
|
<DrawerPrimitive.Root {...props} />
|
|
12
12
|
</DrawerContext.Provider>
|
|
13
13
|
)
|
|
@@ -41,28 +41,31 @@ const DrawerContent = React.forwardRef<
|
|
|
41
41
|
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>
|
|
42
42
|
>(({ className, children, ...props }, ref) => {
|
|
43
43
|
const direction = useContext(DrawerContext)
|
|
44
|
+
console.log("direction.>>>", direction)
|
|
44
45
|
|
|
45
46
|
return (
|
|
46
47
|
<DrawerPortal>
|
|
48
|
+
<DrawerOverlay className='fixed inset-0 bg-slate-600'/>
|
|
49
|
+
|
|
47
50
|
<DrawerPrimitive.Content
|
|
48
51
|
ref={ref}
|
|
49
52
|
className={cn(
|
|
50
|
-
`z-50 fixed inset-x-0 flex flex-col bg-page drop-shadow-1
|
|
51
|
-
direction === 'top' ? '
|
|
53
|
+
`z-50 fixed inset-x-0 ${direction}-0 flex flex-col bg-page drop-shadow-1 max-h-[94%] sm:container`,
|
|
54
|
+
direction === 'top' ? 'rounded-b-md' : 'rounded-t-md',
|
|
52
55
|
className
|
|
53
56
|
)}
|
|
54
57
|
{...props}
|
|
55
58
|
>
|
|
56
59
|
{direction !== 'top' && (
|
|
57
|
-
<
|
|
60
|
+
<div className="pt-[4px] pb-[16px]">
|
|
58
61
|
<span className="block bg-[#cbcdd1] mx-auto rounded-full w-[36px] h-[5px]" />
|
|
59
|
-
</
|
|
62
|
+
</div>
|
|
60
63
|
)}
|
|
61
64
|
|
|
62
65
|
{children}
|
|
63
66
|
|
|
64
67
|
{direction === 'top' && (
|
|
65
|
-
<
|
|
68
|
+
<div className="pt-[24px] pb-[16px]">
|
|
66
69
|
<svg
|
|
67
70
|
className="mx-auto"
|
|
68
71
|
width="38"
|
|
@@ -76,7 +79,7 @@ const DrawerContent = React.forwardRef<
|
|
|
76
79
|
fill="#cbcdd1"
|
|
77
80
|
/>
|
|
78
81
|
</svg>
|
|
79
|
-
</
|
|
82
|
+
</div>
|
|
80
83
|
)}
|
|
81
84
|
</DrawerPrimitive.Content>
|
|
82
85
|
</DrawerPortal>
|
|
@@ -78,10 +78,13 @@
|
|
|
78
78
|
--primary-light: var(--cl-blue-7);
|
|
79
79
|
--success: var(--cl-green-3);
|
|
80
80
|
--success-light: var(--cl-green-7);
|
|
81
|
-
--
|
|
81
|
+
--secondary: var(--cl-graphite-2);
|
|
82
82
|
--light: var(--cl-graphite-3);
|
|
83
83
|
--dark: var(--cl-graphite-2);
|
|
84
84
|
--disabled: var(--cl-graphite-4);
|
|
85
|
+
|
|
86
|
+
--critical: var(--cl-red-4);
|
|
87
|
+
--critical-light: var(--cl-red-7);
|
|
85
88
|
/* --text-quaternary:; */
|
|
86
89
|
|
|
87
90
|
--page-bg: var(--cl-white);
|
|
@@ -135,7 +138,8 @@
|
|
|
135
138
|
/* BORDER */
|
|
136
139
|
/* =========================================== */
|
|
137
140
|
--border-color: var(--cl-graphite-5);
|
|
138
|
-
--border-radius-
|
|
141
|
+
--border-radius-sm: 4px;
|
|
142
|
+
--border-radius-md: 8px;
|
|
139
143
|
/* =========================================== */
|
|
140
144
|
/* BORDER */
|
|
141
145
|
|