@dumiflex/wp-kit 0.13.0 → 0.15.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/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.15.0](https://github.com/DumiFlex/wp-kit/compare/v0.14.0...v0.15.0) (2026-11-09)
4
+
5
+
6
+ ### Features
7
+
8
+ * **post-card:** show a few sample values from the pack ([#111](https://github.com/DumiFlex/wp-kit/issues/111)) ([c01cdc2](https://github.com/DumiFlex/wp-kit/commit/c01cdc27db3c33c33c7ff59aa96b38473ac6e57e))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **preview:** weight multiplier wraps under the chance on narrow cards ([#110](https://github.com/DumiFlex/wp-kit/issues/110)) ([3ad37b8](https://github.com/DumiFlex/wp-kit/commit/3ad37b80c6f2cc724025b86d407ac9e383817767))
14
+
15
+ ## [0.14.0](https://github.com/DumiFlex/wp-kit/compare/v0.13.0...v0.14.0) (2026-11-03)
16
+
17
+
18
+ ### Features
19
+
20
+ * canvas controls at ComfyUI's own sizes ([#105](https://github.com/DumiFlex/wp-kit/issues/105)) ([22e6d62](https://github.com/DumiFlex/wp-kit/commit/22e6d62834d197ef4c4ce64a463fbbbe50f75610))
21
+
3
22
  ## [0.13.0](https://github.com/DumiFlex/wp-kit/compare/v0.12.0...v0.13.0) (2026-11-03)
4
23
 
5
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dumiflex/wp-kit",
3
- "version": "0.13.0",
3
+ "version": "0.15.0",
4
4
  "description": "Vue 3 component kit shared by the Wildcard Pipeline manager, canvas and community site.",
5
5
  "keywords": [
6
6
  "vue",
package/src/Checkbox.vue CHANGED
@@ -8,8 +8,9 @@
8
8
  * <Checkbox v-model="favorites" field label="Favorites only" />
9
9
  *
10
10
  * Box: a `<button role="checkbox">`, so a wrapping `<label>` ticks it like an
11
- * input. Click, Space and Enter toggle. `size="sm"` is the 12px box of the
12
- * canvas rows' on/off mark; md is 14px. A parent can tint the checked fill
11
+ * input. Click, Space and Enter toggle. `size="sm"` is the 14px box of the
12
+ * canvas rows' on/off mark; md is 16px (ComfyUI's own box). Either takes a
13
+ * 24px click around it, so a lone box is as easy to hit as a native row. A parent can tint the checked fill
13
14
  * with `--check-on` (a bundle header uses its bundle colour).
14
15
  *
15
16
  * Without a label the box is the root: `class`, `title`, `data-test` and a
@@ -170,8 +171,9 @@ function toggle(): void {
170
171
  .wp-check {
171
172
  appearance: none;
172
173
  box-sizing: border-box;
173
- width: 14px;
174
- height: 14px;
174
+ position: relative;
175
+ width: 16px;
176
+ height: 16px;
175
177
  flex-shrink: 0;
176
178
  display: inline-flex;
177
179
  align-items: center;
@@ -188,9 +190,12 @@ function toggle(): void {
188
190
  cursor: pointer;
189
191
  transition: background var(--wp-motion-quick), border-color var(--wp-motion-quick), color var(--wp-motion-quick);
190
192
  }
191
- .wp-check svg { width: 9px; height: 9px; display: block; pointer-events: none; }
192
- .wp-check--sm { width: 12px; height: 12px; border-width: 1px; border-radius: min(2px, var(--wp-radius-cap, 999px)); }
193
- .wp-check--sm svg { width: 7px; height: 7px; }
193
+ .wp-check svg { width: 10px; height: 10px; display: block; pointer-events: none; }
194
+ /* The click reaches 24 x 24 around the box (::before is the TUI look's [x]). */
195
+ .wp-check::after { content: ""; position: absolute; inset: -4px; }
196
+ .wp-check--sm { width: 14px; height: 14px; border-width: 1px; border-radius: min(2px, var(--wp-radius-cap, 999px)); }
197
+ .wp-check--sm::after { inset: -5px; }
198
+ .wp-check--sm svg { width: 8px; height: 8px; }
194
199
  .wp-check:focus-visible { outline: none; box-shadow: var(--wp-focus-ring); }
195
200
  .wp-check:where(:not(:disabled, [aria-checked="true"], [aria-checked="mixed"]):hover) { border-color: var(--wp-accent-500); }
196
201
  .wp-check:where([aria-invalid="true"]) { border-color: var(--wp-error-border); }
package/src/PostCard.vue CHANGED
@@ -1,8 +1,8 @@
1
1
  <script setup lang="ts">
2
2
  /**
3
3
  * A community post as a card: type chip, NSFW / Featured / recommended
4
- * badges, version, `owner/name` slug, bundle contents, description, up to
5
- * four tags, then stars, downloads and when it was updated. A coloured stripe
4
+ * badges, version, `owner/name` slug, bundle contents, a few sample values
5
+ * from the pack, description, up to four tags, then stars, downloads and when it was updated. A coloured stripe
6
6
  * on top says the type; a featured card is tinted, a deleted one faded.
7
7
  *
8
8
  * The whole card is one link. It renders an `<a>` by default; pass the app's
@@ -38,6 +38,8 @@ export interface PostCardData {
38
38
  deleted?: boolean | undefined;
39
39
  version?: number | null | undefined;
40
40
  bundleModules?: { count: number; names: string[] } | null | undefined;
41
+ /** A few values the pack rolls (its options), shown as "what it makes". */
42
+ samples?: string[] | undefined;
41
43
  }
42
44
 
43
45
  const props = withDefaults(defineProps<{
@@ -52,6 +54,7 @@ const type = computed(() => itemType(props.post.kind, props.post.subtype));
52
54
  const owner = computed(() => props.post.slug.split("/")[0]);
53
55
  const name = computed(() => props.post.slug.split("/").slice(1).join("/"));
54
56
  const tags = computed(() => props.post.tags ?? []);
57
+ const samples = computed(() => (props.post.samples ?? []).filter((v) => v.trim()).slice(0, 4));
55
58
  </script>
56
59
 
57
60
  <template>
@@ -83,6 +86,10 @@ const tags = computed(() => props.post.tags ?? []);
83
86
  :names="post.bundleModules.names"
84
87
  />
85
88
 
89
+ <ul v-if="samples.length" class="wp-post-card__samples" aria-label="Sample values">
90
+ <li v-for="(v, i) in samples" :key="i" class="wp-post-card__sample">{{ v }}</li>
91
+ </ul>
92
+
86
93
  <p v-if="post.description" class="wp-post-card__desc">{{ post.description }}</p>
87
94
 
88
95
  <div v-if="tags.length" class="wp-post-card__tags">
@@ -185,6 +192,28 @@ const tags = computed(() => props.post.tags ?? []);
185
192
  -webkit-line-clamp: 3;
186
193
  -webkit-box-orient: vertical;
187
194
  }
195
+ .wp-post-card__samples {
196
+ display: flex;
197
+ flex-wrap: wrap;
198
+ gap: 5px;
199
+ margin: 0;
200
+ padding: 0;
201
+ list-style: none;
202
+ }
203
+ .wp-post-card__sample {
204
+ max-width: 100%;
205
+ overflow: hidden;
206
+ padding: 3px 9px;
207
+ font-family: var(--wp-font-mono);
208
+ font-size: 12px;
209
+ line-height: 1.4;
210
+ color: var(--wp-text);
211
+ white-space: nowrap;
212
+ text-overflow: ellipsis;
213
+ background: color-mix(in oklab, var(--post-card-c) 12%, var(--wp-bg-2));
214
+ border: 1px solid color-mix(in oklab, var(--post-card-c) 28%, var(--wp-border));
215
+ border-radius: min(6px, var(--wp-radius-cap, 999px));
216
+ }
188
217
  .wp-post-card__tags { display: flex; flex-wrap: wrap; gap: 4px; }
189
218
  .wp-post-card__tags .wp-chip { padding: 2px 8px; font-size: 11px; }
190
219
  .wp-post-card__foot {
@@ -405,7 +405,10 @@ function isLong(o: WildcardOption): boolean {
405
405
  >{{ expanded.has(`${g.name}|${oidx}`) ? "Show less" : "Show all" }}</Button>
406
406
  </td>
407
407
  <td class="wp-wc__chance">
408
- <span>{{ totalWeight ? pct(Math.max(0, o.weight)) : "—" }}<template v-if="o.weight !== 1"> · ×{{ fmt(o.weight) }}</template></span>
408
+ <span>{{ totalWeight ? pct(Math.max(0, o.weight)) : "—" }}<span
409
+ v-if="o.weight !== 1"
410
+ class="wp-wc__mult"
411
+ ><span class="wp-wc__sep"> · </span>×{{ fmt(o.weight) }}</span></span>
409
412
  <span
410
413
  v-if="o.fallback"
411
414
  class="wp-pv-fbtag"
@@ -549,6 +552,13 @@ function isLong(o: WildcardOption): boolean {
549
552
  .wp-wc__col-chance {
550
553
  width: 56px;
551
554
  }
555
+ /* "29% · ×2" doesn't fit 56px: the weight goes on its own line. */
556
+ .wp-wc__mult {
557
+ display: block;
558
+ }
559
+ .wp-wc__sep {
560
+ display: none;
561
+ }
552
562
  .wp-wc__bar {
553
563
  display: none;
554
564
  }
@@ -58,6 +58,7 @@ const emit = defineEmits<{ click: [evt: MouseEvent] }>();
58
58
  display: inline-flex;
59
59
  align-items: center;
60
60
  justify-content: center;
61
+ position: relative;
61
62
  flex: none;
62
63
  box-sizing: border-box;
63
64
  width: 20px;
@@ -72,6 +73,9 @@ const emit = defineEmits<{ click: [evt: MouseEvent] }>();
72
73
  cursor: pointer;
73
74
  transition: background var(--wp-motion-quick), border-color var(--wp-motion-quick), color var(--wp-motion-quick);
74
75
  }
76
+ /* The drawn box stays 20 px (it lines up with ComfyUI's own icon-sm and our
77
+ rows); the click reaches 24 x 24, ComfyUI's row control size. */
78
+ .wp-icon-btn::after { content: ""; position: absolute; inset: -3px; }
75
79
  .wp-icon-btn[data-tone="accent"] { --tone: var(--wp-accent); }
76
80
  .wp-icon-btn[data-tone="warn"] { --tone: var(--wp-warn); }
77
81
  .wp-icon-btn[data-tone="danger"] { --tone: var(--wp-danger); }
package/src/WpNumber.vue CHANGED
@@ -142,13 +142,15 @@ function bump(dir: 1 | -1): void {
142
142
  <style scoped src="./field.css"></style>
143
143
 
144
144
  <style scoped>
145
+ /* Spinner columns sized so each arrow is a real target in the box
146
+ * (sm: 20 x 12 in a 24 px field, near ComfyUI's 24 px -/+ buttons). */
145
147
  .wp-cnum {
146
- --cnum-spin: 16px;
148
+ --cnum-spin: 20px;
147
149
  display: inline-flex; align-items: stretch; height: var(--wp-field-h); min-width: 0; overflow: hidden;
148
150
  font-family: var(--wp-font-mono);
149
151
  }
150
- .wp-cnum--md { --cnum-spin: 20px; }
151
- .wp-cnum--lg { --cnum-spin: 22px; }
152
+ .wp-cnum--md { --cnum-spin: 24px; }
153
+ .wp-cnum--lg { --cnum-spin: 28px; }
152
154
  .wp-cnum__field {
153
155
  flex: 1; min-width: 0; padding: 0 6px 0 8px; background: transparent; border: 0;
154
156
  color: var(--wp-text); font: inherit; text-align: right;
@@ -170,8 +172,8 @@ function bump(dir: 1 | -1): void {
170
172
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 0; border: 0;
171
173
  background: transparent; color: var(--wp-text-dim); cursor: pointer; line-height: 0;
172
174
  }
173
- .wp-cnum__btn .pi { font-size: 7px; }
174
- .wp-cnum--md .wp-cnum__btn .pi, .wp-cnum--lg .wp-cnum__btn .pi { font-size: 8px; }
175
+ .wp-cnum__btn .pi { font-size: 10px; }
176
+ .wp-cnum--md .wp-cnum__btn .pi, .wp-cnum--lg .wp-cnum__btn .pi { font-size: 10px; }
175
177
  .wp-cnum__btn + .wp-cnum__btn { border-top: 1px solid var(--wp-border); }
176
178
  .wp-cnum__btn:hover:not(:disabled) { color: var(--wp-accent-text); background: color-mix(in oklab, var(--wp-accent) 12%, transparent); }
177
179
  .wp-cnum__btn:disabled { cursor: not-allowed; }
@@ -127,7 +127,9 @@ function onKeydown(ev: KeyboardEvent): void {
127
127
  height: var(--wp-control-h-md);
128
128
  box-sizing: border-box;
129
129
  }
130
- .wp-segmented[data-size="sm"] { height: var(--wp-control-h-sm); border-radius: var(--wp-radius-sm); }
130
+ /* sm: a 1 px inset, so each option is 20 px tall in the 24 px box (a bigger
131
+ target in the same row, close to ComfyUI's 24 px toggle-group items). */
132
+ .wp-segmented[data-size="sm"] { height: var(--wp-control-h-sm); padding: 1px; border-radius: var(--wp-radius-sm); }
131
133
  .wp-segmented[data-size="lg"] { height: var(--wp-control-h-lg); }
132
134
  .wp-segmented__opt {
133
135
  display: inline-flex;
package/src/WpSwitch.vue CHANGED
@@ -64,12 +64,13 @@ function flip(): void {
64
64
  <style scoped>
65
65
  /* Two looks. track: a sliding knob, for a setting that takes effect at once.
66
66
  * chip: a labelled chip that lights up when on (Hide from prompt, Lock...).
67
- * Heights follow the control scale (sm 24 / md 32 / lg 40). */
67
+ * Heights follow the control scale (sm 24 / md 32 / lg 40). The sm track is
68
+ * ComfyUI's own Nodes 2.0 switch (36 x 20, 16 px knob, 24 px row). */
68
69
  .wp-switch {
69
70
  display: inline-flex;
70
71
  align-items: center;
71
72
  gap: var(--wp-space-3);
72
- min-height: 20px;
73
+ min-height: 24px;
73
74
  flex-shrink: 0;
74
75
  color: var(--wp-text-muted);
75
76
  font: var(--wp-text-xs) / 1 var(--wp-font-sans);
@@ -80,12 +81,12 @@ function flip(): void {
80
81
  }
81
82
  .wp-switch[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
82
83
  .wp-switch__label { color: var(--wp-text-muted); }
83
- .wp-switch--md, .wp-switch--lg { min-height: 24px; font-size: var(--wp-text-sm); }
84
+ .wp-switch--md, .wp-switch--lg { min-height: 32px; font-size: var(--wp-text-sm); }
84
85
 
85
86
  /* Track look */
86
87
  .wp-switch__track {
87
- --switch-w: 26px;
88
- --switch-h: 14px;
88
+ --switch-w: 36px;
89
+ --switch-h: 20px;
89
90
  position: relative;
90
91
  flex-shrink: 0;
91
92
  width: var(--switch-w);
@@ -98,8 +99,8 @@ function flip(): void {
98
99
  background: var(--wp-bg-3);
99
100
  transition: background var(--wp-motion-quick), border-color var(--wp-motion-quick);
100
101
  }
101
- .wp-switch--md .wp-switch__track { --switch-w: 32px; --switch-h: 18px; }
102
- .wp-switch--lg .wp-switch__track { --switch-w: 40px; --switch-h: 22px; }
102
+ .wp-switch--md .wp-switch__track { --switch-w: 40px; --switch-h: 22px; }
103
+ .wp-switch--lg .wp-switch__track { --switch-w: 48px; --switch-h: 26px; }
103
104
  .wp-switch__knob {
104
105
  position: absolute;
105
106
  top: 1px;