wings-plugin-ui 0.5.0 → 0.6.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.
Files changed (3) hide show
  1. package/README.md +2 -0
  2. package/package.json +1 -1
  3. package/plugin-ui.css +57 -33
package/README.md CHANGED
@@ -123,6 +123,8 @@ page has:
123
123
  | `--wings-menu-bg`, `--wings-menu-ring`, `--wings-menu-active`, `--wings-shadow` | A raised layer like a menu or a list of suggestions, as Wings' own menus draw it: its opaque background, its edge, the highlighted option and its shadow |
124
124
  | `--wings-font`, `--wings-mono` | Fonts |
125
125
 
126
+ The colours, radius and font come from the Wings app's theme (`apps/desktop/src/index.css`), copied into the generated block at the top of `plugin-ui.css` by `pnpm tokens` in `apps/desktop`; edit the theme there, not the block. The file keeps those values, so the package works on its own.
127
+
126
128
  ```tsx
127
129
  // src/sidebar.tsx
128
130
  import "./sidebar.css";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wings-plugin-ui",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "React components and the stylesheet for Wings plugin pages, on Base UI like the Wings app's shadcn/ui components.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/plugin-ui.css CHANGED
@@ -9,26 +9,37 @@
9
9
  @layer wings-base, theme, base, wings-components, components, utilities;
10
10
 
11
11
  @layer wings-base {
12
+ /* tokens:start (generated from apps/desktop/src/index.css by apps/desktop/scripts/plugin-tokens.mjs, do not edit) */
12
13
  :root {
13
- color-scheme: dark;
14
- --wings-bg: transparent;
15
- --wings-surface: rgb(255 255 255 / 0.04);
16
14
  --wings-fg: #ece9e4;
17
15
  --wings-muted: #9d978f;
18
16
  --wings-hover: rgb(255 255 255 / 0.06);
19
- --wings-pressed: rgb(255 255 255 / 0.1);
17
+ --wings-pressed: rgb(255 255 255 / 0.10);
20
18
  --wings-hairline: rgb(255 255 255 / 0.07);
21
19
  --wings-hairline-strong: rgb(255 255 255 / 0.16);
22
- --wings-input: rgb(255 255 255 / 0.06);
23
20
  --wings-ring: rgb(255 255 255 / 0.32);
24
21
  --wings-primary: #ece9e4;
25
22
  --wings-primary-fg: #17151a;
26
- --wings-info: #9cc0ff;
27
23
  --wings-success: #7dd3a7;
28
24
  --wings-warning: #e9b65f;
29
25
  --wings-danger: #f2786a;
30
- --wings-radius: 10px;
26
+ --wings-secondary: rgb(255 255 255 / 0.08);
27
+ --wings-border: rgb(255 255 255 / 0.08);
28
+ --wings-control-border: rgb(255 255 255 / 0.10);
29
+ --wings-menu-bg: rgb(32 29 35);
30
+ --wings-menu-active: rgb(255 255 255 / 0.08);
31
+ --wings-accent-fg: #f4f1ec;
32
+ --wings-radius: 0.625rem;
31
33
  --wings-font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Ubuntu, sans-serif;
34
+ }
35
+ /* tokens:end */
36
+
37
+ :root {
38
+ color-scheme: dark;
39
+ --wings-bg: transparent;
40
+ --wings-surface: rgb(255 255 255 / 0.04);
41
+ --wings-input: rgb(255 255 255 / 0.06);
42
+ --wings-info: #9cc0ff;
32
43
  --wings-mono: ui-monospace, "SF Mono", Menlo, monospace;
33
44
  }
34
45
 
@@ -164,16 +175,12 @@ textarea::placeholder {
164
175
  /* Raised layers, like a list of suggestions or a menu, as Wings' own menus draw them, and the controls as the app's
165
176
  own shadcn/ui ones do. */
166
177
  :root {
167
- --wings-menu-bg: rgb(32 29 35);
168
- --wings-menu-ring: rgb(236 233 228 / 0.1);
169
- --wings-menu-active: rgb(255 255 255 / 0.08);
178
+ --wings-menu-ring: color-mix(in srgb, var(--wings-fg) 10%, transparent);
179
+ --wings-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
170
180
  --wings-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
171
- --wings-border: rgb(255 255 255 / 0.08);
172
- --wings-control-border: rgb(255 255 255 / 0.1);
173
- --wings-control-bg: rgb(255 255 255 / 0.03);
174
- --wings-control-bg-hover: rgb(255 255 255 / 0.05);
175
- --wings-secondary: rgb(255 255 255 / 0.08);
176
- --wings-ring-soft: rgb(255 255 255 / 0.16);
181
+ --wings-control-bg: color-mix(in srgb, var(--wings-control-border) 30%, transparent);
182
+ --wings-control-bg-hover: color-mix(in srgb, var(--wings-control-border) 50%, transparent);
183
+ --wings-ring-soft: color-mix(in srgb, var(--wings-ring) 50%, transparent);
177
184
  --wings-radius-sm: calc(var(--wings-radius) * 0.6);
178
185
  --wings-radius-md: calc(var(--wings-radius) * 0.8);
179
186
  }
@@ -947,50 +954,50 @@ textarea::placeholder {
947
954
  transform 100ms;
948
955
  }
949
956
  .w-button[data-variant="default"]:hover {
950
- background: color-mix(in srgb, var(--wings-primary) 80%, transparent);
957
+ background-color: color-mix(in srgb, var(--wings-primary) 80%, transparent);
951
958
  }
952
959
  .w-button[data-variant="secondary"] {
953
- background: var(--wings-secondary);
960
+ background-color: var(--wings-secondary);
954
961
  color: var(--wings-fg);
955
962
  }
956
963
  .w-button[data-variant="secondary"]:hover {
957
- background: color-mix(in srgb, var(--wings-secondary), var(--wings-fg) 5%);
964
+ background-color: color-mix(in srgb, var(--wings-secondary), var(--wings-fg) 5%);
958
965
  }
959
966
  .w-button[data-variant="outline"] {
960
967
  border-color: var(--wings-control-border);
961
- background: var(--wings-control-bg);
968
+ background-color: var(--wings-control-bg);
962
969
  color: var(--wings-fg);
963
970
  }
964
971
  .w-button[data-variant="outline"]:hover {
965
- background: var(--wings-control-bg-hover);
972
+ background-color: var(--wings-control-bg-hover);
966
973
  }
967
974
  .w-button[data-variant="outline"][aria-expanded="true"] {
968
- background: var(--wings-hover);
975
+ background-color: var(--wings-hover);
969
976
  }
970
977
  .w-button[data-variant="ghost"] {
971
- background: transparent;
978
+ background-color: transparent;
972
979
  color: var(--wings-fg);
973
980
  }
974
981
  .w-button[data-variant="ghost"]:hover {
975
- background: color-mix(in srgb, var(--wings-hover) 50%, transparent);
982
+ background-color: color-mix(in srgb, var(--wings-hover) 50%, transparent);
976
983
  }
977
984
  .w-button[data-variant="ghost"][aria-expanded="true"] {
978
- background: var(--wings-hover);
985
+ background-color: var(--wings-hover);
979
986
  }
980
987
  .w-button[data-variant="destructive"] {
981
- background: color-mix(in srgb, var(--wings-danger) 20%, transparent);
988
+ background-color: color-mix(in srgb, var(--wings-danger) 20%, transparent);
982
989
  color: var(--wings-danger);
983
990
  }
984
991
  .w-button[data-variant="destructive"]:hover {
985
- background: color-mix(in srgb, var(--wings-danger) 30%, transparent);
992
+ background-color: color-mix(in srgb, var(--wings-danger) 30%, transparent);
986
993
  }
987
994
  .w-button[data-variant="link"] {
988
- background: transparent;
995
+ background-color: transparent;
989
996
  color: var(--wings-primary);
990
997
  text-underline-offset: 4px;
991
998
  }
992
999
  .w-button[data-variant="link"]:hover {
993
- background: transparent;
1000
+ background-color: transparent;
994
1001
  text-decoration: underline;
995
1002
  }
996
1003
  .w-button[data-size="xs"] {
@@ -999,6 +1006,7 @@ textarea::placeholder {
999
1006
  padding: 0 8px;
1000
1007
  border-radius: var(--wings-radius-md);
1001
1008
  font-size: 12px;
1009
+ line-height: 16px;
1002
1010
  }
1003
1011
  .w-button[data-size="sm"] {
1004
1012
  gap: 4px;
@@ -1006,6 +1014,7 @@ textarea::placeholder {
1006
1014
  padding: 0 10px;
1007
1015
  border-radius: var(--wings-radius-md);
1008
1016
  font-size: 12.8px;
1017
+ line-height: 1.5;
1009
1018
  }
1010
1019
  .w-button[data-size="lg"] {
1011
1020
  height: 36px;
@@ -1073,12 +1082,13 @@ textarea::placeholder {
1073
1082
  min-width: 28px;
1074
1083
  height: 28px;
1075
1084
  padding: 0 10px;
1076
- border: 1px solid transparent;
1085
+ border: 0;
1077
1086
  border-radius: var(--wings-radius-md);
1078
1087
  background: transparent;
1079
1088
  color: var(--wings-fg);
1080
1089
  font-size: 12.8px;
1081
1090
  font-weight: 500;
1091
+ line-height: 1.5;
1082
1092
  white-space: nowrap;
1083
1093
  cursor: pointer;
1084
1094
  outline: none;
@@ -1160,7 +1170,7 @@ textarea::placeholder {
1160
1170
  border-color: var(--wings-control-border);
1161
1171
  background: var(--wings-control-bg);
1162
1172
  color: var(--wings-fg);
1163
- box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
1173
+ box-shadow: var(--wings-shadow-sm);
1164
1174
  }
1165
1175
  .w-tabs[data-variant="line"] > .w-tab[data-active] {
1166
1176
  border-color: transparent;
@@ -1263,7 +1273,7 @@ textarea::placeholder {
1263
1273
  .w-select {
1264
1274
  justify-content: space-between;
1265
1275
  gap: 6px;
1266
- padding: 0 8px 0 10px;
1276
+ padding: 8px 8px 8px 10px;
1267
1277
  text-align: left;
1268
1278
  white-space: nowrap;
1269
1279
  user-select: none;
@@ -1377,6 +1387,20 @@ textarea::placeholder {
1377
1387
  border-color: color-mix(in srgb, var(--wings-danger) 40%, transparent);
1378
1388
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--wings-danger) 40%, transparent);
1379
1389
  }
1390
+ /* The app's outline button and active tab keep their border on focus, since their dark border colour outranks the
1391
+ focus one there. */
1392
+ .w-button[data-variant="outline"]:focus-visible,
1393
+ .w-tab[data-active]:focus-visible {
1394
+ border-color: var(--wings-control-border);
1395
+ }
1396
+ .w-tab[data-active]:focus-visible {
1397
+ box-shadow:
1398
+ 0 0 0 3px var(--wings-ring-soft),
1399
+ var(--wings-shadow-sm);
1400
+ }
1401
+ .w-tabs[data-variant="line"] > .w-tab[data-active]:focus-visible {
1402
+ box-shadow: 0 0 0 3px var(--wings-ring-soft);
1403
+ }
1380
1404
  .w-tab:focus-visible {
1381
1405
  outline: 1px solid var(--wings-ring);
1382
1406
  }
@@ -1459,7 +1483,7 @@ textarea::placeholder {
1459
1483
  .w-option[data-highlighted],
1460
1484
  .w-menu-item[data-highlighted] {
1461
1485
  background: var(--wings-menu-active);
1462
- color: #f4f1ec;
1486
+ color: var(--wings-accent-fg);
1463
1487
  }
1464
1488
  .w-select-item[data-disabled],
1465
1489
  .w-menu-item[data-disabled] {