@raystack/apsara 0.27.2 → 0.29.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 (199) hide show
  1. package/dist/container/container.cjs +3 -0
  2. package/dist/container/container.cjs.map +1 -1
  3. package/dist/container/container.d.ts +3 -0
  4. package/dist/container/container.d.ts.map +1 -1
  5. package/dist/container/container.js +3 -0
  6. package/dist/container/container.js.map +1 -1
  7. package/dist/image/image.cjs +6 -0
  8. package/dist/image/image.cjs.map +1 -1
  9. package/dist/image/image.d.ts +6 -0
  10. package/dist/image/image.d.ts.map +1 -1
  11. package/dist/image/image.js +6 -0
  12. package/dist/image/image.js.map +1 -1
  13. package/dist/link/link.cjs +3 -0
  14. package/dist/link/link.cjs.map +1 -1
  15. package/dist/link/link.d.ts +3 -0
  16. package/dist/link/link.d.ts.map +1 -1
  17. package/dist/link/link.js +3 -0
  18. package/dist/link/link.js.map +1 -1
  19. package/dist/separator/separator.cjs +3 -0
  20. package/dist/separator/separator.cjs.map +1 -1
  21. package/dist/separator/separator.d.ts +3 -0
  22. package/dist/separator/separator.d.ts.map +1 -1
  23. package/dist/separator/separator.js +3 -0
  24. package/dist/separator/separator.js.map +1 -1
  25. package/dist/style.css +1 -1
  26. package/dist/table/DataTableFilterChips.cjs.map +1 -1
  27. package/dist/table/DataTableFilterChips.js.map +1 -1
  28. package/dist/toggle-group/togglegroup.cjs +3 -3
  29. package/dist/toggle-group/togglegroup.cjs.map +1 -1
  30. package/dist/toggle-group/togglegroup.d.ts +5 -5
  31. package/dist/toggle-group/togglegroup.js +3 -3
  32. package/dist/toggle-group/togglegroup.js.map +1 -1
  33. package/dist/v1/components/box/box.cjs +3 -3
  34. package/dist/v1/components/box/box.cjs.map +1 -1
  35. package/dist/v1/components/box/box.d.ts +7 -2
  36. package/dist/v1/components/box/box.d.ts.map +1 -1
  37. package/dist/v1/components/box/box.js +3 -3
  38. package/dist/v1/components/box/box.js.map +1 -1
  39. package/dist/v1/components/calendar/calendar.cjs +6 -6
  40. package/dist/v1/components/calendar/calendar.cjs.map +1 -1
  41. package/dist/v1/components/calendar/calendar.d.ts.map +1 -1
  42. package/dist/v1/components/calendar/calendar.js +6 -6
  43. package/dist/v1/components/calendar/calendar.js.map +1 -1
  44. package/dist/v1/components/calendar/calendar.module.css.cjs +1 -1
  45. package/dist/v1/components/calendar/calendar.module.css.js +1 -1
  46. package/dist/v1/components/calendar/date-picker.cjs +6 -6
  47. package/dist/v1/components/calendar/date-picker.cjs.map +1 -1
  48. package/dist/v1/components/calendar/date-picker.d.ts +3 -2
  49. package/dist/v1/components/calendar/date-picker.d.ts.map +1 -1
  50. package/dist/v1/components/calendar/date-picker.js +6 -6
  51. package/dist/v1/components/calendar/date-picker.js.map +1 -1
  52. package/dist/v1/components/calendar/range-picker.cjs +6 -6
  53. package/dist/v1/components/calendar/range-picker.cjs.map +1 -1
  54. package/dist/v1/components/calendar/range-picker.d.ts +3 -2
  55. package/dist/v1/components/calendar/range-picker.d.ts.map +1 -1
  56. package/dist/v1/components/calendar/range-picker.js +6 -6
  57. package/dist/v1/components/calendar/range-picker.js.map +1 -1
  58. package/dist/v1/components/callout/callout.cjs +1 -1
  59. package/dist/v1/components/callout/callout.cjs.map +1 -1
  60. package/dist/v1/components/callout/callout.d.ts +1 -1
  61. package/dist/v1/components/callout/callout.d.ts.map +1 -1
  62. package/dist/v1/components/callout/callout.js +1 -1
  63. package/dist/v1/components/callout/callout.js.map +1 -1
  64. package/dist/v1/components/container/container.cjs +31 -0
  65. package/dist/v1/components/container/container.cjs.map +1 -0
  66. package/dist/v1/components/container/container.d.ts +13 -0
  67. package/dist/v1/components/container/container.d.ts.map +1 -0
  68. package/dist/v1/components/container/container.js +29 -0
  69. package/dist/v1/components/container/container.js.map +1 -0
  70. package/dist/v1/components/container/container.module.css.cjs +8 -0
  71. package/dist/v1/components/container/container.module.css.cjs.map +1 -0
  72. package/dist/v1/components/container/container.module.css.js +4 -0
  73. package/dist/v1/components/container/container.module.css.js.map +1 -0
  74. package/dist/v1/components/container/index.d.ts +2 -0
  75. package/dist/v1/components/container/index.d.ts.map +1 -0
  76. package/dist/v1/components/filter-chip/filter-chip.cjs +53 -0
  77. package/dist/v1/components/filter-chip/filter-chip.cjs.map +1 -0
  78. package/dist/v1/components/filter-chip/filter-chip.d.ts +24 -0
  79. package/dist/v1/components/filter-chip/filter-chip.d.ts.map +1 -0
  80. package/dist/v1/components/filter-chip/filter-chip.js +51 -0
  81. package/dist/v1/components/filter-chip/filter-chip.js.map +1 -0
  82. package/dist/v1/components/filter-chip/filter-chip.module.css.cjs +8 -0
  83. package/dist/v1/components/filter-chip/filter-chip.module.css.cjs.map +1 -0
  84. package/dist/v1/components/filter-chip/filter-chip.module.css.js +4 -0
  85. package/dist/v1/components/filter-chip/filter-chip.module.css.js.map +1 -0
  86. package/dist/v1/components/filter-chip/index.d.ts +2 -0
  87. package/dist/v1/components/filter-chip/index.d.ts.map +1 -0
  88. package/dist/v1/components/image/image.cjs +43 -0
  89. package/dist/v1/components/image/image.cjs.map +1 -0
  90. package/dist/v1/components/image/image.d.ts +17 -0
  91. package/dist/v1/components/image/image.d.ts.map +1 -0
  92. package/dist/v1/components/image/image.js +41 -0
  93. package/dist/v1/components/image/image.js.map +1 -0
  94. package/dist/v1/components/image/image.module.css.cjs +8 -0
  95. package/dist/v1/components/image/image.module.css.cjs.map +1 -0
  96. package/dist/v1/components/image/image.module.css.js +4 -0
  97. package/dist/v1/components/image/image.module.css.js.map +1 -0
  98. package/dist/v1/components/image/index.d.ts +2 -0
  99. package/dist/v1/components/image/index.d.ts.map +1 -0
  100. package/dist/v1/components/input-field/input-field.cjs.map +1 -1
  101. package/dist/v1/components/input-field/input-field.d.ts.map +1 -1
  102. package/dist/v1/components/input-field/input-field.js.map +1 -1
  103. package/dist/v1/components/link/index.d.ts +2 -0
  104. package/dist/v1/components/link/index.d.ts.map +1 -0
  105. package/dist/v1/components/link/link.cjs +74 -0
  106. package/dist/v1/components/link/link.cjs.map +1 -0
  107. package/dist/v1/components/link/link.d.ts +18 -0
  108. package/dist/v1/components/link/link.d.ts.map +1 -0
  109. package/dist/v1/components/link/link.js +72 -0
  110. package/dist/v1/components/link/link.js.map +1 -0
  111. package/dist/v1/components/link/link.module.css.cjs +8 -0
  112. package/dist/v1/components/link/link.module.css.cjs.map +1 -0
  113. package/dist/v1/components/link/link.module.css.js +4 -0
  114. package/dist/v1/components/link/link.module.css.js.map +1 -0
  115. package/dist/v1/components/list/index.d.ts +2 -0
  116. package/dist/v1/components/list/index.d.ts.map +1 -0
  117. package/dist/v1/components/list/list.cjs +42 -0
  118. package/dist/v1/components/list/list.cjs.map +1 -0
  119. package/dist/v1/components/list/list.d.ts +44 -0
  120. package/dist/v1/components/list/list.d.ts.map +1 -0
  121. package/dist/v1/components/list/list.js +40 -0
  122. package/dist/v1/components/list/list.js.map +1 -0
  123. package/dist/v1/components/list/list.module.css.cjs +8 -0
  124. package/dist/v1/components/list/list.module.css.cjs.map +1 -0
  125. package/dist/v1/components/list/list.module.css.js +4 -0
  126. package/dist/v1/components/list/list.module.css.js.map +1 -0
  127. package/dist/v1/components/popover/popover.cjs +1 -1
  128. package/dist/v1/components/popover/popover.cjs.map +1 -1
  129. package/dist/v1/components/popover/popover.d.ts.map +1 -1
  130. package/dist/v1/components/popover/popover.js +1 -1
  131. package/dist/v1/components/popover/popover.js.map +1 -1
  132. package/dist/v1/components/search/search.cjs.map +1 -1
  133. package/dist/v1/components/search/search.d.ts.map +1 -1
  134. package/dist/v1/components/search/search.js.map +1 -1
  135. package/dist/v1/components/select/select.cjs +6 -1
  136. package/dist/v1/components/select/select.cjs.map +1 -1
  137. package/dist/v1/components/select/select.d.ts +1 -0
  138. package/dist/v1/components/select/select.d.ts.map +1 -1
  139. package/dist/v1/components/select/select.js +6 -1
  140. package/dist/v1/components/select/select.js.map +1 -1
  141. package/dist/v1/components/select/select.module.css.cjs +1 -1
  142. package/dist/v1/components/select/select.module.css.js +1 -1
  143. package/dist/v1/components/separator/index.d.ts +2 -0
  144. package/dist/v1/components/separator/index.d.ts.map +1 -0
  145. package/dist/v1/components/separator/separator.cjs +32 -0
  146. package/dist/v1/components/separator/separator.cjs.map +1 -0
  147. package/dist/v1/components/separator/separator.d.ts +13 -0
  148. package/dist/v1/components/separator/separator.d.ts.map +1 -0
  149. package/dist/v1/components/separator/separator.js +30 -0
  150. package/dist/v1/components/separator/separator.js.map +1 -0
  151. package/dist/v1/components/separator/separator.module.css.cjs +8 -0
  152. package/dist/v1/components/separator/separator.module.css.cjs.map +1 -0
  153. package/dist/v1/components/separator/separator.module.css.js +4 -0
  154. package/dist/v1/components/separator/separator.module.css.js.map +1 -0
  155. package/dist/v1/components/sidepanel/sidepanel.cjs.map +1 -1
  156. package/dist/v1/components/sidepanel/sidepanel.d.ts +1 -1
  157. package/dist/v1/components/sidepanel/sidepanel.d.ts.map +1 -1
  158. package/dist/v1/components/sidepanel/sidepanel.js.map +1 -1
  159. package/dist/v1/components/slider/slider.cjs +2 -2
  160. package/dist/v1/components/slider/slider.cjs.map +1 -1
  161. package/dist/v1/components/slider/slider.d.ts +2 -2
  162. package/dist/v1/components/slider/slider.d.ts.map +1 -1
  163. package/dist/v1/components/slider/slider.js +2 -2
  164. package/dist/v1/components/slider/slider.js.map +1 -1
  165. package/dist/v1/components/text/text.cjs.map +1 -1
  166. package/dist/v1/components/text/text.d.ts.map +1 -1
  167. package/dist/v1/components/text/text.js +33 -33
  168. package/dist/v1/components/text/text.js.map +1 -1
  169. package/dist/v1/components/text/text.module.css.cjs +2 -2
  170. package/dist/v1/components/text/text.module.css.js +2 -2
  171. package/dist/v1/components/text-area/text-area.cjs +1 -1
  172. package/dist/v1/components/text-area/text-area.cjs.map +1 -1
  173. package/dist/v1/components/text-area/text-area.d.ts +1 -1
  174. package/dist/v1/components/text-area/text-area.d.ts.map +1 -1
  175. package/dist/v1/components/text-area/text-area.js +1 -1
  176. package/dist/v1/components/text-area/text-area.js.map +1 -1
  177. package/dist/v1/components/textfield/textfield.cjs.map +1 -1
  178. package/dist/v1/components/textfield/textfield.d.ts.map +1 -1
  179. package/dist/v1/components/textfield/textfield.js.map +1 -1
  180. package/dist/v1/components/tooltip/tooltip.cjs.map +1 -1
  181. package/dist/v1/components/tooltip/tooltip.d.ts +1 -1
  182. package/dist/v1/components/tooltip/tooltip.d.ts.map +1 -1
  183. package/dist/v1/components/tooltip/tooltip.js.map +1 -1
  184. package/dist/v1/index.cjs +20 -8
  185. package/dist/v1/index.cjs.map +1 -1
  186. package/dist/v1/index.d.ts +10 -4
  187. package/dist/v1/index.d.ts.map +1 -1
  188. package/dist/v1/index.js +10 -4
  189. package/dist/v1/index.js.map +1 -1
  190. package/dist/v1/node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.cjs +23 -0
  191. package/dist/v1/node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.cjs.map +1 -1
  192. package/dist/v1/node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js +23 -1
  193. package/dist/v1/node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js.map +1 -1
  194. package/dist/v1/node_modules/.pnpm/@radix-ui_react-separator@1.0.3_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3._na4co26slzimf5qojej32hgyjm/node_modules/@radix-ui/react-separator/dist/index.cjs +51 -0
  195. package/dist/v1/node_modules/.pnpm/@radix-ui_react-separator@1.0.3_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3._na4co26slzimf5qojej32hgyjm/node_modules/@radix-ui/react-separator/dist/index.cjs.map +1 -0
  196. package/dist/v1/node_modules/.pnpm/@radix-ui_react-separator@1.0.3_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3._na4co26slzimf5qojej32hgyjm/node_modules/@radix-ui/react-separator/dist/index.js +48 -0
  197. package/dist/v1/node_modules/.pnpm/@radix-ui_react-separator@1.0.3_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3._na4co26slzimf5qojej32hgyjm/node_modules/@radix-ui/react-separator/dist/index.js.map +1 -0
  198. package/dist/v1/style.css +1 -1
  199. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableFilterChips.cjs","sources":["../../table/DataTableFilterChips.tsx"],"sourcesContent":["import { PlusIcon } from \"@radix-ui/react-icons\";\nimport { ComponentProps } from \"react\";\nimport { Flex } from \"~/flex\";\nimport { DataTableFilterOptions } from \"./DataTableFilterOptions\";\nimport { FilteredChip } from \"./FilteredChip\";\nimport styles from \"./datatable.module.css\";\nimport { useTable } from \"./hooks/useTable\";\n\ntype DataTableFilterChipsProps = ComponentProps<typeof Flex>;\nexport function DataTableFilterChips(props: DataTableFilterChipsProps) {\n const { filteredColumns, table, updateColumnCustomFilter } = useTable();\n const tableColumns = table\n .getAllColumns()\n .filter(\n (column) =>\n typeof column.accessorFn !== \"undefined\" &&\n column.getCanHide() &&\n column.getCanFilter()\n );\n\n if (!filteredColumns.length) return null;\n\n return (\n <Flex gap=\"small\" align=\"center\" className={styles.chipWrapper} {...props}>\n {filteredColumns.map((filter, index) => {\n const filteredColumn = table.getColumn(filter)!;\n return (\n <FilteredChip\n key={index}\n column={filteredColumn}\n updateColumnCustomFilter={updateColumnCustomFilter}\n />\n );\n })}\n\n {filteredColumns.length < tableColumns.length && (\n <DataTableFilterOptions\n variant=\"ghost\"\n style={{ border: \"none\", background: \"none\" }}\n >\n <PlusIcon width={16} height={16} />\n </DataTableFilterOptions>\n )}\n </Flex>\n );\n}\n"],"names":["useTable","_jsxs","Flex","styles","_jsx","FilteredChip","DataTableFilterOptions","PlusIcon"],"mappings":";;;;;;;;;;AASM,SAAU,oBAAoB,CAAC,KAAgC,EAAA;IACnE,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,wBAAwB,EAAE,GAAGA,iBAAQ,EAAE,CAAC;IACxE,MAAM,YAAY,GAAG,KAAK;AACvB,SAAA,aAAa,EAAE;SACf,MAAM,CACL,CAAC,MAAM,KACL,OAAO,MAAM,CAAC,UAAU,KAAK,WAAW;QACxC,MAAM,CAAC,UAAU,EAAE;AACnB,QAAA,MAAM,CAAC,YAAY,EAAE,CACxB,CAAC;IAEJ,IAAI,CAAC,eAAe,CAAC,MAAM;AAAE,QAAA,OAAO,IAAI,CAAC;AAEzC,IAAA,QACEC,iCAAA,CAACC,SAAI,EAAA,EAAC,GAAG,EAAC,OAAO,EAAC,KAAK,EAAC,QAAQ,EAAC,SAAS,EAAEC,wBAAM,CAAC,WAAW,EAAA,GAAM,KAAK,EAAA,QAAA,EAAA,CACtE,eAAe,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,KAAI;gBACrC,MAAM,cAAc,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAE,CAAC;AAChD,gBAAA,QACEC,gCAAA,CAACC,yBAAY,EAAA,EAEX,MAAM,EAAE,cAAc,EACtB,wBAAwB,EAAE,wBAAwB,EAAA,EAF7C,KAAK,CAGV,EACF;aACH,CAAC,EAED,eAAe,CAAC,MAAM,GAAG,YAAY,CAAC,MAAM,KAC3CD,gCAAC,CAAAE,6CAAsB,IACrB,OAAO,EAAC,OAAO,EACf,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,EAE7C,QAAA,EAAAF,gCAAA,CAACG,uBAAQ,EAAC,EAAA,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,GAAI,EACZ,CAAA,CAC1B,CACI,EAAA,CAAA,EACP;AACJ;;;;"}
1
+ {"version":3,"file":"DataTableFilterChips.cjs","sources":["../../table/DataTableFilterChips.tsx"],"sourcesContent":["import { PlusIcon } from \"@radix-ui/react-icons\";\nimport { ComponentProps } from \"react\";\nimport { Flex } from \"~/flex\";\nimport { DataTableFilterOptions } from \"./DataTableFilterOptions\";\nimport { FilteredChip } from \"./FilteredChip\";\nimport styles from \"./datatable.module.css\";\nimport { useTable } from \"./hooks/useTable\";\n\ntype DataTableFilterChipsProps = ComponentProps<typeof Flex>;\nexport function DataTableFilterChips(props: DataTableFilterChipsProps) {\n const { filteredColumns, table, updateColumnCustomFilter } = useTable();\n const tableColumns = table\n .getAllColumns()\n .filter(\n (column) =>\n typeof column.accessorFn !== \"undefined\" &&\n column.getCanHide() &&\n column.getCanFilter()\n );\n\n if (!filteredColumns.length) return null;\n\n return (\n <Flex gap=\"small\" align=\"center\" className={styles.chipWrapper} {...props}>\n {filteredColumns.map((filter, index) => {\n const filteredColumn = table.getColumn(filter)!;\n return (\n <FilteredChip\n key={index}\n column={filteredColumn}\n updateColumnCustomFilter={updateColumnCustomFilter}\n />\n );\n })}\n\n {filteredColumns.length < tableColumns.length && (\n <DataTableFilterOptions\n variant=\"ghost\"\n style={{ border: \"none\", background: \"none\" }}\n >\n <PlusIcon width={16} height={16} />\n </DataTableFilterOptions>\n )}\n </Flex>\n );\n}"],"names":["useTable","_jsxs","Flex","styles","_jsx","FilteredChip","DataTableFilterOptions","PlusIcon"],"mappings":";;;;;;;;;;AASM,SAAU,oBAAoB,CAAC,KAAgC,EAAA;IACnE,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,wBAAwB,EAAE,GAAGA,iBAAQ,EAAE,CAAC;IACxE,MAAM,YAAY,GAAG,KAAK;AACvB,SAAA,aAAa,EAAE;SACf,MAAM,CACL,CAAC,MAAM,KACL,OAAO,MAAM,CAAC,UAAU,KAAK,WAAW;QACxC,MAAM,CAAC,UAAU,EAAE;AACnB,QAAA,MAAM,CAAC,YAAY,EAAE,CACxB,CAAC;IAEJ,IAAI,CAAC,eAAe,CAAC,MAAM;AAAE,QAAA,OAAO,IAAI,CAAC;AAEzC,IAAA,QACEC,iCAAA,CAACC,SAAI,EAAA,EAAC,GAAG,EAAC,OAAO,EAAC,KAAK,EAAC,QAAQ,EAAC,SAAS,EAAEC,wBAAM,CAAC,WAAW,EAAA,GAAM,KAAK,EAAA,QAAA,EAAA,CACtE,eAAe,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,KAAI;gBACrC,MAAM,cAAc,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAE,CAAC;AAChD,gBAAA,QACEC,gCAAA,CAACC,yBAAY,EAAA,EAEX,MAAM,EAAE,cAAc,EACtB,wBAAwB,EAAE,wBAAwB,EAAA,EAF7C,KAAK,CAGV,EACF;aACH,CAAC,EAED,eAAe,CAAC,MAAM,GAAG,YAAY,CAAC,MAAM,KAC3CD,gCAAC,CAAAE,6CAAsB,IACrB,OAAO,EAAC,OAAO,EACf,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,EAE7C,QAAA,EAAAF,gCAAA,CAACG,uBAAQ,EAAC,EAAA,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,GAAI,EACZ,CAAA,CAC1B,CACI,EAAA,CAAA,EACP;AACJ;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableFilterChips.js","sources":["../../table/DataTableFilterChips.tsx"],"sourcesContent":["import { PlusIcon } from \"@radix-ui/react-icons\";\nimport { ComponentProps } from \"react\";\nimport { Flex } from \"~/flex\";\nimport { DataTableFilterOptions } from \"./DataTableFilterOptions\";\nimport { FilteredChip } from \"./FilteredChip\";\nimport styles from \"./datatable.module.css\";\nimport { useTable } from \"./hooks/useTable\";\n\ntype DataTableFilterChipsProps = ComponentProps<typeof Flex>;\nexport function DataTableFilterChips(props: DataTableFilterChipsProps) {\n const { filteredColumns, table, updateColumnCustomFilter } = useTable();\n const tableColumns = table\n .getAllColumns()\n .filter(\n (column) =>\n typeof column.accessorFn !== \"undefined\" &&\n column.getCanHide() &&\n column.getCanFilter()\n );\n\n if (!filteredColumns.length) return null;\n\n return (\n <Flex gap=\"small\" align=\"center\" className={styles.chipWrapper} {...props}>\n {filteredColumns.map((filter, index) => {\n const filteredColumn = table.getColumn(filter)!;\n return (\n <FilteredChip\n key={index}\n column={filteredColumn}\n updateColumnCustomFilter={updateColumnCustomFilter}\n />\n );\n })}\n\n {filteredColumns.length < tableColumns.length && (\n <DataTableFilterOptions\n variant=\"ghost\"\n style={{ border: \"none\", background: \"none\" }}\n >\n <PlusIcon width={16} height={16} />\n </DataTableFilterOptions>\n )}\n </Flex>\n );\n}\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;AASM,SAAU,oBAAoB,CAAC,KAAgC,EAAA;IACnE,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,wBAAwB,EAAE,GAAG,QAAQ,EAAE,CAAC;IACxE,MAAM,YAAY,GAAG,KAAK;AACvB,SAAA,aAAa,EAAE;SACf,MAAM,CACL,CAAC,MAAM,KACL,OAAO,MAAM,CAAC,UAAU,KAAK,WAAW;QACxC,MAAM,CAAC,UAAU,EAAE;AACnB,QAAA,MAAM,CAAC,YAAY,EAAE,CACxB,CAAC;IAEJ,IAAI,CAAC,eAAe,CAAC,MAAM;AAAE,QAAA,OAAO,IAAI,CAAC;AAEzC,IAAA,QACEA,sBAAA,CAAC,IAAI,EAAA,EAAC,GAAG,EAAC,OAAO,EAAC,KAAK,EAAC,QAAQ,EAAC,SAAS,EAAE,MAAM,CAAC,WAAW,EAAA,GAAM,KAAK,EAAA,QAAA,EAAA,CACtE,eAAe,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,KAAI;gBACrC,MAAM,cAAc,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAE,CAAC;AAChD,gBAAA,QACEC,qBAAA,CAAC,YAAY,EAAA,EAEX,MAAM,EAAE,cAAc,EACtB,wBAAwB,EAAE,wBAAwB,EAAA,EAF7C,KAAK,CAGV,EACF;aACH,CAAC,EAED,eAAe,CAAC,MAAM,GAAG,YAAY,CAAC,MAAM,KAC3CA,qBAAC,CAAA,sBAAsB,IACrB,OAAO,EAAC,OAAO,EACf,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,EAE7C,QAAA,EAAAA,qBAAA,CAAC,QAAQ,EAAC,EAAA,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,GAAI,EACZ,CAAA,CAC1B,CACI,EAAA,CAAA,EACP;AACJ;;;;"}
1
+ {"version":3,"file":"DataTableFilterChips.js","sources":["../../table/DataTableFilterChips.tsx"],"sourcesContent":["import { PlusIcon } from \"@radix-ui/react-icons\";\nimport { ComponentProps } from \"react\";\nimport { Flex } from \"~/flex\";\nimport { DataTableFilterOptions } from \"./DataTableFilterOptions\";\nimport { FilteredChip } from \"./FilteredChip\";\nimport styles from \"./datatable.module.css\";\nimport { useTable } from \"./hooks/useTable\";\n\ntype DataTableFilterChipsProps = ComponentProps<typeof Flex>;\nexport function DataTableFilterChips(props: DataTableFilterChipsProps) {\n const { filteredColumns, table, updateColumnCustomFilter } = useTable();\n const tableColumns = table\n .getAllColumns()\n .filter(\n (column) =>\n typeof column.accessorFn !== \"undefined\" &&\n column.getCanHide() &&\n column.getCanFilter()\n );\n\n if (!filteredColumns.length) return null;\n\n return (\n <Flex gap=\"small\" align=\"center\" className={styles.chipWrapper} {...props}>\n {filteredColumns.map((filter, index) => {\n const filteredColumn = table.getColumn(filter)!;\n return (\n <FilteredChip\n key={index}\n column={filteredColumn}\n updateColumnCustomFilter={updateColumnCustomFilter}\n />\n );\n })}\n\n {filteredColumns.length < tableColumns.length && (\n <DataTableFilterOptions\n variant=\"ghost\"\n style={{ border: \"none\", background: \"none\" }}\n >\n <PlusIcon width={16} height={16} />\n </DataTableFilterOptions>\n )}\n </Flex>\n );\n}"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;AASM,SAAU,oBAAoB,CAAC,KAAgC,EAAA;IACnE,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,wBAAwB,EAAE,GAAG,QAAQ,EAAE,CAAC;IACxE,MAAM,YAAY,GAAG,KAAK;AACvB,SAAA,aAAa,EAAE;SACf,MAAM,CACL,CAAC,MAAM,KACL,OAAO,MAAM,CAAC,UAAU,KAAK,WAAW;QACxC,MAAM,CAAC,UAAU,EAAE;AACnB,QAAA,MAAM,CAAC,YAAY,EAAE,CACxB,CAAC;IAEJ,IAAI,CAAC,eAAe,CAAC,MAAM;AAAE,QAAA,OAAO,IAAI,CAAC;AAEzC,IAAA,QACEA,sBAAA,CAAC,IAAI,EAAA,EAAC,GAAG,EAAC,OAAO,EAAC,KAAK,EAAC,QAAQ,EAAC,SAAS,EAAE,MAAM,CAAC,WAAW,EAAA,GAAM,KAAK,EAAA,QAAA,EAAA,CACtE,eAAe,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,KAAI;gBACrC,MAAM,cAAc,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAE,CAAC;AAChD,gBAAA,QACEC,qBAAA,CAAC,YAAY,EAAA,EAEX,MAAM,EAAE,cAAc,EACtB,wBAAwB,EAAE,wBAAwB,EAAA,EAF7C,KAAK,CAGV,EACF;aACH,CAAC,EAED,eAAe,CAAC,MAAM,GAAG,YAAY,CAAC,MAAM,KAC3CA,qBAAC,CAAA,sBAAsB,IACrB,OAAO,EAAC,OAAO,EACf,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,EAE7C,QAAA,EAAAA,qBAAA,CAAC,QAAQ,EAAC,EAAA,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,GAAI,EACZ,CAAA,CAC1B,CACI,EAAA,CAAA,EACP;AACJ;;;;"}
@@ -7,7 +7,7 @@ var index$1 = require('../node_modules/.pnpm/class-variance-authority@0.7.1/node
7
7
 
8
8
  const root = index$1.cva(togglegroup_module.default.root);
9
9
  /**
10
- * @deprecated Use ToggleGroupRoot from '@raystack/apsara/v1' instead.
10
+ * @deprecated Use Tabs from '@raystack/apsara/v1' instead.
11
11
  */
12
12
  const ToggleGroupRoot = ({ className, ...props }) => {
13
13
  return (jsxRuntime.jsxRuntimeExports.jsx(index.Root, { className: root({ className }), ...props }));
@@ -15,13 +15,13 @@ const ToggleGroupRoot = ({ className, ...props }) => {
15
15
  ToggleGroupRoot.defaultProps = { type: "single" };
16
16
  const item = index$1.cva(togglegroup_module.default.item);
17
17
  /**
18
- * @deprecated Use ToggleGroupItem from '@raystack/apsara/v1' instead.
18
+ * @deprecated Use Tabs from '@raystack/apsara/v1' instead.
19
19
  */
20
20
  const ToggleGroupItem = ({ className, ...props }) => {
21
21
  return (jsxRuntime.jsxRuntimeExports.jsx(index.Item, { className: item({ className }), ...props }));
22
22
  };
23
23
  /**
24
- * @deprecated Use ToggleGroup from '@raystack/apsara/v1' instead.
24
+ * @deprecated Use Tabs from '@raystack/apsara/v1' instead.
25
25
  */
26
26
  const ToggleGroup = Object.assign(ToggleGroupRoot, {
27
27
  Item: ToggleGroupItem,
@@ -1 +1 @@
1
- {"version":3,"file":"togglegroup.cjs","sources":["../../toggle-group/togglegroup.tsx"],"sourcesContent":["import React, { ComponentPropsWithoutRef } from \"react\";\nimport * as ToggleGroupPrimitive from \"@radix-ui/react-toggle-group\";\nimport styles from \"./togglegroup.module.css\";\nimport { cva, VariantProps } from \"class-variance-authority\";\n\nconst root = cva(styles.root);\n\n/**\n * @deprecated Use ToggleGroupProps from '@raystack/apsara/v1' instead.\n */\nexport type ToggleGroupProps = ComponentPropsWithoutRef<\n typeof ToggleGroupPrimitive.Root\n> &\n VariantProps<typeof root>;\n\n/**\n * @deprecated Use ToggleGroupRoot from '@raystack/apsara/v1' instead.\n */\nexport const ToggleGroupRoot = ({ className, ...props }: ToggleGroupProps) => {\n return (\n <ToggleGroupPrimitive.Root className={root({ className })} {...props} />\n );\n};\n\nToggleGroupRoot.defaultProps = { type: \"single\" };\n\nconst item = cva(styles.item);\n\n/**\n * @deprecated Use ToggleGroupItemProps from '@raystack/apsara/v1' instead.\n */\nexport interface ToggleGroupItemProps\n extends ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item>,\n VariantProps<typeof item> {}\n\n/**\n * @deprecated Use ToggleGroupItem from '@raystack/apsara/v1' instead.\n */\nexport const ToggleGroupItem = ({\n className,\n ...props\n}: ToggleGroupItemProps) => {\n return (\n <ToggleGroupPrimitive.Item className={item({ className })} {...props} />\n );\n};\n\n/**\n * @deprecated Use ToggleGroup from '@raystack/apsara/v1' instead.\n */\nexport const ToggleGroup = Object.assign(ToggleGroupRoot, {\n Item: ToggleGroupItem,\n});\n"],"names":["cva","styles","_jsx","ToggleGroupPrimitive.Root","ToggleGroupPrimitive.Item"],"mappings":";;;;;;;AAKA,MAAM,IAAI,GAAGA,WAAG,CAACC,0BAAM,CAAC,IAAI,CAAC,CAAC;AAU9B;;AAEG;AACI,MAAM,eAAe,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAoB,KAAI;AAC3E,IAAA,QACEC,gCAAC,CAAAC,UAAyB,EAAA,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,KAAM,KAAK,EAAA,CAAI,EACxE;AACJ,EAAE;AAEF,eAAe,CAAC,YAAY,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAElD,MAAM,IAAI,GAAGH,WAAG,CAACC,0BAAM,CAAC,IAAI,CAAC,CAAC;AAS9B;;AAEG;AACI,MAAM,eAAe,GAAG,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACa,KAAI;AACzB,IAAA,QACEC,gCAAC,CAAAE,UAAyB,EAAA,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,KAAM,KAAK,EAAA,CAAI,EACxE;AACJ,EAAE;AAEF;;AAEG;MACU,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE;AACxD,IAAA,IAAI,EAAE,eAAe;AACtB,CAAA;;;;;;"}
1
+ {"version":3,"file":"togglegroup.cjs","sources":["../../toggle-group/togglegroup.tsx"],"sourcesContent":["import React, { ComponentPropsWithoutRef } from \"react\";\nimport * as ToggleGroupPrimitive from \"@radix-ui/react-toggle-group\";\nimport styles from \"./togglegroup.module.css\";\nimport { cva, VariantProps } from \"class-variance-authority\";\n\nconst root = cva(styles.root);\n\n/**\n * @deprecated Use Tabs from '@raystack/apsara/v1' instead.\n */\nexport type ToggleGroupProps = ComponentPropsWithoutRef<\n typeof ToggleGroupPrimitive.Root\n> &\n VariantProps<typeof root>;\n\n/**\n * @deprecated Use Tabs from '@raystack/apsara/v1' instead.\n */\nexport const ToggleGroupRoot = ({ className, ...props }: ToggleGroupProps) => {\n return (\n <ToggleGroupPrimitive.Root className={root({ className })} {...props} />\n );\n};\n\nToggleGroupRoot.defaultProps = { type: \"single\" };\n\nconst item = cva(styles.item);\n\n/**\n * @deprecated Use Tabs from '@raystack/apsara/v1' instead.\n */\nexport interface ToggleGroupItemProps\n extends ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item>,\n VariantProps<typeof item> {}\n\n/**\n * @deprecated Use Tabs from '@raystack/apsara/v1' instead.\n */\nexport const ToggleGroupItem = ({\n className,\n ...props\n}: ToggleGroupItemProps) => {\n return (\n <ToggleGroupPrimitive.Item className={item({ className })} {...props} />\n );\n};\n\n/**\n * @deprecated Use Tabs from '@raystack/apsara/v1' instead.\n */\nexport const ToggleGroup = Object.assign(ToggleGroupRoot, {\n Item: ToggleGroupItem,\n});\n"],"names":["cva","styles","_jsx","ToggleGroupPrimitive.Root","ToggleGroupPrimitive.Item"],"mappings":";;;;;;;AAKA,MAAM,IAAI,GAAGA,WAAG,CAACC,0BAAM,CAAC,IAAI,CAAC,CAAC;AAU9B;;AAEG;AACI,MAAM,eAAe,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAoB,KAAI;AAC3E,IAAA,QACEC,gCAAC,CAAAC,UAAyB,EAAA,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,KAAM,KAAK,EAAA,CAAI,EACxE;AACJ,EAAE;AAEF,eAAe,CAAC,YAAY,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAElD,MAAM,IAAI,GAAGH,WAAG,CAACC,0BAAM,CAAC,IAAI,CAAC,CAAC;AAS9B;;AAEG;AACI,MAAM,eAAe,GAAG,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACa,KAAI;AACzB,IAAA,QACEC,gCAAC,CAAAE,UAAyB,EAAA,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,KAAM,KAAK,EAAA,CAAI,EACxE;AACJ,EAAE;AAEF;;AAEG;MACU,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE;AACxD,IAAA,IAAI,EAAE,eAAe;AACtB,CAAA;;;;;;"}
@@ -3,11 +3,11 @@ import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
3
3
  import { VariantProps } from "class-variance-authority";
4
4
  declare const root: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
5
5
  /**
6
- * @deprecated Use ToggleGroupProps from '@raystack/apsara/v1' instead.
6
+ * @deprecated Use Tabs from '@raystack/apsara/v1' instead.
7
7
  */
8
8
  export type ToggleGroupProps = ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof root>;
9
9
  /**
10
- * @deprecated Use ToggleGroupRoot from '@raystack/apsara/v1' instead.
10
+ * @deprecated Use Tabs from '@raystack/apsara/v1' instead.
11
11
  */
12
12
  export declare const ToggleGroupRoot: {
13
13
  ({ className, ...props }: ToggleGroupProps): import("react/jsx-runtime").JSX.Element;
@@ -17,16 +17,16 @@ export declare const ToggleGroupRoot: {
17
17
  };
18
18
  declare const item: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
19
19
  /**
20
- * @deprecated Use ToggleGroupItemProps from '@raystack/apsara/v1' instead.
20
+ * @deprecated Use Tabs from '@raystack/apsara/v1' instead.
21
21
  */
22
22
  export interface ToggleGroupItemProps extends ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item>, VariantProps<typeof item> {
23
23
  }
24
24
  /**
25
- * @deprecated Use ToggleGroupItem from '@raystack/apsara/v1' instead.
25
+ * @deprecated Use Tabs from '@raystack/apsara/v1' instead.
26
26
  */
27
27
  export declare const ToggleGroupItem: ({ className, ...props }: ToggleGroupItemProps) => import("react/jsx-runtime").JSX.Element;
28
28
  /**
29
- * @deprecated Use ToggleGroup from '@raystack/apsara/v1' instead.
29
+ * @deprecated Use Tabs from '@raystack/apsara/v1' instead.
30
30
  */
31
31
  export declare const ToggleGroup: {
32
32
  ({ className, ...props }: ToggleGroupProps): import("react/jsx-runtime").JSX.Element;
@@ -5,7 +5,7 @@ import { cva } from '../node_modules/.pnpm/class-variance-authority@0.7.1/node_m
5
5
 
6
6
  const root = cva(styles.root);
7
7
  /**
8
- * @deprecated Use ToggleGroupRoot from '@raystack/apsara/v1' instead.
8
+ * @deprecated Use Tabs from '@raystack/apsara/v1' instead.
9
9
  */
10
10
  const ToggleGroupRoot = ({ className, ...props }) => {
11
11
  return (jsxRuntimeExports.jsx($6c1fd9e6a8969628$export$be92b6f5f03c0fe9, { className: root({ className }), ...props }));
@@ -13,13 +13,13 @@ const ToggleGroupRoot = ({ className, ...props }) => {
13
13
  ToggleGroupRoot.defaultProps = { type: "single" };
14
14
  const item = cva(styles.item);
15
15
  /**
16
- * @deprecated Use ToggleGroupItem from '@raystack/apsara/v1' instead.
16
+ * @deprecated Use Tabs from '@raystack/apsara/v1' instead.
17
17
  */
18
18
  const ToggleGroupItem = ({ className, ...props }) => {
19
19
  return (jsxRuntimeExports.jsx($6c1fd9e6a8969628$export$6d08773d2e66f8f2, { className: item({ className }), ...props }));
20
20
  };
21
21
  /**
22
- * @deprecated Use ToggleGroup from '@raystack/apsara/v1' instead.
22
+ * @deprecated Use Tabs from '@raystack/apsara/v1' instead.
23
23
  */
24
24
  const ToggleGroup = Object.assign(ToggleGroupRoot, {
25
25
  Item: ToggleGroupItem,
@@ -1 +1 @@
1
- {"version":3,"file":"togglegroup.js","sources":["../../toggle-group/togglegroup.tsx"],"sourcesContent":["import React, { ComponentPropsWithoutRef } from \"react\";\nimport * as ToggleGroupPrimitive from \"@radix-ui/react-toggle-group\";\nimport styles from \"./togglegroup.module.css\";\nimport { cva, VariantProps } from \"class-variance-authority\";\n\nconst root = cva(styles.root);\n\n/**\n * @deprecated Use ToggleGroupProps from '@raystack/apsara/v1' instead.\n */\nexport type ToggleGroupProps = ComponentPropsWithoutRef<\n typeof ToggleGroupPrimitive.Root\n> &\n VariantProps<typeof root>;\n\n/**\n * @deprecated Use ToggleGroupRoot from '@raystack/apsara/v1' instead.\n */\nexport const ToggleGroupRoot = ({ className, ...props }: ToggleGroupProps) => {\n return (\n <ToggleGroupPrimitive.Root className={root({ className })} {...props} />\n );\n};\n\nToggleGroupRoot.defaultProps = { type: \"single\" };\n\nconst item = cva(styles.item);\n\n/**\n * @deprecated Use ToggleGroupItemProps from '@raystack/apsara/v1' instead.\n */\nexport interface ToggleGroupItemProps\n extends ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item>,\n VariantProps<typeof item> {}\n\n/**\n * @deprecated Use ToggleGroupItem from '@raystack/apsara/v1' instead.\n */\nexport const ToggleGroupItem = ({\n className,\n ...props\n}: ToggleGroupItemProps) => {\n return (\n <ToggleGroupPrimitive.Item className={item({ className })} {...props} />\n );\n};\n\n/**\n * @deprecated Use ToggleGroup from '@raystack/apsara/v1' instead.\n */\nexport const ToggleGroup = Object.assign(ToggleGroupRoot, {\n Item: ToggleGroupItem,\n});\n"],"names":["_jsx","ToggleGroupPrimitive.Root","ToggleGroupPrimitive.Item"],"mappings":";;;;;AAKA,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAU9B;;AAEG;AACI,MAAM,eAAe,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAoB,KAAI;AAC3E,IAAA,QACEA,qBAAC,CAAAC,yCAAyB,EAAA,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,KAAM,KAAK,EAAA,CAAI,EACxE;AACJ,EAAE;AAEF,eAAe,CAAC,YAAY,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAElD,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAS9B;;AAEG;AACI,MAAM,eAAe,GAAG,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACa,KAAI;AACzB,IAAA,QACED,qBAAC,CAAAE,yCAAyB,EAAA,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,KAAM,KAAK,EAAA,CAAI,EACxE;AACJ,EAAE;AAEF;;AAEG;MACU,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE;AACxD,IAAA,IAAI,EAAE,eAAe;AACtB,CAAA;;;;"}
1
+ {"version":3,"file":"togglegroup.js","sources":["../../toggle-group/togglegroup.tsx"],"sourcesContent":["import React, { ComponentPropsWithoutRef } from \"react\";\nimport * as ToggleGroupPrimitive from \"@radix-ui/react-toggle-group\";\nimport styles from \"./togglegroup.module.css\";\nimport { cva, VariantProps } from \"class-variance-authority\";\n\nconst root = cva(styles.root);\n\n/**\n * @deprecated Use Tabs from '@raystack/apsara/v1' instead.\n */\nexport type ToggleGroupProps = ComponentPropsWithoutRef<\n typeof ToggleGroupPrimitive.Root\n> &\n VariantProps<typeof root>;\n\n/**\n * @deprecated Use Tabs from '@raystack/apsara/v1' instead.\n */\nexport const ToggleGroupRoot = ({ className, ...props }: ToggleGroupProps) => {\n return (\n <ToggleGroupPrimitive.Root className={root({ className })} {...props} />\n );\n};\n\nToggleGroupRoot.defaultProps = { type: \"single\" };\n\nconst item = cva(styles.item);\n\n/**\n * @deprecated Use Tabs from '@raystack/apsara/v1' instead.\n */\nexport interface ToggleGroupItemProps\n extends ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item>,\n VariantProps<typeof item> {}\n\n/**\n * @deprecated Use Tabs from '@raystack/apsara/v1' instead.\n */\nexport const ToggleGroupItem = ({\n className,\n ...props\n}: ToggleGroupItemProps) => {\n return (\n <ToggleGroupPrimitive.Item className={item({ className })} {...props} />\n );\n};\n\n/**\n * @deprecated Use Tabs from '@raystack/apsara/v1' instead.\n */\nexport const ToggleGroup = Object.assign(ToggleGroupRoot, {\n Item: ToggleGroupItem,\n});\n"],"names":["_jsx","ToggleGroupPrimitive.Root","ToggleGroupPrimitive.Item"],"mappings":";;;;;AAKA,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAU9B;;AAEG;AACI,MAAM,eAAe,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAoB,KAAI;AAC3E,IAAA,QACEA,qBAAC,CAAAC,yCAAyB,EAAA,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,KAAM,KAAK,EAAA,CAAI,EACxE;AACJ,EAAE;AAEF,eAAe,CAAC,YAAY,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAElD,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAS9B;;AAEG;AACI,MAAM,eAAe,GAAG,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACa,KAAI;AACzB,IAAA,QACED,qBAAC,CAAAE,yCAAyB,EAAA,EAAC,SAAS,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,KAAM,KAAK,EAAA,CAAI,EACxE;AACJ,EAAE;AAEF;;AAEG;MACU,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE;AACxD,IAAA,IAAI,EAAE,eAAe;AACtB,CAAA;;;;"}
@@ -5,11 +5,11 @@ var index = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/nod
5
5
  var box_module = require('./box.module.css.cjs');
6
6
 
7
7
  // Note: This is the old component just copied in v1 folder as it is used in v1.
8
- // TODO: Remove this component and use the new one from @raystack/apsara/v1
9
8
  const box = index.cva(box_module.default.box);
10
- function Box({ children, className, ...props }) {
11
- return (jsxRuntime.jsxRuntimeExports.jsx("div", { className: box({ className }), ...props, children: children }));
9
+ function Box({ children, className, ref, ...props }) {
10
+ return (jsxRuntime.jsxRuntimeExports.jsx("div", { ref: ref, className: box({ className }), ...props, children: children }));
12
11
  }
12
+ Box.displayName = "Box";
13
13
 
14
14
  exports.Box = Box;
15
15
  //# sourceMappingURL=box.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"box.cjs","sources":["../../../../v1/components/box/box.tsx"],"sourcesContent":["import { cva, VariantProps } from \"class-variance-authority\";\nimport { HTMLAttributes, PropsWithChildren } from \"react\";\n\nimport styles from \"./box.module.css\";\n\n// Note: This is the old component just copied in v1 folder as it is used in v1. \n// TODO: Remove this component and use the new one from @raystack/apsara/v1\nconst box = cva(styles.box);\n\ntype BoxProps = PropsWithChildren<VariantProps<typeof box>> &\n HTMLAttributes<HTMLDivElement>;\n\nexport function Box({ children, className, ...props }: BoxProps) {\n return (\n <div className={box({ className })} {...props}>\n {children}\n </div>\n );\n}\n"],"names":["cva","styles","_jsx"],"mappings":";;;;;;AAKA;AACA;AACA,MAAM,GAAG,GAAGA,SAAG,CAACC,kBAAM,CAAC,GAAG,CAAC,CAAC;AAKtB,SAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAY,EAAA;AAC7D,IAAA,QACEC,gCAAK,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,GAAG,CAAC,EAAE,SAAS,EAAE,CAAC,KAAM,KAAK,EAAA,QAAA,EAC1C,QAAQ,EAAA,CACL,EACN;AACJ;;;;"}
1
+ {"version":3,"file":"box.cjs","sources":["../../../../v1/components/box/box.tsx"],"sourcesContent":["import { cva, VariantProps } from \"class-variance-authority\";\nimport { HTMLAttributes, PropsWithChildren, forwardRef } from \"react\";\n\nimport styles from \"./box.module.css\";\n\n// Note: This is the old component just copied in v1 folder as it is used in v1. \n\nconst box = cva(styles.box);\n\ntype BoxProps = PropsWithChildren<VariantProps<typeof box>> &\n HTMLAttributes<HTMLDivElement> & {\n ref?: React.RefObject<HTMLDivElement>;\n };\n\nexport function Box({ children, className, ref, ...props }: BoxProps) {\n return (\n <div ref={ref} className={box({ className })} {...props}>\n {children}\n </div>\n );\n}\n\nBox.displayName = \"Box\";\n"],"names":["cva","styles","_jsx"],"mappings":";;;;;;AAKA;AAEA,MAAM,GAAG,GAAGA,SAAG,CAACC,kBAAM,CAAC,GAAG,CAAC,CAAC;AAOZ,SAAA,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAY,EAAA;IAClE,QACEC,0CAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,SAAS,EAAE,CAAC,EAAM,GAAA,KAAK,YACpD,QAAQ,EAAA,CACL,EACN;AACJ,CAAC;AAED,GAAG,CAAC,WAAW,GAAG,KAAK;;;;"}
@@ -1,7 +1,12 @@
1
1
  import { VariantProps } from "class-variance-authority";
2
2
  import { HTMLAttributes, PropsWithChildren } from "react";
3
3
  declare const box: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
4
- type BoxProps = PropsWithChildren<VariantProps<typeof box>> & HTMLAttributes<HTMLDivElement>;
5
- export declare function Box({ children, className, ...props }: BoxProps): import("react/jsx-runtime").JSX.Element;
4
+ type BoxProps = PropsWithChildren<VariantProps<typeof box>> & HTMLAttributes<HTMLDivElement> & {
5
+ ref?: React.RefObject<HTMLDivElement>;
6
+ };
7
+ export declare function Box({ children, className, ref, ...props }: BoxProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare namespace Box {
9
+ var displayName: string;
10
+ }
6
11
  export {};
7
12
  //# sourceMappingURL=box.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../../../../v1/components/box/box.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAM1D,QAAA,MAAM,GAAG,yFAAkB,CAAC;AAE5B,KAAK,QAAQ,GAAG,iBAAiB,CAAC,YAAY,CAAC,OAAO,GAAG,CAAC,CAAC,GACzD,cAAc,CAAC,cAAc,CAAC,CAAC;AAEjC,wBAAgB,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,QAAQ,2CAM9D"}
1
+ {"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../../../../v1/components/box/box.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAc,MAAM,OAAO,CAAC;AAMtE,QAAA,MAAM,GAAG,yFAAkB,CAAC;AAE5B,KAAK,QAAQ,GAAG,iBAAiB,CAAC,YAAY,CAAC,OAAO,GAAG,CAAC,CAAC,GACzD,cAAc,CAAC,cAAc,CAAC,GAAG;IAC/B,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;CACvC,CAAC;AAEJ,wBAAgB,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,QAAQ,2CAMnE;yBANe,GAAG"}
@@ -3,11 +3,11 @@ import { cva } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/nod
3
3
  import styles from './box.module.css.js';
4
4
 
5
5
  // Note: This is the old component just copied in v1 folder as it is used in v1.
6
- // TODO: Remove this component and use the new one from @raystack/apsara/v1
7
6
  const box = cva(styles.box);
8
- function Box({ children, className, ...props }) {
9
- return (jsxRuntimeExports.jsx("div", { className: box({ className }), ...props, children: children }));
7
+ function Box({ children, className, ref, ...props }) {
8
+ return (jsxRuntimeExports.jsx("div", { ref: ref, className: box({ className }), ...props, children: children }));
10
9
  }
10
+ Box.displayName = "Box";
11
11
 
12
12
  export { Box };
13
13
  //# sourceMappingURL=box.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"box.js","sources":["../../../../v1/components/box/box.tsx"],"sourcesContent":["import { cva, VariantProps } from \"class-variance-authority\";\nimport { HTMLAttributes, PropsWithChildren } from \"react\";\n\nimport styles from \"./box.module.css\";\n\n// Note: This is the old component just copied in v1 folder as it is used in v1. \n// TODO: Remove this component and use the new one from @raystack/apsara/v1\nconst box = cva(styles.box);\n\ntype BoxProps = PropsWithChildren<VariantProps<typeof box>> &\n HTMLAttributes<HTMLDivElement>;\n\nexport function Box({ children, className, ...props }: BoxProps) {\n return (\n <div className={box({ className })} {...props}>\n {children}\n </div>\n );\n}\n"],"names":["_jsx"],"mappings":";;;;AAKA;AACA;AACA,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAKtB,SAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAY,EAAA;AAC7D,IAAA,QACEA,qBAAK,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,GAAG,CAAC,EAAE,SAAS,EAAE,CAAC,KAAM,KAAK,EAAA,QAAA,EAC1C,QAAQ,EAAA,CACL,EACN;AACJ;;;;"}
1
+ {"version":3,"file":"box.js","sources":["../../../../v1/components/box/box.tsx"],"sourcesContent":["import { cva, VariantProps } from \"class-variance-authority\";\nimport { HTMLAttributes, PropsWithChildren, forwardRef } from \"react\";\n\nimport styles from \"./box.module.css\";\n\n// Note: This is the old component just copied in v1 folder as it is used in v1. \n\nconst box = cva(styles.box);\n\ntype BoxProps = PropsWithChildren<VariantProps<typeof box>> &\n HTMLAttributes<HTMLDivElement> & {\n ref?: React.RefObject<HTMLDivElement>;\n };\n\nexport function Box({ children, className, ref, ...props }: BoxProps) {\n return (\n <div ref={ref} className={box({ className })} {...props}>\n {children}\n </div>\n );\n}\n\nBox.displayName = \"Box\";\n"],"names":["_jsx"],"mappings":";;;;AAKA;AAEA,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAOZ,SAAA,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAY,EAAA;IAClE,QACEA,+BAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,SAAS,EAAE,CAAC,EAAM,GAAA,KAAK,YACpD,QAAQ,EAAA,CACL,EACN;AACJ,CAAC;AAED,GAAG,CAAC,WAAW,GAAG,KAAK;;;;"}
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
 
3
3
  var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
4
- var DayPicker = require('../../node_modules/.pnpm/react-day-picker@9.0.4_react@18.2.0/node_modules/react-day-picker/dist/esm/DayPicker.cjs');
4
+ var reactIcons_esm = require('../../node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.cjs');
5
+ var index$1 = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
5
6
  var React = require('react');
7
+ var DayPicker = require('../../node_modules/.pnpm/react-day-picker@9.0.4_react@18.2.0/node_modules/react-day-picker/dist/esm/DayPicker.cjs');
6
8
  require('../../node_modules/.pnpm/react-day-picker@9.0.4_react@18.2.0/node_modules/react-day-picker/dist/esm/useDayPicker.cjs');
7
9
  var dateLib = require('../../node_modules/.pnpm/react-day-picker@9.0.4_react@18.2.0/node_modules/react-day-picker/dist/esm/lib/dateLib.cjs');
8
10
  require('../../node_modules/.pnpm/react-day-picker@9.0.4_react@18.2.0/node_modules/react-day-picker/dist/esm/UI.cjs');
9
- var index$1 = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
10
- var reactIcons_esm = require('../../node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.cjs');
11
- var calendar_module = require('./calendar.module.css.cjs');
12
- var select = require('../select/select.cjs');
11
+ var index = require('../../node_modules/.pnpm/react-loading-skeleton@3.4.0_react@18.2.0/node_modules/react-loading-skeleton/dist/index.cjs');
13
12
  var flex = require('../flex/flex.cjs');
13
+ var select = require('../select/select.cjs');
14
14
  var tooltip = require('../tooltip/tooltip.cjs');
15
- var index = require('../../node_modules/.pnpm/react-loading-skeleton@3.4.0_react@18.2.0/node_modules/react-loading-skeleton/dist/index.cjs');
15
+ var calendar_module = require('./calendar.module.css.cjs');
16
16
 
17
17
  const root = index$1.cva(calendar_module.default.calendarRoot);
18
18
  function DropDown({ options = [], value, onChange, onDropdownOpen, }) {
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.cjs","sources":["../../../../v1/components/calendar/calendar.tsx"],"sourcesContent":["import {\n dateLib,\n DayPicker,\n DayPickerProps,\n DropdownProps,\n} from 'react-day-picker';\nimport { cva } from 'class-variance-authority';\nimport {\n ChevronRightIcon,\n ChevronLeftIcon,\n ChevronUpIcon,\n ChevronDownIcon,\n} from '@radix-ui/react-icons';\nimport styles from './calendar.module.css';\nimport { Select } from '../select';\nimport { ChangeEvent, useEffect, useState } from 'react';\nimport { Flex } from '../flex/flex';\nimport { Tooltip } from '../tooltip';\n\nimport Skeleton from 'react-loading-skeleton';\n\ninterface OnDropdownOpen {\n onDropdownOpen?: VoidFunction;\n}\n\ninterface CalendarPropsExtended {\n showTooltip?: boolean;\n tooltipMessages?: { [key: string]: any };\n loadingData?: boolean;\n}\n\nexport type CalendarProps = DayPickerProps &\n OnDropdownOpen &\n CalendarPropsExtended;\n\nconst root = cva(styles.calendarRoot);\n\nfunction DropDown({\n options = [],\n value,\n onChange,\n onDropdownOpen,\n}: DropdownProps & OnDropdownOpen) {\n const [open, setOpen] = useState(false);\n\n useEffect(() => {\n if (open && onDropdownOpen) onDropdownOpen();\n }, [open]);\n\n function handleChange(value: string) {\n if (onChange) {\n onChange({ target: { value } } as ChangeEvent<HTMLSelectElement>);\n }\n }\n\n return (\n <Select\n value={value?.toString()}\n onValueChange={handleChange}\n open={open}\n onOpenChange={setOpen}\n >\n <Select.Trigger\n className={styles.dropdown_trigger}\n iconProps={{\n className: styles.dropdown_icon,\n }}\n >\n <Select.Value />\n </Select.Trigger>\n <Select.Content className={styles.dropdown_content}>\n <Select.ScrollUpButton asChild>\n <Flex justify={'center'}>\n <ChevronUpIcon />\n </Flex>\n </Select.ScrollUpButton>\n <Select.Viewport>\n {options.map((opt) => (\n <Select.Item\n value={opt.value.toString()}\n key={opt.value}\n disabled={opt.disabled}\n textProps={{\n className: styles.dropdown_item_text,\n }}\n >\n {opt.label}\n </Select.Item>\n ))}\n </Select.Viewport>\n <Select.ScrollDownButton asChild>\n <Flex justify={'center'}>\n <ChevronDownIcon />\n </Flex>\n </Select.ScrollDownButton>\n </Select.Content>\n </Select>\n );\n}\n\nexport const Calendar = function ({\n className,\n classNames,\n showOutsideDays = true,\n onDropdownOpen,\n showTooltip = false,\n tooltipMessages = {},\n loadingData = false,\n ...props\n}: CalendarProps) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n components={{\n Chevron: (props) => {\n if (props.orientation === 'left') {\n return <ChevronLeftIcon {...props} />;\n }\n return <ChevronRightIcon {...props} />;\n },\n Dropdown: (props: DropdownProps) => (\n <DropDown {...props} onDropdownOpen={onDropdownOpen} />\n ),\n DayButton: (props) => {\n const { day, ...buttonProps } = props;\n const message =\n tooltipMessages[dateLib.format(day.date, 'dd-MM-yyyy')];\n return (\n <Tooltip\n side=\"top\"\n disabled={loadingData || !showTooltip || !message}\n message={message}\n >\n <button {...buttonProps} />\n </Tooltip>\n );\n },\n MonthGrid: (props) =>\n loadingData ? (\n <Skeleton\n count={6}\n height={'12px'}\n width={'252px'}\n style={{ marginBottom: 'var(--space-5)' }}\n highlightColor=\"var(--background-base)\"\n baseColor=\"var(--background-base-hover)\"\n />\n ) : (\n <table {...props} />\n ),\n }}\n classNames={{\n caption_label: styles.caption_label,\n button_previous: `${styles.nav_button} ${styles.nav_button_previous}`,\n button_next: `${styles.nav_button} ${styles.nav_button_next}`,\n month_caption: styles.month_caption,\n months: styles.months,\n nav: styles.nav,\n day: styles.day,\n today: styles.today,\n outside: styles.outside,\n week: styles.week,\n weekdays: styles.week,\n weekday: styles.weekday,\n disabled: styles.disabled,\n selected: styles.selected,\n day_button: styles.day_button,\n range_middle: styles.range_middle,\n range_end: styles.range_end,\n range_start: styles.range_start,\n hidden: styles.hidden,\n dropdowns: styles.dropdowns,\n ...classNames,\n }}\n className={root({ className })}\n mode=\"single\"\n {...props}\n />\n );\n};\n"],"names":["cva","styles","useState","useEffect","_jsxs","Select","_jsx","Flex","ChevronUpIcon","ChevronDownIcon","DayPicker","ChevronLeftIcon","ChevronRightIcon","dateLib","Tooltip","Skeleton"],"mappings":";;;;;;;;;;;;;;;;AAmCA,MAAM,IAAI,GAAGA,WAAG,CAACC,uBAAM,CAAC,YAAY,CAAC,CAAC;AAEtC,SAAS,QAAQ,CAAC,EAChB,OAAO,GAAG,EAAE,EACZ,KAAK,EACL,QAAQ,EACR,cAAc,GACiB,EAAA;IAC/B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAGC,cAAQ,CAAC,KAAK,CAAC,CAAC;IAExCC,eAAS,CAAC,MAAK;QACb,IAAI,IAAI,IAAI,cAAc;AAAE,YAAA,cAAc,EAAE,CAAC;AAC/C,KAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,SAAS,YAAY,CAAC,KAAa,EAAA;QACjC,IAAI,QAAQ,EAAE;YACZ,QAAQ,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAoC,CAAC,CAAC;SACnE;K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EA,uBAAM,CAAC,SAAS;AAC3B,YAAA,GAAG,UAAU;AACd,SAAA,EACD,SAAS,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,EAC9B,IAAI,EAAC,QAAQ,EAAA,GACT,KAAK,EAAA,CACT,EACF;AACJ;;;;"}
1
+ {"version":3,"file":"calendar.cjs","sources":["../../../../v1/components/calendar/calendar.tsx"],"sourcesContent":["import {\n ChevronDownIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n ChevronUpIcon,\n} from '@radix-ui/react-icons';\nimport { cva } from 'class-variance-authority';\nimport { ChangeEvent, useEffect, useState } from 'react';\nimport {\n dateLib,\n DayPicker,\n DayPickerProps,\n DropdownProps,\n} from 'react-day-picker';\nimport Skeleton from 'react-loading-skeleton';\n\nimport { Flex } from '../flex/flex';\nimport { Select } from '../select';\nimport { Tooltip } from '../tooltip';\nimport styles from './calendar.module.css';\n\ninterface OnDropdownOpen {\n onDropdownOpen?: VoidFunction;\n}\n\ninterface CalendarPropsExtended {\n showTooltip?: boolean;\n tooltipMessages?: { [key: string]: any };\n loadingData?: boolean;\n}\n\nexport type CalendarProps = DayPickerProps &\n OnDropdownOpen &\n CalendarPropsExtended;\n\nconst root = cva(styles.calendarRoot);\n\nfunction DropDown({\n options = [],\n value,\n onChange,\n onDropdownOpen,\n}: DropdownProps & OnDropdownOpen) {\n const [open, setOpen] = useState(false);\n\n useEffect(() => {\n if (open && onDropdownOpen) onDropdownOpen();\n }, [open]);\n\n function handleChange(value: string) {\n if (onChange) {\n onChange({ target: { value } } as ChangeEvent<HTMLSelectElement>);\n }\n }\n\n return (\n <Select\n value={value?.toString()}\n onValueChange={handleChange}\n open={open}\n onOpenChange={setOpen}\n >\n <Select.Trigger\n className={styles.dropdown_trigger}\n iconProps={{\n className: styles.dropdown_icon,\n }}\n >\n <Select.Value />\n </Select.Trigger>\n <Select.Content className={styles.dropdown_content}>\n <Select.ScrollUpButton asChild>\n <Flex justify={'center'}>\n <ChevronUpIcon />\n </Flex>\n </Select.ScrollUpButton>\n <Select.Viewport>\n {options.map((opt) => (\n <Select.Item\n value={opt.value.toString()}\n key={opt.value}\n disabled={opt.disabled}\n textProps={{\n className: styles.dropdown_item_text,\n }}\n >\n {opt.label}\n </Select.Item>\n ))}\n </Select.Viewport>\n <Select.ScrollDownButton asChild>\n <Flex justify={'center'}>\n <ChevronDownIcon />\n </Flex>\n </Select.ScrollDownButton>\n </Select.Content>\n </Select>\n );\n}\n\nexport const Calendar = function ({\n className,\n classNames,\n showOutsideDays = true,\n onDropdownOpen,\n showTooltip = false,\n tooltipMessages = {},\n loadingData = false,\n ...props\n}: CalendarProps) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n components={{\n Chevron: (props) => {\n if (props.orientation === 'left') {\n return <ChevronLeftIcon {...props} />;\n }\n return <ChevronRightIcon {...props} />;\n },\n Dropdown: (props: DropdownProps) => (\n <DropDown {...props} onDropdownOpen={onDropdownOpen} />\n ),\n DayButton: (props) => {\n const { day, ...buttonProps } = props;\n const message =\n tooltipMessages[dateLib.format(day.date, 'dd-MM-yyyy')];\n return (\n <Tooltip\n side=\"top\"\n disabled={loadingData || !showTooltip || !message}\n message={message}\n >\n <button {...buttonProps} />\n </Tooltip>\n );\n },\n MonthGrid: (props) =>\n loadingData ? (\n <Skeleton\n count={6}\n height={'12px'}\n width={'252px'}\n style={{ marginBottom: 'var(--space-5)' }}\n highlightColor=\"var(--background-base)\"\n baseColor=\"var(--background-base-hover)\"\n />\n ) : (\n <table {...props} />\n ),\n }}\n classNames={{\n caption_label: styles.caption_label,\n button_previous: `${styles.nav_button} ${styles.nav_button_previous}`,\n button_next: `${styles.nav_button} ${styles.nav_button_next}`,\n month_caption: styles.month_caption,\n months: styles.months,\n nav: styles.nav,\n day: styles.day,\n today: styles.today,\n outside: styles.outside,\n week: styles.week,\n weekdays: styles.week,\n weekday: styles.weekday,\n disabled: styles.disabled,\n selected: styles.selected,\n day_button: styles.day_button,\n range_middle: styles.range_middle,\n range_end: styles.range_end,\n range_start: styles.range_start,\n hidden: styles.hidden,\n dropdowns: styles.dropdowns,\n ...classNames,\n }}\n className={root({ className })}\n mode=\"single\"\n {...props}\n />\n );\n};\n"],"names":["cva","styles","useState","useEffect","_jsxs","Select","_jsx","Flex","ChevronUpIcon","ChevronDownIcon","DayPicker","ChevronLeftIcon","ChevronRightIcon","dateLib","Tooltip","Skeleton"],"mappings":";;;;;;;;;;;;;;;;AAmCA,MAAM,IAAI,GAAGA,WAAG,CAACC,uBAAM,CAAC,YAAY,CAAC,CAAC;AAEtC,SAAS,QAAQ,CAAC,EAChB,OAAO,GAAG,EAAE,EACZ,KAAK,EACL,QAAQ,EACR,cAAc,GACiB,EAAA;IAC/B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAGC,cAAQ,CAAC,KAAK,CAAC,CAAC;IAExCC,eAAS,CAAC,MAAK;QACb,IAAI,IAAI,IAAI,cAAc;AAAE,YAAA,cAAc,EAAE,CAAC;AAC/C,KAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,SAAS,YAAY,CAAC,KAAa,EAAA;QACjC,IAAI,QAAQ,EAAE;YACZ,QAAQ,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAoC,CAAC,CAAC;SACnE;KACF;AAED,IAAA,QACEC,iCAAA,CAACC,aAAM,EAAA,EACL,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,EACxB,aAAa,EAAE,YAAY,EAC3B,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,OAAO,EAErB,QAAA,EAAA,CAAAC,gCAAA,CAACD,aAAM,CAAC,OAAO,EACb,EAAA,SAAS,EAAEJ,uBAAM,CAAC,gBAAgB,EAClC,SAAS,EAAE;oBACT,SAAS,EAAEA,uBAAM,CAAC,aAAa;AAChC,iBAAA,EAAA,QAAA,EAEDK,gCAAC,CAAAD,aAAM,CAAC,KAAK,KAAG,EACD,CAAA,EACjBD,iCAAC,CAAAC,aAAM,CAA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EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,MAAM,aAAa,GAAG,cAAc,GACxC,cAAc,GACd,qBAAqB,CAAC;AAmExB,eAAO,MAAM,QAAQ,oHASlB,aAAa,4CAsEf,CAAC"}
1
+ {"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../../v1/components/calendar/calendar.tsx"],"names":[],"mappings":"AAQA,OAAO,EAGL,cAAc,EAEf,MAAM,kBAAkB,CAAC;AAQ1B,UAAU,cAAc;IACtB,cAAc,CAAC,EAAE,YAAY,CAAC;CAC/B;AAED,UAAU,qBAAqB;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,MAAM,aAAa,GAAG,cAAc,GACxC,cAAc,GACd,qBAAqB,CAAC;AAmExB,eAAO,MAAM,QAAQ,oHASlB,aAAa,4CAsEf,CAAC"}
@@ -1,16 +1,16 @@
1
1
  import { j as jsxRuntimeExports } from '../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js';
2
- import { DayPicker } from '../../node_modules/.pnpm/react-day-picker@9.0.4_react@18.2.0/node_modules/react-day-picker/dist/esm/DayPicker.js';
2
+ import { ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronDownIcon } from '../../node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js';
3
+ import { cva } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
3
4
  import { useState, useEffect } from 'react';
5
+ import { DayPicker } from '../../node_modules/.pnpm/react-day-picker@9.0.4_react@18.2.0/node_modules/react-day-picker/dist/esm/DayPicker.js';
4
6
  import '../../node_modules/.pnpm/react-day-picker@9.0.4_react@18.2.0/node_modules/react-day-picker/dist/esm/useDayPicker.js';
5
7
  import { dateLib } from '../../node_modules/.pnpm/react-day-picker@9.0.4_react@18.2.0/node_modules/react-day-picker/dist/esm/lib/dateLib.js';
6
8
  import '../../node_modules/.pnpm/react-day-picker@9.0.4_react@18.2.0/node_modules/react-day-picker/dist/esm/UI.js';
7
- import { cva } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
8
- import { ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronDownIcon } from '../../node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js';
9
- import styles from './calendar.module.css.js';
10
- import { Select } from '../select/select.js';
9
+ import Skeleton from '../../node_modules/.pnpm/react-loading-skeleton@3.4.0_react@18.2.0/node_modules/react-loading-skeleton/dist/index.js';
11
10
  import { Flex } from '../flex/flex.js';
11
+ import { Select } from '../select/select.js';
12
12
  import { Tooltip } from '../tooltip/tooltip.js';
13
- import Skeleton from '../../node_modules/.pnpm/react-loading-skeleton@3.4.0_react@18.2.0/node_modules/react-loading-skeleton/dist/index.js';
13
+ import styles from './calendar.module.css.js';
14
14
 
15
15
  const root = cva(styles.calendarRoot);
16
16
  function DropDown({ options = [], value, onChange, onDropdownOpen, }) {
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.js","sources":["../../../../v1/components/calendar/calendar.tsx"],"sourcesContent":["import {\n dateLib,\n DayPicker,\n DayPickerProps,\n DropdownProps,\n} from 'react-day-picker';\nimport { cva } from 'class-variance-authority';\nimport {\n ChevronRightIcon,\n ChevronLeftIcon,\n ChevronUpIcon,\n ChevronDownIcon,\n} from '@radix-ui/react-icons';\nimport styles from './calendar.module.css';\nimport { Select } from '../select';\nimport { ChangeEvent, useEffect, useState } from 'react';\nimport { Flex } from '../flex/flex';\nimport { Tooltip } from '../tooltip';\n\nimport Skeleton from 'react-loading-skeleton';\n\ninterface OnDropdownOpen {\n onDropdownOpen?: VoidFunction;\n}\n\ninterface CalendarPropsExtended {\n showTooltip?: boolean;\n tooltipMessages?: { [key: string]: any };\n loadingData?: boolean;\n}\n\nexport type CalendarProps = DayPickerProps &\n OnDropdownOpen &\n CalendarPropsExtended;\n\nconst root = cva(styles.calendarRoot);\n\nfunction DropDown({\n options = [],\n value,\n onChange,\n onDropdownOpen,\n}: DropdownProps & OnDropdownOpen) {\n const [open, setOpen] = useState(false);\n\n useEffect(() => {\n if (open && onDropdownOpen) onDropdownOpen();\n }, [open]);\n\n function handleChange(value: string) {\n if (onChange) {\n onChange({ target: { value } } as ChangeEvent<HTMLSelectElement>);\n }\n }\n\n return (\n <Select\n value={value?.toString()}\n onValueChange={handleChange}\n open={open}\n onOpenChange={setOpen}\n >\n <Select.Trigger\n className={styles.dropdown_trigger}\n iconProps={{\n className: styles.dropdown_icon,\n }}\n >\n <Select.Value />\n </Select.Trigger>\n <Select.Content className={styles.dropdown_content}>\n <Select.ScrollUpButton asChild>\n <Flex justify={'center'}>\n <ChevronUpIcon />\n </Flex>\n </Select.ScrollUpButton>\n <Select.Viewport>\n {options.map((opt) => (\n <Select.Item\n value={opt.value.toString()}\n key={opt.value}\n disabled={opt.disabled}\n textProps={{\n className: styles.dropdown_item_text,\n }}\n >\n {opt.label}\n </Select.Item>\n ))}\n </Select.Viewport>\n <Select.ScrollDownButton asChild>\n <Flex justify={'center'}>\n <ChevronDownIcon />\n </Flex>\n </Select.ScrollDownButton>\n </Select.Content>\n </Select>\n );\n}\n\nexport const Calendar = function ({\n className,\n classNames,\n showOutsideDays = true,\n onDropdownOpen,\n showTooltip = false,\n tooltipMessages = {},\n loadingData = false,\n ...props\n}: CalendarProps) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n components={{\n Chevron: (props) => {\n if (props.orientation === 'left') {\n return <ChevronLeftIcon {...props} />;\n }\n return <ChevronRightIcon {...props} />;\n },\n Dropdown: (props: DropdownProps) => (\n <DropDown {...props} onDropdownOpen={onDropdownOpen} />\n ),\n DayButton: (props) => {\n const { day, ...buttonProps } = props;\n const message =\n tooltipMessages[dateLib.format(day.date, 'dd-MM-yyyy')];\n return (\n <Tooltip\n side=\"top\"\n disabled={loadingData || !showTooltip || !message}\n message={message}\n >\n <button {...buttonProps} />\n </Tooltip>\n );\n },\n MonthGrid: (props) =>\n loadingData ? (\n <Skeleton\n count={6}\n height={'12px'}\n width={'252px'}\n style={{ marginBottom: 'var(--space-5)' }}\n highlightColor=\"var(--background-base)\"\n baseColor=\"var(--background-base-hover)\"\n />\n ) : (\n <table {...props} />\n ),\n }}\n classNames={{\n caption_label: styles.caption_label,\n button_previous: `${styles.nav_button} ${styles.nav_button_previous}`,\n button_next: `${styles.nav_button} ${styles.nav_button_next}`,\n month_caption: styles.month_caption,\n months: styles.months,\n nav: styles.nav,\n day: styles.day,\n today: styles.today,\n outside: styles.outside,\n week: styles.week,\n weekdays: styles.week,\n weekday: styles.weekday,\n disabled: styles.disabled,\n selected: styles.selected,\n day_button: styles.day_button,\n range_middle: styles.range_middle,\n range_end: styles.range_end,\n range_start: styles.range_start,\n hidden: styles.hidden,\n dropdowns: styles.dropdowns,\n ...classNames,\n }}\n className={root({ className })}\n mode=\"single\"\n {...props}\n />\n );\n};\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;AAmCA,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAEtC,SAAS,QAAQ,CAAC,EAChB,OAAO,GAAG,EAAE,EACZ,KAAK,EACL,QAAQ,EACR,cAAc,GACiB,EAAA;IAC/B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAExC,SAAS,CAAC,MAAK;QACb,IAAI,IAAI,IAAI,cAAc;AAAE,YAAA,cAAc,EAA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AS,EAAE,MAAM,CAAC,SAAS;YAC3B,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,SAAS,EAAE,MAAM,CAAC,SAAS;AAC3B,YAAA,GAAG,UAAU;AACd,SAAA,EACD,SAAS,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,EAC9B,IAAI,EAAC,QAAQ,EAAA,GACT,KAAK,EAAA,CACT,EACF;AACJ;;;;"}
1
+ {"version":3,"file":"calendar.js","sources":["../../../../v1/components/calendar/calendar.tsx"],"sourcesContent":["import {\n ChevronDownIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n ChevronUpIcon,\n} from '@radix-ui/react-icons';\nimport { cva } from 'class-variance-authority';\nimport { ChangeEvent, useEffect, useState } from 'react';\nimport {\n dateLib,\n DayPicker,\n DayPickerProps,\n DropdownProps,\n} from 'react-day-picker';\nimport Skeleton from 'react-loading-skeleton';\n\nimport { Flex } from '../flex/flex';\nimport { Select } from '../select';\nimport { Tooltip } from '../tooltip';\nimport styles from './calendar.module.css';\n\ninterface OnDropdownOpen {\n onDropdownOpen?: VoidFunction;\n}\n\ninterface CalendarPropsExtended {\n showTooltip?: boolean;\n tooltipMessages?: { [key: string]: any };\n loadingData?: boolean;\n}\n\nexport type CalendarProps = DayPickerProps &\n OnDropdownOpen &\n CalendarPropsExtended;\n\nconst root = cva(styles.calendarRoot);\n\nfunction DropDown({\n options = [],\n value,\n onChange,\n onDropdownOpen,\n}: DropdownProps & OnDropdownOpen) {\n const [open, setOpen] = useState(false);\n\n useEffect(() => {\n if (open && onDropdownOpen) onDropdownOpen();\n }, [open]);\n\n function handleChange(value: string) {\n if (onChange) {\n onChange({ target: { value } } as ChangeEvent<HTMLSelectElement>);\n }\n }\n\n return (\n <Select\n value={value?.toString()}\n onValueChange={handleChange}\n open={open}\n onOpenChange={setOpen}\n >\n <Select.Trigger\n className={styles.dropdown_trigger}\n iconProps={{\n className: styles.dropdown_icon,\n }}\n >\n <Select.Value />\n </Select.Trigger>\n <Select.Content className={styles.dropdown_content}>\n <Select.ScrollUpButton asChild>\n <Flex justify={'center'}>\n <ChevronUpIcon />\n </Flex>\n </Select.ScrollUpButton>\n <Select.Viewport>\n {options.map((opt) => (\n <Select.Item\n value={opt.value.toString()}\n key={opt.value}\n disabled={opt.disabled}\n textProps={{\n className: styles.dropdown_item_text,\n }}\n >\n {opt.label}\n </Select.Item>\n ))}\n </Select.Viewport>\n <Select.ScrollDownButton asChild>\n <Flex justify={'center'}>\n <ChevronDownIcon />\n </Flex>\n </Select.ScrollDownButton>\n </Select.Content>\n </Select>\n );\n}\n\nexport const Calendar = function ({\n className,\n classNames,\n showOutsideDays = true,\n onDropdownOpen,\n showTooltip = false,\n tooltipMessages = {},\n loadingData = false,\n ...props\n}: CalendarProps) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n components={{\n Chevron: (props) => {\n if (props.orientation === 'left') {\n return <ChevronLeftIcon {...props} />;\n }\n return <ChevronRightIcon {...props} />;\n },\n Dropdown: (props: DropdownProps) => (\n <DropDown {...props} onDropdownOpen={onDropdownOpen} />\n ),\n DayButton: (props) => {\n const { day, ...buttonProps } = props;\n const message =\n tooltipMessages[dateLib.format(day.date, 'dd-MM-yyyy')];\n return (\n <Tooltip\n side=\"top\"\n disabled={loadingData || !showTooltip || !message}\n message={message}\n >\n <button {...buttonProps} />\n </Tooltip>\n );\n },\n MonthGrid: (props) =>\n loadingData ? (\n <Skeleton\n count={6}\n height={'12px'}\n width={'252px'}\n style={{ marginBottom: 'var(--space-5)' }}\n highlightColor=\"var(--background-base)\"\n baseColor=\"var(--background-base-hover)\"\n />\n ) : (\n <table {...props} />\n ),\n }}\n classNames={{\n caption_label: styles.caption_label,\n button_previous: `${styles.nav_button} ${styles.nav_button_previous}`,\n button_next: `${styles.nav_button} ${styles.nav_button_next}`,\n month_caption: styles.month_caption,\n months: styles.months,\n nav: styles.nav,\n day: styles.day,\n today: styles.today,\n outside: styles.outside,\n week: styles.week,\n weekdays: styles.week,\n weekday: styles.weekday,\n disabled: styles.disabled,\n selected: styles.selected,\n day_button: styles.day_button,\n range_middle: styles.range_middle,\n range_end: styles.range_end,\n range_start: styles.range_start,\n hidden: styles.hidden,\n dropdowns: styles.dropdowns,\n ...classNames,\n }}\n className={root({ className })}\n mode=\"single\"\n {...props}\n />\n );\n};\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;AAmCA,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAEtC,SAAS,QAAQ,CAAC,EAChB,OAAO,GAAG,EAAE,EACZ,KAAK,EACL,QAAQ,EACR,cAAc,GACiB,EAAA;IAC/B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAExC,SAAS,CAAC,MAAK;QACb,IAAI,IAAI,IAAI,cAAc;AAAE,YAAA,cAAc,EAAE,CAAC;AAC/C,KAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,SAAS,YAAY,CAAC,KAAa,EAAA;QACjC,IAAI,QAAQ,EAAE;YACZ,QAAQ,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAoC,CAAC,CAAC;SACnE;KACF;AAED,IAAA,QACEA,sBAAA,CAAC,MAAM,EAAA,EACL,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,EACxB,aAAa,EAAE,YAAY,EAC3B,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,OAAO,EAErB,QAAA,EAAA,CAAAC,qBAAA,CAAC,MAAM,CAAC,OAAO,EACb,EAAA,SAAS,EAAE,MAAM,CAAC,gBAAgB,EAClC,SAAS,EAAE;oBACT,SAAS,EAAE,MAAM,CAAC,aAAa;AAChC,iBAAA,EAAA,QAAA,EAEDA,qBAAC,CAAA,MAAM,CAAC,KAAK,KAAG,EACD,CAAA,EACjBD,sBAAC,CAAA,MAAM,CAAC,OA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,CAAC,mBAAmB,CAAE,CAAA;YACrE,WAAW,EAAE,GAAG,MAAM,CAAC,UAAU,CAAI,CAAA,EAAA,MAAM,CAAC,eAAe,CAAE,CAAA;YAC7D,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,GAAG,EAAE,MAAM,CAAC,GAAG;YACf,GAAG,EAAE,MAAM,CAAC,GAAG;YACf,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,QAAQ,EAAE,MAAM,CAAC,IAAI;YACrB,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,SAAS,EAAE,MAAM,CAAC,SAAS;AAC3B,YAAA,GAAG,UAAU;AACd,SAAA,EACD,SAAS,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,EAC9B,IAAI,EAAC,QAAQ,EAAA,GACT,KAAK,EAAA,CACT,EACF;AACJ;;;;"}
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var styles = {"calendarRoot":"calendar-module_calendarRoot__OZGQR","caption_label":"calendar-module_caption_label__8K7ZD","dropdowns":"calendar-module_dropdowns__0Uj8G","dropdown_trigger":"calendar-module_dropdown_trigger__HJ6Tm","dropdown_item_text":"calendar-module_dropdown_item_text__vUAKC","nav_button":"calendar-module_nav_button__tZDLw","nav_button_previous":"calendar-module_nav_button_previous__NVCfJ","nav_button_next":"calendar-module_nav_button_next__l1U08","months":"calendar-module_months__bBetg","nav":"calendar-module_nav__QMOu0","month_caption":"calendar-module_month_caption__pYPFz","day":"calendar-module_day__8eOAz","disabled":"calendar-module_disabled__ipw4l","outside":"calendar-module_outside__dbHbx","selected":"calendar-module_selected__TlwjL","range_middle":"calendar-module_range_middle__vn4Fr","range_start":"calendar-module_range_start__ErGPG","range_end":"calendar-module_range_end__K6oe-","week":"calendar-module_week__te1nD","day_button":"calendar-module_day_button__F4ayk","weekday":"calendar-module_weekday__H63mo","hidden":"calendar-module_hidden__5XuPD","calendarPopover":"calendar-module_calendarPopover__ykbVn","dropdown_icon":"calendar-module_dropdown_icon__J5WPO","dropdown_content":"calendar-module_dropdown_content__6KXfz","today":"calendar-module_today__HlNqe"};
5
+ var styles = {"calendarRoot":"calendar-module_calendarRoot__OZGQR","caption_label":"calendar-module_caption_label__8K7ZD","dropdowns":"calendar-module_dropdowns__0Uj8G","dropdown_trigger":"calendar-module_dropdown_trigger__HJ6Tm","dropdown_item_text":"calendar-module_dropdown_item_text__vUAKC","nav_button":"calendar-module_nav_button__tZDLw","nav_button_previous":"calendar-module_nav_button_previous__NVCfJ","nav_button_next":"calendar-module_nav_button_next__l1U08","months":"calendar-module_months__bBetg","nav":"calendar-module_nav__QMOu0","month_caption":"calendar-module_month_caption__pYPFz","day":"calendar-module_day__8eOAz","disabled":"calendar-module_disabled__ipw4l","outside":"calendar-module_outside__dbHbx","selected":"calendar-module_selected__TlwjL","range_middle":"calendar-module_range_middle__vn4Fr","range_start":"calendar-module_range_start__ErGPG","range_end":"calendar-module_range_end__K6oe-","week":"calendar-module_week__te1nD","day_button":"calendar-module_day_button__F4ayk","weekday":"calendar-module_weekday__H63mo","hidden":"calendar-module_hidden__5XuPD","calendarPopover":"calendar-module_calendarPopover__ykbVn","dropdown_icon":"calendar-module_dropdown_icon__J5WPO","dropdown_content":"calendar-module_dropdown_content__6KXfz","today":"calendar-module_today__HlNqe","datePickerInput":"calendar-module_datePickerInput__eVoid"};
6
6
 
7
7
  exports.default = styles;
8
8
  //# sourceMappingURL=calendar.module.css.cjs.map
@@ -1,4 +1,4 @@
1
- var styles = {"calendarRoot":"calendar-module_calendarRoot__OZGQR","caption_label":"calendar-module_caption_label__8K7ZD","dropdowns":"calendar-module_dropdowns__0Uj8G","dropdown_trigger":"calendar-module_dropdown_trigger__HJ6Tm","dropdown_item_text":"calendar-module_dropdown_item_text__vUAKC","nav_button":"calendar-module_nav_button__tZDLw","nav_button_previous":"calendar-module_nav_button_previous__NVCfJ","nav_button_next":"calendar-module_nav_button_next__l1U08","months":"calendar-module_months__bBetg","nav":"calendar-module_nav__QMOu0","month_caption":"calendar-module_month_caption__pYPFz","day":"calendar-module_day__8eOAz","disabled":"calendar-module_disabled__ipw4l","outside":"calendar-module_outside__dbHbx","selected":"calendar-module_selected__TlwjL","range_middle":"calendar-module_range_middle__vn4Fr","range_start":"calendar-module_range_start__ErGPG","range_end":"calendar-module_range_end__K6oe-","week":"calendar-module_week__te1nD","day_button":"calendar-module_day_button__F4ayk","weekday":"calendar-module_weekday__H63mo","hidden":"calendar-module_hidden__5XuPD","calendarPopover":"calendar-module_calendarPopover__ykbVn","dropdown_icon":"calendar-module_dropdown_icon__J5WPO","dropdown_content":"calendar-module_dropdown_content__6KXfz","today":"calendar-module_today__HlNqe"};
1
+ var styles = {"calendarRoot":"calendar-module_calendarRoot__OZGQR","caption_label":"calendar-module_caption_label__8K7ZD","dropdowns":"calendar-module_dropdowns__0Uj8G","dropdown_trigger":"calendar-module_dropdown_trigger__HJ6Tm","dropdown_item_text":"calendar-module_dropdown_item_text__vUAKC","nav_button":"calendar-module_nav_button__tZDLw","nav_button_previous":"calendar-module_nav_button_previous__NVCfJ","nav_button_next":"calendar-module_nav_button_next__l1U08","months":"calendar-module_months__bBetg","nav":"calendar-module_nav__QMOu0","month_caption":"calendar-module_month_caption__pYPFz","day":"calendar-module_day__8eOAz","disabled":"calendar-module_disabled__ipw4l","outside":"calendar-module_outside__dbHbx","selected":"calendar-module_selected__TlwjL","range_middle":"calendar-module_range_middle__vn4Fr","range_start":"calendar-module_range_start__ErGPG","range_end":"calendar-module_range_end__K6oe-","week":"calendar-module_week__te1nD","day_button":"calendar-module_day_button__F4ayk","weekday":"calendar-module_weekday__H63mo","hidden":"calendar-module_hidden__5XuPD","calendarPopover":"calendar-module_calendarPopover__ykbVn","dropdown_icon":"calendar-module_dropdown_icon__J5WPO","dropdown_content":"calendar-module_dropdown_content__6KXfz","today":"calendar-module_today__HlNqe","datePickerInput":"calendar-module_datePickerInput__eVoid"};
2
2
 
3
3
  export { styles as default };
4
4
  //# sourceMappingURL=calendar.module.css.js.map
@@ -1,17 +1,17 @@
1
1
  'use strict';
2
2
 
3
3
  var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
4
+ var reactIcons_esm = require('../../node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.cjs');
5
+ var dayjs_min = require('../../node_modules/.pnpm/dayjs@1.11.11/node_modules/dayjs/dayjs.min.cjs');
6
+ var customParseFormat = require('../../node_modules/.pnpm/dayjs@1.11.11/node_modules/dayjs/plugin/customParseFormat.cjs');
7
+ var React = require('react');
4
8
  var popover = require('../popover/popover.cjs');
5
9
  var textfield = require('../textfield/textfield.cjs');
6
10
  var calendar = require('./calendar.cjs');
7
11
  var calendar_module = require('./calendar.module.css.cjs');
8
- var React = require('react');
9
- var reactIcons_esm = require('../../node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.cjs');
10
- var dayjs_min = require('../../node_modules/.pnpm/dayjs@1.11.11/node_modules/dayjs/dayjs.min.cjs');
11
- var customParseFormat = require('../../node_modules/.pnpm/dayjs@1.11.11/node_modules/dayjs/plugin/customParseFormat.cjs');
12
12
 
13
13
  dayjs_min.default.extend(customParseFormat.default);
14
- function DatePicker({ side = "top", dateFormat = "DD/MM/YYYY", placeholder = "DD/MM/YYYY", textFieldProps, calendarProps, value = new Date(), onSelect = () => { }, children, }) {
14
+ function DatePicker({ side = "top", dateFormat = "DD/MM/YYYY", placeholder = "DD/MM/YYYY", textFieldProps, calendarProps, value = new Date(), onSelect = () => { }, children, showCalendarIcon = true, }) {
15
15
  const [showCalendar, setShowCalendar] = React.useState(false);
16
16
  const [selectedDate, setSelectedDate] = React.useState(value);
17
17
  const [inputState, setInputState] = React.useState();
@@ -105,7 +105,7 @@ function DatePicker({ side = "top", dateFormat = "DD/MM/YYYY", placeholder = "DD
105
105
  setInputState('invalid');
106
106
  }
107
107
  }
108
- const defaultTrigger = (jsxRuntime.jsxRuntimeExports.jsx(textfield.TextField, { ref: textFieldRef, defaultValue: formattedDate, trailing: jsxRuntime.jsxRuntimeExports.jsx(reactIcons_esm.CalendarIcon, {}), onChange: handleInputChange, onFocus: handleInputFocus, onBlur: handleInputBlur, state: inputState, placeholder: placeholder, onKeyUp: handleKeyUp, ...textFieldProps }));
108
+ const defaultTrigger = (jsxRuntime.jsxRuntimeExports.jsx(textfield.TextField, { ref: textFieldRef, defaultValue: formattedDate, trailing: showCalendarIcon ? jsxRuntime.jsxRuntimeExports.jsx(reactIcons_esm.CalendarIcon, {}) : undefined, onChange: handleInputChange, onFocus: handleInputFocus, onBlur: handleInputBlur, state: inputState, placeholder: placeholder, onKeyUp: handleKeyUp, className: calendar_module.default.datePickerInput, ...textFieldProps }));
109
109
  const trigger = typeof children === 'function'
110
110
  ? children({ selectedDate: formattedDate })
111
111
  : children || defaultTrigger;
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.cjs","sources":["../../../../v1/components/calendar/date-picker.tsx"],"sourcesContent":["import { Popover } from \"../popover\";\nimport { TextField } from \"../textfield\";\nimport { Calendar } from \"./calendar\";\nimport styles from \"./calendar.module.css\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { CalendarIcon } from \"@radix-ui/react-icons\";\nimport dayjs from \"dayjs\";\nimport { TextfieldProps } from \"../textfield/textfield\";\nimport { PropsBase, PropsSingleRequired } from \"react-day-picker\";\n\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\n\ndayjs.extend(customParseFormat);\n\ninterface DatePickerProps {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n dateFormat?: string;\n textFieldProps?: TextfieldProps;\n calendarProps?: PropsSingleRequired & PropsBase;\n onSelect?: (date: Date) => void;\n placeholder?: string;\n value?: Date;\n children?: React.ReactNode | ((props: { selectedDate: string }) => React.ReactNode);\n}\n\nexport function DatePicker({\n side = \"top\",\n dateFormat = \"DD/MM/YYYY\",\n placeholder = \"DD/MM/YYYY\",\n textFieldProps,\n calendarProps,\n value = new Date(),\n onSelect = () => {},\n children,\n}: DatePickerProps) {\n const [showCalendar, setShowCalendar] = useState(false);\n const [selectedDate, setSelectedDate] = useState(value);\n const [inputState, setInputState] = useState<Partial<React.ComponentProps<typeof TextField>['state']>>();\n\n const formattedDate = dayjs(selectedDate).format(dateFormat);\n\n const isDropdownOpenRef = useRef(false);\n const textFieldRef = useRef<HTMLInputElement | null>(null);\n const contentRef = useRef<HTMLDivElement | null>(null);\n const isInputFieldFocused = useRef(false);\n const selectedDateRef = useRef(selectedDate);\n\n useEffect(() => {\n selectedDateRef.current = selectedDate;\n }, [selectedDate]);\n\n function isElementOutside(el: HTMLElement) {\n return !isDropdownOpenRef.current && // Month and Year dropdown from Date picker\n !textFieldRef.current?.contains(el) && // TextField\n !contentRef.current?.contains(el);\n }\n\n const handleMouseDown = useCallback((event: MouseEvent) => {\n const el = (event.target) as HTMLElement | null;\n if (el && isElementOutside(el)) removeEventListeners();\n }, [])\n\n function registerEventListeners() {\n isInputFieldFocused.current = true;\n document.addEventListener('mouseup', handleMouseDown);\n }\n\n function removeEventListeners() {\n isInputFieldFocused.current = false;\n setShowCalendar(false);\n\n const updatedVal = dayjs(selectedDateRef.current).format(dateFormat);\n\n if (textFieldRef.current) textFieldRef.current.value = updatedVal;\n if (inputState === undefined) onSelect(dayjs(updatedVal).toDate());\n\n document.removeEventListener('mouseup', handleMouseDown);\n }\n\n const handleSelect = (day: Date) => {\n setSelectedDate(day);\n onSelect(day);\n setInputState(undefined);\n removeEventListeners();\n };\n\n function onDropdownOpen() {\n isDropdownOpenRef.current = true;\n }\n\n function onOpenChange(open?: boolean) {\n if (!isDropdownOpenRef.current && !(isInputFieldFocused.current && showCalendar)) {\n setShowCalendar(Boolean(open));\n }\n\n isDropdownOpenRef.current = false;\n }\n\n function handleInputFocus() {\n if (isInputFieldFocused.current) return;\n if (!showCalendar) setShowCalendar(true);\n }\n\n function handleInputBlur(event: React.FocusEvent) {\n if (isInputFieldFocused.current) {\n const el = event.relatedTarget as HTMLElement | null;\n if (el && isElementOutside(el)) removeEventListeners();\n } else {\n registerEventListeners();\n setTimeout(() => textFieldRef.current?.select());\n }\n }\n\n function handleKeyUp(event: React.KeyboardEvent) {\n if (event.code === 'Enter' && textFieldRef.current) {\n textFieldRef.current.blur();\n removeEventListeners();\n }\n }\n\n function handleInputChange(event: React.ChangeEvent<HTMLInputElement>) {\n const { value } = event.target;\n\n const format = value.includes(\"/\") ? \"DD/MM/YYYY\" : value.includes(\"-\") ? \"DD-MM-YYYY\" : undefined;\n const date = dayjs(value.replace(/(\\d{1,2})\\/(\\d{1,2})\\/(\\d{4})/, (_, day, month, year) => {\n\t\t\t\treturn `${day.padStart(2, '0')}/${month.padStart(2, '0')}/${year}`; // Replaces [8/8/2024] to [08/08/2024]\n\t\t}), format);\n\n const isValidDate = date.isValid();\n\n const isAfter = calendarProps?.startMonth !== undefined ? dayjs(date).isSameOrAfter(calendarProps.startMonth) : true;\n const isBefore = calendarProps?.endMonth !== undefined ? dayjs(date).isSameOrBefore(calendarProps.endMonth) : true;\n\n const isValid = isValidDate && isAfter && isBefore && dayjs(date).isSameOrBefore(dayjs());\n\n if (isValid) {\n setSelectedDate(date.toDate());\n if (inputState === 'invalid') setInputState(undefined);\n } else {\n setInputState('invalid');\n }\n }\n\n const defaultTrigger = (\n <TextField\n ref={textFieldRef}\n defaultValue={formattedDate}\n trailing={<CalendarIcon />}\n onChange={handleInputChange}\n onFocus={handleInputFocus}\n onBlur={handleInputBlur}\n state={inputState}\n placeholder={placeholder}\n onKeyUp={handleKeyUp}\n {...textFieldProps}\n />\n );\n\n const trigger = typeof children === 'function'\n ? children({ selectedDate: formattedDate })\n : children || defaultTrigger;\n\n return (\n <Popover open={showCalendar} onOpenChange={onOpenChange}>\n <Popover.Trigger asChild>\n {trigger}\n </Popover.Trigger>\n\n <Popover.Content side={side} className={styles.calendarPopover} ref={contentRef}>\n <Calendar\n required={true}\n {...calendarProps}\n onDropdownOpen={onDropdownOpen}\n mode=\"single\"\n selected={selectedDate}\n month={selectedDate}\n onSelect={handleSelect}\n onMonthChange={setSelectedDate}\n />\n </Popover.Content>\n </Popover>\n );\n}\n"],"names":["dayjs","customParseFormat","useState","useRef","useEffect","useCallback","_jsx","TextField","CalendarIcon","_jsxs","Popover","styles","Calendar"],"mappings":";;;;;;;;;;;;AAYAA,iBAAK,CAAC,MAAM,CAACC,yBAAiB,CAAC,CAAC;AAahB,SAAA,UAAU,CAAC,EACzB,IAAI,GAAG,KAAK,EACZ,UAAU,GAAG,YAAY,EACzB,WAAW,GAAG,YAAY,EAC1B,cAAc,EACd,aAAa,EACb,KAAK,GAAG,IAAI,IAAI,EAAE,EAClB,QAAQ,GAAG,MAAK,GAAG,EACnB,QAAQ,GACQ,EAAA;IAChB,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAGC,cAAQ,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAGA,cAAQ,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAGA,cAAQ,EAA4D,CAAC;IAEzG,MAAM,aAAa,GAAGF,iBAAK,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AAE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AS,EAAEC,uBAAM,CAAC,eAAe,EAAE,GAAG,EAAE,UAAU,YAC7EL,gCAAC,CAAAM,iBAAQ,EACP,EAAA,QAAQ,EAAE,IAAI,EAAA,GACV,aAAa,EACjB,cAAc,EAAE,cAAc,EAC9B,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,YAAY,EACtB,aAAa,EAAE,eAAe,GAC9B,EACc,CAAA,CAAA,EAAA,CACV,EACV;AACJ;;;;"}
1
+ {"version":3,"file":"date-picker.cjs","sources":["../../../../v1/components/calendar/date-picker.tsx"],"sourcesContent":["import { CalendarIcon } from \"@radix-ui/react-icons\";\nimport dayjs from \"dayjs\";\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { PropsBase, PropsSingleRequired } from \"react-day-picker\";\n\nimport { Popover } from \"../popover\";\nimport { TextField } from \"../textfield\";\nimport { TextfieldProps } from \"../textfield/textfield\";\nimport { Calendar } from \"./calendar\";\nimport styles from \"./calendar.module.css\";\n\ndayjs.extend(customParseFormat);\n\ninterface DatePickerProps {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n dateFormat?: string;\n textFieldProps?: TextfieldProps;\n calendarProps?: PropsSingleRequired & PropsBase;\n onSelect?: (date: Date) => void;\n placeholder?: string;\n value?: Date;\n children?: React.ReactNode | ((props: { selectedDate: string }) => React.ReactNode);\n showCalendarIcon?: boolean;\n}\n\nexport function DatePicker({\n side = \"top\",\n dateFormat = \"DD/MM/YYYY\",\n placeholder = \"DD/MM/YYYY\",\n textFieldProps,\n calendarProps,\n value = new Date(),\n onSelect = () => {},\n children,\n showCalendarIcon = true,\n}: DatePickerProps) {\n const [showCalendar, setShowCalendar] = useState(false);\n const [selectedDate, setSelectedDate] = useState(value);\n const [inputState, setInputState] = useState<Partial<React.ComponentProps<typeof TextField>['state']>>();\n\n const formattedDate = dayjs(selectedDate).format(dateFormat);\n\n const isDropdownOpenRef = useRef(false);\n const textFieldRef = useRef<HTMLInputElement | null>(null);\n const contentRef = useRef<HTMLDivElement | null>(null);\n const isInputFieldFocused = useRef(false);\n const selectedDateRef = useRef(selectedDate);\n\n useEffect(() => {\n selectedDateRef.current = selectedDate;\n }, [selectedDate]);\n\n function isElementOutside(el: HTMLElement) {\n return !isDropdownOpenRef.current && // Month and Year dropdown from Date picker\n !textFieldRef.current?.contains(el) && // TextField\n !contentRef.current?.contains(el);\n }\n\n const handleMouseDown = useCallback((event: MouseEvent) => {\n const el = (event.target) as HTMLElement | null;\n if (el && isElementOutside(el)) removeEventListeners();\n }, [])\n\n function registerEventListeners() {\n isInputFieldFocused.current = true;\n document.addEventListener('mouseup', handleMouseDown);\n }\n\n function removeEventListeners() {\n isInputFieldFocused.current = false;\n setShowCalendar(false);\n\n const updatedVal = dayjs(selectedDateRef.current).format(dateFormat);\n\n if (textFieldRef.current) textFieldRef.current.value = updatedVal;\n if (inputState === undefined) onSelect(dayjs(updatedVal).toDate());\n\n document.removeEventListener('mouseup', handleMouseDown);\n }\n\n const handleSelect = (day: Date) => {\n setSelectedDate(day);\n onSelect(day);\n setInputState(undefined);\n removeEventListeners();\n };\n\n function onDropdownOpen() {\n isDropdownOpenRef.current = true;\n }\n\n function onOpenChange(open?: boolean) {\n if (!isDropdownOpenRef.current && !(isInputFieldFocused.current && showCalendar)) {\n setShowCalendar(Boolean(open));\n }\n\n isDropdownOpenRef.current = false;\n }\n\n function handleInputFocus() {\n if (isInputFieldFocused.current) return;\n if (!showCalendar) setShowCalendar(true);\n }\n\n function handleInputBlur(event: React.FocusEvent) {\n if (isInputFieldFocused.current) {\n const el = event.relatedTarget as HTMLElement | null;\n if (el && isElementOutside(el)) removeEventListeners();\n } else {\n registerEventListeners();\n setTimeout(() => textFieldRef.current?.select());\n }\n }\n\n function handleKeyUp(event: React.KeyboardEvent) {\n if (event.code === 'Enter' && textFieldRef.current) {\n textFieldRef.current.blur();\n removeEventListeners();\n }\n }\n\n function handleInputChange(event: React.ChangeEvent<HTMLInputElement>) {\n const { value } = event.target;\n\n const format = value.includes(\"/\") ? \"DD/MM/YYYY\" : value.includes(\"-\") ? \"DD-MM-YYYY\" : undefined;\n const date = dayjs(value.replace(/(\\d{1,2})\\/(\\d{1,2})\\/(\\d{4})/, (_, day, month, year) => {\n\t\t\t\treturn `${day.padStart(2, '0')}/${month.padStart(2, '0')}/${year}`; // Replaces [8/8/2024] to [08/08/2024]\n\t\t}), format);\n\n const isValidDate = date.isValid();\n\n const isAfter = calendarProps?.startMonth !== undefined ? dayjs(date).isSameOrAfter(calendarProps.startMonth) : true;\n const isBefore = calendarProps?.endMonth !== undefined ? dayjs(date).isSameOrBefore(calendarProps.endMonth) : true;\n\n const isValid = isValidDate && isAfter && isBefore && dayjs(date).isSameOrBefore(dayjs());\n\n if (isValid) {\n setSelectedDate(date.toDate());\n if (inputState === 'invalid') setInputState(undefined);\n } else {\n setInputState('invalid');\n }\n }\n\n const defaultTrigger = (\n <TextField\n ref={textFieldRef}\n defaultValue={formattedDate}\n trailing={showCalendarIcon ? <CalendarIcon /> : undefined}\n onChange={handleInputChange}\n onFocus={handleInputFocus}\n onBlur={handleInputBlur}\n state={inputState}\n placeholder={placeholder}\n onKeyUp={handleKeyUp}\n className={styles.datePickerInput}\n {...textFieldProps}\n />\n );\n\n const trigger = typeof children === 'function'\n ? children({ selectedDate: formattedDate })\n : children || defaultTrigger;\n\n return (\n <Popover open={showCalendar} onOpenChange={onOpenChange}>\n <Popover.Trigger asChild>\n {trigger}\n </Popover.Trigger>\n\n <Popover.Content side={side} className={styles.calendarPopover} ref={contentRef}>\n <Calendar\n required={true}\n {...calendarProps}\n onDropdownOpen={onDropdownOpen}\n mode=\"single\"\n selected={selectedDate}\n month={selectedDate}\n onSelect={handleSelect}\n onMonthChange={setSelectedDate}\n />\n </Popover.Content>\n </Popover>\n );\n}\n"],"names":["dayjs","customParseFormat","useState","useRef","useEffect","useCallback","_jsx","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E,gBAAgB,GAAGD,gCAAC,CAAAE,2BAAY,EAAG,EAAA,CAAA,GAAG,SAAS,EACzD,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,UAAU,EACjB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,WAAW,EACpB,SAAS,EAAEC,uBAAM,CAAC,eAAe,EAAA,GAC7B,cAAc,EAAA,CAClB,CACH,CAAC;AAEF,IAAA,MAAM,OAAO,GAAG,OAAO,QAAQ,KAAK,UAAU;UAC1C,QAAQ,CAAC,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC;AAC3C,UAAE,QAAQ,IAAI,cAAc,CAAC;AAE/B,IAAA,QACEC,iCAAC,CAAAC,eAAO,EAAC,EAAA,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EACrD,QAAA,EAAA,CAAAL,gCAAA,CAACK,eAAO,CAAC,OAAO,EAAC,EAAA,OAAO,EACrB,IAAA,EAAA,QAAA,EAAA,OAAO,GACQ,EAElBL,gCAAA,CAACK,eAAO,CAAC,OAAO,EAAC,EAAA,IAAI,EAAE,IAAI,EAAE,SAAS,EAAEF,uBAAM,CAAC,eAAe,EAAE,GAAG,EAAE,UAAU,YAC7EH,gCAAC,CAAAM,iBAAQ,EACP,EAAA,QAAQ,EAAE,IAAI,EAAA,GACV,aAAa,EACjB,cAAc,EAAE,cAAc,EAC9B,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,YAAY,EACtB,aAAa,EAAE,eAAe,GAC9B,EACc,CAAA,CAAA,EAAA,CACV,EACV;AACJ;;;;"}
@@ -1,5 +1,5 @@
1
- import { TextfieldProps } from "../textfield/textfield";
2
1
  import { PropsBase, PropsSingleRequired } from "react-day-picker";
2
+ import { TextfieldProps } from "../textfield/textfield";
3
3
  interface DatePickerProps {
4
4
  side?: "top" | "right" | "bottom" | "left";
5
5
  dateFormat?: string;
@@ -11,7 +11,8 @@ interface DatePickerProps {
11
11
  children?: React.ReactNode | ((props: {
12
12
  selectedDate: string;
13
13
  }) => React.ReactNode);
14
+ showCalendarIcon?: boolean;
14
15
  }
15
- export declare function DatePicker({ side, dateFormat, placeholder, textFieldProps, calendarProps, value, onSelect, children, }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function DatePicker({ side, dateFormat, placeholder, textFieldProps, calendarProps, value, onSelect, children, showCalendarIcon, }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
16
17
  export {};
17
18
  //# sourceMappingURL=date-picker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../../v1/components/calendar/date-picker.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAMlE,UAAU,eAAe;IACvB,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,aAAa,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAChD,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;CACrF;AAED,wBAAgB,UAAU,CAAC,EACzB,IAAY,EACZ,UAAyB,EACzB,WAA0B,EAC1B,cAAc,EACd,aAAa,EACb,KAAkB,EAClB,QAAmB,EACnB,QAAQ,GACT,EAAE,eAAe,2CAoJjB"}
1
+ {"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../../v1/components/calendar/date-picker.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAIlE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAMxD,UAAU,eAAe;IACvB,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,aAAa,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAChD,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IACpF,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAgB,UAAU,CAAC,EACzB,IAAY,EACZ,UAAyB,EACzB,WAA0B,EAC1B,cAAc,EACd,aAAa,EACb,KAAkB,EAClB,QAAmB,EACnB,QAAQ,EACR,gBAAuB,GACxB,EAAE,eAAe,2CAqJjB"}
@@ -1,15 +1,15 @@
1
1
  import { j as jsxRuntimeExports } from '../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js';
2
+ import { CalendarIcon } from '../../node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js';
3
+ import dayjs from '../../node_modules/.pnpm/dayjs@1.11.11/node_modules/dayjs/dayjs.min.js';
4
+ import customParseFormat from '../../node_modules/.pnpm/dayjs@1.11.11/node_modules/dayjs/plugin/customParseFormat.js';
5
+ import { useState, useRef, useEffect, useCallback } from 'react';
2
6
  import { Popover } from '../popover/popover.js';
3
7
  import { TextField } from '../textfield/textfield.js';
4
8
  import { Calendar } from './calendar.js';
5
9
  import styles from './calendar.module.css.js';
6
- import { useState, useRef, useEffect, useCallback } from 'react';
7
- import { CalendarIcon } from '../../node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js';
8
- import dayjs from '../../node_modules/.pnpm/dayjs@1.11.11/node_modules/dayjs/dayjs.min.js';
9
- import customParseFormat from '../../node_modules/.pnpm/dayjs@1.11.11/node_modules/dayjs/plugin/customParseFormat.js';
10
10
 
11
11
  dayjs.extend(customParseFormat);
12
- function DatePicker({ side = "top", dateFormat = "DD/MM/YYYY", placeholder = "DD/MM/YYYY", textFieldProps, calendarProps, value = new Date(), onSelect = () => { }, children, }) {
12
+ function DatePicker({ side = "top", dateFormat = "DD/MM/YYYY", placeholder = "DD/MM/YYYY", textFieldProps, calendarProps, value = new Date(), onSelect = () => { }, children, showCalendarIcon = true, }) {
13
13
  const [showCalendar, setShowCalendar] = useState(false);
14
14
  const [selectedDate, setSelectedDate] = useState(value);
15
15
  const [inputState, setInputState] = useState();
@@ -103,7 +103,7 @@ function DatePicker({ side = "top", dateFormat = "DD/MM/YYYY", placeholder = "DD
103
103
  setInputState('invalid');
104
104
  }
105
105
  }
106
- const defaultTrigger = (jsxRuntimeExports.jsx(TextField, { ref: textFieldRef, defaultValue: formattedDate, trailing: jsxRuntimeExports.jsx(CalendarIcon, {}), onChange: handleInputChange, onFocus: handleInputFocus, onBlur: handleInputBlur, state: inputState, placeholder: placeholder, onKeyUp: handleKeyUp, ...textFieldProps }));
106
+ const defaultTrigger = (jsxRuntimeExports.jsx(TextField, { ref: textFieldRef, defaultValue: formattedDate, trailing: showCalendarIcon ? jsxRuntimeExports.jsx(CalendarIcon, {}) : undefined, onChange: handleInputChange, onFocus: handleInputFocus, onBlur: handleInputBlur, state: inputState, placeholder: placeholder, onKeyUp: handleKeyUp, className: styles.datePickerInput, ...textFieldProps }));
107
107
  const trigger = typeof children === 'function'
108
108
  ? children({ selectedDate: formattedDate })
109
109
  : children || defaultTrigger;