@trsys-tech/matrix-library 0.6.4 → 0.7.1-canary.0

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.
Files changed (64) hide show
  1. package/dist/components/button/Button.d.ts.map +1 -1
  2. package/dist/components/date-picker/DatePicker.d.ts +24 -1
  3. package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
  4. package/dist/components/date-picker/DateRangePicker.d.ts +23 -1
  5. package/dist/components/date-picker/DateRangePicker.d.ts.map +1 -1
  6. package/dist/components/date-picker/DesktopDatePicker.d.ts +23 -2
  7. package/dist/components/date-picker/DesktopDatePicker.d.ts.map +1 -1
  8. package/dist/components/date-picker/DesktopDateRangePicker.d.ts +29 -3
  9. package/dist/components/date-picker/DesktopDateRangePicker.d.ts.map +1 -1
  10. package/dist/components/date-picker/DesktopTimePicker.d.ts +17 -0
  11. package/dist/components/date-picker/DesktopTimePicker.d.ts.map +1 -1
  12. package/dist/components/date-picker/MobileDatePicker.d.ts +24 -3
  13. package/dist/components/date-picker/MobileDatePicker.d.ts.map +1 -1
  14. package/dist/components/date-picker/MobileDateRangePicker.d.ts +31 -4
  15. package/dist/components/date-picker/MobileDateRangePicker.d.ts.map +1 -1
  16. package/dist/components/date-picker/MobileTimePicker.d.ts +17 -0
  17. package/dist/components/date-picker/MobileTimePicker.d.ts.map +1 -1
  18. package/dist/components/date-picker/TimePicker.d.ts +22 -0
  19. package/dist/components/date-picker/TimePicker.d.ts.map +1 -1
  20. package/dist/components/date-picker/TimePickerContent.d.ts +24 -0
  21. package/dist/components/date-picker/TimePickerContent.d.ts.map +1 -1
  22. package/dist/components/date-picker/dateValue.d.ts +44 -0
  23. package/dist/components/date-picker/dateValue.d.ts.map +1 -0
  24. package/dist/components/drawer/SwipableDrawer.d.ts.map +1 -1
  25. package/dist/components/duration/Duration.d.ts.map +1 -1
  26. package/dist/components/form/Form.d.ts +1 -1
  27. package/dist/components/form/Form.d.ts.map +1 -1
  28. package/dist/components/form-date-picker/FormDatePicker.d.ts +32 -4
  29. package/dist/components/form-date-picker/FormDatePicker.d.ts.map +1 -1
  30. package/dist/components/form-date-range-picker/FormDateRangePicker.d.ts +34 -4
  31. package/dist/components/form-date-range-picker/FormDateRangePicker.d.ts.map +1 -1
  32. package/dist/components/form-time-picker/FormTimePicker.d.ts +34 -0
  33. package/dist/components/form-time-picker/FormTimePicker.d.ts.map +1 -1
  34. package/dist/components/label/Label.d.ts.map +1 -1
  35. package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
  36. package/dist/components/progress/Progress.d.ts.map +1 -1
  37. package/dist/components/sheet/Sheet.d.ts.map +1 -1
  38. package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
  39. package/dist/components/status/Status.d.ts.map +1 -1
  40. package/dist/components/switch/Switch.d.ts.map +1 -1
  41. package/dist/components/text-field/TextField.d.ts.map +1 -1
  42. package/dist/components/toast/toast-components.d.ts.map +1 -1
  43. package/dist/datepicker.es.js.map +1 -1
  44. package/dist/daterangepicker.es.js.map +1 -1
  45. package/dist/datevalue.es.js +44 -0
  46. package/dist/datevalue.es.js.map +1 -0
  47. package/dist/desktopdatepicker.es.js +39 -34
  48. package/dist/desktopdatepicker.es.js.map +1 -1
  49. package/dist/desktopdaterangepicker.es.js +57 -50
  50. package/dist/desktopdaterangepicker.es.js.map +1 -1
  51. package/dist/desktoptimepicker.es.js.map +1 -1
  52. package/dist/formdatepicker.es.js.map +1 -1
  53. package/dist/formdaterangepicker.es.js.map +1 -1
  54. package/dist/formtimepicker.es.js.map +1 -1
  55. package/dist/index.d.ts +2 -2
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/mobiledatepicker.es.js +46 -41
  58. package/dist/mobiledatepicker.es.js.map +1 -1
  59. package/dist/mobiledaterangepicker.es.js +82 -73
  60. package/dist/mobiledaterangepicker.es.js.map +1 -1
  61. package/dist/mobiletimepicker.es.js.map +1 -1
  62. package/dist/timepicker.es.js.map +1 -1
  63. package/dist/timepickercontent.es.js.map +1 -1
  64. package/package.json +19 -19
@@ -1 +1 @@
1
- {"version":3,"file":"desktopdaterangepicker.es.js","sources":["../src/components/date-picker/DesktopDateRangePicker.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport { format } from \"date-fns\";\r\nimport { Calendar as CalendarIcon } from \"@trsys-tech/matrix-icons\";\r\nimport { PropsBase, PropsRange, DateRange, Matcher } from \"react-day-picker\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\nimport { Calendar } from \"./calendar\";\r\nimport { Button } from \"../button/Button\";\r\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover/Popover\";\r\n\r\ntype DesktopDateRangePickerProps = Omit<PropsBase, \"disabled\"> &\r\n Omit<PropsRange, \"mode\" | \"disabled\"> & {\r\n formatStr?: string;\r\n placeholder?: string;\r\n calendarClassName?: string;\r\n selected?: DateRange;\r\n required?: boolean;\r\n fromText?: string;\r\n toText?: string;\r\n disabled?: boolean;\r\n disabledDates?: Matcher | Matcher[];\r\n };\r\n\r\nconst DesktopDateRangePicker: React.FC<DesktopDateRangePickerProps> = ({\r\n formatStr,\r\n selected,\r\n placeholder,\r\n className,\r\n calendarClassName,\r\n fromText,\r\n toText,\r\n disabled,\r\n disabledDates,\r\n ...props\r\n}) => {\r\n const [isOpen, setIsOpen] = React.useState(false);\r\n\r\n return (\r\n <Popover\r\n open={isOpen}\r\n onOpenChange={open => {\r\n setIsOpen(open);\r\n }}\r\n >\r\n <PopoverTrigger asChild>\r\n <Button\r\n type=\"button\"\r\n variant=\"text\"\r\n className={cn(\r\n \"flex h-8 w-full items-center justify-between whitespace-nowrap rounded-sm border border-input bg-transparent ps-3 pe-1 py-1.5 text-xs ring-offset-background data-[placeholder]:text-muted-foreground hover:border hover:border-primary hover:bg-transparent focus:border focus:border-primary focus:outline-none focus:ring focus:ring-primary-100 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-text-300 disabled:border-gray-100 [&>span]:line-clamp-1 [&_svg]:disabled:text-text-300\",\r\n className,\r\n )}\r\n data-placeholder={!selected ? \"\" : undefined}\r\n aria-label={\r\n selected\r\n ? `Selected date: ${selected?.from ? format(selected.from, formatStr ?? \"yyyy/MM/dd\") : \"\"} - ${selected?.to ? format(selected.to, formatStr ?? \"yyyy/MM/dd\") : \"\"}`\r\n : placeholder\r\n }\r\n disabled={disabled}\r\n >\r\n {selected ? (\r\n <div className=\"grid grid-cols-2 flex-1 justify-items-start\">\r\n <span>\r\n {fromText ?? \"From\"}: {selected?.from ? format(selected.from, formatStr ?? \"yyyy/MM/dd\") : \"-\"}\r\n </span>{\" \"}\r\n <span>\r\n {toText ?? \"To\"}: {selected?.to ? format(selected.to, formatStr ?? \"yyyy/MM/dd\") : \"-\"}\r\n </span>\r\n </div>\r\n ) : (\r\n <span>{placeholder ?? \"Pick a Range\"}</span>\r\n )}\r\n <CalendarIcon className=\"mr-2 h-5 w-4 ms-auto\" />\r\n </Button>\r\n </PopoverTrigger>\r\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\r\n <Calendar\r\n defaultMonth={selected?.from}\r\n startMonth={new Date(2000, 0, 1)}\r\n endMonth={new Date(new Date().getFullYear() + 2, 11, 31)}\r\n {...props}\r\n mode=\"range\"\r\n selected={selected}\r\n className={cn(calendarClassName, \"md:max-w-full md:w-[36rem]\")}\r\n numberOfMonths={2}\r\n disabled={disabledDates}\r\n />\r\n </PopoverContent>\r\n </Popover>\r\n );\r\n};\r\n\r\nexport { DesktopDateRangePicker, type DesktopDateRangePickerProps };\r\n"],"names":["DesktopDateRangePicker","formatStr","selected","placeholder","className","calendarClassName","fromText","toText","disabled","disabledDates","props","isOpen","setIsOpen","React","jsxs","Popover","open","jsx","PopoverTrigger","Button","cn","format","CalendarIcon","PopoverContent","Calendar"],"mappings":";;;;;;;;AAyBA,MAAMA,IAAgE,CAAC;AAAA,EACrE,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,mBAA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EAACK,GAAA,EAAa,WAAU,uBAAA,CAAuB;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA,GAEnD;AAAA,QACA,gBAAAL,EAACM,GAAA,EAAe,WAAU,cAAa,OAAM,SAC3C,UAAA,gBAAAN;AAAA,UAACO;AAAAA,UAAA;AAAA,YACC,cAActB,GAAU;AAAA,YACxB,YAAY,IAAI,KAAK,KAAM,GAAG,CAAC;AAAA,YAC/B,UAAU,IAAI,MAAK,oBAAI,KAAA,GAAO,gBAAgB,GAAG,IAAI,EAAE;AAAA,YACtD,GAAGQ;AAAA,YACJ,MAAK;AAAA,YACL,UAAAR;AAAA,YACA,WAAWkB,EAAGf,GAAmB,4BAA4B;AAAA,YAC7D,gBAAgB;AAAA,YAChB,UAAUI;AAAA,UAAA;AAAA,QAAA,EACZ,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"desktopdaterangepicker.es.js","sources":["../src/components/date-picker/DesktopDateRangePicker.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport { format } from \"date-fns\";\r\nimport { Calendar as CalendarIcon } from \"@trsys-tech/matrix-icons\";\r\nimport { PropsBase, PropsRange, DateRange, Matcher, OnSelectHandler } from \"react-day-picker\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\nimport { Calendar } from \"./calendar\";\r\nimport { DateOnlyRange, DateRangeValue, toCalendarDateRange, toDateOnlyRange } from \"./dateValue\";\r\nimport { Button } from \"../button/Button\";\r\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover/Popover\";\r\n\r\n/**\r\n * Props for the desktop-only date-range picker.\r\n *\r\n * Inherits the range calendar props from react-day-picker, but normalizes the\r\n * public value contract to Date | YYYY-MM-DD on input and { from, to } strings on output.\r\n */\r\ntype DesktopDateRangePickerProps = Omit<PropsBase, \"disabled\"> &\r\n Omit<PropsRange, \"mode\" | \"disabled\" | \"selected\" | \"onSelect\"> & {\r\n /** Display format used in the trigger and accessibility label. */\r\n formatStr?: string;\r\n /** Placeholder shown when no range is selected. */\r\n placeholder?: string;\r\n /** Class name forwarded to the calendar content. */\r\n calendarClassName?: string;\r\n /** Current value as Date objects or YYYY-MM-DD strings. */\r\n selected?: DateRangeValue;\r\n /** Called with YYYY-MM-DD range values when the user selects a range. */\r\n onSelect?: (date: DateOnlyRange | undefined) => void;\r\n /** Prevents clearing the selection when true. */\r\n required?: boolean;\r\n /** Label shown before the start date in the trigger. */\r\n fromText?: string;\r\n /** Label shown before the end date in the trigger. */\r\n toText?: string;\r\n /** Disables the trigger button. */\r\n disabled?: boolean;\r\n /** Dates disabled in the calendar. */\r\n disabledDates?: Matcher | Matcher[];\r\n /** Separator between the start and end date in the trigger. default: \": \" */\r\n labelSeparator?: string;\r\n /** Separator between the start and end date in the trigger. default: \"\" */\r\n fromToSeparator?: string;\r\n };\r\n\r\n/**\r\n * Desktop-only date-range picker rendered in a popover.\r\n * Use this component when you want the desktop experience regardless of screen size.\r\n */\r\nconst DesktopDateRangePicker: React.FC<DesktopDateRangePickerProps> = ({\r\n formatStr,\r\n selected,\r\n placeholder,\r\n className,\r\n labelSeparator = \": \",\r\n fromToSeparator = \"\",\r\n calendarClassName,\r\n fromText,\r\n toText,\r\n onSelect,\r\n disabled,\r\n disabledDates,\r\n ...props\r\n}) => {\r\n const [isOpen, setIsOpen] = React.useState(false);\r\n const selectedRange = toCalendarDateRange(selected);\r\n const hasSelectedRange = Boolean(selectedRange?.from || selectedRange?.to);\r\n\r\n const handleSelect: OnSelectHandler<DateRange | undefined> = range => {\r\n onSelect?.(toDateOnlyRange(range));\r\n };\r\n\r\n return (\r\n <Popover\r\n open={isOpen}\r\n onOpenChange={open => {\r\n setIsOpen(open);\r\n }}\r\n >\r\n <PopoverTrigger asChild>\r\n <Button\r\n type=\"button\"\r\n variant=\"text\"\r\n className={cn(\r\n \"flex h-8 w-full items-center justify-between whitespace-nowrap rounded-sm border border-input bg-transparent ps-3 pe-1 py-1.5 text-xs ring-offset-background data-[placeholder]:text-muted-foreground hover:border hover:border-primary hover:bg-transparent focus:border focus:border-primary focus:outline-none focus:ring focus:ring-primary-100 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-text-300 disabled:border-gray-100 [&>span]:line-clamp-1 [&_svg]:disabled:text-text-300\",\r\n className,\r\n )}\r\n data-placeholder={!hasSelectedRange ? \"\" : undefined}\r\n aria-label={\r\n hasSelectedRange\r\n ? `Selected date: ${selectedRange?.from ? format(selectedRange.from, formatStr ?? \"yyyy/MM/dd\") : \"\"} - ${selectedRange?.to ? format(selectedRange.to, formatStr ?? \"yyyy/MM/dd\") : \"\"}`\r\n : placeholder\r\n }\r\n disabled={disabled}\r\n >\r\n {hasSelectedRange ? (\r\n <div className=\"flex flex-row gap-1 flex-1 justify-items-start\">\r\n <span>\r\n {fromText ?? \"From\"}\r\n {labelSeparator}\r\n {selectedRange?.from ? format(selectedRange.from, formatStr ?? \"yyyy/MM/dd\") : \"-\"}\r\n </span>\r\n {fromToSeparator}\r\n <span>\r\n {toText ?? \"To\"}\r\n {labelSeparator}\r\n {selectedRange?.to ? format(selectedRange.to, formatStr ?? \"yyyy/MM/dd\") : \"-\"}\r\n </span>\r\n </div>\r\n ) : (\r\n <span>{placeholder ?? \"Pick a Range\"}</span>\r\n )}\r\n <CalendarIcon className=\"mr-2 h-5 w-4 ms-auto\" />\r\n </Button>\r\n </PopoverTrigger>\r\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\r\n <Calendar\r\n defaultMonth={selectedRange?.from}\r\n startMonth={new Date(2000, 0, 1)}\r\n endMonth={new Date(new Date().getFullYear() + 2, 11, 31)}\r\n {...props}\r\n mode=\"range\"\r\n selected={selectedRange}\r\n className={cn(calendarClassName, \"md:max-w-full md:w-[36rem]\")}\r\n numberOfMonths={2}\r\n onSelect={handleSelect}\r\n disabled={disabledDates}\r\n />\r\n </PopoverContent>\r\n </Popover>\r\n );\r\n};\r\n\r\nexport { DesktopDateRangePicker, type DesktopDateRangePickerProps };\r\n"],"names":["DesktopDateRangePicker","formatStr","selected","placeholder","className","labelSeparator","fromToSeparator","calendarClassName","fromText","toText","onSelect","disabled","disabledDates","props","isOpen","setIsOpen","React","selectedRange","toCalendarDateRange","hasSelectedRange","handleSelect","range","toDateOnlyRange","jsxs","Popover","open","jsx","PopoverTrigger","Button","cn","format","CalendarIcon","PopoverContent","Calendar"],"mappings":";;;;;;;;;AAmDA,MAAMA,IAAgE,CAAC;AAAA,EACrE,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,gBAAAC,IAAiB;AAAA,EACjB,iBAAAC,IAAkB;AAAA,EAClB,mBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAM,SAAS,EAAK,GAC1CC,IAAgBC,EAAoBhB,CAAQ,GAC5CiB,IAAmB,GAAQF,GAAe,QAAQA,GAAe,KAEjEG,IAAuD,CAAAC,MAAS;AACpE,IAAAX,IAAWY,EAAgBD,CAAK,CAAC;AAAA,EACnC;AAEA,SACE,gBAAAE;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAMV;AAAA,MACN,cAAc,CAAAW,MAAQ;AACpB,QAAAV,EAAUU,CAAI;AAAA,MAChB;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAC,EAACC,GAAA,EAAe,SAAO,IACrB,UAAA,gBAAAJ;AAAA,UAACK;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,SAAQ;AAAA,YACR,WAAWC;AAAA,cACT;AAAA,cACAzB;AAAA,YAAA;AAAA,YAEF,oBAAmBe,IAAwB,SAAL;AAAA,YACtC,cACEA,IACI,kBAAkBF,GAAe,OAAOa,EAAOb,EAAc,MAAMhB,KAAa,YAAY,IAAI,EAAE,MAAMgB,GA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picker/DesktopTimePicker.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { HTMLAttributes, useState } from \"react\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\nimport { Button } from \"../button/Button\";\r\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover/Popover\";\r\nimport { Time, TimePickerContent } from \"./TimePickerContent\";\r\n\r\nconst formatTimeLabel = (time: Time, is24HourMode: boolean) => {\r\n const minute = time.minute.toString().padStart(2, \"0\");\r\n\r\n if (is24HourMode) {\r\n const hour = time.ampm ? (time.hour % 12) + (time.ampm === \"PM\" ? 12 : 0) : time.hour;\r\n return `${hour.toString().padStart(2, \"0\")} : ${minute}`;\r\n }\r\n\r\n const hourFromAmpm = time.ampm ? (time.hour % 12) + (time.ampm === \"PM\" ? 12 : 0) : time.hour;\r\n const hour = hourFromAmpm % 12 || 12;\r\n const ampm = time.ampm ?? (hourFromAmpm >= 12 ? \"PM\" : \"AM\");\r\n\r\n return `${hour.toString().padStart(2, \"0\")} : ${minute} ${ampm}`;\r\n};\r\n\r\ntype DesktopTimePickerProps = HTMLAttributes<HTMLButtonElement> & {\r\n time: Time | undefined;\r\n onTimeChange: (time: Time | undefined) => void;\r\n is24HourMode?: boolean;\r\n placeholder?: string;\r\n disabled?: boolean;\r\n slotsProps?: {\r\n content?: HTMLAttributes<HTMLDivElement>;\r\n };\r\n};\r\n\r\nconst DesktopTimePicker: React.FC<DesktopTimePickerProps> = ({\r\n time,\r\n onTimeChange,\r\n className,\r\n slotsProps,\r\n is24HourMode = false,\r\n placeholder = \"Pick a Time\",\r\n ...restProps\r\n}) => {\r\n const [isOpen, setIsOpen] = useState(false);\r\n\r\n return (\r\n <Popover open={isOpen} onOpenChange={setIsOpen}>\r\n <PopoverTrigger asChild>\r\n <Button\r\n type=\"button\"\r\n variant=\"text\"\r\n className={cn(\r\n \"flex h-8 w-full items-center justify-between whitespace-nowrap rounded-sm border border-input bg-transparent ps-3 pe-1 py-1.5 text-xs ring-offset-background data-[placeholder]:text-muted-foreground hover:border hover:border-primary hover:bg-transparent focus:border focus:border-primary focus:outline-none focus:ring focus:ring-primary-100 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-text-300 disabled:border-gray-100 [&>span]:line-clamp-1 [&_svg]:disabled:text-text-300\",\r\n className,\r\n )}\r\n data-placeholder={!time ? \"\" : undefined}\r\n aria-label={time ? `Selected time: ${formatTimeLabel(time, is24HourMode)}` : placeholder}\r\n {...restProps}\r\n >\r\n {time ? formatTimeLabel(time, is24HourMode) : \"-- : --\"}\r\n </Button>\r\n </PopoverTrigger>\r\n <PopoverContent {...(slotsProps?.content ?? {})} className={cn(\"w-auto p-0\", slotsProps?.content?.className)}>\r\n <TimePickerContent isOpen={isOpen} is24HourMode={is24HourMode} onTimeChange={onTimeChange} time={time} slotsProps={slotsProps} />\r\n </PopoverContent>\r\n </Popover>\r\n );\r\n};\r\nexport { DesktopTimePicker, type DesktopTimePickerProps };\r\n"],"names":["formatTimeLabel","time","is24HourMode","minute","hourFromAmpm","hour","ampm","DesktopTimePicker","onTimeChange","className","slotsProps","placeholder","restProps","isOpen","setIsOpen","useState","jsxs","Popover","jsx","PopoverTrigger","Button","cn","PopoverContent","TimePickerContent"],"mappings":";;;;;;AASA,MAAMA,IAAkB,CAACC,GAAYC,MAA0B;AAC7D,QAAMC,IAASF,EAAK,OAAO,WAAW,SAAS,GAAG,GAAG;AAErD,MAAIC;AAEF,WAAO,IADMD,EAAK,OAAQA,EAAK,OAAO,MAAOA,EAAK,SAAS,OAAO,KAAK,KAAKA,EAAK,MAClE,WAAW,SAAS,GAAG,GAAG,CAAC,MAAME,CAAM;AAGxD,QAAMC,IAAeH,EAAK,OAAQA,EAAK,OAAO,MAAOA,EAAK,SAAS,OAAO,KAAK,KAAKA,EAAK,MACnFI,IAAOD,IAAe,MAAM,IAC5BE,IAAOL,EAAK,SAASG,KAAgB,KAAK,OAAO;AAEvD,SAAO,GAAGC,EAAK,SAAA,EAAW,SAAS,GAAG,GAAG,CAAC,MAAMF,CAAM,IAAIG,CAAI;AAChE,GAaMC,IAAsD,CAAC;AAAA,EAC3D,MAAAN;AAAA,EACA,cAAAO;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAR,IAAe;AAAA,EACf,aAAAS,IAAc;AAAA,EACd,GAAGC;AACL,MAAM;AACJ,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK;AAE1C,SACE,gBAAAC,EAACC,GAAA,EAAQ,MAAMJ,GAAQ,cAAcC,GACnC,UAAA;AAAA,IAAA,gBAAAI,EAACC,GAAA,EAAe,SAAO,IACrB,UAAA,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAQ;AAAA,QACR,WAAWC;AAAA,UACT;AAAA,UACAZ;AAAA,QAAA;AAAA,QAEF,oBAAmBR,IAAY,SAAL;AAAA,QAC1B,cAAYA,IAAO,kBAAkBD,EAAgBC,GAAMC,CAAY,CAAC,KAAKS;AAAA,QAC5E,GAAGC;AAAA,QAEH,UAAAX,IAAOD,EAAgBC,GAAMC,CAAY,IAAI;AAAA,MAAA;AAAA,IAAA,GAElD;AAAA,IACA,gBAAAgB,EAACI,KAAgB,GAAIZ,GAAY,WAAW,CAAA,GAAK,WAAWW,EAAG,cAAcX,GAAY,SAAS,SAAS,GACzG,UAAA,gBAAAQ,EAACK,GAAA,EAAkB,QAAAV,GAAgB,cAAAX,GAA4B,cAAAM,GAA4B,MAAAP,GAAY,YAAAS,EAAA,CAAwB,EAAA,CACjI;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"desktoptimepicker.es.js","sources":["../src/components/date-picker/DesktopTimePicker.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { HTMLAttributes, useState } from \"react\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\nimport { Button } from \"../button/Button\";\r\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover/Popover\";\r\nimport { Time, TimePickerContent } from \"./TimePickerContent\";\r\n\r\nconst formatTimeLabel = (time: Time, is24HourMode: boolean) => {\r\n const minute = time.minute.toString().padStart(2, \"0\");\r\n\r\n if (is24HourMode) {\r\n const hour = time.ampm ? (time.hour % 12) + (time.ampm === \"PM\" ? 12 : 0) : time.hour;\r\n return `${hour.toString().padStart(2, \"0\")} : ${minute}`;\r\n }\r\n\r\n const hourFromAmpm = time.ampm ? (time.hour % 12) + (time.ampm === \"PM\" ? 12 : 0) : time.hour;\r\n const hour = hourFromAmpm % 12 || 12;\r\n const ampm = time.ampm ?? (hourFromAmpm >= 12 ? \"PM\" : \"AM\");\r\n\r\n return `${hour.toString().padStart(2, \"0\")} : ${minute} ${ampm}`;\r\n};\r\n\r\n/**\r\n * Props for the desktop-only time picker.\r\n *\r\n * In 12-hour mode, the time value should include ampm.\r\n * In 24-hour mode, the time value should omit ampm and use hour values from 0-23.\r\n */\r\ntype DesktopTimePickerProps = HTMLAttributes<HTMLButtonElement> & {\r\n /** Current time value. */\r\n time: Time | undefined;\r\n /** Called whenever the selected time changes. */\r\n onTimeChange: (time: Time | undefined) => void;\r\n /** Enables 24-hour mode and hides the AM/PM column when true. */\r\n is24HourMode?: boolean;\r\n /** Accessible label and trigger fallback when no time is selected. */\r\n placeholder?: string;\r\n /** Disables the trigger button. */\r\n disabled?: boolean;\r\n /** Props forwarded to the popover content. */\r\n slotsProps?: {\r\n /** Props forwarded to the time picker content container. */\r\n content?: HTMLAttributes<HTMLDivElement>;\r\n };\r\n};\r\n\r\n/**\r\n * Desktop-only time picker rendered in a popover.\r\n * Use this component when you want the desktop interaction regardless of screen size.\r\n */\r\nconst DesktopTimePicker: React.FC<DesktopTimePickerProps> = ({\r\n time,\r\n onTimeChange,\r\n className,\r\n slotsProps,\r\n is24HourMode = false,\r\n placeholder = \"Pick a Time\",\r\n ...restProps\r\n}) => {\r\n const [isOpen, setIsOpen] = useState(false);\r\n\r\n return (\r\n <Popover open={isOpen} onOpenChange={setIsOpen}>\r\n <PopoverTrigger asChild>\r\n <Button\r\n type=\"button\"\r\n variant=\"text\"\r\n className={cn(\r\n \"flex h-8 w-full items-center justify-between whitespace-nowrap rounded-sm border border-input bg-transparent ps-3 pe-1 py-1.5 text-xs ring-offset-background data-[placeholder]:text-muted-foreground hover:border hover:border-primary hover:bg-transparent focus:border focus:border-primary focus:outline-none focus:ring focus:ring-primary-100 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-text-300 disabled:border-gray-100 [&>span]:line-clamp-1 [&_svg]:disabled:text-text-300\",\r\n className,\r\n )}\r\n data-placeholder={!time ? \"\" : undefined}\r\n aria-label={time ? `Selected time: ${formatTimeLabel(time, is24HourMode)}` : placeholder}\r\n {...restProps}\r\n >\r\n {time ? formatTimeLabel(time, is24HourMode) : \"-- : --\"}\r\n </Button>\r\n </PopoverTrigger>\r\n <PopoverContent {...(slotsProps?.content ?? {})} className={cn(\"w-auto p-0\", slotsProps?.content?.className)}>\r\n <TimePickerContent isOpen={isOpen} is24HourMode={is24HourMode} onTimeChange={onTimeChange} time={time} slotsProps={slotsProps} />\r\n </PopoverContent>\r\n </Popover>\r\n );\r\n};\r\nexport { DesktopTimePicker, type DesktopTimePickerProps };\r\n"],"names":["formatTimeLabel","time","is24HourMode","minute","hourFromAmpm","hour","ampm","DesktopTimePicker","onTimeChange","className","slotsProps","placeholder","restProps","isOpen","setIsOpen","useState","jsxs","Popover","jsx","PopoverTrigger","Button","cn","PopoverContent","TimePickerContent"],"mappings":";;;;;;AASA,MAAMA,IAAkB,CAACC,GAAYC,MAA0B;AAC7D,QAAMC,IAASF,EAAK,OAAO,WAAW,SAAS,GAAG,GAAG;AAErD,MAAIC;AAEF,WAAO,IADMD,EAAK,OAAQA,EAAK,OAAO,MAAOA,EAAK,SAAS,OAAO,KAAK,KAAKA,EAAK,MAClE,WAAW,SAAS,GAAG,GAAG,CAAC,MAAME,CAAM;AAGxD,QAAMC,IAAeH,EAAK,OAAQA,EAAK,OAAO,MAAOA,EAAK,SAAS,OAAO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";\r\n\r\nimport { FormControl, FormField, FormItem, FormLabel, FormMessage } from \"../form/Form\";\r\nimport { SlotProps } from \"@radix-ui/react-slot\";\r\nimport { Control, ControllerProps, FieldPath, FieldValues } from \"react-hook-form\";\r\nimport { DatePicker, type DatePickerProps } from \"../date-picker/DatePicker\";\r\n\r\ntype FormDatePickerProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = Omit<\r\n ControllerProps<TFieldValues, TName>,\r\n \"render\"\r\n> &\r\n React.ComponentProps<typeof FormItem> & {\r\n label: string;\r\n control: Control<TFieldValues>;\r\n required?: boolean;\r\n disabled?: boolean;\r\n readOnly?: boolean;\r\n slotProps?: {\r\n formLabelProps?: React.HTMLAttributes<HTMLLabelElement> & React.RefAttributes<HTMLLabelElement>;\r\n formMessageProps?: React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>;\r\n formControlProps?: Omit<SlotProps & React.RefAttributes<HTMLElement>, \"ref\"> & React.RefAttributes<HTMLElement>;\r\n datepickerProps?: DatePickerProps;\r\n };\r\n };\r\n\r\nconst FormDatePicker = <TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>>(props: FormDatePickerProps<TFieldValues, TName>) => {\r\n const { name, control, defaultValue, disabled, readOnly, rules, shouldUnregister, label, slotProps, required, ...formItemProps } = props;\r\n\r\n return (\r\n <FormField\r\n control={control}\r\n name={name}\r\n defaultValue={defaultValue}\r\n disabled={disabled}\r\n rules={rules}\r\n shouldUnregister={shouldUnregister}\r\n render={({ field }) => {\r\n return (\r\n <FormItem {...formItemProps}>\r\n <FormLabel {...(slotProps?.formLabelProps ?? {})}>\r\n {label}\r\n {required && <span className=\"text-danger text-sm leading-4\">*</span>}\r\n </FormLabel>\r\n <FormControl {...(slotProps?.formControlProps ?? {})}>\r\n <DatePicker {...(slotProps?.datepickerProps ?? {})} selected={field.value} onSelect={field.onChange} disabled={disabled || readOnly} />\r\n </FormControl>\r\n <FormMessage {...(slotProps?.formMessageProps ?? {})} />\r\n </FormItem>\r\n );\r\n }}\r\n />\r\n );\r\n};\r\nexport { FormDatePicker, type FormDatePickerProps };\r\n"],"names":["FormDatePicker","props","name","control","defaultValue","disabled","readOnly","rules","shouldUnregister","label","slotProps","required","formItemProps","jsx","FormField","field","jsxs","FormItem","FormLabel","FormControl","DatePicker","FormMessage"],"mappings":";;;AAyBA,MAAMA,IAAiB,CAA0EC,MAAoD;AACnJ,QAAM,EAAE,MAAAC,GAAM,SAAAC,GAAS,cAAAC,GAAc,UAAAC,GAAU,UAAAC,GAAU,OAAAC,GAAO,kBAAAC,GAAkB,OAAAC,GAAO,WAAAC,GAAW,UAAAC,GAAU,GAAGC,MAAkBX;AAEnI,SACE,gBAAAY;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAAAX;AAAA,MACA,MAAAD;AAAA,MACA,cAAAE;AAAA,MACA,UAAAC;AAAA,MACA,OAAAE;AAAA,MACA,kBAAAC;AAAA,MACA,QAAQ,CAAC,EAAE,OAAAO,QAEP,gBAAAC,EAACC,GAAA,EAAU,GAAGL,GACZ,UAAA;AAAA,QAAA,gBAAAI,EAACE,GAAA,EAAW,GAAIR,GAAW,kBAAkB,CAAA,GAC1C,UAAA;AAAA,UAAAD;AAAA,UACAE,KAAY,gBAAAE,EAAC,QAAA,EAAK,WAAU,iCAAgC,UAAA,IAAA,CAAC;AAAA,QAAA,GAChE;AAAA,QACA,gBAAAA,EAACM,KAAa,GAAIT,GAAW,oBAAoB,IAC/C,UAAA,gBAAAG,EAACO,GAAA,EAAY,GAAIV,GAAW,mBAAmB,CAAA,GAAK,UAAUK,EAAM,OAAO,UAAUA,EAAM,UAAU,UAAUV,KAAYC,EAAA,CAAU,EAAA,CACvI;AAAA,0BACCe,GAAA,EAAa,GAAIX,GAAW,oBAAoB,CAAA,EAAC,CAAI;AAAA,MAAA,GACxD;AAAA,IAEJ;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"formdatepicker.es.js","sources":["../src/components/form-date-picker/FormDatePicker.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { FormControl, FormField, FormItem, FormLabel, FormMessage } from \"../form/Form\";\r\nimport { SlotProps } from \"@radix-ui/react-slot\";\r\nimport { Control, ControllerProps, FieldPathByValue, FieldValues } from \"react-hook-form\";\r\nimport { DatePicker, type DateOnlyString, type DatePickerProps } from \"../date-picker/DatePicker\";\r\n\r\n/**\r\n * Props for FormDatePicker.\r\n *\r\n * The bound field value should be a YYYY-MM-DD string or undefined.\r\n * Use slotProps.datepickerProps to forward props to the underlying DatePicker.\r\n */\r\ntype FormDatePickerProps<TFieldValues extends FieldValues, TName extends FieldPathByValue<TFieldValues, DateOnlyString | undefined>> = Omit<\r\n ControllerProps<TFieldValues, TName>,\r\n \"render\"\r\n> &\r\n React.ComponentProps<typeof FormItem> & {\r\n /** Label rendered above the picker. */\r\n label: string;\r\n /** React Hook Form control instance. */\r\n control: Control<TFieldValues>;\r\n /** Shows the required asterisk next to the label. */\r\n required?: boolean;\r\n /** Disables the picker and the field interaction. */\r\n disabled?: boolean;\r\n /** Keeps the field readable while preventing edits. */\r\n readOnly?: boolean;\r\n /** Props forwarded to the form shell and underlying DatePicker. */\r\n slotProps?: {\r\n formLabelProps?: React.HTMLAttributes<HTMLLabelElement> & React.RefAttributes<HTMLLabelElement>;\r\n formMessageProps?: React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>;\r\n formControlProps?: Omit<SlotProps & React.RefAttributes<HTMLElement>, \"ref\"> & React.RefAttributes<HTMLElement>;\r\n datepickerProps?: DatePickerProps;\r\n };\r\n };\r\n\r\n/**\r\n * React Hook Form wrapper around DatePicker.\r\n *\r\n * Binds a YYYY-MM-DD field value to the shared date picker and renders the\r\n * label, validation message, and disabled/read-only handling.\r\n *\r\n * @example\r\n * const form = useForm<{ dueDate?: string }>({ defaultValues: { dueDate: \"2025-12-24\" } });\r\n *\r\n * <FormDatePicker\r\n * control={form.control}\r\n * name=\"dueDate\"\r\n * label=\"Due date\"\r\n * slotProps={{ datepickerProps: { placeholder: \"Pick a due date\" } }}\r\n * />\r\n */\r\nconst FormDatePicker = <TFieldValues extends FieldValues, TName extends FieldPathByValue<TFieldValues, DateOnlyString | undefined>>(\r\n props: FormDatePickerProps<TFieldValues, TName>,\r\n) => {\r\n const { name, control, defaultValue, disabled, readOnly, rules, shouldUnregister, label, slotProps, required, ...formItemProps } = props;\r\n\r\n return (\r\n <FormField\r\n control={control}\r\n name={name}\r\n defaultValue={defaultValue}\r\n disabled={disabled}\r\n rules={rules}\r\n shouldUnregister={shouldUnregister}\r\n render={({ field }) => {\r\n return (\r\n <FormItem {...formItemProps}>\r\n <FormLabel {...(slotProps?.formLabelProps ?? {})}>\r\n {label}\r\n {required && <span className=\"text-danger text-sm leading-4\">*</span>}\r\n </FormLabel>\r\n <FormControl {...(slotProps?.formControlProps ?? {})}>\r\n <DatePicker {...(slotProps?.datepickerProps ?? {})} selected={field.value} onSelect={field.onChange} disabled={disabled || readOnly} />\r\n </FormControl>\r\n <FormMessage {...(slotProps?.formMessageProps ?? {})} />\r\n </FormItem>\r\n );\r\n }}\r\n />\r\n );\r\n};\r\nexport { FormDatePicker, type FormDatePickerProps };\r\n"],"names":["FormDatePicker","props","name","control","defaultValue","disabled","readOnly","rules","shouldUnregister","label","slotProps","required","formItemProps","jsx","FormField","field","jsxs","FormItem","FormLabel","FormControl","DatePicker","FormMessage"],"mappings":";;;AAqDA,MAAMA,IAAiB,CACrBC,MACG;AACH,QAAM,EAAE,MAAAC,GAAM,SAAAC,GAAS,cAAAC,GAAc,UAAAC,GAAU,UAAAC,GAAU,OAAAC,GAAO,kBAAAC,GAAkB,OAAAC,GAAO,WAAAC,GAAW,UAAAC,GAAU,GAAGC,MAAkBX;AAEnI,SACE,gBAAAY;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAAAX;AAAA,MACA,MAAAD;AAAA,MACA,cAAAE;AAAA,MACA,UAAAC;AAAA,MACA,OAAAE;AAAA,MACA,kBAAAC;AAAA,MACA,QAAQ,CAAC,EAAE,OAAAO,QAEP,gBAAAC,EAACC,GAAA,EAAU,GAAGL,GACZ,UAAA;AAAA,QAAA,gBAAAI,EAACE,GAAA,EAAW,GAAIR,GAAW,kBAAkB,CAAA,GAC1C,UAAA;AAAA,UAAAD;AAAA,UACAE,KAAY,gBAAAE,EAAC,QAAA,EAAK,WAAU,iCAAgC,UAAA,IAAA,CAAC;AAAA,QAAA,GAChE;AAAA,QACA,gBAAAA,EAACM,KAAa,GAAIT,GAAW,oBAAoB,IAC/C,UAAA,gBAAAG,EAACO,GAAA,EAAY,GAAIV,GAAW,mBAAmB,CAAA,GAAK,UAAUK,EAAM,OAAO,UAAUA,EAAM,UAAU,UAAUV,KAAYC,EAAA,CAAU,EAAA,CACvI;AAAA,0BACCe,GAAA,EAAa,GAAIX,GAAW,oBAAoB,CAAA,EAAC,CAAI;AAAA,MAAA,GACxD;AAAA,IAEJ;AAAA,EAAA;AAGN;"}
@@ -1 +1 @@
1
- {"version":3,"file":"formdaterangepicker.es.js","sources":["../src/components/form-date-range-picker/FormDateRangePicker.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { FormControl, FormField, FormItem, FormLabel, FormMessage } from \"../form/Form\";\r\nimport { SlotProps } from \"@radix-ui/react-slot\";\r\nimport { Control, ControllerProps, FieldPath, FieldValues } from \"react-hook-form\";\r\n\r\nimport { DateRangePicker, DateRangePickerProps } from \"../date-picker/DateRangePicker\";\r\n\r\ntype FormDateRangePickerProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = Omit<\r\n ControllerProps<TFieldValues, TName>,\r\n \"render\"\r\n> &\r\n React.ComponentProps<typeof FormItem> & {\r\n label: string;\r\n control: Control<TFieldValues>;\r\n required?: boolean;\r\n readOnly?: boolean;\r\n slotProps?: {\r\n formLabelProps?: React.HTMLAttributes<HTMLLabelElement> & React.RefAttributes<HTMLLabelElement>;\r\n formMessageProps?: React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>;\r\n formControlProps?: Omit<SlotProps & React.RefAttributes<HTMLElement>, \"ref\"> & React.RefAttributes<HTMLElement>;\r\n datepickerProps?: DateRangePickerProps;\r\n };\r\n };\r\n\r\nconst FormDateRangePicker = <TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>>(\r\n props: FormDateRangePickerProps<TFieldValues, TName>,\r\n) => {\r\n const { name, control, defaultValue, disabled, readOnly, rules, shouldUnregister, label, slotProps, required, ...formItemProps } = props;\r\n\r\n return (\r\n <FormField\r\n control={control}\r\n name={name}\r\n defaultValue={defaultValue}\r\n disabled={disabled}\r\n rules={rules}\r\n shouldUnregister={shouldUnregister}\r\n render={({ field }) => {\r\n return (\r\n <FormItem {...formItemProps}>\r\n <FormLabel {...(slotProps?.formLabelProps ?? {})}>\r\n {label}\r\n {required && <span className=\"text-danger text-sm leading-4\">*</span>}\r\n </FormLabel>\r\n <FormControl {...(slotProps?.formControlProps ?? {})}>\r\n <DateRangePicker\r\n {...(slotProps?.datepickerProps ?? {})}\r\n selected={field.value}\r\n onSelect={field.onChange}\r\n disabled={disabled || readOnly}\r\n />\r\n </FormControl>\r\n <FormMessage {...(slotProps?.formMessageProps ?? {})} />\r\n </FormItem>\r\n );\r\n }}\r\n />\r\n );\r\n};\r\nexport { FormDateRangePicker, type FormDateRangePickerProps };\r\n"],"names":["FormDateRangePicker","props","name","control","defaultValue","disabled","readOnly","rules","shouldUnregister","label","slotProps","required","formItemProps","jsx","FormField","field","jsxs","FormItem","FormLabel","FormControl","DateRangePicker","FormMessage"],"mappings":";;;AAyBA,MAAMA,IAAsB,CAC1BC,MACG;AACH,QAAM,EAAE,MAAAC,GAAM,SAAAC,GAAS,cAAAC,GAAc,UAAAC,GAAU,UAAAC,GAAU,OAAAC,GAAO,kBAAAC,GAAkB,OAAAC,GAAO,WAAAC,GAAW,UAAAC,GAAU,GAAGC,MAAkBX;AAEnI,SACE,gBAAAY;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAAAX;AAAA,MACA,MAAAD;AAAA,MACA,cAAAE;AAAA,MACA,UAAAC;AAAA,MACA,OAAAE;AAAA,MACA,kBAAAC;AAAA,MACA,QAAQ,CAAC,EAAE,OAAAO,QAEP,gBAAAC,EAACC,GAAA,EAAU,GAAGL,GACZ,UAAA;AAAA,QAAA,gBAAAI,EAACE,GAAA,EAAW,GAAIR,GAAW,kBAAkB,CAAA,GAC1C,UAAA;AAAA,UAAAD;AAAA,UACAE,KAAY,gBAAAE,EAAC,QAAA,EAAK,WAAU,iCAAgC,UAAA,IAAA,CAAC;AAAA,QAAA,GAChE;AAAA,0BACCM,GAAA,EAAa,GAAIT,GAAW,oBAAoB,CAAA,GAC/C,UAAA,gBAAAG;AAAA,UAACO;AAAA,UAAA;AAAA,YACE,GAAIV,GAAW,mBAAmB,CAAA;AAAA,YACnC,UAAUK,EAAM;AAAA,YAChB,UAAUA,EAAM;AAAA,YAChB,UAAUV,KAAYC;AAAA,UAAA;AAAA,QAAA,GAE1B;AAAA,0BACCe,GAAA,EAAa,GAAIX,GAAW,oBAAoB,CAAA,EAAC,CAAI;AAAA,MAAA,GACxD;AAAA,IAEJ;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"formdaterangepicker.es.js","sources":["../src/components/form-date-range-picker/FormDateRangePicker.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { FormControl, FormField, FormItem, FormLabel, FormMessage } from \"../form/Form\";\r\nimport { SlotProps } from \"@radix-ui/react-slot\";\r\nimport { Control, ControllerProps, FieldPathByValue, FieldValues } from \"react-hook-form\";\r\n\r\nimport { DateRangePicker, type DateOnlyRange, type DateRangePickerProps } from \"../date-picker/DateRangePicker\";\r\n\r\n/**\r\n * Props for FormDateRangePicker.\r\n *\r\n * The bound field value should be an object shaped like\r\n * { from?: \"YYYY-MM-DD\", to?: \"YYYY-MM-DD\" } or undefined.\r\n * Use slotProps.datepickerProps to forward props to the underlying DateRangePicker.\r\n */\r\ntype FormDateRangePickerProps<TFieldValues extends FieldValues, TName extends FieldPathByValue<TFieldValues, DateOnlyRange | undefined>> = Omit<\r\n ControllerProps<TFieldValues, TName>,\r\n \"render\"\r\n> &\r\n React.ComponentProps<typeof FormItem> & {\r\n /** Label rendered above the picker. */\r\n label: string;\r\n /** React Hook Form control instance. */\r\n control: Control<TFieldValues>;\r\n /** Shows the required asterisk next to the label. */\r\n required?: boolean;\r\n /** Keeps the field readable while preventing edits. */\r\n readOnly?: boolean;\r\n /** Props forwarded to the form shell and underlying DateRangePicker. */\r\n slotProps?: {\r\n formLabelProps?: React.HTMLAttributes<HTMLLabelElement> & React.RefAttributes<HTMLLabelElement>;\r\n formMessageProps?: React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>;\r\n formControlProps?: Omit<SlotProps & React.RefAttributes<HTMLElement>, \"ref\"> & React.RefAttributes<HTMLElement>;\r\n datepickerProps?: DateRangePickerProps;\r\n };\r\n };\r\n\r\n/**\r\n * React Hook Form wrapper around DateRangePicker.\r\n *\r\n * Binds a { from, to } date-only string object to the shared range picker and\r\n * renders the label, validation message, and read-only handling.\r\n *\r\n * @example\r\n * const form = useForm<{ vacation?: { from?: string; to?: string } }>({\r\n * defaultValues: { vacation: { from: \"2025-12-24\", to: \"2025-12-31\" } },\r\n * });\r\n *\r\n * <FormDateRangePicker\r\n * control={form.control}\r\n * name=\"vacation\"\r\n * label=\"Vacation\"\r\n * slotProps={{ datepickerProps: { fromText: \"Start\", toText: \"End\" } }}\r\n * />\r\n */\r\nconst FormDateRangePicker = <TFieldValues extends FieldValues, TName extends FieldPathByValue<TFieldValues, DateOnlyRange | undefined>>(\r\n props: FormDateRangePickerProps<TFieldValues, TName>,\r\n) => {\r\n const { name, control, defaultValue, disabled, readOnly, rules, shouldUnregister, label, slotProps, required, ...formItemProps } = props;\r\n\r\n return (\r\n <FormField\r\n control={control}\r\n name={name}\r\n defaultValue={defaultValue}\r\n disabled={disabled}\r\n rules={rules}\r\n shouldUnregister={shouldUnregister}\r\n render={({ field }) => {\r\n return (\r\n <FormItem {...formItemProps}>\r\n <FormLabel {...(slotProps?.formLabelProps ?? {})}>\r\n {label}\r\n {required && <span className=\"text-danger text-sm leading-4\">*</span>}\r\n </FormLabel>\r\n <FormControl {...(slotProps?.formControlProps ?? {})}>\r\n <DateRangePicker\r\n {...(slotProps?.datepickerProps ?? {})}\r\n selected={field.value}\r\n onSelect={field.onChange}\r\n disabled={disabled || readOnly}\r\n />\r\n </FormControl>\r\n <FormMessage {...(slotProps?.formMessageProps ?? {})} />\r\n </FormItem>\r\n );\r\n }}\r\n />\r\n );\r\n};\r\nexport { FormDateRangePicker, type FormDateRangePickerProps };\r\n"],"names":["FormDateRangePicker","props","name","control","defaultValue","disabled","readOnly","rules","shouldUnregister","label","slotProps","required","formItemProps","jsx","FormField","field","jsxs","FormItem","FormLabel","FormControl","DateRangePicker","FormMessage"],"mappings":";;;AAuDA,MAAMA,IAAsB,CAC1BC,MACG;AACH,QAAM,EAAE,MAAAC,GAAM,SAAAC,GAAS,cAAAC,GAAc,UAAAC,GAAU,UAAAC,GAAU,OAAAC,GAAO,kBAAAC,GAAkB,OAAAC,GAAO,WAAAC,GAAW,UAAAC,GAAU,GAAGC,MAAkBX;AAEnI,SACE,gBAAAY;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAAAX;AAAA,MACA,MAAAD;AAAA,MACA,cAAAE;AAAA,MACA,UAAAC;AAAA,MACA,OAAAE;AAAA,MACA,kBAAAC;AAAA,MACA,QAAQ,CAAC,EAAE,OAAAO,QAEP,gBAAAC,EAACC,GAAA,EAAU,GAAGL,GACZ,UAAA;AAAA,QAAA,gBAAAI,EAACE,GAAA,EAAW,GAAIR,GAAW,kBAAkB,CAAA,GAC1C,UAAA;AAAA,UAAAD;AAAA,UACAE,KAAY,gBAAAE,EAAC,QAAA,EAAK,WAAU,iCAAgC,UAAA,IAAA,CAAC;AAAA,QAAA,GAChE;AAAA,0BACCM,GAAA,EAAa,GAAIT,GAAW,oBAAoB,CAAA,GAC/C,UAAA,gBAAAG;AAAA,UAACO;AAAA,UAAA;AAAA,YACE,GAAIV,GAAW,mBAAmB,CAAA;AAAA,YACnC,UAAUK,EAAM;AAAA,YAChB,UAAUA,EAAM;AAAA,YAChB,UAAUV,KAAYC;AAAA,UAAA;AAAA,QAAA,GAE1B;AAAA,0BACCe,GAAA,EAAa,GAAIX,GAAW,oBAAoB,CAAA,EAAC,CAAI;AAAA,MAAA,GACxD;AAAA,IAEJ;AAAA,EAAA;AAGN;"}
@@ -1 +1 @@
1
- {"version":3,"file":"formtimepicker.es.js","sources":["../src/components/form-time-picker/FormTimePicker.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { SlotProps } from \"@radix-ui/react-slot\";\r\nimport { Control, ControllerProps, FieldPath, FieldValues } from \"react-hook-form\";\r\n\r\nimport { TimePicker, TimePickerProps } from \"../date-picker/TimePicker\";\r\nimport { FormControl, FormField, FormItem, FormLabel, FormMessage } from \"../form/Form\";\r\n\r\ntype FormTimePickerProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = Omit<\r\n ControllerProps<TFieldValues, TName>,\r\n \"render\"\r\n> &\r\n React.ComponentProps<typeof FormItem> & {\r\n label: string;\r\n control: Control<TFieldValues>;\r\n required?: boolean;\r\n readOnly?: boolean;\r\n is24HourMode?: boolean;\r\n slotProps?: {\r\n formLabelProps?: React.HTMLAttributes<HTMLLabelElement> & React.RefAttributes<HTMLLabelElement>;\r\n formMessageProps?: React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>;\r\n formControlProps?: Omit<SlotProps & React.RefAttributes<HTMLElement>, \"ref\"> & React.RefAttributes<HTMLElement>;\r\n timepickerProps?: Partial<TimePickerProps>;\r\n };\r\n };\r\n\r\nconst FormTimePicker = <TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>>(props: FormTimePickerProps<TFieldValues, TName>) => {\r\n const { name, control, defaultValue, disabled, readOnly, rules, shouldUnregister, label, slotProps, required, is24HourMode, ...formItemProps } =\r\n props;\r\n\r\n return (\r\n <FormField\r\n control={control}\r\n name={name}\r\n defaultValue={defaultValue}\r\n disabled={disabled}\r\n rules={rules}\r\n shouldUnregister={shouldUnregister}\r\n render={({ field }) => {\r\n return (\r\n <FormItem {...formItemProps}>\r\n <FormLabel {...(slotProps?.formLabelProps ?? {})}>\r\n {label}\r\n {required && <span className=\"text-danger text-sm leading-4\">*</span>}\r\n </FormLabel>\r\n <FormControl {...(slotProps?.formControlProps ?? {})}>\r\n <TimePicker\r\n {...(slotProps?.timepickerProps ?? {})}\r\n time={field.value}\r\n onTimeChange={field.onChange}\r\n disabled={disabled || readOnly}\r\n is24HourMode={is24HourMode}\r\n />\r\n </FormControl>\r\n <FormMessage {...(slotProps?.formMessageProps ?? {})} />\r\n </FormItem>\r\n );\r\n }}\r\n />\r\n );\r\n};\r\nexport { FormTimePicker, type FormTimePickerProps };\r\n"],"names":["FormTimePicker","props","name","control","defaultValue","disabled","readOnly","rules","shouldUnregister","label","slotProps","required","is24HourMode","formItemProps","jsx","FormField","field","jsxs","FormItem","FormLabel","FormControl","TimePicker","FormMessage"],"mappings":";;;AA0BA,MAAMA,IAAiB,CAA0EC,MAAoD;AACnJ,QAAM,EAAE,MAAAC,GAAM,SAAAC,GAAS,cAAAC,GAAc,UAAAC,GAAU,UAAAC,GAAU,OAAAC,GAAO,kBAAAC,GAAkB,OAAAC,GAAO,WAAAC,GAAW,UAAAC,GAAU,cAAAC,GAAc,GAAGC,MAC7HZ;AAEF,SACE,gBAAAa;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAAAZ;AAAA,MACA,MAAAD;AAAA,MACA,cAAAE;AAAA,MACA,UAAAC;AAAA,MACA,OAAAE;AAAA,MACA,kBAAAC;AAAA,MACA,QAAQ,CAAC,EAAE,OAAAQ,QAEP,gBAAAC,EAACC,GAAA,EAAU,GAAGL,GACZ,UAAA;AAAA,QAAA,gBAAAI,EAACE,GAAA,EAAW,GAAIT,GAAW,kBAAkB,CAAA,GAC1C,UAAA;AAAA,UAAAD;AAAA,UACAE,KAAY,gBAAAG,EAAC,QAAA,EAAK,WAAU,iCAAgC,UAAA,IAAA,CAAC;AAAA,QAAA,GAChE;AAAA,0BACCM,GAAA,EAAa,GAAIV,GAAW,oBAAoB,CAAA,GAC/C,UAAA,gBAAAI;AAAA,UAACO;AAAA,UAAA;AAAA,YACE,GAAIX,GAAW,mBAAmB,CAAA;AAAA,YACnC,MAAMM,EAAM;AAAA,YACZ,cAAcA,EAAM;AAAA,YACpB,UAAUX,KAAYC;AAAA,YACtB,cAAAM;AAAA,UAAA;AAAA,QAAA,GAEJ;AAAA,0BACCU,GAAA,EAAa,GAAIZ,GAAW,oBAAoB,CAAA,EAAC,CAAI;AAAA,MAAA,GACxD;AAAA,IAEJ;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"formtimepicker.es.js","sources":["../src/components/form-time-picker/FormTimePicker.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { SlotProps } from \"@radix-ui/react-slot\";\r\nimport { Control, ControllerProps, FieldPath, FieldValues } from \"react-hook-form\";\r\n\r\nimport { TimePicker, TimePickerProps } from \"../date-picker/TimePicker\";\r\nimport { FormControl, FormField, FormItem, FormLabel, FormMessage } from \"../form/Form\";\r\n\r\n/**\r\n * Props for FormTimePicker.\r\n *\r\n * The bound field value should be a Time object or undefined.\r\n * In 12-hour mode, include ampm in the stored value.\r\n * In 24-hour mode, omit ampm and use hour values from 0-23.\r\n */\r\ntype FormTimePickerProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = Omit<\r\n ControllerProps<TFieldValues, TName>,\r\n \"render\"\r\n> &\r\n React.ComponentProps<typeof FormItem> & {\r\n /** Label rendered above the picker. */\r\n label: string;\r\n /** React Hook Form control instance. */\r\n control: Control<TFieldValues>;\r\n /** Shows the required asterisk next to the label. */\r\n required?: boolean;\r\n /** Keeps the field readable while preventing edits. */\r\n readOnly?: boolean;\r\n /** Enables 24-hour mode and hides the AM/PM selector when true. */\r\n is24HourMode?: boolean;\r\n /** Props forwarded to the form shell and underlying TimePicker. */\r\n slotProps?: {\r\n formLabelProps?: React.HTMLAttributes<HTMLLabelElement> & React.RefAttributes<HTMLLabelElement>;\r\n formMessageProps?: React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>;\r\n formControlProps?: Omit<SlotProps & React.RefAttributes<HTMLElement>, \"ref\"> & React.RefAttributes<HTMLElement>;\r\n /** Props forwarded to the underlying TimePicker. */\r\n timepickerProps?: Partial<TimePickerProps>;\r\n };\r\n };\r\n\r\n/**\r\n * React Hook Form wrapper around TimePicker.\r\n *\r\n * Binds a Time object to the shared time picker and renders the label,\r\n * validation message, and disabled/read-only handling.\r\n *\r\n * @example\r\n * const form = useForm<{ reminder?: { hour: number; minute: number; ampm?: \"AM\" | \"PM\" } }>({\r\n * defaultValues: { reminder: { hour: 9, minute: 30, ampm: \"AM\" } },\r\n * });\r\n *\r\n * <FormTimePicker control={form.control} name=\"reminder\" label=\"Reminder time\" />\r\n *\r\n * @example\r\n * const form = useForm<{ shiftStart?: { hour: number; minute: number } }>({\r\n * defaultValues: { shiftStart: { hour: 14, minute: 0 } },\r\n * });\r\n *\r\n * <FormTimePicker control={form.control} name=\"shiftStart\" label=\"Shift start\" is24HourMode />\r\n */\r\nconst FormTimePicker = <TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>>(props: FormTimePickerProps<TFieldValues, TName>) => {\r\n const { name, control, defaultValue, disabled, readOnly, rules, shouldUnregister, label, slotProps, required, is24HourMode, ...formItemProps } =\r\n props;\r\n\r\n return (\r\n <FormField\r\n control={control}\r\n name={name}\r\n defaultValue={defaultValue}\r\n disabled={disabled}\r\n rules={rules}\r\n shouldUnregister={shouldUnregister}\r\n render={({ field }) => {\r\n return (\r\n <FormItem {...formItemProps}>\r\n <FormLabel {...(slotProps?.formLabelProps ?? {})}>\r\n {label}\r\n {required && <span className=\"text-danger text-sm leading-4\">*</span>}\r\n </FormLabel>\r\n <FormControl {...(slotProps?.formControlProps ?? {})}>\r\n <TimePicker\r\n {...(slotProps?.timepickerProps ?? {})}\r\n time={field.value}\r\n onTimeChange={field.onChange}\r\n disabled={disabled || readOnly}\r\n is24HourMode={is24HourMode}\r\n />\r\n </FormControl>\r\n <FormMessage {...(slotProps?.formMessageProps ?? {})} />\r\n </FormItem>\r\n );\r\n }}\r\n />\r\n );\r\n};\r\nexport { FormTimePicker, type FormTimePickerProps };\r\n"],"names":["FormTimePicker","props","name","control","defaultValue","disabled","readOnly","rules","shouldUnregister","label","slotProps","required","is24HourMode","formItemProps","jsx","FormField","field","jsxs","FormItem","FormLabel","FormControl","TimePicker","FormMessage"],"mappings":";;;AA4DA,MAAMA,IAAiB,CAA0EC,MAAoD;AACnJ,QAAM,EAAE,MAAAC,GAAM,SAAAC,GAAS,cAAAC,GAAc,UAAAC,GAAU,UAAAC,GAAU,OAAAC,GAAO,kBAAAC,GAAkB,OAAAC,GAAO,WAAAC,GAAW,UAAAC,GAAU,cAAAC,GAAc,GAAGC,MAC7HZ;AAEF,SACE,gBAAAa;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAAAZ;AAAA,MACA,MAAAD;AAAA,MACA,cAAAE;AAAA,MACA,UAAAC;AAAA,MACA,OAAAE;AAAA,MACA,kBAAAC;AAAA,MACA,QAAQ,CAAC,EAAE,OAAAQ,QAEP,gBAAAC,EAACC,GAAA,EAAU,GAAGL,GACZ,UAAA;AAAA,QAAA,gBAAAI,EAACE,GAAA,EAAW,GAAIT,GAAW,kBAAkB,CAAA,GAC1C,UAAA;AAAA,UAAAD;AAAA,UACAE,KAAY,gBAAAG,EAAC,QAAA,EAAK,WAAU,iCAAgC,UAAA,IAAA,CAAC;AAAA,QAAA,GAChE;AAAA,0BACCM,GAAA,EAAa,GAAIV,GAAW,oBAAoB,CAAA,GAC/C,UAAA,gBAAAI;AAAA,UAACO;AAAA,UAAA;AAAA,YACE,GAAIX,GAAW,mBAAmB,CAAA;AAAA,YACnC,MAAMM,EAAM;AAAA,YACZ,cAAcA,EAAM;AAAA,YACpB,UAAUX,KAAYC;AAAA,YACtB,cAAAM;AAAA,UAAA;AAAA,QAAA,GAEJ;AAAA,0BACCU,GAAA,EAAa,GAAIZ,GAAW,oBAAoB,CAAA,EAAC,CAAI;AAAA,MAAA,GACxD;AAAA,IAEJ;AAAA,EAAA;AAGN;"}
package/dist/index.d.ts CHANGED
@@ -13,8 +13,8 @@ export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, Comma
13
13
  export { ConfirmProvider, useConfirm } from './components/confirm/Confirm';
14
14
  export { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, } from './components/context-menu/ContextMenu';
15
15
  export { DataGrid, DataGridContent, DataGridActionBar, SearchAction, FreezeAction, PrintAction, RefreshAction, ExtraActions, DeleteAction, type DataGridProps, type DataGridContentProps, type DatagridActionBarProps, type SearchActionProps, type FreezeActionProps, type RefreshActionProps, type ExtraActionsProps, type DeleteActionProps, useDataGrid, dataGridDefaultTheme, } from './components/data-grid/DataGrid';
16
- export { DatePicker, DesktopDatePicker, MobileDatePicker, type DatePickerProps, type DesktopDatePickerProps, type MobileDatePickerProps, } from './components/date-picker/DatePicker';
17
- export { DateRangePicker, DesktopDateRangePicker, MobileDateRangePicker, type DateRangePickerProps, type DesktopDateRangePickerProps, type MobileDateRangePickerProps, } from './components/date-picker/DateRangePicker';
16
+ export { DatePicker, DesktopDatePicker, MobileDatePicker, type DateOnlyString, type DatePickerProps, type DesktopDatePickerProps, type DateValue, type MobileDatePickerProps, } from './components/date-picker/DatePicker';
17
+ export { DateRangePicker, DesktopDateRangePicker, MobileDateRangePicker, type DateOnlyRange, type DateRangePickerProps, type DesktopDateRangePickerProps, type DateRangeValue, type MobileDateRangePickerProps, } from './components/date-picker/DateRangePicker';
18
18
  export { TimePicker, MobileTimePicker, DesktopTimePicker, type Time, type TimePickerProps, type MobileTimePickerProps, type DesktopTimePickerProps, } from './components/date-picker/TimePicker';
19
19
  export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, type DialogCloseProps, type DialogContentProps, type DialogDescriptionProps, type DialogOverlayProps, type DialogPortalProps, type DialogProps, type DialogTitleProps, type DialogTriggerProps, } from './components/dialog/Dialog';
20
20
  export { Drawer, DrawerContent, DrawerMain, type DrawerContentProps, type DrawerMainProps, type DrawerProps } from './components/drawer/Drawer';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAChH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,mBAAmB,GACpB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EACL,IAAI,EACJ,UAAU,EACV,UAAU,EACV,SAAS,EACT,eAAe,EACf,WAAW,EACX,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,oBAAo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AAmC,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,EACd,eAAe,EACf,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,GAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC"}
@@ -1,57 +1,62 @@
1
1
  import { jsxs as a, Fragment as N, jsx as e } from "react/jsx-runtime";
2
- import * as m from "react";
3
- import { VisuallyHidden as C } from "@radix-ui/react-visually-hidden";
4
- import { Calendar as k } from "@trsys-tech/matrix-icons";
5
- import { cn as p } from "./utils.es.js";
2
+ import * as l from "react";
3
+ import { VisuallyHidden as k } from "@radix-ui/react-visually-hidden";
4
+ import { Calendar as S } from "@trsys-tech/matrix-icons";
5
+ import { cn as f } from "./utils.es.js";
6
6
  import { Calendar as j } from "./calendar.es.js";
7
- import { Button as o } from "./button.es.js";
8
- import { Dialog as P, DialogContent as S, DialogHeader as F, DialogTitle as O, DialogDescription as A } from "./dialog.es.js";
9
- import { format as d } from "./format.es.js";
10
- const _ = ({
11
- formatStr: l,
12
- selected: s,
7
+ import { toCalendarDateFromKey as F, toDateOnlyString as O } from "./datevalue.es.js";
8
+ import { Button as i } from "./button.es.js";
9
+ import { Dialog as P, DialogContent as A, DialogHeader as H, DialogTitle as K, DialogDescription as T } from "./dialog.es.js";
10
+ import { format as c } from "./format.es.js";
11
+ const z = ({
12
+ formatStr: o,
13
+ selected: n,
13
14
  placeholder: h,
14
- className: f,
15
- calendarClassName: u,
16
- cancelText: b,
15
+ className: u,
16
+ calendarClassName: b,
17
+ cancelText: g,
17
18
  applyText: x,
18
- onSelect: g,
19
- disabled: y,
20
- disabledDates: D,
21
- ...v
19
+ onSelect: y,
20
+ disabled: D,
21
+ disabledDates: v,
22
+ ...w
22
23
  }) => {
23
- const [w, n] = m.useState(!1), t = s ? new Date(s) : void 0, [r, i] = m.useState(t), c = () => {
24
- n(!1), i(t);
25
- }, M = () => {
26
- g?.(r), n(!1);
24
+ const [M, s] = l.useState(!1), m = n instanceof Date ? n.getTime() : n, t = l.useMemo(() => F(m), [m]), [r, d] = l.useState(t);
25
+ l.useEffect(() => {
26
+ d(t);
27
+ }, [t]);
28
+ const p = () => {
29
+ s(!1), d(t);
30
+ }, C = () => {
31
+ y?.(O(r)), s(!1);
27
32
  };
28
33
  return /* @__PURE__ */ a(N, { children: [
29
34
  /* @__PURE__ */ a(
30
- o,
35
+ i,
31
36
  {
32
37
  type: "button",
33
38
  variant: "text",
34
- className: p(
39
+ className: f(
35
40
  "flex h-8 w-full items-center justify-between whitespace-nowrap rounded-sm border border-input bg-transparent ps-3 pe-1 py-1.5 text-xs ring-offset-background data-[placeholder]:text-muted-foreground hover:border hover:border-primary hover:bg-transparent focus:border focus:border-primary focus:outline-none focus:ring focus:ring-primary-100 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-text-300 disabled:border-gray-100 [&>span]:line-clamp-1 [&_svg]:disabled:text-text-300",
36
- f
41
+ u
37
42
  ),
38
43
  "data-placeholder": t ? void 0 : "",
39
- onClick: () => n(!0),
40
- "aria-label": t ? `Selected date: ${d(t, l ?? "yyyy/MM/dd")}` : "Pick a date",
41
- disabled: y,
44
+ onClick: () => s(!0),
45
+ "aria-label": t ? `Selected date: ${c(t, o ?? "yyyy/MM/dd")}` : "Pick a date",
46
+ disabled: D,
42
47
  children: [
43
- t ? d(t, l ?? "eee, MMM dd") : /* @__PURE__ */ e("span", { children: h ?? "Pick a date" }),
44
- /* @__PURE__ */ e(k, { className: "mr-2 h-5 w-5 ms-auto" })
48
+ t ? c(t, o ?? "eee, MMM dd") : /* @__PURE__ */ e("span", { children: h ?? "Pick a date" }),
49
+ /* @__PURE__ */ e(S, { className: "mr-2 h-5 w-5 ms-auto" })
45
50
  ]
46
51
  }
47
52
  ),
48
- /* @__PURE__ */ e(P, { open: w, onOpenChange: c, children: /* @__PURE__ */ a(S, { className: "h-dscreen w-screen p-0 flex flex-col gap-0 data-[state=open]:animate-slide-from-bottom data-[state=closed]:animate-slide-to-bottom overflow-auto max-w-screen-2xl sm:rounded-none", children: [
49
- /* @__PURE__ */ a(F, { className: "p-4 border-b border-b-gray-200", children: [
50
- /* @__PURE__ */ e(O, { asChild: !0, children: /* @__PURE__ */ a("div", { className: "text-sm font-bold space-y-1 mt-3", children: [
53
+ /* @__PURE__ */ e(P, { open: M, onOpenChange: p, children: /* @__PURE__ */ a(A, { className: "h-dscreen w-screen p-0 flex flex-col gap-0 data-[state=open]:animate-slide-from-bottom data-[state=closed]:animate-slide-to-bottom overflow-auto max-w-screen-2xl sm:rounded-none", children: [
54
+ /* @__PURE__ */ a(H, { className: "p-4 border-b border-b-gray-200", children: [
55
+ /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ a("div", { className: "text-sm font-bold space-y-1 mt-3", children: [
51
56
  /* @__PURE__ */ e("h5", { className: "text-text-300", children: r?.getFullYear() ?? /* @__PURE__ */ e("pre", { children: " " }) }),
52
- /* @__PURE__ */ e("h6", { className: "", children: r ? d(r, l ?? "eee, MMM dd") : /* @__PURE__ */ e("pre", { children: " " }) })
57
+ /* @__PURE__ */ e("h6", { className: "", children: r ? c(r, o ?? "eee, MMM dd") : /* @__PURE__ */ e("pre", { children: " " }) })
53
58
  ] }) }),
54
- /* @__PURE__ */ e(C, { children: /* @__PURE__ */ e(A, { children: "Date Picker" }) })
59
+ /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(T, { children: "Date Picker" }) })
55
60
  ] }),
56
61
  /* @__PURE__ */ a("div", { className: "flex-1 flex flex-col items-center p-4", children: [
57
62
  /* @__PURE__ */ e(
@@ -60,23 +65,23 @@ const _ = ({
60
65
  defaultMonth: t,
61
66
  startMonth: new Date(2e3, 0, 1),
62
67
  endMonth: new Date((/* @__PURE__ */ new Date()).getFullYear() + 2, 11, 31),
63
- ...v,
68
+ ...w,
64
69
  mode: "single",
65
70
  selected: r,
66
- onSelect: i,
67
- className: p("p-0", u),
68
- disabled: D
71
+ onSelect: d,
72
+ className: f("p-0", b),
73
+ disabled: v
69
74
  }
70
75
  ),
71
76
  /* @__PURE__ */ a("div", { className: "flex justify-center items-center gap-4 mt-auto w-full", children: [
72
- /* @__PURE__ */ e(o, { type: "button", variant: "text", className: "flex-1 h-10", onClick: c, children: b ?? "Cancel" }),
73
- /* @__PURE__ */ e(o, { type: "button", variant: "primary", className: "flex-1 h-10", onClick: M, children: x ?? "Apply" })
77
+ /* @__PURE__ */ e(i, { type: "button", variant: "text", className: "flex-1 h-10", onClick: p, children: g ?? "Cancel" }),
78
+ /* @__PURE__ */ e(i, { type: "button", variant: "primary", className: "flex-1 h-10", onClick: C, children: x ?? "Apply" })
74
79
  ] })
75
80
  ] })
76
81
  ] }) })
77
82
  ] });
78
83
  };
79
84
  export {
80
- _ as MobileDatePicker
85
+ z as MobileDatePicker
81
86
  };
82
87
  //# sourceMappingURL=mobiledatepicker.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mobiledatepicker.es.js","sources":["../src/components/date-picker/MobileDatePicker.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport { format } from \"date-fns\";\r\nimport { VisuallyHidden } from \"@radix-ui/react-visually-hidden\";\r\nimport { Matcher, PropsBase, PropsSingle } from \"react-day-picker\";\r\nimport { Calendar as CalendarIcon } from \"@trsys-tech/matrix-icons\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\nimport { Calendar } from \"./calendar\";\r\nimport { Button } from \"../button/Button\";\r\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from \"../dialog/Dialog\";\r\n\r\ntype MobileDatePickerProps = Omit<PropsBase, \"disabled\"> &\r\n Omit<PropsSingle, \"mode\" | \"disabled\"> & {\r\n formatStr?: string;\r\n placeholder?: string;\r\n calendarClassName?: string;\r\n selected?: Date;\r\n required?: boolean;\r\n cancelText?: string;\r\n applyText?: string;\r\n onSelect?: (date: Date | undefined) => void;\r\n disabled?: boolean;\r\n disabledDates?: Matcher | Matcher[]; // Renamed to avoid conflict with the 'disabled' prop\r\n };\r\n\r\nconst MobileDatePicker: React.FC<MobileDatePickerProps> = ({\r\n formatStr,\r\n selected,\r\n placeholder,\r\n className,\r\n calendarClassName,\r\n cancelText,\r\n applyText,\r\n onSelect,\r\n disabled,\r\n disabledDates,\r\n ...props\r\n}) => {\r\n const [isOpen, setIsOpen] = React.useState(false);\r\n const validatedSelectedDate = selected ? new Date(selected) : undefined;\r\n const [selectedDate, setSelectedDate] = React.useState<Date | undefined>(validatedSelectedDate);\r\n\r\n const handleCancel = () => {\r\n setIsOpen(false);\r\n setSelectedDate(validatedSelectedDate);\r\n };\r\n\r\n const handleApply = () => {\r\n onSelect?.(selectedDate);\r\n setIsOpen(false);\r\n };\r\n\r\n return (\r\n <>\r\n <Button\r\n type=\"button\"\r\n variant=\"text\"\r\n className={cn(\r\n \"flex h-8 w-full items-center justify-between whitespace-nowrap rounded-sm border border-input bg-transparent ps-3 pe-1 py-1.5 text-xs ring-offset-background data-[placeholder]:text-muted-foreground hover:border hover:border-primary hover:bg-transparent focus:border focus:border-primary focus:outline-none focus:ring focus:ring-primary-100 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-text-300 disabled:border-gray-100 [&>span]:line-clamp-1 [&_svg]:disabled:text-text-300\",\r\n className,\r\n )}\r\n data-placeholder={!validatedSelectedDate ? \"\" : undefined}\r\n onClick={() => setIsOpen(true)}\r\n aria-label={validatedSelectedDate ? `Selected date: ${format(validatedSelectedDate, formatStr ?? \"yyyy/MM/dd\")}` : \"Pick a date\"}\r\n disabled={disabled}\r\n >\r\n {validatedSelectedDate ? format(validatedSelectedDate, formatStr ?? \"eee, MMM dd\") : <span>{placeholder ?? \"Pick a date\"}</span>}\r\n <CalendarIcon className=\"mr-2 h-5 w-5 ms-auto\" />\r\n </Button>\r\n <Dialog open={isOpen} onOpenChange={handleCancel}>\r\n <DialogContent className=\"h-dscreen w-screen p-0 flex flex-col gap-0 data-[state=open]:animate-slide-from-bottom data-[state=closed]:animate-slide-to-bottom overflow-auto max-w-screen-2xl sm:rounded-none\">\r\n <DialogHeader className=\"p-4 border-b border-b-gray-200\">\r\n <DialogTitle asChild>\r\n <div className=\"text-sm font-bold space-y-1 mt-3\">\r\n <h5 className=\"text-text-300\">{selectedDate?.getFullYear() ?? <pre> </pre>}</h5>\r\n <h6 className=\"\">{selectedDate ? format(selectedDate, formatStr ?? \"eee, MMM dd\") : <pre> </pre>}</h6>\r\n </div>\r\n </DialogTitle>\r\n <VisuallyHidden>\r\n <DialogDescription>{\"Date Picker\"}</DialogDescription>\r\n </VisuallyHidden>\r\n </DialogHeader>\r\n <div className=\"flex-1 flex flex-col items-center p-4\">\r\n <Calendar\r\n defaultMonth={validatedSelectedDate}\r\n startMonth={new Date(2000, 0, 1)}\r\n endMonth={new Date(new Date().getFullYear() + 2, 11, 31)}\r\n {...props}\r\n mode=\"single\"\r\n selected={selectedDate}\r\n onSelect={setSelectedDate}\r\n className={cn(\"p-0\", calendarClassName)}\r\n disabled={disabledDates}\r\n />\r\n <div className=\"flex justify-center items-center gap-4 mt-auto w-full\">\r\n <Button type=\"button\" variant=\"text\" className=\"flex-1 h-10\" onClick={handleCancel}>\r\n {cancelText ?? \"Cancel\"}\r\n </Button>\r\n <Button type=\"button\" variant=\"primary\" className=\"flex-1 h-10\" onClick={handleApply}>\r\n {applyText ?? \"Apply\"}\r\n </Button>\r\n </div>\r\n </div>\r\n </DialogContent>\r\n </Dialog>\r\n </>\r\n );\r\n};\r\n\r\nexport { MobileDatePicker, type MobileDatePickerProps };\r\n"],"names":["MobileDatePicker","formatStr","selected","placeholder","className","calendarClassName","cancelText","applyText","onSelect","disabled","disabledDates","props","isOpen","setIsOpen","React","validatedSelectedDate","selectedDate","setSelectedDate","handleCancel","handleApply","jsxs","Fragment","Button","cn","format","jsx","CalendarIcon","Dialog","DialogContent","DialogHeader","DialogTitle","VisuallyHidden","DialogDescription","Calendar"],"mappings":";;;;;;;;;AA2BA,MAAMA,IAAoD,CAAC;AAAA,EACzD,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAM,SAAS,EAAK,GAC1CC,IAAwBb,IAAW,IAAI,KAAKA,CAAQ,IAAI,QACxD,CAACc,GAAcC,CAAe,IAAIH,EAAM,SAA2BC,CAAqB,GAExFG,IAAe,MAAM;AACzB,IAAAL,EAAU,EAAK,GACfI,EAAgBF,CAAqB;AAAA,EACvC,GAEMI,IAAc,MAAM;AACxB,IAAAX,IAAWQ,CAAY,GACvBH,EAAU,EAAK;AAAA,EACjB;AAEA,SACE,gBAAAO,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAQ;AAAA,QACR,WAAWC;AAAA,UACT;AAAA,UACAnB;AAAA,QAAA;AAAA,QAEF,oBAAmBW,IAA6B,SAAL;AAAA,QAC3C,SAAS,MAAMF,EAAU,EAAI;AAAA,QAC7B,cAAYE,IAAwB,kBAAkBS,EAAOT,GAAuBd,KAAa,YAAY,CAAC,KAAK;AAAA,QACnH,UAAAQ;AAAA,QAEC,UAAA;AAAA,UAAAM,IAAwBS,EAAOT,GAAuBd,KAAa,aAAa,IAAI,gBA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QAEZ,gBAAAU,EAAC,OAAA,EAAI,WAAU,yDACb,UAAA;AAAA,UAAA,gBAAAK,EAACH,GAAA,EAAO,MAAK,UAAS,SAAQ,QAAO,WAAU,eAAc,SAASJ,GACnE,UAAAZ,KAAc,SAAA,CACjB;AAAA,UACA,gBAAAmB,EAACH,GAAA,EAAO,MAAK,UAAS,SAAQ,WAAU,WAAU,eAAc,SAASH,GACtE,UAAAZ,KAAa,QAAA,CAChB;AAAA,QAAA,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA,EAAA,CACF,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"mobiledatepicker.es.js","sources":["../src/components/date-picker/MobileDatePicker.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport { format } from \"date-fns\";\r\nimport { VisuallyHidden } from \"@radix-ui/react-visually-hidden\";\r\nimport { Matcher, PropsBase, PropsSingle } from \"react-day-picker\";\r\nimport { Calendar as CalendarIcon } from \"@trsys-tech/matrix-icons\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\nimport { Calendar } from \"./calendar\";\r\nimport { DateOnlyString, DateValue, toCalendarDateFromKey, toDateOnlyString } from \"./dateValue\";\r\nimport { Button } from \"../button/Button\";\r\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from \"../dialog/Dialog\";\r\n\r\n/**\r\n * Props for the mobile-only single-date picker.\r\n *\r\n * Inherits the single-date calendar props from react-day-picker, but accepts\r\n * Date | YYYY-MM-DD on input and emits YYYY-MM-DD on apply.\r\n */\r\ntype MobileDatePickerProps = Omit<PropsBase, \"disabled\"> &\r\n Omit<PropsSingle, \"mode\" | \"disabled\" | \"selected\" | \"onSelect\"> & {\r\n /** Display format used in the trigger and dialog header. */\r\n formatStr?: string;\r\n /** Placeholder shown when no date is selected. */\r\n placeholder?: string;\r\n /** Class name forwarded to the calendar content. */\r\n calendarClassName?: string;\r\n /** Current value as a native Date or a YYYY-MM-DD string. */\r\n selected?: DateValue;\r\n /** Prevents clearing the selection when true. */\r\n required?: boolean;\r\n /** Label for the cancel button. */\r\n cancelText?: string;\r\n /** Label for the apply button. */\r\n applyText?: string;\r\n /** Called with a YYYY-MM-DD string when the user confirms the selection. */\r\n onSelect?: (date: DateOnlyString | undefined) => void;\r\n /** Disables the trigger button. */\r\n disabled?: boolean;\r\n /** Dates disabled in the calendar. */\r\n disabledDates?: Matcher | Matcher[];\r\n };\r\n\r\n/**\r\n * Mobile-only single-date picker rendered in a full-screen dialog.\r\n * Use this component when you want mobile interaction regardless of screen size.\r\n */\r\nconst MobileDatePicker: React.FC<MobileDatePickerProps> = ({\r\n formatStr,\r\n selected,\r\n placeholder,\r\n className,\r\n calendarClassName,\r\n cancelText,\r\n applyText,\r\n onSelect,\r\n disabled,\r\n disabledDates,\r\n ...props\r\n}) => {\r\n const [isOpen, setIsOpen] = React.useState(false);\r\n const selectedValueKey = selected instanceof Date ? selected.getTime() : selected;\r\n const validatedSelectedDate = React.useMemo(() => toCalendarDateFromKey(selectedValueKey), [selectedValueKey]);\r\n const [selectedDate, setSelectedDate] = React.useState<Date | undefined>(validatedSelectedDate);\r\n\r\n React.useEffect(() => {\r\n setSelectedDate(validatedSelectedDate);\r\n }, [validatedSelectedDate]);\r\n\r\n const handleCancel = () => {\r\n setIsOpen(false);\r\n setSelectedDate(validatedSelectedDate);\r\n };\r\n\r\n const handleApply = () => {\r\n onSelect?.(toDateOnlyString(selectedDate));\r\n setIsOpen(false);\r\n };\r\n\r\n return (\r\n <>\r\n <Button\r\n type=\"button\"\r\n variant=\"text\"\r\n className={cn(\r\n \"flex h-8 w-full items-center justify-between whitespace-nowrap rounded-sm border border-input bg-transparent ps-3 pe-1 py-1.5 text-xs ring-offset-background data-[placeholder]:text-muted-foreground hover:border hover:border-primary hover:bg-transparent focus:border focus:border-primary focus:outline-none focus:ring focus:ring-primary-100 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-text-300 disabled:border-gray-100 [&>span]:line-clamp-1 [&_svg]:disabled:text-text-300\",\r\n className,\r\n )}\r\n data-placeholder={!validatedSelectedDate ? \"\" : undefined}\r\n onClick={() => setIsOpen(true)}\r\n aria-label={validatedSelectedDate ? `Selected date: ${format(validatedSelectedDate, formatStr ?? \"yyyy/MM/dd\")}` : \"Pick a date\"}\r\n disabled={disabled}\r\n >\r\n {validatedSelectedDate ? format(validatedSelectedDate, formatStr ?? \"eee, MMM dd\") : <span>{placeholder ?? \"Pick a date\"}</span>}\r\n <CalendarIcon className=\"mr-2 h-5 w-5 ms-auto\" />\r\n </Button>\r\n <Dialog open={isOpen} onOpenChange={handleCancel}>\r\n <DialogContent className=\"h-dscreen w-screen p-0 flex flex-col gap-0 data-[state=open]:animate-slide-from-bottom data-[state=closed]:animate-slide-to-bottom overflow-auto max-w-screen-2xl sm:rounded-none\">\r\n <DialogHeader className=\"p-4 border-b border-b-gray-200\">\r\n <DialogTitle asChild>\r\n <div className=\"text-sm font-bold space-y-1 mt-3\">\r\n <h5 className=\"text-text-300\">{selectedDate?.getFullYear() ?? <pre> </pre>}</h5>\r\n <h6 className=\"\">{selectedDate ? format(selectedDate, formatStr ?? \"eee, MMM dd\") : <pre> </pre>}</h6>\r\n </div>\r\n </DialogTitle>\r\n <VisuallyHidden>\r\n <DialogDescription>{\"Date Picker\"}</DialogDescription>\r\n </VisuallyHidden>\r\n </DialogHeader>\r\n <div className=\"flex-1 flex flex-col items-center p-4\">\r\n <Calendar\r\n defaultMonth={validatedSelectedDate}\r\n startMonth={new Date(2000, 0, 1)}\r\n endMonth={new Date(new Date().getFullYear() + 2, 11, 31)}\r\n {...props}\r\n mode=\"single\"\r\n selected={selectedDate}\r\n onSelect={setSelectedDate}\r\n className={cn(\"p-0\", calendarClassName)}\r\n disabled={disabledDates}\r\n />\r\n <div className=\"flex justify-center items-center gap-4 mt-auto w-full\">\r\n <Button type=\"button\" variant=\"text\" className=\"flex-1 h-10\" onClick={handleCancel}>\r\n {cancelText ?? \"Cancel\"}\r\n </Button>\r\n <Button type=\"button\" variant=\"primary\" className=\"flex-1 h-10\" onClick={handleApply}>\r\n {applyText ?? \"Apply\"}\r\n </Button>\r\n </div>\r\n </div>\r\n </DialogContent>\r\n </Dialog>\r\n </>\r\n );\r\n};\r\n\r\nexport { MobileDatePicker, type MobileDatePickerProps };\r\n"],"names":["MobileDatePicker","formatStr","selected","placeholder","className","calendarClassName","cancelText","applyText","onSelect","disabled","disabledDates","props","isOpen","setIsOpen","React","selectedValueKey","validatedSelectedDate","toCalendarDateFromKey","selectedDate","setSelectedDate","handleCancel","handleApply","toDateOnlyString","jsxs","Fragment","Button","cn","format","jsx","CalendarIcon","Dialog","DialogContent","DialogHeader","DialogTitle","VisuallyHidden","DialogDescription","Calendar"],"mappings":";;;;;;;;;;AAgDA,MAAMA,IAAoD,CAAC;AAAA,EACzD,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAM,SAAS,EAAK,GAC1CC,IAAmBb,aAAoB,OAAOA,EAAS,YAAYA,GACnEc,IAAwBF,EAAM,QAAQ,MAAMG,EAAsBF,CAAgB,GAAG,CAACA,CAAgB,CAAC,GACvG,CAACG,GAAcC,CAAe,IAAIL,EAAM,SAA2BE,CAAqB;AAE9F,EAAAF,EAAM,UAAU,MAAM;AACpB,IAAAK,EAAgBH,CAAqB;AAAA,EACvC,GAAG,CAACA,CAAqB,CAAC;AAE1B,QAAMI,IAAe,MAAM;AACzB,IAAAP,EAAU,EAAK,GACfM,EAAgBH,CAAqB;AAAA,EACvC,GAEMK,IAAc,MAAM;AACxB,IAAAb,IAAWc,EAAiBJ,CAAY,CAAC,GACzCL,EAAU,EAAK;A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EAAA,CACpC;AAAA,MAAA,GACF;AAAA,MACA,gBAAAZ,EAAC,OAAA,EAAI,WAAU,yCACb,UAAA;AAAA,QAAA,gBAAAK;AAAA,UAACQ;AAAAA,UAAA;AAAA,YACC,cAAcpB;AAAA,YACd,YAAY,IAAI,KAAK,KAAM,GAAG,CAAC;AAAA,YAC/B,UAAU,IAAI,MAAK,oBAAI,KAAA,GAAO,gBAAgB,GAAG,IAAI,EAAE;AAAA,YACtD,GAAGL;AAAA,YACJ,MAAK;AAAA,YACL,UAAUO;AAAA,YACV,UAAUC;AAAA,YACV,WAAWO,EAAG,OAAOrB,CAAiB;AAAA,YACtC,UAAUK;AAAA,UAAA;AAAA,QAAA;AAAA,QAEZ,gBAAAa,EAAC,OAAA,EAAI,WAAU,yDACb,UAAA;AAAA,UAAA,gBAAAK,EAACH,GAAA,EAAO,MAAK,UAAS,SAAQ,QAAO,WAAU,eAAc,SAASL,GACnE,UAAAd,KAAc,SAAA,CACjB;AAAA,UACA,gBAAAsB,EAACH,GAAA,EAAO,MAAK,UAAS,SAAQ,WAAU,WAAU,eAAc,SAASJ,GACtE,UAAAd,KAAa,QAAA,CAChB;AAAA,QAAA,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA,EAAA,CACF,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
@@ -1,105 +1,114 @@
1
- import { jsxs as t, Fragment as R, jsx as o } from "react/jsx-runtime";
2
- import * as f from "react";
3
- import { VisuallyHidden as O } from "@radix-ui/react-visually-hidden";
4
- import { Calendar as P } from "@trsys-tech/matrix-icons";
5
- import { cn as p } from "./utils.es.js";
6
- import { Calendar as $ } from "./calendar.es.js";
7
- import { Button as m } from "./button.es.js";
8
- import { Dialog as A, DialogContent as H, DialogHeader as B, DialogTitle as I, DialogDescription as V } from "./dialog.es.js";
9
- import { format as l } from "./format.es.js";
10
- const L = ({
11
- formatStr: n,
12
- selected: r,
13
- placeholder: d,
14
- className: h,
15
- calendarClassName: g,
16
- onDayClick: y,
17
- cancelText: u,
18
- applyText: x,
19
- onSelect: b,
20
- fromText: M,
21
- toText: v,
22
- disabled: N,
23
- disabledDates: w,
24
- ...C
1
+ import { jsxs as r, Fragment as B, jsx as t } from "react/jsx-runtime";
2
+ import * as m from "react";
3
+ import { VisuallyHidden as H } from "@radix-ui/react-visually-hidden";
4
+ import { Calendar as E } from "@trsys-tech/matrix-icons";
5
+ import { cn as x } from "./utils.es.js";
6
+ import { Calendar as I } from "./calendar.es.js";
7
+ import { toCalendarDateRangeFromKeys as V, toDateOnlyRange as Y } from "./datevalue.es.js";
8
+ import { Button as f } from "./button.es.js";
9
+ import { Dialog as _, DialogContent as q, DialogHeader as z, DialogTitle as G, DialogDescription as J } from "./dialog.es.js";
10
+ import { format as s } from "./format.es.js";
11
+ const oe = ({
12
+ formatStr: l,
13
+ selected: i,
14
+ placeholder: p,
15
+ className: b,
16
+ calendarClassName: M,
17
+ onDayClick: v,
18
+ cancelText: D,
19
+ applyText: N,
20
+ onSelect: T,
21
+ fromText: w,
22
+ toText: C,
23
+ disabled: k,
24
+ disabledDates: R,
25
+ labelSeparator: h = ": ",
26
+ fromToSeparator: j = "",
27
+ ...F
25
28
  }) => {
26
- const [D, s] = f.useState(!1), [e, i] = f.useState(r), T = (a, j, F) => {
27
- y?.(a, j, F), !e || !e.from ? i({ from: a, to: void 0 }) : a < e.from ? e.to ? i({ from: a, to: e.to }) : i({ from: a, to: e.from }) : e?.from?.getTime() === a?.getTime() && (e?.from?.getTime() === e?.to?.getTime() || !e.to) ? i(void 0) : e?.from?.getTime() !== e?.to?.getTime() && (e.from?.getTime() === a?.getTime() || e?.to?.getTime() === a?.getTime()) ? i({ from: a, to: a }) : i({ ...e, to: a });
28
- }, c = () => {
29
- s(!1), i(r);
30
- }, k = () => {
31
- b?.(e), s(!1);
29
+ const [O, d] = m.useState(!1), g = i?.from instanceof Date ? i.from.getTime() : i?.from, y = i?.to instanceof Date ? i.to.getTime() : i?.to, o = m.useMemo(() => V(g, y), [g, y]), [e, n] = m.useState(o), c = !!(o?.from || o?.to);
30
+ m.useEffect(() => {
31
+ n(o);
32
+ }, [o]);
33
+ const K = (a, $, A) => {
34
+ v?.(a, $, A), !e || !e.from ? n({ from: a, to: void 0 }) : a < e.from ? e.to ? n({ from: a, to: e.to }) : n({ from: a, to: e.from }) : e?.from?.getTime() === a?.getTime() && (e?.from?.getTime() === e?.to?.getTime() || !e.to) ? n(void 0) : e?.from?.getTime() !== e?.to?.getTime() && (e.from?.getTime() === a?.getTime() || e?.to?.getTime() === a?.getTime()) ? n({ from: a, to: a }) : n({ ...e, to: a });
35
+ }, u = () => {
36
+ d(!1), n(o);
37
+ }, P = () => {
38
+ T?.(Y(e)), d(!1);
32
39
  };
33
- return /* @__PURE__ */ t(R, { children: [
34
- /* @__PURE__ */ t(
35
- m,
40
+ return /* @__PURE__ */ r(B, { children: [
41
+ /* @__PURE__ */ r(
42
+ f,
36
43
  {
37
44
  type: "button",
38
45
  variant: "text",
39
- className: p(
46
+ className: x(
40
47
  "flex h-8 w-full items-center justify-between whitespace-nowrap rounded-sm border border-input bg-transparent ps-3 pe-1 py-1.5 text-xs ring-offset-background data-[placeholder]:text-muted-foreground hover:border hover:border-primary hover:bg-transparent focus:border focus:border-primary focus:outline-none focus:ring focus:ring-primary-100 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-text-300 disabled:border-gray-100 [&>span]:line-clamp-1 [&_svg]:disabled:text-text-300",
41
- h
48
+ b
42
49
  ),
43
- "data-placeholder": r ? void 0 : "",
44
- onClick: () => s(!0),
45
- "aria-label": r ? `Selected date: ${r?.from ? l(r.from, n ?? "yyyy/MM/dd") : ""} - ${r?.to ? l(r.to, n ?? "yyyy/MM/dd") : ""}` : d,
46
- disabled: N,
50
+ "data-placeholder": c ? void 0 : "",
51
+ onClick: () => d(!0),
52
+ "aria-label": c ? `Selected date: ${o?.from ? s(o.from, l ?? "yyyy/MM/dd") : ""} - ${o?.to ? s(o.to, l ?? "yyyy/MM/dd") : ""}` : p,
53
+ disabled: k,
47
54
  children: [
48
- r ? /* @__PURE__ */ t("div", { className: "grid grid-cols-2 flex-1 justify-items-start", children: [
49
- /* @__PURE__ */ t("span", { children: [
50
- M ?? "From",
51
- ": ",
52
- r?.from ? l(r.from, n ?? "yyyy/MM/dd") : "-"
55
+ c ? /* @__PURE__ */ r("div", { className: "flex flex-row gap-1 flex-1 justify-items-start", children: [
56
+ /* @__PURE__ */ r("span", { children: [
57
+ w ?? "From",
58
+ h,
59
+ o?.from ? s(o.from, l ?? "yyyy/MM/dd") : "-"
53
60
  ] }),
54
61
  " ",
55
- /* @__PURE__ */ t("span", { children: [
56
- v ?? "To",
57
- ": ",
58
- r?.to ? l(r.to, n ?? "yyyy/MM/dd") : "-"
62
+ j,
63
+ " ",
64
+ /* @__PURE__ */ r("span", { children: [
65
+ C ?? "To",
66
+ h,
67
+ o?.to ? s(o.to, l ?? "yyyy/MM/dd") : "-"
59
68
  ] })
60
- ] }) : /* @__PURE__ */ o("span", { children: d ?? "Pick a Range" }),
61
- /* @__PURE__ */ o(P, { className: "mr-2 h-5 w-4 ms-auto" })
69
+ ] }) : /* @__PURE__ */ t("span", { children: p ?? "Pick a Range" }),
70
+ /* @__PURE__ */ t(E, { className: "mr-2 h-5 w-4 ms-auto" })
62
71
  ]
63
72
  }
64
73
  ),
65
- /* @__PURE__ */ o(A, { open: D, onOpenChange: c, children: /* @__PURE__ */ t(H, { className: "h-dscreen w-screen p-0 flex flex-col gap-0 data-[state=open]:animate-slide-from-bottom data-[state=closed]:animate-slide-to-bottom overflow-auto max-w-screen-2xl sm:rounded-none", children: [
66
- /* @__PURE__ */ t(B, { children: [
67
- /* @__PURE__ */ o(I, { asChild: !0, children: /* @__PURE__ */ t("div", { className: "grid grid-cols-2 border-b border-b-gray-200 mt-3", children: [
68
- /* @__PURE__ */ t("div", { className: "text-sm font-bold space-y-1 border-e border-e-gray-200 p-4", children: [
69
- /* @__PURE__ */ o("h5", { className: "text-text-300 font-medium text-xs", children: "From" }),
70
- /* @__PURE__ */ o("h6", { className: "", children: e?.from ? l(e.from, n ?? "eee, MMM dd") : /* @__PURE__ */ o("pre", { children: " " }) })
74
+ /* @__PURE__ */ t(_, { open: O, onOpenChange: u, children: /* @__PURE__ */ r(q, { className: "h-dscreen w-screen p-0 flex flex-col gap-0 data-[state=open]:animate-slide-from-bottom data-[state=closed]:animate-slide-to-bottom overflow-auto max-w-screen-2xl sm:rounded-none", children: [
75
+ /* @__PURE__ */ r(z, { children: [
76
+ /* @__PURE__ */ t(G, { asChild: !0, children: /* @__PURE__ */ r("div", { className: "grid grid-cols-2 border-b border-b-gray-200 mt-3", children: [
77
+ /* @__PURE__ */ r("div", { className: "text-sm font-bold space-y-1 border-e border-e-gray-200 p-4", children: [
78
+ /* @__PURE__ */ t("h5", { className: "text-text-300 font-medium text-xs", children: "From" }),
79
+ /* @__PURE__ */ t("h6", { className: "", children: e?.from ? s(e.from, l ?? "eee, MMM dd") : /* @__PURE__ */ t("pre", { children: " " }) })
71
80
  ] }),
72
- /* @__PURE__ */ t("div", { className: "text-sm font-bold space-y-1 p-4 flex flex-col justify-center", children: [
73
- /* @__PURE__ */ o("h5", { className: "text-text-300 font-medium text-xs", children: "To" }),
74
- /* @__PURE__ */ o("h6", { className: "", children: e?.to ? l(e.to, n ?? "eee, MMM dd") : /* @__PURE__ */ o("pre", { children: " " }) })
81
+ /* @__PURE__ */ r("div", { className: "text-sm font-bold space-y-1 p-4 flex flex-col justify-center", children: [
82
+ /* @__PURE__ */ t("h5", { className: "text-text-300 font-medium text-xs", children: "To" }),
83
+ /* @__PURE__ */ t("h6", { className: "", children: e?.to ? s(e.to, l ?? "eee, MMM dd") : /* @__PURE__ */ t("pre", { children: " " }) })
75
84
  ] })
76
85
  ] }) }),
77
- /* @__PURE__ */ o(O, { children: /* @__PURE__ */ o(V, { children: "Date Picker" }) })
86
+ /* @__PURE__ */ t(H, { children: /* @__PURE__ */ t(J, { children: "Date Picker" }) })
78
87
  ] }),
79
- /* @__PURE__ */ t("div", { className: "flex-1 flex flex-col items-center p-4", children: [
80
- /* @__PURE__ */ o(
81
- $,
88
+ /* @__PURE__ */ r("div", { className: "flex-1 flex flex-col items-center p-4", children: [
89
+ /* @__PURE__ */ t(
90
+ I,
82
91
  {
83
- defaultMonth: r?.from,
92
+ defaultMonth: e?.from,
84
93
  startMonth: new Date(2e3, 0, 1),
85
94
  endMonth: new Date((/* @__PURE__ */ new Date()).getFullYear() + 2, 11, 31),
86
- ...C,
95
+ ...F,
87
96
  mode: "range",
88
- selected: r,
89
- onDayClick: T,
90
- className: p("p-0", g),
91
- disabled: w
97
+ selected: e,
98
+ onDayClick: K,
99
+ className: x("p-0", M),
100
+ disabled: R
92
101
  }
93
102
  ),
94
- /* @__PURE__ */ t("div", { className: "flex justify-center items-center gap-4 mt-auto w-full", children: [
95
- /* @__PURE__ */ o(m, { type: "button", variant: "text", className: "flex-1 h-10", onClick: c, children: u ?? "Cancel" }),
96
- /* @__PURE__ */ o(m, { type: "button", variant: "primary", className: "flex-1 h-10", onClick: k, children: x ?? "Apply" })
103
+ /* @__PURE__ */ r("div", { className: "flex justify-center items-center gap-4 mt-auto w-full", children: [
104
+ /* @__PURE__ */ t(f, { type: "button", variant: "text", className: "flex-1 h-10", onClick: u, children: D ?? "Cancel" }),
105
+ /* @__PURE__ */ t(f, { type: "button", variant: "primary", className: "flex-1 h-10", onClick: P, children: N ?? "Apply" })
97
106
  ] })
98
107
  ] })
99
108
  ] }) })
100
109
  ] });
101
110
  };
102
111
  export {
103
- L as MobileDateRangePicker
112
+ oe as MobileDateRangePicker
104
113
  };
105
114
  //# sourceMappingURL=mobiledaterangepicker.es.js.map