govuk-chakra 0.1.4 → 0.1.5
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/README.md +26 -2
- package/dist/CodeBlock-COWssyP1.mjs +454 -0
- package/dist/CodeBlock-COWssyP1.mjs.map +1 -0
- package/dist/CodeBlock-D5HlsQKE.js +2 -0
- package/dist/CodeBlock-D5HlsQKE.js.map +1 -0
- package/dist/chakra.cjs +1 -1
- package/dist/chakra.mjs +4 -4
- package/dist/editor.cjs +1 -1
- package/dist/editor.cjs.map +1 -1
- package/dist/editor.mjs +46 -348
- package/dist/editor.mjs.map +1 -1
- package/dist/govuk-chakra-C_Tky_0D.js +2 -0
- package/dist/{govuk-chakra-tIrdgNx6.js.map → govuk-chakra-C_Tky_0D.js.map} +1 -1
- package/dist/{govuk-chakra-DM6zTEdn.mjs → govuk-chakra-DTBFpLhp.mjs} +140 -140
- package/dist/{govuk-chakra-DM6zTEdn.mjs.map → govuk-chakra-DTBFpLhp.mjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +4 -4
- package/dist/types/govuk-chakra.d.ts +2 -0
- package/package.json +5 -5
- package/dist/Button-BmDGyjW7.mjs +0 -149
- package/dist/Button-BmDGyjW7.mjs.map +0 -1
- package/dist/Button-DZLug9I8.js +0 -2
- package/dist/Button-DZLug9I8.js.map +0 -1
- package/dist/govuk-chakra-tIrdgNx6.js +0 -2
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@ yarn add govuk-chakra @emotion/react @emotion/styled framer-motion react react-d
|
|
|
51
51
|
|
|
52
52
|
### Optional peer dependencies
|
|
53
53
|
|
|
54
|
-
Chart
|
|
54
|
+
Chart and rich text editor components are **not included in the main entry point**. They live in separate entry points so your app only pays the cost of the deps it actually uses. `CodeBlock` is available from both `govuk-chakra` and `govuk-chakra/editor` and requires `shiki`.
|
|
55
55
|
|
|
56
56
|
| Entry point | Install | Components |
|
|
57
57
|
| --------------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -197,7 +197,7 @@ export function ExamplePage() {
|
|
|
197
197
|
|
|
198
198
|
- `govuk-chakra`
|
|
199
199
|
Single combined barrel with Chakra UI exports plus local GOV.UK-styled overrides.
|
|
200
|
-
Does **not** include charts
|
|
200
|
+
Includes the GOV.UK-styled `CodeBlock` compound component. Its `CodeBlock.CopyButton` helper takes precedence over Chakra's base `CodeBlock` export. Does **not** include charts or `RichTextEditor` — use the dedicated entry points for those.
|
|
201
201
|
|
|
202
202
|
- `govuk-chakra/charts`
|
|
203
203
|
All chart components. Requires `@chakra-ui/charts` and `recharts` to be installed.
|
|
@@ -231,6 +231,30 @@ import { BarChart, LineChart } from 'govuk-chakra/charts'
|
|
|
231
231
|
import { CodeBlock, RichTextEditor } from 'govuk-chakra/editor'
|
|
232
232
|
```
|
|
233
233
|
|
|
234
|
+
`CodeBlock` can also be imported from the main entry point:
|
|
235
|
+
|
|
236
|
+
```tsx
|
|
237
|
+
import { CodeBlock } from 'govuk-chakra'
|
|
238
|
+
|
|
239
|
+
export function ExampleCodeBlock({ source }: { source: string }) {
|
|
240
|
+
return (
|
|
241
|
+
<CodeBlock.Root code={source} language="typescript">
|
|
242
|
+
<CodeBlock.Header>
|
|
243
|
+
<CodeBlock.Title>example.ts</CodeBlock.Title>
|
|
244
|
+
<CodeBlock.Control>
|
|
245
|
+
<CodeBlock.CopyButton />
|
|
246
|
+
</CodeBlock.Control>
|
|
247
|
+
</CodeBlock.Header>
|
|
248
|
+
<CodeBlock.Content>
|
|
249
|
+
<CodeBlock.Code>
|
|
250
|
+
<CodeBlock.CodeText />
|
|
251
|
+
</CodeBlock.Code>
|
|
252
|
+
</CodeBlock.Content>
|
|
253
|
+
</CodeBlock.Root>
|
|
254
|
+
)
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
234
258
|
## Theme
|
|
235
259
|
|
|
236
260
|
If you want direct access to the Chakra system rather than the convenience provider:
|
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
import { o as e } from "./px-to-rem-DcgNLA9k.mjs";
|
|
2
|
+
import { c as t, n, u as r } from "./lu-7Alw9EuV.mjs";
|
|
3
|
+
import { t as i } from "./fa-Dc0gK-Y2.mjs";
|
|
4
|
+
import { Button as a, ClientOnly as o, CodeBlock as s, IconButton as c, Skeleton as l, Span as u, createShikiAdapter as d } from "@chakra-ui/react";
|
|
5
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
6
|
+
import * as m from "react";
|
|
7
|
+
import { forwardRef as h } from "react";
|
|
8
|
+
//#region src/utils/shiki-adapter.ts
|
|
9
|
+
var g = [
|
|
10
|
+
"bash",
|
|
11
|
+
"html",
|
|
12
|
+
"javascript",
|
|
13
|
+
"json",
|
|
14
|
+
"python",
|
|
15
|
+
"tsx",
|
|
16
|
+
"typescript"
|
|
17
|
+
], _ = ["github-light", "github-dark"], v = {
|
|
18
|
+
light: "github-light",
|
|
19
|
+
dark: "github-dark"
|
|
20
|
+
}, y = g, b = _, x = d({
|
|
21
|
+
async load() {
|
|
22
|
+
let { createHighlighter: e } = await import("shiki");
|
|
23
|
+
return e({
|
|
24
|
+
langs: g,
|
|
25
|
+
themes: _
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
theme: v
|
|
29
|
+
});
|
|
30
|
+
function S({ languages: e = g, themes: t = _, theme: n = v } = {}) {
|
|
31
|
+
return d({
|
|
32
|
+
async load() {
|
|
33
|
+
let { createHighlighter: n } = await import("shiki");
|
|
34
|
+
return n({
|
|
35
|
+
langs: e,
|
|
36
|
+
themes: t
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
theme: n
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/components/Button/buttonVariants.ts
|
|
44
|
+
var C = {
|
|
45
|
+
outline: "none",
|
|
46
|
+
bgColor: "yellow.500",
|
|
47
|
+
color: "gray.950"
|
|
48
|
+
}, w = {
|
|
49
|
+
primary: {
|
|
50
|
+
bgColor: "green.500",
|
|
51
|
+
color: "white",
|
|
52
|
+
boxShadow: "0 2px 0 {colors.green.800}",
|
|
53
|
+
_hover: {
|
|
54
|
+
bgColor: "green.700",
|
|
55
|
+
color: "white",
|
|
56
|
+
_focus: C,
|
|
57
|
+
_focusVisible: C
|
|
58
|
+
},
|
|
59
|
+
_focus: C,
|
|
60
|
+
_focusVisible: C
|
|
61
|
+
},
|
|
62
|
+
secondary: {
|
|
63
|
+
color: "gray.900",
|
|
64
|
+
bgColor: "gray.50",
|
|
65
|
+
_dark: {
|
|
66
|
+
color: "gray.50",
|
|
67
|
+
bgColor: "gray.600",
|
|
68
|
+
_hover: {
|
|
69
|
+
bgColor: "gray.600",
|
|
70
|
+
_focus: C,
|
|
71
|
+
_focusVisible: C
|
|
72
|
+
},
|
|
73
|
+
_focus: C,
|
|
74
|
+
_focusVisible: C
|
|
75
|
+
},
|
|
76
|
+
boxShadow: "0 2px 0 {colors.gray.200}",
|
|
77
|
+
_hover: {
|
|
78
|
+
bgColor: "gray.100",
|
|
79
|
+
_focus: C,
|
|
80
|
+
_focusVisible: C
|
|
81
|
+
},
|
|
82
|
+
_focus: C,
|
|
83
|
+
_focusVisible: C
|
|
84
|
+
},
|
|
85
|
+
error: {
|
|
86
|
+
bgColor: "border.error",
|
|
87
|
+
color: "white",
|
|
88
|
+
boxShadow: "0 2px 0 {colors.red.800}",
|
|
89
|
+
_hover: {
|
|
90
|
+
bgColor: "red.700",
|
|
91
|
+
_focus: C,
|
|
92
|
+
_focusVisible: C
|
|
93
|
+
},
|
|
94
|
+
_focus: C,
|
|
95
|
+
_focusVisible: C
|
|
96
|
+
},
|
|
97
|
+
inverse: {
|
|
98
|
+
bgColor: "bg",
|
|
99
|
+
color: "blue.500",
|
|
100
|
+
boxShadow: "0 2px 0 {colors.blue.700}",
|
|
101
|
+
_dark: {
|
|
102
|
+
bgColor: "blue.900",
|
|
103
|
+
color: "blue.50",
|
|
104
|
+
_hover: {
|
|
105
|
+
color: "blue.50",
|
|
106
|
+
bgColor: "blue.800",
|
|
107
|
+
_focus: C,
|
|
108
|
+
_focusVisible: C
|
|
109
|
+
},
|
|
110
|
+
_focus: C,
|
|
111
|
+
_focusVisible: C
|
|
112
|
+
},
|
|
113
|
+
_hover: {
|
|
114
|
+
color: "blue.700",
|
|
115
|
+
bgColor: "blue.100",
|
|
116
|
+
_focus: C,
|
|
117
|
+
_focusVisible: C
|
|
118
|
+
},
|
|
119
|
+
_focus: C,
|
|
120
|
+
_focusVisible: C
|
|
121
|
+
},
|
|
122
|
+
plain: {
|
|
123
|
+
bgColor: "transparent",
|
|
124
|
+
color: "fg",
|
|
125
|
+
_dark: {
|
|
126
|
+
_hover: {
|
|
127
|
+
color: "gray.50",
|
|
128
|
+
bgColor: "gray.800",
|
|
129
|
+
_focus: C,
|
|
130
|
+
_focusVisible: C
|
|
131
|
+
},
|
|
132
|
+
_focus: C,
|
|
133
|
+
_focusVisible: C
|
|
134
|
+
},
|
|
135
|
+
_hover: {
|
|
136
|
+
color: "gray.700",
|
|
137
|
+
bgColor: "gray.100",
|
|
138
|
+
_focus: C,
|
|
139
|
+
_focusVisible: C
|
|
140
|
+
},
|
|
141
|
+
_focus: C,
|
|
142
|
+
_focusVisible: C
|
|
143
|
+
},
|
|
144
|
+
link: {
|
|
145
|
+
bgColor: "transparent",
|
|
146
|
+
color: "blue.500",
|
|
147
|
+
textDecoration: "underline",
|
|
148
|
+
boxShadow: "none",
|
|
149
|
+
_hover: {
|
|
150
|
+
color: "blue.700",
|
|
151
|
+
_focus: C,
|
|
152
|
+
_focusVisible: C
|
|
153
|
+
},
|
|
154
|
+
_focus: C,
|
|
155
|
+
_focusVisible: C
|
|
156
|
+
}
|
|
157
|
+
}, T = h(({ variant: t = "primary", children: n, startButton: r, ...i }, o) => /* @__PURE__ */ p(a, {
|
|
158
|
+
ref: o,
|
|
159
|
+
borderRadius: "0",
|
|
160
|
+
fontSize: "1.1875rem",
|
|
161
|
+
bg: "green.500",
|
|
162
|
+
color: "white",
|
|
163
|
+
boxShadow: "0 2px 0 {colors.green.900}",
|
|
164
|
+
fontFamily: "body",
|
|
165
|
+
fontWeight: r ? "bold" : "normal",
|
|
166
|
+
padding: `${e(8)} ${e(10)} ${e(7)}`,
|
|
167
|
+
...w[t],
|
|
168
|
+
...i,
|
|
169
|
+
children: [n, r && /* @__PURE__ */ f("svg", {
|
|
170
|
+
className: "govuk-button__start-icon",
|
|
171
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
172
|
+
width: "17.5",
|
|
173
|
+
height: "19",
|
|
174
|
+
viewBox: "0 0 33 40",
|
|
175
|
+
"aria-hidden": "true",
|
|
176
|
+
focusable: "false",
|
|
177
|
+
children: /* @__PURE__ */ f("path", {
|
|
178
|
+
fill: "currentColor",
|
|
179
|
+
d: "M0 0h13l20 20-20 20H0l20-20z"
|
|
180
|
+
})
|
|
181
|
+
})]
|
|
182
|
+
}));
|
|
183
|
+
T.displayName = "Button";
|
|
184
|
+
//#endregion
|
|
185
|
+
//#region node_modules/next-themes/dist/index.mjs
|
|
186
|
+
var E = (e, t, n, r, i, a, o, s) => {
|
|
187
|
+
let c = document.documentElement, l = ["light", "dark"];
|
|
188
|
+
function u(t) {
|
|
189
|
+
(Array.isArray(e) ? e : [e]).forEach((e) => {
|
|
190
|
+
let n = e === "class", r = n && a ? i.map((e) => a[e] || e) : i;
|
|
191
|
+
n ? (c.classList.remove(...r), c.classList.add(a && a[t] ? a[t] : t)) : c.setAttribute(e, t);
|
|
192
|
+
}), d(t);
|
|
193
|
+
}
|
|
194
|
+
function d(e) {
|
|
195
|
+
s && l.includes(e) && (c.style.colorScheme = e);
|
|
196
|
+
}
|
|
197
|
+
function f() {
|
|
198
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
199
|
+
}
|
|
200
|
+
if (r) u(r);
|
|
201
|
+
else try {
|
|
202
|
+
let e = localStorage.getItem(t) || n;
|
|
203
|
+
u(o && e === "system" ? f() : e);
|
|
204
|
+
} catch {}
|
|
205
|
+
}, D = m.createContext(void 0), O = {
|
|
206
|
+
setTheme: (e) => {},
|
|
207
|
+
themes: []
|
|
208
|
+
}, k = () => m.useContext(D) ?? O;
|
|
209
|
+
m.memo(({ forcedTheme: e, storageKey: t, attribute: n, enableSystem: r, enableColorScheme: i, defaultTheme: a, value: o, themes: s, nonce: c, scriptProps: l }) => {
|
|
210
|
+
let u = JSON.stringify([
|
|
211
|
+
n,
|
|
212
|
+
t,
|
|
213
|
+
a,
|
|
214
|
+
e,
|
|
215
|
+
s,
|
|
216
|
+
o,
|
|
217
|
+
r,
|
|
218
|
+
i
|
|
219
|
+
]).slice(1, -1);
|
|
220
|
+
return m.createElement("script", {
|
|
221
|
+
...l,
|
|
222
|
+
suppressHydrationWarning: !0,
|
|
223
|
+
nonce: typeof window > "u" ? c : "",
|
|
224
|
+
dangerouslySetInnerHTML: { __html: `(${E.toString()})(${u})` }
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
//#endregion
|
|
228
|
+
//#region src/components/ui/color-mode.tsx
|
|
229
|
+
function A() {
|
|
230
|
+
let { resolvedTheme: e, setTheme: t, forcedTheme: n } = k(), r = typeof document < "u" && document.documentElement.classList.contains("dark") ? "dark" : "light", i = n || e || r;
|
|
231
|
+
return {
|
|
232
|
+
colorMode: i,
|
|
233
|
+
setColorMode: t,
|
|
234
|
+
toggleColorMode: () => {
|
|
235
|
+
t(i === "dark" ? "light" : "dark");
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
function j() {
|
|
240
|
+
let { colorMode: e } = A();
|
|
241
|
+
return f(e === "dark" ? t : r, {});
|
|
242
|
+
}
|
|
243
|
+
m.forwardRef(function(e, t) {
|
|
244
|
+
let { toggleColorMode: n } = A();
|
|
245
|
+
return /* @__PURE__ */ f(o, {
|
|
246
|
+
fallback: /* @__PURE__ */ f(l, { boxSize: "9" }),
|
|
247
|
+
children: /* @__PURE__ */ f(c, {
|
|
248
|
+
onClick: n,
|
|
249
|
+
variant: "ghost",
|
|
250
|
+
"aria-label": "Toggle color mode",
|
|
251
|
+
size: "sm",
|
|
252
|
+
ref: t,
|
|
253
|
+
...e,
|
|
254
|
+
css: { _icon: {
|
|
255
|
+
width: "5",
|
|
256
|
+
height: "5"
|
|
257
|
+
} },
|
|
258
|
+
children: /* @__PURE__ */ f(j, {})
|
|
259
|
+
})
|
|
260
|
+
});
|
|
261
|
+
}), m.forwardRef(function(e, t) {
|
|
262
|
+
return /* @__PURE__ */ f(u, {
|
|
263
|
+
color: "fg",
|
|
264
|
+
display: "contents",
|
|
265
|
+
className: "chakra-theme light",
|
|
266
|
+
colorPalette: "gray",
|
|
267
|
+
colorScheme: "light",
|
|
268
|
+
ref: t,
|
|
269
|
+
...e
|
|
270
|
+
});
|
|
271
|
+
}), m.forwardRef(function(e, t) {
|
|
272
|
+
return /* @__PURE__ */ f(u, {
|
|
273
|
+
color: "fg",
|
|
274
|
+
display: "contents",
|
|
275
|
+
className: "chakra-theme dark",
|
|
276
|
+
colorPalette: "gray",
|
|
277
|
+
colorScheme: "dark",
|
|
278
|
+
ref: t,
|
|
279
|
+
...e
|
|
280
|
+
});
|
|
281
|
+
});
|
|
282
|
+
//#endregion
|
|
283
|
+
//#region src/components/CodeBlock/CodeBlock.tsx
|
|
284
|
+
var M = {
|
|
285
|
+
minH: e(48),
|
|
286
|
+
px: e(16),
|
|
287
|
+
py: e(10),
|
|
288
|
+
borderBottomWidth: "1px",
|
|
289
|
+
borderColor: "border",
|
|
290
|
+
bg: "bg.subtle",
|
|
291
|
+
gap: e(12)
|
|
292
|
+
}, N = {
|
|
293
|
+
position: "relative",
|
|
294
|
+
overflowX: "auto",
|
|
295
|
+
bg: "bg"
|
|
296
|
+
}, P = {
|
|
297
|
+
display: "block",
|
|
298
|
+
w: "100%",
|
|
299
|
+
px: e(16),
|
|
300
|
+
py: e(16),
|
|
301
|
+
fontSize: e(16),
|
|
302
|
+
lineHeight: "1.6"
|
|
303
|
+
}, F = h(function(e, t) {
|
|
304
|
+
let { meta: n, ...r } = e, { colorMode: i } = A();
|
|
305
|
+
return /* @__PURE__ */ f(s.AdapterProvider, {
|
|
306
|
+
value: x,
|
|
307
|
+
children: /* @__PURE__ */ f(o, {
|
|
308
|
+
fallback: /* @__PURE__ */ f(l, { height: "200px" }),
|
|
309
|
+
children: () => /* @__PURE__ */ f(s.Root, {
|
|
310
|
+
ref: t,
|
|
311
|
+
meta: {
|
|
312
|
+
...n,
|
|
313
|
+
colorScheme: i
|
|
314
|
+
},
|
|
315
|
+
colorPalette: "green",
|
|
316
|
+
bg: "bg",
|
|
317
|
+
color: "fg",
|
|
318
|
+
borderWidth: "1px",
|
|
319
|
+
borderColor: "border",
|
|
320
|
+
borderRadius: "0",
|
|
321
|
+
overflow: "hidden",
|
|
322
|
+
className: "code-block",
|
|
323
|
+
...r
|
|
324
|
+
})
|
|
325
|
+
})
|
|
326
|
+
});
|
|
327
|
+
}), I = h(function(e, t) {
|
|
328
|
+
return /* @__PURE__ */ f(s.Header, {
|
|
329
|
+
ref: t,
|
|
330
|
+
mb: 0,
|
|
331
|
+
...M,
|
|
332
|
+
...e
|
|
333
|
+
});
|
|
334
|
+
}), L = h(function(t, n) {
|
|
335
|
+
return /* @__PURE__ */ f(s.Title, {
|
|
336
|
+
ref: n,
|
|
337
|
+
fontSize: e(16),
|
|
338
|
+
fontWeight: "700",
|
|
339
|
+
color: "fg",
|
|
340
|
+
...t
|
|
341
|
+
});
|
|
342
|
+
}), R = h(function(t, n) {
|
|
343
|
+
return /* @__PURE__ */ f(s.Control, {
|
|
344
|
+
ref: n,
|
|
345
|
+
gap: e(8),
|
|
346
|
+
...t
|
|
347
|
+
});
|
|
348
|
+
}), z = h(function(e, t) {
|
|
349
|
+
return /* @__PURE__ */ f(s.Content, {
|
|
350
|
+
ref: t,
|
|
351
|
+
...N,
|
|
352
|
+
...e
|
|
353
|
+
});
|
|
354
|
+
}), B = h(function(e, t) {
|
|
355
|
+
return /* @__PURE__ */ f(s.Code, {
|
|
356
|
+
ref: t,
|
|
357
|
+
fontFamily: "mono",
|
|
358
|
+
...P,
|
|
359
|
+
...e
|
|
360
|
+
});
|
|
361
|
+
}), V = h(function(e, t) {
|
|
362
|
+
return /* @__PURE__ */ f(s.CodeText, {
|
|
363
|
+
ref: t,
|
|
364
|
+
...e
|
|
365
|
+
});
|
|
366
|
+
}), H = h(function(e, t) {
|
|
367
|
+
return /* @__PURE__ */ f(s.CopyTrigger, {
|
|
368
|
+
ref: t,
|
|
369
|
+
...e
|
|
370
|
+
});
|
|
371
|
+
}), U = h(function(e, t) {
|
|
372
|
+
return /* @__PURE__ */ f(s.CopyIndicator, {
|
|
373
|
+
ref: t,
|
|
374
|
+
copied: /* @__PURE__ */ f(n, {}),
|
|
375
|
+
...e,
|
|
376
|
+
children: /* @__PURE__ */ f(i, {})
|
|
377
|
+
});
|
|
378
|
+
}), W = h(function({ copiedLabel: t = "Copied", copyLabel: n = "Copy code", size: r = "xs", variant: i = "secondary", ...a }, o) {
|
|
379
|
+
return /* @__PURE__ */ f(H, {
|
|
380
|
+
asChild: !0,
|
|
381
|
+
children: /* @__PURE__ */ p(T, {
|
|
382
|
+
ref: o,
|
|
383
|
+
size: r,
|
|
384
|
+
variant: i,
|
|
385
|
+
color: "fg",
|
|
386
|
+
h: "auto",
|
|
387
|
+
minW: "unset",
|
|
388
|
+
px: e(10),
|
|
389
|
+
py: e(6),
|
|
390
|
+
gap: e(6),
|
|
391
|
+
...a,
|
|
392
|
+
children: [/* @__PURE__ */ f(U, {}), /* @__PURE__ */ f(s.CopyIndicator, {
|
|
393
|
+
copied: t,
|
|
394
|
+
children: n
|
|
395
|
+
})]
|
|
396
|
+
})
|
|
397
|
+
});
|
|
398
|
+
}), G = h(function(e, t) {
|
|
399
|
+
return /* @__PURE__ */ f(s.Overlay, {
|
|
400
|
+
ref: t,
|
|
401
|
+
...e
|
|
402
|
+
});
|
|
403
|
+
}), K = h(function(e, t) {
|
|
404
|
+
return /* @__PURE__ */ f(s.CollapseTrigger, {
|
|
405
|
+
ref: t,
|
|
406
|
+
...e
|
|
407
|
+
});
|
|
408
|
+
}), q = h(function({ children: e, collapsedLabel: t = "Expand code", expandedLabel: n = "Collapse code", ...r }, i) {
|
|
409
|
+
let a = n ?? e;
|
|
410
|
+
return /* @__PURE__ */ f(s.CollapseIndicator, {
|
|
411
|
+
asChild: !0,
|
|
412
|
+
ref: i,
|
|
413
|
+
cursor: "pointer",
|
|
414
|
+
collapsed: /* @__PURE__ */ f(T, {
|
|
415
|
+
variant: "secondary",
|
|
416
|
+
size: "xs",
|
|
417
|
+
children: t
|
|
418
|
+
}),
|
|
419
|
+
display: "inline-flex",
|
|
420
|
+
alignItems: "center",
|
|
421
|
+
justifyContent: "center",
|
|
422
|
+
minH: "auto",
|
|
423
|
+
...r,
|
|
424
|
+
children: /* @__PURE__ */ f(T, {
|
|
425
|
+
variant: "secondary",
|
|
426
|
+
size: "xs",
|
|
427
|
+
children: a
|
|
428
|
+
})
|
|
429
|
+
});
|
|
430
|
+
}), J = h(function(e, t) {
|
|
431
|
+
return /* @__PURE__ */ f(s.CollapseText, {
|
|
432
|
+
ref: t,
|
|
433
|
+
...e
|
|
434
|
+
});
|
|
435
|
+
}), Y = Object.assign(F, {
|
|
436
|
+
Root: F,
|
|
437
|
+
Header: I,
|
|
438
|
+
Title: L,
|
|
439
|
+
Control: R,
|
|
440
|
+
Content: z,
|
|
441
|
+
Code: B,
|
|
442
|
+
CodeText: V,
|
|
443
|
+
CopyTrigger: H,
|
|
444
|
+
CopyIndicator: U,
|
|
445
|
+
CopyButton: W,
|
|
446
|
+
Overlay: G,
|
|
447
|
+
CollapseTrigger: K,
|
|
448
|
+
CollapseIndicator: q,
|
|
449
|
+
CollapseText: J
|
|
450
|
+
});
|
|
451
|
+
//#endregion
|
|
452
|
+
export { w as _, J as a, y as b, R as c, H as d, I as f, T as g, L as h, q as i, W as l, F as m, B as n, K as o, G as p, V as r, z as s, Y as t, U as u, S as v, b as x, x as y };
|
|
453
|
+
|
|
454
|
+
//# sourceMappingURL=CodeBlock-COWssyP1.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlock-COWssyP1.mjs","names":[],"sources":["../src/utils/shiki-adapter.ts","../src/components/Button/buttonVariants.ts","../src/components/Button/Button.tsx","../node_modules/next-themes/dist/index.mjs","../src/components/ui/color-mode.tsx","../src/components/CodeBlock/CodeBlock.tsx"],"sourcesContent":["import { createShikiAdapter } from '@chakra-ui/react'\nimport type { BundledLanguage, BundledTheme, HighlighterGeneric } from 'shiki'\n\nexport type ShikiHighlighter = HighlighterGeneric<BundledLanguage, BundledTheme>\n\nexport interface GovUkShikiAdapterOptions {\n languages?: BundledLanguage[]\n themes?: BundledTheme[]\n theme?: string | Record<string, string>\n}\n\nconst defaultShikiLanguages: BundledLanguage[] = [\n 'bash',\n 'html',\n 'javascript',\n 'json',\n 'python',\n 'tsx',\n 'typescript',\n]\nconst defaultShikiThemes: BundledTheme[] = ['github-light', 'github-dark']\nconst defaultShikiTheme = {\n light: 'github-light',\n dark: 'github-dark',\n} satisfies Record<string, string>\n\nexport const shikiLanguages = defaultShikiLanguages\nexport const shikiThemes = defaultShikiThemes\n\nexport const shikiAdapter = createShikiAdapter<ShikiHighlighter>({\n async load() {\n const { createHighlighter } = await import('shiki')\n\n return createHighlighter({\n langs: defaultShikiLanguages,\n themes: defaultShikiThemes,\n })\n },\n theme: defaultShikiTheme,\n})\n\nexport function createGovUkShikiAdapter({\n languages = defaultShikiLanguages,\n themes = defaultShikiThemes,\n theme = defaultShikiTheme,\n}: GovUkShikiAdapterOptions = {}) {\n return createShikiAdapter<ShikiHighlighter>({\n async load() {\n const { createHighlighter } = await import('shiki')\n\n return createHighlighter({\n langs: languages,\n themes,\n })\n },\n theme,\n })\n}\n","import type { SystemStyleObject } from '@chakra-ui/react'\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'plain' | 'error' | 'inverse' | 'link'\n\nexport const buttonFocusStyles: SystemStyleObject = {\n outline: 'none',\n bgColor: 'yellow.500',\n color: 'gray.950',\n}\n\nexport const buttonVariantStyles: Record<ButtonVariant, SystemStyleObject> = {\n primary: {\n bgColor: 'green.500',\n color: 'white',\n boxShadow: '0 2px 0 {colors.green.800}',\n _hover: {\n bgColor: 'green.700',\n color: 'white',\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n secondary: {\n color: 'gray.900',\n bgColor: 'gray.50',\n _dark: {\n color: 'gray.50',\n bgColor: 'gray.600',\n _hover: {\n bgColor: 'gray.600',\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n boxShadow: '0 2px 0 {colors.gray.200}',\n _hover: {\n bgColor: 'gray.100',\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n error: {\n bgColor: 'border.error',\n color: 'white',\n boxShadow: '0 2px 0 {colors.red.800}',\n _hover: {\n bgColor: 'red.700',\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n inverse: {\n bgColor: 'bg',\n color: 'blue.500',\n boxShadow: '0 2px 0 {colors.blue.700}',\n _dark: {\n bgColor: 'blue.900',\n color: 'blue.50',\n _hover: {\n color: 'blue.50',\n bgColor: 'blue.800',\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n _hover: {\n color: 'blue.700',\n bgColor: 'blue.100',\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n plain: {\n bgColor: 'transparent',\n color: 'fg',\n _dark: {\n _hover: {\n color: 'gray.50',\n bgColor: 'gray.800',\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n _hover: {\n color: 'gray.700',\n bgColor: 'gray.100',\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n link: {\n bgColor: 'transparent',\n color: 'blue.500',\n textDecoration: 'underline',\n boxShadow: 'none',\n _hover: {\n color: 'blue.700',\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n}\n","import { Button as ChakraButton, type ButtonProps as ChakraButtonProps } from '@chakra-ui/react'\n\nimport { forwardRef } from 'react'\nimport { pxToRem } from '@/utils'\nimport { buttonVariantStyles, type ButtonVariant } from './buttonVariants'\n\nexport interface ButtonProps extends Omit<ChakraButtonProps, 'variant'> {\n variant?: ButtonVariant\n startButton?: boolean\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ variant = 'primary', children, startButton, ...props }, ref) => {\n return (\n <ChakraButton\n ref={ref}\n borderRadius=\"0\"\n fontSize=\"1.1875rem\"\n bg=\"green.500\"\n color=\"white\"\n boxShadow=\"0 2px 0 {colors.green.900}\"\n fontFamily=\"body\"\n fontWeight={startButton ? 'bold' : 'normal'}\n padding={`${pxToRem(8)} ${pxToRem(10)} ${pxToRem(7)}`}\n {...buttonVariantStyles[variant]}\n {...props}\n >\n {children}\n {startButton && (\n <svg\n className=\"govuk-button__start-icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"17.5\"\n height=\"19\"\n viewBox=\"0 0 33 40\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path fill=\"currentColor\" d=\"M0 0h13l20 20-20 20H0l20-20z\"></path>\n </svg>\n )}\n </ChakraButton>\n )\n }\n)\n\nButton.displayName = 'Button'\n","\"use client\";import*as t from\"react\";var M=(e,i,s,u,m,a,l,h)=>{let d=document.documentElement,w=[\"light\",\"dark\"];function p(n){(Array.isArray(e)?e:[e]).forEach(y=>{let k=y===\"class\",S=k&&a?m.map(f=>a[f]||f):m;k?(d.classList.remove(...S),d.classList.add(a&&a[n]?a[n]:n)):d.setAttribute(y,n)}),R(n)}function R(n){h&&w.includes(n)&&(d.style.colorScheme=n)}function c(){return window.matchMedia(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\"}if(u)p(u);else try{let n=localStorage.getItem(i)||s,y=l&&n===\"system\"?c():n;p(y)}catch(n){}};var b=[\"light\",\"dark\"],I=\"(prefers-color-scheme: dark)\",O=typeof window==\"undefined\",x=t.createContext(void 0),U={setTheme:e=>{},themes:[]},z=()=>{var e;return(e=t.useContext(x))!=null?e:U},J=e=>t.useContext(x)?t.createElement(t.Fragment,null,e.children):t.createElement(V,{...e}),N=[\"light\",\"dark\"],V=({forcedTheme:e,disableTransitionOnChange:i=!1,enableSystem:s=!0,enableColorScheme:u=!0,storageKey:m=\"theme\",themes:a=N,defaultTheme:l=s?\"system\":\"light\",attribute:h=\"data-theme\",value:d,children:w,nonce:p,scriptProps:R})=>{let[c,n]=t.useState(()=>H(m,l)),[T,y]=t.useState(()=>c===\"system\"?E():c),k=d?Object.values(d):a,S=t.useCallback(o=>{let r=o;if(!r)return;o===\"system\"&&s&&(r=E());let v=d?d[r]:r,C=i?W(p):null,P=document.documentElement,L=g=>{g===\"class\"?(P.classList.remove(...k),v&&P.classList.add(v)):g.startsWith(\"data-\")&&(v?P.setAttribute(g,v):P.removeAttribute(g))};if(Array.isArray(h)?h.forEach(L):L(h),u){let g=b.includes(l)?l:null,D=b.includes(r)?r:g;P.style.colorScheme=D}C==null||C()},[p]),f=t.useCallback(o=>{let r=typeof o==\"function\"?o(c):o;n(r);try{localStorage.setItem(m,r)}catch(v){}},[c]),A=t.useCallback(o=>{let r=E(o);y(r),c===\"system\"&&s&&!e&&S(\"system\")},[c,e]);t.useEffect(()=>{let o=window.matchMedia(I);return o.addListener(A),A(o),()=>o.removeListener(A)},[A]),t.useEffect(()=>{let o=r=>{r.key===m&&(r.newValue?n(r.newValue):f(l))};return window.addEventListener(\"storage\",o),()=>window.removeEventListener(\"storage\",o)},[f]),t.useEffect(()=>{S(e!=null?e:c)},[e,c]);let Q=t.useMemo(()=>({theme:c,setTheme:f,forcedTheme:e,resolvedTheme:c===\"system\"?T:c,themes:s?[...a,\"system\"]:a,systemTheme:s?T:void 0}),[c,f,e,T,s,a]);return t.createElement(x.Provider,{value:Q},t.createElement(_,{forcedTheme:e,storageKey:m,attribute:h,enableSystem:s,enableColorScheme:u,defaultTheme:l,value:d,themes:a,nonce:p,scriptProps:R}),w)},_=t.memo(({forcedTheme:e,storageKey:i,attribute:s,enableSystem:u,enableColorScheme:m,defaultTheme:a,value:l,themes:h,nonce:d,scriptProps:w})=>{let p=JSON.stringify([s,i,a,e,h,l,u,m]).slice(1,-1);return t.createElement(\"script\",{...w,suppressHydrationWarning:!0,nonce:typeof window==\"undefined\"?d:\"\",dangerouslySetInnerHTML:{__html:`(${M.toString()})(${p})`}})}),H=(e,i)=>{if(O)return;let s;try{s=localStorage.getItem(e)||void 0}catch(u){}return s||i},W=e=>{let i=document.createElement(\"style\");return e&&i.setAttribute(\"nonce\",e),i.appendChild(document.createTextNode(\"*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}\")),document.head.appendChild(i),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(i)},1)}},E=e=>(e||(e=window.matchMedia(I)),e.matches?\"dark\":\"light\");export{J as ThemeProvider,z as useTheme};\n","'use client'\n\nimport type { IconButtonProps, SpanProps } from '@chakra-ui/react'\nimport { ClientOnly, IconButton, Skeleton, Span } from '@chakra-ui/react'\nimport { ThemeProvider, useTheme } from 'next-themes'\nimport type { ThemeProviderProps } from 'next-themes'\nimport * as React from 'react'\nimport { LuMoon, LuSun } from 'react-icons/lu'\n\nexport type ColorModeProviderProps = ThemeProviderProps\n\nexport function ColorModeProvider(props: ColorModeProviderProps) {\n return <ThemeProvider attribute=\"class\" disableTransitionOnChange {...props} />\n}\n\nexport type ColorMode = 'light' | 'dark'\n\nexport interface UseColorModeReturn {\n colorMode: ColorMode\n setColorMode: (colorMode: ColorMode) => void\n toggleColorMode: () => void\n}\n\nexport function useColorMode(): UseColorModeReturn {\n const { resolvedTheme, setTheme, forcedTheme } = useTheme()\n const fallbackTheme =\n typeof document !== 'undefined' && document.documentElement.classList.contains('dark')\n ? 'dark'\n : 'light'\n const colorMode = (forcedTheme || resolvedTheme || fallbackTheme) as ColorMode\n const toggleColorMode = () => {\n setTheme(colorMode === 'dark' ? 'light' : 'dark')\n }\n return {\n colorMode,\n setColorMode: setTheme,\n toggleColorMode,\n }\n}\n\nexport function useColorModeValue<T>(light: T, dark: T) {\n const { colorMode } = useColorMode()\n return colorMode === 'dark' ? dark : light\n}\n\nexport function ColorModeIcon() {\n const { colorMode } = useColorMode()\n return colorMode === 'dark' ? <LuMoon /> : <LuSun />\n}\n\ntype ColorModeButtonProps = Omit<IconButtonProps, 'aria-label'>\n\nexport const ColorModeButton = React.forwardRef<HTMLButtonElement, ColorModeButtonProps>(\n function ColorModeButton(props, ref) {\n const { toggleColorMode } = useColorMode()\n return (\n <ClientOnly fallback={<Skeleton boxSize=\"9\" />}>\n <IconButton\n onClick={toggleColorMode}\n variant=\"ghost\"\n aria-label=\"Toggle color mode\"\n size=\"sm\"\n ref={ref}\n {...props}\n css={{\n _icon: {\n width: '5',\n height: '5',\n },\n }}\n >\n <ColorModeIcon />\n </IconButton>\n </ClientOnly>\n )\n }\n)\n\nexport const LightMode = React.forwardRef<HTMLSpanElement, SpanProps>(\n function LightMode(props, ref) {\n return (\n <Span\n color=\"fg\"\n display=\"contents\"\n className=\"chakra-theme light\"\n colorPalette=\"gray\"\n colorScheme=\"light\"\n ref={ref}\n {...props}\n />\n )\n }\n)\n\nexport const DarkMode = React.forwardRef<HTMLSpanElement, SpanProps>(function DarkMode(props, ref) {\n return (\n <Span\n color=\"fg\"\n display=\"contents\"\n className=\"chakra-theme dark\"\n colorPalette=\"gray\"\n colorScheme=\"dark\"\n ref={ref}\n {...props}\n />\n )\n})\n","import {\n CodeBlock as ChakraCodeBlock,\n ClientOnly,\n Skeleton,\n type SystemStyleObject,\n} from '@chakra-ui/react'\nimport { forwardRef, type ComponentPropsWithoutRef, type ElementRef, type ReactNode } from 'react'\nimport { LuCheck } from 'react-icons/lu'\n\nimport { pxToRem, shikiAdapter } from '@/utils'\nimport { Button, type ButtonProps } from '@/components/Button'\nimport { useColorMode } from '@/components/ui/color-mode'\nimport { FaCopy } from 'react-icons/fa'\n\nexport type CodeBlockProps = ComponentPropsWithoutRef<typeof ChakraCodeBlock.Root>\nexport type CodeBlockHeaderProps = ComponentPropsWithoutRef<typeof ChakraCodeBlock.Header>\nexport type CodeBlockTitleProps = ComponentPropsWithoutRef<typeof ChakraCodeBlock.Title>\nexport type CodeBlockContentProps = ComponentPropsWithoutRef<typeof ChakraCodeBlock.Content>\nexport type CodeBlockCodeProps = ComponentPropsWithoutRef<typeof ChakraCodeBlock.Code>\nexport type CodeBlockCodeTextProps = ComponentPropsWithoutRef<typeof ChakraCodeBlock.CodeText>\nexport type CodeBlockControlProps = ComponentPropsWithoutRef<typeof ChakraCodeBlock.Control>\nexport type CodeBlockCopyTriggerProps = ComponentPropsWithoutRef<typeof ChakraCodeBlock.CopyTrigger>\nexport type CodeBlockCopyIndicatorProps = ComponentPropsWithoutRef<\n typeof ChakraCodeBlock.CopyIndicator\n>\nexport type CodeBlockOverlayProps = ComponentPropsWithoutRef<typeof ChakraCodeBlock.Overlay>\nexport type CodeBlockCollapseTriggerProps = ComponentPropsWithoutRef<\n typeof ChakraCodeBlock.CollapseTrigger\n>\nexport interface CodeBlockCollapseIndicatorProps extends Omit<\n ComponentPropsWithoutRef<typeof ChakraCodeBlock.CollapseIndicator>,\n 'collapsed'\n> {\n collapsedLabel?: ReactNode\n expandedLabel?: ReactNode\n}\nexport type CodeBlockCollapseTextProps = ComponentPropsWithoutRef<\n typeof ChakraCodeBlock.CollapseText\n>\n\nexport interface CodeBlockCopyButtonProps extends Omit<ButtonProps, 'children'> {\n copyLabel?: ReactNode\n copiedLabel?: ReactNode\n}\n\nconst headerStyles: SystemStyleObject = {\n minH: pxToRem(48),\n px: pxToRem(16),\n py: pxToRem(10),\n borderBottomWidth: '1px',\n borderColor: 'border',\n bg: 'bg.subtle',\n gap: pxToRem(12),\n}\n\nconst contentStyles: SystemStyleObject = {\n position: 'relative',\n overflowX: 'auto',\n bg: 'bg',\n}\n\nconst codeStyles: SystemStyleObject = {\n display: 'block',\n w: '100%',\n px: pxToRem(16),\n py: pxToRem(16),\n fontSize: pxToRem(16),\n lineHeight: '1.6',\n}\n\nconst CodeBlockRoot = forwardRef<ElementRef<typeof ChakraCodeBlock.Root>, CodeBlockProps>(\n function CodeBlockRoot(props, ref) {\n const { meta, ...restProps } = props\n const { colorMode } = useColorMode()\n return (\n <ChakraCodeBlock.AdapterProvider value={shikiAdapter}>\n <ClientOnly fallback={<Skeleton height=\"200px\" />}>\n {() => (\n <ChakraCodeBlock.Root\n ref={ref}\n meta={{ ...meta, colorScheme: colorMode }}\n colorPalette={'green'}\n bg=\"bg\"\n color=\"fg\"\n borderWidth=\"1px\"\n borderColor=\"border\"\n borderRadius=\"0\"\n overflow=\"hidden\"\n className=\"code-block\"\n {...restProps}\n />\n )}\n </ClientOnly>\n </ChakraCodeBlock.AdapterProvider>\n )\n }\n)\n\nconst CodeBlockHeader = forwardRef<ElementRef<typeof ChakraCodeBlock.Header>, CodeBlockHeaderProps>(\n function CodeBlockHeader(props, ref) {\n return <ChakraCodeBlock.Header ref={ref} mb={0} {...headerStyles} {...props} />\n }\n)\n\nconst CodeBlockTitle = forwardRef<ElementRef<typeof ChakraCodeBlock.Title>, CodeBlockTitleProps>(\n function CodeBlockTitle(props, ref) {\n return (\n <ChakraCodeBlock.Title\n ref={ref}\n fontSize={pxToRem(16)}\n fontWeight=\"700\"\n color=\"fg\"\n {...props}\n />\n )\n }\n)\n\nconst CodeBlockControl = forwardRef<\n ElementRef<typeof ChakraCodeBlock.Control>,\n CodeBlockControlProps\n>(function CodeBlockControl(props, ref) {\n return <ChakraCodeBlock.Control ref={ref} gap={pxToRem(8)} {...props} />\n})\n\nconst CodeBlockContent = forwardRef<\n ElementRef<typeof ChakraCodeBlock.Content>,\n CodeBlockContentProps\n>(function CodeBlockContent(props, ref) {\n return <ChakraCodeBlock.Content ref={ref} {...contentStyles} {...props} />\n})\n\nconst CodeBlockCode = forwardRef<ElementRef<typeof ChakraCodeBlock.Code>, CodeBlockCodeProps>(\n function CodeBlockCode(props, ref) {\n return <ChakraCodeBlock.Code ref={ref} fontFamily=\"mono\" {...codeStyles} {...props} />\n }\n)\n\nconst CodeBlockCodeText = forwardRef<\n ElementRef<typeof ChakraCodeBlock.CodeText>,\n CodeBlockCodeTextProps\n>(function CodeBlockCodeText(props, ref) {\n return <ChakraCodeBlock.CodeText ref={ref} {...props} />\n})\n\nconst CodeBlockCopyTrigger = forwardRef<\n ElementRef<typeof ChakraCodeBlock.CopyTrigger>,\n CodeBlockCopyTriggerProps\n>(function CodeBlockCopyTrigger(props, ref) {\n return <ChakraCodeBlock.CopyTrigger ref={ref} {...props} />\n})\n\nconst CodeBlockCopyIndicator = forwardRef<\n ElementRef<typeof ChakraCodeBlock.CopyIndicator>,\n CodeBlockCopyIndicatorProps\n>(function CodeBlockCopyIndicator(props, ref) {\n return (\n <ChakraCodeBlock.CopyIndicator ref={ref} copied={<LuCheck />} {...props}>\n <FaCopy />\n </ChakraCodeBlock.CopyIndicator>\n )\n})\n\nconst CodeBlockCopyButton = forwardRef<HTMLButtonElement, CodeBlockCopyButtonProps>(\n function CodeBlockCopyButton(\n {\n copiedLabel = 'Copied',\n copyLabel = 'Copy code',\n size = 'xs',\n variant = 'secondary',\n ...props\n },\n ref\n ) {\n return (\n <CodeBlockCopyTrigger asChild>\n <Button\n ref={ref}\n size={size}\n variant={variant}\n color=\"fg\"\n h=\"auto\"\n minW=\"unset\"\n px={pxToRem(10)}\n py={pxToRem(6)}\n gap={pxToRem(6)}\n {...props}\n >\n <CodeBlockCopyIndicator />\n <ChakraCodeBlock.CopyIndicator copied={copiedLabel}>\n {copyLabel}\n </ChakraCodeBlock.CopyIndicator>\n </Button>\n </CodeBlockCopyTrigger>\n )\n }\n)\n\nconst CodeBlockOverlay = forwardRef<\n ElementRef<typeof ChakraCodeBlock.Overlay>,\n CodeBlockOverlayProps\n>(function CodeBlockOverlay(props, ref) {\n return <ChakraCodeBlock.Overlay ref={ref} {...props} />\n})\n\nconst CodeBlockCollapseTrigger = forwardRef<\n ElementRef<typeof ChakraCodeBlock.CollapseTrigger>,\n CodeBlockCollapseTriggerProps\n>(function CodeBlockCollapseTrigger(props, ref) {\n return <ChakraCodeBlock.CollapseTrigger ref={ref} {...props} />\n})\n\nconst CodeBlockCollapseIndicator = forwardRef<\n ElementRef<typeof ChakraCodeBlock.CollapseIndicator>,\n CodeBlockCollapseIndicatorProps\n>(function CodeBlockCollapseIndicator(\n { children, collapsedLabel = 'Expand code', expandedLabel = 'Collapse code', ...props },\n ref\n) {\n const expandedContent = expandedLabel ?? children\n const collapsedComponent = () => {\n return (\n <Button variant=\"secondary\" size=\"xs\">\n {collapsedLabel}\n </Button>\n )\n }\n return (\n <ChakraCodeBlock.CollapseIndicator\n asChild\n ref={ref}\n cursor=\"pointer\"\n collapsed={collapsedComponent()}\n display=\"inline-flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n minH=\"auto\"\n {...props}\n >\n <Button variant=\"secondary\" size=\"xs\">\n {expandedContent}\n </Button>\n </ChakraCodeBlock.CollapseIndicator>\n )\n})\n\nconst CodeBlockCollapseText = forwardRef<\n ElementRef<typeof ChakraCodeBlock.CollapseText>,\n CodeBlockCollapseTextProps\n>(function CodeBlockCollapseText(props, ref) {\n return <ChakraCodeBlock.CollapseText ref={ref} {...props} />\n})\n\nexport const CodeBlock = Object.assign(CodeBlockRoot, {\n Root: CodeBlockRoot,\n Header: CodeBlockHeader,\n Title: CodeBlockTitle,\n Control: CodeBlockControl,\n Content: CodeBlockContent,\n Code: CodeBlockCode,\n CodeText: CodeBlockCodeText,\n CopyTrigger: CodeBlockCopyTrigger,\n CopyIndicator: CodeBlockCopyIndicator,\n CopyButton: CodeBlockCopyButton,\n Overlay: CodeBlockOverlay,\n CollapseTrigger: CodeBlockCollapseTrigger,\n CollapseIndicator: CodeBlockCollapseIndicator,\n CollapseText: CodeBlockCollapseText,\n})\n\nexport {\n CodeBlockRoot,\n CodeBlockHeader,\n CodeBlockTitle,\n CodeBlockControl,\n CodeBlockContent,\n CodeBlockCode,\n CodeBlockCodeText,\n CodeBlockCopyTrigger,\n CodeBlockCopyIndicator,\n CodeBlockCopyButton,\n CodeBlockOverlay,\n CodeBlockCollapseTrigger,\n CodeBlockCollapseIndicator,\n CodeBlockCollapseText,\n}\n"],"x_google_ignoreList":[3],"mappings":";;;;;;;;AAWA,IAAM,IAA2C;CAC/C;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GACM,IAAqC,CAAC,gBAAgB,aAAa,GACnE,IAAoB;CACxB,OAAO;CACP,MAAM;AACR,GAEa,IAAiB,GACjB,IAAc,GAEd,IAAe,EAAqC;CAC/D,MAAM,OAAO;EACX,IAAM,EAAE,yBAAsB,MAAM,OAAO;EAE3C,OAAO,EAAkB;GACvB,OAAO;GACP,QAAQ;EACV,CAAC;CACH;CACA,OAAO;AACT,CAAC;AAED,SAAgB,EAAwB,EACtC,eAAY,GACZ,YAAS,GACT,WAAQ,MACoB,CAAC,GAAG;CAChC,OAAO,EAAqC;EAC1C,MAAM,OAAO;GACX,IAAM,EAAE,yBAAsB,MAAM,OAAO;GAE3C,OAAO,EAAkB;IACvB,OAAO;IACP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N,QAAQ;CACR,OAAO;CACP,SAAS;CACT,SAAS;CACT,MAAM;CACN,UAAU;CACV,aAAa;CACb,eAAe;CACf,YAAY;CACZ,SAAS;CACT,iBAAiB;CACjB,mBAAmB;CACnB,cAAc;AAChB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("./iconBase-oF_9OlGK.js"),t=require("./px-to-rem-CwuxPF53.js"),n=require("./lu-z5T_luPj.js"),r=require("./fa-CH8Fqe4D.js");let i=require("@chakra-ui/react"),a=require("react/jsx-runtime"),o=require("react"),s=e.i(o,1);o=e.i(o);var c=[`bash`,`html`,`javascript`,`json`,`python`,`tsx`,`typescript`],l=[`github-light`,`github-dark`],u={light:`github-light`,dark:`github-dark`},d=c,f=l,p=(0,i.createShikiAdapter)({async load(){let{createHighlighter:e}=await import(`shiki`);return e({langs:c,themes:l})},theme:u});function m({languages:e=c,themes:t=l,theme:n=u}={}){return(0,i.createShikiAdapter)({async load(){let{createHighlighter:n}=await import(`shiki`);return n({langs:e,themes:t})},theme:n})}var h={outline:`none`,bgColor:`yellow.500`,color:`gray.950`},g={primary:{bgColor:`green.500`,color:`white`,boxShadow:`0 2px 0 {colors.green.800}`,_hover:{bgColor:`green.700`,color:`white`,_focus:h,_focusVisible:h},_focus:h,_focusVisible:h},secondary:{color:`gray.900`,bgColor:`gray.50`,_dark:{color:`gray.50`,bgColor:`gray.600`,_hover:{bgColor:`gray.600`,_focus:h,_focusVisible:h},_focus:h,_focusVisible:h},boxShadow:`0 2px 0 {colors.gray.200}`,_hover:{bgColor:`gray.100`,_focus:h,_focusVisible:h},_focus:h,_focusVisible:h},error:{bgColor:`border.error`,color:`white`,boxShadow:`0 2px 0 {colors.red.800}`,_hover:{bgColor:`red.700`,_focus:h,_focusVisible:h},_focus:h,_focusVisible:h},inverse:{bgColor:`bg`,color:`blue.500`,boxShadow:`0 2px 0 {colors.blue.700}`,_dark:{bgColor:`blue.900`,color:`blue.50`,_hover:{color:`blue.50`,bgColor:`blue.800`,_focus:h,_focusVisible:h},_focus:h,_focusVisible:h},_hover:{color:`blue.700`,bgColor:`blue.100`,_focus:h,_focusVisible:h},_focus:h,_focusVisible:h},plain:{bgColor:`transparent`,color:`fg`,_dark:{_hover:{color:`gray.50`,bgColor:`gray.800`,_focus:h,_focusVisible:h},_focus:h,_focusVisible:h},_hover:{color:`gray.700`,bgColor:`gray.100`,_focus:h,_focusVisible:h},_focus:h,_focusVisible:h},link:{bgColor:`transparent`,color:`blue.500`,textDecoration:`underline`,boxShadow:`none`,_hover:{color:`blue.700`,_focus:h,_focusVisible:h},_focus:h,_focusVisible:h}},_=(0,o.forwardRef)(({variant:e=`primary`,children:n,startButton:r,...o},s)=>(0,a.jsxs)(i.Button,{ref:s,borderRadius:`0`,fontSize:`1.1875rem`,bg:`green.500`,color:`white`,boxShadow:`0 2px 0 {colors.green.900}`,fontFamily:`body`,fontWeight:r?`bold`:`normal`,padding:`${t.o(8)} ${t.o(10)} ${t.o(7)}`,...g[e],...o,children:[n,r&&(0,a.jsx)(`svg`,{className:`govuk-button__start-icon`,xmlns:`http://www.w3.org/2000/svg`,width:`17.5`,height:`19`,viewBox:`0 0 33 40`,"aria-hidden":`true`,focusable:`false`,children:(0,a.jsx)(`path`,{fill:`currentColor`,d:`M0 0h13l20 20-20 20H0l20-20z`})})]}));_.displayName=`Button`;var v=(e,t,n,r,i,a,o,s)=>{let c=document.documentElement,l=[`light`,`dark`];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n=e===`class`,r=n&&a?i.map(e=>a[e]||e):i;n?(c.classList.remove(...r),c.classList.add(a&&a[t]?a[t]:t)):c.setAttribute(e,t)}),d(t)}function d(e){s&&l.includes(e)&&(c.style.colorScheme=e)}function f(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}if(r)u(r);else try{let e=localStorage.getItem(t)||n;u(o&&e===`system`?f():e)}catch{}},y=s.createContext(void 0),b={setTheme:e=>{},themes:[]},x=()=>s.useContext(y)??b;s.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:c,nonce:l,scriptProps:u})=>{let d=JSON.stringify([n,t,a,e,c,o,r,i]).slice(1,-1);return s.createElement(`script`,{...u,suppressHydrationWarning:!0,nonce:typeof window>`u`?l:``,dangerouslySetInnerHTML:{__html:`(${v.toString()})(${d})`}})});function S(){let{resolvedTheme:e,setTheme:t,forcedTheme:n}=x(),r=typeof document<`u`&&document.documentElement.classList.contains(`dark`)?`dark`:`light`,i=n||e||r;return{colorMode:i,setColorMode:t,toggleColorMode:()=>{t(i===`dark`?`light`:`dark`)}}}function C(){let{colorMode:e}=S();return e===`dark`?(0,a.jsx)(n.c,{}):(0,a.jsx)(n.u,{})}o.forwardRef(function(e,t){let{toggleColorMode:n}=S();return(0,a.jsx)(i.ClientOnly,{fallback:(0,a.jsx)(i.Skeleton,{boxSize:`9`}),children:(0,a.jsx)(i.IconButton,{onClick:n,variant:`ghost`,"aria-label":`Toggle color mode`,size:`sm`,ref:t,...e,css:{_icon:{width:`5`,height:`5`}},children:(0,a.jsx)(C,{})})})}),o.forwardRef(function(e,t){return(0,a.jsx)(i.Span,{color:`fg`,display:`contents`,className:`chakra-theme light`,colorPalette:`gray`,colorScheme:`light`,ref:t,...e})}),o.forwardRef(function(e,t){return(0,a.jsx)(i.Span,{color:`fg`,display:`contents`,className:`chakra-theme dark`,colorPalette:`gray`,colorScheme:`dark`,ref:t,...e})});var w={minH:t.o(48),px:t.o(16),py:t.o(10),borderBottomWidth:`1px`,borderColor:`border`,bg:`bg.subtle`,gap:t.o(12)},T={position:`relative`,overflowX:`auto`,bg:`bg`},E={display:`block`,w:`100%`,px:t.o(16),py:t.o(16),fontSize:t.o(16),lineHeight:`1.6`},D=(0,o.forwardRef)(function(e,t){let{meta:n,...r}=e,{colorMode:o}=S();return(0,a.jsx)(i.CodeBlock.AdapterProvider,{value:p,children:(0,a.jsx)(i.ClientOnly,{fallback:(0,a.jsx)(i.Skeleton,{height:`200px`}),children:()=>(0,a.jsx)(i.CodeBlock.Root,{ref:t,meta:{...n,colorScheme:o},colorPalette:`green`,bg:`bg`,color:`fg`,borderWidth:`1px`,borderColor:`border`,borderRadius:`0`,overflow:`hidden`,className:`code-block`,...r})})})}),O=(0,o.forwardRef)(function(e,t){return(0,a.jsx)(i.CodeBlock.Header,{ref:t,mb:0,...w,...e})}),k=(0,o.forwardRef)(function(e,n){return(0,a.jsx)(i.CodeBlock.Title,{ref:n,fontSize:t.o(16),fontWeight:`700`,color:`fg`,...e})}),A=(0,o.forwardRef)(function(e,n){return(0,a.jsx)(i.CodeBlock.Control,{ref:n,gap:t.o(8),...e})}),j=(0,o.forwardRef)(function(e,t){return(0,a.jsx)(i.CodeBlock.Content,{ref:t,...T,...e})}),M=(0,o.forwardRef)(function(e,t){return(0,a.jsx)(i.CodeBlock.Code,{ref:t,fontFamily:`mono`,...E,...e})}),N=(0,o.forwardRef)(function(e,t){return(0,a.jsx)(i.CodeBlock.CodeText,{ref:t,...e})}),P=(0,o.forwardRef)(function(e,t){return(0,a.jsx)(i.CodeBlock.CopyTrigger,{ref:t,...e})}),F=(0,o.forwardRef)(function(e,t){return(0,a.jsx)(i.CodeBlock.CopyIndicator,{ref:t,copied:(0,a.jsx)(n.n,{}),...e,children:(0,a.jsx)(r.t,{})})}),I=(0,o.forwardRef)(function({copiedLabel:e=`Copied`,copyLabel:n=`Copy code`,size:r=`xs`,variant:o=`secondary`,...s},c){return(0,a.jsx)(P,{asChild:!0,children:(0,a.jsxs)(_,{ref:c,size:r,variant:o,color:`fg`,h:`auto`,minW:`unset`,px:t.o(10),py:t.o(6),gap:t.o(6),...s,children:[(0,a.jsx)(F,{}),(0,a.jsx)(i.CodeBlock.CopyIndicator,{copied:e,children:n})]})})}),L=(0,o.forwardRef)(function(e,t){return(0,a.jsx)(i.CodeBlock.Overlay,{ref:t,...e})}),R=(0,o.forwardRef)(function(e,t){return(0,a.jsx)(i.CodeBlock.CollapseTrigger,{ref:t,...e})}),z=(0,o.forwardRef)(function({children:e,collapsedLabel:t=`Expand code`,expandedLabel:n=`Collapse code`,...r},o){let s=n??e;return(0,a.jsx)(i.CodeBlock.CollapseIndicator,{asChild:!0,ref:o,cursor:`pointer`,collapsed:(0,a.jsx)(_,{variant:`secondary`,size:`xs`,children:t}),display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minH:`auto`,...r,children:(0,a.jsx)(_,{variant:`secondary`,size:`xs`,children:s})})}),B=(0,o.forwardRef)(function(e,t){return(0,a.jsx)(i.CodeBlock.CollapseText,{ref:t,...e})}),V=Object.assign(D,{Root:D,Header:O,Title:k,Control:A,Content:j,Code:M,CodeText:N,CopyTrigger:P,CopyIndicator:F,CopyButton:I,Overlay:L,CollapseTrigger:R,CollapseIndicator:z,CollapseText:B});Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return p}});
|
|
2
|
+
//# sourceMappingURL=CodeBlock-D5HlsQKE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlock-D5HlsQKE.js","names":["t"],"sources":["../src/utils/shiki-adapter.ts","../src/components/Button/buttonVariants.ts","../src/components/Button/Button.tsx","../node_modules/next-themes/dist/index.mjs","../src/components/ui/color-mode.tsx","../src/components/CodeBlock/CodeBlock.tsx"],"sourcesContent":["import { createShikiAdapter } from '@chakra-ui/react'\nimport type { BundledLanguage, BundledTheme, HighlighterGeneric } from 'shiki'\n\nexport type ShikiHighlighter = HighlighterGeneric<BundledLanguage, BundledTheme>\n\nexport interface GovUkShikiAdapterOptions {\n languages?: BundledLanguage[]\n themes?: BundledTheme[]\n theme?: string | Record<string, string>\n}\n\nconst defaultShikiLanguages: BundledLanguage[] = [\n 'bash',\n 'html',\n 'javascript',\n 'json',\n 'python',\n 'tsx',\n 'typescript',\n]\nconst defaultShikiThemes: BundledTheme[] = ['github-light', 'github-dark']\nconst defaultShikiTheme = {\n light: 'github-light',\n dark: 'github-dark',\n} satisfies Record<string, string>\n\nexport const shikiLanguages = defaultShikiLanguages\nexport const shikiThemes = defaultShikiThemes\n\nexport const shikiAdapter = createShikiAdapter<ShikiHighlighter>({\n async load() {\n const { createHighlighter } = await import('shiki')\n\n return createHighlighter({\n langs: defaultShikiLanguages,\n themes: defaultShikiThemes,\n })\n },\n theme: defaultShikiTheme,\n})\n\nexport function createGovUkShikiAdapter({\n languages = defaultShikiLanguages,\n themes = defaultShikiThemes,\n theme = defaultShikiTheme,\n}: GovUkShikiAdapterOptions = {}) {\n return createShikiAdapter<ShikiHighlighter>({\n async load() {\n const { createHighlighter } = await import('shiki')\n\n return createHighlighter({\n langs: languages,\n themes,\n })\n },\n theme,\n })\n}\n","import type { SystemStyleObject } from '@chakra-ui/react'\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'plain' | 'error' | 'inverse' | 'link'\n\nexport const buttonFocusStyles: SystemStyleObject = {\n outline: 'none',\n bgColor: 'yellow.500',\n color: 'gray.950',\n}\n\nexport const buttonVariantStyles: Record<ButtonVariant, SystemStyleObject> = {\n primary: {\n bgColor: 'green.500',\n color: 'white',\n boxShadow: '0 2px 0 {colors.green.800}',\n _hover: {\n bgColor: 'green.700',\n color: 'white',\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n secondary: {\n color: 'gray.900',\n bgColor: 'gray.50',\n _dark: {\n color: 'gray.50',\n bgColor: 'gray.600',\n _hover: {\n bgColor: 'gray.600',\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n boxShadow: '0 2px 0 {colors.gray.200}',\n _hover: {\n bgColor: 'gray.100',\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n error: {\n bgColor: 'border.error',\n color: 'white',\n boxShadow: '0 2px 0 {colors.red.800}',\n _hover: {\n bgColor: 'red.700',\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n inverse: {\n bgColor: 'bg',\n color: 'blue.500',\n boxShadow: '0 2px 0 {colors.blue.700}',\n _dark: {\n bgColor: 'blue.900',\n color: 'blue.50',\n _hover: {\n color: 'blue.50',\n bgColor: 'blue.800',\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n _hover: {\n color: 'blue.700',\n bgColor: 'blue.100',\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n plain: {\n bgColor: 'transparent',\n color: 'fg',\n _dark: {\n _hover: {\n color: 'gray.50',\n bgColor: 'gray.800',\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n _hover: {\n color: 'gray.700',\n bgColor: 'gray.100',\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n link: {\n bgColor: 'transparent',\n color: 'blue.500',\n textDecoration: 'underline',\n boxShadow: 'none',\n _hover: {\n color: 'blue.700',\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n _focus: buttonFocusStyles,\n _focusVisible: buttonFocusStyles,\n },\n}\n","import { Button as ChakraButton, type ButtonProps as ChakraButtonProps } from '@chakra-ui/react'\n\nimport { forwardRef } from 'react'\nimport { pxToRem } from '@/utils'\nimport { buttonVariantStyles, type ButtonVariant } from './buttonVariants'\n\nexport interface ButtonProps extends Omit<ChakraButtonProps, 'variant'> {\n variant?: ButtonVariant\n startButton?: boolean\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ variant = 'primary', children, startButton, ...props }, ref) => {\n return (\n <ChakraButton\n ref={ref}\n borderRadius=\"0\"\n fontSize=\"1.1875rem\"\n bg=\"green.500\"\n color=\"white\"\n boxShadow=\"0 2px 0 {colors.green.900}\"\n fontFamily=\"body\"\n fontWeight={startButton ? 'bold' : 'normal'}\n padding={`${pxToRem(8)} ${pxToRem(10)} ${pxToRem(7)}`}\n {...buttonVariantStyles[variant]}\n {...props}\n >\n {children}\n {startButton && (\n <svg\n className=\"govuk-button__start-icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"17.5\"\n height=\"19\"\n viewBox=\"0 0 33 40\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path fill=\"currentColor\" d=\"M0 0h13l20 20-20 20H0l20-20z\"></path>\n </svg>\n )}\n </ChakraButton>\n )\n }\n)\n\nButton.displayName = 'Button'\n","\"use client\";import*as t from\"react\";var M=(e,i,s,u,m,a,l,h)=>{let d=document.documentElement,w=[\"light\",\"dark\"];function p(n){(Array.isArray(e)?e:[e]).forEach(y=>{let k=y===\"class\",S=k&&a?m.map(f=>a[f]||f):m;k?(d.classList.remove(...S),d.classList.add(a&&a[n]?a[n]:n)):d.setAttribute(y,n)}),R(n)}function R(n){h&&w.includes(n)&&(d.style.colorScheme=n)}function c(){return window.matchMedia(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\"}if(u)p(u);else try{let n=localStorage.getItem(i)||s,y=l&&n===\"system\"?c():n;p(y)}catch(n){}};var b=[\"light\",\"dark\"],I=\"(prefers-color-scheme: dark)\",O=typeof window==\"undefined\",x=t.createContext(void 0),U={setTheme:e=>{},themes:[]},z=()=>{var e;return(e=t.useContext(x))!=null?e:U},J=e=>t.useContext(x)?t.createElement(t.Fragment,null,e.children):t.createElement(V,{...e}),N=[\"light\",\"dark\"],V=({forcedTheme:e,disableTransitionOnChange:i=!1,enableSystem:s=!0,enableColorScheme:u=!0,storageKey:m=\"theme\",themes:a=N,defaultTheme:l=s?\"system\":\"light\",attribute:h=\"data-theme\",value:d,children:w,nonce:p,scriptProps:R})=>{let[c,n]=t.useState(()=>H(m,l)),[T,y]=t.useState(()=>c===\"system\"?E():c),k=d?Object.values(d):a,S=t.useCallback(o=>{let r=o;if(!r)return;o===\"system\"&&s&&(r=E());let v=d?d[r]:r,C=i?W(p):null,P=document.documentElement,L=g=>{g===\"class\"?(P.classList.remove(...k),v&&P.classList.add(v)):g.startsWith(\"data-\")&&(v?P.setAttribute(g,v):P.removeAttribute(g))};if(Array.isArray(h)?h.forEach(L):L(h),u){let g=b.includes(l)?l:null,D=b.includes(r)?r:g;P.style.colorScheme=D}C==null||C()},[p]),f=t.useCallback(o=>{let r=typeof o==\"function\"?o(c):o;n(r);try{localStorage.setItem(m,r)}catch(v){}},[c]),A=t.useCallback(o=>{let r=E(o);y(r),c===\"system\"&&s&&!e&&S(\"system\")},[c,e]);t.useEffect(()=>{let o=window.matchMedia(I);return o.addListener(A),A(o),()=>o.removeListener(A)},[A]),t.useEffect(()=>{let o=r=>{r.key===m&&(r.newValue?n(r.newValue):f(l))};return window.addEventListener(\"storage\",o),()=>window.removeEventListener(\"storage\",o)},[f]),t.useEffect(()=>{S(e!=null?e:c)},[e,c]);let Q=t.useMemo(()=>({theme:c,setTheme:f,forcedTheme:e,resolvedTheme:c===\"system\"?T:c,themes:s?[...a,\"system\"]:a,systemTheme:s?T:void 0}),[c,f,e,T,s,a]);return t.createElement(x.Provider,{value:Q},t.createElement(_,{forcedTheme:e,storageKey:m,attribute:h,enableSystem:s,enableColorScheme:u,defaultTheme:l,value:d,themes:a,nonce:p,scriptProps:R}),w)},_=t.memo(({forcedTheme:e,storageKey:i,attribute:s,enableSystem:u,enableColorScheme:m,defaultTheme:a,value:l,themes:h,nonce:d,scriptProps:w})=>{let p=JSON.stringify([s,i,a,e,h,l,u,m]).slice(1,-1);return t.createElement(\"script\",{...w,suppressHydrationWarning:!0,nonce:typeof window==\"undefined\"?d:\"\",dangerouslySetInnerHTML:{__html:`(${M.toString()})(${p})`}})}),H=(e,i)=>{if(O)return;let s;try{s=localStorage.getItem(e)||void 0}catch(u){}return s||i},W=e=>{let i=document.createElement(\"style\");return e&&i.setAttribute(\"nonce\",e),i.appendChild(document.createTextNode(\"*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}\")),document.head.appendChild(i),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(i)},1)}},E=e=>(e||(e=window.matchMedia(I)),e.matches?\"dark\":\"light\");export{J as ThemeProvider,z as useTheme};\n","'use client'\n\nimport type { IconButtonProps, SpanProps } from '@chakra-ui/react'\nimport { ClientOnly, IconButton, Skeleton, Span } from '@chakra-ui/react'\nimport { ThemeProvider, useTheme } from 'next-themes'\nimport type { ThemeProviderProps } from 'next-themes'\nimport * as React from 'react'\nimport { LuMoon, LuSun } from 'react-icons/lu'\n\nexport type ColorModeProviderProps = ThemeProviderProps\n\nexport function ColorModeProvider(props: ColorModeProviderProps) {\n return <ThemeProvider attribute=\"class\" disableTransitionOnChange {...props} />\n}\n\nexport type ColorMode = 'light' | 'dark'\n\nexport interface UseColorModeReturn {\n colorMode: ColorMode\n setColorMode: (colorMode: ColorMode) => void\n toggleColorMode: () => void\n}\n\nexport function useColorMode(): UseColorModeReturn {\n const { resolvedTheme, setTheme, forcedTheme } = useTheme()\n const fallbackTheme =\n typeof document !== 'undefined' && document.documentElement.classList.contains('dark')\n ? 'dark'\n : 'light'\n const colorMode = (forcedTheme || resolvedTheme || fallbackTheme) as ColorMode\n const toggleColorMode = () => {\n setTheme(colorMode === 'dark' ? 'light' : 'dark')\n }\n return {\n colorMode,\n setColorMode: setTheme,\n toggleColorMode,\n }\n}\n\nexport function useColorModeValue<T>(light: T, dark: T) {\n const { colorMode } = useColorMode()\n return colorMode === 'dark' ? dark : light\n}\n\nexport function ColorModeIcon() {\n const { colorMode } = useColorMode()\n return colorMode === 'dark' ? <LuMoon /> : <LuSun />\n}\n\ntype ColorModeButtonProps = Omit<IconButtonProps, 'aria-label'>\n\nexport const ColorModeButton = React.forwardRef<HTMLButtonElement, ColorModeButtonProps>(\n function ColorModeButton(props, ref) {\n const { toggleColorMode } = useColorMode()\n return (\n <ClientOnly fallback={<Skeleton boxSize=\"9\" />}>\n <IconButton\n onClick={toggleColorMode}\n variant=\"ghost\"\n aria-label=\"Toggle color mode\"\n size=\"sm\"\n ref={ref}\n {...props}\n css={{\n _icon: {\n width: '5',\n height: '5',\n },\n }}\n >\n <ColorModeIcon />\n </IconButton>\n </ClientOnly>\n )\n }\n)\n\nexport const LightMode = React.forwardRef<HTMLSpanElement, SpanProps>(\n function LightMode(props, ref) {\n return (\n <Span\n color=\"fg\"\n display=\"contents\"\n className=\"chakra-theme light\"\n colorPalette=\"gray\"\n colorScheme=\"light\"\n ref={ref}\n {...props}\n />\n )\n }\n)\n\nexport const DarkMode = React.forwardRef<HTMLSpanElement, SpanProps>(function DarkMode(props, ref) {\n return (\n <Span\n color=\"fg\"\n display=\"contents\"\n className=\"chakra-theme dark\"\n colorPalette=\"gray\"\n colorScheme=\"dark\"\n ref={ref}\n {...props}\n />\n )\n})\n","import {\n CodeBlock as ChakraCodeBlock,\n ClientOnly,\n Skeleton,\n type SystemStyleObject,\n} from '@chakra-ui/react'\nimport { forwardRef, type ComponentPropsWithoutRef, type ElementRef, type ReactNode } from 'react'\nimport { LuCheck } from 'react-icons/lu'\n\nimport { pxToRem, shikiAdapter } from '@/utils'\nimport { Button, type ButtonProps } from '@/components/Button'\nimport { useColorMode } from '@/components/ui/color-mode'\nimport { FaCopy } from 'react-icons/fa'\n\nexport type CodeBlockProps = ComponentPropsWithoutRef<typeof ChakraCodeBlock.Root>\nexport type CodeBlockHeaderProps = ComponentPropsWithoutRef<typeof ChakraCodeBlock.Header>\nexport type CodeBlockTitleProps = ComponentPropsWithoutRef<typeof ChakraCodeBlock.Title>\nexport type CodeBlockContentProps = ComponentPropsWithoutRef<typeof ChakraCodeBlock.Content>\nexport type CodeBlockCodeProps = ComponentPropsWithoutRef<typeof ChakraCodeBlock.Code>\nexport type CodeBlockCodeTextProps = ComponentPropsWithoutRef<typeof ChakraCodeBlock.CodeText>\nexport type CodeBlockControlProps = ComponentPropsWithoutRef<typeof ChakraCodeBlock.Control>\nexport type CodeBlockCopyTriggerProps = ComponentPropsWithoutRef<typeof ChakraCodeBlock.CopyTrigger>\nexport type CodeBlockCopyIndicatorProps = ComponentPropsWithoutRef<\n typeof ChakraCodeBlock.CopyIndicator\n>\nexport type CodeBlockOverlayProps = ComponentPropsWithoutRef<typeof ChakraCodeBlock.Overlay>\nexport type CodeBlockCollapseTriggerProps = ComponentPropsWithoutRef<\n typeof ChakraCodeBlock.CollapseTrigger\n>\nexport interface CodeBlockCollapseIndicatorProps extends Omit<\n ComponentPropsWithoutRef<typeof ChakraCodeBlock.CollapseIndicator>,\n 'collapsed'\n> {\n collapsedLabel?: ReactNode\n expandedLabel?: ReactNode\n}\nexport type CodeBlockCollapseTextProps = ComponentPropsWithoutRef<\n typeof ChakraCodeBlock.CollapseText\n>\n\nexport interface CodeBlockCopyButtonProps extends Omit<ButtonProps, 'children'> {\n copyLabel?: ReactNode\n copiedLabel?: ReactNode\n}\n\nconst headerStyles: SystemStyleObject = {\n minH: pxToRem(48),\n px: pxToRem(16),\n py: pxToRem(10),\n borderBottomWidth: '1px',\n borderColor: 'border',\n bg: 'bg.subtle',\n gap: pxToRem(12),\n}\n\nconst contentStyles: SystemStyleObject = {\n position: 'relative',\n overflowX: 'auto',\n bg: 'bg',\n}\n\nconst codeStyles: SystemStyleObject = {\n display: 'block',\n w: '100%',\n px: pxToRem(16),\n py: pxToRem(16),\n fontSize: pxToRem(16),\n lineHeight: '1.6',\n}\n\nconst CodeBlockRoot = forwardRef<ElementRef<typeof ChakraCodeBlock.Root>, CodeBlockProps>(\n function CodeBlockRoot(props, ref) {\n const { meta, ...restProps } = props\n const { colorMode } = useColorMode()\n return (\n <ChakraCodeBlock.AdapterProvider value={shikiAdapter}>\n <ClientOnly fallback={<Skeleton height=\"200px\" />}>\n {() => (\n <ChakraCodeBlock.Root\n ref={ref}\n meta={{ ...meta, colorScheme: colorMode }}\n colorPalette={'green'}\n bg=\"bg\"\n color=\"fg\"\n borderWidth=\"1px\"\n borderColor=\"border\"\n borderRadius=\"0\"\n overflow=\"hidden\"\n className=\"code-block\"\n {...restProps}\n />\n )}\n </ClientOnly>\n </ChakraCodeBlock.AdapterProvider>\n )\n }\n)\n\nconst CodeBlockHeader = forwardRef<ElementRef<typeof ChakraCodeBlock.Header>, CodeBlockHeaderProps>(\n function CodeBlockHeader(props, ref) {\n return <ChakraCodeBlock.Header ref={ref} mb={0} {...headerStyles} {...props} />\n }\n)\n\nconst CodeBlockTitle = forwardRef<ElementRef<typeof ChakraCodeBlock.Title>, CodeBlockTitleProps>(\n function CodeBlockTitle(props, ref) {\n return (\n <ChakraCodeBlock.Title\n ref={ref}\n fontSize={pxToRem(16)}\n fontWeight=\"700\"\n color=\"fg\"\n {...props}\n />\n )\n }\n)\n\nconst CodeBlockControl = forwardRef<\n ElementRef<typeof ChakraCodeBlock.Control>,\n CodeBlockControlProps\n>(function CodeBlockControl(props, ref) {\n return <ChakraCodeBlock.Control ref={ref} gap={pxToRem(8)} {...props} />\n})\n\nconst CodeBlockContent = forwardRef<\n ElementRef<typeof ChakraCodeBlock.Content>,\n CodeBlockContentProps\n>(function CodeBlockContent(props, ref) {\n return <ChakraCodeBlock.Content ref={ref} {...contentStyles} {...props} />\n})\n\nconst CodeBlockCode = forwardRef<ElementRef<typeof ChakraCodeBlock.Code>, CodeBlockCodeProps>(\n function CodeBlockCode(props, ref) {\n return <ChakraCodeBlock.Code ref={ref} fontFamily=\"mono\" {...codeStyles} {...props} />\n }\n)\n\nconst CodeBlockCodeText = forwardRef<\n ElementRef<typeof ChakraCodeBlock.CodeText>,\n CodeBlockCodeTextProps\n>(function CodeBlockCodeText(props, ref) {\n return <ChakraCodeBlock.CodeText ref={ref} {...props} />\n})\n\nconst CodeBlockCopyTrigger = forwardRef<\n ElementRef<typeof ChakraCodeBlock.CopyTrigger>,\n CodeBlockCopyTriggerProps\n>(function CodeBlockCopyTrigger(props, ref) {\n return <ChakraCodeBlock.CopyTrigger ref={ref} {...props} />\n})\n\nconst CodeBlockCopyIndicator = forwardRef<\n ElementRef<typeof ChakraCodeBlock.CopyIndicator>,\n CodeBlockCopyIndicatorProps\n>(function CodeBlockCopyIndicator(props, ref) {\n return (\n <ChakraCodeBlock.CopyIndicator ref={ref} copied={<LuCheck />} {...props}>\n <FaCopy />\n </ChakraCodeBlock.CopyIndicator>\n )\n})\n\nconst CodeBlockCopyButton = forwardRef<HTMLButtonElement, CodeBlockCopyButtonProps>(\n function CodeBlockCopyButton(\n {\n copiedLabel = 'Copied',\n copyLabel = 'Copy code',\n size = 'xs',\n variant = 'secondary',\n ...props\n },\n ref\n ) {\n return (\n <CodeBlockCopyTrigger asChild>\n <Button\n ref={ref}\n size={size}\n variant={variant}\n color=\"fg\"\n h=\"auto\"\n minW=\"unset\"\n px={pxToRem(10)}\n py={pxToRem(6)}\n gap={pxToRem(6)}\n {...props}\n >\n <CodeBlockCopyIndicator />\n <ChakraCodeBlock.CopyIndicator copied={copiedLabel}>\n {copyLabel}\n </ChakraCodeBlock.CopyIndicator>\n </Button>\n </CodeBlockCopyTrigger>\n )\n }\n)\n\nconst CodeBlockOverlay = forwardRef<\n ElementRef<typeof ChakraCodeBlock.Overlay>,\n CodeBlockOverlayProps\n>(function CodeBlockOverlay(props, ref) {\n return <ChakraCodeBlock.Overlay ref={ref} {...props} />\n})\n\nconst CodeBlockCollapseTrigger = forwardRef<\n ElementRef<typeof ChakraCodeBlock.CollapseTrigger>,\n CodeBlockCollapseTriggerProps\n>(function CodeBlockCollapseTrigger(props, ref) {\n return <ChakraCodeBlock.CollapseTrigger ref={ref} {...props} />\n})\n\nconst CodeBlockCollapseIndicator = forwardRef<\n ElementRef<typeof ChakraCodeBlock.CollapseIndicator>,\n CodeBlockCollapseIndicatorProps\n>(function CodeBlockCollapseIndicator(\n { children, collapsedLabel = 'Expand code', expandedLabel = 'Collapse code', ...props },\n ref\n) {\n const expandedContent = expandedLabel ?? children\n const collapsedComponent = () => {\n return (\n <Button variant=\"secondary\" size=\"xs\">\n {collapsedLabel}\n </Button>\n )\n }\n return (\n <ChakraCodeBlock.CollapseIndicator\n asChild\n ref={ref}\n cursor=\"pointer\"\n collapsed={collapsedComponent()}\n display=\"inline-flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n minH=\"auto\"\n {...props}\n >\n <Button variant=\"secondary\" size=\"xs\">\n {expandedContent}\n </Button>\n </ChakraCodeBlock.CollapseIndicator>\n )\n})\n\nconst CodeBlockCollapseText = forwardRef<\n ElementRef<typeof ChakraCodeBlock.CollapseText>,\n CodeBlockCollapseTextProps\n>(function CodeBlockCollapseText(props, ref) {\n return <ChakraCodeBlock.CollapseText ref={ref} {...props} />\n})\n\nexport const CodeBlock = Object.assign(CodeBlockRoot, {\n Root: CodeBlockRoot,\n Header: CodeBlockHeader,\n Title: CodeBlockTitle,\n Control: CodeBlockControl,\n Content: CodeBlockContent,\n Code: CodeBlockCode,\n CodeText: CodeBlockCodeText,\n CopyTrigger: CodeBlockCopyTrigger,\n CopyIndicator: CodeBlockCopyIndicator,\n CopyButton: CodeBlockCopyButton,\n Overlay: CodeBlockOverlay,\n CollapseTrigger: CodeBlockCollapseTrigger,\n CollapseIndicator: CodeBlockCollapseIndicator,\n CollapseText: CodeBlockCollapseText,\n})\n\nexport {\n CodeBlockRoot,\n CodeBlockHeader,\n CodeBlockTitle,\n CodeBlockControl,\n CodeBlockContent,\n CodeBlockCode,\n CodeBlockCodeText,\n CodeBlockCopyTrigger,\n CodeBlockCopyIndicator,\n CodeBlockCopyButton,\n CodeBlockOverlay,\n CodeBlockCollapseTrigger,\n CodeBlockCollapseIndicator,\n CodeBlockCollapseText,\n}\n"],"x_google_ignoreList":[3],"mappings":"mPAWA,IAAM,EAA2C,CAC/C,OACA,OACA,aACA,OACA,SACA,MACA,YACF,EACM,EAAqC,CAAC,eAAgB,aAAa,EACnE,EAAoB,CACxB,MAAO,eACP,KAAM,aACR,EAEa,EAAiB,EACjB,EAAc,EAEd,GAAA,EAAe,EAAA,mBAAA,CAAqC,CAC/D,MAAM,MAAO,CACX,GAAM,CAAE,qBAAsB,MAAM,OAAO,SAE3C,OAAO,EAAkB,CACvB,MAAO,EACP,OAAQ,CACV,CAAC,CACH,EACA,MAAO,CACT,CAAC,EAED,SAAgB,EAAwB,CACtC,YAAY,EACZ,SAAS,EACT,QAAQ,GACoB,CAAC,EAAG,CAChC,OAAA,EAAO,EAAA,mBAAA,CAAqC,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