@intlayer/design-system 5.5.11 → 5.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +1 -1
  2. package/dist/.vite/manifest.json +38 -10
  3. package/dist/components/Container/index.cjs +2 -1
  4. package/dist/components/Container/index.cjs.map +1 -1
  5. package/dist/components/Container/index.d.ts +2 -3
  6. package/dist/components/Container/index.d.ts.map +1 -1
  7. package/dist/components/Container/index.mjs +3 -2
  8. package/dist/components/Container/index.mjs.map +1 -1
  9. package/dist/components/{IDE/CopyButton.cjs → CopyButton/index.cjs} +6 -5
  10. package/dist/components/CopyButton/index.cjs.map +1 -0
  11. package/dist/components/{IDE/CopyButton.d.ts → CopyButton/index.d.ts} +3 -2
  12. package/dist/components/CopyButton/index.d.ts.map +1 -0
  13. package/dist/components/{IDE/CopyButton.mjs → CopyButton/index.mjs} +6 -5
  14. package/dist/components/CopyButton/index.mjs.map +1 -0
  15. package/dist/components/IDE/Code.cjs +3 -3
  16. package/dist/components/IDE/Code.cjs.map +1 -1
  17. package/dist/components/IDE/Code.d.ts +1 -1
  18. package/dist/components/IDE/Code.d.ts.map +1 -1
  19. package/dist/components/IDE/Code.mjs +3 -3
  20. package/dist/components/IDE/Code.mjs.map +1 -1
  21. package/dist/components/IDE/CopyCode.cjs +28 -0
  22. package/dist/components/IDE/CopyCode.cjs.map +1 -0
  23. package/dist/components/IDE/CopyCode.d.ts +7 -0
  24. package/dist/components/IDE/CopyCode.d.ts.map +1 -0
  25. package/dist/components/IDE/CopyCode.mjs +28 -0
  26. package/dist/components/IDE/CopyCode.mjs.map +1 -0
  27. package/dist/components/IDE/MonacoCode.cjs +2 -2
  28. package/dist/components/IDE/MonacoCode.cjs.map +1 -1
  29. package/dist/components/IDE/MonacoCode.mjs +1 -1
  30. package/dist/components/IDE/MonacoCode.mjs.map +1 -1
  31. package/dist/components/IDE/code.content.cjs +39 -0
  32. package/dist/components/IDE/code.content.cjs.map +1 -0
  33. package/dist/components/IDE/code.content.d.ts +73 -0
  34. package/dist/components/IDE/code.content.d.ts.map +1 -0
  35. package/dist/components/IDE/code.content.mjs +40 -0
  36. package/dist/components/IDE/code.content.mjs.map +1 -0
  37. package/dist/components/IDE/copyCode.content.cjs +39 -0
  38. package/dist/components/IDE/copyCode.content.cjs.map +1 -0
  39. package/dist/components/IDE/copyCode.content.d.ts +73 -0
  40. package/dist/components/IDE/copyCode.content.d.ts.map +1 -0
  41. package/dist/components/IDE/copyCode.content.mjs +40 -0
  42. package/dist/components/IDE/copyCode.content.mjs.map +1 -0
  43. package/dist/components/Popover/index.cjs +59 -15
  44. package/dist/components/Popover/index.cjs.map +1 -1
  45. package/dist/components/Popover/index.d.ts +32 -6
  46. package/dist/components/Popover/index.d.ts.map +1 -1
  47. package/dist/components/Popover/index.mjs +60 -16
  48. package/dist/components/Popover/index.mjs.map +1 -1
  49. package/dist/components/SocialNetworks/index.cjs +1 -1
  50. package/dist/components/SocialNetworks/index.cjs.map +1 -1
  51. package/dist/components/SocialNetworks/index.mjs +1 -1
  52. package/dist/components/SocialNetworks/index.mjs.map +1 -1
  53. package/dist/components/index.cjs +3 -0
  54. package/dist/components/index.cjs.map +1 -1
  55. package/dist/components/index.d.ts +1 -0
  56. package/dist/components/index.d.ts.map +1 -1
  57. package/dist/components/index.mjs +4 -1
  58. package/dist/components/index.mjs.map +1 -1
  59. package/dist/tailwind.css +1 -1
  60. package/package.json +17 -17
  61. package/dist/components/IDE/CopyButton.cjs.map +0 -1
  62. package/dist/components/IDE/CopyButton.d.ts.map +0 -1
  63. package/dist/components/IDE/CopyButton.mjs.map +0 -1
package/README.md CHANGED
@@ -33,7 +33,7 @@
33
33
  <a href="https://www.facebook.com/intlayer" target="blank"><img align="center"
34
34
  src="https://img.shields.io/badge/facebook-4267B2.svg?style=for-the-badge&logo=facebook&logoColor=white"
35
35
  alt="Intlayer Facebook" height="30"/></a>
36
- <a href="https://www.instagram.com/intlayer_org/" target="blank"><img align="center"
36
+ <a href="https://www.instagram.com/intlayer/" target="blank"><img align="center"
37
37
  src="https://img.shields.io/badge/instagram-%23E4405F.svg?style=for-the-badge&logo=Instagram&logoColor=white"
38
38
  alt="Intlayer Instagram" height="30"/></a>
39
39
  <a href="https://x.com/Intlayer183096" target="blank"><img align="center"
@@ -736,6 +736,16 @@
736
736
  "src/components/ContentSelector/ContentSelector.tsx"
737
737
  ]
738
738
  },
739
+ "src/components/CopyButton/index.tsx": {
740
+ "file": "components/CopyButton/index.cjs",
741
+ "name": "components/CopyButton/index",
742
+ "src": "src/components/CopyButton/index.tsx",
743
+ "isEntry": true,
744
+ "imports": [
745
+ "src/components/Button/Button.tsx",
746
+ "src/components/IDE/CopyButton.content.ts"
747
+ ]
748
+ },
739
749
  "src/components/CopyToClipboard/index.tsx": {
740
750
  "file": "components/CopyToClipboard/index.cjs",
741
751
  "name": "components/CopyToClipboard/index",
@@ -1633,7 +1643,7 @@
1633
1643
  "src/components/IDE/CodeConditionalRenderer.tsx",
1634
1644
  "src/components/IDE/CodeFormatSelector.tsx",
1635
1645
  "src/components/IDE/ContentDeclarationFormatSelector.tsx",
1636
- "src/components/IDE/CopyButton.tsx",
1646
+ "src/components/IDE/CopyCode.tsx",
1637
1647
  "src/components/IDE/PackageManagerSelector.tsx"
1638
1648
  ]
1639
1649
  },
@@ -1704,14 +1714,15 @@
1704
1714
  "src": "src/components/IDE/CopyButton.content.ts",
1705
1715
  "isEntry": true
1706
1716
  },
1707
- "src/components/IDE/CopyButton.tsx": {
1708
- "file": "components/IDE/CopyButton.cjs",
1709
- "name": "components/IDE/CopyButton",
1710
- "src": "src/components/IDE/CopyButton.tsx",
1717
+ "src/components/IDE/CopyCode.tsx": {
1718
+ "file": "components/IDE/CopyCode.cjs",
1719
+ "name": "components/IDE/CopyCode",
1720
+ "src": "src/components/IDE/CopyCode.tsx",
1711
1721
  "isEntry": true,
1712
1722
  "imports": [
1713
- "src/components/Button/Button.tsx",
1714
- "src/components/IDE/CopyButton.content.ts"
1723
+ "src/components/CopyButton/index.tsx",
1724
+ "src/components/Popover/index.tsx",
1725
+ "src/components/IDE/copyCode.content.ts"
1715
1726
  ]
1716
1727
  },
1717
1728
  "src/components/IDE/FileList.tsx": {
@@ -1764,8 +1775,8 @@
1764
1775
  "isEntry": true,
1765
1776
  "imports": [
1766
1777
  "src/utils/cn.ts",
1767
- "src/components/Loader/index.tsx",
1768
- "src/components/IDE/CopyButton.tsx"
1778
+ "src/components/CopyButton/index.tsx",
1779
+ "src/components/Loader/index.tsx"
1769
1780
  ]
1770
1781
  },
1771
1782
  "src/components/IDE/PackageManagerSelector.tsx": {
@@ -1779,6 +1790,18 @@
1779
1790
  "src/components/IDE/CodeContext.tsx"
1780
1791
  ]
1781
1792
  },
1793
+ "src/components/IDE/code.content.ts": {
1794
+ "file": "components/IDE/code.content.cjs",
1795
+ "name": "components/IDE/code.content",
1796
+ "src": "src/components/IDE/code.content.ts",
1797
+ "isEntry": true
1798
+ },
1799
+ "src/components/IDE/copyCode.content.ts": {
1800
+ "file": "components/IDE/copyCode.content.cjs",
1801
+ "name": "components/IDE/copyCode.content",
1802
+ "src": "src/components/IDE/copyCode.content.ts",
1803
+ "isEntry": true
1804
+ },
1782
1805
  "src/components/IDE/createFileTree.ts": {
1783
1806
  "file": "components/IDE/createFileTree.cjs",
1784
1807
  "name": "components/IDE/createFileTree",
@@ -2162,7 +2185,11 @@
2162
2185
  "file": "components/Popover/index.cjs",
2163
2186
  "name": "components/Popover/index",
2164
2187
  "src": "src/components/Popover/index.tsx",
2165
- "isEntry": true
2188
+ "isEntry": true,
2189
+ "imports": [
2190
+ "src/utils/cn.ts",
2191
+ "src/components/Container/index.tsx"
2192
+ ]
2166
2193
  },
2167
2194
  "src/components/PressableSpan/PressableSpan.tsx": {
2168
2195
  "file": "components/PressableSpan/PressableSpan.cjs",
@@ -2512,6 +2539,7 @@
2512
2539
  "src/components/Command/index.tsx",
2513
2540
  "src/components/Container/index.tsx",
2514
2541
  "src/components/ContentSelector/ContentSelector.tsx",
2542
+ "src/components/CopyButton/index.tsx",
2515
2543
  "src/components/CopyToClipboard/index.tsx",
2516
2544
  "src/components/DictionaryEditor/DictionaryEditor.tsx",
2517
2545
  "src/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.tsx",
@@ -17,7 +17,7 @@ const containerVariants = classVarianceAuthority.cva("flex text-text flex-col ba
17
17
  },
18
18
  transparency: {
19
19
  none: "bg-card",
20
- sm: "bg-card/90",
20
+ sm: "bg-card/95",
21
21
  md: "bg-card/70",
22
22
  lg: "bg-card/40",
23
23
  xl: "bg-card/20",
@@ -104,4 +104,5 @@ const Container = ({
104
104
  }
105
105
  );
106
106
  exports.Container = Container;
107
+ exports.containerVariants = containerVariants;
107
108
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/components/Container/index.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport {\n type PropsWithChildren,\n type HTMLAttributes,\n type FC,\n type DetailedHTMLProps,\n} from 'react';\nimport { cn } from '../../utils/cn';\n\nconst containerVariants = cva('flex text-text flex-col backdrop-blur', {\n variants: {\n roundedSize: {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n '2xl': 'rounded-2xl',\n '3xl': 'rounded-3xl',\n full: 'rounded-full',\n },\n transparency: {\n none: 'bg-card',\n sm: 'bg-card/90',\n md: 'bg-card/70',\n lg: 'bg-card/40',\n xl: 'bg-card/20',\n full: '',\n },\n padding: {\n none: 'p-0',\n sm: 'p-1',\n md: 'p-2',\n lg: 'p-3',\n xl: 'p-4',\n },\n separator: {\n without: '',\n x: 'divide-x divide-dashed divide-text/20',\n y: 'divide-y divide-dashed divide-text/20',\n both: 'divide-x divide-y divide-dashed divide-text/20',\n },\n border: {\n none: '',\n with: 'border-[1.5px]',\n },\n borderColor: {\n primary: 'border-primary',\n secondary: 'border-secondary',\n neutral: 'border-neutral',\n text: 'border-text ',\n error: 'border-error',\n warning: 'border-warning',\n success: 'border-success',\n },\n background: {\n none: 'bg-inherit',\n hoverable:\n '!bg-opacity-5 backdrop-blur-0 hover:!bg-opacity-10 hover:backdrop-blur focus:!bg-opacity-10 focus:backdrop-blur aria-selected:!bg-opacity-15 aria-selected:backdrop-blur',\n with: '',\n },\n gap: {\n none: 'gap-0',\n sm: 'gap-1',\n md: 'gap-3',\n lg: 'gap-5',\n xl: 'gap-8',\n '2xl': 'gap-10',\n },\n },\n defaultVariants: {\n roundedSize: 'md',\n border: 'none',\n borderColor: 'text',\n transparency: 'md',\n padding: 'none',\n separator: 'without',\n gap: 'none',\n },\n});\n\nexport type ContainerProps = PropsWithChildren<\n Omit<VariantProps<typeof containerVariants>, 'border'>\n> &\n DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {\n border?: boolean;\n };\n\nexport const Container: FC<ContainerProps> = ({\n children,\n roundedSize,\n padding,\n transparency,\n separator,\n className,\n border,\n borderColor,\n background,\n ...props\n}) => (\n <div\n className={cn(\n containerVariants({\n roundedSize,\n transparency,\n padding,\n separator,\n border:\n typeof border === 'boolean' ? (border ? 'with' : 'none') : undefined,\n background,\n borderColor,\n className,\n })\n )}\n {...props}\n >\n {children}\n </div>\n);\n"],"names":["cva","jsx","cn"],"mappings":";;;;;AASA,MAAM,oBAAoBA,2BAAI,yCAAyC;AAAA,EACrE,UAAU;AAAA,IACR,aAAa;AAAA,MACX,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,OAAO;AAAA,MACP,MAAM;AAAA,IACR;AAAA,IACA,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,MAAM;AAAA,IACR;AAAA,IAC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
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/Container/index.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport {\n type DetailedHTMLProps,\n type FC,\n type HTMLAttributes,\n type PropsWithChildren,\n} from 'react';\nimport { cn } from '../../utils/cn';\n\nexport const containerVariants = cva('flex text-text flex-col backdrop-blur', {\n variants: {\n roundedSize: {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n '2xl': 'rounded-2xl',\n '3xl': 'rounded-3xl',\n full: 'rounded-full',\n },\n transparency: {\n none: 'bg-card',\n sm: 'bg-card/95',\n md: 'bg-card/70',\n lg: 'bg-card/40',\n xl: 'bg-card/20',\n full: '',\n },\n padding: {\n none: 'p-0',\n sm: 'p-1',\n md: 'p-2',\n lg: 'p-3',\n xl: 'p-4',\n },\n separator: {\n without: '',\n x: 'divide-x divide-dashed divide-text/20',\n y: 'divide-y divide-dashed divide-text/20',\n both: 'divide-x divide-y divide-dashed divide-text/20',\n },\n border: {\n none: '',\n with: 'border-[1.5px]',\n },\n borderColor: {\n primary: 'border-primary',\n secondary: 'border-secondary',\n neutral: 'border-neutral',\n text: 'border-text ',\n error: 'border-error',\n warning: 'border-warning',\n success: 'border-success',\n },\n background: {\n none: 'bg-inherit',\n hoverable:\n '!bg-opacity-5 backdrop-blur-0 hover:!bg-opacity-10 hover:backdrop-blur focus:!bg-opacity-10 focus:backdrop-blur aria-selected:!bg-opacity-15 aria-selected:backdrop-blur',\n with: '',\n },\n gap: {\n none: 'gap-0',\n sm: 'gap-1',\n md: 'gap-3',\n lg: 'gap-5',\n xl: 'gap-8',\n '2xl': 'gap-10',\n },\n },\n defaultVariants: {\n roundedSize: 'md',\n border: 'none',\n borderColor: 'text',\n transparency: 'md',\n padding: 'none',\n separator: 'without',\n gap: 'none',\n },\n});\n\nexport type ContainerProps = PropsWithChildren<\n Omit<VariantProps<typeof containerVariants>, 'border'>\n> &\n DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {\n border?: boolean;\n };\n\nexport const Container: FC<ContainerProps> = ({\n children,\n roundedSize,\n padding,\n transparency,\n separator,\n className,\n border,\n borderColor,\n background,\n ...props\n}) => (\n <div\n className={cn(\n containerVariants({\n roundedSize,\n transparency,\n padding,\n separator,\n border:\n typeof border === 'boolean' ? (border ? 'with' : 'none') : undefined,\n background,\n borderColor,\n className,\n })\n )}\n {...props}\n >\n {children}\n </div>\n);\n"],"names":["cva","jsx","cn"],"mappings":";;;;;AASa,MAAA,oBAAoBA,2BAAI,yCAAyC;AAAA,EAC5E,UAAU;AAAA,IACR,aAAa;AAAA,MACX,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,OAAO;AAAA,MACP,MAAM;AAAA,IACR;AAAA,IACA,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,MAAM;AAAA,IACR;AAAA,IACA,SAAS;AAAA,MACP,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAAA,IACA,WAAW;AAAA,MACT,SAAS;AAAA,MACT,GAAG;AAAA,MACH,GAAG;AAAA,MACH,MAAM;AAAA,IACR;AAAA,IACA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,IACR;AAAA,IACA,aAAa;AAAA,MACX,SAAS;AAAA,MACT,WAAW;AAAA,MACX,SAAS;AAAA,MACT,MAAM;AAAA,MACN,OAAO;AAAA,MACP,SAAS;AAAA,MACT,SAAS;AAAA,IACX;AAAA,IACA,YAAY;AAAA,MACV,MAAM;AAAA,MACN,WACE;AAAA,MACF,MAAM;AAAA,IACR;AAAA,IACA,KAAK;AAAA,MACH,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,OAAO;AAAA,IAAA;AAAA,EAEX;AAAA,EACA,iBAAiB;AAAA,IACf,aAAa;AAAA,IACb,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,cAAc;AAAA,IACd,SAAS;AAAA,IACT,WAAW;AAAA,IACX,KAAK;AAAA,EAAA;AAET,CAAC;AASM,MAAM,YAAgC,CAAC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACEC,2BAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,SAAA;AAAA,MACT,kBAAkB;AAAA,QAChB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,QACE,OAAO,WAAW,YAAa,SAAS,SAAS,SAAU;AAAA,QAC7D;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAA;AAAA,IACH;AAAA,IACC,GAAG;AAAA,IAEH;AAAA,EAAA;AACH;;;"}
@@ -1,6 +1,6 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
- import { PropsWithChildren, HTMLAttributes, FC, DetailedHTMLProps } from 'react';
3
- declare const containerVariants: (props?: ({
2
+ import { DetailedHTMLProps, FC, HTMLAttributes, PropsWithChildren } from 'react';
3
+ export declare const containerVariants: (props?: ({
4
4
  roundedSize?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
5
5
  transparency?: "none" | "sm" | "md" | "lg" | "xl" | "full" | null | undefined;
6
6
  padding?: "none" | "sm" | "md" | "lg" | "xl" | null | undefined;
@@ -14,5 +14,4 @@ export type ContainerProps = PropsWithChildren<Omit<VariantProps<typeof containe
14
14
  border?: boolean;
15
15
  };
16
16
  export declare const Container: FC<ContainerProps>;
17
- export {};
18
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Container/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,EAAE,EACP,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAC;AAGf,QAAA,MAAM,iBAAiB;;;;;;;;;8EAsErB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAC5C,IAAI,CAAC,YAAY,CAAC,OAAO,iBAAiB,CAAC,EAAE,QAAQ,CAAC,CACvD,GACC,iBAAiB,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,GAAG;IAClE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEJ,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA8BxC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Container/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,EAAE,EACP,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAC;AAGf,eAAO,MAAM,iBAAiB;;;;;;;;;8EAsE5B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAC5C,IAAI,CAAC,YAAY,CAAC,OAAO,iBAAiB,CAAC,EAAE,QAAQ,CAAC,CACvD,GACC,iBAAiB,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,GAAG;IAClE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEJ,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA8BxC,CAAC"}
@@ -15,7 +15,7 @@ const containerVariants = cva("flex text-text flex-col backdrop-blur", {
15
15
  },
16
16
  transparency: {
17
17
  none: "bg-card",
18
- sm: "bg-card/90",
18
+ sm: "bg-card/95",
19
19
  md: "bg-card/70",
20
20
  lg: "bg-card/40",
21
21
  xl: "bg-card/20",
@@ -102,6 +102,7 @@ const Container = ({
102
102
  }
103
103
  );
104
104
  export {
105
- Container
105
+ Container,
106
+ containerVariants
106
107
  };
107
108
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../src/components/Container/index.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport {\n type PropsWithChildren,\n type HTMLAttributes,\n type FC,\n type DetailedHTMLProps,\n} from 'react';\nimport { cn } from '../../utils/cn';\n\nconst containerVariants = cva('flex text-text flex-col backdrop-blur', {\n variants: {\n roundedSize: {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n '2xl': 'rounded-2xl',\n '3xl': 'rounded-3xl',\n full: 'rounded-full',\n },\n transparency: {\n none: 'bg-card',\n sm: 'bg-card/90',\n md: 'bg-card/70',\n lg: 'bg-card/40',\n xl: 'bg-card/20',\n full: '',\n },\n padding: {\n none: 'p-0',\n sm: 'p-1',\n md: 'p-2',\n lg: 'p-3',\n xl: 'p-4',\n },\n separator: {\n without: '',\n x: 'divide-x divide-dashed divide-text/20',\n y: 'divide-y divide-dashed divide-text/20',\n both: 'divide-x divide-y divide-dashed divide-text/20',\n },\n border: {\n none: '',\n with: 'border-[1.5px]',\n },\n borderColor: {\n primary: 'border-primary',\n secondary: 'border-secondary',\n neutral: 'border-neutral',\n text: 'border-text ',\n error: 'border-error',\n warning: 'border-warning',\n success: 'border-success',\n },\n background: {\n none: 'bg-inherit',\n hoverable:\n '!bg-opacity-5 backdrop-blur-0 hover:!bg-opacity-10 hover:backdrop-blur focus:!bg-opacity-10 focus:backdrop-blur aria-selected:!bg-opacity-15 aria-selected:backdrop-blur',\n with: '',\n },\n gap: {\n none: 'gap-0',\n sm: 'gap-1',\n md: 'gap-3',\n lg: 'gap-5',\n xl: 'gap-8',\n '2xl': 'gap-10',\n },\n },\n defaultVariants: {\n roundedSize: 'md',\n border: 'none',\n borderColor: 'text',\n transparency: 'md',\n padding: 'none',\n separator: 'without',\n gap: 'none',\n },\n});\n\nexport type ContainerProps = PropsWithChildren<\n Omit<VariantProps<typeof containerVariants>, 'border'>\n> &\n DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {\n border?: boolean;\n };\n\nexport const Container: FC<ContainerProps> = ({\n children,\n roundedSize,\n padding,\n transparency,\n separator,\n className,\n border,\n borderColor,\n background,\n ...props\n}) => (\n <div\n className={cn(\n containerVariants({\n roundedSize,\n transparency,\n padding,\n separator,\n border:\n typeof border === 'boolean' ? (border ? 'with' : 'none') : undefined,\n background,\n borderColor,\n className,\n })\n )}\n {...props}\n >\n {children}\n </div>\n);\n"],"names":[],"mappings":";;;AASA,MAAM,oBAAoB,IAAI,yCAAyC;AAAA,EACrE,UAAU;AAAA,IACR,aAAa;AAAA,MACX,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,OAAO;AAAA,MACP,MAAM;AAAA,IACR;AAAA,IACA,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,MAAM;AAAA,IACR;AAAA,IACA,SAAS;AAAA,MACP,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAAA,IACA,WAAW;AAAA,MACT,SAAS;AAAA,MACT,GAAG;AAAA,MACH,GAAG;AAAA,MACH,MAAM;AAAA,IACR;AAAA,IACA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,MAAM;AAAA,IACR;AAAA,IACA,aAAa;AAAA,MACX,SAAS;AAAA,MACT,WAAW;AAAA,MACX,SAAS;AAAA,MACT,MAAM;AAAA,MACN,OAAO;AAAA,MACP,SAAS;AAAA,MACT,SAAS;AAAA,IACX;AAAA,IACA,YAAY;AAAA,MACV,MAAM;AAAA,MACN,WACE;AAAA,MACF,MAAM;AAAA,IACR;AAAA,IACA,KAAK;AAAA,MACH,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,OAAO;AAAA,IAAA;AAAA,EAEX;AAAA,EACA,iBAAiB;AAAA,IACf,aAAa;AAAA,IACb,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,cAAc;AAAA,IACd,SAAS;AAAA,IACT,WAAW;AAAA,IACX,KAAK;AAAA,EAAA;AAET,CAAC;AASM,MAAM,YAAgC,CAAC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAW;AAAA,MACT,kBAAkB;AAAA,QAChB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,QACE,OAAO,WAAW,YAAa,SAAS,SAAS,SAAU;AAAA,QAC7D;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAA;AAAA,IACH;AAAA,IACC,GAAG;AAAA,IAEH;AAAA,EAAA;AACH;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../src/components/Container/index.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport {\n type DetailedHTMLProps,\n type FC,\n type HTMLAttributes,\n type PropsWithChildren,\n} from 'react';\nimport { cn } from '../../utils/cn';\n\nexport const containerVariants = cva('flex text-text flex-col backdrop-blur', {\n variants: {\n roundedSize: {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n '2xl': 'rounded-2xl',\n '3xl': 'rounded-3xl',\n full: 'rounded-full',\n },\n transparency: {\n none: 'bg-card',\n sm: 'bg-card/95',\n md: 'bg-card/70',\n lg: 'bg-card/40',\n xl: 'bg-card/20',\n full: '',\n },\n padding: {\n none: 'p-0',\n sm: 'p-1',\n md: 'p-2',\n lg: 'p-3',\n xl: 'p-4',\n },\n separator: {\n without: '',\n x: 'divide-x divide-dashed divide-text/20',\n y: 'divide-y divide-dashed divide-text/20',\n both: 'divide-x divide-y divide-dashed divide-text/20',\n },\n border: {\n none: '',\n with: 'border-[1.5px]',\n },\n borderColor: {\n primary: 'border-primary',\n secondary: 'border-secondary',\n neutral: 'border-neutral',\n text: 'border-text ',\n error: 'border-error',\n warning: 'border-warning',\n success: 'border-success',\n },\n background: {\n none: 'bg-inherit',\n hoverable:\n '!bg-opacity-5 backdrop-blur-0 hover:!bg-opacity-10 hover:backdrop-blur focus:!bg-opacity-10 focus:backdrop-blur aria-selected:!bg-opacity-15 aria-selected:backdrop-blur',\n with: '',\n },\n gap: {\n none: 'gap-0',\n sm: 'gap-1',\n md: 'gap-3',\n lg: 'gap-5',\n xl: 'gap-8',\n '2xl': 'gap-10',\n },\n },\n defaultVariants: {\n roundedSize: 'md',\n border: 'none',\n borderColor: 'text',\n transparency: 'md',\n padding: 'none',\n separator: 'without',\n gap: 'none',\n },\n});\n\nexport type ContainerProps = PropsWithChildren<\n Omit<VariantProps<typeof containerVariants>, 'border'>\n> &\n DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {\n border?: boolean;\n };\n\nexport const Container: FC<ContainerProps> = ({\n children,\n roundedSize,\n padding,\n transparency,\n separator,\n className,\n border,\n borderColor,\n background,\n ...props\n}) => (\n <div\n className={cn(\n containerVariants({\n roundedSize,\n transparency,\n padding,\n separator,\n border:\n typeof border === 'boolean' ? (border ? 'with' : 'none') : undefined,\n background,\n borderColor,\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gC,CAAC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MACE;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAW;AAAA,MACT,kBAAkB;AAAA,QAChB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,QACE,OAAO,WAAW,YAAa,SAAS,SAAS,SAAU;AAAA,QAC7D;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAA;AAAA,IACH;AAAA,IACC,GAAG;AAAA,IAEH;AAAA,EAAA;AACH;"}
@@ -6,8 +6,8 @@ const lucideReact = require("lucide-react");
6
6
  const ReactExports = require("react");
7
7
  const reactIntlayer = require("react-intlayer");
8
8
  const components_Button_Button = require("../Button/Button.cjs");
9
- const components_IDE_CopyButton_content = require("./CopyButton.content.cjs");
10
- const CopyButton = ({ content }) => {
9
+ const components_IDE_CopyButton_content = require("../IDE/CopyButton.content.cjs");
10
+ const CopyButton = ({ content, ...props }) => {
11
11
  const [copied, setCopied] = ReactExports.useState(false);
12
12
  const { label } = reactIntlayer.useDictionary(components_IDE_CopyButton_content.copyContentContent);
13
13
  const handleCopy = async () => {
@@ -31,10 +31,11 @@ const CopyButton = ({ content }) => {
31
31
  onClick: handleCopy,
32
32
  variant: "hoverable",
33
33
  color: "text",
34
- label: label.value,
35
- size: "icon-sm"
34
+ size: "icon-sm",
35
+ ...props,
36
+ label: props.label ?? label.value
36
37
  }
37
38
  );
38
39
  };
39
40
  exports.CopyButton = CopyButton;
40
- //# sourceMappingURL=CopyButton.cjs.map
41
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/CopyButton/index.tsx"],"sourcesContent":["'use client';\n\nimport { CopyCheckIcon, CopyIcon } from 'lucide-react';\nimport { useEffect, useState, type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Button, ButtonProps } from '../Button';\nimport { copyContentContent } from '../IDE/CopyButton.content';\n\ntype CopyButtonProps = {\n content: string;\n} & Partial<ButtonProps>;\n\nexport const CopyButton: FC<CopyButtonProps> = ({ content, ...props }) => {\n const [copied, setCopied] = useState(false);\n const { label } = useDictionary(copyContentContent);\n\n const handleCopy = async () => {\n try {\n await navigator.clipboard.writeText(content);\n setCopied(true);\n } catch (error) {\n console.error('Failed to copy text: ', error);\n }\n };\n\n useEffect(() => {\n const timer = setTimeout(() => {\n setCopied(false);\n }, 1000);\n return () => clearTimeout(timer);\n }, [copied]);\n\n return (\n <Button\n Icon={copied ? CopyCheckIcon : CopyIcon}\n onClick={handleCopy}\n variant=\"hoverable\"\n color=\"text\"\n size=\"icon-sm\"\n {...props}\n label={props.label ?? label.value}\n />\n );\n};\n"],"names":["useState","useDictionary","copyContentContent","useEffect","jsx","Button","CopyCheckIcon","CopyIcon"],"mappings":";;;;;;;;;AAYO,MAAM,aAAkC,CAAC,EAAE,SAAS,GAAG,YAAY;AACxE,QAAM,CAAC,QAAQ,SAAS,IAAIA,aAAAA,SAAS,KAAK;AAC1C,QAAM,EAAE,MAAA,IAAUC,cAAA,cAAcC,oDAAkB;AAElD,QAAM,aAAa,YAAY;AACzB,QAAA;AACI,YAAA,UAAU,UAAU,UAAU,OAAO;AAC3C,gBAAU,IAAI;AAAA,aACP,OAAO;AACN,cAAA,MAAM,yBAAyB,KAAK;AAAA,IAAA;AAAA,EAEhD;AAEAC,eAAAA,UAAU,MAAM;AACR,UAAA,QAAQ,WAAW,MAAM;AAC7B,gBAAU,KAAK;AAAA,OACd,GAAI;AACA,WAAA,MAAM,aAAa,KAAK;AAAA,EAAA,GAC9B,CAAC,MAAM,CAAC;AAGT,SAAAC,2BAAA;AAAA,IAACC,yBAAA;AAAA,IAAA;AAAA,MACC,MAAM,SAASC,YAAAA,gBAAgBC,YAAA;AAAA,MAC/B,SAAS;AAAA,MACT,SAAQ;AAAA,MACR,OAAM;AAAA,MACN,MAAK;AAAA,MACJ,GAAG;AAAA,MACJ,OAAO,MAAM,SAAS,MAAM;AAAA,IAAA;AAAA,EAC9B;AAEJ;;"}
@@ -1,7 +1,8 @@
1
1
  import { FC } from 'react';
2
+ import { ButtonProps } from '../Button';
2
3
  type CopyButtonProps = {
3
4
  content: string;
4
- };
5
+ } & Partial<ButtonProps>;
5
6
  export declare const CopyButton: FC<CopyButtonProps>;
6
7
  export {};
7
- //# sourceMappingURL=CopyButton.d.ts.map
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CopyButton/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAuB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EAAU,WAAW,EAAE,MAAM,WAAW,CAAC;AAGhD,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAEzB,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CA+B1C,CAAC"}
@@ -4,8 +4,8 @@ import { CopyCheckIcon, CopyIcon } from "lucide-react";
4
4
  import { useState, useEffect } from "react";
5
5
  import { useDictionary } from "react-intlayer";
6
6
  import { Button } from "../Button/Button.mjs";
7
- import { copyContentContent } from "./CopyButton.content.mjs";
8
- const CopyButton = ({ content }) => {
7
+ import { copyContentContent } from "../IDE/CopyButton.content.mjs";
8
+ const CopyButton = ({ content, ...props }) => {
9
9
  const [copied, setCopied] = useState(false);
10
10
  const { label } = useDictionary(copyContentContent);
11
11
  const handleCopy = async () => {
@@ -29,12 +29,13 @@ const CopyButton = ({ content }) => {
29
29
  onClick: handleCopy,
30
30
  variant: "hoverable",
31
31
  color: "text",
32
- label: label.value,
33
- size: "icon-sm"
32
+ size: "icon-sm",
33
+ ...props,
34
+ label: props.label ?? label.value
34
35
  }
35
36
  );
36
37
  };
37
38
  export {
38
39
  CopyButton
39
40
  };
40
- //# sourceMappingURL=CopyButton.mjs.map
41
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../../src/components/CopyButton/index.tsx"],"sourcesContent":["'use client';\n\nimport { CopyCheckIcon, CopyIcon } from 'lucide-react';\nimport { useEffect, useState, type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { Button, ButtonProps } from '../Button';\nimport { copyContentContent } from '../IDE/CopyButton.content';\n\ntype CopyButtonProps = {\n content: string;\n} & Partial<ButtonProps>;\n\nexport const CopyButton: FC<CopyButtonProps> = ({ content, ...props }) => {\n const [copied, setCopied] = useState(false);\n const { label } = useDictionary(copyContentContent);\n\n const handleCopy = async () => {\n try {\n await navigator.clipboard.writeText(content);\n setCopied(true);\n } catch (error) {\n console.error('Failed to copy text: ', error);\n }\n };\n\n useEffect(() => {\n const timer = setTimeout(() => {\n setCopied(false);\n }, 1000);\n return () => clearTimeout(timer);\n }, [copied]);\n\n return (\n <Button\n Icon={copied ? CopyCheckIcon : CopyIcon}\n onClick={handleCopy}\n variant=\"hoverable\"\n color=\"text\"\n size=\"icon-sm\"\n {...props}\n label={props.label ?? label.value}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;AAYO,MAAM,aAAkC,CAAC,EAAE,SAAS,GAAG,YAAY;AACxE,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAC1C,QAAM,EAAE,MAAA,IAAU,cAAc,kBAAkB;AAElD,QAAM,aAAa,YAAY;AACzB,QAAA;AACI,YAAA,UAAU,UAAU,UAAU,OAAO;AAC3C,gBAAU,IAAI;AAAA,aACP,OAAO;AACN,cAAA,MAAM,yBAAyB,KAAK;AAAA,IAAA;AAAA,EAEhD;AAEA,YAAU,MAAM;AACR,UAAA,QAAQ,WAAW,MAAM;AAC7B,gBAAU,KAAK;AAAA,OACd,GAAI;AACA,WAAA,MAAM,aAAa,KAAK;AAAA,EAAA,GAC9B,CAAC,MAAM,CAAC;AAGT,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAM,SAAS,gBAAgB;AAAA,MAC/B,SAAS;AAAA,MACT,SAAQ;AAAA,MACR,OAAM;AAAA,MACN,MAAK;AAAA,MACJ,GAAG;AAAA,MACJ,OAAO,MAAM,SAAS,MAAM;AAAA,IAAA;AAAA,EAC9B;AAEJ;"}
@@ -7,7 +7,7 @@ const components_IDE_CodeBlockClient = require("./CodeBlockClient.cjs");
7
7
  const components_IDE_CodeConditionalRenderer = require("./CodeConditionalRenderer.cjs");
8
8
  const components_IDE_CodeFormatSelector = require("./CodeFormatSelector.cjs");
9
9
  const components_IDE_ContentDeclarationFormatSelector = require("./ContentDeclarationFormatSelector.cjs");
10
- const components_IDE_CopyButton = require("./CopyButton.cjs");
10
+ const components_IDE_CopyCode = require("./CopyCode.cjs");
11
11
  const components_IDE_PackageManagerSelector = require("./PackageManagerSelector.cjs");
12
12
  const Code = ({
13
13
  children,
@@ -50,14 +50,14 @@ const Code = ({
50
50
  contentDeclarationFormat && /* @__PURE__ */ jsxRuntime.jsx(components_IDE_ContentDeclarationFormatSelector.ContentDeclarationFormatSelector, {})
51
51
  ] })
52
52
  ] }),
53
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sticky top-28", children: /* @__PURE__ */ jsxRuntime.jsx(
53
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sticky top-48", children: /* @__PURE__ */ jsxRuntime.jsx(
54
54
  "div",
55
55
  {
56
56
  className: utils_cn.cn(
57
57
  "absolute bottom-0 right-2 flex h-7 items-center",
58
58
  hadSelectInHeader && "h-11"
59
59
  ),
60
- children: /* @__PURE__ */ jsxRuntime.jsx(components_IDE_CopyButton.CopyButton, { content: code })
60
+ children: /* @__PURE__ */ jsxRuntime.jsx(components_IDE_CopyCode.CopyCode, { code })
61
61
  }
62
62
  ) })
63
63
  ] }),
@@ -1 +1 @@
1
- {"version":3,"file":"Code.cjs","sources":["../../../src/components/IDE/Code.tsx"],"sourcesContent":["import { type FC, type HTMLAttributes } from 'react';\nimport type { BundledLanguage } from 'shiki';\nimport { cn } from '../../utils/cn';\nimport { Container } from '../Container';\nimport { CodeBlock } from './CodeBlockClient';\nimport { CodeConditionalRender } from './CodeConditionalRenderer';\nimport type {\n PackageManager,\n CodeFormat,\n ContentDeclarationFormat,\n} from './CodeContext';\nimport { CodeFormatSelector } from './CodeFormatSelector';\nimport { ContentDeclarationFormatSelector } from './ContentDeclarationFormatSelector';\nimport { CopyButton } from './CopyButton';\nimport { PackageManagerSelector } from './PackageManagerSelector';\n\nexport type CodeCompAttributes = {\n fileName?: string;\n packageManager?: PackageManager;\n codeFormat?: CodeFormat;\n contentDeclarationFormat?: ContentDeclarationFormat;\n};\n\ntype CodeCompProps = {\n children: string;\n fileName?: string;\n language: BundledLanguage;\n isDarkMode?: boolean;\n showHeader?: boolean;\n showLineNumbers?: boolean;\n} & CodeCompAttributes &\n HTMLAttributes<HTMLDivElement>;\n\nexport const Code: FC<CodeCompProps> = ({\n children,\n language,\n isDarkMode,\n showHeader = true,\n showLineNumbers = true,\n className,\n fileName,\n packageManager,\n codeFormat,\n contentDeclarationFormat,\n ...props\n}) => {\n const code = children.endsWith('\\n') ? children.slice(0, -1) : children;\n\n const hadSelectInHeader =\n packageManager || codeFormat || contentDeclarationFormat;\n\n return (\n <CodeConditionalRender\n packageManager={packageManager}\n codeFormat={codeFormat}\n contentDeclarationFormat={contentDeclarationFormat}\n >\n <Container\n className={cn(\n 'relative text-sm leading-6',\n showLineNumbers && 'with-line-number ml-0',\n className\n )}\n transparency=\"lg\"\n {...props}\n >\n {showHeader && (\n <>\n <div className=\"bg-card/50 text-neutral grid w-full grid-cols-[1fr_auto] items-center justify-between rounded-t-xl py-1.5 pl-4 pr-12 text-xs\">\n <span className=\"truncate\">{fileName ?? language}</span>\n <div className=\"flex items-center gap-2\">\n {packageManager && <PackageManagerSelector />}\n {codeFormat && <CodeFormatSelector />}\n {contentDeclarationFormat && (\n <ContentDeclarationFormatSelector />\n )}\n </div>\n </div>\n <div className=\"sticky top-28\">\n <div\n className={cn(\n 'absolute bottom-0 right-2 flex h-7 items-center',\n hadSelectInHeader && 'h-11'\n )}\n >\n <CopyButton content={code} />\n </div>\n </div>\n </>\n )}\n <div className=\"grid size-full grid-cols-[0px] overflow-auto p-3\">\n <CodeBlock lang={language} isDarkMode={isDarkMode}>\n {code}\n </CodeBlock>\n </div>\n </Container>\n </CodeConditionalRender>\n );\n};\n"],"names":["jsx","CodeConditionalRender","jsxs","Container","cn","Fragment","PackageManagerSelector","CodeFormatSelector","ContentDeclarationFormatSelector","CopyButton","CodeBlock"],"mappings":";;;;;;;;;;;AAiCO,MAAM,OAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACE,QAAA,OAAO,SAAS,SAAS,IAAI,IAAI,SAAS,MAAM,GAAG,EAAE,IAAI;AAEzD,QAAA,oBACJ,kBAAkB,cAAc;AAGhC,SAAAA,2BAAA;AAAA,IAACC,uCAAA;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MAEA,UAAAC,2BAAA;AAAA,QAACC,2BAAA;AAAA,QAAA;AAAA,UACC,WAAWC,SAAA;AAAA,YACT;AAAA,YACA,mBAAmB;AAAA,YACnB;AAAA,UACF;AAAA,UACA,cAAa;AAAA,UACZ,GAAG;AAAA,UAEH,UAAA;AAAA,YAAA,cAEGF,2BAAA,KAAAG,qBAAA,EAAA,UAAA;AAAA,cAACH,2BAAAA,KAAA,OAAA,EAAI,WAAU,gIACb,UAAA;AAAA,gBAAAF,2BAAA,IAAC,QAAK,EAAA,WAAU,YAAY,UAAA,YAAY,UAAS;AAAA,gBACjDE,2BAAAA,KAAC,OAAI,EAAA,WAAU,2BACZ,UAAA;AAAA,kBAAA,iDAAmBI,sCAAuB,wBAAA,EAAA;AAAA,kBAC1C,6CAAeC,kCAAmB,oBAAA,EAAA;AAAA,kBAClC,2DACEC,gDAAAA,kCAAiC,CAAA,CAAA;AAAA,gBAAA,EAEtC,CAAA;AAAA,cAAA,GACF;AAAA,cACAR,2BAAAA,IAAC,OAAI,EAAA,WAAU,iBACb,UAAAA,2BAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAWI,SAAA;AAAA,oBACT;AAAA,oBACA,qBAAqB;AAAA,kBACvB;AAAA,kBAEA,UAAAJ,2BAAAA,IAACS,0BAAAA,YAAW,EAAA,SAAS,KAAM,CAAA;AAAA,gBAAA;AAAA,cAAA,EAE/B,CAAA;AAAA,YAAA,GACF;AAAA,YAEFT,2BAAAA,IAAC,OAAI,EAAA,WAAU,oDACb,UAAAA,2BAAA,IAACU,4CAAU,MAAM,UAAU,YACxB,UAAA,KACH,CAAA,EACF,CAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF;AAEJ;;"}
1
+ {"version":3,"file":"Code.cjs","sources":["../../../src/components/IDE/Code.tsx"],"sourcesContent":["import { type FC, type HTMLAttributes } from 'react';\nimport type { BundledLanguage } from 'shiki';\nimport { cn } from '../../utils/cn';\nimport { Container } from '../Container';\nimport { CodeBlock } from './CodeBlockClient';\nimport { CodeConditionalRender } from './CodeConditionalRenderer';\nimport type {\n CodeFormat,\n ContentDeclarationFormat,\n PackageManager,\n} from './CodeContext';\nimport { CodeFormatSelector } from './CodeFormatSelector';\nimport { ContentDeclarationFormatSelector } from './ContentDeclarationFormatSelector';\nimport { CopyCode } from './CopyCode';\nimport { PackageManagerSelector } from './PackageManagerSelector';\n\nexport type CodeCompAttributes = {\n fileName?: string;\n packageManager?: PackageManager;\n codeFormat?: CodeFormat;\n contentDeclarationFormat?: ContentDeclarationFormat;\n};\n\ntype CodeCompProps = {\n children: string;\n fileName?: string;\n language: BundledLanguage;\n isDarkMode?: boolean;\n showHeader?: boolean;\n showLineNumbers?: boolean;\n} & CodeCompAttributes &\n HTMLAttributes<HTMLDivElement>;\n\nexport const Code: FC<CodeCompProps> = ({\n children,\n language,\n isDarkMode,\n showHeader = true,\n showLineNumbers = true,\n className,\n fileName,\n packageManager,\n codeFormat,\n contentDeclarationFormat,\n ...props\n}) => {\n const code = children.endsWith('\\n') ? children.slice(0, -1) : children;\n\n const hadSelectInHeader =\n packageManager || codeFormat || contentDeclarationFormat;\n\n return (\n <CodeConditionalRender\n packageManager={packageManager}\n codeFormat={codeFormat}\n contentDeclarationFormat={contentDeclarationFormat}\n >\n <Container\n className={cn(\n 'relative text-sm leading-6',\n showLineNumbers && 'with-line-number ml-0',\n className\n )}\n transparency=\"lg\"\n {...props}\n >\n {showHeader && (\n <>\n <div className=\"bg-card/50 text-neutral grid w-full grid-cols-[1fr_auto] items-center justify-between rounded-t-xl py-1.5 pl-4 pr-12 text-xs\">\n <span className=\"truncate\">{fileName ?? language}</span>\n <div className=\"flex items-center gap-2\">\n {packageManager && <PackageManagerSelector />}\n {codeFormat && <CodeFormatSelector />}\n {contentDeclarationFormat && (\n <ContentDeclarationFormatSelector />\n )}\n </div>\n </div>\n <div className=\"sticky top-48\">\n <div\n className={cn(\n 'absolute bottom-0 right-2 flex h-7 items-center',\n hadSelectInHeader && 'h-11'\n )}\n >\n <CopyCode code={code} />\n </div>\n </div>\n </>\n )}\n <div className=\"grid size-full grid-cols-[0px] overflow-auto p-3\">\n <CodeBlock lang={language} isDarkMode={isDarkMode}>\n {code}\n </CodeBlock>\n </div>\n </Container>\n </CodeConditionalRender>\n );\n};\n"],"names":["jsx","CodeConditionalRender","jsxs","Container","cn","Fragment","PackageManagerSelector","CodeFormatSelector","ContentDeclarationFormatSelector","CopyCode","CodeBlock"],"mappings":";;;;;;;;;;;AAiCO,MAAM,OAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB;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U,YACxB,UAAA,KACH,CAAA,EACF,CAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF;AAEJ;;"}
@@ -1,6 +1,6 @@
1
1
  import { FC, HTMLAttributes } from 'react';
2
2
  import { BundledLanguage } from 'shiki';
3
- import { PackageManager, CodeFormat, ContentDeclarationFormat } from './CodeContext';
3
+ import { CodeFormat, ContentDeclarationFormat, PackageManager } from './CodeContext';
4
4
  export type CodeCompAttributes = {
5
5
  fileName?: string;
6
6
  packageManager?: PackageManager;
@@ -1 +1 @@
1
- {"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../../src/components/IDE/Code.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAK7C,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,wBAAwB,EACzB,MAAM,eAAe,CAAC;AAMvB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;CACrD,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,eAAe,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,kBAAkB,GACpB,cAAc,CAAC,cAAc,CAAC,CAAC;AAEjC,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,aAAa,CAiElC,CAAC"}
1
+ {"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../../src/components/IDE/Code.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAK7C,OAAO,KAAK,EACV,UAAU,EACV,wBAAwB,EACxB,cAAc,EACf,MAAM,eAAe,CAAC;AAMvB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;CACrD,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,eAAe,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,kBAAkB,GACpB,cAAc,CAAC,cAAc,CAAC,CAAC;AAEjC,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,aAAa,CAiElC,CAAC"}
@@ -5,7 +5,7 @@ import { CodeBlock } from "./CodeBlockClient.mjs";
5
5
  import { CodeConditionalRender } from "./CodeConditionalRenderer.mjs";
6
6
  import { CodeFormatSelector } from "./CodeFormatSelector.mjs";
7
7
  import { ContentDeclarationFormatSelector } from "./ContentDeclarationFormatSelector.mjs";
8
- import { CopyButton } from "./CopyButton.mjs";
8
+ import { CopyCode } from "./CopyCode.mjs";
9
9
  import { PackageManagerSelector } from "./PackageManagerSelector.mjs";
10
10
  const Code = ({
11
11
  children,
@@ -48,14 +48,14 @@ const Code = ({
48
48
  contentDeclarationFormat && /* @__PURE__ */ jsx(ContentDeclarationFormatSelector, {})
49
49
  ] })
50
50
  ] }),
51
- /* @__PURE__ */ jsx("div", { className: "sticky top-28", children: /* @__PURE__ */ jsx(
51
+ /* @__PURE__ */ jsx("div", { className: "sticky top-48", children: /* @__PURE__ */ jsx(
52
52
  "div",
53
53
  {
54
54
  className: cn(
55
55
  "absolute bottom-0 right-2 flex h-7 items-center",
56
56
  hadSelectInHeader && "h-11"
57
57
  ),
58
- children: /* @__PURE__ */ jsx(CopyButton, { content: code })
58
+ children: /* @__PURE__ */ jsx(CopyCode, { code })
59
59
  }
60
60
  ) })
61
61
  ] }),
@@ -1 +1 @@
1
- {"version":3,"file":"Code.mjs","sources":["../../../src/components/IDE/Code.tsx"],"sourcesContent":["import { type FC, type HTMLAttributes } from 'react';\nimport type { BundledLanguage } from 'shiki';\nimport { cn } from '../../utils/cn';\nimport { Container } from '../Container';\nimport { CodeBlock } from './CodeBlockClient';\nimport { CodeConditionalRender } from './CodeConditionalRenderer';\nimport type {\n PackageManager,\n CodeFormat,\n ContentDeclarationFormat,\n} from './CodeContext';\nimport { CodeFormatSelector } from './CodeFormatSelector';\nimport { ContentDeclarationFormatSelector } from './ContentDeclarationFormatSelector';\nimport { CopyButton } from './CopyButton';\nimport { PackageManagerSelector } from './PackageManagerSelector';\n\nexport type CodeCompAttributes = {\n fileName?: string;\n packageManager?: PackageManager;\n codeFormat?: CodeFormat;\n contentDeclarationFormat?: ContentDeclarationFormat;\n};\n\ntype CodeCompProps = {\n children: string;\n fileName?: string;\n language: BundledLanguage;\n isDarkMode?: boolean;\n showHeader?: boolean;\n showLineNumbers?: boolean;\n} & CodeCompAttributes &\n HTMLAttributes<HTMLDivElement>;\n\nexport const Code: FC<CodeCompProps> = ({\n children,\n language,\n isDarkMode,\n showHeader = true,\n showLineNumbers = true,\n className,\n fileName,\n packageManager,\n codeFormat,\n contentDeclarationFormat,\n ...props\n}) => {\n const code = children.endsWith('\\n') ? children.slice(0, -1) : children;\n\n const hadSelectInHeader =\n packageManager || codeFormat || contentDeclarationFormat;\n\n return (\n <CodeConditionalRender\n packageManager={packageManager}\n codeFormat={codeFormat}\n contentDeclarationFormat={contentDeclarationFormat}\n >\n <Container\n className={cn(\n 'relative text-sm leading-6',\n showLineNumbers && 'with-line-number ml-0',\n className\n )}\n transparency=\"lg\"\n {...props}\n >\n {showHeader && (\n <>\n <div className=\"bg-card/50 text-neutral grid w-full grid-cols-[1fr_auto] items-center justify-between rounded-t-xl py-1.5 pl-4 pr-12 text-xs\">\n <span className=\"truncate\">{fileName ?? language}</span>\n <div className=\"flex items-center gap-2\">\n {packageManager && <PackageManagerSelector />}\n {codeFormat && <CodeFormatSelector />}\n {contentDeclarationFormat && (\n <ContentDeclarationFormatSelector />\n )}\n </div>\n </div>\n <div className=\"sticky top-28\">\n <div\n className={cn(\n 'absolute bottom-0 right-2 flex h-7 items-center',\n hadSelectInHeader && 'h-11'\n )}\n >\n <CopyButton content={code} />\n </div>\n </div>\n </>\n )}\n <div className=\"grid size-full grid-cols-[0px] overflow-auto p-3\">\n <CodeBlock lang={language} isDarkMode={isDarkMode}>\n {code}\n </CodeBlock>\n </div>\n </Container>\n </CodeConditionalRender>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAiCO,MAAM,OAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACE,QAAA,OAAO,SAAS,SAAS,IAAI,IAAI,SAAS,MAAM,GAAG,EAAE,IAAI;AAEzD,QAAA,oBACJ,kBAAkB,cAAc;AAGhC,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MAEA,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACA,mBAAmB;AAAA,YACnB;AAAA,UACF;AAAA,UACA,cAAa;AAAA,UACZ,GAAG;AAAA,UAEH,UAAA;AAAA,YAAA,cAEG,qBAAA,UAAA,EAAA,UAAA;AAAA,cAAC,qBAAA,OAAA,EAAI,WAAU,gIACb,UAAA;AAAA,gBAAA,oBAAC,QAAK,EAAA,WAAU,YAAY,UAAA,YAAY,UAAS;AAAA,gBACjD,qBAAC,OAAI,EAAA,WAAU,2BACZ,UAAA;AAAA,kBAAA,sCAAmB,wBAAuB,EAAA;AAAA,kBAC1C,kCAAe,oBAAmB,EAAA;AAAA,kBAClC,gDACE,kCAAiC,CAAA,CAAA;AAAA,gBAAA,EAEtC,CAAA;AAAA,cAAA,GACF;AAAA,cACA,oBAAC,OAAI,EAAA,WAAU,iBACb,UAAA;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,WAAW;AAAA,oBACT;AAAA,oBACA,qBAAqB;AAAA,kBACvB;AAAA,kBAEA,UAAA,oBAAC,YAAW,EAAA,SAAS,KAAM,CAAA;AAAA,gBAAA;AAAA,cAAA,EAE/B,CAAA;AAAA,YAAA,GACF;AAAA,YAEF,oBAAC,OAAI,EAAA,WAAU,oDACb,UAAA,oBAAC,aAAU,MAAM,UAAU,YACxB,UAAA,KACH,CAAA,EACF,CAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EACF;AAEJ;"}
1
+ {"version":3,"file":"Code.mjs","sources":["../../../src/components/IDE/Code.tsx"],"sourcesContent":["import { type FC, type HTMLAttributes } from 'react';\nimport type { BundledLanguage } from 'shiki';\nimport { cn } from '../../utils/cn';\nimport { Container } from '../Container';\nimport { CodeBlock } from './CodeBlockClient';\nimport { CodeConditionalRender } from './CodeConditionalRenderer';\nimport type {\n CodeFormat,\n ContentDeclarationFormat,\n PackageManager,\n} from './CodeContext';\nimport { CodeFormatSelector } from './CodeFormatSelector';\nimport { ContentDeclarationFormatSelector } from './ContentDeclarationFormatSelector';\nimport { CopyCode } from './CopyCode';\nimport { PackageManagerSelector } from './PackageManagerSelector';\n\nexport type CodeCompAttributes = {\n fileName?: string;\n packageManager?: PackageManager;\n codeFormat?: CodeFormat;\n contentDeclarationFormat?: ContentDeclarationFormat;\n};\n\ntype CodeCompProps = {\n children: string;\n fileName?: string;\n language: BundledLanguage;\n isDarkMode?: boolean;\n showHeader?: boolean;\n showLineNumbers?: boolean;\n} & CodeCompAttributes &\n HTMLAttributes<HTMLDivElement>;\n\nexport const Code: FC<CodeCompProps> = ({\n children,\n language,\n isDarkMode,\n showHeader = true,\n showLineNumbers = true,\n className,\n fileName,\n packageManager,\n codeFormat,\n contentDeclarationFormat,\n ...props\n}) => {\n const code = children.endsWith('\\n') ? children.slice(0, -1) : children;\n\n const hadSelectInHeader =\n packageManager || codeFormat || contentDeclarationFormat;\n\n return (\n <CodeConditionalRender\n packageManager={packageManager}\n codeFormat={codeFormat}\n contentDeclarationFormat={contentDeclarationFormat}\n >\n <Container\n className={cn(\n 'relative text-sm leading-6',\n showLineNumbers && 'with-line-number ml-0',\n className\n )}\n transparency=\"lg\"\n {...props}\n >\n {showHeader && (\n <>\n <div className=\"bg-card/50 text-neutral grid w-full grid-cols-[1fr_auto] items-center justify-between rounded-t-xl py-1.5 pl-4 pr-12 text-xs\">\n <span className=\"truncate\">{fileName ?? language}</span>\n <div className=\"flex items-center gap-2\">\n {packageManager && <PackageManagerSelector />}\n {codeFormat && <CodeFormatSelector />}\n {contentDeclarationFormat && (\n <ContentDeclarationFormatSelector />\n )}\n </div>\n </div>\n <div className=\"sticky top-48\">\n <div\n className={cn(\n 'absolute bottom-0 right-2 flex h-7 items-center',\n hadSelectInHeader && 'h-11'\n )}\n >\n <CopyCode code={code} />\n </div>\n </div>\n </>\n )}\n <div className=\"grid size-full grid-cols-[0px] overflow-auto p-3\">\n <CodeBlock lang={language} isDarkMode={isDarkMode}>\n {code}\n </CodeBlock>\n </div>\n </Container>\n </CodeConditionalRender>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAiCO,MAAM,OAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,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
1
+ "use client";
2
+ "use strict";
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
+ const jsxRuntime = require("react/jsx-runtime");
5
+ const reactIntlayer = require("react-intlayer");
6
+ const components_CopyButton_index = require("../CopyButton/index.cjs");
7
+ const components_Popover_index = require("../Popover/index.cjs");
8
+ const components_IDE_copyCode_content = require("./copyCode.content.cjs");
9
+ const CopyCode = ({ code }) => {
10
+ const { title, description } = reactIntlayer.useDictionary(components_IDE_copyCode_content);
11
+ return /* @__PURE__ */ jsxRuntime.jsxs(components_Popover_index.Popover, { identifier: "copy", children: [
12
+ /* @__PURE__ */ jsxRuntime.jsx(components_CopyButton_index.CopyButton, { content: code }),
13
+ /* @__PURE__ */ jsxRuntime.jsxs(
14
+ components_Popover_index.Popover.Detail,
15
+ {
16
+ identifier: "copy",
17
+ className: "flex flex-col gap-3 p-3 min-w-64 text-sm",
18
+ xAlign: "end",
19
+ children: [
20
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: title }),
21
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-neutral", children: description })
22
+ ]
23
+ }
24
+ )
25
+ ] });
26
+ };
27
+ exports.CopyCode = CopyCode;
28
+ //# sourceMappingURL=CopyCode.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CopyCode.cjs","sources":["../../../src/components/IDE/CopyCode.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { CopyButton } from '../CopyButton';\nimport { Popover } from '../Popover';\nimport copyContentContent from './copyCode.content';\n\ntype CopyCodeProps = {\n code: string;\n};\n\nexport const CopyCode: FC<CopyCodeProps> = ({ code }) => {\n const { title, description } = useDictionary(copyContentContent);\n\n return (\n <Popover identifier=\"copy\">\n <CopyButton content={code} />\n\n <Popover.Detail\n identifier=\"copy\"\n className=\"flex flex-col gap-3 p-3 min-w-64 text-sm\"\n xAlign=\"end\"\n >\n <strong>{title}</strong>\n <p className=\"text-neutral\">{description}</p>\n </Popover.Detail>\n </Popover>\n );\n};\n"],"names":["useDictionary","copyContentContent","jsxs","Popover","jsx","CopyButton"],"mappings":";;;;;;;;AAYO,MAAM,WAA8B,CAAC,EAAE,WAAW;AACvD,QAAM,EAAE,OAAO,gBAAgBA,cAAAA,cAAcC,+BAAkB;AAG7D,SAAAC,2BAAA,KAACC,yBAAQ,SAAA,EAAA,YAAW,QAClB,UAAA;AAAA,IAACC,2BAAAA,IAAAC,4BAAA,YAAA,EAAW,SAAS,KAAM,CAAA;AAAA,IAE3BH,2BAAA;AAAA,MAACC,yBAAAA,QAAQ;AAAA,MAAR;AAAA,QACC,YAAW;AAAA,QACX,WAAU;AAAA,QACV,QAAO;AAAA,QAEP,UAAA;AAAA,UAAAC,2BAAAA,IAAC,YAAQ,UAAM,MAAA,CAAA;AAAA,UACdA,2BAAA,IAAA,KAAA,EAAE,WAAU,gBAAgB,UAAY,YAAA,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAC3C,GACF;AAEJ;;"}
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ type CopyCodeProps = {
3
+ code: string;
4
+ };
5
+ export declare const CopyCode: FC<CopyCodeProps>;
6
+ export {};
7
+ //# sourceMappingURL=CopyCode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CopyCode.d.ts","sourceRoot":"","sources":["../../../src/components/IDE/CopyCode.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAiBtC,CAAC"}
@@ -0,0 +1,28 @@
1
+ "use client";
2
+ import { jsxs, jsx } from "react/jsx-runtime";
3
+ import { useDictionary } from "react-intlayer";
4
+ import { CopyButton } from "../CopyButton/index.mjs";
5
+ import { Popover } from "../Popover/index.mjs";
6
+ import copyContentContent from "./copyCode.content.mjs";
7
+ const CopyCode = ({ code }) => {
8
+ const { title, description } = useDictionary(copyContentContent);
9
+ return /* @__PURE__ */ jsxs(Popover, { identifier: "copy", children: [
10
+ /* @__PURE__ */ jsx(CopyButton, { content: code }),
11
+ /* @__PURE__ */ jsxs(
12
+ Popover.Detail,
13
+ {
14
+ identifier: "copy",
15
+ className: "flex flex-col gap-3 p-3 min-w-64 text-sm",
16
+ xAlign: "end",
17
+ children: [
18
+ /* @__PURE__ */ jsx("strong", { children: title }),
19
+ /* @__PURE__ */ jsx("p", { className: "text-neutral", children: description })
20
+ ]
21
+ }
22
+ )
23
+ ] });
24
+ };
25
+ export {
26
+ CopyCode
27
+ };
28
+ //# sourceMappingURL=CopyCode.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CopyCode.mjs","sources":["../../../src/components/IDE/CopyCode.tsx"],"sourcesContent":["'use client';\n\nimport { type FC } from 'react';\nimport { useDictionary } from 'react-intlayer';\nimport { CopyButton } from '../CopyButton';\nimport { Popover } from '../Popover';\nimport copyContentContent from './copyCode.content';\n\ntype CopyCodeProps = {\n code: string;\n};\n\nexport const CopyCode: FC<CopyCodeProps> = ({ code }) => {\n const { title, description } = useDictionary(copyContentContent);\n\n return (\n <Popover identifier=\"copy\">\n <CopyButton content={code} />\n\n <Popover.Detail\n identifier=\"copy\"\n className=\"flex flex-col gap-3 p-3 min-w-64 text-sm\"\n xAlign=\"end\"\n >\n <strong>{title}</strong>\n <p className=\"text-neutral\">{description}</p>\n </Popover.Detail>\n </Popover>\n );\n};\n"],"names":[],"mappings":";;;;;;AAYO,MAAM,WAA8B,CAAC,EAAE,WAAW;AACvD,QAAM,EAAE,OAAO,gBAAgB,cAAc,kBAAkB;AAG7D,SAAA,qBAAC,SAAQ,EAAA,YAAW,QAClB,UAAA;AAAA,IAAC,oBAAA,YAAA,EAAW,SAAS,KAAM,CAAA;AAAA,IAE3B;AAAA,MAAC,QAAQ;AAAA,MAAR;AAAA,QACC,YAAW;AAAA,QACX,WAAU;AAAA,QACV,QAAO;AAAA,QAEP,UAAA;AAAA,UAAA,oBAAC,YAAQ,UAAM,MAAA,CAAA;AAAA,UACd,oBAAA,KAAA,EAAE,WAAU,gBAAgB,UAAY,YAAA,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAC3C,GACF;AAEJ;"}
@@ -5,8 +5,8 @@ const jsxRuntime = require("react/jsx-runtime");
5
5
  const react = require("@monaco-editor/react");
6
6
  const ReactExports = require("react");
7
7
  const utils_cn = require("../../utils/cn.cjs");
8
+ const components_CopyButton_index = require("../CopyButton/index.cjs");
8
9
  const components_Loader_index = require("../Loader/index.cjs");
9
- const components_IDE_CopyButton = require("./CopyButton.cjs");
10
10
  const MonacoCode = ({
11
11
  children,
12
12
  language,
@@ -79,7 +79,7 @@ const MonacoCode = ({
79
79
  "div",
80
80
  {
81
81
  className: utils_cn.cn("absolute bottom-0 right-2 flex h-7 items-center"),
82
- children: /* @__PURE__ */ jsxRuntime.jsx(components_IDE_CopyButton.CopyButton, { content: children })
82
+ children: /* @__PURE__ */ jsxRuntime.jsx(components_CopyButton_index.CopyButton, { content: children })
83
83
  }
84
84
  ) }),
85
85
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -1 +1 @@
1
- {"version":3,"file":"MonacoCode.cjs","sources":["../../../src/components/IDE/MonacoCode.tsx"],"sourcesContent":["'use client';\n\nimport { type OnChange, type OnMount, Editor } from '@monaco-editor/react';\nimport { type FC, useState, useRef, useMemo } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Loader } from '../Loader';\nimport { CopyButton } from './CopyButton';\n\ntype CodeCompProps = {\n children: string;\n language: string;\n isDarkMode?: boolean;\n showLineNumbers?: boolean;\n showCopyButton?: boolean;\n isReadOnly?: boolean;\n onChange?: OnChange;\n};\n\nexport const MonacoCode: FC<CodeCompProps> = ({\n children,\n language,\n isDarkMode,\n showLineNumbers,\n showCopyButton = true,\n isReadOnly = false,\n onChange,\n}) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const ideRef = useRef(null);\n const [editorSize, setEditorSize] = useState<{\n height: number;\n width: number;\n }>({ height: 0, width: 0 });\n\n const theme = useMemo(\n () => (isDarkMode ? 'vs-dark-transparent' : 'hc-light-theme'),\n [isDarkMode]\n );\n\n const handleMountIde: OnMount = (editor, monaco) => {\n // first time you set the height based on content Height\n\n ideRef.current = editor as any;\n const contentHeight = (editor.getContentHeight() ?? 0) + 25;\n\n monaco.editor.defineTheme('vs-dark-transparent', {\n base: 'vs-dark',\n inherit: true,\n rules: [],\n colors: {\n 'editor.background': '#00000000',\n },\n });\n monaco.editor.defineTheme('hc-light-theme', {\n base: 'vs',\n inherit: true,\n rules: [],\n colors: {\n 'editor.background': '#00000000',\n },\n });\n\n monaco.editor.setTheme(theme);\n\n // Disable TypeScript diagnostics\n monaco.languages.typescript.typescriptDefaults.setDiagnosticsOptions({\n noSemanticValidation: true, // Disables type checking\n noSyntaxValidation: true, // Disables syntax errors\n });\n\n // Disable JavaScript diagnostics\n monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({\n noSemanticValidation: true,\n noSyntaxValidation: true,\n });\n\n // Disable unnecessary language features (e.g., suggestions, quick fixes)\n monaco.languages.typescript.typescriptDefaults.setCompilerOptions({\n noLib: true,\n allowNonTsExtensions: true,\n });\n\n monaco.languages.typescript.javascriptDefaults.setCompilerOptions({\n noLib: true,\n allowNonTsExtensions: true,\n });\n\n setEditorSize({\n height: contentHeight,\n width: containerRef.current?.clientWidth ?? 0,\n });\n };\n\n const isShowLineNumbers = showLineNumbers ?? children.split('\\n').length > 1;\n\n return (\n <div\n className={cn(\n 'relative h-full w-full text-sm',\n showLineNumbers && 'ml-0'\n )}\n >\n {showCopyButton && (\n <div className=\"sticky top-5 z-10\">\n <div\n className={cn('absolute bottom-0 right-2 flex h-7 items-center')}\n >\n <CopyButton content={children} />\n </div>\n </div>\n )}\n <div\n className=\"z-0 grid size-full grid-cols-[0px] overflow-auto\"\n ref={containerRef}\n >\n <Editor\n {...editorSize}\n defaultLanguage=\"typescript\"\n language={language}\n loading={<Loader />}\n defaultValue={String(children).replace(/\\n$/, '')}\n onMount={handleMountIde}\n onChange={onChange}\n options={{\n readOnly: isReadOnly,\n cursorStyle: 'line',\n minimap: { enabled: false },\n scrollbar: {\n vertical: 'hidden',\n verticalScrollbarSize: 0,\n alwaysConsumeMouseWheel: false,\n },\n folding: false, // Disable code folding\n renderValidationDecorations: 'off', // Disable error/warning decorations\n quickSuggestions: false, // Disable IntelliSense\n parameterHints: { enabled: false }, // Disable parameter hints\n suggestOnTriggerCharacters: false, // Disable suggestions on typing\n\n mouseWheelScrollSensitivity: 0,\n fastScrollSensitivity: 0,\n scrollBeyondLastLine: false,\n lineNumbers: isShowLineNumbers ? 'on' : 'off',\n }}\n theme={theme}\n className=\"my-2 rounded-md\"\n />\n </div>\n </div>\n );\n};\n"],"names":["useRef","useState","useMemo","jsxs","cn","jsx","CopyButton","Editor","Loader"],"mappings":";;;;;;;;;AAkBO,MAAM,aAAgC,CAAC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb;AACF,MAAM;AACE,QAAA,eAAeA,oBAAuB,IAAI;AAC1C,QAAA,SAASA,oBAAO,IAAI;AACpB,QAAA,CAAC,YAAY,aAAa,IAAIC,aAAA,SAGjC,EAAE,QAAQ,GAAG,OAAO,GAAG;AAE1B,QAAM,QAAQC,aAAA;AAAA,IACZ,MAAO,aAAa,wBAAwB;AAAA,IAC5C,CAAC,UAAU;AAAA,EACb;AAEM,QAAA,iBAA0B,CAAC,QAAQ,WAAW;AAGlD,WAAO,UAAU;AACjB,UAAM,iBAAiB,OAAO,iBAAiB,KAAK,KAAK;AAElD,WAAA,OAAO,YAAY,uBAAuB;AAAA,MAC/C,MAAM;AAAA,MACN,SAAS;AAAA,MACT,OAAO,CAAC;AAAA,MACR,QA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ACV,KAAK;AAAA,YAEL,UAAAA,2BAAA;AAAA,cAACE,MAAA;AAAA,cAAA;AAAA,gBACE,GAAG;AAAA,gBACJ,iBAAgB;AAAA,gBAChB;AAAA,gBACA,wCAAUC,wBAAO,QAAA,EAAA;AAAA,gBACjB,cAAc,OAAO,QAAQ,EAAE,QAAQ,OAAO,EAAE;AAAA,gBAChD,SAAS;AAAA,gBACT;AAAA,gBACA,SAAS;AAAA,kBACP,UAAU;AAAA,kBACV,aAAa;AAAA,kBACb,SAAS,EAAE,SAAS,MAAM;AAAA,kBAC1B,WAAW;AAAA,oBACT,UAAU;AAAA,oBACV,uBAAuB;AAAA,oBACvB,yBAAyB;AAAA,kBAC3B;AAAA,kBACA,SAAS;AAAA;AAAA,kBACT,6BAA6B;AAAA;AAAA,kBAC7B,kBAAkB;AAAA;AAAA,kBAClB,gBAAgB,EAAE,SAAS,MAAM;AAAA;AAAA,kBACjC,4BAA4B;AAAA;AAAA,kBAE5B,6BAA6B;AAAA,kBAC7B,uBAAuB;AAAA,kBACvB,sBAAsB;AAAA,kBACtB,aAAa,oBAAoB,OAAO;AAAA,gBAC1C;AAAA,gBACA;AAAA,gBACA,WAAU;AAAA,cAAA;AAAA,YAAA;AAAA,UACZ;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EACF;AAEJ;;"}
1
+ {"version":3,"file":"MonacoCode.cjs","sources":["../../../src/components/IDE/MonacoCode.tsx"],"sourcesContent":["'use client';\n\nimport { type OnChange, type OnMount, Editor } from '@monaco-editor/react';\nimport { type FC, useMemo, useRef, useState } from 'react';\nimport { cn } from '../../utils/cn';\nimport { CopyButton } from '../CopyButton';\nimport { Loader } from '../Loader';\n\ntype CodeCompProps = {\n children: string;\n language: string;\n isDarkMode?: boolean;\n showLineNumbers?: boolean;\n showCopyButton?: boolean;\n isReadOnly?: boolean;\n onChange?: OnChange;\n};\n\nexport const MonacoCode: FC<CodeCompProps> = ({\n children,\n language,\n isDarkMode,\n showLineNumbers,\n showCopyButton = true,\n isReadOnly = false,\n onChange,\n}) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const ideRef = useRef(null);\n const [editorSize, setEditorSize] = useState<{\n height: number;\n width: number;\n }>({ height: 0, width: 0 });\n\n const theme = useMemo(\n () => (isDarkMode ? 'vs-dark-transparent' : 'hc-light-theme'),\n [isDarkMode]\n );\n\n const handleMountIde: OnMount = (editor, monaco) => {\n // first time you set the height based on content Height\n\n ideRef.current = editor as any;\n const contentHeight = (editor.getContentHeight() ?? 0) + 25;\n\n monaco.editor.defineTheme('vs-dark-transparent', {\n base: 'vs-dark',\n inherit: true,\n rules: [],\n colors: {\n 'editor.background': '#00000000',\n },\n });\n monaco.editor.defineTheme('hc-light-theme', {\n base: 'vs',\n inherit: true,\n rules: [],\n colors: {\n 'editor.background': '#00000000',\n },\n });\n\n monaco.editor.setTheme(theme);\n\n // Disable TypeScript diagnostics\n monaco.languages.typescript.typescriptDefaults.setDiagnosticsOptions({\n noSemanticValidation: true, // Disables type checking\n noSyntaxValidation: true, // Disables syntax errors\n });\n\n // Disable JavaScript diagnostics\n monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({\n noSemanticValidation: true,\n noSyntaxValidation: true,\n });\n\n // Disable unnecessary language features (e.g., suggestions, quick fixes)\n monaco.languages.typescript.typescriptDefaults.setCompilerOptions({\n noLib: true,\n allowNonTsExtensions: true,\n });\n\n monaco.languages.typescript.javascriptDefaults.setCompilerOptions({\n noLib: true,\n allowNonTsExtensions: true,\n });\n\n setEditorSize({\n height: contentHeight,\n width: containerRef.current?.clientWidth ?? 0,\n });\n };\n\n const isShowLineNumbers = showLineNumbers ?? children.split('\\n').length > 1;\n\n return (\n <div\n className={cn(\n 'relative h-full w-full text-sm',\n showLineNumbers && 'ml-0'\n )}\n >\n {showCopyButton && (\n <div className=\"sticky top-5 z-10\">\n <div\n className={cn('absolute bottom-0 right-2 flex h-7 items-center')}\n >\n <CopyButton content={children} />\n </div>\n </div>\n )}\n <div\n className=\"z-0 grid size-full grid-cols-[0px] overflow-auto\"\n ref={containerRef}\n >\n <Editor\n {...editorSize}\n defaultLanguage=\"typescript\"\n language={language}\n loading={<Loader />}\n defaultValue={String(children).replace(/\\n$/, '')}\n onMount={handleMountIde}\n onChange={onChange}\n options={{\n readOnly: isReadOnly,\n cursorStyle: 'line',\n minimap: { enabled: false },\n scrollbar: {\n vertical: 'hidden',\n verticalScrollbarSize: 0,\n alwaysConsumeMouseWheel: false,\n },\n folding: false, // Disable code folding\n renderValidationDecorations: 'off', // Disable error/warning decorations\n quickSuggestions: false, // Disable IntelliSense\n parameterHints: { enabled: false }, // Disable parameter hints\n suggestOnTriggerCharacters: false, // Disable suggestions on typing\n\n mouseWheelScrollSensitivity: 0,\n fastScrollSensitivity: 0,\n scrollBeyondLastLine: false,\n lineNumbers: isShowLineNumbers ? 'on' : 'off',\n }}\n theme={theme}\n className=\"my-2 rounded-md\"\n />\n </div>\n </div>\n );\n};\n"],"names":["useRef","useState","useMemo","jsxs","cn","jsx","CopyButton","Editor","Loader"],"mappings":";;;;;;;;;AAkBO,MAAM,aAAgC,CAAC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb;AACF,MAAM;AACE,QAAA,eAAeA,oBAAuB,IAAI;AAC1C,QAAA,SAASA,oBAAO,IAAI;AACpB,QAAA,CAAC,YAAY,aAAa,IAAIC,aAAA,SAGjC,EAAE,QAAQ,GAAG,OAAO,GAAG;AAE1B,QAAM,QAAQC,aAAA;AAAA,IACZ,MAAO,aAAa,wBAAwB;AAAA,IAC5C,CAAC,UAAU;AAAA,EACb;AAEM,QAAA,iBAA0B,CAAC,QAAQ,WAAW;AAGlD,WAAO,UAAU;AACjB,UAAM,iBAAiB,OAAO,iBAAiB,KAAK,KAAK;AAElD,WAAA,OAAO,YAAY,uBAAuB;AAAA,MAC/C,MAAM;AAAA,MACN,SAAS;AAAA,MACT,OAAO,CAAC;A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AAU;AAAA,YACV,KAAK;AAAA,YAEL,UAAAA,2BAAA;AAAA,cAACE,MAAA;AAAA,cAAA;AAAA,gBACE,GAAG;AAAA,gBACJ,iBAAgB;AAAA,gBAChB;AAAA,gBACA,wCAAUC,wBAAO,QAAA,EAAA;AAAA,gBACjB,cAAc,OAAO,QAAQ,EAAE,QAAQ,OAAO,EAAE;AAAA,gBAChD,SAAS;AAAA,gBACT;AAAA,gBACA,SAAS;AAAA,kBACP,UAAU;AAAA,kBACV,aAAa;AAAA,kBACb,SAAS,EAAE,SAAS,MAAM;AAAA,kBAC1B,WAAW;AAAA,oBACT,UAAU;AAAA,oBACV,uBAAuB;AAAA,oBACvB,yBAAyB;AAAA,kBAC3B;AAAA,kBACA,SAAS;AAAA;AAAA,kBACT,6BAA6B;AAAA;AAAA,kBAC7B,kBAAkB;AAAA;AAAA,kBAClB,gBAAgB,EAAE,SAAS,MAAM;AAAA;AAAA,kBACjC,4BAA4B;AAAA;AAAA,kBAE5B,6BAA6B;AAAA,kBAC7B,uBAAuB;AAAA,kBACvB,sBAAsB;AAAA,kBACtB,aAAa,oBAAoB,OAAO;AAAA,gBAC1C;AAAA,gBACA;AAAA,gBACA,WAAU;AAAA,cAAA;AAAA,YAAA;AAAA,UACZ;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EACF;AAEJ;;"}
@@ -3,8 +3,8 @@ import { jsxs, jsx } from "react/jsx-runtime";
3
3
  import { Editor } from "@monaco-editor/react";
4
4
  import { useRef, useState, useMemo } from "react";
5
5
  import { cn } from "../../utils/cn.mjs";
6
+ import { CopyButton } from "../CopyButton/index.mjs";
6
7
  import { Loader } from "../Loader/index.mjs";
7
- import { CopyButton } from "./CopyButton.mjs";
8
8
  const MonacoCode = ({
9
9
  children,
10
10
  language,