@sikka/hawa 0.0.263 → 0.0.264
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/styles.css +3 -0
- package/es/index.es.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/src/elements/HawaCodeBlock.tsx +7 -5
- package/src/styles.css +3 -0
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { FC, useState } from "react"
|
|
2
2
|
import clsx from "clsx"
|
|
3
|
+
import { HawaButton } from "./HawaButton"
|
|
3
4
|
|
|
4
5
|
type CodeBlockTypes = {
|
|
5
6
|
color?: "dark" | "light"
|
|
@@ -20,6 +21,7 @@ export const HawaCodeBlock: FC<CodeBlockTypes> = ({
|
|
|
20
21
|
width = "full",
|
|
21
22
|
}) => {
|
|
22
23
|
const [selectedTab, setSelectedTab] = useState(0)
|
|
24
|
+
const [showTooltip, setShowTooltip] = useState(0)
|
|
23
25
|
let widthStyles = {
|
|
24
26
|
full: "w-full",
|
|
25
27
|
md: "w-full max-w-md",
|
|
@@ -59,19 +61,19 @@ export const HawaCodeBlock: FC<CodeBlockTypes> = ({
|
|
|
59
61
|
<pre>
|
|
60
62
|
<code
|
|
61
63
|
className={clsx(
|
|
62
|
-
"flex flex-row items-
|
|
64
|
+
"flex flex-row items-start justify-between rounded bg-gray-800 py-4 pr-4 text-left text-sm text-white sm:text-base",
|
|
63
65
|
// `language-${language}`,
|
|
64
66
|
tabs ? "" : "pl-4"
|
|
65
67
|
)}
|
|
66
68
|
>
|
|
67
69
|
<span className="flex">{tabs ? tabs[selectedTab].code : code}</span>
|
|
68
|
-
<
|
|
70
|
+
<HawaButton margins="none">
|
|
69
71
|
<svg
|
|
70
|
-
onClick={() =>
|
|
72
|
+
onClick={() => {
|
|
71
73
|
navigator.clipboard.writeText(
|
|
72
74
|
tabs ? tabs[selectedTab].code : code
|
|
73
75
|
)
|
|
74
|
-
}
|
|
76
|
+
}}
|
|
75
77
|
stroke="currentColor"
|
|
76
78
|
fill="none"
|
|
77
79
|
stroke-width="2"
|
|
@@ -85,7 +87,7 @@ export const HawaCodeBlock: FC<CodeBlockTypes> = ({
|
|
|
85
87
|
<rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect>
|
|
86
88
|
<path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path>
|
|
87
89
|
</svg>
|
|
88
|
-
</
|
|
90
|
+
</HawaButton>
|
|
89
91
|
</code>
|
|
90
92
|
</pre>
|
|
91
93
|
{/* {tabs.map((tab) => (
|
package/src/styles.css
CHANGED
|
@@ -1168,6 +1168,9 @@ video {
|
|
|
1168
1168
|
.transform {
|
|
1169
1169
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
1170
1170
|
}
|
|
1171
|
+
.transform-gpu {
|
|
1172
|
+
transform: translate3d(var(--tw-translate-x), var(--tw-translate-y), 0) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
1173
|
+
}
|
|
1171
1174
|
@keyframes spin {
|
|
1172
1175
|
|
|
1173
1176
|
to {
|