@zydon/common 2.7.62 → 2.7.64

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 (172) hide show
  1. package/README.md +1 -0
  2. package/dist/{chunk-CU7PKEY2.js → chunk-4RNGASI4.js} +2 -2
  3. package/dist/{chunk-75G5RNV4.js → chunk-5LQLLZ5L.js} +2 -2
  4. package/dist/chunk-5NIMUEW5.js +25 -0
  5. package/dist/chunk-5NIMUEW5.js.map +1 -0
  6. package/dist/chunk-7MVZYOHX.js +13 -0
  7. package/dist/chunk-7MVZYOHX.js.map +1 -0
  8. package/dist/{chunk-WDKKCLZ6.js → chunk-CWCEG2DZ.js} +2 -2
  9. package/dist/{chunk-HLMZQG27.js → chunk-HWYA3EGC.js} +2 -2
  10. package/dist/chunk-HWYA3EGC.js.map +1 -0
  11. package/dist/{chunk-5AWUE6JG.js → chunk-JZ55NEMI.js} +2 -2
  12. package/dist/{chunk-EKIESGNJ.js → chunk-LEMPYV5U.js} +2 -2
  13. package/dist/{chunk-QGMJKW7H.js → chunk-LNXA53QR.js} +2 -2
  14. package/dist/{chunk-FBSNLBJM.js → chunk-LY3IB5VH.js} +2 -2
  15. package/dist/{chunk-DIWJKSWV.js → chunk-MP2LAJS5.js} +3 -3
  16. package/dist/{chunk-IC3H2DXY.js → chunk-N4DW7EIC.js} +2 -2
  17. package/dist/{chunk-CMZI4PHD.js → chunk-NQNNMRLC.js} +1 -1
  18. package/dist/{chunk-CMZI4PHD.js.map → chunk-NQNNMRLC.js.map} +1 -1
  19. package/dist/{chunk-DOVOMWT6.js → chunk-OTVEMGF2.js} +2 -2
  20. package/dist/chunk-POTVACYB.js +8 -0
  21. package/dist/chunk-POTVACYB.js.map +1 -0
  22. package/dist/chunk-QVU6HSYP.js +12 -0
  23. package/dist/chunk-QVU6HSYP.js.map +1 -0
  24. package/dist/chunk-QVUHCBI2.js +35 -0
  25. package/dist/chunk-QVUHCBI2.js.map +1 -0
  26. package/dist/{chunk-RANEJERP.js → chunk-R76WTFYC.js} +2 -2
  27. package/dist/chunk-RBTYTONM.js +13 -0
  28. package/dist/chunk-RBTYTONM.js.map +1 -0
  29. package/dist/{chunk-DPT3E7PD.js → chunk-RFRLNTFN.js} +2 -2
  30. package/dist/{chunk-LBYTNLD3.js → chunk-U7BH6DMJ.js} +2 -2
  31. package/dist/{chunk-5SIAWCDO.js → chunk-XZFBTUAG.js} +2 -2
  32. package/dist/{chunk-N7R22QVG.js → chunk-ZFRNMT3P.js} +2 -2
  33. package/dist/{chunk-YPQCLH3D.js → chunk-ZGSSTXUO.js} +2 -2
  34. package/dist/components/ActionButton/index.js +2 -2
  35. package/dist/components/Autocomplete/index.js +2 -2
  36. package/dist/components/Avatar/index.d.ts +1 -1
  37. package/dist/components/AvatarButton/index.js +3 -3
  38. package/dist/components/BuilderLayout/index.js +2 -2
  39. package/dist/components/BuilderSidebar/index.js +1 -1
  40. package/dist/components/BulkEditModal/index.d.ts +64 -0
  41. package/dist/components/BulkEditModal/index.js +28 -0
  42. package/dist/components/BulkEditModal/index.js.map +1 -0
  43. package/dist/components/CardBrand/index.js +1 -1
  44. package/dist/components/Common/index.js +3 -3
  45. package/dist/components/CopyButton/index.js +2 -2
  46. package/dist/components/DataGrid/index.js +2 -1
  47. package/dist/components/DataView/index.js +8 -6
  48. package/dist/components/DatePicker/index.d.ts +2 -1
  49. package/dist/components/DatePicker/index.js +3 -3
  50. package/dist/components/DatePicker/index.js.map +1 -1
  51. package/dist/components/DragButton/index.js +2 -2
  52. package/dist/components/DragContainer/index.js +2 -2
  53. package/dist/components/DragContainer/index.js.map +1 -1
  54. package/dist/components/Drawer/index.js +1 -1
  55. package/dist/components/DynamicDataView/index.d.ts +4 -2
  56. package/dist/components/DynamicDataView/index.js +20 -14
  57. package/dist/components/DynamicDataView/index.js.map +1 -1
  58. package/dist/components/EasyCropModal/index.js +3 -3
  59. package/dist/components/Error/index.js +1 -1
  60. package/dist/components/ExpandableGroup/index.js +7 -7
  61. package/dist/components/ExpandableGroup/index.js.map +1 -1
  62. package/dist/components/FieldMentions/index.js.map +1 -1
  63. package/dist/components/FileUpload/index.js +6 -8
  64. package/dist/components/FrameSkeleton/index.js +4 -4
  65. package/dist/components/HelpButton/index.js +2 -2
  66. package/dist/components/Icon/index.js +1 -1
  67. package/dist/components/IconButton/index.js +2 -2
  68. package/dist/components/ImageCropModal/index.js +14 -4
  69. package/dist/components/ImageCropModal/index.js.map +1 -1
  70. package/dist/components/Incrementer/index.js +2 -2
  71. package/dist/components/InfoCircle/index.js +1 -1
  72. package/dist/components/ListBundles/index.js +2 -2
  73. package/dist/components/MenuItem/index.js +1 -1
  74. package/dist/components/Modal/index.js +2 -2
  75. package/dist/components/MoreMenu/index.js +1 -1
  76. package/dist/components/PasswordRules/index.js +1 -1
  77. package/dist/components/PopoverSelect/index.js +1 -1
  78. package/dist/components/SearchInput/index.js +2 -2
  79. package/dist/components/SelectableCards/index.js +3 -3
  80. package/dist/components/SeoPreview/index.js +1 -1
  81. package/dist/components/StateDisplay/index.js +2 -2
  82. package/dist/components/Steps/index.js +1 -1
  83. package/dist/components/StyledTab/index.js +1 -1
  84. package/dist/components/SwapList/index.js +2 -2
  85. package/dist/components/ToggleTheme/index.js +2 -2
  86. package/dist/components/WebhookCard/index.js +2 -2
  87. package/dist/components/carousel/index.js +2 -2
  88. package/dist/components/form/Address/index.js +3 -3
  89. package/dist/components/form/Autocomplete/index.js +3 -3
  90. package/dist/components/form/Codes/index.d.ts +2 -1
  91. package/dist/components/form/Codes/index.js +4 -4
  92. package/dist/components/form/Codes/index.js.map +1 -1
  93. package/dist/components/form/FileUpload/index.js +6 -8
  94. package/dist/components/form/FileUpload/index.js.map +1 -1
  95. package/dist/components/form/Incrementer/index.js +2 -2
  96. package/dist/components/form/Password/index.js +1 -1
  97. package/dist/components/form/SelectableCards/index.js +3 -3
  98. package/dist/components/form/Webhook/index.js +12 -12
  99. package/dist/components/form/Webhook/index.js.map +1 -1
  100. package/dist/components/lightbox/index.js +1 -1
  101. package/dist/components/table/index.js +2 -2
  102. package/dist/contexts/PushNotifications/index.js +1 -1
  103. package/dist/hooks/useCollapseSidebarOnMount.js +3 -3
  104. package/dist/hooks/useEventCallback.d.ts +2 -3
  105. package/dist/hooks/useEventCallback.js +1 -1
  106. package/dist/hooks/useLocalStorage.js +2 -2
  107. package/dist/hooks/useSnackbar.d.ts +1 -1
  108. package/dist/hooks/useThemeToggle.js +2 -2
  109. package/dist/hooks/useUpload.js +6 -1
  110. package/dist/hooks/useUpload.js.map +1 -1
  111. package/dist/hooks/useUploadImage.js +7 -2
  112. package/dist/hooks/useUploadImage.js.map +1 -1
  113. package/dist/index.d.ts +3 -5
  114. package/dist/index.js +2 -6
  115. package/dist/index.js.map +1 -1
  116. package/dist/theme/core/index.d.ts +1 -1
  117. package/dist/theme/styles/index.d.ts +13 -13
  118. package/dist/theme/theme-provider.js +2 -2
  119. package/dist/utils/dnd.js +4 -4
  120. package/dist/utils/dnd.js.map +1 -1
  121. package/package.json +4 -1
  122. package/dist/chunk-33C6UWPV.js +0 -7
  123. package/dist/chunk-33C6UWPV.js.map +0 -1
  124. package/dist/chunk-DTIGB5NW.js +0 -10
  125. package/dist/chunk-DTIGB5NW.js.map +0 -1
  126. package/dist/chunk-G4J47YPR.js +0 -23
  127. package/dist/chunk-G4J47YPR.js.map +0 -1
  128. package/dist/chunk-HLMZQG27.js.map +0 -1
  129. package/dist/chunk-IMKYDHP2.js +0 -16
  130. package/dist/chunk-IMKYDHP2.js.map +0 -1
  131. package/dist/chunk-JBPWWO5D.js +0 -15
  132. package/dist/chunk-JBPWWO5D.js.map +0 -1
  133. package/dist/chunk-L4FRE2NC.js +0 -42
  134. package/dist/chunk-L4FRE2NC.js.map +0 -1
  135. package/dist/chunk-MQAMSYYK.js +0 -8
  136. package/dist/chunk-MQAMSYYK.js.map +0 -1
  137. package/dist/chunk-SA2BESEB.js +0 -17
  138. package/dist/chunk-SA2BESEB.js.map +0 -1
  139. package/dist/chunk-SBMEL2IJ.js +0 -9
  140. package/dist/chunk-SBMEL2IJ.js.map +0 -1
  141. package/dist/chunk-TNSABPJ2.js +0 -27
  142. package/dist/chunk-TNSABPJ2.js.map +0 -1
  143. package/dist/chunk-UZ4EKQYP.js +0 -36
  144. package/dist/chunk-UZ4EKQYP.js.map +0 -1
  145. package/dist/chunk-YCEQDXLR.js +0 -8
  146. package/dist/chunk-YCEQDXLR.js.map +0 -1
  147. package/dist/components/form/UploadAvatarWithCrop/index.d.ts +0 -21
  148. package/dist/components/form/UploadAvatarWithCrop/index.js +0 -22
  149. package/dist/components/form/UploadAvatarWithCrop/index.js.map +0 -1
  150. package/dist/components/form/UploadWithCrop/index.d.ts +0 -21
  151. package/dist/components/form/UploadWithCrop/index.js +0 -28
  152. package/dist/components/form/UploadWithCrop/index.js.map +0 -1
  153. package/dist/components/upload/index.d.ts +0 -70
  154. package/dist/components/upload/index.js +0 -30
  155. package/dist/components/upload/index.js.map +0 -1
  156. package/dist/{chunk-CU7PKEY2.js.map → chunk-4RNGASI4.js.map} +0 -0
  157. package/dist/{chunk-75G5RNV4.js.map → chunk-5LQLLZ5L.js.map} +0 -0
  158. package/dist/{chunk-WDKKCLZ6.js.map → chunk-CWCEG2DZ.js.map} +0 -0
  159. package/dist/{chunk-5AWUE6JG.js.map → chunk-JZ55NEMI.js.map} +0 -0
  160. package/dist/{chunk-EKIESGNJ.js.map → chunk-LEMPYV5U.js.map} +0 -0
  161. package/dist/{chunk-QGMJKW7H.js.map → chunk-LNXA53QR.js.map} +0 -0
  162. package/dist/{chunk-FBSNLBJM.js.map → chunk-LY3IB5VH.js.map} +0 -0
  163. package/dist/{chunk-DIWJKSWV.js.map → chunk-MP2LAJS5.js.map} +0 -0
  164. package/dist/{chunk-IC3H2DXY.js.map → chunk-N4DW7EIC.js.map} +0 -0
  165. package/dist/{chunk-DOVOMWT6.js.map → chunk-OTVEMGF2.js.map} +0 -0
  166. package/dist/{chunk-RANEJERP.js.map → chunk-R76WTFYC.js.map} +0 -0
  167. package/dist/{chunk-DPT3E7PD.js.map → chunk-RFRLNTFN.js.map} +0 -0
  168. package/dist/{chunk-LBYTNLD3.js.map → chunk-U7BH6DMJ.js.map} +0 -0
  169. package/dist/{chunk-5SIAWCDO.js.map → chunk-XZFBTUAG.js.map} +0 -0
  170. package/dist/{chunk-N7R22QVG.js.map → chunk-ZFRNMT3P.js.map} +0 -0
  171. package/dist/{chunk-YPQCLH3D.js.map → chunk-ZGSSTXUO.js.map} +0 -0
  172. package/dist/{index-c8f1e6e7.d.ts → index-5a5e5dc8.d.ts} +12 -12
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/form/Webhook/index.tsx","../../../../src/components/form/Webhook/props.ts","../../../../src/components/form/Webhook/styles.ts","../../../../src/components/form/Webhook/WebhookAlert.tsx"],"names":["useFieldArray","useFormContext","Divider","IconButton","InputAdornment","Stack","Typography","ContentTypeOptions","HttpMethodOptions","Alert","alpha","styled","SyledIconButton","theme","SyledDeleteIcon","StyledTypography","StyledAlert","jsx","jsxs","WebhookAlert","handleLinkClick","url","WebhookAlert_default","Fragment","Webhook","webhookData","isEditing","haveTip","control","headers","append","remove","handleCreateField","Field_default","Icon_default","Autocomplete_default","item","index","ActionButton_default","Webhook_default"],"mappings":"kQAAA,OAAS,iBAAAA,EAAe,kBAAAC,MAAsB,kBAC9C,OAAOC,MAAa,wBACpB,OAAOC,MAAgB,2BACvB,OAAOC,MAAoB,+BAC3B,OAAOC,MAAW,sBAClB,OAAOC,MAAgB,2BCgBhB,IAAMC,EAAqB,CAChC,CACE,MAAO,MACP,MAAO,KACT,EACA,CACE,MAAO,OACP,MAAO,MACT,EACA,CACE,MAAO,QACP,MAAO,OACT,CACF,EAEaC,EAAoB,CAC/B,CACE,MAAO,MACP,MAAO,KACT,EACA,CACE,MAAO,OACP,MAAO,MACT,EACA,CACE,MAAO,SACP,MAAO,QACT,EACA,CACE,MAAO,MACP,MAAO,KACT,CACF,ECrDA,OAAOC,M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AW,SACxC,UAAAY,EAACkB,EAAA,CACC,UAAS,GACT,QAAS5B,EACT,KAAK,eACL,MAAM,sBACN,SAAQ,GACR,MAAO,CACL,SAAU,CACR,MAAO,GACP,QAAS,+CACX,CACF,EACF,EACAU,EAACkB,EAAA,CACC,UAAS,GACT,QAAS3B,EACT,KAAK,cACL,MAAM,iBACN,SAAQ,GACR,MAAO,CACL,SAAU,CACR,MAAO,GACP,QAAS,0CACX,CACF,EACF,GACF,EACAS,EAACX,EAAA,CAAW,QAAQ,WAAW,MAAM,OAAO,wBAE5C,EACCuB,GAAS,IAAI,CAACO,EAAMC,IACnBnB,EAACb,EAAA,CAAoB,UAAU,MAAM,IAAK,EAAG,WAAW,SACtD,UAAAY,EAACgB,EAAA,CACC,KAAM,WAAWI,SACjB,MAAM,QACN,SAAQ,GACR,MAAO,CACL,SAAU,CACR,MAAO,GACP,QAAS,EACX,CACF,EACF,EACApB,EAACgB,EAAA,CAAM,KAAM,WAAWI,UAAe,MAAM,QAAQ,EACrDpB,EAACd,EAAA,CAAW,MAAM,QAAQ,QAAS,IAAM4B,EAAOM,CAAK,EACnD,SAAApB,EAACiB,EAAA,CAAK,KAAK,wBAAwB,EACrC,IAfUE,EAAK,EAgBjB,CACD,EACDnB,EAACqB,EAAA,CACC,WAAW,MACX,KAAK,QACL,QAAQ,WACR,MAAM,UACN,UAAS,GACT,QAAS,IAAMN,EAAkB,EAClC,uCAED,EACAf,EAACf,EAAA,EAAQ,GACX,CAEJ,EAEOqC,GAAQf","sourcesContent":["import { useFieldArray, useFormContext } from 'react-hook-form';\nimport Divider from '@mui/material/Divider';\nimport IconButton from '@mui/material/IconButton';\nimport InputAdornment from '@mui/material/InputAdornment';\nimport Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\n\nimport ActionButton from 'components/ActionButton';\nimport Icon from 'components/Icon';\n\nimport Autocomplete from '../Autocomplete';\nimport Field from '../Field';\n\nimport { ContentTypeOptions, HttpMethodOptions, WebhookProps } from './props';\nimport { SyledIconButton } from './styles';\nimport WebhookAlert from './WebhookAlert';\n\nconst Webhook = ({\n webhookData,\n isEditing = false,\n haveTip = false,\n}: WebhookProps) => {\n const { control } = useFormContext();\n\n const {\n fields: headers,\n append,\n remove,\n } = useFieldArray({\n name: 'headers',\n control,\n });\n\n const handleCreateField = () => {\n append({\n value: '',\n name: '',\n });\n };\n\n return (\n <>\n {haveTip && <WebhookAlert />}\n {isEditing && <Field name=\"name\" label=\"Nome do webhook\" />}\n <Stack direction=\"row\" gap={2}>\n <Field\n name=\"url\"\n label=\"URL de endpoint\"\n rules={{ required: { value: true, message: 'Url é obrigatório' } }}\n />\n <Field name=\"filter\" label=\"Filtro\" />\n </Stack>\n {isEditing && webhookData && (\n <>\n <Field variant=\"filled\" name=\"solution\" label=\"Solução\" disabled />\n <Stack direction=\"row\" gap={2}>\n <Field variant=\"filled\" name=\"resource\" label=\"Origem\" disabled />\n <Field\n variant=\"filled\"\n name=\"resource_id\"\n label=\"ID origem\"\n disabled\n InputProps={{\n endAdornment: (\n <InputAdornment position=\"end\">\n <SyledIconButton\n onClick={() =>\n navigator.clipboard.writeText(webhookData.resource_id)\n }\n >\n <Icon className=\"copyIcon\" icon=\"COPY_CONTENT\" />\n </SyledIconButton>\n </InputAdornment>\n ),\n }}\n />\n <Field variant=\"filled\" name=\"event\" label=\"Evento\" disabled />\n </Stack>\n </>\n )}\n <Stack direction=\"row\" gap={2} alignItems=\"center\">\n <Autocomplete\n fullWidth\n options={ContentTypeOptions}\n name=\"content_type\"\n label=\"Tipo de conteúdo\"\n required\n rules={{\n required: {\n value: true,\n message: 'Campo Tipo de conteúdo é obrigatório',\n },\n }}\n />\n <Autocomplete\n fullWidth\n options={HttpMethodOptions}\n name=\"http_method\"\n label=\"Método HTTP\"\n required\n rules={{\n required: {\n value: true,\n message: 'Campo Método HTTP é obrigatório',\n },\n }}\n />\n </Stack>\n <Typography variant=\"overline\" color=\"grey\">\n Cabeçalho\n </Typography>\n {headers?.map((item, index) => (\n <Stack key={item.id} direction=\"row\" gap={2} alignItems=\"center\">\n <Field\n name={`headers.${index}.name`}\n label=\"Chave\"\n required\n rules={{\n required: {\n value: true,\n message: '',\n },\n }}\n />\n <Field name={`headers.${index}.value`} label=\"Valor\" />\n <IconButton color=\"error\" onClick={() => remove(index)}>\n <Icon icon=\"DELETE_MARK_BUTTON_02\" />\n </IconButton>\n </Stack>\n ))}\n <ActionButton\n actionType=\"NEW\"\n size=\"large\"\n variant=\"outlined\"\n color=\"inherit\"\n fullWidth\n onClick={() => handleCreateField()}\n >\n Adicionar novo cabeçalho\n </ActionButton>\n <Divider />\n </>\n );\n};\n\nexport default Webhook;\n","import { WebhookType } from 'types/webhook';\n\nexport interface WebhookProps {\n webhookData?: WebhookType;\n isEditing?: boolean;\n haveTip?: boolean;\n}\nexport enum ContentTypeStatus {\n XML = 'XML',\n JSON = 'JSON',\n BYTEA = 'BYTEA',\n}\n\nexport enum HttpMethodStatus {\n GET = 'GET',\n POST = 'POST',\n PATCH = 'PATCH',\n DELETE = 'DELETE',\n PUT = 'PUT',\n}\n\nexport const ContentTypeOptions = [\n {\n label: ContentTypeStatus.XML,\n value: ContentTypeStatus.XML,\n },\n {\n label: ContentTypeStatus.JSON,\n value: ContentTypeStatus.JSON,\n },\n {\n label: ContentTypeStatus.BYTEA,\n value: ContentTypeStatus.BYTEA,\n },\n];\n\nexport const HttpMethodOptions = [\n {\n label: HttpMethodStatus.GET,\n value: HttpMethodStatus.GET,\n },\n {\n label: HttpMethodStatus.POST,\n value: HttpMethodStatus.POST,\n },\n {\n label: HttpMethodStatus.DELETE,\n value: HttpMethodStatus.DELETE,\n },\n {\n label: HttpMethodStatus.PUT,\n value: HttpMethodStatus.PUT,\n },\n];\n","import Alert from '@mui/material/Alert';\nimport IconButton from '@mui/material/IconButton';\nimport { alpha, styled } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\n\nexport const SyledIconButton = styled(IconButton)(({ theme }) => ({\n svg: {\n color: `${theme.palette.primary.main} !important`,\n },\n}));\n\nexport const SyledDeleteIcon = styled(IconButton)(() => ({\n height: '38px',\n alignSelf: 'center',\n}));\n\nexport const StyledTypography = styled(Typography)(() => ({\n textDecoration: 'underline',\n fontWeight: '600',\n cursor: 'pointer',\n}));\n\nexport const StyledAlert = styled(Alert)(({ theme }) => ({\n backgroundColor: `${alpha(theme.palette.primary.main, 0.03)}`,\n border: `1px solid ${alpha(theme.palette.primary.main, 0.4)}`,\n flexDirection: 'row',\n alignItems: 'center',\n padding: '2px 12px',\n gap: 8,\n borderRadius: 8,\n marginBottom: 16,\n\n '& svg': {\n color: theme.palette.primary.main,\n },\n}));\n","import Typography from '@mui/material/Typography';\n\nimport { StyledAlert, StyledTypography } from './styles';\n\nconst WebhookAlert = () => {\n const handleLinkClick = () => {\n const url =\n 'https://ajuda.zydon.com.br/pt-BR/articles/9180603-sobre-webhooks';\n window.open(url, '_blank');\n };\n\n return (\n <StyledAlert severity=\"info\">\n <Typography color=\"grey\" variant=\"caption\">\n Webhooks permitem que serviços externos sejam notificados quando\n determinados eventos acontecem. Saiba mais{' '}\n <StyledTypography\n variant=\"caption\"\n color=\"primary\"\n onClick={() => handleLinkClick()}\n >\n acessando a documentação do Webhook\n </StyledTypography>\n </Typography>\n </StyledAlert>\n );\n};\n\nexport default WebhookAlert;\n"]}
1
+ {"version":3,"sources":["../../../../src/components/form/Webhook/index.tsx","../../../../src/components/form/Webhook/props.ts","../../../../src/components/form/Webhook/styles.ts","../../../../src/components/form/Webhook/WebhookAlert.tsx"],"names":["useFieldArray","useFormContext","Divider","IconButton","InputAdornment","Stack","Typography","ContentTypeOptions","HttpMethodOptions","Alert","alpha","styled","SyledIconButton","theme","StyledTypography","StyledAlert","jsx","jsxs","WebhookAlert","handleLinkClick","url","WebhookAlert_default","Fragment","Webhook","webhookData","isEditing","haveTip","control","headers","append","remove","handleCreateField","Field_default","Icon_default","Autocomplete_default","item","index","ActionButton_default","Webhook_default"],"mappings":"kQAAA,OAAS,iBAA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,EACAf,EAACd,EAAA,EAAQ,GACX,CAEJ,EAEOoC,GAAQf","sourcesContent":["import { useFieldArray, useFormContext } from 'react-hook-form';\nimport Divider from '@mui/material/Divider';\nimport IconButton from '@mui/material/IconButton';\nimport InputAdornment from '@mui/material/InputAdornment';\nimport Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\n\nimport ActionButton from 'components/ActionButton';\nimport Icon from 'components/Icon';\n\nimport Autocomplete from '../Autocomplete';\nimport Field from '../Field';\n\nimport { ContentTypeOptions, HttpMethodOptions, WebhookProps } from './props';\nimport { SyledIconButton } from './styles';\nimport WebhookAlert from './WebhookAlert';\n\nconst Webhook = ({\n webhookData,\n isEditing = false,\n haveTip = false,\n}: WebhookProps) => {\n const { control } = useFormContext();\n\n const {\n fields: headers,\n append,\n remove,\n } = useFieldArray({\n name: 'headers',\n control,\n });\n\n const handleCreateField = () => {\n append({\n value: '',\n name: '',\n });\n };\n\n return (\n <>\n {haveTip && <WebhookAlert />}\n {isEditing && <Field name=\"name\" label=\"Nome do webhook\" />}\n <Stack direction=\"row\" gap={2}>\n <Field\n name=\"url\"\n label=\"URL de endpoint\"\n rules={{ required: { value: true, message: 'Url é obrigatório' } }}\n />\n <Field name=\"filter\" label=\"Filtro\" />\n </Stack>\n {isEditing && webhookData && (\n <>\n <Field variant=\"filled\" name=\"solution\" label=\"Solução\" disabled />\n <Stack direction=\"row\" gap={2}>\n <Field variant=\"filled\" name=\"resource\" label=\"Origem\" disabled />\n <Field\n variant=\"filled\"\n name=\"resource_id\"\n label=\"ID origem\"\n disabled\n InputProps={{\n endAdornment: (\n <InputAdornment position=\"end\">\n <SyledIconButton\n onClick={() =>\n navigator.clipboard.writeText(webhookData.resource_id)\n }\n >\n <Icon className=\"copyIcon\" icon=\"COPY_CONTENT\" />\n </SyledIconButton>\n </InputAdornment>\n ),\n }}\n />\n <Field variant=\"filled\" name=\"event\" label=\"Evento\" disabled />\n </Stack>\n </>\n )}\n <Stack direction=\"row\" gap={2} alignItems=\"center\">\n <Autocomplete\n fullWidth\n options={ContentTypeOptions}\n name=\"content_type\"\n label=\"Tipo de conteúdo\"\n required\n rules={{\n required: {\n value: true,\n message: 'Campo Tipo de conteúdo é obrigatório',\n },\n }}\n />\n <Autocomplete\n fullWidth\n options={HttpMethodOptions}\n name=\"http_method\"\n label=\"Método HTTP\"\n required\n rules={{\n required: {\n value: true,\n message: 'Campo Método HTTP é obrigatório',\n },\n }}\n />\n </Stack>\n <Typography variant=\"overline\" color=\"grey\">\n Cabeçalho\n </Typography>\n {headers?.map((item, index) => (\n <Stack key={item.id} direction=\"row\" gap={2} alignItems=\"center\">\n <Field\n name={`headers.${index}.name`}\n label=\"Chave\"\n required\n rules={{\n required: {\n value: true,\n message: '',\n },\n }}\n />\n <Field name={`headers.${index}.value`} label=\"Valor\" />\n <IconButton color=\"error\" onClick={() => remove(index)}>\n <Icon icon=\"DELETE_MARK_BUTTON_02\" />\n </IconButton>\n </Stack>\n ))}\n <ActionButton\n actionType=\"NEW\"\n size=\"large\"\n variant=\"outlined\"\n color=\"inherit\"\n fullWidth\n onClick={() => handleCreateField()}\n >\n Adicionar novo cabeçalho\n </ActionButton>\n <Divider />\n </>\n );\n};\n\nexport default Webhook;\n","import { WebhookType } from 'types/webhook';\n\nexport interface WebhookProps {\n webhookData?: WebhookType;\n isEditing?: boolean;\n haveTip?: boolean;\n}\nexport enum ContentTypeStatus {\n XML = 'XML',\n JSON = 'JSON',\n BYTEA = 'BYTEA',\n}\n\nexport enum HttpMethodStatus {\n GET = 'GET',\n POST = 'POST',\n PATCH = 'PATCH',\n DELETE = 'DELETE',\n PUT = 'PUT',\n}\n\nexport const ContentTypeOptions = [\n {\n label: ContentTypeStatus.XML,\n value: ContentTypeStatus.XML,\n },\n {\n label: ContentTypeStatus.JSON,\n value: ContentTypeStatus.JSON,\n },\n {\n label: ContentTypeStatus.BYTEA,\n value: ContentTypeStatus.BYTEA,\n },\n];\n\nexport const HttpMethodOptions = [\n {\n label: HttpMethodStatus.GET,\n value: HttpMethodStatus.GET,\n },\n {\n label: HttpMethodStatus.POST,\n value: HttpMethodStatus.POST,\n },\n {\n label: HttpMethodStatus.DELETE,\n value: HttpMethodStatus.DELETE,\n },\n {\n label: HttpMethodStatus.PUT,\n value: HttpMethodStatus.PUT,\n },\n];\n","import Alert from '@mui/material/Alert';\nimport IconButton from '@mui/material/IconButton';\nimport { alpha, styled } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\n\nexport const SyledIconButton = styled(IconButton)(({ theme }) => ({\n svg: {\n color: `${theme.palette.primary.main} !important`,\n },\n}));\n\nexport const StyledTypography = styled(Typography)(() => ({\n textDecoration: 'underline',\n fontWeight: '600',\n cursor: 'pointer',\n}));\n\nexport const StyledAlert = styled(Alert)(({ theme }) => ({\n backgroundColor: `${alpha(theme.palette.primary.main, 0.03)}`,\n border: `1px solid ${alpha(theme.palette.primary.main, 0.4)}`,\n flexDirection: 'row',\n alignItems: 'center',\n padding: '2px 12px',\n gap: 8,\n borderRadius: 8,\n marginBottom: 16,\n\n '& svg': {\n color: theme.palette.primary.main,\n },\n}));\n","import Typography from '@mui/material/Typography';\n\nimport { StyledAlert, StyledTypography } from './styles';\n\nconst WebhookAlert = () => {\n const handleLinkClick = () => {\n const url =\n 'https://ajuda.zydon.com.br/pt-BR/articles/9180603-sobre-webhooks';\n window.open(url, '_blank');\n };\n\n return (\n <StyledAlert severity=\"info\">\n <Typography color=\"grey\" variant=\"caption\">\n Webhooks permitem que serviços externos sejam notificados quando\n determinados eventos acontecem. Saiba mais{' '}\n <StyledTypography\n variant=\"caption\"\n color=\"primary\"\n onClick={() => handleLinkClick()}\n >\n acessando a documentação do Webhook\n </StyledTypography>\n </Typography>\n </StyledAlert>\n );\n};\n\nexport default WebhookAlert;\n"]}
@@ -1,4 +1,4 @@
1
- import { a } from '../../chunk-CMZI4PHD.js';
1
+ import { a } from '../../chunk-NQNNMRLC.js';
2
2
  import '../../chunk-CIGSMWKF.js';
3
3
  import w from '@mui/material/Box';
4
4
  import C, { useLightboxState } from 'yet-another-react-lightbox';
@@ -1,5 +1,5 @@
1
- import { a } from '../../chunk-WDKKCLZ6.js';
2
- import '../../chunk-CMZI4PHD.js';
1
+ import { a } from '../../chunk-CWCEG2DZ.js';
2
+ import '../../chunk-NQNNMRLC.js';
3
3
  import '../../chunk-CIGSMWKF.js';
4
4
  import S from '@mui/material/TableCell';
5
5
  import F from '@mui/material/TableRow';
@@ -1,6 +1,6 @@
1
1
  import { a as a$1 } from '../../chunk-RP7PNTLJ.js';
2
- import { a } from '../../chunk-GPFANUMT.js';
3
2
  import '../../chunk-E5ULJSWF.js';
3
+ import { a } from '../../chunk-GPFANUMT.js';
4
4
  import '../../chunk-TVKBRJHF.js';
5
5
  import { createContext, useState, useRef, useMemo, useEffect, useCallback, useContext } from 'react';
6
6
  import { jsx } from 'react/jsx-runtime';
@@ -1,7 +1,7 @@
1
- export { a as default } from '../chunk-75G5RNV4.js';
1
+ export { a as default } from '../chunk-5LQLLZ5L.js';
2
2
  import '../chunk-XNKYJHNL.js';
3
- import '../chunk-HLMZQG27.js';
4
- import '../chunk-MQAMSYYK.js';
3
+ import '../chunk-HWYA3EGC.js';
4
+ import '../chunk-POTVACYB.js';
5
5
  import '../chunk-L5URMM57.js';
6
6
  import '../chunk-ET3WPQIO.js';
7
7
  //# sourceMappingURL=out.js.map
@@ -1,4 +1,3 @@
1
- declare function useEventCallback<Args extends unknown[], R>(fn: (...args: Args) => R): (...args: Args) => R;
2
- declare function useEventCallback<Args extends unknown[], R>(fn: ((...args: Args) => R) | undefined): ((...args: Args) => R) | undefined;
1
+ declare const useEventCallback: <Args extends unknown[], R>(fn: ((...args: Args) => R) | undefined) => (...args: Args) => R;
3
2
 
4
- export { useEventCallback as default, useEventCallback };
3
+ export { useEventCallback as default };
@@ -1,4 +1,4 @@
1
- export { b as default, a as useEventCallback } from '../chunk-MQAMSYYK.js';
1
+ export { a as default } from '../chunk-POTVACYB.js';
2
2
  import '../chunk-ET3WPQIO.js';
3
3
  //# sourceMappingURL=out.js.map
4
4
  //# sourceMappingURL=useEventCallback.js.map
@@ -1,5 +1,5 @@
1
- export { a as default } from '../chunk-HLMZQG27.js';
2
- import '../chunk-MQAMSYYK.js';
1
+ export { a as default } from '../chunk-HWYA3EGC.js';
2
+ import '../chunk-POTVACYB.js';
3
3
  import '../chunk-L5URMM57.js';
4
4
  import '../chunk-ET3WPQIO.js';
5
5
  //# sourceMappingURL=out.js.map
@@ -12,7 +12,6 @@ declare const useSnackbar: () => {
12
12
  custom: (jsx: (id: string | number) => react.ReactElement<any, string | react.JSXElementConstructor<any>>, data?: ExternalToast | undefined) => string | number;
13
13
  message: (message: string | number | boolean | react.ReactElement<any, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | react.ReactPortal | (() => ReactNode) | null | undefined, data?: ExternalToast | undefined) => string | number;
14
14
  promise: <ToastData>(promise: Promise<ToastData> | (() => Promise<ToastData>), data?: ({
15
- cancel?: ReactNode | sonner.Action;
16
15
  className?: string | undefined;
17
16
  style?: react.CSSProperties | undefined;
18
17
  position?: ("top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right") | undefined;
@@ -22,6 +21,7 @@ declare const useSnackbar: () => {
22
21
  icon?: ReactNode;
23
22
  duration?: number | undefined;
24
23
  onDismiss?: ((toast: sonner.ToastT) => void) | undefined;
24
+ cancel?: ReactNode | sonner.Action;
25
25
  richColors?: boolean | undefined;
26
26
  closeButton?: boolean | undefined;
27
27
  dismissible?: boolean | undefined;
@@ -1,12 +1,12 @@
1
1
  export { a as useThemeToggle } from '../chunk-UHXAPEIF.js';
2
- import '../chunk-CU7PKEY2.js';
2
+ import '../chunk-4RNGASI4.js';
3
3
  import '../chunk-LDGBS7ZI.js';
4
- import '../chunk-2WG6OWB4.js';
5
4
  import '../chunk-6W52DPH4.js';
6
5
  import '../chunk-TWSAWMZ3.js';
7
6
  import '../chunk-ROVD7OGE.js';
8
7
  import '../chunk-EQYL7U3J.js';
9
8
  import '../chunk-WUFEPE2G.js';
9
+ import '../chunk-2WG6OWB4.js';
10
10
  import '../chunk-GLRLKFPS.js';
11
11
  //# sourceMappingURL=out.js.map
12
12
  //# sourceMappingURL=useThemeToggle.js.map
@@ -1,3 +1,8 @@
1
- export { a as default } from '../chunk-YCEQDXLR.js';
1
+ import { useState } from 'react';
2
+ import { useFormContext } from 'react-hook-form';
3
+
4
+ function F(t,i){let{watch:r,setValue:n}=useFormContext(),[u,o]=useState(i),l=r(t)||[];return {uploadFile:async e=>{if(!e){n(t,void 0),o(void 0);return}n(t,e),o(Object.assign(e,{preview:URL.createObjectURL(e)}));},uploadFiles:async e=>{n(t,[...l,...e.map(s=>Object.assign(s,{preview:URL.createObjectURL(s)}))]);},handleDeleteFile:()=>{n(t,void 0),o(void 0);},handleRemoveAll:()=>{n(t,void 0);},handleRemove:e=>{let s=l.filter(a=>a!==e);n(t,s);},file:u,setFileValue:o}}var b=F;
5
+
6
+ export { b as default };
2
7
  //# sourceMappingURL=out.js.map
3
8
  //# sourceMappingURL=useUpload.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":["../../src/hooks/useUpload.ts"],"names":["useState","useFormContext","useUpload","fieldName","urlImage","watch","setValue","fileValue","setFileValue","filesValues","file","files","filteredItems","f","useUpload_default"],"mappings":"AAAA,OAAS,YAAAA,MAAgB,QACzB,OAAS,kBAAAC,MAAsB,kBAI/B,SAASC,EAAUC,EAAmBC,EAAmB,CACvD,GAAM,CAAE,MAAAC,EAAO,SAAAC,CAAS,EAAIL,EAAe,EACrC,CAACM,EAAWC,CAAY,EAAIR,EAChCI,CACF,EACMK,EAAwBJ,EAAMF,CAAS,GAAK,CAAC,EA4CnD,MAAO,CACL,WA3CiB,MAAOO,GAAgB,CACxC,GAAI,CAACA,EAAM,CACTJ,EAASH,EAAW,MAAS,EAC7BK,EAAa,MAAS,EACtB,OAGFF,EAASH,EAAWO,CAAI,EAExBF,EACE,OAAO,OAAOE,EAAM,CAClB,QAAS,IAAI,gBAAgBA,CAAI,CACnC,CAAC,CACH,CACF,EA8BE,YA5BkB,MAAOC,GAAkB,CAC3CL,EAASH,EAAW,CAClB,GAAGM,EACH,GAAGE,EAAM,IAAKD,GACZ,OAAO,OAAOA,EAAM,CAClB,QAAS,IAAI,gBAAgBA,CAAI,CACnC,CAAC,CACH,CACF,CAAC,CACH,EAoBE,iBAlBuB,IAAM,CAC7BJ,EAASH,EAAW,MAAS,EAC7BK,EAAa,MAAS,CACxB,EAgBE,gBAdsB,IAAM,CAC5BF,EAASH,EAAW,MAAS,CAC/B,EAaE,aAXoBO,GAAwB,CAC5C,IAAME,EAAgBH,EAAY,OAAOI,GAAKA,IAAMH,CAAI,EAExDJ,EAASH,EAAWS,CAAa,CACnC,EAQE,KAAML,EACN,aAAAC,CACF,CACF,CAEA,IAAOM,EAAQZ","sourcesContent":["import { useState } from 'react';\nimport { useFormContext } from 'react-hook-form';\n\nimport { CustomFile } from 'types/upload';\n\nfunction useUpload(fieldName: string, urlImage?: string) {\n const { watch, setValue } = useFormContext();\n const [fileValue, setFileValue] = useState<CustomFile | string | undefined>(\n urlImage,\n );\n const filesValues: string[] = watch(fieldName) || [];\n\n const uploadFile = async (file?: File) => {\n if (!file) {\n setValue(fieldName, undefined);\n setFileValue(undefined);\n return;\n }\n\n setValue(fieldName, file);\n\n setFileValue(\n Object.assign(file, {\n preview: URL.createObjectURL(file),\n }),\n );\n };\n\n const uploadFiles = async (files: File[]) => {\n setValue(fieldName, [\n ...filesValues,\n ...files.map((file: Blob | MediaSource) =>\n Object.assign(file, {\n preview: URL.createObjectURL(file),\n }),\n ),\n ]);\n };\n\n const handleDeleteFile = () => {\n setValue(fieldName, undefined);\n setFileValue(undefined);\n };\n\n const handleRemoveAll = () => {\n setValue(fieldName, undefined);\n };\n\n const handleRemove = (file: File | string) => {\n const filteredItems = filesValues.filter(f => f !== file);\n\n setValue(fieldName, filteredItems);\n };\n\n return {\n uploadFile,\n uploadFiles,\n handleDeleteFile,\n handleRemoveAll,\n handleRemove,\n file: fileValue,\n setFileValue,\n };\n}\n\nexport default useUpload;\n"]}
@@ -1,4 +1,9 @@
1
- export { a as default } from '../chunk-SBMEL2IJ.js';
2
- import '../chunk-E3R7W7GK.js';
1
+ import { a } from '../chunk-E3R7W7GK.js';
2
+ import { useId, useState } from 'react';
3
+ import I from 'browser-image-compression';
4
+
5
+ var h=5242880,y=({onFileCropped:n,onImageUploaded:d,onCancel:i})=>{let l=useId(),[e,m]=useState(),[f,o,a$1]=a(),[u,r]=useState(),[v,p]=useState(!1);return {id:l,setCropModalOpen:a$1,handleRemove:()=>{n(void 0),d(void 0),a$1(!1);},toggleCropModalOpen:o,cropModalOpen:f,cancelChanges:()=>{i&&i(),a$1(!1);},saveChanges:()=>{e!==void 0&&e.getCroppedCanvas().toBlob(async g=>{try{if(!g)return;p(!0);let s=new File([g],"imagem.png",{type:"image/png"});if(s.size>h){let C=await I(s,{maxSizeMB:5});n(C),o();return}n(s),o();}finally{p(!1);}},"image/png",1);},previewImage:()=>{e!==void 0&&r(e.getCroppedCanvas().toDataURL());},setCropper:m,preview:u,closePreviewImage:()=>r(void 0),saving:v}},x=y;
6
+
7
+ export { x as default };
3
8
  //# sourceMappingURL=out.js.map
4
9
  //# sourceMappingURL=useUploadImage.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":["../../src/hooks/useUploadImage.ts"],"names":["useId","useState","imageCompression","FIVE_MB","useUploadImage","onFileCropped","onImageUploaded","onCancel","id","cropper","setCropper","cropModalOpen","toggleCropModalOpen","setCropModalOpen","useToggle_default","preview","setPreview","saving","setSaving","blob","file","compressedFile","useUploadImage_default"],"mappings":"yCACA,OAAS,SAAAA,EAAO,YAAAC,MAAgB,QAChC,OAAOC,MAAsB,4BAU7B,IAAMC,EAAU,QAEVC,EAAiB,CAAC,CACtB,cAAAC,EACA,gBAAAC,EACA,SAAAC,CACF,IAAa,CACX,IAAMC,EAAKR,EAAM,EACX,CAACS,EAASC,CAAU,EAAIT,EAAc,EACtC,CAACU,EAAeC,EAAqBC,CAAgB,EAAIC,EAAU,EACnE,CAACC,EAASC,CAAU,EAAIf,EAAiB,EACzC,CAACgB,EAAQC,CAAS,EAAIjB,EAAS,EAAK,EAuD1C,MAAO,CACL,GAAAO,EACA,iBAAAK,EACA,aATmB,IAAM,CACzBR,EAAc,MAAS,EACvBC,EAAgB,MAAS,EACzBO,EAAiB,EAAK,CACxB,EAME,oBAAAD,EACA,cAAAD,EACA,cA3DoB,IAAM,CACtBJ,GAAUA,EAAS,EACvBM,EAAiB,EAAK,CACxB,EAyDE,YA/CkB,IAAM,CACpBJ,IAAY,QAEhBA,EAAQ,iBAAiB,EAAE,OACzB,MAAOU,GAAc,CACnB,GAAI,CACF,GAAI,CAACA,EAAM,OAEXD,EAAU,EAAI,EAEd,IAAME,EAAO,IAAI,KAAK,CAACD,CAAI,EAAG,aAAc,CAAE,KAAM,WAAY,CAAC,EAEjE,GAAIC,EAAK,KAAOjB,EAAS,CACvB,IAAMkB,EAAiB,MAAMnB,EAAiBkB,EAAM,CAClD,UAAW,CACb,CAAC,EAEDf,EAAcgB,CAAc,EAC5BT,EAAoB,EAEpB,OAGFP,EAAce,CAAI,EAClBR,EAAoB,CACtB,QAAE,CACAM,EAAU,EAAK,CACjB,CACF,EACA,YACA,CACF,CACF,EAgBE,aAxDmB,IAAM,CACrBT,IAAY,QAEhBO,EAAWP,EAAQ,iBAAiB,EAAE,UAAU,CAAC,CACnD,EAqDE,WAAAC,EACA,QAAAK,EACA,kBArDwB,IAAMC,EAAW,MAAS,EAsDlD,OAAAC,CACF,CACF,EAEOK,EAAQlB","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useId, useState } from 'react';\nimport imageCompression from 'browser-image-compression';\n\nimport useToggle from './useToggle';\n\ninterface Props {\n onFileCropped(file?: File): void;\n onImageUploaded(image?: string): void;\n onCancel?: VoidFunction;\n}\n\nconst FIVE_MB = 5242880;\n\nconst useUploadImage = ({\n onFileCropped,\n onImageUploaded,\n onCancel,\n}: Props) => {\n const id = useId();\n const [cropper, setCropper] = useState<any>();\n const [cropModalOpen, toggleCropModalOpen, setCropModalOpen] = useToggle();\n const [preview, setPreview] = useState<string>();\n const [saving, setSaving] = useState(false);\n\n const cancelChanges = () => {\n if (onCancel) onCancel();\n setCropModalOpen(false);\n };\n\n const previewImage = () => {\n if (cropper === undefined) return;\n\n setPreview(cropper.getCroppedCanvas().toDataURL());\n };\n\n const closePreviewImage = () => setPreview(undefined);\n\n const saveChanges = () => {\n if (cropper === undefined) return;\n\n cropper.getCroppedCanvas().toBlob(\n async (blob: any) => {\n try {\n if (!blob) return;\n\n setSaving(true);\n\n const file = new File([blob], 'imagem.png', { type: 'image/png' });\n\n if (file.size > FIVE_MB) {\n const compressedFile = await imageCompression(file, {\n maxSizeMB: 5,\n });\n\n onFileCropped(compressedFile);\n toggleCropModalOpen();\n\n return;\n }\n\n onFileCropped(file);\n toggleCropModalOpen();\n } finally {\n setSaving(false);\n }\n },\n 'image/png',\n 1,\n );\n };\n\n const handleRemove = () => {\n onFileCropped(undefined);\n onImageUploaded(undefined);\n setCropModalOpen(false);\n };\n\n return {\n id,\n setCropModalOpen,\n handleRemove,\n toggleCropModalOpen,\n cropModalOpen,\n cancelChanges,\n saveChanges,\n previewImage,\n setCropper,\n preview,\n closePreviewImage,\n saving,\n };\n};\n\nexport default useUploadImage;\n"]}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as CustomShadows } from './index-c8f1e6e7.js';
2
- export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from './index-c8f1e6e7.js';
1
+ import { C as CustomShadows } from './index-5a5e5dc8.js';
2
+ export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from './index-5a5e5dc8.js';
3
3
  export { S as SettingsContextValue, _ as SettingsProvider, T as ThemeProviderProps, u as useSettingsContext } from './settings-provider-38d09283.js';
4
4
  export { THEME_CONFIG, default as ThemeProvider } from './theme/theme-provider.js';
5
5
  import { S as SettingsState } from './settings-583c107c.js';
@@ -147,6 +147,4 @@ declare module '@mui/material/styles' {
147
147
  }
148
148
  }
149
149
 
150
- declare const test: () => boolean;
151
-
152
- export { SettingsState, createTheme, test };
150
+ export { SettingsState, createTheme };
package/dist/index.js CHANGED
@@ -1,16 +1,12 @@
1
1
  export { a as useThemeToggle } from './chunk-UHXAPEIF.js';
2
- export { b as ThemeProvider, a as createTheme } from './chunk-CU7PKEY2.js';
2
+ export { b as ThemeProvider, a as createTheme } from './chunk-4RNGASI4.js';
3
3
  import './chunk-LDGBS7ZI.js';
4
- export { c as SettingsProvider, b as useSettingsContext } from './chunk-2WG6OWB4.js';
5
4
  export { b as defaultFont, c as primaryFont, d as secondaryFont, a as shadows, e as typography } from './chunk-6W52DPH4.js';
6
5
  import './chunk-TWSAWMZ3.js';
7
6
  import './chunk-ROVD7OGE.js';
8
7
  export { l as action, k as background, m as basePalette, p as colorSchemes, i as common, a as components, q as createShadowColor, r as customShadows, o as darkPalette, h as error, b as grey, e as info, n as lightPalette, c as primary, d as secondary, f as success, j as text, g as warning } from './chunk-EQYL7U3J.js';
9
8
  import './chunk-WUFEPE2G.js';
9
+ export { c as SettingsProvider, b as useSettingsContext } from './chunk-2WG6OWB4.js';
10
10
  export { a as THEME_CONFIG, q as bgBlur, p as bgGradient, o as borderGradient, j as createPaletteChannel, h as hexToRgbChannel, i as hexToRgbaChannel, l as hideScrollX, m as hideScrollY, r as maxLine, c as mediaQueries, t as menuItem, s as paper, f as pxToRem, e as remToPx, g as responsiveFontSizes, d as setFont, b as stylesMode, n as textGradient, k as varAlpha } from './chunk-GLRLKFPS.js';
11
-
12
- var Y=()=>!0;
13
-
14
- export { Y as test };
15
11
  //# sourceMappingURL=out.js.map
16
12
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["test"],"mappings":"ioBA8KA,IAAMA,EAAO,IAAM","sourcesContent":["/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport { CustomShadows } from './types/shadows';\n\n// @ts-ignore\ndeclare module '@mui/material/styles/createPalette' {\n interface CommonColors {\n whiteChannel: string;\n blackChannel: string;\n }\n interface TypeText {\n disabledChannel: string;\n }\n interface TypeBackground {\n neutral: string;\n neutralChannel: string;\n }\n interface SimplePaletteColorOptions {\n lighter: string;\n darker: string;\n lighterChannel: string;\n darkerChannel: string;\n }\n interface PaletteColor {\n lighter: string;\n darker: string;\n lighterChannel: string;\n darkerChannel: string;\n }\n}\n\n// @ts-ignore\ndeclare module '@mui/material/styles' {\n interface ThemeVars {\n // @ts-ignore\n transitions: Theme['transitions'];\n }\n}\n\n// @ts-ignore\ndeclare module '@mui/material' {\n interface Color {\n ['50Channel']: string;\n ['100Channel']: string;\n ['200Channel']: string;\n ['300Channel']: string;\n ['400Channel']: string;\n ['500Channel']: string;\n ['600Channel']: string;\n ['700Channel']: string;\n ['800Channel']: string;\n ['900Channel']: string;\n }\n}\n\n// @ts-ignore\ndeclare module '@mui/material/styles' {\n interface TypographyVariants {\n fontSecondaryFamily: React.CSSProperties['fontFamily'];\n fontWeightSemiBold: React.CSSProperties['fontWeight'];\n }\n interface TypographyVariantsOptions {\n fontSecondaryFamily?: React.CSSProperties['fontFamily'];\n fontWeightSemiBold?: React.CSSProperties['fontWeight'];\n }\n interface ThemeVars {\n // @ts-ignore\n typography: Theme['typography'];\n }\n}\n\n// @ts-ignore\ndeclare module '@mui/material/AvatarGroup' {\n interface AvatarGroupPropsVariantOverrides {\n compact: true;\n }\n}\n\n// @ts-ignore\ndeclare module '@mui/material/Badge' {\n interface BadgePropsVariantOverrides {\n alway: true;\n busy: true;\n online: true;\n offline: true;\n invisible: true;\n }\n}\n\n// @ts-ignore\ndeclare module '@mui/material/Fab' {\n interface FabPropsVariantOverrides {\n outlined: true;\n outlinedExtended: true;\n soft: true;\n softExtended: true;\n }\n}\n\n// @ts-ignore\ndeclare module '@mui/material/ButtonGroup' {\n interface ButtonGroupPropsVariantOverrides {\n soft: true;\n }\n}\n\n// @ts-ignore\ndeclare module '@mui/material/Button' {\n interface ButtonPropsVariantOverrides {\n soft: true;\n }\n}\n\n// @ts-ignore\ndeclare module '@mui/material/Chip' {\n interface ChipPropsVariantOverrides {\n soft: true;\n }\n}\n\n// @ts-ignore\ndeclare module '@mui/material/Pagination' {\n interface PaginationPropsVariantOverrides {\n soft: true;\n }\n\n interface PaginationPropsColorOverrides {\n info: true;\n success: true;\n warning: true;\n error: true;\n }\n}\n\n// @ts-ignore\ndeclare module '@mui/material/Slider' {\n interface SliderPropsColorOverrides {\n inherit: true;\n }\n}\n\n// @ts-ignore\ndeclare module '@mui/material/styles' {\n interface Theme {\n customShadows: CustomShadows;\n }\n interface ThemeOptions {\n customShadows?: CustomShadows;\n }\n interface ThemeVars {\n customShadows: CustomShadows;\n }\n}\n\nimport './global.css';\n\n// Theme exports\nexport type { ThemeProviderProps } from './theme/props';\nexport type { SettingsContextValue } from './theme/props';\nexport { default as SettingsProvider } from './theme/settings-provider';\nexport {\n THEME_CONFIG,\n default as ThemeProvider,\n useSettingsContext,\n} from './theme/theme-provider';\nexport type { SettingsState } from './types/settings';\n\n// Core theme utilities\nexport * from './theme/core';\nexport { createTheme } from './theme/create-theme';\nexport * from './theme/styles';\n\n// Hooks exports\nexport { useThemeToggle } from './hooks/useThemeToggle';\n\nconst test = () => true;\n\nexport { test };\n"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,4 +1,4 @@
1
- export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from '../../index-c8f1e6e7.js';
1
+ export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from '../../index-5a5e5dc8.js';
2
2
  import '@mui/lab/TimelineConnector';
3
3
  import '@mui/system';
4
4
  import '@mui/lab/TimelineDot';
@@ -193,7 +193,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
193
193
  flexShrink?: readonly ((string & {}) | csstype.Globals)[] | csstype.Property.FlexShrink | readonly NonNullable<csstype.Property.FlexShrink | undefined>[] | undefined;
194
194
  flexWrap?: csstype.Property.FlexWrap | readonly NonNullable<csstype.Property.FlexWrap | undefined>[] | readonly csstype.Property.FlexWrap[] | undefined;
195
195
  float?: csstype.Property.Float | readonly NonNullable<csstype.Property.Float | undefined>[] | readonly csstype.Property.Float[] | undefined;
196
- fontFamily?: readonly string[] | csstype.Property.FontFamily | readonly csstype.Property.FontFamily[] | undefined;
196
+ fontFamily?: csstype.Property.FontFamily | readonly string[] | readonly csstype.Property.FontFamily[] | undefined;
197
197
  fontFeatureSettings?: readonly string[] | csstype.Property.FontFeatureSettings | readonly csstype.Property.FontFeatureSettings[] | undefined;
198
198
  fontKerning?: csstype.Property.FontKerning | readonly NonNullable<csstype.Property.FontKerning | undefined>[] | readonly csstype.Property.FontKerning[] | undefined;
199
199
  fontLanguageOverride?: readonly string[] | csstype.Property.FontLanguageOverride | readonly csstype.Property.FontLanguageOverride[] | undefined;
@@ -218,7 +218,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
218
218
  fontVariantNumeric?: readonly string[] | csstype.Property.FontVariantNumeric | readonly csstype.Property.FontVariantNumeric[] | undefined;
219
219
  fontVariantPosition?: csstype.Property.FontVariantPosition | readonly NonNullable<csstype.Property.FontVariantPosition | undefined>[] | readonly csstype.Property.FontVariantPosition[] | undefined;
220
220
  fontVariationSettings?: readonly string[] | csstype.Property.FontVariationSettings | readonly csstype.Property.FontVariationSettings[] | undefined;
221
- fontWeight?: csstype.Property.FontWeight | readonly NonNullable<csstype.Property.FontWeight | undefined>[] | readonly ("bold" | (string & {}) | csstype.Globals | "normal" | "bolder" | "lighter")[] | undefined;
221
+ fontWeight?: csstype.Property.FontWeight | readonly NonNullable<csstype.Property.FontWeight | undefined>[] | readonly ((string & {}) | csstype.Globals | "bold" | "normal" | "bolder" | "lighter")[] | undefined;
222
222
  forcedColorAdjust?: csstype.Property.ForcedColorAdjust | readonly NonNullable<csstype.Property.ForcedColorAdjust | undefined>[] | readonly csstype.Property.ForcedColorAdjust[] | undefined;
223
223
  gridAutoColumns?: readonly (string | (string & {}))[] | csstype.Property.GridAutoColumns<string | number> | readonly NonNullable<csstype.Property.GridAutoColumns<string | number> | undefined>[] | undefined;
224
224
  gridAutoFlow?: readonly string[] | csstype.Property.GridAutoFlow | readonly csstype.Property.GridAutoFlow[] | undefined;
@@ -443,9 +443,9 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
443
443
  wordWrap?: csstype.Property.WordWrap | readonly NonNullable<csstype.Property.WordWrap | undefined>[] | readonly csstype.Property.WordWrap[] | undefined;
444
444
  writingMode?: csstype.Property.WritingMode | readonly NonNullable<csstype.Property.WritingMode | undefined>[] | readonly csstype.Property.WritingMode[] | undefined;
445
445
  zIndex?: readonly ((string & {}) | csstype.Globals | "auto")[] | csstype.Property.ZIndex | readonly NonNullable<csstype.Property.ZIndex | undefined>[] | undefined;
446
- zoom?: csstype.Property.Zoom | readonly NonNullable<csstype.Property.Zoom | undefined>[] | readonly ("reset" | (string & {}) | csstype.Globals | "normal")[] | undefined;
446
+ zoom?: csstype.Property.Zoom | readonly NonNullable<csstype.Property.Zoom | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reset")[] | undefined;
447
447
  all?: csstype.Globals | readonly NonNullable<csstype.Globals | undefined>[] | readonly csstype.Globals[] | undefined;
448
- animation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "none" | "auto" | "normal" | "alternate" | "alternate-reverse" | "reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
448
+ animation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "none" | "auto" | "alternate" | "alternate-reverse" | "reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
449
449
  animationRange?: readonly (string | (string & {}))[] | csstype.Property.AnimationRange<string | number> | readonly NonNullable<csstype.Property.AnimationRange<string | number> | undefined>[] | undefined;
450
450
  background?: readonly (string | (string & {}))[] | csstype.Property.Background<string | number> | readonly NonNullable<csstype.Property.Background<string | number> | undefined>[] | undefined;
451
451
  border?: readonly (string | (string & {}))[] | csstype.Property.Border<string | number> | readonly NonNullable<csstype.Property.Border<string | number> | undefined>[] | undefined;
@@ -454,7 +454,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
454
454
  borderBlockStart?: readonly (string | (string & {}))[] | csstype.Property.BorderBlockStart<string | number> | readonly NonNullable<csstype.Property.BorderBlockStart<string | number> | undefined>[] | undefined;
455
455
  borderBottom?: readonly (string | (string & {}))[] | csstype.Property.BorderBottom<string | number> | readonly NonNullable<csstype.Property.BorderBottom<string | number> | undefined>[] | undefined;
456
456
  borderColor?: readonly string[] | csstype.Property.BorderColor | readonly csstype.Property.BorderColor[] | undefined;
457
- borderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
457
+ borderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "stretch")[] | undefined;
458
458
  borderInline?: readonly (string | (string & {}))[] | csstype.Property.BorderInline<string | number> | readonly NonNullable<csstype.Property.BorderInline<string | number> | undefined>[] | undefined;
459
459
  borderInlineEnd?: readonly (string | (string & {}))[] | csstype.Property.BorderInlineEnd<string | number> | readonly NonNullable<csstype.Property.BorderInlineEnd<string | number> | undefined>[] | undefined;
460
460
  borderInlineStart?: readonly (string | (string & {}))[] | csstype.Property.BorderInlineStart<string | number> | readonly NonNullable<csstype.Property.BorderInlineStart<string | number> | undefined>[] | undefined;
@@ -486,7 +486,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
486
486
  marginBlock?: readonly (string | (string & {}))[] | csstype.Property.MarginBlock<string | number> | readonly NonNullable<csstype.Property.MarginBlock<string | number> | undefined>[] | undefined;
487
487
  marginInline?: readonly (string | (string & {}))[] | csstype.Property.MarginInline<string | number> | readonly NonNullable<csstype.Property.MarginInline<string | number> | undefined>[] | undefined;
488
488
  mask?: readonly (string | (string & {}))[] | csstype.Property.Mask<string | number> | readonly NonNullable<csstype.Property.Mask<string | number> | undefined>[] | undefined;
489
- maskBorder?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
489
+ maskBorder?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
490
490
  motion?: readonly (string | (string & {}))[] | csstype.Property.Offset<string | number> | readonly NonNullable<csstype.Property.Offset<string | number> | undefined>[] | undefined;
491
491
  offset?: readonly (string | (string & {}))[] | csstype.Property.Offset<string | number> | readonly NonNullable<csstype.Property.Offset<string | number> | undefined>[] | undefined;
492
492
  outline?: readonly (string | (string & {}))[] | csstype.Property.Outline<string | number> | readonly NonNullable<csstype.Property.Outline<string | number> | undefined>[] | undefined;
@@ -729,8 +729,8 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
729
729
  WebkitUserModify?: csstype.Property.WebkitUserModify | readonly NonNullable<csstype.Property.WebkitUserModify | undefined>[] | readonly csstype.Property.WebkitUserModify[] | undefined;
730
730
  WebkitUserSelect?: csstype.Property.UserSelect | readonly NonNullable<csstype.Property.UserSelect | undefined>[] | readonly csstype.Property.UserSelect[] | undefined;
731
731
  WebkitWritingMode?: csstype.Property.WritingMode | readonly NonNullable<csstype.Property.WritingMode | undefined>[] | readonly csstype.Property.WritingMode[] | undefined;
732
- MozAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "none" | "auto" | "normal" | "alternate" | "alternate-reverse" | "reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
733
- MozBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
732
+ MozAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "none" | "auto" | "alternate" | "alternate-reverse" | "reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
733
+ MozBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "stretch")[] | undefined;
734
734
  MozColumnRule?: readonly (string | (string & {}))[] | csstype.Property.ColumnRule<string | number> | readonly NonNullable<csstype.Property.ColumnRule<string | number> | undefined>[] | undefined;
735
735
  MozColumns?: readonly (string | (string & {}))[] | csstype.Property.Columns<string | number> | readonly NonNullable<csstype.Property.Columns<string | number> | undefined>[] | undefined;
736
736
  MozOutlineRadius?: readonly (string | (string & {}))[] | csstype.Property.MozOutlineRadius<string | number> | readonly NonNullable<csstype.Property.MozOutlineRadius<string | number> | undefined>[] | undefined;
@@ -741,16 +741,16 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
741
741
  msScrollSnapX?: readonly string[] | csstype.Property.MsScrollSnapX | readonly csstype.Property.MsScrollSnapX[] | undefined;
742
742
  msScrollSnapY?: readonly string[] | csstype.Property.MsScrollSnapY | readonly csstype.Property.MsScrollSnapY[] | undefined;
743
743
  msTransition?: readonly string[] | csstype.Property.Transition<string & {}> | readonly csstype.Property.Transition<string & {}>[] | undefined;
744
- WebkitAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "none" | "auto" | "normal" | "alternate" | "alternate-reverse" | "reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
744
+ WebkitAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "none" | "auto" | "alternate" | "alternate-reverse" | "reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
745
745
  WebkitBorderBefore?: readonly (string | (string & {}))[] | csstype.Property.WebkitBorderBefore<string | number> | readonly NonNullable<csstype.Property.WebkitBorderBefore<string | number> | undefined>[] | undefined;
746
- WebkitBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
746
+ WebkitBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "stretch")[] | undefined;
747
747
  WebkitBorderRadius?: readonly (string | (string & {}))[] | csstype.Property.BorderRadius<string | number> | readonly NonNullable<csstype.Property.BorderRadius<string | number> | undefined>[] | undefined;
748
748
  WebkitColumnRule?: readonly (string | (string & {}))[] | csstype.Property.ColumnRule<string | number> | readonly NonNullable<csstype.Property.ColumnRule<string | number> | undefined>[] | undefined;
749
749
  WebkitColumns?: readonly (string | (string & {}))[] | csstype.Property.Columns<string | number> | readonly NonNullable<csstype.Property.Columns<string | number> | undefined>[] | undefined;
750
750
  WebkitFlex?: readonly (string | (string & {}))[] | csstype.Property.Flex<string | number> | readonly NonNullable<csstype.Property.Flex<string | number> | undefined>[] | undefined;
751
751
  WebkitFlexFlow?: readonly string[] | csstype.Property.FlexFlow | readonly csstype.Property.FlexFlow[] | undefined;
752
752
  WebkitMask?: readonly (string | (string & {}))[] | csstype.Property.WebkitMask<string | number> | readonly NonNullable<csstype.Property.WebkitMask<string | number> | undefined>[] | undefined;
753
- WebkitMaskBoxImage?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
753
+ WebkitMaskBoxImage?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
754
754
  WebkitTextEmphasis?: readonly string[] | csstype.Property.TextEmphasis | readonly csstype.Property.TextEmphasis[] | undefined;
755
755
  WebkitTextStroke?: readonly (string | (string & {}))[] | csstype.Property.WebkitTextStroke<string | number> | readonly NonNullable<csstype.Property.WebkitTextStroke<string | number> | undefined>[] | undefined;
756
756
  WebkitTransition?: readonly string[] | csstype.Property.Transition<string & {}> | readonly csstype.Property.Transition<string & {}>[] | undefined;
@@ -831,7 +831,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
831
831
  MozTransitionTimingFunction?: readonly string[] | csstype.Property.TransitionTimingFunction | readonly csstype.Property.TransitionTimingFunction[] | undefined;
832
832
  MozUserInput?: csstype.Property.MozUserInput | readonly NonNullable<csstype.Property.MozUserInput | undefined>[] | readonly csstype.Property.MozUserInput[] | undefined;
833
833
  msImeMode?: csstype.Property.ImeMode | readonly NonNullable<csstype.Property.ImeMode | undefined>[] | readonly csstype.Property.ImeMode[] | undefined;
834
- OAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "none" | "auto" | "normal" | "alternate" | "alternate-reverse" | "reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
834
+ OAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "none" | "auto" | "alternate" | "alternate-reverse" | "reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
835
835
  OAnimationDelay?: readonly string[] | csstype.Property.AnimationDelay<string & {}> | readonly csstype.Property.AnimationDelay<string & {}>[] | undefined;
836
836
  OAnimationDirection?: readonly string[] | csstype.Property.AnimationDirection | readonly csstype.Property.AnimationDirection[] | undefined;
837
837
  OAnimationDuration?: readonly string[] | csstype.Property.AnimationDuration<string & {}> | readonly csstype.Property.AnimationDuration<string & {}>[] | undefined;
@@ -841,7 +841,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
841
841
  OAnimationPlayState?: readonly string[] | csstype.Property.AnimationPlayState | readonly csstype.Property.AnimationPlayState[] | undefined;
842
842
  OAnimationTimingFunction?: readonly string[] | csstype.Property.AnimationTimingFunction | readonly csstype.Property.AnimationTimingFunction[] | undefined;
843
843
  OBackgroundSize?: readonly (string | (string & {}))[] | csstype.Property.BackgroundSize<string | number> | readonly NonNullable<csstype.Property.BackgroundSize<string | number> | undefined>[] | undefined;
844
- OBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ("repeat" | (string & {}) | csstype.Globals | "none" | "round" | "space" | "stretch")[] | undefined;
844
+ OBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "stretch")[] | undefined;
845
845
  OObjectFit?: csstype.Property.ObjectFit | readonly NonNullable<csstype.Property.ObjectFit | undefined>[] | readonly csstype.Property.ObjectFit[] | undefined;
846
846
  OObjectPosition?: readonly (string | (string & {}))[] | csstype.Property.ObjectPosition<string | number> | readonly NonNullable<csstype.Property.ObjectPosition<string | number> | undefined>[] | undefined;
847
847
  OTabSize?: readonly (string | (string & {}))[] | csstype.Property.TabSize<string | number> | readonly NonNullable<csstype.Property.TabSize<string | number> | undefined>[] | undefined;
@@ -1,11 +1,11 @@
1
- export { b as default } from '../chunk-CU7PKEY2.js';
1
+ export { b as default } from '../chunk-4RNGASI4.js';
2
2
  import '../chunk-LDGBS7ZI.js';
3
- export { b as useSettingsContext } from '../chunk-2WG6OWB4.js';
4
3
  import '../chunk-6W52DPH4.js';
5
4
  import '../chunk-TWSAWMZ3.js';
6
5
  import '../chunk-ROVD7OGE.js';
7
6
  import '../chunk-EQYL7U3J.js';
8
7
  import '../chunk-WUFEPE2G.js';
8
+ export { b as useSettingsContext } from '../chunk-2WG6OWB4.js';
9
9
  export { a as THEME_CONFIG } from '../chunk-GLRLKFPS.js';
10
10
  //# sourceMappingURL=out.js.map
11
11
  //# sourceMappingURL=theme-provider.js.map
package/dist/utils/dnd.js CHANGED
@@ -1,11 +1,11 @@
1
- export { x as CSS, r as add, b as canUseDOM, y as findFirstFocusableNode, w as getEventCoordinates, i as getOwnerDocument, e as getWindow, t as hasViewportRelativeCoordinates, f as isDocument, g as isHTMLElement, u as isKeyboardEvent, d as isNode, h as isSVGElement, v as isTouchEvent, c as isWindow, s as subtract, a as useCombinedRefs, k as useEvent, l as useInterval, j as useIsomorphicLayoutEffect, m as useLatestValue, n as useLazyMemo, o as useNodeRef, p as usePrevious, q as useUniqueId } from '../chunk-33C6UWPV.js';
2
- import i, { useState, useCallback } from 'react';
1
+ export * from '@dnd-kit/accessibility';
3
2
  export * from '@dnd-kit/core';
4
3
  export * from '@dnd-kit/modifiers';
5
4
  export * from '@dnd-kit/sortable';
5
+ export * from '@dnd-kit/utilities';
6
6
 
7
- var c={display:"none"};function q(e){let{id:n,value:t}=e;return i.createElement("div",{id:n,style:c},t)}function z(e){let{id:n,announcement:t,ariaLiveType:r="assertive"}=e,o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return i.createElement("div",{id:n,style:o,role:"status","aria-live":r,"aria-atomic":!0},t)}function B(){let[e,n]=useState("");return {announce:useCallback(r=>{r!=null&&n(r);},[]),announcement:e}}var u=(e,n)=>{if(e?.data?.current)return e.data.current[n]},G=e=>u(e,"index")||0;
7
+ var t=(e,r)=>{if(e?.data?.current)return e.data.current[r]},n=e=>t(e,"index")||0;
8
8
 
9
- export { q as HiddenText, z as LiveRegion, u as getData, G as getIndex, B as useAnnouncement };
9
+ export { t as getData, n as getIndex };
10
10
  //# sourceMappingURL=out.js.map
11
11
  //# sourceMappingURL=dnd.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../node_modules/@dnd-kit/accessibility/src/components/HiddenText/HiddenText.tsx","../../node_modules/@dnd-kit/accessibility/src/components/LiveRegion/LiveRegion.tsx","../../node_modules/@dnd-kit/accessibility/src/hooks/useAnnouncement.ts","../../src/utils/dnd.ts"],"names":["hiddenStyles","display","HiddenText","id","value","React","style","LiveRegion","announcement","ariaLiveType","visuallyHidden","position","top","left","width","height","margin","border","padding","overflow","clip","clipPath","whiteSpace","role","useAnnouncement","setAnnouncement","useState","announce","useCallback","getData","data","propName","getIndex"],"mappings":"sQAOA,IAAMA,EAAoC,CACxCC,QAAS,MAD+B,WAI1BC,EAAAA,EAAAA,IAAW,CAACC,GAAAA,EAAIC,MAAAA,KAC9B,OACEC,EAAAA,cAAA,MAAA,CAAKF,GAAIA,EAAIG,MAAON,GACjBI,CADH,CAIH,UCTeG,EAAAA,EAAAA,IAAW,CAACJ,GAAAA,EAAIK,aAAAA,EAAcC,aAAAA,EAAe,eAErDC,EAAsC,CAC1CC,SAAU,QACVC,IAAK,EACLC,KAAM,EACNC,MAAO,EACPC,OAAQ,EACRC,OAAQ,GACRC,OAAQ,EACRC,QAAS,EACTC,SAAU,SACVC,KAAM,gBACNC,SAAU,cACVC,WAAY,UAGd,OACEjB,EAAAA,cAAA,MAAA,CACEF,GAAIA,EACJG,MAAOI,EACPa,KAAK,qBACMd,oBAGVD,CAPH,CAUH,UClCegB,GAAAA,CACd,GAAM,CAAChB,EAAciB,CAAf,EAAkCC,EAAS,EAAD,EAOhD,MAAO,CAACC,SANSC,EAAaxB,GAAD,CACvBA,GAAS,MACXqB,EAAgBrB,CAAD,GAEhB,CAAA,CAJyB,EAMVI,aAAAA,EACnB,CCRD,WAAc,gBACd,WAAc,qBACd,WAAc,oBAGP,IAAMqB,EAAU,CACrBC,EACAC,IACkB,CAClB,GAAKD,GAAM,MAAM,QAEjB,OAAOA,EAAK,KAAK,QAAQC,CAAQ,CACnC,EAEaC,EAAYF,GAChBD,EAAgBC,EAAM,OAAO,GAAK","sourcesContent":["import React from 'react';\n\ninterface Props {\n id: string;\n value: string;\n}\n\nconst hiddenStyles: React.CSSProperties = {\n display: 'none',\n};\n\nexport function HiddenText({id, value}: Props) {\n return (\n <div id={id} style={hiddenStyles}>\n {value}\n </div>\n );\n}\n","import React from 'react';\n\nexport interface Props {\n id: string;\n announcement: string;\n ariaLiveType?: \"polite\" | \"assertive\" | \"off\";\n}\n\nexport function LiveRegion({id, announcement, ariaLiveType = \"assertive\"}: Props) {\n // Hide element visually but keep it readable by screen readers\n const visuallyHidden: React.CSSProperties = {\n position: 'fixed',\n top: 0,\n left: 0,\n width: 1,\n height: 1,\n margin: -1,\n border: 0,\n padding: 0,\n overflow: 'hidden',\n clip: 'rect(0 0 0 0)',\n clipPath: 'inset(100%)',\n whiteSpace: 'nowrap',\n };\n \n return (\n <div\n id={id}\n style={visuallyHidden}\n role=\"status\"\n aria-live={ariaLiveType}\n aria-atomic\n >\n {announcement}\n </div>\n );\n}\n","import {useCallback, useState} from 'react';\n\nexport function useAnnouncement() {\n const [announcement, setAnnouncement] = useState('');\n const announce = useCallback((value: string | undefined) => {\n if (value != null) {\n setAnnouncement(value);\n }\n }, []);\n\n return {announce, announcement} as const;\n}\n","import { Active, Over } from '@dnd-kit/core';\n\nexport * from '@dnd-kit/accessibility';\nexport * from '@dnd-kit/core';\nexport * from '@dnd-kit/modifiers';\nexport * from '@dnd-kit/sortable';\nexport * from '@dnd-kit/utilities';\n\nexport const getData = <T>(\n data: Active | Over | undefined,\n propName: string,\n): T | undefined => {\n if (!data?.data?.current) return undefined;\n\n return data.data.current[propName];\n};\n\nexport const getIndex = (data: Active | Over | undefined) => {\n return getData<number>(data, 'index') || 0;\n};\n"]}
1
+ {"version":3,"sources":["../../src/utils/dnd.ts"],"names":["getData","data","propName","getIndex"],"mappings":"AAEA,WAAc,yBACd,WAAc,gBACd,WAAc,qBACd,WAAc,oBACd,WAAc,qBAEP,IAAMA,EAAU,CACrBC,EACAC,IACkB,CAClB,GAAKD,GAAM,MAAM,QAEjB,OAAOA,EAAK,KAAK,QAAQC,CAAQ,CACnC,EAEaC,EAAYF,GAChBD,EAAgBC,EAAM,OAAO,GAAK","sourcesContent":["import { Active, Over } from '@dnd-kit/core';\n\nexport * from '@dnd-kit/accessibility';\nexport * from '@dnd-kit/core';\nexport * from '@dnd-kit/modifiers';\nexport * from '@dnd-kit/sortable';\nexport * from '@dnd-kit/utilities';\n\nexport const getData = <T>(\n data: Active | Over | undefined,\n propName: string,\n): T | undefined => {\n if (!data?.data?.current) return undefined;\n\n return data.data.current[propName];\n};\n\nexport const getIndex = (data: Active | Over | undefined) => {\n return getData<number>(data, 'index') || 0;\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.7.62",
3
+ "version": "2.7.64",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -116,6 +116,7 @@
116
116
  "autoprefixer": "^10.4.20",
117
117
  "eslint": "^8.47.0",
118
118
  "eslint-config-prettier": "^9.0.0",
119
+ "eslint-plugin-jsx-a11y": "^6.10.2",
119
120
  "eslint-plugin-prettier": "^5.0.0",
120
121
  "eslint-plugin-react": "^7.33.2",
121
122
  "eslint-plugin-react-hooks": "^4.6.0",
@@ -138,9 +139,11 @@
138
139
  "vite": "^6.0.7"
139
140
  },
140
141
  "dependencies": {
142
+ "@dnd-kit/accessibility": "^3.1.1",
141
143
  "@dnd-kit/core": "^6.3.1",
142
144
  "@dnd-kit/modifiers": "^9.0.0",
143
145
  "@dnd-kit/sortable": "^10.0.0",
146
+ "@dnd-kit/utilities": "^3.2.2",
144
147
  "browser-image-compression": "^2.0.2",
145
148
  "card-validator": "^10.0.3",
146
149
  "color": "^4.2.3",
@@ -1,7 +0,0 @@
1
- import { useMemo, useLayoutEffect, useEffect, useRef, useCallback } from 'react';
2
-
3
- function Y(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];return useMemo(()=>u=>{t.forEach(r=>r(u));},t)}var D=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function a(n){let t=Object.prototype.toString.call(n);return t==="[object Window]"||t==="[object global]"}function b(n){return "nodeType"in n}function c(n){var t,e;return n?a(n)?n:b(n)&&(t=(e=n.ownerDocument)==null?void 0:e.defaultView)!=null?t:window:window}function j(n){let{Document:t}=c(n);return n instanceof t}function C(n){return a(n)?!1:n instanceof c(n).HTMLElement}function L(n){return n instanceof c(n).SVGElement}function x(n){return n?a(n)?n.document:b(n)?j(n)?n:C(n)||L(n)?n.ownerDocument:document:document:document}var E=D?useLayoutEffect:useEffect;function M(n){let t=useRef(n);return E(()=>{t.current=n;}),useCallback(function(){for(var e=arguments.length,u=new Array(e),r=0;r<e;r++)u[r]=arguments[r];return t.current==null?void 0:t.current(...u)},[])}function A(){let n=useRef(null),t=useCallback((u,r)=>{n.current=setInterval(u,r);},[]),e=useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null);},[]);return [t,e]}function I(n,t){t===void 0&&(t=[n]);let e=useRef(n);return E(()=>{e.current!==n&&(e.current=n);},t),e}function v(n,t){let e=useRef();return useMemo(()=>{let u=n(e.current);return e.current=u,u},[...t])}function N(n){let t=M(n),e=useRef(null),u=useCallback(r=>{r!==e.current&&t?.(r,e.current),e.current=r;},[]);return [e,u]}function F(n){let t=useRef();return useEffect(()=>{t.current=n;},[n]),t.current}var f={};function H(n,t){return useMemo(()=>{if(t)return t;let e=f[n]==null?0:f[n]+1;return f[n]=e,n+"-"+e},[n,t])}function S(n){return function(t){for(var e=arguments.length,u=new Array(e>1?e-1:0),r=1;r<e;r++)u[r-1]=arguments[r];return u.reduce((s,T)=>{let y=Object.entries(T);for(let[d,p]of y){let m=s[d];m!=null&&(s[d]=m+n*p);}return s},{...t})}}var W=S(1),q=S(-1);function O(n){return "clientX"in n&&"clientY"in n}function z(n){if(!n)return !1;let{KeyboardEvent:t}=c(n.target);return t&&n instanceof t}function V(n){if(!n)return !1;let{TouchEvent:t}=c(n.target);return t&&n instanceof t}function G(n){if(V(n)){if(n.touches&&n.touches.length){let{clientX:t,clientY:e}=n.touches[0];return {x:t,y:e}}else if(n.changedTouches&&n.changedTouches.length){let{clientX:t,clientY:e}=n.changedTouches[0];return {x:t,y:e}}}return O(n)?{x:n.clientX,y:n.clientY}:null}var w=Object.freeze({Translate:{toString(n){if(!n)return;let{x:t,y:e}=n;return "translate3d("+(t?Math.round(t):0)+"px, "+(e?Math.round(e):0)+"px, 0)"}},Scale:{toString(n){if(!n)return;let{scaleX:t,scaleY:e}=n;return "scaleX("+t+") scaleY("+e+")"}},Transform:{toString(n){if(n)return [w.Translate.toString(n),w.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:t,duration:e,easing:u}=n;return t+" "+e+"ms "+u}}}),h="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function K(n){return n.matches(h)?n:n.querySelector(h)}
4
-
5
- export { Y as a, D as b, a as c, b as d, c as e, j as f, C as g, L as h, x as i, E as j, M as k, A as l, I as m, v as n, N as o, F as p, H as q, W as r, q as s, O as t, z as u, V as v, G as w, w as x, K as y };
6
- //# sourceMappingURL=out.js.map
7
- //# sourceMappingURL=chunk-33C6UWPV.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../node_modules/@dnd-kit/utilities/src/hooks/useCombinedRefs.ts","../node_modules/@dnd-kit/utilities/src/execution-context/canUseDOM.ts","../node_modules/@dnd-kit/utilities/src/type-guards/isWindow.ts","../node_modules/@dnd-kit/utilities/src/type-guards/isNode.ts","../node_modules/@dnd-kit/utilities/src/execution-context/getWindow.ts","../node_modules/@dnd-kit/utilities/src/type-guards/isDocument.ts","../node_modules/@dnd-kit/utilities/src/type-guards/isHTMLElement.ts","../node_modules/@dnd-kit/utilities/src/type-guards/isSVGElement.ts","../node_modules/@dnd-kit/utilities/src/execution-context/getOwnerDocument.ts","../node_modules/@dnd-kit/utilities/src/hooks/useIsomorphicLayoutEffect.ts","../node_modules/@dnd-kit/utilities/src/hooks/useEvent.ts","../node_modules/@dnd-kit/utilities/src/hooks/useInterval.ts","../node_modules/@dnd-kit/utilities/src/hooks/useLatestValue.ts","../node_modules/@dnd-kit/utilities/src/hooks/useLazyMemo.ts","../node_modules/@dnd-kit/utilities/src/hooks/useNodeRef.ts","../node_modules/@dnd-kit/utilities/src/hooks/usePrevious.ts","../node_modules/@dnd-kit/utilities/src/hooks/useUniqueId.ts","../node_modules/@dnd-kit/utilities/src/adjustment.ts","../node_modules/@dnd-kit/utilities/src/event/hasViewportRelativeCoordinates.ts","../node_modules/@dnd-kit/utilities/src/event/isKeyboardEvent.ts","../node_modules/@dnd-kit/utilities/src/event/isTouchEvent.ts","../node_modules/@dnd-kit/utilities/src/coordinates/getEventCoordinates.ts","../node_modules/@dnd-kit/utilities/src/css.ts","../node_modules/@dnd-kit/utilities/src/focus/findFirstFocusableNode.ts"],"names":["useCombinedRefs","refs","useMemo","node","forEach","ref","canUseDOM","window","document","createElement","isWindow","element","elementString","Object","prototype","toString","call","isNode","getWindow","target","_target$ownerDocument","_target$ownerDocument2","ownerDocument","defaultView","isDocument","Document","isHTMLElement","HTMLElement","isSVGElement","SVGElement","getOwnerDocument","useIsomorphicLayoutEffect","useLayoutEffect","useEffect","useEvent","handler","handlerRef","useRef","current","useCallback","args","useInterval","intervalRef","set","listener","duration","setInterval","clear","clearInterval","useLatestValue","value","dependencies","valueRef","useLazyMemo","callback","newValue","useNodeRef","onChange","onChangeHandler","setNodeRef","usePrevious","ids","useUniqueId","prefix","id","createAdjustmentFn","modifier","object","adjustments","reduce","accumulator","adjustment","entries","key","valueAdjustment","add","subtract","hasViewportRelativeCoordinates","event","isKeyboardEvent","KeyboardEvent","isTouchEvent","TouchEvent","getEventCoordinates","touches","length","clientX","x","clientY","y","changedTouches","CSS","freeze","Translate","transform","Math","round","Scale","scaleX","scaleY","Transform","join","Transition","_ref","property","easing","SELECTOR","findFirstFocusableNode","matches","querySelector"],"mappings":"0GAEgBA,GAAAA,4BACXC,EAAAA,IAAAA,MAAAA,CAAAA,EAAAA,EAAAA,EAAAA,EAAAA,EAAAA,IAAAA,EAAAA,CAAAA,EAAAA,UAAAA,CAAAA,EAEH,OAAOC,EACL,IAAOC,GAAD,CACJF,EAAKG,QAASC,GAAQA,EAAIF,CAAD,CAAzB,GAGFF,CALY,CAOf,CCXD,IAAaK,EACX,OAAOC,OAAW,KAClB,OAAOA,OAAOC,SAAa,KAC3B,OAAOD,OAAOC,SAASC,cAAkB,aCJ3BC,EAASC,EAAAA,CACvB,IAAMC,EAAgBC,OAAOC,UAAUC,SAASC,KAAKL,CAA/B,EACtB,OACEC,IAAkB,mBAElBA,IAAkB,iBAErB,UCPeK,EAAOd,EAAAA,CACrB,MAAO,aAAcA,CACtB,UCCee,EAAUC,EAAAA,SACxB,OAAKA,EAIDT,EAASS,CAAD,EACHA,EAGJF,EAAOE,CAAD,IAIXC,GAAAC,EAAOF,EAAOG,gBAAd,KAAA,OAAOD,EAAsBE,cAA7B,KAAAH,EAHSb,OARAA,MAYV,UCfeiB,EAAWrB,EAAAA,CACzB,GAAM,CAACsB,SAAAA,GAAYP,EAAUf,CAAD,EAE5B,OAAOA,aAAgBsB,CACxB,UCFeC,EAAcvB,EAAAA,CAC5B,OAAIO,EAASP,CAAD,EACH,GAGFA,aAAgBe,EAAUf,CAAD,EAAOwB,WACxC,UCReC,EAAazB,EAAAA,CAC3B,OAAOA,aAAgBe,EAAUf,CAAD,EAAO0B,UACxC,UCIeC,EAAiBX,EAAAA,CAC/B,OAAKA,EAIDT,EAASS,CAAD,EACHA,EAAOX,SAGXS,EAAOE,CAAD,EAIPK,EAAWL,CAAD,EACLA,EAGLO,EAAcP,C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H,EAAIM,MAAMlF,SAAS+E,CAAnB,CAFK,EAGLO,KAAK,GAHA,IAMXC,WAAY,CACVvF,SAAQwF,EAAA,IAAC,CAACC,SAAAA,EAAU3D,SAAAA,EAAU4D,OAAAA,KAC5B,OAAUD,EAAV,IAAsB3D,EAAtB,MAAoC4D,GAvCT,CAAd,ECbbC,EACJ,yIAEF,SAAgBC,EACdhG,EAAAA,CAEA,OAAIA,EAAQiG,QAAQF,CAAhB,EACK/F,EAGFA,EAAQkG,cAAcH,CAAtB,CACR","sourcesContent":["import {useMemo} from 'react';\n\nexport function useCombinedRefs<T>(\n ...refs: ((node: T) => void)[]\n): (node: T) => void {\n return useMemo(\n () => (node: T) => {\n refs.forEach((ref) => ref(node));\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n refs\n );\n}\n","// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js\nexport const canUseDOM =\n typeof window !== 'undefined' &&\n typeof window.document !== 'undefined' &&\n typeof window.document.createElement !== 'undefined';\n","export function isWindow(element: Object): element is typeof window {\n const elementString = Object.prototype.toString.call(element);\n return (\n elementString === '[object Window]' ||\n // In Electron context the Window object serializes to [object global]\n elementString === '[object global]'\n );\n}\n","export function isNode(node: Object): node is Node {\n return 'nodeType' in node;\n}\n","import {isWindow} from '../type-guards/isWindow';\nimport {isNode} from '../type-guards/isNode';\n\nexport function getWindow(target: Event['target']): typeof window {\n if (!target) {\n return window;\n }\n\n if (isWindow(target)) {\n return target;\n }\n\n if (!isNode(target)) {\n return window;\n }\n\n return target.ownerDocument?.defaultView ?? window;\n}\n","import {getWindow} from '../execution-context/getWindow';\n\nexport function isDocument(node: Node): node is Document {\n const {Document} = getWindow(node);\n\n return node instanceof Document;\n}\n","import {getWindow} from '../execution-context/getWindow';\n\nimport {isWindow} from './isWindow';\n\nexport function isHTMLElement(node: Node | Window): node is HTMLElement {\n if (isWindow(node)) {\n return false;\n }\n\n return node instanceof getWindow(node).HTMLElement;\n}\n","import {getWindow} from '../execution-context/getWindow';\n\nexport function isSVGElement(node: Node): node is SVGElement {\n return node instanceof getWindow(node).SVGElement;\n}\n","import {\n isWindow,\n isHTMLElement,\n isDocument,\n isNode,\n isSVGElement,\n} from '../type-guards';\n\nexport function getOwnerDocument(target: Event['target']): Document {\n if (!target) {\n return document;\n }\n\n if (isWindow(target)) {\n return target.document;\n }\n\n if (!isNode(target)) {\n return document;\n }\n\n if (isDocument(target)) {\n return target;\n }\n\n if (isHTMLElement(target) || isSVGElement(target)) {\n return target.ownerDocument;\n }\n\n return document;\n}\n","import {useEffect, useLayoutEffect} from 'react';\n\nimport {canUseDOM} from '../execution-context';\n\n/**\n * A hook that resolves to useEffect on the server and useLayoutEffect on the client\n * @param callback {function} Callback function that is invoked when the dependencies of the hook change\n */\nexport const useIsomorphicLayoutEffect = canUseDOM\n ? useLayoutEffect\n : useEffect;\n","import {useCallback, useRef} from 'react';\n\nimport {useIsomorphicLayoutEffect} from './useIsomorphicLayoutEffect';\n\nexport function useEvent<T extends Function>(handler: T | undefined) {\n const handlerRef = useRef<T | undefined>(handler);\n\n useIsomorphicLayoutEffect(() => {\n handlerRef.current = handler;\n });\n\n return useCallback(function (...args: any) {\n return handlerRef.current?.(...args);\n }, []);\n}\n","import {useCallback, useRef} from 'react';\n\nexport function useInterval() {\n const intervalRef = useRef<number | null>(null);\n\n const set = useCallback((listener: Function, duration: number) => {\n intervalRef.current = setInterval(listener, duration);\n }, []);\n\n const clear = useCallback(() => {\n if (intervalRef.current !== null) {\n clearInterval(intervalRef.current);\n intervalRef.current = null;\n }\n }, []);\n\n return [set, clear] as const;\n}\n","import {useRef} from 'react';\nimport type {DependencyList} from 'react';\n\nimport {useIsomorphicLayoutEffect} from './useIsomorphicLayoutEffect';\n\nexport function useLatestValue<T extends any>(\n value: T,\n dependencies: DependencyList = [value]\n) {\n const valueRef = useRef<T>(value);\n\n useIsomorphicLayoutEffect(() => {\n if (valueRef.current !== value) {\n valueRef.current = value;\n }\n }, dependencies);\n\n return valueRef;\n}\n","import {useMemo, useRef} from 'react';\n\nexport function useLazyMemo<T>(\n callback: (prevValue: T | undefined) => T,\n dependencies: any[]\n) {\n const valueRef = useRef<T>();\n\n return useMemo(\n () => {\n const newValue = callback(valueRef.current);\n valueRef.current = newValue;\n\n return newValue;\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [...dependencies]\n );\n}\n","import {useRef, useCallback} from 'react';\n\nimport {useEvent} from './useEvent';\n\nexport function useNodeRef(\n onChange?: (\n newElement: HTMLElement | null,\n previousElement: HTMLElement | null\n ) => void\n) {\n const onChangeHandler = useEvent(onChange);\n const node = useRef<HTMLElement | null>(null);\n const setNodeRef = useCallback(\n (element: HTMLElement | null) => {\n if (element !== node.current) {\n onChangeHandler?.(element, node.current);\n }\n\n node.current = element;\n },\n //eslint-disable-next-line\n []\n );\n\n return [node, setNodeRef] as const;\n}\n","import {useRef, useEffect} from 'react';\n\nexport function usePrevious<T>(value: T) {\n const ref = useRef<T>();\n\n useEffect(() => {\n ref.current = value;\n }, [value]);\n\n return ref.current;\n}\n","import {useMemo} from 'react';\n\nlet ids: Record<string, number> = {};\n\nexport function useUniqueId(prefix: string, value?: string) {\n return useMemo(() => {\n if (value) {\n return value;\n }\n\n const id = ids[prefix] == null ? 0 : ids[prefix] + 1;\n ids[prefix] = id;\n\n return `${prefix}-${id}`;\n }, [prefix, value]);\n}\n","function createAdjustmentFn(modifier: number) {\n return <T extends Record<U, number>, U extends string>(\n object: T,\n ...adjustments: Partial<T>[]\n ): T => {\n return adjustments.reduce<T>(\n (accumulator, adjustment) => {\n const entries = Object.entries(adjustment) as [U, number][];\n\n for (const [key, valueAdjustment] of entries) {\n const value = accumulator[key];\n\n if (value != null) {\n accumulator[key] = (value + modifier * valueAdjustment) as T[U];\n }\n }\n\n return accumulator;\n },\n {\n ...object,\n }\n );\n };\n}\n\nexport const add = createAdjustmentFn(1);\nexport const subtract = createAdjustmentFn(-1);\n","export function hasViewportRelativeCoordinates(\n event: Event\n): event is Event & Pick<PointerEvent, 'clientX' | 'clientY'> {\n return 'clientX' in event && 'clientY' in event;\n}\n","import {getWindow} from '../execution-context';\n\nexport function isKeyboardEvent(\n event: Event | undefined | null\n): event is KeyboardEvent {\n if (!event) {\n return false;\n }\n\n const {KeyboardEvent} = getWindow(event.target);\n\n return KeyboardEvent && event instanceof KeyboardEvent;\n}\n","import {getWindow} from '../execution-context';\n\nexport function isTouchEvent(\n event: Event | undefined | null\n): event is TouchEvent {\n if (!event) {\n return false;\n }\n\n const {TouchEvent} = getWindow(event.target);\n\n return TouchEvent && event instanceof TouchEvent;\n}\n","import type {Coordinates} from './types';\nimport {isTouchEvent, hasViewportRelativeCoordinates} from '../event';\n\n/**\n * Returns the normalized x and y coordinates for mouse and touch events.\n */\nexport function getEventCoordinates(event: Event): Coordinates | null {\n if (isTouchEvent(event)) {\n if (event.touches && event.touches.length) {\n const {clientX: x, clientY: y} = event.touches[0];\n\n return {\n x,\n y,\n };\n } else if (event.changedTouches && event.changedTouches.length) {\n const {clientX: x, clientY: y} = event.changedTouches[0];\n\n return {\n x,\n y,\n };\n }\n }\n\n if (hasViewportRelativeCoordinates(event)) {\n return {\n x: event.clientX,\n y: event.clientY,\n };\n }\n\n return null;\n}\n","export type Transform = {\n x: number;\n y: number;\n scaleX: number;\n scaleY: number;\n};\n\nexport interface Transition {\n property: string;\n easing: string;\n duration: number;\n}\n\nexport const CSS = Object.freeze({\n Translate: {\n toString(transform: Transform | null) {\n if (!transform) {\n return;\n }\n\n const {x, y} = transform;\n\n return `translate3d(${x ? Math.round(x) : 0}px, ${\n y ? Math.round(y) : 0\n }px, 0)`;\n },\n },\n Scale: {\n toString(transform: Transform | null) {\n if (!transform) {\n return;\n }\n\n const {scaleX, scaleY} = transform;\n\n return `scaleX(${scaleX}) scaleY(${scaleY})`;\n },\n },\n Transform: {\n toString(transform: Transform | null) {\n if (!transform) {\n return;\n }\n\n return [\n CSS.Translate.toString(transform),\n CSS.Scale.toString(transform),\n ].join(' ');\n },\n },\n Transition: {\n toString({property, duration, easing}: Transition) {\n return `${property} ${duration}ms ${easing}`;\n },\n },\n});\n","const SELECTOR =\n 'a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]';\n\nexport function findFirstFocusableNode(\n element: HTMLElement\n): HTMLElement | null {\n if (element.matches(SELECTOR)) {\n return element;\n }\n\n return element.querySelector(SELECTOR);\n}\n"]}