automoby-kit 1.0.18 → 1.0.19
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/dist/cjs/Button.js +1 -1
- package/dist/cjs/Chips.js +1 -1
- package/dist/cjs/Menu.js +1 -1
- package/dist/cjs/Typography.js +1 -1
- package/dist/esm/Button.js +1 -1
- package/dist/esm/Chips.js +1 -1
- package/dist/esm/Menu.js +1 -1
- package/dist/esm/Typography.js +1 -1
- package/dist/types/Button.js +12 -12
- package/dist/types/Chips.js +17 -17
- package/dist/types/Menu.js +4 -4
- package/dist/types/Typography.js +6 -6
- package/package.json +1 -1
package/dist/cjs/Button.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
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;
|
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"),
|
|
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-[12px]",lineHeight:"leading-[1.8]"},desktop:{padding:"px-3 py-1",gap:"gap-1.5",iconSize:"size-5",fontSize:"text-[14px]",lineHeight:"leading-[24px]"}},d=r.forwardRef(({variant:r="purple",size:d,children:l="متن پیشفرض",disabled:s=!1,onClick:c,onIconClick:b,className:p,isMobile:u,...g},x)=>{const h=i.useMobile(),f=n[s?"disabled":r],k=a[d||(u??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&&!s&&"cursor-pointer hover:opacity-80",s&&"cursor-not-allowed opacity-60",p),onClick:s?void 0:c,onKeyDown:c&&!s?e=>{"Enter"!==e.key&&" "!==e.key||!c||s||(e.preventDefault(),c())}:void 0,tabIndex:c&&!s?0:void 0,role:c?"button":void 0,...g,children:[e.jsx("span",{className:"text-center",children:l}),(()=>{const r=e.jsx(o,{className:t(k.iconSize)});return b?e.jsx("button",{type:"button",onClick:handleIconClick,disabled:s,className:t("flex items-center justify-center","hover:opacity-70 transition-opacity",s&&"cursor-not-allowed opacity-50"),"aria-label":"حذف",children:r}):r})()]})});d.displayName="Chips",exports.Chips=d,exports.default=d;
|
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"),
|
|
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},p)=>{const[b,x]=r.useState(!1),f=r.useRef(null),h=r.useRef(null),m=void 0!==d?d:b,handleToggle=()=>{if(o)return;const e=!m;void 0===d&&x(e),l?.(e)};r.useEffect(()=>{const handleClickOutside=e=>{f.current&&!f.current.contains(e.target)&&(void 0===d&&x(!1),l?.(!1))};if(m)return document.addEventListener("mousedown",handleClickOutside),()=>{document.removeEventListener("mousedown",handleClickOutside)}},[m,d,l]);const v=t("inline-flex items-center justify-center","bg-white border border-neutral-light","rounded-[6px] px-[16px] py-[13px]","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}),y=t("absolute top-full left-0 right-0 z-10 mt-[4px]","bg-white border border-neutral-light","rounded-[6px] py-[13px] px-[16px]","shadow-lg","transition-all duration-200",{"opacity-100 translate-y-0 pointer-events-auto":m,"opacity-0 -translate-y-2 pointer-events-none":!m}),g=t("block w-full text-right","transition-colors duration-200","hover:bg-neutral-lighter rounded-[4px] px-[8px] py-[4px] -mx-[8px]","focus:outline-none focus:bg-neutral-lighter");return e.jsx("div",{ref:p,className:t("relative inline-block",s),...c,children:e.jsxs("div",{ref:f,children:[e.jsx("button",{ref:h,type:"button",className:v,onClick:handleToggle,onKeyDown:e=>{if(!o)switch(e.key){case"Escape":m&&(e.preventDefault(),void 0===d&&x(!1),l?.(!1),h.current?.focus());break;case"ArrowDown":m||(e.preventDefault(),handleToggle());break;case"Enter":case" ":e.preventDefault(),handleToggle()}},disabled:o,"aria-expanded":m,"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-[16px]",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&&x(!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:m?0:-1,children:a},r.id):e.jsx("button",{...i,type:"button",role:"menuitem",tabIndex:m?0:-1,disabled:r.disabled,children:a},r.id)})})})]})})});a.displayName="Menu",exports.Menu=a;
|
package/dist/cjs/Typography.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t=require("react"),e=require("./utils.js");const o={h1:"text-[36px] font-fat",h2:"text-[32px] font-fat",h3:"text-[28px] font-fat",h4:"text-[24px] font-heavy",h5:"text-[22px] font-heavy",h6:"text-[20px] font-heavy","body-xl-heavy":"text-[20px] font-heavy","body-l-heavy":"text-[18px] font-heavy","body-l-bold":"text-[18px] font-bold","body-l-medium":"text-[18px] font-medium","body-m-heavy":"text-[16px] font-heavy","body-m-bold":"text-[16px] font-bold","body-m-medium":"text-[16px] font-medium","body-s-heavy":"text-[14px] font-heavy","body-s-bold":"text-[14px] font-bold","body-s-medium":"text-[14px] font-medium","body-ms-bold":"text-[13px] font-bold","body-ms-medium":"text-[13px] font-medium","body-xs-bold":"text-[12px] font-bold","body-xs-medium":"text-[12px] font-medium","body-t-bold":"text-[10px] font-bold","body-t-medium":"text-[10px] font-medium","body-ss-medium":"text-[9px] font-medium"},
|
|
1
|
+
"use strict";var t=require("react"),e=require("./utils.js");const o={h1:"text-[36px] font-fat",h2:"text-[32px] font-fat",h3:"text-[28px] font-fat",h4:"text-[24px] font-heavy",h5:"text-[22px] font-heavy",h6:"text-[20px] font-heavy","body-xl-heavy":"text-[20px] font-heavy","body-l-heavy":"text-[18px] font-heavy","body-l-bold":"text-[18px] font-bold","body-l-medium":"text-[18px] font-medium","body-m-heavy":"text-[16px] font-heavy","body-m-bold":"text-[16px] font-bold","body-m-medium":"text-[16px] font-medium","body-s-heavy":"text-[14px] font-heavy","body-s-bold":"text-[14px] font-bold","body-s-medium":"text-[14px] font-medium","body-ms-bold":"text-[13px] font-bold","body-ms-medium":"text-[13px] font-medium","body-xs-bold":"text-[12px] font-bold","body-xs-medium":"text-[12px] font-medium","body-t-bold":"text-[10px] font-bold","body-t-medium":"text-[10px] font-medium","body-ss-medium":"text-[9px] font-medium"},x={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"},d=t.forwardRef(({variant:d="body-m-medium",color:a="inherit",as:m,className:n,children:r,...y},i)=>{const p=m||(t=>t.startsWith("h")?t.split("-")[0]:"p")(d);return t.createElement(p,{ref:i,className:e(o[d],x[a],"leading-[var(--leading-default)]",n),...y},r)});d.displayName="Typography",exports.Typography=d,exports.getTypographyClasses=t=>o[t];
|
package/dist/esm/Button.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as r,jsx as e}from"react/jsx-runtime";import
|
|
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};
|
package/dist/esm/Chips.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
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-[12px]",lineHeight:"leading-[1.8]"},desktop:{padding:"px-3 py-1",gap:"gap-1.5",iconSize:"size-5",fontSize:"text-[14px]",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/Menu.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import t,{useState as
|
|
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:p,"aria-label":b,...f},m)=>{const[h,x]=n(!1),v=o(null),g=o(null),y=void 0!==p?p:h,handleToggle=()=>{if(d)return;const e=!y;void 0===p&&x(e),u?.(e)};a(()=>{const handleClickOutside=e=>{v.current&&!v.current.contains(e.target)&&(void 0===p&&x(!1),u?.(!1))};if(y)return document.addEventListener("mousedown",handleClickOutside),()=>{document.removeEventListener("mousedown",handleClickOutside)}},[y,p,u]);const w=i("inline-flex items-center justify-center","bg-white border border-neutral-light","rounded-[6px] px-[16px] py-[13px]","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-[4px]","bg-white border border-neutral-light","rounded-[6px] py-[13px] px-[16px]","shadow-lg","transition-all duration-200",{"opacity-100 translate-y-0 pointer-events-auto":y,"opacity-0 -translate-y-2 pointer-events-none":!y}),N=i("block w-full text-right","transition-colors duration-200","hover:bg-neutral-lighter rounded-[4px] px-[8px] py-[4px] -mx-[8px]","focus:outline-none focus:bg-neutral-lighter");return e("div",{ref:m,className:i("relative inline-block",c),...f,children:r("div",{ref:v,children:[e("button",{ref:g,type:"button",className:w,onClick:handleToggle,onKeyDown:e=>{if(!d)switch(e.key){case"Escape":y&&(e.preventDefault(),void 0===p&&x(!1),u?.(!1),g.current?.focus());break;case"ArrowDown":y||(e.preventDefault(),handleToggle());break;case"Enter":case" ":e.preventDefault(),handleToggle()}},disabled:d,"aria-expanded":y,"aria-haspopup":"true","aria-label":b||`منوی ${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-[16px]",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===p&&x(!1),u?.(!1),e.onClick?.())})(r),"aria-label":`منوی ${r.label}`};return r.href&&!r.disabled?e("a",{...n,href:r.href,role:"menuitem",tabIndex:y?0:-1,children:t},r.id):e("button",{...n,type:"button",role:"menuitem",tabIndex:y?0:-1,disabled:r.disabled,children:t},r.id)})})})]})})});s.displayName="Menu";export{s as Menu};
|
package/dist/esm/Typography.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"react";import e from"./utils.js";const o={h1:"text-[36px] font-fat",h2:"text-[32px] font-fat",h3:"text-[28px] font-fat",h4:"text-[24px] font-heavy",h5:"text-[22px] font-heavy",h6:"text-[20px] font-heavy","body-xl-heavy":"text-[20px] font-heavy","body-l-heavy":"text-[18px] font-heavy","body-l-bold":"text-[18px] font-bold","body-l-medium":"text-[18px] font-medium","body-m-heavy":"text-[16px] font-heavy","body-m-bold":"text-[16px] font-bold","body-m-medium":"text-[16px] font-medium","body-s-heavy":"text-[14px] font-heavy","body-s-bold":"text-[14px] font-bold","body-s-medium":"text-[14px] font-medium","body-ms-bold":"text-[13px] font-bold","body-ms-medium":"text-[13px] font-medium","body-xs-bold":"text-[12px] font-bold","body-xs-medium":"text-[12px] font-medium","body-t-bold":"text-[10px] font-bold","body-t-medium":"text-[10px] font-medium","body-ss-medium":"text-[9px] font-medium"},getTypographyClasses=t=>o[t],d={primary:"text-
|
|
1
|
+
import t from"react";import e from"./utils.js";const o={h1:"text-[36px] font-fat",h2:"text-[32px] font-fat",h3:"text-[28px] font-fat",h4:"text-[24px] font-heavy",h5:"text-[22px] font-heavy",h6:"text-[20px] font-heavy","body-xl-heavy":"text-[20px] font-heavy","body-l-heavy":"text-[18px] font-heavy","body-l-bold":"text-[18px] font-bold","body-l-medium":"text-[18px] font-medium","body-m-heavy":"text-[16px] font-heavy","body-m-bold":"text-[16px] font-bold","body-m-medium":"text-[16px] font-medium","body-s-heavy":"text-[14px] font-heavy","body-s-bold":"text-[14px] font-bold","body-s-medium":"text-[14px] font-medium","body-ms-bold":"text-[13px] font-bold","body-ms-medium":"text-[13px] font-medium","body-xs-bold":"text-[12px] font-bold","body-xs-medium":"text-[12px] font-medium","body-t-bold":"text-[10px] font-bold","body-t-medium":"text-[10px] font-medium","body-ss-medium":"text-[9px] 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"},x=t.forwardRef(({variant:x="body-m-medium",color:a="inherit",as:m,className:n,children:r,...i},y)=>{const l=m||(t=>t.startsWith("h")?t.split("-")[0]:"p")(x);return t.createElement(l,{ref:y,className:e(o[x],d[a],"leading-[var(--leading-default)]",n),...i},r)});x.displayName="Typography";export{x as Typography,getTypographyClasses};
|
package/dist/types/Button.js
CHANGED
|
@@ -17,24 +17,24 @@ const defaultTextVariants = {
|
|
|
17
17
|
};
|
|
18
18
|
const variantClasses = {
|
|
19
19
|
primary: `
|
|
20
|
-
bg-
|
|
21
|
-
hover:bg-
|
|
22
|
-
disabled:bg-
|
|
20
|
+
bg-primary text-white
|
|
21
|
+
hover:bg-primary-dark
|
|
22
|
+
disabled:bg-neutral-light disabled:text-neutral-darker
|
|
23
23
|
`,
|
|
24
24
|
secondary: `
|
|
25
|
-
bg-
|
|
26
|
-
hover:bg-
|
|
27
|
-
disabled:bg-
|
|
25
|
+
bg-primary-lightest text-primary
|
|
26
|
+
hover:bg-primary-lighter
|
|
27
|
+
disabled:bg-neutral-light disabled:text-neutral-darker
|
|
28
28
|
`,
|
|
29
29
|
tertiary: `
|
|
30
|
-
bg-white border border-
|
|
31
|
-
hover:bg-
|
|
32
|
-
disabled:bg-
|
|
30
|
+
bg-white border border-primary-light text-primary
|
|
31
|
+
hover:bg-neutral-lighter
|
|
32
|
+
disabled:bg-neutral-light disabled:text-neutral-darker
|
|
33
33
|
`,
|
|
34
34
|
ghost: `
|
|
35
|
-
bg-transparent text-
|
|
36
|
-
hover:bg-
|
|
37
|
-
disabled:bg-
|
|
35
|
+
bg-transparent text-primary
|
|
36
|
+
hover:bg-primary-lightest
|
|
37
|
+
disabled:bg-neutral-light disabled:text-neutral-darker
|
|
38
38
|
`,
|
|
39
39
|
};
|
|
40
40
|
const Button = React.forwardRef(({ className, variant = 'primary', size = 'md', icon, iconPosition = 'right', children, loading = false, disabled, textVariant, ...props }, ref) => {
|
package/dist/types/Chips.js
CHANGED
|
@@ -20,39 +20,39 @@ const X = createLucideIcon("x", __iconNode);
|
|
|
20
20
|
|
|
21
21
|
const chipVariants = {
|
|
22
22
|
purple: {
|
|
23
|
-
background: 'bg-
|
|
24
|
-
text: 'text-
|
|
25
|
-
border: 'border-
|
|
23
|
+
background: 'bg-primary-lightest',
|
|
24
|
+
text: 'text-primary-darkest',
|
|
25
|
+
border: 'border-primary-light',
|
|
26
26
|
},
|
|
27
27
|
red: {
|
|
28
|
-
background: 'bg-
|
|
29
|
-
text: 'text-
|
|
28
|
+
background: 'bg-error-light',
|
|
29
|
+
text: 'text-error',
|
|
30
30
|
border: 'border-[#f0d6d6]',
|
|
31
31
|
},
|
|
32
32
|
green: {
|
|
33
|
-
background: 'bg-
|
|
34
|
-
text: 'text-
|
|
33
|
+
background: 'bg-success-light',
|
|
34
|
+
text: 'text-success',
|
|
35
35
|
border: 'border-[#d4e8dc]',
|
|
36
36
|
},
|
|
37
37
|
orange: {
|
|
38
|
-
background: 'bg-
|
|
39
|
-
text: 'text-
|
|
38
|
+
background: 'bg-warning-light',
|
|
39
|
+
text: 'text-warning',
|
|
40
40
|
border: 'border-[#f5e1d1]',
|
|
41
41
|
},
|
|
42
42
|
blue: {
|
|
43
|
-
background: 'bg-
|
|
44
|
-
text: 'text-
|
|
43
|
+
background: 'bg-info-light',
|
|
44
|
+
text: 'text-info',
|
|
45
45
|
border: 'border-[#d3e9f2]',
|
|
46
46
|
},
|
|
47
47
|
white: {
|
|
48
|
-
background: 'bg-
|
|
49
|
-
text: 'text-
|
|
50
|
-
border: 'border-
|
|
48
|
+
background: 'bg-white',
|
|
49
|
+
text: 'text-neutral-darker',
|
|
50
|
+
border: 'border-neutral-light',
|
|
51
51
|
},
|
|
52
52
|
disabled: {
|
|
53
|
-
background: 'bg-
|
|
54
|
-
text: 'text-
|
|
55
|
-
border: 'border-
|
|
53
|
+
background: 'bg-neutral-lighter',
|
|
54
|
+
text: 'text-neutral-main',
|
|
55
|
+
border: 'border-neutral-light',
|
|
56
56
|
},
|
|
57
57
|
};
|
|
58
58
|
const chipSizes = {
|
package/dist/types/Menu.js
CHANGED
|
@@ -78,9 +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-
|
|
81
|
+
'inline-flex items-center justify-center', 'bg-white border border-neutral-light', 'rounded-[6px] px-[16px] py-[13px]', 'transition-colors duration-200',
|
|
82
82
|
// Interactive states
|
|
83
|
-
'hover:bg-
|
|
83
|
+
'hover:bg-neutral-lighter', 'focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2',
|
|
84
84
|
// Disabled state
|
|
85
85
|
{
|
|
86
86
|
'opacity-50 cursor-not-allowed': disabled,
|
|
@@ -88,13 +88,13 @@ const Menu = React.forwardRef(({ buttonText, items, disabled = false, className,
|
|
|
88
88
|
});
|
|
89
89
|
const dropdownClasses = cn(
|
|
90
90
|
// Base dropdown styles
|
|
91
|
-
'absolute top-full left-0 right-0 z-10 mt-[4px]', 'bg-white border border-
|
|
91
|
+
'absolute top-full left-0 right-0 z-10 mt-[4px]', 'bg-white border border-neutral-light', 'rounded-[6px] py-[13px] px-[16px]', 'shadow-lg',
|
|
92
92
|
// Animation
|
|
93
93
|
'transition-all duration-200', {
|
|
94
94
|
'opacity-100 translate-y-0 pointer-events-auto': isOpen,
|
|
95
95
|
'opacity-0 -translate-y-2 pointer-events-none': !isOpen,
|
|
96
96
|
});
|
|
97
|
-
const itemClasses = cn('block w-full text-right', 'transition-colors duration-200', 'hover:bg-
|
|
97
|
+
const itemClasses = cn('block w-full text-right', 'transition-colors duration-200', 'hover:bg-neutral-lighter rounded-[4px] px-[8px] py-[4px] -mx-[8px]', 'focus:outline-none focus:bg-neutral-lighter');
|
|
98
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-[16px]", children: items.map((item) => {
|
|
99
99
|
const content = (jsx(Typography, { variant: "body-s-heavy", color: item.disabled ? 'neutral-main' : 'neutral-darker', className: "text-right", children: item.label }));
|
|
100
100
|
const commonProps = {
|
package/dist/types/Typography.js
CHANGED
|
@@ -33,12 +33,12 @@ const getTypographyClasses = (variant) => {
|
|
|
33
33
|
return variantClasses[variant];
|
|
34
34
|
};
|
|
35
35
|
const colorClasses = {
|
|
36
|
-
primary: 'text-
|
|
37
|
-
secondary: 'text-
|
|
38
|
-
'neutral-darker': 'text-
|
|
39
|
-
'neutral-dark': 'text-
|
|
40
|
-
'neutral-main': 'text-
|
|
41
|
-
white: 'text-
|
|
36
|
+
primary: 'text-primary',
|
|
37
|
+
secondary: 'text-secondary',
|
|
38
|
+
'neutral-darker': 'text-neutral-darker',
|
|
39
|
+
'neutral-dark': 'text-neutral-dark',
|
|
40
|
+
'neutral-main': 'text-neutral-main',
|
|
41
|
+
white: 'text-white',
|
|
42
42
|
inherit: 'text-inherit',
|
|
43
43
|
};
|
|
44
44
|
const getDefaultElement = (variant) => {
|