@modul/mbui 0.0.10-beta-pv-52970-8bff8029 → 0.0.10-beta-pv-52970-19d10001
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 +16 -6
- package/dist/Drawer/Drawer.js.map +1 -1
- package/dist/Page/Page.d.ts +7 -3
- package/dist/Page/Page.js +8 -5
- package/dist/Page/Page.js.map +1 -1
- package/dist/Page/index.d.ts +1 -1
- package/dist/Page/index.js +1 -2
- package/dist/Page/index.js.map +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/Drawer/Drawer.tsx +40 -24
- package/src/DrawerCompanyList/CompanyList.tsx +2 -2
- package/src/Page/Page.tsx +19 -15
- package/src/Page/index.ts +1 -1
- package/src/index.ts +2 -2
package/dist/Drawer/Drawer.js
CHANGED
|
@@ -5,7 +5,12 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const React = (0, tslib_1.__importStar)(require("react"));
|
|
6
6
|
const vaul_1 = require("vaul");
|
|
7
7
|
const utils_1 = require("../@/lib/utils");
|
|
8
|
-
const
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const DrawerContext = React.createContext('bottom');
|
|
10
|
+
const Drawer = ({ ...props }) => {
|
|
11
|
+
return (React.createElement(DrawerContext.Provider, { value: props.direction },
|
|
12
|
+
React.createElement(vaul_1.Drawer.Root, { ...props })));
|
|
13
|
+
};
|
|
9
14
|
exports.Drawer = Drawer;
|
|
10
15
|
Drawer.displayName = 'Drawer';
|
|
11
16
|
const DrawerTrigger = vaul_1.Drawer.Trigger;
|
|
@@ -17,13 +22,18 @@ const DrawerOverlay = vaul_1.Drawer.Overlay;
|
|
|
17
22
|
const DrawerTitle = React.forwardRef(({ className, ...props }, ref) => (React.createElement(vaul_1.Drawer.Title, { ref: ref, className: (0, utils_1.cn)(className), ...props })));
|
|
18
23
|
exports.DrawerTitle = DrawerTitle;
|
|
19
24
|
DrawerTitle.displayName = vaul_1.Drawer.Title.displayName;
|
|
20
|
-
const DrawerFooter = () => (React.createElement(DrawerClose, { className: "p-[16px]" },
|
|
21
|
-
React.createElement("svg", { className: "mx-auto", width: "38", height: "10", viewBox: "0 0 38 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
22
|
-
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: "#243036", fillOpacity: "0.24" }))));
|
|
23
25
|
const DrawerContent = React.forwardRef(({ className, children, ...props }, ref) => {
|
|
24
|
-
|
|
26
|
+
const direction = (0, react_1.useContext)(DrawerContext);
|
|
27
|
+
console.log("direction", direction);
|
|
25
28
|
return (React.createElement(DrawerPortal, null,
|
|
26
|
-
React.createElement(vaul_1.Drawer.Content, { ref: ref, className: (0, utils_1.cn)('fixed
|
|
29
|
+
React.createElement(vaul_1.Drawer.Content, { ref: ref, className: (0, utils_1.cn)(`${direction ?? 'bottom'}-0 z-50 fixed inset-x-0 flex bg-page drop-shadow-1 sm:container flex-col *:shrink-0 rounded-t-1`, className), ...props },
|
|
30
|
+
direction !== 'top' && (React.createElement(DrawerClose, { className: "pt-[4px] pb-[16px]" },
|
|
31
|
+
React.createElement("span", { className: "block bg-[#cbcdd1] mx-auto rounded-full w-[36px] h-[5px]" }))),
|
|
32
|
+
children,
|
|
33
|
+
direction === 'top' &&
|
|
34
|
+
React.createElement(DrawerClose, { className: "pt-[24px] pb-[16px]" },
|
|
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" },
|
|
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" }))))));
|
|
27
37
|
});
|
|
28
38
|
exports.DrawerContent = DrawerContent;
|
|
29
39
|
DrawerContent.displayName = 'DrawerContent';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../src/Drawer/Drawer.tsx"],"names":[],"mappings":";;;;AAAA,0DAA8B;AAC9B,+BAAgD;AAChD,0CAAmC;
|
|
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;QAC7C,oBAAC,aAAe,CAAC,IAAI,OAAK,KAAK,GAAI,CACX,CACzB,CAAA;AACF,CAAC,CAAA;AA2EQ,wBAAM;AAzEf,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAA;AAE7B,MAAM,aAAa,GAAG,aAAe,CAAC,OAAO,CAAA;AAuE5B,sCAAa;AArE9B,MAAM,YAAY,GAAG,aAAe,CAAC,MAAM,CAAA;AAE3C,MAAM,WAAW,GAAG,aAAe,CAAC,KAAK,CAAA;AA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U,EACjV,IAAI,EAAC,SAAS,GACb,CACG,CACO,CAEU,CACZ,CACf,CAAA;AACF,CAAC,CAAC,CAAA;AAG8B,sCAAa;AAF7C,aAAa,CAAC,WAAW,GAAG,eAAe,CAAA"}
|
package/dist/Page/Page.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ declare type IProps = {
|
|
|
3
3
|
children?: React.ReactNode;
|
|
4
4
|
className?: string;
|
|
5
5
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
interface IPage extends FC<IProps> {
|
|
7
|
+
displayName: string;
|
|
8
|
+
Navbar: FC<IProps>;
|
|
9
|
+
Content: FC<IProps>;
|
|
10
|
+
}
|
|
11
|
+
declare const Page: IPage;
|
|
12
|
+
export { Page };
|
package/dist/Page/Page.js
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Page = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = (0, tslib_1.__importDefault)(require("react"));
|
|
6
6
|
const utils_1 = require("../@/lib/utils");
|
|
7
|
-
const
|
|
7
|
+
const Navbar = ({ children, className }) => {
|
|
8
|
+
return react_1.default.createElement("div", { className: (0, utils_1.cn)('flex items-center h-[44px] px-[20px]', className) }, children);
|
|
9
|
+
};
|
|
10
|
+
const Content = ({ children, className }) => {
|
|
8
11
|
return react_1.default.createElement("div", { className: (0, utils_1.cn)('flex items-center h-[44px] px-[20px]', className) }, children);
|
|
9
12
|
};
|
|
10
|
-
exports.PageNavbar = PageNavbar;
|
|
11
|
-
PageNavbar.displayName = 'PageNavbar';
|
|
12
13
|
const Page = ({ children, className }) => {
|
|
13
|
-
return
|
|
14
|
+
return react_1.default.createElement("div", { className: (0, utils_1.cn)('sm:container bg-page h-screen', className) }, children);
|
|
14
15
|
};
|
|
15
16
|
exports.Page = Page;
|
|
16
17
|
Page.displayName = 'Page';
|
|
18
|
+
Page.Navbar = Navbar;
|
|
19
|
+
Page.Content = Content;
|
|
17
20
|
//# sourceMappingURL=Page.js.map
|
package/dist/Page/Page.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Page.js","sourceRoot":"","sources":["../../src/Page/Page.tsx"],"names":[],"mappings":";;;;AAAA,+
|
|
1
|
+
{"version":3,"file":"Page.js","sourceRoot":"","sources":["../../src/Page/Page.tsx"],"names":[],"mappings":";;;;AAAA,+DAAiC;AACjC,0CAAmC;AAOnC,MAAM,MAAM,GAAO,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAU,EAAE,EAAE;IACtD,OAAO,uCAAK,SAAS,EAAE,IAAA,UAAE,EAAC,sCAAsC,EAAE,SAAS,CAAC,IAAG,QAAQ,CAAO,CAAA;AAC/F,CAAC,CAAA;AAED,MAAM,OAAO,GAAO,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAU,EAAE,EAAE;IACvD,OAAO,uCAAK,SAAS,EAAE,IAAA,UAAE,EAAC,sCAAsC,EAAE,SAAS,CAAC,IAAG,QAAQ,CAAO,CAAA;AAC/F,CAAC,CAAA;AAQD,MAAM,IAAI,GAAU,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAU,EAAE,EAAE;IACvD,OAAO,uCAAK,SAAS,EAAE,IAAA,UAAE,EAAC,+BAA+B,EAAE,SAAS,CAAC,IAAG,QAAQ,CAAO,CAAA;AACxF,CAAC,CAAA;AAMQ,oBAAI;AAJb,IAAI,CAAC,WAAW,GAAG,MAAM,CAAA;AACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;AACpB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA"}
|
package/dist/Page/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Page
|
|
1
|
+
export { Page } from './Page';
|
package/dist/Page/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Page = void 0;
|
|
4
4
|
var Page_1 = require("./Page");
|
|
5
5
|
Object.defineProperty(exports, "Page", { enumerable: true, get: function () { return Page_1.Page; } });
|
|
6
|
-
Object.defineProperty(exports, "PageNavbar", { enumerable: true, get: function () { return Page_1.PageNavbar; } });
|
|
7
6
|
//# sourceMappingURL=index.js.map
|
package/dist/Page/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Page/index.ts"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Page/index.ts"],"names":[],"mappings":";;;AAAA,+BAA6B;AAApB,4FAAA,IAAI,OAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,9 +12,8 @@ import { Button } from "./Button";
|
|
|
12
12
|
import { Input } from "./Base/Input";
|
|
13
13
|
import { Audio } from "./Audio";
|
|
14
14
|
import { cn } from "./@/lib/utils";
|
|
15
|
-
import { Drawer, DrawerTrigger, DrawerClose, DrawerContent } from './Drawer';
|
|
15
|
+
import { Drawer, DrawerTrigger, DrawerTitle, DrawerClose, DrawerContent } from './Drawer';
|
|
16
16
|
import { Page } from "./Page";
|
|
17
|
-
import { PageNavbar } from "./Page";
|
|
18
17
|
import { Chip } from "./Chip";
|
|
19
18
|
import { InputField, InputLabel } from "./Input";
|
|
20
|
-
export { Tooltip, Tabs, Slider, Popover, Logo, InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator, Collapsible, CollapsibleTrigger, CollapsibleContent, AccountCollapsible, AccountCollapsibleHeader, AccountCollapsibleTrigger, AccountCollapsibleContent, AccountCollapsibleContentItem, Button, Input, InputField, InputLabel, Audio, cn, Icon, Drawer, DrawerTrigger, DrawerClose, DrawerContent, BottomNavigation, BottomNavigationList, BottomNavigationListItem, BottomNavigationLink, Page,
|
|
19
|
+
export { Tooltip, Tabs, Slider, Popover, Logo, InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator, Collapsible, CollapsibleTrigger, CollapsibleContent, AccountCollapsible, AccountCollapsibleHeader, AccountCollapsibleTrigger, AccountCollapsibleContent, AccountCollapsibleContentItem, Button, Input, InputField, InputLabel, Audio, cn, Icon, Drawer, DrawerTrigger, DrawerTitle, DrawerClose, DrawerContent, BottomNavigation, BottomNavigationList, BottomNavigationListItem, BottomNavigationLink, Page, Chip, };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Chip = exports.
|
|
3
|
+
exports.Chip = exports.Page = exports.BottomNavigationLink = exports.BottomNavigationListItem = exports.BottomNavigationList = exports.BottomNavigation = exports.DrawerContent = exports.DrawerClose = exports.DrawerTitle = exports.DrawerTrigger = exports.Drawer = exports.Icon = exports.cn = exports.Audio = exports.InputLabel = exports.InputField = exports.Input = exports.Button = exports.AccountCollapsibleContentItem = exports.AccountCollapsibleContent = exports.AccountCollapsibleTrigger = exports.AccountCollapsibleHeader = exports.AccountCollapsible = exports.CollapsibleContent = exports.CollapsibleTrigger = exports.Collapsible = exports.InputOTPSeparator = exports.InputOTPSlot = exports.InputOTPGroup = exports.InputOTP = exports.Logo = exports.Popover = exports.Slider = exports.Tabs = exports.Tooltip = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const Tooltip_1 = require("./Tooltip");
|
|
6
6
|
Object.defineProperty(exports, "Tooltip", { enumerable: true, get: function () { return Tooltip_1.Tooltip; } });
|
|
@@ -45,12 +45,11 @@ Object.defineProperty(exports, "cn", { enumerable: true, get: function () { retu
|
|
|
45
45
|
const Drawer_1 = require("./Drawer");
|
|
46
46
|
Object.defineProperty(exports, "Drawer", { enumerable: true, get: function () { return Drawer_1.Drawer; } });
|
|
47
47
|
Object.defineProperty(exports, "DrawerTrigger", { enumerable: true, get: function () { return Drawer_1.DrawerTrigger; } });
|
|
48
|
+
Object.defineProperty(exports, "DrawerTitle", { enumerable: true, get: function () { return Drawer_1.DrawerTitle; } });
|
|
48
49
|
Object.defineProperty(exports, "DrawerClose", { enumerable: true, get: function () { return Drawer_1.DrawerClose; } });
|
|
49
50
|
Object.defineProperty(exports, "DrawerContent", { enumerable: true, get: function () { return Drawer_1.DrawerContent; } });
|
|
50
51
|
const Page_1 = require("./Page");
|
|
51
52
|
Object.defineProperty(exports, "Page", { enumerable: true, get: function () { return Page_1.Page; } });
|
|
52
|
-
const Page_2 = require("./Page");
|
|
53
|
-
Object.defineProperty(exports, "PageNavbar", { enumerable: true, get: function () { return Page_2.PageNavbar; } });
|
|
54
53
|
const Chip_1 = require("./Chip");
|
|
55
54
|
Object.defineProperty(exports, "Chip", { enumerable: true, get: function () { return Chip_1.Chip; } });
|
|
56
55
|
const Input_2 = require("./Input");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,uCAAoC;AA6CnC,wFA7CQ,iBAAO,OA6CR;AA5CR,iCAA8B;AA6C7B,qFA7CQ,WAAI,OA6CR;AA5CL,qCAAkC;AA6CjC,uFA7CQ,eAAM,OA6CR;AA5CP,uCAAoC;AA6CnC,wFA7CQ,iBAAO,OA6CR;AA5CR,+DAA0B;AA6CzB,eA7CM,cAAI,CA6CN;AA5CL,2CAIqB;AAyCpB,yFA7CQ,oBAAQ,OA6CR;AACR,8FA7CA,yBAAa,OA6CA;AACb,6FA7CA,wBAAY,OA6CA;AACZ,kGA7CA,6BAAiB,OA6CA;AA3ClB,yDAK4B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,uCAAoC;AA6CnC,wFA7CQ,iBAAO,OA6CR;AA5CR,iCAA8B;AA6C7B,qFA7CQ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kBAAU,OAuBpB"}
|
package/package.json
CHANGED
package/src/Drawer/Drawer.tsx
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { Drawer as DrawerPrimitive } from 'vaul'
|
|
3
3
|
import { cn } from '../@/lib/utils'
|
|
4
|
-
import { useContext } from 'react'
|
|
4
|
+
import { useContext } from 'react'
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const DrawerContext = React.createContext('bottom')
|
|
7
|
+
|
|
8
|
+
const Drawer = ({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) => {
|
|
9
|
+
return (
|
|
10
|
+
<DrawerContext.Provider value={props.direction}>
|
|
11
|
+
<DrawerPrimitive.Root {...props} />
|
|
12
|
+
</DrawerContext.Provider>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
7
15
|
|
|
8
16
|
Drawer.displayName = 'Drawer'
|
|
9
17
|
|
|
@@ -28,43 +36,51 @@ const DrawerTitle = React.forwardRef<
|
|
|
28
36
|
|
|
29
37
|
DrawerTitle.displayName = DrawerPrimitive.Title.displayName
|
|
30
38
|
|
|
31
|
-
const DrawerFooter: React.FC = () => (
|
|
32
|
-
<DrawerClose className="p-[16px]">
|
|
33
|
-
<svg
|
|
34
|
-
className="mx-auto"
|
|
35
|
-
width="38"
|
|
36
|
-
height="10"
|
|
37
|
-
viewBox="0 0 38 10"
|
|
38
|
-
fill="none"
|
|
39
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
40
|
-
>
|
|
41
|
-
<path
|
|
42
|
-
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"
|
|
43
|
-
fill="#243036"
|
|
44
|
-
fillOpacity="0.24"
|
|
45
|
-
/>
|
|
46
|
-
</svg>
|
|
47
|
-
</DrawerClose>
|
|
48
|
-
)
|
|
49
|
-
|
|
50
39
|
const DrawerContent = React.forwardRef<
|
|
51
40
|
React.ElementRef<typeof DrawerPrimitive.Content>,
|
|
52
41
|
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>
|
|
53
42
|
>(({ className, children, ...props }, ref) => {
|
|
54
|
-
|
|
43
|
+
const direction = useContext(DrawerContext)
|
|
44
|
+
console.log("direction", direction)
|
|
45
|
+
|
|
55
46
|
return (
|
|
56
47
|
<DrawerPortal>
|
|
57
48
|
<DrawerPrimitive.Content
|
|
58
49
|
ref={ref}
|
|
59
50
|
className={cn(
|
|
60
|
-
|
|
51
|
+
`${
|
|
52
|
+
direction ?? 'bottom'
|
|
53
|
+
}-0 z-50 fixed inset-x-0 flex bg-page drop-shadow-1 sm:container flex-col *:shrink-0 rounded-t-1`,
|
|
61
54
|
className
|
|
62
55
|
)}
|
|
63
56
|
{...props}
|
|
64
57
|
>
|
|
58
|
+
{direction !== 'top' && (
|
|
59
|
+
<DrawerClose className="pt-[4px] pb-[16px]">
|
|
60
|
+
<span className="block bg-[#cbcdd1] mx-auto rounded-full w-[36px] h-[5px]" />
|
|
61
|
+
</DrawerClose>
|
|
62
|
+
)}
|
|
63
|
+
|
|
65
64
|
{children}
|
|
65
|
+
|
|
66
|
+
{direction === 'top' &&
|
|
67
|
+
<DrawerClose className="pt-[24px] pb-[16px]">
|
|
68
|
+
<svg
|
|
69
|
+
className="mx-auto"
|
|
70
|
+
width="38"
|
|
71
|
+
height="10"
|
|
72
|
+
viewBox="0 0 38 10"
|
|
73
|
+
fill="none"
|
|
74
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
75
|
+
>
|
|
76
|
+
<path
|
|
77
|
+
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"
|
|
78
|
+
fill="#cbcdd1"
|
|
79
|
+
/>
|
|
80
|
+
</svg>
|
|
81
|
+
</DrawerClose>
|
|
82
|
+
}
|
|
66
83
|
</DrawerPrimitive.Content>
|
|
67
|
-
{/* <DrawerOverlay className='fixed inset-0 bg-[#000]/70'/> */}
|
|
68
84
|
</DrawerPortal>
|
|
69
85
|
)
|
|
70
86
|
})
|
|
@@ -58,6 +58,6 @@ const DrawerListItem: React.FC<DrawerListItemProps> = ({ label, value, isActive,
|
|
|
58
58
|
export { CompanyList }
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
<DrawerTitle className="sr-only">Выбор компании</DrawerTitle>
|
|
61
|
+
{/* <DrawerTitle className="sr-only">Выбор компании</DrawerTitle>
|
|
62
62
|
{children}
|
|
63
|
-
<DrawerFooter />
|
|
63
|
+
<DrawerFooter /> */}
|
package/src/Page/Page.tsx
CHANGED
|
@@ -1,27 +1,31 @@
|
|
|
1
|
-
import React, {FC} from 'react'
|
|
2
|
-
import { cn } from '../@/lib/utils'
|
|
1
|
+
import React, { FC } from 'react'
|
|
2
|
+
import { cn } from '../@/lib/utils'
|
|
3
3
|
|
|
4
4
|
type IProps = {
|
|
5
|
-
children?: React.ReactNode
|
|
5
|
+
children?: React.ReactNode
|
|
6
6
|
className?: string
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
return <div className={cn('flex items-center h-[44px] px-[20px]', className)}>
|
|
11
|
-
{children}
|
|
12
|
-
</div>
|
|
9
|
+
const Navbar: FC = ({ children, className }: IProps) => {
|
|
10
|
+
return <div className={cn('flex items-center h-[44px] px-[20px]', className)}>{children}</div>
|
|
13
11
|
}
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
const Content: FC = ({ children, className }: IProps) => {
|
|
14
|
+
return <div className={cn('flex items-center h-[44px] px-[20px]', className)}>{children}</div>
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface IPage extends FC<IProps> {
|
|
18
|
+
displayName: string
|
|
19
|
+
Navbar: FC<IProps>
|
|
20
|
+
Content: FC<IProps>
|
|
21
|
+
}
|
|
16
22
|
|
|
17
|
-
const Page:
|
|
18
|
-
return (
|
|
19
|
-
<div className={cn('sm:container bg-page h-screen', className)}>
|
|
20
|
-
{children}
|
|
21
|
-
</div>
|
|
22
|
-
);
|
|
23
|
+
const Page: IPage = ({ children, className }: IProps) => {
|
|
24
|
+
return <div className={cn('sm:container bg-page h-screen', className)}>{children}</div>
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
Page.displayName = 'Page'
|
|
28
|
+
Page.Navbar = Navbar
|
|
29
|
+
Page.Content = Content
|
|
26
30
|
|
|
27
|
-
export { Page
|
|
31
|
+
export { Page }
|
package/src/Page/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Page
|
|
1
|
+
export { Page } from './Page'
|
package/src/index.ts
CHANGED
|
@@ -34,11 +34,11 @@ import { cn } from "./@/lib/utils";
|
|
|
34
34
|
import {
|
|
35
35
|
Drawer,
|
|
36
36
|
DrawerTrigger,
|
|
37
|
+
DrawerTitle,
|
|
37
38
|
DrawerClose,
|
|
38
39
|
DrawerContent
|
|
39
40
|
} from './Drawer'
|
|
40
41
|
import { Page } from "./Page";
|
|
41
|
-
import { PageNavbar } from "./Page";
|
|
42
42
|
import { Chip } from "./Chip";
|
|
43
43
|
import { InputField, InputLabel } from "./Input";
|
|
44
44
|
|
|
@@ -69,6 +69,7 @@ export {
|
|
|
69
69
|
Icon,
|
|
70
70
|
Drawer,
|
|
71
71
|
DrawerTrigger,
|
|
72
|
+
DrawerTitle,
|
|
72
73
|
DrawerClose,
|
|
73
74
|
DrawerContent,
|
|
74
75
|
BottomNavigation,
|
|
@@ -76,6 +77,5 @@ export {
|
|
|
76
77
|
BottomNavigationListItem,
|
|
77
78
|
BottomNavigationLink,
|
|
78
79
|
Page,
|
|
79
|
-
PageNavbar,
|
|
80
80
|
Chip,
|
|
81
81
|
};
|