@modul/mbui 0.0.10-beta-pv-52970-a6fdbd96 → 0.0.10-beta-pv-52970-8c953d22

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.
@@ -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 Drawer = ({ ...props }) => React.createElement(vaul_1.Drawer.Root, { ...props });
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,16 @@ 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
- console.log("EF>", ref);
26
+ const direction = (0, react_1.useContext)(DrawerContext);
25
27
  return (React.createElement(DrawerPortal, null,
26
- React.createElement(vaul_1.Drawer.Content, { ref: ref, className: (0, utils_1.cn)('fixed flex inset-x-0 bottom-0 flex-col bg-page drop-shadow-1 rounded-t-1 z-50', className), ...props }, children)));
28
+ React.createElement(vaul_1.Drawer.Content, { ref: ref, className: (0, utils_1.cn)(`z-50 fixed inset-x-0 flex flex-col bg-page drop-shadow-1 rounded-t-1 max-h-[94%] sm:container`, direction === 'top' ? 'top-0' : 'bottom-0', className), ...props },
29
+ direction !== 'top' && (React.createElement(DrawerClose, { className: "pt-[4px] pb-[16px]" },
30
+ React.createElement("span", { className: "block bg-[#cbcdd1] mx-auto rounded-full w-[36px] h-[5px]" }))),
31
+ children,
32
+ direction === 'top' && (React.createElement(DrawerClose, { className: "pt-[24px] pb-[16px]" },
33
+ 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
+ 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
35
  });
28
36
  exports.DrawerContent = DrawerContent;
29
37
  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;AAGnC,MAAM,MAAM,GAAG,CAAC,EAAE,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,EAAC,SAAS,CAAC,KACpB,KAAK,GACR,CACF,CAAC,CAAA;AAoD6C,kCAAW;AAlD1D,WAAW,CAAC,WAAW,GAAG,aAAe,CAAC,KAAK,CAAC,WAAW,CAAA;AAE3D,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CAGpC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAC5C,MAAM,SAAS,GAAG,IAAA,kBAAU,EAAC,aAAa,CAAC,CAAA;IAE3C,OAAO,CACN,oBAAC,YAAY;QACZ,oBAAC,aAAe,CAAC,OAAO,IACvB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,UAAE,EACZ,+FAA+F,EAC/F,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,EAC1C,SAAS,CACT,KACG,KAAK;YAER,SAAS,KAAK,KAAK,IAAI,CACvB,oBAAC,WAAW,IAAC,SAAS,EAAC,oBAAoB;gBAC1C,8BAAM,SAAS,EAAC,0DAA0D,GAAG,CAChE,CACd;YAEA,QAAQ;YAER,SAAS,KAAK,KAAK,IAAI,CACvB,oBAAC,WAAW,IAAC,SAAS,EAAC,qBAAqB;gBAC3C,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,CACO,CACd,CACwB,CACZ,CACf,CAAA;AACF,CAAC,CAAC,CAAA;AAG8B,sCAAa;AAF7C,aAAa,CAAC,WAAW,GAAG,eAAe,CAAA"}
@@ -3,6 +3,10 @@ declare type IProps = {
3
3
  children?: React.ReactNode;
4
4
  className?: string;
5
5
  };
6
- declare const PageNavbar: FC<IProps>;
7
- declare const Page: FC<IProps>;
8
- export { Page, PageNavbar };
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.PageNavbar = exports.Page = void 0;
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 PageNavbar = ({ children, className }) => {
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 (react_1.default.createElement("div", { className: (0, utils_1.cn)('sm:container bg-page h-screen', className) }, children));
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
@@ -1 +1 @@
1
- {"version":3,"file":"Page.js","sourceRoot":"","sources":["../../src/Page/Page.tsx"],"names":[],"mappings":";;;;AAAA,+DAAgC;AAChC,0CAAoC;AAOpC,MAAM,UAAU,GAAe,CAAC,EAAC,QAAQ,EAAE,SAAS,EAAC,EAAE,EAAE;IACxD,OAAO,uCAAK,SAAS,EAAE,IAAA,UAAE,EAAC,sCAAsC,EAAE,SAAS,CAAC,IAC1E,QAAQ,CACJ,CAAA;AACP,CAAC,CAAA;AAcc,gCAAU;AAZzB,UAAU,CAAC,WAAW,GAAG,YAAY,CAAA;AAErC,MAAM,IAAI,GAAe,CAAC,EAAC,QAAQ,EAAE,SAAS,EAAC,EAAE,EAAE;IAClD,OAAO,CACN,uCAAK,SAAS,EAAE,IAAA,UAAE,EAAC,+BAA+B,EAAE,SAAS,CAAC,IAC5D,QAAQ,CACJ,CACN,CAAC;AACH,CAAC,CAAA;AAIQ,oBAAI;AAFb,IAAI,CAAC,WAAW,GAAG,MAAM,CAAA"}
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"}
@@ -1 +1 @@
1
- export { Page, PageNavbar } from './Page';
1
+ export { Page } from './Page';
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PageNavbar = exports.Page = void 0;
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
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Page/index.ts"],"names":[],"mappings":";;;AAAA,+BAAyC;AAAhC,4FAAA,IAAI,OAAA;AAAE,kGAAA,UAAU,OAAA"}
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
@@ -14,7 +14,6 @@ import { Audio } from "./Audio";
14
14
  import { cn } from "./@/lib/utils";
15
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, DrawerTitle, DrawerClose, DrawerContent, BottomNavigation, BottomNavigationList, BottomNavigationListItem, BottomNavigationLink, Page, PageNavbar, Chip, };
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.PageNavbar = 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;
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; } });
@@ -50,8 +50,6 @@ Object.defineProperty(exports, "DrawerClose", { enumerable: true, get: function
50
50
  Object.defineProperty(exports, "DrawerContent", { enumerable: true, get: function () { return Drawer_1.DrawerContent; } });
51
51
  const Page_1 = require("./Page");
52
52
  Object.defineProperty(exports, "Page", { enumerable: true, get: function () { return Page_1.Page; } });
53
- const Page_2 = require("./Page");
54
- Object.defineProperty(exports, "PageNavbar", { enumerable: true, get: function () { return Page_2.PageNavbar; } });
55
53
  const Chip_1 = require("./Chip");
56
54
  Object.defineProperty(exports, "Chip", { enumerable: true, get: function () { return Chip_1.Chip; } });
57
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;AA8CnC,wFA9CQ,iBAAO,OA8CR;AA7CR,iCAA8B;AA8C7B,qFA9CQ,WAAI,OA8CR;AA7CL,qCAAkC;AA8CjC,uFA9CQ,eAAM,OA8CR;AA7CP,uCAAoC;AA8CnC,wFA9CQ,iBAAO,OA8CR;AA7CR,+DAA0B;AA8CzB,eA9CM,cAAI,CA8CN;AA7CL,2CAIqB;AA0CpB,yFA9CQ,oBAAQ,OA8CR;AACR,8FA9CA,yBAAa,OA8CA;AACb,6FA9CA,wBAAY,OA8CA;AACZ,kGA9CA,6BAAiB,OA8CA;AA5ClB,yDAK4B;AA4D3B,iGAhEA,mCAAgB,OAgEA;AAChB,qGAhEA,uCAAoB,OAgEA;AACpB,yGAhEA,2CAAwB,OAgEA;AACxB,qGAhEA,uCAAoB,OAgEA;AA9DrB,0DAA+B;AAqD9B,oBAAI;AApDL,+CAIuB;AAkCtB,4FArCA,yBAAW,OAqCA;AACX,mGArCA,gCAAkB,OAqCA;AAClB,mGArCA,gCAAkB,OAqCA;AAnCnB,+CAMuB;AA8BtB,mGAnCA,gCAAkB,OAmCA;AAClB,yGAnCA,sCAAwB,OAmCA;AACxB,0GAnCA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,oBAAI;AAnDL,+CAIuB;AAiCtB,4FApCA,yBAAW,OAoCA;AACX,mGApCA,gCAAkB,OAoCA;AAClB,mGApCA,gCAAkB,OAoCA;AAlCnB,+CAMuB;AA6BtB,mGAlCA,gCAAkB,OAkCA;AAClB,yGAlCA,sCAAwB,OAkCA;AACxB,0GAlCA,uCAAyB,OAkCA;AACzB,0GAlCA,uCAAyB,OAkCA;AACzB,8GAlCA,2CAA6B,OAkCA;AAhC9B,qCAAkC;AAiCjC,uFAjCQ,eAAM,OAiCR;AAhCP,wCAAqC;AAiCpC,sFAjCQ,aAAK,OAiCR;AAhCN,mCAAgC;AAmC/B,sFAnCQ,aAAK,OAmCR;AAlCN,yCAAmC;AAmClC,mFAnCQ,UAAE,OAmCR;AAlCH,qCAMiB;AA8BhB,uFAnCA,eAAM,OAmCA;AACN,8FAnCA,sBAAa,OAmCA;AACb,4FAnCA,oBAAW,OAmCA;AACX,4FAnCA,oBAAW,OAmCA;AACX,8FAnCA,sBAAa,OAmCA;AAjCd,iCAA8B;AAsC7B,qFAtCQ,WAAI,OAsCR;AArCL,iCAA8B;AAsC7B,qFAtCQ,WAAI,OAsCR;AArCL,mCAAiD;AAsBhD,2FAtBQ,kBAAU,OAsBR;AACV,2FAvBoB,kBAAU,OAuBpB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modul/mbui",
3
- "version": "0.0.10-beta-pv-52970-a6fdbd96",
3
+ "version": "0.0.10-beta-pv-52970-8c953d22",
4
4
  "packageManager": "yarn@3.5.1",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -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 Drawer = ({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) => <DrawerPrimitive.Root {...props} />
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,49 @@ 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
- console.log("EF>",ref)
43
+ const direction = useContext(DrawerContext)
44
+
55
45
  return (
56
46
  <DrawerPortal>
57
47
  <DrawerPrimitive.Content
58
48
  ref={ref}
59
49
  className={cn(
60
- 'fixed flex inset-x-0 bottom-0 flex-col bg-page drop-shadow-1 rounded-t-1 z-50',
50
+ `z-50 fixed inset-x-0 flex flex-col bg-page drop-shadow-1 rounded-t-1 max-h-[94%] sm:container`,
51
+ direction === 'top' ? 'top-0' : 'bottom-0',
61
52
  className
62
53
  )}
63
54
  {...props}
64
55
  >
56
+ {direction !== 'top' && (
57
+ <DrawerClose className="pt-[4px] pb-[16px]">
58
+ <span className="block bg-[#cbcdd1] mx-auto rounded-full w-[36px] h-[5px]" />
59
+ </DrawerClose>
60
+ )}
61
+
65
62
  {children}
63
+
64
+ {direction === 'top' && (
65
+ <DrawerClose className="pt-[24px] pb-[16px]">
66
+ <svg
67
+ className="mx-auto"
68
+ width="38"
69
+ height="10"
70
+ viewBox="0 0 38 10"
71
+ fill="none"
72
+ xmlns="http://www.w3.org/2000/svg"
73
+ >
74
+ <path
75
+ 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"
76
+ fill="#cbcdd1"
77
+ />
78
+ </svg>
79
+ </DrawerClose>
80
+ )}
66
81
  </DrawerPrimitive.Content>
67
- {/* <DrawerOverlay className='fixed inset-0 bg-[#000]/70'/> */}
68
82
  </DrawerPortal>
69
83
  )
70
84
  })
@@ -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 PageNavbar: FC<IProps> = ({children, className}) => {
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
- PageNavbar.displayName = 'PageNavbar'
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: FC<IProps> = ({children, className}) => {
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, PageNavbar };
31
+ export { Page }
package/src/Page/index.ts CHANGED
@@ -1 +1 @@
1
- export { Page, PageNavbar } from './Page'
1
+ export { Page } from './Page'
package/src/index.ts CHANGED
@@ -39,7 +39,6 @@ import {
39
39
  DrawerContent
40
40
  } from './Drawer'
41
41
  import { Page } from "./Page";
42
- import { PageNavbar } from "./Page";
43
42
  import { Chip } from "./Chip";
44
43
  import { InputField, InputLabel } from "./Input";
45
44
 
@@ -78,6 +77,5 @@ export {
78
77
  BottomNavigationListItem,
79
78
  BottomNavigationLink,
80
79
  Page,
81
- PageNavbar,
82
80
  Chip,
83
81
  };