@mittwald/flow-react-components 0.1.0-alpha.289 → 0.1.0-alpha.290
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/CodeBlock.js +38 -0
- package/dist/CopyButton-5wgohMM6.js +40 -0
- package/dist/CopyButton.js +3 -37
- package/dist/styles.css +1 -1
- package/dist/types/components/CodeBlock/CodeBlock.d.ts +10 -0
- package/dist/types/components/CodeBlock/index.d.ts +3 -0
- package/dist/types/components/CodeBlock/stories/Default.stories.d.ts +10 -0
- package/package.json +10 -4
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import e from "react";
|
|
4
|
+
import d from "react-syntax-highlighter";
|
|
5
|
+
import m from "clsx";
|
|
6
|
+
import { C as f } from "./CopyButton-5wgohMM6.js";
|
|
7
|
+
const i = "flow--code-block", k = "flow--code-block--light", u = "flow--code-block--dark", l = {
|
|
8
|
+
codeBlock: i,
|
|
9
|
+
default: "flow--code-block--default",
|
|
10
|
+
light: k,
|
|
11
|
+
dark: u
|
|
12
|
+
}, h = (c) => {
|
|
13
|
+
const { code: t, className: a, copyable: r, color: o = "default", ...s } = c, n = m(l.codeBlock, l[o], a);
|
|
14
|
+
return /* @__PURE__ */ e.createElement("div", { className: n }, /* @__PURE__ */ e.createElement(
|
|
15
|
+
d,
|
|
16
|
+
{
|
|
17
|
+
customStyle: {
|
|
18
|
+
background: "none",
|
|
19
|
+
padding: "none",
|
|
20
|
+
margin: "none"
|
|
21
|
+
},
|
|
22
|
+
useInlineStyles: !1,
|
|
23
|
+
...s
|
|
24
|
+
},
|
|
25
|
+
t
|
|
26
|
+
), r && /* @__PURE__ */ e.createElement(
|
|
27
|
+
f,
|
|
28
|
+
{
|
|
29
|
+
size: "s",
|
|
30
|
+
color: o === "default" ? "dark" : o,
|
|
31
|
+
text: t
|
|
32
|
+
}
|
|
33
|
+
));
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
h as CodeBlock,
|
|
37
|
+
h as default
|
|
38
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import o from "react";
|
|
4
|
+
import i from "copy-to-clipboard";
|
|
5
|
+
import { B as c } from "./Button-Da1fC2tj.js";
|
|
6
|
+
import "@tabler/icons-react";
|
|
7
|
+
import "./Icon-COqUQ8Af.js";
|
|
8
|
+
import { I as l } from "./IconCopy-DjisJX3k.js";
|
|
9
|
+
import { useLocalizedStringFormatter as s } from "react-aria";
|
|
10
|
+
import { a as f, T as u } from "./TooltipTrigger-TslkLN5s.js";
|
|
11
|
+
import { onlyText as y } from "react-children-utilities";
|
|
12
|
+
import { C } from "./ClearPropsContext-CUvsbMn8.js";
|
|
13
|
+
import "./propsContext-DzAKlmhS.js";
|
|
14
|
+
import "@react-aria/utils";
|
|
15
|
+
import "remeda";
|
|
16
|
+
import "dot-prop";
|
|
17
|
+
import { f as E } from "./flowComponent-uZXy7sF4.js";
|
|
18
|
+
import { A as B } from "./Action-A7BoAz3C.js";
|
|
19
|
+
const g = { "de-DE": {
|
|
20
|
+
"copyButton.copy": "Kopieren"
|
|
21
|
+
}, "en-EN": {
|
|
22
|
+
"copyButton.copy": "Copy"
|
|
23
|
+
} }, R = E("CopyButton", (r) => {
|
|
24
|
+
const { text: e, refProp: n, variant: p = "plain", ...m } = r, t = s(g).format("copyButton.copy"), a = () => {
|
|
25
|
+
i(y(e));
|
|
26
|
+
};
|
|
27
|
+
return /* @__PURE__ */ o.createElement(C, null, /* @__PURE__ */ o.createElement(f, null, /* @__PURE__ */ o.createElement(B, { action: a, showFeedback: !0 }, /* @__PURE__ */ o.createElement(
|
|
28
|
+
c,
|
|
29
|
+
{
|
|
30
|
+
"aria-label": t,
|
|
31
|
+
...m,
|
|
32
|
+
ref: n,
|
|
33
|
+
variant: p
|
|
34
|
+
},
|
|
35
|
+
/* @__PURE__ */ o.createElement(l, null)
|
|
36
|
+
)), /* @__PURE__ */ o.createElement(u, null, t)));
|
|
37
|
+
});
|
|
38
|
+
export {
|
|
39
|
+
R as C
|
|
40
|
+
};
|
package/dist/CopyButton.js
CHANGED
|
@@ -1,41 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
import
|
|
4
|
-
import i from "copy-to-clipboard";
|
|
5
|
-
import { B as l } from "./Button-Da1fC2tj.js";
|
|
6
|
-
import "@tabler/icons-react";
|
|
7
|
-
import "./Icon-COqUQ8Af.js";
|
|
8
|
-
import { I as c } from "./IconCopy-DjisJX3k.js";
|
|
9
|
-
import { useLocalizedStringFormatter as s } from "react-aria";
|
|
10
|
-
import { a as f, T as u } from "./TooltipTrigger-TslkLN5s.js";
|
|
11
|
-
import { onlyText as y } from "react-children-utilities";
|
|
12
|
-
import { C } from "./ClearPropsContext-CUvsbMn8.js";
|
|
13
|
-
import "./propsContext-DzAKlmhS.js";
|
|
14
|
-
import "@react-aria/utils";
|
|
15
|
-
import "remeda";
|
|
16
|
-
import "dot-prop";
|
|
17
|
-
import { f as E } from "./flowComponent-uZXy7sF4.js";
|
|
18
|
-
import { A as B } from "./Action-A7BoAz3C.js";
|
|
19
|
-
const g = { "de-DE": {
|
|
20
|
-
"copyButton.copy": "Kopieren"
|
|
21
|
-
}, "en-EN": {
|
|
22
|
-
"copyButton.copy": "Copy"
|
|
23
|
-
} }, R = E("CopyButton", (r) => {
|
|
24
|
-
const { text: e, refProp: n, variant: p = "plain", ...m } = r, t = s(g).format("copyButton.copy"), a = () => {
|
|
25
|
-
i(y(e));
|
|
26
|
-
};
|
|
27
|
-
return /* @__PURE__ */ o.createElement(C, null, /* @__PURE__ */ o.createElement(f, null, /* @__PURE__ */ o.createElement(B, { action: a, showFeedback: !0 }, /* @__PURE__ */ o.createElement(
|
|
28
|
-
l,
|
|
29
|
-
{
|
|
30
|
-
"aria-label": t,
|
|
31
|
-
...m,
|
|
32
|
-
ref: n,
|
|
33
|
-
variant: p
|
|
34
|
-
},
|
|
35
|
-
/* @__PURE__ */ o.createElement(c, null)
|
|
36
|
-
)), /* @__PURE__ */ o.createElement(u, null, t)));
|
|
37
|
-
});
|
|
3
|
+
import { C as t } from "./CopyButton-5wgohMM6.js";
|
|
38
4
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
5
|
+
t as CopyButton,
|
|
6
|
+
t as default
|
|
41
7
|
};
|