@rainbow-robotics/muscat-plugin-kit 1.3.8-dev.2 → 1.3.8-dev.3
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/cli/src/build.mjs +21 -11
- package/cli/src/dev.mjs +2 -3
- package/cli/src/manifest.mjs +6 -2
- package/cli/src/muscatLocal.mjs +4 -5
- package/cli/storybook-dist/assets/{Color-YHDXOIA2-DeirXVfl.js → Color-YHDXOIA2-CI89lJl-.js} +1 -1
- package/cli/storybook-dist/assets/{Docs-Buyf7Djy.js → Docs-7jUVS93j.js} +1 -1
- package/cli/storybook-dist/assets/{Docs-BLxyi8cP.js → Docs-BFY0Ci6m.js} +1 -1
- package/cli/storybook-dist/assets/{Docs-CnfIOwf8.js → Docs-Bg_qFlWf.js} +1 -1
- package/cli/storybook-dist/assets/{Docs-wzFMK-XA.js → Docs-CnEDa7je.js} +1 -1
- package/cli/storybook-dist/assets/{Docs-NrBqEYvM.js → Docs-Csxm7Pfz.js} +1 -1
- package/cli/storybook-dist/assets/{Docs-BxmwdaYa.js → Docs-pBF5PbN5.js} +1 -1
- package/cli/storybook-dist/assets/{DocsRenderer-CFRXHY34-CWc43rTP.js → DocsRenderer-CFRXHY34-DBBBNBbZ.js} +1 -1
- package/cli/storybook-dist/assets/{NxAvatar.stories-DfL0kqmN.js → NxAvatar.stories-CM98sSb1.js} +1 -1
- package/cli/storybook-dist/assets/{NxButton.stories-WxSc_gsR.js → NxButton.stories-BVmEmDTn.js} +1 -1
- package/cli/storybook-dist/assets/{NxNumberInput.stories-C1D3oUiY.js → NxNumberInput.stories-DNvQbqEI.js} +1 -1
- package/cli/storybook-dist/assets/{NxPagination.stories-C1Qa88rn.js → NxPagination.stories-BHTyJLgq.js} +1 -1
- package/cli/storybook-dist/assets/{NxPointerHoldButton.stories-CmteJX3t.js → NxPointerHoldButton.stories-By8KWJWJ.js} +1 -1
- package/cli/storybook-dist/assets/{NxRangeInput.stories-B7E-mhyI.js → NxRangeInput.stories-CEN6h9wS.js} +1 -1
- package/cli/storybook-dist/assets/{NxSelectBox.stories-De67vMdU.js → NxSelectBox.stories-D8jfN20G.js} +1 -1
- package/cli/storybook-dist/assets/{NxSlideRange.stories-DvCV1MGk.js → NxSlideRange.stories-D3J7RLUl.js} +1 -1
- package/cli/storybook-dist/assets/{NxSwitch.stories-DuHDZ9-v.js → NxSwitch.stories-DI9DCdqg.js} +1 -1
- package/cli/storybook-dist/assets/{NxTextArea.stories-BT1o0ngg.js → NxTextArea.stories-B-1Ou1vF.js} +1 -1
- package/cli/storybook-dist/assets/{NxTextInput.stories-CSLBT83Q.js → NxTextInput.stories-BKuOzpHo.js} +1 -1
- package/cli/storybook-dist/assets/{RBAccordion.stories-QavkYgV0.js → RBAccordion.stories-6IYUcdt3.js} +1 -1
- package/cli/storybook-dist/assets/{RBAccordionGroup.stories-C0RPGnO7.js → RBAccordionGroup.stories-DP3JzHJm.js} +1 -1
- package/cli/storybook-dist/assets/{RBAlert.stories-BUCAT0Sd.js → RBAlert.stories-DWuWyDhE.js} +1 -1
- package/cli/storybook-dist/assets/{RBBadge.stories-CnBXTQ4J.js → RBBadge.stories-B-WWqdEZ.js} +1 -1
- package/cli/storybook-dist/assets/{RBBattery.stories-5FbsZcdy.js → RBBattery.stories-C_csZJf8.js} +1 -1
- package/cli/storybook-dist/assets/{RBCard.stories-FwTKjtCi.js → RBCard.stories-DqJP2dj2.js} +1 -1
- package/cli/storybook-dist/assets/{RBCheckBox.stories-C0y5psMI.js → RBCheckBox.stories-DJJtQVBP.js} +1 -1
- package/cli/storybook-dist/assets/{RBCheckIconButton.stories-sJjAZBVh.js → RBCheckIconButton.stories-DNi6YACF.js} +1 -1
- package/cli/storybook-dist/assets/{RBCheckLabelButton.stories-COJqEkDr.js → RBCheckLabelButton.stories-Df2ZHCAH.js} +1 -1
- package/cli/storybook-dist/assets/{RBChipTab.stories-BnXj-Woa.js → RBChipTab.stories-DHIebYdr.js} +1 -1
- package/cli/storybook-dist/assets/{RBChipsBoxTab.stories-DE1yl3rz.js → RBChipsBoxTab.stories-BBng9GCS.js} +1 -1
- package/cli/storybook-dist/assets/{RBColorIcons.stories-CYASERLQ.js → RBColorIcons.stories-DJrurysg.js} +1 -1
- package/cli/storybook-dist/assets/{RBCommand.stories-BYkWjdMG.js → RBCommand.stories-DnXBHyas.js} +1 -1
- package/cli/storybook-dist/assets/{RBConfirm.stories-XLLTJZRf.js → RBConfirm.stories-CSfY8YgA.js} +1 -1
- package/cli/storybook-dist/assets/{RBDateInput.stories-DpVylrQl.js → RBDateInput.stories-BxXvUfV6.js} +1 -1
- package/cli/storybook-dist/assets/{RBDialog.stories-DcPRAan8.js → RBDialog.stories-D3yVVilm.js} +1 -1
- package/cli/storybook-dist/assets/{RBDivider.stories-NOTo-jJG.js → RBDivider.stories-C9oGl_IM.js} +1 -1
- package/cli/storybook-dist/assets/{RBDrawer.stories-CUZaQyw8.js → RBDrawer.stories-D7DWSFAa.js} +1 -1
- package/cli/storybook-dist/assets/{RBDropdownMenu.stories-5UC0ZA3H.js → RBDropdownMenu.stories-BJN_1_jp.js} +1 -1
- package/cli/storybook-dist/assets/{RBEmptyView.stories-BIRNPjwt.js → RBEmptyView.stories-D3yofNoP.js} +1 -1
- package/cli/storybook-dist/assets/{RBIconButton.stories-CJWeIQTt.js → RBIconButton.stories-l_YkDbHC.js} +1 -1
- package/cli/storybook-dist/assets/{RBIcons.stories-Cu0txCUp.js → RBIcons.stories-BngzBBTw.js} +1 -1
- package/cli/storybook-dist/assets/{RBInlineLabelButton.stories-DnGhYrxa.js → RBInlineLabelButton.stories-B6hyVALJ.js} +1 -1
- package/cli/storybook-dist/assets/{RBJoyStick.stories-BlfvKcGb.js → RBJoyStick.stories-D_Dq7D8E.js} +1 -1
- package/cli/storybook-dist/assets/{RBLabelButton.stories-CFwmlhAE.js → RBLabelButton.stories-Bt6Nz4R8.js} +1 -1
- package/cli/storybook-dist/assets/{RBLight.stories-wMrFLJ7u.js → RBLight.stories-kRu2LDSP.js} +1 -1
- package/cli/storybook-dist/assets/{RBMenubar.stories-Bu5wtV-T.js → RBMenubar.stories-CGuAr1W6.js} +1 -1
- package/cli/storybook-dist/assets/{RBMultiRangeInput.stories-Db1d940z.js → RBMultiRangeInput.stories-BX1UOmOj.js} +1 -1
- package/cli/storybook-dist/assets/{RBPagination.stories-NCpjg-2W.js → RBPagination.stories-TrJdjSlQ.js} +1 -1
- package/cli/storybook-dist/assets/{RBPopover.stories-CqsM8byU.js → RBPopover.stories-CbMwKmFe.js} +1 -1
- package/cli/storybook-dist/assets/{RBPrompt.stories-TMQEaHk-.js → RBPrompt.stories-CFPXGQVF.js} +1 -1
- package/cli/storybook-dist/assets/{RBRadioBox.stories-pnsBvtzU.js → RBRadioBox.stories-Cs2Rw1Rf.js} +1 -1
- package/cli/storybook-dist/assets/{RBRadioButton.stories-BMDBfq82.js → RBRadioButton.stories-BVHC-XvU.js} +1 -1
- package/cli/storybook-dist/assets/{RBRangeDateInput.stories-ljAsdz0Q.js → RBRangeDateInput.stories-8LiCL1Vi.js} +1 -1
- package/cli/storybook-dist/assets/{RBResizable.stories-B5YDW687.js → RBResizable.stories-CXLXv-Cd.js} +1 -1
- package/cli/storybook-dist/assets/{RBSelectBox.stories-DPtyIwEr.js → RBSelectBox.stories-ccel3kbv.js} +1 -1
- package/cli/storybook-dist/assets/{RBSheet.stories-DMTeF_hx.js → RBSheet.stories-CGpXDNGJ.js} +1 -1
- package/cli/storybook-dist/assets/{RBSideNumberInput.stories-DLsS3mzL.js → RBSideNumberInput.stories-CPOTUek4.js} +1 -1
- package/cli/storybook-dist/assets/{RBSlider.stories-BjTYZ3ri.js → RBSlider.stories-Cc_bwUwS.js} +1 -1
- package/cli/storybook-dist/assets/{RBSpinner.stories-BWBvOGUY.js → RBSpinner.stories-m2I4_oTS.js} +1 -1
- package/cli/storybook-dist/assets/{RBSwitch.stories-tpthe98k.js → RBSwitch.stories-DRQb4llM.js} +1 -1
- package/cli/storybook-dist/assets/{RBTab.stories-BijmaLIo.js → RBTab.stories-DvnR5c0A.js} +1 -1
- package/cli/storybook-dist/assets/{RBTable.stories-Dojsz28q.js → RBTable.stories-B0QWuQmW.js} +1 -1
- package/cli/storybook-dist/assets/{RBTableRow.stories-CQajMiEa.js → RBTableRow.stories-B7V61cZI.js} +1 -1
- package/cli/storybook-dist/assets/{RBTabs.stories-BslRXoCw.js → RBTabs.stories-CTcTt28t.js} +1 -1
- package/cli/storybook-dist/assets/{RBTextArea.stories-N44Q45Xp.js → RBTextArea.stories-CxmXsiDS.js} +1 -1
- package/cli/storybook-dist/assets/{RBTextField.stories-scpiy0Kx.js → RBTextField.stories-HuzSS1QR.js} +1 -1
- package/cli/storybook-dist/assets/{RBTextInput.stories-D_suHJaA.js → RBTextInput.stories-DzSR9mIU.js} +1 -1
- package/cli/storybook-dist/assets/{RBToast.stories-B73JQcKo.js → RBToast.stories-CUyxR3hN.js} +1 -1
- package/cli/storybook-dist/assets/{RBToggle.stories-CmujM833.js → RBToggle.stories-9Z6J-KMM.js} +1 -1
- package/cli/storybook-dist/assets/{RBToggleGroup.stories-DhCAfiKu.js → RBToggleGroup.stories-Bq1QbXU3.js} +1 -1
- package/cli/storybook-dist/assets/{RBTooltip.stories-BixEjKZy.js → RBTooltip.stories-CM1R_eeG.js} +1 -1
- package/cli/storybook-dist/assets/{SideNumberInput-B7fbx2jk.js → SideNumberInput-DJEqu6Ws.js} +1 -1
- package/cli/storybook-dist/assets/{entry-preview-BeR5Td7C.js → entry-preview-DP10QZSb.js} +1 -1
- package/cli/storybook-dist/assets/{iframe-D3pKf_6w.js → iframe-B8FjC8Y_.js} +2 -2
- package/cli/storybook-dist/assets/{index-gXlU0WyC.js → index-MqY7mw_o.js} +3 -3
- package/cli/storybook-dist/assets/{preview-D-VpQB0_.js → preview-eUpuI_wJ.js} +1 -1
- package/cli/storybook-dist/assets/{preview-GwaHbm9r.js → preview-u1kopjLn.js} +2 -2
- package/cli/storybook-dist/iframe.html +1 -1
- package/cli/storybook-dist/project.json +1 -1
- package/cli/templates/common/README.md +1 -1
- package/cli/templates/readme-cpp/README.md +1 -1
- package/package.json +3 -3
package/cli/src/build.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import { createRequire } from "node:module";
|
|
|
14
14
|
import { basename, dirname, resolve } from "node:path";
|
|
15
15
|
import { createInterface } from "node:readline/promises";
|
|
16
16
|
import { execSync, spawnSync } from "node:child_process";
|
|
17
|
-
import { ensureDocker, findPluginRoot, hasBin, humanSize, log, parseArgs } from "./util.mjs";
|
|
17
|
+
import { ensureDocker, findPluginRoot, hasBin, humanSize, log, parseArgs, prompt } from "./util.mjs";
|
|
18
18
|
import { assertManifest, manifestRuntime } from "./manifest.mjs";
|
|
19
19
|
|
|
20
20
|
// Find a usable JS runtime for running vite as a subprocess.
|
|
@@ -39,15 +39,16 @@ function findViteBin(pluginRoot) {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
// Run vite build in the plugin project.
|
|
43
|
-
|
|
42
|
+
// Run vite build in the plugin project. Without a JS runtime (binary CLI, no Node.js) it asks
|
|
43
|
+
// whether to build the plugin without its UI and returns false on yes; throws on no or if vite is missing.
|
|
44
|
+
async function runViteBuild(pluginRoot, { mode = "production" } = {}) {
|
|
44
45
|
const runtime = findJsRuntime();
|
|
45
46
|
if (!runtime) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
|
|
47
|
+
log.warn("Node.js 20+ (or Bun) not found — the UI cannot be built and will not be in the plugin.");
|
|
48
|
+
const answer = await prompt(" Build the plugin without its UI? [y/N]: ", "n");
|
|
49
|
+
if (answer.toLowerCase() !== "y")
|
|
50
|
+
throw new Error("build cancelled. Install Node.js 20+ (https://nodejs.org), run `npm install` in the plugin, then build again.");
|
|
51
|
+
return false;
|
|
51
52
|
}
|
|
52
53
|
const viteBin = findViteBin(pluginRoot);
|
|
53
54
|
if (!viteBin || !existsSync(viteBin)) {
|
|
@@ -63,6 +64,7 @@ function runViteBuild(pluginRoot, { mode = "production" } = {}) {
|
|
|
63
64
|
: [viteBin, "build", "--mode", mode];
|
|
64
65
|
const r = spawnSync(runtime.bin, args, { cwd: pluginRoot, stdio: "inherit" });
|
|
65
66
|
if (r.status !== 0) throw new Error("vite build failed");
|
|
67
|
+
return true;
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
// function isMainBranch() {
|
|
@@ -242,13 +244,21 @@ export async function buildPlugin({ root, minify = false } = {}) {
|
|
|
242
244
|
);
|
|
243
245
|
}
|
|
244
246
|
const hasUiFiles = existsSync(uiDir) && readdirSync(uiDir).some((f) => /\.[tj]sx?$/.test(f));
|
|
245
|
-
|
|
246
|
-
|
|
247
|
+
// A backend-only plugin (no contributes) ships no UI, so leftover ui/ files are not built either.
|
|
248
|
+
let uiBuilt = true;
|
|
249
|
+
if (declaredUiEntries.length > 0 || (hasUiFiles && manifest.contributes?.length > 0)) {
|
|
250
|
+
uiBuilt = await runViteBuild(pluginRoot, { mode: minify ? "production" : "development" });
|
|
247
251
|
}
|
|
248
252
|
|
|
249
253
|
// Stage distribution files.
|
|
250
254
|
const manifestSrc = resolve(pluginRoot, "manifest.json");
|
|
251
255
|
if (existsSync(manifestSrc)) copyFileSync(manifestSrc, resolve(distDir, "manifest.json"));
|
|
256
|
+
// Built without the UI: ship it as a backend-only plugin so the host lists no screen it cannot load.
|
|
257
|
+
if (!uiBuilt) {
|
|
258
|
+
const { contributes, ...backendOnly } = manifest;
|
|
259
|
+
writeFileSync(resolve(distDir, "manifest.json"), JSON.stringify(backendOnly, null, 2) + "\n");
|
|
260
|
+
log.warn(`packaged without UI: dropped ${contributes.length} screen area(s) from dist/manifest.json`);
|
|
261
|
+
}
|
|
252
262
|
|
|
253
263
|
// No sandbox.html: the host dynamically imports dist/{ui}.js directly as a
|
|
254
264
|
// plain ESM module (see @rainbow-robotics/plugin-ui/host) — no iframe.
|
|
@@ -276,7 +286,7 @@ export async function buildPlugin({ root, minify = false } = {}) {
|
|
|
276
286
|
}
|
|
277
287
|
|
|
278
288
|
log.ok(`built → ${distDir}`);
|
|
279
|
-
return { pluginRoot, distDir };
|
|
289
|
+
return { pluginRoot, distDir, uiBuilt };
|
|
280
290
|
}
|
|
281
291
|
|
|
282
292
|
function dirSize(dir, skip = []) {
|
package/cli/src/dev.mjs
CHANGED
|
@@ -131,17 +131,16 @@ export async function runDev(args = []) {
|
|
|
131
131
|
|
|
132
132
|
// Robot or not, the local Muscat runtime is the gateway (:10000), MediaMTX and common; the
|
|
133
133
|
// backend joins its netns, so the plugin's declared ports are published from it too.
|
|
134
|
-
log.step("starting
|
|
134
|
+
log.step("starting dev:ui + dev:back");
|
|
135
135
|
const muscat = await ensureLocalMuscat({
|
|
136
136
|
pluginPorts: portRanges,
|
|
137
137
|
zenohPort: remoteRobot && !proxyEndpoint ? Number(process.env.MUSCAT_ZENOH_PORT) || null : null,
|
|
138
138
|
}).catch((e) => { log.warn(`local Muscat: ${e.message}`); return null; });
|
|
139
139
|
if (muscat) {
|
|
140
|
-
log.step(`local Muscat container '${muscat}' owns :${GATEWAY_PORT} — backend joins its network (gateway, MediaMTX)`);
|
|
141
140
|
process.env.MUSCAT_PK_MUSCAT_CONTAINER = muscat;
|
|
142
141
|
} else if (await isPortInUse(GATEWAY_PORT)) {
|
|
143
142
|
// e.g. developing on the robot PC: its Muscat already serves the gateway; the backend reaches it via the host.
|
|
144
|
-
log.step(
|
|
143
|
+
log.step(`Muscat already running on this machine (:${GATEWAY_PORT}) — using it`);
|
|
145
144
|
} else {
|
|
146
145
|
log.warn(`no local Muscat on :${GATEWAY_PORT} — the plugin UI cannot reach the backend.`);
|
|
147
146
|
const answer = await prompt(" Proceed anyway? [y/N]: ");
|
package/cli/src/manifest.mjs
CHANGED
|
@@ -162,11 +162,15 @@ function validateVariables(variables, errors) {
|
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
+
// No contributes (missing or []) = a backend-only plugin: no screens, nothing for vite to build.
|
|
166
|
+
// A plugin with screens still needs a toolbar entry — that is where the host lists it.
|
|
165
167
|
function validateContributes(contributes, errors) {
|
|
166
|
-
if (
|
|
167
|
-
|
|
168
|
+
if (contributes === undefined || contributes === null) return;
|
|
169
|
+
if (!Array.isArray(contributes)) {
|
|
170
|
+
errors.push("contributes must be an array");
|
|
168
171
|
return;
|
|
169
172
|
}
|
|
173
|
+
if (contributes.length === 0) return;
|
|
170
174
|
if (!contributes.some((c) => c.point === "toolbar"))
|
|
171
175
|
errors.push(`contributes: at least one "toolbar" entry is required`);
|
|
172
176
|
|
package/cli/src/muscatLocal.mjs
CHANGED
|
@@ -141,7 +141,7 @@ export async function ensureLocalMuscat({ pluginPorts = [], zenohPort = null } =
|
|
|
141
141
|
log.step(`recreating local Muscat to publish ${portsKey || "no extra"} port(s)`);
|
|
142
142
|
spawnSync("docker", ["rm", "-f", MUSCAT_CONTAINER], { stdio: "ignore" });
|
|
143
143
|
} else if (existing) {
|
|
144
|
-
log.step(`
|
|
144
|
+
log.step(`Muscat already running ('${existing}') — using it`);
|
|
145
145
|
if (existing !== MUSCAT_CONTAINER && portsKey)
|
|
146
146
|
log.warn(`'${existing}' is not managed by muscat-pk — port(s) ${portsKey} are not published from it.`);
|
|
147
147
|
return existing;
|
|
@@ -150,11 +150,10 @@ export async function ensureLocalMuscat({ pluginPorts = [], zenohPort = null } =
|
|
|
150
150
|
log.warn("Docker not found — no local Muscat; program preview will have no back end.");
|
|
151
151
|
return null;
|
|
152
152
|
}
|
|
153
|
+
// Ports taken but no container publishing them: usually a Muscat on host networking (robot PC,
|
|
154
|
+
// CI runner) — the caller uses it as is.
|
|
153
155
|
for (const port of [API_PORT, GATEWAY_PORT]) {
|
|
154
|
-
if (await isPortInUse(port))
|
|
155
|
-
log.warn(`port ${port} is in use by something that is not a Muscat container — not starting local Muscat.`);
|
|
156
|
-
return null;
|
|
157
|
-
}
|
|
156
|
+
if (await isPortInUse(port)) return null;
|
|
158
157
|
}
|
|
159
158
|
|
|
160
159
|
const versions = await resolveVersions();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as ce,Z as Y,g as he,v as M,s as fe,Q as de,M as ge,_ as be,a as q}from"./index-gXlU0WyC.js";import{r as p,R as m}from"./index-Dmy2JGbm.js";import"./iframe-D3pKf_6w.js";import"./jsx-runtime-BTJTZTIL.js";import"./index-ChsGqxH_.js";import"./index-CT3U1fyk.js";import"./index-BRq5TIsn.js";import"./index-DgH-xKnr.js";import"./index-DrFu-skq.js";var me=q({"../../node_modules/color-name/index.js"(n,o){o.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}}),Z=q({"../../node_modules/color-convert/conversions.js"(n,o){var c=me(),h={};for(let e of Object.keys(c))h[c[e]]=e;var i={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};o.exports=i;for(let e of Object.keys(i)){if(!("channels"in i[e]))throw new Error("missing channels property: "+e);if(!("labels"in i[e]))throw new Error("missing channel labels property: "+e);if(i[e].labels.length!==i[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:r}=i[e];delete i[e].channels,delete i[e].labels,Object.defineProperty(i[e],"channels",{value:t}),Object.defineProperty(i[e],"labels",{value:r})}i.rgb.hsl=function(e){let t=e[0]/255,r=e[1]/255,a=e[2]/255,l=Math.min(t,r,a),u=Math.max(t,r,a),s=u-l,f,g;u===l?f=0:t===u?f=(r-a)/s:r===u?f=2+(a-t)/s:a===u&&(f=4+(t-r)/s),f=Math.min(f*60,360),f<0&&(f+=360);let b=(l+u)/2;return u===l?g=0:b<=.5?g=s/(u+l):g=s/(2-u-l),[f,g*100,b*100]},i.rgb.hsv=function(e){let t,r,a,l,u,s=e[0]/255,f=e[1]/255,g=e[2]/255,b=Math.max(s,f,g),y=b-Math.min(s,f,g),v=function(w){return(b-w)/6/y+1/2};return y===0?(l=0,u=0):(u=y/b,t=v(s),r=v(f),a=v(g),s===b?l=a-r:f===b?l=1/3+t-a:g===b&&(l=2/3+r-t),l<0?l+=1:l>1&&(l-=1)),[l*360,u*100,b*100]},i.rgb.hwb=function(e){let t=e[0],r=e[1],a=e[2],l=i.rgb.hsl(e)[0],u=1/255*Math.min(t,Math.min(r,a));return a=1-1/255*Math.max(t,Math.max(r,a)),[l,u*100,a*100]},i.rgb.cmyk=function(e){let t=e[0]/255,r=e[1]/255,a=e[2]/255,l=Math.min(1-t,1-r,1-a),u=(1-t-l)/(1-l)||0,s=(1-r-l)/(1-l)||0,f=(1-a-l)/(1-l)||0;return[u*100,s*100,f*100,l*100]};function d(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}i.rgb.keyword=function(e){let t=h[e];if(t)return t;let r=1/0,a;for(let l of Object.keys(c)){let u=c[l],s=d(e,u);s<r&&(r=s,a=l)}return a},i.keyword.rgb=function(e){return c[e]},i.rgb.xyz=function(e){let t=e[0]/255,r=e[1]/255,a=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,a=a>.04045?((a+.055)/1.055)**2.4:a/12.92;let l=t*.4124+r*.3576+a*.1805,u=t*.2126+r*.7152+a*.0722,s=t*.0193+r*.1192+a*.9505;return[l*100,u*100,s*100]},i.rgb.lab=function(e){let t=i.rgb.xyz(e),r=t[0],a=t[1],l=t[2];r/=95.047,a/=100,l/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,l=l>.008856?l**(1/3):7.787*l+16/116;let u=116*a-16,s=500*(r-a),f=200*(a-l);return[u,s,f]},i.hsl.rgb=function(e){let t=e[0]/360,r=e[1]/100,a=e[2]/100,l,u,s;if(r===0)return s=a*255,[s,s,s];a<.5?l=a*(1+r):l=a+r-a*r;let f=2*a-l,g=[0,0,0];for(let b=0;b<3;b++)u=t+1/3*-(b-1),u<0&&u++,u>1&&u--,6*u<1?s=f+(l-f)*6*u:2*u<1?s=l:3*u<2?s=f+(l-f)*(2/3-u)*6:s=f,g[b]=s*255;return g},i.hsl.hsv=function(e){let t=e[0],r=e[1]/100,a=e[2]/100,l=r,u=Math.max(a,.01);a*=2,r*=a<=1?a:2-a,l*=u<=1?u:2-u;let s=(a+r)/2,f=a===0?2*l/(u+l):2*r/(a+r);return[t,f*100,s*100]},i.hsv.rgb=function(e){let t=e[0]/60,r=e[1]/100,a=e[2]/100,l=Math.floor(t)%6,u=t-Math.floor(t),s=255*a*(1-r),f=255*a*(1-r*u),g=255*a*(1-r*(1-u));switch(a*=255,l){case 0:return[a,g,s];case 1:return[f,a,s];case 2:return[s,a,g];case 3:return[s,f,a];case 4:return[g,s,a];case 5:return[a,s,f]}},i.hsv.hsl=function(e){let t=e[0],r=e[1]/100,a=e[2]/100,l=Math.max(a,.01),u,s;s=(2-r)*a;let f=(2-r)*l;return u=r*l,u/=f<=1?f:2-f,u=u||0,s/=2,[t,u*100,s*100]},i.hwb.rgb=function(e){let t=e[0]/360,r=e[1]/100,a=e[2]/100,l=r+a,u;l>1&&(r/=l,a/=l);let s=Math.floor(6*t),f=1-a;u=6*t-s,(s&1)!==0&&(u=1-u);let g=r+u*(f-r),b,y,v;switch(s){default:case 6:case 0:b=f,y=g,v=r;break;case 1:b=g,y=f,v=r;break;case 2:b=r,y=f,v=g;break;case 3:b=r,y=g,v=f;break;case 4:b=g,y=r,v=f;break;case 5:b=f,y=r,v=g;break}return[b*255,y*255,v*255]},i.cmyk.rgb=function(e){let t=e[0]/100,r=e[1]/100,a=e[2]/100,l=e[3]/100,u=1-Math.min(1,t*(1-l)+l),s=1-Math.min(1,r*(1-l)+l),f=1-Math.min(1,a*(1-l)+l);return[u*255,s*255,f*255]},i.xyz.rgb=function(e){let t=e[0]/100,r=e[1]/100,a=e[2]/100,l,u,s;return l=t*3.2406+r*-1.5372+a*-.4986,u=t*-.9689+r*1.8758+a*.0415,s=t*.0557+r*-.204+a*1.057,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,l=Math.min(Math.max(0,l),1),u=Math.min(Math.max(0,u),1),s=Math.min(Math.max(0,s),1),[l*255,u*255,s*255]},i.xyz.lab=function(e){let t=e[0],r=e[1],a=e[2];t/=95.047,r/=100,a/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;let l=116*r-16,u=500*(t-r),s=200*(r-a);return[l,u,s]},i.lab.xyz=function(e){let t=e[0],r=e[1],a=e[2],l,u,s;u=(t+16)/116,l=r/500+u,s=u-a/200;let f=u**3,g=l**3,b=s**3;return u=f>.008856?f:(u-16/116)/7.787,l=g>.008856?g:(l-16/116)/7.787,s=b>.008856?b:(s-16/116)/7.787,l*=95.047,u*=100,s*=108.883,[l,u,s]},i.lab.lch=function(e){let t=e[0],r=e[1],a=e[2],l;l=Math.atan2(a,r)*360/2/Math.PI,l<0&&(l+=360);let u=Math.sqrt(r*r+a*a);return[t,u,l]},i.lch.lab=function(e){let t=e[0],r=e[1],a=e[2]/360*2*Math.PI,l=r*Math.cos(a),u=r*Math.sin(a);return[t,l,u]},i.rgb.ansi16=function(e,t=null){let[r,a,l]=e,u=t===null?i.rgb.hsv(e)[2]:t;if(u=Math.round(u/50),u===0)return 30;let s=30+(Math.round(l/255)<<2|Math.round(a/255)<<1|Math.round(r/255));return u===2&&(s+=60),s},i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])},i.rgb.ansi256=function(e){let t=e[0],r=e[1],a=e[2];return t===r&&r===a?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(a/255*5)},i.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let r=(~~(e>50)+1)*.5,a=(t&1)*r*255,l=(t>>1&1)*r*255,u=(t>>2&1)*r*255;return[a,l,u]},i.ansi256.rgb=function(e){if(e>=232){let u=(e-232)*10+8;return[u,u,u]}e-=16;let t,r=Math.floor(e/36)/5*255,a=Math.floor((t=e%36)/6)/5*255,l=t%6/5*255;return[r,a,l]},i.rgb.hex=function(e){let t=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(t.length)+t},i.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let r=t[0];t[0].length===3&&(r=r.split("").map(f=>f+f).join(""));let a=parseInt(r,16),l=a>>16&255,u=a>>8&255,s=a&255;return[l,u,s]},i.rgb.hcg=function(e){let t=e[0]/255,r=e[1]/255,a=e[2]/255,l=Math.max(Math.max(t,r),a),u=Math.min(Math.min(t,r),a),s=l-u,f,g;return s<1?f=u/(1-s):f=0,s<=0?g=0:l===t?g=(r-a)/s%6:l===r?g=2+(a-t)/s:g=4+(t-r)/s,g/=6,g%=1,[g*360,s*100,f*100]},i.hsl.hcg=function(e){let t=e[1]/100,r=e[2]/100,a=r<.5?2*t*r:2*t*(1-r),l=0;return a<1&&(l=(r-.5*a)/(1-a)),[e[0],a*100,l*100]},i.hsv.hcg=function(e){let t=e[1]/100,r=e[2]/100,a=t*r,l=0;return a<1&&(l=(r-a)/(1-a)),[e[0],a*100,l*100]},i.hcg.rgb=function(e){let t=e[0]/360,r=e[1]/100,a=e[2]/100;if(r===0)return[a*255,a*255,a*255];let l=[0,0,0],u=t%1*6,s=u%1,f=1-s,g=0;switch(Math.floor(u)){case 0:l[0]=1,l[1]=s,l[2]=0;break;case 1:l[0]=f,l[1]=1,l[2]=0;break;case 2:l[0]=0,l[1]=1,l[2]=s;break;case 3:l[0]=0,l[1]=f,l[2]=1;break;case 4:l[0]=s,l[1]=0,l[2]=1;break;default:l[0]=1,l[1]=0,l[2]=f}return g=(1-r)*a,[(r*l[0]+g)*255,(r*l[1]+g)*255,(r*l[2]+g)*255]},i.hcg.hsv=function(e){let t=e[1]/100,r=e[2]/100,a=t+r*(1-t),l=0;return a>0&&(l=t/a),[e[0],l*100,a*100]},i.hcg.hsl=function(e){let t=e[1]/100,r=e[2]/100*(1-t)+.5*t,a=0;return r>0&&r<.5?a=t/(2*r):r>=.5&&r<1&&(a=t/(2*(1-r))),[e[0],a*100,r*100]},i.hcg.hwb=function(e){let t=e[1]/100,r=e[2]/100,a=t+r*(1-t);return[e[0],(a-t)*100,(1-a)*100]},i.hwb.hcg=function(e){let t=e[1]/100,r=1-e[2]/100,a=r-t,l=0;return a<1&&(l=(r-a)/(1-a)),[e[0],a*100,l*100]},i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},i.gray.hsl=function(e){return[0,0,e[0]]},i.gray.hsv=i.gray.hsl,i.gray.hwb=function(e){return[0,100,e[0]]},i.gray.cmyk=function(e){return[0,0,0,e[0]]},i.gray.lab=function(e){return[e[0],0,0]},i.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},i.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}}}),ve=q({"../../node_modules/color-convert/route.js"(n,o){var c=Z();function h(){let t={},r=Object.keys(c);for(let a=r.length,l=0;l<a;l++)t[r[l]]={distance:-1,parent:null};return t}function i(t){let r=h(),a=[t];for(r[t].distance=0;a.length;){let l=a.pop(),u=Object.keys(c[l]);for(let s=u.length,f=0;f<s;f++){let g=u[f],b=r[g];b.distance===-1&&(b.distance=r[l].distance+1,b.parent=l,a.unshift(g))}}return r}function d(t,r){return function(a){return r(t(a))}}function e(t,r){let a=[r[t].parent,t],l=c[r[t].parent][t],u=r[t].parent;for(;r[u].parent;)a.unshift(r[u].parent),l=d(c[r[u].parent][u],l),u=r[u].parent;return l.conversion=a,l}o.exports=function(t){let r=i(t),a={},l=Object.keys(r);for(let u=l.length,s=0;s<u;s++){let f=l[s];r[f].parent!==null&&(a[f]=e(f,r))}return a}}}),pe=q({"../../node_modules/color-convert/index.js"(n,o){var c=Z(),h=ve(),i={},d=Object.keys(c);function e(r){let a=function(...l){let u=l[0];return u==null?u:(u.length>1&&(l=u),r(l))};return"conversion"in r&&(a.conversion=r.conversion),a}function t(r){let a=function(...l){let u=l[0];if(u==null)return u;u.length>1&&(l=u);let s=r(l);if(typeof s=="object")for(let f=s.length,g=0;g<f;g++)s[g]=Math.round(s[g]);return s};return"conversion"in r&&(a.conversion=r.conversion),a}d.forEach(r=>{i[r]={},Object.defineProperty(i[r],"channels",{value:c[r].channels}),Object.defineProperty(i[r],"labels",{value:c[r].labels});let a=h(r);Object.keys(a).forEach(l=>{let u=a[l];i[r][l]=t(u),i[r][l].raw=e(u)})}),o.exports=i}}),_=be(pe());function C(){return(C=Object.assign||function(n){for(var o=1;o<arguments.length;o++){var c=arguments[o];for(var h in c)Object.prototype.hasOwnProperty.call(c,h)&&(n[h]=c[h])}return n}).apply(this,arguments)}function V(n,o){if(n==null)return{};var c,h,i={},d=Object.keys(n);for(h=0;h<d.length;h++)o.indexOf(c=d[h])>=0||(i[c]=n[c]);return i}function L(n){var o=p.useRef(n),c=p.useRef(function(h){o.current&&o.current(h)});return o.current=n,c.current}var O=function(n,o,c){return o===void 0&&(o=0),c===void 0&&(c=1),n>c?c:n<o?o:n},S=function(n){return"touches"in n},B=function(n){return n&&n.ownerDocument.defaultView||self},T=function(n,o,c){var h=n.getBoundingClientRect(),i=S(o)?(function(d,e){for(var t=0;t<d.length;t++)if(d[t].identifier===e)return d[t];return d[0]})(o.touches,c):o;return{left:O((i.pageX-(h.left+B(n).pageXOffset))/h.width),top:O((i.pageY-(h.top+B(n).pageYOffset))/h.height)}},W=function(n){!S(n)&&n.preventDefault()},G=m.memo(function(n){var o=n.onMove,c=n.onKey,h=V(n,["onMove","onKey"]),i=p.useRef(null),d=L(o),e=L(c),t=p.useRef(null),r=p.useRef(!1),a=p.useMemo(function(){var f=function(y){W(y),(S(y)?y.touches.length>0:y.buttons>0)&&i.current?d(T(i.current,y,t.current)):b(!1)},g=function(){return b(!1)};function b(y){var v=r.current,w=B(i.current),E=y?w.addEventListener:w.removeEventListener;E(v?"touchmove":"mousemove",f),E(v?"touchend":"mouseup",g)}return[function(y){var v=y.nativeEvent,w=i.current;if(w&&(W(v),!(function(k,P){return P&&!S(k)})(v,r.current)&&w)){if(S(v)){r.current=!0;var E=v.changedTouches||[];E.length&&(t.current=E[0].identifier)}w.focus(),d(T(w,v,t.current)),b(!0)}},function(y){var v=y.which||y.keyCode;v<37||v>40||(y.preventDefault(),e({left:v===39?.05:v===37?-.05:0,top:v===40?.05:v===38?-.05:0}))},b]},[e,d]),l=a[0],u=a[1],s=a[2];return p.useEffect(function(){return s},[s]),m.createElement("div",C({},h,{onTouchStart:l,onMouseDown:l,className:"react-colorful__interactive",ref:i,onKeyDown:u,tabIndex:0,role:"slider"}))}),N=function(n){return n.filter(Boolean).join(" ")},F=function(n){var o=n.color,c=n.left,h=n.top,i=h===void 0?.5:h,d=N(["react-colorful__pointer",n.className]);return m.createElement("div",{className:d,style:{top:100*i+"%",left:100*c+"%"}},m.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:o}}))},x=function(n,o,c){return o===void 0&&(o=0),c===void 0&&(c=Math.pow(10,o)),Math.round(c*n)/c},ye={grad:.9,turn:360,rad:360/(2*Math.PI)},xe=function(n){return re(X(n))},X=function(n){return n[0]==="#"&&(n=n.substring(1)),n.length<6?{r:parseInt(n[0]+n[0],16),g:parseInt(n[1]+n[1],16),b:parseInt(n[2]+n[2],16),a:n.length===4?x(parseInt(n[3]+n[3],16)/255,2):1}:{r:parseInt(n.substring(0,2),16),g:parseInt(n.substring(2,4),16),b:parseInt(n.substring(4,6),16),a:n.length===8?x(parseInt(n.substring(6,8),16)/255,2):1}},we=function(n,o){return o===void 0&&(o="deg"),Number(n)*(ye[o]||1)},ke=function(n){var o=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(n);return o?_e({h:we(o[1],o[2]),s:Number(o[3]),l:Number(o[4]),a:o[5]===void 0?1:Number(o[5])/(o[6]?100:1)}):{h:0,s:0,v:0,a:1}},_e=function(n){var o=n.s,c=n.l;return{h:n.h,s:(o*=(c<50?c:100-c)/100)>0?2*o/(c+o)*100:0,v:c+o,a:n.a}},Ee=function(n){return Ce(ee(n))},J=function(n){var o=n.s,c=n.v,h=n.a,i=(200-o)*c/100;return{h:x(n.h),s:x(i>0&&i<200?o*c/100/(i<=100?i:200-i)*100:0),l:x(i/2),a:x(h,2)}},K=function(n){var o=J(n);return"hsl("+o.h+", "+o.s+"%, "+o.l+"%)"},I=function(n){var o=J(n);return"hsla("+o.h+", "+o.s+"%, "+o.l+"%, "+o.a+")"},ee=function(n){var o=n.h,c=n.s,h=n.v,i=n.a;o=o/360*6,c/=100,h/=100;var d=Math.floor(o),e=h*(1-c),t=h*(1-(o-d)*c),r=h*(1-(1-o+d)*c),a=d%6;return{r:x(255*[h,t,e,e,r,h][a]),g:x(255*[r,h,h,t,e,e][a]),b:x(255*[e,e,r,h,h,t][a]),a:x(i,2)}},Me=function(n){var o=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(n);return o?re({r:Number(o[1])/(o[2]?100/255:1),g:Number(o[3])/(o[4]?100/255:1),b:Number(o[5])/(o[6]?100/255:1),a:o[7]===void 0?1:Number(o[7])/(o[8]?100:1)}):{h:0,s:0,v:0,a:1}},j=function(n){var o=n.toString(16);return o.length<2?"0"+o:o},Ce=function(n){var o=n.r,c=n.g,h=n.b,i=n.a,d=i<1?j(x(255*i)):"";return"#"+j(o)+j(c)+j(h)+d},re=function(n){var o=n.r,c=n.g,h=n.b,i=n.a,d=Math.max(o,c,h),e=d-Math.min(o,c,h),t=e?d===o?(c-h)/e:d===c?2+(h-o)/e:4+(o-c)/e:0;return{h:x(60*(t<0?t+6:t)),s:x(d?e/d*100:0),v:x(d/255*100),a:i}},te=m.memo(function(n){var o=n.hue,c=n.onChange,h=N(["react-colorful__hue",n.className]);return m.createElement("div",{className:h},m.createElement(G,{onMove:function(i){c({h:360*i.left})},onKey:function(i){c({h:O(o+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":x(o),"aria-valuemax":"360","aria-valuemin":"0"},m.createElement(F,{className:"react-colorful__hue-pointer",left:o/360,color:K({h:o,s:100,v:100,a:1})})))}),ne=m.memo(function(n){var o=n.hsva,c=n.onChange,h={backgroundColor:K({h:o.h,s:100,v:100,a:1})};return m.createElement("div",{className:"react-colorful__saturation",style:h},m.createElement(G,{onMove:function(i){c({s:100*i.left,v:100-100*i.top})},onKey:function(i){c({s:O(o.s+100*i.left,0,100),v:O(o.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+x(o.s)+"%, Brightness "+x(o.v)+"%"},m.createElement(F,{className:"react-colorful__saturation-pointer",top:1-o.v/100,left:o.s/100,color:K(o)})))}),ae=function(n,o){if(n===o)return!0;for(var c in n)if(n[c]!==o[c])return!1;return!0},le=function(n,o){return n.replace(/\s/g,"")===o.replace(/\s/g,"")},$e=function(n,o){return n.toLowerCase()===o.toLowerCase()||ae(X(n),X(o))};function oe(n,o,c){var h=L(c),i=p.useState(function(){return n.toHsva(o)}),d=i[0],e=i[1],t=p.useRef({color:o,hsva:d});p.useEffect(function(){if(!n.equal(o,t.current.color)){var a=n.toHsva(o);t.current={hsva:a,color:o},e(a)}},[o,n]),p.useEffect(function(){var a;ae(d,t.current.hsva)||n.equal(a=n.fromHsva(d),t.current.color)||(t.current={hsva:d,color:a},h(a))},[d,n,h]);var r=p.useCallback(function(a){e(function(l){return Object.assign({},l,a)})},[]);return[d,r]}var Oe=typeof window<"u"?p.useLayoutEffect:p.useEffect,Se=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},A=new Map,ue=function(n){Oe(function(){var o=n.current?n.current.ownerDocument:document;if(o!==void 0&&!A.has(o)){var c=o.createElement("style");c.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,A.set(o,c);var h=Se();h&&c.setAttribute("nonce",h),o.head.appendChild(c)}},[])},Ne=function(n){var o=n.className,c=n.colorModel,h=n.color,i=h===void 0?c.defaultColor:h,d=n.onChange,e=V(n,["className","colorModel","color","onChange"]),t=p.useRef(null);ue(t);var r=oe(c,i,d),a=r[0],l=r[1],u=N(["react-colorful",o]);return m.createElement("div",C({},e,{ref:t,className:u}),m.createElement(ne,{hsva:a,onChange:l}),m.createElement(te,{hue:a.h,onChange:l,className:"react-colorful__last-control"}))},je={defaultColor:"000",toHsva:xe,fromHsva:function(n){return Ee({h:n.h,s:n.s,v:n.v,a:1})},equal:$e},Re=function(n){return m.createElement(Ne,C({},n,{colorModel:je}))},ze=function(n){var o=n.className,c=n.hsva,h=n.onChange,i={backgroundImage:"linear-gradient(90deg, "+I(Object.assign({},c,{a:0}))+", "+I(Object.assign({},c,{a:1}))+")"},d=N(["react-colorful__alpha",o]),e=x(100*c.a);return m.createElement("div",{className:d},m.createElement("div",{className:"react-colorful__alpha-gradient",style:i}),m.createElement(G,{onMove:function(t){h({a:t.left})},onKey:function(t){h({a:O(c.a+t.left)})},"aria-label":"Alpha","aria-valuetext":e+"%","aria-valuenow":e,"aria-valuemin":"0","aria-valuemax":"100"},m.createElement(F,{className:"react-colorful__alpha-pointer",left:c.a,color:I(c)})))},ie=function(n){var o=n.className,c=n.colorModel,h=n.color,i=h===void 0?c.defaultColor:h,d=n.onChange,e=V(n,["className","colorModel","color","onChange"]),t=p.useRef(null);ue(t);var r=oe(c,i,d),a=r[0],l=r[1],u=N(["react-colorful",o]);return m.createElement("div",C({},e,{ref:t,className:u}),m.createElement(ne,{hsva:a,onChange:l}),m.createElement(te,{hue:a.h,onChange:l}),m.createElement(ze,{hsva:a,onChange:l,className:"react-colorful__last-control"}))},Ie={defaultColor:"hsla(0, 0%, 0%, 1)",toHsva:ke,fromHsva:I,equal:le},He=function(n){return m.createElement(ie,C({},n,{colorModel:Ie}))},qe={defaultColor:"rgba(0, 0, 0, 1)",toHsva:Me,fromHsva:function(n){var o=ee(n);return"rgba("+o.r+", "+o.g+", "+o.b+", "+o.a+")"},equal:le},Pe=function(n){return m.createElement(ie,C({},n,{colorModel:qe}))},Le=M.div({position:"relative",maxWidth:250,'&[aria-readonly="true"]':{opacity:.5}}),Be=M(Y)({position:"absolute",zIndex:1,top:4,left:4,"[aria-readonly=true] &":{cursor:"not-allowed"}}),Xe=M.div({width:200,margin:5,".react-colorful__saturation":{borderRadius:"4px 4px 0 0"},".react-colorful__hue":{boxShadow:"inset 0 0 0 1px rgb(0 0 0 / 5%)"},".react-colorful__last-control":{borderRadius:"0 0 4px 4px"}}),Ke=M(fe)(({theme:n})=>({fontFamily:n.typography.fonts.base})),De=M.div({display:"grid",gridTemplateColumns:"repeat(9, 16px)",gap:6,padding:3,marginTop:5,width:200}),Ve=M.div(({theme:n,active:o})=>({width:16,height:16,boxShadow:o?`${n.appBorderColor} 0 0 0 1px inset, ${n.textMutedColor}50 0 0 0 4px`:`${n.appBorderColor} 0 0 0 1px inset`,borderRadius:n.appBorderRadius})),Ge=`url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')`,Q=({value:n,style:o,...c})=>{let h=`linear-gradient(${n}, ${n}), ${Ge}, linear-gradient(#fff, #fff)`;return m.createElement(Ve,{...c,style:{...o,backgroundImage:h}})},Fe=M(de.Input)(({theme:n,readOnly:o})=>({width:"100%",paddingLeft:30,paddingRight:30,boxSizing:"border-box",fontFamily:n.typography.fonts.base})),Te=M(ge)(({theme:n})=>({position:"absolute",zIndex:1,top:6,right:7,width:20,height:20,padding:4,boxSizing:"border-box",cursor:"pointer",color:n.input.color})),se=(n=>(n.RGB="rgb",n.HSL="hsl",n.HEX="hex",n))(se||{}),R=Object.values(se),We=/\(([0-9]+),\s*([0-9]+)%?,\s*([0-9]+)%?,?\s*([0-9.]+)?\)/,Ae=/^\s*rgba?\(([0-9]+),\s*([0-9]+),\s*([0-9]+),?\s*([0-9.]+)?\)\s*$/i,Qe=/^\s*hsla?\(([0-9]+),\s*([0-9]+)%,\s*([0-9]+)%,?\s*([0-9.]+)?\)\s*$/i,D=/^\s*#?([0-9a-f]{3}|[0-9a-f]{6})\s*$/i,Ue=/^\s*#?([0-9a-f]{3})\s*$/i,Ye={hex:Re,rgb:Pe,hsl:He},z={hex:"transparent",rgb:"rgba(0, 0, 0, 0)",hsl:"hsla(0, 0%, 0%, 0)"},U=n=>{let o=n==null?void 0:n.match(We);if(!o)return[0,0,0,1];let[,c,h,i,d=1]=o;return[c,h,i,d].map(Number)},$=n=>{if(!n)return;let o=!0;if(Ae.test(n)){let[e,t,r,a]=U(n),[l,u,s]=_.default.rgb.hsl([e,t,r])||[0,0,0];return{valid:o,value:n,keyword:_.default.rgb.keyword([e,t,r]),colorSpace:"rgb",rgb:n,hsl:`hsla(${l}, ${u}%, ${s}%, ${a})`,hex:`#${_.default.rgb.hex([e,t,r]).toLowerCase()}`}}if(Qe.test(n)){let[e,t,r,a]=U(n),[l,u,s]=_.default.hsl.rgb([e,t,r])||[0,0,0];return{valid:o,value:n,keyword:_.default.hsl.keyword([e,t,r]),colorSpace:"hsl",rgb:`rgba(${l}, ${u}, ${s}, ${a})`,hsl:n,hex:`#${_.default.hsl.hex([e,t,r]).toLowerCase()}`}}let c=n.replace("#",""),h=_.default.keyword.rgb(c)||_.default.hex.rgb(c),i=_.default.rgb.hsl(h),d=n;if(/[^#a-f0-9]/i.test(n)?d=c:D.test(n)&&(d=`#${c}`),d.startsWith("#"))o=D.test(d);else try{_.default.keyword.hex(d)}catch{o=!1}return{valid:o,value:d,keyword:_.default.rgb.keyword(h),colorSpace:"hex",rgb:`rgba(${h[0]}, ${h[1]}, ${h[2]}, 1)`,hsl:`hsla(${i[0]}, ${i[1]}%, ${i[2]}%, 1)`,hex:d}},Ze=(n,o,c)=>{if(!n||!(o!=null&&o.valid))return z[c];if(c!=="hex")return(o==null?void 0:o[c])||z[c];if(!o.hex.startsWith("#"))try{return`#${_.default.keyword.hex(o.hex)}`}catch{return z.hex}let h=o.hex.match(Ue);if(!h)return D.test(o.hex)?o.hex:z.hex;let[i,d,e]=h[1].split("");return`#${i}${i}${d}${d}${e}${e}`},Je=(n,o)=>{let[c,h]=p.useState(n||""),[i,d]=p.useState(()=>$(c)),[e,t]=p.useState((i==null?void 0:i.colorSpace)||"hex");p.useEffect(()=>{let u=n||"",s=$(u);h(u),d(s),t((s==null?void 0:s.colorSpace)||"hex")},[n]);let r=p.useMemo(()=>Ze(c,i,e).toLowerCase(),[c,i,e]),a=p.useCallback(u=>{let s=$(u),f=(s==null?void 0:s.value)||u||"";h(f),f===""&&(d(void 0),o(void 0)),s&&(d(s),t(s.colorSpace),o(s.value))},[o]),l=p.useCallback(()=>{let u=R.indexOf(e)+1;u>=R.length&&(u=0),t(R[u]);let s=(i==null?void 0:i[R[u]])||"";h(s),o(s)},[i,e,o]);return{value:c,realValue:r,updateValue:a,color:i,colorSpace:e,cycleColorSpace:l}},H=n=>n.replace(/\s*/,"").toLowerCase(),er=(n,o,c)=>{let[h,i]=p.useState(o!=null&&o.valid?[o]:[]);p.useEffect(()=>{o===void 0&&i([])},[o]);let d=p.useMemo(()=>(n||[]).map(t=>typeof t=="string"?$(t):t.title?{...$(t.color),keyword:t.title}:$(t.color)).concat(h).filter(Boolean).slice(-27),[n,h]),e=p.useCallback(t=>{t!=null&&t.valid&&(d.some(r=>H(r[c])===H(t[c]))||i(r=>r.concat(t)))},[c,d]);return{presets:d,addPreset:e}},rr=({name:n,value:o,onChange:c,onFocus:h,onBlur:i,presetColors:d,startOpen:e=!1,argType:t})=>{var E;let r=p.useCallback(ce(c,200),[c]),{value:a,realValue:l,updateValue:u,color:s,colorSpace:f,cycleColorSpace:g}=Je(o,r),{presets:b,addPreset:y}=er(d,s,f),v=Ye[f],w=!!((E=t==null?void 0:t.table)!=null&&E.readonly);return m.createElement(Le,{"aria-readonly":w},m.createElement(Be,{startOpen:e,trigger:w?[null]:void 0,closeOnOutsideClick:!0,onVisibleChange:()=>y(s),tooltip:m.createElement(Xe,null,m.createElement(v,{color:l==="transparent"?"#000000":l,onChange:u,onFocus:h,onBlur:i}),b.length>0&&m.createElement(De,null,b.map((k,P)=>m.createElement(Y,{key:`${k.value}-${P}`,hasChrome:!1,tooltip:m.createElement(Ke,{note:k.keyword||k.value})},m.createElement(Q,{value:k[f],active:s&&H(k[f])===H(s[f]),onClick:()=>u(k.value)})))))},m.createElement(Q,{value:l,style:{margin:4}})),m.createElement(Fe,{id:he(n),value:a,onChange:k=>u(k.target.value),onFocus:k=>k.target.select(),readOnly:w,placeholder:"Choose color..."}),a?m.createElement(Te,{onClick:g}):null)},hr=rr;export{rr as ColorControl,hr as default};
|
|
1
|
+
import{d as ce,Z as Y,g as he,v as M,s as fe,Q as de,M as ge,_ as be,a as q}from"./index-MqY7mw_o.js";import{r as p,R as m}from"./index-Dmy2JGbm.js";import"./iframe-B8FjC8Y_.js";import"./jsx-runtime-BTJTZTIL.js";import"./index-ChsGqxH_.js";import"./index-CT3U1fyk.js";import"./index-BRq5TIsn.js";import"./index-DgH-xKnr.js";import"./index-DrFu-skq.js";var me=q({"../../node_modules/color-name/index.js"(n,o){o.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}}),Z=q({"../../node_modules/color-convert/conversions.js"(n,o){var c=me(),h={};for(let e of Object.keys(c))h[c[e]]=e;var i={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};o.exports=i;for(let e of Object.keys(i)){if(!("channels"in i[e]))throw new Error("missing channels property: "+e);if(!("labels"in i[e]))throw new Error("missing channel labels property: "+e);if(i[e].labels.length!==i[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:r}=i[e];delete i[e].channels,delete i[e].labels,Object.defineProperty(i[e],"channels",{value:t}),Object.defineProperty(i[e],"labels",{value:r})}i.rgb.hsl=function(e){let t=e[0]/255,r=e[1]/255,a=e[2]/255,l=Math.min(t,r,a),u=Math.max(t,r,a),s=u-l,f,g;u===l?f=0:t===u?f=(r-a)/s:r===u?f=2+(a-t)/s:a===u&&(f=4+(t-r)/s),f=Math.min(f*60,360),f<0&&(f+=360);let b=(l+u)/2;return u===l?g=0:b<=.5?g=s/(u+l):g=s/(2-u-l),[f,g*100,b*100]},i.rgb.hsv=function(e){let t,r,a,l,u,s=e[0]/255,f=e[1]/255,g=e[2]/255,b=Math.max(s,f,g),y=b-Math.min(s,f,g),v=function(w){return(b-w)/6/y+1/2};return y===0?(l=0,u=0):(u=y/b,t=v(s),r=v(f),a=v(g),s===b?l=a-r:f===b?l=1/3+t-a:g===b&&(l=2/3+r-t),l<0?l+=1:l>1&&(l-=1)),[l*360,u*100,b*100]},i.rgb.hwb=function(e){let t=e[0],r=e[1],a=e[2],l=i.rgb.hsl(e)[0],u=1/255*Math.min(t,Math.min(r,a));return a=1-1/255*Math.max(t,Math.max(r,a)),[l,u*100,a*100]},i.rgb.cmyk=function(e){let t=e[0]/255,r=e[1]/255,a=e[2]/255,l=Math.min(1-t,1-r,1-a),u=(1-t-l)/(1-l)||0,s=(1-r-l)/(1-l)||0,f=(1-a-l)/(1-l)||0;return[u*100,s*100,f*100,l*100]};function d(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}i.rgb.keyword=function(e){let t=h[e];if(t)return t;let r=1/0,a;for(let l of Object.keys(c)){let u=c[l],s=d(e,u);s<r&&(r=s,a=l)}return a},i.keyword.rgb=function(e){return c[e]},i.rgb.xyz=function(e){let t=e[0]/255,r=e[1]/255,a=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,a=a>.04045?((a+.055)/1.055)**2.4:a/12.92;let l=t*.4124+r*.3576+a*.1805,u=t*.2126+r*.7152+a*.0722,s=t*.0193+r*.1192+a*.9505;return[l*100,u*100,s*100]},i.rgb.lab=function(e){let t=i.rgb.xyz(e),r=t[0],a=t[1],l=t[2];r/=95.047,a/=100,l/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,l=l>.008856?l**(1/3):7.787*l+16/116;let u=116*a-16,s=500*(r-a),f=200*(a-l);return[u,s,f]},i.hsl.rgb=function(e){let t=e[0]/360,r=e[1]/100,a=e[2]/100,l,u,s;if(r===0)return s=a*255,[s,s,s];a<.5?l=a*(1+r):l=a+r-a*r;let f=2*a-l,g=[0,0,0];for(let b=0;b<3;b++)u=t+1/3*-(b-1),u<0&&u++,u>1&&u--,6*u<1?s=f+(l-f)*6*u:2*u<1?s=l:3*u<2?s=f+(l-f)*(2/3-u)*6:s=f,g[b]=s*255;return g},i.hsl.hsv=function(e){let t=e[0],r=e[1]/100,a=e[2]/100,l=r,u=Math.max(a,.01);a*=2,r*=a<=1?a:2-a,l*=u<=1?u:2-u;let s=(a+r)/2,f=a===0?2*l/(u+l):2*r/(a+r);return[t,f*100,s*100]},i.hsv.rgb=function(e){let t=e[0]/60,r=e[1]/100,a=e[2]/100,l=Math.floor(t)%6,u=t-Math.floor(t),s=255*a*(1-r),f=255*a*(1-r*u),g=255*a*(1-r*(1-u));switch(a*=255,l){case 0:return[a,g,s];case 1:return[f,a,s];case 2:return[s,a,g];case 3:return[s,f,a];case 4:return[g,s,a];case 5:return[a,s,f]}},i.hsv.hsl=function(e){let t=e[0],r=e[1]/100,a=e[2]/100,l=Math.max(a,.01),u,s;s=(2-r)*a;let f=(2-r)*l;return u=r*l,u/=f<=1?f:2-f,u=u||0,s/=2,[t,u*100,s*100]},i.hwb.rgb=function(e){let t=e[0]/360,r=e[1]/100,a=e[2]/100,l=r+a,u;l>1&&(r/=l,a/=l);let s=Math.floor(6*t),f=1-a;u=6*t-s,(s&1)!==0&&(u=1-u);let g=r+u*(f-r),b,y,v;switch(s){default:case 6:case 0:b=f,y=g,v=r;break;case 1:b=g,y=f,v=r;break;case 2:b=r,y=f,v=g;break;case 3:b=r,y=g,v=f;break;case 4:b=g,y=r,v=f;break;case 5:b=f,y=r,v=g;break}return[b*255,y*255,v*255]},i.cmyk.rgb=function(e){let t=e[0]/100,r=e[1]/100,a=e[2]/100,l=e[3]/100,u=1-Math.min(1,t*(1-l)+l),s=1-Math.min(1,r*(1-l)+l),f=1-Math.min(1,a*(1-l)+l);return[u*255,s*255,f*255]},i.xyz.rgb=function(e){let t=e[0]/100,r=e[1]/100,a=e[2]/100,l,u,s;return l=t*3.2406+r*-1.5372+a*-.4986,u=t*-.9689+r*1.8758+a*.0415,s=t*.0557+r*-.204+a*1.057,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,l=Math.min(Math.max(0,l),1),u=Math.min(Math.max(0,u),1),s=Math.min(Math.max(0,s),1),[l*255,u*255,s*255]},i.xyz.lab=function(e){let t=e[0],r=e[1],a=e[2];t/=95.047,r/=100,a/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;let l=116*r-16,u=500*(t-r),s=200*(r-a);return[l,u,s]},i.lab.xyz=function(e){let t=e[0],r=e[1],a=e[2],l,u,s;u=(t+16)/116,l=r/500+u,s=u-a/200;let f=u**3,g=l**3,b=s**3;return u=f>.008856?f:(u-16/116)/7.787,l=g>.008856?g:(l-16/116)/7.787,s=b>.008856?b:(s-16/116)/7.787,l*=95.047,u*=100,s*=108.883,[l,u,s]},i.lab.lch=function(e){let t=e[0],r=e[1],a=e[2],l;l=Math.atan2(a,r)*360/2/Math.PI,l<0&&(l+=360);let u=Math.sqrt(r*r+a*a);return[t,u,l]},i.lch.lab=function(e){let t=e[0],r=e[1],a=e[2]/360*2*Math.PI,l=r*Math.cos(a),u=r*Math.sin(a);return[t,l,u]},i.rgb.ansi16=function(e,t=null){let[r,a,l]=e,u=t===null?i.rgb.hsv(e)[2]:t;if(u=Math.round(u/50),u===0)return 30;let s=30+(Math.round(l/255)<<2|Math.round(a/255)<<1|Math.round(r/255));return u===2&&(s+=60),s},i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])},i.rgb.ansi256=function(e){let t=e[0],r=e[1],a=e[2];return t===r&&r===a?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(a/255*5)},i.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let r=(~~(e>50)+1)*.5,a=(t&1)*r*255,l=(t>>1&1)*r*255,u=(t>>2&1)*r*255;return[a,l,u]},i.ansi256.rgb=function(e){if(e>=232){let u=(e-232)*10+8;return[u,u,u]}e-=16;let t,r=Math.floor(e/36)/5*255,a=Math.floor((t=e%36)/6)/5*255,l=t%6/5*255;return[r,a,l]},i.rgb.hex=function(e){let t=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(t.length)+t},i.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let r=t[0];t[0].length===3&&(r=r.split("").map(f=>f+f).join(""));let a=parseInt(r,16),l=a>>16&255,u=a>>8&255,s=a&255;return[l,u,s]},i.rgb.hcg=function(e){let t=e[0]/255,r=e[1]/255,a=e[2]/255,l=Math.max(Math.max(t,r),a),u=Math.min(Math.min(t,r),a),s=l-u,f,g;return s<1?f=u/(1-s):f=0,s<=0?g=0:l===t?g=(r-a)/s%6:l===r?g=2+(a-t)/s:g=4+(t-r)/s,g/=6,g%=1,[g*360,s*100,f*100]},i.hsl.hcg=function(e){let t=e[1]/100,r=e[2]/100,a=r<.5?2*t*r:2*t*(1-r),l=0;return a<1&&(l=(r-.5*a)/(1-a)),[e[0],a*100,l*100]},i.hsv.hcg=function(e){let t=e[1]/100,r=e[2]/100,a=t*r,l=0;return a<1&&(l=(r-a)/(1-a)),[e[0],a*100,l*100]},i.hcg.rgb=function(e){let t=e[0]/360,r=e[1]/100,a=e[2]/100;if(r===0)return[a*255,a*255,a*255];let l=[0,0,0],u=t%1*6,s=u%1,f=1-s,g=0;switch(Math.floor(u)){case 0:l[0]=1,l[1]=s,l[2]=0;break;case 1:l[0]=f,l[1]=1,l[2]=0;break;case 2:l[0]=0,l[1]=1,l[2]=s;break;case 3:l[0]=0,l[1]=f,l[2]=1;break;case 4:l[0]=s,l[1]=0,l[2]=1;break;default:l[0]=1,l[1]=0,l[2]=f}return g=(1-r)*a,[(r*l[0]+g)*255,(r*l[1]+g)*255,(r*l[2]+g)*255]},i.hcg.hsv=function(e){let t=e[1]/100,r=e[2]/100,a=t+r*(1-t),l=0;return a>0&&(l=t/a),[e[0],l*100,a*100]},i.hcg.hsl=function(e){let t=e[1]/100,r=e[2]/100*(1-t)+.5*t,a=0;return r>0&&r<.5?a=t/(2*r):r>=.5&&r<1&&(a=t/(2*(1-r))),[e[0],a*100,r*100]},i.hcg.hwb=function(e){let t=e[1]/100,r=e[2]/100,a=t+r*(1-t);return[e[0],(a-t)*100,(1-a)*100]},i.hwb.hcg=function(e){let t=e[1]/100,r=1-e[2]/100,a=r-t,l=0;return a<1&&(l=(r-a)/(1-a)),[e[0],a*100,l*100]},i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},i.gray.hsl=function(e){return[0,0,e[0]]},i.gray.hsv=i.gray.hsl,i.gray.hwb=function(e){return[0,100,e[0]]},i.gray.cmyk=function(e){return[0,0,0,e[0]]},i.gray.lab=function(e){return[e[0],0,0]},i.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},i.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}}}),ve=q({"../../node_modules/color-convert/route.js"(n,o){var c=Z();function h(){let t={},r=Object.keys(c);for(let a=r.length,l=0;l<a;l++)t[r[l]]={distance:-1,parent:null};return t}function i(t){let r=h(),a=[t];for(r[t].distance=0;a.length;){let l=a.pop(),u=Object.keys(c[l]);for(let s=u.length,f=0;f<s;f++){let g=u[f],b=r[g];b.distance===-1&&(b.distance=r[l].distance+1,b.parent=l,a.unshift(g))}}return r}function d(t,r){return function(a){return r(t(a))}}function e(t,r){let a=[r[t].parent,t],l=c[r[t].parent][t],u=r[t].parent;for(;r[u].parent;)a.unshift(r[u].parent),l=d(c[r[u].parent][u],l),u=r[u].parent;return l.conversion=a,l}o.exports=function(t){let r=i(t),a={},l=Object.keys(r);for(let u=l.length,s=0;s<u;s++){let f=l[s];r[f].parent!==null&&(a[f]=e(f,r))}return a}}}),pe=q({"../../node_modules/color-convert/index.js"(n,o){var c=Z(),h=ve(),i={},d=Object.keys(c);function e(r){let a=function(...l){let u=l[0];return u==null?u:(u.length>1&&(l=u),r(l))};return"conversion"in r&&(a.conversion=r.conversion),a}function t(r){let a=function(...l){let u=l[0];if(u==null)return u;u.length>1&&(l=u);let s=r(l);if(typeof s=="object")for(let f=s.length,g=0;g<f;g++)s[g]=Math.round(s[g]);return s};return"conversion"in r&&(a.conversion=r.conversion),a}d.forEach(r=>{i[r]={},Object.defineProperty(i[r],"channels",{value:c[r].channels}),Object.defineProperty(i[r],"labels",{value:c[r].labels});let a=h(r);Object.keys(a).forEach(l=>{let u=a[l];i[r][l]=t(u),i[r][l].raw=e(u)})}),o.exports=i}}),_=be(pe());function C(){return(C=Object.assign||function(n){for(var o=1;o<arguments.length;o++){var c=arguments[o];for(var h in c)Object.prototype.hasOwnProperty.call(c,h)&&(n[h]=c[h])}return n}).apply(this,arguments)}function V(n,o){if(n==null)return{};var c,h,i={},d=Object.keys(n);for(h=0;h<d.length;h++)o.indexOf(c=d[h])>=0||(i[c]=n[c]);return i}function L(n){var o=p.useRef(n),c=p.useRef(function(h){o.current&&o.current(h)});return o.current=n,c.current}var O=function(n,o,c){return o===void 0&&(o=0),c===void 0&&(c=1),n>c?c:n<o?o:n},S=function(n){return"touches"in n},B=function(n){return n&&n.ownerDocument.defaultView||self},T=function(n,o,c){var h=n.getBoundingClientRect(),i=S(o)?(function(d,e){for(var t=0;t<d.length;t++)if(d[t].identifier===e)return d[t];return d[0]})(o.touches,c):o;return{left:O((i.pageX-(h.left+B(n).pageXOffset))/h.width),top:O((i.pageY-(h.top+B(n).pageYOffset))/h.height)}},W=function(n){!S(n)&&n.preventDefault()},G=m.memo(function(n){var o=n.onMove,c=n.onKey,h=V(n,["onMove","onKey"]),i=p.useRef(null),d=L(o),e=L(c),t=p.useRef(null),r=p.useRef(!1),a=p.useMemo(function(){var f=function(y){W(y),(S(y)?y.touches.length>0:y.buttons>0)&&i.current?d(T(i.current,y,t.current)):b(!1)},g=function(){return b(!1)};function b(y){var v=r.current,w=B(i.current),E=y?w.addEventListener:w.removeEventListener;E(v?"touchmove":"mousemove",f),E(v?"touchend":"mouseup",g)}return[function(y){var v=y.nativeEvent,w=i.current;if(w&&(W(v),!(function(k,P){return P&&!S(k)})(v,r.current)&&w)){if(S(v)){r.current=!0;var E=v.changedTouches||[];E.length&&(t.current=E[0].identifier)}w.focus(),d(T(w,v,t.current)),b(!0)}},function(y){var v=y.which||y.keyCode;v<37||v>40||(y.preventDefault(),e({left:v===39?.05:v===37?-.05:0,top:v===40?.05:v===38?-.05:0}))},b]},[e,d]),l=a[0],u=a[1],s=a[2];return p.useEffect(function(){return s},[s]),m.createElement("div",C({},h,{onTouchStart:l,onMouseDown:l,className:"react-colorful__interactive",ref:i,onKeyDown:u,tabIndex:0,role:"slider"}))}),N=function(n){return n.filter(Boolean).join(" ")},F=function(n){var o=n.color,c=n.left,h=n.top,i=h===void 0?.5:h,d=N(["react-colorful__pointer",n.className]);return m.createElement("div",{className:d,style:{top:100*i+"%",left:100*c+"%"}},m.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:o}}))},x=function(n,o,c){return o===void 0&&(o=0),c===void 0&&(c=Math.pow(10,o)),Math.round(c*n)/c},ye={grad:.9,turn:360,rad:360/(2*Math.PI)},xe=function(n){return re(X(n))},X=function(n){return n[0]==="#"&&(n=n.substring(1)),n.length<6?{r:parseInt(n[0]+n[0],16),g:parseInt(n[1]+n[1],16),b:parseInt(n[2]+n[2],16),a:n.length===4?x(parseInt(n[3]+n[3],16)/255,2):1}:{r:parseInt(n.substring(0,2),16),g:parseInt(n.substring(2,4),16),b:parseInt(n.substring(4,6),16),a:n.length===8?x(parseInt(n.substring(6,8),16)/255,2):1}},we=function(n,o){return o===void 0&&(o="deg"),Number(n)*(ye[o]||1)},ke=function(n){var o=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(n);return o?_e({h:we(o[1],o[2]),s:Number(o[3]),l:Number(o[4]),a:o[5]===void 0?1:Number(o[5])/(o[6]?100:1)}):{h:0,s:0,v:0,a:1}},_e=function(n){var o=n.s,c=n.l;return{h:n.h,s:(o*=(c<50?c:100-c)/100)>0?2*o/(c+o)*100:0,v:c+o,a:n.a}},Ee=function(n){return Ce(ee(n))},J=function(n){var o=n.s,c=n.v,h=n.a,i=(200-o)*c/100;return{h:x(n.h),s:x(i>0&&i<200?o*c/100/(i<=100?i:200-i)*100:0),l:x(i/2),a:x(h,2)}},K=function(n){var o=J(n);return"hsl("+o.h+", "+o.s+"%, "+o.l+"%)"},I=function(n){var o=J(n);return"hsla("+o.h+", "+o.s+"%, "+o.l+"%, "+o.a+")"},ee=function(n){var o=n.h,c=n.s,h=n.v,i=n.a;o=o/360*6,c/=100,h/=100;var d=Math.floor(o),e=h*(1-c),t=h*(1-(o-d)*c),r=h*(1-(1-o+d)*c),a=d%6;return{r:x(255*[h,t,e,e,r,h][a]),g:x(255*[r,h,h,t,e,e][a]),b:x(255*[e,e,r,h,h,t][a]),a:x(i,2)}},Me=function(n){var o=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(n);return o?re({r:Number(o[1])/(o[2]?100/255:1),g:Number(o[3])/(o[4]?100/255:1),b:Number(o[5])/(o[6]?100/255:1),a:o[7]===void 0?1:Number(o[7])/(o[8]?100:1)}):{h:0,s:0,v:0,a:1}},j=function(n){var o=n.toString(16);return o.length<2?"0"+o:o},Ce=function(n){var o=n.r,c=n.g,h=n.b,i=n.a,d=i<1?j(x(255*i)):"";return"#"+j(o)+j(c)+j(h)+d},re=function(n){var o=n.r,c=n.g,h=n.b,i=n.a,d=Math.max(o,c,h),e=d-Math.min(o,c,h),t=e?d===o?(c-h)/e:d===c?2+(h-o)/e:4+(o-c)/e:0;return{h:x(60*(t<0?t+6:t)),s:x(d?e/d*100:0),v:x(d/255*100),a:i}},te=m.memo(function(n){var o=n.hue,c=n.onChange,h=N(["react-colorful__hue",n.className]);return m.createElement("div",{className:h},m.createElement(G,{onMove:function(i){c({h:360*i.left})},onKey:function(i){c({h:O(o+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":x(o),"aria-valuemax":"360","aria-valuemin":"0"},m.createElement(F,{className:"react-colorful__hue-pointer",left:o/360,color:K({h:o,s:100,v:100,a:1})})))}),ne=m.memo(function(n){var o=n.hsva,c=n.onChange,h={backgroundColor:K({h:o.h,s:100,v:100,a:1})};return m.createElement("div",{className:"react-colorful__saturation",style:h},m.createElement(G,{onMove:function(i){c({s:100*i.left,v:100-100*i.top})},onKey:function(i){c({s:O(o.s+100*i.left,0,100),v:O(o.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+x(o.s)+"%, Brightness "+x(o.v)+"%"},m.createElement(F,{className:"react-colorful__saturation-pointer",top:1-o.v/100,left:o.s/100,color:K(o)})))}),ae=function(n,o){if(n===o)return!0;for(var c in n)if(n[c]!==o[c])return!1;return!0},le=function(n,o){return n.replace(/\s/g,"")===o.replace(/\s/g,"")},$e=function(n,o){return n.toLowerCase()===o.toLowerCase()||ae(X(n),X(o))};function oe(n,o,c){var h=L(c),i=p.useState(function(){return n.toHsva(o)}),d=i[0],e=i[1],t=p.useRef({color:o,hsva:d});p.useEffect(function(){if(!n.equal(o,t.current.color)){var a=n.toHsva(o);t.current={hsva:a,color:o},e(a)}},[o,n]),p.useEffect(function(){var a;ae(d,t.current.hsva)||n.equal(a=n.fromHsva(d),t.current.color)||(t.current={hsva:d,color:a},h(a))},[d,n,h]);var r=p.useCallback(function(a){e(function(l){return Object.assign({},l,a)})},[]);return[d,r]}var Oe=typeof window<"u"?p.useLayoutEffect:p.useEffect,Se=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},A=new Map,ue=function(n){Oe(function(){var o=n.current?n.current.ownerDocument:document;if(o!==void 0&&!A.has(o)){var c=o.createElement("style");c.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,A.set(o,c);var h=Se();h&&c.setAttribute("nonce",h),o.head.appendChild(c)}},[])},Ne=function(n){var o=n.className,c=n.colorModel,h=n.color,i=h===void 0?c.defaultColor:h,d=n.onChange,e=V(n,["className","colorModel","color","onChange"]),t=p.useRef(null);ue(t);var r=oe(c,i,d),a=r[0],l=r[1],u=N(["react-colorful",o]);return m.createElement("div",C({},e,{ref:t,className:u}),m.createElement(ne,{hsva:a,onChange:l}),m.createElement(te,{hue:a.h,onChange:l,className:"react-colorful__last-control"}))},je={defaultColor:"000",toHsva:xe,fromHsva:function(n){return Ee({h:n.h,s:n.s,v:n.v,a:1})},equal:$e},Re=function(n){return m.createElement(Ne,C({},n,{colorModel:je}))},ze=function(n){var o=n.className,c=n.hsva,h=n.onChange,i={backgroundImage:"linear-gradient(90deg, "+I(Object.assign({},c,{a:0}))+", "+I(Object.assign({},c,{a:1}))+")"},d=N(["react-colorful__alpha",o]),e=x(100*c.a);return m.createElement("div",{className:d},m.createElement("div",{className:"react-colorful__alpha-gradient",style:i}),m.createElement(G,{onMove:function(t){h({a:t.left})},onKey:function(t){h({a:O(c.a+t.left)})},"aria-label":"Alpha","aria-valuetext":e+"%","aria-valuenow":e,"aria-valuemin":"0","aria-valuemax":"100"},m.createElement(F,{className:"react-colorful__alpha-pointer",left:c.a,color:I(c)})))},ie=function(n){var o=n.className,c=n.colorModel,h=n.color,i=h===void 0?c.defaultColor:h,d=n.onChange,e=V(n,["className","colorModel","color","onChange"]),t=p.useRef(null);ue(t);var r=oe(c,i,d),a=r[0],l=r[1],u=N(["react-colorful",o]);return m.createElement("div",C({},e,{ref:t,className:u}),m.createElement(ne,{hsva:a,onChange:l}),m.createElement(te,{hue:a.h,onChange:l}),m.createElement(ze,{hsva:a,onChange:l,className:"react-colorful__last-control"}))},Ie={defaultColor:"hsla(0, 0%, 0%, 1)",toHsva:ke,fromHsva:I,equal:le},He=function(n){return m.createElement(ie,C({},n,{colorModel:Ie}))},qe={defaultColor:"rgba(0, 0, 0, 1)",toHsva:Me,fromHsva:function(n){var o=ee(n);return"rgba("+o.r+", "+o.g+", "+o.b+", "+o.a+")"},equal:le},Pe=function(n){return m.createElement(ie,C({},n,{colorModel:qe}))},Le=M.div({position:"relative",maxWidth:250,'&[aria-readonly="true"]':{opacity:.5}}),Be=M(Y)({position:"absolute",zIndex:1,top:4,left:4,"[aria-readonly=true] &":{cursor:"not-allowed"}}),Xe=M.div({width:200,margin:5,".react-colorful__saturation":{borderRadius:"4px 4px 0 0"},".react-colorful__hue":{boxShadow:"inset 0 0 0 1px rgb(0 0 0 / 5%)"},".react-colorful__last-control":{borderRadius:"0 0 4px 4px"}}),Ke=M(fe)(({theme:n})=>({fontFamily:n.typography.fonts.base})),De=M.div({display:"grid",gridTemplateColumns:"repeat(9, 16px)",gap:6,padding:3,marginTop:5,width:200}),Ve=M.div(({theme:n,active:o})=>({width:16,height:16,boxShadow:o?`${n.appBorderColor} 0 0 0 1px inset, ${n.textMutedColor}50 0 0 0 4px`:`${n.appBorderColor} 0 0 0 1px inset`,borderRadius:n.appBorderRadius})),Ge=`url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')`,Q=({value:n,style:o,...c})=>{let h=`linear-gradient(${n}, ${n}), ${Ge}, linear-gradient(#fff, #fff)`;return m.createElement(Ve,{...c,style:{...o,backgroundImage:h}})},Fe=M(de.Input)(({theme:n,readOnly:o})=>({width:"100%",paddingLeft:30,paddingRight:30,boxSizing:"border-box",fontFamily:n.typography.fonts.base})),Te=M(ge)(({theme:n})=>({position:"absolute",zIndex:1,top:6,right:7,width:20,height:20,padding:4,boxSizing:"border-box",cursor:"pointer",color:n.input.color})),se=(n=>(n.RGB="rgb",n.HSL="hsl",n.HEX="hex",n))(se||{}),R=Object.values(se),We=/\(([0-9]+),\s*([0-9]+)%?,\s*([0-9]+)%?,?\s*([0-9.]+)?\)/,Ae=/^\s*rgba?\(([0-9]+),\s*([0-9]+),\s*([0-9]+),?\s*([0-9.]+)?\)\s*$/i,Qe=/^\s*hsla?\(([0-9]+),\s*([0-9]+)%,\s*([0-9]+)%,?\s*([0-9.]+)?\)\s*$/i,D=/^\s*#?([0-9a-f]{3}|[0-9a-f]{6})\s*$/i,Ue=/^\s*#?([0-9a-f]{3})\s*$/i,Ye={hex:Re,rgb:Pe,hsl:He},z={hex:"transparent",rgb:"rgba(0, 0, 0, 0)",hsl:"hsla(0, 0%, 0%, 0)"},U=n=>{let o=n==null?void 0:n.match(We);if(!o)return[0,0,0,1];let[,c,h,i,d=1]=o;return[c,h,i,d].map(Number)},$=n=>{if(!n)return;let o=!0;if(Ae.test(n)){let[e,t,r,a]=U(n),[l,u,s]=_.default.rgb.hsl([e,t,r])||[0,0,0];return{valid:o,value:n,keyword:_.default.rgb.keyword([e,t,r]),colorSpace:"rgb",rgb:n,hsl:`hsla(${l}, ${u}%, ${s}%, ${a})`,hex:`#${_.default.rgb.hex([e,t,r]).toLowerCase()}`}}if(Qe.test(n)){let[e,t,r,a]=U(n),[l,u,s]=_.default.hsl.rgb([e,t,r])||[0,0,0];return{valid:o,value:n,keyword:_.default.hsl.keyword([e,t,r]),colorSpace:"hsl",rgb:`rgba(${l}, ${u}, ${s}, ${a})`,hsl:n,hex:`#${_.default.hsl.hex([e,t,r]).toLowerCase()}`}}let c=n.replace("#",""),h=_.default.keyword.rgb(c)||_.default.hex.rgb(c),i=_.default.rgb.hsl(h),d=n;if(/[^#a-f0-9]/i.test(n)?d=c:D.test(n)&&(d=`#${c}`),d.startsWith("#"))o=D.test(d);else try{_.default.keyword.hex(d)}catch{o=!1}return{valid:o,value:d,keyword:_.default.rgb.keyword(h),colorSpace:"hex",rgb:`rgba(${h[0]}, ${h[1]}, ${h[2]}, 1)`,hsl:`hsla(${i[0]}, ${i[1]}%, ${i[2]}%, 1)`,hex:d}},Ze=(n,o,c)=>{if(!n||!(o!=null&&o.valid))return z[c];if(c!=="hex")return(o==null?void 0:o[c])||z[c];if(!o.hex.startsWith("#"))try{return`#${_.default.keyword.hex(o.hex)}`}catch{return z.hex}let h=o.hex.match(Ue);if(!h)return D.test(o.hex)?o.hex:z.hex;let[i,d,e]=h[1].split("");return`#${i}${i}${d}${d}${e}${e}`},Je=(n,o)=>{let[c,h]=p.useState(n||""),[i,d]=p.useState(()=>$(c)),[e,t]=p.useState((i==null?void 0:i.colorSpace)||"hex");p.useEffect(()=>{let u=n||"",s=$(u);h(u),d(s),t((s==null?void 0:s.colorSpace)||"hex")},[n]);let r=p.useMemo(()=>Ze(c,i,e).toLowerCase(),[c,i,e]),a=p.useCallback(u=>{let s=$(u),f=(s==null?void 0:s.value)||u||"";h(f),f===""&&(d(void 0),o(void 0)),s&&(d(s),t(s.colorSpace),o(s.value))},[o]),l=p.useCallback(()=>{let u=R.indexOf(e)+1;u>=R.length&&(u=0),t(R[u]);let s=(i==null?void 0:i[R[u]])||"";h(s),o(s)},[i,e,o]);return{value:c,realValue:r,updateValue:a,color:i,colorSpace:e,cycleColorSpace:l}},H=n=>n.replace(/\s*/,"").toLowerCase(),er=(n,o,c)=>{let[h,i]=p.useState(o!=null&&o.valid?[o]:[]);p.useEffect(()=>{o===void 0&&i([])},[o]);let d=p.useMemo(()=>(n||[]).map(t=>typeof t=="string"?$(t):t.title?{...$(t.color),keyword:t.title}:$(t.color)).concat(h).filter(Boolean).slice(-27),[n,h]),e=p.useCallback(t=>{t!=null&&t.valid&&(d.some(r=>H(r[c])===H(t[c]))||i(r=>r.concat(t)))},[c,d]);return{presets:d,addPreset:e}},rr=({name:n,value:o,onChange:c,onFocus:h,onBlur:i,presetColors:d,startOpen:e=!1,argType:t})=>{var E;let r=p.useCallback(ce(c,200),[c]),{value:a,realValue:l,updateValue:u,color:s,colorSpace:f,cycleColorSpace:g}=Je(o,r),{presets:b,addPreset:y}=er(d,s,f),v=Ye[f],w=!!((E=t==null?void 0:t.table)!=null&&E.readonly);return m.createElement(Le,{"aria-readonly":w},m.createElement(Be,{startOpen:e,trigger:w?[null]:void 0,closeOnOutsideClick:!0,onVisibleChange:()=>y(s),tooltip:m.createElement(Xe,null,m.createElement(v,{color:l==="transparent"?"#000000":l,onChange:u,onFocus:h,onBlur:i}),b.length>0&&m.createElement(De,null,b.map((k,P)=>m.createElement(Y,{key:`${k.value}-${P}`,hasChrome:!1,tooltip:m.createElement(Ke,{note:k.keyword||k.value})},m.createElement(Q,{value:k[f],active:s&&H(k[f])===H(s[f]),onClick:()=>u(k.value)})))))},m.createElement(Q,{value:l,style:{margin:4}})),m.createElement(Fe,{id:he(n),value:a,onChange:k=>u(k.target.value),onFocus:k=>k.target.select(),readOnly:w,placeholder:"Choose color..."}),a?m.createElement(Te,{onClick:g}):null)},hr=rr;export{rr as ColorControl,hr as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-BTJTZTIL.js";import{useMDXComponents as g}from"./index-B4FGfHer.js";import{b as S,U as $}from"./index-gXlU0WyC.js";import{d as u,e as s,f as c,g as b}from"./react-resizable-panels.browser-D49JKwKo.js";import"./index-Dmy2JGbm.js";import{c as v}from"./browserUtils-CQM9Za7e.js";import"./index-ChsGqxH_.js";import"./iframe-D3pKf_6w.js";import"./index-CT3U1fyk.js";import"./index-BRq5TIsn.js";import"./index-DgH-xKnr.js";import"./index-DrFu-skq.js";const F=JSON.parse('{"title":{"01":{"normal":{"$type":"typography","$value":{"fontSize":16,"lineHeight":24,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":16,"lineHeight":24,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"bold":{"$type":"typography","$value":{"fontSize":16,"lineHeight":24,"letterSpacing":0,"fontWeight":700,"fontFamily":"Pretendard Variable"}}},"02":{"normal":{"$type":"typography","$value":{"fontSize":18,"lineHeight":28,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":18,"lineHeight":28,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"bold":{"$type":"typography","$value":{"fontSize":18,"lineHeight":28,"letterSpacing":0,"fontWeight":700,"fontFamily":"Pretendard Variable"}}},"03":{"normal":{"$type":"typography","$value":{"fontSize":20,"lineHeight":32,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":20,"lineHeight":32,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"bold":{"$type":"typography","$value":{"fontSize":20,"lineHeight":32,"letterSpacing":0,"fontWeight":700,"fontFamily":"Pretendard Variable"}}},"04":{"normal":{"$type":"typography","$value":{"fontSize":24,"lineHeight":36,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":24,"lineHeight":36,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"bold":{"$type":"typography","$value":{"fontSize":24,"lineHeight":36,"letterSpacing":0,"fontWeight":700,"fontFamily":"Pretendard Variable"}}},"05":{"normal":{"$type":"typography","$value":{"fontSize":30,"lineHeight":44,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":30,"lineHeight":44,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"bold":{"$type":"typography","$value":{"fontSize":30,"lineHeight":44,"letterSpacing":0,"fontWeight":700,"fontFamily":"Pretendard Variable"}}},"06":{"normal":{"$type":"typography","$value":{"fontSize":36,"lineHeight":54,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":36,"lineHeight":54,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"bold":{"$type":"typography","$value":{"fontSize":36,"lineHeight":54,"letterSpacing":0,"fontWeight":700,"fontFamily":"Pretendard Variable"}}}},"body":{"lg":{"normal":{"$type":"typography","$value":{"fontSize":18,"lineHeight":32,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":18,"lineHeight":32,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":18,"lineHeight":32,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"md":{"normal":{"$type":"typography","$value":{"fontSize":16,"lineHeight":28,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":16,"lineHeight":28,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":16,"lineHeight":28,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"sm2":{"normal":{"$type":"typography","$value":{"fontSize":15,"lineHeight":26,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":15,"lineHeight":26,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":15,"lineHeight":26,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"sm":{"normal":{"$type":"typography","$value":{"fontSize":14,"lineHeight":24,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":14,"lineHeight":24,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":14,"lineHeight":24,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"xs2":{"normal":{"$type":"typography","$value":{"fontSize":13,"lineHeight":22,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":13,"lineHeight":22,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":13,"lineHeight":22,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"xs":{"normal":{"$type":"typography","$value":{"fontSize":12,"lineHeight":20,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":12,"lineHeight":20,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":12,"lineHeight":20,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"2xs":{"normal":{"$type":"typography","$value":{"fontSize":10,"lineHeight":16,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":10,"lineHeight":16,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":10,"lineHeight":16,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}}},"compact":{"lg":{"normal":{"$type":"typography","$value":{"fontSize":18,"lineHeight":28,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":18,"lineHeight":28,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":18,"lineHeight":28,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"md":{"normal":{"$type":"typography","$value":{"fontSize":16,"lineHeight":24,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":16,"lineHeight":24,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":16,"lineHeight":24,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"sm2":{"normal":{"$type":"typography","$value":{"fontSize":15,"lineHeight":22,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":15,"lineHeight":22,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":15,"lineHeight":22,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"sm":{"normal":{"$type":"typography","$value":{"fontSize":14,"lineHeight":20,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":14,"lineHeight":20,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":14,"lineHeight":20,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"xs2":{"normal":{"$type":"typography","$value":{"fontSize":13,"lineHeight":18,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":13,"lineHeight":18,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":13,"lineHeight":18,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"xs":{"normal":{"$type":"typography","$value":{"fontSize":12,"lineHeight":16,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":12,"lineHeight":16,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":12,"lineHeight":16,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"2xs":{"normal":{"$type":"typography","$value":{"fontSize":10,"lineHeight":12,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":10,"lineHeight":12,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":10,"lineHeight":12,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}}},"code":{"2xs":{"normal":{"$type":"typography","$value":{"fontSize":10,"lineHeight":12,"letterSpacing":0,"fontWeight":400,"fontFamily":"Oxanium"}},"medium":{"$type":"typography","$value":{"fontSize":10,"lineHeight":12,"letterSpacing":0,"fontWeight":500,"fontFamily":"Oxanium"}},"semibold":{"$type":"typography","$value":{"fontSize":10,"lineHeight":12,"letterSpacing":0,"fontWeight":600,"fontFamily":"Oxanium"}}},"xs":{"normal":{"$type":"typography","$value":{"fontSize":12,"lineHeight":14,"letterSpacing":0,"fontWeight":400,"fontFamily":"Oxanium"}},"medium":{"$type":"typography","$value":{"fontSize":12,"lineHeight":14,"letterSpacing":0,"fontWeight":500,"fontFamily":"Oxanium"}},"semibold":{"$type":"typography","$value":{"fontSize":12,"lineHeight":14,"letterSpacing":0,"fontWeight":600,"fontFamily":"Oxanium"}}},"xs2":{"semibold":{"$type":"typography","$value":{"fontSize":13,"lineHeight":18,"letterSpacing":0,"fontWeight":600,"fontFamily":"Oxanium"}},"medium":{"$type":"typography","$value":{"fontSize":13,"lineHeight":18,"letterSpacing":0,"fontWeight":500,"fontFamily":"Oxanium"}},"normal":{"$type":"typography","$value":{"fontSize":13,"lineHeight":18,"letterSpacing":0,"fontWeight":400,"fontFamily":"Oxanium"}}},"sm":{"semibold":{"$type":"typography","$value":{"fontSize":14,"lineHeight":20,"letterSpacing":0,"fontWeight":600,"fontFamily":"Oxanium"}},"medium":{"$type":"typography","$value":{"fontSize":14,"lineHeight":20,"letterSpacing":0,"fontWeight":500,"fontFamily":"Oxanium"}},"normal":{"$type":"typography","$value":{"fontSize":14,"lineHeight":20,"letterSpacing":0,"fontWeight":400,"fontFamily":"Oxanium"}}},"sm2":{"semibold":{"$type":"typography","$value":{"fontSize":15,"lineHeight":22,"letterSpacing":0,"fontWeight":600,"fontFamily":"Oxanium"}},"medium":{"$type":"typography","$value":{"fontSize":15,"lineHeight":22,"letterSpacing":0,"fontWeight":500,"fontFamily":"Oxanium"}},"normal":{"$type":"typography","$value":{"fontSize":15,"lineHeight":22,"letterSpacing":0,"fontWeight":400,"fontFamily":"Oxanium"}}},"md":{"semibold":{"$type":"typography","$value":{"fontSize":16,"lineHeight":24,"letterSpacing":0,"fontWeight":600,"fontFamily":"Oxanium"}},"medium":{"$type":"typography","$value":{"fontSize":16,"lineHeight":24,"letterSpacing":0,"fontWeight":500,"fontFamily":"Oxanium"}},"normal":{"$type":"typography","$value":{"fontSize":16,"lineHeight":24,"letterSpacing":0,"fontWeight":400,"fontFamily":"Oxanium"}}},"lg":{"semibold":{"$type":"typography","$value":{"fontSize":18,"lineHeight":28,"letterSpacing":0,"fontWeight":600,"fontFamily":"Oxanium"}},"medium":{"$type":"typography","$value":{"fontSize":18,"lineHeight":28,"letterSpacing":0,"fontWeight":500,"fontFamily":"Oxanium"}},"normal":{"$type":"typography","$value":{"fontSize":18,"lineHeight":28,"letterSpacing":0,"fontWeight":400,"fontFamily":"Oxanium"}}}}}'),z={text:F},H=({scale:t,weight:i,fontFamilyToken:a})=>[`font-${a??"sans"}`,`text-${t}`,`leading-${t}`,`tracking-${t}`,`font-${i}`].join(" + "),W=t=>{v({text:t}),alert("복사가 완료되었습니다.")},l=Object.entries(z.text??{}),f=()=>{var i;const t=(i=l[0])==null?void 0:i[0];return t?e.jsxs(u,{defaultValue:t,className:"w-full",children:[e.jsx(s,{className:"border-default bg-default text-fg-default supports-[backdrop-filter]:bg-default sticky top-2 z-20 mb-3 rounded-lg border p-1 shadow-sm backdrop-blur",children:l.map(([a])=>e.jsx(c,{value:a,children:a},a))}),l.map(([a,h])=>e.jsx(b,{value:a,children:e.jsx("div",{className:"border-default bg-default text-default space-y-2 rounded-lg border p-4",children:Object.entries(h).flatMap(([o,m])=>Object.entries(m).map(([r,d])=>{var p;const n=`typo-${a}-${o}-${r}`;return e.jsx("button",{type:"button",className:"border-subtle hover:bg-overlay/30 block w-full cursor-copy rounded-md border p-3 text-left transition-colors",onClick:()=>W(n),title:`Copy ${n}`,children:e.jsx("div",{className:"flex items-start justify-between gap-3",children:e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("p",{className:n,children:["Rainbow Robotics UI Typography Test",e.jsx("br",{}),"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789"]}),e.jsxs("p",{className:"text-subtle mt-1 text-sm",children:[".",n]}),e.jsx("p",{className:"text-subtler mt-1 text-sm",children:H({scale:o,weight:r,fontFamilyToken:(p=d.$value)==null?void 0:p.fontFamilyToken})})]})})},n)}))})},a))]}):null};f.__docgenInfo={description:"",methods:[],displayName:"TextStylePreview"};function y(t){const i={code:"code",h1:"h1",p:"p",pre:"pre",...g(),...t.components};return e.jsxs(e.Fragment,{children:[e.jsx(S,{title:"1.foundations/text-style"}),`
|
|
1
|
+
import{j as e}from"./jsx-runtime-BTJTZTIL.js";import{useMDXComponents as g}from"./index-B4FGfHer.js";import{b as S,U as $}from"./index-MqY7mw_o.js";import{d as u,e as s,f as c,g as b}from"./react-resizable-panels.browser-D49JKwKo.js";import"./index-Dmy2JGbm.js";import{c as v}from"./browserUtils-CQM9Za7e.js";import"./index-ChsGqxH_.js";import"./iframe-B8FjC8Y_.js";import"./index-CT3U1fyk.js";import"./index-BRq5TIsn.js";import"./index-DgH-xKnr.js";import"./index-DrFu-skq.js";const F=JSON.parse('{"title":{"01":{"normal":{"$type":"typography","$value":{"fontSize":16,"lineHeight":24,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":16,"lineHeight":24,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"bold":{"$type":"typography","$value":{"fontSize":16,"lineHeight":24,"letterSpacing":0,"fontWeight":700,"fontFamily":"Pretendard Variable"}}},"02":{"normal":{"$type":"typography","$value":{"fontSize":18,"lineHeight":28,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":18,"lineHeight":28,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"bold":{"$type":"typography","$value":{"fontSize":18,"lineHeight":28,"letterSpacing":0,"fontWeight":700,"fontFamily":"Pretendard Variable"}}},"03":{"normal":{"$type":"typography","$value":{"fontSize":20,"lineHeight":32,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":20,"lineHeight":32,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"bold":{"$type":"typography","$value":{"fontSize":20,"lineHeight":32,"letterSpacing":0,"fontWeight":700,"fontFamily":"Pretendard Variable"}}},"04":{"normal":{"$type":"typography","$value":{"fontSize":24,"lineHeight":36,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":24,"lineHeight":36,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"bold":{"$type":"typography","$value":{"fontSize":24,"lineHeight":36,"letterSpacing":0,"fontWeight":700,"fontFamily":"Pretendard Variable"}}},"05":{"normal":{"$type":"typography","$value":{"fontSize":30,"lineHeight":44,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":30,"lineHeight":44,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"bold":{"$type":"typography","$value":{"fontSize":30,"lineHeight":44,"letterSpacing":0,"fontWeight":700,"fontFamily":"Pretendard Variable"}}},"06":{"normal":{"$type":"typography","$value":{"fontSize":36,"lineHeight":54,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":36,"lineHeight":54,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"bold":{"$type":"typography","$value":{"fontSize":36,"lineHeight":54,"letterSpacing":0,"fontWeight":700,"fontFamily":"Pretendard Variable"}}}},"body":{"lg":{"normal":{"$type":"typography","$value":{"fontSize":18,"lineHeight":32,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":18,"lineHeight":32,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":18,"lineHeight":32,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"md":{"normal":{"$type":"typography","$value":{"fontSize":16,"lineHeight":28,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":16,"lineHeight":28,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":16,"lineHeight":28,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"sm2":{"normal":{"$type":"typography","$value":{"fontSize":15,"lineHeight":26,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":15,"lineHeight":26,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":15,"lineHeight":26,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"sm":{"normal":{"$type":"typography","$value":{"fontSize":14,"lineHeight":24,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":14,"lineHeight":24,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":14,"lineHeight":24,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"xs2":{"normal":{"$type":"typography","$value":{"fontSize":13,"lineHeight":22,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":13,"lineHeight":22,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":13,"lineHeight":22,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"xs":{"normal":{"$type":"typography","$value":{"fontSize":12,"lineHeight":20,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":12,"lineHeight":20,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":12,"lineHeight":20,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"2xs":{"normal":{"$type":"typography","$value":{"fontSize":10,"lineHeight":16,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":10,"lineHeight":16,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":10,"lineHeight":16,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}}},"compact":{"lg":{"normal":{"$type":"typography","$value":{"fontSize":18,"lineHeight":28,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":18,"lineHeight":28,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":18,"lineHeight":28,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"md":{"normal":{"$type":"typography","$value":{"fontSize":16,"lineHeight":24,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":16,"lineHeight":24,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":16,"lineHeight":24,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"sm2":{"normal":{"$type":"typography","$value":{"fontSize":15,"lineHeight":22,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":15,"lineHeight":22,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":15,"lineHeight":22,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"sm":{"normal":{"$type":"typography","$value":{"fontSize":14,"lineHeight":20,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":14,"lineHeight":20,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":14,"lineHeight":20,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"xs2":{"normal":{"$type":"typography","$value":{"fontSize":13,"lineHeight":18,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":13,"lineHeight":18,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":13,"lineHeight":18,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"xs":{"normal":{"$type":"typography","$value":{"fontSize":12,"lineHeight":16,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":12,"lineHeight":16,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":12,"lineHeight":16,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}},"2xs":{"normal":{"$type":"typography","$value":{"fontSize":10,"lineHeight":12,"letterSpacing":0,"fontWeight":400,"fontFamily":"Pretendard Variable"}},"medium":{"$type":"typography","$value":{"fontSize":10,"lineHeight":12,"letterSpacing":0,"fontWeight":500,"fontFamily":"Pretendard Variable"}},"semibold":{"$type":"typography","$value":{"fontSize":10,"lineHeight":12,"letterSpacing":0,"fontWeight":600,"fontFamily":"Pretendard Variable"}}}},"code":{"2xs":{"normal":{"$type":"typography","$value":{"fontSize":10,"lineHeight":12,"letterSpacing":0,"fontWeight":400,"fontFamily":"Oxanium"}},"medium":{"$type":"typography","$value":{"fontSize":10,"lineHeight":12,"letterSpacing":0,"fontWeight":500,"fontFamily":"Oxanium"}},"semibold":{"$type":"typography","$value":{"fontSize":10,"lineHeight":12,"letterSpacing":0,"fontWeight":600,"fontFamily":"Oxanium"}}},"xs":{"normal":{"$type":"typography","$value":{"fontSize":12,"lineHeight":14,"letterSpacing":0,"fontWeight":400,"fontFamily":"Oxanium"}},"medium":{"$type":"typography","$value":{"fontSize":12,"lineHeight":14,"letterSpacing":0,"fontWeight":500,"fontFamily":"Oxanium"}},"semibold":{"$type":"typography","$value":{"fontSize":12,"lineHeight":14,"letterSpacing":0,"fontWeight":600,"fontFamily":"Oxanium"}}},"xs2":{"semibold":{"$type":"typography","$value":{"fontSize":13,"lineHeight":18,"letterSpacing":0,"fontWeight":600,"fontFamily":"Oxanium"}},"medium":{"$type":"typography","$value":{"fontSize":13,"lineHeight":18,"letterSpacing":0,"fontWeight":500,"fontFamily":"Oxanium"}},"normal":{"$type":"typography","$value":{"fontSize":13,"lineHeight":18,"letterSpacing":0,"fontWeight":400,"fontFamily":"Oxanium"}}},"sm":{"semibold":{"$type":"typography","$value":{"fontSize":14,"lineHeight":20,"letterSpacing":0,"fontWeight":600,"fontFamily":"Oxanium"}},"medium":{"$type":"typography","$value":{"fontSize":14,"lineHeight":20,"letterSpacing":0,"fontWeight":500,"fontFamily":"Oxanium"}},"normal":{"$type":"typography","$value":{"fontSize":14,"lineHeight":20,"letterSpacing":0,"fontWeight":400,"fontFamily":"Oxanium"}}},"sm2":{"semibold":{"$type":"typography","$value":{"fontSize":15,"lineHeight":22,"letterSpacing":0,"fontWeight":600,"fontFamily":"Oxanium"}},"medium":{"$type":"typography","$value":{"fontSize":15,"lineHeight":22,"letterSpacing":0,"fontWeight":500,"fontFamily":"Oxanium"}},"normal":{"$type":"typography","$value":{"fontSize":15,"lineHeight":22,"letterSpacing":0,"fontWeight":400,"fontFamily":"Oxanium"}}},"md":{"semibold":{"$type":"typography","$value":{"fontSize":16,"lineHeight":24,"letterSpacing":0,"fontWeight":600,"fontFamily":"Oxanium"}},"medium":{"$type":"typography","$value":{"fontSize":16,"lineHeight":24,"letterSpacing":0,"fontWeight":500,"fontFamily":"Oxanium"}},"normal":{"$type":"typography","$value":{"fontSize":16,"lineHeight":24,"letterSpacing":0,"fontWeight":400,"fontFamily":"Oxanium"}}},"lg":{"semibold":{"$type":"typography","$value":{"fontSize":18,"lineHeight":28,"letterSpacing":0,"fontWeight":600,"fontFamily":"Oxanium"}},"medium":{"$type":"typography","$value":{"fontSize":18,"lineHeight":28,"letterSpacing":0,"fontWeight":500,"fontFamily":"Oxanium"}},"normal":{"$type":"typography","$value":{"fontSize":18,"lineHeight":28,"letterSpacing":0,"fontWeight":400,"fontFamily":"Oxanium"}}}}}'),z={text:F},H=({scale:t,weight:i,fontFamilyToken:a})=>[`font-${a??"sans"}`,`text-${t}`,`leading-${t}`,`tracking-${t}`,`font-${i}`].join(" + "),W=t=>{v({text:t}),alert("복사가 완료되었습니다.")},l=Object.entries(z.text??{}),f=()=>{var i;const t=(i=l[0])==null?void 0:i[0];return t?e.jsxs(u,{defaultValue:t,className:"w-full",children:[e.jsx(s,{className:"border-default bg-default text-fg-default supports-[backdrop-filter]:bg-default sticky top-2 z-20 mb-3 rounded-lg border p-1 shadow-sm backdrop-blur",children:l.map(([a])=>e.jsx(c,{value:a,children:a},a))}),l.map(([a,h])=>e.jsx(b,{value:a,children:e.jsx("div",{className:"border-default bg-default text-default space-y-2 rounded-lg border p-4",children:Object.entries(h).flatMap(([o,m])=>Object.entries(m).map(([r,d])=>{var p;const n=`typo-${a}-${o}-${r}`;return e.jsx("button",{type:"button",className:"border-subtle hover:bg-overlay/30 block w-full cursor-copy rounded-md border p-3 text-left transition-colors",onClick:()=>W(n),title:`Copy ${n}`,children:e.jsx("div",{className:"flex items-start justify-between gap-3",children:e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("p",{className:n,children:["Rainbow Robotics UI Typography Test",e.jsx("br",{}),"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789"]}),e.jsxs("p",{className:"text-subtle mt-1 text-sm",children:[".",n]}),e.jsx("p",{className:"text-subtler mt-1 text-sm",children:H({scale:o,weight:r,fontFamilyToken:(p=d.$value)==null?void 0:p.fontFamilyToken})})]})})},n)}))})},a))]}):null};f.__docgenInfo={description:"",methods:[],displayName:"TextStylePreview"};function y(t){const i={code:"code",h1:"h1",p:"p",pre:"pre",...g(),...t.components};return e.jsxs(e.Fragment,{children:[e.jsx(S,{title:"1.foundations/text-style"}),`
|
|
2
2
|
`,e.jsx(i.h1,{id:"text-style",children:"Text Style"}),`
|
|
3
3
|
`,e.jsxs(i.p,{children:[e.jsx(i.code,{children:"rb-token.css"}),"의 타이포그래피 유틸리티 전체를 미리보기에서 확인합니다."]}),`
|
|
4
4
|
`,e.jsx(i.pre,{children:e.jsx(i.code,{className:"language-tsx",children:`<p className="typo-body-sm-normal text-default">본문</p>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./jsx-runtime-BTJTZTIL.js";import{useMDXComponents as c}from"./index-B4FGfHer.js";import{b as l,U as r}from"./index-
|
|
1
|
+
import{j as a}from"./jsx-runtime-BTJTZTIL.js";import{useMDXComponents as c}from"./index-B4FGfHer.js";import{b as l,U as r}from"./index-MqY7mw_o.js";import{c as o}from"./browserUtils-CQM9Za7e.js";import"./index-ChsGqxH_.js";import"./index-Dmy2JGbm.js";import"./iframe-B8FjC8Y_.js";import"./index-CT3U1fyk.js";import"./index-BRq5TIsn.js";import"./index-DgH-xKnr.js";import"./index-DrFu-skq.js";const $={0:{$type:"spacing",$value:0},1:{$type:"spacing",$value:4},2:{$type:"spacing",$value:8},3:{$type:"spacing",$value:12},4:{$type:"spacing",$value:16},5:{$type:"spacing",$value:20},6:{$type:"spacing",$value:24},7:{$type:"spacing",$value:28},8:{$type:"spacing",$value:32},9:{$type:"spacing",$value:36},10:{$type:"spacing",$value:40},11:{$type:"spacing",$value:44},12:{$type:"spacing",$value:48},14:{$type:"spacing",$value:56},16:{$type:"spacing",$value:64},20:{$type:"spacing",$value:80},24:{$type:"spacing",$value:96},28:{$type:"spacing",$value:112},32:{$type:"spacing",$value:128},36:{$type:"spacing",$value:144},40:{$type:"spacing",$value:160},44:{$type:"spacing",$value:176},48:{$type:"spacing",$value:192},50:{$type:"spacing",$value:200},"3_5":{$type:"spacing",$value:14},"1_5":{$type:"spacing",$value:6},"0_5":{$type:"spacing",$value:2},"2_5":{$type:"spacing",$value:10}},u={spacing:$},d=e=>`${e/16}rem`,n=e=>Number(e.replace("_",".")),g=Object.entries(u.spacing).sort(([e],[s])=>n(e)-n(s)).map(([e,s])=>({token:`spacing-${e}`,utility:`p-${e}`,value:d(s.$value)})),m=e=>{o({text:e}),alert("복사가 완료되었습니다.")},i=()=>a.jsx("div",{className:"border-default bg-default text-default space-y-2 rounded-lg border p-4",children:g.map(({token:e,utility:s,value:t})=>a.jsxs("button",{type:"button",className:"border-subtle grid w-full cursor-copy grid-cols-[180px_1fr] items-center gap-3 rounded-md border p-2 text-left",onClick:()=>m(s),title:`Copy ${s}`,children:[a.jsx("p",{className:"text-subtle text-xs",children:s}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"bg-fill-brand h-2 rounded-full",style:{width:t}}),a.jsx("span",{className:"text-subtle text-sm",children:t})]})]},e))});i.__docgenInfo={description:"",methods:[],displayName:"SpacingPreview"};function p(e){const s={code:"code",h1:"h1",p:"p",pre:"pre",...c(),...e.components};return a.jsxs(a.Fragment,{children:[a.jsx(l,{title:"1.foundations/spacing"}),`
|
|
2
2
|
`,a.jsx(s.h1,{id:"spacing",children:"Spacing"}),`
|
|
3
3
|
`,a.jsxs(s.p,{children:[a.jsx(s.code,{children:"--spacing-*"})," 전체 토큰을 미리보기에서 확인합니다."]}),`
|
|
4
4
|
`,a.jsx(s.pre,{children:a.jsx(s.code,{className:"language-tsx",children:`<div className="p-4 gap-2" />
|