srcdev-nuxt-components 9.6.18 → 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.
- package/.claude/rules/consumer/css-relative-colour-calc.md +15 -0
- package/.claude/rules/consumer/vue-dynamic-arg-no-spaces.md +16 -0
- package/.claude/skills/component-compliance-checklist.md +6 -1
- package/.claude/skills/component-dynamic-slots.md +2 -2
- package/.claude/skills/component-naming.md +1 -1
- package/.claude/skills/components/accordion-chat.md +99 -0
- package/.claude/skills/components/accordion-group.md +98 -0
- package/.claude/skills/components/action-menu.md +11 -5
- package/.claude/skills/components/expanding-panel-classic.md +9 -7
- package/.claude/skills/components/expanding-panel.md +9 -8
- package/.claude/skills/components/sparkle-effect.md +79 -0
- package/.claude/skills/index.md +4 -2
- package/.claude/skills/storybook-add-story.md +8 -0
- package/.claude/skills/using-component-skills.md +1 -1
- package/.vscode/srcdev-component-accordion-chat.code-snippets +42 -0
- package/.vscode/srcdev-component-accordion-group.code-snippets +38 -0
- package/.vscode/srcdev-component-action-menu.code-snippets +3 -3
- package/.vscode/srcdev-component-sparkle-effect.code-snippets +33 -0
- package/app/components/01.atoms/animations/sparkle-effect/CONSUMER-STYLING.md +75 -0
- package/app/components/01.atoms/animations/sparkle-effect/SparkleEffect.vue +213 -0
- package/app/components/01.atoms/animations/sparkle-effect/stories/SparkleEffect.stories.ts +303 -0
- package/app/components/01.atoms/animations/sparkle-effect/tests/SparkleEffect.spec.ts +150 -0
- package/app/components/01.atoms/content-wrappers/docs-pages/ContentDocs.vue +1 -1
- package/app/components/02.molecules/action-menu/ActionMenu.vue +6 -2
- package/app/components/02.molecules/action-menu/ActionMenuItem.vue +6 -3
- package/app/components/02.molecules/action-menu/CONSUMER-STYLING.md +11 -4
- package/app/components/02.molecules/action-menu/stories/ActionMenu.stories.ts +130 -18
- package/app/components/02.molecules/expandable/accordion-chat/AccordionChat.vue +227 -0
- package/app/components/02.molecules/expandable/accordion-chat/CONSUMER-STYLING.md +150 -0
- package/app/components/02.molecules/expandable/accordion-chat/stories/AccordionChat.stories.ts +347 -0
- package/app/components/02.molecules/expandable/accordion-chat/tests/AccordionChat.spec.ts +205 -0
- package/app/components/02.molecules/expandable/accordion-chat/tests/__snapshots__/AccordionChat.spec.ts.snap +40 -0
- package/app/components/02.molecules/expandable/{accordian/AccordianCore.vue → accordion-group/AccordionGroup.vue} +32 -20
- package/app/components/02.molecules/expandable/accordion-group/CONSUMER-STYLING.md +66 -0
- package/app/components/02.molecules/expandable/accordion-group/stories/AccordionGroup.stories.ts +238 -0
- package/app/components/02.molecules/expandable/accordion-group/tests/AccordionGroup.spec.ts +172 -0
- package/app/components/02.molecules/expandable/accordion-group/tests/__snapshots__/AccordionGroup.spec.ts.snap +45 -0
- package/app/components/02.molecules/expandable/expanding-panel/CONSUMER-STYLING.md +1 -0
- package/app/components/02.molecules/expandable/expanding-panel/ExpandingPanel.vue +11 -6
- package/app/components/02.molecules/expandable/expanding-panel/stories/ExpandingPanel.stories.ts +82 -1
- package/app/components/02.molecules/expandable/expanding-panel/tests/ExpandingPanel.spec.ts +24 -30
- package/app/components/02.molecules/expandable/expanding-panel/tests/__snapshots__/ExpandingPanel.spec.ts.snap +8 -8
- package/app/components/02.molecules/expandable/expanding-panel-classic/CONSUMER-STYLING.md +1 -0
- package/app/components/02.molecules/expandable/expanding-panel-classic/ExpandingPanelClassic.vue +10 -5
- package/app/components/02.molecules/expandable/expanding-panel-classic/stories/ExpandingPanelClassic.stories.ts +83 -1
- package/app/components/02.molecules/expandable/expanding-panel-classic/tests/ExpandingPanelClassic.spec.ts +24 -30
- package/app/components/02.molecules/expandable/expanding-panel-classic/tests/__snapshots__/ExpandingPanelClassic.spec.ts.snap +8 -8
- package/app/components/03.organisms/responsive-header/tests/__snapshots__/NavigationItems.spec.ts.snap +2 -2
- package/app/components/03.organisms/responsive-header/tests/__snapshots__/ResponsiveHeader.spec.ts.snap +2 -2
- package/package.json +1 -1
- package/.claude/skills/components/accordian-core.md +0 -180
- package/.vscode/srcdev-component-accordian-core.code-snippets +0 -74
- package/app/components/02.molecules/expandable/accordian/CONSUMER-STYLING.md +0 -100
- package/app/components/02.molecules/expandable/accordian/stories/AccordianCore.stories.ts +0 -272
- package/app/components/02.molecules/expandable/accordian/tests/AccordianCore.spec.ts +0 -257
- 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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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>
|
|
@@ -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="
|
|
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="
|
|
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="
|
|
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="
|
|
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,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
|
-
|