@purr-react-tailwindcss/components.navbar 0.0.1

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.
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { INavbarProps } from './_types';
3
+
4
+ export declare const Navbar: ({ title, leftButton, rightButton, classes, htmlAttributes, leftButtonHtmlAttributes, titleHtmlAttributes, rightButtonHtmlAttributes, }: INavbarProps) => React.JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { ClassValue } from 'clsx';
2
+ import { HTMLAttributes, ReactNode } from 'react';
3
+ import { IExtendable } from '@purr-core/utils.definitions';
4
+
5
+ export interface INavbarClasses {
6
+ container?: ClassValue;
7
+ title?: ClassValue;
8
+ leftButton?: ClassValue;
9
+ rightButton?: ClassValue;
10
+ }
11
+ export interface INavbarProps {
12
+ leftButton?: ReactNode;
13
+ rightButton?: ReactNode;
14
+ title?: ReactNode;
15
+ classes?: INavbarClasses;
16
+ htmlAttributes?: HTMLAttributes<HTMLDivElement> & IExtendable;
17
+ leftButtonHtmlAttributes?: HTMLAttributes<HTMLSpanElement> & IExtendable;
18
+ titleHtmlAttributes?: HTMLAttributes<HTMLSpanElement> & IExtendable;
19
+ rightButtonHtmlAttributes?: HTMLAttributes<HTMLSpanElement> & IExtendable;
20
+ }
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("clsx"),j=({title:n,leftButton:i,rightButton:f,classes:t,htmlAttributes:u,leftButtonHtmlAttributes:x,titleHtmlAttributes:o,rightButtonHtmlAttributes:h})=>e.jsxs("nav",{className:r("fixed","top-0","left-0","right-0","flex","justify-around","items-center","h-14","bg-gray-900",t==null?void 0:t.container),...u,children:[e.jsx("span",{className:r("flex","flex-1","justify-center","items-center","h-full",t==null?void 0:t.leftButton),...x,children:i}),e.jsx("span",{className:r("flex","flex-1","justify-center","items-center","h-full",t==null?void 0:t.title),...o,children:n}),e.jsx("span",{className:r("flex","flex-1","justify-center","items-center","h-full",t==null?void 0:t.rightButton),...h,children:f})]});exports.Navbar=j;
@@ -0,0 +1,2 @@
1
+ export * from './_components';
2
+ export * from './_types';
package/dist/index.js ADDED
@@ -0,0 +1,79 @@
1
+ import { jsxs as h, jsx as n } from "react/jsx-runtime";
2
+ import r from "clsx";
3
+ const j = ({
4
+ title: e,
5
+ leftButton: f,
6
+ rightButton: i,
7
+ classes: t,
8
+ htmlAttributes: m,
9
+ leftButtonHtmlAttributes: x,
10
+ titleHtmlAttributes: o,
11
+ rightButtonHtmlAttributes: u
12
+ }) => /* @__PURE__ */ h(
13
+ "nav",
14
+ {
15
+ className: r(
16
+ "fixed",
17
+ "top-0",
18
+ "left-0",
19
+ "right-0",
20
+ "flex",
21
+ "justify-around",
22
+ "items-center",
23
+ "h-14",
24
+ "bg-gray-900",
25
+ t == null ? void 0 : t.container
26
+ ),
27
+ ...m,
28
+ children: [
29
+ /* @__PURE__ */ n(
30
+ "span",
31
+ {
32
+ className: r(
33
+ "flex",
34
+ "flex-1",
35
+ "justify-center",
36
+ "items-center",
37
+ "h-full",
38
+ t == null ? void 0 : t.leftButton
39
+ ),
40
+ ...x,
41
+ children: f
42
+ }
43
+ ),
44
+ /* @__PURE__ */ n(
45
+ "span",
46
+ {
47
+ className: r(
48
+ "flex",
49
+ "flex-1",
50
+ "justify-center",
51
+ "items-center",
52
+ "h-full",
53
+ t == null ? void 0 : t.title
54
+ ),
55
+ ...o,
56
+ children: e
57
+ }
58
+ ),
59
+ /* @__PURE__ */ n(
60
+ "span",
61
+ {
62
+ className: r(
63
+ "flex",
64
+ "flex-1",
65
+ "justify-center",
66
+ "items-center",
67
+ "h-full",
68
+ t == null ? void 0 : t.rightButton
69
+ ),
70
+ ...u,
71
+ children: i
72
+ }
73
+ )
74
+ ]
75
+ }
76
+ );
77
+ export {
78
+ j as Navbar
79
+ };
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@purr-react-tailwindcss/components.navbar",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "main": "dist/index.cjs",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": {
11
+ "types": "./dist/index.d.ts",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "require": {
15
+ "types": "./dist/index.d.ts",
16
+ "default": "./dist/index.cjs"
17
+ }
18
+ }
19
+ },
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "peerDependencies": {
24
+ "typescript": "*",
25
+ "react": "*",
26
+ "clsx": "*",
27
+ "@purr-core/utils.definitions": "0.0.5"
28
+ },
29
+ "devDependencies": {
30
+ "@purr-react-tailwindcss/components.button": "0.0.1"
31
+ },
32
+ "author": "@DinhThienPhuc",
33
+ "license": "ISC",
34
+ "description": "",
35
+ "sideEffects": false,
36
+ "scripts": {
37
+ "dev": "vite build --watch",
38
+ "build": "tsc && vite build",
39
+ "lint": "eslint . --ext ts,tsx --max-warnings 0"
40
+ }
41
+ }