automoby-kit 1.0.50 → 1.0.52
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/README.md +99 -99
- package/dist/cjs/Chips.js +1 -1
- package/dist/cjs/Drawer.js +1 -1
- package/dist/cjs/chunks/Chips-Ws80QAgh.js +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/esm/Chips.js +1 -1
- package/dist/esm/Drawer.js +1 -1
- package/dist/esm/chunks/Chips-Dg1jNlMl.js +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/types/{Chips-C0k57uXa.js → Chips-DfvV08WT.js} +9 -9
- package/dist/types/Chips.js +1 -1
- package/dist/types/Drawer.js +1 -1
- package/dist/types/index.js +1 -1
- package/package.json +176 -176
- package/dist/cjs/chunks/Chips-CJF5Mk_Y.js +0 -1
- package/dist/esm/chunks/Chips-BgI0ODyl.js +0 -1
package/README.md
CHANGED
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
# Automoby Kit
|
|
2
|
-
|
|
3
|
-
A comprehensive React UI component library - created in war 2025.
|
|
4
|
-
|
|
5
|
-
## 🚀 Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install automoby-kit
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## 📦 Usage
|
|
12
|
-
|
|
13
|
-
```typescript
|
|
14
|
-
import {
|
|
15
|
-
Button,
|
|
16
|
-
Typography,
|
|
17
|
-
Input,
|
|
18
|
-
Tabs
|
|
19
|
-
} from 'automoby-kit';
|
|
20
|
-
|
|
21
|
-
function App() {
|
|
22
|
-
return (
|
|
23
|
-
<div>
|
|
24
|
-
<Typography variant="h1">Welcome to Automoby Kit</Typography>
|
|
25
|
-
<Button variant="primary" size="lg">
|
|
26
|
-
Click me!
|
|
27
|
-
</Button>
|
|
28
|
-
<Input placeholder="Enter text..." />
|
|
29
|
-
</div>
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## 🧩 Available Components
|
|
35
|
-
|
|
36
|
-
- **Typography** - Text rendering with various styles
|
|
37
|
-
- **Button** - Interactive buttons with multiple variants
|
|
38
|
-
- **Input** - Form input fields
|
|
39
|
-
- **Tabs** - Tabbed interfaces
|
|
40
|
-
- **Drawer** - Slide-out panels
|
|
41
|
-
- **Backdrop** - Modal overlays
|
|
42
|
-
- **Breadcrumb** - Navigation breadcrumbs
|
|
43
|
-
- **Pagination** - Page navigation
|
|
44
|
-
- **Accordion** - Collapsible content sections
|
|
45
|
-
- **Divider** - Visual separators
|
|
46
|
-
- **RadioGroup** - Radio button groups
|
|
47
|
-
- **Chips** - Tag-like elements
|
|
48
|
-
- **Menu** - Context menus and dropdowns
|
|
49
|
-
|
|
50
|
-
## 🏗️ TypeScript Support
|
|
51
|
-
|
|
52
|
-
All components come with full TypeScript support:
|
|
53
|
-
|
|
54
|
-
```typescript
|
|
55
|
-
import { ButtonProps, TypographyVariant } from 'automoby-kit';
|
|
56
|
-
|
|
57
|
-
const MyButton: React.FC<ButtonProps> = (props) => {
|
|
58
|
-
return <Button {...props} />;
|
|
59
|
-
};
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## 📱 Mobile Context
|
|
63
|
-
|
|
64
|
-
The library includes a mobile detection context:
|
|
65
|
-
|
|
66
|
-
```typescript
|
|
67
|
-
import { MobileProvider } from 'automoby-kit';
|
|
68
|
-
|
|
69
|
-
function App() {
|
|
70
|
-
return (
|
|
71
|
-
<MobileProvider userAgent={navigator.userAgent}>
|
|
72
|
-
<MyComponent />
|
|
73
|
-
</MobileProvider>
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
## 🛠️ Development
|
|
79
|
-
|
|
80
|
-
This package requires the following peer dependencies:
|
|
81
|
-
|
|
82
|
-
```json
|
|
83
|
-
{
|
|
84
|
-
"react": "^19.1.0",
|
|
85
|
-
"react-dom": "^19.1.0",
|
|
86
|
-
"clsx": "^2.1.1",
|
|
87
|
-
"tailwindcss": "^4.1.10"
|
|
88
|
-
}
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## 🆘 Support
|
|
92
|
-
|
|
93
|
-
If you have issues:
|
|
94
|
-
|
|
95
|
-
1. Check the [GitHub issues](https://github.com/yourusername/automoby-kit/issues) for known problems
|
|
96
|
-
2. Submit a new issue with detailed information about your problem
|
|
97
|
-
|
|
98
|
-
## 🔄 Version History
|
|
99
|
-
|
|
1
|
+
# Automoby Kit
|
|
2
|
+
|
|
3
|
+
A comprehensive React UI component library - created in war 2025.
|
|
4
|
+
|
|
5
|
+
## 🚀 Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install automoby-kit
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 📦 Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import {
|
|
15
|
+
Button,
|
|
16
|
+
Typography,
|
|
17
|
+
Input,
|
|
18
|
+
Tabs
|
|
19
|
+
} from 'automoby-kit';
|
|
20
|
+
|
|
21
|
+
function App() {
|
|
22
|
+
return (
|
|
23
|
+
<div>
|
|
24
|
+
<Typography variant="h1">Welcome to Automoby Kit</Typography>
|
|
25
|
+
<Button variant="primary" size="lg">
|
|
26
|
+
Click me!
|
|
27
|
+
</Button>
|
|
28
|
+
<Input placeholder="Enter text..." />
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 🧩 Available Components
|
|
35
|
+
|
|
36
|
+
- **Typography** - Text rendering with various styles
|
|
37
|
+
- **Button** - Interactive buttons with multiple variants
|
|
38
|
+
- **Input** - Form input fields
|
|
39
|
+
- **Tabs** - Tabbed interfaces
|
|
40
|
+
- **Drawer** - Slide-out panels
|
|
41
|
+
- **Backdrop** - Modal overlays
|
|
42
|
+
- **Breadcrumb** - Navigation breadcrumbs
|
|
43
|
+
- **Pagination** - Page navigation
|
|
44
|
+
- **Accordion** - Collapsible content sections
|
|
45
|
+
- **Divider** - Visual separators
|
|
46
|
+
- **RadioGroup** - Radio button groups
|
|
47
|
+
- **Chips** - Tag-like elements
|
|
48
|
+
- **Menu** - Context menus and dropdowns
|
|
49
|
+
|
|
50
|
+
## 🏗️ TypeScript Support
|
|
51
|
+
|
|
52
|
+
All components come with full TypeScript support:
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
import { ButtonProps, TypographyVariant } from 'automoby-kit';
|
|
56
|
+
|
|
57
|
+
const MyButton: React.FC<ButtonProps> = (props) => {
|
|
58
|
+
return <Button {...props} />;
|
|
59
|
+
};
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 📱 Mobile Context
|
|
63
|
+
|
|
64
|
+
The library includes a mobile detection context:
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
import { MobileProvider } from 'automoby-kit';
|
|
68
|
+
|
|
69
|
+
function App() {
|
|
70
|
+
return (
|
|
71
|
+
<MobileProvider userAgent={navigator.userAgent}>
|
|
72
|
+
<MyComponent />
|
|
73
|
+
</MobileProvider>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## 🛠️ Development
|
|
79
|
+
|
|
80
|
+
This package requires the following peer dependencies:
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"react": "^19.1.0",
|
|
85
|
+
"react-dom": "^19.1.0",
|
|
86
|
+
"clsx": "^2.1.1",
|
|
87
|
+
"tailwindcss": "^4.1.10"
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## 🆘 Support
|
|
92
|
+
|
|
93
|
+
If you have issues:
|
|
94
|
+
|
|
95
|
+
1. Check the [GitHub issues](https://github.com/yourusername/automoby-kit/issues) for known problems
|
|
96
|
+
2. Submit a new issue with detailed information about your problem
|
|
97
|
+
|
|
98
|
+
## 🔄 Version History
|
|
99
|
+
|
|
100
100
|
- **1.0.0** - Initial release
|
package/dist/cjs/Chips.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("react/jsx-runtime"),require("./contexts.js"),require("./utils.js"),require("react");var e=require("./chunks/Chips-
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("react/jsx-runtime"),require("./contexts.js"),require("./utils.js"),require("react");var e=require("./chunks/Chips-Ws80QAgh.js");require("./chunks/createLucideIcon-BqJVOzoK.js"),exports.Chips=e.Chips,exports.default=e.Chips;
|
package/dist/cjs/Drawer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("react-dom"),l=require("./utils.js"),n=require("./contexts.js");const o=t.forwardRef(({children:o,direction:a="bottom",fullScreen:u=!1,isOpen:s=!1,onClose:i,className:d,isMobile:c,keepMounted:f,...b},m)=>{const[h,w]=t.useState(!1),x=n.useMobile(),p=c??x,y=t.useRef(null),v=t.useRef(null);t.useEffect(()=>{w(!0)},[]),t.useEffect(()=>{const handleEscape=e=>{"Escape"===e.key&&s&&i&&i()};return s&&(document.addEventListener("keydown",handleEscape),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",handleEscape),document.body.style.overflow="auto"}},[s,i]);const g=l("fixed inset-0 z-
|
|
1
|
+
"use client";"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("react-dom"),l=require("./utils.js"),n=require("./contexts.js");const o=t.forwardRef(({children:o,direction:a="bottom",fullScreen:u=!1,isOpen:s=!1,onClose:i,className:d,isMobile:c,keepMounted:f,...b},m)=>{const[h,w]=t.useState(!1),x=n.useMobile(),p=c??x,y=t.useRef(null),v=t.useRef(null);t.useEffect(()=>{w(!0)},[]),t.useEffect(()=>{const handleEscape=e=>{"Escape"===e.key&&s&&i&&i()};return s&&(document.addEventListener("keydown",handleEscape),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",handleEscape),document.body.style.overflow="auto"}},[s,i]);const g=l("fixed inset-0 z-1000 transition-all duration-300",{"bg-neutral-darker/50 backdrop-blur-sm":s,"bg-transparent pointer-events-none":!s,"hidden invisible absolute inset-0":f&&!h}),k=l("fixed bg-white shadow-2xl transition-all duration-300 ease-out overflow-auto",(()=>{switch(a){case"top":return"top-0 left-0 right-0";case"bottom":default:return"bottom-0 left-0 right-0";case"left":return"top-0 left-0 bottom-0";case"right":return"top-0 right-0 bottom-0"}})(),(()=>{const e="top"===a||"bottom"===a;return u?"w-full h-full":e?"w-full max-h-[90vh]":"h-full max-w-[90vw]"})(),(()=>{if(!s)switch(a){case"top":return"-translate-y-full";case"bottom":default:return"translate-y-full";case"left":return"-translate-x-full";case"right":return"translate-x-full"}return"translate-x-0 translate-y-0"})(),{"rounded-t-2xl":"bottom"===a&&!u,"rounded-b-2xl":"top"===a&&!u,"rounded-r-2xl":"left"===a&&!u,"rounded-l-2xl":"right"===a&&!u,"p-6":!p,"p-4":p},d),E=e.jsx("div",{ref:y,className:g,onClick:e=>{!u&&i&&y.current&&e.target===y.current&&i()},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||!u&&i&&y.current&&e.target===y.current&&i()},tabIndex:-1,role:"button","aria-label":"Close drawer","aria-hidden":!s,children:e.jsx("div",{ref:m||v,className:k,role:"dialog","aria-modal":"true","aria-label":"Drawer",...b,children:o})});return f||h?f&&!h?E:s?r.createPortal(E,document.body):null:null});o.displayName="Drawer",exports.Drawer=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";var e=require("react/jsx-runtime"),r=require("../contexts.js"),t=require("../utils.js"),i=require("react");const o=require("./createLucideIcon-BqJVOzoK.js").createLucideIcon("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),n={purple:{background:"bg-primary-lightest",text:"text-primary-darkest",border:"border-primary-light"},red:{background:"bg-error-light",text:"text-error",border:"border-error-light"},green:{background:"bg-success-light",text:"text-success",border:"border-success-light"},orange:{background:"bg-warning-light",text:"text-warning",border:"border-warning-light"},blue:{background:"bg-info-light",text:"text-info",border:"border-info-light"},white:{background:"bg-white",text:"text-neutral-darker",border:"border-neutral-light"},disabled:{background:"bg-neutral-lighter",text:"text-neutral-main",border:"border-neutral-light"}},a={mobile:{padding:"px-2.5 py-1",gap:"gap-1",iconSize:"w-4 h-4",fontSize:"text-xs",lineHeight:"leading-normal"},desktop:{padding:"px-3 py-1",gap:"gap-1.5",iconSize:"w-5 h-5",fontSize:"text-s",lineHeight:"leading-6"}},l=i.forwardRef(({variant:i="purple",size:l,children:s="متن پیشفرض",disabled:d=!1,onClick:c,onIconClick:b,className:u,isMobile:g,showIcon:p=!0,startIcon:x,...h},f)=>{const k=r.useMobile(),y=n[d?"disabled":i],m=a[l||(g??k?"mobile":"desktop")],handleIconClick=e=>{e.stopPropagation(),b&&b()};return e.jsxs("div",{ref:f,className:t("relative rounded-full border border-solid inline-flex","flex-row items-center justify-center","font-sans font-bold not-italic","text-nowrap text-right","transition-all duration-200",y.background,y.text,y.border,m.padding,m.gap,m.fontSize,m.lineHeight,c&&!d&&"cursor-pointer hover:opacity-80",d&&"cursor-not-allowed opacity-60",u),onClick:d?void 0:c,onKeyDown:c&&!d?e=>{"Enter"!==e.key&&" "!==e.key||!c||d||(e.preventDefault(),c())}:void 0,tabIndex:c&&!d?0:void 0,role:c?"button":void 0,...h,children:[x?e.jsx("span",{className:t("flex items-center justify-center",m.iconSize),children:x}):null,e.jsx("span",{className:"text-center",children:s}),(()=>{if(!p)return null;const r=e.jsx(o,{className:t(m.iconSize)});return b?e.jsx("button",{type:"button",onClick:handleIconClick,disabled:d,className:t("flex items-center justify-center","hover:opacity-70 transition-opacity",d&&"cursor-not-allowed opacity-50"),"aria-label":"حذف",children:r}):r})()]})});l.displayName="Chips",exports.Chips=l,exports.X=o;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./Typography.js"),r=require("./Button.js"),s=require("./Input.js"),o=require("./Tabs.js"),a=require("./Drawer.js"),i=require("./Backdrop.js"),t=require("./Breadcrumb.js"),l=require("./Pagination.js"),n=require("./Accordion.js"),c=require("./Divider.js"),d=require("./RadioGroup.js"),u=require("./chunks/Chips-
|
|
1
|
+
"use strict";var e=require("./Typography.js"),r=require("./Button.js"),s=require("./Input.js"),o=require("./Tabs.js"),a=require("./Drawer.js"),i=require("./Backdrop.js"),t=require("./Breadcrumb.js"),l=require("./Pagination.js"),n=require("./Accordion.js"),c=require("./Divider.js"),d=require("./RadioGroup.js"),u=require("./chunks/Chips-Ws80QAgh.js"),x=require("./Menu.js"),p=require("react/jsx-runtime"),b=require("react"),m=require("./utils.js"),h=require("./contexts.js");require("react-dom"),require("./chunks/chevron-left-Do__K6cA.js"),require("./chunks/createLucideIcon-BqJVOzoK.js");const j=b.forwardRef(({isOpen:e=!1,onClose:r,title:s,content:o,buttons:a,showCloseButton:t=!0,size:l="md",className:n,children:c},d)=>{const handleClose=()=>{r&&r()},x=m("bg-white rounded-[10px] shadow-lg mx-4 w-full",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl"}[l],n);return p.jsx(i.Backdrop,{isOpen:e,onClick:handleClose,blur:!0,children:p.jsx("div",{ref:d,className:x,onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Escape"===e.key&&r&&r()},role:"dialog","aria-modal":"true","aria-labelledby":s?"dialog-title":void 0,children:p.jsxs("div",{className:"flex flex-col p-6 gap-8",children:[s&&p.jsx("div",{className:"flex flex-col gap-2.5",children:p.jsx("div",{className:"flex items-center justify-between pb-4 border-b border-[#ebeaf0]",children:p.jsxs("div",{className:"flex items-center justify-between gap-3 w-full flex-row-reverse",children:[p.jsx("div",{className:"text-[#590d8b] text-xl font-extrabold leading-8",children:s}),t&&p.jsx("button",{type:"button",onClick:handleClose,className:"p-1 rounded-full hover:bg-gray-100 transition-colors","aria-label":"Close dialog",children:p.jsx(u.X,{className:"w-6 h-6 text-[#a4a2bb]"})})]})})}),o&&p.jsx("div",{className:"flex flex-col gap-4",children:o}),c&&!o&&p.jsx("div",{className:"flex flex-col gap-4",children:c}),a&&p.jsx("div",{className:"flex flex-col gap-1.5",children:a})]})})})});j.displayName="Dialog";const g=b.forwardRef(({variant:e="primary",icon:r,children:s,className:o,...a},i)=>{const t=m("h-14 px-4 py-[13px] rounded-md font-bold text-base leading-[1.8] flex items-center justify-center gap-2 transition-colors",{"bg-[#590d8b] text-white hover:bg-[#4a0a75]":"primary"===e,"bg-white text-[#1a1922] border border-[#ebeaf0] hover:bg-gray-50":"secondary"===e},o);return p.jsxs("button",{type:"button",ref:i,className:t,...a,children:[s,r&&p.jsx("span",{className:"w-5 h-5",children:r})]})});g.displayName="DialogButton";const f=e.Typography,v=r.Button,w=s.Input,y=o.Tabs,q=a.Drawer,N=i.Backdrop,B=t.Breadcrumb,k=l.Pagination,D=n.Accordion,C=c.Divider,T=d.RadioGroup,M=u.Chips,P=x.Menu;exports.MobileProvider=h.MobileProvider,exports.useMobile=h.useMobile,exports.useTablet=h.useTablet,exports.Accordion=D,exports.Backdrop=N,exports.Breadcrumb=B,exports.Button=v,exports.Chips=M,exports.Dialog=j,exports.DialogButton=g,exports.Divider=C,exports.Drawer=q,exports.Input=w,exports.Menu=P,exports.Pagination=k,exports.RadioGroup=T,exports.Tabs=y,exports.Typography=f;
|
package/dist/esm/Chips.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import"react/jsx-runtime";import"./contexts.js";import"./utils.js";import"react";export{C as Chips,C as default}from"./chunks/Chips-
|
|
1
|
+
"use client";import"react/jsx-runtime";import"./contexts.js";import"./utils.js";import"react";export{C as Chips,C as default}from"./chunks/Chips-Dg1jNlMl.js";import"./chunks/createLucideIcon-DGp0SoUT.js";
|
package/dist/esm/Drawer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t}from"react/jsx-runtime";import e,{useState as r,useRef as o,useEffect as n}from"react";import{createPortal as l}from"react-dom";import a from"./utils.js";import{useMobile as i}from"./contexts.js";const s=e.forwardRef(({children:e,direction:s="bottom",fullScreen:u=!1,isOpen:d=!1,onClose:c,className:m,isMobile:f,keepMounted:b,...p},h)=>{const[w,x]=r(!1),y=i(),g=f??y,v=o(null),k=o(null);n(()=>{x(!0)},[]),n(()=>{const handleEscape=t=>{"Escape"===t.key&&d&&c&&c()};return d&&(document.addEventListener("keydown",handleEscape),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",handleEscape),document.body.style.overflow="auto"}},[d,c]);const E=a("fixed inset-0 z-
|
|
1
|
+
"use client";import{jsx as t}from"react/jsx-runtime";import e,{useState as r,useRef as o,useEffect as n}from"react";import{createPortal as l}from"react-dom";import a from"./utils.js";import{useMobile as i}from"./contexts.js";const s=e.forwardRef(({children:e,direction:s="bottom",fullScreen:u=!1,isOpen:d=!1,onClose:c,className:m,isMobile:f,keepMounted:b,...p},h)=>{const[w,x]=r(!1),y=i(),g=f??y,v=o(null),k=o(null);n(()=>{x(!0)},[]),n(()=>{const handleEscape=t=>{"Escape"===t.key&&d&&c&&c()};return d&&(document.addEventListener("keydown",handleEscape),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",handleEscape),document.body.style.overflow="auto"}},[d,c]);const E=a("fixed inset-0 z-1000 transition-all duration-300",{"bg-neutral-darker/50 backdrop-blur-sm":d,"bg-transparent pointer-events-none":!d,"hidden invisible absolute inset-0":b&&!w}),N=a("fixed bg-white shadow-2xl transition-all duration-300 ease-out overflow-auto",(()=>{switch(s){case"top":return"top-0 left-0 right-0";case"bottom":default:return"bottom-0 left-0 right-0";case"left":return"top-0 left-0 bottom-0";case"right":return"top-0 right-0 bottom-0"}})(),(()=>{const t="top"===s||"bottom"===s;return u?"w-full h-full":t?"w-full max-h-[90vh]":"h-full max-w-[90vw]"})(),(()=>{if(!d)switch(s){case"top":return"-translate-y-full";case"bottom":default:return"translate-y-full";case"left":return"-translate-x-full";case"right":return"translate-x-full"}return"translate-x-0 translate-y-0"})(),{"rounded-t-2xl":"bottom"===s&&!u,"rounded-b-2xl":"top"===s&&!u,"rounded-r-2xl":"left"===s&&!u,"rounded-l-2xl":"right"===s&&!u,"p-6":!g,"p-4":g},m),j=t("div",{ref:v,className:E,onClick:t=>{!u&&c&&v.current&&t.target===v.current&&c()},onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||!u&&c&&v.current&&t.target===v.current&&c()},tabIndex:-1,role:"button","aria-label":"Close drawer","aria-hidden":!d,children:t("div",{ref:h||k,className:N,role:"dialog","aria-modal":"true","aria-label":"Drawer",...p,children:e})});return b||w?b&&!w?j:d?l(j,document.body):null:null});s.displayName="Drawer";export{s as Drawer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useMobile as r}from"../contexts.js";import i from"../utils.js";import{forwardRef as o}from"react";import{c as n}from"./createLucideIcon-DGp0SoUT.js";const a=n("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),l={purple:{background:"bg-primary-lightest",text:"text-primary-darkest",border:"border-primary-light"},red:{background:"bg-error-light",text:"text-error",border:"border-error-light"},green:{background:"bg-success-light",text:"text-success",border:"border-success-light"},orange:{background:"bg-warning-light",text:"text-warning",border:"border-warning-light"},blue:{background:"bg-info-light",text:"text-info",border:"border-info-light"},white:{background:"bg-white",text:"text-neutral-darker",border:"border-neutral-light"},disabled:{background:"bg-neutral-lighter",text:"text-neutral-main",border:"border-neutral-light"}},d={mobile:{padding:"px-2.5 py-1",gap:"gap-1",iconSize:"w-4 h-4",fontSize:"text-xs",lineHeight:"leading-normal"},desktop:{padding:"px-3 py-1",gap:"gap-1.5",iconSize:"w-5 h-5",fontSize:"text-s",lineHeight:"leading-6"}},s=o(({variant:o="purple",size:n,children:s="متن پیشفرض",disabled:c=!1,onClick:b,onIconClick:g,className:p,isMobile:u,showIcon:h=!0,startIcon:x,...m},f)=>{const k=r(),y=l[c?"disabled":o],w=d[n||(u??k?"mobile":"desktop")],handleIconClick=e=>{e.stopPropagation(),g&&g()};return e("div",{ref:f,className:i("relative rounded-full border border-solid inline-flex","flex-row items-center justify-center","font-sans font-bold not-italic","text-nowrap text-right","transition-all duration-200",y.background,y.text,y.border,w.padding,w.gap,w.fontSize,w.lineHeight,b&&!c&&"cursor-pointer hover:opacity-80",c&&"cursor-not-allowed opacity-60",p),onClick:c?void 0:b,onKeyDown:b&&!c?e=>{"Enter"!==e.key&&" "!==e.key||!b||c||(e.preventDefault(),b())}:void 0,tabIndex:b&&!c?0:void 0,role:b?"button":void 0,...m,children:[x?t("span",{className:i("flex items-center justify-center",w.iconSize),children:x}):null,t("span",{className:"text-center",children:s}),(()=>{if(!h)return null;const e=t(a,{className:i(w.iconSize)});return g?t("button",{type:"button",onClick:handleIconClick,disabled:c,className:i("flex items-center justify-center","hover:opacity-70 transition-opacity",c&&"cursor-not-allowed opacity-50"),"aria-label":"حذف",children:e}):e})()]})});s.displayName="Chips";export{s as C,a as X};
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Typography as e}from"./Typography.js";import{Button as r}from"./Button.js";import{Input as o}from"./Input.js";import{Tabs as a}from"./Tabs.js";import{Drawer as t}from"./Drawer.js";import{Backdrop as s}from"./Backdrop.js";import{Breadcrumb as i}from"./Breadcrumb.js";import{Pagination as l}from"./Pagination.js";import{Accordion as n}from"./Accordion.js";import{Divider as m}from"./Divider.js";import{RadioGroup as c}from"./RadioGroup.js";import{X as d,C as p}from"./chunks/Chips-
|
|
1
|
+
import{Typography as e}from"./Typography.js";import{Button as r}from"./Button.js";import{Input as o}from"./Input.js";import{Tabs as a}from"./Tabs.js";import{Drawer as t}from"./Drawer.js";import{Backdrop as s}from"./Backdrop.js";import{Breadcrumb as i}from"./Breadcrumb.js";import{Pagination as l}from"./Pagination.js";import{Accordion as n}from"./Accordion.js";import{Divider as m}from"./Divider.js";import{RadioGroup as c}from"./RadioGroup.js";import{X as d,C as p}from"./chunks/Chips-Dg1jNlMl.js";import{Menu as f}from"./Menu.js";import{jsx as b,jsxs as u}from"react/jsx-runtime";import x from"react";import h from"./utils.js";export{MobileProvider,useMobile,useTablet}from"./contexts.js";import"react-dom";import"./chunks/chevron-left-4HSuTes3.js";import"./chunks/createLucideIcon-DGp0SoUT.js";const g=x.forwardRef(({isOpen:e=!1,onClose:r,title:o,content:a,buttons:t,showCloseButton:i=!0,size:l="md",className:n,children:m},c)=>{const handleClose=()=>{r&&r()},p=h("bg-white rounded-[10px] shadow-lg mx-4 w-full",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl"}[l],n);return b(s,{isOpen:e,onClick:handleClose,blur:!0,children:b("div",{ref:c,className:p,onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Escape"===e.key&&r&&r()},role:"dialog","aria-modal":"true","aria-labelledby":o?"dialog-title":void 0,children:u("div",{className:"flex flex-col p-6 gap-8",children:[o&&b("div",{className:"flex flex-col gap-2.5",children:b("div",{className:"flex items-center justify-between pb-4 border-b border-[#ebeaf0]",children:u("div",{className:"flex items-center justify-between gap-3 w-full flex-row-reverse",children:[b("div",{className:"text-[#590d8b] text-xl font-extrabold leading-8",children:o}),i&&b("button",{type:"button",onClick:handleClose,className:"p-1 rounded-full hover:bg-gray-100 transition-colors","aria-label":"Close dialog",children:b(d,{className:"w-6 h-6 text-[#a4a2bb]"})})]})})}),a&&b("div",{className:"flex flex-col gap-4",children:a}),m&&!a&&b("div",{className:"flex flex-col gap-4",children:m}),t&&b("div",{className:"flex flex-col gap-1.5",children:t})]})})})});g.displayName="Dialog";const j=x.forwardRef(({variant:e="primary",icon:r,children:o,className:a,...t},s)=>{const i=h("h-14 px-4 py-[13px] rounded-md font-bold text-base leading-[1.8] flex items-center justify-center gap-2 transition-colors",{"bg-[#590d8b] text-white hover:bg-[#4a0a75]":"primary"===e,"bg-white text-[#1a1922] border border-[#ebeaf0] hover:bg-gray-50":"secondary"===e},a);return u("button",{type:"button",ref:s,className:i,...t,children:[o,r&&b("span",{className:"w-5 h-5",children:r})]})});j.displayName="DialogButton";const w=e,y=r,v=o,N=a,k=t,B=s,C=i,D=l,T=n,M=m,P=c,R=p,I=f;export{T as Accordion,B as Backdrop,C as Breadcrumb,y as Button,R as Chips,g as Dialog,j as DialogButton,M as Divider,k as Drawer,v as Input,I as Menu,D as Pagination,P as RadioGroup,N as Tabs,w as Typography};
|
|
@@ -27,22 +27,22 @@ const chipVariants = {
|
|
|
27
27
|
red: {
|
|
28
28
|
background: 'bg-error-light',
|
|
29
29
|
text: 'text-error',
|
|
30
|
-
border: 'border-
|
|
30
|
+
border: 'border-error-light',
|
|
31
31
|
},
|
|
32
32
|
green: {
|
|
33
33
|
background: 'bg-success-light',
|
|
34
34
|
text: 'text-success',
|
|
35
|
-
border: 'border-
|
|
35
|
+
border: 'border-success-light',
|
|
36
36
|
},
|
|
37
37
|
orange: {
|
|
38
38
|
background: 'bg-warning-light',
|
|
39
39
|
text: 'text-warning',
|
|
40
|
-
border: 'border-
|
|
40
|
+
border: 'border-warning-light',
|
|
41
41
|
},
|
|
42
42
|
blue: {
|
|
43
43
|
background: 'bg-info-light',
|
|
44
44
|
text: 'text-info',
|
|
45
|
-
border: 'border-
|
|
45
|
+
border: 'border-info-light',
|
|
46
46
|
},
|
|
47
47
|
white: {
|
|
48
48
|
background: 'bg-white',
|
|
@@ -59,16 +59,16 @@ const chipSizes = {
|
|
|
59
59
|
mobile: {
|
|
60
60
|
padding: 'px-2.5 py-1',
|
|
61
61
|
gap: 'gap-1',
|
|
62
|
-
iconSize: '
|
|
62
|
+
iconSize: 'w-4 h-4',
|
|
63
63
|
fontSize: 'text-xs',
|
|
64
|
-
lineHeight: 'leading-
|
|
64
|
+
lineHeight: 'leading-normal',
|
|
65
65
|
},
|
|
66
66
|
desktop: {
|
|
67
67
|
padding: 'px-3 py-1',
|
|
68
68
|
gap: 'gap-1.5',
|
|
69
|
-
iconSize: '
|
|
69
|
+
iconSize: 'w-5 h-5',
|
|
70
70
|
fontSize: 'text-s',
|
|
71
|
-
lineHeight: 'leading-
|
|
71
|
+
lineHeight: 'leading-6',
|
|
72
72
|
},
|
|
73
73
|
};
|
|
74
74
|
const Chips = forwardRef(({ variant = 'purple', size, children = 'متن پیشفرض', disabled = false, onClick, onIconClick, className, isMobile, showIcon = true, startIcon, ...props }, ref) => {
|
|
@@ -106,7 +106,7 @@ const Chips = forwardRef(({ variant = 'purple', size, children = 'متن پیش
|
|
|
106
106
|
};
|
|
107
107
|
return (jsxs("div", { ref: ref, className: cn(
|
|
108
108
|
// Base styles
|
|
109
|
-
'relative rounded-
|
|
109
|
+
'relative rounded-full border border-solid inline-flex', 'flex-row items-center justify-center', 'font-sans font-bold not-italic', 'text-nowrap text-right', 'transition-all duration-200',
|
|
110
110
|
// Variant styles
|
|
111
111
|
variantStyles.background, variantStyles.text, variantStyles.border,
|
|
112
112
|
// Size styles
|
package/dist/types/Chips.js
CHANGED
package/dist/types/Drawer.js
CHANGED
|
@@ -91,7 +91,7 @@ const Drawer = React.forwardRef(({ children, direction = 'bottom', fullScreen =
|
|
|
91
91
|
}
|
|
92
92
|
return 'h-full max-w-[90vw]';
|
|
93
93
|
};
|
|
94
|
-
const baseOverlayClasses = 'fixed inset-0 z-
|
|
94
|
+
const baseOverlayClasses = 'fixed inset-0 z-1000 transition-all duration-300';
|
|
95
95
|
const baseDrawerClasses = 'fixed bg-white shadow-2xl transition-all duration-300 ease-out overflow-auto';
|
|
96
96
|
const overlayClasses = cn(baseOverlayClasses, {
|
|
97
97
|
'bg-neutral-darker/50 backdrop-blur-sm': isOpen,
|
package/dist/types/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { Pagination as Pagination$1 } from './Pagination.js';
|
|
|
9
9
|
import { Accordion as Accordion$1 } from './Accordion.js';
|
|
10
10
|
import { Divider as Divider$1 } from './Divider.js';
|
|
11
11
|
import { RadioGroup as RadioGroup$1 } from './RadioGroup.js';
|
|
12
|
-
import { X, C as Chips$1 } from './Chips-
|
|
12
|
+
import { X, C as Chips$1 } from './Chips-DfvV08WT.js';
|
|
13
13
|
import { Menu as Menu$1 } from './Menu.js';
|
|
14
14
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
15
15
|
import React from 'react';
|
package/package.json
CHANGED
|
@@ -1,176 +1,176 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "automoby-kit",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "A comprehensive React UI component library - created in war 2025",
|
|
5
|
-
"main": "dist/cjs/index.js",
|
|
6
|
-
"module": "dist/esm/index.js",
|
|
7
|
-
"types": "dist/types/index.d.ts",
|
|
8
|
-
"files": [
|
|
9
|
-
"dist"
|
|
10
|
-
],
|
|
11
|
-
"exports": {
|
|
12
|
-
".": {
|
|
13
|
-
"import": "./dist/esm/index.js",
|
|
14
|
-
"require": "./dist/cjs/index.js",
|
|
15
|
-
"types": "./dist/types/index.d.ts"
|
|
16
|
-
},
|
|
17
|
-
"./Typography": {
|
|
18
|
-
"import": "./dist/esm/Typography.js",
|
|
19
|
-
"require": "./dist/cjs/Typography.js",
|
|
20
|
-
"types": "./dist/types/components/Typography/Typography.d.ts"
|
|
21
|
-
},
|
|
22
|
-
"./Button": {
|
|
23
|
-
"import": "./dist/esm/Button.js",
|
|
24
|
-
"require": "./dist/cjs/Button.js",
|
|
25
|
-
"types": "./dist/types/components/Button/Button.d.ts"
|
|
26
|
-
},
|
|
27
|
-
"./Input": {
|
|
28
|
-
"import": "./dist/esm/Input.js",
|
|
29
|
-
"require": "./dist/cjs/Input.js",
|
|
30
|
-
"types": "./dist/types/components/Input/Input.d.ts"
|
|
31
|
-
},
|
|
32
|
-
"./Tabs": {
|
|
33
|
-
"import": "./dist/esm/Tabs.js",
|
|
34
|
-
"require": "./dist/cjs/Tabs.js",
|
|
35
|
-
"types": "./dist/types/components/Tabs/Tabs.d.ts"
|
|
36
|
-
},
|
|
37
|
-
"./Drawer": {
|
|
38
|
-
"import": "./dist/esm/Drawer.js",
|
|
39
|
-
"require": "./dist/cjs/Drawer.js",
|
|
40
|
-
"types": "./dist/types/components/Drawer/Drawer.d.ts"
|
|
41
|
-
},
|
|
42
|
-
"./Backdrop": {
|
|
43
|
-
"import": "./dist/esm/Backdrop.js",
|
|
44
|
-
"require": "./dist/cjs/Backdrop.js",
|
|
45
|
-
"types": "./dist/types/components/Backdrop/Backdrop.d.ts"
|
|
46
|
-
},
|
|
47
|
-
"./Breadcrumb": {
|
|
48
|
-
"import": "./dist/esm/Breadcrumb.js",
|
|
49
|
-
"require": "./dist/cjs/Breadcrumb.js",
|
|
50
|
-
"types": "./dist/types/components/Breadcrumb/Breadcrumb.d.ts"
|
|
51
|
-
},
|
|
52
|
-
"./Pagination": {
|
|
53
|
-
"import": "./dist/esm/Pagination.js",
|
|
54
|
-
"require": "./dist/cjs/Pagination.js",
|
|
55
|
-
"types": "./dist/types/components/Pagination/Pagination.d.ts"
|
|
56
|
-
},
|
|
57
|
-
"./Accordion": {
|
|
58
|
-
"import": "./dist/esm/Accordion.js",
|
|
59
|
-
"require": "./dist/cjs/Accordion.js",
|
|
60
|
-
"types": "./dist/types/components/Accordion/Accordion.d.ts"
|
|
61
|
-
},
|
|
62
|
-
"./Divider": {
|
|
63
|
-
"import": "./dist/esm/Divider.js",
|
|
64
|
-
"require": "./dist/cjs/Divider.js",
|
|
65
|
-
"types": "./dist/types/components/Divider/Divider.d.ts"
|
|
66
|
-
},
|
|
67
|
-
"./RadioGroup": {
|
|
68
|
-
"import": "./dist/esm/RadioGroup.js",
|
|
69
|
-
"require": "./dist/cjs/RadioGroup.js",
|
|
70
|
-
"types": "./dist/types/components/RadioGroup/RadioGroup.d.ts"
|
|
71
|
-
},
|
|
72
|
-
"./Chips": {
|
|
73
|
-
"import": "./dist/esm/Chips.js",
|
|
74
|
-
"require": "./dist/cjs/Chips.js",
|
|
75
|
-
"types": "./dist/types/components/Chips/Chips.d.ts"
|
|
76
|
-
},
|
|
77
|
-
"./Menu": {
|
|
78
|
-
"import": "./dist/esm/Menu.js",
|
|
79
|
-
"require": "./dist/cjs/Menu.js",
|
|
80
|
-
"types": "./dist/types/components/Menu/Menu.d.ts"
|
|
81
|
-
},
|
|
82
|
-
"./contexts": {
|
|
83
|
-
"import": "./dist/esm/contexts.js",
|
|
84
|
-
"require": "./dist/cjs/contexts.js",
|
|
85
|
-
"types": "./dist/types/contexts/index.d.ts"
|
|
86
|
-
},
|
|
87
|
-
"./utils": {
|
|
88
|
-
"import": "./dist/esm/utils.js",
|
|
89
|
-
"require": "./dist/cjs/utils.js",
|
|
90
|
-
"types": "./dist/types/utils/cn.d.ts"
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
"keywords": [
|
|
94
|
-
"react",
|
|
95
|
-
"ui",
|
|
96
|
-
"components",
|
|
97
|
-
"typescript",
|
|
98
|
-
"tailwind",
|
|
99
|
-
"kit"
|
|
100
|
-
],
|
|
101
|
-
"scripts": {
|
|
102
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
103
|
-
"lint": "eslint \"src/**/*.{js,ts,jsx,tsx}\" --fix",
|
|
104
|
-
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,css,md}\"",
|
|
105
|
-
"check-format": "prettier --check \"src/**/*.{js,jsx,ts,tsx,json,css,md}\"",
|
|
106
|
-
"check-lint": "eslint \"src/**/*.{js,ts,jsx,tsx}\"",
|
|
107
|
-
"check-types": "tsc --noEmit",
|
|
108
|
-
"prepare": "husky",
|
|
109
|
-
"prepublishOnly": "npm run build",
|
|
110
|
-
"storybook": "storybook dev -p 6006",
|
|
111
|
-
"storybook:dev": "concurrently \"npm:build:storybook:css:watch\" \"cross-env STORYBOOK_FORCE_MOBILE=true storybook dev -p 6006 \"",
|
|
112
|
-
"storybook:dev:mobile": "concurrently \"npm:build:storybook:css:watch\" \"cross-env STORYBOOK_FORCE_MOBILE=true storybook dev -p 6006 \"",
|
|
113
|
-
"storybook:dev:desktop": "concurrently \"npm:build:storybook:css:watch\" \"cross-env STORYBOOK_FORCE_MOBILE=false storybook dev -p 6006 \"",
|
|
114
|
-
"build-storybook": "storybook build",
|
|
115
|
-
"build:storybook:css:watch": "npx @tailwindcss/cli -i ./.storybook/tailwind.css -o ./tailwind-build/tailwind.build.css --watch",
|
|
116
|
-
"build:storybook:css": "npx @tailwindcss/cli -i ./.storybook/tailwind.css -o ./tailwind-build/tailwind.build.css",
|
|
117
|
-
"clean": "rimraf dist",
|
|
118
|
-
"build": "npm run clean && rollup -c"
|
|
119
|
-
},
|
|
120
|
-
"author": "Ghazal_kordi Alireza_mirzaee",
|
|
121
|
-
"license": "ISC",
|
|
122
|
-
"peerDependencies": {
|
|
123
|
-
"clsx": "^2.1.1",
|
|
124
|
-
"lucide-react": "^0.522.0",
|
|
125
|
-
"react": "^19.1.0",
|
|
126
|
-
"react-dom": "^19.1.0",
|
|
127
|
-
"tailwindcss": "^4.1.10",
|
|
128
|
-
"typescript": "^5.8.3",
|
|
129
|
-
"ua-parser-js": "^2.0.4"
|
|
130
|
-
},
|
|
131
|
-
"devDependencies": {
|
|
132
|
-
"@rollup/plugin-alias": "^5.1.1",
|
|
133
|
-
"@rollup/plugin-commonjs": "^28.0.6",
|
|
134
|
-
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
135
|
-
"@rollup/plugin-terser": "^0.4.4",
|
|
136
|
-
"@rollup/plugin-typescript": "^12.1.3",
|
|
137
|
-
"@storybook/addon-docs": "^9.0.6",
|
|
138
|
-
"@storybook/addon-onboarding": "^9.0.6",
|
|
139
|
-
"@storybook/react-vite": "^9.0.6",
|
|
140
|
-
"@tailwindcss/cli": "^4.1.10",
|
|
141
|
-
"@tailwindcss/postcss": "^4.1.10",
|
|
142
|
-
"@types/node": "^24.0.3",
|
|
143
|
-
"@types/react": "^19.1.4",
|
|
144
|
-
"@types/react-dom": "^19.1.5",
|
|
145
|
-
"@types/ua-parser-js": "^0.7.39",
|
|
146
|
-
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
147
|
-
"@typescript-eslint/parser": "^7.18.0",
|
|
148
|
-
"autoprefixer": "^10.4.21",
|
|
149
|
-
"clsx": "^2.1.1",
|
|
150
|
-
"concurrently": "^9.2.0",
|
|
151
|
-
"cross-env": "^7.0.3",
|
|
152
|
-
"eslint": "^8.57.0",
|
|
153
|
-
"eslint-config-airbnb": "^19.0.4",
|
|
154
|
-
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
155
|
-
"eslint-config-prettier": "^10.1.5",
|
|
156
|
-
"eslint-import-resolver-typescript": "^4.4.3",
|
|
157
|
-
"eslint-plugin-import": "^2.32.0",
|
|
158
|
-
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
159
|
-
"eslint-plugin-prettier": "^5.5.0",
|
|
160
|
-
"eslint-plugin-react": "^7.37.5",
|
|
161
|
-
"eslint-plugin-storybook": "^9.0.6",
|
|
162
|
-
"husky": "^9.1.7",
|
|
163
|
-
"lucide-react": "^0.522.0",
|
|
164
|
-
"prettier": "^3.5.3",
|
|
165
|
-
"react": "^19.1.0",
|
|
166
|
-
"react-dom": "^19.1.0",
|
|
167
|
-
"rimraf": "^6.0.1",
|
|
168
|
-
"rollup": "^4.44.0",
|
|
169
|
-
"serve": "^14.2.4",
|
|
170
|
-
"storybook": "^9.0.6",
|
|
171
|
-
"tailwind-merge": "^3.3.1",
|
|
172
|
-
"tailwindcss": "^4.1.10",
|
|
173
|
-
"typescript": "^5.8.3",
|
|
174
|
-
"ua-parser-js": "^2.0.4"
|
|
175
|
-
}
|
|
176
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "automoby-kit",
|
|
3
|
+
"version": "1.0.52",
|
|
4
|
+
"description": "A comprehensive React UI component library - created in war 2025",
|
|
5
|
+
"main": "dist/cjs/index.js",
|
|
6
|
+
"module": "dist/esm/index.js",
|
|
7
|
+
"types": "dist/types/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/esm/index.js",
|
|
14
|
+
"require": "./dist/cjs/index.js",
|
|
15
|
+
"types": "./dist/types/index.d.ts"
|
|
16
|
+
},
|
|
17
|
+
"./Typography": {
|
|
18
|
+
"import": "./dist/esm/Typography.js",
|
|
19
|
+
"require": "./dist/cjs/Typography.js",
|
|
20
|
+
"types": "./dist/types/components/Typography/Typography.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./Button": {
|
|
23
|
+
"import": "./dist/esm/Button.js",
|
|
24
|
+
"require": "./dist/cjs/Button.js",
|
|
25
|
+
"types": "./dist/types/components/Button/Button.d.ts"
|
|
26
|
+
},
|
|
27
|
+
"./Input": {
|
|
28
|
+
"import": "./dist/esm/Input.js",
|
|
29
|
+
"require": "./dist/cjs/Input.js",
|
|
30
|
+
"types": "./dist/types/components/Input/Input.d.ts"
|
|
31
|
+
},
|
|
32
|
+
"./Tabs": {
|
|
33
|
+
"import": "./dist/esm/Tabs.js",
|
|
34
|
+
"require": "./dist/cjs/Tabs.js",
|
|
35
|
+
"types": "./dist/types/components/Tabs/Tabs.d.ts"
|
|
36
|
+
},
|
|
37
|
+
"./Drawer": {
|
|
38
|
+
"import": "./dist/esm/Drawer.js",
|
|
39
|
+
"require": "./dist/cjs/Drawer.js",
|
|
40
|
+
"types": "./dist/types/components/Drawer/Drawer.d.ts"
|
|
41
|
+
},
|
|
42
|
+
"./Backdrop": {
|
|
43
|
+
"import": "./dist/esm/Backdrop.js",
|
|
44
|
+
"require": "./dist/cjs/Backdrop.js",
|
|
45
|
+
"types": "./dist/types/components/Backdrop/Backdrop.d.ts"
|
|
46
|
+
},
|
|
47
|
+
"./Breadcrumb": {
|
|
48
|
+
"import": "./dist/esm/Breadcrumb.js",
|
|
49
|
+
"require": "./dist/cjs/Breadcrumb.js",
|
|
50
|
+
"types": "./dist/types/components/Breadcrumb/Breadcrumb.d.ts"
|
|
51
|
+
},
|
|
52
|
+
"./Pagination": {
|
|
53
|
+
"import": "./dist/esm/Pagination.js",
|
|
54
|
+
"require": "./dist/cjs/Pagination.js",
|
|
55
|
+
"types": "./dist/types/components/Pagination/Pagination.d.ts"
|
|
56
|
+
},
|
|
57
|
+
"./Accordion": {
|
|
58
|
+
"import": "./dist/esm/Accordion.js",
|
|
59
|
+
"require": "./dist/cjs/Accordion.js",
|
|
60
|
+
"types": "./dist/types/components/Accordion/Accordion.d.ts"
|
|
61
|
+
},
|
|
62
|
+
"./Divider": {
|
|
63
|
+
"import": "./dist/esm/Divider.js",
|
|
64
|
+
"require": "./dist/cjs/Divider.js",
|
|
65
|
+
"types": "./dist/types/components/Divider/Divider.d.ts"
|
|
66
|
+
},
|
|
67
|
+
"./RadioGroup": {
|
|
68
|
+
"import": "./dist/esm/RadioGroup.js",
|
|
69
|
+
"require": "./dist/cjs/RadioGroup.js",
|
|
70
|
+
"types": "./dist/types/components/RadioGroup/RadioGroup.d.ts"
|
|
71
|
+
},
|
|
72
|
+
"./Chips": {
|
|
73
|
+
"import": "./dist/esm/Chips.js",
|
|
74
|
+
"require": "./dist/cjs/Chips.js",
|
|
75
|
+
"types": "./dist/types/components/Chips/Chips.d.ts"
|
|
76
|
+
},
|
|
77
|
+
"./Menu": {
|
|
78
|
+
"import": "./dist/esm/Menu.js",
|
|
79
|
+
"require": "./dist/cjs/Menu.js",
|
|
80
|
+
"types": "./dist/types/components/Menu/Menu.d.ts"
|
|
81
|
+
},
|
|
82
|
+
"./contexts": {
|
|
83
|
+
"import": "./dist/esm/contexts.js",
|
|
84
|
+
"require": "./dist/cjs/contexts.js",
|
|
85
|
+
"types": "./dist/types/contexts/index.d.ts"
|
|
86
|
+
},
|
|
87
|
+
"./utils": {
|
|
88
|
+
"import": "./dist/esm/utils.js",
|
|
89
|
+
"require": "./dist/cjs/utils.js",
|
|
90
|
+
"types": "./dist/types/utils/cn.d.ts"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"keywords": [
|
|
94
|
+
"react",
|
|
95
|
+
"ui",
|
|
96
|
+
"components",
|
|
97
|
+
"typescript",
|
|
98
|
+
"tailwind",
|
|
99
|
+
"kit"
|
|
100
|
+
],
|
|
101
|
+
"scripts": {
|
|
102
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
103
|
+
"lint": "eslint \"src/**/*.{js,ts,jsx,tsx}\" --fix",
|
|
104
|
+
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,css,md}\"",
|
|
105
|
+
"check-format": "prettier --check \"src/**/*.{js,jsx,ts,tsx,json,css,md}\"",
|
|
106
|
+
"check-lint": "eslint \"src/**/*.{js,ts,jsx,tsx}\"",
|
|
107
|
+
"check-types": "tsc --noEmit",
|
|
108
|
+
"prepare": "husky",
|
|
109
|
+
"prepublishOnly": "npm run build",
|
|
110
|
+
"storybook": "storybook dev -p 6006",
|
|
111
|
+
"storybook:dev": "concurrently \"npm:build:storybook:css:watch\" \"cross-env STORYBOOK_FORCE_MOBILE=true storybook dev -p 6006 \"",
|
|
112
|
+
"storybook:dev:mobile": "concurrently \"npm:build:storybook:css:watch\" \"cross-env STORYBOOK_FORCE_MOBILE=true storybook dev -p 6006 \"",
|
|
113
|
+
"storybook:dev:desktop": "concurrently \"npm:build:storybook:css:watch\" \"cross-env STORYBOOK_FORCE_MOBILE=false storybook dev -p 6006 \"",
|
|
114
|
+
"build-storybook": "storybook build",
|
|
115
|
+
"build:storybook:css:watch": "npx @tailwindcss/cli -i ./.storybook/tailwind.css -o ./tailwind-build/tailwind.build.css --watch",
|
|
116
|
+
"build:storybook:css": "npx @tailwindcss/cli -i ./.storybook/tailwind.css -o ./tailwind-build/tailwind.build.css",
|
|
117
|
+
"clean": "rimraf dist",
|
|
118
|
+
"build": "npm run clean && rollup -c"
|
|
119
|
+
},
|
|
120
|
+
"author": "Ghazal_kordi Alireza_mirzaee",
|
|
121
|
+
"license": "ISC",
|
|
122
|
+
"peerDependencies": {
|
|
123
|
+
"clsx": "^2.1.1",
|
|
124
|
+
"lucide-react": "^0.522.0",
|
|
125
|
+
"react": "^19.1.0",
|
|
126
|
+
"react-dom": "^19.1.0",
|
|
127
|
+
"tailwindcss": "^4.1.10",
|
|
128
|
+
"typescript": "^5.8.3",
|
|
129
|
+
"ua-parser-js": "^2.0.4"
|
|
130
|
+
},
|
|
131
|
+
"devDependencies": {
|
|
132
|
+
"@rollup/plugin-alias": "^5.1.1",
|
|
133
|
+
"@rollup/plugin-commonjs": "^28.0.6",
|
|
134
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
135
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
136
|
+
"@rollup/plugin-typescript": "^12.1.3",
|
|
137
|
+
"@storybook/addon-docs": "^9.0.6",
|
|
138
|
+
"@storybook/addon-onboarding": "^9.0.6",
|
|
139
|
+
"@storybook/react-vite": "^9.0.6",
|
|
140
|
+
"@tailwindcss/cli": "^4.1.10",
|
|
141
|
+
"@tailwindcss/postcss": "^4.1.10",
|
|
142
|
+
"@types/node": "^24.0.3",
|
|
143
|
+
"@types/react": "^19.1.4",
|
|
144
|
+
"@types/react-dom": "^19.1.5",
|
|
145
|
+
"@types/ua-parser-js": "^0.7.39",
|
|
146
|
+
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
147
|
+
"@typescript-eslint/parser": "^7.18.0",
|
|
148
|
+
"autoprefixer": "^10.4.21",
|
|
149
|
+
"clsx": "^2.1.1",
|
|
150
|
+
"concurrently": "^9.2.0",
|
|
151
|
+
"cross-env": "^7.0.3",
|
|
152
|
+
"eslint": "^8.57.0",
|
|
153
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
154
|
+
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
155
|
+
"eslint-config-prettier": "^10.1.5",
|
|
156
|
+
"eslint-import-resolver-typescript": "^4.4.3",
|
|
157
|
+
"eslint-plugin-import": "^2.32.0",
|
|
158
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
159
|
+
"eslint-plugin-prettier": "^5.5.0",
|
|
160
|
+
"eslint-plugin-react": "^7.37.5",
|
|
161
|
+
"eslint-plugin-storybook": "^9.0.6",
|
|
162
|
+
"husky": "^9.1.7",
|
|
163
|
+
"lucide-react": "^0.522.0",
|
|
164
|
+
"prettier": "^3.5.3",
|
|
165
|
+
"react": "^19.1.0",
|
|
166
|
+
"react-dom": "^19.1.0",
|
|
167
|
+
"rimraf": "^6.0.1",
|
|
168
|
+
"rollup": "^4.44.0",
|
|
169
|
+
"serve": "^14.2.4",
|
|
170
|
+
"storybook": "^9.0.6",
|
|
171
|
+
"tailwind-merge": "^3.3.1",
|
|
172
|
+
"tailwindcss": "^4.1.10",
|
|
173
|
+
"typescript": "^5.8.3",
|
|
174
|
+
"ua-parser-js": "^2.0.4"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";"use strict";var e=require("react/jsx-runtime"),t=require("../contexts.js"),r=require("../utils.js"),i=require("react");const o=require("./createLucideIcon-BqJVOzoK.js").createLucideIcon("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),n={purple:{background:"bg-primary-lightest",text:"text-primary-darkest",border:"border-primary-light"},red:{background:"bg-error-light",text:"text-error",border:"border-[#f0d6d6]"},green:{background:"bg-success-light",text:"text-success",border:"border-[#d4e8dc]"},orange:{background:"bg-warning-light",text:"text-warning",border:"border-[#f5e1d1]"},blue:{background:"bg-info-light",text:"text-info",border:"border-[#d3e9f2]"},white:{background:"bg-white",text:"text-neutral-darker",border:"border-neutral-light"},disabled:{background:"bg-neutral-lighter",text:"text-neutral-main",border:"border-neutral-light"}},a={mobile:{padding:"px-2.5 py-1",gap:"gap-1",iconSize:"size-4",fontSize:"text-xs",lineHeight:"leading-[1.8]"},desktop:{padding:"px-3 py-1",gap:"gap-1.5",iconSize:"size-5",fontSize:"text-s",lineHeight:"leading-[24px]"}},d=i.forwardRef(({variant:i="purple",size:d,children:s="متن پیشفرض",disabled:l=!1,onClick:c,onIconClick:b,className:u,isMobile:g,showIcon:p=!0,startIcon:x,...h},f)=>{const k=t.useMobile(),y=n[l?"disabled":i],m=a[d||(g??k?"mobile":"desktop")],handleIconClick=e=>{e.stopPropagation(),b&&b()};return e.jsxs("div",{ref:f,className:r("relative rounded-[50px] border border-solid inline-flex","flex-row items-center justify-center","font-sans font-bold not-italic","text-nowrap text-right","transition-all duration-200",y.background,y.text,y.border,m.padding,m.gap,m.fontSize,m.lineHeight,c&&!l&&"cursor-pointer hover:opacity-80",l&&"cursor-not-allowed opacity-60",u),onClick:l?void 0:c,onKeyDown:c&&!l?e=>{"Enter"!==e.key&&" "!==e.key||!c||l||(e.preventDefault(),c())}:void 0,tabIndex:c&&!l?0:void 0,role:c?"button":void 0,...h,children:[x?e.jsx("span",{className:r("flex items-center justify-center",m.iconSize),children:x}):null,e.jsx("span",{className:"text-center",children:s}),(()=>{if(!p)return null;const t=e.jsx(o,{className:r(m.iconSize)});return b?e.jsx("button",{type:"button",onClick:handleIconClick,disabled:l,className:r("flex items-center justify-center","hover:opacity-70 transition-opacity",l&&"cursor-not-allowed opacity-50"),"aria-label":"حذف",children:t}):t})()]})});d.displayName="Chips",exports.Chips=d,exports.X=o;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useMobile as r}from"../contexts.js";import i from"../utils.js";import{forwardRef as o}from"react";import{c as n}from"./createLucideIcon-DGp0SoUT.js";const a=n("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),d={purple:{background:"bg-primary-lightest",text:"text-primary-darkest",border:"border-primary-light"},red:{background:"bg-error-light",text:"text-error",border:"border-[#f0d6d6]"},green:{background:"bg-success-light",text:"text-success",border:"border-[#d4e8dc]"},orange:{background:"bg-warning-light",text:"text-warning",border:"border-[#f5e1d1]"},blue:{background:"bg-info-light",text:"text-info",border:"border-[#d3e9f2]"},white:{background:"bg-white",text:"text-neutral-darker",border:"border-neutral-light"},disabled:{background:"bg-neutral-lighter",text:"text-neutral-main",border:"border-neutral-light"}},l={mobile:{padding:"px-2.5 py-1",gap:"gap-1",iconSize:"size-4",fontSize:"text-xs",lineHeight:"leading-[1.8]"},desktop:{padding:"px-3 py-1",gap:"gap-1.5",iconSize:"size-5",fontSize:"text-s",lineHeight:"leading-[24px]"}},s=o(({variant:o="purple",size:n,children:s="متن پیشفرض",disabled:c=!1,onClick:b,onIconClick:p,className:g,isMobile:u,showIcon:x=!0,startIcon:m,...f},h)=>{const k=r(),y=d[c?"disabled":o],v=l[n||(u??k?"mobile":"desktop")],handleIconClick=e=>{e.stopPropagation(),p&&p()};return e("div",{ref:h,className:i("relative rounded-[50px] border border-solid inline-flex","flex-row items-center justify-center","font-sans font-bold not-italic","text-nowrap text-right","transition-all duration-200",y.background,y.text,y.border,v.padding,v.gap,v.fontSize,v.lineHeight,b&&!c&&"cursor-pointer hover:opacity-80",c&&"cursor-not-allowed opacity-60",g),onClick:c?void 0:b,onKeyDown:b&&!c?e=>{"Enter"!==e.key&&" "!==e.key||!b||c||(e.preventDefault(),b())}:void 0,tabIndex:b&&!c?0:void 0,role:b?"button":void 0,...f,children:[m?t("span",{className:i("flex items-center justify-center",v.iconSize),children:m}):null,t("span",{className:"text-center",children:s}),(()=>{if(!x)return null;const e=t(a,{className:i(v.iconSize)});return p?t("button",{type:"button",onClick:handleIconClick,disabled:c,className:i("flex items-center justify-center","hover:opacity-70 transition-opacity",c&&"cursor-not-allowed opacity-50"),"aria-label":"حذف",children:e}):e})()]})});s.displayName="Chips";export{s as C,a as X};
|