automoby-kit 1.0.50 → 1.0.51
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/Chips.js +1 -1
- package/dist/cjs/chunks/Chips-Ws80QAgh.js +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/esm/Chips.js +1 -1
- package/dist/esm/chunks/Chips-Dg1jNlMl.js +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/types/{Chips-C0k57uXa.js → Chips-DfvV08WT.js} +9 -9
- package/dist/types/Chips.js +1 -1
- package/dist/types/index.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/chunks/Chips-CJF5Mk_Y.js +0 -1
- package/dist/esm/chunks/Chips-BgI0ODyl.js +0 -1
package/dist/cjs/Chips.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("react/jsx-runtime"),require("./contexts.js"),require("./utils.js"),require("react");var e=require("./chunks/Chips-
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("react/jsx-runtime"),require("./contexts.js"),require("./utils.js"),require("react");var e=require("./chunks/Chips-Ws80QAgh.js");require("./chunks/createLucideIcon-BqJVOzoK.js"),exports.Chips=e.Chips,exports.default=e.Chips;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";var e=require("react/jsx-runtime"),r=require("../contexts.js"),t=require("../utils.js"),i=require("react");const o=require("./createLucideIcon-BqJVOzoK.js").createLucideIcon("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),n={purple:{background:"bg-primary-lightest",text:"text-primary-darkest",border:"border-primary-light"},red:{background:"bg-error-light",text:"text-error",border:"border-error-light"},green:{background:"bg-success-light",text:"text-success",border:"border-success-light"},orange:{background:"bg-warning-light",text:"text-warning",border:"border-warning-light"},blue:{background:"bg-info-light",text:"text-info",border:"border-info-light"},white:{background:"bg-white",text:"text-neutral-darker",border:"border-neutral-light"},disabled:{background:"bg-neutral-lighter",text:"text-neutral-main",border:"border-neutral-light"}},a={mobile:{padding:"px-2.5 py-1",gap:"gap-1",iconSize:"w-4 h-4",fontSize:"text-xs",lineHeight:"leading-normal"},desktop:{padding:"px-3 py-1",gap:"gap-1.5",iconSize:"w-5 h-5",fontSize:"text-s",lineHeight:"leading-6"}},l=i.forwardRef(({variant:i="purple",size:l,children:s="متن پیشفرض",disabled:d=!1,onClick:c,onIconClick:b,className:u,isMobile:g,showIcon:p=!0,startIcon:x,...h},f)=>{const k=r.useMobile(),y=n[d?"disabled":i],m=a[l||(g??k?"mobile":"desktop")],handleIconClick=e=>{e.stopPropagation(),b&&b()};return e.jsxs("div",{ref:f,className:t("relative rounded-full border border-solid inline-flex","flex-row items-center justify-center","font-sans font-bold not-italic","text-nowrap text-right","transition-all duration-200",y.background,y.text,y.border,m.padding,m.gap,m.fontSize,m.lineHeight,c&&!d&&"cursor-pointer hover:opacity-80",d&&"cursor-not-allowed opacity-60",u),onClick:d?void 0:c,onKeyDown:c&&!d?e=>{"Enter"!==e.key&&" "!==e.key||!c||d||(e.preventDefault(),c())}:void 0,tabIndex:c&&!d?0:void 0,role:c?"button":void 0,...h,children:[x?e.jsx("span",{className:t("flex items-center justify-center",m.iconSize),children:x}):null,e.jsx("span",{className:"text-center",children:s}),(()=>{if(!p)return null;const r=e.jsx(o,{className:t(m.iconSize)});return b?e.jsx("button",{type:"button",onClick:handleIconClick,disabled:d,className:t("flex items-center justify-center","hover:opacity-70 transition-opacity",d&&"cursor-not-allowed opacity-50"),"aria-label":"حذف",children:r}):r})()]})});l.displayName="Chips",exports.Chips=l,exports.X=o;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./Typography.js"),r=require("./Button.js"),s=require("./Input.js"),o=require("./Tabs.js"),a=require("./Drawer.js"),i=require("./Backdrop.js"),t=require("./Breadcrumb.js"),l=require("./Pagination.js"),n=require("./Accordion.js"),c=require("./Divider.js"),d=require("./RadioGroup.js"),u=require("./chunks/Chips-
|
|
1
|
+
"use strict";var e=require("./Typography.js"),r=require("./Button.js"),s=require("./Input.js"),o=require("./Tabs.js"),a=require("./Drawer.js"),i=require("./Backdrop.js"),t=require("./Breadcrumb.js"),l=require("./Pagination.js"),n=require("./Accordion.js"),c=require("./Divider.js"),d=require("./RadioGroup.js"),u=require("./chunks/Chips-Ws80QAgh.js"),x=require("./Menu.js"),p=require("react/jsx-runtime"),b=require("react"),m=require("./utils.js"),h=require("./contexts.js");require("react-dom"),require("./chunks/chevron-left-Do__K6cA.js"),require("./chunks/createLucideIcon-BqJVOzoK.js");const j=b.forwardRef(({isOpen:e=!1,onClose:r,title:s,content:o,buttons:a,showCloseButton:t=!0,size:l="md",className:n,children:c},d)=>{const handleClose=()=>{r&&r()},x=m("bg-white rounded-[10px] shadow-lg mx-4 w-full",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl"}[l],n);return p.jsx(i.Backdrop,{isOpen:e,onClick:handleClose,blur:!0,children:p.jsx("div",{ref:d,className:x,onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Escape"===e.key&&r&&r()},role:"dialog","aria-modal":"true","aria-labelledby":s?"dialog-title":void 0,children:p.jsxs("div",{className:"flex flex-col p-6 gap-8",children:[s&&p.jsx("div",{className:"flex flex-col gap-2.5",children:p.jsx("div",{className:"flex items-center justify-between pb-4 border-b border-[#ebeaf0]",children:p.jsxs("div",{className:"flex items-center justify-between gap-3 w-full flex-row-reverse",children:[p.jsx("div",{className:"text-[#590d8b] text-xl font-extrabold leading-8",children:s}),t&&p.jsx("button",{type:"button",onClick:handleClose,className:"p-1 rounded-full hover:bg-gray-100 transition-colors","aria-label":"Close dialog",children:p.jsx(u.X,{className:"w-6 h-6 text-[#a4a2bb]"})})]})})}),o&&p.jsx("div",{className:"flex flex-col gap-4",children:o}),c&&!o&&p.jsx("div",{className:"flex flex-col gap-4",children:c}),a&&p.jsx("div",{className:"flex flex-col gap-1.5",children:a})]})})})});j.displayName="Dialog";const g=b.forwardRef(({variant:e="primary",icon:r,children:s,className:o,...a},i)=>{const t=m("h-14 px-4 py-[13px] rounded-md font-bold text-base leading-[1.8] flex items-center justify-center gap-2 transition-colors",{"bg-[#590d8b] text-white hover:bg-[#4a0a75]":"primary"===e,"bg-white text-[#1a1922] border border-[#ebeaf0] hover:bg-gray-50":"secondary"===e},o);return p.jsxs("button",{type:"button",ref:i,className:t,...a,children:[s,r&&p.jsx("span",{className:"w-5 h-5",children:r})]})});g.displayName="DialogButton";const f=e.Typography,v=r.Button,w=s.Input,y=o.Tabs,q=a.Drawer,N=i.Backdrop,B=t.Breadcrumb,k=l.Pagination,D=n.Accordion,C=c.Divider,T=d.RadioGroup,M=u.Chips,P=x.Menu;exports.MobileProvider=h.MobileProvider,exports.useMobile=h.useMobile,exports.useTablet=h.useTablet,exports.Accordion=D,exports.Backdrop=N,exports.Breadcrumb=B,exports.Button=v,exports.Chips=M,exports.Dialog=j,exports.DialogButton=g,exports.Divider=C,exports.Drawer=q,exports.Input=w,exports.Menu=P,exports.Pagination=k,exports.RadioGroup=T,exports.Tabs=y,exports.Typography=f;
|
package/dist/esm/Chips.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import"react/jsx-runtime";import"./contexts.js";import"./utils.js";import"react";export{C as Chips,C as default}from"./chunks/Chips-
|
|
1
|
+
"use client";import"react/jsx-runtime";import"./contexts.js";import"./utils.js";import"react";export{C as Chips,C as default}from"./chunks/Chips-Dg1jNlMl.js";import"./chunks/createLucideIcon-DGp0SoUT.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useMobile as r}from"../contexts.js";import i from"../utils.js";import{forwardRef as o}from"react";import{c as n}from"./createLucideIcon-DGp0SoUT.js";const a=n("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),l={purple:{background:"bg-primary-lightest",text:"text-primary-darkest",border:"border-primary-light"},red:{background:"bg-error-light",text:"text-error",border:"border-error-light"},green:{background:"bg-success-light",text:"text-success",border:"border-success-light"},orange:{background:"bg-warning-light",text:"text-warning",border:"border-warning-light"},blue:{background:"bg-info-light",text:"text-info",border:"border-info-light"},white:{background:"bg-white",text:"text-neutral-darker",border:"border-neutral-light"},disabled:{background:"bg-neutral-lighter",text:"text-neutral-main",border:"border-neutral-light"}},d={mobile:{padding:"px-2.5 py-1",gap:"gap-1",iconSize:"w-4 h-4",fontSize:"text-xs",lineHeight:"leading-normal"},desktop:{padding:"px-3 py-1",gap:"gap-1.5",iconSize:"w-5 h-5",fontSize:"text-s",lineHeight:"leading-6"}},s=o(({variant:o="purple",size:n,children:s="متن پیشفرض",disabled:c=!1,onClick:b,onIconClick:g,className:p,isMobile:u,showIcon:h=!0,startIcon:x,...m},f)=>{const k=r(),y=l[c?"disabled":o],w=d[n||(u??k?"mobile":"desktop")],handleIconClick=e=>{e.stopPropagation(),g&&g()};return e("div",{ref:f,className:i("relative rounded-full border border-solid inline-flex","flex-row items-center justify-center","font-sans font-bold not-italic","text-nowrap text-right","transition-all duration-200",y.background,y.text,y.border,w.padding,w.gap,w.fontSize,w.lineHeight,b&&!c&&"cursor-pointer hover:opacity-80",c&&"cursor-not-allowed opacity-60",p),onClick:c?void 0:b,onKeyDown:b&&!c?e=>{"Enter"!==e.key&&" "!==e.key||!b||c||(e.preventDefault(),b())}:void 0,tabIndex:b&&!c?0:void 0,role:b?"button":void 0,...m,children:[x?t("span",{className:i("flex items-center justify-center",w.iconSize),children:x}):null,t("span",{className:"text-center",children:s}),(()=>{if(!h)return null;const e=t(a,{className:i(w.iconSize)});return g?t("button",{type:"button",onClick:handleIconClick,disabled:c,className:i("flex items-center justify-center","hover:opacity-70 transition-opacity",c&&"cursor-not-allowed opacity-50"),"aria-label":"حذف",children:e}):e})()]})});s.displayName="Chips";export{s as C,a as X};
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Typography as e}from"./Typography.js";import{Button as r}from"./Button.js";import{Input as o}from"./Input.js";import{Tabs as a}from"./Tabs.js";import{Drawer as t}from"./Drawer.js";import{Backdrop as s}from"./Backdrop.js";import{Breadcrumb as i}from"./Breadcrumb.js";import{Pagination as l}from"./Pagination.js";import{Accordion as n}from"./Accordion.js";import{Divider as m}from"./Divider.js";import{RadioGroup as c}from"./RadioGroup.js";import{X as d,C as p}from"./chunks/Chips-
|
|
1
|
+
import{Typography as e}from"./Typography.js";import{Button as r}from"./Button.js";import{Input as o}from"./Input.js";import{Tabs as a}from"./Tabs.js";import{Drawer as t}from"./Drawer.js";import{Backdrop as s}from"./Backdrop.js";import{Breadcrumb as i}from"./Breadcrumb.js";import{Pagination as l}from"./Pagination.js";import{Accordion as n}from"./Accordion.js";import{Divider as m}from"./Divider.js";import{RadioGroup as c}from"./RadioGroup.js";import{X as d,C as p}from"./chunks/Chips-Dg1jNlMl.js";import{Menu as f}from"./Menu.js";import{jsx as b,jsxs as u}from"react/jsx-runtime";import x from"react";import h from"./utils.js";export{MobileProvider,useMobile,useTablet}from"./contexts.js";import"react-dom";import"./chunks/chevron-left-4HSuTes3.js";import"./chunks/createLucideIcon-DGp0SoUT.js";const g=x.forwardRef(({isOpen:e=!1,onClose:r,title:o,content:a,buttons:t,showCloseButton:i=!0,size:l="md",className:n,children:m},c)=>{const handleClose=()=>{r&&r()},p=h("bg-white rounded-[10px] shadow-lg mx-4 w-full",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl"}[l],n);return b(s,{isOpen:e,onClick:handleClose,blur:!0,children:b("div",{ref:c,className:p,onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Escape"===e.key&&r&&r()},role:"dialog","aria-modal":"true","aria-labelledby":o?"dialog-title":void 0,children:u("div",{className:"flex flex-col p-6 gap-8",children:[o&&b("div",{className:"flex flex-col gap-2.5",children:b("div",{className:"flex items-center justify-between pb-4 border-b border-[#ebeaf0]",children:u("div",{className:"flex items-center justify-between gap-3 w-full flex-row-reverse",children:[b("div",{className:"text-[#590d8b] text-xl font-extrabold leading-8",children:o}),i&&b("button",{type:"button",onClick:handleClose,className:"p-1 rounded-full hover:bg-gray-100 transition-colors","aria-label":"Close dialog",children:b(d,{className:"w-6 h-6 text-[#a4a2bb]"})})]})})}),a&&b("div",{className:"flex flex-col gap-4",children:a}),m&&!a&&b("div",{className:"flex flex-col gap-4",children:m}),t&&b("div",{className:"flex flex-col gap-1.5",children:t})]})})})});g.displayName="Dialog";const j=x.forwardRef(({variant:e="primary",icon:r,children:o,className:a,...t},s)=>{const i=h("h-14 px-4 py-[13px] rounded-md font-bold text-base leading-[1.8] flex items-center justify-center gap-2 transition-colors",{"bg-[#590d8b] text-white hover:bg-[#4a0a75]":"primary"===e,"bg-white text-[#1a1922] border border-[#ebeaf0] hover:bg-gray-50":"secondary"===e},a);return u("button",{type:"button",ref:s,className:i,...t,children:[o,r&&b("span",{className:"w-5 h-5",children:r})]})});j.displayName="DialogButton";const w=e,y=r,v=o,N=a,k=t,B=s,C=i,D=l,T=n,M=m,P=c,R=p,I=f;export{T as Accordion,B as Backdrop,C as Breadcrumb,y as Button,R as Chips,g as Dialog,j as DialogButton,M as Divider,k as Drawer,v as Input,I as Menu,D as Pagination,P as RadioGroup,N as Tabs,w as Typography};
|
|
@@ -27,22 +27,22 @@ const chipVariants = {
|
|
|
27
27
|
red: {
|
|
28
28
|
background: 'bg-error-light',
|
|
29
29
|
text: 'text-error',
|
|
30
|
-
border: 'border-
|
|
30
|
+
border: 'border-error-light',
|
|
31
31
|
},
|
|
32
32
|
green: {
|
|
33
33
|
background: 'bg-success-light',
|
|
34
34
|
text: 'text-success',
|
|
35
|
-
border: 'border-
|
|
35
|
+
border: 'border-success-light',
|
|
36
36
|
},
|
|
37
37
|
orange: {
|
|
38
38
|
background: 'bg-warning-light',
|
|
39
39
|
text: 'text-warning',
|
|
40
|
-
border: 'border-
|
|
40
|
+
border: 'border-warning-light',
|
|
41
41
|
},
|
|
42
42
|
blue: {
|
|
43
43
|
background: 'bg-info-light',
|
|
44
44
|
text: 'text-info',
|
|
45
|
-
border: 'border-
|
|
45
|
+
border: 'border-info-light',
|
|
46
46
|
},
|
|
47
47
|
white: {
|
|
48
48
|
background: 'bg-white',
|
|
@@ -59,16 +59,16 @@ const chipSizes = {
|
|
|
59
59
|
mobile: {
|
|
60
60
|
padding: 'px-2.5 py-1',
|
|
61
61
|
gap: 'gap-1',
|
|
62
|
-
iconSize: '
|
|
62
|
+
iconSize: 'w-4 h-4',
|
|
63
63
|
fontSize: 'text-xs',
|
|
64
|
-
lineHeight: 'leading-
|
|
64
|
+
lineHeight: 'leading-normal',
|
|
65
65
|
},
|
|
66
66
|
desktop: {
|
|
67
67
|
padding: 'px-3 py-1',
|
|
68
68
|
gap: 'gap-1.5',
|
|
69
|
-
iconSize: '
|
|
69
|
+
iconSize: 'w-5 h-5',
|
|
70
70
|
fontSize: 'text-s',
|
|
71
|
-
lineHeight: 'leading-
|
|
71
|
+
lineHeight: 'leading-6',
|
|
72
72
|
},
|
|
73
73
|
};
|
|
74
74
|
const Chips = forwardRef(({ variant = 'purple', size, children = 'متن پیشفرض', disabled = false, onClick, onIconClick, className, isMobile, showIcon = true, startIcon, ...props }, ref) => {
|
|
@@ -106,7 +106,7 @@ const Chips = forwardRef(({ variant = 'purple', size, children = 'متن پیش
|
|
|
106
106
|
};
|
|
107
107
|
return (jsxs("div", { ref: ref, className: cn(
|
|
108
108
|
// Base styles
|
|
109
|
-
'relative rounded-
|
|
109
|
+
'relative rounded-full border border-solid inline-flex', 'flex-row items-center justify-center', 'font-sans font-bold not-italic', 'text-nowrap text-right', 'transition-all duration-200',
|
|
110
110
|
// Variant styles
|
|
111
111
|
variantStyles.background, variantStyles.text, variantStyles.border,
|
|
112
112
|
// Size styles
|
package/dist/types/Chips.js
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { Pagination as Pagination$1 } from './Pagination.js';
|
|
|
9
9
|
import { Accordion as Accordion$1 } from './Accordion.js';
|
|
10
10
|
import { Divider as Divider$1 } from './Divider.js';
|
|
11
11
|
import { RadioGroup as RadioGroup$1 } from './RadioGroup.js';
|
|
12
|
-
import { X, C as Chips$1 } from './Chips-
|
|
12
|
+
import { X, C as Chips$1 } from './Chips-DfvV08WT.js';
|
|
13
13
|
import { Menu as Menu$1 } from './Menu.js';
|
|
14
14
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
15
15
|
import React from 'react';
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";"use strict";var e=require("react/jsx-runtime"),t=require("../contexts.js"),r=require("../utils.js"),i=require("react");const o=require("./createLucideIcon-BqJVOzoK.js").createLucideIcon("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),n={purple:{background:"bg-primary-lightest",text:"text-primary-darkest",border:"border-primary-light"},red:{background:"bg-error-light",text:"text-error",border:"border-[#f0d6d6]"},green:{background:"bg-success-light",text:"text-success",border:"border-[#d4e8dc]"},orange:{background:"bg-warning-light",text:"text-warning",border:"border-[#f5e1d1]"},blue:{background:"bg-info-light",text:"text-info",border:"border-[#d3e9f2]"},white:{background:"bg-white",text:"text-neutral-darker",border:"border-neutral-light"},disabled:{background:"bg-neutral-lighter",text:"text-neutral-main",border:"border-neutral-light"}},a={mobile:{padding:"px-2.5 py-1",gap:"gap-1",iconSize:"size-4",fontSize:"text-xs",lineHeight:"leading-[1.8]"},desktop:{padding:"px-3 py-1",gap:"gap-1.5",iconSize:"size-5",fontSize:"text-s",lineHeight:"leading-[24px]"}},d=i.forwardRef(({variant:i="purple",size:d,children:s="متن پیشفرض",disabled:l=!1,onClick:c,onIconClick:b,className:u,isMobile:g,showIcon:p=!0,startIcon:x,...h},f)=>{const k=t.useMobile(),y=n[l?"disabled":i],m=a[d||(g??k?"mobile":"desktop")],handleIconClick=e=>{e.stopPropagation(),b&&b()};return e.jsxs("div",{ref:f,className:r("relative rounded-[50px] border border-solid inline-flex","flex-row items-center justify-center","font-sans font-bold not-italic","text-nowrap text-right","transition-all duration-200",y.background,y.text,y.border,m.padding,m.gap,m.fontSize,m.lineHeight,c&&!l&&"cursor-pointer hover:opacity-80",l&&"cursor-not-allowed opacity-60",u),onClick:l?void 0:c,onKeyDown:c&&!l?e=>{"Enter"!==e.key&&" "!==e.key||!c||l||(e.preventDefault(),c())}:void 0,tabIndex:c&&!l?0:void 0,role:c?"button":void 0,...h,children:[x?e.jsx("span",{className:r("flex items-center justify-center",m.iconSize),children:x}):null,e.jsx("span",{className:"text-center",children:s}),(()=>{if(!p)return null;const t=e.jsx(o,{className:r(m.iconSize)});return b?e.jsx("button",{type:"button",onClick:handleIconClick,disabled:l,className:r("flex items-center justify-center","hover:opacity-70 transition-opacity",l&&"cursor-not-allowed opacity-50"),"aria-label":"حذف",children:t}):t})()]})});d.displayName="Chips",exports.Chips=d,exports.X=o;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useMobile as r}from"../contexts.js";import i from"../utils.js";import{forwardRef as o}from"react";import{c as n}from"./createLucideIcon-DGp0SoUT.js";const a=n("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),d={purple:{background:"bg-primary-lightest",text:"text-primary-darkest",border:"border-primary-light"},red:{background:"bg-error-light",text:"text-error",border:"border-[#f0d6d6]"},green:{background:"bg-success-light",text:"text-success",border:"border-[#d4e8dc]"},orange:{background:"bg-warning-light",text:"text-warning",border:"border-[#f5e1d1]"},blue:{background:"bg-info-light",text:"text-info",border:"border-[#d3e9f2]"},white:{background:"bg-white",text:"text-neutral-darker",border:"border-neutral-light"},disabled:{background:"bg-neutral-lighter",text:"text-neutral-main",border:"border-neutral-light"}},l={mobile:{padding:"px-2.5 py-1",gap:"gap-1",iconSize:"size-4",fontSize:"text-xs",lineHeight:"leading-[1.8]"},desktop:{padding:"px-3 py-1",gap:"gap-1.5",iconSize:"size-5",fontSize:"text-s",lineHeight:"leading-[24px]"}},s=o(({variant:o="purple",size:n,children:s="متن پیشفرض",disabled:c=!1,onClick:b,onIconClick:p,className:g,isMobile:u,showIcon:x=!0,startIcon:m,...f},h)=>{const k=r(),y=d[c?"disabled":o],v=l[n||(u??k?"mobile":"desktop")],handleIconClick=e=>{e.stopPropagation(),p&&p()};return e("div",{ref:h,className:i("relative rounded-[50px] border border-solid inline-flex","flex-row items-center justify-center","font-sans font-bold not-italic","text-nowrap text-right","transition-all duration-200",y.background,y.text,y.border,v.padding,v.gap,v.fontSize,v.lineHeight,b&&!c&&"cursor-pointer hover:opacity-80",c&&"cursor-not-allowed opacity-60",g),onClick:c?void 0:b,onKeyDown:b&&!c?e=>{"Enter"!==e.key&&" "!==e.key||!b||c||(e.preventDefault(),b())}:void 0,tabIndex:b&&!c?0:void 0,role:b?"button":void 0,...f,children:[m?t("span",{className:i("flex items-center justify-center",v.iconSize),children:m}):null,t("span",{className:"text-center",children:s}),(()=>{if(!x)return null;const e=t(a,{className:i(v.iconSize)});return p?t("button",{type:"button",onClick:handleIconClick,disabled:c,className:i("flex items-center justify-center","hover:opacity-70 transition-opacity",c&&"cursor-not-allowed opacity-50"),"aria-label":"حذف",children:e}):e})()]})});s.displayName="Chips";export{s as C,a as X};
|