@dumiflex/wp-kit 0.11.0 → 0.12.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 +7 -0
- package/package.json +1 -1
- package/src/Input.vue +8 -1
- package/src/Textarea.vue +6 -0
- package/src/input.css +26 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.12.0](https://github.com/DumiFlex/wp-kit/compare/v0.11.0...v0.12.0) (2026-11-03)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* Input and Textarea take mono and an accent / warn tone, and size themselves border-box ([#98](https://github.com/DumiFlex/wp-kit/issues/98)) ([7b1023f](https://github.com/DumiFlex/wp-kit/commit/7b1023f699e7f9b37904abf0200ed805f1db23a7))
|
|
9
|
+
|
|
3
10
|
## [0.11.0](https://github.com/DumiFlex/wp-kit/compare/v0.10.0...v0.11.0) (2026-11-03)
|
|
4
11
|
|
|
5
12
|
|
package/package.json
CHANGED
package/src/Input.vue
CHANGED
|
@@ -24,6 +24,10 @@ interface Props {
|
|
|
24
24
|
suffix?: string | undefined;
|
|
25
25
|
id?: string | undefined;
|
|
26
26
|
ariaLabel?: string | undefined;
|
|
27
|
+
/** Mono text: variable names, ids, tags. */
|
|
28
|
+
mono?: boolean | undefined;
|
|
29
|
+
/** "accent" marks a value changed from its default, "warn" one that needs a look. */
|
|
30
|
+
tone?: "accent" | "warn" | undefined;
|
|
27
31
|
}
|
|
28
32
|
const props = withDefaults(defineProps<Props>(), {
|
|
29
33
|
type: "text",
|
|
@@ -57,7 +61,7 @@ function onInput(e: Event) {
|
|
|
57
61
|
</script>
|
|
58
62
|
|
|
59
63
|
<template>
|
|
60
|
-
<div v-if="wrapped" :class="groupClasses" :aria-invalid="error || undefined">
|
|
64
|
+
<div v-if="wrapped" :class="groupClasses" :aria-invalid="error || undefined" :data-tone="tone">
|
|
61
65
|
<span v-if="icon" class="wp-input-group__icon" aria-hidden="true">
|
|
62
66
|
<Icon :name="icon" />
|
|
63
67
|
</span>
|
|
@@ -65,6 +69,7 @@ function onInput(e: Event) {
|
|
|
65
69
|
<input
|
|
66
70
|
:id="id"
|
|
67
71
|
:class="inputClasses"
|
|
72
|
+
:data-mono="mono || undefined"
|
|
68
73
|
:type="type"
|
|
69
74
|
:value="modelValue"
|
|
70
75
|
:placeholder="placeholder"
|
|
@@ -85,6 +90,8 @@ function onInput(e: Event) {
|
|
|
85
90
|
v-else
|
|
86
91
|
:id="id"
|
|
87
92
|
:class="inputClasses"
|
|
93
|
+
:data-mono="mono || undefined"
|
|
94
|
+
:data-tone="tone"
|
|
88
95
|
:type="type"
|
|
89
96
|
:value="modelValue"
|
|
90
97
|
:placeholder="placeholder"
|
package/src/Textarea.vue
CHANGED
|
@@ -10,6 +10,10 @@ interface Props {
|
|
|
10
10
|
error?: boolean | undefined;
|
|
11
11
|
id?: string | undefined;
|
|
12
12
|
ariaLabel?: string | undefined;
|
|
13
|
+
/** Mono text: templates, tag lists. */
|
|
14
|
+
mono?: boolean | undefined;
|
|
15
|
+
/** "accent" marks a value changed from its default, "warn" one that needs a look. */
|
|
16
|
+
tone?: "accent" | "warn" | undefined;
|
|
13
17
|
}
|
|
14
18
|
const props = withDefaults(defineProps<Props>(), { rows: 3 });
|
|
15
19
|
|
|
@@ -44,6 +48,8 @@ watch(() => props.modelValue, () => {
|
|
|
44
48
|
:id="id"
|
|
45
49
|
ref="taRef"
|
|
46
50
|
class="wp-textarea"
|
|
51
|
+
:data-mono="mono || undefined"
|
|
52
|
+
:data-tone="tone"
|
|
47
53
|
:rows="rows"
|
|
48
54
|
:value="modelValue"
|
|
49
55
|
:placeholder="placeholder"
|
package/src/input.css
CHANGED
|
@@ -3,7 +3,15 @@
|
|
|
3
3
|
* Scoped into Input.vue and Textarea.vue so a field looks right on the
|
|
4
4
|
* canvas, which never loads theme/tokens.css; the theme imports it too so
|
|
5
5
|
* a page can still write `.wp-input-group` around another field. Shared
|
|
6
|
-
* tokens only. The other field pieces draw field.css' `.wp-field-box`.
|
|
6
|
+
* tokens only. The other field pieces draw field.css' `.wp-field-box`.
|
|
7
|
+
*
|
|
8
|
+
* `data-mono` sets the text in the mono face (variable names, ids, tags);
|
|
9
|
+
* `data-tone="accent"` marks a value changed from its default (accent border
|
|
10
|
+
* and text), `data-tone="warn"` one that needs a look (an empty binding). */
|
|
11
|
+
|
|
12
|
+
.wp-input,
|
|
13
|
+
.wp-textarea,
|
|
14
|
+
.wp-input-group { box-sizing: border-box; }
|
|
7
15
|
|
|
8
16
|
.wp-input,
|
|
9
17
|
.wp-textarea {
|
|
@@ -111,3 +119,20 @@
|
|
|
111
119
|
flex: 1;
|
|
112
120
|
}
|
|
113
121
|
.wp-input-group .wp-input:focus { box-shadow: none; }
|
|
122
|
+
|
|
123
|
+
/* Mono text and tones (see the top of this file). On a prefixed field the
|
|
124
|
+
* group draws the border, so the tone sits on the group. */
|
|
125
|
+
.wp-input[data-mono],
|
|
126
|
+
.wp-textarea[data-mono] { font-family: var(--wp-font-mono); font-size: 12px; }
|
|
127
|
+
.wp-input--sm[data-mono] { font-size: 11px; }
|
|
128
|
+
.wp-input[data-tone="accent"],
|
|
129
|
+
.wp-textarea[data-tone="accent"],
|
|
130
|
+
.wp-input-group[data-tone="accent"] { border-color: var(--wp-accent-500); }
|
|
131
|
+
.wp-input[data-tone="accent"],
|
|
132
|
+
.wp-textarea[data-tone="accent"],
|
|
133
|
+
.wp-input-group[data-tone="accent"] .wp-input,
|
|
134
|
+
.wp-input-group[data-tone="accent"] .wp-input-group__affix { color: var(--wp-accent-text); }
|
|
135
|
+
.wp-input[data-tone="warn"],
|
|
136
|
+
.wp-textarea[data-tone="warn"],
|
|
137
|
+
.wp-input-group[data-tone="warn"] { border-color: var(--wp-warn); }
|
|
138
|
+
.wp-input-group[data-tone="warn"] .wp-input-group__affix { color: var(--wp-warn); }
|