automoby-kit 1.0.23 → 1.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("react"),a=require("./utils.js"),t=require("./contexts.js"),n=require("./chunks/chevron-left-Do__K6cA.js");require("./chunks/createLucideIcon-BqJVOzoK.js");const s=r.forwardRef(({items:r,className:s,isMobile:l},i)=>{const c=t.useMobile(),o=l??c;return e.jsx("nav",{ref:i,className:a("flex flex-row-reverse items-center",o?"gap-1 px-4 py-2.5":"gap-3 pr-1 pt-3 pb-4 pl-0",s),"aria-label":"Breadcrumb navigation",children:e.jsx("ol",{className:"flex flex-row-reverse items-center gap-inherit",children:r.map((t,s)=>{const l=s===r.length-1,i=!l&&(t.href||t.onClick),c=`${t.label}-${s}`;return e.jsxs("li",{className:"flex items-center gap-inherit",children:[i?e.jsx("a",{href:t.href||"#",className:a("whitespace-nowrap border-0 bg-transparent p-0 no-underline",o?"text-t":"text-s","text-neutral-main","cursor-pointer hover:text-neutral-dark transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 rounded-sm"),onClick:e=>((e,a,t)=>{a!==r.length-1&&e.onClick&&(t.preventDefault(),e.onClick())})(t,s,e),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t.onClick&&t.onClick())},"aria-label":`Go to ${t.label}`,children:t.label}):e.jsx("span",{className:a("whitespace-nowrap",o?"text-t":"text-s","text-neutral-main","font-medium"),"aria-current":l?"page":void 0,"aria-label":l?`Current page: ${t.label}`:void 0,children:t.label}),!l&&e.jsx(n.ChevronLeft,{className:a("text-black flex-shrink-0",o?"w-2.5 h-2.5":"w-3 h-3"),"aria-hidden":"true"})]},c)})})})});s.displayName="Breadcrumb",exports.Breadcrumb=s;
1
+ "use client";"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./utils.js"),a=require("./contexts.js"),n=require("./chunks/chevron-left-Do__K6cA.js");require("./chunks/createLucideIcon-BqJVOzoK.js");const s=r.forwardRef(({items:r,className:s,isMobile:l},i)=>{const c=a.useMobile(),o=l??c;return e.jsx("nav",{ref:i,className:t("flex flex-row-reverse items-center",o?"gap-1 px-4 py-2.5":"gap-3 pr-1 pt-3 pb-4 pl-0",s),"aria-label":"Breadcrumb navigation",children:e.jsx("ol",{className:"flex flex-row-reverse items-center gap-inherit",children:r.map((a,s)=>{const l=s===r.length-1,i=!l&&(a.href||a.onClick),c=`${a.label}-${s}`;return e.jsxs("li",{className:"flex items-center gap-inherit",children:[i?e.jsx("a",{href:a.href||"#",className:t("whitespace-nowrap border-0 bg-transparent p-0 no-underline",o?"text-t":"text-s","text-neutral-main","cursor-pointer hover:text-neutral-dark transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 rounded-sm"),onClick:e=>((e,t,a)=>{t!==r.length-1&&e.onClick&&(a.preventDefault(),e.onClick())})(a,s,e),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),a.onClick&&a.onClick())},"aria-label":`Go to ${a.label}`,children:a.label}):e.jsx("span",{className:t("whitespace-nowrap",o?"text-t":"text-s","text-neutral-main","font-medium"),"aria-current":l?"page":void 0,"aria-label":l?`Current page: ${a.label}`:void 0,children:a.label}),!l&&e.jsx(n.ChevronLeft,{className:t("text-black flex-shrink-0",o?"w-2.5 h-2.5":"w-3 h-3"),"aria-hidden":"true"})]},c)})})})});s.displayName="Breadcrumb",exports.Breadcrumb=s;
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./utils.js"),a=require("./Typography.js");const i={sm:"px-[16px] py-[7px]",md:"px-[16px] py-[9px]",lg:"px-[16px] py-[13px]",xl:"px-[20px] py-[13px]"},n={sm:"body-s-bold",md:"body-m-bold",lg:"body-l-bold",xl:"body-xl-heavy"},l={primary:"\n bg-primary text-white\n hover:bg-primary-dark\n disabled:bg-neutral-light disabled:text-neutral-darker\n ",secondary:"\n bg-primary-lightest text-primary\n hover:bg-primary-lighter\n disabled:bg-neutral-light disabled:text-neutral-darker\n ",tertiary:"\n bg-white border border-primary-light text-primary\n hover:bg-neutral-lighter\n disabled:bg-neutral-light disabled:text-neutral-darker\n ",ghost:"\n bg-transparent text-primary\n hover:bg-primary-lightest\n disabled:bg-neutral-light disabled:text-neutral-darker\n "},s=r.forwardRef(({className:r,variant:s="primary",size:d="md",icon:p,iconPosition:o="right",children:b,loading:x=!1,disabled:g,textVariant:y,...m},h)=>{const u=y||n[d];return e.jsxs("button",{ref:h,type:"button",className:t("inline-flex items-center justify-center rounded-[8px] transition-colors duration-200",i[d],l[s],a.getTypographyClasses(u),g&&"opacity-50 pointer-events-none",r),disabled:g||x,...m,children:[p&&"left"===o&&e.jsx("span",{className:"mr-2 flex items-center",children:p}),x?"...":b,p&&"right"===o&&e.jsx("span",{className:"ml-2 flex items-center",children:p})]})});s.displayName="Button",exports.Button=s;
1
+ "use client";"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./utils.js"),a=require("./Typography.js");const i={sm:"px-[16px] py-[7px]",md:"px-[16px] py-[9px]",lg:"px-[16px] py-[13px]",xl:"px-[20px] py-[13px]"},n={sm:"body-s-bold",md:"body-m-bold",lg:"body-l-bold",xl:"body-xl-heavy"},l={primary:"\n bg-primary text-white\n hover:bg-primary-dark\n disabled:bg-neutral-light disabled:text-neutral-darker\n ",secondary:"\n bg-primary-lightest text-primary\n hover:bg-primary-lighter\n disabled:bg-neutral-light disabled:text-neutral-darker\n ",tertiary:"\n bg-white border border-primary-light text-primary\n hover:bg-neutral-lighter\n disabled:bg-neutral-light disabled:text-neutral-darker\n ",ghost:"\n bg-transparent text-primary\n hover:bg-primary-lightest\n disabled:bg-neutral-light disabled:text-neutral-darker\n "},s=r.forwardRef(({className:r,variant:s="primary",size:d="md",icon:p,iconPosition:o="right",children:b,loading:x=!1,disabled:g,textVariant:y,...m},h)=>{const u=y||n[d];return e.jsxs("button",{ref:h,type:"button",className:t("inline-flex items-center justify-center rounded-[8px] transition-colors duration-200",i[d],l[s],a.getTypographyClasses(u),g&&"opacity-50 pointer-events-none",r),disabled:g||x,...m,children:[p&&"left"===o&&e.jsx("span",{className:"mr-2 flex items-center",children:p}),x?"...":b,p&&"right"===o&&e.jsx("span",{className:"ml-2 flex items-center",children:p})]})});s.displayName="Button",exports.Button=s;
package/dist/cjs/Chips.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("./utils.js"),i=require("./contexts.js");const o=require("./chunks/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=r.forwardRef(({variant:r="purple",size:d,children:s="متن پیشفرض",disabled:l=!1,onClick:c,onIconClick:b,className:u,isMobile:p,...g},x)=>{const h=i.useMobile(),f=n[l?"disabled":r],k=a[d||(p??h?"mobile":"desktop")],handleIconClick=e=>{e.stopPropagation(),b&&b()};return e.jsxs("div",{ref:x,className:t("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",f.background,f.text,f.border,k.padding,k.gap,k.fontSize,k.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,...g,children:[e.jsx("span",{className:"text-center",children:s}),(()=>{const r=e.jsx(o,{className:t(k.iconSize)});return b?e.jsx("button",{type:"button",onClick:handleIconClick,disabled:l,className:t("flex items-center justify-center","hover:opacity-70 transition-opacity",l&&"cursor-not-allowed opacity-50"),"aria-label":"حذف",children:r}):r})()]})});d.displayName="Chips",exports.Chips=d,exports.default=d;
1
+ "use client";"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./utils.js"),i=require("./contexts.js");const o=require("./chunks/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=t.forwardRef(({variant:t="purple",size:d,children:s="متن پیشفرض",disabled:l=!1,onClick:c,onIconClick:b,className:u,isMobile:p,...g},x)=>{const h=i.useMobile(),f=n[l?"disabled":t],k=a[d||(p??h?"mobile":"desktop")],handleIconClick=e=>{e.stopPropagation(),b&&b()};return e.jsxs("div",{ref:x,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",f.background,f.text,f.border,k.padding,k.gap,k.fontSize,k.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,...g,children:[e.jsx("span",{className:"text-center",children:s}),(()=>{const t=e.jsx(o,{className:r(k.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.default=d;
package/dist/cjs/Tabs.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("react"),i=require("./utils.js"),r=require("./contexts.js");const renderBadge=(t,r,s,a)=>void 0===t?null:e.jsx("div",{className:i("flex items-center justify-center rounded-[5px] font-sans font-bold text-white","transition-colors duration-200",a?"size-6 text-s pt-0.5":"size-[25px] text-s pt-[3px]",s?"bg-midnight":r?"bg-primary":"bg-neutral-main"),children:e.jsx("p",{className:"leading-[24px] whitespace-pre",dir:"auto",children:t})}),renderTabContent=(t,r,s)=>{const a=void 0!==t.count;return e.jsxs("div",{className:i("flex flex-row items-center justify-start transition-colors duration-200","gap-1.5"),children:[a&&renderBadge(t.count,r,t.disabled,s),e.jsx("div",{className:i("font-sans text-nowrap text-right transition-colors duration-200",s?"text-s":r?"text-m":"text-l",t.disabled?"font-normal text-midnight":r?"font-bold text-primary":"font-normal text-neutral-main",s?"leading-[24px]":r?"leading-normal":"leading-[1.9]"),children:e.jsx("p",{className:"whitespace-pre",dir:"auto",children:t.label})})]})},s=t.forwardRef(({items:t,activeTab:s,onTabChange:a,className:n,isMobile:l,...o},d)=>{const c=r.useMobile(),x=l??c;return e.jsxs("div",{ref:d,className:i("relative w-full",n),...o,children:[e.jsx("div",{className:"box-border flex flex-row items-center justify-end p-0 relative w-full",children:t.map(t=>((t,r,s,a)=>{const n=t.id===r;return e.jsxs("div",{className:i("box-border flex flex-col items-center justify-between relative shrink-0","cursor-pointer transition-all duration-200",s?"h-12 px-3":"h-14 px-4",n?s?"pt-[11px] pb-0":"pt-3.5 pb-0":"py-0 justify-center",t.disabled&&"cursor-not-allowed opacity-50",!t.disabled&&"hover:opacity-80"),onClick:()=>((e,t,i)=>{t||i(e)})(t.id,t.disabled,a),onKeyDown:e=>((e,t,i,r)=>{"Enter"!==e.key&&" "!==e.key||i||(e.preventDefault(),r(t))})(e,t.id,t.disabled,a),tabIndex:t.disabled?-1:0,role:"tab","aria-selected":n,"aria-disabled":t.disabled,children:[renderTabContent(t,n,s),n&&e.jsx("div",{className:"bg-primary h-1 rounded-tl-[8px] rounded-tr-[8px] shrink-0 w-full"})]},t.id)})(t,s,x,a))}),e.jsx("div",{className:"absolute border-midnight-light border-[0px_0px_1px] border-solid bottom-[-0.5px] left-0 right-0 top-0 pointer-events-none"})]})});s.displayName="Tabs",exports.Tabs=s;
1
+ "use client";"use strict";var e=require("react/jsx-runtime"),t=require("react"),i=require("./utils.js"),r=require("./contexts.js");const renderBadge=(t,r,s,a)=>void 0===t?null:e.jsx("div",{className:i("flex items-center justify-center rounded-[5px] font-sans font-bold text-white","transition-colors duration-200",a?"size-6 text-s pt-0.5":"size-[25px] text-s pt-[3px]",s?"bg-midnight":r?"bg-primary":"bg-neutral-main"),children:e.jsx("p",{className:"leading-[24px] whitespace-pre",dir:"auto",children:t})}),renderTabContent=(t,r,s)=>{const a=void 0!==t.count;return e.jsxs("div",{className:i("flex flex-row items-center justify-start transition-colors duration-200","gap-1.5"),children:[a&&renderBadge(t.count,r,t.disabled,s),e.jsx("div",{className:i("font-sans text-nowrap text-right transition-colors duration-200",s?"text-s":r?"text-m":"text-l",t.disabled?"font-normal text-midnight":r?"font-bold text-primary":"font-normal text-neutral-main",s?"leading-[24px]":r?"leading-normal":"leading-[1.9]"),children:e.jsx("p",{className:"whitespace-pre",dir:"auto",children:t.label})})]})},s=t.forwardRef(({items:t,activeTab:s,onTabChange:a,className:n,isMobile:l,...o},d)=>{const c=r.useMobile(),x=l??c;return e.jsxs("div",{ref:d,className:i("relative w-full",n),...o,children:[e.jsx("div",{className:"box-border flex flex-row items-center justify-end p-0 relative w-full",children:t.map(t=>((t,r,s,a)=>{const n=t.id===r;return e.jsxs("div",{className:i("box-border flex flex-col items-center justify-between relative shrink-0","cursor-pointer transition-all duration-200",s?"h-12 px-3":"h-14 px-4",n?s?"pt-[11px] pb-0":"pt-3.5 pb-0":"py-0 justify-center",t.disabled&&"cursor-not-allowed opacity-50",!t.disabled&&"hover:opacity-80"),onClick:()=>((e,t,i)=>{t||i(e)})(t.id,t.disabled,a),onKeyDown:e=>((e,t,i,r)=>{"Enter"!==e.key&&" "!==e.key||i||(e.preventDefault(),r(t))})(e,t.id,t.disabled,a),tabIndex:t.disabled?-1:0,role:"tab","aria-selected":n,"aria-disabled":t.disabled,children:[renderTabContent(t,n,s),n&&e.jsx("div",{className:"bg-primary h-1 rounded-tl-[8px] rounded-tr-[8px] shrink-0 w-full"})]},t.id)})(t,s,x,a))}),e.jsx("div",{className:"absolute border-midnight-light border-[0px_0px_1px] border-solid bottom-[-0.5px] left-0 right-0 top-0 pointer-events-none"})]})});s.displayName="Tabs",exports.Tabs=s;
@@ -1 +1 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import t from"react";import a from"./utils.js";import{useMobile as n}from"./contexts.js";import{C as l}from"./chunks/chevron-left-4HSuTes3.js";import"./chunks/createLucideIcon-DGp0SoUT.js";const i=t.forwardRef(({items:t,className:i,isMobile:o},s)=>{const c=n(),m=o??c;return e("nav",{ref:s,className:a("flex flex-row-reverse items-center",m?"gap-1 px-4 py-2.5":"gap-3 pr-1 pt-3 pb-4 pl-0",i),"aria-label":"Breadcrumb navigation",children:e("ol",{className:"flex flex-row-reverse items-center gap-inherit",children:t.map((n,i)=>{const o=i===t.length-1,s=!o&&(n.href||n.onClick),c=`${n.label}-${i}`;return r("li",{className:"flex items-center gap-inherit",children:[s?e("a",{href:n.href||"#",className:a("whitespace-nowrap border-0 bg-transparent p-0 no-underline",m?"text-t":"text-s","text-neutral-main","cursor-pointer hover:text-neutral-dark transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 rounded-sm"),onClick:e=>((e,r,a)=>{r!==t.length-1&&e.onClick&&(a.preventDefault(),e.onClick())})(n,i,e),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick&&n.onClick())},"aria-label":`Go to ${n.label}`,children:n.label}):e("span",{className:a("whitespace-nowrap",m?"text-t":"text-s","text-neutral-main","font-medium"),"aria-current":o?"page":void 0,"aria-label":o?`Current page: ${n.label}`:void 0,children:n.label}),!o&&e(l,{className:a("text-black flex-shrink-0",m?"w-2.5 h-2.5":"w-3 h-3"),"aria-hidden":"true"})]},c)})})})});i.displayName="Breadcrumb";export{i as Breadcrumb};
1
+ "use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import t from"react";import a from"./utils.js";import{useMobile as n}from"./contexts.js";import{C as l}from"./chunks/chevron-left-4HSuTes3.js";import"./chunks/createLucideIcon-DGp0SoUT.js";const i=t.forwardRef(({items:t,className:i,isMobile:o},s)=>{const c=n(),m=o??c;return e("nav",{ref:s,className:a("flex flex-row-reverse items-center",m?"gap-1 px-4 py-2.5":"gap-3 pr-1 pt-3 pb-4 pl-0",i),"aria-label":"Breadcrumb navigation",children:e("ol",{className:"flex flex-row-reverse items-center gap-inherit",children:t.map((n,i)=>{const o=i===t.length-1,s=!o&&(n.href||n.onClick),c=`${n.label}-${i}`;return r("li",{className:"flex items-center gap-inherit",children:[s?e("a",{href:n.href||"#",className:a("whitespace-nowrap border-0 bg-transparent p-0 no-underline",m?"text-t":"text-s","text-neutral-main","cursor-pointer hover:text-neutral-dark transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 rounded-sm"),onClick:e=>((e,r,a)=>{r!==t.length-1&&e.onClick&&(a.preventDefault(),e.onClick())})(n,i,e),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick&&n.onClick())},"aria-label":`Go to ${n.label}`,children:n.label}):e("span",{className:a("whitespace-nowrap",m?"text-t":"text-s","text-neutral-main","font-medium"),"aria-current":o?"page":void 0,"aria-label":o?`Current page: ${n.label}`:void 0,children:n.label}),!o&&e(l,{className:a("text-black flex-shrink-0",m?"w-2.5 h-2.5":"w-3 h-3"),"aria-hidden":"true"})]},c)})})})});i.displayName="Breadcrumb";export{i as Breadcrumb};
@@ -1 +1 @@
1
- import{jsxs as r,jsx as e}from"react/jsx-runtime";import t from"react";import i from"./utils.js";import{getTypographyClasses as a}from"./Typography.js";const n={sm:"px-[16px] py-[7px]",md:"px-[16px] py-[9px]",lg:"px-[16px] py-[13px]",xl:"px-[20px] py-[13px]"},l={sm:"body-s-bold",md:"body-m-bold",lg:"body-l-bold",xl:"body-xl-heavy"},d={primary:"\n bg-primary text-white\n hover:bg-primary-dark\n disabled:bg-neutral-light disabled:text-neutral-darker\n ",secondary:"\n bg-primary-lightest text-primary\n hover:bg-primary-lighter\n disabled:bg-neutral-light disabled:text-neutral-darker\n ",tertiary:"\n bg-white border border-primary-light text-primary\n hover:bg-neutral-lighter\n disabled:bg-neutral-light disabled:text-neutral-darker\n ",ghost:"\n bg-transparent text-primary\n hover:bg-primary-lightest\n disabled:bg-neutral-light disabled:text-neutral-darker\n "},o=t.forwardRef(({className:t,variant:o="primary",size:s="md",icon:p,iconPosition:m="right",children:b,loading:x=!1,disabled:g,textVariant:y,...h},c)=>r("button",{ref:c,type:"button",className:i("inline-flex items-center justify-center rounded-[8px] transition-colors duration-200",n[s],d[o],a(y||l[s]),g&&"opacity-50 pointer-events-none",t),disabled:g||x,...h,children:[p&&"left"===m&&e("span",{className:"mr-2 flex items-center",children:p}),x?"...":b,p&&"right"===m&&e("span",{className:"ml-2 flex items-center",children:p})]}));o.displayName="Button";export{o as Button};
1
+ "use client";import{jsxs as r,jsx as e}from"react/jsx-runtime";import t from"react";import i from"./utils.js";import{getTypographyClasses as a}from"./Typography.js";const n={sm:"px-[16px] py-[7px]",md:"px-[16px] py-[9px]",lg:"px-[16px] py-[13px]",xl:"px-[20px] py-[13px]"},l={sm:"body-s-bold",md:"body-m-bold",lg:"body-l-bold",xl:"body-xl-heavy"},d={primary:"\n bg-primary text-white\n hover:bg-primary-dark\n disabled:bg-neutral-light disabled:text-neutral-darker\n ",secondary:"\n bg-primary-lightest text-primary\n hover:bg-primary-lighter\n disabled:bg-neutral-light disabled:text-neutral-darker\n ",tertiary:"\n bg-white border border-primary-light text-primary\n hover:bg-neutral-lighter\n disabled:bg-neutral-light disabled:text-neutral-darker\n ",ghost:"\n bg-transparent text-primary\n hover:bg-primary-lightest\n disabled:bg-neutral-light disabled:text-neutral-darker\n "},s=t.forwardRef(({className:t,variant:s="primary",size:o="md",icon:p,iconPosition:m="right",children:b,loading:x=!1,disabled:g,textVariant:y,...h},c)=>r("button",{ref:c,type:"button",className:i("inline-flex items-center justify-center rounded-[8px] transition-colors duration-200",n[o],d[s],a(y||l[o]),g&&"opacity-50 pointer-events-none",t),disabled:g||x,...h,children:[p&&"left"===m&&e("span",{className:"mr-2 flex items-center",children:p}),x?"...":b,p&&"right"===m&&e("span",{className:"ml-2 flex items-center",children:p})]}));s.displayName="Button";export{s as Button};
package/dist/esm/Chips.js CHANGED
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import r from"react";import o from"./utils.js";import{useMobile as i}from"./contexts.js";import{c as n}from"./chunks/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=r.forwardRef(({variant:r="purple",size:n,children:s="متن پیشفرض",disabled:c=!1,onClick:b,onIconClick:p,className:g,isMobile:u,...x},f)=>{const m=i(),h=d[c?"disabled":r],k=l[n||(u??m?"mobile":"desktop")],handleIconClick=e=>{e.stopPropagation(),p&&p()};return e("div",{ref:f,className:o("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",h.background,h.text,h.border,k.padding,k.gap,k.fontSize,k.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,...x,children:[t("span",{className:"text-center",children:s}),(()=>{const e=t(a,{className:o(k.iconSize)});return p?t("button",{type:"button",onClick:handleIconClick,disabled:c,className:o("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 Chips,s as default};
1
+ "use client";import{jsxs as e,jsx as t}from"react/jsx-runtime";import r from"react";import o from"./utils.js";import{useMobile as i}from"./contexts.js";import{c as n}from"./chunks/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=r.forwardRef(({variant:r="purple",size:n,children:s="متن پیشفرض",disabled:c=!1,onClick:b,onIconClick:p,className:g,isMobile:u,...x},f)=>{const m=i(),h=d[c?"disabled":r],k=l[n||(u??m?"mobile":"desktop")],handleIconClick=e=>{e.stopPropagation(),p&&p()};return e("div",{ref:f,className:o("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",h.background,h.text,h.border,k.padding,k.gap,k.fontSize,k.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,...x,children:[t("span",{className:"text-center",children:s}),(()=>{const e=t(a,{className:o(k.iconSize)});return p?t("button",{type:"button",onClick:handleIconClick,disabled:c,className:o("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 Chips,s as default};
package/dist/esm/Tabs.js CHANGED
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import i from"react";import r from"./utils.js";import{useMobile as a}from"./contexts.js";const renderBadge=(e,i,a,n)=>void 0===e?null:t("div",{className:r("flex items-center justify-center rounded-[5px] font-sans font-bold text-white","transition-colors duration-200",n?"size-6 text-s pt-0.5":"size-[25px] text-s pt-[3px]",a?"bg-midnight":i?"bg-primary":"bg-neutral-main"),children:t("p",{className:"leading-[24px] whitespace-pre",dir:"auto",children:e})}),renderTabContent=(i,a,n)=>{const o=void 0!==i.count;return e("div",{className:r("flex flex-row items-center justify-start transition-colors duration-200","gap-1.5"),children:[o&&renderBadge(i.count,a,i.disabled,n),t("div",{className:r("font-sans text-nowrap text-right transition-colors duration-200",n?"text-s":a?"text-m":"text-l",i.disabled?"font-normal text-midnight":a?"font-bold text-primary":"font-normal text-neutral-main",n?"leading-[24px]":a?"leading-normal":"leading-[1.9]"),children:t("p",{className:"whitespace-pre",dir:"auto",children:i.label})})]})},n=i.forwardRef(({items:i,activeTab:n,onTabChange:o,className:l,isMobile:s,...d},c)=>{const p=a(),m=s??p;return e("div",{ref:c,className:r("relative w-full",l),...d,children:[t("div",{className:"box-border flex flex-row items-center justify-end p-0 relative w-full",children:i.map(i=>((i,a,n,o)=>{const l=i.id===a;return e("div",{className:r("box-border flex flex-col items-center justify-between relative shrink-0","cursor-pointer transition-all duration-200",n?"h-12 px-3":"h-14 px-4",l?n?"pt-[11px] pb-0":"pt-3.5 pb-0":"py-0 justify-center",i.disabled&&"cursor-not-allowed opacity-50",!i.disabled&&"hover:opacity-80"),onClick:()=>((e,t,i)=>{t||i(e)})(i.id,i.disabled,o),onKeyDown:e=>((e,t,i,r)=>{"Enter"!==e.key&&" "!==e.key||i||(e.preventDefault(),r(t))})(e,i.id,i.disabled,o),tabIndex:i.disabled?-1:0,role:"tab","aria-selected":l,"aria-disabled":i.disabled,children:[renderTabContent(i,l,n),l&&t("div",{className:"bg-primary h-1 rounded-tl-[8px] rounded-tr-[8px] shrink-0 w-full"})]},i.id)})(i,n,m,o))}),t("div",{className:"absolute border-midnight-light border-[0px_0px_1px] border-solid bottom-[-0.5px] left-0 right-0 top-0 pointer-events-none"})]})});n.displayName="Tabs";export{n as Tabs};
1
+ "use client";import{jsxs as e,jsx as t}from"react/jsx-runtime";import i from"react";import r from"./utils.js";import{useMobile as a}from"./contexts.js";const renderBadge=(e,i,a,n)=>void 0===e?null:t("div",{className:r("flex items-center justify-center rounded-[5px] font-sans font-bold text-white","transition-colors duration-200",n?"size-6 text-s pt-0.5":"size-[25px] text-s pt-[3px]",a?"bg-midnight":i?"bg-primary":"bg-neutral-main"),children:t("p",{className:"leading-[24px] whitespace-pre",dir:"auto",children:e})}),renderTabContent=(i,a,n)=>{const l=void 0!==i.count;return e("div",{className:r("flex flex-row items-center justify-start transition-colors duration-200","gap-1.5"),children:[l&&renderBadge(i.count,a,i.disabled,n),t("div",{className:r("font-sans text-nowrap text-right transition-colors duration-200",n?"text-s":a?"text-m":"text-l",i.disabled?"font-normal text-midnight":a?"font-bold text-primary":"font-normal text-neutral-main",n?"leading-[24px]":a?"leading-normal":"leading-[1.9]"),children:t("p",{className:"whitespace-pre",dir:"auto",children:i.label})})]})},n=i.forwardRef(({items:i,activeTab:n,onTabChange:l,className:o,isMobile:s,...d},c)=>{const p=a(),m=s??p;return e("div",{ref:c,className:r("relative w-full",o),...d,children:[t("div",{className:"box-border flex flex-row items-center justify-end p-0 relative w-full",children:i.map(i=>((i,a,n,l)=>{const o=i.id===a;return e("div",{className:r("box-border flex flex-col items-center justify-between relative shrink-0","cursor-pointer transition-all duration-200",n?"h-12 px-3":"h-14 px-4",o?n?"pt-[11px] pb-0":"pt-3.5 pb-0":"py-0 justify-center",i.disabled&&"cursor-not-allowed opacity-50",!i.disabled&&"hover:opacity-80"),onClick:()=>((e,t,i)=>{t||i(e)})(i.id,i.disabled,l),onKeyDown:e=>((e,t,i,r)=>{"Enter"!==e.key&&" "!==e.key||i||(e.preventDefault(),r(t))})(e,i.id,i.disabled,l),tabIndex:i.disabled?-1:0,role:"tab","aria-selected":o,"aria-disabled":i.disabled,children:[renderTabContent(i,o,n),o&&t("div",{className:"bg-primary h-1 rounded-tl-[8px] rounded-tr-[8px] shrink-0 w-full"})]},i.id)})(i,n,m,l))}),t("div",{className:"absolute border-midnight-light border-[0px_0px_1px] border-solid bottom-[-0.5px] left-0 right-0 top-0 pointer-events-none"})]})});n.displayName="Tabs";export{n as Tabs};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "automoby-kit",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "description": "A comprehensive React UI component library - created in war 2025",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",