@solace-health/ui 0.10.666 → 0.10.668

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 (197) hide show
  1. package/dist/BackLink/BackLink.cjs +1 -1
  2. package/dist/BackLink/BackLink.js +1 -1
  3. package/dist/Card/index.cjs +1 -1
  4. package/dist/Card/index.js +1 -1
  5. package/dist/DateDropdown/index.cjs +1 -1
  6. package/dist/DateDropdown/index.js +1 -1
  7. package/dist/DateSelectCalendar/DateSelectCalendar.cjs +1 -1
  8. package/dist/DateSelectCalendar/DateSelectCalendar.js +1 -1
  9. package/dist/Error/index.cjs +1 -1
  10. package/dist/Error/index.js +1 -1
  11. package/dist/ExpandableDrawer/index.cjs +1 -1
  12. package/dist/ExpandableDrawer/index.js +1 -1
  13. package/dist/File/index.cjs +1 -1
  14. package/dist/File/index.js +1 -1
  15. package/dist/Form/AddressSelect/index.cjs +1 -1
  16. package/dist/Form/AddressSelect/index.js +1 -1
  17. package/dist/Form/Checkbox/index.cjs +1 -1
  18. package/dist/Form/Checkbox/index.js +1 -1
  19. package/dist/Form/DateDropdown/index.cjs +1 -1
  20. package/dist/Form/DateDropdown/index.js +1 -1
  21. package/dist/Form/DateSelect/index.cjs +1 -1
  22. package/dist/Form/DateSelect/index.js +1 -1
  23. package/dist/Form/DateTextMaskInput/index.cjs +1 -1
  24. package/dist/Form/DateTextMaskInput/index.js +1 -1
  25. package/dist/Form/FileUpload/index.cjs +1 -1
  26. package/dist/Form/FileUpload/index.js +1 -1
  27. package/dist/Form/Keyword/index.cjs +1 -1
  28. package/dist/Form/Keyword/index.js +1 -1
  29. package/dist/Form/LocationSelect/index.cjs +1 -1
  30. package/dist/Form/LocationSelect/index.js +1 -1
  31. package/dist/Form/Number/index.cjs +1 -1
  32. package/dist/Form/Number/index.js +1 -1
  33. package/dist/Form/OTP/index.cjs +1 -1
  34. package/dist/Form/OTP/index.js +1 -1
  35. package/dist/Form/Radio/index.cjs +1 -1
  36. package/dist/Form/Radio/index.js +1 -1
  37. package/dist/Form/Select/index.cjs +1 -1
  38. package/dist/Form/Select/index.js +1 -1
  39. package/dist/Form/SelectMenu/index.cjs +1 -1
  40. package/dist/Form/SelectMenu/index.js +1 -1
  41. package/dist/Form/SentimentSelector/index.cjs +1 -1
  42. package/dist/Form/SentimentSelector/index.js +1 -1
  43. package/dist/Form/Signature/index.cjs +1 -1
  44. package/dist/Form/Signature/index.js +1 -1
  45. package/dist/Form/Text/index.cjs +1 -1
  46. package/dist/Form/Text/index.js +1 -1
  47. package/dist/Form/TextInput/index.cjs +1 -1
  48. package/dist/Form/TextInput/index.js +1 -1
  49. package/dist/Form/TimePicker/index.cjs +1 -1
  50. package/dist/Form/TimePicker/index.js +1 -1
  51. package/dist/Form/TimeSelect/index.cjs +1 -1
  52. package/dist/Form/TimeSelect/index.js +1 -1
  53. package/dist/Form/index.cjs +1 -1
  54. package/dist/Form/index.js +1 -1
  55. package/dist/Form/shared/FormInputLabel.cjs +1 -1
  56. package/dist/Form/shared/FormInputLabel.js +1 -1
  57. package/dist/Form/shared/HelpModal.cjs +1 -1
  58. package/dist/Form/shared/HelpModal.js +1 -1
  59. package/dist/IconSelector/IconSelector.cjs +1 -1
  60. package/dist/IconSelector/IconSelector.js +1 -1
  61. package/dist/Icons/index.cjs +1 -1
  62. package/dist/Icons/index.js +1 -1
  63. package/dist/Illustration/index.cjs +1 -1
  64. package/dist/Illustration/index.js +1 -1
  65. package/dist/Menu/ExpandIcon.cjs +1 -1
  66. package/dist/Menu/ExpandIcon.js +1 -1
  67. package/dist/Menu/index.cjs +1 -1
  68. package/dist/Menu/index.js +1 -1
  69. package/dist/Molecules/FilterPopover/FiltersMenu/FiltersMenu.cjs +1 -1
  70. package/dist/Molecules/FilterPopover/FiltersMenu/FiltersMenu.js +1 -1
  71. package/dist/Molecules/FilterPopover/index.cjs +1 -1
  72. package/dist/Molecules/FilterPopover/index.js +1 -1
  73. package/dist/NavigationMenu/ExpandIcon.cjs +1 -1
  74. package/dist/NavigationMenu/ExpandIcon.js +1 -1
  75. package/dist/NavigationMenu/index.cjs +1 -1
  76. package/dist/NavigationMenu/index.js +1 -1
  77. package/dist/PreviewDrawer/PreviewDrawer.cjs +1 -1
  78. package/dist/PreviewDrawer/PreviewDrawer.js +1 -1
  79. package/dist/Search/index.cjs +1 -1
  80. package/dist/Search/index.js +1 -1
  81. package/dist/SelectClient/index.cjs +1 -1
  82. package/dist/SelectClient/index.js +1 -1
  83. package/dist/SentimentSelector/index.cjs +1 -1
  84. package/dist/SentimentSelector/index.js +1 -1
  85. package/dist/TimeSelect/styles.cjs +4 -4
  86. package/dist/TimeSelect/styles.js +1 -1
  87. package/dist/{chunk-G5NHVCRJ.cjs → chunk-2BUA2PCN.cjs} +2 -2
  88. package/dist/{chunk-G5NHVCRJ.cjs.map → chunk-2BUA2PCN.cjs.map} +1 -1
  89. package/dist/{chunk-2UFDHOOO.js → chunk-3N4EBY5Q.js} +2 -2
  90. package/dist/{chunk-2UFDHOOO.js.map → chunk-3N4EBY5Q.js.map} +1 -1
  91. package/dist/{chunk-JI5AQXDZ.cjs → chunk-3TNSGXJ6.cjs} +2 -2
  92. package/dist/{chunk-JI5AQXDZ.cjs.map → chunk-3TNSGXJ6.cjs.map} +1 -1
  93. package/dist/{chunk-MVRPKIMJ.js → chunk-6TGWLOLD.js} +2 -2
  94. package/dist/{chunk-MVRPKIMJ.js.map → chunk-6TGWLOLD.js.map} +1 -1
  95. package/dist/{chunk-NCNDA2DV.js → chunk-BCJNTCHK.js} +2 -2
  96. package/dist/{chunk-NCNDA2DV.js.map → chunk-BCJNTCHK.js.map} +1 -1
  97. package/dist/{chunk-NPC4CKVY.cjs → chunk-C45VZ526.cjs} +2 -2
  98. package/dist/{chunk-NPC4CKVY.cjs.map → chunk-C45VZ526.cjs.map} +1 -1
  99. package/dist/chunk-CEIPBWDG.cjs +2 -0
  100. package/dist/{chunk-XE6CF6SQ.cjs.map → chunk-CEIPBWDG.cjs.map} +1 -1
  101. package/dist/{chunk-4RCOG3AM.cjs → chunk-E7W73IO3.cjs} +2 -2
  102. package/dist/{chunk-4RCOG3AM.cjs.map → chunk-E7W73IO3.cjs.map} +1 -1
  103. package/dist/{chunk-UDKRDNFM.cjs → chunk-ETZDR7A5.cjs} +2 -2
  104. package/dist/{chunk-UDKRDNFM.cjs.map → chunk-ETZDR7A5.cjs.map} +1 -1
  105. package/dist/{chunk-A6HKBRRQ.js → chunk-FBXJ2VCI.js} +2 -2
  106. package/dist/{chunk-A6HKBRRQ.js.map → chunk-FBXJ2VCI.js.map} +1 -1
  107. package/dist/{chunk-INPZSDJ7.js → chunk-FMPII2NF.js} +2 -2
  108. package/dist/{chunk-INPZSDJ7.js.map → chunk-FMPII2NF.js.map} +1 -1
  109. package/dist/{chunk-KUUJM4SB.cjs → chunk-FXLG3LU3.cjs} +2 -2
  110. package/dist/{chunk-KUUJM4SB.cjs.map → chunk-FXLG3LU3.cjs.map} +1 -1
  111. package/dist/{chunk-G3D7LW2D.cjs → chunk-HP66FPW5.cjs} +2 -2
  112. package/dist/{chunk-G3D7LW2D.cjs.map → chunk-HP66FPW5.cjs.map} +1 -1
  113. package/dist/{chunk-QEELP4K2.js → chunk-JE6P5GU3.js} +2 -2
  114. package/dist/{chunk-QEELP4K2.js.map → chunk-JE6P5GU3.js.map} +1 -1
  115. package/dist/chunk-JH4FQUIS.js +2 -0
  116. package/dist/{chunk-YCZSXQP4.js.map → chunk-JH4FQUIS.js.map} +1 -1
  117. package/dist/{chunk-TL7AHX66.cjs → chunk-L4FOTU2K.cjs} +2 -2
  118. package/dist/{chunk-TL7AHX66.cjs.map → chunk-L4FOTU2K.cjs.map} +1 -1
  119. package/dist/{chunk-XOH4SEBO.js → chunk-MPGPI6LC.js} +2 -2
  120. package/dist/{chunk-XOH4SEBO.js.map → chunk-MPGPI6LC.js.map} +1 -1
  121. package/dist/chunk-MZVRBL6S.js +2 -0
  122. package/dist/{chunk-4NKACID5.js.map → chunk-MZVRBL6S.js.map} +1 -1
  123. package/dist/{chunk-TJLALRVG.js → chunk-ONAYZGIC.js} +2 -2
  124. package/dist/{chunk-TJLALRVG.js.map → chunk-ONAYZGIC.js.map} +1 -1
  125. package/dist/{chunk-CAUYNM6X.cjs → chunk-QOIWWR24.cjs} +2 -2
  126. package/dist/{chunk-CAUYNM6X.cjs.map → chunk-QOIWWR24.cjs.map} +1 -1
  127. package/dist/{chunk-NDF7Y2BW.cjs → chunk-QSXPBYYK.cjs} +3 -3
  128. package/dist/{chunk-NDF7Y2BW.cjs.map → chunk-QSXPBYYK.cjs.map} +1 -1
  129. package/dist/chunk-QUD4HTUP.cjs +2 -0
  130. package/dist/{chunk-25P3XDJA.cjs.map → chunk-QUD4HTUP.cjs.map} +1 -1
  131. package/dist/{chunk-DR6BI7MP.cjs → chunk-SM7PYFD2.cjs} +2 -2
  132. package/dist/{chunk-DR6BI7MP.cjs.map → chunk-SM7PYFD2.cjs.map} +1 -1
  133. package/dist/{chunk-EN66V63W.js → chunk-SMTXYI6Q.js} +2 -2
  134. package/dist/{chunk-EN66V63W.js.map → chunk-SMTXYI6Q.js.map} +1 -1
  135. package/dist/{chunk-AIGGWECF.js → chunk-UVZVZAGK.js} +2 -2
  136. package/dist/{chunk-AIGGWECF.js.map → chunk-UVZVZAGK.js.map} +1 -1
  137. package/dist/{chunk-IB6D4HIL.js → chunk-VO2GGQ2X.js} +2 -2
  138. package/dist/{chunk-IB6D4HIL.js.map → chunk-VO2GGQ2X.js.map} +1 -1
  139. package/dist/{chunk-M4I2WW74.cjs → chunk-VTBYJGTJ.cjs} +2 -2
  140. package/dist/{chunk-M4I2WW74.cjs.map → chunk-VTBYJGTJ.cjs.map} +1 -1
  141. package/dist/{chunk-X4O2D662.cjs → chunk-VTYXYLTK.cjs} +2 -2
  142. package/dist/{chunk-X4O2D662.cjs.map → chunk-VTYXYLTK.cjs.map} +1 -1
  143. package/dist/{chunk-5YC7OURG.js → chunk-WMOD232S.js} +2 -2
  144. package/dist/{chunk-5YC7OURG.js.map → chunk-WMOD232S.js.map} +1 -1
  145. package/dist/{chunk-UT2WK5SS.cjs → chunk-X7HU4N6X.cjs} +2 -2
  146. package/dist/{chunk-UT2WK5SS.cjs.map → chunk-X7HU4N6X.cjs.map} +1 -1
  147. package/dist/{chunk-UJY4CEZN.js → chunk-Y2INDMUK.js} +3 -3
  148. package/dist/{chunk-UJY4CEZN.js.map → chunk-Y2INDMUK.js.map} +1 -1
  149. package/dist/{chunk-VWQTIAV2.js → chunk-Z6BTLUPD.js} +2 -2
  150. package/dist/{chunk-VWQTIAV2.js.map → chunk-Z6BTLUPD.js.map} +1 -1
  151. package/dist/index.cjs +1 -1
  152. package/dist/index.js +1 -1
  153. package/dist/metafile-cjs.json +1 -1
  154. package/dist/metafile-esm.json +1 -1
  155. package/dist/v2/button/button.cjs +1 -1
  156. package/dist/v2/button/button.js +1 -1
  157. package/dist/v2/calendar/calendar.cjs +1 -1
  158. package/dist/v2/calendar/calendar.js +1 -1
  159. package/dist/v2/carousel/carousel.cjs +1 -1
  160. package/dist/v2/carousel/carousel.js +1 -1
  161. package/dist/v2/checkbox/button-checkbox.cjs +1 -1
  162. package/dist/v2/checkbox/button-checkbox.js +1 -1
  163. package/dist/v2/checkbox-group/checkbox-group.cjs +1 -1
  164. package/dist/v2/checkbox-group/checkbox-group.js +1 -1
  165. package/dist/v2/combobox/combobox.cjs +1 -1
  166. package/dist/v2/combobox/combobox.js +1 -1
  167. package/dist/v2/command/command.cjs +1 -1
  168. package/dist/v2/command/command.js +1 -1
  169. package/dist/v2/date-picker/date-picker-input.cjs +1 -1
  170. package/dist/v2/date-picker/date-picker-input.js +1 -1
  171. package/dist/v2/date-picker/date-picker.cjs +1 -1
  172. package/dist/v2/date-picker/date-picker.js +1 -1
  173. package/dist/v2/dialog/dialog.cjs +1 -1
  174. package/dist/v2/dialog/dialog.js +1 -1
  175. package/dist/v2/drawer/drawer.cjs +1 -1
  176. package/dist/v2/drawer/drawer.js +1 -1
  177. package/dist/v2/flex-drawer/flex-drawer.cjs +1 -1
  178. package/dist/v2/flex-drawer/flex-drawer.js +1 -1
  179. package/dist/v2/image-preview/image-preview.cjs +1 -1
  180. package/dist/v2/image-preview/image-preview.js +1 -1
  181. package/dist/v2/index.cjs +1 -1
  182. package/dist/v2/index.js +1 -1
  183. package/dist/v2/multiselect/components/MultiSelectCommandGroup.cjs +1 -1
  184. package/dist/v2/multiselect/components/MultiSelectCommandGroup.js +1 -1
  185. package/dist/v2/multiselect/components/MultiSelectDropdown.cjs +1 -1
  186. package/dist/v2/multiselect/components/MultiSelectDropdown.js +1 -1
  187. package/dist/v2/multiselect/multiselect.cjs +1 -1
  188. package/dist/v2/multiselect/multiselect.js +1 -1
  189. package/dist/v2/time-select/time-select.cjs +1 -1
  190. package/dist/v2/time-select/time-select.js +1 -1
  191. package/dist/v2/verified-advocate/verified-advocate.cjs +1 -1
  192. package/dist/v2/verified-advocate/verified-advocate.js +1 -1
  193. package/package.json +1 -1
  194. package/dist/chunk-25P3XDJA.cjs +0 -2
  195. package/dist/chunk-4NKACID5.js +0 -2
  196. package/dist/chunk-XE6CF6SQ.cjs +0 -2
  197. package/dist/chunk-YCZSXQP4.js +0 -2
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkQRO22BPZ_cjs=require('./chunk-QRO22BPZ.cjs'),chunkXY4I4IUO_cjs=require('./chunk-XY4I4IUO.cjs'),s=require('react'),reactSlot=require('@radix-ui/react-slot'),classVarianceAuthority=require('class-variance-authority'),jsxRuntime=require('react/jsx-runtime');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var s__namespace=/*#__PURE__*/_interopNamespace(s);var o="bg-dark-green text-primary-foreground hover:bg-green active:bg-green disabled:bg-gray-200 disabled:text-secondary-foreground",t="bg-white text-dark-green border border-dark-green hover:bg-green-100 active:bg-green-100 disabled:bg-white disabled:text-secondary-foreground disabled:border-gray-300",v=classVarianceAuthority.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-bold transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-5 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",{variants:{variant:{primary:o,outline:t,ghost:"text-dark-green hover:bg-green-200 active:bg-green-200","ghost-secondary":"text-gray-700 hover:bg-gray-200 active:bg-gray-200",link:"text-dark-green underline-offset-4 underline font-normal disabled:text-secondary-foreground hover:text-green-700 active:text-green-700",danger:"bg-red text-primary-foreground hover:bg-red-400 active:bg-red-400 disabled:bg-gray-200 disabled:text-secondary-foreground","danger-outline":"bg-white text-destructive border border-destructive hover:bg-red-100 active:bg-red-100 disabled:bg-white disabled:text-secondary-foreground disabled:border-gray-300","danger-ghost":"bg-transparent text-destructive border-none hover:bg-red-100 active:bg-red-100 disabled:bg-white disabled:text-secondary-foreground","danger-link":"text-red-600 hover:text-red-400 active:text-red-400 underline-offset-4 underline font-normal disabled:text-secondary-foreground","primary-icon":`${o} py-0! px-0! aspect-square rounded-sm`,"primary-icon-rounded":`${o} py-0! px-0! aspect-square rounded-full`,"outline-icon":`${t} py-0! px-0! aspect-square rounded-sm`,"outline-icon-rounded":`${t} py-0! px-0! aspect-square rounded-full`,"ghost-icon":"hover:bg-green-200 active:bg-green-200 py-0! px-0! aspect-square rounded-sm","ghost-icon-rounded":"hover:bg-green-200 active:bg-green-200 py-0! px-0! aspect-square rounded-full","ai-primary":"[background-image:linear-gradient(220deg,theme(colors.purple.400),theme(colors.gold.500))] px-[1px]! py-[1px]! hover:shadow-sm active:shadow-sm font-normal","ai-secondary":"bg-border px-[1px]! py-[1px]! hover:[background-image:linear-gradient(220deg,theme(colors.purple.400),theme(colors.gold.500))] hover:shadow-sm active:[background-image:linear-gradient(220deg,theme(colors.purple.400),theme(colors.gold.500))] active:shadow-sm font-normal",secondary:"border bg-glass hover:border-dark-gray active:border-dark-gray font-normal","secondary-icon":"border bg-glass hover:border-dark-gray active:border-dark-gray py-0! px-0! aspect-square rounded-sm","secondary-icon-rounded":"border bg-glass hover:border-dark-gray active:border-dark-gray py-0! px-0! aspect-square rounded-full"},size:{default:"px-4 h-12",sm:"px-3 py-xs h-8 [&_svg:not([class*='size-'])]:size-4"}},defaultVariants:{variant:"primary",size:"default"}}),B=s__namespace.forwardRef(({className:g,type:l="button",variant:e,size:a,asChild:p=false,children:n=null,...b},c)=>jsxRuntime.jsx(p?reactSlot.Slot:"button",{"data-slot":"button",className:chunkQRO22BPZ_cjs.a(v({variant:e,size:a,className:g})),type:l,ref:c,...b,children:e==="ai-primary"||e==="ai-secondary"?jsxRuntime.jsxs("div",{className:chunkQRO22BPZ_cjs.a("flex items-center gap-2 rounded-[7px] bg-white",e==="ai-primary"?"hover:bg-lightpolaris-gradient active:bg-lightpolaris-gradient":"bg-glass",a==="sm"?"h-[30px] px-2":"h-[46px] px-3"),children:[jsxRuntime.jsx(chunkXY4I4IUO_cjs.a,{})," ",n]}):n}));exports.a=v;exports.b=B;//# sourceMappingURL=chunk-QUD4HTUP.cjs.map
2
+ //# sourceMappingURL=chunk-QUD4HTUP.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/v2/button/button.tsx"],"names":["primaryButtonStyles","outlineButtonStyles","buttonVariants","cva","Button","s","className","type","variant","size","asChild","children","props","ref","jsx","Slot","cn","jsxs","SparklesBold"],"mappings":"2nBAOA,IAAMA,EACJ,8HAAA,CAEIC,CAAAA,CACJ,wKAAA,CAEIC,CAAAA,CAAiBC,2BACrB,kcAAA,CACA,CACE,SAAU,CACR,OAAA,CAAS,CACP,OAAA,CAASH,CAAAA,CACT,OAAA,CAASC,C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SAAA,CAAWD,mBAAAA,CACT,gDAAA,CACAR,IAAY,YAAA,CACR,gEAAA,CACA,WACJC,CAAAA,GAAS,IAAA,CAAO,gBAAkB,eACpC,CAAA,CAEA,QAAA,CAAA,CAAAK,cAAAA,CAACI,oBAAA,EAAa,CAAA,CAAE,IAAEP,CAAAA,CAAAA,CACpB,CAAA,CAEAA,EAEJ,CAGN","file":"chunk-25P3XDJA.cjs","sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\nimport { SparklesBold } from '@/Icons';\n\nconst primaryButtonStyles =\n 'bg-dark-green text-primary-foreground hover:bg-green active:bg-green disabled:bg-gray-200 disabled:text-secondary-foreground';\n\nconst outlineButtonStyles =\n 'bg-white text-dark-green border border-dark-green hover:bg-green-100 active:bg-green-100 disabled:bg-white disabled:text-secondary-foreground disabled:border-gray-300';\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-bold transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-5 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer\",\n {\n variants: {\n variant: {\n primary: primaryButtonStyles,\n outline: outlineButtonStyles,\n ghost: 'text-dark-green hover:bg-green-200 active:bg-green-200',\n 'ghost-secondary': 'text-gray-700 hover:bg-gray-200 active:bg-gray-200',\n link: 'text-dark-green underline-offset-4 underline font-normal disabled:text-secondary-foreground hover:text-green-700 active:text-green-700',\n\n danger:\n 'bg-red text-primary-foreground hover:bg-red-400 active:bg-red-400 disabled:bg-gray-200 disabled:text-secondary-foreground',\n 'danger-outline':\n 'bg-white text-destructive border border-destructive hover:bg-red-100 active:bg-red-100 disabled:bg-white disabled:text-secondary-foreground disabled:border-gray-300',\n 'danger-ghost':\n 'bg-transparent text-destructive border-none hover:bg-red-100 active:bg-red-100 disabled:bg-white disabled:text-secondary-foreground',\n 'danger-link':\n 'text-red-600 hover:text-red-400 active:text-red-400 underline-offset-4 underline font-normal disabled:text-secondary-foreground',\n\n 'primary-icon': `${primaryButtonStyles} py-0! px-0! aspect-square`,\n 'primary-icon-rounded': `${primaryButtonStyles} py-0! px-0! aspect-square rounded-full`,\n\n 'outline-icon': `${outlineButtonStyles} py-0! px-0! aspect-square`,\n 'outline-icon-rounded': `${outlineButtonStyles} py-0! px-0! aspect-square rounded-full`,\n\n 'ghost-icon': 'hover:bg-green-200 active:bg-green-200 py-0! px-0! aspect-square',\n 'ghost-icon-rounded':\n 'hover:bg-green-200 active:bg-green-200 py-0! px-0! aspect-square rounded-full',\n\n 'ai-primary':\n '[background-image:linear-gradient(220deg,theme(colors.purple.400),theme(colors.gold.500))] px-[1px]! py-[1px]! hover:shadow-sm active:shadow-sm font-normal',\n 'ai-secondary':\n 'bg-border px-[1px]! py-[1px]! hover:[background-image:linear-gradient(220deg,theme(colors.purple.400),theme(colors.gold.500))] hover:shadow-sm active:[background-image:linear-gradient(220deg,theme(colors.purple.400),theme(colors.gold.500))] active:shadow-sm font-normal',\n\n secondary: 'border bg-glass hover:border-dark-gray active:border-dark-gray font-normal',\n 'secondary-icon':\n 'border bg-glass hover:border-dark-gray active:border-dark-gray py-0! px-0! aspect-square',\n 'secondary-icon-rounded':\n 'border bg-glass hover:border-dark-gray active:border-dark-gray py-0! px-0! aspect-square rounded-full',\n },\n size: {\n default: 'px-4 h-12',\n sm: \"px-3 py-xs h-8 [&_svg:not([class*='size-'])]:size-4\",\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 'default',\n },\n },\n);\n\ntype ButtonSize = VariantProps<typeof buttonVariants>['size'];\n\nexport type ButtonProps = React.ComponentProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean;\n };\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n { className, type = 'button', variant, size, asChild = false, children = null, ...props },\n ref,\n ) => {\n const Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n type={type}\n ref={ref}\n {...props}\n >\n {variant === 'ai-primary' || variant === 'ai-secondary' ? (\n <div\n className={cn(\n 'flex items-center gap-2 rounded-[7px] bg-white',\n variant === 'ai-primary'\n ? 'hover:bg-lightpolaris-gradient active:bg-lightpolaris-gradient'\n : 'bg-glass',\n size === 'sm' ? 'h-[30px] px-2' : 'h-[46px] px-3',\n )}\n >\n <SparklesBold /> {children}\n </div>\n ) : (\n children\n )}\n </Comp>\n );\n },\n);\n\nexport { Button, buttonVariants, type ButtonSize };\n"]}
1
+ {"version":3,"sources":["../src/v2/button/button.tsx"],"names":["primaryButtonStyles","outlineButtonStyles","buttonVariants","cva","Button","s","className","type","variant","size","asChild","children","props","ref","jsx","Slot","cn","jsxs","SparklesBold"],"mappings":"2nBAOA,IAAMA,EACJ,8HAAA,CAEIC,CAAAA,CACJ,wKAAA,CAEIC,CAAAA,CAAiBC,2BACrB,kcAAA,CACA,CACE,SAAU,CACR,OAAA,CAAS,CACP,OAAA,CAASH,CAAAA,CACT,OAAA,CAASC,CAAAA,CACT,MAAO,wDAAA,CACP,iBAAA,CAAmB,qDACnB,IAAA,CAAM,wIAAA,CAEN,OACE,2HAAA,CACF,gBAAA,CACE,sKAAA,CACF,cAAA,CACE,sIACF,aAAA,CACE,iIAAA,CAEF,eAAgB,CAAA,EAAGD,CAAmB,wCACtC,sBAAA,CAAwB,CAAA,EAAGA,CAAmB,CAAA,uCAAA,CAAA,CAE9C,eAAgB,CAAA,EAAGC,CAAmB,wCACtC,sBAAA,CAAwB,CAAA,EAAGA,CAAmB,CAAA,uCAAA,CAAA,CAE9C,YAAA,CAAc,6EAAA,CACd,oBAAA,CACE,gFAEF,YAAA,CACE,6JAAA,CACF,eACE,+QAAA,CAEF,SAAA,CAAW,6EACX,gBAAA,CACE,qGAAA,CACF,wBAAA,CACE,uGACJ,EACA,IAAA,CAAM,CACJ,QAAS,WAAA,CACT,EAAA,CAAI,qDACN,CACF,CAAA,CACA,eAAA,CAAiB,CACf,QAAS,SAAA,CACT,IAAA,CAAM,SACR,CACF,CACF,EASMG,CAAAA,CAAeC,YAAA,CAAA,UAAA,CACnB,CACE,CAAE,UAAAC,CAAAA,CAAW,IAAA,CAAAC,EAAO,QAAA,CAAU,OAAA,CAAAC,EAAS,IAAA,CAAAC,CAAAA,CAAM,OAAA,CAAAC,CAAAA,CAAU,MAAO,QAAA,CAAAC,CAAAA,CAAW,KAAM,GAAGC,CAAM,EACxFC,CAAAA,GAKEC,cAAAA,CAHWJ,CAAAA,CAAUK,cAAAA,CAAO,SAG3B,CACC,WAAA,CAAU,SACV,SAAA,CAAWC,mBAAAA,CAAGd,EAAe,CAAE,OAAA,CAAAM,CAAAA,CAAS,IAAA,CAAAC,EAAM,SAAA,CAAAH,CAAU,CAAC,CAAC,CAAA,CAC1D,KAAMC,CAAAA,CACN,GAAA,CAAKM,CAAAA,CACJ,GAAGD,EAEH,QAAA,CAAAJ,CAAAA,GAAY,cAAgBA,CAAAA,GAAY,cAAA,CACvCS,gBAAC,KAAA,CAAA,CACC,SAAA,CAAWD,mBAAAA,CACT,gDAAA,CACAR,IAAY,YAAA,CACR,gEAAA,CACA,WACJC,CAAAA,GAAS,IAAA,CAAO,gBAAkB,eACpC,CAAA,CAEA,QAAA,CAAA,CAAAK,cAAAA,CAACI,oBAAA,EAAa,CAAA,CAAE,IAAEP,CAAAA,CAAAA,CACpB,CAAA,CAEAA,EAEJ,CAGN","file":"chunk-QUD4HTUP.cjs","sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\nimport { SparklesBold } from '@/Icons';\n\nconst primaryButtonStyles =\n 'bg-dark-green text-primary-foreground hover:bg-green active:bg-green disabled:bg-gray-200 disabled:text-secondary-foreground';\n\nconst outlineButtonStyles =\n 'bg-white text-dark-green border border-dark-green hover:bg-green-100 active:bg-green-100 disabled:bg-white disabled:text-secondary-foreground disabled:border-gray-300';\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-bold transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-5 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer\",\n {\n variants: {\n variant: {\n primary: primaryButtonStyles,\n outline: outlineButtonStyles,\n ghost: 'text-dark-green hover:bg-green-200 active:bg-green-200',\n 'ghost-secondary': 'text-gray-700 hover:bg-gray-200 active:bg-gray-200',\n link: 'text-dark-green underline-offset-4 underline font-normal disabled:text-secondary-foreground hover:text-green-700 active:text-green-700',\n\n danger:\n 'bg-red text-primary-foreground hover:bg-red-400 active:bg-red-400 disabled:bg-gray-200 disabled:text-secondary-foreground',\n 'danger-outline':\n 'bg-white text-destructive border border-destructive hover:bg-red-100 active:bg-red-100 disabled:bg-white disabled:text-secondary-foreground disabled:border-gray-300',\n 'danger-ghost':\n 'bg-transparent text-destructive border-none hover:bg-red-100 active:bg-red-100 disabled:bg-white disabled:text-secondary-foreground',\n 'danger-link':\n 'text-red-600 hover:text-red-400 active:text-red-400 underline-offset-4 underline font-normal disabled:text-secondary-foreground',\n\n 'primary-icon': `${primaryButtonStyles} py-0! px-0! aspect-square rounded-sm`,\n 'primary-icon-rounded': `${primaryButtonStyles} py-0! px-0! aspect-square rounded-full`,\n\n 'outline-icon': `${outlineButtonStyles} py-0! px-0! aspect-square rounded-sm`,\n 'outline-icon-rounded': `${outlineButtonStyles} py-0! px-0! aspect-square rounded-full`,\n\n 'ghost-icon': 'hover:bg-green-200 active:bg-green-200 py-0! px-0! aspect-square rounded-sm',\n 'ghost-icon-rounded':\n 'hover:bg-green-200 active:bg-green-200 py-0! px-0! aspect-square rounded-full',\n\n 'ai-primary':\n '[background-image:linear-gradient(220deg,theme(colors.purple.400),theme(colors.gold.500))] px-[1px]! py-[1px]! hover:shadow-sm active:shadow-sm font-normal',\n 'ai-secondary':\n 'bg-border px-[1px]! py-[1px]! hover:[background-image:linear-gradient(220deg,theme(colors.purple.400),theme(colors.gold.500))] hover:shadow-sm active:[background-image:linear-gradient(220deg,theme(colors.purple.400),theme(colors.gold.500))] active:shadow-sm font-normal',\n\n secondary: 'border bg-glass hover:border-dark-gray active:border-dark-gray font-normal',\n 'secondary-icon':\n 'border bg-glass hover:border-dark-gray active:border-dark-gray py-0! px-0! aspect-square rounded-sm',\n 'secondary-icon-rounded':\n 'border bg-glass hover:border-dark-gray active:border-dark-gray py-0! px-0! aspect-square rounded-full',\n },\n size: {\n default: 'px-4 h-12',\n sm: \"px-3 py-xs h-8 [&_svg:not([class*='size-'])]:size-4\",\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 'default',\n },\n },\n);\n\ntype ButtonSize = VariantProps<typeof buttonVariants>['size'];\n\nexport type ButtonProps = React.ComponentProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean;\n };\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n { className, type = 'button', variant, size, asChild = false, children = null, ...props },\n ref,\n ) => {\n const Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n type={type}\n ref={ref}\n {...props}\n >\n {variant === 'ai-primary' || variant === 'ai-secondary' ? (\n <div\n className={cn(\n 'flex items-center gap-2 rounded-[7px] bg-white',\n variant === 'ai-primary'\n ? 'hover:bg-lightpolaris-gradient active:bg-lightpolaris-gradient'\n : 'bg-glass',\n size === 'sm' ? 'h-[30px] px-2' : 'h-[46px] px-3',\n )}\n >\n <SparklesBold /> {children}\n </div>\n ) : (\n children\n )}\n </Comp>\n );\n },\n);\n\nexport { Button, buttonVariants, type ButtonSize };\n"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var chunk25P3XDJA_cjs=require('./chunk-25P3XDJA.cjs'),chunkXXIJHROA_cjs=require('./chunk-XXIJHROA.cjs'),chunkQRO22BPZ_cjs=require('./chunk-QRO22BPZ.cjs'),w=require('react'),web=require('@react-spring/web'),lu=require('react-icons/lu'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var w__default=/*#__PURE__*/_interopDefault(w);function E({isOpen:t,drawerPosition:e,className:o,...l}){let i=e==="right"?jsxRuntime.jsx(lu.LuChevronLeft,{}):jsxRuntime.jsx(lu.LuChevronRight,{}),s=e==="right"?jsxRuntime.jsx(lu.LuChevronRight,{}):jsxRuntime.jsx(lu.LuChevronLeft,{});return jsxRuntime.jsx(chunk25P3XDJA_cjs.b,{size:"sm",variant:"secondary-icon-rounded",className:chunkQRO22BPZ_cjs.a("absolute top-16 z-10",{"left-[-16px]":e==="right","right-[-16px]":e==="left"},o),...l,children:t?s:i})}function S({className:t="",children:e,...o}){return jsxRuntime.jsx("div",{className:chunkQRO22BPZ_cjs.a("flex h-auto w-full flex-col",t),...o,children:e})}function $({className:t="",children:e,...o}){return jsxRuntime.jsx("div",{className:chunkQRO22BPZ_cjs.a("flex h-full w-full flex-col",t),...o,children:e})}function k({className:t="",children:e,...o}){return jsxRuntime.jsx("div",{className:chunkQRO22BPZ_cjs.a("flex w-full items-end justify-between",t),...o,children:e})}function j({position:t,className:e="",children:o,isOpen:l,collapsedWidth:i="4rem",defaultWidth:s,...R}){let d=w.useRef(null),[c,P]=w.useState(0),[u,D]=w.useState(0),p=null,m=null,h=null,x=[];w__default.default.Children.toArray(o).forEach(a=>{if(w__default.default.isValidElement(a))switch(a.type){case E:p=a;break;case S:m=a;break;case k:h=a;break;default:x.push(a);}}),w.useLayoutEffect(()=>{d.current&&(D(chunkXXIJHROA_cjs.a(s,d.current)),P(chunkXXIJHROA_cjs.a(i,d.current)));},[i,s]);let C=web.useSpring({width:l?u:c,minWidth:l?u:c,config:{tension:250,friction:30}});return jsxRuntime.jsxs("div",{className:"relative flex",children:[p,jsxRuntime.jsx(web.animated.div,{role:"region",className:chunkQRO22BPZ_cjs.a("flex-drawer-outer relative z-1 overflow-x-hidden shadow-md",{"rounded-l-md border-l":t==="right","rounded-r-md border-r":t==="left"}),style:C,ref:d,children:jsxRuntime.jsx("div",{style:{width:`${u}px`},className:chunkQRO22BPZ_cjs.a("flex-drawer-fixed absolute top-0 h-full px-4 py-6",{"right-0":t==="left"},e),...R,children:jsxRuntime.jsxs("div",{className:chunkQRO22BPZ_cjs.a("flex-drawer-inner flex h-full flex-col transition-discrete duration-300 ease-out",{"hidden opacity-0":!l,"visible opacity-100":l}),children:[m,x,h]})})})]})}exports.a=E;exports.b=S;exports.c=$;exports.d=k;exports.e=j;//# sourceMappingURL=chunk-DR6BI7MP.cjs.map
2
- //# sourceMappingURL=chunk-DR6BI7MP.cjs.map
1
+ 'use strict';var chunkQUD4HTUP_cjs=require('./chunk-QUD4HTUP.cjs'),chunkXXIJHROA_cjs=require('./chunk-XXIJHROA.cjs'),chunkQRO22BPZ_cjs=require('./chunk-QRO22BPZ.cjs'),w=require('react'),web=require('@react-spring/web'),lu=require('react-icons/lu'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var w__default=/*#__PURE__*/_interopDefault(w);function E({isOpen:t,drawerPosition:e,className:o,...l}){let i=e==="right"?jsxRuntime.jsx(lu.LuChevronLeft,{}):jsxRuntime.jsx(lu.LuChevronRight,{}),s=e==="right"?jsxRuntime.jsx(lu.LuChevronRight,{}):jsxRuntime.jsx(lu.LuChevronLeft,{});return jsxRuntime.jsx(chunkQUD4HTUP_cjs.b,{size:"sm",variant:"secondary-icon-rounded",className:chunkQRO22BPZ_cjs.a("absolute top-16 z-10",{"left-[-16px]":e==="right","right-[-16px]":e==="left"},o),...l,children:t?s:i})}function S({className:t="",children:e,...o}){return jsxRuntime.jsx("div",{className:chunkQRO22BPZ_cjs.a("flex h-auto w-full flex-col",t),...o,children:e})}function $({className:t="",children:e,...o}){return jsxRuntime.jsx("div",{className:chunkQRO22BPZ_cjs.a("flex h-full w-full flex-col",t),...o,children:e})}function k({className:t="",children:e,...o}){return jsxRuntime.jsx("div",{className:chunkQRO22BPZ_cjs.a("flex w-full items-end justify-between",t),...o,children:e})}function j({position:t,className:e="",children:o,isOpen:l,collapsedWidth:i="4rem",defaultWidth:s,...R}){let d=w.useRef(null),[c,P]=w.useState(0),[u,D]=w.useState(0),p=null,m=null,h=null,x=[];w__default.default.Children.toArray(o).forEach(a=>{if(w__default.default.isValidElement(a))switch(a.type){case E:p=a;break;case S:m=a;break;case k:h=a;break;default:x.push(a);}}),w.useLayoutEffect(()=>{d.current&&(D(chunkXXIJHROA_cjs.a(s,d.current)),P(chunkXXIJHROA_cjs.a(i,d.current)));},[i,s]);let C=web.useSpring({width:l?u:c,minWidth:l?u:c,config:{tension:250,friction:30}});return jsxRuntime.jsxs("div",{className:"relative flex",children:[p,jsxRuntime.jsx(web.animated.div,{role:"region",className:chunkQRO22BPZ_cjs.a("flex-drawer-outer relative z-1 overflow-x-hidden shadow-md",{"rounded-l-md border-l":t==="right","rounded-r-md border-r":t==="left"}),style:C,ref:d,children:jsxRuntime.jsx("div",{style:{width:`${u}px`},className:chunkQRO22BPZ_cjs.a("flex-drawer-fixed absolute top-0 h-full px-4 py-6",{"right-0":t==="left"},e),...R,children:jsxRuntime.jsxs("div",{className:chunkQRO22BPZ_cjs.a("flex-drawer-inner flex h-full flex-col transition-discrete duration-300 ease-out",{"hidden opacity-0":!l,"visible opacity-100":l}),children:[m,x,h]})})})]})}exports.a=E;exports.b=S;exports.c=$;exports.d=k;exports.e=j;//# sourceMappingURL=chunk-SM7PYFD2.cjs.map
2
+ //# sourceMappingURL=chunk-SM7PYFD2.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/v2/flex-drawer/flex-drawer.tsx"],"names":["FlexDrawerButton","isOpen","drawerPosition","className","props","OpenIcon","jsx","LuChevronLeft","LuChevronRight","CloseIcon","Button","cn","FlexDrawerHeader","children","FlexDrawerContent","FlexDrawerFooter","FlexDrawer","position","collapsedWidth","defaultWidth","drawerRef","useRef","collapsedPx","setCollapsedPx","useState","drawerWidth","setDrawerWidth","button","header","footer","content","React","child","useLayoutEffect","toPx","outerSpringStyles","useSpring","jsxs","animated"],"mappings":"gZAiCA,SAASA,CAAAA,CAAiB,CAAE,MAAA,CAAAC,CAAAA,CAAQ,eAAAC,CAAAA,CAAgB,SAAA,CAAAC,EAAW,GAAGC,CAAM,EAA0B,CAChG,IAAMC,EAAWH,CAAAA,GAAmB,OAAA,CAAUI,eAACC,gBAAAA,CAAA,EAAc,CAAA,CAAKD,cAAAA,CAACE,kBAAA,EAAe,CAAA,CAC5EC,EAAYP,CAAAA,GAAmB,OAAA,CAAUI,eAACE,iBAAAA,CAAA,EAAe,EAAKF,cAAAA,CAACC,gBAAAA,CAAA,EAAc,CAAA,CAEnF,OACED,eAACI,mBAAAA,CAAA,CACC,KAAK,IAAA,CACL,OAAA,CAAQ,yBACR,SAAA,CAAWC,mBAAAA,CACT,uBACA,CACE,cAAA,CAAgBT,IAAmB,OAAA,CACnC,eAAA,CAAiBA,IAAmB,MACtC,CAAA,CACAC,CACF,CAAA,CACC,GAAGC,EAEH,QAAA,CAAAH,CAAAA,CAASQ,EAAYJ,CAAAA,CACxB,CAEJ,CAEA,SAASO,CAAAA,CAAiB,CAAE,SAAA,CAAAT,EAAY,EAAA,CAAI,QAAA,CAAAU,EAAU,GAAGT,CAAM,EAAU,CACvE,OACEE,eAAC,KAAA,CAAA,CAAI,SAAA,CAAWK,oBAAG,6BAAA,CAA+BR,CAAS,EAAI,GAAGC,CAAAA,CAC/D,SAAAS,CAAAA,CACH,CAEJ,CAEA,SAASC,CAAAA,C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AAA,CACF,CAAA,CACF,GACF,CAEJ","file":"chunk-DR6BI7MP.cjs","sourcesContent":["import React, {\n ReactNode,\n useLayoutEffect,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n} from 'react';\nimport { useSpring, animated } from '@react-spring/web';\nimport { LuChevronLeft, LuChevronRight } from 'react-icons/lu';\nimport { Button } from '@/v2/button/button';\nimport { toPx } from '@/lib/toPx';\nimport { cn } from '@/lib/utils';\n\ntype Props = {\n className?: string;\n children: React.ReactNode;\n} & ComponentPropsWithoutRef<'div'>;\n\ntype DrawerProps = {\n isOpen: boolean;\n /** The drawer's position on the screen */\n position: 'right' | 'left';\n /** The default width in CSS units of the open drawer. A number defaults to px. */\n defaultWidth: number | string;\n /** Collapsed drawer width in CSS units. Default 4rem */\n collapsedWidth?: number | string;\n} & Props;\n\ntype FlexDrawerButtonProps = {\n isOpen: boolean;\n drawerPosition: 'right' | 'left';\n} & ComponentPropsWithoutRef<typeof Button>;\n\nfunction FlexDrawerButton({ isOpen, drawerPosition, className, ...props }: FlexDrawerButtonProps) {\n const OpenIcon = drawerPosition === 'right' ? <LuChevronLeft /> : <LuChevronRight />;\n const CloseIcon = drawerPosition === 'right' ? <LuChevronRight /> : <LuChevronLeft />;\n\n return (\n <Button\n size=\"sm\"\n variant=\"secondary-icon-rounded\"\n className={cn(\n 'absolute top-16 z-10',\n {\n 'left-[-16px]': drawerPosition === 'right',\n 'right-[-16px]': drawerPosition === 'left',\n },\n className,\n )}\n {...props}\n >\n {isOpen ? CloseIcon : OpenIcon}\n </Button>\n );\n}\n\nfunction FlexDrawerHeader({ className = '', children, ...props }: Props) {\n return (\n <div className={cn('flex h-auto w-full flex-col', className)} {...props}>\n {children}\n </div>\n );\n}\n\nfunction FlexDrawerContent({ className = '', children, ...props }: Props) {\n return (\n <div className={cn('flex h-full w-full flex-col', className)} {...props}>\n {children}\n </div>\n );\n}\n\nfunction FlexDrawerFooter({ className = '', children, ...props }: Props) {\n return (\n <div className={cn('flex w-full items-end justify-between', className)} {...props}>\n {children}\n </div>\n );\n}\n\nfunction FlexDrawer({\n position,\n className = '',\n children,\n isOpen,\n collapsedWidth = '4rem',\n defaultWidth,\n ...props\n}: DrawerProps) {\n const drawerRef = useRef<HTMLDivElement>(null);\n const [collapsedPx, setCollapsedPx] = useState(0);\n const [drawerWidth, setDrawerWidth] = useState(0);\n\n let button: ReactNode = null;\n let header: ReactNode = null;\n let footer: ReactNode = null;\n const content: ReactNode[] = [];\n\n React.Children.toArray(children).forEach((child) => {\n if (!React.isValidElement(child)) return;\n switch (child.type) {\n case FlexDrawerButton:\n button = child;\n break;\n case FlexDrawerHeader:\n header = child;\n break;\n case FlexDrawerFooter:\n footer = child;\n break;\n\n default:\n content.push(child);\n }\n });\n\n useLayoutEffect(() => {\n if (drawerRef.current) {\n setDrawerWidth(toPx(defaultWidth, drawerRef.current));\n setCollapsedPx(toPx(collapsedWidth, drawerRef.current));\n }\n }, [collapsedWidth, defaultWidth]);\n\n const outerSpringStyles = useSpring({\n width: isOpen ? drawerWidth : collapsedPx,\n minWidth: isOpen ? drawerWidth : collapsedPx,\n config: { tension: 250, friction: 30 },\n });\n\n return (\n <div className=\"relative flex\">\n {button}\n <animated.div\n role=\"region\"\n className={cn('flex-drawer-outer relative z-1 overflow-x-hidden shadow-md', {\n 'rounded-l-md border-l': position === 'right',\n 'rounded-r-md border-r': position === 'left',\n })}\n style={outerSpringStyles}\n ref={drawerRef}\n >\n <div\n style={{\n width: `${drawerWidth}px`,\n }}\n className={cn(\n 'flex-drawer-fixed absolute top-0 h-full px-4 py-6',\n {\n 'right-0': position === 'left',\n },\n\n className,\n )}\n {...props}\n >\n <div\n className={cn(\n 'flex-drawer-inner flex h-full flex-col transition-discrete duration-300 ease-out',\n {\n 'hidden opacity-0': !isOpen,\n 'visible opacity-100': isOpen,\n },\n )}\n >\n {header}\n {content}\n {footer}\n </div>\n </div>\n </animated.div>\n </div>\n );\n}\n\nexport { FlexDrawer, FlexDrawerButton, FlexDrawerHeader, FlexDrawerContent, FlexDrawerFooter };\n"]}
1
+ {"version":3,"sources":["../src/v2/flex-drawer/flex-drawer.tsx"],"names":["FlexDrawerButton","isOpen","drawerPosition","className","props","OpenIcon","jsx","LuChevronLeft","LuChevronRight","CloseIcon","Button","cn","FlexDrawerHeader","children","FlexDrawerContent","FlexDrawerFooter","FlexDrawer","position","collapsedWidth","defaultWidth","drawerRef","useRef","collapsedPx","setCollapsedPx","useState","drawerWidth","setDrawerWidth","button","header","footer","content","React","child","useLayoutEffect","toPx","outerSpringStyles","useSpring","jsxs","animated"],"mappings":"gZAiCA,SAASA,CAAAA,CAAiB,CAAE,MAAA,CAAAC,CAAAA,CAAQ,eAAAC,CAAAA,CAAgB,SAAA,CAAAC,EAAW,GAAGC,CAAM,EAA0B,CAChG,IAAMC,EAAWH,CAAAA,GAAmB,OAAA,CAAUI,eAACC,gBAAAA,CAAA,EAAc,CAAA,CAAKD,cAAAA,CAACE,kBAAA,EAAe,CAAA,CAC5EC,EAAYP,CAAAA,GAAmB,OAAA,CAAUI,eAACE,iBAAAA,CAAA,EAAe,EAAKF,cAAAA,CAACC,gBAAAA,CAAA,EAAc,CAAA,CAEnF,OACED,eAACI,mBAAAA,CAAA,CACC,KAAK,IAAA,CACL,OAAA,CAAQ,yBACR,SAAA,CAAWC,mBAAAA,CACT,uBACA,CACE,cAAA,CAAgBT,IAAmB,OAAA,CACnC,eAAA,CAAiBA,IAAmB,MACtC,CAAA,CACAC,CACF,CAAA,CACC,GAAGC,EAEH,QAAA,CAAAH,CAAAA,CAASQ,EAAYJ,CAAAA,CACxB,CAEJ,CAEA,SAASO,CAAAA,CAAiB,CAAE,SAAA,CAAAT,EAAY,EAAA,CAAI,QAAA,CAAAU,EAAU,GAAGT,CAAM,EAAU,CACvE,OACEE,eAAC,KAAA,CAAA,CAAI,SAAA,CAAWK,oBAAG,6BAAA,CAA+BR,CAAS,EAAI,GAAGC,CAAAA,CAC/D,SAAAS,CAAAA,CACH,CAEJ,CAEA,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A,CACAD,GACH,CAAA,CACF,CAAA,CACF,GACF,CAEJ","file":"chunk-SM7PYFD2.cjs","sourcesContent":["import React, {\n ReactNode,\n useLayoutEffect,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n} from 'react';\nimport { useSpring, animated } from '@react-spring/web';\nimport { LuChevronLeft, LuChevronRight } from 'react-icons/lu';\nimport { Button } from '@/v2/button/button';\nimport { toPx } from '@/lib/toPx';\nimport { cn } from '@/lib/utils';\n\ntype Props = {\n className?: string;\n children: React.ReactNode;\n} & ComponentPropsWithoutRef<'div'>;\n\ntype DrawerProps = {\n isOpen: boolean;\n /** The drawer's position on the screen */\n position: 'right' | 'left';\n /** The default width in CSS units of the open drawer. A number defaults to px. */\n defaultWidth: number | string;\n /** Collapsed drawer width in CSS units. Default 4rem */\n collapsedWidth?: number | string;\n} & Props;\n\ntype FlexDrawerButtonProps = {\n isOpen: boolean;\n drawerPosition: 'right' | 'left';\n} & ComponentPropsWithoutRef<typeof Button>;\n\nfunction FlexDrawerButton({ isOpen, drawerPosition, className, ...props }: FlexDrawerButtonProps) {\n const OpenIcon = drawerPosition === 'right' ? <LuChevronLeft /> : <LuChevronRight />;\n const CloseIcon = drawerPosition === 'right' ? <LuChevronRight /> : <LuChevronLeft />;\n\n return (\n <Button\n size=\"sm\"\n variant=\"secondary-icon-rounded\"\n className={cn(\n 'absolute top-16 z-10',\n {\n 'left-[-16px]': drawerPosition === 'right',\n 'right-[-16px]': drawerPosition === 'left',\n },\n className,\n )}\n {...props}\n >\n {isOpen ? CloseIcon : OpenIcon}\n </Button>\n );\n}\n\nfunction FlexDrawerHeader({ className = '', children, ...props }: Props) {\n return (\n <div className={cn('flex h-auto w-full flex-col', className)} {...props}>\n {children}\n </div>\n );\n}\n\nfunction FlexDrawerContent({ className = '', children, ...props }: Props) {\n return (\n <div className={cn('flex h-full w-full flex-col', className)} {...props}>\n {children}\n </div>\n );\n}\n\nfunction FlexDrawerFooter({ className = '', children, ...props }: Props) {\n return (\n <div className={cn('flex w-full items-end justify-between', className)} {...props}>\n {children}\n </div>\n );\n}\n\nfunction FlexDrawer({\n position,\n className = '',\n children,\n isOpen,\n collapsedWidth = '4rem',\n defaultWidth,\n ...props\n}: DrawerProps) {\n const drawerRef = useRef<HTMLDivElement>(null);\n const [collapsedPx, setCollapsedPx] = useState(0);\n const [drawerWidth, setDrawerWidth] = useState(0);\n\n let button: ReactNode = null;\n let header: ReactNode = null;\n let footer: ReactNode = null;\n const content: ReactNode[] = [];\n\n React.Children.toArray(children).forEach((child) => {\n if (!React.isValidElement(child)) return;\n switch (child.type) {\n case FlexDrawerButton:\n button = child;\n break;\n case FlexDrawerHeader:\n header = child;\n break;\n case FlexDrawerFooter:\n footer = child;\n break;\n\n default:\n content.push(child);\n }\n });\n\n useLayoutEffect(() => {\n if (drawerRef.current) {\n setDrawerWidth(toPx(defaultWidth, drawerRef.current));\n setCollapsedPx(toPx(collapsedWidth, drawerRef.current));\n }\n }, [collapsedWidth, defaultWidth]);\n\n const outerSpringStyles = useSpring({\n width: isOpen ? drawerWidth : collapsedPx,\n minWidth: isOpen ? drawerWidth : collapsedPx,\n config: { tension: 250, friction: 30 },\n });\n\n return (\n <div className=\"relative flex\">\n {button}\n <animated.div\n role=\"region\"\n className={cn('flex-drawer-outer relative z-1 overflow-x-hidden shadow-md', {\n 'rounded-l-md border-l': position === 'right',\n 'rounded-r-md border-r': position === 'left',\n })}\n style={outerSpringStyles}\n ref={drawerRef}\n >\n <div\n style={{\n width: `${drawerWidth}px`,\n }}\n className={cn(\n 'flex-drawer-fixed absolute top-0 h-full px-4 py-6',\n {\n 'right-0': position === 'left',\n },\n\n className,\n )}\n {...props}\n >\n <div\n className={cn(\n 'flex-drawer-inner flex h-full flex-col transition-discrete duration-300 ease-out',\n {\n 'hidden opacity-0': !isOpen,\n 'visible opacity-100': isOpen,\n },\n )}\n >\n {header}\n {content}\n {footer}\n </div>\n </div>\n </animated.div>\n </div>\n );\n}\n\nexport { FlexDrawer, FlexDrawerButton, FlexDrawerHeader, FlexDrawerContent, FlexDrawerFooter };\n"]}
@@ -1,2 +1,2 @@
1
- import {a as a$1,g,i,j,f}from'./chunk-IB6D4HIL.js';import {a}from'./chunk-YTIIAU4W.js';import {forwardRef}from'react';import {Command}from'cmdk';import {LuSearch}from'react-icons/lu';import {jsx,jsxs}from'react/jsx-runtime';var C=forwardRef(({className:o,...e},a$1)=>jsx(Command,{"data-slot":"command",ref:a$1,className:a("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",o),...e}));function P({title:o="Command Palette",description:e="Search for a command to run...",children:a$2,className:c,...u}){return jsxs(a$1,{...u,children:[jsxs(g,{className:"sr-only",children:[jsx(i,{children:o}),jsx(j,{children:e})]}),jsx(f,{className:a("overflow-hidden p-0",c),children:jsx(C,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:a$2})})]})}function w({className:o,...e}){return jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[jsx(LuSearch,{className:"size-4 shrink-0 opacity-50"}),jsx(Command.Input,{"data-slot":"command-input",className:a("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 outline-hidden disabled:cursor-not-allowed disabled:opacity-50",o),...e})]})}function D({className:o,...e}){return jsx(Command.List,{"data-slot":"command-list",className:a("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",o),...e})}function N({...o}){return jsx(Command.Empty,{"data-slot":"command-empty",className:"py-6 text-center",...o})}function b({className:o,...e}){return jsx(Command.Group,{"data-slot":"command-group",className:a("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",o),...e})}function I({className:o,...e}){return jsx(Command.Separator,{"data-slot":"command-separator",className:a("bg-border -mx-1 h-px",o),...e})}function S({className:o,...e}){return jsx(Command.Item,{"data-slot":"command-item",className:a("data-[selected=true]:bg-accent data-[selected=true]:text-primary [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),...e})}function L({className:o,...e}){return jsx("span",{"data-slot":"command-shortcut",className:a("text-muted-foreground ml-auto text-xs tracking-widest",o),...e})}export{C as a,P as b,w as c,D as d,N as e,b as f,I as g,S as h,L as i};//# sourceMappingURL=chunk-EN66V63W.js.map
2
- //# sourceMappingURL=chunk-EN66V63W.js.map
1
+ import {a as a$1,g,i,j,f}from'./chunk-VO2GGQ2X.js';import {a}from'./chunk-YTIIAU4W.js';import {forwardRef}from'react';import {Command}from'cmdk';import {LuSearch}from'react-icons/lu';import {jsx,jsxs}from'react/jsx-runtime';var C=forwardRef(({className:o,...e},a$1)=>jsx(Command,{"data-slot":"command",ref:a$1,className:a("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",o),...e}));function P({title:o="Command Palette",description:e="Search for a command to run...",children:a$2,className:c,...u}){return jsxs(a$1,{...u,children:[jsxs(g,{className:"sr-only",children:[jsx(i,{children:o}),jsx(j,{children:e})]}),jsx(f,{className:a("overflow-hidden p-0",c),children:jsx(C,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:a$2})})]})}function w({className:o,...e}){return jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[jsx(LuSearch,{className:"size-4 shrink-0 opacity-50"}),jsx(Command.Input,{"data-slot":"command-input",className:a("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 outline-hidden disabled:cursor-not-allowed disabled:opacity-50",o),...e})]})}function D({className:o,...e}){return jsx(Command.List,{"data-slot":"command-list",className:a("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",o),...e})}function N({...o}){return jsx(Command.Empty,{"data-slot":"command-empty",className:"py-6 text-center",...o})}function b({className:o,...e}){return jsx(Command.Group,{"data-slot":"command-group",className:a("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",o),...e})}function I({className:o,...e}){return jsx(Command.Separator,{"data-slot":"command-separator",className:a("bg-border -mx-1 h-px",o),...e})}function S({className:o,...e}){return jsx(Command.Item,{"data-slot":"command-item",className:a("data-[selected=true]:bg-accent data-[selected=true]:text-primary [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),...e})}function L({className:o,...e}){return jsx("span",{"data-slot":"command-shortcut",className:a("text-muted-foreground ml-auto text-xs tracking-widest",o),...e})}export{C as a,P as b,w as c,D as d,N as e,b as f,I as g,S as h,L as i};//# sourceMappingURL=chunk-SMTXYI6Q.js.map
2
+ //# sourceMappingURL=chunk-SMTXYI6Q.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/v2/command/command.tsx"],"names":["Command","forwardRef","className","props","forwardedRef","jsx","CommandPrimitive","cn","CommandDialog","title","description","children","jsxs","Dialog","DialogHeader","DialogTitle","DialogDescription","DialogContent","CommandInput","LuSearch","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","CommandShortcut"],"mappings":"gOAaA,IAAMA,CAAAA,CAAUC,UAAAA,CACd,CAAC,CAAE,SAAA,CAAAC,EAAW,GAAGC,CAAM,CAAA,CAAGC,GAAAA,GAEtBC,GAAAA,CAACC,OAAAA,CAAA,CACC,WAAA,CAAU,UACV,GAAA,CAAKF,GAAAA,CACL,SAAA,CAAWG,CAAAA,CACT,2FAAA,CACAL,CACF,CAAA,CACC,GAAGC,EACN,CAGN,EAEA,SAASK,CAAAA,CAAc,CACrB,KAAA,CAAAC,CAAAA,CAAQ,iBAAA,CACR,YAAAC,CAAAA,CAAc,gCAAA,CACd,QAAA,CAAAC,GAAAA,CACA,SAAA,CAAAT,CAAAA,CACA,GAAGC,CACL,EAIG,CACD,OACES,IAAAA,CAACC,GAAAA,CAAA,CAAQ,GAAGV,CAAAA,CACV,QAAA,CAAA,CAAAS,KAACE,CAAAA,CAAA,CAAa,SAAA,CAAU,SAAA,CACtB,QAAA,CAAA,CAAAT,GAAAA,CAACU,CAAAA,CAAA,CAAa,SAAAN,CAAAA,CAAM,CAAA,CACpBJ,GAAAA,CAACW,CAAAA,CAAA,CAAmB,QAAA,CAAAN,CAAAA,CAAY,CAAA,CAAA,CAClC,EACAL,GAAAA,CAACY,CAAAA,CAAA,CAAc,SAAA,CAAWV,CAAAA,CAAG,qBAAA,CAAuBL,CAAS,CAAA,CAC3D,SAAAG,G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,CAAArB,CAAAA,CACA,GAAGC,CACL,CAAA,CAAsD,CACpD,OACEE,GAAAA,CAACC,OAAAA,CAAiB,SAAA,CAAjB,CACC,WAAA,CAAU,oBACV,SAAA,CAAWC,CAAAA,CAAG,sBAAA,CAAwBL,CAAS,CAAA,CAC9C,GAAGC,CAAAA,CACN,CAEJ,CAEA,SAASqB,CAAAA,CAAY,CAAE,SAAA,CAAAtB,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAiD,CAC1F,OACEE,GAAAA,CAACC,OAAAA,CAAiB,IAAA,CAAjB,CACC,WAAA,CAAU,cAAA,CACV,SAAA,CAAWC,EACT,mXAAA,CACAL,CACF,CAAA,CACC,GAAGC,CAAAA,CACN,CAEJ,CAEA,SAASsB,EAAgB,CAAE,SAAA,CAAAvB,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAA2B,CACxE,OACEE,IAAC,MAAA,CAAA,CACC,WAAA,CAAU,kBAAA,CACV,SAAA,CAAWE,EAAG,uDAAA,CAAyDL,CAAS,CAAA,CAC/E,GAAGC,EACN,CAEJ","file":"chunk-EN66V63W.js","sourcesContent":["import { ComponentProps, forwardRef } from 'react';\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { LuSearch } from 'react-icons/lu';\n\nimport { cn } from '@/lib/utils';\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from '@/v2/dialog/dialog';\n\nconst Command = forwardRef<HTMLDivElement, ComponentProps<typeof CommandPrimitive>>(\n ({ className, ...props }, forwardedRef) => {\n return (\n <CommandPrimitive\n data-slot=\"command\"\n ref={forwardedRef}\n className={cn(\n 'bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md',\n className,\n )}\n {...props}\n />\n );\n },\n);\n\nfunction CommandDialog({\n title = 'Command Palette',\n description = 'Search for a command to run...',\n children,\n className,\n ...props\n}: ComponentProps<typeof Dialog> & {\n title?: string;\n description?: string;\n className?: string;\n}) {\n return (\n <Dialog {...props}>\n <DialogHeader className=\"sr-only\">\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n <DialogContent className={cn('overflow-hidden p-0', className)}>\n <Command className=\"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction CommandInput({ className, ...props }: ComponentProps<typeof CommandPrimitive.Input>) {\n return (\n <div data-slot=\"command-input-wrapper\" className=\"flex h-9 items-center gap-2 border-b px-3\">\n <LuSearch className=\"size-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n data-slot=\"command-input\"\n className={cn(\n 'placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 outline-hidden disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n />\n </div>\n );\n}\n\nfunction CommandList({ className, ...props }: ComponentProps<typeof CommandPrimitive.List>) {\n return (\n <CommandPrimitive.List\n data-slot=\"command-list\"\n className={cn('max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto', className)}\n {...props}\n />\n );\n}\n\nfunction CommandEmpty({ ...props }: ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty data-slot=\"command-empty\" className=\"py-6 text-center\" {...props} />\n );\n}\n\nfunction CommandGroup({ className, ...props }: ComponentProps<typeof CommandPrimitive.Group>) {\n return (\n <CommandPrimitive.Group\n data-slot=\"command-group\"\n className={cn(\n 'text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandSeparator({\n className,\n ...props\n}: ComponentProps<typeof CommandPrimitive.Separator>) {\n return (\n <CommandPrimitive.Separator\n data-slot=\"command-separator\"\n className={cn('bg-border -mx-1 h-px', className)}\n {...props}\n />\n );\n}\n\nfunction CommandItem({ className, ...props }: ComponentProps<typeof CommandPrimitive.Item>) {\n return (\n <CommandPrimitive.Item\n data-slot=\"command-item\"\n className={cn(\n \"data-[selected=true]:bg-accent data-[selected=true]:text-primary [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandShortcut({ className, ...props }: ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"command-shortcut\"\n className={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)}\n {...props}\n />\n );\n}\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n"]}
1
+ {"version":3,"sources":["../src/v2/command/command.tsx"],"names":["Command","forwardRef","className","props","forwardedRef","jsx","CommandPrimitive","cn","CommandDialog","title","description","children","jsxs","Dialog","DialogHeader","DialogTitle","DialogDescription","DialogContent","CommandInput","LuSearch","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","CommandShortcut"],"mappings":"gOAaA,IAAMA,CAAAA,CAAUC,UAAAA,CACd,CAAC,CAAE,SAAA,CAAAC,EAAW,GAAGC,CAAM,CAAA,CAAGC,GAAAA,GAEtBC,GAAAA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M,CAAA,CAA2B,CACxE,OACEE,IAAC,MAAA,CAAA,CACC,WAAA,CAAU,kBAAA,CACV,SAAA,CAAWE,EAAG,uDAAA,CAAyDL,CAAS,CAAA,CAC/E,GAAGC,EACN,CAEJ","file":"chunk-SMTXYI6Q.js","sourcesContent":["import { ComponentProps, forwardRef } from 'react';\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { LuSearch } from 'react-icons/lu';\n\nimport { cn } from '@/lib/utils';\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from '@/v2/dialog/dialog';\n\nconst Command = forwardRef<HTMLDivElement, ComponentProps<typeof CommandPrimitive>>(\n ({ className, ...props }, forwardedRef) => {\n return (\n <CommandPrimitive\n data-slot=\"command\"\n ref={forwardedRef}\n className={cn(\n 'bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md',\n className,\n )}\n {...props}\n />\n );\n },\n);\n\nfunction CommandDialog({\n title = 'Command Palette',\n description = 'Search for a command to run...',\n children,\n className,\n ...props\n}: ComponentProps<typeof Dialog> & {\n title?: string;\n description?: string;\n className?: string;\n}) {\n return (\n <Dialog {...props}>\n <DialogHeader className=\"sr-only\">\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n <DialogContent className={cn('overflow-hidden p-0', className)}>\n <Command className=\"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction CommandInput({ className, ...props }: ComponentProps<typeof CommandPrimitive.Input>) {\n return (\n <div data-slot=\"command-input-wrapper\" className=\"flex h-9 items-center gap-2 border-b px-3\">\n <LuSearch className=\"size-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n data-slot=\"command-input\"\n className={cn(\n 'placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 outline-hidden disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n />\n </div>\n );\n}\n\nfunction CommandList({ className, ...props }: ComponentProps<typeof CommandPrimitive.List>) {\n return (\n <CommandPrimitive.List\n data-slot=\"command-list\"\n className={cn('max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto', className)}\n {...props}\n />\n );\n}\n\nfunction CommandEmpty({ ...props }: ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty data-slot=\"command-empty\" className=\"py-6 text-center\" {...props} />\n );\n}\n\nfunction CommandGroup({ className, ...props }: ComponentProps<typeof CommandPrimitive.Group>) {\n return (\n <CommandPrimitive.Group\n data-slot=\"command-group\"\n className={cn(\n 'text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandSeparator({\n className,\n ...props\n}: ComponentProps<typeof CommandPrimitive.Separator>) {\n return (\n <CommandPrimitive.Separator\n data-slot=\"command-separator\"\n className={cn('bg-border -mx-1 h-px', className)}\n {...props}\n />\n );\n}\n\nfunction CommandItem({ className, ...props }: ComponentProps<typeof CommandPrimitive.Item>) {\n return (\n <CommandPrimitive.Item\n data-slot=\"command-item\"\n className={cn(\n \"data-[selected=true]:bg-accent data-[selected=true]:text-primary [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandShortcut({ className, ...props }: ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"command-shortcut\"\n className={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)}\n {...props}\n />\n );\n}\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n"]}
@@ -1,2 +1,2 @@
1
- import {b}from'./chunk-YCZSXQP4.js';import {a as a$1}from'./chunk-J3GR47HY.js';import {a}from'./chunk-YTIIAU4W.js';import w,{useRef,useState,useLayoutEffect}from'react';import {useSpring,animated}from'@react-spring/web';import {LuChevronLeft,LuChevronRight}from'react-icons/lu';import {jsx,jsxs}from'react/jsx-runtime';function E({isOpen:t,drawerPosition:e,className:o,...l}){let i=e==="right"?jsx(LuChevronLeft,{}):jsx(LuChevronRight,{}),s=e==="right"?jsx(LuChevronRight,{}):jsx(LuChevronLeft,{});return jsx(b,{size:"sm",variant:"secondary-icon-rounded",className:a("absolute top-16 z-10",{"left-[-16px]":e==="right","right-[-16px]":e==="left"},o),...l,children:t?s:i})}function S({className:t="",children:e,...o}){return jsx("div",{className:a("flex h-auto w-full flex-col",t),...o,children:e})}function $({className:t="",children:e,...o}){return jsx("div",{className:a("flex h-full w-full flex-col",t),...o,children:e})}function k({className:t="",children:e,...o}){return jsx("div",{className:a("flex w-full items-end justify-between",t),...o,children:e})}function j({position:t,className:e="",children:o,isOpen:l,collapsedWidth:i="4rem",defaultWidth:s,...R}){let d=useRef(null),[c,P]=useState(0),[u,D]=useState(0),p=null,m=null,h=null,x=[];w.Children.toArray(o).forEach(a=>{if(w.isValidElement(a))switch(a.type){case E:p=a;break;case S:m=a;break;case k:h=a;break;default:x.push(a);}}),useLayoutEffect(()=>{d.current&&(D(a$1(s,d.current)),P(a$1(i,d.current)));},[i,s]);let C=useSpring({width:l?u:c,minWidth:l?u:c,config:{tension:250,friction:30}});return jsxs("div",{className:"relative flex",children:[p,jsx(animated.div,{role:"region",className:a("flex-drawer-outer relative z-1 overflow-x-hidden shadow-md",{"rounded-l-md border-l":t==="right","rounded-r-md border-r":t==="left"}),style:C,ref:d,children:jsx("div",{style:{width:`${u}px`},className:a("flex-drawer-fixed absolute top-0 h-full px-4 py-6",{"right-0":t==="left"},e),...R,children:jsxs("div",{className:a("flex-drawer-inner flex h-full flex-col transition-discrete duration-300 ease-out",{"hidden opacity-0":!l,"visible opacity-100":l}),children:[m,x,h]})})})]})}export{E as a,S as b,$ as c,k as d,j as e};//# sourceMappingURL=chunk-AIGGWECF.js.map
2
- //# sourceMappingURL=chunk-AIGGWECF.js.map
1
+ import {b}from'./chunk-JH4FQUIS.js';import {a as a$1}from'./chunk-J3GR47HY.js';import {a}from'./chunk-YTIIAU4W.js';import w,{useRef,useState,useLayoutEffect}from'react';import {useSpring,animated}from'@react-spring/web';import {LuChevronLeft,LuChevronRight}from'react-icons/lu';import {jsx,jsxs}from'react/jsx-runtime';function E({isOpen:t,drawerPosition:e,className:o,...l}){let i=e==="right"?jsx(LuChevronLeft,{}):jsx(LuChevronRight,{}),s=e==="right"?jsx(LuChevronRight,{}):jsx(LuChevronLeft,{});return jsx(b,{size:"sm",variant:"secondary-icon-rounded",className:a("absolute top-16 z-10",{"left-[-16px]":e==="right","right-[-16px]":e==="left"},o),...l,children:t?s:i})}function S({className:t="",children:e,...o}){return jsx("div",{className:a("flex h-auto w-full flex-col",t),...o,children:e})}function $({className:t="",children:e,...o}){return jsx("div",{className:a("flex h-full w-full flex-col",t),...o,children:e})}function k({className:t="",children:e,...o}){return jsx("div",{className:a("flex w-full items-end justify-between",t),...o,children:e})}function j({position:t,className:e="",children:o,isOpen:l,collapsedWidth:i="4rem",defaultWidth:s,...R}){let d=useRef(null),[c,P]=useState(0),[u,D]=useState(0),p=null,m=null,h=null,x=[];w.Children.toArray(o).forEach(a=>{if(w.isValidElement(a))switch(a.type){case E:p=a;break;case S:m=a;break;case k:h=a;break;default:x.push(a);}}),useLayoutEffect(()=>{d.current&&(D(a$1(s,d.current)),P(a$1(i,d.current)));},[i,s]);let C=useSpring({width:l?u:c,minWidth:l?u:c,config:{tension:250,friction:30}});return jsxs("div",{className:"relative flex",children:[p,jsx(animated.div,{role:"region",className:a("flex-drawer-outer relative z-1 overflow-x-hidden shadow-md",{"rounded-l-md border-l":t==="right","rounded-r-md border-r":t==="left"}),style:C,ref:d,children:jsx("div",{style:{width:`${u}px`},className:a("flex-drawer-fixed absolute top-0 h-full px-4 py-6",{"right-0":t==="left"},e),...R,children:jsxs("div",{className:a("flex-drawer-inner flex h-full flex-col transition-discrete duration-300 ease-out",{"hidden opacity-0":!l,"visible opacity-100":l}),children:[m,x,h]})})})]})}export{E as a,S as b,$ as c,k as d,j as e};//# sourceMappingURL=chunk-UVZVZAGK.js.map
2
+ //# sourceMappingURL=chunk-UVZVZAGK.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/v2/flex-drawer/flex-drawer.tsx"],"names":["FlexDrawerButton","isOpen","drawerPosition","className","props","OpenIcon","jsx","LuChevronLeft","LuChevronRight","CloseIcon","Button","cn","FlexDrawerHeader","children","FlexDrawerContent","FlexDrawerFooter","FlexDrawer","position","collapsedWidth","defaultWidth","drawerRef","useRef","collapsedPx","setCollapsedPx","useState","drawerWidth","setDrawerWidth","button","header","footer","content","React","child","useLayoutEffect","toPx","outerSpringStyles","useSpring","jsxs","animated"],"mappings":"+TAiCA,SAASA,CAAAA,CAAiB,CAAE,MAAA,CAAAC,CAAAA,CAAQ,eAAAC,CAAAA,CAAgB,SAAA,CAAAC,EAAW,GAAGC,CAAM,EAA0B,CAChG,IAAMC,EAAWH,CAAAA,GAAmB,OAAA,CAAUI,IAACC,aAAAA,CAAA,EAAc,CAAA,CAAKD,GAAAA,CAAC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,eAAA,CACZ,UAAAV,CAAAA,CACDrB,GAAAA,CAACgC,SAAS,GAAA,CAAT,CACC,KAAK,QAAA,CACL,SAAA,CAAW3B,EAAG,4DAAA,CAA8D,CAC1E,wBAAyBM,CAAAA,GAAa,OAAA,CACtC,wBAAyBA,CAAAA,GAAa,MACxC,CAAC,CAAA,CACD,KAAA,CAAOkB,EACP,GAAA,CAAKf,CAAAA,CAEL,SAAAd,GAAAA,CAAC,KAAA,CAAA,CACC,MAAO,CACL,KAAA,CAAO,GAAGmB,CAAW,CAAA,EAAA,CACvB,EACA,SAAA,CAAWd,CAAAA,CACT,oDACA,CACE,SAAA,CAAWM,IAAa,MAC1B,CAAA,CAEAd,CACF,CAAA,CACC,GAAGC,EAEJ,QAAA,CAAAiC,IAAAA,CAAC,OACC,SAAA,CAAW1B,CAAAA,CACT,mFACA,CACE,kBAAA,CAAoB,CAACV,CAAAA,CACrB,qBAAA,CAAuBA,CACzB,CACF,CAAA,CAEC,UAAA2B,CAAAA,CACAE,CAAAA,CACAD,GACH,CAAA,CACF,CAAA,CACF,GACF,CAEJ","file":"chunk-AIGGWECF.js","sourcesContent":["import React, {\n ReactNode,\n useLayoutEffect,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n} from 'react';\nimport { useSpring, animated } from '@react-spring/web';\nimport { LuChevronLeft, LuChevronRight } from 'react-icons/lu';\nimport { Button } from '@/v2/button/button';\nimport { toPx } from '@/lib/toPx';\nimport { cn } from '@/lib/utils';\n\ntype Props = {\n className?: string;\n children: React.ReactNode;\n} & ComponentPropsWithoutRef<'div'>;\n\ntype DrawerProps = {\n isOpen: boolean;\n /** The drawer's position on the screen */\n position: 'right' | 'left';\n /** The default width in CSS units of the open drawer. A number defaults to px. */\n defaultWidth: number | string;\n /** Collapsed drawer width in CSS units. Default 4rem */\n collapsedWidth?: number | string;\n} & Props;\n\ntype FlexDrawerButtonProps = {\n isOpen: boolean;\n drawerPosition: 'right' | 'left';\n} & ComponentPropsWithoutRef<typeof Button>;\n\nfunction FlexDrawerButton({ isOpen, drawerPosition, className, ...props }: FlexDrawerButtonProps) {\n const OpenIcon = drawerPosition === 'right' ? <LuChevronLeft /> : <LuChevronRight />;\n const CloseIcon = drawerPosition === 'right' ? <LuChevronRight /> : <LuChevronLeft />;\n\n return (\n <Button\n size=\"sm\"\n variant=\"secondary-icon-rounded\"\n className={cn(\n 'absolute top-16 z-10',\n {\n 'left-[-16px]': drawerPosition === 'right',\n 'right-[-16px]': drawerPosition === 'left',\n },\n className,\n )}\n {...props}\n >\n {isOpen ? CloseIcon : OpenIcon}\n </Button>\n );\n}\n\nfunction FlexDrawerHeader({ className = '', children, ...props }: Props) {\n return (\n <div className={cn('flex h-auto w-full flex-col', className)} {...props}>\n {children}\n </div>\n );\n}\n\nfunction FlexDrawerContent({ className = '', children, ...props }: Props) {\n return (\n <div className={cn('flex h-full w-full flex-col', className)} {...props}>\n {children}\n </div>\n );\n}\n\nfunction FlexDrawerFooter({ className = '', children, ...props }: Props) {\n return (\n <div className={cn('flex w-full items-end justify-between', className)} {...props}>\n {children}\n </div>\n );\n}\n\nfunction FlexDrawer({\n position,\n className = '',\n children,\n isOpen,\n collapsedWidth = '4rem',\n defaultWidth,\n ...props\n}: DrawerProps) {\n const drawerRef = useRef<HTMLDivElement>(null);\n const [collapsedPx, setCollapsedPx] = useState(0);\n const [drawerWidth, setDrawerWidth] = useState(0);\n\n let button: ReactNode = null;\n let header: ReactNode = null;\n let footer: ReactNode = null;\n const content: ReactNode[] = [];\n\n React.Children.toArray(children).forEach((child) => {\n if (!React.isValidElement(child)) return;\n switch (child.type) {\n case FlexDrawerButton:\n button = child;\n break;\n case FlexDrawerHeader:\n header = child;\n break;\n case FlexDrawerFooter:\n footer = child;\n break;\n\n default:\n content.push(child);\n }\n });\n\n useLayoutEffect(() => {\n if (drawerRef.current) {\n setDrawerWidth(toPx(defaultWidth, drawerRef.current));\n setCollapsedPx(toPx(collapsedWidth, drawerRef.current));\n }\n }, [collapsedWidth, defaultWidth]);\n\n const outerSpringStyles = useSpring({\n width: isOpen ? drawerWidth : collapsedPx,\n minWidth: isOpen ? drawerWidth : collapsedPx,\n config: { tension: 250, friction: 30 },\n });\n\n return (\n <div className=\"relative flex\">\n {button}\n <animated.div\n role=\"region\"\n className={cn('flex-drawer-outer relative z-1 overflow-x-hidden shadow-md', {\n 'rounded-l-md border-l': position === 'right',\n 'rounded-r-md border-r': position === 'left',\n })}\n style={outerSpringStyles}\n ref={drawerRef}\n >\n <div\n style={{\n width: `${drawerWidth}px`,\n }}\n className={cn(\n 'flex-drawer-fixed absolute top-0 h-full px-4 py-6',\n {\n 'right-0': position === 'left',\n },\n\n className,\n )}\n {...props}\n >\n <div\n className={cn(\n 'flex-drawer-inner flex h-full flex-col transition-discrete duration-300 ease-out',\n {\n 'hidden opacity-0': !isOpen,\n 'visible opacity-100': isOpen,\n },\n )}\n >\n {header}\n {content}\n {footer}\n </div>\n </div>\n </animated.div>\n </div>\n );\n}\n\nexport { FlexDrawer, FlexDrawerButton, FlexDrawerHeader, FlexDrawerContent, FlexDrawerFooter };\n"]}
1
+ {"version":3,"sources":["../src/v2/flex-drawer/flex-drawer.tsx"],"names":["FlexDrawerButton","isOpen","drawerPosition","className","props","OpenIcon","jsx","LuChevronLeft","LuChevronRight","CloseIcon","Button","cn","FlexDrawerHeader","children","FlexDrawerContent","FlexDrawerFooter","FlexDrawer","position","collapsedWidth","defaultWidth","drawerRef","useRef","collapsedPx","setCollapsedPx","useState","drawerWidth","setDrawerWidth","button","header","footer","content","React","child","useLayoutEffect","toPx","outerSpringStyles","useSpring","jsxs","animated"],"mappings":"+TAiCA,SAASA,CAAAA,CAAiB,CAAE,MAAA,CAAAC,CAAAA,CAAQ,eAAAC,CAAAA,CAAgB,SAAA,CAAAC,EAAW,GAAGC,CAAM,EAA0B,CAChG,IAAMC,EAAWH,CAAAA,GAAmB,OAAA,CAAUI,IAACC,aAAAA,CAAA,EAAc,CAAA,CAAKD,GAAAA,CAACE,eAAA,E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Z,UAAAV,CAAAA,CACDrB,GAAAA,CAACgC,SAAS,GAAA,CAAT,CACC,KAAK,QAAA,CACL,SAAA,CAAW3B,EAAG,4DAAA,CAA8D,CAC1E,wBAAyBM,CAAAA,GAAa,OAAA,CACtC,wBAAyBA,CAAAA,GAAa,MACxC,CAAC,CAAA,CACD,KAAA,CAAOkB,EACP,GAAA,CAAKf,CAAAA,CAEL,SAAAd,GAAAA,CAAC,KAAA,CAAA,CACC,MAAO,CACL,KAAA,CAAO,GAAGmB,CAAW,CAAA,EAAA,CACvB,EACA,SAAA,CAAWd,CAAAA,CACT,oDACA,CACE,SAAA,CAAWM,IAAa,MAC1B,CAAA,CAEAd,CACF,CAAA,CACC,GAAGC,EAEJ,QAAA,CAAAiC,IAAAA,CAAC,OACC,SAAA,CAAW1B,CAAAA,CACT,mFACA,CACE,kBAAA,CAAoB,CAACV,CAAAA,CACrB,qBAAA,CAAuBA,CACzB,CACF,CAAA,CAEC,UAAA2B,CAAAA,CACAE,CAAAA,CACAD,GACH,CAAA,CACF,CAAA,CACF,GACF,CAEJ","file":"chunk-UVZVZAGK.js","sourcesContent":["import React, {\n ReactNode,\n useLayoutEffect,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n} from 'react';\nimport { useSpring, animated } from '@react-spring/web';\nimport { LuChevronLeft, LuChevronRight } from 'react-icons/lu';\nimport { Button } from '@/v2/button/button';\nimport { toPx } from '@/lib/toPx';\nimport { cn } from '@/lib/utils';\n\ntype Props = {\n className?: string;\n children: React.ReactNode;\n} & ComponentPropsWithoutRef<'div'>;\n\ntype DrawerProps = {\n isOpen: boolean;\n /** The drawer's position on the screen */\n position: 'right' | 'left';\n /** The default width in CSS units of the open drawer. A number defaults to px. */\n defaultWidth: number | string;\n /** Collapsed drawer width in CSS units. Default 4rem */\n collapsedWidth?: number | string;\n} & Props;\n\ntype FlexDrawerButtonProps = {\n isOpen: boolean;\n drawerPosition: 'right' | 'left';\n} & ComponentPropsWithoutRef<typeof Button>;\n\nfunction FlexDrawerButton({ isOpen, drawerPosition, className, ...props }: FlexDrawerButtonProps) {\n const OpenIcon = drawerPosition === 'right' ? <LuChevronLeft /> : <LuChevronRight />;\n const CloseIcon = drawerPosition === 'right' ? <LuChevronRight /> : <LuChevronLeft />;\n\n return (\n <Button\n size=\"sm\"\n variant=\"secondary-icon-rounded\"\n className={cn(\n 'absolute top-16 z-10',\n {\n 'left-[-16px]': drawerPosition === 'right',\n 'right-[-16px]': drawerPosition === 'left',\n },\n className,\n )}\n {...props}\n >\n {isOpen ? CloseIcon : OpenIcon}\n </Button>\n );\n}\n\nfunction FlexDrawerHeader({ className = '', children, ...props }: Props) {\n return (\n <div className={cn('flex h-auto w-full flex-col', className)} {...props}>\n {children}\n </div>\n );\n}\n\nfunction FlexDrawerContent({ className = '', children, ...props }: Props) {\n return (\n <div className={cn('flex h-full w-full flex-col', className)} {...props}>\n {children}\n </div>\n );\n}\n\nfunction FlexDrawerFooter({ className = '', children, ...props }: Props) {\n return (\n <div className={cn('flex w-full items-end justify-between', className)} {...props}>\n {children}\n </div>\n );\n}\n\nfunction FlexDrawer({\n position,\n className = '',\n children,\n isOpen,\n collapsedWidth = '4rem',\n defaultWidth,\n ...props\n}: DrawerProps) {\n const drawerRef = useRef<HTMLDivElement>(null);\n const [collapsedPx, setCollapsedPx] = useState(0);\n const [drawerWidth, setDrawerWidth] = useState(0);\n\n let button: ReactNode = null;\n let header: ReactNode = null;\n let footer: ReactNode = null;\n const content: ReactNode[] = [];\n\n React.Children.toArray(children).forEach((child) => {\n if (!React.isValidElement(child)) return;\n switch (child.type) {\n case FlexDrawerButton:\n button = child;\n break;\n case FlexDrawerHeader:\n header = child;\n break;\n case FlexDrawerFooter:\n footer = child;\n break;\n\n default:\n content.push(child);\n }\n });\n\n useLayoutEffect(() => {\n if (drawerRef.current) {\n setDrawerWidth(toPx(defaultWidth, drawerRef.current));\n setCollapsedPx(toPx(collapsedWidth, drawerRef.current));\n }\n }, [collapsedWidth, defaultWidth]);\n\n const outerSpringStyles = useSpring({\n width: isOpen ? drawerWidth : collapsedPx,\n minWidth: isOpen ? drawerWidth : collapsedPx,\n config: { tension: 250, friction: 30 },\n });\n\n return (\n <div className=\"relative flex\">\n {button}\n <animated.div\n role=\"region\"\n className={cn('flex-drawer-outer relative z-1 overflow-x-hidden shadow-md', {\n 'rounded-l-md border-l': position === 'right',\n 'rounded-r-md border-r': position === 'left',\n })}\n style={outerSpringStyles}\n ref={drawerRef}\n >\n <div\n style={{\n width: `${drawerWidth}px`,\n }}\n className={cn(\n 'flex-drawer-fixed absolute top-0 h-full px-4 py-6',\n {\n 'right-0': position === 'left',\n },\n\n className,\n )}\n {...props}\n >\n <div\n className={cn(\n 'flex-drawer-inner flex h-full flex-col transition-discrete duration-300 ease-out',\n {\n 'hidden opacity-0': !isOpen,\n 'visible opacity-100': isOpen,\n },\n )}\n >\n {header}\n {content}\n {footer}\n </div>\n </div>\n </animated.div>\n </div>\n );\n}\n\nexport { FlexDrawer, FlexDrawerButton, FlexDrawerHeader, FlexDrawerContent, FlexDrawerFooter };\n"]}
@@ -1,2 +1,2 @@
1
- import {b as b$1}from'./chunk-YCZSXQP4.js';import {a}from'./chunk-YTIIAU4W.js';import {a as a$1}from'./chunk-CWXZFXQT.js';import {b}from'./chunk-6MYNQMQU.js';import {createContext,forwardRef,useContext,useMemo}from'react';import {Drawer}from'vaul';import*as i from'@radix-ui/react-dialog';import {LuX}from'react-icons/lu';import {jsx,jsxs}from'react/jsx-runtime';var s=createContext({isResponsive:true});function z({disableDrawerOnMobile:t=false,...e}){let{isMobile:a}=b(),r=useMemo(()=>({isResponsive:!t}),[t]);return jsx(s.Provider,{value:r,children:a&&!t?jsx(Drawer.Root,{"data-slot":"drawer",direction:"bottom",...e}):jsx(i.Root,{"data-slot":"dialog",...e})})}function B({...t}){let{isMobile:e}=b(),{isResponsive:a}=useContext(s);return e&&a?jsx(Drawer.Trigger,{"data-slot":"drawer-trigger",...t}):jsx(i.Trigger,{"data-slot":"dialog-trigger",...t})}function f({...t}){let{isMobile:e}=b(),{isResponsive:a}=useContext(s);return e&&a?jsx(Drawer.Portal,{"data-slot":"drawer-portal",...t}):jsx(i.Portal,{"data-slot":"dialog-portal",...t})}function P({...t}){let{isMobile:e}=b(),{isResponsive:a}=useContext(s);return e&&a?jsx(Drawer.Close,{"data-slot":"drawer-close",...t}):jsx(i.Close,{"data-slot":"dialog-close",...t})}var w=forwardRef(({className:t,...e},a$1)=>{let{isMobile:r}=b(),{isResponsive:c}=useContext(s);return r&&c?jsx(Drawer.Overlay,{"data-slot":"drawer-overlay",className:a("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 z-modal-stacking-context fixed inset-0 bg-black/50",t),ref:a$1,...e}):jsx(i.Overlay,{"data-slot":"dialog-overlay",className:a("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 z-modal-stacking-context fixed inset-0 bg-black/50",t),ref:a$1,...e})}),O=forwardRef(({className:t,children:e=null,overlayClassName:a$1,...r},c)=>{let{isMobile:C}=b(),{isResponsive:b$1}=useContext(s);return C&&b$1?jsxs(f,{"data-slot":"drawer-portal",children:[jsx(w,{className:a$1}),jsx(Drawer.Content,{"data-slot":"drawer-content",className:a("group/drawer-content bg-background z-modal-stacking-context fixed flex h-auto flex-col px-4","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-md","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm","max-w-dvw!",t),ref:c,...r,children:e})]}):jsxs(f,{"data-slot":"dialog-portal",children:[jsx(w,{className:a$1}),jsx(i.Content,{"data-slot":"dialog-content",className:a("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-modal-stacking-context fixed top-[50%] left-[50%] grid w-[calc(100%-2rem)] max-w-[34.4rem] translate-x-[-50%] translate-y-[-50%] rounded-lg border border-gray-300 p-6 shadow-sm duration-200",t),ref:c,...r,children:e})]})});function H({className:t,showCloseButton:e=true,...a$1}){let{isMobile:r}=b(),{isResponsive:c}=useContext(s);return r&&c?jsxs("div",{"data-slot":"drawer-header",className:a("relative flex flex-col gap-0.5 pt-6 pb-4 text-left md:gap-1.5",t),...a$1,children:[e&&jsx(P,{asChild:true,children:jsxs(b$1,{className:"absolute top-5 right-0",size:"sm",variant:"ghost-icon",children:[jsx(LuX,{}),jsx("span",{className:"sr-only",children:"Close dialog"})]})}),a$1.children]}):jsxs("div",{"data-slot":"dialog-header",className:a("relative flex flex-col gap-2 pb-4",t),...a$1,children:[e&&jsx(P,{asChild:true,children:jsxs(b$1,{className:"absolute top-0 right-0",size:"sm",variant:"ghost-icon",children:[jsx(LuX,{}),jsx("span",{className:"sr-only",children:"Close dialog"})]})}),a$1.children]})}function L({className:t,...e}){let{isMobile:a$1}=b(),{isResponsive:r}=useContext(s);return a$1&&r?jsx("div",{"data-slot":"drawer-footer",className:a("mt-auto flex flex-col gap-2 py-4",t),...e}):jsx("div",{"data-slot":"dialog-footer",className:a("mt-2 flex gap-2 pt-3",t),...e})}function E({className:t,...e}){let{isMobile:a$2}=a$1(),{isResponsive:r}=useContext(s);return a$2&&r?jsx(Drawer.Title,{"data-slot":"drawer-title",className:a("font-display pr-6 text-3xl",t),...e}):jsx(i.Title,{"data-slot":"dialog-title",className:a("font-display pr-6 text-3xl leading-none tracking-[0.01rem]",t),...e})}function F({className:t,...e}){let{isMobile:a$1}=b(),{isResponsive:r}=useContext(s);return a$1&&r?jsx(Drawer.Description,{"data-slot":"drawer-description",className:t,...e}):jsx(i.Description,{"data-slot":"dialog-description",className:a("text-muted-foreground text-sm",t),...e})}export{z as a,B as b,f as c,P as d,w as e,O as f,H as g,L as h,E as i,F as j};//# sourceMappingURL=chunk-IB6D4HIL.js.map
2
- //# sourceMappingURL=chunk-IB6D4HIL.js.map
1
+ import {b as b$1}from'./chunk-JH4FQUIS.js';import {a}from'./chunk-YTIIAU4W.js';import {a as a$1}from'./chunk-CWXZFXQT.js';import {b}from'./chunk-6MYNQMQU.js';import {createContext,forwardRef,useContext,useMemo}from'react';import {Drawer}from'vaul';import*as i from'@radix-ui/react-dialog';import {LuX}from'react-icons/lu';import {jsx,jsxs}from'react/jsx-runtime';var s=createContext({isResponsive:true});function z({disableDrawerOnMobile:t=false,...e}){let{isMobile:a}=b(),r=useMemo(()=>({isResponsive:!t}),[t]);return jsx(s.Provider,{value:r,children:a&&!t?jsx(Drawer.Root,{"data-slot":"drawer",direction:"bottom",...e}):jsx(i.Root,{"data-slot":"dialog",...e})})}function B({...t}){let{isMobile:e}=b(),{isResponsive:a}=useContext(s);return e&&a?jsx(Drawer.Trigger,{"data-slot":"drawer-trigger",...t}):jsx(i.Trigger,{"data-slot":"dialog-trigger",...t})}function f({...t}){let{isMobile:e}=b(),{isResponsive:a}=useContext(s);return e&&a?jsx(Drawer.Portal,{"data-slot":"drawer-portal",...t}):jsx(i.Portal,{"data-slot":"dialog-portal",...t})}function P({...t}){let{isMobile:e}=b(),{isResponsive:a}=useContext(s);return e&&a?jsx(Drawer.Close,{"data-slot":"drawer-close",...t}):jsx(i.Close,{"data-slot":"dialog-close",...t})}var w=forwardRef(({className:t,...e},a$1)=>{let{isMobile:r}=b(),{isResponsive:c}=useContext(s);return r&&c?jsx(Drawer.Overlay,{"data-slot":"drawer-overlay",className:a("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 z-modal-stacking-context fixed inset-0 bg-black/50",t),ref:a$1,...e}):jsx(i.Overlay,{"data-slot":"dialog-overlay",className:a("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 z-modal-stacking-context fixed inset-0 bg-black/50",t),ref:a$1,...e})}),O=forwardRef(({className:t,children:e=null,overlayClassName:a$1,...r},c)=>{let{isMobile:C}=b(),{isResponsive:b$1}=useContext(s);return C&&b$1?jsxs(f,{"data-slot":"drawer-portal",children:[jsx(w,{className:a$1}),jsx(Drawer.Content,{"data-slot":"drawer-content",className:a("group/drawer-content bg-background z-modal-stacking-context fixed flex h-auto flex-col px-4","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-md","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm","max-w-dvw!",t),ref:c,...r,children:e})]}):jsxs(f,{"data-slot":"dialog-portal",children:[jsx(w,{className:a$1}),jsx(i.Content,{"data-slot":"dialog-content",className:a("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-modal-stacking-context fixed top-[50%] left-[50%] grid w-[calc(100%-2rem)] max-w-[34.4rem] translate-x-[-50%] translate-y-[-50%] rounded-lg border border-gray-300 p-6 shadow-sm duration-200",t),ref:c,...r,children:e})]})});function H({className:t,showCloseButton:e=true,...a$1}){let{isMobile:r}=b(),{isResponsive:c}=useContext(s);return r&&c?jsxs("div",{"data-slot":"drawer-header",className:a("relative flex flex-col gap-0.5 pt-6 pb-4 text-left md:gap-1.5",t),...a$1,children:[e&&jsx(P,{asChild:true,children:jsxs(b$1,{className:"absolute top-5 right-0",size:"sm",variant:"ghost-icon",children:[jsx(LuX,{}),jsx("span",{className:"sr-only",children:"Close dialog"})]})}),a$1.children]}):jsxs("div",{"data-slot":"dialog-header",className:a("relative flex flex-col gap-2 pb-4",t),...a$1,children:[e&&jsx(P,{asChild:true,children:jsxs(b$1,{className:"absolute top-0 right-0",size:"sm",variant:"ghost-icon",children:[jsx(LuX,{}),jsx("span",{className:"sr-only",children:"Close dialog"})]})}),a$1.children]})}function L({className:t,...e}){let{isMobile:a$1}=b(),{isResponsive:r}=useContext(s);return a$1&&r?jsx("div",{"data-slot":"drawer-footer",className:a("mt-auto flex flex-col gap-2 py-4",t),...e}):jsx("div",{"data-slot":"dialog-footer",className:a("mt-2 flex gap-2 pt-3",t),...e})}function E({className:t,...e}){let{isMobile:a$2}=a$1(),{isResponsive:r}=useContext(s);return a$2&&r?jsx(Drawer.Title,{"data-slot":"drawer-title",className:a("font-display pr-6 text-3xl",t),...e}):jsx(i.Title,{"data-slot":"dialog-title",className:a("font-display pr-6 text-3xl leading-none tracking-[0.01rem]",t),...e})}function F({className:t,...e}){let{isMobile:a$1}=b(),{isResponsive:r}=useContext(s);return a$1&&r?jsx(Drawer.Description,{"data-slot":"drawer-description",className:t,...e}):jsx(i.Description,{"data-slot":"dialog-description",className:a("text-muted-foreground text-sm",t),...e})}export{z as a,B as b,f as c,P as d,w as e,O as f,H as g,L as h,E as i,F as j};//# sourceMappingURL=chunk-VO2GGQ2X.js.map
2
+ //# sourceMappingURL=chunk-VO2GGQ2X.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/v2/dialog/dialog.tsx"],"names":["DialogContext","createContext","Dialog","disableDrawerOnMobile","props","isMobile","useWindowSize_default","contextValue","useMemo","jsx","DrawerPrimitive","DialogTrigger","isResponsive","useContext","DialogPortal","DialogClose","DialogOverlay","forwardRef","className","ref","cn","DialogContent","children","overlayClassName","jsxs","DialogHeader","showCloseButton","Button","LuX","DialogFooter","DialogTitle","useIsMobile","DialogDescription"],"mappings":"2WASA,IAAMA,CAAAA,CAAgBC,aAAAA,CAAc,CAAE,YAAA,CAAc,IAAK,CAAC,CAAA,CAE1D,SAASC,CAAAA,CAAO,CACd,sBAAAC,CAAAA,CAAwB,KAAA,CACxB,GAAGC,CACL,EACqF,CACnF,GAAM,CAAE,QAAA,CAAAC,CAAS,CAAA,CAAIC,CAAAA,EAAc,CAE7BC,CAAAA,CAAeC,QACnB,KAAO,CAAE,YAAA,CAAc,CAACL,CAAsB,CAAA,CAAA,CAC9C,CAACA,CAAqB,CACxB,EAEA,OACEM,GAAAA,CAACT,CAAAA,CAAc,QAAA,CAAd,CAAuB,KAAA,CAAOO,CAAAA,CAC5B,QAAA,CAAAF,CAAAA,EAAY,CAACF,CAAAA,CACZM,GAAAA,CAACC,OAAgB,IAAA,CAAhB,CAAqB,YAAU,QAAA,CAAS,SAAA,CAAU,QAAA,CAAU,GAAGN,EAAO,CAAA,CAEvEK,GA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,EAAIC,UAAAA,CAAWb,CAAa,CAAA,CACjD,OAAIK,KAAYO,CAAAA,CAEZH,GAAAA,CAACC,MAAAA,CAAgB,KAAA,CAAhB,CACC,WAAA,CAAU,cAAA,CACV,SAAA,CAAWU,CAAAA,CAAG,6BAA8BF,CAAS,CAAA,CACpD,GAAGd,CAAAA,CACN,EAIFK,GAAAA,CAAiB,CAAA,CAAA,KAAA,CAAhB,CACC,WAAA,CAAU,eACV,SAAA,CAAWW,CAAAA,CAAG,4DAAA,CAA8DF,CAAS,EACpF,GAAGd,CAAAA,CACN,CAEJ,CAEA,SAAS4B,CAAAA,CAAkB,CACzB,UAAAd,CAAAA,CACA,GAAGd,CACL,CAAA,CACsD,CACpD,GAAM,CAAE,SAAAC,GAAS,CAAA,CAAIC,CAAAA,EAAc,CAC7B,CAAE,YAAA,CAAAM,CAAa,CAAA,CAAIC,UAAAA,CAAWb,CAAa,CAAA,CACjD,OAAIK,KAAYO,CAAAA,CAEZH,GAAAA,CAACC,OAAgB,WAAA,CAAhB,CACC,WAAA,CAAU,oBAAA,CACV,UAAWQ,CAAAA,CACV,GAAGd,CAAAA,CACN,CAAA,CAIFK,IAAiB,CAAA,CAAA,WAAA,CAAhB,CACC,WAAA,CAAU,oBAAA,CACV,UAAWW,CAAAA,CAAG,+BAAA,CAAiCF,CAAS,CAAA,CACvD,GAAGd,EACN,CAEJ","file":"chunk-IB6D4HIL.js","sourcesContent":["import { type ComponentProps, createContext, forwardRef, useContext, useMemo } from 'react';\nimport { Drawer as DrawerPrimitive } from 'vaul';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { LuX } from 'react-icons/lu';\n\nimport { cn } from '@/lib/utils';\nimport { Button } from '../button/button';\nimport { useIsMobile, useWindowSize } from '@/hooks';\n\nconst DialogContext = createContext({ isResponsive: true });\n\nfunction Dialog({\n disableDrawerOnMobile = false,\n ...props\n}: ComponentProps<typeof DialogPrimitive.Root> &\n ComponentProps<typeof DrawerPrimitive.Root> & { disableDrawerOnMobile?: boolean }) {\n const { isMobile } = useWindowSize();\n\n const contextValue = useMemo(\n () => ({ isResponsive: !disableDrawerOnMobile }),\n [disableDrawerOnMobile],\n );\n\n return (\n <DialogContext.Provider value={contextValue}>\n {isMobile && !disableDrawerOnMobile ? (\n <DrawerPrimitive.Root data-slot=\"drawer\" direction=\"bottom\" {...props} />\n ) : (\n <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n )}\n </DialogContext.Provider>\n );\n}\n\nfunction DialogTrigger({\n ...props\n}: ComponentProps<typeof DialogPrimitive.Trigger> &\n ComponentProps<typeof DrawerPrimitive.Trigger>) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n }\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n ...props\n}: ComponentProps<typeof DialogPrimitive.Portal> & ComponentProps<typeof DrawerPrimitive.Portal>) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />;\n }\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n ...props\n}: ComponentProps<typeof DialogPrimitive.Close> & ComponentProps<typeof DrawerPrimitive.Close>) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n }\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nconst DialogOverlay = forwardRef<\n HTMLDivElement,\n ComponentProps<typeof DialogPrimitive.Overlay> & ComponentProps<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 z-modal-stacking-context fixed inset-0 bg-black/50',\n className,\n )}\n ref={ref}\n {...props}\n />\n );\n }\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 z-modal-stacking-context fixed inset-0 bg-black/50',\n className,\n )}\n ref={ref}\n {...props}\n />\n );\n});\n\nconst DialogContent = forwardRef<\n HTMLDivElement,\n ComponentProps<typeof DialogPrimitive.Content> &\n ComponentProps<typeof DrawerPrimitive.Content> & {\n onBackButtonClick?: () => void;\n overlayClassName?: string | undefined;\n }\n>(({ className, children = null, overlayClassName, ...props }, ref) => {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return (\n <DialogPortal data-slot=\"drawer-portal\">\n <DialogOverlay className={overlayClassName} />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n 'group/drawer-content bg-background z-modal-stacking-context fixed flex h-auto flex-col px-4',\n 'data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b',\n 'data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t',\n 'data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-md',\n 'data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm',\n 'max-w-dvw!',\n className,\n )}\n ref={ref}\n {...props}\n >\n {children}\n </DrawerPrimitive.Content>\n </DialogPortal>\n );\n }\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay className={overlayClassName} />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-modal-stacking-context fixed top-[50%] left-[50%] grid w-[calc(100%-2rem)] max-w-[34.4rem] translate-x-[-50%] translate-y-[-50%] rounded-lg border border-gray-300 p-6 shadow-sm duration-200',\n className,\n )}\n ref={ref}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n});\n\nfunction DialogHeader({\n className,\n showCloseButton = true,\n ...props\n}: ComponentProps<'div'> & {\n showCloseButton?: boolean;\n}) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn('relative flex flex-col gap-0.5 pt-6 pb-4 text-left md:gap-1.5', className)}\n {...props}\n >\n {showCloseButton && (\n <DialogClose asChild>\n <Button className=\"absolute top-5 right-0\" size=\"sm\" variant=\"ghost-icon\">\n <LuX />\n <span className=\"sr-only\">Close dialog</span>\n </Button>\n </DialogClose>\n )}\n {props.children}\n </div>\n );\n }\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn('relative flex flex-col gap-2 pb-4', className)}\n {...props}\n >\n {showCloseButton && (\n <DialogClose asChild>\n <Button className=\"absolute top-0 right-0\" size=\"sm\" variant=\"ghost-icon\">\n <LuX />\n <span className=\"sr-only\">Close dialog</span>\n </Button>\n </DialogClose>\n )}\n {props.children}\n </div>\n );\n}\n\nfunction DialogFooter({ className, ...props }: ComponentProps<'div'>) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn('mt-auto flex flex-col gap-2 py-4', className)}\n {...props}\n />\n );\n }\n return (\n <div data-slot=\"dialog-footer\" className={cn('mt-2 flex gap-2 pt-3', className)} {...props} />\n );\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: ComponentProps<typeof DialogPrimitive.Title> & ComponentProps<typeof DrawerPrimitive.Title>) {\n const { isMobile } = useIsMobile();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn('font-display pr-6 text-3xl', className)}\n {...props}\n />\n );\n }\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('font-display pr-6 text-3xl leading-none tracking-[0.01rem]', className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: ComponentProps<typeof DialogPrimitive.Description> &\n ComponentProps<typeof DrawerPrimitive.Description>) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={className}\n {...props}\n />\n );\n }\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"]}
1
+ {"version":3,"sources":["../src/v2/dialog/dialog.tsx"],"names":["DialogContext","createContext","Dialog","disableDrawerOnMobile","props","isMobile","useWindowSize_default","contextValue","useMemo","jsx","DrawerPrimitive","DialogTrigger","isResponsive","useContext","DialogPortal","DialogClose","DialogOverlay","forwardRef","className","ref","cn","DialogContent","children","overlayClassName","jsxs","DialogHeader","showCloseButton","Button","LuX","DialogFooter","DialogTitle","useIsMobile","DialogDescription"],"mappings":"2WASA,IAAMA,CAAAA,CAAgBC,aAAAA,CAAc,CAAE,YAAA,CAAc,IAAK,CAAC,CAAA,CAE1D,SAASC,CAAAA,CAAO,CACd,sBAAAC,CAAAA,CAAwB,KAAA,CACxB,GAAGC,CACL,EACqF,CACnF,GAAM,CAAE,QAAA,CAAAC,CAAS,CAAA,CAAIC,CAAAA,EAAc,CAE7BC,CAAAA,CAAeC,QACnB,KAAO,CAAE,YAAA,CAAc,CAACL,CAAsB,CAAA,CAAA,CAC9C,CAACA,CAAqB,CACxB,EAEA,OACEM,GAAAA,CAACT,CAAAA,CAAc,QAAA,CAAd,CAAuB,KAAA,CAAOO,CAAAA,CAC5B,QAAA,CAAAF,CAAAA,EAAY,CAACF,CAAAA,CACZM,GAAAA,CAACC,OAAgB,IAAA,CAAhB,CAAqB,YAAU,QAAA,CAAS,SAAA,CAAU,QAAA,CAAU,GAAGN,EAAO,CAAA,CAEvEK,GAAAA,CAAiB,CAAA,CAAA,IAAA,CAAhB,CAAqB,YAAU,QAAA,CAAU,GAAGL,CAAAA,CAAO,CAAA,CAExD,CAEJ,CAEA,SAASO,CAAAA,CAAc,CACrB,GAAGP,CACL,CAAA,CACkD,CAChD,GAAM,CAAE,QAAA,CAAAC,CAAS,CAAA,CAAIC,CAAAA,GACf,CAAE,YAAA,CAAAM,CAAa,CAAA,CAAIC,WAAWb,CAAa,CAAA,CACjD,OAAIK,CAAAA,EAAYO,CAAAA,CACPH,IAACC,MAAAA,CAAgB,OAAA,CAAhB,CAAwB,WAAA,CAAU,iBAAkB,GAAGN,CAAAA,CAAO,CAAA,CAEjEK,GAAAA,CAAiB,UAAhB,CAAwB,WAAA,CAAU,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,SAAAC,GAAS,CAAA,CAAIC,CAAAA,EAAc,CAC7B,CAAE,YAAA,CAAAM,CAAa,CAAA,CAAIC,UAAAA,CAAWb,CAAa,CAAA,CACjD,OAAIK,KAAYO,CAAAA,CAEZH,GAAAA,CAACC,OAAgB,WAAA,CAAhB,CACC,WAAA,CAAU,oBAAA,CACV,UAAWQ,CAAAA,CACV,GAAGd,CAAAA,CACN,CAAA,CAIFK,IAAiB,CAAA,CAAA,WAAA,CAAhB,CACC,WAAA,CAAU,oBAAA,CACV,UAAWW,CAAAA,CAAG,+BAAA,CAAiCF,CAAS,CAAA,CACvD,GAAGd,EACN,CAEJ","file":"chunk-VO2GGQ2X.js","sourcesContent":["import { type ComponentProps, createContext, forwardRef, useContext, useMemo } from 'react';\nimport { Drawer as DrawerPrimitive } from 'vaul';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { LuX } from 'react-icons/lu';\n\nimport { cn } from '@/lib/utils';\nimport { Button } from '../button/button';\nimport { useIsMobile, useWindowSize } from '@/hooks';\n\nconst DialogContext = createContext({ isResponsive: true });\n\nfunction Dialog({\n disableDrawerOnMobile = false,\n ...props\n}: ComponentProps<typeof DialogPrimitive.Root> &\n ComponentProps<typeof DrawerPrimitive.Root> & { disableDrawerOnMobile?: boolean }) {\n const { isMobile } = useWindowSize();\n\n const contextValue = useMemo(\n () => ({ isResponsive: !disableDrawerOnMobile }),\n [disableDrawerOnMobile],\n );\n\n return (\n <DialogContext.Provider value={contextValue}>\n {isMobile && !disableDrawerOnMobile ? (\n <DrawerPrimitive.Root data-slot=\"drawer\" direction=\"bottom\" {...props} />\n ) : (\n <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n )}\n </DialogContext.Provider>\n );\n}\n\nfunction DialogTrigger({\n ...props\n}: ComponentProps<typeof DialogPrimitive.Trigger> &\n ComponentProps<typeof DrawerPrimitive.Trigger>) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n }\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n ...props\n}: ComponentProps<typeof DialogPrimitive.Portal> & ComponentProps<typeof DrawerPrimitive.Portal>) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />;\n }\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n ...props\n}: ComponentProps<typeof DialogPrimitive.Close> & ComponentProps<typeof DrawerPrimitive.Close>) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n }\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nconst DialogOverlay = forwardRef<\n HTMLDivElement,\n ComponentProps<typeof DialogPrimitive.Overlay> & ComponentProps<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 z-modal-stacking-context fixed inset-0 bg-black/50',\n className,\n )}\n ref={ref}\n {...props}\n />\n );\n }\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 z-modal-stacking-context fixed inset-0 bg-black/50',\n className,\n )}\n ref={ref}\n {...props}\n />\n );\n});\n\nconst DialogContent = forwardRef<\n HTMLDivElement,\n ComponentProps<typeof DialogPrimitive.Content> &\n ComponentProps<typeof DrawerPrimitive.Content> & {\n onBackButtonClick?: () => void;\n overlayClassName?: string | undefined;\n }\n>(({ className, children = null, overlayClassName, ...props }, ref) => {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return (\n <DialogPortal data-slot=\"drawer-portal\">\n <DialogOverlay className={overlayClassName} />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n 'group/drawer-content bg-background z-modal-stacking-context fixed flex h-auto flex-col px-4',\n 'data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b',\n 'data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t',\n 'data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-md',\n 'data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm',\n 'max-w-dvw!',\n className,\n )}\n ref={ref}\n {...props}\n >\n {children}\n </DrawerPrimitive.Content>\n </DialogPortal>\n );\n }\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay className={overlayClassName} />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-modal-stacking-context fixed top-[50%] left-[50%] grid w-[calc(100%-2rem)] max-w-[34.4rem] translate-x-[-50%] translate-y-[-50%] rounded-lg border border-gray-300 p-6 shadow-sm duration-200',\n className,\n )}\n ref={ref}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n});\n\nfunction DialogHeader({\n className,\n showCloseButton = true,\n ...props\n}: ComponentProps<'div'> & {\n showCloseButton?: boolean;\n}) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn('relative flex flex-col gap-0.5 pt-6 pb-4 text-left md:gap-1.5', className)}\n {...props}\n >\n {showCloseButton && (\n <DialogClose asChild>\n <Button className=\"absolute top-5 right-0\" size=\"sm\" variant=\"ghost-icon\">\n <LuX />\n <span className=\"sr-only\">Close dialog</span>\n </Button>\n </DialogClose>\n )}\n {props.children}\n </div>\n );\n }\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn('relative flex flex-col gap-2 pb-4', className)}\n {...props}\n >\n {showCloseButton && (\n <DialogClose asChild>\n <Button className=\"absolute top-0 right-0\" size=\"sm\" variant=\"ghost-icon\">\n <LuX />\n <span className=\"sr-only\">Close dialog</span>\n </Button>\n </DialogClose>\n )}\n {props.children}\n </div>\n );\n}\n\nfunction DialogFooter({ className, ...props }: ComponentProps<'div'>) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn('mt-auto flex flex-col gap-2 py-4', className)}\n {...props}\n />\n );\n }\n return (\n <div data-slot=\"dialog-footer\" className={cn('mt-2 flex gap-2 pt-3', className)} {...props} />\n );\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: ComponentProps<typeof DialogPrimitive.Title> & ComponentProps<typeof DrawerPrimitive.Title>) {\n const { isMobile } = useIsMobile();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn('font-display pr-6 text-3xl', className)}\n {...props}\n />\n );\n }\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('font-display pr-6 text-3xl leading-none tracking-[0.01rem]', className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: ComponentProps<typeof DialogPrimitive.Description> &\n ComponentProps<typeof DrawerPrimitive.Description>) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={className}\n {...props}\n />\n );\n }\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkKUUJM4SB_cjs=require('./chunk-KUUJM4SB.cjs'),chunkQRO22BPZ_cjs=require('./chunk-QRO22BPZ.cjs'),jsxRuntime=require('react/jsx-runtime');var m=({id:h,children:i=null,className:b,classNames:r={},columns:o=2,value:t,onValueChange:C,items:l=[],...n})=>{let u=(e,s)=>{let g=s?[...t,e]:t.filter(d=>d!==e);C(g);};return jsxRuntime.jsx("div",{className:chunkQRO22BPZ_cjs.a("grid gap-2",o===1&&"grid-cols-1",o===2&&"grid-cols-2",o===3&&"grid-cols-3",o===4&&"grid-cols-4",b,r?.base),id:h,children:l?.length?l.map(e=>jsxRuntime.jsx(chunkKUUJM4SB_cjs.a,{classNames:r?.buttonCheckbox,checked:t.includes(e.value),onCheckedChange:s=>u(e.value,s),size:n.size,...n,children:e.label},e.value)):i})};exports.a=m;//# sourceMappingURL=chunk-M4I2WW74.cjs.map
2
- //# sourceMappingURL=chunk-M4I2WW74.cjs.map
1
+ 'use strict';var chunkFXLG3LU3_cjs=require('./chunk-FXLG3LU3.cjs'),chunkQRO22BPZ_cjs=require('./chunk-QRO22BPZ.cjs'),jsxRuntime=require('react/jsx-runtime');var m=({id:h,children:i=null,className:b,classNames:r={},columns:o=2,value:t,onValueChange:C,items:l=[],...n})=>{let u=(e,s)=>{let g=s?[...t,e]:t.filter(d=>d!==e);C(g);};return jsxRuntime.jsx("div",{className:chunkQRO22BPZ_cjs.a("grid gap-2",o===1&&"grid-cols-1",o===2&&"grid-cols-2",o===3&&"grid-cols-3",o===4&&"grid-cols-4",b,r?.base),id:h,children:l?.length?l.map(e=>jsxRuntime.jsx(chunkFXLG3LU3_cjs.a,{classNames:r?.buttonCheckbox,checked:t.includes(e.value),onCheckedChange:s=>u(e.value,s),size:n.size,...n,children:e.label},e.value)):i})};exports.a=m;//# sourceMappingURL=chunk-VTBYJGTJ.cjs.map
2
+ //# sourceMappingURL=chunk-VTBYJGTJ.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/v2/checkbox-group/checkbox-group.tsx"],"names":["CheckboxGroup","id","children","className","classNames","columns","value","onValueChange","items","props","handleToggle","optionValue","checked","newValues","v","jsx","cn","option","ButtonCheckbox"],"mappings":"6JAsBO,IAAMA,CAAAA,CAAgB,CAAC,CAC5B,EAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CAAW,IAAA,CACX,SAAA,CAAAC,CAAAA,CACA,WAAAC,CAAAA,CAAa,EAAC,CACd,OAAA,CAAAC,CAAAA,CAAU,CAAA,CACV,KAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CAAQ,EAAC,CACT,GAAGC,CACL,CAAA,GAA0B,CACxB,IAAMC,CAAAA,CAAe,CAACC,CAAAA,CAAqBC,CAAAA,GAAqB,CAC9D,IAAMC,CAAAA,CAAYD,CAAAA,CAAU,CAAC,GAAGN,CAAAA,CAAOK,CAAW,CAAA,CAAIL,CAAAA,CAAM,MAAA,CAAQQ,CAAAA,EAAMA,CAAAA,GAAMH,CAAW,CAAA,CAC3FJ,CAAAA,CAAcM,CAAS,EACzB,CAAA,CAEA,OACEE,cAAAA,CAAC,KAAA,CAAA,CACC,UAAWC,mBAAAA,CACT,YAAA,CACAX,CAAAA,GAAY,CAAA,EAAK,aAAA,CACjBA,CAAAA,GAAY,CAAA,EAAK,aAAA,CACjBA,CAAAA,GAAY,CAAA,EAAK,aAAA,CACjBA,CAAAA,GAAY,CAAA,EAAK,aAAA,CACjBF,EACAC,CAAAA,EAAY,IACd,CAAA,CACA,EAAA,CAAIH,CAAAA,CAEH,QAAA,CAAAO,CAAAA,EAAO,MAAA,CACJA,CAAAA,CAAM,GAAA,CAAKS,CAAAA,EACTF,cAAAA,CAACG,mBAAAA,CAAA,CACC,WAAYd,CAAAA,EAAY,cAAA,CAExB,OAAA,CAASE,CAAAA,CAAM,QAAA,CAASW,CAAAA,CAAO,KAAK,CAAA,CACpC,eAAA,CAAkBL,CAAAA,EAAqBF,CAAAA,CAAaO,CAAAA,CAAO,KAAA,CAAOL,CAAO,CAAA,CACzE,IAAA,CAAMH,CAAAA,CAAM,IAAA,CACX,GAAGA,CAAAA,CAEH,QAAA,CAAAQ,CAAAA,CAAO,KAAA,CAAA,CANHA,CAAAA,CAAO,KAOd,CACD,CAAA,CACDf,CAAAA,CACN,CAEJ","file":"chunk-M4I2WW74.cjs","sourcesContent":["import type { ComponentProps, PropsWithChildren } from 'react';\nimport { cn } from '@/lib/utils';\nimport { ButtonCheckbox, type ButtonCheckboxSlots } from '../checkbox/button-checkbox';\nimport type { Slots } from '../types';\n\nexport type CheckboxGroupSlots = Slots & {\n classNames?: {\n buttonCheckbox?: ButtonCheckboxSlots['classNames'];\n };\n};\n\nexport type CheckboxGroupProps = Omit<\n ComponentProps<typeof ButtonCheckbox>,\n 'classNames' | 'value'\n> & {\n columns?: 1 | 2 | 3 | 4;\n onValueChange: (value: string[]) => void;\n items?: { label: string; value: string }[];\n value: string[];\n} & CheckboxGroupSlots &\n PropsWithChildren;\n\nexport const CheckboxGroup = ({\n id,\n children = null,\n className,\n classNames = {},\n columns = 2,\n value,\n onValueChange,\n items = [],\n ...props\n}: CheckboxGroupProps) => {\n const handleToggle = (optionValue: string, checked: boolean) => {\n const newValues = checked ? [...value, optionValue] : value.filter((v) => v !== optionValue);\n onValueChange(newValues);\n };\n\n return (\n <div\n className={cn(\n 'grid gap-2',\n columns === 1 && 'grid-cols-1',\n columns === 2 && 'grid-cols-2',\n columns === 3 && 'grid-cols-3',\n columns === 4 && 'grid-cols-4',\n className,\n classNames?.base,\n )}\n id={id}\n >\n {items?.length\n ? items.map((option) => (\n <ButtonCheckbox\n classNames={classNames?.buttonCheckbox}\n key={option.value}\n checked={value.includes(option.value)}\n onCheckedChange={(checked: boolean) => handleToggle(option.value, checked)}\n size={props.size}\n {...props}\n >\n {option.label}\n </ButtonCheckbox>\n ))\n : children}\n </div>\n );\n};\n"]}
1
+ {"version":3,"sources":["../src/v2/checkbox-group/checkbox-group.tsx"],"names":["CheckboxGroup","id","children","className","classNames","columns","value","onValueChange","items","props","handleToggle","optionValue","checked","newValues","v","jsx","cn","option","ButtonCheckbox"],"mappings":"6JAsBO,IAAMA,CAAAA,CAAgB,CAAC,CAC5B,EAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CAAW,IAAA,CACX,SAAA,CAAAC,CAAAA,CACA,WAAAC,CAAAA,CAAa,EAAC,CACd,OAAA,CAAAC,CAAAA,CAAU,CAAA,CACV,KAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CAAQ,EAAC,CACT,GAAGC,CACL,CAAA,GAA0B,CACxB,IAAMC,CAAAA,CAAe,CAACC,CAAAA,CAAqBC,CAAAA,GAAqB,CAC9D,IAAMC,CAAAA,CAAYD,CAAAA,CAAU,CAAC,GAAGN,CAAAA,CAAOK,CAAW,CAAA,CAAIL,CAAAA,CAAM,MAAA,CAAQQ,CAAAA,EAAMA,CAAAA,GAAMH,CAAW,CAAA,CAC3FJ,CAAAA,CAAcM,CAAS,EACzB,CAAA,CAEA,OACEE,cAAAA,CAAC,KAAA,CAAA,CACC,UAAWC,mBAAAA,CACT,YAAA,CACAX,CAAAA,GAAY,CAAA,EAAK,aAAA,CACjBA,CAAAA,GAAY,CAAA,EAAK,aAAA,CACjBA,CAAAA,GAAY,CAAA,EAAK,aAAA,CACjBA,CAAAA,GAAY,CAAA,EAAK,aAAA,CACjBF,EACAC,CAAAA,EAAY,IACd,CAAA,CACA,EAAA,CAAIH,CAAAA,CAEH,QAAA,CAAAO,CAAAA,EAAO,MAAA,CACJA,CAAAA,CAAM,GAAA,CAAKS,CAAAA,EACTF,cAAAA,CAACG,mBAAAA,CAAA,CACC,WAAYd,CAAAA,EAAY,cAAA,CAExB,OAAA,CAASE,CAAAA,CAAM,QAAA,CAASW,CAAAA,CAAO,KAAK,CAAA,CACpC,eAAA,CAAkBL,CAAAA,EAAqBF,CAAAA,CAAaO,CAAAA,CAAO,KAAA,CAAOL,CAAO,CAAA,CACzE,IAAA,CAAMH,CAAAA,CAAM,IAAA,CACX,GAAGA,CAAAA,CAEH,QAAA,CAAAQ,CAAAA,CAAO,KAAA,CAAA,CANHA,CAAAA,CAAO,KAOd,CACD,CAAA,CACDf,CAAAA,CACN,CAEJ","file":"chunk-VTBYJGTJ.cjs","sourcesContent":["import type { ComponentProps, PropsWithChildren } from 'react';\nimport { cn } from '@/lib/utils';\nimport { ButtonCheckbox, type ButtonCheckboxSlots } from '../checkbox/button-checkbox';\nimport type { Slots } from '../types';\n\nexport type CheckboxGroupSlots = Slots & {\n classNames?: {\n buttonCheckbox?: ButtonCheckboxSlots['classNames'];\n };\n};\n\nexport type CheckboxGroupProps = Omit<\n ComponentProps<typeof ButtonCheckbox>,\n 'classNames' | 'value'\n> & {\n columns?: 1 | 2 | 3 | 4;\n onValueChange: (value: string[]) => void;\n items?: { label: string; value: string }[];\n value: string[];\n} & CheckboxGroupSlots &\n PropsWithChildren;\n\nexport const CheckboxGroup = ({\n id,\n children = null,\n className,\n classNames = {},\n columns = 2,\n value,\n onValueChange,\n items = [],\n ...props\n}: CheckboxGroupProps) => {\n const handleToggle = (optionValue: string, checked: boolean) => {\n const newValues = checked ? [...value, optionValue] : value.filter((v) => v !== optionValue);\n onValueChange(newValues);\n };\n\n return (\n <div\n className={cn(\n 'grid gap-2',\n columns === 1 && 'grid-cols-1',\n columns === 2 && 'grid-cols-2',\n columns === 3 && 'grid-cols-3',\n columns === 4 && 'grid-cols-4',\n className,\n classNames?.base,\n )}\n id={id}\n >\n {items?.length\n ? items.map((option) => (\n <ButtonCheckbox\n classNames={classNames?.buttonCheckbox}\n key={option.value}\n checked={value.includes(option.value)}\n onCheckedChange={(checked: boolean) => handleToggle(option.value, checked)}\n size={props.size}\n {...props}\n >\n {option.label}\n </ButtonCheckbox>\n ))\n : children}\n </div>\n );\n};\n"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkTL7AHX66_cjs=require('./chunk-TL7AHX66.cjs'),chunkQRO22BPZ_cjs=require('./chunk-QRO22BPZ.cjs'),react=require('react'),cmdk=require('cmdk'),lu=require('react-icons/lu'),jsxRuntime=require('react/jsx-runtime');var C=react.forwardRef(({className:o,...e},a)=>jsxRuntime.jsx(cmdk.Command,{"data-slot":"command",ref:a,className:chunkQRO22BPZ_cjs.a("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",o),...e}));function P({title:o="Command Palette",description:e="Search for a command to run...",children:a,className:c,...u}){return jsxRuntime.jsxs(chunkTL7AHX66_cjs.a,{...u,children:[jsxRuntime.jsxs(chunkTL7AHX66_cjs.g,{className:"sr-only",children:[jsxRuntime.jsx(chunkTL7AHX66_cjs.i,{children:o}),jsxRuntime.jsx(chunkTL7AHX66_cjs.j,{children:e})]}),jsxRuntime.jsx(chunkTL7AHX66_cjs.f,{className:chunkQRO22BPZ_cjs.a("overflow-hidden p-0",c),children:jsxRuntime.jsx(C,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:a})})]})}function w({className:o,...e}){return jsxRuntime.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[jsxRuntime.jsx(lu.LuSearch,{className:"size-4 shrink-0 opacity-50"}),jsxRuntime.jsx(cmdk.Command.Input,{"data-slot":"command-input",className:chunkQRO22BPZ_cjs.a("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 outline-hidden disabled:cursor-not-allowed disabled:opacity-50",o),...e})]})}function D({className:o,...e}){return jsxRuntime.jsx(cmdk.Command.List,{"data-slot":"command-list",className:chunkQRO22BPZ_cjs.a("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",o),...e})}function N({...o}){return jsxRuntime.jsx(cmdk.Command.Empty,{"data-slot":"command-empty",className:"py-6 text-center",...o})}function b({className:o,...e}){return jsxRuntime.jsx(cmdk.Command.Group,{"data-slot":"command-group",className:chunkQRO22BPZ_cjs.a("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",o),...e})}function I({className:o,...e}){return jsxRuntime.jsx(cmdk.Command.Separator,{"data-slot":"command-separator",className:chunkQRO22BPZ_cjs.a("bg-border -mx-1 h-px",o),...e})}function S({className:o,...e}){return jsxRuntime.jsx(cmdk.Command.Item,{"data-slot":"command-item",className:chunkQRO22BPZ_cjs.a("data-[selected=true]:bg-accent data-[selected=true]:text-primary [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),...e})}function L({className:o,...e}){return jsxRuntime.jsx("span",{"data-slot":"command-shortcut",className:chunkQRO22BPZ_cjs.a("text-muted-foreground ml-auto text-xs tracking-widest",o),...e})}exports.a=C;exports.b=P;exports.c=w;exports.d=D;exports.e=N;exports.f=b;exports.g=I;exports.h=S;exports.i=L;//# sourceMappingURL=chunk-X4O2D662.cjs.map
2
- //# sourceMappingURL=chunk-X4O2D662.cjs.map
1
+ 'use strict';var chunkL4FOTU2K_cjs=require('./chunk-L4FOTU2K.cjs'),chunkQRO22BPZ_cjs=require('./chunk-QRO22BPZ.cjs'),react=require('react'),cmdk=require('cmdk'),lu=require('react-icons/lu'),jsxRuntime=require('react/jsx-runtime');var C=react.forwardRef(({className:o,...e},a)=>jsxRuntime.jsx(cmdk.Command,{"data-slot":"command",ref:a,className:chunkQRO22BPZ_cjs.a("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",o),...e}));function P({title:o="Command Palette",description:e="Search for a command to run...",children:a,className:c,...u}){return jsxRuntime.jsxs(chunkL4FOTU2K_cjs.a,{...u,children:[jsxRuntime.jsxs(chunkL4FOTU2K_cjs.g,{className:"sr-only",children:[jsxRuntime.jsx(chunkL4FOTU2K_cjs.i,{children:o}),jsxRuntime.jsx(chunkL4FOTU2K_cjs.j,{children:e})]}),jsxRuntime.jsx(chunkL4FOTU2K_cjs.f,{className:chunkQRO22BPZ_cjs.a("overflow-hidden p-0",c),children:jsxRuntime.jsx(C,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:a})})]})}function w({className:o,...e}){return jsxRuntime.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[jsxRuntime.jsx(lu.LuSearch,{className:"size-4 shrink-0 opacity-50"}),jsxRuntime.jsx(cmdk.Command.Input,{"data-slot":"command-input",className:chunkQRO22BPZ_cjs.a("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 outline-hidden disabled:cursor-not-allowed disabled:opacity-50",o),...e})]})}function D({className:o,...e}){return jsxRuntime.jsx(cmdk.Command.List,{"data-slot":"command-list",className:chunkQRO22BPZ_cjs.a("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",o),...e})}function N({...o}){return jsxRuntime.jsx(cmdk.Command.Empty,{"data-slot":"command-empty",className:"py-6 text-center",...o})}function b({className:o,...e}){return jsxRuntime.jsx(cmdk.Command.Group,{"data-slot":"command-group",className:chunkQRO22BPZ_cjs.a("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",o),...e})}function I({className:o,...e}){return jsxRuntime.jsx(cmdk.Command.Separator,{"data-slot":"command-separator",className:chunkQRO22BPZ_cjs.a("bg-border -mx-1 h-px",o),...e})}function S({className:o,...e}){return jsxRuntime.jsx(cmdk.Command.Item,{"data-slot":"command-item",className:chunkQRO22BPZ_cjs.a("data-[selected=true]:bg-accent data-[selected=true]:text-primary [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),...e})}function L({className:o,...e}){return jsxRuntime.jsx("span",{"data-slot":"command-shortcut",className:chunkQRO22BPZ_cjs.a("text-muted-foreground ml-auto text-xs tracking-widest",o),...e})}exports.a=C;exports.b=P;exports.c=w;exports.d=D;exports.e=N;exports.f=b;exports.g=I;exports.h=S;exports.i=L;//# sourceMappingURL=chunk-VTYXYLTK.cjs.map
2
+ //# sourceMappingURL=chunk-VTYXYLTK.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/v2/command/command.tsx"],"names":["Command","forwardRef","className","props","forwardedRef","jsx","CommandPrimitive","cn","CommandDialog","title","description","children","jsxs","Dialog","DialogHeader","DialogTitle","DialogDescription","DialogContent","CommandInput","LuSearch","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","CommandShortcut"],"mappings":"sOAaA,IAAMA,CAAAA,CAAUC,gBAAAA,CACd,CAAC,CAAE,SAAA,CAAAC,EAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,GAEtBC,cAAAA,CAACC,YAAAA,CAAA,CACC,WAAA,CAAU,UACV,GAAA,CAAKF,CAAAA,CACL,SAAA,CAAWG,mBAAAA,CACT,2FAAA,CACAL,CACF,CAAA,CACC,GAAGC,EACN,CAGN,EAEA,SAASK,CAAAA,CAAc,CACrB,KAAA,CAAAC,CAAAA,CAAQ,iBAAA,CACR,YAAAC,CAAAA,CAAc,gCAAA,CACd,QAAA,CAAAC,CAAAA,CACA,SAAA,CAAAT,CAAAA,CACA,GAAGC,CACL,EAIG,CACD,OACES,eAAAA,CAACC,mBAAAA,CAAA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AAAA,CAAiB,KAAA,CAAjB,CAAuB,WAAA,CAAU,eAAA,CAAgB,SAAA,CAAU,mBAAoB,GAAGH,CAAAA,CAAO,CAE9F,CAEA,SAASmB,CAAAA,CAAa,CAAE,SAAA,CAAApB,EAAW,GAAGC,CAAM,CAAA,CAAkD,CAC5F,OACEE,cAAAA,CAACC,YAAAA,CAAiB,KAAA,CAAjB,CACC,WAAA,CAAU,eAAA,CACV,SAAA,CAAWC,mBAAAA,CACT,wNAAA,CACAL,CACF,CAAA,CACC,GAAGC,EACN,CAEJ,CAEA,SAASoB,CAAAA,CAAiB,CACxB,SAAA,CAAArB,CAAAA,CACA,GAAGC,CACL,CAAA,CAAsD,CACpD,OACEE,cAAAA,CAACC,YAAAA,CAAiB,SAAA,CAAjB,CACC,WAAA,CAAU,oBACV,SAAA,CAAWC,mBAAAA,CAAG,sBAAA,CAAwBL,CAAS,CAAA,CAC9C,GAAGC,CAAAA,CACN,CAEJ,CAEA,SAASqB,CAAAA,CAAY,CAAE,SAAA,CAAAtB,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAiD,CAC1F,OACEE,cAAAA,CAACC,YAAAA,CAAiB,IAAA,CAAjB,CACC,WAAA,CAAU,cAAA,CACV,SAAA,CAAWC,oBACT,mXAAA,CACAL,CACF,CAAA,CACC,GAAGC,CAAAA,CACN,CAEJ,CAEA,SAASsB,EAAgB,CAAE,SAAA,CAAAvB,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAA2B,CACxE,OACEE,eAAC,MAAA,CAAA,CACC,WAAA,CAAU,kBAAA,CACV,SAAA,CAAWE,oBAAG,uDAAA,CAAyDL,CAAS,CAAA,CAC/E,GAAGC,EACN,CAEJ","file":"chunk-X4O2D662.cjs","sourcesContent":["import { ComponentProps, forwardRef } from 'react';\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { LuSearch } from 'react-icons/lu';\n\nimport { cn } from '@/lib/utils';\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from '@/v2/dialog/dialog';\n\nconst Command = forwardRef<HTMLDivElement, ComponentProps<typeof CommandPrimitive>>(\n ({ className, ...props }, forwardedRef) => {\n return (\n <CommandPrimitive\n data-slot=\"command\"\n ref={forwardedRef}\n className={cn(\n 'bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md',\n className,\n )}\n {...props}\n />\n );\n },\n);\n\nfunction CommandDialog({\n title = 'Command Palette',\n description = 'Search for a command to run...',\n children,\n className,\n ...props\n}: ComponentProps<typeof Dialog> & {\n title?: string;\n description?: string;\n className?: string;\n}) {\n return (\n <Dialog {...props}>\n <DialogHeader className=\"sr-only\">\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n <DialogContent className={cn('overflow-hidden p-0', className)}>\n <Command className=\"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction CommandInput({ className, ...props }: ComponentProps<typeof CommandPrimitive.Input>) {\n return (\n <div data-slot=\"command-input-wrapper\" className=\"flex h-9 items-center gap-2 border-b px-3\">\n <LuSearch className=\"size-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n data-slot=\"command-input\"\n className={cn(\n 'placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 outline-hidden disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n />\n </div>\n );\n}\n\nfunction CommandList({ className, ...props }: ComponentProps<typeof CommandPrimitive.List>) {\n return (\n <CommandPrimitive.List\n data-slot=\"command-list\"\n className={cn('max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto', className)}\n {...props}\n />\n );\n}\n\nfunction CommandEmpty({ ...props }: ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty data-slot=\"command-empty\" className=\"py-6 text-center\" {...props} />\n );\n}\n\nfunction CommandGroup({ className, ...props }: ComponentProps<typeof CommandPrimitive.Group>) {\n return (\n <CommandPrimitive.Group\n data-slot=\"command-group\"\n className={cn(\n 'text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandSeparator({\n className,\n ...props\n}: ComponentProps<typeof CommandPrimitive.Separator>) {\n return (\n <CommandPrimitive.Separator\n data-slot=\"command-separator\"\n className={cn('bg-border -mx-1 h-px', className)}\n {...props}\n />\n );\n}\n\nfunction CommandItem({ className, ...props }: ComponentProps<typeof CommandPrimitive.Item>) {\n return (\n <CommandPrimitive.Item\n data-slot=\"command-item\"\n className={cn(\n \"data-[selected=true]:bg-accent data-[selected=true]:text-primary [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandShortcut({ className, ...props }: ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"command-shortcut\"\n className={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)}\n {...props}\n />\n );\n}\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n"]}
1
+ {"version":3,"sources":["../src/v2/command/command.tsx"],"names":["Command","forwardRef","className","props","forwardedRef","jsx","CommandPrimitive","cn","CommandDialog","title","description","children","jsxs","Dialog","DialogHeader","DialogTitle","DialogDescription","DialogContent","CommandInput","LuSearch","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","CommandShortcut"],"mappings":"sOAaA,IAAMA,CAAAA,CAAUC,gBAAAA,CACd,CAAC,CAAE,SAAA,CAAAC,EAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,GAEtBC,cAAAA,CAACC,YAAAA,CAAA,CACC,WAAA,CAAU,UACV,GAAA,CAAKF,CAAAA,CACL,SAAA,CAAWG,mBAAAA,CACT,2FAAA,CACAL,CACF,CAAA,CACC,GAAGC,EACN,CAGN,EAEA,SAASK,CAAAA,CAAc,CACrB,KAAA,CAAAC,CAAAA,CAAQ,iBAAA,CACR,YAAAC,CAAAA,CAAc,gCAAA,CACd,QAAA,CAAAC,CAAAA,CACA,SAAA,CAAAT,CAAAA,CACA,GAAGC,CACL,EAIG,CACD,OACES,eAAAA,CAACC,mBAAAA,CAAA,CAAQ,GAAGV,CAAAA,CACV,QAAA,CAAA,CAAAS,gBAACE,mBAAAA,CAAA,CAAa,SAAA,CAAU,SAAA,CACtB,QAAA,CAAA,CAAAT,cAAAA,CAACU,mBAAAA,CAAA,CAAa,SAAAN,CAAAA,CAAM,CAAA,CACpBJ,cAAAA,CAACW,mBAAAA,CAAA,CAAmB,QAAA,CAAAN,CAAAA,CAAY,CAAA,CAAA,CAClC,EACAL,cAAAA,CAACY,mBAAAA,CAAA,CAAc,SAAA,CAAWV,mBAAAA,CAAG,qBAAA,CAAuBL,CAAS,CAAA,CAC3D,SAAAG,cAAAA,CAACL,CAAAA,CAAA,CAAQ,SAAA,CAAU,uZAAA,CAChB,QAAA,CAAAW,CAAAA,CACH,CAAA,CACF,GACF,CAEJ,CAEA,SAASO,C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oBACV,SAAA,CAAWC,mBAAAA,CAAG,sBAAA,CAAwBL,CAAS,CAAA,CAC9C,GAAGC,CAAAA,CACN,CAEJ,CAEA,SAASqB,CAAAA,CAAY,CAAE,SAAA,CAAAtB,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAiD,CAC1F,OACEE,cAAAA,CAACC,YAAAA,CAAiB,IAAA,CAAjB,CACC,WAAA,CAAU,cAAA,CACV,SAAA,CAAWC,oBACT,mXAAA,CACAL,CACF,CAAA,CACC,GAAGC,CAAAA,CACN,CAEJ,CAEA,SAASsB,EAAgB,CAAE,SAAA,CAAAvB,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAA2B,CACxE,OACEE,eAAC,MAAA,CAAA,CACC,WAAA,CAAU,kBAAA,CACV,SAAA,CAAWE,oBAAG,uDAAA,CAAyDL,CAAS,CAAA,CAC/E,GAAGC,EACN,CAEJ","file":"chunk-VTYXYLTK.cjs","sourcesContent":["import { ComponentProps, forwardRef } from 'react';\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { LuSearch } from 'react-icons/lu';\n\nimport { cn } from '@/lib/utils';\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from '@/v2/dialog/dialog';\n\nconst Command = forwardRef<HTMLDivElement, ComponentProps<typeof CommandPrimitive>>(\n ({ className, ...props }, forwardedRef) => {\n return (\n <CommandPrimitive\n data-slot=\"command\"\n ref={forwardedRef}\n className={cn(\n 'bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md',\n className,\n )}\n {...props}\n />\n );\n },\n);\n\nfunction CommandDialog({\n title = 'Command Palette',\n description = 'Search for a command to run...',\n children,\n className,\n ...props\n}: ComponentProps<typeof Dialog> & {\n title?: string;\n description?: string;\n className?: string;\n}) {\n return (\n <Dialog {...props}>\n <DialogHeader className=\"sr-only\">\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n <DialogContent className={cn('overflow-hidden p-0', className)}>\n <Command className=\"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction CommandInput({ className, ...props }: ComponentProps<typeof CommandPrimitive.Input>) {\n return (\n <div data-slot=\"command-input-wrapper\" className=\"flex h-9 items-center gap-2 border-b px-3\">\n <LuSearch className=\"size-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n data-slot=\"command-input\"\n className={cn(\n 'placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 outline-hidden disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n />\n </div>\n );\n}\n\nfunction CommandList({ className, ...props }: ComponentProps<typeof CommandPrimitive.List>) {\n return (\n <CommandPrimitive.List\n data-slot=\"command-list\"\n className={cn('max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto', className)}\n {...props}\n />\n );\n}\n\nfunction CommandEmpty({ ...props }: ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty data-slot=\"command-empty\" className=\"py-6 text-center\" {...props} />\n );\n}\n\nfunction CommandGroup({ className, ...props }: ComponentProps<typeof CommandPrimitive.Group>) {\n return (\n <CommandPrimitive.Group\n data-slot=\"command-group\"\n className={cn(\n 'text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandSeparator({\n className,\n ...props\n}: ComponentProps<typeof CommandPrimitive.Separator>) {\n return (\n <CommandPrimitive.Separator\n data-slot=\"command-separator\"\n className={cn('bg-border -mx-1 h-px', className)}\n {...props}\n />\n );\n}\n\nfunction CommandItem({ className, ...props }: ComponentProps<typeof CommandPrimitive.Item>) {\n return (\n <CommandPrimitive.Item\n data-slot=\"command-item\"\n className={cn(\n \"data-[selected=true]:bg-accent data-[selected=true]:text-primary [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandShortcut({ className, ...props }: ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"command-shortcut\"\n className={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)}\n {...props}\n />\n );\n}\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n"]}
@@ -1,2 +1,2 @@
1
- import {a}from'./chunk-Z2IHO2AX.js';import {a as a$1}from'./chunk-XOH4SEBO.js';import {d,h}from'./chunk-EN66V63W.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var g=({uniqueId:t,open:p,loading:l,options:o,selected:c,toggleOption:a$2,onSearch:d$1,scrollbarRef:r,inputRef:f,emptyIndicator:R,loadingIndicator:n,selectFirstItem:M})=>jsx("div",{className:"relative",children:p&&jsx(d,{id:t,className:"bg-popover text-popover-foreground animate-in absolute top-1 z-10 w-full rounded-md border shadow-xs outline-none",onMouseLeave:()=>{r.current=false;},onMouseEnter:()=>{r.current=true;},onMouseUp:()=>{f?.current?.focus();},children:l&&n?n:jsxs(Fragment,{children:[jsx(a,{onSearch:d$1,options:o,emptyIndicator:R}),!M&&jsx(h,{value:"-",className:"hidden"}),jsx(a$1,{options:o,uniqueId:t,selected:c,toggleOption:a$2})]})})});export{g as a};//# sourceMappingURL=chunk-5YC7OURG.js.map
2
- //# sourceMappingURL=chunk-5YC7OURG.js.map
1
+ import {a}from'./chunk-Z2IHO2AX.js';import {a as a$1}from'./chunk-MPGPI6LC.js';import {d,h}from'./chunk-SMTXYI6Q.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var g=({uniqueId:t,open:p,loading:l,options:o,selected:c,toggleOption:a$2,onSearch:d$1,scrollbarRef:r,inputRef:f,emptyIndicator:R,loadingIndicator:n,selectFirstItem:M})=>jsx("div",{className:"relative",children:p&&jsx(d,{id:t,className:"bg-popover text-popover-foreground animate-in absolute top-1 z-10 w-full rounded-md border shadow-xs outline-none",onMouseLeave:()=>{r.current=false;},onMouseEnter:()=>{r.current=true;},onMouseUp:()=>{f?.current?.focus();},children:l&&n?n:jsxs(Fragment,{children:[jsx(a,{onSearch:d$1,options:o,emptyIndicator:R}),!M&&jsx(h,{value:"-",className:"hidden"}),jsx(a$1,{options:o,uniqueId:t,selected:c,toggleOption:a$2})]})})});export{g as a};//# sourceMappingURL=chunk-WMOD232S.js.map
2
+ //# sourceMappingURL=chunk-WMOD232S.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/v2/multiselect/components/MultiSelectDropdown.tsx"],"names":["MultiSelectDropdown","uniqueId","open","loading","options","selected","toggleOption","onSearch","scrollbarRef","inputRef","emptyIndicator","loadingIndicator","selectFirstItem","jsx","CommandList","jsxs","Fragment","EmptyItem","CommandItem","MultiSelectCommandGroup"],"mappings":"uKAgBO,IAAMA,CAAAA,CAAsB,CAAC,CAClC,QAAA,CAAAC,CAAAA,CACA,KAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,EACA,YAAA,CAAAC,GAAAA,CACA,QAAA,CAAAC,GAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,SAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CACF,CAAA,GAEIC,GAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,UAAA,CACZ,QAAA,CAAAX,GACCW,GAAAA,CAACC,CAAAA,CAAA,CACC,EAAA,CAAIb,CAAAA,CACJ,SAAA,CAAU,mHAAA,CACV,YAAA,CAAc,IAAM,CAElBO,CAAAA,CAAa,OAAA,CAAU,MAEzB,CAAA,CACA,aAAc,IAAM,CAElBA,CAAAA,CAAa,OAAA,CAAU,KAEzB,CAAA,CACA,UAAW,IAAM,CACfC,CAAAA,EAAU,OAAA,EAAS,KAAA,GACrB,EAEC,QAAA,CAAAN,CAAAA,EAAWQ,CAAAA,CACVA,CAAAA,CAEAI,IAAAA,CAAAC,QAAAA,CAAA,CACE,QAAA,CAAA,CAAAH,GAAAA,CAACI,CAAAA,CAAA,CAAgB,QAAA,CAAAV,GAAAA,CAAU,OAAA,CAAAH,EAAS,cAAA,CAAAM,CAAAA,CAAkB,CAAA,CACrD,CAACE,CAAAA,EAAmBC,GAAAA,CAACK,EAAA,CAAY,KAAA,CAAM,GAAA,CAAI,SAAA,CAAU,QAAA,CAAS,CAAA,CAC/DL,IAACM,GAAAA,CAAA,CAA8B,OAAA,CAAAf,CAAAA,CAAS,QAAA,CAAAH,CAAAA,CAAU,QAAA,CAAAI,CAAAA,CAAU,YAAA,CAAAC,GAAAA,CAAgB,CAAA,CAAA,CAC9E,CAAA,CAEJ,CAAA,CAEJ","file":"chunk-5YC7OURG.js","sourcesContent":["import { CommandItem, CommandList } from '@/v2/command/command';\nimport { MultiSelectProps } from '../types';\nimport { MultiSelectCommandGroup } from './MultiSelectCommandGroup';\nimport { EmptyItem } from './EmptyItem';\nimport type { UseRefsReturn } from '../hooks/useRefs';\nimport { UseMultiSelectReturn } from '../hooks/useMultiSelect';\nimport { UseInteractionsReturn } from '../hooks/useInteractions';\n\ntype Props = Pick<\n MultiSelectProps,\n 'loading' | 'loadingIndicator' | 'emptyIndicator' | 'onSearch' | 'selectFirstItem'\n> &\n Pick<UseRefsReturn, 'inputRef' | 'scrollbarRef'> &\n Pick<UseMultiSelectReturn, 'uniqueId' | 'open' | 'selected' | 'options'> &\n Pick<UseInteractionsReturn, 'toggleOption'>;\n\nexport const MultiSelectDropdown = ({\n uniqueId,\n open,\n loading,\n options,\n selected,\n toggleOption,\n onSearch,\n scrollbarRef,\n inputRef,\n emptyIndicator,\n loadingIndicator,\n selectFirstItem,\n}: Props) => {\n return (\n <div className=\"relative\">\n {open && (\n <CommandList\n id={uniqueId}\n className=\"bg-popover text-popover-foreground animate-in absolute top-1 z-10 w-full rounded-md border shadow-xs outline-none\"\n onMouseLeave={() => {\n // eslint-disable-next-line no-param-reassign\n scrollbarRef.current = false;\n // setOnScrollbar(false);\n }}\n onMouseEnter={() => {\n // eslint-disable-next-line no-param-reassign\n scrollbarRef.current = true;\n // setOnScrollbar(true);\n }}\n onMouseUp={() => {\n inputRef?.current?.focus();\n }}\n >\n {loading && loadingIndicator ? (\n loadingIndicator\n ) : (\n <>\n <EmptyItem {...{ onSearch, options, emptyIndicator }} />\n {!selectFirstItem && <CommandItem value=\"-\" className=\"hidden\" />}\n <MultiSelectCommandGroup {...{ options, uniqueId, selected, toggleOption }} />\n </>\n )}\n </CommandList>\n )}\n </div>\n );\n};\n"]}
1
+ {"version":3,"sources":["../src/v2/multiselect/components/MultiSelectDropdown.tsx"],"names":["MultiSelectDropdown","uniqueId","open","loading","options","selected","toggleOption","onSearch","scrollbarRef","inputRef","emptyIndicator","loadingIndicator","selectFirstItem","jsx","CommandList","jsxs","Fragment","EmptyItem","CommandItem","MultiSelectCommandGroup"],"mappings":"uKAgBO,IAAMA,CAAAA,CAAsB,CAAC,CAClC,QAAA,CAAAC,CAAAA,CACA,KAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,EACA,YAAA,CAAAC,GAAAA,CACA,QAAA,CAAAC,GAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,SAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CACF,CAAA,GAEIC,GAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,UAAA,CACZ,QAAA,CAAAX,GACCW,GAAAA,CAACC,CAAAA,CAAA,CACC,EAAA,CAAIb,CAAAA,CACJ,SAAA,CAAU,mHAAA,CACV,YAAA,CAAc,IAAM,CAElBO,CAAAA,CAAa,OAAA,CAAU,MAEzB,CAAA,CACA,aAAc,IAAM,CAElBA,CAAAA,CAAa,OAAA,CAAU,KAEzB,CAAA,CACA,UAAW,IAAM,CACfC,CAAAA,EAAU,OAAA,EAAS,KAAA,GACrB,EAEC,QAAA,CAAAN,CAAAA,EAAWQ,CAAAA,CACVA,CAAAA,CAEAI,IAAAA,CAAAC,QAAAA,CAAA,CACE,QAAA,CAAA,CAAAH,GAAAA,CAACI,CAAAA,CAAA,CAAgB,QAAA,CAAAV,GAAAA,CAAU,OAAA,CAAAH,EAAS,cAAA,CAAAM,CAAAA,CAAkB,CAAA,CACrD,CAACE,CAAAA,EAAmBC,GAAAA,CAACK,EAAA,CAAY,KAAA,CAAM,GAAA,CAAI,SAAA,CAAU,QAAA,CAAS,CAAA,CAC/DL,IAACM,GAAAA,CAAA,CAA8B,OAAA,CAAAf,CAAAA,CAAS,QAAA,CAAAH,CAAAA,CAAU,QAAA,CAAAI,CAAAA,CAAU,YAAA,CAAAC,GAAAA,CAAgB,CAAA,CAAA,CAC9E,CAAA,CAEJ,CAAA,CAEJ","file":"chunk-WMOD232S.js","sourcesContent":["import { CommandItem, CommandList } from '@/v2/command/command';\nimport { MultiSelectProps } from '../types';\nimport { MultiSelectCommandGroup } from './MultiSelectCommandGroup';\nimport { EmptyItem } from './EmptyItem';\nimport type { UseRefsReturn } from '../hooks/useRefs';\nimport { UseMultiSelectReturn } from '../hooks/useMultiSelect';\nimport { UseInteractionsReturn } from '../hooks/useInteractions';\n\ntype Props = Pick<\n MultiSelectProps,\n 'loading' | 'loadingIndicator' | 'emptyIndicator' | 'onSearch' | 'selectFirstItem'\n> &\n Pick<UseRefsReturn, 'inputRef' | 'scrollbarRef'> &\n Pick<UseMultiSelectReturn, 'uniqueId' | 'open' | 'selected' | 'options'> &\n Pick<UseInteractionsReturn, 'toggleOption'>;\n\nexport const MultiSelectDropdown = ({\n uniqueId,\n open,\n loading,\n options,\n selected,\n toggleOption,\n onSearch,\n scrollbarRef,\n inputRef,\n emptyIndicator,\n loadingIndicator,\n selectFirstItem,\n}: Props) => {\n return (\n <div className=\"relative\">\n {open && (\n <CommandList\n id={uniqueId}\n className=\"bg-popover text-popover-foreground animate-in absolute top-1 z-10 w-full rounded-md border shadow-xs outline-none\"\n onMouseLeave={() => {\n // eslint-disable-next-line no-param-reassign\n scrollbarRef.current = false;\n // setOnScrollbar(false);\n }}\n onMouseEnter={() => {\n // eslint-disable-next-line no-param-reassign\n scrollbarRef.current = true;\n // setOnScrollbar(true);\n }}\n onMouseUp={() => {\n inputRef?.current?.focus();\n }}\n >\n {loading && loadingIndicator ? (\n loadingIndicator\n ) : (\n <>\n <EmptyItem {...{ onSearch, options, emptyIndicator }} />\n {!selectFirstItem && <CommandItem value=\"-\" className=\"hidden\" />}\n <MultiSelectCommandGroup {...{ options, uniqueId, selected, toggleOption }} />\n </>\n )}\n </CommandList>\n )}\n </div>\n );\n};\n"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var chunk25P3XDJA_cjs=require('./chunk-25P3XDJA.cjs'),chunkQRO22BPZ_cjs=require('./chunk-QRO22BPZ.cjs'),e=require('react'),w=require('embla-carousel-react'),lu=require('react-icons/lu'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var e__namespace=/*#__PURE__*/_interopNamespace(e);var w__default=/*#__PURE__*/_interopDefault(w);var v=e__namespace.createContext(null);function d(){let t=e__namespace.useContext(v);if(!t)throw new Error("useCarousel must be used within a <Carousel />");return t}function T({orientation:t="horizontal",opts:l,setApi:o,plugins:s,className:u,children:c,...i}){let[x,r]=w__default.default({...l,axis:t==="horizontal"?"x":"y"},s),[P,R]=e__namespace.useState(false),[y,b]=e__namespace.useState(false),[N,S]=e__namespace.useState(0),[h,z]=e__namespace.useState(0),p=e__namespace.useCallback(C=>{C&&(R(C.canScrollPrev()),b(C.canScrollNext()),S(C.selectedScrollSnap()),z(C.scrollSnapList().length));},[]),g=e__namespace.useCallback(()=>{r?.scrollPrev();},[r]),E=e__namespace.useCallback(()=>{r?.scrollNext();},[r]);return e__namespace.useEffect(()=>{!r||!o||o(r);},[r,o]),e__namespace.useEffect(()=>{if(r)return p(r),r.on("reInit",p),r.on("select",p),()=>{r?.off("select",p);}},[r,p]),jsxRuntime.jsx(v.Provider,{value:{carouselRef:x,api:r,opts:l,orientation:t||(l?.axis==="y"?"vertical":"horizontal"),selectedIndex:N,slideCount:h,scrollPrev:g,scrollNext:E,canScrollPrev:P,canScrollNext:y},children:jsxRuntime.jsx("div",{className:chunkQRO22BPZ_cjs.a("relative",u),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...i,children:c})})}function O({className:t,...l}){let{carouselRef:o,orientation:s}=d();return jsxRuntime.jsx("div",{ref:o,className:"overflow-hidden","data-slot":"carousel-content",children:jsxRuntime.jsx("div",{className:chunkQRO22BPZ_cjs.a("flex",s==="horizontal"?"-ml-4":"-mt-4 flex-col",t),...l})})}function F({className:t,...l}){let{orientation:o}=d();return jsxRuntime.jsx("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:chunkQRO22BPZ_cjs.a("min-w-0 shrink-0 grow-0 basis-full",o==="horizontal"?"pl-4":"pt-4",t),...l})}function j({className:t,variant:l="outline",size:o="sm",...s}){let{orientation:u,scrollPrev:c,canScrollPrev:i}=d();return jsxRuntime.jsxs(chunk25P3XDJA_cjs.b,{"data-slot":"carousel-previous",variant:l,size:o,className:chunkQRO22BPZ_cjs.a("absolute size-8 rounded-full",u==="horizontal"?"top-1/2 -left-12 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!i,onClick:c,...s,children:[jsxRuntime.jsx(lu.LuArrowLeft,{}),jsxRuntime.jsx("span",{className:"sr-only",children:"Previous slide"})]})}function q({className:t,variant:l="outline",size:o="sm",...s}){let{orientation:u,scrollNext:c,canScrollNext:i}=d();return jsxRuntime.jsxs(chunk25P3XDJA_cjs.b,{"data-slot":"carousel-next",variant:l,size:o,className:chunkQRO22BPZ_cjs.a("absolute size-8 rounded-full",u==="horizontal"?"top-1/2 -right-12 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!i,onClick:c,...s,children:[jsxRuntime.jsx(lu.LuArrowRight,{}),jsxRuntime.jsx("span",{className:"sr-only",children:"Next slide"})]})}function D({className:t,...l}){let{slideCount:o,selectedIndex:s}=d();return o<=1?null:jsxRuntime.jsxs("div",{className:chunkQRO22BPZ_cjs.a("text-muted-foreground text-sm",t),"data-slot":"carousel-fraction",...l,children:[s+1,"/",o]})}exports.a=d;exports.b=T;exports.c=O;exports.d=F;exports.e=j;exports.f=q;exports.g=D;//# sourceMappingURL=chunk-UT2WK5SS.cjs.map
2
- //# sourceMappingURL=chunk-UT2WK5SS.cjs.map
1
+ 'use strict';var chunkQUD4HTUP_cjs=require('./chunk-QUD4HTUP.cjs'),chunkQRO22BPZ_cjs=require('./chunk-QRO22BPZ.cjs'),e=require('react'),w=require('embla-carousel-react'),lu=require('react-icons/lu'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var e__namespace=/*#__PURE__*/_interopNamespace(e);var w__default=/*#__PURE__*/_interopDefault(w);var v=e__namespace.createContext(null);function d(){let t=e__namespace.useContext(v);if(!t)throw new Error("useCarousel must be used within a <Carousel />");return t}function T({orientation:t="horizontal",opts:l,setApi:o,plugins:s,className:u,children:c,...i}){let[x,r]=w__default.default({...l,axis:t==="horizontal"?"x":"y"},s),[P,R]=e__namespace.useState(false),[y,b]=e__namespace.useState(false),[N,S]=e__namespace.useState(0),[h,z]=e__namespace.useState(0),p=e__namespace.useCallback(C=>{C&&(R(C.canScrollPrev()),b(C.canScrollNext()),S(C.selectedScrollSnap()),z(C.scrollSnapList().length));},[]),g=e__namespace.useCallback(()=>{r?.scrollPrev();},[r]),E=e__namespace.useCallback(()=>{r?.scrollNext();},[r]);return e__namespace.useEffect(()=>{!r||!o||o(r);},[r,o]),e__namespace.useEffect(()=>{if(r)return p(r),r.on("reInit",p),r.on("select",p),()=>{r?.off("select",p);}},[r,p]),jsxRuntime.jsx(v.Provider,{value:{carouselRef:x,api:r,opts:l,orientation:t||(l?.axis==="y"?"vertical":"horizontal"),selectedIndex:N,slideCount:h,scrollPrev:g,scrollNext:E,canScrollPrev:P,canScrollNext:y},children:jsxRuntime.jsx("div",{className:chunkQRO22BPZ_cjs.a("relative",u),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...i,children:c})})}function O({className:t,...l}){let{carouselRef:o,orientation:s}=d();return jsxRuntime.jsx("div",{ref:o,className:"overflow-hidden","data-slot":"carousel-content",children:jsxRuntime.jsx("div",{className:chunkQRO22BPZ_cjs.a("flex",s==="horizontal"?"-ml-4":"-mt-4 flex-col",t),...l})})}function F({className:t,...l}){let{orientation:o}=d();return jsxRuntime.jsx("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:chunkQRO22BPZ_cjs.a("min-w-0 shrink-0 grow-0 basis-full",o==="horizontal"?"pl-4":"pt-4",t),...l})}function j({className:t,variant:l="outline",size:o="sm",...s}){let{orientation:u,scrollPrev:c,canScrollPrev:i}=d();return jsxRuntime.jsxs(chunkQUD4HTUP_cjs.b,{"data-slot":"carousel-previous",variant:l,size:o,className:chunkQRO22BPZ_cjs.a("absolute size-8 rounded-full",u==="horizontal"?"top-1/2 -left-12 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!i,onClick:c,...s,children:[jsxRuntime.jsx(lu.LuArrowLeft,{}),jsxRuntime.jsx("span",{className:"sr-only",children:"Previous slide"})]})}function q({className:t,variant:l="outline",size:o="sm",...s}){let{orientation:u,scrollNext:c,canScrollNext:i}=d();return jsxRuntime.jsxs(chunkQUD4HTUP_cjs.b,{"data-slot":"carousel-next",variant:l,size:o,className:chunkQRO22BPZ_cjs.a("absolute size-8 rounded-full",u==="horizontal"?"top-1/2 -right-12 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!i,onClick:c,...s,children:[jsxRuntime.jsx(lu.LuArrowRight,{}),jsxRuntime.jsx("span",{className:"sr-only",children:"Next slide"})]})}function D({className:t,...l}){let{slideCount:o,selectedIndex:s}=d();return o<=1?null:jsxRuntime.jsxs("div",{className:chunkQRO22BPZ_cjs.a("text-muted-foreground text-sm",t),"data-slot":"carousel-fraction",...l,children:[s+1,"/",o]})}exports.a=d;exports.b=T;exports.c=O;exports.d=F;exports.e=j;exports.f=q;exports.g=D;//# sourceMappingURL=chunk-X7HU4N6X.cjs.map
2
+ //# sourceMappingURL=chunk-X7HU4N6X.cjs.map