@modul/mbui 0.0.4-beta-pv-52894-ba6f4013 → 0.0.4-beta-pv-52894-6d5156ce
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/Collapsible/AccountCollapsible.d.ts +1 -0
- package/dist/Collapsible/AccountCollapsible.js +5 -1
- package/dist/Collapsible/AccountCollapsible.js.map +1 -1
- package/package.json +4 -2
- package/src/@/config/index.ts +9 -56
- package/src/Collapsible/AccountCollapsible.tsx +21 -12
- package/src/DasboardDrawer/DashboardDrawer.tsx +92 -0
- package/src/DasboardDrawer/index.ts +14 -0
- package/src/assets/css/global.css +1 -0
|
@@ -9,6 +9,7 @@ export declare type AccountCollapsibleHeaderProps = {
|
|
|
9
9
|
export declare type AccountCollapsibleContentItemProps = {
|
|
10
10
|
className?: string;
|
|
11
11
|
children: ReactNode;
|
|
12
|
+
asChild: boolean;
|
|
12
13
|
};
|
|
13
14
|
declare const AccountCollapsibleHeader: FC<AccountCollapsibleHeaderProps>;
|
|
14
15
|
declare const AccountCollapsibleContentItem: FC<AccountCollapsibleContentItemProps>;
|
|
@@ -6,6 +6,7 @@ const react_1 = (0, tslib_1.__importDefault)(require("react"));
|
|
|
6
6
|
const CollapsiblePrimitive = (0, tslib_1.__importStar)(require("@radix-ui/react-collapsible"));
|
|
7
7
|
const Icon_1 = require("../../src/Icon");
|
|
8
8
|
const utils_1 = require("../@/lib/utils");
|
|
9
|
+
const react_slot_1 = require("@radix-ui/react-slot");
|
|
9
10
|
const AccountCollapsible = CollapsiblePrimitive.Root;
|
|
10
11
|
exports.AccountCollapsible = AccountCollapsible;
|
|
11
12
|
const AccountCollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
|
|
@@ -19,7 +20,10 @@ const AccountCollapsibleHeader = ({ label }) => {
|
|
|
19
20
|
react_1.default.createElement(Icon_1.DropdownSmallOld, null))));
|
|
20
21
|
};
|
|
21
22
|
exports.AccountCollapsibleHeader = AccountCollapsibleHeader;
|
|
22
|
-
const AccountCollapsibleContentItem = ({ children, className, ...props }) =>
|
|
23
|
+
const AccountCollapsibleContentItem = ({ children, asChild = true, className, ...props }) => {
|
|
24
|
+
const Comp = asChild ? react_slot_1.Slot : 'div';
|
|
25
|
+
return (react_1.default.createElement(Comp, { className: (0, utils_1.cn)('text-left w-full rounded-[4px] px-[12px] py-[16px] bg-btn-secondary hover:bg-btn-secondary-hover focus:bg-btn-secondary-focus active:bg-btn-secondary-active border-btn-secondary hover:border-btn-secondary-hover focus:border-btn-secondary-focus active:border-btn-secondary-active', className), ...props }, children));
|
|
26
|
+
};
|
|
23
27
|
exports.AccountCollapsibleContentItem = AccountCollapsibleContentItem;
|
|
24
28
|
AccountCollapsible.displayName = 'AccountCollaspible';
|
|
25
29
|
AccountCollapsibleTrigger.displayName = 'AccountCollaspibleTrigger';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountCollapsible.js","sourceRoot":"","sources":["../../src/Collapsible/AccountCollapsible.tsx"],"names":[],"mappings":";;;;AAAA,+DAA4C;AAC5C,+FAAmE;AACnE,yCAAiD;AACjD,0CAAmC;
|
|
1
|
+
{"version":3,"file":"AccountCollapsible.js","sourceRoot":"","sources":["../../src/Collapsible/AccountCollapsible.tsx"],"names":[],"mappings":";;;;AAAA,+DAA4C;AAC5C,+FAAmE;AACnE,yCAAiD;AACjD,0CAAmC;AACnC,qDAA2C;AAE3C,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,IAAI,CAAA;AAoDnD,gDAAkB;AAlDnB,MAAM,yBAAyB,GAAG,oBAAoB,CAAC,kBAAkB,CAAA;AAoDxE,8DAAyB;AAlD1B,MAAM,yBAAyB,GAAG,oBAAoB,CAAC,kBAAkB,CAAA;AAmDxE,8DAAyB;AAxC1B,MAAM,wBAAwB,GAAsC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACjF,OAAO,CACN,uCAAK,SAAS,EAAC,0CAA0C;QACxD,uCAAK,SAAS,EAAC,uCAAuC,IAAE,KAAK,CAAO;QACpE,8BAAC,yBAAyB,IAAC,SAAS,EAAC,2DAA2D;YAC/F,8BAAC,uBAAgB,OAAG,CACO,CACvB,CACN,CAAA;AACF,CAAC,CAAA;AA6BA,4DAAwB;AA5BzB,MAAM,6BAA6B,GAA2C,CAAC,EAC9E,QAAQ,EACR,OAAO,GAAE,IAAI,EACb,SAAS,EACT,GAAG,KAAK,EACR,EAAE,EAAE;IACJ,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,iBAAI,CAAC,CAAC,CAAC,KAAK,CAAA;IACnC,OAAO,CACN,8BAAC,IAAI,IACJ,SAAS,EAAE,IAAA,UAAE,EACZ,wRAAwR,EACxR,SAAS,CACT,KACG,KAAK,IAER,QAAQ,CACH,CACP,CAAA;AACF,CAAC,CAAA;AAaA,sEAA6B;AAX9B,kBAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAA;AACrD,yBAAyB,CAAC,WAAW,GAAG,2BAA2B,CAAA;AACnE,wBAAwB,CAAC,WAAW,GAAG,0BAA0B,CAAA;AACjE,yBAAyB,CAAC,WAAW,GAAG,2BAA2B,CAAA;AACnE,6BAA6B,CAAC,WAAW,GAAG,+BAA+B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modul/mbui",
|
|
3
|
-
"version": "0.0.4-beta-pv-52894-
|
|
3
|
+
"version": "0.0.4-beta-pv-52894-6d5156ce",
|
|
4
4
|
"packageManager": "yarn@3.5.1",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"@radix-ui/react-collapsible": "1.1.0",
|
|
26
26
|
"@radix-ui/react-dropdown-menu": "2.1.1",
|
|
27
27
|
"@radix-ui/react-popover": "^1.1.1",
|
|
28
|
+
"@radix-ui/react-select": "2.1.1",
|
|
28
29
|
"@radix-ui/react-slider": "^1.2.0",
|
|
29
30
|
"@radix-ui/react-slot": "1.1.0",
|
|
30
31
|
"@radix-ui/react-tabs": "^1.1.0",
|
|
@@ -38,7 +39,8 @@
|
|
|
38
39
|
"react-imask": "7.1.3",
|
|
39
40
|
"tailwind-merge": "^2.3.0",
|
|
40
41
|
"tailwindcss": "^3.4.4",
|
|
41
|
-
"tailwindcss-animate": "^1.0.7"
|
|
42
|
+
"tailwindcss-animate": "^1.0.7",
|
|
43
|
+
"vaul": "0.9.1"
|
|
42
44
|
},
|
|
43
45
|
"devDependencies": {
|
|
44
46
|
"@babel/core": "^7.9.0",
|
package/src/@/config/index.ts
CHANGED
|
@@ -26,62 +26,15 @@ export default {
|
|
|
26
26
|
transparent: 'transparent',
|
|
27
27
|
current: 'currentColor',
|
|
28
28
|
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
// },
|
|
39
|
-
|
|
40
|
-
// border: {
|
|
41
|
-
// 'btn-primary-outline': '2px solid red'
|
|
42
|
-
// },
|
|
43
|
-
|
|
44
|
-
// colors: {
|
|
45
|
-
// border: 'hsl(var(--border))',
|
|
46
|
-
// input: 'hsl(var(--input))',
|
|
47
|
-
// ring: 'hsl(var(--ring))',
|
|
48
|
-
// background: 'hsl(var(--background))',
|
|
49
|
-
// foreground: 'hsl(var(--foreground))',
|
|
50
|
-
// primary: {
|
|
51
|
-
// DEFAULT: 'hsl(var(--primary))',
|
|
52
|
-
// foreground: 'hsl(var(--primary-foreground))',
|
|
53
|
-
// },
|
|
54
|
-
// secondary: {
|
|
55
|
-
// DEFAULT: 'hsl(var(--secondary))',
|
|
56
|
-
// foreground: 'hsl(var(--secondary-foreground))',
|
|
57
|
-
// },
|
|
58
|
-
// destructive: {
|
|
59
|
-
// DEFAULT: 'hsl(var(--destructive))',
|
|
60
|
-
// foreground: 'hsl(var(--destructive-foreground))',
|
|
61
|
-
// },
|
|
62
|
-
// muted: {
|
|
63
|
-
// DEFAULT: 'hsl(var(--muted))',
|
|
64
|
-
// foreground: 'hsl(var(--muted-foreground))',
|
|
65
|
-
// },
|
|
66
|
-
// accent: {
|
|
67
|
-
// DEFAULT: 'hsl(var(--accent))',
|
|
68
|
-
// foreground: 'hsl(var(--accent-foreground))',
|
|
69
|
-
// },
|
|
70
|
-
// popover: {
|
|
71
|
-
// DEFAULT: 'hsl(var(--popover))',
|
|
72
|
-
// foreground: 'hsl(var(--popover-foreground))',
|
|
73
|
-
// },
|
|
74
|
-
// card: {
|
|
75
|
-
// DEFAULT: 'hsl(var(--card))',
|
|
76
|
-
// foreground: 'hsl(var(--card-foreground))',
|
|
77
|
-
// },
|
|
78
|
-
// },
|
|
79
|
-
// borderRadius: {
|
|
80
|
-
// lg: `var(--radius)`,
|
|
81
|
-
// md: `calc(var(--radius) - 2px)`,
|
|
82
|
-
// sm: 'calc(var(--radius) - 4px)',
|
|
83
|
-
// },
|
|
84
|
-
|
|
29
|
+
textColor: {
|
|
30
|
+
...button.textColor
|
|
31
|
+
},
|
|
32
|
+
backgroundColor: {
|
|
33
|
+
primary: {
|
|
34
|
+
DEFAULT: 'var(--primary-bg)'
|
|
35
|
+
},
|
|
36
|
+
...button.backgroundColor
|
|
37
|
+
},
|
|
85
38
|
keyframes: {
|
|
86
39
|
'accordion-down': {
|
|
87
40
|
from: { height: '0' },
|
|
@@ -2,6 +2,7 @@ import React, { FC, ReactNode } from 'react'
|
|
|
2
2
|
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible'
|
|
3
3
|
import { DropdownSmallOld } from '../../src/Icon'
|
|
4
4
|
import { cn } from '../@/lib/utils'
|
|
5
|
+
import { Slot } from '@radix-ui/react-slot'
|
|
5
6
|
|
|
6
7
|
const AccountCollapsible = CollapsiblePrimitive.Root
|
|
7
8
|
|
|
@@ -15,6 +16,7 @@ export type AccountCollapsibleHeaderProps = {
|
|
|
15
16
|
export type AccountCollapsibleContentItemProps = {
|
|
16
17
|
className?: string
|
|
17
18
|
children: ReactNode
|
|
19
|
+
asChild: boolean
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
const AccountCollapsibleHeader: FC<AccountCollapsibleHeaderProps> = ({ label }) => {
|
|
@@ -27,18 +29,25 @@ const AccountCollapsibleHeader: FC<AccountCollapsibleHeaderProps> = ({ label })
|
|
|
27
29
|
</div>
|
|
28
30
|
)
|
|
29
31
|
}
|
|
30
|
-
const AccountCollapsibleContentItem: FC<AccountCollapsibleContentItemProps> = ({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
const AccountCollapsibleContentItem: FC<AccountCollapsibleContentItemProps> = ({
|
|
33
|
+
children,
|
|
34
|
+
asChild =true,
|
|
35
|
+
className,
|
|
36
|
+
...props
|
|
37
|
+
}) => {
|
|
38
|
+
const Comp = asChild ? Slot : 'div'
|
|
39
|
+
return (
|
|
40
|
+
<Comp
|
|
41
|
+
className={cn(
|
|
42
|
+
'text-left w-full rounded-[4px] px-[12px] py-[16px] bg-btn-secondary hover:bg-btn-secondary-hover focus:bg-btn-secondary-focus active:bg-btn-secondary-active border-btn-secondary hover:border-btn-secondary-hover focus:border-btn-secondary-focus active:border-btn-secondary-active',
|
|
43
|
+
className
|
|
44
|
+
)}
|
|
45
|
+
{...props}
|
|
46
|
+
>
|
|
47
|
+
{children}
|
|
48
|
+
</Comp>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
42
51
|
|
|
43
52
|
AccountCollapsible.displayName = 'AccountCollaspible'
|
|
44
53
|
AccountCollapsibleTrigger.displayName = 'AccountCollaspibleTrigger'
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { Drawer as DrawerPrimitive } from 'vaul'
|
|
5
|
+
import { cn } from '../@/lib/utils'
|
|
6
|
+
|
|
7
|
+
const Drawer = ({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) => <DrawerPrimitive.Root {...props} />
|
|
8
|
+
Drawer.displayName = 'Drawer'
|
|
9
|
+
|
|
10
|
+
const DrawerTrigger = DrawerPrimitive.Trigger
|
|
11
|
+
|
|
12
|
+
const DrawerPortal = DrawerPrimitive.Portal
|
|
13
|
+
|
|
14
|
+
const DrawerClose = DrawerPrimitive.Close
|
|
15
|
+
|
|
16
|
+
const DrawerFooter: React.FC = () => (
|
|
17
|
+
<div className="p-[16px] cursor-pointer">
|
|
18
|
+
<svg
|
|
19
|
+
className="block mx-auto"
|
|
20
|
+
width="38"
|
|
21
|
+
height="10"
|
|
22
|
+
viewBox="0 0 38 10"
|
|
23
|
+
fill="none"
|
|
24
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
25
|
+
>
|
|
26
|
+
<path
|
|
27
|
+
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"
|
|
28
|
+
fill="#243036"
|
|
29
|
+
fill-opacity="0.24"
|
|
30
|
+
/>
|
|
31
|
+
</svg>
|
|
32
|
+
</div>
|
|
33
|
+
)
|
|
34
|
+
type DrawerListProps = {
|
|
35
|
+
children: React.ReactNode
|
|
36
|
+
}
|
|
37
|
+
const DrawerList: React.FC<DrawerListProps> = ({ children }) => {
|
|
38
|
+
return (
|
|
39
|
+
<div
|
|
40
|
+
role="listbox"
|
|
41
|
+
className="px-[12px] py-[20px]"
|
|
42
|
+
>
|
|
43
|
+
{children}
|
|
44
|
+
</div>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
type DrawerListItemProps = {
|
|
48
|
+
value: string
|
|
49
|
+
label: string | JSX.Element
|
|
50
|
+
isSelected?: boolean
|
|
51
|
+
}
|
|
52
|
+
const DrawerListItem: React.FC<DrawerListItemProps> = ({ label, value, isSelected }) => {
|
|
53
|
+
return (
|
|
54
|
+
<div
|
|
55
|
+
role="option"
|
|
56
|
+
aria-labelledby=""
|
|
57
|
+
aria-selected={isSelected}
|
|
58
|
+
className="flex"
|
|
59
|
+
tabIndex={0}
|
|
60
|
+
>
|
|
61
|
+
<div className="shrink-0">
|
|
62
|
+
<p
|
|
63
|
+
className="font-medium text-[14px] text-muted leading-[1.4]"
|
|
64
|
+
id=""
|
|
65
|
+
>
|
|
66
|
+
{label}
|
|
67
|
+
</p>
|
|
68
|
+
<p className="font-bold text-[20px] leading-[1.2]">{value}</p>
|
|
69
|
+
</div>
|
|
70
|
+
{isSelected && <span></span>}
|
|
71
|
+
</div>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
// const Drawer
|
|
75
|
+
const DrawerContent = React.forwardRef<
|
|
76
|
+
React.ElementRef<typeof DrawerPrimitive.Content>,
|
|
77
|
+
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>
|
|
78
|
+
>(({ className, children, ...props }, ref) => (
|
|
79
|
+
<DrawerPortal>
|
|
80
|
+
<DrawerPrimitive.Content
|
|
81
|
+
ref={ref}
|
|
82
|
+
className={cn('fixed inset-x-0 top-0 flex h-auto flex-col bg-app', className)}
|
|
83
|
+
{...props}
|
|
84
|
+
>
|
|
85
|
+
{children}
|
|
86
|
+
<DrawerFooter />
|
|
87
|
+
</DrawerPrimitive.Content>
|
|
88
|
+
</DrawerPortal>
|
|
89
|
+
))
|
|
90
|
+
DrawerContent.displayName = 'DrawerContent'
|
|
91
|
+
|
|
92
|
+
export { Drawer, DrawerTrigger, DrawerClose, DrawerContent, DrawerList, DrawerListItem }
|