@undp/design-system-react
Version:
React based design system for UNDP
2 lines • 1.76 kB
JavaScript
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./utils-Dd9-5CFr.cjs"),n=require("./dist-BZMXZCSu.cjs"),r=require("./calendar-D3DI6jL5.cjs"),i=require("./popover-UvMqvZhZ.cjs"),a=require("./calendar-card-BmXmnASy.cjs");let o=require("react");o=e.r(o,1);let s=require("react/jsx-runtime");var c=n.t(`w-full h-auto bg-background rounded-base text-content-primary text-base transition-colors focus-visible:outline-hidden focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-disabled placeholder:text-content-placeholder`,{variants:{variant:{light:`border border-stroke`,normal:`border-2 border-foreground`},rounded:{base:`rounded`,sm:`rounded-sm`,md:`rounded-md`,lg:`rounded-lg`,xl:`rounded-xl`,"2xl":`rounded-2xl`,full:`rounded-full`},inputSize:{sm:`px-2.5 py-1`,base:`p-2.5`}},defaultVariants:{inputSize:`base`,variant:`normal`,rounded:`base`}});function l({selected:e,onSelect:n,disablePopover:l,classNames:u,variant:d,inputSize:f,placeHolder:p=`Pick a date`,...m}){let[h,g]=o.useState(),[_,v]=o.useState(!1);return(0,s.jsxs)(i.t,{open:_,onOpenChange:v,children:[(0,s.jsxs)(i.i,{className:t.t(c({inputSize:f,variant:d}),u?.popOverTrigger),children:[(0,s.jsx)(r.t,{className:t.t(`size-4 text-content-placeholder`,u?.popOverTriggerIcon)}),h?(0,s.jsx)(`p`,{className:`mt-1 p-0 font-body text-content-primary`,children:a.r(h,`MMM d, yyyy`)}):(0,s.jsx)(`p`,{className:`mt-1 p-0 font-body text-content-placeholder`,children:p})]}),(0,s.jsx)(i.r,{className:t.t(`w-auto p-0`,u?.popOverContent),align:`start`,children:(0,s.jsx)(a.t,{mode:`single`,selected:e||h,onSelect:(e,t,r,i)=>{g(e),n?.(e,t,r,i),v(!1)},...m})})]})}exports.DatePicker=l;
//# sourceMappingURL=DatePicker.cjs.map