srcdev-nuxt-components 9.1.43 → 9.1.45
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/.claude/skills/components/display-avatar.md +187 -0
- package/.claude/skills/components/display-chip.md +213 -0
- package/.claude/skills/components/display-pill.md +162 -0
- package/.claude/skills/index.md +3 -0
- package/app/components/01.atoms/display-avatar/DisplayAvatar.vue +130 -0
- package/app/components/{display-avatar → 01.atoms/display-avatar}/stories/DisplayAvatar.stories.ts +13 -1
- package/app/components/01.atoms/display-avatar/tests/DisplayAvatar.spec.ts +208 -0
- package/app/components/01.atoms/display-avatar/tests/__snapshots__/DisplayAvatar.spec.ts.snap +11 -0
- package/app/components/01.atoms/display-pill/DisplayPill.vue +134 -0
- package/app/components/01.atoms/display-pill/stories/DisplayPill.stories.ts +88 -0
- package/app/components/01.atoms/display-pill/tests/DisplayPill.spec.ts +159 -0
- package/app/components/01.atoms/display-pill/tests/__snapshots__/DisplayPill.spec.ts.snap +7 -0
- package/app/components/02.molecules/display-chip/DisplayChip.vue +189 -0
- package/app/components/{display-chip → 02.molecules/display-chip}/stories/DisplayChip.stories.ts +38 -54
- package/app/components/02.molecules/display-chip/tests/DisplayChip.spec.ts +191 -0
- package/app/components/02.molecules/display-chip/tests/__snapshots__/DisplayChip.spec.ts.snap +12 -0
- package/app/layouts/default.vue +1 -0
- package/app/pages/ui/display-chip.vue +201 -66
- package/app/pages/ui/display-pill.vue +402 -0
- package/package.json +1 -1
- package/app/components/display-avatar/DisplayAvatar.vue +0 -148
- package/app/components/display-chip/DisplayChip.vue +0 -187
|
@@ -5,26 +5,71 @@
|
|
|
5
5
|
<LayoutRow tag="div" variant="popout">
|
|
6
6
|
<h1 class="page-heading-2">Display Chip</h1>
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
8
|
+
<!-- ── QA Panel (dev only) ───────────────────────────────── -->
|
|
9
|
+
<div v-if="isDev" class="qa-panel">
|
|
10
|
+
<details class="qa-panel__details">
|
|
11
|
+
<summary class="qa-panel__summary">
|
|
12
|
+
<span class="qa-panel__title">QA — DisplayChip</span>
|
|
13
|
+
<code class="qa-panel__status">
|
|
14
|
+
size:{{ qaSize }}px · mask:{{ qaMaskWidth }}px · offset:{{ qaOffset }}px · angle:{{ qaAngle }}deg
|
|
15
|
+
</code>
|
|
16
|
+
</summary>
|
|
17
|
+
<div class="qa-panel__body">
|
|
18
|
+
|
|
19
|
+
<div class="qa-panel__group">
|
|
20
|
+
<span class="qa-panel__label">Size</span>
|
|
21
|
+
<div class="qa-panel__chips">
|
|
22
|
+
<button
|
|
23
|
+
v-for="preset in sizePresets"
|
|
24
|
+
:key="preset"
|
|
25
|
+
class="qa-panel__chip"
|
|
26
|
+
:class="{ 'is-active': qaSize === preset }"
|
|
27
|
+
@click="qaSize = preset"
|
|
28
|
+
>{{ preset }}px</button>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div class="qa-panel__group">
|
|
33
|
+
<span class="qa-panel__label">Mask Width</span>
|
|
34
|
+
<div class="qa-panel__chips">
|
|
35
|
+
<button
|
|
36
|
+
v-for="preset in maskWidthPresets"
|
|
37
|
+
:key="preset"
|
|
38
|
+
class="qa-panel__chip"
|
|
39
|
+
:class="{ 'is-active': qaMaskWidth === preset }"
|
|
40
|
+
@click="qaMaskWidth = preset"
|
|
41
|
+
>{{ preset }}px</button>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<div class="qa-panel__group">
|
|
46
|
+
<span class="qa-panel__label">Offset</span>
|
|
47
|
+
<div class="qa-panel__chips">
|
|
48
|
+
<button
|
|
49
|
+
v-for="preset in offsetPresets"
|
|
50
|
+
:key="preset"
|
|
51
|
+
class="qa-panel__chip"
|
|
52
|
+
:class="{ 'is-active': qaOffset === preset }"
|
|
53
|
+
@click="qaOffset = preset"
|
|
54
|
+
>{{ preset }}px</button>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<div class="qa-panel__group">
|
|
59
|
+
<span class="qa-panel__label">Angle — {{ qaAngle }}deg</span>
|
|
60
|
+
<input
|
|
61
|
+
v-model.number="qaAngle"
|
|
62
|
+
type="range"
|
|
63
|
+
min="0"
|
|
64
|
+
max="360"
|
|
65
|
+
step="1"
|
|
66
|
+
class="qa-panel__range"
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
25
70
|
</div>
|
|
26
|
-
</
|
|
27
|
-
</
|
|
71
|
+
</details>
|
|
72
|
+
</div>
|
|
28
73
|
|
|
29
74
|
<section>
|
|
30
75
|
<div class="dl">
|
|
@@ -106,6 +151,8 @@
|
|
|
106
151
|
</template>
|
|
107
152
|
|
|
108
153
|
<script setup lang="ts">
|
|
154
|
+
import type { DisplayChipConfig } from "~/types/components";
|
|
155
|
+
|
|
109
156
|
definePageMeta({
|
|
110
157
|
layout: false,
|
|
111
158
|
});
|
|
@@ -118,59 +165,148 @@ useHead({
|
|
|
118
165
|
},
|
|
119
166
|
});
|
|
120
167
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
168
|
+
// ── QA controls (dev only) ────────────────────────────────────────
|
|
169
|
+
const isDev = import.meta.dev;
|
|
170
|
+
|
|
171
|
+
const qaSize = ref(12);
|
|
172
|
+
const qaMaskWidth = ref(4);
|
|
173
|
+
const qaOffset = ref(2);
|
|
174
|
+
const qaAngle = ref(45);
|
|
127
175
|
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
const changeOffset = (e: Event) => {
|
|
139
|
-
const target = e.target as HTMLInputElement;
|
|
140
|
-
chipConfig.offset = `${target.value}px`;
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
const changeAngle = (e: Event) => {
|
|
144
|
-
const target = e.target as HTMLInputElement;
|
|
145
|
-
chipConfig.angle = `${target.value}deg`;
|
|
146
|
-
};
|
|
176
|
+
const sizePresets = [8, 10, 12, 16, 20, 24];
|
|
177
|
+
const maskWidthPresets = [0, 2, 4, 6, 8];
|
|
178
|
+
const offsetPresets = [-4, 0, 2, 4, 8];
|
|
179
|
+
|
|
180
|
+
const chipConfig = computed((): DisplayChipConfig => ({
|
|
181
|
+
size: `${qaSize.value}px`,
|
|
182
|
+
maskWidth: `${qaMaskWidth.value}px`,
|
|
183
|
+
offset: `${qaOffset.value}px`,
|
|
184
|
+
angle: `${qaAngle.value}deg`,
|
|
185
|
+
}));
|
|
147
186
|
</script>
|
|
148
187
|
|
|
149
188
|
<style lang="css">
|
|
150
189
|
.ui-display-chip-page {
|
|
151
|
-
|
|
152
|
-
margin-bottom: 2rem;
|
|
153
|
-
|
|
154
|
-
.form-row {
|
|
155
|
-
.form-col {
|
|
156
|
-
display: grid;
|
|
157
|
-
grid-template-columns: 200px 200px;
|
|
158
|
-
gap: 1rem;
|
|
159
|
-
padding: 0.5rem 0;
|
|
160
|
-
|
|
161
|
-
label {
|
|
162
|
-
font-weight: bold;
|
|
163
|
-
}
|
|
190
|
+
/* ── QA Panel ──────────────────────────────────────────────────── */
|
|
164
191
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
192
|
+
.qa-panel {
|
|
193
|
+
background: oklch(15% 0 0);
|
|
194
|
+
color: white;
|
|
195
|
+
font-size: 1.3rem;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.qa-panel__details {
|
|
199
|
+
padding: 1rem 2rem;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.qa-panel__summary {
|
|
203
|
+
cursor: pointer;
|
|
204
|
+
display: flex;
|
|
205
|
+
align-items: center;
|
|
206
|
+
gap: 1.6rem;
|
|
207
|
+
list-style: none;
|
|
208
|
+
user-select: none;
|
|
209
|
+
|
|
210
|
+
&::-webkit-details-marker { display: none; }
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.qa-panel__title {
|
|
214
|
+
font-weight: 600;
|
|
215
|
+
font-size: 1.1rem;
|
|
216
|
+
text-transform: uppercase;
|
|
217
|
+
letter-spacing: 0.08em;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.qa-panel__status {
|
|
221
|
+
font-family: monospace;
|
|
222
|
+
font-size: 1.2rem;
|
|
223
|
+
background: oklch(0% 0 0 / 0.3);
|
|
224
|
+
padding: 0.2rem 0.8rem;
|
|
225
|
+
border-radius: 0.4rem;
|
|
226
|
+
user-select: text;
|
|
227
|
+
cursor: text;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.qa-panel__body {
|
|
231
|
+
display: flex;
|
|
232
|
+
flex-wrap: wrap;
|
|
233
|
+
gap: 2.4rem;
|
|
234
|
+
padding-block: 1.2rem 0.4rem;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.qa-panel__group {
|
|
238
|
+
display: flex;
|
|
239
|
+
flex-direction: column;
|
|
240
|
+
gap: 0.6rem;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.qa-panel__label {
|
|
244
|
+
font-size: 1.1rem;
|
|
245
|
+
text-transform: uppercase;
|
|
246
|
+
letter-spacing: 0.08em;
|
|
247
|
+
opacity: 0.55;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.qa-panel__chips {
|
|
251
|
+
display: flex;
|
|
252
|
+
flex-wrap: wrap;
|
|
253
|
+
gap: 0.4rem;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.qa-panel__chip {
|
|
257
|
+
font-family: monospace;
|
|
258
|
+
font-size: 1.2rem;
|
|
259
|
+
color: white;
|
|
260
|
+
background: oklch(0% 0 0 / 0.25);
|
|
261
|
+
border: 1px solid oklch(100% 0 0 / 0.18);
|
|
262
|
+
padding: 0.3rem 1rem;
|
|
263
|
+
border-radius: 0.4rem;
|
|
264
|
+
cursor: pointer;
|
|
265
|
+
transition: background 0.15s;
|
|
266
|
+
|
|
267
|
+
&:hover { background: oklch(0% 0 0 / 0.4); }
|
|
268
|
+
|
|
269
|
+
&.is-active {
|
|
270
|
+
background: oklch(55% 0.18 240);
|
|
271
|
+
border-color: oklch(55% 0.18 240);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.qa-panel__range {
|
|
276
|
+
appearance: none;
|
|
277
|
+
width: 18rem;
|
|
278
|
+
height: 0.4rem;
|
|
279
|
+
background: oklch(100% 0 0 / 0.18);
|
|
280
|
+
border-radius: 0.4rem;
|
|
281
|
+
outline: none;
|
|
282
|
+
cursor: pointer;
|
|
283
|
+
|
|
284
|
+
&::-webkit-slider-thumb {
|
|
285
|
+
appearance: none;
|
|
286
|
+
width: 1.4rem;
|
|
287
|
+
height: 1.4rem;
|
|
288
|
+
border-radius: 50%;
|
|
289
|
+
background: oklch(55% 0.18 240);
|
|
290
|
+
cursor: pointer;
|
|
291
|
+
transition: background 0.15s;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
&::-moz-range-thumb {
|
|
295
|
+
width: 1.4rem;
|
|
296
|
+
height: 1.4rem;
|
|
297
|
+
border: none;
|
|
298
|
+
border-radius: 50%;
|
|
299
|
+
background: oklch(55% 0.18 240);
|
|
300
|
+
cursor: pointer;
|
|
301
|
+
transition: background 0.15s;
|
|
172
302
|
}
|
|
303
|
+
|
|
304
|
+
&:hover::-webkit-slider-thumb { background: oklch(62% 0.18 240); }
|
|
305
|
+
&:hover::-moz-range-thumb { background: oklch(62% 0.18 240); }
|
|
173
306
|
}
|
|
307
|
+
|
|
308
|
+
/* ── Demo grid ─────────────────────────────────────────────────── */
|
|
309
|
+
|
|
174
310
|
section {
|
|
175
311
|
margin-top: 2rem;
|
|
176
312
|
|
|
@@ -181,11 +317,10 @@ const changeAngle = (e: Event) => {
|
|
|
181
317
|
align-items: center;
|
|
182
318
|
justify-content: start;
|
|
183
319
|
|
|
184
|
-
/* background-color: var(--slate-05); */
|
|
185
|
-
|
|
186
320
|
.dt {
|
|
187
321
|
font-weight: bold;
|
|
188
322
|
}
|
|
323
|
+
|
|
189
324
|
.dd {
|
|
190
325
|
margin: 0;
|
|
191
326
|
|