automoby-kit 1.0.53 → 1.0.55

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 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/Input.js CHANGED
@@ -1 +1 @@
1
- "use client";"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("./utils.js"),l=require("./contexts.js");const a=t.forwardRef(({state:a="default",label:n,value:i,onChange:o,helperText:s,startIcon:u,endIcon:d,type:x="text",placeholder:h,isMobile:p,...c},m)=>{const[f,g]=t.useState(!1),b=t.useId(),j=l.useMobile(),v=p??j,w=f||""!==i&&null!=i,y="disabled"===a,N=r("relative flex items-center border rounded-lg transition-all duration-300 w-90",{"h-14":!v,"h-12":v,"border-neutral-light":"default"===a&&!f,"border-primary":"default"===a&&f,"border-error":"error"===a,"bg-white border-neutral-light cursor-not-allowed":y}),I=r("absolute pointer-events-none transition-all duration-300",{"-top-2.5 bg-white px-1 mx-3 font-medium":w,"text-s":!v&&w||v&&!w,"text-xs":v&&w,"text-m":!v&&!w,"right-1":u,"right-3":!u,"top-1/2 -translate-y-1/2 text-m font-medium":!w,"right-11":!w&&u,"right-4":!w&&!u,"text-neutral-main":!f&&"default"===a,"text-neutral-light":y,"text-primary":f&&"default"===a,"text-error":w&&"error"===a}),q=r("peer w-full h-full bg-transparent outline-none text-m font-medium disabled:text-neutral-light",{"pr-12":u,"pl-12":d,"px-4":!u&&!d,"pr-4 pl-12":!u&&d,"pl-4 pr-12":u&&!d,"cursor-not-allowed text-red-500":y,"text-neutral-dark":!f,"text-neutral-darker":f}),F=r("absolute h-5 w-5 transition-colors duration-300",{"text-neutral-main":"error"!==a&&!f,"text-primary":"default"===a&&f,"text-error":"error"===a,"text-neutral-light":y}),k=r("font-light mt-1 px-2 h-4",{"text-s":!v,"text-xs":v,"text-neutral-main":"default"===a,"text-primary":"default"===a&&f,"text-error":"error"===a,"text-neutral-light":y}),B=h&&!f?void 0:h;return e.jsxs("div",{children:[e.jsxs("div",{className:N,children:[d&&e.jsx("span",{className:r(F,"left-4"),children:d}),e.jsx("label",{htmlFor:b,className:I,children:n}),e.jsx("input",{ref:m,id:b,type:x,value:i,onChange:o,onFocus:e=>{y||(g(!0),c.onFocus?.(e))},onBlur:e=>{y||(g(!1),c.onBlur?.(e))},disabled:y,placeholder:B,className:q,...c}),u&&e.jsx("span",{className:r(F,"right-4"),children:u})]}),s&&e.jsx("p",{className:k,children:s})]})});a.displayName="Input",exports.Input=a;
1
+ "use client";"use strict";var t=require("react/jsx-runtime"),e=require("react"),r=require("./utils.js"),l=require("./contexts.js");const s=e.forwardRef(({state:s="default",label:m,value:a,onChange:i,helperText:d,startIcon:n,endIcon:x,type:o="text",placeholder:g,isMobile:h,containerClassName:u,...p},c)=>{const[f,w]=e.useState(!1),b=e.useId(),j=l.useMobile(),v=h??j,y=f||""!==a&&null!=a,N="disabled"===s,I=r("relative flex items-center border rounded-lg transition-all duration-300 w-full sm:w-90 md:w-90 lg:w-90",{"h-12 sm:h-13 md:h-14 lg:h-14":v,"h-14 sm:h-14 md:h-14 lg:h-14":!v},"transition-all duration-300",{"border-neutral-light":"default"===s&&!f,"border-primary":"default"===s&&f,"border-error":"error"===s,"bg-white border-neutral-light cursor-not-allowed":N},u),q=r("absolute pointer-events-none transition-all duration-300",{"-top-2.5 bg-white px-1 mx-3 font-medium":y,"text-xs sm:text-s md:text-s lg:text-s":y&&v,"text-s sm:text-s md:text-s lg:text-s":y&&!v,"text-s sm:text-m md:text-m lg:text-m font-medium":!y&&v,"text-m sm:text-m md:text-m lg:text-m font-medium":!y&&!v,"right-1 sm:right-1 md:right-1 lg:right-1":n,"right-3 sm:right-3 md:right-3 lg:right-3":!n,"top-1/2 -translate-y-1/2":!y,"right-11 sm:right-11 md:right-12 lg:right-12":!y&&n,"right-4 sm:right-4 md:right-4 lg:right-4":!y&&!n,"text-neutral-main":!f&&"default"===s,"text-neutral-light":N,"text-primary":f&&"default"===s,"text-error":y&&"error"===s}),C=r("peer w-full h-full bg-transparent outline-none font-medium disabled:text-neutral-light",{"text-s sm:text-m md:text-m lg:text-m":v,"text-m sm:text-m md:text-m lg:text-m":!v},{"pr-10 sm:pr-12 md:pr-12 lg:pr-12":n,"pl-10 sm:pl-12 md:pl-12 lg:pl-12":x,"px-3 sm:px-4 md:px-4 lg:px-4":!n&&!x,"pr-3 pl-10 sm:pr-4 sm:pl-12 md:pr-4 md:pl-12 lg:pr-4 lg:pl-12":!n&&x,"pl-3 pr-10 sm:pl-4 sm:pr-12 md:pl-4 md:pr-12 lg:pl-4 lg:pr-12":n&&!x,"cursor-not-allowed text-red-500":N,"text-neutral-dark":!f,"text-neutral-darker":f}),F=r("absolute transition-colors duration-300",{"h-4 w-4 sm:h-5 sm:w-5 md:h-5 md:w-5 lg:h-6 lg:w-6":v,"h-5 w-5 sm:h-5 sm:w-5 md:h-6 md:w-6 lg:h-6 lg:w-6":!v},{"text-neutral-main":"error"!==s&&!f,"text-primary":"default"===s&&f,"text-error":"error"===s,"text-neutral-light":N}),k=r("font-light mt-1 h-4","px-2 sm:px-2 md:px-3 lg:px-3",{"text-xs sm:text-s md:text-s lg:text-s":v,"text-s sm:text-s md:text-s lg:text-s":!v},{"text-neutral-main":"default"===s,"text-primary":"default"===s&&f,"text-error":"error"===s,"text-neutral-light":N}),B=g&&!f?void 0:g;return t.jsxs("div",{children:[t.jsxs("div",{className:I,children:[x&&t.jsx("span",{className:r(F,"left-3 sm:left-4 md:left-4 lg:left-4"),children:x}),t.jsx("label",{htmlFor:b,className:q,children:m}),t.jsx("input",{ref:c,id:b,type:o,value:a,onChange:i,onFocus:t=>{N||(w(!0),p.onFocus?.(t))},onBlur:t=>{N||(w(!1),p.onBlur?.(t))},disabled:N,placeholder:B,className:C,...p}),n&&t.jsx("span",{className:r(F,"right-3 sm:right-4 md:right-4 lg:right-4"),children:n})]}),d&&t.jsx("p",{className:k,children:d})]})});s.displayName="Input",exports.Input=s;
package/dist/cjs/Menu.js CHANGED
@@ -1 +1 @@
1
- "use client";"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./utils.js"),n=require("./Typography.js");const a=r.forwardRef(({buttonText:a,items:i,disabled:o=!1,className:s,onOpenChange:l,isOpen:d,"aria-label":u,...c},b)=>{const[p,f]=r.useState(!1),h=r.useRef(null),m=r.useRef(null),v=void 0!==d?d:p,handleToggle=()=>{if(o)return;const e=!v;void 0===d&&f(e),l?.(e)};r.useEffect(()=>{const handleClickOutside=e=>{h.current&&!h.current.contains(e.target)&&(void 0===d&&f(!1),l?.(!1))};if(v)return document.addEventListener("mousedown",handleClickOutside),()=>{document.removeEventListener("mousedown",handleClickOutside)}},[v,d,l]);const y=t("inline-flex items-center justify-center","bg-white border border-neutral-light","rounded-md px-4 py-3","transition-colors duration-200","hover:bg-neutral-lighter","focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",{"opacity-50 cursor-not-allowed":o,"cursor-pointer":!o}),x=t("absolute top-full left-0 right-0 z-10 mt-1","bg-white border border-neutral-light","rounded-md py-3 px-4","shadow-lg","transition-all duration-200",{"opacity-100 translate-y-0 pointer-events-auto":v,"opacity-0 -translate-y-2 pointer-events-none":!v}),g=t("block w-full text-right","transition-colors duration-200","hover:bg-neutral-lighter rounded px-2 py-1 -mx-2","focus:outline-none focus:bg-neutral-lighter");return e.jsx("div",{ref:b,className:t("relative inline-block",s),...c,children:e.jsxs("div",{ref:h,children:[e.jsx("button",{ref:m,type:"button",className:y,onClick:handleToggle,onKeyDown:e=>{if(!o)switch(e.key){case"Escape":v&&(e.preventDefault(),void 0===d&&f(!1),l?.(!1),m.current?.focus());break;case"ArrowDown":v||(e.preventDefault(),handleToggle());break;case"Enter":case" ":e.preventDefault(),handleToggle()}},disabled:o,"aria-expanded":v,"aria-haspopup":"true","aria-label":u||`منوی ${a}`,children:e.jsx(n.Typography,{variant:"body-s-heavy",color:"neutral-darker",className:"text-right",children:a})}),e.jsx("div",{className:x,children:e.jsx("div",{className:"flex flex-col gap-4",children:i.map(r=>{const a=e.jsx(n.Typography,{variant:"body-s-heavy",color:r.disabled?"neutral-main":"neutral-darker",className:"text-right",children:r.label}),i={className:t(g,{"opacity-50 cursor-not-allowed":r.disabled,"cursor-pointer":!r.disabled}),onClick:r.disabled?void 0:()=>(e=>{e.disabled||(void 0===d&&f(!1),l?.(!1),e.onClick?.())})(r),"aria-label":`منوی ${r.label}`};return r.href&&!r.disabled?e.jsx("a",{...i,href:r.href,role:"menuitem",tabIndex:v?0:-1,children:a},r.id):e.jsx("button",{...i,type:"button",role:"menuitem",tabIndex:v?0:-1,disabled:r.disabled,children:a},r.id)})})})]})})});a.displayName="Menu",exports.Menu=a;
1
+ "use client";"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./utils.js"),n=require("./Typography.js");const a=r.forwardRef(({buttonText:a,items:i,disabled:s=!1,className:l,onOpenChange:o,isOpen:d,"aria-label":u,...c},m)=>{const[p,b]=r.useState(!1),g=r.useRef(null),x=r.useRef(null),f=void 0!==d?d:p,handleToggle=()=>{if(s)return;const e=!f;void 0===d&&b(e),o?.(e)};r.useEffect(()=>{const handleClickOutside=e=>{g.current&&!g.current.contains(e.target)&&(void 0===d&&b(!1),o?.(!1))};if(f)return document.addEventListener("mousedown",handleClickOutside),()=>{document.removeEventListener("mousedown",handleClickOutside)}},[f,d,o]);const h=t("inline-flex items-center justify-center","bg-white border border-neutral-light","rounded-md transition-colors duration-200","px-3 py-2 sm:px-4 sm:py-3 md:px-4 md:py-3 lg:px-5 lg:py-3","min-w-20 sm:min-w-24 md:min-w-28 lg:min-w-32","hover:bg-neutral-lighter","focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",{"opacity-50 cursor-not-allowed":s,"cursor-pointer":!s}),y=t("absolute top-full z-10 mt-1","bg-white border border-neutral-light","rounded-md shadow-lg","left-0 right-0 sm:left-0 sm:right-auto sm:min-w-48 md:min-w-52 lg:min-w-56","py-2 px-3 sm:py-3 sm:px-4 md:py-3 md:px-4 lg:py-4 lg:px-5","transition-all duration-200",{"opacity-100 translate-y-0 pointer-events-auto":f,"opacity-0 -translate-y-2 pointer-events-none":!f}),v=t("block w-full text-right","transition-colors duration-200","hover:bg-neutral-lighter rounded","focus:outline-none focus:bg-neutral-lighter","px-2 py-1 sm:px-2 sm:py-2 md:px-3 md:py-2 lg:px-3 lg:py-2","-mx-2 sm:-mx-2 md:-mx-3 lg:-mx-3");return e.jsx("div",{ref:m,className:t("relative inline-block",l),...c,children:e.jsxs("div",{ref:g,children:[e.jsx("button",{ref:x,type:"button",className:h,onClick:handleToggle,onKeyDown:e=>{if(!s)switch(e.key){case"Escape":f&&(e.preventDefault(),void 0===d&&b(!1),o?.(!1),x.current?.focus());break;case"ArrowDown":f||(e.preventDefault(),handleToggle());break;case"Enter":case" ":e.preventDefault(),handleToggle()}},disabled:s,"aria-expanded":f,"aria-haspopup":"true","aria-label":u||`منوی ${a}`,children:e.jsx(n.Typography,{variant:"body-s-heavy",color:"neutral-darker",className:"text-right",children:a})}),e.jsx("div",{className:y,children:e.jsx("div",{className:"flex flex-col gap-2 sm:gap-3 md:gap-4 lg:gap-4",children:i.map(r=>{const a=e.jsx(n.Typography,{variant:"body-s-heavy",color:r.disabled?"neutral-main":"neutral-darker",className:"text-right",children:r.label}),i={className:t(v,{"opacity-50 cursor-not-allowed":r.disabled,"cursor-pointer":!r.disabled}),onClick:r.disabled?void 0:()=>(e=>{e.disabled||(void 0===d&&b(!1),o?.(!1),e.onClick?.())})(r),"aria-label":`منوی ${r.label}`};return r.href&&!r.disabled?e.jsx("a",{...i,href:r.href,role:"menuitem",tabIndex:f?0:-1,children:a},r.id):e.jsx("button",{...i,type:"button",role:"menuitem",tabIndex:f?0:-1,disabled:r.disabled,children:a},r.id)})})})]})})});a.displayName="Menu",exports.Menu=a;
@@ -1 +1 @@
1
- "use strict";var t=require("react"),e=require("./utils.js");const o={h1:"text-h1 font-fat",h2:"text-h2 font-fat",h3:"text-h3 font-fat",h4:"text-h4 font-heavy",h5:"text-h5 font-heavy",h6:"text-h6 font-heavy","body-xl-heavy":"text-xl font-heavy","body-l-heavy":"text-l font-heavy","body-l-bold":"text-l font-bold","body-l-medium":"text-l font-medium","body-m-heavy":"text-m font-heavy","body-m-bold":"text-m font-bold","body-m-medium":"text-m font-medium","body-s-heavy":"text-s font-heavy","body-s-bold":"text-s font-bold","body-s-medium":"text-s font-medium","body-ms-bold":"text-ms font-bold","body-ms-medium":"text-ms font-medium","body-xs-bold":"text-xs font-bold","body-xs-medium":"text-xs font-medium","body-t-bold":"text-t font-bold","body-t-medium":"text-t font-medium","body-ss-medium":"text-ss font-medium"},d={primary:"text-primary",secondary:"text-secondary","neutral-darker":"text-neutral-darker","neutral-dark":"text-neutral-dark","neutral-main":"text-neutral-main",white:"text-white",inherit:"text-inherit"},m=t.forwardRef(({variant:m="body-m-medium",color:a="inherit",as:r,className:n,children:s,...y},x)=>{const i=r||(t=>t.startsWith("h")?t.split("-")[0]:"p")(m);return t.createElement(i,{ref:x,className:e(d[a],o[m],n),...y},s)});m.displayName="Typography",exports.Typography=m,exports.getTypographyClasses=t=>o[t];
1
+ "use strict";var t=require("react"),e=require("./utils.js");const x={h1:"text-h3 sm:text-h2 md:text-h1 lg:text-h1 xl:text-h1 font-fat",h2:"text-h4 sm:text-h3 md:text-h2 lg:text-h2 xl:text-h2 font-fat",h3:"text-h5 sm:text-h4 md:text-h3 lg:text-h3 xl:text-h3 font-fat",h4:"text-h6 sm:text-h5 md:text-h4 lg:text-h4 xl:text-h4 font-heavy",h5:"text-l sm:text-xl md:text-h5 lg:text-h5 xl:text-h5 font-heavy",h6:"text-m sm:text-l md:text-h6 lg:text-h6 xl:text-h6 font-heavy","body-xl-heavy":"text-l sm:text-xl md:text-xl lg:text-xl xl:text-xl font-heavy","body-l-heavy":"text-m sm:text-l md:text-l lg:text-l xl:text-l font-heavy","body-l-bold":"text-m sm:text-l md:text-l lg:text-l xl:text-l font-bold","body-l-medium":"text-m sm:text-l md:text-l lg:text-l xl:text-l font-medium","body-m-heavy":"text-s sm:text-m md:text-m lg:text-m xl:text-m font-heavy","body-m-bold":"text-s sm:text-m md:text-m lg:text-m xl:text-m font-bold","body-m-medium":"text-s sm:text-m md:text-m lg:text-m xl:text-m font-medium","body-s-heavy":"text-ms sm:text-s md:text-s lg:text-s xl:text-s font-heavy","body-s-bold":"text-ms sm:text-s md:text-s lg:text-s xl:text-s font-bold","body-s-medium":"text-ms sm:text-s md:text-s lg:text-s xl:text-s font-medium","body-ms-bold":"text-xs sm:text-ms md:text-ms lg:text-ms xl:text-ms font-bold","body-ms-medium":"text-xs sm:text-ms md:text-ms lg:text-ms xl:text-ms font-medium","body-xs-bold":"text-t sm:text-xs md:text-xs lg:text-xs xl:text-xs font-bold","body-xs-medium":"text-t sm:text-xs md:text-xs lg:text-xs xl:text-xs font-medium","body-t-bold":"text-ss sm:text-t md:text-t lg:text-t xl:text-t font-bold","body-t-medium":"text-ss sm:text-t md:text-t lg:text-t xl:text-t font-medium","body-ss-medium":"text-ss sm:text-ss md:text-ss lg:text-ss xl:text-ss font-medium"},m={primary:"text-primary",secondary:"text-secondary","neutral-darker":"text-neutral-darker","neutral-dark":"text-neutral-dark","neutral-main":"text-neutral-main",white:"text-white",inherit:"text-inherit"},s=t.forwardRef(({variant:s="body-m-medium",color:l="inherit",as:d,className:o,children:h,...a},r)=>{const n=d||(t=>t.startsWith("h")?t.split("-")[0]:"p")(s);return t.createElement(n,{ref:r,className:e(m[l],x[s],o),...a},h)});s.displayName="Typography",exports.Typography=s,exports.getTypographyClasses=t=>x[t];
package/dist/esm/Input.js CHANGED
@@ -1 +1 @@
1
- "use client";import{jsxs as t,jsx as e}from"react/jsx-runtime";import r,{useState as l,useId as a}from"react";import n from"./utils.js";import{useMobile as o}from"./contexts.js";const i=r.forwardRef(({state:r="default",label:i,value:d,onChange:s,helperText:u,startIcon:m,endIcon:x,type:p="text",placeholder:h,isMobile:c,...f},g)=>{const[b,w]=l(!1),y=a(),v=o(),N=c??v,j=b||""!==d&&null!=d,F="disabled"===r,I=n("relative flex items-center border rounded-lg transition-all duration-300 w-90",{"h-14":!N,"h-12":N,"border-neutral-light":"default"===r&&!b,"border-primary":"default"===r&&b,"border-error":"error"===r,"bg-white border-neutral-light cursor-not-allowed":F}),k=n("absolute pointer-events-none transition-all duration-300",{"-top-2.5 bg-white px-1 mx-3 font-medium":j,"text-s":!N&&j||N&&!j,"text-xs":N&&j,"text-m":!N&&!j,"right-1":m,"right-3":!m,"top-1/2 -translate-y-1/2 text-m font-medium":!j,"right-11":!j&&m,"right-4":!j&&!m,"text-neutral-main":!b&&"default"===r,"text-neutral-light":F,"text-primary":b&&"default"===r,"text-error":j&&"error"===r}),B=n("peer w-full h-full bg-transparent outline-none text-m font-medium disabled:text-neutral-light",{"pr-12":m,"pl-12":x,"px-4":!m&&!x,"pr-4 pl-12":!m&&x,"pl-4 pr-12":m&&!x,"cursor-not-allowed text-red-500":F,"text-neutral-dark":!b,"text-neutral-darker":b}),C=n("absolute h-5 w-5 transition-colors duration-300",{"text-neutral-main":"error"!==r&&!b,"text-primary":"default"===r&&b,"text-error":"error"===r,"text-neutral-light":F}),M=n("font-light mt-1 px-2 h-4",{"text-s":!N,"text-xs":N,"text-neutral-main":"default"===r,"text-primary":"default"===r&&b,"text-error":"error"===r,"text-neutral-light":F}),R=h&&!b?void 0:h;return t("div",{children:[t("div",{className:I,children:[x&&e("span",{className:n(C,"left-4"),children:x}),e("label",{htmlFor:y,className:k,children:i}),e("input",{ref:g,id:y,type:p,value:d,onChange:s,onFocus:t=>{F||(w(!0),f.onFocus?.(t))},onBlur:t=>{F||(w(!1),f.onBlur?.(t))},disabled:F,placeholder:R,className:B,...f}),m&&e("span",{className:n(C,"right-4"),children:m})]}),u&&e("p",{className:M,children:u})]})});i.displayName="Input";export{i as Input};
1
+ "use client";import{jsxs as t,jsx as e}from"react/jsx-runtime";import r,{useState as l,useId as m}from"react";import s from"./utils.js";import{useMobile as a}from"./contexts.js";const i=r.forwardRef(({state:r="default",label:i,value:d,onChange:n,helperText:o,startIcon:x,endIcon:g,type:h="text",placeholder:p,isMobile:u,containerClassName:c,...f},w)=>{const[b,y]=l(!1),N=m(),v=a(),j=u??v,C=b||""!==d&&null!=d,F="disabled"===r,I=s("relative flex items-center border rounded-lg transition-all duration-300 w-full sm:w-90 md:w-90 lg:w-90",{"h-12 sm:h-13 md:h-14 lg:h-14":j,"h-14 sm:h-14 md:h-14 lg:h-14":!j},"transition-all duration-300",{"border-neutral-light":"default"===r&&!b,"border-primary":"default"===r&&b,"border-error":"error"===r,"bg-white border-neutral-light cursor-not-allowed":F},c),k=s("absolute pointer-events-none transition-all duration-300",{"-top-2.5 bg-white px-1 mx-3 font-medium":C,"text-xs sm:text-s md:text-s lg:text-s":C&&j,"text-s sm:text-s md:text-s lg:text-s":C&&!j,"text-s sm:text-m md:text-m lg:text-m font-medium":!C&&j,"text-m sm:text-m md:text-m lg:text-m font-medium":!C&&!j,"right-1 sm:right-1 md:right-1 lg:right-1":x,"right-3 sm:right-3 md:right-3 lg:right-3":!x,"top-1/2 -translate-y-1/2":!C,"right-11 sm:right-11 md:right-12 lg:right-12":!C&&x,"right-4 sm:right-4 md:right-4 lg:right-4":!C&&!x,"text-neutral-main":!b&&"default"===r,"text-neutral-light":F,"text-primary":b&&"default"===r,"text-error":C&&"error"===r}),B=s("peer w-full h-full bg-transparent outline-none font-medium disabled:text-neutral-light",{"text-s sm:text-m md:text-m lg:text-m":j,"text-m sm:text-m md:text-m lg:text-m":!j},{"pr-10 sm:pr-12 md:pr-12 lg:pr-12":x,"pl-10 sm:pl-12 md:pl-12 lg:pl-12":g,"px-3 sm:px-4 md:px-4 lg:px-4":!x&&!g,"pr-3 pl-10 sm:pr-4 sm:pl-12 md:pr-4 md:pl-12 lg:pr-4 lg:pl-12":!x&&g,"pl-3 pr-10 sm:pl-4 sm:pr-12 md:pl-4 md:pr-12 lg:pl-4 lg:pr-12":x&&!g,"cursor-not-allowed text-red-500":F,"text-neutral-dark":!b,"text-neutral-darker":b}),M=s("absolute transition-colors duration-300",{"h-4 w-4 sm:h-5 sm:w-5 md:h-5 md:w-5 lg:h-6 lg:w-6":j,"h-5 w-5 sm:h-5 sm:w-5 md:h-6 md:w-6 lg:h-6 lg:w-6":!j},{"text-neutral-main":"error"!==r&&!b,"text-primary":"default"===r&&b,"text-error":"error"===r,"text-neutral-light":F}),R=s("font-light mt-1 h-4","px-2 sm:px-2 md:px-3 lg:px-3",{"text-xs sm:text-s md:text-s lg:text-s":j,"text-s sm:text-s md:text-s lg:text-s":!j},{"text-neutral-main":"default"===r,"text-primary":"default"===r&&b,"text-error":"error"===r,"text-neutral-light":F}),T=p&&!b?void 0:p;return t("div",{children:[t("div",{className:I,children:[g&&e("span",{className:s(M,"left-3 sm:left-4 md:left-4 lg:left-4"),children:g}),e("label",{htmlFor:N,className:k,children:i}),e("input",{ref:w,id:N,type:h,value:d,onChange:n,onFocus:t=>{F||(y(!0),f.onFocus?.(t))},onBlur:t=>{F||(y(!1),f.onBlur?.(t))},disabled:F,placeholder:T,className:B,...f}),x&&e("span",{className:s(M,"right-3 sm:right-4 md:right-4 lg:right-4"),children:x})]}),o&&e("p",{className:R,children:o})]})});i.displayName="Input";export{i as Input};
package/dist/esm/Menu.js CHANGED
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import t,{useState as n,useRef as o,useEffect as a}from"react";import i from"./utils.js";import{Typography as l}from"./Typography.js";const s=t.forwardRef(({buttonText:t,items:s,disabled:d=!1,className:c,onOpenChange:u,isOpen:b,"aria-label":p,...m},f)=>{const[h,v]=n(!1),g=o(null),y=o(null),x=void 0!==b?b:h,handleToggle=()=>{if(d)return;const e=!x;void 0===b&&v(e),u?.(e)};a(()=>{const handleClickOutside=e=>{g.current&&!g.current.contains(e.target)&&(void 0===b&&v(!1),u?.(!1))};if(x)return document.addEventListener("mousedown",handleClickOutside),()=>{document.removeEventListener("mousedown",handleClickOutside)}},[x,b,u]);const w=i("inline-flex items-center justify-center","bg-white border border-neutral-light","rounded-md px-4 py-3","transition-colors duration-200","hover:bg-neutral-lighter","focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",{"opacity-50 cursor-not-allowed":d,"cursor-pointer":!d}),k=i("absolute top-full left-0 right-0 z-10 mt-1","bg-white border border-neutral-light","rounded-md py-3 px-4","shadow-lg","transition-all duration-200",{"opacity-100 translate-y-0 pointer-events-auto":x,"opacity-0 -translate-y-2 pointer-events-none":!x}),N=i("block w-full text-right","transition-colors duration-200","hover:bg-neutral-lighter rounded px-2 py-1 -mx-2","focus:outline-none focus:bg-neutral-lighter");return e("div",{ref:f,className:i("relative inline-block",c),...m,children:r("div",{ref:g,children:[e("button",{ref:y,type:"button",className:w,onClick:handleToggle,onKeyDown:e=>{if(!d)switch(e.key){case"Escape":x&&(e.preventDefault(),void 0===b&&v(!1),u?.(!1),y.current?.focus());break;case"ArrowDown":x||(e.preventDefault(),handleToggle());break;case"Enter":case" ":e.preventDefault(),handleToggle()}},disabled:d,"aria-expanded":x,"aria-haspopup":"true","aria-label":p||`منوی ${t}`,children:e(l,{variant:"body-s-heavy",color:"neutral-darker",className:"text-right",children:t})}),e("div",{className:k,children:e("div",{className:"flex flex-col gap-4",children:s.map(r=>{const t=e(l,{variant:"body-s-heavy",color:r.disabled?"neutral-main":"neutral-darker",className:"text-right",children:r.label}),n={className:i(N,{"opacity-50 cursor-not-allowed":r.disabled,"cursor-pointer":!r.disabled}),onClick:r.disabled?void 0:()=>(e=>{e.disabled||(void 0===b&&v(!1),u?.(!1),e.onClick?.())})(r),"aria-label":`منوی ${r.label}`};return r.href&&!r.disabled?e("a",{...n,href:r.href,role:"menuitem",tabIndex:x?0:-1,children:t},r.id):e("button",{...n,type:"button",role:"menuitem",tabIndex:x?0:-1,disabled:r.disabled,children:t},r.id)})})})]})})});s.displayName="Menu";export{s as Menu};
1
+ "use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import t,{useState as n,useRef as a,useEffect as i}from"react";import o from"./utils.js";import{Typography as l}from"./Typography.js";const s=t.forwardRef(({buttonText:t,items:s,disabled:d=!1,className:m,onOpenChange:c,isOpen:u,"aria-label":p,...b},g)=>{const[f,h]=n(!1),y=a(null),x=a(null),v=void 0!==u?u:f,handleToggle=()=>{if(d)return;const e=!v;void 0===u&&h(e),c?.(e)};i(()=>{const handleClickOutside=e=>{y.current&&!y.current.contains(e.target)&&(void 0===u&&h(!1),c?.(!1))};if(v)return document.addEventListener("mousedown",handleClickOutside),()=>{document.removeEventListener("mousedown",handleClickOutside)}},[v,u,c]);const w=o("inline-flex items-center justify-center","bg-white border border-neutral-light","rounded-md transition-colors duration-200","px-3 py-2 sm:px-4 sm:py-3 md:px-4 md:py-3 lg:px-5 lg:py-3","min-w-20 sm:min-w-24 md:min-w-28 lg:min-w-32","hover:bg-neutral-lighter","focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",{"opacity-50 cursor-not-allowed":d,"cursor-pointer":!d}),k=o("absolute top-full z-10 mt-1","bg-white border border-neutral-light","rounded-md shadow-lg","left-0 right-0 sm:left-0 sm:right-auto sm:min-w-48 md:min-w-52 lg:min-w-56","py-2 px-3 sm:py-3 sm:px-4 md:py-3 md:px-4 lg:py-4 lg:px-5","transition-all duration-200",{"opacity-100 translate-y-0 pointer-events-auto":v,"opacity-0 -translate-y-2 pointer-events-none":!v}),N=o("block w-full text-right","transition-colors duration-200","hover:bg-neutral-lighter rounded","focus:outline-none focus:bg-neutral-lighter","px-2 py-1 sm:px-2 sm:py-2 md:px-3 md:py-2 lg:px-3 lg:py-2","-mx-2 sm:-mx-2 md:-mx-3 lg:-mx-3");return e("div",{ref:g,className:o("relative inline-block",m),...b,children:r("div",{ref:y,children:[e("button",{ref:x,type:"button",className:w,onClick:handleToggle,onKeyDown:e=>{if(!d)switch(e.key){case"Escape":v&&(e.preventDefault(),void 0===u&&h(!1),c?.(!1),x.current?.focus());break;case"ArrowDown":v||(e.preventDefault(),handleToggle());break;case"Enter":case" ":e.preventDefault(),handleToggle()}},disabled:d,"aria-expanded":v,"aria-haspopup":"true","aria-label":p||`منوی ${t}`,children:e(l,{variant:"body-s-heavy",color:"neutral-darker",className:"text-right",children:t})}),e("div",{className:k,children:e("div",{className:"flex flex-col gap-2 sm:gap-3 md:gap-4 lg:gap-4",children:s.map(r=>{const t=e(l,{variant:"body-s-heavy",color:r.disabled?"neutral-main":"neutral-darker",className:"text-right",children:r.label}),n={className:o(N,{"opacity-50 cursor-not-allowed":r.disabled,"cursor-pointer":!r.disabled}),onClick:r.disabled?void 0:()=>(e=>{e.disabled||(void 0===u&&h(!1),c?.(!1),e.onClick?.())})(r),"aria-label":`منوی ${r.label}`};return r.href&&!r.disabled?e("a",{...n,href:r.href,role:"menuitem",tabIndex:v?0:-1,children:t},r.id):e("button",{...n,type:"button",role:"menuitem",tabIndex:v?0:-1,disabled:r.disabled,children:t},r.id)})})})]})})});s.displayName="Menu";export{s as Menu};
@@ -1 +1 @@
1
- import t from"react";import e from"./utils.js";const o={h1:"text-h1 font-fat",h2:"text-h2 font-fat",h3:"text-h3 font-fat",h4:"text-h4 font-heavy",h5:"text-h5 font-heavy",h6:"text-h6 font-heavy","body-xl-heavy":"text-xl font-heavy","body-l-heavy":"text-l font-heavy","body-l-bold":"text-l font-bold","body-l-medium":"text-l font-medium","body-m-heavy":"text-m font-heavy","body-m-bold":"text-m font-bold","body-m-medium":"text-m font-medium","body-s-heavy":"text-s font-heavy","body-s-bold":"text-s font-bold","body-s-medium":"text-s font-medium","body-ms-bold":"text-ms font-bold","body-ms-medium":"text-ms font-medium","body-xs-bold":"text-xs font-bold","body-xs-medium":"text-xs font-medium","body-t-bold":"text-t font-bold","body-t-medium":"text-t font-medium","body-ss-medium":"text-ss font-medium"},getTypographyClasses=t=>o[t],d={primary:"text-primary",secondary:"text-secondary","neutral-darker":"text-neutral-darker","neutral-dark":"text-neutral-dark","neutral-main":"text-neutral-main",white:"text-white",inherit:"text-inherit"},m=t.forwardRef(({variant:m="body-m-medium",color:a="inherit",as:n,className:r,children:x,...y},i)=>{const l=n||(t=>t.startsWith("h")?t.split("-")[0]:"p")(m);return t.createElement(l,{ref:i,className:e(d[a],o[m],r),...y},x)});m.displayName="Typography";export{m as Typography,getTypographyClasses};
1
+ import t from"react";import e from"./utils.js";const x={h1:"text-h3 sm:text-h2 md:text-h1 lg:text-h1 xl:text-h1 font-fat",h2:"text-h4 sm:text-h3 md:text-h2 lg:text-h2 xl:text-h2 font-fat",h3:"text-h5 sm:text-h4 md:text-h3 lg:text-h3 xl:text-h3 font-fat",h4:"text-h6 sm:text-h5 md:text-h4 lg:text-h4 xl:text-h4 font-heavy",h5:"text-l sm:text-xl md:text-h5 lg:text-h5 xl:text-h5 font-heavy",h6:"text-m sm:text-l md:text-h6 lg:text-h6 xl:text-h6 font-heavy","body-xl-heavy":"text-l sm:text-xl md:text-xl lg:text-xl xl:text-xl font-heavy","body-l-heavy":"text-m sm:text-l md:text-l lg:text-l xl:text-l font-heavy","body-l-bold":"text-m sm:text-l md:text-l lg:text-l xl:text-l font-bold","body-l-medium":"text-m sm:text-l md:text-l lg:text-l xl:text-l font-medium","body-m-heavy":"text-s sm:text-m md:text-m lg:text-m xl:text-m font-heavy","body-m-bold":"text-s sm:text-m md:text-m lg:text-m xl:text-m font-bold","body-m-medium":"text-s sm:text-m md:text-m lg:text-m xl:text-m font-medium","body-s-heavy":"text-ms sm:text-s md:text-s lg:text-s xl:text-s font-heavy","body-s-bold":"text-ms sm:text-s md:text-s lg:text-s xl:text-s font-bold","body-s-medium":"text-ms sm:text-s md:text-s lg:text-s xl:text-s font-medium","body-ms-bold":"text-xs sm:text-ms md:text-ms lg:text-ms xl:text-ms font-bold","body-ms-medium":"text-xs sm:text-ms md:text-ms lg:text-ms xl:text-ms font-medium","body-xs-bold":"text-t sm:text-xs md:text-xs lg:text-xs xl:text-xs font-bold","body-xs-medium":"text-t sm:text-xs md:text-xs lg:text-xs xl:text-xs font-medium","body-t-bold":"text-ss sm:text-t md:text-t lg:text-t xl:text-t font-bold","body-t-medium":"text-ss sm:text-t md:text-t lg:text-t xl:text-t font-medium","body-ss-medium":"text-ss sm:text-ss md:text-ss lg:text-ss xl:text-ss font-medium"},getTypographyClasses=t=>x[t],m={primary:"text-primary",secondary:"text-secondary","neutral-darker":"text-neutral-darker","neutral-dark":"text-neutral-dark","neutral-main":"text-neutral-main",white:"text-white",inherit:"text-inherit"},s=t.forwardRef(({variant:s="body-m-medium",color:l="inherit",as:d,className:o,children:h,...a},n)=>{const r=d||(t=>t.startsWith("h")?t.split("-")[0]:"p")(s);return t.createElement(r,{ref:n,className:e(m[l],x[s],o),...a},h)});s.displayName="Typography";export{s as Typography,getTypographyClasses};
@@ -3,10 +3,12 @@ import React, { useState, useId } from 'react';
3
3
  import cn from './utils.js';
4
4
  import { useMobile } from './contexts.js';
5
5
 
6
- const Input = React.forwardRef(({ state = 'default', label, value, onChange, helperText, startIcon, endIcon, type = 'text', placeholder, isMobile, ...props }, ref) => {
6
+ const Input = React.forwardRef(({ state = 'default', label, value, onChange, helperText, startIcon, endIcon, type = 'text', placeholder, isMobile, containerClassName, ...props }, ref) => {
7
7
  const [isFocused, setIsFocused] = useState(false);
8
8
  const id = useId();
9
9
  const detectedIsMobile = useMobile();
10
+ // Use provided isMobile prop or fall back to detected mobile state
11
+ // This ensures SSR compatibility while allowing responsive breakpoints on client
10
12
  const actualIsMobile = isMobile ?? detectedIsMobile;
11
13
  const hasContent = value !== '' && value !== null && value !== undefined;
12
14
  const isLabelFloated = isFocused || hasContent;
@@ -23,53 +25,78 @@ const Input = React.forwardRef(({ state = 'default', label, value, onChange, hel
23
25
  props.onBlur?.(e);
24
26
  }
25
27
  };
26
- const baseContainerClasses = 'relative flex items-center border rounded-lg transition-all duration-300 w-90';
28
+ const baseContainerClasses = 'relative flex items-center border rounded-lg transition-all duration-300 w-full sm:w-90 md:w-90 lg:w-90';
27
29
  const baseLabelClasses = 'absolute pointer-events-none transition-all duration-300';
28
- const baseInputClasses = 'peer w-full h-full bg-transparent outline-none text-m font-medium disabled:text-neutral-light';
29
- const baseIconClasses = 'absolute h-5 w-5 transition-colors duration-300';
30
- const containerClasses = cn(baseContainerClasses, {
31
- 'h-14': !actualIsMobile,
32
- 'h-12': actualIsMobile,
30
+ const baseInputClasses = 'peer w-full h-full bg-transparent outline-none font-medium disabled:text-neutral-light';
31
+ const baseIconClasses = 'absolute transition-colors duration-300';
32
+ const containerClasses = cn(baseContainerClasses,
33
+ // SSR-safe initial height based on mobile detection, then responsive scaling
34
+ {
35
+ 'h-12 sm:h-13 md:h-14 lg:h-14': actualIsMobile,
36
+ 'h-14 sm:h-14 md:h-14 lg:h-14': !actualIsMobile,
37
+ },
38
+ // Enhanced responsive breakpoints for client-side optimization
39
+ 'transition-all duration-300', {
33
40
  'border-neutral-light': state === 'default' && !isFocused,
34
41
  'border-primary': state === 'default' && isFocused,
35
42
  'border-error': state === 'error',
36
43
  'bg-white border-neutral-light cursor-not-allowed': isDisabled,
37
- });
44
+ }, containerClassName);
38
45
  const labelClasses = cn(baseLabelClasses, {
39
46
  '-top-2.5 bg-white px-1 mx-3 font-medium': isLabelFloated,
40
- 'text-s': (!actualIsMobile && isLabelFloated) ||
41
- (actualIsMobile && !isLabelFloated),
42
- 'text-xs': actualIsMobile && isLabelFloated,
43
- 'text-m': !actualIsMobile && !isLabelFloated,
44
- 'right-1': startIcon,
45
- 'right-3': !startIcon,
46
- 'top-1/2 -translate-y-1/2 text-m font-medium': !isLabelFloated,
47
- 'right-11': !isLabelFloated && startIcon,
48
- 'right-4': !isLabelFloated && !startIcon,
47
+ // SSR-safe label text sizes with responsive enhancement
48
+ 'text-xs sm:text-s md:text-s lg:text-s': isLabelFloated && actualIsMobile,
49
+ 'text-s sm:text-s md:text-s lg:text-s': isLabelFloated && !actualIsMobile,
50
+ 'text-s sm:text-m md:text-m lg:text-m font-medium': !isLabelFloated && actualIsMobile,
51
+ 'text-m sm:text-m md:text-m lg:text-m font-medium': !isLabelFloated && !actualIsMobile,
52
+ // Responsive positioning
53
+ 'right-1 sm:right-1 md:right-1 lg:right-1': startIcon,
54
+ 'right-3 sm:right-3 md:right-3 lg:right-3': !startIcon,
55
+ 'top-1/2 -translate-y-1/2': !isLabelFloated,
56
+ // Responsive positioning for non-floated with icons
57
+ 'right-11 sm:right-11 md:right-12 lg:right-12': !isLabelFloated && startIcon,
58
+ 'right-4 sm:right-4 md:right-4 lg:right-4': !isLabelFloated && !startIcon,
59
+ // Colors
49
60
  'text-neutral-main': !isFocused && state === 'default',
50
61
  'text-neutral-light': isDisabled,
51
62
  'text-primary': isFocused && state === 'default',
52
63
  'text-error': isLabelFloated && state === 'error',
53
64
  });
54
- const inputClasses = cn(baseInputClasses, {
55
- 'pr-12': startIcon,
56
- 'pl-12': endIcon,
57
- 'px-4': !startIcon && !endIcon,
58
- 'pr-4 pl-12': !startIcon && endIcon,
59
- 'pl-4 pr-12': startIcon && !endIcon,
65
+ const inputClasses = cn(baseInputClasses,
66
+ // SSR-safe text size with responsive enhancement
67
+ {
68
+ 'text-s sm:text-m md:text-m lg:text-m': actualIsMobile,
69
+ 'text-m sm:text-m md:text-m lg:text-m': !actualIsMobile,
70
+ }, {
71
+ // Responsive padding with icons
72
+ 'pr-10 sm:pr-12 md:pr-12 lg:pr-12': startIcon,
73
+ 'pl-10 sm:pl-12 md:pl-12 lg:pl-12': endIcon,
74
+ 'px-3 sm:px-4 md:px-4 lg:px-4': !startIcon && !endIcon,
75
+ 'pr-3 pl-10 sm:pr-4 sm:pl-12 md:pr-4 md:pl-12 lg:pr-4 lg:pl-12': !startIcon && endIcon,
76
+ 'pl-3 pr-10 sm:pl-4 sm:pr-12 md:pl-4 md:pr-12 lg:pl-4 lg:pr-12': startIcon && !endIcon,
77
+ // States
60
78
  'cursor-not-allowed text-red-500': isDisabled,
61
79
  'text-neutral-dark': !isFocused,
62
80
  'text-neutral-darker': isFocused,
63
81
  });
64
- const iconClasses = cn(baseIconClasses, {
82
+ const iconClasses = cn(baseIconClasses,
83
+ // SSR-safe icon size with responsive enhancement
84
+ {
85
+ 'h-4 w-4 sm:h-5 sm:w-5 md:h-5 md:w-5 lg:h-6 lg:w-6': actualIsMobile,
86
+ 'h-5 w-5 sm:h-5 sm:w-5 md:h-6 md:w-6 lg:h-6 lg:w-6': !actualIsMobile,
87
+ }, {
65
88
  'text-neutral-main': state !== 'error' && !isFocused,
66
89
  'text-primary': state === 'default' && isFocused,
67
90
  'text-error': state === 'error',
68
91
  'text-neutral-light': isDisabled,
69
92
  });
70
- const helperTextClasses = cn('font-light mt-1 px-2 h-4', {
71
- 'text-s': !actualIsMobile,
72
- 'text-xs': actualIsMobile,
93
+ const helperTextClasses = cn('font-light mt-1 h-4',
94
+ // Responsive padding and text size
95
+ 'px-2 sm:px-2 md:px-3 lg:px-3', {
96
+ // SSR-safe text sizing with responsive enhancement
97
+ 'text-xs sm:text-s md:text-s lg:text-s': actualIsMobile,
98
+ 'text-s sm:text-s md:text-s lg:text-s': !actualIsMobile,
99
+ }, {
73
100
  'text-neutral-main': state === 'default',
74
101
  'text-primary': state === 'default' && isFocused,
75
102
  'text-error': state === 'error',
@@ -77,7 +104,7 @@ const Input = React.forwardRef(({ state = 'default', label, value, onChange, hel
77
104
  });
78
105
  // If both label and placeholder are provided, hide placeholder when not focused
79
106
  const computedPlaceholder = placeholder && !isFocused ? undefined : placeholder;
80
- return (jsxs("div", { children: [jsxs("div", { className: containerClasses, children: [endIcon && (jsx("span", { className: cn(iconClasses, 'left-4'), children: endIcon })), jsx("label", { htmlFor: id, className: labelClasses, children: label }), jsx("input", { ref: ref, id: id, type: type, value: value, onChange: onChange, onFocus: handleFocus, onBlur: handleBlur, disabled: isDisabled, placeholder: computedPlaceholder, className: inputClasses, ...props }), startIcon && (jsx("span", { className: cn(iconClasses, 'right-4'), children: startIcon }))] }), helperText && jsx("p", { className: helperTextClasses, children: helperText })] }));
107
+ return (jsxs("div", { children: [jsxs("div", { className: containerClasses, children: [endIcon && (jsx("span", { className: cn(iconClasses, 'left-3 sm:left-4 md:left-4 lg:left-4'), children: endIcon })), jsx("label", { htmlFor: id, className: labelClasses, children: label }), jsx("input", { ref: ref, id: id, type: type, value: value, onChange: onChange, onFocus: handleFocus, onBlur: handleBlur, disabled: isDisabled, placeholder: computedPlaceholder, className: inputClasses, ...props }), startIcon && (jsx("span", { className: cn(iconClasses, 'right-3 sm:right-4 md:right-4 lg:right-4'), children: startIcon }))] }), helperText && jsx("p", { className: helperTextClasses, children: helperText })] }));
81
108
  });
82
109
  Input.displayName = 'Input';
83
110
 
@@ -78,7 +78,9 @@ const Menu = React.forwardRef(({ buttonText, items, disabled = false, className,
78
78
  };
79
79
  const buttonClasses = cn(
80
80
  // Base button styles matching Figma design
81
- 'inline-flex items-center justify-center', 'bg-white border border-neutral-light', 'rounded-md px-4 py-3', 'transition-colors duration-200',
81
+ 'inline-flex items-center justify-center', 'bg-white border border-neutral-light', 'rounded-md transition-colors duration-200',
82
+ // Responsive padding and sizing
83
+ 'px-3 py-2 sm:px-4 sm:py-3 md:px-4 md:py-3 lg:px-5 lg:py-3', 'min-w-20 sm:min-w-24 md:min-w-28 lg:min-w-32',
82
84
  // Interactive states
83
85
  'hover:bg-neutral-lighter', 'focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2',
84
86
  // Disabled state
@@ -88,14 +90,22 @@ const Menu = React.forwardRef(({ buttonText, items, disabled = false, className,
88
90
  });
89
91
  const dropdownClasses = cn(
90
92
  // Base dropdown styles
91
- 'absolute top-full left-0 right-0 z-10 mt-1', 'bg-white border border-neutral-light', 'rounded-md py-3 px-4', 'shadow-lg',
93
+ 'absolute top-full z-10 mt-1', 'bg-white border border-neutral-light', 'rounded-md shadow-lg',
94
+ // Responsive positioning and sizing
95
+ 'left-0 right-0 sm:left-0 sm:right-auto sm:min-w-48 md:min-w-52 lg:min-w-56',
96
+ // Responsive padding
97
+ 'py-2 px-3 sm:py-3 sm:px-4 md:py-3 md:px-4 lg:py-4 lg:px-5',
92
98
  // Animation
93
99
  'transition-all duration-200', {
94
100
  'opacity-100 translate-y-0 pointer-events-auto': isOpen,
95
101
  'opacity-0 -translate-y-2 pointer-events-none': !isOpen,
96
102
  });
97
- const itemClasses = cn('block w-full text-right', 'transition-colors duration-200', 'hover:bg-neutral-lighter rounded px-2 py-1 -mx-2', 'focus:outline-none focus:bg-neutral-lighter');
98
- return (jsx("div", { ref: ref, className: cn('relative inline-block', className), ...props, children: jsxs("div", { ref: menuRef, children: [jsx("button", { ref: buttonRef, type: "button", className: buttonClasses, onClick: handleToggle, onKeyDown: handleKeyDown, disabled: disabled, "aria-expanded": isOpen, "aria-haspopup": "true", "aria-label": ariaLabel || `منوی ${buttonText}`, children: jsx(Typography, { variant: "body-s-heavy", color: "neutral-darker", className: "text-right", children: buttonText }) }), jsx("div", { className: dropdownClasses, children: jsx("div", { className: "flex flex-col gap-4", children: items.map((item) => {
103
+ const itemClasses = cn('block w-full text-right', 'transition-colors duration-200', 'hover:bg-neutral-lighter rounded', 'focus:outline-none focus:bg-neutral-lighter',
104
+ // Responsive padding
105
+ 'px-2 py-1 sm:px-2 sm:py-2 md:px-3 md:py-2 lg:px-3 lg:py-2',
106
+ // Responsive margins
107
+ '-mx-2 sm:-mx-2 md:-mx-3 lg:-mx-3');
108
+ return (jsx("div", { ref: ref, className: cn('relative inline-block', className), ...props, children: jsxs("div", { ref: menuRef, children: [jsx("button", { ref: buttonRef, type: "button", className: buttonClasses, onClick: handleToggle, onKeyDown: handleKeyDown, disabled: disabled, "aria-expanded": isOpen, "aria-haspopup": "true", "aria-label": ariaLabel || `منوی ${buttonText}`, children: jsx(Typography, { variant: "body-s-heavy", color: "neutral-darker", className: "text-right", children: buttonText }) }), jsx("div", { className: dropdownClasses, children: jsx("div", { className: "flex flex-col gap-2 sm:gap-3 md:gap-4 lg:gap-4", children: items.map((item) => {
99
109
  const content = (jsx(Typography, { variant: "body-s-heavy", color: item.disabled ? 'neutral-main' : 'neutral-darker', className: "text-right", children: item.label }));
100
110
  const commonProps = {
101
111
  className: cn(itemClasses, {
@@ -2,31 +2,31 @@ import React from 'react';
2
2
  import cn from './utils.js';
3
3
 
4
4
  const variantClasses = {
5
- // Headings with Fat weight (900)
6
- h1: 'text-h1 font-fat',
7
- h2: 'text-h2 font-fat',
8
- h3: 'text-h3 font-fat',
9
- h4: 'text-h4 font-heavy',
10
- h5: 'text-h5 font-heavy',
11
- h6: 'text-h6 font-heavy',
12
- // Body Copy with specific weight variants
13
- 'body-xl-heavy': 'text-xl font-heavy',
14
- 'body-l-heavy': 'text-l font-heavy',
15
- 'body-l-bold': 'text-l font-bold',
16
- 'body-l-medium': 'text-l font-medium',
17
- 'body-m-heavy': 'text-m font-heavy',
18
- 'body-m-bold': 'text-m font-bold',
19
- 'body-m-medium': 'text-m font-medium',
20
- 'body-s-heavy': 'text-s font-heavy',
21
- 'body-s-bold': 'text-s font-bold',
22
- 'body-s-medium': 'text-s font-medium',
23
- 'body-ms-bold': 'text-ms font-bold',
24
- 'body-ms-medium': 'text-ms font-medium',
25
- 'body-xs-bold': 'text-xs font-bold',
26
- 'body-xs-medium': 'text-xs font-medium',
27
- 'body-t-bold': 'text-t font-bold',
28
- 'body-t-medium': 'text-t font-medium',
29
- 'body-ss-medium': 'text-ss font-medium',
5
+ // Headings with Fat weight (900) - Responsive scaling
6
+ h1: 'text-h3 sm:text-h2 md:text-h1 lg:text-h1 xl:text-h1 font-fat',
7
+ h2: 'text-h4 sm:text-h3 md:text-h2 lg:text-h2 xl:text-h2 font-fat',
8
+ h3: 'text-h5 sm:text-h4 md:text-h3 lg:text-h3 xl:text-h3 font-fat',
9
+ h4: 'text-h6 sm:text-h5 md:text-h4 lg:text-h4 xl:text-h4 font-heavy',
10
+ h5: 'text-l sm:text-xl md:text-h5 lg:text-h5 xl:text-h5 font-heavy',
11
+ h6: 'text-m sm:text-l md:text-h6 lg:text-h6 xl:text-h6 font-heavy',
12
+ // Body Copy with specific weight variants - Responsive scaling
13
+ 'body-xl-heavy': 'text-l sm:text-xl md:text-xl lg:text-xl xl:text-xl font-heavy',
14
+ 'body-l-heavy': 'text-m sm:text-l md:text-l lg:text-l xl:text-l font-heavy',
15
+ 'body-l-bold': 'text-m sm:text-l md:text-l lg:text-l xl:text-l font-bold',
16
+ 'body-l-medium': 'text-m sm:text-l md:text-l lg:text-l xl:text-l font-medium',
17
+ 'body-m-heavy': 'text-s sm:text-m md:text-m lg:text-m xl:text-m font-heavy',
18
+ 'body-m-bold': 'text-s sm:text-m md:text-m lg:text-m xl:text-m font-bold',
19
+ 'body-m-medium': 'text-s sm:text-m md:text-m lg:text-m xl:text-m font-medium',
20
+ 'body-s-heavy': 'text-ms sm:text-s md:text-s lg:text-s xl:text-s font-heavy',
21
+ 'body-s-bold': 'text-ms sm:text-s md:text-s lg:text-s xl:text-s font-bold',
22
+ 'body-s-medium': 'text-ms sm:text-s md:text-s lg:text-s xl:text-s font-medium',
23
+ 'body-ms-bold': 'text-xs sm:text-ms md:text-ms lg:text-ms xl:text-ms font-bold',
24
+ 'body-ms-medium': 'text-xs sm:text-ms md:text-ms lg:text-ms xl:text-ms font-medium',
25
+ 'body-xs-bold': 'text-t sm:text-xs md:text-xs lg:text-xs xl:text-xs font-bold',
26
+ 'body-xs-medium': 'text-t sm:text-xs md:text-xs lg:text-xs xl:text-xs font-medium',
27
+ 'body-t-bold': 'text-ss sm:text-t md:text-t lg:text-t xl:text-t font-bold',
28
+ 'body-t-medium': 'text-ss sm:text-t md:text-t lg:text-t xl:text-t font-medium',
29
+ 'body-ss-medium': 'text-ss sm:text-ss md:text-ss lg:text-ss xl:text-ss font-medium',
30
30
  };
31
31
  // Export for reuse in other components
32
32
  const getTypographyClasses = (variant) => {
@@ -9,6 +9,7 @@ export type InputProps = {
9
9
  * Whether the component is in mobile mode (optional, auto-detected if not provided)
10
10
  */
11
11
  isMobile?: boolean;
12
+ containerClassName?: string;
12
13
  } & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'id'>;
13
14
  declare const Input: React.ForwardRefExoticComponent<{
14
15
  state?: "default" | "disabled" | "error";
@@ -20,5 +21,6 @@ declare const Input: React.ForwardRefExoticComponent<{
20
21
  * Whether the component is in mobile mode (optional, auto-detected if not provided)
21
22
  */
22
23
  isMobile?: boolean;
24
+ containerClassName?: string;
23
25
  } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "id"> & React.RefAttributes<HTMLInputElement>>;
24
26
  export { Input };
@@ -11,6 +11,7 @@ declare const _default: {
11
11
  startIcon?: import("react").ReactNode;
12
12
  endIcon?: import("react").ReactNode;
13
13
  isMobile?: boolean;
14
+ containerClassName?: string;
14
15
  } & Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "id"> & import("react").RefAttributes<HTMLInputElement>>;
15
16
  parameters: {
16
17
  docs: {
@@ -152,3 +153,7 @@ export declare const WithLabelAndPlaceholder: {
152
153
  placeholder: string;
153
154
  };
154
155
  };
156
+ export declare const ResponsiveDemo: {
157
+ (): import("react/jsx-runtime").JSX.Element;
158
+ storyName: string;
159
+ };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  export type TypographyVariant = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'body-xl-heavy' | 'body-l-heavy' | 'body-l-bold' | 'body-l-medium' | 'body-m-heavy' | 'body-m-bold' | 'body-m-medium' | 'body-s-heavy' | 'body-s-bold' | 'body-s-medium' | 'body-ms-bold' | 'body-ms-medium' | 'body-xs-bold' | 'body-xs-medium' | 'body-t-bold' | 'body-t-medium' | 'body-ss-medium';
3
- export interface TypographyProps {
3
+ export interface TypographyProps extends React.HTMLAttributes<HTMLElement> {
4
4
  variant?: TypographyVariant;
5
5
  children?: React.ReactNode;
6
6
  color?: 'primary' | 'secondary' | 'neutral-darker' | 'neutral-dark' | 'neutral-main' | 'white' | 'inherit';
@@ -55,3 +55,7 @@ export declare const ColorVariants: {
55
55
  (): import("react/jsx-runtime").JSX.Element;
56
56
  storyName: string;
57
57
  };
58
+ export declare const ResponsiveTypography: {
59
+ (): import("react/jsx-runtime").JSX.Element;
60
+ storyName: string;
61
+ };
@@ -7,6 +7,7 @@ export declare const Input: import("react").ForwardRefExoticComponent<{
7
7
  startIcon?: import("react").ReactNode;
8
8
  endIcon?: import("react").ReactNode;
9
9
  isMobile?: boolean;
10
+ containerClassName?: string;
10
11
  } & Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "id"> & import("react").RefAttributes<HTMLInputElement>>;
11
12
  export declare const Tabs: import("react").ForwardRefExoticComponent<import("./components/Tabs/Tabs").TabsProps & import("react").RefAttributes<HTMLDivElement>>;
12
13
  export declare const Drawer: import("react").ForwardRefExoticComponent<import("./components/Drawer/Drawer").DrawerProps & import("react").RefAttributes<HTMLDivElement>>;
package/package.json CHANGED
@@ -1,176 +1,176 @@
1
- {
2
- "name": "automoby-kit",
3
- "version": "1.0.53",
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.55",
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
+ }