@modul/mbui 0.0.5 → 0.0.6-beta-pv-52894-3a6d5f54

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.
@@ -1,5 +1,13 @@
1
- import * as React from "react";
2
- declare const BottomNavigation: React.ForwardRefExoticComponent<{
3
- className: string;
4
- } & React.RefAttributes<unknown>>;
5
- export { BottomNavigation };
1
+ import * as React from 'react';
2
+ export interface BottomNavigationLinkProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
3
+ asChild?: boolean;
4
+ }
5
+ export declare type IProps = {
6
+ className?: string;
7
+ children: React.ReactNode;
8
+ };
9
+ declare const BottomNavigationLink: React.ForwardRefExoticComponent<BottomNavigationLinkProps & React.RefAttributes<HTMLButtonElement>>;
10
+ declare const BottomNavigationListItem: React.ForwardRefExoticComponent<IProps & React.RefAttributes<unknown>>;
11
+ declare const BottomNavigationList: React.ForwardRefExoticComponent<IProps & React.RefAttributes<unknown>>;
12
+ declare const BottomNavigation: React.ForwardRefExoticComponent<IProps & React.RefAttributes<unknown>>;
13
+ export { BottomNavigation, BottomNavigationList, BottomNavigationListItem, BottomNavigationLink };
@@ -1,35 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BottomNavigation = void 0;
3
+ exports.BottomNavigationLink = exports.BottomNavigationListItem = exports.BottomNavigationList = exports.BottomNavigation = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = (0, tslib_1.__importStar)(require("react"));
6
- const Icon_1 = require("../Icon");
7
- const btnClasses = "block hover:bg-btn-ghost-hover focus:bg-btn-ghost-focus active:bg-btn-ghost-active p-[8px] w-full text-[10px] text-center hover:text-primary leading-[1.33] transition duration-300";
8
- const iconClasses = "block mx-auto mb-[8px]";
9
- const BottomNavigation = React.forwardRef(({ className, ...props }, ref) => {
10
- return (React.createElement("nav", { className: "" },
11
- React.createElement("ul", { role: "list", className: "grid grid-flow-col" },
12
- React.createElement("li", { className: "" },
13
- React.createElement("a", { className: btnClasses, href: "" },
14
- React.createElement(Icon_1.Home, { width: "24px", height: "24px", fill: "red", className: "block mx-auto mb-[8px]" }),
15
- "\u0413\u043B\u0430\u0432\u043D\u0430\u044F")),
16
- React.createElement("li", { className: "" },
17
- React.createElement("a", { className: btnClasses, href: "" },
18
- React.createElement(Icon_1.Payment, { width: "24px", height: "24px", className: iconClasses }),
19
- "\u041F\u043B\u0430\u0442\u0435\u0436\u0438")),
20
- React.createElement("li", { className: "" },
21
- React.createElement("a", { className: btnClasses, href: "" },
22
- React.createElement(Icon_1.Clock, { width: "24px", height: "24px", className: iconClasses }),
23
- "\u0418\u0441\u0442\u043E\u0440\u0438\u044F")),
24
- React.createElement("li", { className: "" },
25
- React.createElement("a", { className: btnClasses, href: "" },
26
- React.createElement(Icon_1.Services, { width: "24px", height: "24px", className: iconClasses }),
27
- "\u0421\u0435\u0440\u0432\u0438\u0441\u044B")),
28
- React.createElement("li", { className: "" },
29
- React.createElement("button", { className: btnClasses },
30
- React.createElement(Icon_1.ChatSolid, { width: "24px", height: "24px", className: iconClasses }),
31
- "\u0427\u0430\u0442")))));
6
+ const react_slot_1 = require("@radix-ui/react-slot");
7
+ const utils_1 = require("../@/lib/utils");
8
+ const btnClasses = 'inline-flex flex-col gap-y-[8px] place-items-center hover:bg-btn-ghost-hover focus:bg-btn-ghost-focus active:bg-btn-ghost-active p-[8px] w-full text-[10px] text-center hover:text-primary leading-[1.33] transition duration-300';
9
+ const BottomNavigationLink = React.forwardRef(({ className, asChild, ...props }, ref) => {
10
+ const Comp = asChild ? react_slot_1.Slot : "button";
11
+ return (React.createElement(Comp, { className: (0, utils_1.cn)(btnClasses, className), ref: ref, ...props }));
12
+ });
13
+ exports.BottomNavigationLink = BottomNavigationLink;
14
+ BottomNavigationLink.displayName = 'BottomNavigationLink';
15
+ const BottomNavigationListItem = React.forwardRef(({ className, children }, ref) => (React.createElement("li", { className: className }, children)));
16
+ exports.BottomNavigationListItem = BottomNavigationListItem;
17
+ BottomNavigationListItem.displayName = 'BottomNavigationListItem';
18
+ const BottomNavigationList = React.forwardRef(({ className, children }, ref) => (React.createElement("ul", { className: "grid grid-flow-col" }, children)));
19
+ exports.BottomNavigationList = BottomNavigationList;
20
+ BottomNavigationList.displayName = 'BottomNavigationList';
21
+ const BottomNavigation = React.forwardRef(({ className, children }, ref) => {
22
+ return React.createElement("nav", { className: className }, children);
32
23
  });
33
24
  exports.BottomNavigation = BottomNavigation;
34
- BottomNavigation.displayName = "BottomNavigation";
25
+ BottomNavigation.displayName = 'BottomNavigation';
35
26
  //# sourceMappingURL=BottomNavigation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BottomNavigation.js","sourceRoot":"","sources":["../../src/BottomNavigation/BottomNavigation.tsx"],"names":[],"mappings":";;;;AAAA,0DAA8B;AAC9B,kCAAoE;AAEpE,MAAM,UAAU,GAAG,qLAAqL,CAAC;AACzM,MAAM,WAAW,GAAG,wBAAwB,CAAC;AAE7C,MAAM,gBAAgB,GAAG,KAAK,CAAC,UAAU,CACvC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAwB,EAAE,GAAG,EAAE,EAAE;IAErD,OAAO,CACT,6BAAK,SAAS,EAAC,EAAE;QAChB,4BAAI,IAAI,EAAC,MAAM,EAAC,SAAS,EAAC,oBAAoB;YAC7C,4BAAI,SAAS,EAAC,EAAE;gBACf,2BAAG,SAAS,EAAE,UAAU,EAAE,IAAI,EAAC,EAAE;oBAChC,oBAAC,WAAI,IAAC,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,IAAI,EAAC,KAAK,EAAC,SAAS,EAAC,wBAAwB,GAAE;iEAE7E,CACA;YACL,4BAAI,SAAS,EAAC,EAAE;gBACf,2BAAG,SAAS,EAAE,UAAU,EAAE,IAAI,EAAC,EAAE;oBAChC,oBAAC,cAAO,IAAC,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,SAAS,EAAE,WA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CAAA;AACF,CAAC,CAAC,CAAA;AAmByE,oDAAoB;AAjB/F,oBAAoB,CAAC,WAAW,GAAG,sBAAsB,CAAA;AAEzD,MAAM,wBAAwB,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAU,EAAE,GAAG,EAAE,EAAE,CAAC,CAC3F,4BAAI,SAAS,EAAE,SAAS,IAAG,QAAQ,CAAM,CACzC,CAAC,CAAA;AAa+C,4DAAwB;AAZzE,wBAAwB,CAAC,WAAW,GAAG,0BAA0B,CAAA;AAEjE,MAAM,oBAAoB,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAU,EAAE,GAAG,EAAE,EAAE,CAAC,CACvF,4BAAI,SAAS,EAAC,oBAAoB,IAAE,QAAQ,CAAM,CAClD,CAAC,CAAA;AAQyB,oDAAoB;AAP/C,oBAAoB,CAAC,WAAW,GAAG,sBAAsB,CAAA;AAEzD,MAAM,gBAAgB,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAU,EAAE,GAAG,EAAE,EAAE;IAClF,OAAO,6BAAK,SAAS,EAAE,SAAS,IAAG,QAAQ,CAAO,CAAA;AACnD,CAAC,CAAC,CAAA;AAGO,4CAAgB;AAFzB,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAA"}
@@ -1,3 +1 @@
1
- import { BottomNavigation } from './BottomNavigation';
2
- export { BottomNavigation };
3
- export default BottomNavigation;
1
+ export { BottomNavigation, BottomNavigationList, BottomNavigationListItem, BottomNavigationLink } from './BottomNavigation';
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BottomNavigation = void 0;
4
- const BottomNavigation_1 = require("./BottomNavigation");
3
+ exports.BottomNavigationLink = exports.BottomNavigationListItem = exports.BottomNavigationList = exports.BottomNavigation = void 0;
4
+ var BottomNavigation_1 = require("./BottomNavigation");
5
5
  Object.defineProperty(exports, "BottomNavigation", { enumerable: true, get: function () { return BottomNavigation_1.BottomNavigation; } });
6
- exports.default = BottomNavigation_1.BottomNavigation;
6
+ Object.defineProperty(exports, "BottomNavigationList", { enumerable: true, get: function () { return BottomNavigation_1.BottomNavigationList; } });
7
+ Object.defineProperty(exports, "BottomNavigationListItem", { enumerable: true, get: function () { return BottomNavigation_1.BottomNavigationListItem; } });
8
+ Object.defineProperty(exports, "BottomNavigationLink", { enumerable: true, get: function () { return BottomNavigation_1.BottomNavigationLink; } });
7
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/BottomNavigation/index.ts"],"names":[],"mappings":";;;AAAA,yDAAqD;AAE5C,iGAFA,mCAAgB,OAEA;AAEzB,kBAAe,mCAAgB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/BottomNavigation/index.ts"],"names":[],"mappings":";;;AAAA,uDAA2H;AAAlH,oHAAA,gBAAgB,OAAA;AAAE,wHAAA,oBAAoB,OAAA;AAAE,4HAAA,wBAAwB,OAAA;AAAE,wHAAA,oBAAoB,OAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modul/mbui",
3
- "version": "0.0.5",
3
+ "version": "0.0.6-beta-pv-52894-3a6d5f54",
4
4
  "packageManager": "yarn@3.5.1",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1,51 +1,45 @@
1
- import * as React from "react"
2
- import { Home, Services, ChatSolid, Clock, Payment } from "../Icon";
3
-
4
- const btnClasses = "block hover:bg-btn-ghost-hover focus:bg-btn-ghost-focus active:bg-btn-ghost-active p-[8px] w-full text-[10px] text-center hover:text-primary leading-[1.33] transition duration-300";
5
- const iconClasses = "block mx-auto mb-[8px]";
6
-
7
- const BottomNavigation = React.forwardRef(
8
- ({ className, ...props } : {className: string}, ref) => {
9
-
10
- return (
11
- <nav className="">
12
- <ul role="list" className="grid grid-flow-col">
13
- <li className="">
14
- <a className={btnClasses} href="">
15
- <Home width="24px" height="24px" fill="red" className="block mx-auto mb-[8px]"/>
16
- Главная
17
- </a>
18
- </li>
19
- <li className="">
20
- <a className={btnClasses} href="">
21
- <Payment width="24px" height="24px" className={iconClasses}/>
22
- Платежи
23
- </a>
24
- </li>
25
- <li className="">
26
- <a className={btnClasses} href="">
27
- <Clock width="24px" height="24px" className={iconClasses}/>
28
- История
29
- </a>
30
- </li>
31
- <li className="">
32
- <a className={btnClasses} href="">
33
- <Services width="24px" height="24px" className={iconClasses}/>
34
- Сервисы
35
- </a>
36
- </li>
37
- <li className="">
38
- <button className={btnClasses}>
39
- <ChatSolid width="24px" height="24px" className={iconClasses}/>
40
- Чат
41
- </button>
42
- </li>
43
- </ul>
44
- </nav>
45
- )
46
- }
47
- )
48
-
49
- BottomNavigation.displayName = "BottomNavigation"
50
-
51
- export { BottomNavigation }
1
+ import * as React from 'react'
2
+ import { Slot } from '@radix-ui/react-slot'
3
+ import { cn } from '../@/lib/utils'
4
+
5
+ export interface BottomNavigationLinkProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
6
+ asChild?: boolean
7
+ }
8
+
9
+ export type IProps = {
10
+ className?: string
11
+ children: React.ReactNode
12
+ }
13
+
14
+ const btnClasses =
15
+ 'inline-flex flex-col gap-y-[8px] place-items-center hover:bg-btn-ghost-hover focus:bg-btn-ghost-focus active:bg-btn-ghost-active p-[8px] w-full text-[10px] text-center hover:text-primary leading-[1.33] transition duration-300'
16
+
17
+ const BottomNavigationLink = React.forwardRef<HTMLButtonElement, BottomNavigationLinkProps>(({ className, asChild, ...props }, ref) => {
18
+ const Comp = asChild ? Slot : "button"
19
+ return (
20
+ <Comp
21
+ className={cn(btnClasses, className)}
22
+ ref={ref}
23
+ {...props}
24
+ />
25
+ )
26
+ })
27
+
28
+ BottomNavigationLink.displayName = 'BottomNavigationLink'
29
+
30
+ const BottomNavigationListItem = React.forwardRef(({ className, children }: IProps, ref) => (
31
+ <li className={className}>{children}</li>
32
+ ))
33
+ BottomNavigationListItem.displayName = 'BottomNavigationListItem'
34
+
35
+ const BottomNavigationList = React.forwardRef(({ className, children }: IProps, ref) => (
36
+ <ul className="grid grid-flow-col">{children}</ul>
37
+ ))
38
+ BottomNavigationList.displayName = 'BottomNavigationList'
39
+
40
+ const BottomNavigation = React.forwardRef(({ className, children }: IProps, ref) => {
41
+ return <nav className={className}>{children}</nav>
42
+ })
43
+ BottomNavigation.displayName = 'BottomNavigation'
44
+
45
+ export { BottomNavigation, BottomNavigationList, BottomNavigationListItem, BottomNavigationLink }
@@ -1,6 +1 @@
1
- import { BottomNavigation } from './BottomNavigation'
2
-
3
- export { BottomNavigation }
4
-
5
- export default BottomNavigation
6
-
1
+ export { BottomNavigation, BottomNavigationList, BottomNavigationListItem, BottomNavigationLink } from './BottomNavigation'