@fuf-stack/pixels 1.11.1 → 1.11.2

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 (141) hide show
  1. package/dist/Accordion/Accordion.cjs +0 -1
  2. package/dist/Accordion/Accordion.cjs.map +1 -1
  3. package/dist/Accordion/Accordion.d.cts +10 -10
  4. package/dist/Accordion/Accordion.d.cts.map +1 -1
  5. package/dist/Accordion/Accordion.d.ts +10 -10
  6. package/dist/Accordion/Accordion.d.ts.map +1 -1
  7. package/dist/Alert/Alert.cjs +0 -1
  8. package/dist/Alert/Alert.cjs.map +1 -1
  9. package/dist/Alert/Alert.d.cts +6 -6
  10. package/dist/Alert/Alert.d.cts.map +1 -1
  11. package/dist/Alert/Alert.d.ts +6 -6
  12. package/dist/Alert/Alert.d.ts.map +1 -1
  13. package/dist/Avatar/Avatar.cjs +0 -1
  14. package/dist/Avatar/Avatar.cjs.map +1 -1
  15. package/dist/Avatar/Avatar.d.cts +10 -10
  16. package/dist/Avatar/Avatar.d.ts +10 -10
  17. package/dist/AvatarGroup/AvatarGroup.cjs +0 -1
  18. package/dist/AvatarGroup/AvatarGroup.cjs.map +1 -1
  19. package/dist/Badge/Badge.cjs +0 -1
  20. package/dist/Badge/Badge.cjs.map +1 -1
  21. package/dist/Breadcrumb/Breadcrumb.cjs +10 -11
  22. package/dist/Breadcrumb/Breadcrumb.cjs.map +1 -1
  23. package/dist/Breadcrumb/Breadcrumb.d.cts +16 -16
  24. package/dist/Breadcrumb/Breadcrumb.d.ts +16 -16
  25. package/dist/Breadcrumb/Breadcrumb.js +10 -10
  26. package/dist/Breadcrumb/Breadcrumb.js.map +1 -1
  27. package/dist/Button/Button.cjs +0 -1
  28. package/dist/Button/Button.cjs.map +1 -1
  29. package/dist/Button/subcomponents/LoadingSpinner.cjs +0 -1
  30. package/dist/Button/subcomponents/LoadingSpinner.cjs.map +1 -1
  31. package/dist/ButtonGroup/ButtonGroup.cjs +0 -1
  32. package/dist/ButtonGroup/ButtonGroup.cjs.map +1 -1
  33. package/dist/Card/Card.cjs +1 -2
  34. package/dist/Card/Card.cjs.map +1 -1
  35. package/dist/Card/Card.d.cts +10 -10
  36. package/dist/Card/Card.d.ts +10 -10
  37. package/dist/Card/Card.js +1 -1
  38. package/dist/Card/Card.js.map +1 -1
  39. package/dist/Drawer/Drawer.cjs +0 -1
  40. package/dist/Drawer/Drawer.cjs.map +1 -1
  41. package/dist/Drawer/Drawer.d.cts +10 -10
  42. package/dist/Drawer/Drawer.d.ts +10 -10
  43. package/dist/Json/Json.cjs +30 -23
  44. package/dist/Json/Json.cjs.map +1 -1
  45. package/dist/Json/Json.d.cts.map +1 -1
  46. package/dist/Json/Json.d.ts.map +1 -1
  47. package/dist/Json/Json.js +30 -22
  48. package/dist/Json/Json.js.map +1 -1
  49. package/dist/Json/subcomponents/CopiedRenderer.cjs +3 -4
  50. package/dist/Json/subcomponents/CopiedRenderer.cjs.map +1 -1
  51. package/dist/Json/subcomponents/CopiedRenderer.js +3 -3
  52. package/dist/Json/subcomponents/CopiedRenderer.js.map +1 -1
  53. package/dist/Json/subcomponents/ErrorRenderer.cjs +0 -1
  54. package/dist/Json/subcomponents/ErrorRenderer.cjs.map +1 -1
  55. package/dist/Json/subcomponents/NullRenderer.cjs +0 -1
  56. package/dist/Json/subcomponents/NullRenderer.cjs.map +1 -1
  57. package/dist/Label/Label.cjs +0 -1
  58. package/dist/Label/Label.cjs.map +1 -1
  59. package/dist/Label/Label.d.cts +29 -29
  60. package/dist/Label/Label.d.cts.map +1 -1
  61. package/dist/Label/Label.d.ts +29 -29
  62. package/dist/Label/Label.d.ts.map +1 -1
  63. package/dist/Menu/Menu.cjs +1 -2
  64. package/dist/Menu/Menu.cjs.map +1 -1
  65. package/dist/Menu/Menu.d.cts +10 -10
  66. package/dist/Menu/Menu.d.cts.map +1 -1
  67. package/dist/Menu/Menu.d.ts +10 -10
  68. package/dist/Menu/Menu.d.ts.map +1 -1
  69. package/dist/Menu/Menu.js +1 -1
  70. package/dist/Menu/Menu.js.map +1 -1
  71. package/dist/Menu/VerticalDotsIcon.cjs +0 -1
  72. package/dist/Menu/VerticalDotsIcon.cjs.map +1 -1
  73. package/dist/Modal/Modal.cjs +0 -1
  74. package/dist/Modal/Modal.cjs.map +1 -1
  75. package/dist/Modal/Modal.d.cts +35 -35
  76. package/dist/Modal/Modal.d.cts.map +1 -1
  77. package/dist/Modal/Modal.d.ts +35 -35
  78. package/dist/Modal/Modal.d.ts.map +1 -1
  79. package/dist/Modal/ModalHost.cjs +0 -1
  80. package/dist/Modal/ModalHost.cjs.map +1 -1
  81. package/dist/Modal/modalStore.cjs +0 -1
  82. package/dist/Modal/modalStore.cjs.map +1 -1
  83. package/dist/Popover/Popover.cjs +1 -2
  84. package/dist/Popover/Popover.cjs.map +1 -1
  85. package/dist/Popover/Popover.d.cts +16 -16
  86. package/dist/Popover/Popover.d.ts +16 -16
  87. package/dist/Popover/Popover.js +1 -1
  88. package/dist/Popover/Popover.js.map +1 -1
  89. package/dist/Progress/Progress.cjs +0 -1
  90. package/dist/Progress/Progress.cjs.map +1 -1
  91. package/dist/Progress/Progress.d.cts +10 -10
  92. package/dist/Progress/Progress.d.cts.map +1 -1
  93. package/dist/Progress/Progress.d.ts +10 -10
  94. package/dist/Progress/Progress.d.ts.map +1 -1
  95. package/dist/ProgressCircular/ProgressCircular.cjs +1 -2
  96. package/dist/ProgressCircular/ProgressCircular.cjs.map +1 -1
  97. package/dist/ProgressCircular/ProgressCircular.d.cts +43 -43
  98. package/dist/ProgressCircular/ProgressCircular.d.cts.map +1 -1
  99. package/dist/ProgressCircular/ProgressCircular.d.ts +43 -43
  100. package/dist/ProgressCircular/ProgressCircular.d.ts.map +1 -1
  101. package/dist/ProgressCircular/ProgressCircular.js +1 -1
  102. package/dist/ProgressCircular/ProgressCircular.js.map +1 -1
  103. package/dist/ScrollShadow/ScrollShadow.cjs +0 -1
  104. package/dist/ScrollShadow/ScrollShadow.cjs.map +1 -1
  105. package/dist/SearchInput/SearchInput.cjs +8 -9
  106. package/dist/SearchInput/SearchInput.cjs.map +1 -1
  107. package/dist/SearchInput/SearchInput.d.cts +10 -10
  108. package/dist/SearchInput/SearchInput.d.ts +10 -10
  109. package/dist/SearchInput/SearchInput.js +8 -8
  110. package/dist/SearchInput/SearchInput.js.map +1 -1
  111. package/dist/Table/Table.cjs +0 -1
  112. package/dist/Table/Table.cjs.map +1 -1
  113. package/dist/Table/Table.d.cts +62 -62
  114. package/dist/Table/Table.d.cts.map +1 -1
  115. package/dist/Table/Table.d.ts +62 -62
  116. package/dist/Table/Table.d.ts.map +1 -1
  117. package/dist/Tabs/Tabs.cjs +0 -1
  118. package/dist/Tabs/Tabs.cjs.map +1 -1
  119. package/dist/Toast/Toaster.cjs +0 -1
  120. package/dist/Toast/Toaster.cjs.map +1 -1
  121. package/dist/Toast/toast.cjs +0 -1
  122. package/dist/Toast/toast.cjs.map +1 -1
  123. package/dist/Tooltip/Tooltip.cjs +6 -7
  124. package/dist/Tooltip/Tooltip.cjs.map +1 -1
  125. package/dist/Tooltip/Tooltip.d.cts +45 -45
  126. package/dist/Tooltip/Tooltip.d.cts.map +1 -1
  127. package/dist/Tooltip/Tooltip.d.ts +45 -45
  128. package/dist/Tooltip/Tooltip.d.ts.map +1 -1
  129. package/dist/Tooltip/Tooltip.js +6 -6
  130. package/dist/Tooltip/Tooltip.js.map +1 -1
  131. package/dist/hooks/useDebounce/useDebounce.cjs +0 -1
  132. package/dist/hooks/useDebounce/useDebounce.cjs.map +1 -1
  133. package/dist/hooks/useIsInitialRenderCycle/useIsInitialRenderCycle.cjs +0 -1
  134. package/dist/hooks/useIsInitialRenderCycle/useIsInitialRenderCycle.cjs.map +1 -1
  135. package/dist/hooks/useLocalStorage/useLocalStorage.cjs +0 -1
  136. package/dist/hooks/useLocalStorage/useLocalStorage.cjs.map +1 -1
  137. package/dist/node_modules/.pnpm/@uiw_react-json-view@2.0.0-alpha.43_@babel_runtime@7.29.2_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@uiw/react-json-view/esm/comps/useIdCompat.cjs +0 -1
  138. package/dist/node_modules/.pnpm/@uiw_react-json-view@2.0.0-alpha.43_@babel_runtime@7.29.2_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@uiw/react-json-view/esm/comps/useIdCompat.cjs.map +1 -1
  139. package/dist/node_modules/.pnpm/@uiw_react-json-view@2.0.0-alpha.43_@babel_runtime@7.29.2_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@uiw/react-json-view/esm/utils/useHighlight.cjs +0 -1
  140. package/dist/node_modules/.pnpm/@uiw_react-json-view@2.0.0-alpha.43_@babel_runtime@7.29.2_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@uiw/react-json-view/esm/utils/useHighlight.cjs.map +1 -1
  141. package/package.json +4 -4
@@ -861,9 +861,9 @@ declare const drawerVariants: ((props?: ({
861
861
  body?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
862
862
  footer?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
863
863
  header?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
864
- backdrop?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
865
864
  wrapper?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
866
865
  closeButton?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
866
+ backdrop?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
867
867
  };
868
868
  className?: never;
869
869
  } | {
@@ -873,13 +873,13 @@ declare const drawerVariants: ((props?: ({
873
873
  body?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
874
874
  footer?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
875
875
  header?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
876
- backdrop?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
877
876
  wrapper?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
878
877
  closeButton?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
878
+ backdrop?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
879
879
  };
880
880
  }))[];
881
881
  compoundSlots: ({
882
- slots: ("base" | "body" | "footer" | "header" | "backdrop" | "wrapper" | "closeButton")[];
882
+ slots: ("base" | "body" | "footer" | "header" | "wrapper" | "closeButton" | "backdrop")[];
883
883
  } & ({} & ({
884
884
  class?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
885
885
  className?: never;
@@ -906,9 +906,9 @@ declare const drawerVariants: ((props?: ({
906
906
  body?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
907
907
  footer?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
908
908
  header?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
909
- backdrop?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
910
909
  wrapper?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
911
910
  closeButton?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
911
+ backdrop?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
912
912
  };
913
913
  };
914
914
  } | {
@@ -918,9 +918,9 @@ declare const drawerVariants: ((props?: ({
918
918
  body?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
919
919
  footer?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
920
920
  header?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
921
- backdrop?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
922
921
  wrapper?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
923
922
  closeButton?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
923
+ backdrop?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
924
924
  };
925
925
  };
926
926
  } | {};
@@ -931,9 +931,9 @@ declare const drawerVariants: ((props?: ({
931
931
  body?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
932
932
  footer?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
933
933
  header?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
934
- backdrop?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
935
934
  wrapper?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
936
935
  closeButton?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
936
+ backdrop?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
937
937
  };
938
938
  className?: never;
939
939
  } | {
@@ -943,13 +943,13 @@ declare const drawerVariants: ((props?: ({
943
943
  body?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
944
944
  footer?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
945
945
  header?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
946
- backdrop?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
947
946
  wrapper?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
948
947
  closeButton?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
948
+ backdrop?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
949
949
  };
950
950
  }))[];
951
951
  compoundSlots: (({
952
- slots: ("base" | "body" | "footer" | "header" | "backdrop" | "wrapper" | "closeButton")[];
952
+ slots: ("base" | "body" | "footer" | "header" | "wrapper" | "closeButton" | "backdrop")[];
953
953
  } & ({
954
954
  [x: string]: string | number | (string | number)[] | undefined;
955
955
  } & ({
@@ -959,7 +959,7 @@ declare const drawerVariants: ((props?: ({
959
959
  class?: never;
960
960
  className?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
961
961
  }))) | ({
962
- slots: ("base" | "body" | "footer" | "header" | "backdrop" | "wrapper" | "closeButton")[];
962
+ slots: ("base" | "body" | "footer" | "header" | "wrapper" | "closeButton" | "backdrop")[];
963
963
  } & ({
964
964
  [x: string]: string | number | (string | number)[] | undefined;
965
965
  } & ({
@@ -969,7 +969,7 @@ declare const drawerVariants: ((props?: ({
969
969
  class?: never;
970
970
  className?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
971
971
  }))) | ({
972
- slots: ("base" | "body" | "footer" | "header" | "backdrop" | "wrapper" | "closeButton")[];
972
+ slots: ("base" | "body" | "footer" | "header" | "wrapper" | "closeButton" | "backdrop")[];
973
973
  } & ({} & ({
974
974
  class?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
975
975
  className?: never;
@@ -1,4 +1,3 @@
1
- require("../_virtual/_rolldown/runtime.cjs");
2
1
  const require_index = require("../node_modules/.pnpm/@uiw_react-json-view@2.0.0-alpha.43_@babel_runtime@7.29.2_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@uiw/react-json-view/esm/index.cjs");
3
2
  const require_jsonParser = require("./jsonParser.cjs");
4
3
  const require_CopiedRenderer = require("./subcomponents/CopiedRenderer.cjs");
@@ -30,7 +29,7 @@ const handleCopy = (rawValue, onCopy) => {
30
29
  let isObject = false;
31
30
  try {
32
31
  if (rawValue !== require_NullRenderer.default && typeof rawValue === "object") isObject = true;
33
- } catch (_err) {}
32
+ } catch {}
34
33
  const copyValue = isObject ? JSON.stringify(rawValue, null, 2) : rawValue;
35
34
  setTimeout(async () => {
36
35
  return navigator.clipboard.writeText(copyValue);
@@ -43,11 +42,34 @@ const handleCopy = (rawValue, onCopy) => {
43
42
  */
44
43
  const Json = ({ className = void 0, collapsed = false, errorRenderer = void 0, maxHeight = void 0, onCopy = void 0, value }) => {
45
44
  const [showDetails, setShowDetails] = (0, react.useState)(false);
46
- let content = null;
47
- let error = null;
45
+ let parsedValue;
46
+ let parsingError = null;
48
47
  try {
49
- const parsedValue = require_jsonParser.getValue(value);
50
- content = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
48
+ parsedValue = require_jsonParser.getValue(value);
49
+ } catch (err) {
50
+ parsingError = err;
51
+ }
52
+ if (parsingError) {
53
+ const renderedError = errorRenderer ? errorRenderer(parsingError, value) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ErrorRenderer.default, {
54
+ data: value,
55
+ error: parsingError,
56
+ onToggleDetails: () => {
57
+ setShowDetails(!showDetails);
58
+ },
59
+ showDetails
60
+ });
61
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
62
+ "aria-label": "JSON viewer",
63
+ className: (0, _fuf_stack_pixel_utils.cn)(className),
64
+ role: "region",
65
+ children: renderedError
66
+ });
67
+ }
68
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
69
+ "aria-label": "JSON viewer",
70
+ className: (0, _fuf_stack_pixel_utils.cn)(className),
71
+ role: "region",
72
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
51
73
  className: "relative",
52
74
  style: {
53
75
  maxHeight,
@@ -57,28 +79,13 @@ const Json = ({ className = void 0, collapsed = false, errorRenderer = void 0, m
57
79
  className: "pr-5",
58
80
  collapsed,
59
81
  displayDataTypes: false,
60
- value: parsedValue,
61
82
  onCopied: (_, rawValue) => {
62
83
  handleCopy(rawValue, onCopy);
63
84
  },
85
+ value: parsedValue,
64
86
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_CopiedRenderer.default, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_NullRenderer.default, {})]
65
87
  })
66
- });
67
- } catch (err) {
68
- error = errorRenderer ? errorRenderer(err, value) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ErrorRenderer.default, {
69
- data: value,
70
- error: err,
71
- showDetails,
72
- onToggleDetails: () => {
73
- setShowDetails(!showDetails);
74
- }
75
- });
76
- }
77
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
78
- "aria-label": "JSON viewer",
79
- className: (0, _fuf_stack_pixel_utils.cn)(className),
80
- role: "region",
81
- children: error ?? content
88
+ })
82
89
  });
83
90
  };
84
91
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"Json.cjs","names":["NullRenderer","getValue","JsonView","CopiedRenderer","ErrorRenderer"],"sources":["../../src/Json/Json.tsx"],"sourcesContent":["/* eslint-disable import-x/no-extraneous-dependencies */\n\nimport type { ReactNode } from 'react';\n\nimport { useState } from 'react';\n\n// INFO: react-json-view is bundled with --dts-resolve for now (dev dep)\nimport JsonView from '@uiw/react-json-view';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { getValue } from './jsonParser';\nimport CopiedRenderer from './subcomponents/CopiedRenderer';\nimport ErrorRenderer from './subcomponents/ErrorRenderer';\nimport NullRenderer from './subcomponents/NullRenderer';\n\nimport './theme.css';\n\n/**\n * Handles copying text or object values to clipboard.\n *\n * @param rawValue - The original value to copy (can be an object or primitive)\n * @param onCopy - Optional callback function triggered after copying with the copied value\n *\n * This function:\n * 1. Detects if the value is an object (not null and typeof 'object')\n * 2. Converts objects to JSON strings for clipboard copying\n * 3. Uses setTimeout to write the value to clipboard in the next render cycle\n * - This is necessary because JsonView (CopiedRenderer) normally handles copying itself,\n * but its copied value doesn't follow the same isObject logic\n * - By using setTimeout, we ensure our properly formatted value overwrites any previous copy operation\n * 4. Calls the optional onCopy callback with the copied value if provided\n *\n * Note: The text parameter is kept for API consistency but is not used in the copying process\n */\nconst handleCopy = (rawValue?: unknown, onCopy?: JsonProps['onCopy']) => {\n // determine of copied value is object-like\n let isObject = false;\n try {\n if (rawValue !== NullRenderer && typeof rawValue === 'object') {\n isObject = true;\n }\n } catch (_err) {\n // ignore\n }\n const copyValue = isObject\n ? JSON.stringify(rawValue as string, null, 2)\n : (rawValue as string);\n\n // JsonView (CopiedRenderer) does copy on its own but doesn't handle\n // object serialization correctly. We use setTimeout to overwrite its\n // clipboard value with our properly formatted version in the next tick.\n setTimeout(async () => {\n return navigator.clipboard.writeText(copyValue);\n }, 1);\n\n // if cb provided call it with copyValue\n if (onCopy) {\n onCopy(copyValue);\n }\n};\n\nexport interface JsonProps {\n /** CSS class name */\n className?: string;\n /** When set to true, all nodes will be collapsed by default. Use an integer value to collapse at a particular depth. */\n collapsed?: boolean | number;\n /** Optional custom error renderer */\n errorRenderer?: (error: Error, data: string | object) => ReactNode;\n /** Optional maximum height of the JSON viewer */\n maxHeight?: string | number;\n /** Callback when copy action is performed */\n onCopy?: (copiedValue: string) => void;\n /** Object to be visualized JSON string or object */\n value: string | object;\n}\n\n/**\n * Json renderer based on [react-json-view](https://uiwjs.github.io/react-json-view)\n * with improved error handling, accessibility, and customization options\n */\nconst Json = ({\n className = undefined,\n collapsed = false,\n errorRenderer = undefined,\n maxHeight = undefined,\n onCopy = undefined,\n value,\n}: JsonProps) => {\n const [showDetails, setShowDetails] = useState(false);\n\n let content: ReactNode = null;\n let error: ReactNode = null;\n\n try {\n const parsedValue = getValue(value);\n content = (\n <div\n className=\"relative\"\n style={{ maxHeight, overflowY: maxHeight ? 'auto' : undefined }}\n >\n <JsonView\n className=\"pr-5\"\n collapsed={collapsed}\n displayDataTypes={false}\n value={parsedValue}\n onCopied={(_, rawValue) => {\n handleCopy(rawValue, onCopy);\n }}\n >\n <CopiedRenderer />\n <NullRenderer />\n </JsonView>\n </div>\n );\n } catch (err) {\n const defaultError = (\n <ErrorRenderer\n data={value}\n error={err}\n showDetails={showDetails}\n onToggleDetails={() => {\n setShowDetails(!showDetails);\n }}\n />\n );\n\n error = errorRenderer ? errorRenderer(err as Error, value) : defaultError;\n }\n\n return (\n <div aria-label=\"JSON viewer\" className={cn(className)} role=\"region\">\n {error ?? content}\n </div>\n );\n};\n\nexport default Json;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,MAAM,cAAc,UAAoB,WAAiC;CAEvE,IAAI,WAAW;CACf,IAAI;EACF,IAAI,aAAaA,qBAAAA,WAAgB,OAAO,aAAa,UACnD,WAAW;CAEf,SAAS,MAAM,CAEf;CACA,MAAM,YAAY,WACd,KAAK,UAAU,UAAoB,MAAM,CAAC,IACzC;CAKL,WAAW,YAAY;EACrB,OAAO,UAAU,UAAU,UAAU,SAAS;CAChD,GAAG,CAAC;CAGJ,IAAI,QACF,OAAO,SAAS;AAEpB;;;;;AAqBA,MAAM,QAAQ,EACZ,YAAY,KAAA,GACZ,YAAY,OACZ,gBAAgB,KAAA,GAChB,YAAY,KAAA,GACZ,SAAS,KAAA,GACT,YACe;CACf,MAAM,CAAC,aAAa,mBAAA,GAAA,MAAA,UAA2B,KAAK;CAEpD,IAAI,UAAqB;CACzB,IAAI,QAAmB;CAEvB,IAAI;EACF,MAAM,cAAcC,mBAAAA,SAAS,KAAK;EAClC,UACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;GACE,WAAU;GACV,OAAO;IAAE;IAAW,WAAW,YAAY,SAAS,KAAA;GAAU;aAE9D,iBAAA,GAAA,kBAAA,MAACC,cAAAA,SAAD;IACE,WAAU;IACC;IACX,kBAAkB;IAClB,OAAO;IACP,WAAW,GAAG,aAAa;KACzB,WAAW,UAAU,MAAM;IAC7B;cAPF,CASE,iBAAA,GAAA,kBAAA,KAACC,uBAAAA,SAAD,CAAiB,CAAA,GACjB,iBAAA,GAAA,kBAAA,KAACH,qBAAAA,SAAD,CAAe,CAAA,CACP;;EACP,CAAA;CAET,SAAS,KAAK;EAYZ,QAAQ,gBAAgB,cAAc,KAAc,KAAK,IAAI,iBAAA,GAAA,kBAAA,KAV1DI,sBAAAA,SAAD;GACE,MAAM;GACN,OAAO;GACM;GACb,uBAAuB;IACrB,eAAe,CAAC,WAAW;GAC7B;EACD,CAGqE;CAC1E;CAEA,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EAAK,cAAW;EAAc,YAAA,GAAA,uBAAA,IAAc,SAAS;EAAG,MAAK;YAC1D,SAAS;CACP,CAAA;AAET"}
1
+ {"version":3,"file":"Json.cjs","names":["NullRenderer","getValue","ErrorRenderer","JsonView","CopiedRenderer"],"sources":["../../src/Json/Json.tsx"],"sourcesContent":["/* eslint-disable import-x/no-extraneous-dependencies */\n\nimport type { ReactNode } from 'react';\n\nimport { useState } from 'react';\n\n// INFO: react-json-view is bundled with --dts-resolve for now (dev dep)\nimport JsonView from '@uiw/react-json-view';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { getValue } from './jsonParser';\nimport CopiedRenderer from './subcomponents/CopiedRenderer';\nimport ErrorRenderer from './subcomponents/ErrorRenderer';\nimport NullRenderer from './subcomponents/NullRenderer';\n\nimport './theme.css';\n\n/**\n * Handles copying text or object values to clipboard.\n *\n * @param rawValue - The original value to copy (can be an object or primitive)\n * @param onCopy - Optional callback function triggered after copying with the copied value\n *\n * This function:\n * 1. Detects if the value is an object (not null and typeof 'object')\n * 2. Converts objects to JSON strings for clipboard copying\n * 3. Uses setTimeout to write the value to clipboard in the next render cycle\n * - This is necessary because JsonView (CopiedRenderer) normally handles copying itself,\n * but its copied value doesn't follow the same isObject logic\n * - By using setTimeout, we ensure our properly formatted value overwrites any previous copy operation\n * 4. Calls the optional onCopy callback with the copied value if provided\n *\n * Note: The text parameter is kept for API consistency but is not used in the copying process\n */\nconst handleCopy = (rawValue?: unknown, onCopy?: JsonProps['onCopy']) => {\n // determine of copied value is object-like\n let isObject = false;\n try {\n if (rawValue !== NullRenderer && typeof rawValue === 'object') {\n isObject = true;\n }\n } catch {\n // ignore\n }\n const copyValue = isObject\n ? JSON.stringify(rawValue, null, 2)\n : (rawValue as string);\n\n // JsonView (CopiedRenderer) does copy on its own but doesn't handle\n // object serialization correctly. We use setTimeout to overwrite its\n // clipboard value with our properly formatted version in the next tick.\n setTimeout(async () => {\n // eslint-disable-next-line n/no-unsupported-features/node-builtins\n return navigator.clipboard.writeText(copyValue);\n }, 1);\n\n // if cb provided call it with copyValue\n if (onCopy) {\n onCopy(copyValue);\n }\n};\n\nexport interface JsonProps {\n /** CSS class name */\n className?: string;\n /** When set to true, all nodes will be collapsed by default. Use an integer value to collapse at a particular depth. */\n collapsed?: boolean | number;\n /** Optional custom error renderer */\n errorRenderer?: (error: Error, data: string | object) => ReactNode;\n /** Optional maximum height of the JSON viewer */\n maxHeight?: string | number;\n /** Callback when copy action is performed */\n onCopy?: (copiedValue: string) => void;\n /** Object to be visualized JSON string or object */\n value: string | object;\n}\n\n/**\n * Json renderer based on [react-json-view](https://uiwjs.github.io/react-json-view)\n * with improved error handling, accessibility, and customization options\n */\nconst Json = ({\n className = undefined,\n collapsed = false,\n errorRenderer = undefined,\n maxHeight = undefined,\n onCopy = undefined,\n value,\n}: JsonProps) => {\n const [showDetails, setShowDetails] = useState(false);\n let parsedValue: object | undefined;\n let parsingError: Error | null = null;\n\n try {\n parsedValue = getValue(value);\n } catch (err) {\n parsingError = err as Error;\n }\n\n if (parsingError) {\n const defaultError = (\n <ErrorRenderer\n data={value}\n error={parsingError}\n onToggleDetails={() => {\n setShowDetails(!showDetails);\n }}\n showDetails={showDetails}\n />\n );\n\n const renderedError = errorRenderer\n ? errorRenderer(parsingError, value)\n : defaultError;\n\n return (\n <div aria-label=\"JSON viewer\" className={cn(className)} role=\"region\">\n {renderedError}\n </div>\n );\n }\n\n return (\n <div aria-label=\"JSON viewer\" className={cn(className)} role=\"region\">\n <div\n className=\"relative\"\n style={{ maxHeight, overflowY: maxHeight ? 'auto' : undefined }}\n >\n <JsonView\n className=\"pr-5\"\n collapsed={collapsed}\n displayDataTypes={false}\n onCopied={(_, rawValue) => {\n handleCopy(rawValue, onCopy);\n }}\n value={parsedValue}\n >\n <CopiedRenderer />\n <NullRenderer />\n </JsonView>\n </div>\n </div>\n );\n};\n\nexport default Json;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,MAAM,cAAc,UAAoB,WAAiC;CAEvE,IAAI,WAAW;CACf,IAAI;EACF,IAAI,aAAaA,qBAAAA,WAAgB,OAAO,aAAa,UACnD,WAAW;CAEf,QAAQ,CAER;CACA,MAAM,YAAY,WACd,KAAK,UAAU,UAAU,MAAM,CAAC,IAC/B;CAKL,WAAW,YAAY;EAErB,OAAO,UAAU,UAAU,UAAU,SAAS;CAChD,GAAG,CAAC;CAGJ,IAAI,QACF,OAAO,SAAS;AAEpB;;;;;AAqBA,MAAM,QAAQ,EACZ,YAAY,KAAA,GACZ,YAAY,OACZ,gBAAgB,KAAA,GAChB,YAAY,KAAA,GACZ,SAAS,KAAA,GACT,YACe;CACf,MAAM,CAAC,aAAa,mBAAA,GAAA,MAAA,UAA2B,KAAK;CACpD,IAAI;CACJ,IAAI,eAA6B;CAEjC,IAAI;EACF,cAAcC,mBAAAA,SAAS,KAAK;CAC9B,SAAS,KAAK;EACZ,eAAe;CACjB;CAEA,IAAI,cAAc;EAYhB,MAAM,gBAAgB,gBAClB,cAAc,cAAc,KAAK,IACjC,iBAAA,GAAA,kBAAA,KAZDC,sBAAAA,SAAD;GACE,MAAM;GACN,OAAO;GACP,uBAAuB;IACrB,eAAe,CAAC,WAAW;GAC7B;GACa;EACd,CAKY;EAEf,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;GAAK,cAAW;GAAc,YAAA,GAAA,uBAAA,IAAc,SAAS;GAAG,MAAK;aAC1D;EACE,CAAA;CAET;CAEA,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EAAK,cAAW;EAAc,YAAA,GAAA,uBAAA,IAAc,SAAS;EAAG,MAAK;YAC3D,iBAAA,GAAA,kBAAA,KAAC,OAAD;GACE,WAAU;GACV,OAAO;IAAE;IAAW,WAAW,YAAY,SAAS,KAAA;GAAU;aAE9D,iBAAA,GAAA,kBAAA,MAACC,cAAAA,SAAD;IACE,WAAU;IACC;IACX,kBAAkB;IAClB,WAAW,GAAG,aAAa;KACzB,WAAW,UAAU,MAAM;IAC7B;IACA,OAAO;cAPT,CASE,iBAAA,GAAA,kBAAA,KAACC,uBAAAA,SAAD,CAAiB,CAAA,GACjB,iBAAA,GAAA,kBAAA,KAACJ,qBAAAA,SAAD,CAAe,CAAA,CACP;;EACP,CAAA;CACF,CAAA;AAET"}
@@ -1 +1 @@
1
- {"version":3,"file":"Json.d.cts","names":[],"sources":["../../src/Json/Json.tsx"],"mappings":";;;UA8DiB,SAAA;EAAA;EAEf,SAAA;;EAEA,SAAA;EAFA;EAIA,aAAA,IAAiB,KAAA,EAAO,KAAA,EAAO,IAAA,sBAA0B,SAAS;EAAlE;EAEA,SAAA;EAFiB;EAIjB,MAAA,IAAU,WAAA;EAJ+C;EAMzD,KAAA;AAAA;;;;AAAK;cAOD,IAAA;EAAQ,SAAA;EAAA,SAAA;EAAA,aAAA;EAAA,SAAA;EAAA,MAAA;EAAA;AAAA,GAOX,SAAA,iCAAS,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"Json.d.cts","names":[],"sources":["../../src/Json/Json.tsx"],"mappings":";;;UA+DiB,SAAA;EAAA;EAEf,SAAA;;EAEA,SAAA;EAFA;EAIA,aAAA,IAAiB,KAAA,EAAO,KAAA,EAAO,IAAA,sBAA0B,SAAS;EAAlE;EAEA,SAAA;EAFiB;EAIjB,MAAA,IAAU,WAAA;EAJ+C;EAMzD,KAAA;AAAA;;;;AAAK;cAOD,IAAA;EAAQ,SAAA;EAAA,SAAA;EAAA,aAAA;EAAA,SAAA;EAAA,MAAA;EAAA;AAAA,GAOX,SAAA,iCAAS,GAAA,CAAA,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Json.d.ts","names":[],"sources":["../../src/Json/Json.tsx"],"mappings":";;;UA8DiB,SAAA;EAAA;EAEf,SAAA;;EAEA,SAAA;EAFA;EAIA,aAAA,IAAiB,KAAA,EAAO,KAAA,EAAO,IAAA,sBAA0B,SAAS;EAAlE;EAEA,SAAA;EAFiB;EAIjB,MAAA,IAAU,WAAA;EAJ+C;EAMzD,KAAA;AAAA;;;;AAAK;cAOD,IAAA;EAAQ,SAAA;EAAA,SAAA;EAAA,aAAA;EAAA,SAAA;EAAA,MAAA;EAAA;AAAA,GAOX,SAAA,iCAAS,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"Json.d.ts","names":[],"sources":["../../src/Json/Json.tsx"],"mappings":";;;UA+DiB,SAAA;EAAA;EAEf,SAAA;;EAEA,SAAA;EAFA;EAIA,aAAA,IAAiB,KAAA,EAAO,KAAA,EAAO,IAAA,sBAA0B,SAAS;EAAlE;EAEA,SAAA;EAFiB;EAIjB,MAAA,IAAU,WAAA;EAJ+C;EAMzD,KAAA;AAAA;;;;AAAK;cAOD,IAAA;EAAQ,SAAA;EAAA,SAAA;EAAA,aAAA;EAAA,SAAA;EAAA,MAAA;EAAA;AAAA,GAOX,SAAA,iCAAS,GAAA,CAAA,OAAA"}
package/dist/Json/Json.js CHANGED
@@ -29,7 +29,7 @@ const handleCopy = (rawValue, onCopy) => {
29
29
  let isObject = false;
30
30
  try {
31
31
  if (rawValue !== NullRenderer && typeof rawValue === "object") isObject = true;
32
- } catch (_err) {}
32
+ } catch {}
33
33
  const copyValue = isObject ? JSON.stringify(rawValue, null, 2) : rawValue;
34
34
  setTimeout(async () => {
35
35
  return navigator.clipboard.writeText(copyValue);
@@ -42,11 +42,34 @@ const handleCopy = (rawValue, onCopy) => {
42
42
  */
43
43
  const Json = ({ className = void 0, collapsed = false, errorRenderer = void 0, maxHeight = void 0, onCopy = void 0, value }) => {
44
44
  const [showDetails, setShowDetails] = useState(false);
45
- let content = null;
46
- let error = null;
45
+ let parsedValue;
46
+ let parsingError = null;
47
47
  try {
48
- const parsedValue = getValue(value);
49
- content = /* @__PURE__ */ jsx("div", {
48
+ parsedValue = getValue(value);
49
+ } catch (err) {
50
+ parsingError = err;
51
+ }
52
+ if (parsingError) {
53
+ const renderedError = errorRenderer ? errorRenderer(parsingError, value) : /* @__PURE__ */ jsx(ErrorRenderer, {
54
+ data: value,
55
+ error: parsingError,
56
+ onToggleDetails: () => {
57
+ setShowDetails(!showDetails);
58
+ },
59
+ showDetails
60
+ });
61
+ return /* @__PURE__ */ jsx("div", {
62
+ "aria-label": "JSON viewer",
63
+ className: cn(className),
64
+ role: "region",
65
+ children: renderedError
66
+ });
67
+ }
68
+ return /* @__PURE__ */ jsx("div", {
69
+ "aria-label": "JSON viewer",
70
+ className: cn(className),
71
+ role: "region",
72
+ children: /* @__PURE__ */ jsx("div", {
50
73
  className: "relative",
51
74
  style: {
52
75
  maxHeight,
@@ -56,28 +79,13 @@ const Json = ({ className = void 0, collapsed = false, errorRenderer = void 0, m
56
79
  className: "pr-5",
57
80
  collapsed,
58
81
  displayDataTypes: false,
59
- value: parsedValue,
60
82
  onCopied: (_, rawValue) => {
61
83
  handleCopy(rawValue, onCopy);
62
84
  },
85
+ value: parsedValue,
63
86
  children: [/* @__PURE__ */ jsx(CopiedRenderer, {}), /* @__PURE__ */ jsx(NullRenderer, {})]
64
87
  })
65
- });
66
- } catch (err) {
67
- error = errorRenderer ? errorRenderer(err, value) : /* @__PURE__ */ jsx(ErrorRenderer, {
68
- data: value,
69
- error: err,
70
- showDetails,
71
- onToggleDetails: () => {
72
- setShowDetails(!showDetails);
73
- }
74
- });
75
- }
76
- return /* @__PURE__ */ jsx("div", {
77
- "aria-label": "JSON viewer",
78
- className: cn(className),
79
- role: "region",
80
- children: error ?? content
88
+ })
81
89
  });
82
90
  };
83
91
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"Json.js","names":[],"sources":["../../src/Json/Json.tsx"],"sourcesContent":["/* eslint-disable import-x/no-extraneous-dependencies */\n\nimport type { ReactNode } from 'react';\n\nimport { useState } from 'react';\n\n// INFO: react-json-view is bundled with --dts-resolve for now (dev dep)\nimport JsonView from '@uiw/react-json-view';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { getValue } from './jsonParser';\nimport CopiedRenderer from './subcomponents/CopiedRenderer';\nimport ErrorRenderer from './subcomponents/ErrorRenderer';\nimport NullRenderer from './subcomponents/NullRenderer';\n\nimport './theme.css';\n\n/**\n * Handles copying text or object values to clipboard.\n *\n * @param rawValue - The original value to copy (can be an object or primitive)\n * @param onCopy - Optional callback function triggered after copying with the copied value\n *\n * This function:\n * 1. Detects if the value is an object (not null and typeof 'object')\n * 2. Converts objects to JSON strings for clipboard copying\n * 3. Uses setTimeout to write the value to clipboard in the next render cycle\n * - This is necessary because JsonView (CopiedRenderer) normally handles copying itself,\n * but its copied value doesn't follow the same isObject logic\n * - By using setTimeout, we ensure our properly formatted value overwrites any previous copy operation\n * 4. Calls the optional onCopy callback with the copied value if provided\n *\n * Note: The text parameter is kept for API consistency but is not used in the copying process\n */\nconst handleCopy = (rawValue?: unknown, onCopy?: JsonProps['onCopy']) => {\n // determine of copied value is object-like\n let isObject = false;\n try {\n if (rawValue !== NullRenderer && typeof rawValue === 'object') {\n isObject = true;\n }\n } catch (_err) {\n // ignore\n }\n const copyValue = isObject\n ? JSON.stringify(rawValue as string, null, 2)\n : (rawValue as string);\n\n // JsonView (CopiedRenderer) does copy on its own but doesn't handle\n // object serialization correctly. We use setTimeout to overwrite its\n // clipboard value with our properly formatted version in the next tick.\n setTimeout(async () => {\n return navigator.clipboard.writeText(copyValue);\n }, 1);\n\n // if cb provided call it with copyValue\n if (onCopy) {\n onCopy(copyValue);\n }\n};\n\nexport interface JsonProps {\n /** CSS class name */\n className?: string;\n /** When set to true, all nodes will be collapsed by default. Use an integer value to collapse at a particular depth. */\n collapsed?: boolean | number;\n /** Optional custom error renderer */\n errorRenderer?: (error: Error, data: string | object) => ReactNode;\n /** Optional maximum height of the JSON viewer */\n maxHeight?: string | number;\n /** Callback when copy action is performed */\n onCopy?: (copiedValue: string) => void;\n /** Object to be visualized JSON string or object */\n value: string | object;\n}\n\n/**\n * Json renderer based on [react-json-view](https://uiwjs.github.io/react-json-view)\n * with improved error handling, accessibility, and customization options\n */\nconst Json = ({\n className = undefined,\n collapsed = false,\n errorRenderer = undefined,\n maxHeight = undefined,\n onCopy = undefined,\n value,\n}: JsonProps) => {\n const [showDetails, setShowDetails] = useState(false);\n\n let content: ReactNode = null;\n let error: ReactNode = null;\n\n try {\n const parsedValue = getValue(value);\n content = (\n <div\n className=\"relative\"\n style={{ maxHeight, overflowY: maxHeight ? 'auto' : undefined }}\n >\n <JsonView\n className=\"pr-5\"\n collapsed={collapsed}\n displayDataTypes={false}\n value={parsedValue}\n onCopied={(_, rawValue) => {\n handleCopy(rawValue, onCopy);\n }}\n >\n <CopiedRenderer />\n <NullRenderer />\n </JsonView>\n </div>\n );\n } catch (err) {\n const defaultError = (\n <ErrorRenderer\n data={value}\n error={err}\n showDetails={showDetails}\n onToggleDetails={() => {\n setShowDetails(!showDetails);\n }}\n />\n );\n\n error = errorRenderer ? errorRenderer(err as Error, value) : defaultError;\n }\n\n return (\n <div aria-label=\"JSON viewer\" className={cn(className)} role=\"region\">\n {error ?? content}\n </div>\n );\n};\n\nexport default Json;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,MAAM,cAAc,UAAoB,WAAiC;CAEvE,IAAI,WAAW;CACf,IAAI;EACF,IAAI,aAAa,gBAAgB,OAAO,aAAa,UACnD,WAAW;CAEf,SAAS,MAAM,CAEf;CACA,MAAM,YAAY,WACd,KAAK,UAAU,UAAoB,MAAM,CAAC,IACzC;CAKL,WAAW,YAAY;EACrB,OAAO,UAAU,UAAU,UAAU,SAAS;CAChD,GAAG,CAAC;CAGJ,IAAI,QACF,OAAO,SAAS;AAEpB;;;;;AAqBA,MAAM,QAAQ,EACZ,YAAY,KAAA,GACZ,YAAY,OACZ,gBAAgB,KAAA,GAChB,YAAY,KAAA,GACZ,SAAS,KAAA,GACT,YACe;CACf,MAAM,CAAC,aAAa,kBAAkB,SAAS,KAAK;CAEpD,IAAI,UAAqB;CACzB,IAAI,QAAmB;CAEvB,IAAI;EACF,MAAM,cAAc,SAAS,KAAK;EAClC,UACE,oBAAC,OAAD;GACE,WAAU;GACV,OAAO;IAAE;IAAW,WAAW,YAAY,SAAS,KAAA;GAAU;aAE9D,qBAAC,UAAD;IACE,WAAU;IACC;IACX,kBAAkB;IAClB,OAAO;IACP,WAAW,GAAG,aAAa;KACzB,WAAW,UAAU,MAAM;IAC7B;cAPF,CASE,oBAAC,gBAAD,CAAiB,CAAA,GACjB,oBAAC,cAAD,CAAe,CAAA,CACP;;EACP,CAAA;CAET,SAAS,KAAK;EAYZ,QAAQ,gBAAgB,cAAc,KAAc,KAAK,IAAI,oBAV1D,eAAD;GACE,MAAM;GACN,OAAO;GACM;GACb,uBAAuB;IACrB,eAAe,CAAC,WAAW;GAC7B;EACD,CAGqE;CAC1E;CAEA,OACE,oBAAC,OAAD;EAAK,cAAW;EAAc,WAAW,GAAG,SAAS;EAAG,MAAK;YAC1D,SAAS;CACP,CAAA;AAET"}
1
+ {"version":3,"file":"Json.js","names":[],"sources":["../../src/Json/Json.tsx"],"sourcesContent":["/* eslint-disable import-x/no-extraneous-dependencies */\n\nimport type { ReactNode } from 'react';\n\nimport { useState } from 'react';\n\n// INFO: react-json-view is bundled with --dts-resolve for now (dev dep)\nimport JsonView from '@uiw/react-json-view';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { getValue } from './jsonParser';\nimport CopiedRenderer from './subcomponents/CopiedRenderer';\nimport ErrorRenderer from './subcomponents/ErrorRenderer';\nimport NullRenderer from './subcomponents/NullRenderer';\n\nimport './theme.css';\n\n/**\n * Handles copying text or object values to clipboard.\n *\n * @param rawValue - The original value to copy (can be an object or primitive)\n * @param onCopy - Optional callback function triggered after copying with the copied value\n *\n * This function:\n * 1. Detects if the value is an object (not null and typeof 'object')\n * 2. Converts objects to JSON strings for clipboard copying\n * 3. Uses setTimeout to write the value to clipboard in the next render cycle\n * - This is necessary because JsonView (CopiedRenderer) normally handles copying itself,\n * but its copied value doesn't follow the same isObject logic\n * - By using setTimeout, we ensure our properly formatted value overwrites any previous copy operation\n * 4. Calls the optional onCopy callback with the copied value if provided\n *\n * Note: The text parameter is kept for API consistency but is not used in the copying process\n */\nconst handleCopy = (rawValue?: unknown, onCopy?: JsonProps['onCopy']) => {\n // determine of copied value is object-like\n let isObject = false;\n try {\n if (rawValue !== NullRenderer && typeof rawValue === 'object') {\n isObject = true;\n }\n } catch {\n // ignore\n }\n const copyValue = isObject\n ? JSON.stringify(rawValue, null, 2)\n : (rawValue as string);\n\n // JsonView (CopiedRenderer) does copy on its own but doesn't handle\n // object serialization correctly. We use setTimeout to overwrite its\n // clipboard value with our properly formatted version in the next tick.\n setTimeout(async () => {\n // eslint-disable-next-line n/no-unsupported-features/node-builtins\n return navigator.clipboard.writeText(copyValue);\n }, 1);\n\n // if cb provided call it with copyValue\n if (onCopy) {\n onCopy(copyValue);\n }\n};\n\nexport interface JsonProps {\n /** CSS class name */\n className?: string;\n /** When set to true, all nodes will be collapsed by default. Use an integer value to collapse at a particular depth. */\n collapsed?: boolean | number;\n /** Optional custom error renderer */\n errorRenderer?: (error: Error, data: string | object) => ReactNode;\n /** Optional maximum height of the JSON viewer */\n maxHeight?: string | number;\n /** Callback when copy action is performed */\n onCopy?: (copiedValue: string) => void;\n /** Object to be visualized JSON string or object */\n value: string | object;\n}\n\n/**\n * Json renderer based on [react-json-view](https://uiwjs.github.io/react-json-view)\n * with improved error handling, accessibility, and customization options\n */\nconst Json = ({\n className = undefined,\n collapsed = false,\n errorRenderer = undefined,\n maxHeight = undefined,\n onCopy = undefined,\n value,\n}: JsonProps) => {\n const [showDetails, setShowDetails] = useState(false);\n let parsedValue: object | undefined;\n let parsingError: Error | null = null;\n\n try {\n parsedValue = getValue(value);\n } catch (err) {\n parsingError = err as Error;\n }\n\n if (parsingError) {\n const defaultError = (\n <ErrorRenderer\n data={value}\n error={parsingError}\n onToggleDetails={() => {\n setShowDetails(!showDetails);\n }}\n showDetails={showDetails}\n />\n );\n\n const renderedError = errorRenderer\n ? errorRenderer(parsingError, value)\n : defaultError;\n\n return (\n <div aria-label=\"JSON viewer\" className={cn(className)} role=\"region\">\n {renderedError}\n </div>\n );\n }\n\n return (\n <div aria-label=\"JSON viewer\" className={cn(className)} role=\"region\">\n <div\n className=\"relative\"\n style={{ maxHeight, overflowY: maxHeight ? 'auto' : undefined }}\n >\n <JsonView\n className=\"pr-5\"\n collapsed={collapsed}\n displayDataTypes={false}\n onCopied={(_, rawValue) => {\n handleCopy(rawValue, onCopy);\n }}\n value={parsedValue}\n >\n <CopiedRenderer />\n <NullRenderer />\n </JsonView>\n </div>\n </div>\n );\n};\n\nexport default Json;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,MAAM,cAAc,UAAoB,WAAiC;CAEvE,IAAI,WAAW;CACf,IAAI;EACF,IAAI,aAAa,gBAAgB,OAAO,aAAa,UACnD,WAAW;CAEf,QAAQ,CAER;CACA,MAAM,YAAY,WACd,KAAK,UAAU,UAAU,MAAM,CAAC,IAC/B;CAKL,WAAW,YAAY;EAErB,OAAO,UAAU,UAAU,UAAU,SAAS;CAChD,GAAG,CAAC;CAGJ,IAAI,QACF,OAAO,SAAS;AAEpB;;;;;AAqBA,MAAM,QAAQ,EACZ,YAAY,KAAA,GACZ,YAAY,OACZ,gBAAgB,KAAA,GAChB,YAAY,KAAA,GACZ,SAAS,KAAA,GACT,YACe;CACf,MAAM,CAAC,aAAa,kBAAkB,SAAS,KAAK;CACpD,IAAI;CACJ,IAAI,eAA6B;CAEjC,IAAI;EACF,cAAc,SAAS,KAAK;CAC9B,SAAS,KAAK;EACZ,eAAe;CACjB;CAEA,IAAI,cAAc;EAYhB,MAAM,gBAAgB,gBAClB,cAAc,cAAc,KAAK,IACjC,oBAZD,eAAD;GACE,MAAM;GACN,OAAO;GACP,uBAAuB;IACrB,eAAe,CAAC,WAAW;GAC7B;GACa;EACd,CAKY;EAEf,OACE,oBAAC,OAAD;GAAK,cAAW;GAAc,WAAW,GAAG,SAAS;GAAG,MAAK;aAC1D;EACE,CAAA;CAET;CAEA,OACE,oBAAC,OAAD;EAAK,cAAW;EAAc,WAAW,GAAG,SAAS;EAAG,MAAK;YAC3D,oBAAC,OAAD;GACE,WAAU;GACV,OAAO;IAAE;IAAW,WAAW,YAAY,SAAS,KAAA;GAAU;aAE9D,qBAAC,UAAD;IACE,WAAU;IACC;IACX,kBAAkB;IAClB,WAAW,GAAG,aAAa;KACzB,WAAW,UAAU,MAAM;IAC7B;IACA,OAAO;cAPT,CASE,oBAAC,gBAAD,CAAiB,CAAA,GACjB,oBAAC,cAAD,CAAe,CAAA,CACP;;EACP,CAAA;CACF,CAAA;AAET"}
@@ -1,4 +1,3 @@
1
- require("../../_virtual/_rolldown/runtime.cjs");
2
1
  const require_index = require("../../node_modules/.pnpm/@uiw_react-json-view@2.0.0-alpha.43_@babel_runtime@7.29.2_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@uiw/react-json-view/esm/index.cjs");
3
2
  let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
4
3
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -29,13 +28,13 @@ const CopiedRenderer = () => {
29
28
  "aria-label": isCopied ? "Copied to clipboard" : "Copy to clipboard",
30
29
  className: "ml-0! h-[1em]! w-0! relative",
31
30
  "data-testid": "copy-button",
31
+ onClick: (e) => {
32
+ return onClick?.(e);
33
+ },
32
34
  onKeyDown: handleKeyDown,
33
35
  role: "button",
34
36
  style,
35
37
  tabIndex: 0,
36
- onClick: (e) => {
37
- return onClick?.(e);
38
- },
39
38
  children: isCopied ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_icons_hi.HiOutlineClipboardCheck, { className: elmClasses }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_icons_hi.HiOutlineClipboard, { className: elmClasses })
40
39
  });
41
40
  } });
@@ -1 +1 @@
1
- {"version":3,"file":"CopiedRenderer.cjs","names":["JsonView","HiOutlineClipboardCheck","HiOutlineClipboard"],"sources":["../../../src/Json/subcomponents/CopiedRenderer.tsx"],"sourcesContent":["/* eslint-disable import-x/no-extraneous-dependencies */\n\nimport type { KeyboardEvent, MouseEvent } from 'react';\n\nimport { HiOutlineClipboard, HiOutlineClipboardCheck } from 'react-icons/hi';\n\n// INFO: react-json-view is bundled with --dts-resolve for now (dev dep)\nimport JsonView from '@uiw/react-json-view';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\n/**\n * A custom renderer for the JsonView's copy functionality that provides an accessible\n * and interactive copy button with visual feedback.\n *\n * This component overrides the default copy button implementation from @uiw/react-json-view\n * to fix flickering issues and improve accessibility. It renders a button that:\n * - Shows different icons for copied/not copied states\n * - Supports keyboard navigation\n * - Provides proper ARIA labels\n * - Maintains consistent positioning\n *\n * @returns A JsonView.Copied component with custom render implementation\n */\nconst CopiedRenderer = () => {\n return (\n <JsonView.Copied\n render={(props) => {\n const { style, onClick, className } = props;\n\n // @ts-expect-error this is ok\n\n const isCopied = props['data-copied'] as boolean;\n\n const elmClasses = cn(\n className,\n 'fill-transparent! absolute -right-4 -top-[2px] h-4 w-4 pl-1',\n { 'text-success': isCopied },\n );\n\n const handleKeyDown = (e: KeyboardEvent<HTMLSpanElement>) => {\n if (e.key === 'Enter' || e.key === ' ') {\n onClick?.(e as unknown as MouseEvent<SVGSVGElement>);\n }\n };\n\n return (\n <span\n aria-label={isCopied ? 'Copied to clipboard' : 'Copy to clipboard'}\n className=\"ml-0! h-[1em]! w-0! relative\"\n data-testid=\"copy-button\"\n onKeyDown={handleKeyDown}\n role=\"button\"\n style={style}\n tabIndex={0}\n onClick={(e) => {\n return onClick?.(e as unknown as MouseEvent<SVGSVGElement>);\n }}\n >\n {isCopied ? (\n <HiOutlineClipboardCheck className={elmClasses} />\n ) : (\n <HiOutlineClipboard className={elmClasses} />\n )}\n </span>\n );\n }}\n />\n );\n};\n\nexport default CopiedRenderer;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAwBA,MAAM,uBAAuB;CAC3B,OACE,iBAAA,GAAA,kBAAA,KAACA,cAAAA,QAAS,QAAV,EACE,SAAS,UAAU;EACjB,MAAM,EAAE,OAAO,SAAS,cAAc;EAItC,MAAM,WAAW,MAAM;EAEvB,MAAM,cAAA,GAAA,uBAAA,IACJ,WACA,+DACA,EAAE,gBAAgB,SAAS,CAC7B;EAEA,MAAM,iBAAiB,MAAsC;GAC3D,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,KACjC,UAAU,CAAyC;EAEvD;EAEA,OACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;GACE,cAAY,WAAW,wBAAwB;GAC/C,WAAU;GACV,eAAY;GACZ,WAAW;GACX,MAAK;GACE;GACP,UAAU;GACV,UAAU,MAAM;IACd,OAAO,UAAU,CAAyC;GAC5D;aAEC,WACC,iBAAA,GAAA,kBAAA,KAACC,eAAAA,yBAAD,EAAyB,WAAW,WAAa,CAAA,IAEjD,iBAAA,GAAA,kBAAA,KAACC,eAAAA,oBAAD,EAAoB,WAAW,WAAa,CAAA;EAE1C,CAAA;CAEV,EACD,CAAA;AAEL"}
1
+ {"version":3,"file":"CopiedRenderer.cjs","names":["JsonView","HiOutlineClipboardCheck","HiOutlineClipboard"],"sources":["../../../src/Json/subcomponents/CopiedRenderer.tsx"],"sourcesContent":["/* eslint-disable import-x/no-extraneous-dependencies */\n\nimport type { KeyboardEvent, MouseEvent } from 'react';\n\nimport { HiOutlineClipboard, HiOutlineClipboardCheck } from 'react-icons/hi';\n\n// INFO: react-json-view is bundled with --dts-resolve for now (dev dep)\nimport JsonView from '@uiw/react-json-view';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\n/**\n * A custom renderer for the JsonView's copy functionality that provides an accessible\n * and interactive copy button with visual feedback.\n *\n * This component overrides the default copy button implementation from @uiw/react-json-view\n * to fix flickering issues and improve accessibility. It renders a button that:\n * - Shows different icons for copied/not copied states\n * - Supports keyboard navigation\n * - Provides proper ARIA labels\n * - Maintains consistent positioning\n *\n * @returns A JsonView.Copied component with custom render implementation\n */\nconst CopiedRenderer = () => {\n return (\n <JsonView.Copied\n render={(props) => {\n const { style, onClick, className } = props;\n\n // @ts-expect-error this is ok\n\n const isCopied = props['data-copied'] as boolean;\n\n const elmClasses = cn(\n className,\n 'fill-transparent! absolute -right-4 -top-[2px] h-4 w-4 pl-1',\n { 'text-success': isCopied },\n );\n\n const handleKeyDown = (e: KeyboardEvent<HTMLSpanElement>) => {\n if (e.key === 'Enter' || e.key === ' ') {\n onClick?.(e as unknown as MouseEvent<SVGSVGElement>);\n }\n };\n\n return (\n <span\n aria-label={isCopied ? 'Copied to clipboard' : 'Copy to clipboard'}\n className=\"ml-0! h-[1em]! w-0! relative\"\n data-testid=\"copy-button\"\n onClick={(e) => {\n return onClick?.(e as unknown as MouseEvent<SVGSVGElement>);\n }}\n onKeyDown={handleKeyDown}\n role=\"button\"\n style={style}\n tabIndex={0}\n >\n {isCopied ? (\n <HiOutlineClipboardCheck className={elmClasses} />\n ) : (\n <HiOutlineClipboard className={elmClasses} />\n )}\n </span>\n );\n }}\n />\n );\n};\n\nexport default CopiedRenderer;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAwBA,MAAM,uBAAuB;CAC3B,OACE,iBAAA,GAAA,kBAAA,KAACA,cAAAA,QAAS,QAAV,EACE,SAAS,UAAU;EACjB,MAAM,EAAE,OAAO,SAAS,cAAc;EAItC,MAAM,WAAW,MAAM;EAEvB,MAAM,cAAA,GAAA,uBAAA,IACJ,WACA,+DACA,EAAE,gBAAgB,SAAS,CAC7B;EAEA,MAAM,iBAAiB,MAAsC;GAC3D,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,KACjC,UAAU,CAAyC;EAEvD;EAEA,OACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;GACE,cAAY,WAAW,wBAAwB;GAC/C,WAAU;GACV,eAAY;GACZ,UAAU,MAAM;IACd,OAAO,UAAU,CAAyC;GAC5D;GACA,WAAW;GACX,MAAK;GACE;GACP,UAAU;aAET,WACC,iBAAA,GAAA,kBAAA,KAACC,eAAAA,yBAAD,EAAyB,WAAW,WAAa,CAAA,IAEjD,iBAAA,GAAA,kBAAA,KAACC,eAAAA,oBAAD,EAAoB,WAAW,WAAa,CAAA;EAE1C,CAAA;CAEV,EACD,CAAA;AAEL"}
@@ -28,13 +28,13 @@ const CopiedRenderer = () => {
28
28
  "aria-label": isCopied ? "Copied to clipboard" : "Copy to clipboard",
29
29
  className: "ml-0! h-[1em]! w-0! relative",
30
30
  "data-testid": "copy-button",
31
+ onClick: (e) => {
32
+ return onClick?.(e);
33
+ },
31
34
  onKeyDown: handleKeyDown,
32
35
  role: "button",
33
36
  style,
34
37
  tabIndex: 0,
35
- onClick: (e) => {
36
- return onClick?.(e);
37
- },
38
38
  children: isCopied ? /* @__PURE__ */ jsx(HiOutlineClipboardCheck, { className: elmClasses }) : /* @__PURE__ */ jsx(HiOutlineClipboard, { className: elmClasses })
39
39
  });
40
40
  } });
@@ -1 +1 @@
1
- {"version":3,"file":"CopiedRenderer.js","names":[],"sources":["../../../src/Json/subcomponents/CopiedRenderer.tsx"],"sourcesContent":["/* eslint-disable import-x/no-extraneous-dependencies */\n\nimport type { KeyboardEvent, MouseEvent } from 'react';\n\nimport { HiOutlineClipboard, HiOutlineClipboardCheck } from 'react-icons/hi';\n\n// INFO: react-json-view is bundled with --dts-resolve for now (dev dep)\nimport JsonView from '@uiw/react-json-view';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\n/**\n * A custom renderer for the JsonView's copy functionality that provides an accessible\n * and interactive copy button with visual feedback.\n *\n * This component overrides the default copy button implementation from @uiw/react-json-view\n * to fix flickering issues and improve accessibility. It renders a button that:\n * - Shows different icons for copied/not copied states\n * - Supports keyboard navigation\n * - Provides proper ARIA labels\n * - Maintains consistent positioning\n *\n * @returns A JsonView.Copied component with custom render implementation\n */\nconst CopiedRenderer = () => {\n return (\n <JsonView.Copied\n render={(props) => {\n const { style, onClick, className } = props;\n\n // @ts-expect-error this is ok\n\n const isCopied = props['data-copied'] as boolean;\n\n const elmClasses = cn(\n className,\n 'fill-transparent! absolute -right-4 -top-[2px] h-4 w-4 pl-1',\n { 'text-success': isCopied },\n );\n\n const handleKeyDown = (e: KeyboardEvent<HTMLSpanElement>) => {\n if (e.key === 'Enter' || e.key === ' ') {\n onClick?.(e as unknown as MouseEvent<SVGSVGElement>);\n }\n };\n\n return (\n <span\n aria-label={isCopied ? 'Copied to clipboard' : 'Copy to clipboard'}\n className=\"ml-0! h-[1em]! w-0! relative\"\n data-testid=\"copy-button\"\n onKeyDown={handleKeyDown}\n role=\"button\"\n style={style}\n tabIndex={0}\n onClick={(e) => {\n return onClick?.(e as unknown as MouseEvent<SVGSVGElement>);\n }}\n >\n {isCopied ? (\n <HiOutlineClipboardCheck className={elmClasses} />\n ) : (\n <HiOutlineClipboard className={elmClasses} />\n )}\n </span>\n );\n }}\n />\n );\n};\n\nexport default CopiedRenderer;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAwBA,MAAM,uBAAuB;CAC3B,OACE,oBAAC,SAAS,QAAV,EACE,SAAS,UAAU;EACjB,MAAM,EAAE,OAAO,SAAS,cAAc;EAItC,MAAM,WAAW,MAAM;EAEvB,MAAM,aAAa,GACjB,WACA,+DACA,EAAE,gBAAgB,SAAS,CAC7B;EAEA,MAAM,iBAAiB,MAAsC;GAC3D,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,KACjC,UAAU,CAAyC;EAEvD;EAEA,OACE,oBAAC,QAAD;GACE,cAAY,WAAW,wBAAwB;GAC/C,WAAU;GACV,eAAY;GACZ,WAAW;GACX,MAAK;GACE;GACP,UAAU;GACV,UAAU,MAAM;IACd,OAAO,UAAU,CAAyC;GAC5D;aAEC,WACC,oBAAC,yBAAD,EAAyB,WAAW,WAAa,CAAA,IAEjD,oBAAC,oBAAD,EAAoB,WAAW,WAAa,CAAA;EAE1C,CAAA;CAEV,EACD,CAAA;AAEL"}
1
+ {"version":3,"file":"CopiedRenderer.js","names":[],"sources":["../../../src/Json/subcomponents/CopiedRenderer.tsx"],"sourcesContent":["/* eslint-disable import-x/no-extraneous-dependencies */\n\nimport type { KeyboardEvent, MouseEvent } from 'react';\n\nimport { HiOutlineClipboard, HiOutlineClipboardCheck } from 'react-icons/hi';\n\n// INFO: react-json-view is bundled with --dts-resolve for now (dev dep)\nimport JsonView from '@uiw/react-json-view';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\n/**\n * A custom renderer for the JsonView's copy functionality that provides an accessible\n * and interactive copy button with visual feedback.\n *\n * This component overrides the default copy button implementation from @uiw/react-json-view\n * to fix flickering issues and improve accessibility. It renders a button that:\n * - Shows different icons for copied/not copied states\n * - Supports keyboard navigation\n * - Provides proper ARIA labels\n * - Maintains consistent positioning\n *\n * @returns A JsonView.Copied component with custom render implementation\n */\nconst CopiedRenderer = () => {\n return (\n <JsonView.Copied\n render={(props) => {\n const { style, onClick, className } = props;\n\n // @ts-expect-error this is ok\n\n const isCopied = props['data-copied'] as boolean;\n\n const elmClasses = cn(\n className,\n 'fill-transparent! absolute -right-4 -top-[2px] h-4 w-4 pl-1',\n { 'text-success': isCopied },\n );\n\n const handleKeyDown = (e: KeyboardEvent<HTMLSpanElement>) => {\n if (e.key === 'Enter' || e.key === ' ') {\n onClick?.(e as unknown as MouseEvent<SVGSVGElement>);\n }\n };\n\n return (\n <span\n aria-label={isCopied ? 'Copied to clipboard' : 'Copy to clipboard'}\n className=\"ml-0! h-[1em]! w-0! relative\"\n data-testid=\"copy-button\"\n onClick={(e) => {\n return onClick?.(e as unknown as MouseEvent<SVGSVGElement>);\n }}\n onKeyDown={handleKeyDown}\n role=\"button\"\n style={style}\n tabIndex={0}\n >\n {isCopied ? (\n <HiOutlineClipboardCheck className={elmClasses} />\n ) : (\n <HiOutlineClipboard className={elmClasses} />\n )}\n </span>\n );\n }}\n />\n );\n};\n\nexport default CopiedRenderer;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAwBA,MAAM,uBAAuB;CAC3B,OACE,oBAAC,SAAS,QAAV,EACE,SAAS,UAAU;EACjB,MAAM,EAAE,OAAO,SAAS,cAAc;EAItC,MAAM,WAAW,MAAM;EAEvB,MAAM,aAAa,GACjB,WACA,+DACA,EAAE,gBAAgB,SAAS,CAC7B;EAEA,MAAM,iBAAiB,MAAsC;GAC3D,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,KACjC,UAAU,CAAyC;EAEvD;EAEA,OACE,oBAAC,QAAD;GACE,cAAY,WAAW,wBAAwB;GAC/C,WAAU;GACV,eAAY;GACZ,UAAU,MAAM;IACd,OAAO,UAAU,CAAyC;GAC5D;GACA,WAAW;GACX,MAAK;GACE;GACP,UAAU;aAET,WACC,oBAAC,yBAAD,EAAyB,WAAW,WAAa,CAAA,IAEjD,oBAAC,oBAAD,EAAoB,WAAW,WAAa,CAAA;EAE1C,CAAA;CAEV,EACD,CAAA;AAEL"}
@@ -1,4 +1,3 @@
1
- require("../../_virtual/_rolldown/runtime.cjs");
2
1
  const require_Button = require("../../Button/Button.cjs");
3
2
  let react_jsx_runtime = require("react/jsx-runtime");
4
3
  let react_icons_fa = require("react-icons/fa");
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorRenderer.cjs","names":["FaTimesCircle","Button","FaChevronUp","FaChevronDown"],"sources":["../../../src/Json/subcomponents/ErrorRenderer.tsx"],"sourcesContent":["import { FaChevronDown, FaChevronUp, FaTimesCircle } from 'react-icons/fa';\n\nimport { Button } from '../../Button';\n\ninterface ErrorRendererProps {\n /** The error that occurred during JSON parsing or processing */\n error: unknown;\n /** The original data that caused the error */\n data: string | object;\n /** Controls whether detailed error information is visible */\n showDetails: boolean;\n /** Callback function to toggle the visibility of error details */\n onToggleDetails: () => void;\n}\n\n/**\n * Displays JSON parsing or processing errors in a user-friendly format with expandable details.\n *\n * This component provides a consistent error display with:\n * - A prominent error message\n * - Expandable details section\n * - Original data preview\n * - Accessibility support via ARIA attributes\n */\nconst ErrorRenderer = ({\n error,\n data,\n showDetails,\n onToggleDetails,\n}: ErrorRendererProps) => {\n return (\n <div\n aria-live=\"polite\"\n className=\"mb-4 flex flex-col items-center rounded-lg border border-danger bg-danger-50 p-4 text-sm text-danger\"\n role=\"alert\"\n >\n <div className=\"flex w-full justify-between gap-6\">\n <div className=\"flex items-center\">\n <FaTimesCircle aria-hidden=\"true\" className=\"mr-2\" />\n <span className=\"font-medium\">Failed to parse JSON data</span>\n </div>\n <Button\n aria-controls=\"error-details\"\n aria-expanded={showDetails}\n color=\"danger\"\n onClick={onToggleDetails}\n size=\"sm\"\n variant=\"light\"\n >\n {showDetails ? (\n <>\n <FaChevronUp aria-hidden=\"true\" /> Hide Details\n </>\n ) : (\n <>\n <FaChevronDown aria-hidden=\"true\" /> Show Details\n </>\n )}\n </Button>\n </div>\n {showDetails ? (\n <div className=\"mt-4 w-full text-left\" id=\"error-details\">\n <div>\n <strong>Error:</strong>\n <pre>\n {error instanceof Error\n ? `${error.name}: ${error.message}`\n : 'Unknown error'}\n </pre>\n </div>\n <div className=\"mt-4\">\n <strong>Data:</strong>\n <pre>\n {typeof data !== 'string' ? JSON.stringify(data, null, 2) : data}\n </pre>\n </div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default ErrorRenderer;\n"],"mappings":";;;;;;;;;;;;;;AAwBA,MAAM,iBAAiB,EACrB,OACA,MACA,aACA,sBACwB;CACxB,OACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EACE,aAAU;EACV,WAAU;EACV,MAAK;YAHP,CAKE,iBAAA,GAAA,kBAAA,MAAC,OAAD;GAAK,WAAU;aAAf,CACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;IAAK,WAAU;cAAf,CACE,iBAAA,GAAA,kBAAA,KAACA,eAAAA,eAAD;KAAe,eAAY;KAAO,WAAU;IAAQ,CAAA,GACpD,iBAAA,GAAA,kBAAA,KAAC,QAAD;KAAM,WAAU;eAAc;IAA+B,CAAA,CAC1D;OACL,iBAAA,GAAA,kBAAA,KAACC,eAAAA,SAAD;IACE,iBAAc;IACd,iBAAe;IACf,OAAM;IACN,SAAS;IACT,MAAK;IACL,SAAQ;cAEP,cACC,iBAAA,GAAA,kBAAA,MAAA,kBAAA,UAAA,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,KAACC,eAAAA,aAAD,EAAa,eAAY,OAAQ,CAAA,GAAC,eAClC,EAAA,CAAA,IAEF,iBAAA,GAAA,kBAAA,MAAA,kBAAA,UAAA,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,KAACC,eAAAA,eAAD,EAAe,eAAY,OAAQ,CAAA,GAAC,eACpC,EAAA,CAAA;GAEE,CAAA,CACL;MACJ,cACC,iBAAA,GAAA,kBAAA,MAAC,OAAD;GAAK,WAAU;GAAwB,IAAG;aAA1C,CACE,iBAAA,GAAA,kBAAA,MAAC,OAAD,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,KAAC,UAAD,EAAA,UAAQ,SAAc,CAAA,GACtB,iBAAA,GAAA,kBAAA,KAAC,OAAD,EAAA,UACG,iBAAiB,QACd,GAAG,MAAM,KAAK,IAAI,MAAM,YACxB,gBACD,CAAA,CACF,EAAA,CAAA,GACL,iBAAA,GAAA,kBAAA,MAAC,OAAD;IAAK,WAAU;cAAf,CACE,iBAAA,GAAA,kBAAA,KAAC,UAAD,EAAA,UAAQ,QAAa,CAAA,GACrB,iBAAA,GAAA,kBAAA,KAAC,OAAD,EAAA,UACG,OAAO,SAAS,WAAW,KAAK,UAAU,MAAM,MAAM,CAAC,IAAI,KACzD,CAAA,CACF;KACF;OACH,IACD;;AAET"}
1
+ {"version":3,"file":"ErrorRenderer.cjs","names":["FaTimesCircle","Button","FaChevronUp","FaChevronDown"],"sources":["../../../src/Json/subcomponents/ErrorRenderer.tsx"],"sourcesContent":["import { FaChevronDown, FaChevronUp, FaTimesCircle } from 'react-icons/fa';\n\nimport { Button } from '../../Button';\n\ninterface ErrorRendererProps {\n /** The error that occurred during JSON parsing or processing */\n error: unknown;\n /** The original data that caused the error */\n data: string | object;\n /** Controls whether detailed error information is visible */\n showDetails: boolean;\n /** Callback function to toggle the visibility of error details */\n onToggleDetails: () => void;\n}\n\n/**\n * Displays JSON parsing or processing errors in a user-friendly format with expandable details.\n *\n * This component provides a consistent error display with:\n * - A prominent error message\n * - Expandable details section\n * - Original data preview\n * - Accessibility support via ARIA attributes\n */\nconst ErrorRenderer = ({\n error,\n data,\n showDetails,\n onToggleDetails,\n}: ErrorRendererProps) => {\n return (\n <div\n aria-live=\"polite\"\n className=\"mb-4 flex flex-col items-center rounded-lg border border-danger bg-danger-50 p-4 text-sm text-danger\"\n role=\"alert\"\n >\n <div className=\"flex w-full justify-between gap-6\">\n <div className=\"flex items-center\">\n <FaTimesCircle aria-hidden=\"true\" className=\"mr-2\" />\n <span className=\"font-medium\">Failed to parse JSON data</span>\n </div>\n <Button\n aria-controls=\"error-details\"\n aria-expanded={showDetails}\n color=\"danger\"\n onClick={onToggleDetails}\n size=\"sm\"\n variant=\"light\"\n >\n {showDetails ? (\n <>\n <FaChevronUp aria-hidden=\"true\" /> Hide Details\n </>\n ) : (\n <>\n <FaChevronDown aria-hidden=\"true\" /> Show Details\n </>\n )}\n </Button>\n </div>\n {showDetails ? (\n <div className=\"mt-4 w-full text-left\" id=\"error-details\">\n <div>\n <strong>Error:</strong>\n <pre>\n {error instanceof Error\n ? `${error.name}: ${error.message}`\n : 'Unknown error'}\n </pre>\n </div>\n <div className=\"mt-4\">\n <strong>Data:</strong>\n <pre>\n {typeof data !== 'string' ? JSON.stringify(data, null, 2) : data}\n </pre>\n </div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default ErrorRenderer;\n"],"mappings":";;;;;;;;;;;;;AAwBA,MAAM,iBAAiB,EACrB,OACA,MACA,aACA,sBACwB;CACxB,OACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EACE,aAAU;EACV,WAAU;EACV,MAAK;YAHP,CAKE,iBAAA,GAAA,kBAAA,MAAC,OAAD;GAAK,WAAU;aAAf,CACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;IAAK,WAAU;cAAf,CACE,iBAAA,GAAA,kBAAA,KAACA,eAAAA,eAAD;KAAe,eAAY;KAAO,WAAU;IAAQ,CAAA,GACpD,iBAAA,GAAA,kBAAA,KAAC,QAAD;KAAM,WAAU;eAAc;IAA+B,CAAA,CAC1D;OACL,iBAAA,GAAA,kBAAA,KAACC,eAAAA,SAAD;IACE,iBAAc;IACd,iBAAe;IACf,OAAM;IACN,SAAS;IACT,MAAK;IACL,SAAQ;cAEP,cACC,iBAAA,GAAA,kBAAA,MAAA,kBAAA,UAAA,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,KAACC,eAAAA,aAAD,EAAa,eAAY,OAAQ,CAAA,GAAC,eAClC,EAAA,CAAA,IAEF,iBAAA,GAAA,kBAAA,MAAA,kBAAA,UAAA,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,KAACC,eAAAA,eAAD,EAAe,eAAY,OAAQ,CAAA,GAAC,eACpC,EAAA,CAAA;GAEE,CAAA,CACL;MACJ,cACC,iBAAA,GAAA,kBAAA,MAAC,OAAD;GAAK,WAAU;GAAwB,IAAG;aAA1C,CACE,iBAAA,GAAA,kBAAA,MAAC,OAAD,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,KAAC,UAAD,EAAA,UAAQ,SAAc,CAAA,GACtB,iBAAA,GAAA,kBAAA,KAAC,OAAD,EAAA,UACG,iBAAiB,QACd,GAAG,MAAM,KAAK,IAAI,MAAM,YACxB,gBACD,CAAA,CACF,EAAA,CAAA,GACL,iBAAA,GAAA,kBAAA,MAAC,OAAD;IAAK,WAAU;cAAf,CACE,iBAAA,GAAA,kBAAA,KAAC,UAAD,EAAA,UAAQ,QAAa,CAAA,GACrB,iBAAA,GAAA,kBAAA,KAAC,OAAD,EAAA,UACG,OAAO,SAAS,WAAW,KAAK,UAAU,MAAM,MAAM,CAAC,IAAI,KACzD,CAAA,CACF;KACF;OACH,IACD;;AAET"}
@@ -1,4 +1,3 @@
1
- require("../../_virtual/_rolldown/runtime.cjs");
2
1
  const require_index = require("../../node_modules/.pnpm/@uiw_react-json-view@2.0.0-alpha.43_@babel_runtime@7.29.2_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@uiw/react-json-view/esm/index.cjs");
3
2
  let react_jsx_runtime = require("react/jsx-runtime");
4
3
  //#region src/Json/subcomponents/NullRenderer.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"NullRenderer.cjs","names":["JsonView"],"sources":["../../../src/Json/subcomponents/NullRenderer.tsx"],"sourcesContent":["/* eslint-disable import-x/no-extraneous-dependencies */\n\n// INFO: react-json-view is bundled with --dts-resolve for now (dev dep)\nimport JsonView from '@uiw/react-json-view';\n\n/**\n * A custom renderer for JSON null values in the JsonView component.\n *\n * This component provides a consistent way to render null values across the JSON viewer.\n * It can be customized to handle null values differently from the default representation,\n * such as using different styling or displaying alternative text.\n */\nconst NullRenderer = () => {\n return (\n <JsonView.Null\n render={() => {\n return (\n <span className=\"rounded bg-warning-100 px-1 text-xs text-warning-700\">\n null\n </span>\n );\n }}\n />\n );\n};\n\nexport default NullRenderer;\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,qBAAqB;CACzB,OACE,iBAAA,GAAA,kBAAA,KAACA,cAAAA,QAAS,MAAV,EACE,cAAc;EACZ,OACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;GAAM,WAAU;aAAuD;EAEjE,CAAA;CAEV,EACD,CAAA;AAEL"}
1
+ {"version":3,"file":"NullRenderer.cjs","names":["JsonView"],"sources":["../../../src/Json/subcomponents/NullRenderer.tsx"],"sourcesContent":["/* eslint-disable import-x/no-extraneous-dependencies */\n\n// INFO: react-json-view is bundled with --dts-resolve for now (dev dep)\nimport JsonView from '@uiw/react-json-view';\n\n/**\n * A custom renderer for JSON null values in the JsonView component.\n *\n * This component provides a consistent way to render null values across the JSON viewer.\n * It can be customized to handle null values differently from the default representation,\n * such as using different styling or displaying alternative text.\n */\nconst NullRenderer = () => {\n return (\n <JsonView.Null\n render={() => {\n return (\n <span className=\"rounded bg-warning-100 px-1 text-xs text-warning-700\">\n null\n </span>\n );\n }}\n />\n );\n};\n\nexport default NullRenderer;\n"],"mappings":";;;;;;;;;;AAYA,MAAM,qBAAqB;CACzB,OACE,iBAAA,GAAA,kBAAA,KAACA,cAAAA,QAAS,MAAV,EACE,cAAc;EACZ,OACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;GAAM,WAAU;aAAuD;EAEjE,CAAA;CAEV,EACD,CAAA;AAEL"}
@@ -1,4 +1,3 @@
1
- require("../_virtual/_rolldown/runtime.cjs");
2
1
  let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
3
2
  let react_jsx_runtime = require("react/jsx-runtime");
4
3
  let _heroui_theme = require("@heroui/theme");
@@ -1 +1 @@
1
- {"version":3,"file":"Label.cjs","names":["heroLabelVariants","HeroLabel"],"sources":["../../src/Label/Label.tsx"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ChipProps as HeroLabelProps } from '@heroui/chip';\nimport type { ReactNode } from 'react';\n\nimport { Chip as HeroLabel } from '@heroui/chip';\nimport { chip as heroLabelVariants } from '@heroui/theme';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\n// label variants\nexport const labelVariants = tv({\n slots: {\n base: '',\n closeButton: '',\n content: '',\n dot: '',\n icon: '',\n },\n variants: {\n color: {\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/chip.ts\n info: {\n dot: 'bg-info',\n },\n ...heroLabelVariants.variants.color,\n },\n isIconOnly: {\n true: {\n content: 'px-1',\n },\n false: {\n content: 'flex items-center gap-2',\n },\n },\n hasEndContent: {\n true: {\n base: 'pr-2',\n },\n },\n variant: heroLabelVariants.variants.variant,\n },\n defaultVariants: heroLabelVariants.defaultVariants,\n compoundVariants: [\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/chip.ts\n ...heroLabelVariants.compoundVariants,\n // solid / color info\n {\n variant: 'solid',\n color: 'info',\n class: {\n base: 'bg-info text-info-foreground',\n },\n },\n // bordered / color info\n {\n variant: 'bordered',\n color: 'info',\n class: {\n base: 'border-info text-info',\n },\n },\n // light / color info\n {\n variant: 'light',\n color: 'info',\n class: {\n base: 'text-info',\n },\n },\n // flat / color info\n {\n variant: 'flat',\n color: 'info',\n class: {\n base: 'bg-info/20 text-info-600',\n },\n },\n // faded / color info\n {\n variant: 'faded',\n color: 'info',\n class: {\n base: 'border-default text-info',\n },\n },\n ],\n});\n\ntype VariantProps = TVProps<typeof labelVariants>;\ntype ClassName = TVClassName<typeof labelVariants>;\n\nexport interface LabelProps extends VariantProps {\n /** content of the label */\n children?: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** color of the label */\n color?: VariantProps['color'];\n /** element to be rendered in the right side of the label */\n endContent?: HeroLabelProps['endContent'];\n /** optional label icon, when only icon provided without children and endContent */\n icon?: ReactNode;\n /** add close button to endContent */\n onClose?: HeroLabelProps['onClose'];\n /** radius of the label */\n radius?: HeroLabelProps['radius'];\n /** size of the label */\n size?: HeroLabelProps['size'];\n /** style variant of the label */\n variant?: 'solid' | 'bordered' | 'light' | 'flat' | 'faded' | 'dot';\n}\n\n/**\n * Label component based on [HeroUI Chip](https://www.heroui.com//docs/components/chip)\n */\nconst Label = ({\n children = undefined,\n className: _className = undefined,\n color = 'default',\n endContent = undefined,\n icon = undefined,\n onClose = undefined,\n radius = 'full',\n size = 'md',\n variant = 'solid',\n}: LabelProps) => {\n // determine variants based on props\n const isIconOnly = !!icon && !children && !endContent;\n const hasEndContent = !!endContent;\n\n // classNames from slots\n const variants = labelVariants({ color, isIconOnly, hasEndContent, variant });\n const classNames = variantsToClassNames(variants, _className, 'base');\n\n return (\n <HeroLabel\n classNames={classNames}\n endContent={endContent}\n onClose={onClose}\n radius={radius}\n size={size}\n variant={variant}\n >\n {icon ? <span className={classNames.icon}>{icon}</span> : null}\n {children}\n </HeroLabel>\n );\n};\n\nexport default Label;\n"],"mappings":";;;;;;AAUA,MAAa,iBAAA,GAAA,uBAAA,IAAmB;CAC9B,OAAO;EACL,MAAM;EACN,aAAa;EACb,SAAS;EACT,KAAK;EACL,MAAM;CACR;CACA,UAAU;EACR,OAAO;GAEL,MAAM,EACJ,KAAK,UACP;GACA,GAAGA,cAAAA,KAAkB,SAAS;EAChC;EACA,YAAY;GACV,MAAM,EACJ,SAAS,OACX;GACA,OAAO,EACL,SAAS,0BACX;EACF;EACA,eAAe,EACb,MAAM,EACJ,MAAM,OACR,EACF;EACA,SAASA,cAAAA,KAAkB,SAAS;CACtC;CACA,iBAAiBA,cAAAA,KAAkB;CACnC,kBAAkB;EAEhB,GAAGA,cAAAA,KAAkB;EAErB;GACE,SAAS;GACT,OAAO;GACP,OAAO,EACL,MAAM,+BACR;EACF;EAEA;GACE,SAAS;GACT,OAAO;GACP,OAAO,EACL,MAAM,wBACR;EACF;EAEA;GACE,SAAS;GACT,OAAO;GACP,OAAO,EACL,MAAM,YACR;EACF;EAEA;GACE,SAAS;GACT,OAAO;GACP,OAAO,EACL,MAAM,2BACR;EACF;EAEA;GACE,SAAS;GACT,OAAO;GACP,OAAO,EACL,MAAM,2BACR;EACF;CACF;AACF,CAAC;;;;AA6BD,MAAM,SAAS,EACb,WAAW,KAAA,GACX,WAAW,aAAa,KAAA,GACxB,QAAQ,WACR,aAAa,KAAA,GACb,OAAO,KAAA,GACP,UAAU,KAAA,GACV,SAAS,QACT,OAAO,MACP,UAAU,cACM;CAOhB,MAAM,cAAA,GAAA,uBAAA,sBADW,cAAc;EAAE;EAAO,YAJrB,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC;EAIS,eAAA,CAH7B,CAAC;EAG2C;CAAQ,CAC5B,GAAG,YAAY,MAAM;CAEpE,OACE,iBAAA,GAAA,kBAAA,MAACC,aAAAA,MAAD;EACc;EACA;EACH;EACD;EACF;EACG;YANX,CAQG,OAAO,iBAAA,GAAA,kBAAA,KAAC,QAAD;GAAM,WAAW,WAAW;aAAO;EAAW,CAAA,IAAI,MACzD,QACQ;;AAEf"}
1
+ {"version":3,"file":"Label.cjs","names":["heroLabelVariants","HeroLabel"],"sources":["../../src/Label/Label.tsx"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ChipProps as HeroLabelProps } from '@heroui/chip';\nimport type { ReactNode } from 'react';\n\nimport { Chip as HeroLabel } from '@heroui/chip';\nimport { chip as heroLabelVariants } from '@heroui/theme';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\n// label variants\nexport const labelVariants = tv({\n slots: {\n base: '',\n closeButton: '',\n content: '',\n dot: '',\n icon: '',\n },\n variants: {\n color: {\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/chip.ts\n info: {\n dot: 'bg-info',\n },\n ...heroLabelVariants.variants.color,\n },\n isIconOnly: {\n true: {\n content: 'px-1',\n },\n false: {\n content: 'flex items-center gap-2',\n },\n },\n hasEndContent: {\n true: {\n base: 'pr-2',\n },\n },\n variant: heroLabelVariants.variants.variant,\n },\n defaultVariants: heroLabelVariants.defaultVariants,\n compoundVariants: [\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/chip.ts\n ...heroLabelVariants.compoundVariants,\n // solid / color info\n {\n variant: 'solid',\n color: 'info',\n class: {\n base: 'bg-info text-info-foreground',\n },\n },\n // bordered / color info\n {\n variant: 'bordered',\n color: 'info',\n class: {\n base: 'border-info text-info',\n },\n },\n // light / color info\n {\n variant: 'light',\n color: 'info',\n class: {\n base: 'text-info',\n },\n },\n // flat / color info\n {\n variant: 'flat',\n color: 'info',\n class: {\n base: 'bg-info/20 text-info-600',\n },\n },\n // faded / color info\n {\n variant: 'faded',\n color: 'info',\n class: {\n base: 'border-default text-info',\n },\n },\n ],\n});\n\ntype VariantProps = TVProps<typeof labelVariants>;\ntype ClassName = TVClassName<typeof labelVariants>;\n\nexport interface LabelProps extends VariantProps {\n /** content of the label */\n children?: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** color of the label */\n color?: VariantProps['color'];\n /** element to be rendered in the right side of the label */\n endContent?: HeroLabelProps['endContent'];\n /** optional label icon, when only icon provided without children and endContent */\n icon?: ReactNode;\n /** add close button to endContent */\n onClose?: HeroLabelProps['onClose'];\n /** radius of the label */\n radius?: HeroLabelProps['radius'];\n /** size of the label */\n size?: HeroLabelProps['size'];\n /** style variant of the label */\n variant?: 'solid' | 'bordered' | 'light' | 'flat' | 'faded' | 'dot';\n}\n\n/**\n * Label component based on [HeroUI Chip](https://www.heroui.com//docs/components/chip)\n */\nconst Label = ({\n children = undefined,\n className: _className = undefined,\n color = 'default',\n endContent = undefined,\n icon = undefined,\n onClose = undefined,\n radius = 'full',\n size = 'md',\n variant = 'solid',\n}: LabelProps) => {\n // determine variants based on props\n const isIconOnly = !!icon && !children && !endContent;\n const hasEndContent = !!endContent;\n\n // classNames from slots\n const variants = labelVariants({ color, isIconOnly, hasEndContent, variant });\n const classNames = variantsToClassNames(variants, _className, 'base');\n\n return (\n <HeroLabel\n classNames={classNames}\n endContent={endContent}\n onClose={onClose}\n radius={radius}\n size={size}\n variant={variant}\n >\n {icon ? <span className={classNames.icon}>{icon}</span> : null}\n {children}\n </HeroLabel>\n );\n};\n\nexport default Label;\n"],"mappings":";;;;;AAUA,MAAa,iBAAA,GAAA,uBAAA,IAAmB;CAC9B,OAAO;EACL,MAAM;EACN,aAAa;EACb,SAAS;EACT,KAAK;EACL,MAAM;CACR;CACA,UAAU;EACR,OAAO;GAEL,MAAM,EACJ,KAAK,UACP;GACA,GAAGA,cAAAA,KAAkB,SAAS;EAChC;EACA,YAAY;GACV,MAAM,EACJ,SAAS,OACX;GACA,OAAO,EACL,SAAS,0BACX;EACF;EACA,eAAe,EACb,MAAM,EACJ,MAAM,OACR,EACF;EACA,SAASA,cAAAA,KAAkB,SAAS;CACtC;CACA,iBAAiBA,cAAAA,KAAkB;CACnC,kBAAkB;EAEhB,GAAGA,cAAAA,KAAkB;EAErB;GACE,SAAS;GACT,OAAO;GACP,OAAO,EACL,MAAM,+BACR;EACF;EAEA;GACE,SAAS;GACT,OAAO;GACP,OAAO,EACL,MAAM,wBACR;EACF;EAEA;GACE,SAAS;GACT,OAAO;GACP,OAAO,EACL,MAAM,YACR;EACF;EAEA;GACE,SAAS;GACT,OAAO;GACP,OAAO,EACL,MAAM,2BACR;EACF;EAEA;GACE,SAAS;GACT,OAAO;GACP,OAAO,EACL,MAAM,2BACR;EACF;CACF;AACF,CAAC;;;;AA6BD,MAAM,SAAS,EACb,WAAW,KAAA,GACX,WAAW,aAAa,KAAA,GACxB,QAAQ,WACR,aAAa,KAAA,GACb,OAAO,KAAA,GACP,UAAU,KAAA,GACV,SAAS,QACT,OAAO,MACP,UAAU,cACM;CAOhB,MAAM,cAAA,GAAA,uBAAA,sBADW,cAAc;EAAE;EAAO,YAJrB,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC;EAIS,eAAA,CAH7B,CAAC;EAG2C;CAAQ,CAC5B,GAAG,YAAY,MAAM;CAEpE,OACE,iBAAA,GAAA,kBAAA,MAACC,aAAAA,MAAD;EACc;EACA;EACH;EACD;EACF;EACG;YANX,CAQG,OAAO,iBAAA,GAAA,kBAAA,KAAC,QAAD;GAAM,WAAW,WAAW;aAAO;EAAW,CAAA,IAAI,MACzD,QACQ;;AAEf"}