srcdev-nuxt-components 9.6.17 → 9.6.19

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 (59) hide show
  1. package/.claude/rules/consumer/css-relative-colour-calc.md +15 -0
  2. package/.claude/rules/consumer/vue-dynamic-arg-no-spaces.md +16 -0
  3. package/.claude/skills/component-compliance-checklist.md +6 -1
  4. package/.claude/skills/component-dynamic-slots.md +2 -2
  5. package/.claude/skills/component-naming.md +1 -1
  6. package/.claude/skills/components/accordion-chat.md +99 -0
  7. package/.claude/skills/components/accordion-group.md +98 -0
  8. package/.claude/skills/components/action-menu.md +11 -5
  9. package/.claude/skills/components/expanding-panel-classic.md +9 -7
  10. package/.claude/skills/components/expanding-panel.md +9 -8
  11. package/.claude/skills/components/responsive-header.md +1 -1
  12. package/.claude/skills/components/sparkle-effect.md +79 -0
  13. package/.claude/skills/index.md +4 -2
  14. package/.claude/skills/storybook-add-story.md +8 -0
  15. package/.claude/skills/using-component-skills.md +1 -1
  16. package/.vscode/srcdev-component-accordion-chat.code-snippets +42 -0
  17. package/.vscode/srcdev-component-accordion-group.code-snippets +38 -0
  18. package/.vscode/srcdev-component-action-menu.code-snippets +3 -3
  19. package/.vscode/srcdev-component-sparkle-effect.code-snippets +33 -0
  20. package/app/components/01.atoms/animations/sparkle-effect/CONSUMER-STYLING.md +75 -0
  21. package/app/components/01.atoms/animations/sparkle-effect/SparkleEffect.vue +213 -0
  22. package/app/components/01.atoms/animations/sparkle-effect/stories/SparkleEffect.stories.ts +303 -0
  23. package/app/components/01.atoms/animations/sparkle-effect/tests/SparkleEffect.spec.ts +150 -0
  24. package/app/components/01.atoms/content-wrappers/docs-pages/ContentDocs.vue +1 -1
  25. package/app/components/02.molecules/action-menu/ActionMenu.vue +6 -2
  26. package/app/components/02.molecules/action-menu/ActionMenuItem.vue +6 -3
  27. package/app/components/02.molecules/action-menu/CONSUMER-STYLING.md +11 -4
  28. package/app/components/02.molecules/action-menu/stories/ActionMenu.stories.ts +130 -18
  29. package/app/components/02.molecules/expandable/accordion-chat/AccordionChat.vue +227 -0
  30. package/app/components/02.molecules/expandable/accordion-chat/CONSUMER-STYLING.md +150 -0
  31. package/app/components/02.molecules/expandable/accordion-chat/stories/AccordionChat.stories.ts +347 -0
  32. package/app/components/02.molecules/expandable/accordion-chat/tests/AccordionChat.spec.ts +205 -0
  33. package/app/components/02.molecules/expandable/accordion-chat/tests/__snapshots__/AccordionChat.spec.ts.snap +40 -0
  34. package/app/components/02.molecules/expandable/{accordian/AccordianCore.vue → accordion-group/AccordionGroup.vue} +32 -20
  35. package/app/components/02.molecules/expandable/accordion-group/CONSUMER-STYLING.md +66 -0
  36. package/app/components/02.molecules/expandable/accordion-group/stories/AccordionGroup.stories.ts +238 -0
  37. package/app/components/02.molecules/expandable/accordion-group/tests/AccordionGroup.spec.ts +172 -0
  38. package/app/components/02.molecules/expandable/accordion-group/tests/__snapshots__/AccordionGroup.spec.ts.snap +45 -0
  39. package/app/components/02.molecules/expandable/expanding-panel/CONSUMER-STYLING.md +1 -0
  40. package/app/components/02.molecules/expandable/expanding-panel/ExpandingPanel.vue +11 -6
  41. package/app/components/02.molecules/expandable/expanding-panel/stories/ExpandingPanel.stories.ts +82 -1
  42. package/app/components/02.molecules/expandable/expanding-panel/tests/ExpandingPanel.spec.ts +24 -30
  43. package/app/components/02.molecules/expandable/expanding-panel/tests/__snapshots__/ExpandingPanel.spec.ts.snap +8 -8
  44. package/app/components/02.molecules/expandable/expanding-panel-classic/CONSUMER-STYLING.md +1 -0
  45. package/app/components/02.molecules/expandable/expanding-panel-classic/ExpandingPanelClassic.vue +10 -5
  46. package/app/components/02.molecules/expandable/expanding-panel-classic/stories/ExpandingPanelClassic.stories.ts +83 -1
  47. package/app/components/02.molecules/expandable/expanding-panel-classic/tests/ExpandingPanelClassic.spec.ts +24 -30
  48. package/app/components/02.molecules/expandable/expanding-panel-classic/tests/__snapshots__/ExpandingPanelClassic.spec.ts.snap +8 -8
  49. package/app/components/03.organisms/responsive-header/CONSUMER-STYLING.md +6 -2
  50. package/app/components/03.organisms/responsive-header/ResponsiveHeader.vue +21 -0
  51. package/app/components/03.organisms/responsive-header/tests/__snapshots__/NavigationItems.spec.ts.snap +2 -2
  52. package/app/components/03.organisms/responsive-header/tests/__snapshots__/ResponsiveHeader.spec.ts.snap +2 -2
  53. package/package.json +1 -1
  54. package/.claude/skills/components/accordian-core.md +0 -180
  55. package/.vscode/srcdev-component-accordian-core.code-snippets +0 -74
  56. package/app/components/02.molecules/expandable/accordian/CONSUMER-STYLING.md +0 -100
  57. package/app/components/02.molecules/expandable/accordian/stories/AccordianCore.stories.ts +0 -272
  58. package/app/components/02.molecules/expandable/accordian/tests/AccordianCore.spec.ts +0 -257
  59. package/app/components/02.molecules/expandable/accordian/tests/__snapshots__/AccordianCore.spec.ts.snap +0 -95
@@ -3,12 +3,12 @@
3
3
  exports[`ExpandingPanelClassic > renders correct HTML structure with all props set 1`] = `
4
4
  "<div class="expanding-panel-classic extra-class">
5
5
  <details class="expanding-panel-classic-details" name="snap-all" open="">
6
- <summary id="id-snap-all-trigger" class="expanding-panel-classic-summary" aria-controls="id-snap-all-content" aria-expanded="true">
6
+ <summary id="v-0-1-trigger" class="expanding-panel-classic-summary" aria-controls="v-0-1-content" aria-expanded="true">
7
7
  <div class="label-wrapper"></div>
8
8
  <div class="icon-wrapper icon-wrapper--hidden"><span class="iconify i-bi:caret-down-fill icon" aria-hidden="true"></span></div>
9
9
  </summary>
10
10
  </details>
11
- <div id="id-snap-all-content" class="expanding-panel-classic-content" aria-labelledby="id-snap-all-trigger" role="region">
11
+ <div id="v-0-1-content" class="expanding-panel-classic-content" aria-labelledby="v-0-1-trigger" role="region">
12
12
  <div class="inner"></div>
13
13
  </div>
14
14
  </div>"
@@ -17,12 +17,12 @@ exports[`ExpandingPanelClassic > renders correct HTML structure with all props s
17
17
  exports[`ExpandingPanelClassic > renders correct HTML structure with contentIsOnTop true 1`] = `
18
18
  "<div class="expanding-panel-classic content-is-on-top">
19
19
  <details class="expanding-panel-classic-details" name="snap-content-on-top">
20
- <summary id="id-snap-content-on-top-trigger" class="expanding-panel-classic-summary" aria-controls="id-snap-content-on-top-content" aria-expanded="false">
20
+ <summary id="v-0-1-trigger" class="expanding-panel-classic-summary" aria-controls="v-0-1-content" aria-expanded="false">
21
21
  <div class="label-wrapper"></div>
22
22
  <div class="icon-wrapper"><span class="iconify i-bi:caret-down-fill icon" aria-hidden="true"></span></div>
23
23
  </summary>
24
24
  </details>
25
- <div id="id-snap-content-on-top-content" class="expanding-panel-classic-content" aria-labelledby="id-snap-content-on-top-trigger" role="region">
25
+ <div id="v-0-1-content" class="expanding-panel-classic-content" aria-labelledby="v-0-1-trigger" role="region">
26
26
  <div class="inner"></div>
27
27
  </div>
28
28
  </div>"
@@ -31,12 +31,12 @@ exports[`ExpandingPanelClassic > renders correct HTML structure with contentIsOn
31
31
  exports[`ExpandingPanelClassic > renders correct HTML structure with default props 1`] = `
32
32
  "<div class="expanding-panel-classic">
33
33
  <details class="expanding-panel-classic-details" name="snap-default">
34
- <summary id="id-snap-default-trigger" class="expanding-panel-classic-summary" aria-controls="id-snap-default-content" aria-expanded="false">
34
+ <summary id="v-0-1-trigger" class="expanding-panel-classic-summary" aria-controls="v-0-1-content" aria-expanded="false">
35
35
  <div class="label-wrapper"></div>
36
36
  <div class="icon-wrapper"><span class="iconify i-bi:caret-down-fill icon" aria-hidden="true"></span></div>
37
37
  </summary>
38
38
  </details>
39
- <div id="id-snap-default-content" class="expanding-panel-classic-content" aria-labelledby="id-snap-default-trigger" role="region">
39
+ <div id="v-0-1-content" class="expanding-panel-classic-content" aria-labelledby="v-0-1-trigger" role="region">
40
40
  <div class="inner"></div>
41
41
  </div>
42
42
  </div>"
@@ -45,12 +45,12 @@ exports[`ExpandingPanelClassic > renders correct HTML structure with default pro
45
45
  exports[`ExpandingPanelClassic > renders correct HTML structure with populated slots 1`] = `
46
46
  "<div class="expanding-panel-classic">
47
47
  <details class="expanding-panel-classic-details" name="snap-slots">
48
- <summary id="id-snap-slots-trigger" class="expanding-panel-classic-summary" aria-controls="id-snap-slots-content" aria-expanded="false">
48
+ <summary id="v-0-1-trigger" class="expanding-panel-classic-summary" aria-controls="v-0-1-content" aria-expanded="false">
49
49
  <div class="label-wrapper"><span>Summary text</span></div>
50
50
  <div class="icon-wrapper"><span>▸</span></div>
51
51
  </summary>
52
52
  </details>
53
- <div id="id-snap-slots-content" class="expanding-panel-classic-content" aria-labelledby="id-snap-slots-trigger" role="region">
53
+ <div id="v-0-1-content" class="expanding-panel-classic-content" aria-labelledby="v-0-1-trigger" role="region">
54
54
  <div class="inner">
55
55
  <p>Content text</p>
56
56
  </div>
@@ -39,7 +39,7 @@ are documented alongside it since that's where they're consumed.
39
39
  | `--responsive-nav-decorator-hovered-bg` | `color-mix(in oklch, var(--theme-text) 8%, transparent)` | Hover highlight background behind the hovered item. |
40
40
  | `--responsive-nav-decorator-indicator-height` | `2px` | Thickness of the active indicator. |
41
41
  | `--responsive-nav-decorator-hovered-border-radius` | `4px` | Corner radius of the hover highlight. |
42
- | `--responsive-nav-decorator-transition-duration` | `200ms` | How long the active indicator and hover highlight take to slide between items. |
42
+ | `--responsive-nav-decorator-transition-duration` | `200ms` | How long the active indicator and hover highlight take to slide between items. Under `prefers-reduced-motion` they jump instead (the hover highlight still fades). |
43
43
 
44
44
  ### Overflow panel content (`NavigationItems`)
45
45
 
@@ -63,13 +63,17 @@ Link and dropdown text is never line-clamped: it names where the link goes. Long
63
63
  wrap inside the dropdown and overflow panels; in the top bar, an item too wide to fit moves to the
64
64
  overflow menu.
65
65
 
66
+ > **Changed 2026-10-20**: under `prefers-reduced-motion` the active indicator and hover highlight
67
+ > jump to the new item instead of sliding, the dropdown chevron flips without rotating, and the
68
+ > overflow button appears without animating its width. Opacity fades stay.
69
+ >
66
70
  > **Changed 2026-10-07**: the defaults assumed a dark bar: `Canvas` panel and button backgrounds,
67
71
  > translucent white borders (`#ffffff90`, `#efefef75`), a white button outline/hover outline and
68
72
  > white-tint hover highlights, all near-invisible on a light header. They now come from the
69
73
  > `--theme-*` slots and `--page-bg` (see the tables). A dark header sets these tokens. Also added
70
74
  > the `-link-color-hover` / `-link-color-active` tokens (top bar and overflow panel), which
71
75
  > TabNavigation had and ResponsiveHeader lacked.
72
-
76
+ >
73
77
  > **Changed 2026-10-05**: the dropdown and overflow panels had no maximum size, so a long child
74
78
  > name or a long child list ran off-screen. They are now capped by the max-size tokens above.
75
79
  > `--_overflow-drop-down-width`, a private token nothing ever set, is gone (`min-width: fit-content`
@@ -914,6 +914,10 @@ watch(
914
914
  height: var(--responsive-header-link-icon-size, 1.35em);
915
915
  transform: var(--_icon-transform);
916
916
  transition: transform 0.2s ease-in-out;
917
+
918
+ @media (prefers-reduced-motion: reduce) {
919
+ transition: none;
920
+ }
917
921
  }
918
922
  }
919
923
 
@@ -1062,6 +1066,12 @@ watch(
1062
1066
 
1063
1067
  transition: all 0.2s ease-in-out;
1064
1068
 
1069
+ @media (prefers-reduced-motion: reduce) {
1070
+ transition:
1071
+ opacity 0.2s ease-in-out,
1072
+ visibility 0.2s ease-in-out;
1073
+ }
1074
+
1065
1075
  &.visually-hidden {
1066
1076
  opacity: 0;
1067
1077
  visibility: hidden;
@@ -1234,6 +1244,17 @@ watch(
1234
1244
  transition: none;
1235
1245
  }
1236
1246
 
1247
+ /* The indicators jump to the new item instead of sliding; the hover highlight still fades. */
1248
+ @media (prefers-reduced-motion: reduce) {
1249
+ .nav-indicator-hovered {
1250
+ transition: opacity 150ms ease;
1251
+ }
1252
+
1253
+ .nav-indicator-active {
1254
+ transition: none;
1255
+ }
1256
+ }
1257
+
1237
1258
  &:has(li.is-hovered) .nav-indicator-active {
1238
1259
  background: var(
1239
1260
  --responsive-nav-decorator-hovered-indicator-color,
@@ -8,12 +8,12 @@ exports[`NavigationItems > renders correct HTML structure with default props 1`]
8
8
  <li class="overflow-navigation-item visible" style="--_main-navigation-item-width: 0px;" data-group-key="firstNav" data-local-index="2" role="none">
9
9
  <div class="expanding-panel-classic overflow-navigation-details">
10
10
  <details class="expanding-panel-classic-details" name="overflow-navigation-group">
11
- <summary id="id-overflow-navigation-group-trigger" class="expanding-panel-classic-summary" aria-controls="id-overflow-navigation-group-content" aria-expanded="false">
11
+ <summary id="v-0-0-1-trigger" class="expanding-panel-classic-summary" aria-controls="v-0-0-1-content" aria-expanded="false">
12
12
  <div class="label-wrapper"><span class="overflow-navigation-text" aria-label="UI Components submenu" role="menuitem" aria-haspopup="true">UI Components</span></div>
13
13
  <div class="icon-wrapper"><span class="iconify i-mdi:chevron-down icon" aria-hidden="true"></span></div>
14
14
  </summary>
15
15
  </details>
16
- <div id="id-overflow-navigation-group-content" class="expanding-panel-classic-content" aria-labelledby="id-overflow-navigation-group-trigger" role="region">
16
+ <div id="v-0-0-1-content" class="expanding-panel-classic-content" aria-labelledby="v-0-0-1-trigger" role="region">
17
17
  <div class="inner">
18
18
  <div class="overflow-navigation-sub-nav-inner">
19
19
  <ul class="overflow-navigation-sub-nav-list">
@@ -41,12 +41,12 @@ exports[`ResponsiveHeader > renders correct HTML structure with default props 1`
41
41
  <li class="overflow-navigation-item visible" data-group-key="firstNav" data-local-index="2" role="none">
42
42
  <div class="expanding-panel-classic overflow-navigation-details">
43
43
  <details class="expanding-panel-classic-details" name="overflow-navigation-group">
44
- <summary id="id-overflow-navigation-group-trigger" class="expanding-panel-classic-summary" aria-controls="id-overflow-navigation-group-content" aria-expanded="false">
44
+ <summary id="v-0-0-1-trigger" class="expanding-panel-classic-summary" aria-controls="v-0-0-1-content" aria-expanded="false">
45
45
  <div class="label-wrapper"><span class="overflow-navigation-text" aria-label="UI Components submenu" role="menuitem" aria-haspopup="true">UI Components</span></div>
46
46
  <div class="icon-wrapper"><span class="iconify i-mdi:chevron-down icon" aria-hidden="true"></span></div>
47
47
  </summary>
48
48
  </details>
49
- <div id="id-overflow-navigation-group-content" class="expanding-panel-classic-content" aria-labelledby="id-overflow-navigation-group-trigger" role="region">
49
+ <div id="v-0-0-1-content" class="expanding-panel-classic-content" aria-labelledby="v-0-0-1-trigger" role="region">
50
50
  <div class="inner">
51
51
  <div class="overflow-navigation-sub-nav-inner">
52
52
  <ul class="overflow-navigation-sub-nav-list">
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "srcdev-nuxt-components",
3
3
  "type": "module",
4
- "version": "9.6.17",
4
+ "version": "9.6.19",
5
5
  "main": "nuxt.config.ts",
6
6
  "types": "types.d.ts",
7
7
  "license": "MIT",
@@ -1,180 +0,0 @@
1
- # AccordianCore Component
2
-
3
- ## Overview
4
-
5
- `AccordianCore` renders a group of `ExpandingPanel` components (or `ExpandingPanelClassic`, via the `variant` prop). When a shared `name` prop is supplied, the native `<details>` behaviour ensures only one panel can be open at a time. Content is filled via **indexed dynamic slots** — one set per panel, driven by `itemCount`.
6
-
7
- ---
8
-
9
- ## Dynamic slot pattern
10
-
11
- For `itemCount="3"` the following slots exist:
12
-
13
- | Slot | Purpose |
14
- |------|---------|
15
- | `#accordian-0-summary` | Clickable label for panel 0 |
16
- | `#accordian-0-icon` | Custom toggle icon for panel 0 (optional) |
17
- | `#accordian-0-content` | Expandable content for panel 0 |
18
- | `#accordian-1-summary` | Clickable label for panel 1 |
19
- | `#accordian-1-icon` | Custom toggle icon for panel 1 (optional) |
20
- | `#accordian-1-content` | Expandable content for panel 1 |
21
- | … | … |
22
-
23
- **Rules:**
24
- - Slots are **zero-indexed**: first panel = `accordian-0-*`, last = `accordian-{itemCount - 1}-*`.
25
- - `accordian-{n}-summary` and `accordian-{n}-content` are the primary slots — always provide these.
26
- - `accordian-{n}-icon` is optional. When omitted, the default `ExpandingPanel` caret icon is used.
27
- - Always keep `itemCount` in sync with the number of slot sets you provide.
28
-
29
- ---
30
-
31
- ## Props reference
32
-
33
- | Prop | Type | Default | Notes |
34
- |------|------|---------|-------|
35
- | `name` | `string` | `undefined` | Shared `name` passed to every `ExpandingPanel`. When set, native `<details>` grouping means only one panel can be open at a time. Omit for independent panels. |
36
- | `itemCount` | `number` | `0` | Number of `ExpandingPanel` components to render. |
37
- | `animationDuration` | `number` | `300` | Expand/collapse animation duration in ms, forwarded to every panel. |
38
- | `variant` | `"modern" \| "classic"` | `"classic"` | `"classic"` renders each panel as `ExpandingPanelClassic` (`grid-template-rows`-based, animates identically in every browser). `"modern"` renders `ExpandingPanel` instead (`::details-content`-based) — **known not to work correctly on WebKit (Safari/iOS)**, confirmed via real-device testing (2026-08); the animation silently fails and, worse, `contentIsOnTop` positioning never applies there. `"modern"` is opt-in for consumers who've confirmed it works for their audience, not the safe default. Applies to every panel in the group — mixing variants within one `AccordianCore` isn't supported. See [expanding-panel-classic.md](expanding-panel-classic.md) and CLAUDE.md pitfall #19. |
39
- | `styleClassPassthrough` | `string \| string[]` | `[]` | Extra CSS classes applied to the root `.display-accordian` element. |
40
-
41
- ---
42
-
43
- ## Usage examples
44
-
45
- ### Basic accordion (exclusive open)
46
-
47
- ```vue
48
- <AccordianCore name="faq" :item-count="3" :animation-duration="300">
49
- <template #accordian-0-summary><span>What is your returns policy?</span></template>
50
- <template #accordian-0-content>
51
- <p>You can return any item within 30 days of purchase.</p>
52
- </template>
53
-
54
- <template #accordian-1-summary><span>How long does delivery take?</span></template>
55
- <template #accordian-1-content>
56
- <p>Standard delivery takes 3–5 working days.</p>
57
- </template>
58
-
59
- <template #accordian-2-summary><span>Do you ship internationally?</span></template>
60
- <template #accordian-2-content>
61
- <p>Yes — we ship to over 40 countries.</p>
62
- </template>
63
- </AccordianCore>
64
- ```
65
-
66
- Passing `name="faq"` groups all panels so only one can be open at a time.
67
-
68
- ### Independent panels (no name — each opens freely)
69
-
70
- ```vue
71
- <AccordianCore :item-count="2">
72
- <template #accordian-0-summary><span>Panel A</span></template>
73
- <template #accordian-0-content><p>Content A</p></template>
74
-
75
- <template #accordian-1-summary><span>Panel B</span></template>
76
- <template #accordian-1-content><p>Content B</p></template>
77
- </AccordianCore>
78
- ```
79
-
80
- ### Custom icons per panel
81
-
82
- ```vue
83
- <AccordianCore :item-count="2">
84
- <template #accordian-0-summary><span>Section one</span></template>
85
- <template #accordian-0-icon><span>+</span></template>
86
- <template #accordian-0-content><p>Content one</p></template>
87
-
88
- <template #accordian-1-summary><span>Section two</span></template>
89
- <template #accordian-1-icon><span>+</span></template>
90
- <template #accordian-1-content><p>Content two</p></template>
91
- </AccordianCore>
92
- ```
93
-
94
- ### Modern variant (opt-in, not WebKit-safe)
95
-
96
- ```vue
97
- <AccordianCore name="faq" :item-count="2" variant="modern">
98
- <template #accordian-0-summary><span>Question one?</span></template>
99
- <template #accordian-0-content><p>Answer one.</p></template>
100
-
101
- <template #accordian-1-summary><span>Question two?</span></template>
102
- <template #accordian-1-content><p>Answer two.</p></template>
103
- </AccordianCore>
104
- ```
105
-
106
- ### Programmatic slot rendering (many items)
107
-
108
- ```vue
109
- <AccordianCore :item-count="items.length">
110
- <template v-for="(item, i) in items" #[`accordian-${i}-summary`] :key="i">
111
- <span>{{ item.title }}</span>
112
- </template>
113
- <template v-for="(item, i) in items" #[`accordian-${i}-content`] :key="i">
114
- <p>{{ item.body }}</p>
115
- </template>
116
- </AccordianCore>
117
- ```
118
-
119
- ---
120
-
121
- ## CSS custom properties
122
-
123
- `AccordianCore` has no `--accordian-*` tokens of its own — its panels are `ExpandingPanel`
124
- (or `ExpandingPanelClassic`, per `variant`) underneath, so `--expanding-panel-*` tokens apply
125
- directly. See `CONSUMER-STYLING.md` in the component directory for the full override reference,
126
- including the `.accordian-item` hook and the variant-dependent root class.
127
-
128
- Override in a consuming component or theme block:
129
-
130
- | Property | Effect |
131
- |----------|--------|
132
- | Applied via `accordian-item` class on each panel | Panels animate `margin-block-end` and `border-radius` alongside the expand transition — duration follows `animationDuration`. |
133
-
134
- ---
135
-
136
- ## Local style override scaffold
137
-
138
- When consuming this component, scaffold a style block using `styleClassPassthrough`. Delete the block if unused.
139
-
140
- See [component-local-style-override.md](../component-local-style-override.md) for the full pattern.
141
-
142
- ```vue
143
- <AccordianCore :style-class-passthrough="['my-accordian']" :item-count="3">
144
- ...
145
- </AccordianCore>
146
-
147
- <style>
148
- /* ─── AccordianCore local overrides ────────────────────────────────
149
- Colours, borders, geometry only — do not override behaviour.
150
- Delete this block if no overrides are needed.
151
- ─────────────────────────────────────────────────────────────────── */
152
- .display-accordian {
153
- &.my-accordian {
154
- /* Geometry */
155
- /* max-width: none; */ /* default is 600px — remove the width cap */
156
-
157
- /* Panel-level overrides via the .accordian-item hook — .expanding-panel-classic is
158
- the root class rendered by the default "classic" variant; swap in .expanding-panel
159
- if this instance uses variant="modern" */
160
- .accordian-item.expanding-panel-classic {
161
- /* Border */
162
- /* border-block-end: 1px solid currentColor; */
163
-
164
- /* Geometry */
165
- /* border-radius: 0.8rem; */
166
- }
167
- }
168
- }
169
- </style>
170
- ```
171
-
172
- ---
173
-
174
- ## Notes
175
-
176
- - `AccordianCore` always passes `style-class-passthrough="['accordian-item']"` to every inner panel — use `.accordian-item` as the hook for per-panel styling overrides.
177
- - `variant` applies to the whole group — every panel in a given `AccordianCore` renders as the same component. Switching `variant` at runtime swaps every panel's underlying component (via `<component :is>`), which resets each panel's open/closed state.
178
- - For a single standalone expand/collapse panel, use `ExpandingPanel` (or `ExpandingPanelClassic`) directly instead.
179
- - Auto-imported in Nuxt — no manual import needed.
180
- - File: `app/components/02.molecules/expandable/accordian/AccordianCore.vue`
@@ -1,74 +0,0 @@
1
- {
2
- "SRCDEV AccordianCore Basic": {
3
- "description": "AccordianCore grouped into an exclusive-open accordion (shared name)",
4
- "scope": "vue,html",
5
- "body": [
6
- "<AccordianCore name=\"$1faq\" :item-count=\"$2\">",
7
- " <template #accordian-0-summary>",
8
- " <span>$3Question one?</span>",
9
- " </template>",
10
- " <template #accordian-0-content>",
11
- " <p>$4Answer one.</p>",
12
- " </template>",
13
- "",
14
- " <template #accordian-1-summary>",
15
- " <span>$5Question two?</span>",
16
- " </template>",
17
- " <template #accordian-1-content>",
18
- " <p>$6Answer two.</p>",
19
- " </template>",
20
- "</AccordianCore>"
21
- ]
22
- },
23
- "SRCDEV AccordianCore Classic Variant": {
24
- "description": "AccordianCore using ExpandingPanelClassic panels (animation runs in every browser)",
25
- "scope": "vue,html",
26
- "body": [
27
- "<AccordianCore name=\"$1faq\" :item-count=\"$2\" variant=\"classic\">",
28
- " <template #accordian-0-summary>",
29
- " <span>$3Question one?</span>",
30
- " </template>",
31
- " <template #accordian-0-content>",
32
- " <p>$4Answer one.</p>",
33
- " </template>",
34
- "",
35
- " <template #accordian-1-summary>",
36
- " <span>$5Question two?</span>",
37
- " </template>",
38
- " <template #accordian-1-content>",
39
- " <p>$6Answer two.</p>",
40
- " </template>",
41
- "</AccordianCore>"
42
- ]
43
- },
44
- "SRCDEV AccordianCore Programmatic Slots": {
45
- "description": "AccordianCore with slots generated from an items array via v-for",
46
- "scope": "vue,html",
47
- "body": [
48
- "<AccordianCore :item-count=\"$1items.length\">",
49
- " <template v-for=\"(item, i) in $1items\" #[`accordian-\\${i}-summary`] :key=\"i\">",
50
- " <span>{{ item.$2title }}</span>",
51
- " </template>",
52
- " <template v-for=\"(item, i) in $1items\" #[`accordian-\\${i}-content`] :key=\"i\">",
53
- " <p>{{ item.$3body }}</p>",
54
- " </template>",
55
- "</AccordianCore>"
56
- ]
57
- },
58
- "SRCDEV AccordianCore CSS Override": {
59
- "description": "CSS override scaffold for AccordianCore panel-level styling",
60
- "scope": "css",
61
- "body": [
62
- ".$1my-accordian {",
63
- " .display-accordian {",
64
- " /* max-width: none; */",
65
- "",
66
- " .accordian-item.expanding-panel {",
67
- " /* border-block-end: 1px solid currentColor; */",
68
- " /* border-radius: $2; */",
69
- " }",
70
- " }",
71
- "}"
72
- ]
73
- }
74
- }
@@ -1,100 +0,0 @@
1
- # AccordianCore — Consumer Styling Guide
2
-
3
- ## No tokens of its own
4
-
5
- `AccordianCore` doesn't define any `--accordian-*` custom properties. It's a thin wrapper that
6
- renders `itemCount` copies of a panel component (`ExpandingPanel` by default, or
7
- `ExpandingPanelClassic` when `variant="classic"`) and forwards `name`/`animationDuration` to each
8
- one — all real styling surface lives on whichever panel component is active. See that
9
- component's own `CONSUMER-STYLING.md`:
10
-
11
- - [../expanding-panel/CONSUMER-STYLING.md](../expanding-panel/CONSUMER-STYLING.md) (default, `variant="modern"`)
12
- - [../expanding-panel-classic/CONSUMER-STYLING.md](../expanding-panel-classic/CONSUMER-STYLING.md) (`variant="classic"`)
13
-
14
- `--expanding-panel-*` tokens set at any scope (global, page) apply to `AccordianCore`'s panels
15
- too, since they're the same underlying component — no `AccordianCore`-specific override is
16
- needed for summary gap, icon size, etc.
17
-
18
- ---
19
-
20
- ## The `.accordian-item` hook
21
-
22
- Every panel gets `style-class-passthrough="['accordian-item']"` automatically — this is the one
23
- `AccordianCore`-specific override surface, used to target *all* panels in the group without
24
- reaching into `ExpandingPanel`/`ExpandingPanelClassic` internals.
25
-
26
- ```css
27
- /* In the consuming page's unscoped <style> block */
28
- .display-accordian {
29
- .accordian-item.expanding-panel {
30
- /* modern variant (default) */
31
- border-block-end: 1px solid var(--theme-border, #e0e0e0);
32
- }
33
-
34
- /* If this instance uses variant="classic", target the classic root class instead: */
35
- .accordian-item.expanding-panel-classic {
36
- border-block-end: 1px solid var(--theme-border, #e0e0e0);
37
- }
38
- }
39
- ```
40
-
41
- Note the root class differs by variant (`.expanding-panel` vs `.expanding-panel-classic`) — a
42
- selector written for one won't match the other. If you switch `variant` on an existing instance,
43
- check any `.accordian-item.expanding-panel*` overrides still target the right class.
44
-
45
- ---
46
-
47
- ## Local overrides
48
-
49
- There are no public tokens, so override the classes above with direct properties, scoped to an
50
- element you own (a page or section class, or a class added with `:style-class-passthrough`). Keep
51
- the block **unlayered** (no `@layer` wrapper) so it beats the library's `@layer components`. If your
52
- own file uses `<style scoped>`, selectors that reach inside the component need `:deep()`. Patterns
53
- and examples: `.claude/skills/component-local-style-override.md`.
54
-
55
- ### Page or section
56
-
57
- No `:deep()` is required (component styles are unscoped).
58
-
59
- ```css
60
- .faq-section {
61
- .display-accordian {
62
- max-width: 480px;
63
-
64
- .accordian-item.expanding-panel {
65
- --expanding-panel-summary-padding-block: 1.6rem;
66
- }
67
- }
68
- }
69
- ```
70
-
71
- ### One instance
72
-
73
- Use sparingly — prefer global or page-scoped CSS. `styleClassPassthrough` on `AccordianCore`
74
- targets the root `.display-accordian` element, not the individual panels (those already get
75
- `.accordian-item` automatically):
76
-
77
- ```vue
78
- <AccordianCore name="faq" :item-count="3" :style-class-passthrough="['compact-faq']">
79
- ...
80
- </AccordianCore>
81
- ```
82
-
83
- ```css
84
- .display-accordian.compact-faq {
85
- max-width: 400px;
86
- }
87
- ```
88
-
89
- ---
90
-
91
- ## Notes
92
-
93
- - `variant` is group-wide: every panel in one `AccordianCore` renders the same component, so
94
- there's no per-panel styling divergence caused by variant — just remember which root class
95
- (`.expanding-panel` vs `.expanding-panel-classic`) your `.accordian-item` selectors need.
96
- - `contentIsOnTop` isn't exposed on `AccordianCore` — it isn't meaningful for a grouped accordion
97
- (see `ExpandingPanel`'s own docs for why: it's for a single panel overlaying trailing page
98
- content, not stacked/grouped panels). Use `ExpandingPanel`/`ExpandingPanelClassic` directly if
99
- you need an overlay panel.
100
-