@julseb-lib/react 0.0.49 → 0.0.50
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.
package/dist/index.cjs.js
CHANGED
|
@@ -3425,7 +3425,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
3425
3425
|
background-color: ${M.GRAY_800};
|
|
3426
3426
|
color: ${({$color:l,theme:e})=>l&&s.AllColors(l,e)};
|
|
3427
3427
|
${s.HideScrollbar}
|
|
3428
|
-
|
|
3428
|
+
tab-size: 4;
|
|
3429
3429
|
|
|
3430
3430
|
& > code {
|
|
3431
3431
|
color: ${({$color:l,theme:e})=>l&&s.AllColors(l,e)};
|
|
@@ -3451,7 +3451,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
3451
3451
|
position: absolute;
|
|
3452
3452
|
top: ${L.S};
|
|
3453
3453
|
right: ${L.M};
|
|
3454
|
-
`;S([j6,_6,S6]);const M1=24,Ad=v.forwardRef(({"data-testid":l,as:e,className:c,children:a,highlighterProps:h,highlighterStyle:d=Rd,color:r,hideCopyButton:i,tooltipTexts:f,icons:o,iconsSizes:p,iconsBaseUrl:z,...n},b)=>{const[k,g]=v.useState(!1),C=()=>{a&&(navigator.clipboard.writeText(
|
|
3454
|
+
`;S([j6,_6,S6]);const M1=24,Ad=v.forwardRef(({"data-testid":l,as:e,className:c,children:a,highlighterProps:h,highlighterStyle:d=Rd,color:r,hideCopyButton:i,tooltipTexts:f,icons:o,iconsSizes:p,iconsBaseUrl:z,...n},b)=>{const[k,g]=v.useState(!1),C=()=>{if(a){let $=a.toString();$[0]==="$"&&($=$.replace("$ ","")),navigator.clipboard.writeText($),g(!0)}setTimeout(()=>g(!1),1e3)},x={icon:(o==null?void 0:o.copy)??t.jsx(Nl,{"data-testid":l&&`${l}.CopyButton.IconCopy`,className:c&&"IconCopy",size:(p==null?void 0:p.copy)??r2(M1)}),tooltip:(f==null?void 0:f.copy)??"Copy"},H={icon:(o==null?void 0:o.copied)??t.jsx(J1,{"data-testid":l&&`${l}.CopyButton.IconCopied`,className:c&&"IconCopied",size:(p==null?void 0:p.copied)??r2(M1)}),tooltip:(f==null?void 0:f.copy)??"Copied!"};return t.jsxs(j6,{"data-testid":l,ref:b,className:c,as:e||r?"pre":"div",...n,children:[t.jsx(_6,{"data-testid":l&&`${l}.SyntaxHighlighter`,className:c&&"SyntaxHighlighter",style:d,$color:r,...h,children:a}),!i&&t.jsx(S6,{"data-testid":l&&`${l}.CopyButton`,className:c&&"CopyButton",onClick:C,icon:k?H.icon:x.icon,size:32,color:k?"success":"white",tooltip:k?H.tooltip:x.tooltip,iconBaseUrl:z,showTooltip:!0})]})}),I6=m.div`
|
|
3455
3455
|
opacity: 0;
|
|
3456
3456
|
transform: translateX(calc(${L.S} * -1));
|
|
3457
3457
|
transition: opacity 0.4s ease-out, transform 0.8s ease-out;
|
package/dist/index.es.js
CHANGED
|
@@ -19228,7 +19228,7 @@ const Ni = C(
|
|
|
19228
19228
|
background-color: ${v.GRAY_800};
|
|
19229
19229
|
color: ${({ $color: l, theme: c }) => l && m.AllColors(l, c)};
|
|
19230
19230
|
${m.HideScrollbar}
|
|
19231
|
-
|
|
19231
|
+
tab-size: 4;
|
|
19232
19232
|
|
|
19233
19233
|
& > code {
|
|
19234
19234
|
color: ${({ $color: l, theme: c }) => l && m.AllColors(l, c)};
|
|
@@ -19277,7 +19277,11 @@ const L1 = 24, Vi = C(
|
|
|
19277
19277
|
...z
|
|
19278
19278
|
}, g) => {
|
|
19279
19279
|
const [M, n] = P(!1), H = () => {
|
|
19280
|
-
|
|
19280
|
+
if (a) {
|
|
19281
|
+
let $ = a.toString();
|
|
19282
|
+
$[0] === "$" && ($ = $.replace("$ ", "")), navigator.clipboard.writeText($), n(!0);
|
|
19283
|
+
}
|
|
19284
|
+
setTimeout(() => n(!1), 1e3);
|
|
19281
19285
|
}, u = {
|
|
19282
19286
|
icon: (s == null ? void 0 : s.copy) ?? /* @__PURE__ */ t.jsx(
|
|
19283
19287
|
Vl,
|
package/dist/index.umd.js
CHANGED
|
@@ -3425,7 +3425,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
3425
3425
|
background-color: ${M.GRAY_800};
|
|
3426
3426
|
color: ${({$color:l,theme:c})=>l&&s.AllColors(l,c)};
|
|
3427
3427
|
${s.HideScrollbar}
|
|
3428
|
-
|
|
3428
|
+
tab-size: 4;
|
|
3429
3429
|
|
|
3430
3430
|
& > code {
|
|
3431
3431
|
color: ${({$color:l,theme:c})=>l&&s.AllColors(l,c)};
|
|
@@ -3451,7 +3451,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
3451
3451
|
position: absolute;
|
|
3452
3452
|
top: ${S.S};
|
|
3453
3453
|
right: ${S.M};
|
|
3454
|
-
`;I([p6,n6,v6]);const M6=24,Re=n.forwardRef(({"data-testid":l,as:c,className:e,children:a,highlighterProps:h,highlighterStyle:d=Ae,color:f,hideCopyButton:i,tooltipTexts:r,icons:o,iconsSizes:z,iconsBaseUrl:p,...v},b)=>{const[k,g]=n.useState(!1),A=()=>{a&&(navigator.clipboard.writeText(
|
|
3454
|
+
`;I([p6,n6,v6]);const M6=24,Re=n.forwardRef(({"data-testid":l,as:c,className:e,children:a,highlighterProps:h,highlighterStyle:d=Ae,color:f,hideCopyButton:i,tooltipTexts:r,icons:o,iconsSizes:z,iconsBaseUrl:p,...v},b)=>{const[k,g]=n.useState(!1),A=()=>{if(a){let R=a.toString();R[0]==="$"&&(R=R.replace("$ ","")),navigator.clipboard.writeText(R),g(!0)}setTimeout(()=>g(!1),1e3)},H={icon:(o==null?void 0:o.copy)??t.jsx(hl,{"data-testid":l&&`${l}.CopyButton.IconCopy`,className:e&&"IconCopy",size:(z==null?void 0:z.copy)??r2(M6)}),tooltip:(r==null?void 0:r.copy)??"Copy"},y={icon:(o==null?void 0:o.copied)??t.jsx(v1,{"data-testid":l&&`${l}.CopyButton.IconCopied`,className:e&&"IconCopied",size:(z==null?void 0:z.copied)??r2(M6)}),tooltip:(r==null?void 0:r.copy)??"Copied!"};return t.jsxs(p6,{"data-testid":l,ref:b,className:e,as:c||f?"pre":"div",...v,children:[t.jsx(n6,{"data-testid":l&&`${l}.SyntaxHighlighter`,className:e&&"SyntaxHighlighter",style:d,$color:f,...h,children:a}),!i&&t.jsx(v6,{"data-testid":l&&`${l}.CopyButton`,className:e&&"CopyButton",onClick:A,icon:k?y.icon:H.icon,size:32,color:k?"success":"white",tooltip:k?y.tooltip:H.tooltip,iconBaseUrl:p,showTooltip:!0})]})}),g6=m.div`
|
|
3455
3455
|
opacity: 0;
|
|
3456
3456
|
transform: translateX(calc(${S.S} * -1));
|
|
3457
3457
|
transition: opacity 0.4s ease-out, transform 0.8s ease-out;
|
|
@@ -53,7 +53,13 @@ export const CodeContainer = forwardRef<HTMLDivElement, ILibCodeContainer>(
|
|
|
53
53
|
|
|
54
54
|
const copyToClipboard = () => {
|
|
55
55
|
if (children) {
|
|
56
|
-
|
|
56
|
+
let copyString = children.toString()
|
|
57
|
+
|
|
58
|
+
if (copyString[0] === "$") {
|
|
59
|
+
copyString = copyString.replace("$ ", "")
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
navigator.clipboard.writeText(copyString)
|
|
57
63
|
setHasCopied(true)
|
|
58
64
|
}
|
|
59
65
|
|
|
@@ -20,7 +20,7 @@ const StyledCodeContainer = styled.div<{ $color?: LibAllColors }>`
|
|
|
20
20
|
background-color: ${COLORS_LIGHT.GRAY_800};
|
|
21
21
|
color: ${({ $color, theme }) => $color && Mixins.AllColors($color, theme)};
|
|
22
22
|
${Mixins.HideScrollbar}
|
|
23
|
-
|
|
23
|
+
tab-size: 4;
|
|
24
24
|
|
|
25
25
|
& > code {
|
|
26
26
|
color: ${({ $color, theme }) =>
|