@comfyorg/design-system 1.0.1 → 1.1.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.md CHANGED
@@ -39,6 +39,7 @@ For the palette and fonts without the Tailwind layers or icon plugins:
39
39
  | `./css/_palette.css` | Color variables |
40
40
  | `./css/fonts.css` | Font faces |
41
41
  | `./icons/*.svg` | Comfy icon set source SVGs |
42
+ | `./workspaceAvatar` | Deterministic workspace avatar styles by plan and name |
42
43
 
43
44
  Icons are exposed to Tailwind as `icon-[comfy--*]` and `icon-mask-[comfy--*]`
44
45
  utilities. Size them with `size-*`, not font-size classes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comfyorg/design-system",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "Shared design system for ComfyUI Frontend",
5
5
  "homepage": "https://comfy.org",
6
6
  "license": "MIT",
@@ -15,12 +15,14 @@
15
15
  },
16
16
  "files": [
17
17
  "src/css",
18
- "src/icons"
18
+ "src/icons",
19
+ "src/workspaceAvatar.ts"
19
20
  ],
20
21
  "type": "module",
21
22
  "exports": {
22
23
  "./css/*": "./src/css/*",
23
- "./icons/*": "./src/icons/*"
24
+ "./icons/*": "./src/icons/*",
25
+ "./workspaceAvatar": "./src/workspaceAvatar.ts"
24
26
  },
25
27
  "publishConfig": {
26
28
  "access": "public"
@@ -1,8 +1,13 @@
1
1
  @theme {
2
2
  /* Font Families */
3
3
  --font-inter: 'Inter', sans-serif;
4
+ --font-formula: 'PP Formula', 'Inter', sans-serif;
4
5
 
5
6
  /* Palette Colors */
7
+ --color-transparency-white-t8: rgb(255 255 255 / 0.08);
8
+ --color-transparency-white-t20: rgb(255 255 255 / 0.2);
9
+ --color-transparency-white-t40: rgb(255 255 255 / 0.4);
10
+
6
11
  --color-charcoal-100: #55565e;
7
12
  --color-charcoal-200: #494a50;
8
13
  --color-charcoal-300: #3c3d42;
@@ -11,6 +16,8 @@
11
16
  --color-charcoal-600: #262729;
12
17
  --color-charcoal-700: #202121;
13
18
  --color-charcoal-800: #171718;
19
+ --color-charcoal-900: #111111;
20
+ --color-charcoal-950: #09090a;
14
21
 
15
22
  --color-neutral-550: #636363;
16
23
 
package/src/css/style.css CHANGED
@@ -13,7 +13,7 @@
13
13
  @plugin "./lucideStrokePlugin.js";
14
14
 
15
15
  /* Safelist dynamic comfy icons for node library folders */
16
- @source inline("icon-[comfy--{ai-model,anthropic,bfl,bria,bytedance,claude,comfy-logo,credits,elevenlabs,extensions-blocks,file-output,gemini,grok,hitpaw,ideogram,image-ai-edit,kling,ltxv,luma,magnific,mask,meshy,minimax,moonvalley-marey,node,openai,pin,pixverse,play,recraft,reve,rodin,runway,sora,stability-ai,template,tencent,topaz,tripo,veo,vidu,wan,wavespeed,workflow,quiver}]");
16
+ @source inline("icon-[comfy--{ai-model,anthropic,bfl,bria,bytedance,claude,comfy-cloud,comfy-logo,credits,elevenlabs,extensions-blocks,file-output,gemini,grok,hitpaw,ideogram,image-ai-edit,kling,ltxv,luma,magnific,mask,meshy,minimax,moonvalley-marey,node,openai,pin,pixverse,play,recraft,reve,rodin,runway,sora,stability-ai,template,tencent,topaz,tripo,veo,vidu,wan,wavespeed,workflow,quiver}]");
17
17
 
18
18
  /* Badge icon names are built at runtime, so the scanner cannot find them. */
19
19
  @source inline("icon-mask-[comfy--{3d-decomp,ai-model,anthropic,batch-images-node,bfl,bria,brightness-contrast,bytedance,canny,canny-to-image,canny-to-video,channels,chromatic-aberration,claude,comfy-c,comfy-logo,credits,depth-to-image,depth-to-video,dial,elevenlabs,extensions-blocks,file-output,frames-to-video,gemini,get-video-components,glow,grain,grok,hitpaw,ideogram,image-ai-edit,image-batch,image-blur,image-canny,image-captioning,image-collage,image-compare,image-depth,image-edit,image-inpaint,image-invert,image-outpaint,image-outpainting,image-remove-background,image-rotate,image-select-object-segmentation,image-shader,image-sharpen,image-to-3d,image-to-image,image-to-layers,image-to-video,image-upscale,image-vectorize,kling,load-3d,load-audio,load-video,lora-loader,ltxv,luma,magnific,mask,meshy,minimax,moonvalley-marey,node,open-ai-chat-node,openai,pin,pixverse,play,pose-to-image,pose-to-video,quiver,recraft,reve,rodin,runway,save-3d,save-audio,save-video,send,sora,stability-ai,template,tencent,text-prompt-enhance,text-to-3d,text-to-audio,text-to-image,text-to-video,topaz,tripo,veo,video-captioning,video-edit,video-enhance,video-extract-frame,video-inpaint,video-interpolation,video-select-object-segmentation,video-slice,video-split-screen,video-trim,video-upscale,vidu,voice-clone,wan,wavespeed,workflow}]");
@@ -51,6 +51,8 @@
51
51
  --color-gold-400: #fcbf64;
52
52
  --color-gold-500: #fdab34;
53
53
  --color-gold-600: #fd9903;
54
+ --color-gold-700: #c77700;
55
+ --color-gold-800: #8c6a38;
54
56
 
55
57
  --color-credit: #ddbd31;
56
58
 
@@ -67,6 +69,8 @@
67
69
 
68
70
  --color-primary-comfy-ink: #211927;
69
71
  --color-primary-comfy-canvas: #c2bfb9;
72
+ --color-primary-warm-white: #f0efed;
73
+ --color-primary-warm-gray: #7e7c78;
70
74
 
71
75
  --color-danger-100: #c02323;
72
76
  --color-danger-200: #d62952;
@@ -232,6 +236,8 @@
232
236
  --inverted-background-hover: var(--color-charcoal-600);
233
237
  --warning-background: var(--color-gold-400);
234
238
  --warning-background-hover: var(--color-gold-500);
239
+ --warning-foreground: var(--color-gold-800);
240
+ --warning-on-background: var(--color-charcoal-800);
235
241
  --success-background: var(--color-jade-600);
236
242
  --border-default: var(--color-smoke-600);
237
243
  --border-subtle: var(--color-smoke-400);
@@ -385,6 +391,8 @@
385
391
  --inverted-background-hover: var(--color-smoke-200);
386
392
  --warning-background: var(--color-gold-600);
387
393
  --warning-background-hover: var(--color-gold-500);
394
+ --warning-foreground: var(--color-gold-600);
395
+ --warning-on-background: var(--color-charcoal-800);
388
396
  --success-background: var(--color-jade-600);
389
397
  --border-default: var(--color-charcoal-200);
390
398
  --border-subtle: var(--color-charcoal-300);
@@ -560,6 +568,8 @@
560
568
  --color-inverted-background-hover: var(--inverted-background-hover);
561
569
  --color-warning-background: var(--warning-background);
562
570
  --color-warning-background-hover: var(--warning-background-hover);
571
+ --color-warning-foreground: var(--warning-foreground);
572
+ --color-warning-on-background: var(--warning-on-background);
563
573
  --color-success-background: var(--success-background);
564
574
  --color-border-default: var(--border-default);
565
575
  --color-border-subtle: var(--border-subtle);
@@ -718,6 +728,32 @@ body {
718
728
  border: thin solid;
719
729
  }
720
730
 
731
+ /* Heading rhythm shared by both markdown renderers; em-relative so margins scale with the heading, not the root font size. */
732
+ .comfy-markdown .tiptap h1,
733
+ .comfy-markdown .tiptap h2,
734
+ .comfy-markdown .tiptap h3,
735
+ .comfy-markdown .tiptap h4,
736
+ .comfy-markdown .tiptap h5,
737
+ .comfy-markdown .tiptap h6,
738
+ .comfy-markdown-content h1,
739
+ .comfy-markdown-content h2,
740
+ .comfy-markdown-content h3,
741
+ .comfy-markdown-content h4,
742
+ .comfy-markdown-content h5,
743
+ .comfy-markdown-content h6 {
744
+ margin-block: 0.67em;
745
+ }
746
+
747
+ /* Tiptap headings already resolve to `normal`; only the parsed-HTML renderer needs its 1.6 body leading overridden. */
748
+ .comfy-markdown-content h1,
749
+ .comfy-markdown-content h2,
750
+ .comfy-markdown-content h3,
751
+ .comfy-markdown-content h4,
752
+ .comfy-markdown-content h5,
753
+ .comfy-markdown-content h6 {
754
+ line-height: 1.2;
755
+ }
756
+
721
757
  /* Shared markdown content styling for consistent rendering across components */
722
758
  .comfy-markdown-content {
723
759
  /* Typography */
@@ -730,47 +766,16 @@ body {
730
766
  .comfy-markdown-content h1 {
731
767
  font-size: calc(22 / 14 * var(--comfy-textarea-font-size));
732
768
  font-weight: 700; /* font-bold */
733
- margin-top: 2rem; /* mt-8 */
734
- margin-bottom: 1rem; /* mb-4 */
735
- }
736
-
737
- .comfy-markdown-content h1:first-child {
738
- margin-top: 0; /* first:mt-0 */
739
769
  }
740
770
 
741
771
  .comfy-markdown-content h2 {
742
772
  font-size: calc(18 / 14 * var(--comfy-textarea-font-size));
743
773
  font-weight: 700; /* font-bold */
744
- margin-top: 2rem; /* mt-8 */
745
- margin-bottom: 1rem; /* mb-4 */
746
- }
747
-
748
- .comfy-markdown-content h2:first-child {
749
- margin-top: 0; /* first:mt-0 */
750
774
  }
751
775
 
752
776
  .comfy-markdown-content h3 {
753
777
  font-size: calc(16 / 14 * var(--comfy-textarea-font-size));
754
778
  font-weight: 700; /* font-bold */
755
- margin-top: 2rem; /* mt-8 */
756
- margin-bottom: 1rem; /* mb-4 */
757
- }
758
-
759
- .comfy-markdown-content h3:first-child {
760
- margin-top: 0; /* first:mt-0 */
761
- }
762
-
763
- .comfy-markdown-content h4,
764
- .comfy-markdown-content h5,
765
- .comfy-markdown-content h6 {
766
- margin-top: 2rem; /* mt-8 */
767
- margin-bottom: 1rem; /* mb-4 */
768
- }
769
-
770
- .comfy-markdown-content h4:first-child,
771
- .comfy-markdown-content h5:first-child,
772
- .comfy-markdown-content h6:first-child {
773
- margin-top: 0; /* first:mt-0 */
774
779
  }
775
780
 
776
781
  /* Paragraphs */
@@ -1524,16 +1529,12 @@ audio.comfy-audio.empty-audio-widget {
1524
1529
  position: relative;
1525
1530
  transition: background-color 0.2s;
1526
1531
  }
1527
- .maskEditor_toolPanelContainerSelected svg {
1528
- fill: var(--p-button-text-primary-color) !important;
1529
- }
1530
1532
  .maskEditor_toolPanelContainerSelected .maskEditor_toolPanelIndicator {
1531
1533
  display: block;
1532
1534
  }
1533
1535
  .maskEditor_toolPanelContainer svg {
1534
1536
  width: 75%;
1535
1537
  aspect-ratio: 1/1;
1536
- fill: var(--p-button-text-secondary-color);
1537
1538
  }
1538
1539
 
1539
1540
  .maskEditor_toolPanelContainerDark:hover {
@@ -1550,7 +1551,7 @@ audio.comfy-audio.empty-audio-widget {
1550
1551
  width: 4px;
1551
1552
  position: absolute;
1552
1553
  left: 0;
1553
- background: var(--p-button-text-primary-color);
1554
+ background: currentColor;
1554
1555
  }
1555
1556
  .maskEditor_sidePanelSeparator {
1556
1557
  width: 100%;
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 520 520">
2
+ <path d="M0 184.335C0 119.812 0 87.5502 12.5571 62.9055C23.6026 41.2274 41.2274 23.6026 62.9055 12.5571C87.5502 0 119.812 0 184.335 0H335.665C400.188 0 432.45 0 457.094 12.5571C478.773 23.6026 496.397 41.2274 507.443 62.9055C520 87.5502 520 119.812 520 184.335V335.665C520 400.188 520 432.45 507.443 457.094C496.397 478.773 478.773 496.397 457.094 507.443C432.45 520 400.188 520 335.665 520H184.335C119.812 520 87.5502 520 62.9055 507.443C41.2274 496.397 23.6026 478.773 12.5571 457.094C0 432.45 0 400.188 0 335.665V184.335Z" fill="#211927"/>
3
+ <path d="M176.484 428.831C168.649 428.831 162.327 425.919 158.204 420.412C153.966 414.755 152.861 406.857 155.171 398.749L164.447 366.178C165.187 363.585 164.672 360.794 163.059 358.636C161.446 356.483 158.921 355.216 156.241 355.216H129.571C121.731 355.216 115.409 352.308 111.289 346.802C107.051 341.14 105.946 333.242 108.258 325.134L140.124 213.748L143.642 201.51C148.371 184.904 165.62 171.407 182.097 171.407H214.009C217.817 171.407 221.167 168.868 222.215 165.183L232.769 128.135C237.494 111.545 254.742 98.048 271.219 98.048L339.468 97.9264L389.431 97.9221C397.268 97.9221 403.59 100.831 407.711 106.337C411.949 111.994 413.054 119.892 410.744 128L396.457 178.164C391.734 194.75 374.485 208.242 358.009 208.242L289.607 208.372H257.706C253.902 208.372 250.557 210.907 249.502 214.588L222.903 307.495C222.159 310.093 222.673 312.892 224.291 315.049C225.904 317.202 228.428 318.469 231.107 318.469C231.113 318.469 276.307 318.381 276.307 318.381H326.122C333.959 318.381 340.281 321.29 344.402 326.796C348.639 332.457 349.744 340.355 347.433 348.463L333.146 398.619C328.423 415.209 311.174 428.701 294.698 428.701L226.299 428.831H176.484Z" fill="#F2FF59"/>
4
+ </svg>
@@ -1,3 +1,3 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 23" width="100" height="23">
2
- <path d="M83.6786 22.2799C83.1357 22.2799 82.6977 22.1196 82.4123 21.8161C82.1187 21.5041 82.0422 21.0688 82.2023 20.622L83.192 17.8576C83.519 16.9436 84.7139 16.2 85.8554 16.2H88.0742C88.338 16.2 88.5701 16.0601 88.6427 15.857L89.0255 14.788C89.0767 14.6448 89.0411 14.491 88.9293 14.3721C88.8176 14.2534 88.6426 14.1836 88.4569 14.1836L83.5943 14.1843C83.567 14.1813 83.5416 14.1799 83.5139 14.1799H81.8757C81.3328 14.1799 80.8948 14.0196 80.6094 13.7161C80.316 13.4041 80.2393 12.9688 80.3993 12.5222L80.5903 11.9884C80.6414 11.8455 80.6058 11.6917 80.494 11.5728C80.3823 11.4541 80.2074 11.3843 80.0217 11.3843H79.3942C79.1302 11.3843 78.8983 11.5242 78.8257 11.7275L78.5412 12.5222C78.2141 13.4363 77.0192 14.1799 75.8777 14.1799H73.6644C73.4011 14.1799 73.1693 14.3193 73.0963 14.5219L72.4673 16.2652C72.4645 16.2719 72.4573 16.2897 72.455 16.2964L71.5571 18.7874C71.5531 18.7959 71.5477 18.8096 71.5446 18.8184L70.895 20.6215C70.5677 21.5363 69.3728 22.2799 68.2313 22.2799H64.7799C64.237 22.2799 63.7991 22.1196 63.5136 21.8161C63.2201 21.5044 63.1435 21.0691 63.3035 20.6222L66.1963 12.5859C66.1999 12.5775 66.2065 12.5609 66.2097 12.5523L66.4118 11.9889C66.4632 11.846 66.4277 11.6919 66.316 11.573C66.2042 11.4541 66.0292 11.3843 65.8435 11.3843H65.2223C64.9588 11.3843 64.7272 11.524 64.6542 11.7266L63.3949 15.2212C63.3912 15.2297 63.3857 15.2436 63.3826 15.2522L62.9075 16.5712C62.5801 17.4862 61.3853 18.23 60.2439 18.23H56.7925C56.2495 18.23 55.8115 18.0697 55.5261 17.7663C55.2327 17.454 55.156 17.0188 55.3161 16.5721L57.4134 10.7399C57.4648 10.597 57.4293 10.443 57.3177 10.3238C57.2059 10.205 57.0309 10.1351 56.8451 10.1351H56.2202C55.9564 10.1351 55.7245 10.275 55.6517 10.4781L54.7575 12.9721C54.7539 12.9804 54.7484 12.9941 54.7454 13.0026L53.4584 16.5712C53.1306 17.4862 51.9358 18.23 50.7945 18.23H47.3432C46.8003 18.23 46.3623 18.0697 46.0769 17.7663C45.7833 17.4543 45.7068 17.019 45.8668 16.5721L46.8564 13.8077C46.8602 13.7994 46.8655 13.7862 46.8686 13.7777L47.9658 10.7351C48.0173 10.5921 47.982 10.4378 47.8703 10.319C47.7586 10.2001 47.5834 10.13 47.3976 10.13H46.7786C46.5151 10.13 46.2835 10.2697 46.2104 10.4723L46.1207 10.7212C46.1176 10.7283 46.1108 10.7452 46.1082 10.7524L44.0902 16.3461C44.0871 16.3535 44.0798 16.3716 44.0772 16.379L44.0083 16.573C43.6814 17.4862 42.4866 18.23 41.3452 18.23H37.8938C37.3509 18.23 36.9129 18.0697 36.6275 17.7663C36.3339 17.4542 36.2574 17.0189 36.4174 16.5721L36.6076 16.0406C36.6588 15.8977 36.6232 15.7439 36.5114 15.625C36.3997 15.5063 36.2248 15.4365 36.0391 15.4365H35.4136C35.1503 15.4365 34.9185 15.5759 34.8454 15.7788L34.5597 16.5712C34.2321 17.4862 33.0372 18.23 31.8958 18.23H29.6591C29.3953 18.23 29.1632 18.3699 29.0906 18.573L28.3569 20.622C28.0299 21.5363 26.835 22.2799 25.6935 22.2799H22.2421C21.6991 22.2799 21.2611 22.1196 20.9757 21.8161C20.6821 21.5041 20.6056 21.0688 20.7657 20.622L21.4057 18.8341C21.4569 18.6912 21.4213 18.5374 21.3095 18.4185C21.1978 18.2998 21.0229 18.23 20.8372 18.23H18.9952C18.4524 18.23 18.0145 18.0697 17.7288 17.7663C17.4353 17.4542 17.3587 17.0189 17.5187 16.5723L17.709 16.0406C17.7601 15.8977 17.7244 15.7439 17.6127 15.625C17.5009 15.5063 17.3261 15.4365 17.1404 15.4365H16.513C16.2492 15.4365 16.0173 15.5764 15.9445 15.7795L15.6606 16.5721C15.3335 17.4864 14.1386 18.23 12.9972 18.23L8.26972 18.2367L4.80823 18.2369C4.26533 18.2369 3.82738 18.0766 3.54193 17.7732C3.24852 17.4612 3.17184 17.0259 3.33185 16.5793L3.97453 14.7842C4.02577 14.6411 3.99011 14.4873 3.87836 14.3684C3.76661 14.2497 3.59176 14.1799 3.40605 14.1799H1.55829C1.01539 14.1799 0.577442 14.0196 0.291991 13.7161C-0.00141439 13.4041 -0.0780926 12.9688 0.0819173 12.5222L1.80249 7.73338C1.80565 7.72621 1.81275 7.70818 1.81547 7.70101L2.37094 6.15854C2.37599 6.14743 2.38031 6.13656 2.38436 6.12524L2.53367 5.70776C2.86084 4.7937 4.05555 4.04988 5.19694 4.04988H7.40772C7.67152 4.04988 7.90357 3.90995 7.97619 3.70688L8.70725 1.66506C9.03446 0.75076 10.2293 0.00717626 11.3709 0.00717626L16.109 0H19.5597C20.1026 0 20.5405 0.160294 20.826 0.463733C21.1195 0.775747 21.196 1.21104 21.036 1.65788L20.0464 4.4225C19.719 5.33656 18.5242 6.08014 17.3828 6.08014L12.6446 6.08708H10.4347C10.1711 6.08708 9.93919 6.22701 9.86627 6.42986L8.89148 9.14682C8.88787 9.15537 8.88237 9.16904 8.87936 9.17759L8.02413 11.5497C7.97244 11.6929 8.00795 11.8471 8.12 11.9662C8.23175 12.0849 8.4066 12.1547 8.59231 12.1547C8.59275 12.1547 11.7233 12.1499 11.7233 12.1499H15.1739C15.7168 12.1499 16.1548 12.3102 16.4402 12.6136C16.7338 12.9256 16.8103 13.3609 16.6503 13.8078L16.4532 14.3587C16.402 14.5016 16.4376 14.6554 16.5494 14.7743C16.6611 14.893 16.836 14.9628 17.0217 14.9628H17.6491C17.9127 14.9628 18.1446 14.8229 18.2175 14.6201L18.5896 13.5832C18.5932 13.5746 19.97 9.75861 19.97 9.75861C20.2975 8.84362 21.4923 8.10004 22.6339 8.10004H24.837C25.1008 8.10004 25.3328 7.96011 25.4055 7.75681L26.1371 5.7129C26.4646 4.79884 27.6595 4.05502 28.8008 4.05502H32.252C32.7949 4.05502 33.2329 4.21531 33.5183 4.51875C33.8119 4.83076 33.8886 5.26605 33.7286 5.71266L33.0902 7.4959C33.039 7.63884 33.0746 7.79264 33.1864 7.91153C33.2981 8.03019 33.473 8.10004 33.6587 8.10004H35.5346C36.0775 8.10004 36.5155 8.26033 36.8009 8.56377C37.0945 8.87578 37.171 9.31107 37.0109 9.75792L35.358 14.3583C35.3066 14.5012 35.3421 14.6552 35.4539 14.7741C35.5655 14.893 35.7405 14.9629 35.9264 14.9629H36.5478C36.8113 14.9629 37.0431 14.8232 37.1161 14.6203L37.8943 12.4582C37.897 12.4518 37.9039 12.4344 37.9064 12.4279L39.9245 6.83398C39.9283 6.82519 39.9339 6.81108 39.9371 6.80229L40.3307 5.70852C40.6582 4.79377 41.853 4.04995 42.9944 4.04995H51.1684C51.7112 4.04995 52.1491 4.21045 52.4347 4.51392C52.7283 4.82569 52.8049 5.26098 52.6449 5.70759L52.0047 7.49569C51.9535 7.63886 51.9891 7.79266 52.1009 7.91132C52.2126 8.03022 52.3875 8.10006 52.5732 8.10006H53.2179C53.4817 8.10006 53.7137 7.96013 53.7864 7.75707L54.5181 5.71292C54.8455 4.79886 56.0403 4.05504 57.1817 4.05504H60.6331C61.176 4.05504 61.6139 4.21533 61.8994 4.51877C62.1929 4.83079 62.2695 5.26607 62.1095 5.71292L61.4713 7.49593C61.42 7.63886 61.4557 7.79266 61.5674 7.91156C61.6792 8.03021 61.854 8.10006 62.0397 8.10006H63.8826C64.4255 8.10006 64.8634 8.26035 65.1489 8.56379C65.4423 8.87581 65.519 9.3111 65.359 9.75771L65.1626 10.3066C65.1113 10.4495 65.147 10.6033 65.2587 10.7222C65.3705 10.8408 65.5453 10.9107 65.731 10.9107H66.3563C66.6196 10.9107 66.8512 10.7712 66.9245 10.5686L68.6786 5.70878C69.0061 4.79355 70.201 4.04997 71.3424 4.04997H73.5612C73.825 4.04997 74.0569 3.91005 74.1297 3.70698L74.8635 1.65798C75.1907 0.743679 76.3855 9.47361e-05 77.5269 9.47361e-05H80.9783C81.5213 9.47361e-05 81.9593 0.160388 82.2447 0.463828C82.5383 0.775842 82.6148 1.21113 82.4547 1.65798L81.465 4.42259C81.1378 5.33665 79.943 6.08024 78.8016 6.08024H76.5826C76.3188 6.08024 76.0867 6.22016 76.0141 6.42347L75.6302 7.49595C75.5789 7.63888 75.6146 7.79269 75.7264 7.91158C75.8381 8.03024 76.013 8.10008 76.1987 8.10008H78.0545C78.5974 8.10008 79.0354 8.26038 79.3208 8.56382C79.6144 8.87559 79.6909 9.31088 79.5309 9.75773L79.3345 10.3066C79.2833 10.4495 79.3189 10.6033 79.4307 10.7222C79.5424 10.8409 79.7173 10.9107 79.903 10.9107H80.5305C80.794 10.9107 81.0256 10.7712 81.0987 10.5684L82.8504 5.70878C83.1782 4.79379 84.373 4.04997 85.5143 4.04997H88.9658C89.5087 4.04997 89.9467 4.21026 90.2321 4.5137C90.5257 4.82572 90.6022 5.26101 90.4421 5.70785L88.8841 10.0468C88.8802 10.0554 88.8749 10.0691 88.8717 10.0778L88.7048 10.542C88.6534 10.6852 88.6887 10.8393 88.8005 10.9581C88.9122 11.077 89.0872 11.1469 89.2731 11.1469H89.8905C90.154 11.1469 90.3857 11.0072 90.4588 10.8046L92.2943 5.7088C92.6219 4.79382 93.8167 4.04999 94.9582 4.04999H98.4095C98.9523 4.04999 99.3902 4.2105 99.6758 4.51396C99.9694 4.82574 100.046 5.26103 99.8859 5.70788L95.9781 16.5718C95.6507 17.4865 94.4558 18.2301 93.3146 18.2301H91.0956C90.8318 18.2301 90.5997 18.3701 90.5271 18.5731L89.7934 20.6221C89.4662 21.5364 88.2714 22.28 87.13 22.28L83.6786 22.2799ZM27.8722 10.1351C27.6087 10.1351 27.377 10.2748 27.3039 10.4777L25.4625 15.5952C25.4111 15.7381 25.4465 15.8921 25.5582 16.011C25.67 16.1301 25.845 16.2 26.0308 16.2H26.6556C26.9191 16.2 27.1508 16.0603 27.2239 15.8575L29.0653 10.74C29.1167 10.597 29.0814 10.443 28.9696 10.3241C28.8579 10.205 28.6829 10.1351 28.497 10.1351H27.8722Z" fill="currentColor" />
1
+ <svg viewBox="0 0 173 48" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill="currentColor" d="M170.474 8.75283C170.474 8.75283 167.118 8.75283 164.685 8.75283C162.252 8.75283 160.206 10.3959 159.582 12.6326L156.526 23.2971C156.401 23.7157 156.008 24.0219 155.553 24.0219H154.474C153.912 24.0219 153.457 23.5658 153.457 23.0035C153.457 22.9036 153.469 22.8098 153.501 22.7161L156.563 12.0141C156.626 11.7891 156.663 11.558 156.663 11.3143C156.663 9.90238 155.522 8.75908 154.112 8.75908H148.354C145.922 8.75908 143.869 10.4084 143.252 12.6513L140.351 22.7911C140.226 23.2097 139.84 23.5221 139.378 23.5221H138.268C137.706 23.5221 137.251 23.066 137.251 22.5037C137.251 22.4037 137.263 22.31 137.288 22.2226L137.731 20.6794C137.787 20.4733 137.812 20.2546 137.812 20.0297C137.812 18.6177 136.671 17.4744 135.261 17.4744H131.849C131.288 17.4744 130.832 17.0183 130.832 16.4561C130.832 16.3624 130.845 16.2686 130.87 16.1812L131.512 13.9383C131.649 13.4697 132.08 13.1324 132.591 13.1324H135.904C138.318 13.1324 140.351 11.5143 140.994 9.30886L142.715 3.30496C142.778 3.08004 142.815 2.84264 142.815 2.59898C142.815 1.18704 141.674 0.0437327 140.264 0.0437327H134.581C132.167 0.0437327 130.134 1.66185 129.491 3.87348L128.325 7.94689C128.194 8.42171 127.757 8.76532 127.246 8.76532H123.858C121.432 8.76532 119.392 10.3959 118.762 12.6263L115.855 22.7786C115.737 23.2097 115.344 23.5283 114.876 23.5283H113.766C113.204 23.5283 112.749 23.0722 112.749 22.51C112.749 22.4162 112.761 22.3225 112.786 22.2351L113.229 20.6982C113.285 20.4857 113.316 20.2671 113.316 20.0359C113.316 18.624 112.175 17.4807 110.765 17.4807H107.378C106.817 17.4807 106.361 17.0246 106.361 16.4623C106.361 16.3561 106.374 16.2561 106.405 16.1624L107.584 12.0328C107.646 11.8079 107.684 11.5705 107.684 11.3268C107.684 9.91487 106.542 8.77157 105.132 8.77157H99.3749C96.9546 8.77157 94.9148 10.3959 94.2848 12.6138L93.1059 16.7372C92.9874 17.1683 92.5944 17.4807 92.1265 17.4807H90.9975C90.4361 17.4807 89.9807 17.0246 89.9807 16.4623C89.9807 16.3686 89.9932 16.2749 90.0181 16.1874L91.1971 12.064C91.2657 11.8329 91.3031 11.5892 91.3031 11.3331C91.3031 9.92112 90.1616 8.77782 88.7519 8.77782H74.8165C72.3838 8.77782 70.3378 10.4209 69.714 12.6576L64.312 31.5127C64.1935 31.9438 63.8005 32.2686 63.3265 32.2686H62.2099C61.6485 32.2686 61.1931 31.8126 61.1931 31.2503C61.1931 31.1628 61.2056 31.0754 61.2243 30.9941L64.1499 20.7669C64.2185 20.5357 64.2559 20.2921 64.2559 20.0422C64.2559 18.6302 63.1144 17.4869 61.7046 17.4869H58.2551C57.6937 17.4869 57.2383 17.0308 57.2383 16.4686C57.2383 16.3749 57.2508 16.2811 57.2758 16.1874L58.4485 12.0828C58.5233 11.8454 58.5608 11.5955 58.5608 11.3331C58.5608 9.92112 57.4192 8.77782 56.0095 8.77782H50.2457C47.8379 8.77782 45.8044 10.3897 45.1619 12.5951L44.0017 16.6435C43.8769 17.1246 43.4403 17.4807 42.9163 17.4807H39.5416C37.1089 17.4807 35.0628 19.1238 34.4391 21.3604L31.5322 31.5189C31.4137 31.95 31.0207 32.2624 30.5529 32.2624H29.5548C28.9934 32.2624 28.5381 31.8063 28.5381 31.244C28.5381 31.1503 28.5506 31.0566 28.5755 30.9629L28.9934 29.4947C29.0621 29.2636 29.0995 29.0199 29.0995 28.7638C29.0995 27.3456 27.9517 26.196 26.5357 26.196H15.0456C14.4281 26.2023 13.9228 25.7025 13.9228 25.084C13.9228 24.9715 13.9416 24.8653 13.9665 24.7653L17.0605 13.9695C17.1915 13.4947 17.6281 13.1449 18.1396 13.1449L29.6734 13.1324C32.1061 13.1324 34.1584 11.4893 34.7759 9.24639L36.51 3.22999C36.5662 3.01757 36.5974 2.78641 36.5974 2.55525C36.5974 1.1433 35.4558 0 34.0461 0H20.0921C17.6718 0 15.6258 1.63061 14.9957 3.8485L13.823 7.95314C13.6858 8.42171 13.2554 8.76532 12.7439 8.76532H9.39417C6.99261 8.76532 4.96531 10.3647 4.31658 12.5576L0.0935684 27.3081C0.0311901 27.5267 0 27.7642 0 28.0016C0 29.4198 1.14776 30.5693 2.56375 30.5693H5.85732C6.47487 30.5693 6.98013 31.0691 6.98013 31.6939C6.98013 31.8001 6.96766 31.9063 6.93647 32.0062L5.76999 36.0734C5.71385 36.2921 5.67642 36.517 5.67642 36.7481C5.67642 38.1601 6.81795 39.3034 8.2277 39.3034L22.188 39.2909C24.6145 39.2909 26.6605 37.654 27.2843 35.4237L27.6835 34.018C27.802 33.5869 28.195 33.2683 28.6628 33.2683H29.6609C30.2223 33.2683 30.6777 33.7243 30.6777 34.2866C30.6777 34.3866 30.6652 34.4803 30.634 34.574L30.2098 36.0484C30.1474 36.2671 30.1163 36.492 30.1163 36.7294C30.1163 38.1413 31.2578 39.2846 32.6675 39.2846H36.1358C36.6972 39.2846 37.1525 39.7407 37.1525 40.303C37.1525 40.403 37.14 40.4967 37.1089 40.5904L35.9112 44.7638C35.8488 44.9824 35.8176 45.2073 35.8176 45.4447C35.8176 46.8567 36.9591 48 38.3689 48H44.1327C46.5467 48 48.5802 46.3819 49.2227 44.1702L50.383 40.1156C50.5077 39.6345 50.9444 39.2846 51.4683 39.2846H54.8181C57.2259 39.2846 59.2656 37.6728 59.9019 35.4674L60.3136 34.0242C60.4321 33.5869 60.8251 33.2683 61.2992 33.2683H62.4157C62.9771 33.2683 63.4325 33.7243 63.4325 34.2866C63.4325 34.3803 63.42 34.474 63.3951 34.5615L62.9771 36.0109C62.9148 36.2358 62.8773 36.4732 62.8773 36.7169C62.8773 38.1288 64.0189 39.2722 65.4286 39.2722H71.1549C73.569 39.2784 75.6025 37.6665 76.245 35.4549L79.9253 22.5912C80.0501 22.1663 80.4368 21.854 80.9047 21.854H81.9838C82.5452 21.854 83.0006 22.31 83.0006 22.8723C83.0006 22.9723 82.9881 23.066 82.9632 23.1597L79.2766 36.0359C79.2142 36.2546 79.183 36.4857 79.183 36.7232C79.183 38.1351 80.3245 39.2784 81.7343 39.2784H87.5043C89.9121 39.2784 91.9394 37.6728 92.5881 35.4736L96.2747 22.5912C96.3932 22.1663 96.7862 21.8477 97.254 21.8477H98.3456C98.907 21.8477 99.3624 22.3038 99.3624 22.8661C99.3624 22.966 99.3499 23.0597 99.325 23.1472L95.6446 36.0047C95.5823 36.2296 95.5449 36.467 95.5449 36.7169C95.5449 38.1288 96.6864 39.2722 98.0961 39.2722H103.866C106.286 39.2722 108.326 37.6478 108.956 35.4299L111.869 25.2651C111.994 24.8403 112.381 24.5342 112.849 24.5342H113.959C114.52 24.5342 114.976 24.9902 114.976 25.5525C114.976 25.6525 114.963 25.7524 114.932 25.8399L109.524 44.7325C109.461 44.9512 109.43 45.1886 109.43 45.426C109.43 46.838 110.572 47.9813 111.982 47.9813H117.739C120.159 47.9813 122.205 46.3506 122.835 44.1328L126.491 31.3565C126.628 30.8879 127.058 30.5443 127.57 30.5443H130.882C133.29 30.5443 135.317 28.9387 135.966 26.7333L136.384 25.2776C136.502 24.8465 136.895 24.5279 137.363 24.5279H138.474C139.035 24.5279 139.49 24.984 139.49 25.5463C139.49 25.64 139.478 25.7274 139.453 25.8149L139.035 27.2831C138.973 27.508 138.935 27.7454 138.935 27.9891C138.935 29.401 140.077 30.5443 141.486 30.5443L153.076 30.5568C153.638 30.5568 154.093 31.0129 154.093 31.5752C154.093 31.6751 154.081 31.7751 154.049 31.8626L153.394 34.1492C153.276 34.5802 152.883 34.8926 152.415 34.8926H148.934C146.508 34.8926 144.468 36.5232 143.838 38.7474L142.135 44.7013C142.067 44.9324 142.029 45.1699 142.029 45.426C142.029 46.838 143.171 47.9813 144.58 47.9813H150.338C152.758 47.9813 154.798 46.3569 155.428 44.139L156.607 40.0281C156.719 39.5908 157.118 39.2722 157.593 39.2722H161.111C163.518 39.2722 165.546 37.6665 166.195 35.4611L172.9 12.0266C172.969 11.8016 173 11.558 173 11.3081C173 9.89613 171.858 8.75283 170.449 8.75283H170.474ZM50.2707 23.1347L47.1081 34.1804C46.9833 34.599 46.5904 34.8989 46.135 34.8989H45.0621C44.5007 34.8989 44.0453 34.4428 44.0453 33.8805C44.0453 33.793 44.0578 33.7056 44.0765 33.6244L47.2391 22.5912C47.3576 22.1601 47.7506 21.8477 48.2184 21.8477H49.2851C49.8465 21.8477 50.3019 22.3038 50.3019 22.8661C50.3019 22.9598 50.2894 23.0535 50.2644 23.141L50.2707 23.1347Z" />
3
3
  </svg>
@@ -0,0 +1,54 @@
1
+ const PLAN_COLORS = {
2
+ FREE: { lightness: 0.45, chroma: 0.016, hue: 240, hueRange: 0 },
3
+ CREATOR: { lightness: 0.53, chroma: 0.085, hue: 210, hueRange: 14 },
4
+ PRO: { lightness: 0.52, chroma: 0.14, hue: 295, hueRange: 14 },
5
+ TEAM: { lightness: 0.52, chroma: 0.1, hue: 155, hueRange: 14 },
6
+ ENTERPRISE: { lightness: 0.66, chroma: 0.16, hue: 345, hueRange: 12 }
7
+ } as const
8
+
9
+ type AvatarPlan = keyof typeof PLAN_COLORS
10
+
11
+ const NAME_VARIATIONS = [-1, -0.5, 0, 0.5, 1] as const
12
+
13
+ /** Solid Polar plan color for a workspace avatar; neutral when the tier is unavailable. */
14
+ export function workspaceAvatarStyle(
15
+ workspaceName: string,
16
+ subscriptionTier: string | null | undefined
17
+ ): { backgroundColor?: string; color?: string } {
18
+ if (subscriptionTier === undefined) return {}
19
+
20
+ const plan = resolveAvatarPlan(subscriptionTier)
21
+ const base = PLAN_COLORS[plan]
22
+ const variation =
23
+ NAME_VARIATIONS[nameHash(workspaceName) % NAME_VARIATIONS.length] ?? 0
24
+ const lightnessStep = base.hueRange ? 0.025 : 0.055
25
+ const lightness = (base.lightness + variation * lightnessStep).toFixed(3)
26
+ const chroma = (base.chroma + variation * 0.006).toFixed(3)
27
+ const hue = Math.round(base.hue + variation * base.hueRange)
28
+
29
+ return {
30
+ backgroundColor: `oklch(${lightness} ${chroma} ${hue})`,
31
+ color:
32
+ plan === 'ENTERPRISE' ? 'var(--color-charcoal-800)' : 'var(--color-white)'
33
+ }
34
+ }
35
+
36
+ function resolveAvatarPlan(tier: string | null): AvatarPlan {
37
+ if (tier === 'STANDARD' || tier === 'FOUNDERS_EDITION') return 'CREATOR'
38
+ return tier && isAvatarPlan(tier) ? tier : 'FREE'
39
+ }
40
+
41
+ function isAvatarPlan(tier: string): tier is AvatarPlan {
42
+ return Object.hasOwn(PLAN_COLORS, tier)
43
+ }
44
+
45
+ function nameHash(name: string): number {
46
+ const characters = Array.from(name.normalize('NFKC').trim().toLowerCase())
47
+ return (
48
+ characters.reduce(
49
+ (hash, character) =>
50
+ Math.imul(hash ^ (character.codePointAt(0) ?? 0), 16777619),
51
+ 2166136261
52
+ ) >>> 0
53
+ )
54
+ }
@@ -1,3 +0,0 @@
1
- <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2
- <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0zm-13.239 0a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0zm6.619 6.619a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0zm0-13.238a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z"/>
3
- </svg>