@trsys-tech/matrix-library 0.5.0-beta.1 → 0.5.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 (108) hide show
  1. package/dist/accordion.es.js.map +1 -1
  2. package/dist/avatar.es.js.map +1 -1
  3. package/dist/badge.es.js.map +1 -1
  4. package/dist/breadcrumb.es.js +4 -4
  5. package/dist/breadcrumb.es.js.map +1 -1
  6. package/dist/buildformatlongfn.es.js.map +1 -1
  7. package/dist/buildlocalizefn.es.js.map +1 -1
  8. package/dist/buildmatchfn.es.js.map +1 -1
  9. package/dist/buildmatchpatternfn.es.js.map +1 -1
  10. package/dist/button.es.js +3 -3
  11. package/dist/button.es.js.map +1 -1
  12. package/dist/calendar.es.js +3 -3
  13. package/dist/calendar.es.js.map +1 -1
  14. package/dist/card.es.js.map +1 -1
  15. package/dist/checkbox.es.js.map +1 -1
  16. package/dist/chip.es.js.map +1 -1
  17. package/dist/collapsible.es.js.map +1 -1
  18. package/dist/combobox.es.js +3 -3
  19. package/dist/combobox.es.js.map +1 -1
  20. package/dist/command.es.js.map +1 -1
  21. package/dist/components/command/Command.d.ts.map +1 -1
  22. package/dist/components/data-grid/DataGrid.d.ts +4 -2
  23. package/dist/components/data-grid/DataGrid.d.ts.map +1 -1
  24. package/dist/components/form/Form.d.ts +1 -1
  25. package/dist/components/form/Form.d.ts.map +1 -1
  26. package/dist/confirm.es.js.map +1 -1
  27. package/dist/contextmenu.es.js +4 -4
  28. package/dist/contextmenu.es.js.map +1 -1
  29. package/dist/dangercircleicon.es.js.map +1 -1
  30. package/dist/datagrid.es.js +106 -108
  31. package/dist/datagrid.es.js.map +1 -1
  32. package/dist/datepicker.es.js.map +1 -1
  33. package/dist/daterangepicker.es.js.map +1 -1
  34. package/dist/defaultoptions.es.js.map +1 -1
  35. package/dist/desktopdatepicker.es.js.map +1 -1
  36. package/dist/desktopdaterangepicker.es.js.map +1 -1
  37. package/dist/desktoptimepicker.es.js.map +1 -1
  38. package/dist/dialog.es.js.map +1 -1
  39. package/dist/differenceincalendardays.es.js.map +1 -1
  40. package/dist/drawer.es.js.map +1 -1
  41. package/dist/en-us.es.js.map +1 -1
  42. package/dist/form.es.js.map +1 -1
  43. package/dist/format.es.js.map +1 -1
  44. package/dist/formatdistance.es.js.map +1 -1
  45. package/dist/formatters.es.js +68 -2
  46. package/dist/formatters.es.js.map +1 -1
  47. package/dist/formcheckbox.es.js.map +1 -1
  48. package/dist/formcombobox.es.js.map +1 -1
  49. package/dist/formdatepicker.es.js.map +1 -1
  50. package/dist/formdaterangepicker.es.js.map +1 -1
  51. package/dist/forminput.es.js.map +1 -1
  52. package/dist/formmultiselect.es.js.map +1 -1
  53. package/dist/formrating.es.js.map +1 -1
  54. package/dist/formselect.es.js.map +1 -1
  55. package/dist/formswitch.es.js.map +1 -1
  56. package/dist/formtextarea.es.js.map +1 -1
  57. package/dist/formtimepicker.es.js.map +1 -1
  58. package/dist/getisoweekyear.es.js.map +1 -1
  59. package/dist/gettimezoneoffsetinmilliseconds.es.js.map +1 -1
  60. package/dist/getweekyear.es.js.map +1 -1
  61. package/dist/iconbutton.es.js +3 -3
  62. package/dist/iconbutton.es.js.map +1 -1
  63. package/dist/infocircleicon.es.js.map +1 -1
  64. package/dist/label.es.js.map +1 -1
  65. package/dist/lightformatters.es.js.map +1 -1
  66. package/dist/localize.es.js.map +1 -1
  67. package/dist/longformatters.es.js.map +1 -1
  68. package/dist/match.es.js.map +1 -1
  69. package/dist/matrix-library.css +1 -0
  70. package/dist/mobiledatepicker.es.js.map +1 -1
  71. package/dist/mobiledaterangepicker.es.js.map +1 -1
  72. package/dist/mobiletimepicker.es.js.map +1 -1
  73. package/dist/modal.es.js.map +1 -1
  74. package/dist/multiselect.es.js +3 -3
  75. package/dist/multiselect.es.js.map +1 -1
  76. package/dist/normalizedates.es.js.map +1 -1
  77. package/dist/popover.es.js.map +1 -1
  78. package/dist/printhtml.es.js.map +1 -1
  79. package/dist/progress.es.js.map +1 -1
  80. package/dist/protectedtokens.es.js.map +1 -1
  81. package/dist/radiogroup.es.js.map +1 -1
  82. package/dist/rating.es.js.map +1 -1
  83. package/dist/select.es.js +3 -3
  84. package/dist/select.es.js.map +1 -1
  85. package/dist/sheet.es.js.map +1 -1
  86. package/dist/sidebar.es.js +6 -6
  87. package/dist/sidebar.es.js.map +1 -1
  88. package/dist/skeleton.es.js.map +1 -1
  89. package/dist/startofweek.es.js.map +1 -1
  90. package/dist/startofweekyear.es.js.map +1 -1
  91. package/dist/successcircleicon.es.js.map +1 -1
  92. package/dist/swipabledrawer.es.js.map +1 -1
  93. package/dist/switch.es.js.map +1 -1
  94. package/dist/tabs.es.js.map +1 -1
  95. package/dist/textarea.es.js.map +1 -1
  96. package/dist/textfield.es.js.map +1 -1
  97. package/dist/timepicker.es.js.map +1 -1
  98. package/dist/timepickercontent.es.js.map +1 -1
  99. package/dist/toast-components.es.js.map +1 -1
  100. package/dist/toast.es.js.map +1 -1
  101. package/dist/tooltip.es.js +2 -2
  102. package/dist/tooltip.es.js.map +1 -1
  103. package/dist/use-mobile.es.js.map +1 -1
  104. package/dist/use-toast.es.js.map +1 -1
  105. package/dist/utils.es.js.map +1 -1
  106. package/dist/warningcircleicon.es.js.map +1 -1
  107. package/package.json +9 -9
  108. package/dist/style.css +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"datagrid.es.js","sources":["../src/components/data-grid/DataGrid.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React, { HTMLAttributes, useMemo } from \"react\";\r\nimport { AgGridReact, AgGridReactProps } from \"ag-grid-react\";\r\nimport { GridApi, GridReadyEvent, themeQuartz, AllCommunityModule, ModuleRegistry, Theme } from \"ag-grid-community\";\r\nimport { CircleXmark, ElipsisVertical, Magnifier, Print, Refresh, Snowflake, Trashcan } from \"@trsys-tech/matrix-icons\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\nimport { printHtml } from \"../../lib/printHtml\";\r\nimport { TextField } from \"../text-field/TextField\";\r\nimport { Button, ButtonProps } from \"../button/Button\";\r\nimport { IconButton, IconButtonProps } from \"../icon-botton/IconButton\";\r\nimport { Popover, PopoverContent, PopoverContentProps, PopoverProps, PopoverTrigger, PopoverTriggerProps } from \"../popover/Popover\";\r\n\r\n// Register all Community features\r\n// Todo: Register only the required features\r\nModuleRegistry.registerModules([AllCommunityModule]);\r\n\r\nconst dataGridDefaultTheme = themeQuartz.withParams({\r\n fontFamily: \"DMSans\",\r\n fontSize: \"12px\",\r\n headerFontSize: \"12px\",\r\n headerFontWeight: 700,\r\n headerBackgroundColor: \"hsl(var(--primary-50))\",\r\n backgroundColor: \"hsl(var(--gray-0))\",\r\n accentColor: \"hsl(var(--primary-300))\",\r\n foregroundColor: \"hsl(var(--text-500))\",\r\n cellTextColor: \"hsl(var(--text-500))\",\r\n});\r\n\r\ntype DataGridContext = {\r\n api: GridApi | null;\r\n setApi: (value: GridApi) => void;\r\n rowData: any[] | null | undefined;\r\n setRowData: (value: any[] | null | undefined) => void;\r\n gridId: string;\r\n quickFilterText: string;\r\n setQuickFilterText: (value: string) => void;\r\n actionbarExists: boolean;\r\n setActionbarExists: (value: boolean) => void;\r\n actionbarHeight: number;\r\n setActionbarHeight: (value: number) => void;\r\n};\r\n\r\nconst DataGridContext = React.createContext<DataGridContext | null>(null);\r\n\r\nconst useDataGrid = () => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"useDataGrid should be used within <DataGrid>\");\r\n }\r\n\r\n return context;\r\n};\r\n\r\ntype DataGridProps = {\r\n children: React.ReactNode;\r\n};\r\n\r\nconst DataGrid: React.FC<DataGridProps> = ({ children }) => {\r\n const gridId = React.useId();\r\n const [api, setApi] = React.useState<GridApi | null>(null);\r\n const [rowData, setRowData] = React.useState<any[] | null | undefined>([]);\r\n const [actionbarHeight, setActionbarHeight] = React.useState(0);\r\n\r\n const [quickFilterText, setQuickFilterText] = React.useState(\"\");\r\n const [actionbarExists, setActionbarExists] = React.useState(false);\r\n return (\r\n <DataGridContext.Provider\r\n value={{\r\n api,\r\n setApi,\r\n rowData,\r\n setRowData,\r\n gridId,\r\n quickFilterText,\r\n setQuickFilterText,\r\n actionbarExists,\r\n setActionbarExists,\r\n actionbarHeight,\r\n setActionbarHeight,\r\n }}\r\n >\r\n {children}\r\n </DataGridContext.Provider>\r\n );\r\n};\r\n\r\ntype DataGridContentProps = Omit<AgGridReactProps, \"theme\"> & {\r\n theme?: Theme;\r\n};\r\n\r\nconst DataGridContent: React.FC<DataGridContentProps> = ({\r\n theme: propTheme,\r\n onGridReady,\r\n quickFilterText: quickFilterTextProps,\r\n rowData: rowDataProps,\r\n containerStyle,\r\n ...props\r\n}) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"DataGridContent should be used within <DataGrid>\");\r\n }\r\n const { rowData, setRowData, actionbarExists, setApi, setQuickFilterText, quickFilterText, gridId, actionbarHeight } = context;\r\n\r\n const theme = useMemo(() => {\r\n return dataGridDefaultTheme.withParams({\r\n headerHeight: 40,\r\n wrapperBorderRadius: actionbarExists ? \"0px 0px 8px 8px\" : \"8px\",\r\n });\r\n }, [actionbarExists]);\r\n\r\n const handleGridReady = (e: GridReadyEvent) => {\r\n setApi(e.api);\r\n onGridReady?.(e);\r\n };\r\n\r\n React.useEffect(() => {\r\n setRowData(rowDataProps);\r\n }, [rowDataProps, setRowData]);\r\n\r\n React.useEffect(() => {\r\n if (quickFilterTextProps !== undefined) {\r\n setQuickFilterText(quickFilterTextProps ?? \"\");\r\n }\r\n }, [quickFilterTextProps, setQuickFilterText]);\r\n\r\n return (\r\n <AgGridReact\r\n gridId={gridId}\r\n theme={propTheme ?? theme}\r\n rowData={rowData}\r\n quickFilterText={quickFilterText}\r\n onGridReady={handleGridReady}\r\n containerStyle={{ height: `calc(100% - ${actionbarHeight}px)`, ...containerStyle }}\r\n {...props}\r\n />\r\n );\r\n};\r\n\r\ntype DatagridActionBarProps = HTMLAttributes<HTMLDivElement> & {};\r\n\r\nconst DataGridActionBar: React.FC<DatagridActionBarProps> = ({ className, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"DataGridActionBar should be used within <DataGrid>\");\r\n }\r\n const ref = React.useRef<HTMLDivElement | null>(null);\r\n const { setActionbarExists, setActionbarHeight } = context;\r\n const { children } = props;\r\n\r\n React.useEffect(() => {\r\n setActionbarExists(true);\r\n return () => setActionbarExists(false);\r\n }, [setActionbarExists]);\r\n\r\n React.useEffect(() => {\r\n if (ref.current) {\r\n setActionbarHeight(ref.current.clientHeight);\r\n }\r\n }, [setActionbarHeight]);\r\n\r\n return (\r\n <div\r\n className={cn(\r\n \"relative flex items-center p-2 h-12 w-full bg-gray-0 border border-gray-200 border-b-0 -mb-[1px] z-10 rounded-t-[8px]\",\r\n className,\r\n )}\r\n ref={ref}\r\n >\r\n {children}\r\n </div>\r\n );\r\n};\r\n\r\ntype SearchActionProps = HTMLAttributes<HTMLDivElement> & {\r\n defaultOpen?: boolean;\r\n};\r\n\r\nconst SearchAction: React.FC<SearchActionProps> = ({ defaultOpen = false, className, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"SearchAction should be used within <DataGrid>\");\r\n }\r\n\r\n const { quickFilterText, setQuickFilterText } = context;\r\n\r\n const [isSearchInputOpen, setIsSearchInputOpen] = React.useState(defaultOpen);\r\n const [isClosing, setIsClosing] = React.useState(false);\r\n const inputRef = React.useRef<HTMLInputElement | null>(null);\r\n\r\n const handleClear = () => {\r\n context.setQuickFilterText(\"\");\r\n if (inputRef.current) {\r\n inputRef.current.focus();\r\n }\r\n };\r\n\r\n const handleOpen = () => {\r\n setIsSearchInputOpen(true);\r\n };\r\n\r\n React.useEffect(() => {\r\n if (isSearchInputOpen && inputRef?.current) {\r\n inputRef.current.focus();\r\n }\r\n }, [isSearchInputOpen]);\r\n\r\n const handleClose = () => {\r\n setIsClosing(true);\r\n context.setQuickFilterText(\"\");\r\n setTimeout(() => {\r\n setIsSearchInputOpen(false);\r\n setIsClosing(false);\r\n }, 200);\r\n };\r\n\r\n return (\r\n <div className={cn(\"max-w-60\", className)} {...props}>\r\n {isSearchInputOpen || isClosing ? (\r\n <TextField\r\n ref={inputRef}\r\n className={cn(\"relative h-7.5\", isSearchInputOpen && !isClosing ? \"animate-input-open\" : \"\", isClosing && \"animate-input-close\")}\r\n onChange={e => setQuickFilterText(e.target.value)}\r\n value={quickFilterText}\r\n startAdornment={\r\n <IconButton variant=\"toolbar\" className=\"p-0.5 h-6 w-6 border-none mx-1\" onClick={handleClose}>\r\n <Magnifier className=\"w-5 h-5\" />\r\n </IconButton>\r\n }\r\n endAdornment={\r\n quickFilterText && (\r\n <IconButton variant=\"toolbar\" className=\"p-0.5 w-6 h-6 border-none mx-1\" onClick={handleClear}>\r\n <CircleXmark className=\"w-5 h-5\" />\r\n </IconButton>\r\n )\r\n }\r\n />\r\n ) : (\r\n <IconButton variant=\"toolbar\" className=\"p-0.5 w-6 h-6 m-1\" onClick={handleOpen}>\r\n <Magnifier className=\"w-5 h-5\" />\r\n </IconButton>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\ntype FreezeActionProps = ButtonProps & {\r\n freezeText?: string;\r\n unFreezeText?: string;\r\n};\r\n\r\nconst FreezeAction: React.FC<FreezeActionProps> = ({ freezeText, unFreezeText, onClick, disabled, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"FreezeAction should be used within <DataGrid>\");\r\n }\r\n\r\n const [pinnedRowCount, setPinnedRowCount] = React.useState(0);\r\n const [selectedRowsCount, setSelectedRowsCount] = React.useState(0);\r\n\r\n const { api, rowData } = context;\r\n\r\n const freezeRows = () => {\r\n if (!api) return;\r\n\r\n // Get currently selected rows\r\n const selectedRows = api.getSelectedNodes();\r\n\r\n if (selectedRows.length > 0) {\r\n // Pin the selected rows\r\n api.setGridOption(\r\n \"pinnedTopRowData\",\r\n selectedRows.map(row => row.data),\r\n );\r\n\r\n // Get current row data\r\n const allData = api.getRenderedNodes();\r\n // Filter out pinned rows from the main data\r\n const updatedNodes = allData.filter(row => !selectedRows.some(pinnedRow => pinnedRow.id === row.id));\r\n\r\n // Update the grid with the filtered data\r\n api.setGridOption(\r\n \"rowData\",\r\n updatedNodes.map(node => node.data),\r\n );\r\n }\r\n };\r\n\r\n const unfreezeRows = () => {\r\n if (!api) return;\r\n api.setGridOption(\"pinnedTopRowData\", []);\r\n api.setGridOption(\"rowData\", rowData);\r\n };\r\n\r\n const handleFreezing = (e: React.MouseEvent<HTMLButtonElement>) => {\r\n if (api) {\r\n const pinnedRowsCount = api.getPinnedTopRowCount();\r\n if (pinnedRowsCount > 0) {\r\n unfreezeRows();\r\n } else {\r\n freezeRows();\r\n }\r\n }\r\n onClick?.(e);\r\n };\r\n\r\n React.useEffect(() => {\r\n api?.addEventListener(\"pinnedRowDataChanged\", () => {\r\n setPinnedRowCount(api.getPinnedTopRowCount());\r\n });\r\n\r\n api?.addEventListener(\"selectionChanged\", () => {\r\n setSelectedRowsCount(api.getSelectedNodes().length);\r\n });\r\n\r\n return () => {\r\n api?.removeEventListener(\"pinnedRowDataChanged\", () => {\r\n setPinnedRowCount(api.getPinnedTopRowCount());\r\n });\r\n\r\n api?.removeEventListener(\"selectionChanged\", () => {\r\n setSelectedRowsCount(api.getSelectedNodes().length);\r\n });\r\n };\r\n }, [api]);\r\n\r\n return (\r\n <Button\r\n variant=\"text\"\r\n onClick={handleFreezing}\r\n startIcon={<Snowflake className=\"w-4.5 h-4.5\" />}\r\n disabled={(!pinnedRowCount && !selectedRowsCount) || disabled}\r\n {...props}\r\n >\r\n {pinnedRowCount ? (unFreezeText ?? \"Unfreeze\") : (freezeText ?? \"Freeze\")}\r\n </Button>\r\n );\r\n};\r\n\r\ntype PrintActionProps = IconButtonProps & {};\r\n\r\nconst PrintAction: React.FC<PrintActionProps> = ({ children, className, onClick, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"PrintAction should be used within <DataGrid>\");\r\n }\r\n\r\n const handlePrint = (e: React.MouseEvent<HTMLButtonElement>) => {\r\n if (context.api) {\r\n context.api.setGridOption(\"domLayout\", \"print\");\r\n\r\n setTimeout(() => {\r\n const element = document.querySelector(\"[grid-id='\" + context.gridId + \"']\") as HTMLElement;\r\n const header = document.head;\r\n const html = `<html>\r\n ${header.innerHTML}\r\n ${element.outerHTML}\r\n </html>`;\r\n printHtml(html);\r\n context?.api?.setGridOption(\"domLayout\", undefined);\r\n });\r\n }\r\n onClick?.(e);\r\n };\r\n\r\n return (\r\n <IconButton variant=\"toolbar\" className={cn(\"p-0.5 w-6 h-6\", className)} onClick={handlePrint} {...props}>\r\n {children ?? <Print className=\"w-5 h-5\" />}\r\n </IconButton>\r\n );\r\n};\r\n\r\ntype RefreshActionProps = Omit<IconButtonProps, \"onClick\"> & {\r\n onRefresh: () => void;\r\n};\r\n\r\nconst RefreshAction: React.FC<RefreshActionProps> = ({ className, onRefresh, children, loading, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"RefreshAction should be used within <DataGrid>\");\r\n }\r\n\r\n const handleRefresh = () => {\r\n onRefresh();\r\n };\r\n\r\n return (\r\n <IconButton\r\n className={cn(\"p-0.5 w-6 h-6\", loading && \"disabled:bg-transparent\", className)}\r\n variant=\"toolbar\"\r\n onClick={handleRefresh}\r\n disabled={loading}\r\n {...props}\r\n >\r\n {children ?? <Refresh className={cn(\"w-4.5 h-4.5\", loading && \"animate-spin\")} />}\r\n </IconButton>\r\n );\r\n};\r\n\r\ntype DeleteActionProps = Omit<ButtonProps, \"onClick\"> & {\r\n onDelete: () => void;\r\n};\r\n\r\nconst DeleteAction: React.FC<DeleteActionProps> = ({ onDelete, children, ...props }) => {\r\n const handleDelete = () => {\r\n onDelete();\r\n };\r\n\r\n return (\r\n <Button variant=\"danger\" onClick={handleDelete} startIcon={<Trashcan className=\"w-4.5 h-4.5\" />} {...props}>\r\n {children}\r\n </Button>\r\n );\r\n};\r\n\r\ntype ExtraActionsProps = PopoverContentProps & {\r\n children: React.ReactNode;\r\n slotProps?: {\r\n triggerProps?: PopoverTriggerProps;\r\n popoverProps?: PopoverProps;\r\n };\r\n};\r\n\r\nconst ExtraActions: React.FC<ExtraActionsProps> = ({ children, slotProps, className, ...props }) => {\r\n return (\r\n <Popover {...(slotProps?.popoverProps ?? {})}>\r\n <PopoverTrigger {...(slotProps?.triggerProps ?? {})}>\r\n <ElipsisVertical className=\"w-4.5 h-4.5 text-primary\" />\r\n </PopoverTrigger>\r\n <PopoverContent align=\"end\" className={cn(\"w-40\", className)} {...props}>\r\n {children}\r\n </PopoverContent>\r\n </Popover>\r\n );\r\n};\r\n\r\nexport {\r\n DataGrid,\r\n DataGridContent,\r\n DataGridActionBar,\r\n SearchAction,\r\n FreezeAction,\r\n PrintAction,\r\n RefreshAction,\r\n ExtraActions,\r\n DeleteAction,\r\n type DataGridProps,\r\n type DataGridContentProps,\r\n type DatagridActionBarProps,\r\n type SearchActionProps,\r\n type FreezeActionProps,\r\n type RefreshActionProps,\r\n type ExtraActionsProps,\r\n type DeleteActionProps,\r\n useDataGrid,\r\n dataGridDefaultTheme,\r\n};\r\n"],"names":["ModuleRegistry","AllCommunityModule","dataGridDefaultTheme","themeQuartz","DataGridContext","React","useDataGrid","context","DataGrid","children","gridId","api","setApi","rowData","setRowData","actionbarHeight","setActionbarHeight","quickFilterText","setQuickFilterText","actionbarExists","setActionbarExists","jsx","DataGridContent","propTheme","onGridReady","quickFilterTextProps","rowDataProps","containerStyle","props","theme","useMemo","handleGridReady","e","AgGridReact","DataGridActionBar","className","ref","cn","SearchAction","defaultOpen","isSearchInputOpen","setIsSearchInputOpen","isClosing","setIsClosing","inputRef","handleClear","handleOpen","handleClose","TextField","IconButton","Magnifier","CircleXmark","FreezeAction","freezeText","unFreezeText","onClick","disabled","pinnedRowCount","setPinnedRowCount","selectedRowsCount","setSelectedRowsCount","freezeRows","selectedRows","row","updatedNodes","pinnedRow","node","unfreezeRows","handleFreezing","Button","Snowflake","PrintAction","handlePrint","element","html","printHtml","Print","RefreshAction","onRefresh","loading","handleRefresh","Refresh","DeleteAction","onDelete","Trashcan","ExtraActions","slotProps","Popover","PopoverTrigger","ElipsisVertical","PopoverContent"],"mappings":";;;;;;;;;;;AAgBAA,EAAe,gBAAgB,CAACC,CAAkB,CAAC;AAE7C,MAAAC,IAAuBC,EAAY,WAAW;AAAA,EAClD,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,uBAAuB;AAAA,EACvB,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,eAAe;AACjB,CAAC,GAgBKC,IAAkBC,EAAM,cAAsC,IAAI,GAElEC,KAAc,MAAM;AAClB,QAAAC,IAAUF,EAAM,WAAWD,CAAe;AAEhD,MAAI,CAACG;AACG,UAAA,IAAI,MAAM,8CAA8C;AAGzD,SAAAA;AACT,GAMMC,KAAoC,CAAC,EAAE,UAAAC,QAAe;AACpD,QAAAC,IAASL,EAAM,MAAM,GACrB,CAACM,GAAKC,CAAM,IAAIP,EAAM,SAAyB,IAAI,GACnD,CAACQ,GAASC,CAAU,IAAIT,EAAM,SAAmC,CAAA,CAAE,GACnE,CAACU,GAAiBC,CAAkB,IAAIX,EAAM,SAAS,CAAC,GAExD,CAACY,GAAiBC,CAAkB,IAAIb,EAAM,SAAS,EAAE,GACzD,CAACc,GAAiBC,CAAkB,IAAIf,EAAM,SAAS,EAAK;AAEhE,SAAA,gBAAAgB;AAAA,IAACjB,EAAgB;AAAA,IAAhB;AAAA,MACC,OAAO;AAAA,QACL,KAAAO;AAAA,QACA,QAAAC;AAAA,QACA,SAAAC;AAAA,QACA,YAAAC;AAAA,QACA,QAAAJ;AAAA,QACA,iBAAAO;AAAA,QACA,oBAAAC;AAAA,QACA,iBAAAC;AAAA,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AA,IAAI,MAAM,gDAAgD;AAGlE,QAAM4E,IAAgB,MAAM;AAChB,IAAAF,EAAA;AAAA,EACZ;AAGE,SAAA,gBAAAzD;AAAA,IAAC4B;AAAA,IAAA;AAAA,MACC,WAAWZ,EAAG,iBAAiB0C,KAAW,2BAA2B5C,CAAS;AAAA,MAC9E,SAAQ;AAAA,MACR,SAAS6C;AAAA,MACT,UAAUD;AAAA,MACT,GAAGnD;AAAA,MAEH,UAAAnB,uBAAawE,GAAQ,EAAA,WAAW5C,EAAG,eAAe0C,KAAW,cAAc,EAAG,CAAA;AAAA,IAAA;AAAA,EACjF;AAEJ,GAMMG,KAA4C,CAAC,EAAE,UAAAC,GAAU,UAAA1E,GAAU,GAAGmB,QAMvE,gBAAAP,EAAAgD,GAAA,EAAO,SAAQ,UAAS,SALN,MAAM;AAChB,EAAAc,EAAA;AACX,GAGkD,WAAY,gBAAA9D,EAAA+D,GAAA,EAAS,WAAU,cAAA,CAAc,GAAK,GAAGxD,GAClG,UAAAnB,GACH,GAYE4E,KAA4C,CAAC,EAAE,UAAA5E,GAAU,WAAA6E,GAAW,WAAAnD,GAAW,GAAGP,0BAEnF2D,GAAS,EAAA,GAAID,GAAW,gBAAgB,CACvC,GAAA,UAAA;AAAA,EAAC,gBAAAjE,EAAAmE,GAAA,EAAgB,GAAIF,GAAW,gBAAgB,IAC9C,UAAC,gBAAAjE,EAAAoE,GAAA,EAAgB,WAAU,2BAAA,CAA2B,EACxD,CAAA;AAAA,EACA,gBAAApE,EAACqE,GAAe,EAAA,OAAM,OAAM,WAAWrD,EAAG,QAAQF,CAAS,GAAI,GAAGP,GAC/D,UAAAnB,EACH,CAAA;AAAA,GACF;"}
1
+ {"version":3,"file":"datagrid.es.js","sources":["../src/components/data-grid/DataGrid.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React, { forwardRef, HTMLAttributes, useMemo } from \"react\";\r\nimport { AgGridReact, AgGridReactProps } from \"ag-grid-react\";\r\nimport { GridApi, GridReadyEvent, themeQuartz, AllCommunityModule, ModuleRegistry, Theme } from \"ag-grid-community\";\r\nimport { CircleXmark, ElipsisVertical, Magnifier, Print, Refresh, Snowflake, Trashcan } from \"@trsys-tech/matrix-icons\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\nimport { printHtml } from \"../../lib/printHtml\";\r\nimport { TextField } from \"../text-field/TextField\";\r\nimport { Button, ButtonProps } from \"../button/Button\";\r\nimport { IconButton, IconButtonProps } from \"../icon-botton/IconButton\";\r\nimport { Popover, PopoverContent, PopoverContentProps, PopoverProps, PopoverTrigger, PopoverTriggerProps } from \"../popover/Popover\";\r\n\r\n// Register all Community features\r\n// Todo: Register only the required features\r\nModuleRegistry.registerModules([AllCommunityModule]);\r\n\r\nconst dataGridDefaultTheme = themeQuartz.withParams({\r\n fontFamily: \"DMSans\",\r\n fontSize: \"12px\",\r\n headerFontSize: \"12px\",\r\n headerFontWeight: 700,\r\n headerBackgroundColor: \"hsl(var(--primary-50))\",\r\n backgroundColor: \"hsl(var(--gray-0))\",\r\n accentColor: \"hsl(var(--primary-300))\",\r\n foregroundColor: \"hsl(var(--text-500))\",\r\n cellTextColor: \"hsl(var(--text-500))\",\r\n});\r\n\r\ntype DataGridContext = {\r\n api: GridApi | null;\r\n setApi: (value: GridApi) => void;\r\n rowData: any[] | null | undefined;\r\n setRowData: (value: any[] | null | undefined) => void;\r\n gridId: string;\r\n quickFilterText: string;\r\n setQuickFilterText: (value: string) => void;\r\n actionbarExists: boolean;\r\n setActionbarExists: (value: boolean) => void;\r\n actionbarHeight: number;\r\n setActionbarHeight: (value: number) => void;\r\n};\r\n\r\nconst DataGridContext = React.createContext<DataGridContext | null>(null);\r\n\r\nconst useDataGrid = () => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"useDataGrid should be used within <DataGrid>\");\r\n }\r\n\r\n return context;\r\n};\r\n\r\ntype DataGridProps = {\r\n children: React.ReactNode;\r\n};\r\n\r\nconst DataGrid: React.FC<DataGridProps> = ({ children }) => {\r\n const gridId = React.useId();\r\n const [api, setApi] = React.useState<GridApi | null>(null);\r\n const [rowData, setRowData] = React.useState<any[] | null | undefined>([]);\r\n const [actionbarHeight, setActionbarHeight] = React.useState(0);\r\n\r\n const [quickFilterText, setQuickFilterText] = React.useState(\"\");\r\n const [actionbarExists, setActionbarExists] = React.useState(false);\r\n return (\r\n <DataGridContext.Provider\r\n value={{\r\n api,\r\n setApi,\r\n rowData,\r\n setRowData,\r\n gridId,\r\n quickFilterText,\r\n setQuickFilterText,\r\n actionbarExists,\r\n setActionbarExists,\r\n actionbarHeight,\r\n setActionbarHeight,\r\n }}\r\n >\r\n {children}\r\n </DataGridContext.Provider>\r\n );\r\n};\r\n\r\ntype DataGridContentProps = Omit<AgGridReactProps, \"theme\"> & {\r\n theme?: Theme;\r\n};\r\n\r\nconst DataGridContent = forwardRef<AgGridReact, DataGridContentProps>(\r\n ({ theme: propTheme, onGridReady, quickFilterText: quickFilterTextProps, rowData: rowDataProps, containerStyle, ...props }, ref) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"DataGridContent should be used within <DataGrid>\");\r\n }\r\n const { rowData, setRowData, actionbarExists, setApi, setQuickFilterText, quickFilterText, gridId, actionbarHeight } = context;\r\n\r\n const theme = useMemo(() => {\r\n return dataGridDefaultTheme.withParams({\r\n headerHeight: 40,\r\n wrapperBorderRadius: actionbarExists ? \"0px 0px 8px 8px\" : \"8px\",\r\n });\r\n }, [actionbarExists]);\r\n\r\n const handleGridReady = (e: GridReadyEvent) => {\r\n setApi(e.api);\r\n onGridReady?.(e);\r\n };\r\n\r\n React.useEffect(() => {\r\n setRowData(rowDataProps);\r\n }, [rowDataProps, setRowData]);\r\n\r\n React.useEffect(() => {\r\n if (quickFilterTextProps !== undefined) {\r\n setQuickFilterText(quickFilterTextProps ?? \"\");\r\n }\r\n }, [quickFilterTextProps, setQuickFilterText]);\r\n\r\n return (\r\n <AgGridReact\r\n gridId={gridId}\r\n theme={propTheme ?? theme}\r\n rowData={rowData}\r\n quickFilterText={quickFilterText}\r\n onGridReady={handleGridReady}\r\n containerStyle={{ height: `calc(100% - ${actionbarHeight}px)`, ...containerStyle }}\r\n {...props}\r\n ref={ref}\r\n />\r\n );\r\n },\r\n);\r\n\r\nDataGridContent.displayName = \"DataGridContent\";\r\n\r\ntype DatagridActionBarProps = HTMLAttributes<HTMLDivElement> & {};\r\n\r\nconst DataGridActionBar: React.FC<DatagridActionBarProps> = ({ className, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"DataGridActionBar should be used within <DataGrid>\");\r\n }\r\n const ref = React.useRef<HTMLDivElement | null>(null);\r\n const { setActionbarExists, setActionbarHeight } = context;\r\n const { children } = props;\r\n\r\n React.useEffect(() => {\r\n setActionbarExists(true);\r\n return () => setActionbarExists(false);\r\n }, [setActionbarExists]);\r\n\r\n React.useEffect(() => {\r\n if (ref.current) {\r\n setActionbarHeight(ref.current.clientHeight);\r\n }\r\n }, [setActionbarHeight]);\r\n\r\n return (\r\n <div\r\n className={cn(\r\n \"relative flex items-center p-2 h-12 w-full bg-gray-0 border border-gray-200 border-b-0 -mb-[1px] z-10 rounded-t-[8px]\",\r\n className,\r\n )}\r\n ref={ref}\r\n >\r\n {children}\r\n </div>\r\n );\r\n};\r\n\r\ntype SearchActionProps = HTMLAttributes<HTMLDivElement> & {\r\n defaultOpen?: boolean;\r\n};\r\n\r\nconst SearchAction: React.FC<SearchActionProps> = ({ defaultOpen = false, className, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"SearchAction should be used within <DataGrid>\");\r\n }\r\n\r\n const { quickFilterText, setQuickFilterText } = context;\r\n\r\n const [isSearchInputOpen, setIsSearchInputOpen] = React.useState(defaultOpen);\r\n const [isClosing, setIsClosing] = React.useState(false);\r\n const inputRef = React.useRef<HTMLInputElement | null>(null);\r\n\r\n const handleClear = () => {\r\n context.setQuickFilterText(\"\");\r\n if (inputRef.current) {\r\n inputRef.current.focus();\r\n }\r\n };\r\n\r\n const handleOpen = () => {\r\n setIsSearchInputOpen(true);\r\n };\r\n\r\n React.useEffect(() => {\r\n if (isSearchInputOpen && inputRef?.current) {\r\n inputRef.current.focus();\r\n }\r\n }, [isSearchInputOpen]);\r\n\r\n const handleClose = () => {\r\n setIsClosing(true);\r\n context.setQuickFilterText(\"\");\r\n setTimeout(() => {\r\n setIsSearchInputOpen(false);\r\n setIsClosing(false);\r\n }, 200);\r\n };\r\n\r\n return (\r\n <div className={cn(\"max-w-60\", className)} {...props}>\r\n {isSearchInputOpen || isClosing ? (\r\n <TextField\r\n ref={inputRef}\r\n className={cn(\"relative h-7.5\", isSearchInputOpen && !isClosing ? \"animate-input-open\" : \"\", isClosing && \"animate-input-close\")}\r\n onChange={e => setQuickFilterText(e.target.value)}\r\n value={quickFilterText}\r\n startAdornment={\r\n <IconButton variant=\"toolbar\" className=\"p-0.5 h-6 w-6 border-none mx-1\" onClick={handleClose}>\r\n <Magnifier className=\"w-5 h-5\" />\r\n </IconButton>\r\n }\r\n endAdornment={\r\n quickFilterText && (\r\n <IconButton variant=\"toolbar\" className=\"p-0.5 w-6 h-6 border-none mx-1\" onClick={handleClear}>\r\n <CircleXmark className=\"w-5 h-5\" />\r\n </IconButton>\r\n )\r\n }\r\n />\r\n ) : (\r\n <IconButton variant=\"toolbar\" className=\"p-0.5 w-6 h-6 m-1\" onClick={handleOpen}>\r\n <Magnifier className=\"w-5 h-5\" />\r\n </IconButton>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\ntype FreezeActionProps = ButtonProps & {\r\n freezeText?: string;\r\n unFreezeText?: string;\r\n};\r\n\r\nconst FreezeAction: React.FC<FreezeActionProps> = ({ freezeText, unFreezeText, onClick, disabled, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"FreezeAction should be used within <DataGrid>\");\r\n }\r\n\r\n const [pinnedRowCount, setPinnedRowCount] = React.useState(0);\r\n const [selectedRowsCount, setSelectedRowsCount] = React.useState(0);\r\n\r\n const { api, rowData } = context;\r\n\r\n const freezeRows = () => {\r\n if (!api) return;\r\n\r\n // Get currently selected rows\r\n const selectedRows = api.getSelectedNodes();\r\n\r\n if (selectedRows.length > 0) {\r\n // Pin the selected rows\r\n api.setGridOption(\r\n \"pinnedTopRowData\",\r\n selectedRows.map(row => row.data),\r\n );\r\n\r\n // Get current row data\r\n const allData = api.getRenderedNodes();\r\n // Filter out pinned rows from the main data\r\n const updatedNodes = allData.filter(row => !selectedRows.some(pinnedRow => pinnedRow.id === row.id));\r\n\r\n // Update the grid with the filtered data\r\n api.setGridOption(\r\n \"rowData\",\r\n updatedNodes.map(node => node.data),\r\n );\r\n }\r\n };\r\n\r\n const unfreezeRows = () => {\r\n if (!api) return;\r\n api.setGridOption(\"pinnedTopRowData\", []);\r\n api.setGridOption(\"rowData\", rowData);\r\n };\r\n\r\n const handleFreezing = (e: React.MouseEvent<HTMLButtonElement>) => {\r\n if (api) {\r\n const pinnedRowsCount = api.getPinnedTopRowCount();\r\n if (pinnedRowsCount > 0) {\r\n unfreezeRows();\r\n } else {\r\n freezeRows();\r\n }\r\n }\r\n onClick?.(e);\r\n };\r\n\r\n React.useEffect(() => {\r\n api?.addEventListener(\"pinnedRowDataChanged\", () => {\r\n setPinnedRowCount(api.getPinnedTopRowCount());\r\n });\r\n\r\n api?.addEventListener(\"selectionChanged\", () => {\r\n setSelectedRowsCount(api.getSelectedNodes().length);\r\n });\r\n\r\n return () => {\r\n api?.removeEventListener(\"pinnedRowDataChanged\", () => {\r\n setPinnedRowCount(api.getPinnedTopRowCount());\r\n });\r\n\r\n api?.removeEventListener(\"selectionChanged\", () => {\r\n setSelectedRowsCount(api.getSelectedNodes().length);\r\n });\r\n };\r\n }, [api]);\r\n\r\n return (\r\n <Button\r\n variant=\"text\"\r\n onClick={handleFreezing}\r\n startIcon={<Snowflake className=\"w-4.5 h-4.5\" />}\r\n disabled={(!pinnedRowCount && !selectedRowsCount) || disabled}\r\n {...props}\r\n >\r\n {pinnedRowCount ? (unFreezeText ?? \"Unfreeze\") : (freezeText ?? \"Freeze\")}\r\n </Button>\r\n );\r\n};\r\n\r\ntype PrintActionProps = IconButtonProps & {};\r\n\r\nconst PrintAction: React.FC<PrintActionProps> = ({ children, className, onClick, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"PrintAction should be used within <DataGrid>\");\r\n }\r\n\r\n const handlePrint = (e: React.MouseEvent<HTMLButtonElement>) => {\r\n if (context.api) {\r\n context.api.setGridOption(\"domLayout\", \"print\");\r\n\r\n setTimeout(() => {\r\n const element = document.querySelector(\"[grid-id='\" + context.gridId + \"']\") as HTMLElement;\r\n const header = document.head;\r\n const html = `<html>\r\n ${header.innerHTML}\r\n ${element.outerHTML}\r\n </html>`;\r\n printHtml(html);\r\n context?.api?.setGridOption(\"domLayout\", undefined);\r\n });\r\n }\r\n onClick?.(e);\r\n };\r\n\r\n return (\r\n <IconButton variant=\"toolbar\" className={cn(\"p-0.5 w-6 h-6\", className)} onClick={handlePrint} {...props}>\r\n {children ?? <Print className=\"w-5 h-5\" />}\r\n </IconButton>\r\n );\r\n};\r\n\r\ntype RefreshActionProps = Omit<IconButtonProps, \"onClick\"> & {\r\n onRefresh: () => void;\r\n};\r\n\r\nconst RefreshAction: React.FC<RefreshActionProps> = ({ className, onRefresh, children, loading, ...props }) => {\r\n const context = React.useContext(DataGridContext);\r\n\r\n if (!context) {\r\n throw new Error(\"RefreshAction should be used within <DataGrid>\");\r\n }\r\n\r\n const handleRefresh = () => {\r\n onRefresh();\r\n };\r\n\r\n return (\r\n <IconButton\r\n className={cn(\"p-0.5 w-6 h-6\", loading && \"disabled:bg-transparent\", className)}\r\n variant=\"toolbar\"\r\n onClick={handleRefresh}\r\n disabled={loading}\r\n {...props}\r\n >\r\n {children ?? <Refresh className={cn(\"w-4.5 h-4.5\", loading && \"animate-spin\")} />}\r\n </IconButton>\r\n );\r\n};\r\n\r\ntype DeleteActionProps = Omit<ButtonProps, \"onClick\"> & {\r\n onDelete: () => void;\r\n};\r\n\r\nconst DeleteAction: React.FC<DeleteActionProps> = ({ onDelete, children, ...props }) => {\r\n const handleDelete = () => {\r\n onDelete();\r\n };\r\n\r\n return (\r\n <Button variant=\"danger\" onClick={handleDelete} startIcon={<Trashcan className=\"w-4.5 h-4.5\" />} {...props}>\r\n {children}\r\n </Button>\r\n );\r\n};\r\n\r\ntype ExtraActionsProps = PopoverContentProps & {\r\n children: React.ReactNode;\r\n slotProps?: {\r\n triggerProps?: PopoverTriggerProps;\r\n popoverProps?: PopoverProps;\r\n };\r\n};\r\n\r\nconst ExtraActions: React.FC<ExtraActionsProps> = ({ children, slotProps, className, ...props }) => {\r\n return (\r\n <Popover {...(slotProps?.popoverProps ?? {})}>\r\n <PopoverTrigger {...(slotProps?.triggerProps ?? {})}>\r\n <ElipsisVertical className=\"w-4.5 h-4.5 text-primary\" />\r\n </PopoverTrigger>\r\n <PopoverContent align=\"end\" className={cn(\"w-40\", className)} {...props}>\r\n {children}\r\n </PopoverContent>\r\n </Popover>\r\n );\r\n};\r\n\r\nexport {\r\n DataGrid,\r\n DataGridContent,\r\n DataGridActionBar,\r\n SearchAction,\r\n FreezeAction,\r\n PrintAction,\r\n RefreshAction,\r\n ExtraActions,\r\n DeleteAction,\r\n type DataGridProps,\r\n type DataGridContentProps,\r\n type DatagridActionBarProps,\r\n type SearchActionProps,\r\n type FreezeActionProps,\r\n type RefreshActionProps,\r\n type ExtraActionsProps,\r\n type DeleteActionProps,\r\n useDataGrid,\r\n dataGridDefaultTheme,\r\n};\r\n"],"names":["ModuleRegistry","AllCommunityModule","dataGridDefaultTheme","themeQuartz","DataGridContext","React","useDataGrid","context","DataGrid","children","gridId","api","setApi","rowData","setRowData","actionbarHeight","setActionbarHeight","quickFilterText","setQuickFilterText","actionbarExists","setActionbarExists","jsx","DataGridContent","forwardRef","propTheme","onGridReady","quickFilterTextProps","rowDataProps","containerStyle","props","ref","theme","useMemo","handleGridReady","e","AgGridReact","DataGridActionBar","className","cn","SearchAction","defaultOpen","isSearchInputOpen","setIsSearchInputOpen","isClosing","setIsClosing","inputRef","handleClear","handleOpen","handleClose","TextField","IconButton","Magnifier","CircleXmark","FreezeAction","freezeText","unFreezeText","onClick","disabled","pinnedRowCount","setPinnedRowCount","selectedRowsCount","setSelectedRowsCount","freezeRows","selectedRows","row","updatedNodes","pinnedRow","node","unfreezeRows","handleFreezing","Button","Snowflake","PrintAction","handlePrint","element","html","printHtml","Print","RefreshAction","onRefresh","loading","handleRefresh","Refresh","DeleteAction","onDelete","Trashcan","ExtraActions","slotProps","Popover","PopoverTrigger","ElipsisVertical","PopoverContent"],"mappings":";;;;;;;;;;;AAgBAA,EAAe,gBAAgB,CAACC,CAAkB,CAAC;AAEnD,MAAMC,IAAuBC,EAAY,WAAW;AAAA,EAClD,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,uBAAuB;AAAA,EACvB,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,eAAe;AACjB,CAAC,GAgBKC,IAAkBC,EAAM,cAAsC,IAAI,GAElEC,KAAc,MAAM;AACxB,QAAMC,IAAUF,EAAM,WAAWD,CAAe;AAEhD,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,8CAA8C;AAGhE,SAAOA;AACT,GAMMC,KAAoC,CAAC,EAAE,UAAAC,QAAe;AAC1D,QAAMC,IAASL,EAAM,MAAA,GACf,CAACM,GAAKC,CAAM,IAAIP,EAAM,SAAyB,IAAI,GACnD,CAACQ,GAASC,CAAU,IAAIT,EAAM,SAAmC,CAAA,CAAE,GACnE,CAACU,GAAiBC,CAAkB,IAAIX,EAAM,SAAS,CAAC,GAExD,CAACY,GAAiBC,CAAkB,IAAIb,EAAM,SAAS,EAAE,GACzD,CAACc,GAAiBC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,gBAAArE,EAACsE,GAAA,EAAe,OAAM,OAAM,WAAWrD,EAAG,QAAQD,CAAS,GAAI,GAAGR,GAC/D,UAAApB,EAAA,CACH;AAAA,GACF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"datepicker.es.js","sources":["../src/components/date-picker/DatePicker.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React from \"react\";\r\nimport { DesktopDatePicker, DesktopDatePickerProps } from \"./DesktopDatePicker\";\r\nimport { MobileDatePicker, MobileDatePickerProps } from \"./MobileDatePicker\";\r\nimport { useIsMobile } from \"../../lib/hooks/use-mobile\";\r\n\r\ntype DatePickerProps = DesktopDatePickerProps & MobileDatePickerProps & {};\r\n\r\nconst DatePicker: React.FC<DatePickerProps> = props => {\r\n const isMobile = useIsMobile();\r\n\r\n return isMobile ? <MobileDatePicker {...props} /> : <DesktopDatePicker {...props} />;\r\n};\r\n\r\nexport { DatePicker, DesktopDatePicker, MobileDatePicker, type DatePickerProps, type DesktopDatePickerProps, type MobileDatePickerProps };\r\n"],"names":["DatePicker","props","useIsMobile","MobileDatePicker","jsx","DesktopDatePicker"],"mappings":";;;;AASA,MAAMA,IAAwC,CAASC,MACpCC,EAAY,sBAEVC,GAAkB,EAAA,GAAGF,GAAO,IAAK,gBAAAG,EAACC,GAAmB,EAAA,GAAGJ,EAAO,CAAA;"}
1
+ {"version":3,"file":"datepicker.es.js","sources":["../src/components/date-picker/DatePicker.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React from \"react\";\r\nimport { DesktopDatePicker, DesktopDatePickerProps } from \"./DesktopDatePicker\";\r\nimport { MobileDatePicker, MobileDatePickerProps } from \"./MobileDatePicker\";\r\nimport { useIsMobile } from \"../../lib/hooks/use-mobile\";\r\n\r\ntype DatePickerProps = DesktopDatePickerProps & MobileDatePickerProps & {};\r\n\r\nconst DatePicker: React.FC<DatePickerProps> = props => {\r\n const isMobile = useIsMobile();\r\n\r\n return isMobile ? <MobileDatePicker {...props} /> : <DesktopDatePicker {...props} />;\r\n};\r\n\r\nexport { DatePicker, DesktopDatePicker, MobileDatePicker, type DatePickerProps, type DesktopDatePickerProps, type MobileDatePickerProps };\r\n"],"names":["DatePicker","props","useIsMobile","MobileDatePicker","jsx","DesktopDatePicker"],"mappings":";;;;AASA,MAAMA,IAAwC,CAAAC,MAC3BC,EAAA,sBAEEC,GAAA,EAAkB,GAAGF,GAAO,IAAK,gBAAAG,EAACC,GAAA,EAAmB,GAAGJ,EAAA,CAAO;"}
@@ -1 +1 @@
1
- {"version":3,"file":"daterangepicker.es.js","sources":["../src/components/date-picker/DateRangePicker.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React from \"react\";\r\n\r\nimport { useIsMobile } from \"../../lib/hooks/use-mobile\";\r\nimport { MobileDateRangePicker, MobileDateRangePickerProps } from \"./MobileDateRangePicker\";\r\nimport { DesktopDateRangePicker, DesktopDateRangePickerProps } from \"./DesktopDateRangePicker\";\r\n\r\ntype DateRangePickerProps = DesktopDateRangePickerProps & MobileDateRangePickerProps & {};\r\n\r\nconst DateRangePicker: React.FC<DateRangePickerProps> = props => {\r\n const isMobile = useIsMobile();\r\n\r\n return isMobile ? <MobileDateRangePicker {...props} /> : <DesktopDateRangePicker {...props} />;\r\n};\r\n\r\nexport {\r\n DateRangePicker,\r\n DesktopDateRangePicker,\r\n MobileDateRangePicker,\r\n type DateRangePickerProps,\r\n type DesktopDateRangePickerProps,\r\n type MobileDateRangePickerProps,\r\n};\r\n"],"names":["DateRangePicker","props","useIsMobile","MobileDateRangePicker","jsx","DesktopDateRangePicker"],"mappings":";;;;AAUA,MAAMA,IAAkD,CAASC,MAC9CC,EAAY,sBAEVC,GAAuB,EAAA,GAAGF,GAAO,IAAK,gBAAAG,EAACC,GAAwB,EAAA,GAAGJ,EAAO,CAAA;"}
1
+ {"version":3,"file":"daterangepicker.es.js","sources":["../src/components/date-picker/DateRangePicker.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React from \"react\";\r\n\r\nimport { useIsMobile } from \"../../lib/hooks/use-mobile\";\r\nimport { MobileDateRangePicker, MobileDateRangePickerProps } from \"./MobileDateRangePicker\";\r\nimport { DesktopDateRangePicker, DesktopDateRangePickerProps } from \"./DesktopDateRangePicker\";\r\n\r\ntype DateRangePickerProps = DesktopDateRangePickerProps & MobileDateRangePickerProps & {};\r\n\r\nconst DateRangePicker: React.FC<DateRangePickerProps> = props => {\r\n const isMobile = useIsMobile();\r\n\r\n return isMobile ? <MobileDateRangePicker {...props} /> : <DesktopDateRangePicker {...props} />;\r\n};\r\n\r\nexport {\r\n DateRangePicker,\r\n DesktopDateRangePicker,\r\n MobileDateRangePicker,\r\n type DateRangePickerProps,\r\n type DesktopDateRangePickerProps,\r\n type MobileDateRangePickerProps,\r\n};\r\n"],"names":["DateRangePicker","props","useIsMobile","MobileDateRangePicker","jsx","DesktopDateRangePicker"],"mappings":";;;;AAUA,MAAMA,IAAkD,CAAAC,MACrCC,EAAA,sBAEEC,GAAA,EAAuB,GAAGF,GAAO,IAAK,gBAAAG,EAACC,GAAA,EAAwB,GAAGJ,EAAA,CAAO;"}
@@ -1 +1 @@
1
- {"version":3,"file":"defaultoptions.es.js","sources":["../node_modules/date-fns/_lib/defaultOptions.js"],"sourcesContent":["let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n"],"names":["defaultOptions","getDefaultOptions"],"mappings":"AAAA,IAAIA,IAAiB,CAAE;AAEhB,SAASC,IAAoB;AAClC,SAAOD;AACT;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"defaultoptions.es.js","sources":["../node_modules/date-fns/_lib/defaultOptions.js"],"sourcesContent":["let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n"],"names":["defaultOptions","getDefaultOptions"],"mappings":"AAAA,IAAIA,IAAiB,CAAA;AAEd,SAASC,IAAoB;AAClC,SAAOD;AACT;","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"desktopdatepicker.es.js","sources":["../src/components/date-picker/DesktopDatePicker.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, PropsSingle, DayEventHandler } 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 DesktopDatePickerProps = PropsBase &\r\n Omit<PropsSingle, \"mode\"> & {\r\n formatStr?: string;\r\n placeholder?: string;\r\n calendarClassName?: string;\r\n selected?: Date;\r\n required?: boolean;\r\n closeOnSelect?: boolean;\r\n disabled?: boolean;\r\n };\r\n\r\nconst DesktopDatePicker: React.FC<DesktopDatePickerProps> = ({\r\n formatStr,\r\n selected,\r\n placeholder,\r\n className,\r\n calendarClassName,\r\n closeOnSelect = true,\r\n onDayClick,\r\n disabled,\r\n ...props\r\n}) => {\r\n const [isOpen, setIsOpen] = React.useState(false);\r\n\r\n const handleDayClick: DayEventHandler<React.MouseEvent<Element, MouseEvent>> = (date, modifiers, e) => {\r\n onDayClick?.(date, modifiers, e);\r\n if (closeOnSelect) setIsOpen(false);\r\n };\r\n\r\n return (\r\n <Popover open={isOpen} onOpenChange={setIsOpen}>\r\n <PopoverTrigger asChild>\r\n <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-sm 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={selected ? `Selected date: ${format(selected, formatStr ?? \"yyyy/MM/dd\")}` : \"Pick a date\"}\r\n disabled={disabled}\r\n >\r\n {selected ? format(selected, formatStr ?? \"yyyy/MM/dd\") : <span>{placeholder ?? \"Pick a date\"}</span>}\r\n <CalendarIcon className=\"mr-2 ms-auto\" />\r\n </Button>\r\n </PopoverTrigger>\r\n <PopoverContent className=\"w-auto p-0\">\r\n <Calendar\r\n defaultMonth={selected}\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={selected}\r\n captionLayout=\"dropdown-years\"\r\n className={calendarClassName}\r\n onDayClick={handleDayClick}\r\n />\r\n </PopoverContent>\r\n </Popover>\r\n );\r\n};\r\n\r\nexport { DesktopDatePicker, type DesktopDatePickerProps };\r\n"],"names":["DesktopDatePicker","formatStr","selected","placeholder","className","calendarClassName","closeOnSelect","onDayClick","disabled","props","isOpen","setIsOpen","React","handleDayClick","date","modifiers","e","jsxs","Popover","jsx","PopoverTrigger","Button","cn","format","CalendarIcon","PopoverContent","Calendar"],"mappings":";;;;;;;;AAuBA,MAAMA,IAAsD,CAAC;AAAA,EAC3D,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAM,SAAS,EAAK,GAE1CC,IAAyE,CAACC,GAAMC,GAAWC,MAAM;AACxF,IAAAT,IAAAO,GAAMC,GAAWC,CAAC,GAC3BV,OAAyB,EAAK;AAAA,EACpC;AAEA,SACG,gBAAAW,EAAAC,GAAA,EAAQ,MAAMR,GAAQ,cAAcC,GACnC,UAAA;AAAA,IAAC,gBAAAQ,EAAAC,GAAA,EAAe,SAAO,IACrB,UAAA,gBAAAH;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,WAAWC;AAAA,UACT;AAAA,UACAlB;AAAA,QACF;AAAA,QACA,oBAAmBF,IAAgB,SAAL;AAAA,QAC9B,cAAYA,IAAW,kBAAkBqB,EAAOrB,GAAUD,KAAa,YAAY,CAAC,KAAK;AAAA,QACzF,UAAAO;AAAA,QAEC,UAAA;AAAA,UAAWN,IAAAqB,EAAOrB,GAAUD,KAAa,YAAY,IAAK,gBAAAkB,EAAA,QAAA,EAAM,eAAe,cAAc,CAAA;AAAA,UAC9F,gBAAAA,EAACK,GAAa,EAAA,WAAU,eAAe,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAE3C;AAAA,IACA,gBAAAL,EAACM,GAAe,EAAA,WAAU,cACxB,UAAA,gBAAAN;AAAA,MAACO;AAAAA,MAAA;AAAA,QACC,cAAcxB;AAAA,QACd,YAAY,IAAI,KAAK,KAAM,GAAG,CAAC;AAAA,QAC/B,UAAU,IAAI,MAAS,oBAAA,KAAA,GAAO,gBAAgB,GAAG,IAAI,EAAE;AAAA,QACtD,GAAGO;AAAA,QACJ,MAAK;AAAA,QACL,UAAAP;AAAA,QACA,eAAc;AAAA,QACd,WAAWG;AAAA,QACX,YAAYQ;AAAA,MAAA;AAAA,IAAA,EAEhB,CAAA;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"desktopdatepicker.es.js","sources":["../src/components/date-picker/DesktopDatePicker.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, PropsSingle, DayEventHandler } 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 DesktopDatePickerProps = PropsBase &\r\n Omit<PropsSingle, \"mode\"> & {\r\n formatStr?: string;\r\n placeholder?: string;\r\n calendarClassName?: string;\r\n selected?: Date;\r\n required?: boolean;\r\n closeOnSelect?: boolean;\r\n disabled?: boolean;\r\n };\r\n\r\nconst DesktopDatePicker: React.FC<DesktopDatePickerProps> = ({\r\n formatStr,\r\n selected,\r\n placeholder,\r\n className,\r\n calendarClassName,\r\n closeOnSelect = true,\r\n onDayClick,\r\n disabled,\r\n ...props\r\n}) => {\r\n const [isOpen, setIsOpen] = React.useState(false);\r\n\r\n const handleDayClick: DayEventHandler<React.MouseEvent<Element, MouseEvent>> = (date, modifiers, e) => {\r\n onDayClick?.(date, modifiers, e);\r\n if (closeOnSelect) setIsOpen(false);\r\n };\r\n\r\n return (\r\n <Popover open={isOpen} onOpenChange={setIsOpen}>\r\n <PopoverTrigger asChild>\r\n <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-sm 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={selected ? `Selected date: ${format(selected, formatStr ?? \"yyyy/MM/dd\")}` : \"Pick a date\"}\r\n disabled={disabled}\r\n >\r\n {selected ? format(selected, formatStr ?? \"yyyy/MM/dd\") : <span>{placeholder ?? \"Pick a date\"}</span>}\r\n <CalendarIcon className=\"mr-2 ms-auto\" />\r\n </Button>\r\n </PopoverTrigger>\r\n <PopoverContent className=\"w-auto p-0\">\r\n <Calendar\r\n defaultMonth={selected}\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={selected}\r\n captionLayout=\"dropdown-years\"\r\n className={calendarClassName}\r\n onDayClick={handleDayClick}\r\n />\r\n </PopoverContent>\r\n </Popover>\r\n );\r\n};\r\n\r\nexport { DesktopDatePicker, type DesktopDatePickerProps };\r\n"],"names":["DesktopDatePicker","formatStr","selected","placeholder","className","calendarClassName","closeOnSelect","onDayClick","disabled","props","isOpen","setIsOpen","React","handleDayClick","date","modifiers","e","jsxs","Popover","jsx","PopoverTrigger","Button","cn","format","CalendarIcon","PopoverContent","Calendar"],"mappings":";;;;;;;;AAuBA,MAAMA,IAAsD,CAAC;AAAA,EAC3D,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAM,SAAS,EAAK,GAE1CC,IAAyE,CAACC,GAAMC,GAAWC,MAAM;AACrG,IAAAT,IAAaO,GAAMC,GAAWC,CAAC,GAC3BV,OAAyB,EAAK;AAAA,EACpC;AAEA,SACE,gBAAAW,EAACC,GAAA,EAAQ,MAAMR,GAAQ,cAAcC,GACnC,UAAA;AAAA,IAAA,gBAAAQ,EAACC,GAAA,EAAe,SAAO,IACrB,UAAA,gBAAAH;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,WAAWC;AAAA,UACT;AAAA,UACAlB;AAAA,QAAA;AAAA,QAEF,oBAAmBF,IAAgB,SAAL;AAAA,QAC9B,cAAYA,IAAW,kBAAkBqB,EAAOrB,GAAUD,KAAa,YAAY,CAAC,KAAK;AAAA,QACzF,UAAAO;AAAA,QAEC,UAAA;AAAA,UAAAN,IAAWqB,EAAOrB,GAAUD,KAAa,YAAY,IAAI,gBAAAkB,EAAC,QAAA,EAAM,eAAe,cAAA,CAAc;AAAA,UAC9F,gBAAAA,EAACK,GAAA,EAAa,WAAU,eAAA,CAAe;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAE3C;AAAA,IACA,gBAAAL,EAACM,GAAA,EAAe,WAAU,cACxB,UAAA,gBAAAN;AAAA,MAACO;AAAAA,MAAA;AAAA,QACC,cAAcxB;AAAA,QACd,YAAY,IAAI,KAAK,KAAM,GAAG,CAAC;AAAA,QAC/B,UAAU,IAAI,MAAK,oBAAI,KAAA,GAAO,gBAAgB,GAAG,IAAI,EAAE;AAAA,QACtD,GAAGO;AAAA,QACJ,MAAK;AAAA,QACL,UAAAP;AAAA,QACA,eAAc;AAAA,QACd,WAAWG;AAAA,QACX,YAAYQ;AAAA,MAAA;AAAA,IAAA,EACd,CACF;AAAA,EAAA,GACF;AAEJ;"}
@@ -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 { PropsBase, PropsRange, DateRange } 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 { Popover, PopoverContent, PopoverTrigger } from \"../popover/Popover\";\r\n\r\ntype DesktopDateRangePickerProps = PropsBase &\r\n Omit<PropsRange, \"mode\"> & {\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 };\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 ...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 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-sm 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 {/* <div className=\"flex gap-2\">\r\n <Button\r\n variant={\"outline\"}\r\n className={cn(\r\n \"border-gray-300 text-text focus:ring-0 active:ring-transparent justify-start\",\r\n !selected && \"text-muted-foreground\",\r\n className,\r\n )}\r\n >\r\n {selected?.from ? format(selected.from, formatStr ?? \"yyyy/MM/dd\") : <span>{placeholder ?? \"From\"}</span>}\r\n <CalendarIcon className=\"mr-2 h-5 w-5 ms-auto\" />\r\n </Button>\r\n <Button\r\n variant={\"outline\"}\r\n className={cn(\r\n \"border-gray-300 text-text focus:ring-0 active:ring-transparent justify-start\",\r\n !selected && \"text-muted-foreground\",\r\n className,\r\n )}\r\n >\r\n {selected?.to ? format(selected.to, formatStr ?? \"yyyy/MM/dd\") : <span>{placeholder ?? \"To\"}</span>}\r\n <CalendarIcon className=\"mr-2 h-5 w-5 ms-auto\" />\r\n </Button>\r\n </div> */}\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 />\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","props","isOpen","setIsOpen","React","jsxs","Popover","open","jsx","PopoverTrigger","Button","cn","format","CalendarIcon","PopoverContent","Calendar"],"mappings":";;;;;;;;AAwBA,MAAMA,IAAgE,CAAC;AAAA,EACrE,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAM,SAAS,EAAK;AAG9C,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAMJ;AAAA,MAC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AAC;AAAA,YAC/B,UAAU,IAAI,MAAS,oBAAA,KAAA,GAAO,gBAAgB,GAAG,IAAI,EAAE;AAAA,YACtD,GAAGO;AAAA,YACJ,MAAK;AAAA,YACL,UAAAP;AAAA,YACA,WAAWiB,EAAGd,GAAmB,4BAA4B;AAAA,YAC7D,gBAAgB;AAAA,UAAA;AAAA,QAAA,EAEpB,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACF;AAEJ;"}
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 { PropsBase, PropsRange, DateRange } 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 { Popover, PopoverContent, PopoverTrigger } from \"../popover/Popover\";\r\n\r\ntype DesktopDateRangePickerProps = PropsBase &\r\n Omit<PropsRange, \"mode\"> & {\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 };\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 ...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 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-sm 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 {/* <div className=\"flex gap-2\">\r\n <Button\r\n variant={\"outline\"}\r\n className={cn(\r\n \"border-gray-300 text-text focus:ring-0 active:ring-transparent justify-start\",\r\n !selected && \"text-muted-foreground\",\r\n className,\r\n )}\r\n >\r\n {selected?.from ? format(selected.from, formatStr ?? \"yyyy/MM/dd\") : <span>{placeholder ?? \"From\"}</span>}\r\n <CalendarIcon className=\"mr-2 h-5 w-5 ms-auto\" />\r\n </Button>\r\n <Button\r\n variant={\"outline\"}\r\n className={cn(\r\n \"border-gray-300 text-text focus:ring-0 active:ring-transparent justify-start\",\r\n !selected && \"text-muted-foreground\",\r\n className,\r\n )}\r\n >\r\n {selected?.to ? format(selected.to, formatStr ?? \"yyyy/MM/dd\") : <span>{placeholder ?? \"To\"}</span>}\r\n <CalendarIcon className=\"mr-2 h-5 w-5 ms-auto\" />\r\n </Button>\r\n </div> */}\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 />\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","props","isOpen","setIsOpen","React","jsxs","Popover","open","jsx","PopoverTrigger","Button","cn","format","CalendarIcon","PopoverContent","Calendar"],"mappings":";;;;;;;;AAwBA,MAAMA,IAAgE,CAAC;AAAA,EACrE,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAM,SAAS,EAAK;AAEhD,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAMJ;AAAA,MACN,cAAc,CAAAK,MAAQ;AACpB,QAAAJ,EAAUI,CAAI;AAAA,MAChB;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAC,EAACC,GAAA,EAAe,SAAO,IACrB,UAAA,gBAAAJ;AAAA,UAACK;AAAA,UAAA;AAAA,YACC,SAAQ;AAAA,YACR,WAAWC;AAAA,cACT;AAAA,cACAf;AAAA,YAAA;AAAA,YAEF,oBAAmBF,IAAgB,SAAL;AAAA,YAC9B,cACEA,IACI,kBAAkBA,GAAU,OAAOkB,EAAOlB,EA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/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 { Time, TimePickerContent } from \"./TimePickerContent\";\r\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover/Popover\";\r\n\r\ntype DesktopTimePickerProps = HTMLAttributes<HTMLButtonElement> & {\r\n time: Time | undefined;\r\n onTimeChange: (time: Time | undefined) => void;\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 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 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-sm 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?.hour ? `Selected time: ${time.hour}:${time.minute} ${time.ampm}` : placeholder}\r\n {...restProps}\r\n >\r\n {`${time?.hour?.toString()?.padStart(2, \"0\") ?? \"--\"} : ${time?.minute?.toString()?.padStart(2, \"0\") ?? \"--\"} ${time?.ampm ?? \"--\"}`}\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} onTimeChange={onTimeChange} time={time} slotsProps={slotsProps} />\r\n </PopoverContent>\r\n </Popover>\r\n );\r\n};\r\nexport { DesktopTimePicker, type DesktopTimePickerProps };\r\n"],"names":["DesktopTimePicker","time","onTimeChange","className","slotsProps","placeholder","restProps","isOpen","setIsOpen","useState","jsxs","Popover","jsx","PopoverTrigger","Button","cn","PopoverContent","TimePickerContent"],"mappings":";;;;;;AAmBA,MAAMA,IAAsD,CAAC;AAAA,EAC3D,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,GAAGC;AACL,MAAM;AACJ,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK;AAE1C,SACG,gBAAAC,EAAAC,GAAA,EAAQ,MAAMJ,GAAQ,cAAcC,GACnC,UAAA;AAAA,IAAC,gBAAAI,EAAAC,GAAA,EAAe,SAAO,IACrB,UAAA,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,WAAWC;AAAA,UACT;AAAA,UACAZ;AAAA,QACF;AAAA,QACA,oBAAmBF,IAAY,SAAL;AAAA,QAC1B,cAAYA,GAAM,OAAO,kBAAkBA,EAAK,IAAI,IAAIA,EAAK,MAAM,IAAIA,EAAK,IAAI,KAAKI;AAAA,QACpF,GAAGC;AAAA,QAEH,UAAA,GAAGL,GAAM,MAAM,SAAA,GAAY,SAAS,GAAG,GAAG,KAAK,IAAI,MAAMA,GAAM,QAAQ,SAAA,GAAY,SAAS,GAAG,GAAG,KAAK,IAAI,IAAIA,GAAM,QAAQ,IAAI;AAAA,MAAA;AAAA,IAAA,GAEtI;AAAA,IACA,gBAAAW,EAACI,KAAgB,GAAIZ,GAAY,WAAW,CAAA,GAAK,WAAWW,EAAG,cAAcX,GAAY,SAAS,SAAS,GACzG,UAAC,gBAAAQ,EAAAK,GAAA,EAAkB,QAAAV,GAAgB,cAAAL,GAA4B,MAAAD,GAAY,YAAAG,GAAwB,EACrG,CAAA;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 { Time, TimePickerContent } from \"./TimePickerContent\";\r\nimport { Popover, PopoverContent, PopoverTrigger } from \"../popover/Popover\";\r\n\r\ntype DesktopTimePickerProps = HTMLAttributes<HTMLButtonElement> & {\r\n time: Time | undefined;\r\n onTimeChange: (time: Time | undefined) => void;\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 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 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-sm 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?.hour ? `Selected time: ${time.hour}:${time.minute} ${time.ampm}` : placeholder}\r\n {...restProps}\r\n >\r\n {`${time?.hour?.toString()?.padStart(2, \"0\") ?? \"--\"} : ${time?.minute?.toString()?.padStart(2, \"0\") ?? \"--\"} ${time?.ampm ?? \"--\"}`}\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} onTimeChange={onTimeChange} time={time} slotsProps={slotsProps} />\r\n </PopoverContent>\r\n </Popover>\r\n );\r\n};\r\nexport { DesktopTimePicker, type DesktopTimePickerProps };\r\n"],"names":["DesktopTimePicker","time","onTimeChange","className","slotsProps","placeholder","restProps","isOpen","setIsOpen","useState","jsxs","Popover","jsx","PopoverTrigger","Button","cn","PopoverContent","TimePickerContent"],"mappings":";;;;;;AAmBA,MAAMA,IAAsD,CAAC;AAAA,EAC3D,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC,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,SAAQ;AAAA,QACR,WAAWC;AAAA,UACT;AAAA,UACAZ;AAAA,QAAA;AAAA,QAEF,oBAAmBF,IAAY,SAAL;AAAA,QAC1B,cAAYA,GAAM,OAAO,kBAAkBA,EAAK,IAAI,IAAIA,EAAK,MAAM,IAAIA,EAAK,IAAI,KAAKI;AAAA,QACpF,GAAGC;AAAA,QAEH,UAAA,GAAGL,GAAM,MAAM,SAAA,GAAY,SAAS,GAAG,GAAG,KAAK,IAAI,MAAMA,GAAM,QAAQ,SAAA,GAAY,SAAS,GAAG,GAAG,KAAK,IAAI,IAAIA,GAAM,QAAQ,IAAI;AAAA,MAAA;AAAA,IAAA,GAEtI;AAAA,IACA,gBAAAW,EAACI,KAAgB,GAAIZ,GAAY,WAAW,CAAA,GAAK,WAAWW,EAAG,cAAcX,GAAY,SAAS,SAAS,GACzG,UAAA,gBAAAQ,EAACK,GAAA,EAAkB,QAAAV,GAAgB,cAAAL,GAA4B,MAAAD,GAAY,YAAAG,GAAwB,EAAA,CACrG;AAAA,EAAA,GACF;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.es.js","sources":["../src/components/dialog/Dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport type {\n DialogContentProps,\n DialogTriggerProps,\n DialogProps,\n DialogCloseProps,\n DialogTitleProps,\n DialogPortalProps,\n DialogOverlayProps,\n DialogDescriptionProps,\n} from \"@radix-ui/react-dialog\";\nimport { XMark } from \"@trsys-tech/matrix-icons\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n className,\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"absolute right-4 top-4 rounded-sm disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\">\n <XMark className=\"h-5 w-5\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"flex flex-col space-y-1.5 text-left\", className)} {...props} />\n);\nDialogHeader.displayName = \"DialogHeader\";\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", className)} {...props} />\n);\nDialogFooter.displayName = \"DialogFooter\";\n\nconst DialogTitle = React.forwardRef<React.ElementRef<typeof DialogPrimitive.Title>, React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>>(\n ({ className, ...props }, ref) => (\n <DialogPrimitive.Title ref={ref} className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)} {...props} />\n ),\n);\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => <DialogPrimitive.Description ref={ref} className={cn(\"text-sm text-muted-foreground\", className)} {...props} />);\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport { Dialog, DialogPortal, DialogOverlay, DialogTrigger, DialogClose, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription };\nexport type {\n DialogContentProps,\n DialogTriggerProps,\n DialogProps,\n DialogCloseProps,\n DialogTitleProps,\n DialogPortalProps,\n DialogOverlayProps,\n DialogDescriptionProps,\n};\n"],"names":["Dialog","DialogPrimitive","DialogTrigger","DialogPortal","DialogClose","DialogOverlay","React","className","props","ref","jsx","cn","DialogContent","children","jsxs","XMark","DialogHeader","DialogFooter","DialogTitle","DialogDescription"],"mappings":";;;;;AAkBA,MAAMA,IAASC,EAAgB,MAEzBC,IAAgBD,EAAgB,SAEhCE,IAAeF,EAAgB,QAE/BG,IAAcH,EAAgB,OAE9BI,IAAgBC,EAAM,WAG1B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAM,GAAGC,MAC1B,gBAAAC;AAAA,EAACT,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAQ;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAJ;AAAA,IACF;AAAA,IACC,GAAGC;AAAA,EAAA;AACN,CACD;AACDH,EAAc,cAAcJ,EAAgB,QAAQ;AAEpD,MAAMW,IAAgBN,EAAM,WAG1B,CAAC,EAAE,WAAAC,GAAW,UAAAM,GAAU,GAAGL,EAAM,GAAGC,MACpC,gBAAAK,EAACX,GACC,EAAA,UAAA;AAAA,EAAA,gBAAAO,EAACL,GAAc,EAAA;AAAA,EACf,gBAAAS;AAAA,IAACb,EAAgB;AAAA,IAAhB;AAAA,MACC,KAAAQ;AAAA,MACA,WAAWE;AAAA,QACT;AAAA,QACAJ;AAAA,MACF;AAAA,MACC,GAAGC;AAAA,MAEH,UAAA;AAAA,QAAAK;AAAA,QACA,gBAAAC,EAAAb,EAAgB,OAAhB,EAAsB,WAAU,sIAC/B,UAAA;AAAA,UAAC,gBAAAS,EAAAK,GAAA,EAAM,WAAU,UAAU,CAAA;AAAA,UAC1B,gBAAAL,EAAA,QAAA,EAAK,WAAU,WAAU,UAAK,QAAA,CAAA;AAAA,QAAA,EACjC,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AACF,GACF,CACD;AACDE,EAAc,cAAcX,EAAgB,QAAQ;AAEpD,MAAMe,IAAe,CAAC,EAAE,WAAAT,GAAW,GAAGC,EAAM,MACzC,gBAAAE,EAAA,OAAA,EAAI,WAAWC,EAAG,uCAAuCJ,CAAS,GAAI,GAAGC,EAAO,CAAA;AAEnFQ,EAAa,cAAc;AAE3B,MAAMC,IAAe,CAAC,EAAE,WAAAV,GAAW,GAAGC,EAAM,MACzC,gBAAAE,EAAA,OAAA,EAAI,WAAWC,EAAG,iEAAiEJ,CAAS,GAAI,GAAGC,EAAO,CAAA;AAE7GS,EAAa,cAAc;AAE3B,MAAMC,IAAcZ,EAAM;AAAA,EACxB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAM,GAAGC,MACvB,gBAAAC,EAAAT,EAAgB,OAAhB,EAAsB,KAAAQ,GAAU,WAAWE,EAAG,qDAAqDJ,CAAS,GAAI,GAAGC,EAAO,CAAA;AAE/H;AACAU,EAAY,cAAcjB,EAAgB,MAAM;AAE1C,MAAAkB,IAAoBb,EAAM,WAG9B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAM,GAAGC,MAAQ,gBAAAC,EAACT,EAAgB,aAAhB,EAA4B,KAAAQ,GAAU,WAAWE,EAAG,iCAAiCJ,CAAS,GAAI,GAAGC,GAAO,CAAE;AACnJW,EAAkB,cAAclB,EAAgB,YAAY;"}
1
+ {"version":3,"file":"dialog.es.js","sources":["../src/components/dialog/Dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport type {\n DialogContentProps,\n DialogTriggerProps,\n DialogProps,\n DialogCloseProps,\n DialogTitleProps,\n DialogPortalProps,\n DialogOverlayProps,\n DialogDescriptionProps,\n} from \"@radix-ui/react-dialog\";\nimport { XMark } from \"@trsys-tech/matrix-icons\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n className,\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"absolute right-4 top-4 rounded-sm disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\">\n <XMark className=\"h-5 w-5\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"flex flex-col space-y-1.5 text-left\", className)} {...props} />\n);\nDialogHeader.displayName = \"DialogHeader\";\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", className)} {...props} />\n);\nDialogFooter.displayName = \"DialogFooter\";\n\nconst DialogTitle = React.forwardRef<React.ElementRef<typeof DialogPrimitive.Title>, React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>>(\n ({ className, ...props }, ref) => (\n <DialogPrimitive.Title ref={ref} className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)} {...props} />\n ),\n);\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => <DialogPrimitive.Description ref={ref} className={cn(\"text-sm text-muted-foreground\", className)} {...props} />);\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport { Dialog, DialogPortal, DialogOverlay, DialogTrigger, DialogClose, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription };\nexport type {\n DialogContentProps,\n DialogTriggerProps,\n DialogProps,\n DialogCloseProps,\n DialogTitleProps,\n DialogPortalProps,\n DialogOverlayProps,\n DialogDescriptionProps,\n};\n"],"names":["Dialog","DialogPrimitive","DialogTrigger","DialogPortal","DialogClose","DialogOverlay","React","className","props","ref","jsx","cn","DialogContent","children","jsxs","XMark","DialogHeader","DialogFooter","DialogTitle","DialogDescription"],"mappings":";;;;;AAkBA,MAAMA,IAASC,EAAgB,MAEzBC,IAAgBD,EAAgB,SAEhCE,IAAeF,EAAgB,QAE/BG,IAAcH,EAAgB,OAE9BI,IA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Aa,cAAc;AAE3B,MAAMC,IAAcZ,EAAM;AAAA,EACxB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MACxB,gBAAAC,EAACT,EAAgB,OAAhB,EAAsB,KAAAQ,GAAU,WAAWE,EAAG,qDAAqDJ,CAAS,GAAI,GAAGC,EAAA,CAAO;AAE/H;AACAU,EAAY,cAAcjB,EAAgB,MAAM;AAEhD,MAAMkB,IAAoBb,EAAM,WAG9B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAAQ,gBAAAC,EAACT,EAAgB,aAAhB,EAA4B,KAAAQ,GAAU,WAAWE,EAAG,iCAAiCJ,CAAS,GAAI,GAAGC,GAAO,CAAE;AACnJW,EAAkB,cAAclB,EAAgB,YAAY;"}
@@ -1 +1 @@
1
- {"version":3,"file":"differenceincalendardays.es.js","sources":["../node_modules/date-fns/differenceInCalendarDays.js"],"sourcesContent":["import { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { millisecondsInDay } from \"./constants.js\";\nimport { startOfDay } from \"./startOfDay.js\";\n\n/**\n * The {@link differenceInCalendarDays} function options.\n */\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - The options object\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const laterStartOfDay = startOfDay(laterDate_);\n const earlierStartOfDay = startOfDay(earlierDate_);\n\n const laterTimestamp =\n +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);\n const earlierTimestamp =\n +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);\n\n // Round the number of days to the nearest integer because the number of\n // milliseconds in a day is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n"],"names":["differenceInCalendarDays","laterDate","earlierDate","options","laterDate_","earlierDate_","normalizeDates","laterStartOfDay","startOfDay","earlierStartOfDay","laterTimestamp","getTimezoneOffsetInMilliseconds","earlierTimestamp","millisecondsInDay"],"mappings":";;;;AAwCO,SAASA,EAAyBC,GAAWC,GAAaC,GAAS;AACxE,QAAM,CAACC,GAAYC,CAAY,IAAIC;AAAA,IACjCH,GAAS;AAAA,IACTF;AAAA,IACAC;AAAA,EACD,GAEKK,IAAkBC,EAAWJ,CAAU,GACvCK,IAAoBD,EAAWH,CAAY,GAE3CK,IACJ,CAACH,IAAkBI,EAAgCJ,CAAe,GAC9DK,IACJ,CAACH,IAAoBE,EAAgCF,CAAiB;AAKxE,SAAO,KAAK,OAAOC,IAAiBE,KAAoBC,CAAiB;AAC3E;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"differenceincalendardays.es.js","sources":["../node_modules/date-fns/differenceInCalendarDays.js"],"sourcesContent":["import { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { millisecondsInDay } from \"./constants.js\";\nimport { startOfDay } from \"./startOfDay.js\";\n\n/**\n * The {@link differenceInCalendarDays} function options.\n */\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - The options object\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const laterStartOfDay = startOfDay(laterDate_);\n const earlierStartOfDay = startOfDay(earlierDate_);\n\n const laterTimestamp =\n +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);\n const earlierTimestamp =\n +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);\n\n // Round the number of days to the nearest integer because the number of\n // milliseconds in a day is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n"],"names":["differenceInCalendarDays","laterDate","earlierDate","options","laterDate_","earlierDate_","normalizeDates","laterStartOfDay","startOfDay","earlierStartOfDay","laterTimestamp","getTimezoneOffsetInMilliseconds","earlierTimestamp","millisecondsInDay"],"mappings":";;;;AAwCO,SAASA,EAAyBC,GAAWC,GAAaC,GAAS;AACxE,QAAM,CAACC,GAAYC,CAAY,IAAIC;AAAA,IACjCH,GAAS;AAAA,IACTF;AAAA,IACAC;AAAA,EACJ,GAEQK,IAAkBC,EAAWJ,CAAU,GACvCK,IAAoBD,EAAWH,CAAY,GAE3CK,IACJ,CAACH,IAAkBI,EAAgCJ,CAAe,GAC9DK,IACJ,CAACH,IAAoBE,EAAgCF,CAAiB;AAKxE,SAAO,KAAK,OAAOC,IAAiBE,KAAoBC,CAAiB;AAC3E;","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.es.js","sources":["../src/components/drawer/Drawer.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport { Slot } from \"@radix-ui/react-slot\";\r\nimport { ChevronsRight } from \"@trsys-tech/matrix-icons\";\r\nimport { createContextScope, Scope } from \"@radix-ui/react-context\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\nimport { Modal } from \"../modal/Modal\";\r\nimport { IconButton } from \"../icon-botton/IconButton\";\r\nimport { useIsMobile } from \"../../lib/hooks/use-mobile\";\r\n\r\ntype ScopedProps<P> = P & { __scopeDrawer?: Scope };\r\n\r\nconst DRAWER_NAME = \"Drawer\";\r\n\r\nconst [createDrawerContext] = createContextScope(DRAWER_NAME);\r\n\r\ninterface DrawerProps extends React.HTMLAttributes<HTMLDivElement> {\r\n open: boolean;\r\n onClose?: () => void;\r\n anchor?: \"left\" | \"right\";\r\n width?: number;\r\n children?: React.ReactNode;\r\n asChild?: boolean;\r\n mobileBreakpoint?: number;\r\n}\r\n\r\ntype DrawerContextValue = {\r\n open: boolean;\r\n onClose?: () => void;\r\n anchor: \"left\" | \"right\";\r\n width: number;\r\n isMobile: boolean;\r\n};\r\n\r\nconst [DrawerProvider, useDrawerProvider] = createDrawerContext<DrawerContextValue>(DRAWER_NAME);\r\n\r\n/**\r\n * Drawer component\r\n * This is the wrapper component for Drawer content and main components\r\n * @param {React.HTMLAttributes<HTMLDivElement>} props\r\n * @param {boolean} open - Drawer open state\r\n * @param {() => void} onClose - Drawer close handler\r\n * @param {\"left\" | \"right\"} anchor - Drawer anchor position\r\n * @param {number} width - Drawer width\r\n * @param {React.ReactNode} children - Drawer children\r\n * @param {boolean} asChild - Render as child component\r\n * @returns {React.ReactElement}\r\n */\r\nconst Drawer = React.forwardRef<React.ElementRef<\"div\">, ScopedProps<DrawerProps>>((props, ref) => {\r\n const { asChild, anchor = \"right\", children, open, width = 240, className, onClose, __scopeDrawer, ...restProps } = props;\r\n const Comp = asChild ? Slot : \"div\";\r\n\r\n const isMobile = useIsMobile();\r\n\r\n return (\r\n <Comp ref={ref} className={cn(\"flex\", className)} {...restProps}>\r\n <DrawerProvider anchor={anchor} onClose={onClose} open={open} width={width} isMobile={isMobile} scope={__scopeDrawer}>\r\n {children}\r\n </DrawerProvider>\r\n </Comp>\r\n );\r\n});\r\n\r\nDrawer.displayName = DRAWER_NAME;\r\n\r\ninterface DrawerMainProps extends React.HTMLAttributes<HTMLDivElement> {\r\n asChild: boolean;\r\n}\r\n\r\nconst DRAWER_MAIN_NAME = \"DrawerMain\";\r\n\r\n/**\r\n * DrawerMain component\r\n * This is the main container for the tree that should be shown always\r\n * @param {React.HTMLAttributes<HTMLDivElement>} props\r\n * @param {boolean} asChild - Render as child component\r\n * @property {React.ReactNode} children - DrawerMain children\r\n * @property {string} className - DrawerMain class name\r\n * @property {React.CSSProperties} style - DrawerMain style\r\n * @property {ScopedProps<DrawerMainProps>} __scopeDrawer - DrawerMain scope\r\n * @property {React.Ref<HTMLDivElement>} ref - DrawerMain ref\r\n * @property {React.HTMLAttributes<HTMLDivElement>} props - DrawerMain props\r\n * @returns {React.ReactElement}\r\n */\r\nconst DrawerMain = React.forwardRef<HTMLDivElement, ScopedProps<DrawerMainProps>>(\r\n ({ asChild, children, className, style, __scopeDrawer, ...props }, ref) => {\r\n const Comp = asChild ? Slot : \"div\";\r\n const { anchor, open, width, isMobile } = useDrawerProvider(DRAWER_MAIN_NAME, __scopeDrawer);\r\n\r\n const marginStyle = React.useMemo(() => {\r\n if (isMobile) {\r\n return {};\r\n }\r\n if (anchor === \"left\") {\r\n return { marginInlineStart: open ? width : 0 };\r\n } else {\r\n return { marginInlineEnd: open ? width : 0 };\r\n }\r\n }, [anchor, open, width, isMobile]);\r\n\r\n return (\r\n <Comp ref={ref} className={cn(\"flex-grow overflow-hidden\", className)} style={{ ...style, ...marginStyle }} {...props}>\r\n {children}\r\n </Comp>\r\n );\r\n },\r\n);\r\n\r\nDrawerMain.displayName = DRAWER_MAIN_NAME;\r\n\r\ntype DrawerContentProps = {\r\n children?: React.ReactNode;\r\n title: React.ReactNode;\r\n};\r\n\r\nconst DRAWER_CONTENT_NAME = \"DrawerContent\";\r\n\r\n/**\r\n * DrawerContent component\r\n * This is the content container for the tree that should be shown when the drawer is open\r\n * @param {React.HTMLAttributes<HTMLDivElement>} props\r\n * @param {React.ReactNode} children - DrawerContent children\r\n * @param {React.ReactNode} title - DrawerContent title\r\n * @property {ScopedProps<DrawerContentProps>} __scopeDrawer - DrawerContent scope\r\n * @property {React.Ref<HTMLDivElement>} ref - DrawerContent ref\r\n * @property {React.HTMLAttributes<HTMLDivElement>} props - DrawerContent props\r\n * @returns {React.ReactElement}\r\n */\r\nconst DrawerContent = React.forwardRef<HTMLDivElement, ScopedProps<DrawerContentProps>>(({ children, title, __scopeDrawer }, ref) => {\r\n const { anchor, open, width, onClose, isMobile } = useDrawerProvider(DRAWER_CONTENT_NAME, __scopeDrawer);\r\n\r\n return (\r\n <>\r\n {isMobile ? (\r\n <Modal title={title} open={open} onOpenChange={onClose} ref={ref} fullScreen>\r\n {children}\r\n </Modal>\r\n ) : (\r\n <div className={cn(\"hidden md:block overflow-hidden\")} style={{ width }} ref={ref}>\r\n <div\r\n className={cn(\r\n \"overflow-y-auto flex flex-col h-full top-0 z-[120] bg-background transition-all border-gray-200\",\r\n open ? \"\" : anchor === \"left\" ? \"-translate-x-full rtl:translate-x-full invisible\" : \"translate-x-full rtl:-translate-x-full invisible\",\r\n anchor === \"left\" ? \"border-r\" : \"border-l\",\r\n )}\r\n >\r\n <div\r\n className={cn(\r\n \"h-9 flex items-center gap-2 p-2 bg-background w-full sticky top-0 border-b border-gray-200\",\r\n anchor === \"right\" ? \"justify-start rtl:justify-end\" : \"justify-end rtl:justify-start\",\r\n )}\r\n >\r\n <IconButton onClick={onClose} className=\"w-5 h-5 p-0\">\r\n <ChevronsRight className={cn(\"w-5 h-5\", anchor === \"right\" ? \"rtl:-scale-100\" : \"-scale-100 rtl:scale-100\")} />\r\n </IconButton>\r\n {typeof title === \"string\" || typeof title === \"number\" ? <h2 className=\"text-lg font-bold text-text\">{title}</h2> : title}\r\n </div>\r\n {children}\r\n </div>\r\n </div>\r\n )}\r\n </>\r\n );\r\n});\r\n\r\nDrawerContent.displayName = DRAWER_CONTENT_NAME;\r\n\r\nconst Root = Drawer;\r\nconst Main = DrawerMain;\r\nconst Content = DrawerContent;\r\n\r\nexport { Drawer, DrawerMain, DrawerContent, Root, Main, Content };\r\nexport type { DrawerContentProps, DrawerMainProps, DrawerProps };\r\n"],"names":["DRAWER_NAME","createDrawerContext","createContextScope","DrawerProvider","useDrawerProvider","Drawer","React","props","ref","asChild","anchor","children","open","width","className","onClose","__scopeDrawer","restProps","Comp","Slot","isMobile","useIsMobile","jsx","cn","DRAWER_MAIN_NAME","DrawerMain","style","marginStyle","DRAWER_CONTENT_NAME","DrawerContent","title","Fragment","Modal","jsxs","IconButton","ChevronsRight"],"mappings":";;;;;;;;;AAcA,MAAMA,IAAc,UAEd,CAACC,CAAmB,IAAIC,EAAmBF,CAAW,GAoBtD,CAACG,GAAgBC,CAAiB,IAAIH,EAAwCD,CAAW,GAczFK,IAASC,EAAM,WAA8D,CAACC,GAAOC,MAAQ;AACjG,QAAM,EAAE,SAAAC,GAAS,QAAAC,IAAS,SAAS,UAAAC,GAAU,MAAAC,GAAM,OAAAC,IAAQ,KAAK,WAAAC,GAAW,SAAAC,GAAS,eAAAC,GAAe,GAAGC,EAAc,IAAAV,GAC9GW,IAAOT,IAAUU,IAAO,OAExBC,IAAWC,EAA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F,GAAc,MAAAlB,GAAY,cAAcG,GAAS,KAAAP,GAAU,YAAU,IACzE,UAAAG,EACH,CAAA,IAEA,gBAAAW,EAAC,OAAI,EAAA,WAAWC,EAAG,iCAAiC,GAAG,OAAO,EAAE,OAAAV,EAAM,GAAG,KAAAL,GACvE,UAAA,gBAAAyB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWV;AAAA,QACT;AAAA,QACAX,IAAO,KAAKF,MAAW,SAAS,qDAAqD;AAAA,QACrFA,MAAW,SAAS,aAAa;AAAA,MACnC;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAuB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWV;AAAA,cACT;AAAA,cACAb,MAAW,UAAU,kCAAkC;AAAA,YACzD;AAAA,YAEA,UAAA;AAAA,cAAA,gBAAAY,EAACY,GAAW,EAAA,SAASnB,GAAS,WAAU,eACtC,UAAC,gBAAAO,EAAAa,GAAA,EAAc,WAAWZ,EAAG,WAAWb,MAAW,UAAU,mBAAmB,0BAA0B,EAAG,CAAA,GAC/G;AAAA,cACC,OAAOoB,KAAU,YAAY,OAAOA,KAAU,WAAW,gBAAAR,EAAC,MAAG,EAAA,WAAU,+BAA+B,UAAAQ,EAAM,CAAA,IAAQA;AAAA,YAAA;AAAA,UAAA;AAAA,QACvH;AAAA,QACCnB;AAAA,MAAA;AAAA,IAAA;AAAA,KAEL,EAEJ,CAAA;AAEJ,CAAC;AAEDkB,EAAc,cAAcD;"}
1
+ {"version":3,"file":"drawer.es.js","sources":["../src/components/drawer/Drawer.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport { Slot } from \"@radix-ui/react-slot\";\r\nimport { ChevronsRight } from \"@trsys-tech/matrix-icons\";\r\nimport { createContextScope, Scope } from \"@radix-ui/react-context\";\r\n\r\nimport { cn } from \"../../lib/utils\";\r\nimport { Modal } from \"../modal/Modal\";\r\nimport { IconButton } from \"../icon-botton/IconButton\";\r\nimport { useIsMobile } from \"../../lib/hooks/use-mobile\";\r\n\r\ntype ScopedProps<P> = P & { __scopeDrawer?: Scope };\r\n\r\nconst DRAWER_NAME = \"Drawer\";\r\n\r\nconst [createDrawerContext] = createContextScope(DRAWER_NAME);\r\n\r\ninterface DrawerProps extends React.HTMLAttributes<HTMLDivElement> {\r\n open: boolean;\r\n onClose?: () => void;\r\n anchor?: \"left\" | \"right\";\r\n width?: number;\r\n children?: React.ReactNode;\r\n asChild?: boolean;\r\n mobileBreakpoint?: number;\r\n}\r\n\r\ntype DrawerContextValue = {\r\n open: boolean;\r\n onClose?: () => void;\r\n anchor: \"left\" | \"right\";\r\n width: number;\r\n isMobile: boolean;\r\n};\r\n\r\nconst [DrawerProvider, useDrawerProvider] = createDrawerContext<DrawerContextValue>(DRAWER_NAME);\r\n\r\n/**\r\n * Drawer component\r\n * This is the wrapper component for Drawer content and main components\r\n * @param {React.HTMLAttributes<HTMLDivElement>} props\r\n * @param {boolean} open - Drawer open state\r\n * @param {() => void} onClose - Drawer close handler\r\n * @param {\"left\" | \"right\"} anchor - Drawer anchor position\r\n * @param {number} width - Drawer width\r\n * @param {React.ReactNode} children - Drawer children\r\n * @param {boolean} asChild - Render as child component\r\n * @returns {React.ReactElement}\r\n */\r\nconst Drawer = React.forwardRef<React.ElementRef<\"div\">, ScopedProps<DrawerProps>>((props, ref) => {\r\n const { asChild, anchor = \"right\", children, open, width = 240, className, onClose, __scopeDrawer, ...restProps } = props;\r\n const Comp = asChild ? Slot : \"div\";\r\n\r\n const isMobile = useIsMobile();\r\n\r\n return (\r\n <Comp ref={ref} className={cn(\"flex\", className)} {...restProps}>\r\n <DrawerProvider anchor={anchor} onClose={onClose} open={open} width={width} isMobile={isMobile} scope={__scopeDrawer}>\r\n {children}\r\n </DrawerProvider>\r\n </Comp>\r\n );\r\n});\r\n\r\nDrawer.displayName = DRAWER_NAME;\r\n\r\ninterface DrawerMainProps extends React.HTMLAttributes<HTMLDivElement> {\r\n asChild: boolean;\r\n}\r\n\r\nconst DRAWER_MAIN_NAME = \"DrawerMain\";\r\n\r\n/**\r\n * DrawerMain component\r\n * This is the main container for the tree that should be shown always\r\n * @param {React.HTMLAttributes<HTMLDivElement>} props\r\n * @param {boolean} asChild - Render as child component\r\n * @property {React.ReactNode} children - DrawerMain children\r\n * @property {string} className - DrawerMain class name\r\n * @property {React.CSSProperties} style - DrawerMain style\r\n * @property {ScopedProps<DrawerMainProps>} __scopeDrawer - DrawerMain scope\r\n * @property {React.Ref<HTMLDivElement>} ref - DrawerMain ref\r\n * @property {React.HTMLAttributes<HTMLDivElement>} props - DrawerMain props\r\n * @returns {React.ReactElement}\r\n */\r\nconst DrawerMain = React.forwardRef<HTMLDivElement, ScopedProps<DrawerMainProps>>(\r\n ({ asChild, children, className, style, __scopeDrawer, ...props }, ref) => {\r\n const Comp = asChild ? Slot : \"div\";\r\n const { anchor, open, width, isMobile } = useDrawerProvider(DRAWER_MAIN_NAME, __scopeDrawer);\r\n\r\n const marginStyle = React.useMemo(() => {\r\n if (isMobile) {\r\n return {};\r\n }\r\n if (anchor === \"left\") {\r\n return { marginInlineStart: open ? width : 0 };\r\n } else {\r\n return { marginInlineEnd: open ? width : 0 };\r\n }\r\n }, [anchor, open, width, isMobile]);\r\n\r\n return (\r\n <Comp ref={ref} className={cn(\"flex-grow overflow-hidden\", className)} style={{ ...style, ...marginStyle }} {...props}>\r\n {children}\r\n </Comp>\r\n );\r\n },\r\n);\r\n\r\nDrawerMain.displayName = DRAWER_MAIN_NAME;\r\n\r\ntype DrawerContentProps = {\r\n children?: React.ReactNode;\r\n title: React.ReactNode;\r\n};\r\n\r\nconst DRAWER_CONTENT_NAME = \"DrawerContent\";\r\n\r\n/**\r\n * DrawerContent component\r\n * This is the content container for the tree that should be shown when the drawer is open\r\n * @param {React.HTMLAttributes<HTMLDivElement>} props\r\n * @param {React.ReactNode} children - DrawerContent children\r\n * @param {React.ReactNode} title - DrawerContent title\r\n * @property {ScopedProps<DrawerContentProps>} __scopeDrawer - DrawerContent scope\r\n * @property {React.Ref<HTMLDivElement>} ref - DrawerContent ref\r\n * @property {React.HTMLAttributes<HTMLDivElement>} props - DrawerContent props\r\n * @returns {React.ReactElement}\r\n */\r\nconst DrawerContent = React.forwardRef<HTMLDivElement, ScopedProps<DrawerContentProps>>(({ children, title, __scopeDrawer }, ref) => {\r\n const { anchor, open, width, onClose, isMobile } = useDrawerProvider(DRAWER_CONTENT_NAME, __scopeDrawer);\r\n\r\n return (\r\n <>\r\n {isMobile ? (\r\n <Modal title={title} open={open} onOpenChange={onClose} ref={ref} fullScreen>\r\n {children}\r\n </Modal>\r\n ) : (\r\n <div className={cn(\"hidden md:block overflow-hidden\")} style={{ width }} ref={ref}>\r\n <div\r\n className={cn(\r\n \"overflow-y-auto flex flex-col h-full top-0 z-[120] bg-background transition-all border-gray-200\",\r\n open ? \"\" : anchor === \"left\" ? \"-translate-x-full rtl:translate-x-full invisible\" : \"translate-x-full rtl:-translate-x-full invisible\",\r\n anchor === \"left\" ? \"border-r\" : \"border-l\",\r\n )}\r\n >\r\n <div\r\n className={cn(\r\n \"h-9 flex items-center gap-2 p-2 bg-background w-full sticky top-0 border-b border-gray-200\",\r\n anchor === \"right\" ? \"justify-start rtl:justify-end\" : \"justify-end rtl:justify-start\",\r\n )}\r\n >\r\n <IconButton onClick={onClose} className=\"w-5 h-5 p-0\">\r\n <ChevronsRight className={cn(\"w-5 h-5\", anchor === \"right\" ? \"rtl:-scale-100\" : \"-scale-100 rtl:scale-100\")} />\r\n </IconButton>\r\n {typeof title === \"string\" || typeof title === \"number\" ? <h2 className=\"text-lg font-bold text-text\">{title}</h2> : title}\r\n </div>\r\n {children}\r\n </div>\r\n </div>\r\n )}\r\n </>\r\n );\r\n});\r\n\r\nDrawerContent.displayName = DRAWER_CONTENT_NAME;\r\n\r\nconst Root = Drawer;\r\nconst Main = DrawerMain;\r\nconst Content = DrawerContent;\r\n\r\nexport { Drawer, DrawerMain, DrawerContent, Root, Main, Content };\r\nexport type { DrawerContentProps, DrawerMainProps, DrawerProps };\r\n"],"names":["DRAWER_NAME","createDrawerContext","createContextScope","DrawerProvider","useDrawerProvider","Drawer","React","props","ref","asChild","anchor","children","open","width","className","onClose","__scopeDrawer","restProps","Comp","Slot","isMobile","useIsMobile","jsx","cn","DRAWER_MAIN_NAME","DrawerMain","style","marginStyle","DRAWER_CONTENT_NAME","DrawerContent","title","Fragment","Modal","jsxs","IconButton","ChevronsRight"],"mappings":";;;;;;;;;AAcA,MAAMA,IAAc,UAEd,CAACC,CAAmB,IAAIC,EAAmBF,CAAW,GAoBtD,CAACG,GAAgBC,CAAiB,IAAIH,EAAwCD,CAAW,GAczFK,IAASC,EAAM,WAA8D,CAACC,GAAOC,MAAQ;AACjG,QAAM,EAAE,SAAAC,GAAS,QAAAC,IAAS,SAAS,UAAAC,GAAU,MAAAC,GAAM,OAAAC,IAAQ,KAAK,WAAAC,GAAW,SAAAC,GAAS,eAAAC,GAAe,GAAGC,MAAcV,GAC9GW,IAAOT,IAAUU,IAAO,OAExBC,IAAWC,EAAA;AAEjB,SACE,gBAAAC,EAACJ,KAAK,KAAAV,GAAU,WAAWe,EAAG,QAAQT,CAAS,GAAI,GAAGG,GACpD,4BAACd,GAAA,EAAe,QAAAO,GAAgB,SAAAK,GAAkB,MAAAH,GAAY,OAAAC,GAAc,UAAAO,GAAoB,OAAOJ,GACpG,UAAAL,GACH,EAAA,CACF;AAEJ,CAAC;AAEDN,EAAO,cAAcL;AAMrB,MAAMwB,IAAmB,cAenBC,IAAanB,EAAM;AAAA,EACvB,CAAC,EAAE,SAAAG,GAAS,UAAAE,GAAU,WAAAG,GAAW,OAAAY,GAAO,eAAAV,GAAe,GAAGT,EAAA,GAASC,MAAQ;AACzE,UAAMU,IAAOT,IAAUU,IAAO,OACxB,EAAE,QAAAT,GAAQ,MAAAE,GAAM,OAAAC,GAAO,UAAAO,MAAahB,EAAkBoB,GAAkBR,CAAa,GAErFW,IAAcrB,EAAM,QAAQ,MAC5Bc,IAC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AWZ,EAAG,WAAWb,MAAW,UAAU,mBAAmB,0BAA0B,GAAG,GAC/G;AAAA,cACC,OAAOoB,KAAU,YAAY,OAAOA,KAAU,WAAW,gBAAAR,EAAC,MAAA,EAAG,WAAU,+BAA+B,UAAAQ,EAAA,CAAM,IAAQA;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAEtHnB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAEL,EAAA,CAEJ;AAEJ,CAAC;AAEDkB,EAAc,cAAcD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"en-us.es.js","sources":["../node_modules/date-fns/locale/en-US.js"],"sourcesContent":["import { formatDistance } from \"./en-US/_lib/formatDistance.js\";\nimport { formatLong } from \"./en-US/_lib/formatLong.js\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.js\";\nimport { localize } from \"./en-US/_lib/localize.js\";\nimport { match } from \"./en-US/_lib/match.js\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n"],"names":["enUS","formatDistance","formatLong","formatRelative","localize","match"],"mappings":";;;;;AAcY,MAACA,IAAO;AAAA,EAClB,MAAM;AAAA,EACN,gBAAgBC;AAAA,EAChB,YAAYC;AAAA,EACZ,gBAAgBC;AAAA,EAChB,UAAUC;AAAA,EACV,OAAOC;AAAA,EACP,SAAS;AAAA,IACP,cAAc;AAAA,IACd,uBAAuB;AAAA,EACxB;AACH;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"en-us.es.js","sources":["../node_modules/date-fns/locale/en-US.js"],"sourcesContent":["import { formatDistance } from \"./en-US/_lib/formatDistance.js\";\nimport { formatLong } from \"./en-US/_lib/formatLong.js\";\nimport { formatRelative } from \"./en-US/_lib/formatRelative.js\";\nimport { localize } from \"./en-US/_lib/localize.js\";\nimport { match } from \"./en-US/_lib/match.js\";\n\n/**\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)\n * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)\n */\nexport const enUS = {\n code: \"en-US\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default enUS;\n"],"names":["enUS","formatDistance","formatLong","formatRelative","localize","match"],"mappings":";;;;;AAcY,MAACA,IAAO;AAAA,EAClB,MAAM;AAAA,EACN,gBAAgBC;AAAA,EAChB,YAAYC;AAAA,EACZ,gBAAgBC;AAAA,EAChB,UAAUC;AAAA,EACV,OAAOC;AAAA,EACP,SAAS;AAAA,IACP,cAAc;AAAA,IACd,uBAAuB;AAAA,EAC3B;AACA;","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"form.es.js","sources":["../src/components/form/Form.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { Controller, ControllerProps, FieldPath, FieldValues, FormProvider, useFormContext } from \"react-hook-form\";\n\nimport { Label } from \"../label/Label\";\nimport { cn } from \"../../lib/utils\";\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {\n name: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);\n\nconst FormField = <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\");\n }\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n id: string;\n};\n\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue);\n\nconst FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-1\", className)} {...props} />\n </FormItemContext.Provider>\n );\n});\nFormItem.displayName = \"FormItem\";\n\nconst FormLabel = React.forwardRef<HTMLLabelElement, React.ComponentPropsWithoutRef<\"label\">>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return <Label ref={ref} className={cn(error && \"text-danger\", \"block text-text-300\", className)} htmlFor={formItemId} {...props} />;\n});\nFormLabel.displayName = \"FormLabel\";\n\nconst FormControl = React.forwardRef<React.ElementRef<typeof Slot>, React.ComponentPropsWithoutRef<typeof Slot>>(({ className, ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n className={cn(className, error && \"border-danger hover:border-danger focus-visible:border-danger\")}\n {...props}\n />\n );\n});\nFormControl.displayName = \"FormControl\";\n\nconst FormDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return <p ref={ref} id={formDescriptionId} className={cn(\"text-[0.8rem] text-muted-foreground\", className)} {...props} />;\n});\nFormDescription.displayName = \"FormDescription\";\n\nconst FormMessage = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message) : children;\n\n // if (!body) {\n // return null;\n // }\n\n return (\n <p ref={ref} id={formMessageId} className={cn(\"text-[0.625rem] font-medium text-danger h-4\", className)} {...props}>\n {body ?? \" \"}\n </p>\n );\n});\nFormMessage.displayName = \"FormMessage\";\n\nexport { Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField };\n"],"names":["Form","FormProvider","FormFieldContext","React","FormField","props","jsx","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","id","FormItem","className","ref","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","children","body"],"mappings":";;;;;;AASA,MAAMA,IAAOC,GAMPC,IAAmBC,EAAM,cAAqC,EAA2B,GAEzFC,IAAY,CAAkH;AAAA,EAClI,GAAGC;AACL,MAEK,gBAAAC,EAAAJ,EAAiB,UAAjB,EAA0B,OAAO,EAAE,MAAMG,EAAM,KAAA,GAC9C,UAAA,gBAAAC,EAACC,GAAY,EAAA,GAAGF,EAAO,CAAA,GACzB,GAIEG,IAAe,MAAM;AACnB,QAAAC,IAAeN,EAAM,WAAWD,CAAgB,GAChDQ,IAAcP,EAAM,WAAWQ,CAAe,GAC9C,EAAE,eAAAC,GAAe,WAAAC,EAAU,IAAIC,EAAe,GAE9CC,IAAaH,EAAcH,EAAa,MAAMI,CAAS;AAE7D,MAAI,CAACJ;AACG,UAAA,IAAI,MAAM,gDAAgD;AAG5D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,CAAC,CAACJ;AAAA,MAChB,WAAWF,EAAGF,GAAWI,KAAS,+DAA+D;AAAA,MAChG,GAAGjB;AAAA,IAAA;AAAA,EACN;AAEJ,CAAC;AACDoB,EAAY,cAAc;AAEpB,MAAAI,IAAkB1B,EAAM,WAA6E,CAAC,EAAE,WAAAe,GAAW,GAAGb,EAAM,GAAGc,MAAQ;AACrI,QAAA,EAAE,mBAAAO,EAAkB,IAAIlB,EAAa;AAEpC,SAAA,gBAAAF,EAAC,KAAE,EAAA,KAAAa,GAAU,IAAIO,GAAmB,WAAWN,EAAG,uCAAuCF,CAAS,GAAI,GAAGb,EAAO,CAAA;AACzH,CAAC;AACDwB,EAAgB,cAAc;AAExB,MAAAC,IAAc3B,EAAM,WAA6E,CAAC,EAAE,WAAAe,GAAW,UAAAa,GAAU,GAAG1B,EAAM,GAAGc,MAAQ;AACjJ,QAAM,EAAE,OAAAG,GAAO,eAAAK,EAAc,IAAInB,EAAa,GACxCwB,IAAOV,IAAQ,OAAOA,GAAO,OAAO,IAAIS;AAM9C,SACG,gBAAAzB,EAAA,KAAA,EAAE,KAAAa,GAAU,IAAIQ,GAAe,WAAWP,EAAG,+CAA+CF,CAAS,GAAI,GAAGb,GAC1G,eAAQ,KACX;AAEJ,CAAC;AACDyB,EAAY,cAAc;"}
1
+ {"version":3,"file":"form.es.js","sources":["../src/components/form/Form.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { Controller, ControllerProps, FieldPath, FieldValues, FormProvider, useFormContext } from \"react-hook-form\";\n\nimport { Label } from \"../label/Label\";\nimport { cn } from \"../../lib/utils\";\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {\n name: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);\n\nconst FormField = <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\");\n }\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n id: string;\n};\n\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue);\n\nconst FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-1\", className)} {...props} />\n </FormItemContext.Provider>\n );\n});\nFormItem.displayName = \"FormItem\";\n\nconst FormLabel = React.forwardRef<HTMLLabelElement, React.ComponentPropsWithoutRef<\"label\">>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return <Label ref={ref} className={cn(error && \"text-danger\", \"block text-text-300\", className)} htmlFor={formItemId} {...props} />;\n});\nFormLabel.displayName = \"FormLabel\";\n\nconst FormControl = React.forwardRef<React.ElementRef<typeof Slot>, React.ComponentPropsWithoutRef<typeof Slot>>(({ className, ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n className={cn(className, error && \"border-danger hover:border-danger focus-visible:border-danger\")}\n {...props}\n />\n );\n});\nFormControl.displayName = \"FormControl\";\n\nconst FormDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return <p ref={ref} id={formDescriptionId} className={cn(\"text-[0.8rem] text-muted-foreground\", className)} {...props} />;\n});\nFormDescription.displayName = \"FormDescription\";\n\nconst FormMessage = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message) : children;\n\n // if (!body) {\n // return null;\n // }\n\n return (\n <p ref={ref} id={formMessageId} className={cn(\"text-[0.625rem] font-medium text-danger h-4\", className)} {...props}>\n {body ?? \" \"}\n </p>\n );\n});\nFormMessage.displayName = \"FormMessage\";\n\nexport { Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField };\n"],"names":["Form","FormProvider","FormFieldContext","React","FormField","props","jsx","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","formState","useFormContext","fieldState","id","FormItem","className","ref","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","children","body"],"mappings":";;;;;;AASA,MAAMA,IAAOC,GAMPC,IAAmBC,EAAM,cAAqC,EAA2B,GAEzFC,IAAY,CAAkH;AAAA,EAClI,GAAGC;AACL,MAEI,gBAAAC,EAACJ,EAAiB,UAAjB,EAA0B,OAAO,EAAE,MAAMG,EAAM,KAAA,GAC9C,UAAA,gBAAAC,EAACC,GAAA,EAAY,GAAGF,GAAO,GACzB,GAIEG,IAAe,MAAM;AACzB,QAAMC,IAAeN,EAAM,WAAWD,CAAgB,GAChDQ,IAAcP,EAAM,WAAWQ,CAAe,GAC9C,EAAE,eAAAC,GAAe,WAAAC,EAAA,IAAcC,EAAA,GAE/BC,IAAaH,EAAcH,EAAa,MAAMI,CAAS;AAE7D,MAAI,CAACJ;AACH,UAAM,IAAI,MAAM,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AAc,CAAC,CAACJ;AAAA,MAChB,WAAWF,EAAGF,GAAWI,KAAS,+DAA+D;AAAA,MAChG,GAAGjB;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AACDoB,EAAY,cAAc;AAE1B,MAAMI,IAAkB1B,EAAM,WAA6E,CAAC,EAAE,WAAAe,GAAW,GAAGb,EAAA,GAASc,MAAQ;AAC3I,QAAM,EAAE,mBAAAO,EAAA,IAAsBlB,EAAA;AAE9B,SAAO,gBAAAF,EAAC,KAAA,EAAE,KAAAa,GAAU,IAAIO,GAAmB,WAAWN,EAAG,uCAAuCF,CAAS,GAAI,GAAGb,EAAA,CAAO;AACzH,CAAC;AACDwB,EAAgB,cAAc;AAE9B,MAAMC,IAAc3B,EAAM,WAA6E,CAAC,EAAE,WAAAe,GAAW,UAAAa,GAAU,GAAG1B,EAAA,GAASc,MAAQ;AACjJ,QAAM,EAAE,OAAAG,GAAO,eAAAK,EAAA,IAAkBnB,EAAA,GAC3BwB,IAAOV,IAAQ,OAAOA,GAAO,OAAO,IAAIS;AAM9C,SACE,gBAAAzB,EAAC,KAAA,EAAE,KAAAa,GAAU,IAAIQ,GAAe,WAAWP,EAAG,+CAA+CF,CAAS,GAAI,GAAGb,GAC1G,eAAQ,KACX;AAEJ,CAAC;AACDyB,EAAY,cAAc;"}
@@ -1 +1 @@
1
- {"version":3,"file":"format.es.js","sources":["../node_modules/date-fns/format.js"],"sourcesContent":["import { defaultLocale } from \"./_lib/defaultLocale.js\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { formatters } from \"./_lib/format/formatters.js\";\nimport { longFormatters } from \"./_lib/format/longFormatters.js\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n warnOrThrowProtectedError,\n} from \"./_lib/protectedTokens.js\";\nimport { isValid } from \"./isValid.js\";\nimport { toDate } from \"./toDate.js\";\n\n// Rexports of internal for libraries to use.\n// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874\nexport { formatters, longFormatters };\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\nexport { format as formatDate };\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @alias formatDate\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date, options?.in);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n let parts = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map((substring) => {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return { isToken: false, value: \"'\" };\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return { isToken: false, value: cleanEscapedString(substring) };\n }\n\n if (formatters[firstCharacter]) {\n return { isToken: true, value: substring };\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return { isToken: false, value: substring };\n });\n\n // invoke localize preprocessor (only for french locales at the moment)\n if (locale.localize.preprocessor) {\n parts = locale.localize.preprocessor(originalDate, parts);\n }\n\n const formatterOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n return parts\n .map((part) => {\n if (!part.isToken) return part.value;\n\n const token = part.value;\n\n if (\n (!options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)) ||\n (!options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token))\n ) {\n warnOrThrowProtectedError(token, formatStr, String(date));\n }\n\n const formatter = formatters[token[0]];\n return formatter(originalDate, token, locale.localize, formatterOptions);\n })\n .join(\"\");\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n"],"names":["formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","format","date","formatStr","options","defaultOptions","getDefaultOptions","locale","defaultLocale","firstWeekContainsDate","weekStartsOn","originalDate","toDate","isValid","parts","substring","firstCharacter","longFormatter","longFormatters","cleanEscapedString","formatters","formatterOptions","part","token","isProtectedWeekYearToken","isProtectedDayOfYearToken","warnOrThrowProtectedError","formatter","input","matched"],"mappings":";;;;;;;AA2BA,MAAMA,IACJ,yDAIIC,IAA6B,qCAE7BC,IAAsB,gBACtBC,IAAoB,OACpBC,IAAgC;AAoS/B,SAASC,EAAOC,GAAMC,GAAWC,GAAS;AAC/C,QAAMC,IAAiBC,EAAmB,GACpCC,IAA4BF,EAAe,UAAUG,GAErDC,IAGJJ,EAAe,yBACfA,EAAe,QAAQ,SAAS,yBAChC,GAEIK,IAGJL,EAAe,gBACfA,EAAe,QAAQ,SAAS,gBAChC,GAEIM,IAAeC,EAAOV,GAAME,GAAS,EAAE;AAE7C,MAAI,CAACS,EAAQF,CAAY;AACvB,UAAM,IAAI,WAA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,KAAK,EAAE;AACZ;AAEA,SAASF,EAAmBS,GAAO;AACjC,QAAMC,IAAUD,EAAM,MAAM9B,CAAmB;AAE/C,SAAK+B,IAIEA,EAAQ,CAAC,EAAE,QAAQ9B,GAAmB,GAAG,IAHvC6B;AAIX;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"format.es.js","sources":["../node_modules/date-fns/format.js"],"sourcesContent":["import { defaultLocale } from \"./_lib/defaultLocale.js\";\nimport { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { formatters } from \"./_lib/format/formatters.js\";\nimport { longFormatters } from \"./_lib/format/longFormatters.js\";\nimport {\n isProtectedDayOfYearToken,\n isProtectedWeekYearToken,\n warnOrThrowProtectedError,\n} from \"./_lib/protectedTokens.js\";\nimport { isValid } from \"./isValid.js\";\nimport { toDate } from \"./toDate.js\";\n\n// Rexports of internal for libraries to use.\n// See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874\nexport { formatters, longFormatters };\n\n// This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\nconst formattingTokensRegExp =\n /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\n\n// This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\nconst longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\n\nconst escapedStringRegExp = /^'([^]*?)'?$/;\nconst doubleQuoteRegExp = /''/g;\nconst unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n\nexport { format as formatDate };\n\n/**\n * The {@link format} function options.\n */\n\n/**\n * @name format\n * @alias formatDate\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)\n * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n *\n * @param date - The original date\n * @param format - The string of tokens\n * @param options - An object with options\n *\n * @returns The formatted date string\n *\n * @throws `date` must not be Invalid Date\n * @throws `options.locale` must contain `localize` property\n * @throws `options.locale` must contain `formatLong` property\n * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md\n * @throws format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * const result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\nexport function format(date, formatStr, options) {\n const defaultOptions = getDefaultOptions();\n const locale = options?.locale ?? defaultOptions.locale ?? defaultLocale;\n\n const firstWeekContainsDate =\n options?.firstWeekContainsDate ??\n options?.locale?.options?.firstWeekContainsDate ??\n defaultOptions.firstWeekContainsDate ??\n defaultOptions.locale?.options?.firstWeekContainsDate ??\n 1;\n\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const originalDate = toDate(date, options?.in);\n\n if (!isValid(originalDate)) {\n throw new RangeError(\"Invalid time value\");\n }\n\n let parts = formatStr\n .match(longFormattingTokensRegExp)\n .map((substring) => {\n const firstCharacter = substring[0];\n if (firstCharacter === \"p\" || firstCharacter === \"P\") {\n const longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong);\n }\n return substring;\n })\n .join(\"\")\n .match(formattingTokensRegExp)\n .map((substring) => {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return { isToken: false, value: \"'\" };\n }\n\n const firstCharacter = substring[0];\n if (firstCharacter === \"'\") {\n return { isToken: false, value: cleanEscapedString(substring) };\n }\n\n if (formatters[firstCharacter]) {\n return { isToken: true, value: substring };\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError(\n \"Format string contains an unescaped latin alphabet character `\" +\n firstCharacter +\n \"`\",\n );\n }\n\n return { isToken: false, value: substring };\n });\n\n // invoke localize preprocessor (only for french locales at the moment)\n if (locale.localize.preprocessor) {\n parts = locale.localize.preprocessor(originalDate, parts);\n }\n\n const formatterOptions = {\n firstWeekContainsDate,\n weekStartsOn,\n locale,\n };\n\n return parts\n .map((part) => {\n if (!part.isToken) return part.value;\n\n const token = part.value;\n\n if (\n (!options?.useAdditionalWeekYearTokens &&\n isProtectedWeekYearToken(token)) ||\n (!options?.useAdditionalDayOfYearTokens &&\n isProtectedDayOfYearToken(token))\n ) {\n warnOrThrowProtectedError(token, formatStr, String(date));\n }\n\n const formatter = formatters[token[0]];\n return formatter(originalDate, token, locale.localize, formatterOptions);\n })\n .join(\"\");\n}\n\nfunction cleanEscapedString(input) {\n const matched = input.match(escapedStringRegExp);\n\n if (!matched) {\n return input;\n }\n\n return matched[1].replace(doubleQuoteRegExp, \"'\");\n}\n\n// Fallback for modularized imports:\nexport default format;\n"],"names":["formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","format","date","formatStr","options","defaultOptions","getDefaultOptions","locale","defaultLocale","firstWeekContainsDate","weekStartsOn","originalDate","toDate","isValid","parts","substring","firstCharacter","longFormatter","longFormatters","cleanEscapedString","formatters","formatterOptions","part","token","isProtectedWeekYearToken","isProtectedDayOfYearToken","warnOrThrowProtectedError","formatter","input","matched"],"mappings":";;;;;;;AA2BA,MAAMA,IACJ,yDAIIC,IAA6B,qCAE7BC,IAAsB,gBACtBC,IAAoB,OACpBC,IAAgC;AAoS/B,SAASC,EAAOC,GAAMC,GAAWC,GAAS;AAC/C,QAAMC,IAAiBC,EAAiB,GAClCC,IAA4BF,EAAe,UAAUG,GAErDC,IAGJJ,EAAe,yBACfA,EAAe,QAAQ,SAAS,yBAChC,GAEIK,IAGJL,EAAe,gBACfA,EAAe,QAAQ,SAAS,gBAChC,GAEIM,IAAeC,EAAOV,GAAME,GAAS,EAAE;AAE7C,MAAI,CAACS,EAAQF,CAAY;AACvB,UAAM,IAAI,WAAW,oBAAoB;AAG3C,MAAIG,IAAQX,EACT,MAAMN,CAA0B,EAChC,IAAI,CAACkB,MAAc;AAClB,UAAMC,IAAiBD,EAAU,CAAC;AAClC,QAAIC,MAAmB,OAAOA,MAAmB,KAAK;AACpD,YAAMC,IAAgBC,EAAeF,CAAc;AACnD,aAAOC,EAAcF,GAAWR,EAAO,UAAU;AAAA,IACnD;AACA,WAAOQ;AAAA,EACT,CAAC,EACA,KAAK,EAAE,EACP,MAAMnB,CAAsB,EAC5B,IAAI,CAACmB,MAAc;AAElB,QAAIA,MAAc;AAChB,aAAO,EAAE,SAAS,IAAO,OAAO,IAAG;AAGrC,UAAMC,IAAiBD,EAAU,CAAC;AAClC,QAAIC,MAAmB;AACrB,aAAO,EAAE,SAAS,IAAO,OAAOG,EAAmBJ,CAAS,EAAC;AAG/D,QAAIK,EAAWJ,CAAc;AAC3B,aAAO,EAAE,SAAS,IAAM,OAAOD,EAAS;AAG1C,QAAIC,EAAe,MAAMhB,CAA6B;AACpD,YAAM,IAAI;AAAA,QACR,mEACEgB,IACA;AAAA,MACZ;AAGM,WAAO,EAAE,SAAS,IAAO,OAAOD,EAAS;AAAA,EAC3C,CAAC;AAGH,EAAIR,EAAO,SAAS,iBAClBO,IAAQP,EAAO,SAAS,aAAaI,GAAcG,CAAK;AAG1D,QAAMO,IAAmB;AAAA,IACvB,uBAAAZ;AAAA,IACA,cAAAC;AAAA,IACA,QAAAH;AAAA,EACJ;AAEE,SAAOO,EACJ,IAAI,CAACQ,MAAS;AACb,QAAI,CAACA,EAAK,QAAS,QAAOA,EAAK;AAE/B,UAAMC,IAAQD,EAAK;AAEnB,KAEIE,EAAyBD,CAAK,KAE9BE,EAA0BF,CAAK,MAEjCG,EAA0BH,GAAOpB,GAAW,OAAOD,CAAI,CAAC;AAG1D,UAAMyB,IAAYP,EAAWG,EAAM,CAAC,CAAC;AACrC,WAAOI,EAAUhB,GAAcY,GAAOhB,EAAO,UAAUc,CAAgB;AAAA,EACzE,CAAC,EACA,KAAK,EAAE;AACZ;AAEA,SAASF,EAAmBS,GAAO;AACjC,QAAMC,IAAUD,EAAM,MAAM9B,CAAmB;AAE/C,SAAK+B,IAIEA,EAAQ,CAAC,EAAE,QAAQ9B,GAAmB,GAAG,IAHvC6B;AAIX;","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"formatdistance.es.js","sources":["../node_modules/date-fns/locale/en-US/_lib/formatDistance.js"],"sourcesContent":["const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n"],"names":["formatDistanceLocale","formatDistance","token","count","options","result","tokenValue"],"mappings":"AAAA,MAAMA,IAAuB;AAAA,EAC3B,kBAAkB;AAAA,IAChB,KAAK;AAAA,IACL,OAAO;AAAA,EACR;AAAA,EAED,UAAU;AAAA,IACR,KAAK;AAAA,IACL,OAAO;AAAA,EACR;AAAA,EAED,aAAa;AAAA,EAEb,kBAAkB;AAAA,IAChB,KAAK;AAAA,IACL,OAAO;AAAA,EACR;AAAA,EAED,UAAU;AAAA,IACR,KAAK;AAAA,IACL,OAAO;AAAA,EACR;AAAA,EAED,aAAa;AAAA,IACX,KAAK;AAAA,IACL,OAAO;AAAA,EACR;AAAA,EAED,QAAQ;AAAA,IACN,KAAK;AAAA,IACL,OAAO;AAAA,EACR;AAAA,EAED,OAAO;AAAA,IACL,KAAK;AAAA,IACL,OAAO;AAAA,EACR;AAAA,EAED,aAAa;AAAA,IACX,KAAK;AAAA,IACL,OAAO;AAAA,EACR;AAAA,EAED,QAAQ;AAAA,IACN,KAAK;AAAA,IACL,OAAO;AAAA,EACR;AAAA,EAED,cAAc;AAAA,IACZ,KAAK;AAAA,IACL,OAAO;AAAA,EACR;AAAA,EAED,SAAS;AAAA,IACP,KAAK;AAAA,IACL,OAAO;AAAA,EACR;AAAA,EAED,aAAa;AAAA,IACX,KAAK;AAAA,IACL,OAAO;AAAA,EACR;AAAA,EAED,QAAQ;AAAA,IACN,KAAK;AAAA,IACL,OAAO;AAAA,EACR;AAAA,EAED,YAAY;AAAA,IACV,KAAK;AAAA,IACL,OAAO;AAAA,EACR;AAAA,EAED,cAAc;AAAA,IACZ,KAAK;AAAA,IACL,OAAO;AAAA,EACR;AACH,GAEaC,IAAiB,CAACC,GAAOC,GAAOC,MAAY;AACvD,MAAIC;AAEJ,QAAMC,IAAaN,EAAqBE,CAAK;AAS7C,SARI,OAAOI,KAAe,WACxBD,IAASC,IACAH,MAAU,IACnBE,IAASC,EAAW,MAEpBD,IAASC,EAAW,MAAM,QAAQ,aAAaH,EAAM,UAAU,GAG7DC,GAAS,YACPA,EAAQ,cAAcA,EAAQ,aAAa,IACtC,QAAQC,IAERA,IAAS,SAIbA;AACT;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"formatdistance.es.js","sources":["../node_modules/date-fns/locale/en-US/_lib/formatDistance.js"],"sourcesContent":["const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"less than a second\",\n other: \"less than {{count}} seconds\",\n },\n\n xSeconds: {\n one: \"1 second\",\n other: \"{{count}} seconds\",\n },\n\n halfAMinute: \"half a minute\",\n\n lessThanXMinutes: {\n one: \"less than a minute\",\n other: \"less than {{count}} minutes\",\n },\n\n xMinutes: {\n one: \"1 minute\",\n other: \"{{count}} minutes\",\n },\n\n aboutXHours: {\n one: \"about 1 hour\",\n other: \"about {{count}} hours\",\n },\n\n xHours: {\n one: \"1 hour\",\n other: \"{{count}} hours\",\n },\n\n xDays: {\n one: \"1 day\",\n other: \"{{count}} days\",\n },\n\n aboutXWeeks: {\n one: \"about 1 week\",\n other: \"about {{count}} weeks\",\n },\n\n xWeeks: {\n one: \"1 week\",\n other: \"{{count}} weeks\",\n },\n\n aboutXMonths: {\n one: \"about 1 month\",\n other: \"about {{count}} months\",\n },\n\n xMonths: {\n one: \"1 month\",\n other: \"{{count}} months\",\n },\n\n aboutXYears: {\n one: \"about 1 year\",\n other: \"about {{count}} years\",\n },\n\n xYears: {\n one: \"1 year\",\n other: \"{{count}} years\",\n },\n\n overXYears: {\n one: \"over 1 year\",\n other: \"over {{count}} years\",\n },\n\n almostXYears: {\n one: \"almost 1 year\",\n other: \"almost {{count}} years\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", count.toString());\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"in \" + result;\n } else {\n return result + \" ago\";\n }\n }\n\n return result;\n};\n"],"names":["formatDistanceLocale","formatDistance","token","count","options","result","tokenValue"],"mappings":"AAAA,MAAMA,IAAuB;AAAA,EAC3B,kBAAkB;AAAA,IAChB,KAAK;AAAA,IACL,OAAO;AAAA,EACX;AAAA,EAEE,UAAU;AAAA,IACR,KAAK;AAAA,IACL,OAAO;AAAA,EACX;AAAA,EAEE,aAAa;AAAA,EAEb,kBAAkB;AAAA,IAChB,KAAK;AAAA,IACL,OAAO;AAAA,EACX;AAAA,EAEE,UAAU;AAAA,IACR,KAAK;AAAA,IACL,OAAO;AAAA,EACX;AAAA,EAEE,aAAa;AAAA,IACX,KAAK;AAAA,IACL,OAAO;AAAA,EACX;AAAA,EAEE,QAAQ;AAAA,IACN,KAAK;AAAA,IACL,OAAO;AAAA,EACX;AA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