@rainbow-robotics/muscat-plugin-kit 0.10.1 → 0.10.2-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ko.md +1 -0
- package/README.md +1 -0
- package/cli/bin/muscat-pk.mjs +2 -1
- package/cli/src/dev.mjs +9 -2
- package/cli/src/devBack.mjs +8 -4
- package/cli/src/devSession.mjs +3 -2
- package/cli/src/devUi.mjs +2 -1
- package/cli/src/sim.mjs +3 -2
- package/cli/src/util.mjs +32 -2
- package/cli/storybook-dist/assets/{Color-YHDXOIA2-pCKrjUal.js → Color-YHDXOIA2-HQqhLemJ.js} +1 -1
- package/cli/storybook-dist/assets/{Docs-B_QaTtz8.js → Docs-B5rPlqEd.js} +1 -1
- package/cli/storybook-dist/assets/{Docs-CryDGmfh.js → Docs-BEJVv1c1.js} +1 -1
- package/cli/storybook-dist/assets/{Docs-B-Y7I1GA.js → Docs-CdqXjTah.js} +1 -1
- package/cli/storybook-dist/assets/{Docs-BFJcE_VS.js → Docs-KKJSb_No.js} +1 -1
- package/cli/storybook-dist/assets/{Docs-Q6r1fBeL.js → Docs-i6uoAs4I.js} +1 -1
- package/cli/storybook-dist/assets/{Docs-Cw2AVNKx.js → Docs-k62Vnk7X.js} +1 -1
- package/cli/storybook-dist/assets/{DocsRenderer-CFRXHY34-_OmZBCn8.js → DocsRenderer-CFRXHY34-DowFXJd4.js} +1 -1
- package/cli/storybook-dist/assets/{NxAvatar.stories-Ctf5G2FQ.js → NxAvatar.stories-DaR4bsm0.js} +1 -1
- package/cli/storybook-dist/assets/{NxButton.stories-DeLObVSj.js → NxButton.stories-DIdPdEXx.js} +1 -1
- package/cli/storybook-dist/assets/NxIcons.stories-BUbMg3C7.js +3 -0
- package/cli/storybook-dist/assets/{NxNumberInput.stories-LqoY0ed1.js → NxNumberInput.stories-BcyQA4sG.js} +1 -1
- package/cli/storybook-dist/assets/{NxPagination.stories-DI6bXuJM.js → NxPagination.stories-BuLqF4xQ.js} +1 -1
- package/cli/storybook-dist/assets/{NxPointerHoldButton.stories-3HSV1XmN.js → NxPointerHoldButton.stories-DR80259L.js} +1 -1
- package/cli/storybook-dist/assets/{NxRangeInput.stories-1pjgQVaG.js → NxRangeInput.stories-BHPFmFpa.js} +1 -1
- package/cli/storybook-dist/assets/{NxSelectBox.stories-bcQPZEuF.js → NxSelectBox.stories-BsfLdH6J.js} +1 -1
- package/cli/storybook-dist/assets/{NxSlideRange.stories-BosX4axk.js → NxSlideRange.stories-CnpJ4FOe.js} +1 -1
- package/cli/storybook-dist/assets/{NxSwitch.stories-DxV6dS33.js → NxSwitch.stories-DTDjkl0Z.js} +1 -1
- package/cli/storybook-dist/assets/{NxTextArea.stories-CO545-LP.js → NxTextArea.stories-BUuZ1jk0.js} +1 -1
- package/cli/storybook-dist/assets/{NxTextInput.stories-BP0npai1.js → NxTextInput.stories-Bxk2uYBK.js} +1 -1
- package/cli/storybook-dist/assets/{RBAccordion.stories-fVR4Va2a.js → RBAccordion.stories-C0rlt3Pn.js} +1 -1
- package/cli/storybook-dist/assets/{RBAccordionGroup.stories-Du5bsckD.js → RBAccordionGroup.stories-k8zmLDVH.js} +1 -1
- package/cli/storybook-dist/assets/{RBAlert.stories-DNkMXUu6.js → RBAlert.stories-DOhY67wJ.js} +1 -1
- package/cli/storybook-dist/assets/{RBBadge.stories-C44pXt8D.js → RBBadge.stories-BFxKjHx6.js} +1 -1
- package/cli/storybook-dist/assets/{RBBattery.stories-DE2JHvfL.js → RBBattery.stories-C6MlP-ui.js} +1 -1
- package/cli/storybook-dist/assets/{RBCard.stories-CuIda7NI.js → RBCard.stories-j3gD0bAM.js} +1 -1
- package/cli/storybook-dist/assets/{RBCheckBox.stories-D1qM1ayr.js → RBCheckBox.stories-Dfdrn20B.js} +1 -1
- package/cli/storybook-dist/assets/{RBCheckIconButton.stories-e4gkliBO.js → RBCheckIconButton.stories-BCVI-a9y.js} +1 -1
- package/cli/storybook-dist/assets/{RBCheckLabelButton.stories-CDzCtsMI.js → RBCheckLabelButton.stories-xVEGrcQt.js} +1 -1
- package/cli/storybook-dist/assets/{RBChipTab.stories-DBrc_3Mp.js → RBChipTab.stories-CFfrQqnn.js} +1 -1
- package/cli/storybook-dist/assets/{RBChipsBoxTab.stories-hlrsHjKY.js → RBChipsBoxTab.stories-B4wyJONZ.js} +1 -1
- package/cli/storybook-dist/assets/{RBColorIcons.stories-BHUvpkdu.js → RBColorIcons.stories-zGkBNfs-.js} +1 -1
- package/cli/storybook-dist/assets/{RBCommand.stories-azAF41NP.js → RBCommand.stories-DCjs7Mjn.js} +1 -1
- package/cli/storybook-dist/assets/{RBConfirm.stories-BMNjwbmT.js → RBConfirm.stories-D8JpA9CI.js} +1 -1
- package/cli/storybook-dist/assets/{RBDateInput.stories-D0VezDzv.js → RBDateInput.stories-ek1FGP5A.js} +1 -1
- package/cli/storybook-dist/assets/{RBDialog.stories-AOJ975Fy.js → RBDialog.stories-A7LD5rjA.js} +1 -1
- package/cli/storybook-dist/assets/{RBDivider.stories-NSvnj43Z.js → RBDivider.stories-Dl8GmeOl.js} +1 -1
- package/cli/storybook-dist/assets/{RBDrawer.stories-Du0oTvD1.js → RBDrawer.stories-SkpU6U-j.js} +1 -1
- package/cli/storybook-dist/assets/{RBDropdownMenu.stories-Hsxve4PW.js → RBDropdownMenu.stories-jPWxmzfK.js} +1 -1
- package/cli/storybook-dist/assets/{RBEmptyView.stories-BlwHx3zp.js → RBEmptyView.stories-BM5imXdF.js} +1 -1
- package/cli/storybook-dist/assets/{RBIconButton.stories-DAPDY63x.js → RBIconButton.stories-TNEqH0M7.js} +1 -1
- package/cli/storybook-dist/assets/{RBIcons.stories-W5ZUV2L1.js → RBIcons.stories-Cgv8Ql_V.js} +1 -1
- package/cli/storybook-dist/assets/{RBInlineLabelButton.stories-C99j0Y3g.js → RBInlineLabelButton.stories-BoZINEnv.js} +1 -1
- package/cli/storybook-dist/assets/{RBJoyStick.stories-Du0H1iAS.js → RBJoyStick.stories-CnI0we-G.js} +1 -1
- package/cli/storybook-dist/assets/{RBLabelButton.stories-BlvHaU_Z.js → RBLabelButton.stories-2oYgDagF.js} +1 -1
- package/cli/storybook-dist/assets/{RBLight.stories-BY6DKrre.js → RBLight.stories-D65I5krJ.js} +1 -1
- package/cli/storybook-dist/assets/{RBMenubar.stories-D2PEGpM9.js → RBMenubar.stories-bqC4HfLy.js} +1 -1
- package/cli/storybook-dist/assets/{RBMultiRangeInput.stories-Bm2qSmjq.js → RBMultiRangeInput.stories-DYT_MltY.js} +1 -1
- package/cli/storybook-dist/assets/{RBPagination.stories-DDleJa5N.js → RBPagination.stories-CGi5UiE3.js} +1 -1
- package/cli/storybook-dist/assets/{RBPopover.stories-27YxPSFG.js → RBPopover.stories-D_YAI7le.js} +1 -1
- package/cli/storybook-dist/assets/{RBPrompt.stories-BFaIOctr.js → RBPrompt.stories-BV1Oru_C.js} +1 -1
- package/cli/storybook-dist/assets/{RBRadioBox.stories-BroDar0t.js → RBRadioBox.stories-DM_jWhpl.js} +1 -1
- package/cli/storybook-dist/assets/{RBRadioButton.stories-M3O-wX7V.js → RBRadioButton.stories-j1BA0rGA.js} +1 -1
- package/cli/storybook-dist/assets/{RBRangeDateInput.stories-CWlM_D5X.js → RBRangeDateInput.stories-CsmMf43C.js} +1 -1
- package/cli/storybook-dist/assets/{RBResizable.stories-ui8X1qnc.js → RBResizable.stories-dFrr6swI.js} +1 -1
- package/cli/storybook-dist/assets/{RBSelectBox.stories-C8T6cfA0.js → RBSelectBox.stories-B1S1SU6o.js} +1 -1
- package/cli/storybook-dist/assets/{RBSheet.stories-BCOo_Zcc.js → RBSheet.stories-QEdvcSDV.js} +1 -1
- package/cli/storybook-dist/assets/{RBSideNumberInput.stories-CU2_MVlJ.js → RBSideNumberInput.stories-BxIPOtQX.js} +1 -1
- package/cli/storybook-dist/assets/{RBSlider.stories-DgOp1TFc.js → RBSlider.stories-C-UZTUIT.js} +1 -1
- package/cli/storybook-dist/assets/{RBSpinner.stories-qLScY3zZ.js → RBSpinner.stories-BZinDzF9.js} +1 -1
- package/cli/storybook-dist/assets/{RBSwitch.stories-SXSY1QMb.js → RBSwitch.stories-CaXkqAth.js} +1 -1
- package/cli/storybook-dist/assets/{RBTab.stories-BzXXTsXP.js → RBTab.stories-CYtMShBF.js} +1 -1
- package/cli/storybook-dist/assets/{RBTable.stories-DHTeRNVk.js → RBTable.stories-C_BiwR-w.js} +1 -1
- package/cli/storybook-dist/assets/{RBTableRow.stories-DRNRsd15.js → RBTableRow.stories-fAKtT5lq.js} +1 -1
- package/cli/storybook-dist/assets/{RBTabs.stories-DP0noBLp.js → RBTabs.stories-D9ujavPZ.js} +1 -1
- package/cli/storybook-dist/assets/{RBTextArea.stories-TkaejfxJ.js → RBTextArea.stories-CA6hO-uN.js} +1 -1
- package/cli/storybook-dist/assets/{RBTextField.stories-B6VpCGyt.js → RBTextField.stories-CxQIi0Ap.js} +1 -1
- package/cli/storybook-dist/assets/{RBTextInput.stories-D3hZ08e-.js → RBTextInput.stories-D04dee1S.js} +1 -1
- package/cli/storybook-dist/assets/{RBToast.stories-BQ2wS2U0.js → RBToast.stories-D2U0Y2rf.js} +1 -1
- package/cli/storybook-dist/assets/{RBToggle.stories-GVOjGqo3.js → RBToggle.stories-DEJemW-M.js} +1 -1
- package/cli/storybook-dist/assets/{RBToggleGroup.stories-pzx0btOD.js → RBToggleGroup.stories-CejmxdDV.js} +1 -1
- package/cli/storybook-dist/assets/{RBTooltip.stories-jufB6fa1.js → RBTooltip.stories-6UM9Enyl.js} +1 -1
- package/cli/storybook-dist/assets/{SideNumberInput-BYlmNHEw.js → SideNumberInput-BTQhF4o0.js} +1 -1
- package/cli/storybook-dist/assets/{entry-preview-CAkU-e0D.js → entry-preview-DgHgRCRS.js} +1 -1
- package/cli/storybook-dist/assets/{iframe-B-BmTsxV.js → iframe-BJ5NYGgv.js} +2 -2
- package/cli/storybook-dist/assets/{index-CkB0GfaI.js → index-BI0lvgwk.js} +3 -3
- package/cli/storybook-dist/assets/{preview-M77JRg1A.js → preview-BLq_VLL5.js} +2 -2
- package/cli/storybook-dist/assets/preview-BhVbOkOz.js +3 -0
- package/cli/storybook-dist/iframe.html +1 -1
- package/cli/storybook-dist/project.json +1 -1
- package/cli/templates/common/requirements.txt +3 -3
- package/cli/templates/cpp/cpp/CMakeLists.txt +1 -1
- package/cli/templates/readme-cpp/README.md +1 -1
- package/cli/templates/ros2-cpp/ros2_ws/src/__PLUGIN_SLUG__/CMakeLists.txt +1 -1
- package/package.json +3 -3
- package/cli/storybook-dist/assets/NxIcons.stories-DeqrVzVs.js +0 -3
- package/cli/storybook-dist/assets/preview-CznQwwbo.js +0 -3
package/README.ko.md
CHANGED
|
@@ -1186,3 +1186,4 @@ args = ["mcp"]
|
|
|
1186
1186
|
| `get_variable`이 `None` | 실행 중인 프로그램이 없음 (실행기 상태는 `IS_DEV=true`일 때도 `None`) |
|
|
1187
1187
|
| 재시작 후 외부 호출 504 | gateway가 이전 소켓을 정리할 때까지 최대 1분 대기 |
|
|
1188
1188
|
| 다른 버전의 로컬 설치가 실행됨 | 정상 동작 — 프로젝트 로컬 kit이 우선. `muscat-pk update` |
|
|
1189
|
+
| 터미널을 닫았는데 `dev` 컨테이너가 남아 있음 | `~/.muscat-pk/dev-trace.log` 확인 — `dev`가 종료 단계(시그널, `docker rm -f` 결과)를 매번 이어 적고, 시작할 때마다 비웁니다 |
|
package/README.md
CHANGED
|
@@ -1186,3 +1186,4 @@ Inside the backend container: `RB_PLUGIN_ID` (the plugin / dev id), `RB_PLUGIN_P
|
|
|
1186
1186
|
| `get_variable` returns `None` | no program running (or `IS_DEV=true` for executor state) |
|
|
1187
1187
|
| external call 504 after restart | wait up to a minute for the gateway to drop the old socket |
|
|
1188
1188
|
| a newer/older local install answers | expected — the project's local kit wins; `muscat-pk update` |
|
|
1189
|
+
| `dev` containers are left running after the terminal closes | read `~/.muscat-pk/dev-trace.log` — `dev` appends each stop step (signal, `docker rm -f` result) and resets it on every start |
|
package/cli/bin/muscat-pk.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { readFileSync, realpathSync } from "node:fs";
|
|
|
5
5
|
import { resolve } from "node:path";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
7
|
import { spawnSync } from "node:child_process";
|
|
8
|
-
import { color, compareKitVersions, kitVersion, log, resolveLocalCliBin } from "../src/util.mjs";
|
|
8
|
+
import { color, compareKitVersions, kitVersion, log, resolveLocalCliBin, trace } from "../src/util.mjs";
|
|
9
9
|
import { runNew } from "../src/new.mjs";
|
|
10
10
|
import { runBuild } from "../src/build.mjs";
|
|
11
11
|
import { runDevUi } from "../src/devUi.mjs";
|
|
@@ -63,6 +63,7 @@ if (isBinaryMode && !process.env.MUSCAT_PK_VERSION) {
|
|
|
63
63
|
// Bun 바이너리의 execPath는 스크립트 인자를 실행하지 않으니 PATH의 node로 넘긴다.
|
|
64
64
|
const runtime = isBinaryMode ? "node" : process.execPath;
|
|
65
65
|
const r = spawnSync(runtime, [localBin, ...process.argv.slice(2)], { stdio: "inherit" });
|
|
66
|
+
if (process.argv[2]?.startsWith("dev")) trace(`local install exited: status ${r.status}, signal ${r.signal}`);
|
|
66
67
|
if (r.error) {
|
|
67
68
|
log.warn(`Failed to run local install via ${runtime} (${r.error.code}); continuing with this binary.`);
|
|
68
69
|
return;
|
package/cli/src/dev.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// muscat-pk dev — run the local Muscat runtime (gateway, MediaMTX, common), robot simulators (--sim),
|
|
2
2
|
// dev:ui, and dev:back together.
|
|
3
|
-
import { spawn
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
4
|
import { existsSync } from "node:fs";
|
|
5
5
|
import { connect as netConnect } from "node:net";
|
|
6
6
|
import { resolve } from "node:path";
|
|
@@ -13,6 +13,7 @@ import { resolveSim, startSim, stopSims } from "./sim.mjs";
|
|
|
13
13
|
import { assertManifestPorts, assertManifestVariables, readManifest } from "./manifest.mjs";
|
|
14
14
|
import { devPluginId } from "./devId.mjs";
|
|
15
15
|
import {
|
|
16
|
+
dockerRm,
|
|
16
17
|
ensureDocker,
|
|
17
18
|
ensureIdeVenv,
|
|
18
19
|
findPluginRoot,
|
|
@@ -20,6 +21,8 @@ import {
|
|
|
20
21
|
parseArgs,
|
|
21
22
|
prompt,
|
|
22
23
|
promptRobotConnection,
|
|
24
|
+
startTrace,
|
|
25
|
+
trace,
|
|
23
26
|
venvPython,
|
|
24
27
|
} from "./util.mjs";
|
|
25
28
|
import { ensureRemoteZenohEnv, isRemoteRobot, isWsl } from "./zenohDev.mjs";
|
|
@@ -114,6 +117,7 @@ async function maybeStartHostAgent(root, { robotIp, robotToken }) {
|
|
|
114
117
|
}
|
|
115
118
|
|
|
116
119
|
export async function runDev(args = []) {
|
|
120
|
+
startTrace();
|
|
117
121
|
const root = findPluginRoot();
|
|
118
122
|
await claimDevSession(root, "dev");
|
|
119
123
|
assertManifestVariables(root);
|
|
@@ -137,14 +141,17 @@ export async function runDev(args = []) {
|
|
|
137
141
|
const cleanup = () => {
|
|
138
142
|
if (cleaned) return;
|
|
139
143
|
cleaned = true;
|
|
144
|
+
trace(`cleanup (host_agent ${hostAgent?.pid ?? "-"}, dev:back ${backend?.pid ?? "-"})`);
|
|
140
145
|
if (hostAgent && hostAgent.exitCode === null) hostAgent.kill();
|
|
141
146
|
if (backend && backend.exitCode === null) backend.kill();
|
|
142
147
|
stopDevBackContainers();
|
|
143
148
|
stopSims();
|
|
144
|
-
|
|
149
|
+
dockerRm(MUSCAT_CONTAINER);
|
|
150
|
+
trace("cleanup done");
|
|
145
151
|
};
|
|
146
152
|
for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) // SIGHUP: terminal closed (VS Code re-running Dev disposes it)
|
|
147
153
|
process.once(signal, () => {
|
|
154
|
+
trace(signal);
|
|
148
155
|
cleanup();
|
|
149
156
|
// Once dev:ui is up its own handler stops the UI and exits.
|
|
150
157
|
if (!process.listenerCount(signal)) process.exit(130);
|
package/cli/src/devBack.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import { spawn, spawnSync } from "node:child_process";
|
|
|
11
11
|
import { existsSync, readFileSync, watch, writeFileSync } from "node:fs";
|
|
12
12
|
import { isIP } from "node:net";
|
|
13
13
|
import { resolve } from "node:path";
|
|
14
|
-
import { dockerUserFlags, ensureDevDir, ensureDocker, ensureIdeVenv, findPluginRoot, log, promptRobotConnection, realtimeFlags } from "./util.mjs";
|
|
14
|
+
import { dockerRm, dockerUserFlags, ensureDevDir, ensureDocker, ensureIdeVenv, findPluginRoot, log, promptRobotConnection, realtimeFlags, trace } from "./util.mjs";
|
|
15
15
|
import { ensureRemoteZenohEnv, getFreePort, isRemoteRobot, usesHostNetwork } from "./zenohDev.mjs";
|
|
16
16
|
import { claimDevSession, DEV_CONTAINER, stopDevBackContainers } from "./devSession.mjs";
|
|
17
17
|
import { GATEWAY_PORT, localMuscatContainer, robotHasMuscat } from "./muscatLocal.mjs";
|
|
@@ -489,9 +489,10 @@ PY`]);
|
|
|
489
489
|
const cleanupResources = () => {
|
|
490
490
|
if (cleaned) return;
|
|
491
491
|
cleaned = true;
|
|
492
|
+
trace("dev:back cleanup");
|
|
492
493
|
stopPortMonitor();
|
|
493
494
|
if (!child.killed && child.exitCode === null) child.kill();
|
|
494
|
-
|
|
495
|
+
dockerRm(container);
|
|
495
496
|
};
|
|
496
497
|
const cleanup = () => {
|
|
497
498
|
cleanupResources();
|
|
@@ -596,9 +597,10 @@ async function runRos2(root, portRanges, robotGateway) {
|
|
|
596
597
|
}
|
|
597
598
|
|
|
598
599
|
const cleanup = () => {
|
|
600
|
+
trace("dev:back cleanup");
|
|
599
601
|
stopPortMonitor();
|
|
600
602
|
if (child) child.kill();
|
|
601
|
-
|
|
603
|
+
dockerRm(container);
|
|
602
604
|
process.exit(0);
|
|
603
605
|
};
|
|
604
606
|
process.on("SIGINT", cleanup);
|
|
@@ -672,9 +674,10 @@ async function runCpp(root, portRanges, robotGateway) {
|
|
|
672
674
|
if (existsSync(cppDir)) watch(cppDir, { recursive: true }, onChange);
|
|
673
675
|
|
|
674
676
|
const cleanup = () => {
|
|
677
|
+
trace("dev:back cleanup");
|
|
675
678
|
stopPortMonitor();
|
|
676
679
|
if (child) child.kill();
|
|
677
|
-
|
|
680
|
+
dockerRm(container);
|
|
678
681
|
process.exit(0);
|
|
679
682
|
};
|
|
680
683
|
process.on("SIGINT", cleanup);
|
|
@@ -740,6 +743,7 @@ export async function runDevBack(args = []) {
|
|
|
740
743
|
// cleanup is not registered yet, so remove the container here. Once it is, it handles the signal.
|
|
741
744
|
for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"])
|
|
742
745
|
process.once(signal, () => {
|
|
746
|
+
trace(`dev:back ${signal}`);
|
|
743
747
|
if (process.listenerCount(signal)) return;
|
|
744
748
|
stopDevBackContainers();
|
|
745
749
|
process.exit(130);
|
package/cli/src/devSession.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { spawnSync } from "node:child_process";
|
|
|
5
5
|
import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { homedir } from "node:os";
|
|
7
7
|
import { dirname, resolve } from "node:path";
|
|
8
|
-
import { log, prompt } from "./util.mjs";
|
|
8
|
+
import { dockerRm, log, prompt, trace } from "./util.mjs";
|
|
9
9
|
|
|
10
10
|
export const DEV_CONTAINER = "muscat-pk-dev-run";
|
|
11
11
|
// Per-runtime names from older kits.
|
|
@@ -13,7 +13,7 @@ const OLD_CONTAINERS = ["muscat-pk-python-dev-run", "muscat-pk-ros2-dev-run", "m
|
|
|
13
13
|
const LOCK = resolve(homedir(), ".muscat-pk", "dev-session.json");
|
|
14
14
|
|
|
15
15
|
export function stopDevBackContainers() {
|
|
16
|
-
|
|
16
|
+
dockerRm(DEV_CONTAINER, ...OLD_CONTAINERS);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const alive = (pid) => {
|
|
@@ -35,6 +35,7 @@ function runningSession() {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
async function stopSession(pid) {
|
|
38
|
+
trace(`stopping the running dev session ${pid}`);
|
|
38
39
|
// SIGINT runs its own cleanup (UI, host_agent, containers). Windows has no signals — kill the tree.
|
|
39
40
|
if (process.platform === "win32") spawnSync("taskkill", ["/pid", String(pid), "/T", "/F"], { stdio: "ignore" });
|
|
40
41
|
else process.kill(pid, "SIGINT");
|
package/cli/src/devUi.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { cpSync, existsSync, mkdirSync, readFileSync, rmSync, watch, writeFileSy
|
|
|
6
6
|
import { homedir } from "node:os";
|
|
7
7
|
import { dirname, resolve } from "node:path";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
|
-
import { checkKitUpdate, ensureDevDir, findPluginRoot, hasBin, kitRoot, log, openBrowser, parseArgs, prompt } from "./util.mjs";
|
|
9
|
+
import { checkKitUpdate, ensureDevDir, findPluginRoot, hasBin, kitRoot, log, openBrowser, parseArgs, prompt, trace } from "./util.mjs";
|
|
10
10
|
import { devPluginId } from "./devId.mjs";
|
|
11
11
|
import { readManifest } from "./manifest.mjs";
|
|
12
12
|
import { ensureLocalMuscat, GATEWAY_PORT, localFullMuscat, robotHasMuscat } from "./muscatLocal.mjs";
|
|
@@ -204,6 +204,7 @@ export async function runDevUi(args = []) {
|
|
|
204
204
|
};
|
|
205
205
|
for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"])
|
|
206
206
|
process.once(signal, () => {
|
|
207
|
+
trace(`dev:ui ${signal}`);
|
|
207
208
|
stopProcs();
|
|
208
209
|
process.exit(130);
|
|
209
210
|
});
|
package/cli/src/sim.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Cobot: coreSW (rainbowroboticsofficial/cobot-sim) per component, joined to common's Zenoh.
|
|
3
3
|
// RB-Y1: rby1-sim + Xvfb built locally (it needs a GLFW window; there is no headless mode yet).
|
|
4
4
|
import { spawnSync } from "node:child_process";
|
|
5
|
-
import { canSkipImageBuild, log } from "./util.mjs";
|
|
5
|
+
import { canSkipImageBuild, dockerRm, log, trace } from "./util.mjs";
|
|
6
6
|
import { MUSCAT_NETWORK } from "./muscatLocal.mjs";
|
|
7
7
|
|
|
8
8
|
const COBOT_IMAGE = "rainbowroboticsofficial/cobot-sim";
|
|
@@ -170,8 +170,9 @@ async function startContainers(sim) {
|
|
|
170
170
|
|
|
171
171
|
export function stopSims() {
|
|
172
172
|
const ids = (spawnSync("docker", ["ps", "-aq", "--filter", `label=${SIM_LABEL}=true`], { encoding: "utf8" }).stdout ?? "").split("\n").filter(Boolean);
|
|
173
|
+
trace(`sims: ${ids.length}`);
|
|
173
174
|
if (!ids.length) return;
|
|
174
175
|
// The cobot coreSWs share these under --ipc host; drop them so the next run starts from a fresh segment.
|
|
175
176
|
spawnSync("docker", ["exec", ids[0], "sh", "-c", "rm -f /dev/shm/RB_COBOT_SHM /dev/shm/RB_MESSAGE_SHM"], { stdio: "ignore" });
|
|
176
|
-
|
|
177
|
+
dockerRm(...ids);
|
|
177
178
|
}
|
package/cli/src/util.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Shared helpers for muscat-pk.
|
|
2
2
|
import { execSync, spawn, spawnSync } from "node:child_process";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
|
-
import { existsSync, mkdirSync, readdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { appendFileSync, existsSync, mkdirSync, readdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { dirname, relative, resolve, sep } from "node:path";
|
|
6
|
-
import { tmpdir } from "node:os";
|
|
6
|
+
import { homedir, tmpdir } from "node:os";
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
8
8
|
import { createInterface } from "node:readline/promises";
|
|
9
9
|
|
|
@@ -126,6 +126,36 @@ export function parseArgs(args, { booleans = [] } = {}) {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
/** Prompt user for input. Returns trimmed answer or fallback (non-TTY or empty). */
|
|
129
|
+
// How `dev` stops: each step is appended as it runs, so a process killed mid-cleanup (Windows ends a
|
|
130
|
+
// console's processes a few seconds after it closes) still shows how far it got.
|
|
131
|
+
export const TRACE_FILE = resolve(homedir(), ".muscat-pk", "dev-trace.log");
|
|
132
|
+
let traceHooked = false;
|
|
133
|
+
export function trace(msg) {
|
|
134
|
+
try {
|
|
135
|
+
appendFileSync(TRACE_FILE, `${new Date().toISOString()} ${process.pid} ${process.argv[2] ?? ""} ${msg}\n`);
|
|
136
|
+
} catch {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
if (!traceHooked) {
|
|
140
|
+
traceHooked = true;
|
|
141
|
+
process.on("exit", (code) => trace(`exit ${code}`));
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
export function startTrace() {
|
|
145
|
+
try {
|
|
146
|
+
mkdirSync(dirname(TRACE_FILE), { recursive: true });
|
|
147
|
+
writeFileSync(TRACE_FILE, "");
|
|
148
|
+
} catch {
|
|
149
|
+
/* tracing is best-effort */
|
|
150
|
+
}
|
|
151
|
+
trace(`start ${process.platform} kit ${kitVersion()} ${process.argv.slice(2).join(" ")}`);
|
|
152
|
+
}
|
|
153
|
+
export function dockerRm(...names) {
|
|
154
|
+
const r = spawnSync("docker", ["rm", "-f", ...names], { encoding: "utf8" });
|
|
155
|
+
trace(`docker rm -f ${names.join(" ")} → ${r.status ?? r.error?.code} ${(r.stderr ?? "").trim().replace(/\s*\n\s*/g, " | ")}`);
|
|
156
|
+
return r;
|
|
157
|
+
}
|
|
158
|
+
|
|
129
159
|
export async function prompt(question, fallback = "") {
|
|
130
160
|
if (!process.stdin.isTTY) return fallback;
|
|
131
161
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
@@ -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-CkB0GfaI.js";import{r as p,R as m}from"./index-Dmy2JGbm.js";import"./iframe-B-BmTsxV.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-BI0lvgwk.js";import{r as p,R as m}from"./index-Dmy2JGbm.js";import"./iframe-BJ5NYGgv.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 d}from"./jsx-runtime-BTJTZTIL.js";import{useMDXComponents as t}from"./index-B4FGfHer.js";import{b as n,U as a}from"./index-
|
|
1
|
+
import{j as d}from"./jsx-runtime-BTJTZTIL.js";import{useMDXComponents as t}from"./index-B4FGfHer.js";import{b as n,U as a}from"./index-BI0lvgwk.js";import{c as u}from"./browserUtils-CQM9Za7e.js";import"./index-ChsGqxH_.js";import"./index-Dmy2JGbm.js";import"./iframe-BJ5NYGgv.js";import"./index-CT3U1fyk.js";import"./index-BRq5TIsn.js";import"./index-DgH-xKnr.js";import"./index-DrFu-skq.js";const i={"rounded-full":{$type:"borderRadius",$value:9999},"rounded-4xl":{$type:"borderRadius",$value:32},"rounded-3xl":{$type:"borderRadius",$value:24},"rounded-2xl":{$type:"borderRadius",$value:16},"rounded-xl":{$type:"borderRadius",$value:12},"rounded-sm":{$type:"borderRadius",$value:4},"rounded-lg":{$type:"borderRadius",$value:8},"rounded-md":{$type:"borderRadius",$value:6},"rounded-xs":{$type:"borderRadius",$value:2}},l={rounded:i},c=e=>`${e/16}rem`,m=Object.entries(l.rounded).map(([e,r])=>({token:e,value:c(r.$value)})),p=e=>{u({text:e}),alert("복사가 완료되었습니다.")},o=()=>d.jsx("div",{className:"grid gap-3 md:grid-cols-3",children:m.map(({token:e,value:r})=>d.jsxs("button",{type:"button",className:"border-default bg-default text-default cursor-copy rounded-md border p-3 text-left",onClick:()=>p(e),title:`Copy ${e}`,children:[d.jsx("div",{className:"border-subtle bg-fill-subtler h-16 border",style:{borderRadius:r}}),d.jsx("p",{className:"text-subtle mt-2 text-sm",children:e}),d.jsx("p",{className:"text-subtler mt-1 text-sm",children:r})]},e))});o.__docgenInfo={description:"",methods:[],displayName:"RadiusPreview"};function s(e){const r={code:"code",h1:"h1",p:"p",pre:"pre",...t(),...e.components};return d.jsxs(d.Fragment,{children:[d.jsx(n,{title:"1.foundations/radius"}),`
|
|
2
2
|
`,d.jsx(r.h1,{id:"radius",children:"Radius"}),`
|
|
3
3
|
`,d.jsxs(r.p,{children:[d.jsx(r.code,{children:"--radius-*"})," 전체 토큰을 미리보기에서 확인합니다."]}),`
|
|
4
4
|
`,d.jsx(r.pre,{children:d.jsx(r.code,{className:"language-tsx",children:`<div className="rounded-xs" />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as l}from"./jsx-runtime-BTJTZTIL.js";import{useMDXComponents as y}from"./index-B4FGfHer.js";import{b as g,U as b}from"./index-CkB0GfaI.js";import{d as p,e as n,f as c,g as t}from"./react-resizable-panels.browser-DuxpZLkF.js";import"./index-Dmy2JGbm.js";import{c as f}from"./browserUtils-CQM9Za7e.js";import"./index-ChsGqxH_.js";import"./iframe-B-BmTsxV.js";import"./index-CT3U1fyk.js";import"./index-BRq5TIsn.js";import"./index-DgH-xKnr.js";import"./index-DrFu-skq.js";const k={"scale color":{red:{500:{$type:"color",$value:"#fb2c36"},600:{$type:"color",$value:"#e7000b"},"alpha-50p":{$type:"color",$value:"#fb2c3680"},"alpha-30p":{$type:"color",$value:"#fb2c364d"},"alpha-10p":{$type:"color",$value:"#fb2c361a"},"alpha-20p":{$type:"color",$value:"#fb2c3633"}},orange:{500:{$type:"color",$value:"#ff6900"},600:{$type:"color",$value:"#f54a00"},"alpha-50p":{$type:"color",$value:"#ff690080"},"alpha-30p":{$type:"color",$value:"#ff69004d"},"alpha-10p":{$type:"color",$value:"#ff69001a"},"alpha-20p":{$type:"color",$value:"#ff690033"}},green:{500:{$type:"color",$value:"#00c951"},600:{$type:"color",$value:"#00a63e"},"alpha-50p":{$type:"color",$value:"#00c95180"},"alpha-30p":{$type:"color",$value:"#00c9514d"},"alpha-10p":{$type:"color",$value:"#00c9511a"},"alpha-20p":{$type:"color",$value:"#00c95133"}},blue:{500:{$type:"color",$value:"#2b7fff"},600:{$type:"color",$value:"#155dfc"},"alpha-50p":{$type:"color",$value:"#2b7fff80"},"alpha-30p":{$type:"color",$value:"#2b7fff4d"},"alpha-10p":{$type:"color",$value:"#2b7fff1a"},"alpha-20p":{$type:"color",$value:"#2b7fff33"}},"zinc-950-alpha":{5:{$type:"color",$value:"#09090b0d"},10:{$type:"color",$value:"#09090b1a"},15:{$type:"color",$value:"#09090b26"},20:{$type:"color",$value:"#09090b33"},25:{$type:"color",$value:"#09090b40"},30:{$type:"color",$value:"#09090b4d"},40:{$type:"color",$value:"#09090b66"},50:{$type:"color",$value:"#09090b80"},60:{$type:"color",$value:"#09090b99"},70:{$type:"color",$value:"#09090bb3"},75:{$type:"color",$value:"#09090bbf"},80:{$type:"color",$value:"#09090bcc"},85:{$type:"color",$value:"#09090bd9"},90:{$type:"color",$value:"#09090be6"},95:{$type:"color",$value:"#09090bf2"}},"zinc-50-alpha":{5:{$type:"color",$value:"#fafafa0d"},10:{$type:"color",$value:"#fafafa1a"},15:{$type:"color",$value:"#fafafa26"},20:{$type:"color",$value:"#fafafa33"},25:{$type:"color",$value:"#fafafa40"},30:{$type:"color",$value:"#fafafa4d"},40:{$type:"color",$value:"#fafafa66"},50:{$type:"color",$value:"#fafafa80"},60:{$type:"color",$value:"#fafafa99"},70:{$type:"color",$value:"#fafafab3"},75:{$type:"color",$value:"#fafafabf"},80:{$type:"color",$value:"#fafafacc"},85:{$type:"color",$value:"#fafafad9"},90:{$type:"color",$value:"#fafafae6"},95:{$type:"color",$value:"#fafafaf2"}},zinc:{50:{$type:"color",$value:"#fafafa"},100:{$type:"color",$value:"#f4f4f5"},200:{$type:"color",$value:"#e4e4e7"},300:{$type:"color",$value:"#d4d4d8"},400:{$type:"color",$value:"#9f9fa9"},500:{$type:"color",$value:"#71717b"},600:{$type:"color",$value:"#52525c"},700:{$type:"color",$value:"#3f3f46"},800:{$type:"color",$value:"#232326"},900:{$type:"color",$value:"#18181b"},950:{$type:"color",$value:"#09090b"}},base:{black:{$type:"color",$value:"#000000"},transparent:{$type:"color",$value:"#ffffff00"},white:{$type:"color",$value:"#ffffff"}},yellow:{400:{$type:"color",$value:"#fcc800"},500:{$type:"color",$value:"#efb100"},"alpha-50p":{$type:"color",$value:"#fcc80080"},"alpha-30p":{$type:"color",$value:"#fcc8004d"},"alpha-10p":{$type:"color",$value:"#fcc8001a"},"alpha-20p":{$type:"color",$value:"#fcc80033"}},primary:{"alpha-10p":{$type:"color",$value:"#155dfc1a"},"alpha-30p":{$type:"color",$value:"#155dfc4d"},stronger:{$type:"color",$value:"#003baf"},strong:{$type:"color",$value:"#154dd0"},"alpha-50p":{$type:"color",$value:"#155dfc80"},normal:{$type:"color",$value:"#155dfc"}},custom:{"gray-100":{$type:"color",$value:"#18181a"},"gray-200":{$type:"color",$value:"#1f1f22"},"gray-300":{$type:"color",$value:"#2a2a2d"}},violet:{500:{$type:"color",$value:"#8e51ff"},600:{$type:"color",$value:"#7f22fe"},"alpha-50p":{$type:"color",$value:"#8e51ff80"},"alpha-30p":{$type:"color",$value:"#8e51ff4d"},"alpha-20p":{$type:"color",$value:"#8e51ff33"},"alpha-10p":{$type:"color",$value:"#8e51ff1a"}},rainbow:{normal:{$type:"color",$value:"#e6331b"},strong:{$type:"color",$value:"#cf2d18"},stronger:{$type:"color",$value:"#b82815"},"alpha-50p":{$type:"color",$value:"#e6331b80"},"alpha-30p":{$type:"color",$value:"#e6331b4d"},"alpha-10p":{$type:"color",$value:"#e6331b1a"}},"icon-primary":{$type:"color",$value:"#5c9cff"},navy:{normal:{$type:"color",$value:"#0b558c"},strong:{$type:"color",$value:"#094a7a"},stronger:{$type:"color",$value:"#073e67"},"alpha-50p":{$type:"color",$value:"#0b558c80"},"alpha-30p":{$type:"color",$value:"#082a6c4d"},"alpha-10p":{$type:"color",$value:"#082a6c1a"},"alpha-20p":{$type:"color",$value:"#0b558c33"},"alpha-15p":{$type:"color",$value:"#0b558c26"}}}},L={"semantic color":JSON.parse('{"fg":{"default":{"$type":"color","$value":{"Dark":"{color.scale.zinc.50}","Light":"{color.scale.zinc.950}"}},"danger-subtle":{"$type":"color","$value":{"Dark":"{color.scale.red.alpha-30p}","Light":"{color.scale.red.alpha-50p}"}},"danger":{"$type":"color","$value":{"Dark":"{color.scale.red.500}","Light":"{color.scale.red.500}"}},"warning-subtle":{"$type":"color","$value":{"Dark":"{color.scale.orange.alpha-50p}","Light":"{color.scale.orange.alpha-50p}"}},"warning":{"$type":"color","$value":{"Dark":"{color.scale.orange.500}","Light":"{color.scale.orange.500}"}},"success-subtle":{"$type":"color","$value":{"Dark":"{color.scale.green.alpha-50p}","Light":"{color.scale.green.alpha-50p}"}},"success":{"$type":"color","$value":{"Dark":"{color.scale.green.500}","Light":"{color.scale.green.600}"}},"information-subtle":{"$type":"color","$value":{"Dark":"{color.scale.blue.alpha-50p}","Light":"{color.scale.blue.alpha-50p}"}},"information":{"$type":"color","$value":{"Dark":"{color.scale.blue.500}","Light":"{color.scale.blue.500}"}},"disabled":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.20}","Light":"{color.scale.zinc-950-alpha.25}"}},"inverse":{"$type":"color","$value":{"Dark":"{color.scale.zinc.950}","Light":"{color.scale.zinc.50}"}},"subtlest":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.30}","Light":"{color.scale.zinc-950-alpha.40}"}},"subtle":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.60}","Light":"{color.scale.zinc-950-alpha.70}"}},"subtler":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.40}","Light":"{color.scale.zinc-950-alpha.60}"}},"inverse-disabled":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.15}","Light":"{color.scale.zinc-50-alpha.20}"}},"brand":{"$type":"color","$value":{"Dark":"{color.scale.primary.normal}","Light":"{color.scale.primary.normal}"}},"brand-subtle":{"$type":"color","$value":{"Dark":"{color.scale.primary.alpha-50p}","Light":"{color.scale.primary.alpha-50p}"}},"default-hovered":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.80}","Light":"{color.scale.zinc-950-alpha.80}"}},"brand-hovered":{"$type":"color","$value":{"Dark":"{color.scale.primary.strong}","Light":"{color.scale.primary.strong}"}},"caution":{"$type":"color","$value":{"Dark":"{color.scale.yellow.400}","Light":"{color.scale.yellow.400}"}},"caution-subtle":{"$type":"color","$value":{"Dark":"{color.scale.yellow.alpha-50p}","Light":"{color.scale.yellow.alpha-50p}"}},"static-white":{"$type":"color","$value":{"Dark":"{color.scale.base.white}","Light":"{color.scale.base.white}"}},"static-white-subtle":{"$type":"color","$value":{"Dark":"{color.scale.zinc.500}","Light":"{color.scale.zinc.500}"}},"debug":{"$type":"color","$value":{"Dark":"{color.scale.violet.500}","Light":"{color.scale.violet.500}"}},"debug-subtle":{"$type":"color","$value":{"Dark":"{color.scale.violet.alpha-50p}","Light":"{color.scale.violet.alpha-50p}"}},"rb":{"$type":"color","$value":{"Dark":"{color.scale.rainbow.normal}","Light":"{color.scale.rainbow.normal}"}},"rb-subtle":{"$type":"color","$value":{"Dark":"{color.scale.rainbow.alpha-50p}","Light":"{color.scale.rainbow.alpha-50p}"}},"navy":{"$type":"color","$value":{"Dark":"{color.scale.navy.normal}","Light":"{color.scale.navy.normal}"}},"navy-subtle":{"$type":"color","$value":{"Dark":"{color.scale.navy.alpha-50p}","Light":"{color.scale.navy.alpha-50p}"}},"navy-hovered":{"$type":"color","$value":{"Dark":"{color.scale.navy.strong}","Light":"{color.scale.navy.strong}"}}},"border":{"default":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.30}","Light":"{color.scale.zinc-950-alpha.20}"}},"danger-stronger":{"$type":"color","$value":{"Dark":"{color.scale.red.500}","Light":"{color.scale.red.500}"}},"warning-stronger":{"$type":"color","$value":{"Dark":"{color.scale.orange.500}","Light":"{color.scale.orange.500}"}},"success-stronger":{"$type":"color","$value":{"Dark":"{color.scale.green.500}","Light":"{color.scale.green.500}"}},"information-stronger":{"$type":"color","$value":{"Dark":"{color.scale.blue.500}","Light":"{color.scale.blue.500}"}},"disabled":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.5}","Light":"{color.scale.zinc-950-alpha.5}"}},"inverse-stronger":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.90}","Light":"{color.scale.zinc-50-alpha.90}"}},"stronger":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.90}","Light":"{color.scale.zinc-950-alpha.90}"}},"inverse":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.20}","Light":"{color.scale.zinc-50-alpha.30}"}},"danger":{"$type":"color","$value":{"Dark":"{color.scale.red.alpha-50p}","Light":"{color.scale.red.alpha-50p}"}},"warning":{"$type":"color","$value":{"Dark":"{color.scale.orange.alpha-50p}","Light":"{color.scale.orange.alpha-50p}"}},"information":{"$type":"color","$value":{"Dark":"{color.scale.blue.alpha-50p}","Light":"{color.scale.blue.alpha-50p}"}},"success":{"$type":"color","$value":{"Dark":"{color.scale.green.alpha-50p}","Light":"{color.scale.green.alpha-50p}"}},"subtle":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.15}","Light":"{color.scale.zinc-950-alpha.15}"}},"input-focused":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.90}","Light":"{color.scale.zinc-950-alpha.90}"}},"inverse-disabled":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.10}","Light":"{color.scale.zinc-50-alpha.10}"}},"brand-stronger":{"$type":"color","$value":{"Dark":"{color.scale.primary.normal}","Light":"{color.scale.primary.normal}"}},"brand":{"$type":"color","$value":{"Dark":"{color.scale.primary.alpha-50p}","Light":"{color.scale.primary.alpha-50p}"}},"caution-stronger":{"$type":"color","$value":{"Dark":"{color.scale.yellow.400}","Light":"{color.scale.yellow.400}"}},"caution":{"$type":"color","$value":{"Dark":"{color.scale.yellow.alpha-50p}","Light":"{color.scale.yellow.alpha-50p}"}},"debug-stronger":{"$type":"color","$value":{"Dark":"{color.scale.violet.500}","Light":"{color.scale.violet.500}"}},"debug":{"$type":"color","$value":{"Dark":"{color.scale.violet.alpha-50p}","Light":"{color.scale.violet.alpha-50p}"}},"subtler":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.10}","Light":"{color.scale.zinc-950-alpha.10}"}},"rb-stronger":{"$type":"color","$value":{"Dark":"{color.scale.rainbow.normal}","Light":"{color.scale.rainbow.normal}"}},"rb":{"$type":"color","$value":{"Dark":"{color.scale.rainbow.alpha-50p}","Light":"{color.scale.rainbow.alpha-50p}"}},"navy-stronger":{"$type":"color","$value":{"Dark":"{color.scale.navy.normal}","Light":"{color.scale.navy.normal}"}},"navy":{"$type":"color","$value":{"Dark":"{color.scale.navy.alpha-50p}","Light":"{color.scale.navy.alpha-50p}"}}},"fill":{"danger-subtle":{"$type":"color","$value":{"Dark":"{color.scale.red.alpha-30p}","Light":"{color.scale.red.alpha-30p}"}},"danger":{"$type":"color","$value":{"Dark":"{color.scale.red.500}","Light":"{color.scale.red.500}"}},"warning-subtle":{"$type":"color","$value":{"Dark":"{color.scale.orange.alpha-30p}","Light":"{color.scale.orange.alpha-30p}"}},"warning":{"$type":"color","$value":{"Dark":"{color.scale.orange.500}","Light":"{color.scale.orange.500}"}},"success-subtle":{"$type":"color","$value":{"Dark":"{color.scale.green.alpha-30p}","Light":"{color.scale.green.alpha-30p}"}},"success":{"$type":"color","$value":{"Dark":"{color.scale.green.500}","Light":"{color.scale.green.500}"}},"information-subtle":{"$type":"color","$value":{"Dark":"{color.scale.blue.alpha-30p}","Light":"{color.scale.blue.alpha-30p}"}},"information":{"$type":"color","$value":{"Dark":"{color.scale.blue.500}","Light":"{color.scale.blue.500}"}},"disabled":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.5}","Light":"{color.scale.zinc-950-alpha.5}"}},"control surface":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.50}","Light":"{color.scale.zinc.50}"}},"inverse":{"$type":"color","$value":{"Dark":"{color.scale.zinc.900}","Light":"{color.scale.zinc.100}"}},"inverse-hovered":{"$type":"color","$value":{"Dark":"{color.scale.zinc.700}","Light":"{color.scale.zinc.300}"}},"subtle":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.40}","Light":"{color.scale.zinc-950-alpha.40}"}},"subtle-hovered":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.30}","Light":"{color.scale.zinc-950-alpha.30}"}},"transparent":{"$type":"color","$value":{"Dark":"{color.scale.base.transparent}","Light":"{color.scale.base.transparent}"}},"transparent-hovered":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.5}","Light":"{color.scale.zinc-950-alpha.5}"}},"default":{"$type":"color","$value":{"Dark":"{color.scale.zinc.100}","Light":"{color.scale.zinc.900}"}},"default-hovered":{"$type":"color","$value":{"Dark":"{color.scale.zinc.300}","Light":"{color.scale.zinc.700}"}},"inverse-subtle":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.40}","Light":"{color.scale.zinc-50-alpha.40}"}},"inverse-subtle-hovered":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.30}","Light":"{color.scale.zinc-50-alpha.30}"}},"inverse-disabled":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.10}","Light":"{color.scale.zinc-50-alpha.10}"}},"brand":{"$type":"color","$value":{"Dark":"{color.scale.primary.normal}","Light":"{color.scale.primary.normal}"}},"brand-subtle":{"$type":"color","$value":{"Dark":"{color.scale.primary.alpha-50p}","Light":"{color.scale.primary.alpha-50p}"}},"subtler":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.20}","Light":"{color.scale.zinc-950-alpha.20}"}},"subtler-hovered":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.15}","Light":"{color.scale.zinc-950-alpha.15}"}},"brand-hovered":{"$type":"color","$value":{"Dark":"{color.scale.primary.strong}","Light":"{color.scale.primary.strong}"}},"control surface-hovered":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.30}","Light":"{color.scale.zinc.100}"}},"caution-subtle":{"$type":"color","$value":{"Dark":"{color.scale.yellow.alpha-30p}","Light":"{color.scale.yellow.alpha-30p}"}},"caution":{"$type":"color","$value":{"Dark":"{color.scale.yellow.400}","Light":"{color.scale.yellow.400}"}},"danger-subtler":{"$type":"color","$value":{"Dark":"{color.scale.red.alpha-20p}","Light":"{color.scale.red.alpha-20p}"}},"warning-subtler":{"$type":"color","$value":{"Dark":"{color.scale.orange.alpha-20p}","Light":"{color.scale.orange.alpha-20p}"}},"caution-subtler":{"$type":"color","$value":{"Dark":"{color.scale.yellow.alpha-20p}","Light":"{color.scale.yellow.alpha-20p}"}},"success-subtler":{"$type":"color","$value":{"Dark":"{color.scale.green.alpha-20p}","Light":"{color.scale.green.alpha-20p}"}},"information-subtler":{"$type":"color","$value":{"Dark":"{color.scale.blue.alpha-20p}","Light":"{color.scale.blue.alpha-20p}"}},"subtlest":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.10}","Light":"{color.scale.zinc-950-alpha.10}"}},"subtlest-hovered":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.5}","Light":"{color.scale.zinc-950-alpha.5}"}},"warning-subtlest":{"$type":"color","$value":{"Dark":"{color.scale.orange.alpha-10p}","Light":"{color.scale.orange.alpha-10p}"}},"caution-subtlest":{"$type":"color","$value":{"Dark":"{color.scale.yellow.alpha-10p}","Light":"{color.scale.yellow.alpha-10p}"}},"information-subtlest":{"$type":"color","$value":{"Dark":"{color.scale.blue.alpha-10p}","Light":"{color.scale.blue.alpha-10p}"}},"success-subtlest":{"$type":"color","$value":{"Dark":"{color.scale.green.alpha-10p}","Light":"{color.scale.green.alpha-10p}"}},"danger-subtlest":{"$type":"color","$value":{"Dark":"{color.scale.red.alpha-10p}","Light":"{color.scale.red.alpha-10p}"}},"danger-hovered":{"$type":"color","$value":{"Dark":"{color.scale.red.600}","Light":"{color.scale.red.600}"}},"warning-hovered":{"$type":"color","$value":{"Dark":"{color.scale.orange.600}","Light":"{color.scale.orange.600}"}},"caution-hovered":{"$type":"color","$value":{"Dark":"{color.scale.yellow.500}","Light":"{color.scale.yellow.500}"}},"information-hovered":{"$type":"color","$value":{"Dark":"{color.scale.blue.600}","Light":"{color.scale.blue.600}"}},"success-hovered":{"$type":"color","$value":{"Dark":"{color.scale.green.600}","Light":"{color.scale.green.600}"}},"debug":{"$type":"color","$value":{"Dark":"{color.scale.violet.500}","Light":"{color.scale.violet.500}"}},"debug-hovered":{"$type":"color","$value":{"Dark":"{color.scale.violet.600}","Light":"{color.scale.violet.600}"}},"debug-subtle":{"$type":"color","$value":{"Dark":"{color.scale.violet.alpha-30p}","Light":"{color.scale.violet.alpha-30p}"}},"debug-subtler":{"$type":"color","$value":{"Dark":"{color.scale.violet.alpha-20p}","Light":"{color.scale.violet.alpha-20p}"}},"debug-subtlest":{"$type":"color","$value":{"Dark":"{color.scale.violet.alpha-10p}","Light":"{color.scale.violet.alpha-10p}"}},"control surface-disabled":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.25}","Light":"{color.scale.zinc.50}"}},"brand-subtler":{"$type":"color","$value":{"Dark":"{color.scale.primary.alpha-30p}","Light":"{color.scale.primary.alpha-30p}"}},"rb":{"$type":"color","$value":{"Dark":"{color.scale.rainbow.normal}","Light":"{color.scale.rainbow.normal}"}},"rb-hovered":{"$type":"color","$value":{"Dark":"{color.scale.rainbow.strong}","Light":"{color.scale.rainbow.strong}"}},"rb-subtle":{"$type":"color","$value":{"Dark":"{color.scale.rainbow.alpha-50p}","Light":"{color.scale.rainbow.alpha-50p}"}},"rb-subtler":{"$type":"color","$value":{"Dark":"{color.scale.rainbow.alpha-30p}","Light":"{color.scale.rainbow.alpha-30p}"}},"rb-subtlest":{"$type":"color","$value":{"Dark":"{color.scale.rainbow.alpha-10p}","Light":"{color.scale.rainbow.alpha-10p}"}},"icon-program":{"$type":"color","$value":{"Dark":"{color.scale.icon-primary}","Light":"{color.scale.icon-primary}"}},"brand-subtlest":{"$type":"color","$value":{"Dark":"{color.scale.primary.alpha-10p}","Light":"{color.scale.primary.alpha-10p}"}},"navy":{"$type":"color","$value":{"Dark":"{color.scale.navy.normal}","Light":"{color.scale.navy.normal}"}},"navy-hovered":{"$type":"color","$value":{"Dark":"{color.scale.navy.strong}","Light":"{color.scale.navy.strong}"}},"navy-subtle":{"$type":"color","$value":{"Dark":"{color.scale.navy.alpha-50p}","Light":"{color.scale.navy.alpha-50p}"}},"navy-subtler":{"$type":"color","$value":{"Dark":"{color.scale.navy.alpha-20p}","Light":"{color.scale.navy.alpha-20p}"}},"navy-subtlest":{"$type":"color","$value":{"Dark":"{color.scale.navy.alpha-15p}","Light":"{color.scale.navy.alpha-15p}"}}},"bg":{"dim":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.80}","Light":"{color.scale.zinc-950-alpha.50}"}},"default":{"$type":"color","$value":{"Dark":"{color.scale.zinc.950}","Light":"{color.scale.zinc.50}"}},"overlay":{"$type":"color","$value":{"Dark":"{color.scale.zinc.700}","Light":"{color.scale.zinc.100}"}},"inverse":{"$type":"color","$value":{"Dark":"{color.scale.base.white}","Light":"{color.scale.zinc.950}"}},"raised":{"$type":"color","$value":{"Dark":"{color.scale.custom.gray-300}","Light":"{color.scale.zinc.100}"}},"card":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.10}","Light":"{color.scale.base.white}"}},"alt-1":{"$type":"color","$value":{"Dark":"{color.scale.zinc.900}","Light":"{color.scale.zinc.200}"}},"alt-2":{"$type":"color","$value":{"Dark":"{color.scale.zinc.800}","Light":"{color.scale.zinc.300}"}},"translucent":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.60}","Light":"{color.scale.zinc-50-alpha.50}"}},"overlay-high":{"$type":"color","$value":{"Dark":"{color.scale.zinc.600}","Light":"{color.scale.zinc.200}"}},"tooltip":{"$type":"color","$value":{"Dark":"{color.scale.zinc.50}","Light":"{color.scale.zinc.900}"}}}}')},m=e=>{f({text:e}),alert("복사가 완료되었습니다.")},D=e=>typeof e=="object"&&e!==null&&"$value"in e,h=(e,a=[])=>{if(D(e))return[a.join("-")];const o=[];return Object.entries(e).forEach(([r,s])=>{r.startsWith("$")||o.push(...h(s,[...a,r]))}),o},z=()=>{const e=k["scale color"];return Object.entries(e).map(([a,o])=>{const r=h(o,[a]);return{title:a,tokens:r.map(s=>`bg-scale-${s}`)}})},x=()=>{const e=L["semantic color"];return Object.entries(e).map(([a,o])=>{const r=h(o,[a]);return{title:a,tokens:r}})},i=z(),$=x(),j={backgroundColor:"#f1f1f4",backgroundImage:"linear-gradient(45deg, #bfbfc7 25%, transparent 25%), linear-gradient(-45deg, #bfbfc7 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #bfbfc7 75%), linear-gradient(-45deg, transparent 75%, #bfbfc7 75%)",backgroundSize:"10px 10px",backgroundPosition:"0 0, 0 5px, 5px -5px, -5px 0px"},w=e=>e.includes("alpha")||e.includes("transparent"),C=e=>e.startsWith("bg-scale-")?`--color-scale-${e.replace(/^bg-scale-/,"")}`:`--color-${e}`,N=({utility:e})=>{const a=C(e),o=w(e);return l.jsxs("button",{type:"button",className:"border-default bg-default cursor-copy rounded-md border p-2 text-left",onClick:()=>m(e),title:`Copy ${e}`,children:[l.jsx("div",{className:"border-subtle relative h-10 overflow-hidden rounded border",style:o?j:void 0,children:l.jsx("div",{className:"absolute inset-0",style:{backgroundColor:`var(${a})`}})}),l.jsx("p",{className:"text-subtle mt-2 text-sm break-all",children:e}),l.jsx("p",{className:"text-subtler mt-1 text-sm break-all",children:a})]})},u=({title:e,tokens:a})=>l.jsxs("section",{className:"border-default bg-default text-default space-y-2 rounded-lg border p-4",children:[l.jsx("h4",{className:"text-base font-semibold capitalize",children:e}),l.jsx("div",{className:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3",children:a.map(o=>l.jsx(N,{utility:o},o))})]}),d=()=>{var e,a;return l.jsxs(p,{defaultValue:"scale",className:"w-full",children:[l.jsxs(n,{className:"border-default bg-default text-default supports-[backdrop-filter]:bg-default sticky top-2 z-20 mb-3 rounded-lg border p-1 shadow-sm backdrop-blur",children:[l.jsx(c,{value:"scale",children:"Scale"}),l.jsx(c,{value:"semantic",children:"Semantic"})]}),l.jsx(t,{value:"scale",className:"text-default",children:l.jsxs(p,{defaultValue:((e=i[0])==null?void 0:e.title)||"",className:"w-full",children:[l.jsx(n,{className:"border-default bg-default text-default supports-[backdrop-filter]:bg-default sticky top-14 z-10 mb-3 rounded-lg border p-1 shadow-sm backdrop-blur",children:i.map(o=>l.jsx(c,{value:o.title,children:o.title},o.title))}),i.map(o=>l.jsx(t,{value:o.title,className:"text-default",children:l.jsx(u,{title:o.title,tokens:o.tokens})},o.title))]})}),l.jsx(t,{value:"semantic",className:"text-default",children:l.jsxs(p,{defaultValue:((a=$[0])==null?void 0:a.title)||"",className:"w-full",children:[l.jsx(n,{className:"border-default bg-default text-default supports-[backdrop-filter]:bg-default sticky top-14 z-10 mb-3 rounded-lg border p-1 shadow-sm backdrop-blur",children:$.map(o=>l.jsx(c,{value:o.title,children:o.title},o.title))}),$.map(o=>l.jsx(t,{value:o.title,className:"text-default",children:l.jsx(u,{title:o.title,tokens:o.tokens})},o.title))]})})]})};d.__docgenInfo={description:"",methods:[],displayName:"ColorPreview"};function v(e){const a={code:"code",h1:"h1",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...y(),...e.components};return l.jsxs(l.Fragment,{children:[l.jsx(g,{title:"1.foundations/color"}),`
|
|
1
|
+
import{j as l}from"./jsx-runtime-BTJTZTIL.js";import{useMDXComponents as y}from"./index-B4FGfHer.js";import{b as g,U as b}from"./index-BI0lvgwk.js";import{d as p,e as n,f as c,g as t}from"./react-resizable-panels.browser-DuxpZLkF.js";import"./index-Dmy2JGbm.js";import{c as f}from"./browserUtils-CQM9Za7e.js";import"./index-ChsGqxH_.js";import"./iframe-BJ5NYGgv.js";import"./index-CT3U1fyk.js";import"./index-BRq5TIsn.js";import"./index-DgH-xKnr.js";import"./index-DrFu-skq.js";const k={"scale color":{red:{500:{$type:"color",$value:"#fb2c36"},600:{$type:"color",$value:"#e7000b"},"alpha-50p":{$type:"color",$value:"#fb2c3680"},"alpha-30p":{$type:"color",$value:"#fb2c364d"},"alpha-10p":{$type:"color",$value:"#fb2c361a"},"alpha-20p":{$type:"color",$value:"#fb2c3633"}},orange:{500:{$type:"color",$value:"#ff6900"},600:{$type:"color",$value:"#f54a00"},"alpha-50p":{$type:"color",$value:"#ff690080"},"alpha-30p":{$type:"color",$value:"#ff69004d"},"alpha-10p":{$type:"color",$value:"#ff69001a"},"alpha-20p":{$type:"color",$value:"#ff690033"}},green:{500:{$type:"color",$value:"#00c951"},600:{$type:"color",$value:"#00a63e"},"alpha-50p":{$type:"color",$value:"#00c95180"},"alpha-30p":{$type:"color",$value:"#00c9514d"},"alpha-10p":{$type:"color",$value:"#00c9511a"},"alpha-20p":{$type:"color",$value:"#00c95133"}},blue:{500:{$type:"color",$value:"#2b7fff"},600:{$type:"color",$value:"#155dfc"},"alpha-50p":{$type:"color",$value:"#2b7fff80"},"alpha-30p":{$type:"color",$value:"#2b7fff4d"},"alpha-10p":{$type:"color",$value:"#2b7fff1a"},"alpha-20p":{$type:"color",$value:"#2b7fff33"}},"zinc-950-alpha":{5:{$type:"color",$value:"#09090b0d"},10:{$type:"color",$value:"#09090b1a"},15:{$type:"color",$value:"#09090b26"},20:{$type:"color",$value:"#09090b33"},25:{$type:"color",$value:"#09090b40"},30:{$type:"color",$value:"#09090b4d"},40:{$type:"color",$value:"#09090b66"},50:{$type:"color",$value:"#09090b80"},60:{$type:"color",$value:"#09090b99"},70:{$type:"color",$value:"#09090bb3"},75:{$type:"color",$value:"#09090bbf"},80:{$type:"color",$value:"#09090bcc"},85:{$type:"color",$value:"#09090bd9"},90:{$type:"color",$value:"#09090be6"},95:{$type:"color",$value:"#09090bf2"}},"zinc-50-alpha":{5:{$type:"color",$value:"#fafafa0d"},10:{$type:"color",$value:"#fafafa1a"},15:{$type:"color",$value:"#fafafa26"},20:{$type:"color",$value:"#fafafa33"},25:{$type:"color",$value:"#fafafa40"},30:{$type:"color",$value:"#fafafa4d"},40:{$type:"color",$value:"#fafafa66"},50:{$type:"color",$value:"#fafafa80"},60:{$type:"color",$value:"#fafafa99"},70:{$type:"color",$value:"#fafafab3"},75:{$type:"color",$value:"#fafafabf"},80:{$type:"color",$value:"#fafafacc"},85:{$type:"color",$value:"#fafafad9"},90:{$type:"color",$value:"#fafafae6"},95:{$type:"color",$value:"#fafafaf2"}},zinc:{50:{$type:"color",$value:"#fafafa"},100:{$type:"color",$value:"#f4f4f5"},200:{$type:"color",$value:"#e4e4e7"},300:{$type:"color",$value:"#d4d4d8"},400:{$type:"color",$value:"#9f9fa9"},500:{$type:"color",$value:"#71717b"},600:{$type:"color",$value:"#52525c"},700:{$type:"color",$value:"#3f3f46"},800:{$type:"color",$value:"#232326"},900:{$type:"color",$value:"#18181b"},950:{$type:"color",$value:"#09090b"}},base:{black:{$type:"color",$value:"#000000"},transparent:{$type:"color",$value:"#ffffff00"},white:{$type:"color",$value:"#ffffff"}},yellow:{400:{$type:"color",$value:"#fcc800"},500:{$type:"color",$value:"#efb100"},"alpha-50p":{$type:"color",$value:"#fcc80080"},"alpha-30p":{$type:"color",$value:"#fcc8004d"},"alpha-10p":{$type:"color",$value:"#fcc8001a"},"alpha-20p":{$type:"color",$value:"#fcc80033"}},primary:{"alpha-10p":{$type:"color",$value:"#155dfc1a"},"alpha-30p":{$type:"color",$value:"#155dfc4d"},stronger:{$type:"color",$value:"#003baf"},strong:{$type:"color",$value:"#154dd0"},"alpha-50p":{$type:"color",$value:"#155dfc80"},normal:{$type:"color",$value:"#155dfc"}},custom:{"gray-100":{$type:"color",$value:"#18181a"},"gray-200":{$type:"color",$value:"#1f1f22"},"gray-300":{$type:"color",$value:"#2a2a2d"}},violet:{500:{$type:"color",$value:"#8e51ff"},600:{$type:"color",$value:"#7f22fe"},"alpha-50p":{$type:"color",$value:"#8e51ff80"},"alpha-30p":{$type:"color",$value:"#8e51ff4d"},"alpha-20p":{$type:"color",$value:"#8e51ff33"},"alpha-10p":{$type:"color",$value:"#8e51ff1a"}},rainbow:{normal:{$type:"color",$value:"#e6331b"},strong:{$type:"color",$value:"#cf2d18"},stronger:{$type:"color",$value:"#b82815"},"alpha-50p":{$type:"color",$value:"#e6331b80"},"alpha-30p":{$type:"color",$value:"#e6331b4d"},"alpha-10p":{$type:"color",$value:"#e6331b1a"}},"icon-primary":{$type:"color",$value:"#5c9cff"},navy:{normal:{$type:"color",$value:"#0b558c"},strong:{$type:"color",$value:"#094a7a"},stronger:{$type:"color",$value:"#073e67"},"alpha-50p":{$type:"color",$value:"#0b558c80"},"alpha-30p":{$type:"color",$value:"#082a6c4d"},"alpha-10p":{$type:"color",$value:"#082a6c1a"},"alpha-20p":{$type:"color",$value:"#0b558c33"},"alpha-15p":{$type:"color",$value:"#0b558c26"}}}},L={"semantic color":JSON.parse('{"fg":{"default":{"$type":"color","$value":{"Dark":"{color.scale.zinc.50}","Light":"{color.scale.zinc.950}"}},"danger-subtle":{"$type":"color","$value":{"Dark":"{color.scale.red.alpha-30p}","Light":"{color.scale.red.alpha-50p}"}},"danger":{"$type":"color","$value":{"Dark":"{color.scale.red.500}","Light":"{color.scale.red.500}"}},"warning-subtle":{"$type":"color","$value":{"Dark":"{color.scale.orange.alpha-50p}","Light":"{color.scale.orange.alpha-50p}"}},"warning":{"$type":"color","$value":{"Dark":"{color.scale.orange.500}","Light":"{color.scale.orange.500}"}},"success-subtle":{"$type":"color","$value":{"Dark":"{color.scale.green.alpha-50p}","Light":"{color.scale.green.alpha-50p}"}},"success":{"$type":"color","$value":{"Dark":"{color.scale.green.500}","Light":"{color.scale.green.600}"}},"information-subtle":{"$type":"color","$value":{"Dark":"{color.scale.blue.alpha-50p}","Light":"{color.scale.blue.alpha-50p}"}},"information":{"$type":"color","$value":{"Dark":"{color.scale.blue.500}","Light":"{color.scale.blue.500}"}},"disabled":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.20}","Light":"{color.scale.zinc-950-alpha.25}"}},"inverse":{"$type":"color","$value":{"Dark":"{color.scale.zinc.950}","Light":"{color.scale.zinc.50}"}},"subtlest":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.30}","Light":"{color.scale.zinc-950-alpha.40}"}},"subtle":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.60}","Light":"{color.scale.zinc-950-alpha.70}"}},"subtler":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.40}","Light":"{color.scale.zinc-950-alpha.60}"}},"inverse-disabled":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.15}","Light":"{color.scale.zinc-50-alpha.20}"}},"brand":{"$type":"color","$value":{"Dark":"{color.scale.primary.normal}","Light":"{color.scale.primary.normal}"}},"brand-subtle":{"$type":"color","$value":{"Dark":"{color.scale.primary.alpha-50p}","Light":"{color.scale.primary.alpha-50p}"}},"default-hovered":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.80}","Light":"{color.scale.zinc-950-alpha.80}"}},"brand-hovered":{"$type":"color","$value":{"Dark":"{color.scale.primary.strong}","Light":"{color.scale.primary.strong}"}},"caution":{"$type":"color","$value":{"Dark":"{color.scale.yellow.400}","Light":"{color.scale.yellow.400}"}},"caution-subtle":{"$type":"color","$value":{"Dark":"{color.scale.yellow.alpha-50p}","Light":"{color.scale.yellow.alpha-50p}"}},"static-white":{"$type":"color","$value":{"Dark":"{color.scale.base.white}","Light":"{color.scale.base.white}"}},"static-white-subtle":{"$type":"color","$value":{"Dark":"{color.scale.zinc.500}","Light":"{color.scale.zinc.500}"}},"debug":{"$type":"color","$value":{"Dark":"{color.scale.violet.500}","Light":"{color.scale.violet.500}"}},"debug-subtle":{"$type":"color","$value":{"Dark":"{color.scale.violet.alpha-50p}","Light":"{color.scale.violet.alpha-50p}"}},"rb":{"$type":"color","$value":{"Dark":"{color.scale.rainbow.normal}","Light":"{color.scale.rainbow.normal}"}},"rb-subtle":{"$type":"color","$value":{"Dark":"{color.scale.rainbow.alpha-50p}","Light":"{color.scale.rainbow.alpha-50p}"}},"navy":{"$type":"color","$value":{"Dark":"{color.scale.navy.normal}","Light":"{color.scale.navy.normal}"}},"navy-subtle":{"$type":"color","$value":{"Dark":"{color.scale.navy.alpha-50p}","Light":"{color.scale.navy.alpha-50p}"}},"navy-hovered":{"$type":"color","$value":{"Dark":"{color.scale.navy.strong}","Light":"{color.scale.navy.strong}"}}},"border":{"default":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.30}","Light":"{color.scale.zinc-950-alpha.20}"}},"danger-stronger":{"$type":"color","$value":{"Dark":"{color.scale.red.500}","Light":"{color.scale.red.500}"}},"warning-stronger":{"$type":"color","$value":{"Dark":"{color.scale.orange.500}","Light":"{color.scale.orange.500}"}},"success-stronger":{"$type":"color","$value":{"Dark":"{color.scale.green.500}","Light":"{color.scale.green.500}"}},"information-stronger":{"$type":"color","$value":{"Dark":"{color.scale.blue.500}","Light":"{color.scale.blue.500}"}},"disabled":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.5}","Light":"{color.scale.zinc-950-alpha.5}"}},"inverse-stronger":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.90}","Light":"{color.scale.zinc-50-alpha.90}"}},"stronger":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.90}","Light":"{color.scale.zinc-950-alpha.90}"}},"inverse":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.20}","Light":"{color.scale.zinc-50-alpha.30}"}},"danger":{"$type":"color","$value":{"Dark":"{color.scale.red.alpha-50p}","Light":"{color.scale.red.alpha-50p}"}},"warning":{"$type":"color","$value":{"Dark":"{color.scale.orange.alpha-50p}","Light":"{color.scale.orange.alpha-50p}"}},"information":{"$type":"color","$value":{"Dark":"{color.scale.blue.alpha-50p}","Light":"{color.scale.blue.alpha-50p}"}},"success":{"$type":"color","$value":{"Dark":"{color.scale.green.alpha-50p}","Light":"{color.scale.green.alpha-50p}"}},"subtle":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.15}","Light":"{color.scale.zinc-950-alpha.15}"}},"input-focused":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.90}","Light":"{color.scale.zinc-950-alpha.90}"}},"inverse-disabled":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.10}","Light":"{color.scale.zinc-50-alpha.10}"}},"brand-stronger":{"$type":"color","$value":{"Dark":"{color.scale.primary.normal}","Light":"{color.scale.primary.normal}"}},"brand":{"$type":"color","$value":{"Dark":"{color.scale.primary.alpha-50p}","Light":"{color.scale.primary.alpha-50p}"}},"caution-stronger":{"$type":"color","$value":{"Dark":"{color.scale.yellow.400}","Light":"{color.scale.yellow.400}"}},"caution":{"$type":"color","$value":{"Dark":"{color.scale.yellow.alpha-50p}","Light":"{color.scale.yellow.alpha-50p}"}},"debug-stronger":{"$type":"color","$value":{"Dark":"{color.scale.violet.500}","Light":"{color.scale.violet.500}"}},"debug":{"$type":"color","$value":{"Dark":"{color.scale.violet.alpha-50p}","Light":"{color.scale.violet.alpha-50p}"}},"subtler":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.10}","Light":"{color.scale.zinc-950-alpha.10}"}},"rb-stronger":{"$type":"color","$value":{"Dark":"{color.scale.rainbow.normal}","Light":"{color.scale.rainbow.normal}"}},"rb":{"$type":"color","$value":{"Dark":"{color.scale.rainbow.alpha-50p}","Light":"{color.scale.rainbow.alpha-50p}"}},"navy-stronger":{"$type":"color","$value":{"Dark":"{color.scale.navy.normal}","Light":"{color.scale.navy.normal}"}},"navy":{"$type":"color","$value":{"Dark":"{color.scale.navy.alpha-50p}","Light":"{color.scale.navy.alpha-50p}"}}},"fill":{"danger-subtle":{"$type":"color","$value":{"Dark":"{color.scale.red.alpha-30p}","Light":"{color.scale.red.alpha-30p}"}},"danger":{"$type":"color","$value":{"Dark":"{color.scale.red.500}","Light":"{color.scale.red.500}"}},"warning-subtle":{"$type":"color","$value":{"Dark":"{color.scale.orange.alpha-30p}","Light":"{color.scale.orange.alpha-30p}"}},"warning":{"$type":"color","$value":{"Dark":"{color.scale.orange.500}","Light":"{color.scale.orange.500}"}},"success-subtle":{"$type":"color","$value":{"Dark":"{color.scale.green.alpha-30p}","Light":"{color.scale.green.alpha-30p}"}},"success":{"$type":"color","$value":{"Dark":"{color.scale.green.500}","Light":"{color.scale.green.500}"}},"information-subtle":{"$type":"color","$value":{"Dark":"{color.scale.blue.alpha-30p}","Light":"{color.scale.blue.alpha-30p}"}},"information":{"$type":"color","$value":{"Dark":"{color.scale.blue.500}","Light":"{color.scale.blue.500}"}},"disabled":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.5}","Light":"{color.scale.zinc-950-alpha.5}"}},"control surface":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.50}","Light":"{color.scale.zinc.50}"}},"inverse":{"$type":"color","$value":{"Dark":"{color.scale.zinc.900}","Light":"{color.scale.zinc.100}"}},"inverse-hovered":{"$type":"color","$value":{"Dark":"{color.scale.zinc.700}","Light":"{color.scale.zinc.300}"}},"subtle":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.40}","Light":"{color.scale.zinc-950-alpha.40}"}},"subtle-hovered":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.30}","Light":"{color.scale.zinc-950-alpha.30}"}},"transparent":{"$type":"color","$value":{"Dark":"{color.scale.base.transparent}","Light":"{color.scale.base.transparent}"}},"transparent-hovered":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.5}","Light":"{color.scale.zinc-950-alpha.5}"}},"default":{"$type":"color","$value":{"Dark":"{color.scale.zinc.100}","Light":"{color.scale.zinc.900}"}},"default-hovered":{"$type":"color","$value":{"Dark":"{color.scale.zinc.300}","Light":"{color.scale.zinc.700}"}},"inverse-subtle":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.40}","Light":"{color.scale.zinc-50-alpha.40}"}},"inverse-subtle-hovered":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.30}","Light":"{color.scale.zinc-50-alpha.30}"}},"inverse-disabled":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.10}","Light":"{color.scale.zinc-50-alpha.10}"}},"brand":{"$type":"color","$value":{"Dark":"{color.scale.primary.normal}","Light":"{color.scale.primary.normal}"}},"brand-subtle":{"$type":"color","$value":{"Dark":"{color.scale.primary.alpha-50p}","Light":"{color.scale.primary.alpha-50p}"}},"subtler":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.20}","Light":"{color.scale.zinc-950-alpha.20}"}},"subtler-hovered":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.15}","Light":"{color.scale.zinc-950-alpha.15}"}},"brand-hovered":{"$type":"color","$value":{"Dark":"{color.scale.primary.strong}","Light":"{color.scale.primary.strong}"}},"control surface-hovered":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.30}","Light":"{color.scale.zinc.100}"}},"caution-subtle":{"$type":"color","$value":{"Dark":"{color.scale.yellow.alpha-30p}","Light":"{color.scale.yellow.alpha-30p}"}},"caution":{"$type":"color","$value":{"Dark":"{color.scale.yellow.400}","Light":"{color.scale.yellow.400}"}},"danger-subtler":{"$type":"color","$value":{"Dark":"{color.scale.red.alpha-20p}","Light":"{color.scale.red.alpha-20p}"}},"warning-subtler":{"$type":"color","$value":{"Dark":"{color.scale.orange.alpha-20p}","Light":"{color.scale.orange.alpha-20p}"}},"caution-subtler":{"$type":"color","$value":{"Dark":"{color.scale.yellow.alpha-20p}","Light":"{color.scale.yellow.alpha-20p}"}},"success-subtler":{"$type":"color","$value":{"Dark":"{color.scale.green.alpha-20p}","Light":"{color.scale.green.alpha-20p}"}},"information-subtler":{"$type":"color","$value":{"Dark":"{color.scale.blue.alpha-20p}","Light":"{color.scale.blue.alpha-20p}"}},"subtlest":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.10}","Light":"{color.scale.zinc-950-alpha.10}"}},"subtlest-hovered":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.5}","Light":"{color.scale.zinc-950-alpha.5}"}},"warning-subtlest":{"$type":"color","$value":{"Dark":"{color.scale.orange.alpha-10p}","Light":"{color.scale.orange.alpha-10p}"}},"caution-subtlest":{"$type":"color","$value":{"Dark":"{color.scale.yellow.alpha-10p}","Light":"{color.scale.yellow.alpha-10p}"}},"information-subtlest":{"$type":"color","$value":{"Dark":"{color.scale.blue.alpha-10p}","Light":"{color.scale.blue.alpha-10p}"}},"success-subtlest":{"$type":"color","$value":{"Dark":"{color.scale.green.alpha-10p}","Light":"{color.scale.green.alpha-10p}"}},"danger-subtlest":{"$type":"color","$value":{"Dark":"{color.scale.red.alpha-10p}","Light":"{color.scale.red.alpha-10p}"}},"danger-hovered":{"$type":"color","$value":{"Dark":"{color.scale.red.600}","Light":"{color.scale.red.600}"}},"warning-hovered":{"$type":"color","$value":{"Dark":"{color.scale.orange.600}","Light":"{color.scale.orange.600}"}},"caution-hovered":{"$type":"color","$value":{"Dark":"{color.scale.yellow.500}","Light":"{color.scale.yellow.500}"}},"information-hovered":{"$type":"color","$value":{"Dark":"{color.scale.blue.600}","Light":"{color.scale.blue.600}"}},"success-hovered":{"$type":"color","$value":{"Dark":"{color.scale.green.600}","Light":"{color.scale.green.600}"}},"debug":{"$type":"color","$value":{"Dark":"{color.scale.violet.500}","Light":"{color.scale.violet.500}"}},"debug-hovered":{"$type":"color","$value":{"Dark":"{color.scale.violet.600}","Light":"{color.scale.violet.600}"}},"debug-subtle":{"$type":"color","$value":{"Dark":"{color.scale.violet.alpha-30p}","Light":"{color.scale.violet.alpha-30p}"}},"debug-subtler":{"$type":"color","$value":{"Dark":"{color.scale.violet.alpha-20p}","Light":"{color.scale.violet.alpha-20p}"}},"debug-subtlest":{"$type":"color","$value":{"Dark":"{color.scale.violet.alpha-10p}","Light":"{color.scale.violet.alpha-10p}"}},"control surface-disabled":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.25}","Light":"{color.scale.zinc.50}"}},"brand-subtler":{"$type":"color","$value":{"Dark":"{color.scale.primary.alpha-30p}","Light":"{color.scale.primary.alpha-30p}"}},"rb":{"$type":"color","$value":{"Dark":"{color.scale.rainbow.normal}","Light":"{color.scale.rainbow.normal}"}},"rb-hovered":{"$type":"color","$value":{"Dark":"{color.scale.rainbow.strong}","Light":"{color.scale.rainbow.strong}"}},"rb-subtle":{"$type":"color","$value":{"Dark":"{color.scale.rainbow.alpha-50p}","Light":"{color.scale.rainbow.alpha-50p}"}},"rb-subtler":{"$type":"color","$value":{"Dark":"{color.scale.rainbow.alpha-30p}","Light":"{color.scale.rainbow.alpha-30p}"}},"rb-subtlest":{"$type":"color","$value":{"Dark":"{color.scale.rainbow.alpha-10p}","Light":"{color.scale.rainbow.alpha-10p}"}},"icon-program":{"$type":"color","$value":{"Dark":"{color.scale.icon-primary}","Light":"{color.scale.icon-primary}"}},"brand-subtlest":{"$type":"color","$value":{"Dark":"{color.scale.primary.alpha-10p}","Light":"{color.scale.primary.alpha-10p}"}},"navy":{"$type":"color","$value":{"Dark":"{color.scale.navy.normal}","Light":"{color.scale.navy.normal}"}},"navy-hovered":{"$type":"color","$value":{"Dark":"{color.scale.navy.strong}","Light":"{color.scale.navy.strong}"}},"navy-subtle":{"$type":"color","$value":{"Dark":"{color.scale.navy.alpha-50p}","Light":"{color.scale.navy.alpha-50p}"}},"navy-subtler":{"$type":"color","$value":{"Dark":"{color.scale.navy.alpha-20p}","Light":"{color.scale.navy.alpha-20p}"}},"navy-subtlest":{"$type":"color","$value":{"Dark":"{color.scale.navy.alpha-15p}","Light":"{color.scale.navy.alpha-15p}"}}},"bg":{"dim":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.80}","Light":"{color.scale.zinc-950-alpha.50}"}},"default":{"$type":"color","$value":{"Dark":"{color.scale.zinc.950}","Light":"{color.scale.zinc.50}"}},"overlay":{"$type":"color","$value":{"Dark":"{color.scale.zinc.700}","Light":"{color.scale.zinc.100}"}},"inverse":{"$type":"color","$value":{"Dark":"{color.scale.base.white}","Light":"{color.scale.zinc.950}"}},"raised":{"$type":"color","$value":{"Dark":"{color.scale.custom.gray-300}","Light":"{color.scale.zinc.100}"}},"card":{"$type":"color","$value":{"Dark":"{color.scale.zinc-50-alpha.10}","Light":"{color.scale.base.white}"}},"alt-1":{"$type":"color","$value":{"Dark":"{color.scale.zinc.900}","Light":"{color.scale.zinc.200}"}},"alt-2":{"$type":"color","$value":{"Dark":"{color.scale.zinc.800}","Light":"{color.scale.zinc.300}"}},"translucent":{"$type":"color","$value":{"Dark":"{color.scale.zinc-950-alpha.60}","Light":"{color.scale.zinc-50-alpha.50}"}},"overlay-high":{"$type":"color","$value":{"Dark":"{color.scale.zinc.600}","Light":"{color.scale.zinc.200}"}},"tooltip":{"$type":"color","$value":{"Dark":"{color.scale.zinc.50}","Light":"{color.scale.zinc.900}"}}}}')},m=e=>{f({text:e}),alert("복사가 완료되었습니다.")},D=e=>typeof e=="object"&&e!==null&&"$value"in e,h=(e,a=[])=>{if(D(e))return[a.join("-")];const o=[];return Object.entries(e).forEach(([r,s])=>{r.startsWith("$")||o.push(...h(s,[...a,r]))}),o},z=()=>{const e=k["scale color"];return Object.entries(e).map(([a,o])=>{const r=h(o,[a]);return{title:a,tokens:r.map(s=>`bg-scale-${s}`)}})},x=()=>{const e=L["semantic color"];return Object.entries(e).map(([a,o])=>{const r=h(o,[a]);return{title:a,tokens:r}})},i=z(),$=x(),j={backgroundColor:"#f1f1f4",backgroundImage:"linear-gradient(45deg, #bfbfc7 25%, transparent 25%), linear-gradient(-45deg, #bfbfc7 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #bfbfc7 75%), linear-gradient(-45deg, transparent 75%, #bfbfc7 75%)",backgroundSize:"10px 10px",backgroundPosition:"0 0, 0 5px, 5px -5px, -5px 0px"},w=e=>e.includes("alpha")||e.includes("transparent"),C=e=>e.startsWith("bg-scale-")?`--color-scale-${e.replace(/^bg-scale-/,"")}`:`--color-${e}`,N=({utility:e})=>{const a=C(e),o=w(e);return l.jsxs("button",{type:"button",className:"border-default bg-default cursor-copy rounded-md border p-2 text-left",onClick:()=>m(e),title:`Copy ${e}`,children:[l.jsx("div",{className:"border-subtle relative h-10 overflow-hidden rounded border",style:o?j:void 0,children:l.jsx("div",{className:"absolute inset-0",style:{backgroundColor:`var(${a})`}})}),l.jsx("p",{className:"text-subtle mt-2 text-sm break-all",children:e}),l.jsx("p",{className:"text-subtler mt-1 text-sm break-all",children:a})]})},u=({title:e,tokens:a})=>l.jsxs("section",{className:"border-default bg-default text-default space-y-2 rounded-lg border p-4",children:[l.jsx("h4",{className:"text-base font-semibold capitalize",children:e}),l.jsx("div",{className:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3",children:a.map(o=>l.jsx(N,{utility:o},o))})]}),d=()=>{var e,a;return l.jsxs(p,{defaultValue:"scale",className:"w-full",children:[l.jsxs(n,{className:"border-default bg-default text-default supports-[backdrop-filter]:bg-default sticky top-2 z-20 mb-3 rounded-lg border p-1 shadow-sm backdrop-blur",children:[l.jsx(c,{value:"scale",children:"Scale"}),l.jsx(c,{value:"semantic",children:"Semantic"})]}),l.jsx(t,{value:"scale",className:"text-default",children:l.jsxs(p,{defaultValue:((e=i[0])==null?void 0:e.title)||"",className:"w-full",children:[l.jsx(n,{className:"border-default bg-default text-default supports-[backdrop-filter]:bg-default sticky top-14 z-10 mb-3 rounded-lg border p-1 shadow-sm backdrop-blur",children:i.map(o=>l.jsx(c,{value:o.title,children:o.title},o.title))}),i.map(o=>l.jsx(t,{value:o.title,className:"text-default",children:l.jsx(u,{title:o.title,tokens:o.tokens})},o.title))]})}),l.jsx(t,{value:"semantic",className:"text-default",children:l.jsxs(p,{defaultValue:((a=$[0])==null?void 0:a.title)||"",className:"w-full",children:[l.jsx(n,{className:"border-default bg-default text-default supports-[backdrop-filter]:bg-default sticky top-14 z-10 mb-3 rounded-lg border p-1 shadow-sm backdrop-blur",children:$.map(o=>l.jsx(c,{value:o.title,children:o.title},o.title))}),$.map(o=>l.jsx(t,{value:o.title,className:"text-default",children:l.jsx(u,{title:o.title,tokens:o.tokens})},o.title))]})})]})};d.__docgenInfo={description:"",methods:[],displayName:"ColorPreview"};function v(e){const a={code:"code",h1:"h1",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...y(),...e.components};return l.jsxs(l.Fragment,{children:[l.jsx(g,{title:"1.foundations/color"}),`
|
|
2
2
|
`,l.jsx(a.h1,{id:"color",children:"Color"}),`
|
|
3
3
|
`,l.jsxs(a.p,{children:[l.jsx(a.code,{children:"rb-token.css"}),"에 정의된 색상 토큰 전체를 미리보기에서 확인합니다."]}),`
|
|
4
4
|
`,l.jsx(a.pre,{children:l.jsx(a.code,{className:"language-tsx",children:`<div className="bg-default text-default border border-default" />
|