@scbt-ecom/ui 0.104.0 → 0.104.1

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.
@@ -1,2 +1,2 @@
1
- import{jsx as l}from"react/jsx-runtime";import"../../../Calendar.js";import{formatDateToYearString as h,formatDateToMonthString as f}from"../../../model/utils.js";import{cn as i}from"../../../../../utils/cn.js";import{motion as n}from"../../../../../../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";const v=({dates:c,selected:e,onSelect:p,className:s,mode:r,...m})=>l(n.ul,{...m,layout:!0,initial:{opacity:0,translateY:-20},animate:{opacity:1,translateY:8},exit:{opacity:0},className:i("customScrollbar-y absolute left-0 top-[50px] z-10 max-h-[280px] w-full translate-y-2 list-none overflow-y-scroll bg-color-white pr-1.5",s),children:c.map((t,u)=>{const o=new Date;r==="year"?o.setFullYear(t):o.setMonth(t);const y=r==="year"?h(o):f(o);return l(n.li,{initial:{opacity:0},animate:{opacity:1},children:l("button",{type:"button",onClick:()=>{const a=new Date(e.getTime());r==="year"?a.setFullYear(t):a.setMonth(t),p(a)},className:i("desk-body-regular-l h-10 w-full rounded-sm bg-color-white px-2 text-start","capitalize hover:bg-color-primary-tr-hover hover:text-color-primary-default",{"bg-color-primary-tr-hover text-color-primary-default":r==="month"?e.getMonth()===t:e.getFullYear()===t}),children:y})},u)})});export{v as SelectList};
1
+ import{jsx as l}from"react/jsx-runtime";import"../../../Calendar.js";import{formatDateToYearString as h,formatDateToMonthString as f}from"../../../model/utils.js";import{cn as i}from"../../../../../utils/cn.js";import{motion as n}from"../../../../../../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";const Y=({dates:c,selected:e,onSelect:s,className:p,mode:o,...m})=>l(n.ul,{...m,layout:!0,initial:{opacity:0,translateY:-20},animate:{opacity:1,translateY:8},exit:{opacity:0},className:i("customScrollbar-y absolute left-0 top-[50px] z-10 max-h-[280px] w-full translate-y-2 list-none overflow-y-scroll bg-color-white pr-1.5",p),children:c.map((t,u)=>{const r=new Date;r.setDate(1),o==="year"?r.setFullYear(t):r.setMonth(t);const y=o==="year"?h(r):f(r);return l(n.li,{initial:{opacity:0},animate:{opacity:1},children:l("button",{type:"button",onClick:()=>{const a=new Date(e.getTime());o==="year"?a.setFullYear(t):a.setMonth(t),s(a)},className:i("desk-body-regular-l h-10 w-full rounded-sm bg-color-white px-2 text-start","capitalize hover:bg-color-primary-tr-hover hover:text-color-primary-default",{"bg-color-primary-tr-hover text-color-primary-default":o==="month"?e.getMonth()===t:e.getFullYear()===t}),children:y})},u)})});export{Y as SelectList};
2
2
  //# sourceMappingURL=SelectList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectList.js","sources":["../../../../../../../../lib/shared/ui/calendar/ui/selectDate/ui/SelectList.tsx"],"sourcesContent":["import { type ComponentPropsWithoutRef } from 'react'\nimport { motion } from 'framer-motion'\nimport { formatDateToMonthString, formatDateToYearString } from '$/shared/ui/calendar'\nimport { cn } from '$/shared/utils'\n\ntype SelectListProps = Omit<ComponentPropsWithoutRef<typeof motion.ul>, 'onSelect'> & {\n dates: number[]\n selected: Date\n onSelect: (date: Date) => void\n mode: 'month' | 'year'\n}\n\nexport const SelectList = ({ dates, selected, onSelect, className, mode, ...props }: SelectListProps) => {\n return (\n <motion.ul\n {...props}\n layout\n initial={{ opacity: 0, translateY: -20 }}\n animate={{ opacity: 1, translateY: 8 }}\n exit={{ opacity: 0 }}\n className={cn(\n 'customScrollbar-y absolute left-0 top-[50px] z-10 max-h-[280px] w-full translate-y-2 list-none overflow-y-scroll bg-color-white pr-1.5',\n className\n )}\n >\n {dates.map((date, index) => {\n const d = new Date()\n\n if (mode === 'year') {\n d.setFullYear(date)\n } else {\n d.setMonth(date)\n }\n\n const label = mode === 'year' ? formatDateToYearString(d) : formatDateToMonthString(d)\n\n return (\n <motion.li key={index} initial={{ opacity: 0 }} animate={{ opacity: 1 }}>\n <button\n type='button'\n onClick={() => {\n const updatedDate = new Date(selected.getTime())\n\n if (mode === 'year') {\n updatedDate.setFullYear(date)\n } else {\n updatedDate.setMonth(date)\n }\n\n onSelect(updatedDate)\n }}\n className={cn(\n 'desk-body-regular-l h-10 w-full rounded-sm bg-color-white px-2 text-start',\n 'capitalize hover:bg-color-primary-tr-hover hover:text-color-primary-default',\n {\n 'bg-color-primary-tr-hover text-color-primary-default':\n mode === 'month' ? selected.getMonth() === date : selected.getFullYear() === date\n }\n )}\n >\n {label}\n </button>\n </motion.li>\n )\n })}\n </motion.ul>\n )\n}\n"],"names":["SelectList","dates","selected","onSelect","className","mode","props","jsx","motion","cn","date","index","d","label","formatDateToYearString","formatDateToMonthString","updatedDate"],"mappings":"sUAYO,MAAMA,EAAa,CAAC,CAAE,MAAAC,EAAO,SAAAC,EAAU,SAAAC,EAAU,UAAAC,EAAW,KAAAC,EAAM,GAAGC,KAExEC,EAACC,EAAO,GAAP,CACE,GAAGF,EACJ,OAAM,GACN,QAAS,CAAE,QAAS,EAAG,WAAY,GAAA,EACnC,QAAS,CAAE,QAAS,EAAG,WAAY,CAAA,EACnC,KAAM,CAAE,QAAS,CAAA,EACjB,UAAWG,EACT,yIACAL,CAAA,EAGD,SAAAH,EAAM,IAAI,CAACS,EAAMC,IAAU,CAC1B,MAAMC,MAAQ,KAEVP,IAAS,OACXO,EAAE,YAAYF,CAAI,EAElBE,EAAE,SAASF,CAAI,EAGjB,MAAMG,EAAQR,IAAS,OAASS,EAAuBF,CAAC,EAAIG,EAAwBH,CAAC,EAErF,OACEL,EAACC,EAAO,GAAP,CAAsB,QAAS,CAAE,QAAS,CAAA,EAAK,QAAS,CAAE,QAAS,GAClE,SAAAD,EAAC,SAAA,CACC,KAAK,SACL,QAAS,IAAM,CACb,MAAMS,EAAc,IAAI,KAAKd,EAAS,SAAS,EAE3CG,IAAS,OACXW,EAAY,YAAYN,CAAI,EAE5BM,EAAY,SAASN,CAAI,EAG3BP,EAASa,CAAW,CACtB,EACA,UAAWP,EACT,4EACA,8EACA,CACE,uDACEJ,IAAS,QAAUH,EAAS,aAAeQ,EAAOR,EAAS,gBAAkBQ,CAAA,CACjF,EAGD,SAAAG,CAAA,CAAA,GAvBWF,CAyBhB,CAEJ,CAAC,CAAA,CAAA"}
1
+ {"version":3,"file":"SelectList.js","sources":["../../../../../../../../lib/shared/ui/calendar/ui/selectDate/ui/SelectList.tsx"],"sourcesContent":["import { type ComponentPropsWithoutRef } from 'react'\nimport { motion } from 'framer-motion'\nimport { formatDateToMonthString, formatDateToYearString } from '$/shared/ui/calendar'\nimport { cn } from '$/shared/utils'\n\ntype SelectListProps = Omit<ComponentPropsWithoutRef<typeof motion.ul>, 'onSelect'> & {\n dates: number[]\n selected: Date\n onSelect: (date: Date) => void\n mode: 'month' | 'year'\n}\n\nexport const SelectList = ({ dates, selected, onSelect, className, mode, ...props }: SelectListProps) => {\n return (\n <motion.ul\n {...props}\n layout\n initial={{ opacity: 0, translateY: -20 }}\n animate={{ opacity: 1, translateY: 8 }}\n exit={{ opacity: 0 }}\n className={cn(\n 'customScrollbar-y absolute left-0 top-[50px] z-10 max-h-[280px] w-full translate-y-2 list-none overflow-y-scroll bg-color-white pr-1.5',\n className\n )}\n >\n {dates.map((date, index) => {\n const d = new Date()\n d.setDate(1)\n\n if (mode === 'year') {\n d.setFullYear(date)\n } else {\n d.setMonth(date)\n }\n\n const label = mode === 'year' ? formatDateToYearString(d) : formatDateToMonthString(d)\n\n return (\n <motion.li key={index} initial={{ opacity: 0 }} animate={{ opacity: 1 }}>\n <button\n type='button'\n onClick={() => {\n const updatedDate = new Date(selected.getTime())\n\n if (mode === 'year') {\n updatedDate.setFullYear(date)\n } else {\n updatedDate.setMonth(date)\n }\n\n onSelect(updatedDate)\n }}\n className={cn(\n 'desk-body-regular-l h-10 w-full rounded-sm bg-color-white px-2 text-start',\n 'capitalize hover:bg-color-primary-tr-hover hover:text-color-primary-default',\n {\n 'bg-color-primary-tr-hover text-color-primary-default':\n mode === 'month' ? selected.getMonth() === date : selected.getFullYear() === date\n }\n )}\n >\n {label}\n </button>\n </motion.li>\n )\n })}\n </motion.ul>\n )\n}\n"],"names":["SelectList","dates","selected","onSelect","className","mode","props","jsx","motion","cn","date","index","d","label","formatDateToYearString","formatDateToMonthString","updatedDate"],"mappings":"sUAYO,MAAMA,EAAa,CAAC,CAAE,MAAAC,EAAO,SAAAC,EAAU,SAAAC,EAAU,UAAAC,EAAW,KAAAC,EAAM,GAAGC,KAExEC,EAACC,EAAO,GAAP,CACE,GAAGF,EACJ,OAAM,GACN,QAAS,CAAE,QAAS,EAAG,WAAY,GAAA,EACnC,QAAS,CAAE,QAAS,EAAG,WAAY,CAAA,EACnC,KAAM,CAAE,QAAS,CAAA,EACjB,UAAWG,EACT,yIACAL,CAAA,EAGD,SAAAH,EAAM,IAAI,CAACS,EAAMC,IAAU,CAC1B,MAAMC,MAAQ,KACdA,EAAE,QAAQ,CAAC,EAEPP,IAAS,OACXO,EAAE,YAAYF,CAAI,EAElBE,EAAE,SAASF,CAAI,EAGjB,MAAMG,EAAQR,IAAS,OAASS,EAAuBF,CAAC,EAAIG,EAAwBH,CAAC,EAErF,OACEL,EAACC,EAAO,GAAP,CAAsB,QAAS,CAAE,QAAS,CAAA,EAAK,QAAS,CAAE,QAAS,GAClE,SAAAD,EAAC,SAAA,CACC,KAAK,SACL,QAAS,IAAM,CACb,MAAMS,EAAc,IAAI,KAAKd,EAAS,SAAS,EAE3CG,IAAS,OACXW,EAAY,YAAYN,CAAI,EAE5BM,EAAY,SAASN,CAAI,EAG3BP,EAASa,CAAW,CACtB,EACA,UAAWP,EACT,4EACA,8EACA,CACE,uDACEJ,IAAS,QAAUH,EAAS,aAAeQ,EAAOR,EAAS,gBAAkBQ,CAAA,CACjF,EAGD,SAAAG,CAAA,CAAA,GAvBWF,CAyBhB,CAEJ,CAAC,CAAA,CAAA"}