@stanfordspezi/spezi-web-design-system
Version:
Stanford Biodesign Digital Health Spezi Web Design System
7 lines (6 loc) • 1.13 kB
JavaScript
;const e=require("react/jsx-runtime"),a=require("./index-DwV9MiDB.js"),n=require("./Button-CTJ3Li3o.js"),c=require("./Calendar-CFgY0i3-.js"),s=require("./Popover-Ww689b3v.js"),i=require("./createLucideIcon-DpotSgUx.js");/**
* @license lucide-react v0.488.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const d=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],u=i.createLucideIcon("calendar",d),l=t=>{const{showTimePicker:o}=t,r=t.mode!==void 0?t.selected:null;return e.jsxs(s.PopoverRoot,{children:[e.jsx(s.PopoverTrigger,{asChild:!0,children:e.jsxs(n.Button,{variant:"outline",className:a.cn("bg-surface-primary! w-full! justify-start! text-left! text-sm!",!r&&"text-muted-foreground!"),children:[e.jsx(u,{className:"size-4"}),r&&c.isDate(r)?c.format(r,`PPP${o?" - p":""}`):"Pick a date"]})}),e.jsx(s.PopoverContent,{className:"w-auto! p-0!",children:e.jsx(c.Calendar,{...t})})]})};exports.DatePicker=l;