srcdev-nuxt-components 9.1.0 → 9.1.1
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/settings.json +2 -1
- package/.claude/skills/components/page-hero-highlights.md +60 -0
- package/.claude/skills/components/site-navigation.md +120 -0
- package/.claude/skills/index.md +1 -1
- package/app/components/02.molecules/navigation/site-navigation/SiteNavigation.vue +780 -0
- package/app/components/02.molecules/navigation/site-navigation/stories/SiteNavigation.stories.ts +335 -0
- package/app/components/02.molecules/navigation/site-navigation/tests/SiteNavigation.spec.ts +328 -0
- package/app/components/02.molecules/navigation/site-navigation/tests/__snapshots__/SiteNavigation.spec.ts.snap +30 -0
- package/app/components/04.templates/page-hero-highlights/PageHeroHighlights.vue +36 -21
- package/app/components/04.templates/page-hero-highlights/PageHeroHighlightsHeader.vue +66 -0
- package/app/components/04.templates/page-hero-highlights/stories/PageHeroHighlights.stories.ts +50 -3
- package/app/components/04.templates/page-hero-highlights/stories/PageHeroHighlightsHeader.stories.ts +77 -0
- package/app/components/04.templates/page-hero-highlights/tests/PageHeroHighlights.spec.ts +15 -7
- package/app/components/04.templates/page-hero-highlights/tests/PageHeroHighlightsHeader.spec.ts +51 -0
- package/app/components/04.templates/page-hero-highlights/tests/__snapshots__/PageHeroHighlights.spec.ts.snap +1 -1
- package/app/layouts/default.vue +1 -0
- package/app/pages/page-hero-highlights.vue +15 -11
- package/nuxt.config.ts +7 -0
- package/package.json +6 -6
- package/.claude/skills/components/treatment-consultant.md +0 -128
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
# TreatmentConsultant Component
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
`TreatmentConsultant` is a self-contained 5-step hair consultation wizard (`03.organisms`). It collects a user's hair profile across four steps (hair type, natural colour, dream colour, style & treatments) and renders a personalised recommendation on the final step.
|
|
6
|
-
|
|
7
|
-
All data — hair types, colour swatches, treatments, and the recommendation matrix — is hard-coded inside the component. There are no external data dependencies.
|
|
8
|
-
|
|
9
|
-
## Props
|
|
10
|
-
|
|
11
|
-
| Prop | Type | Default | Purpose |
|
|
12
|
-
|------|------|---------|---------|
|
|
13
|
-
| `autoAdvance` | `boolean` | `false` | Automatically advances to the next step immediately after each selection (steps 0–2). On step 3, a "View Results" button still appears when `allowMultipleTreatments` is also `true`. |
|
|
14
|
-
| `allowMultipleTreatments` | `boolean` | `false` | Enables multi-select on the treatments step. When `false`, selecting a treatment deselects any previous choice. |
|
|
15
|
-
| `styleClassPassthrough` | `string \| string[]` | `[]` | Standard passthrough prop for HOC styling. |
|
|
16
|
-
|
|
17
|
-
## Basic usage
|
|
18
|
-
|
|
19
|
-
```vue
|
|
20
|
-
<TreatmentConsultant :auto-advance="true" :allow-multiple-treatments="true" />
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Steps
|
|
24
|
-
|
|
25
|
-
| Index | Label | Behaviour |
|
|
26
|
-
|-------|-------|-----------|
|
|
27
|
-
| 0 | Hair Type | Single select — straight, wavy, curly, coily |
|
|
28
|
-
| 1 | Your Colour | Single select — 7 natural colour swatches |
|
|
29
|
-
| 2 | Dream Colour | Single select — 8 desired colours (incl. "none") |
|
|
30
|
-
| 3 | Style & Treatments | Single or multi-select (see `allowMultipleTreatments`) |
|
|
31
|
-
| 4 | Results | Read-only — recommendation, treatment cards, summary, CTA |
|
|
32
|
-
|
|
33
|
-
## Navigation rules
|
|
34
|
-
|
|
35
|
-
- Completed steps (index < current) are clickable to go back.
|
|
36
|
-
- Future steps are disabled via `aria-disabled` + `tabindex="-1"`.
|
|
37
|
-
- Steps 0–2 require a selection before proceeding (`canProceed`).
|
|
38
|
-
- Step 3 is always passable — treatments are optional.
|
|
39
|
-
- `reset()` clears all state and returns to step 0.
|
|
40
|
-
|
|
41
|
-
## Treatment selection logic
|
|
42
|
-
|
|
43
|
-
- Selecting `"none"` clears all other treatments (and vice versa).
|
|
44
|
-
- In multi-select mode, selecting a treatment automatically removes any conflicting ones (defined by each treatment's `excludes` array).
|
|
45
|
-
- Conflicting treatments are visually marked with a `lucide:ban` icon and a "Conflicts with X" label.
|
|
46
|
-
|
|
47
|
-
## Treatment–Colour compatibility
|
|
48
|
-
|
|
49
|
-
Some treatments clash with same-day colour services: `keratin-smoothing`, `perm`, `relaxer`, `japanese-straightening`. These show a "Not same-day as colour" badge in the results view when a colour change was also selected.
|
|
50
|
-
|
|
51
|
-
## Recommendation matrix
|
|
52
|
-
|
|
53
|
-
`getColourRecommendation(naturalColour, desiredColour, hairType)` maps the combination to:
|
|
54
|
-
|
|
55
|
-
```ts
|
|
56
|
-
interface Recommendation {
|
|
57
|
-
suitability: "great" | "possible" | "difficult" | "not-recommended";
|
|
58
|
-
method: string; // e.g. "Semi-Permanent", "Bleach Required"
|
|
59
|
-
notes: string; // one-line summary
|
|
60
|
-
details: string[]; // bullet points
|
|
61
|
-
}
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
Curly or coily hair type appends an extra conditioning note to `details`. Unmapped combinations fall back to `suitability: "possible"` with a consultation prompt.
|
|
65
|
-
|
|
66
|
-
## Image assets
|
|
67
|
-
|
|
68
|
-
Swatch JPEGs live at `public/images/treatment-consultant/`:
|
|
69
|
-
- `swatch-{light-blonde,dark-blonde,light-brown,dark-brown,red,black,grey-white}.jpeg` (natural colours)
|
|
70
|
-
- `swatch-dream-{blonde,brown,red,black,grey-silver,vivid,balayage}.jpeg` (desired colours)
|
|
71
|
-
|
|
72
|
-
All `NuxtImg` usages include explicit `width` and `height` (128×128 in options, 96×96 in results summary).
|
|
73
|
-
|
|
74
|
-
## Styling
|
|
75
|
-
|
|
76
|
-
Amber-toned dark theme. Tokens scoped to `.treatment-consultant`:
|
|
77
|
-
|
|
78
|
-
```css
|
|
79
|
-
.treatment-consultant {
|
|
80
|
-
--_canvas-color: var(--amber-09);
|
|
81
|
-
--_canvas-text: var(--amber-02);
|
|
82
|
-
--_surface-active: var(--amber-10);
|
|
83
|
-
--_surface-checked: var(--green-09);
|
|
84
|
-
--_surface-excluded: color-mix(in srgb, var(--red-07) 10%, transparent);
|
|
85
|
-
/* … */
|
|
86
|
-
}
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
Fonts: Inter (body), Playfair Display (accent).
|
|
90
|
-
Step transitions: `<Transition name="slide" mode="out-in">`.
|
|
91
|
-
Results cards use `v-motion` with staggered enter animations.
|
|
92
|
-
|
|
93
|
-
## Local style override scaffold
|
|
94
|
-
|
|
95
|
-
```vue
|
|
96
|
-
<TreatmentConsultant :style-class-passthrough="['my-consultant']" />
|
|
97
|
-
|
|
98
|
-
<style>
|
|
99
|
-
/* ─── TreatmentConsultant local overrides ──────────────────────────
|
|
100
|
-
Colours, borders, geometry only — do not override behaviour.
|
|
101
|
-
Delete this block if no overrides are needed.
|
|
102
|
-
─────────────────────────────────────────────────────────────────── */
|
|
103
|
-
.treatment-consultant {
|
|
104
|
-
&.my-consultant {
|
|
105
|
-
/* Canvas background */
|
|
106
|
-
/* --_canvas-color: var(--brand-surface); */
|
|
107
|
-
|
|
108
|
-
/* Option selected state */
|
|
109
|
-
/* --_surface-checked: var(--brand-accent); */
|
|
110
|
-
/* --_border-checked: var(--brand-accent-border); */
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
</style>
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
See [component-local-style-override.md](../component-local-style-override.md) for the full pattern.
|
|
117
|
-
|
|
118
|
-
## CTA (results step)
|
|
119
|
-
|
|
120
|
-
- "Book Consultation" links to `/#contact` (hardcoded anchor).
|
|
121
|
-
- "Start Again" calls `reset()`.
|
|
122
|
-
|
|
123
|
-
## Notes
|
|
124
|
-
|
|
125
|
-
- Component is auto-imported in Nuxt — no import needed.
|
|
126
|
-
- No slots — entirely self-contained UI and data.
|
|
127
|
-
- `styleClassPassthrough` is accepted but not currently wired to `useStyleClassPassthrough` inside the component.
|
|
128
|
-
- Storybook story at `Organisms/TreatmentConsultant` — controls for both props.
|