automoby-kit 1.0.21 → 1.0.23
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/Backdrop.js +1 -1
- package/dist/cjs/Chips.js +1 -1
- package/dist/cjs/RadioGroup.js +1 -1
- package/dist/cjs/Tabs.js +1 -1
- package/dist/cjs/Typography.js +1 -1
- package/dist/esm/Backdrop.js +1 -1
- package/dist/esm/Chips.js +1 -1
- package/dist/esm/RadioGroup.js +1 -1
- package/dist/esm/Tabs.js +1 -1
- package/dist/esm/Typography.js +1 -1
- package/dist/types/Backdrop.js +7 -5
- package/dist/types/Chips.js +2 -2
- package/dist/types/RadioGroup.js +1 -3
- package/dist/types/Tabs.js +2 -4
- package/dist/types/Typography.js +23 -23
- package/dist/types/components/Backdrop/Backdrop.d.ts +1 -0
- package/dist/types/components/Backdrop/Backdrop.stories.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/Backdrop.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var r=require("react/jsx-runtime"),e=require("react"),s=require("./utils.js");const i=e.forwardRef(({isOpen:e=!1,onClick:i,blur:a=!1,zIndex:n=51,className:t,children:l,visibleChildren:c,...o},d)=>{const u=s("fixed inset-0 transition-all duration-300",{"backdrop-blur-sm":a},t),p={backgroundColor:"rgba(0, 0, 0, 0.60)",zIndex:n};return r.jsxs(r.Fragment,{children:[c,e&&r.jsxs("div",{ref:d,className:u,style:p,onClick:r=>{i&&r.target===r.currentTarget&&i()},role:"presentation",...o,children:[c,l]})]})});i.displayName="Backdrop",exports.Backdrop=i;
|
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-
|
|
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;
|
package/dist/cjs/RadioGroup.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";var e=require("react/jsx-runtime"),r=require("react"),i=require("./utils.js"),s=require("./contexts.js");const RadioButton=({selected:r,disabled:s,isMobile:a})=>{const l=a?"size-5":"size-6";return r?e.jsxs("div",{className:i("relative flex items-center justify-center",l),children:[e.jsx("div",{className:i("absolute inset-0 rounded-full border-2",s?"bg-neutral-light border-neutral-light":"bg-primary border-primary")}),e.jsx("div",{className:i("absolute rounded-full bg-white",a?"inset-[5px]":"inset-1.5")})]}):e.jsx("div",{className:i("relative flex items-center justify-center",l),children:e.jsx("div",{className:i("absolute inset-0 rounded-full border",a?"border":"border-[1.5px]",s?"border-neutral-light":"border-midnight")})})},RadioOptionComponent=({option:s,selected:a,disabled:l,onClick:t,name:n,isMobile:d=!1})=>{const[o,c]=r.useState(!1),getTextColor=()=>l?"text-midnight":a?"text-primary":"text-neutral-dark";return e.jsx("div",{className:i("relative rounded-lg border-[1.5px] cursor-pointer transition-all duration-200",l?"bg-neutral-lighter":a?"bg-primary-lightest":o?"bg-primary-lightest/20":"bg-white",a?"border-primary":"border-transparent",l?"":"shadow-[0px_2px_4px_0px_rgba(0,0,0,0.08)]",l&&"cursor-not-allowed"),onClick:l?void 0:t,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||l||(e.preventDefault(),t())},tabIndex:l?-1:0,role:"radio","aria-checked":a,"aria-disabled":l,children:e.jsx("div",{className:"flex flex-row items-center justify-end relative w-full",children:e.jsx("div",{className:i("box-border flex flex-row items-center justify-end relative w-full",d?"gap-2 px-4 py-3":"gap-4 px-6 py-4"),children:e.jsxs("div",{className:i("flex flex-row items-center justify-end p-0 relative shrink-0",d?"gap-2":"gap-3"),children:[e.jsx("input",{type:"radio",name:n,value:s.id,checked:a,disabled:l,onChange:t,className:"sr-only","aria-label":s.label}),e.jsx("div",{className:"flex flex-col gap-0.5 items-end justify-start p-0 relative shrink-0",children:e.jsx("div",{className:i("font-sans font-bold text-nowrap text-right transition-colors duration-200",d?"text-
|
|
1
|
+
"use client";"use strict";var e=require("react/jsx-runtime"),r=require("react"),i=require("./utils.js"),s=require("./contexts.js");const RadioButton=({selected:r,disabled:s,isMobile:a})=>{const l=a?"size-5":"size-6";return r?e.jsxs("div",{className:i("relative flex items-center justify-center",l),children:[e.jsx("div",{className:i("absolute inset-0 rounded-full border-2",s?"bg-neutral-light border-neutral-light":"bg-primary border-primary")}),e.jsx("div",{className:i("absolute rounded-full bg-white",a?"inset-[5px]":"inset-1.5")})]}):e.jsx("div",{className:i("relative flex items-center justify-center",l),children:e.jsx("div",{className:i("absolute inset-0 rounded-full border",a?"border":"border-[1.5px]",s?"border-neutral-light":"border-midnight")})})},RadioOptionComponent=({option:s,selected:a,disabled:l,onClick:t,name:n,isMobile:d=!1})=>{const[o,c]=r.useState(!1),getTextColor=()=>l?"text-midnight":a?"text-primary":"text-neutral-dark";return e.jsx("div",{className:i("relative rounded-lg border-[1.5px] cursor-pointer transition-all duration-200",l?"bg-neutral-lighter":a?"bg-primary-lightest":o?"bg-primary-lightest/20":"bg-white",a?"border-primary":"border-transparent",l?"":"shadow-[0px_2px_4px_0px_rgba(0,0,0,0.08)]",l&&"cursor-not-allowed"),onClick:l?void 0:t,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||l||(e.preventDefault(),t())},tabIndex:l?-1:0,role:"radio","aria-checked":a,"aria-disabled":l,children:e.jsx("div",{className:"flex flex-row items-center justify-end relative w-full",children:e.jsx("div",{className:i("box-border flex flex-row items-center justify-end relative w-full",d?"gap-2 px-4 py-3":"gap-4 px-6 py-4"),children:e.jsxs("div",{className:i("flex flex-row items-center justify-end p-0 relative shrink-0",d?"gap-2":"gap-3"),children:[e.jsx("input",{type:"radio",name:n,value:s.id,checked:a,disabled:l,onChange:t,className:"sr-only","aria-label":s.label}),e.jsx("div",{className:"flex flex-col gap-0.5 items-end justify-start p-0 relative shrink-0",children:e.jsx("div",{className:i("font-sans font-bold text-nowrap text-right transition-colors duration-200",d?"text-s leading-[24px]":"text-m leading-normal",getTextColor()),children:e.jsx("p",{className:"whitespace-pre",dir:"auto",children:s.label})})}),s.icon&&e.jsx("div",{className:i("flex items-center justify-center shrink-0 transition-colors duration-200",d?"size-6":"size-7",getTextColor()),children:s.icon}),e.jsx("div",{className:"flex flex-col items-start justify-start p-0 relative shrink-0",children:e.jsx(RadioButton,{selected:a,disabled:l,isMobile:d})})]})})})})},a=r.forwardRef(({options:r,value:a,onChange:l,name:t,disabled:n=!1,className:d,isMobile:o,direction:c="vertical",...x},u)=>{const p=s.useMobile(),b=o??p;return e.jsx("div",{ref:u,className:"horizontal"===c?i("flex flex-row gap-2",b?"flex-wrap":"flex-nowrap",d):i("flex flex-col gap-2",d),role:"radiogroup",...x,children:r.map(r=>e.jsx(RadioOptionComponent,{option:r,selected:a===r.id,disabled:n||r.disabled,onClick:()=>{return e=r.id,void(!n&&l&&l(e));var e},name:t,isMobile:b},r.id))})});a.displayName="RadioGroup",exports.RadioGroup=a;
|
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-
|
|
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;
|
package/dist/cjs/Typography.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t=require("react"),e=require("./utils.js");const o={h1:"text-
|
|
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];
|
package/dist/esm/Backdrop.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsxs as r,Fragment as e}from"react/jsx-runtime";import i from"react";import t from"./utils.js";const n=i.forwardRef(({isOpen:i=!1,onClick:n,blur:o=!1,zIndex:a=51,className:l,children:s,visibleChildren:c,...d},m)=>{const p=t("fixed inset-0 transition-all duration-300",{"backdrop-blur-sm":o},l);return r(e,{children:[c,i&&r("div",{ref:m,className:p,style:{backgroundColor:"rgba(0, 0, 0, 0.60)",zIndex:a},onClick:r=>{n&&r.target===r.currentTarget&&n()},role:"presentation",...d,children:[c,s]})]})});n.displayName="Backdrop";export{n as Backdrop};
|
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-
|
|
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};
|
package/dist/esm/RadioGroup.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import i from"react";import t from"./utils.js";import{useMobile as l}from"./contexts.js";const RadioButton=({selected:i,disabled:l,isMobile:a})=>{const s=a?"size-5":"size-6";return i?r("div",{className:t("relative flex items-center justify-center",s),children:[e("div",{className:t("absolute inset-0 rounded-full border-2",l?"bg-neutral-light border-neutral-light":"bg-primary border-primary")}),e("div",{className:t("absolute rounded-full bg-white",a?"inset-[5px]":"inset-1.5")})]}):e("div",{className:t("relative flex items-center justify-center",s),children:e("div",{className:t("absolute inset-0 rounded-full border",a?"border":"border-[1.5px]",l?"border-neutral-light":"border-midnight")})})},RadioOptionComponent=({option:l,selected:a,disabled:s,onClick:n,name:o,isMobile:d=!1})=>{const[c,p]=i.useState(!1),getTextColor=()=>s?"text-midnight":a?"text-primary":"text-neutral-dark";return e("div",{className:t("relative rounded-lg border-[1.5px] cursor-pointer transition-all duration-200",s?"bg-neutral-lighter":a?"bg-primary-lightest":c?"bg-primary-lightest/20":"bg-white",a?"border-primary":"border-transparent",s?"":"shadow-[0px_2px_4px_0px_rgba(0,0,0,0.08)]",s&&"cursor-not-allowed"),onClick:s?void 0:n,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||s||(e.preventDefault(),n())},tabIndex:s?-1:0,role:"radio","aria-checked":a,"aria-disabled":s,children:e("div",{className:"flex flex-row items-center justify-end relative w-full",children:e("div",{className:t("box-border flex flex-row items-center justify-end relative w-full",d?"gap-2 px-4 py-3":"gap-4 px-6 py-4"),children:r("div",{className:t("flex flex-row items-center justify-end p-0 relative shrink-0",d?"gap-2":"gap-3"),children:[e("input",{type:"radio",name:o,value:l.id,checked:a,disabled:s,onChange:n,className:"sr-only","aria-label":l.label}),e("div",{className:"flex flex-col gap-0.5 items-end justify-start p-0 relative shrink-0",children:e("div",{className:t("font-sans font-bold text-nowrap text-right transition-colors duration-200",d?"text-
|
|
1
|
+
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import i from"react";import t from"./utils.js";import{useMobile as l}from"./contexts.js";const RadioButton=({selected:i,disabled:l,isMobile:a})=>{const s=a?"size-5":"size-6";return i?r("div",{className:t("relative flex items-center justify-center",s),children:[e("div",{className:t("absolute inset-0 rounded-full border-2",l?"bg-neutral-light border-neutral-light":"bg-primary border-primary")}),e("div",{className:t("absolute rounded-full bg-white",a?"inset-[5px]":"inset-1.5")})]}):e("div",{className:t("relative flex items-center justify-center",s),children:e("div",{className:t("absolute inset-0 rounded-full border",a?"border":"border-[1.5px]",l?"border-neutral-light":"border-midnight")})})},RadioOptionComponent=({option:l,selected:a,disabled:s,onClick:n,name:o,isMobile:d=!1})=>{const[c,p]=i.useState(!1),getTextColor=()=>s?"text-midnight":a?"text-primary":"text-neutral-dark";return e("div",{className:t("relative rounded-lg border-[1.5px] cursor-pointer transition-all duration-200",s?"bg-neutral-lighter":a?"bg-primary-lightest":c?"bg-primary-lightest/20":"bg-white",a?"border-primary":"border-transparent",s?"":"shadow-[0px_2px_4px_0px_rgba(0,0,0,0.08)]",s&&"cursor-not-allowed"),onClick:s?void 0:n,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||s||(e.preventDefault(),n())},tabIndex:s?-1:0,role:"radio","aria-checked":a,"aria-disabled":s,children:e("div",{className:"flex flex-row items-center justify-end relative w-full",children:e("div",{className:t("box-border flex flex-row items-center justify-end relative w-full",d?"gap-2 px-4 py-3":"gap-4 px-6 py-4"),children:r("div",{className:t("flex flex-row items-center justify-end p-0 relative shrink-0",d?"gap-2":"gap-3"),children:[e("input",{type:"radio",name:o,value:l.id,checked:a,disabled:s,onChange:n,className:"sr-only","aria-label":l.label}),e("div",{className:"flex flex-col gap-0.5 items-end justify-start p-0 relative shrink-0",children:e("div",{className:t("font-sans font-bold text-nowrap text-right transition-colors duration-200",d?"text-s leading-[24px]":"text-m leading-normal",getTextColor()),children:e("p",{className:"whitespace-pre",dir:"auto",children:l.label})})}),l.icon&&e("div",{className:t("flex items-center justify-center shrink-0 transition-colors duration-200",d?"size-6":"size-7",getTextColor()),children:l.icon}),e("div",{className:"flex flex-col items-start justify-start p-0 relative shrink-0",children:e(RadioButton,{selected:a,disabled:s,isMobile:d})})]})})})})},a=i.forwardRef(({options:r,value:i,onChange:a,name:s,disabled:n=!1,className:o,isMobile:d,direction:c="vertical",...p},m)=>{const u=l(),b=d??u;return e("div",{ref:m,className:"horizontal"===c?t("flex flex-row gap-2",b?"flex-wrap":"flex-nowrap",o):t("flex flex-col gap-2",o),role:"radiogroup",...p,children:r.map(r=>e(RadioOptionComponent,{option:r,selected:i===r.id,disabled:n||r.disabled,onClick:()=>{return e=r.id,void(!n&&a&&a(e));var e},name:s,isMobile:b},r.id))})});a.displayName="RadioGroup";export{a as RadioGroup};
|
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-
|
|
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};
|
package/dist/esm/Typography.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"react";import e from"./utils.js";const o={h1:"text-
|
|
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};
|
package/dist/types/Backdrop.js
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import cn from './utils.js';
|
|
4
4
|
|
|
5
|
-
const Backdrop = React.forwardRef(({ isOpen = false, onClick, blur = false, zIndex = 51, className, children, ...props }, ref) => {
|
|
5
|
+
const Backdrop = React.forwardRef(({ isOpen = false, onClick, blur = false, zIndex = 51, className, children, visibleChildren, ...props }, ref) => {
|
|
6
|
+
// // Don't render anything if backdrop is not open
|
|
7
|
+
// if (!isOpen) {
|
|
8
|
+
// return null;
|
|
9
|
+
// }
|
|
6
10
|
const handleClick = (event) => {
|
|
7
11
|
if (onClick && event.target === event.currentTarget) {
|
|
8
12
|
onClick();
|
|
9
13
|
}
|
|
10
14
|
};
|
|
11
15
|
const backdropClasses = cn('fixed inset-0 transition-all duration-300', {
|
|
12
|
-
'opacity-100 pointer-events-auto': isOpen,
|
|
13
|
-
'opacity-0 pointer-events-none': !isOpen,
|
|
14
16
|
'backdrop-blur-sm': blur,
|
|
15
17
|
}, className);
|
|
16
18
|
const backdropStyle = {
|
|
17
19
|
backgroundColor: 'rgba(0, 0, 0, 0.60)',
|
|
18
20
|
zIndex,
|
|
19
21
|
};
|
|
20
|
-
return (
|
|
22
|
+
return (jsxs(Fragment, { children: [visibleChildren, isOpen && (jsxs("div", { ref: ref, className: backdropClasses, style: backdropStyle, onClick: handleClick, role: "presentation", ...props, children: [visibleChildren, children] }))] }));
|
|
21
23
|
});
|
|
22
24
|
Backdrop.displayName = 'Backdrop';
|
|
23
25
|
|
package/dist/types/Chips.js
CHANGED
|
@@ -60,14 +60,14 @@ const chipSizes = {
|
|
|
60
60
|
padding: 'px-2.5 py-1',
|
|
61
61
|
gap: 'gap-1',
|
|
62
62
|
iconSize: 'size-4',
|
|
63
|
-
fontSize: 'text-
|
|
63
|
+
fontSize: 'text-xs',
|
|
64
64
|
lineHeight: 'leading-[1.8]',
|
|
65
65
|
},
|
|
66
66
|
desktop: {
|
|
67
67
|
padding: 'px-3 py-1',
|
|
68
68
|
gap: 'gap-1.5',
|
|
69
69
|
iconSize: 'size-5',
|
|
70
|
-
fontSize: 'text-
|
|
70
|
+
fontSize: 'text-s',
|
|
71
71
|
lineHeight: 'leading-[24px]',
|
|
72
72
|
},
|
|
73
73
|
};
|
package/dist/types/RadioGroup.js
CHANGED
|
@@ -46,9 +46,7 @@ const RadioOptionComponent = ({ option, selected, disabled, onClick, name, isMob
|
|
|
46
46
|
return '';
|
|
47
47
|
return 'shadow-[0px_2px_4px_0px_rgba(0,0,0,0.08)]';
|
|
48
48
|
};
|
|
49
|
-
return (jsx("div", { className: cn('relative rounded-lg border-[1.5px] cursor-pointer transition-all duration-200', getBackgroundColor(), getBorderColor(), getShadow(), disabled && 'cursor-not-allowed'), onClick: disabled ? undefined : onClick, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), onKeyDown: handleKeyDown, tabIndex: disabled ? -1 : 0, role: "radio", "aria-checked": selected, "aria-disabled": disabled, children: jsx("div", { className: "flex flex-row items-center justify-end relative w-full", children: jsx("div", { className: cn('box-border flex flex-row items-center justify-end relative w-full', isMobile ? 'gap-2 px-4 py-3' : 'gap-4 px-6 py-4'), children: jsxs("div", { className: cn('flex flex-row items-center justify-end p-0 relative shrink-0', isMobile ? 'gap-2' : 'gap-3'), children: [jsx("input", { type: "radio", name: name, value: option.id, checked: selected, disabled: disabled, onChange: onClick, className: "sr-only", "aria-label": option.label }), jsx("div", { className: "flex flex-col gap-0.5 items-end justify-start p-0 relative shrink-0", children: jsx("div", { className: cn('font-sans font-bold text-nowrap text-right transition-colors duration-200', isMobile
|
|
50
|
-
? 'text-[14px] leading-[24px]'
|
|
51
|
-
: 'text-[16px] leading-normal', getTextColor()), children: jsx("p", { className: "whitespace-pre", dir: "auto", children: option.label }) }) }), option.icon && (jsx("div", { className: cn('flex items-center justify-center shrink-0 transition-colors duration-200', isMobile ? 'size-6' : 'size-7', getTextColor()), children: option.icon })), jsx("div", { className: "flex flex-col items-start justify-start p-0 relative shrink-0", children: jsx(RadioButton, { selected: selected, disabled: disabled, isMobile: isMobile }) })] }) }) }) }));
|
|
49
|
+
return (jsx("div", { className: cn('relative rounded-lg border-[1.5px] cursor-pointer transition-all duration-200', getBackgroundColor(), getBorderColor(), getShadow(), disabled && 'cursor-not-allowed'), onClick: disabled ? undefined : onClick, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), onKeyDown: handleKeyDown, tabIndex: disabled ? -1 : 0, role: "radio", "aria-checked": selected, "aria-disabled": disabled, children: jsx("div", { className: "flex flex-row items-center justify-end relative w-full", children: jsx("div", { className: cn('box-border flex flex-row items-center justify-end relative w-full', isMobile ? 'gap-2 px-4 py-3' : 'gap-4 px-6 py-4'), children: jsxs("div", { className: cn('flex flex-row items-center justify-end p-0 relative shrink-0', isMobile ? 'gap-2' : 'gap-3'), children: [jsx("input", { type: "radio", name: name, value: option.id, checked: selected, disabled: disabled, onChange: onClick, className: "sr-only", "aria-label": option.label }), jsx("div", { className: "flex flex-col gap-0.5 items-end justify-start p-0 relative shrink-0", children: jsx("div", { className: cn('font-sans font-bold text-nowrap text-right transition-colors duration-200', isMobile ? 'text-s leading-[24px]' : 'text-m leading-normal', getTextColor()), children: jsx("p", { className: "whitespace-pre", dir: "auto", children: option.label }) }) }), option.icon && (jsx("div", { className: cn('flex items-center justify-center shrink-0 transition-colors duration-200', isMobile ? 'size-6' : 'size-7', getTextColor()), children: option.icon })), jsx("div", { className: "flex flex-col items-start justify-start p-0 relative shrink-0", children: jsx(RadioButton, { selected: selected, disabled: disabled, isMobile: isMobile }) })] }) }) }) }));
|
|
52
50
|
};
|
|
53
51
|
const RadioGroup = React.forwardRef(({ options, value, onChange, name, disabled = false, className, isMobile, direction = 'vertical', ...props }, ref) => {
|
|
54
52
|
const detectedIsMobile = useMobile();
|
package/dist/types/Tabs.js
CHANGED
|
@@ -18,13 +18,11 @@ const handleKeyDown = (e, tabId, disabled, onTabChange) => {
|
|
|
18
18
|
const renderBadge = (count, isActive, disabled, isMobile) => {
|
|
19
19
|
if (count === undefined)
|
|
20
20
|
return null;
|
|
21
|
-
return (jsx("div", { className: cn('flex items-center justify-center rounded-[5px] font-sans font-bold text-white', 'transition-colors duration-200', isMobile
|
|
22
|
-
? 'size-6 text-[14px] pt-0.5'
|
|
23
|
-
: 'size-[25px] text-[14px] pt-[3px]', disabled ? 'bg-midnight' : isActive ? 'bg-primary' : 'bg-neutral-main'), children: jsx("p", { className: "leading-[24px] whitespace-pre", dir: "auto", children: count }) }));
|
|
21
|
+
return (jsx("div", { className: cn('flex items-center justify-center rounded-[5px] font-sans font-bold text-white', 'transition-colors duration-200', isMobile ? 'size-6 text-s pt-0.5' : 'size-[25px] text-s pt-[3px]', disabled ? 'bg-midnight' : isActive ? 'bg-primary' : 'bg-neutral-main'), children: jsx("p", { className: "leading-[24px] whitespace-pre", dir: "auto", children: count }) }));
|
|
24
22
|
};
|
|
25
23
|
const renderTabContent = (item, isActive, isMobile) => {
|
|
26
24
|
const hasCount = item.count !== undefined;
|
|
27
|
-
return (jsxs("div", { className: cn('flex flex-row items-center justify-start transition-colors duration-200', isMobile ? 'gap-1.5' : 'gap-1.5'), children: [hasCount && renderBadge(item.count, isActive, item.disabled, isMobile), jsx("div", { className: cn('font-sans text-nowrap text-right transition-colors duration-200', isMobile ? 'text-
|
|
25
|
+
return (jsxs("div", { className: cn('flex flex-row items-center justify-start transition-colors duration-200', isMobile ? 'gap-1.5' : 'gap-1.5'), children: [hasCount && renderBadge(item.count, isActive, item.disabled, isMobile), jsx("div", { className: cn('font-sans text-nowrap text-right transition-colors duration-200', isMobile ? 'text-s' : isActive ? 'text-m' : 'text-l', item.disabled
|
|
28
26
|
? 'font-normal text-midnight'
|
|
29
27
|
: isActive
|
|
30
28
|
? 'font-bold text-primary'
|
package/dist/types/Typography.js
CHANGED
|
@@ -3,30 +3,30 @@ import cn from './utils.js';
|
|
|
3
3
|
|
|
4
4
|
const variantClasses = {
|
|
5
5
|
// Headings with Fat weight (900)
|
|
6
|
-
h1: 'text-
|
|
7
|
-
h2: 'text-
|
|
8
|
-
h3: 'text-
|
|
9
|
-
h4: 'text-
|
|
10
|
-
h5: 'text-
|
|
11
|
-
h6: 'text-
|
|
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
12
|
// Body Copy with specific weight variants
|
|
13
|
-
'body-xl-heavy': 'text-
|
|
14
|
-
'body-l-heavy': 'text-
|
|
15
|
-
'body-l-bold': 'text-
|
|
16
|
-
'body-l-medium': 'text-
|
|
17
|
-
'body-m-heavy': 'text-
|
|
18
|
-
'body-m-bold': 'text-
|
|
19
|
-
'body-m-medium': 'text-
|
|
20
|
-
'body-s-heavy': 'text-
|
|
21
|
-
'body-s-bold': 'text-
|
|
22
|
-
'body-s-medium': 'text-
|
|
23
|
-
'body-ms-bold': 'text-
|
|
24
|
-
'body-ms-medium': 'text-
|
|
25
|
-
'body-xs-bold': 'text-
|
|
26
|
-
'body-xs-medium': 'text-
|
|
27
|
-
'body-t-bold': 'text-
|
|
28
|
-
'body-t-medium': 'text-
|
|
29
|
-
'body-ss-medium': 'text-
|
|
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',
|
|
30
30
|
};
|
|
31
31
|
// Export for reuse in other components
|
|
32
32
|
const getTypographyClasses = (variant) => {
|