srcdev-nuxt-components 9.3.6 → 9.3.8

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 (126) hide show
  1. package/.claude/hooks/check-component-update.sh +30 -1
  2. package/.claude/skills/components/accordian-core.md +7 -7
  3. package/.claude/skills/components/breadcrumb.md +49 -0
  4. package/.claude/skills/components/content-docs.md +2 -1
  5. package/.claude/skills/components/expanding-panel.md +5 -5
  6. package/.claude/skills/components/navigation-items.md +1 -0
  7. package/.claude/skills/components/responsive-header.md +1 -0
  8. package/.claude/skills/components/service-detail.md +156 -0
  9. package/.claude/skills/components/services-card-grid.md +9 -9
  10. package/.claude/skills/components/services-card.md +82 -30
  11. package/.claude/skills/index.md +3 -1
  12. package/.claude/skills/qa-panel.md +2 -2
  13. package/.vscode/srcdev-component-breadcrumb.code-snippets +14 -0
  14. package/.vscode/srcdev-component-service-detail.code-snippets +49 -0
  15. package/.vscode/srcdev-component-services-card.code-snippets +108 -0
  16. package/app/components/01.atoms/content-wrappers/docs-pages/ContentDocs.vue +22 -16
  17. package/app/components/01.atoms/navigation/breadcrumb/Breadcrumb.vue +94 -0
  18. package/app/components/01.atoms/navigation/breadcrumb/CONSUMER-STYLING.md +32 -0
  19. package/app/components/01.atoms/navigation/breadcrumb/stories/Breadcrumb.stories.ts +87 -0
  20. package/app/components/01.atoms/navigation/breadcrumb/tests/Breadcrumb.spec.ts +87 -0
  21. package/app/components/01.atoms/navigation/breadcrumb/tests/__snapshots__/Breadcrumb.spec.ts.snap +13 -0
  22. package/app/components/02.molecules/expandable/accordian/AccordianCore.vue +5 -1
  23. package/app/components/02.molecules/expandable/accordian/tests/AccordianCore.spec.ts +22 -14
  24. package/app/components/02.molecules/expandable/accordian/tests/__snapshots__/AccordianCore.spec.ts.snap +42 -28
  25. package/app/components/02.molecules/expandable/expanding-panel/CONSUMER-STYLING.md +8 -10
  26. package/app/components/02.molecules/expandable/expanding-panel/ExpandingPanel.vue +15 -47
  27. package/app/components/02.molecules/expandable/expanding-panel/tests/__snapshots__/ExpandingPanel.spec.ts.snap +4 -12
  28. package/app/components/03.organisms/responsive-header/NavigationItems.vue +91 -4
  29. package/app/components/03.organisms/responsive-header/ResponsiveHeader.vue +5 -1
  30. package/app/components/03.organisms/responsive-header/tests/NavigationItems.spec.ts +2 -2
  31. package/app/components/03.organisms/responsive-header/tests/__snapshots__/NavigationItems.spec.ts.snap +13 -13
  32. package/app/components/03.organisms/responsive-header/tests/__snapshots__/ResponsiveHeader.spec.ts.snap +13 -13
  33. package/app/components/03.organisms/services/service-detail/CONSUMER-STYLING.md +181 -0
  34. package/app/components/03.organisms/services/service-detail/ServiceDetail.vue +480 -0
  35. package/app/components/03.organisms/services/service-detail/stories/ServiceDetail.stories.ts +282 -0
  36. package/app/components/03.organisms/services/service-detail/tests/ServiceDetail.spec.ts +270 -0
  37. package/app/components/03.organisms/services/service-detail/tests/__snapshots__/ServiceDetail.spec.ts.snap +99 -0
  38. package/app/components/03.organisms/services/services-card/CONSUMER-STYLING.md +129 -0
  39. package/app/components/03.organisms/services/services-card/ServicesCard.vue +153 -39
  40. package/app/components/03.organisms/services/services-card/stories/ServicesCard.stories.ts +65 -0
  41. package/app/components/03.organisms/services/services-card/tests/ServicesCard.spec.ts +82 -0
  42. package/app/components/03.organisms/services/services-card/tests/__snapshots__/ServicesCard.spec.ts.snap +13 -5
  43. package/app/components/03.organisms/services/services-grids/ServicesCardGrid.vue +3 -7
  44. package/app/components/03.organisms/services/services-grids/stories/ServicesCardGrid.stories.ts +126 -2
  45. package/app/components/03.organisms/services/services-grids/stories/ServicesSectionGrid.stories.ts +6 -0
  46. package/app/components/03.organisms/services/services-grids/tests/__snapshots__/ServicesCardGrid.spec.ts.snap +51 -27
  47. package/app/components/03.organisms/services/services-section/ServicesSection.vue +19 -0
  48. package/app/components/03.organisms/services/services-section/tests/__snapshots__/ServicesSection.spec.ts.snap +8 -8
  49. package/app/types/components/breadcrumb.ts +4 -0
  50. package/app/types/components/index.ts +1 -0
  51. package/package.json +2 -2
  52. package/app/pages/auto-grid.vue +0 -328
  53. package/app/pages/banner-video.vue +0 -238
  54. package/app/pages/forms/examples/buttons/index.vue +0 -259
  55. package/app/pages/forms/examples/material/checkbox-radio-panels.vue +0 -244
  56. package/app/pages/forms/examples/material/cssbattle.vue +0 -60
  57. package/app/pages/forms/examples/material/text-fields.vue +0 -910
  58. package/app/pages/grid-stack.vue +0 -252
  59. package/app/pages/index.vue +0 -127
  60. package/app/pages/page-hero-highlights.vue +0 -204
  61. package/app/pages/samaritan.vue +0 -327
  62. package/app/pages/typography/hero-text.vue +0 -97
  63. package/app/pages/typography/index.vue +0 -39
  64. package/app/pages/typography/page-body.vue +0 -171
  65. package/app/pages/typography/page-heading.vue +0 -76
  66. package/app/pages/typography/page-link.vue +0 -103
  67. package/app/pages/ui/accordian.vue +0 -211
  68. package/app/pages/ui/anchor-scroll-tab-navigation.vue +0 -191
  69. package/app/pages/ui/anchor-scroll.vue +0 -367
  70. package/app/pages/ui/animated-svg-text.vue +0 -85
  71. package/app/pages/ui/block-decorators.vue +0 -142
  72. package/app/pages/ui/card-core.vue +0 -82
  73. package/app/pages/ui/carousel-basic.vue +0 -292
  74. package/app/pages/ui/carousel-flip.vue +0 -449
  75. package/app/pages/ui/carousel-infinite.vue +0 -260
  76. package/app/pages/ui/clipped-panels.vue +0 -101
  77. package/app/pages/ui/contact-section.vue +0 -323
  78. package/app/pages/ui/container-glow.vue +0 -106
  79. package/app/pages/ui/content-width.vue +0 -126
  80. package/app/pages/ui/deep-expanding-menu.vue +0 -138
  81. package/app/pages/ui/display-avatar.vue +0 -253
  82. package/app/pages/ui/display-banner.vue +0 -78
  83. package/app/pages/ui/display-chip.vue +0 -367
  84. package/app/pages/ui/display-details.vue +0 -171
  85. package/app/pages/ui/display-dialog.vue +0 -344
  86. package/app/pages/ui/display-pill.vue +0 -396
  87. package/app/pages/ui/display-prompt.vue +0 -284
  88. package/app/pages/ui/display-toast.vue +0 -311
  89. package/app/pages/ui/expanding-panel.vue +0 -326
  90. package/app/pages/ui/glowing-border.vue +0 -111
  91. package/app/pages/ui/layout-content-docs.vue +0 -72
  92. package/app/pages/ui/layout-grid-a.vue +0 -96
  93. package/app/pages/ui/layout-grid-b.vue +0 -132
  94. package/app/pages/ui/magnetic-navigation.vue +0 -50
  95. package/app/pages/ui/marquee-scroller.vue +0 -99
  96. package/app/pages/ui/mask-element.vue +0 -104
  97. package/app/pages/ui/masonry-columns.vue +0 -55
  98. package/app/pages/ui/masonry-grid-ordered-experiment.vue +0 -79
  99. package/app/pages/ui/masonry-grid-ordered.vue +0 -56
  100. package/app/pages/ui/masonry-grid-sorted.vue +0 -55
  101. package/app/pages/ui/masonry-grid.vue +0 -55
  102. package/app/pages/ui/navigation/navigation-horizontal.vue +0 -484
  103. package/app/pages/ui/navigation/site-navigation/about.vue +0 -36
  104. package/app/pages/ui/navigation/site-navigation/contact.vue +0 -39
  105. package/app/pages/ui/navigation/site-navigation/index.vue +0 -38
  106. package/app/pages/ui/navigation/site-navigation/portfolio.vue +0 -43
  107. package/app/pages/ui/navigation/site-navigation/services.vue +0 -42
  108. package/app/pages/ui/navigation/tab-navigation.vue +0 -493
  109. package/app/pages/ui/page-row.vue +0 -127
  110. package/app/pages/ui/price-list.vue +0 -65
  111. package/app/pages/ui/profile-section.vue +0 -142
  112. package/app/pages/ui/qr-code/[componentName].vue +0 -218
  113. package/app/pages/ui/rotating-carousel.vue +0 -154
  114. package/app/pages/ui/scroll-reveal-image.vue +0 -483
  115. package/app/pages/ui/section-parallax.vue +0 -54
  116. package/app/pages/ui/services/colour-finder.vue +0 -43
  117. package/app/pages/ui/services/services-cards.vue +0 -57
  118. package/app/pages/ui/services/services-section/[slug].vue +0 -61
  119. package/app/pages/ui/services/services-sections-compact.vue +0 -64
  120. package/app/pages/ui/settings.vue +0 -54
  121. package/app/pages/ui/simple-grid.vue +0 -55
  122. package/app/pages/ui/slider-gallery.vue +0 -261
  123. package/app/pages/ui/tabs-y.vue +0 -107
  124. package/app/pages/ui/tabs.vue +0 -189
  125. package/app/pages/ui/tooltips.vue +0 -104
  126. package/app/pages/ui/wipe-away-vertical.vue +0 -129
@@ -1,76 +0,0 @@
1
- <template>
2
- <div>
3
- <NuxtLayout name="default">
4
- <template #layout-content>
5
- <PageRow tag="div" variant="full" :style-class-passthrough="['mbe-20']">
6
- <h1 class="page-heading-1">Typography - Heading Text</h1>
7
- <p class="page-body-normal">Page heading styles</p>
8
- <p class="page-body-normal">Use within main body content</p>
9
-
10
- <div class="demo-row">
11
- <strong>page-heading-1</strong>
12
- <div class="class-demo page-heading-1">Lorum ipsum dolor sit amet, consectetur adipiscing elit.</div>
13
- </div>
14
-
15
- <div class="demo-row">
16
- <strong>page-heading-2</strong>
17
- <div class="class-demo page-heading-2">Lorum ipsum dolor sit amet, consectetur adipiscing elit.</div>
18
- </div>
19
-
20
- <div class="demo-row">
21
- <strong>page-heading-3</strong>
22
- <div class="class-demo page-heading-3">
23
- Lorum ipsum dolor sit amet, consectetur adipiscing elit. Lorum ipsum dolor sit amet, consectetur
24
- adipiscing elit.
25
- </div>
26
- </div>
27
-
28
- <div class="demo-row">
29
- <strong>page-heading-4</strong>
30
- <div class="class-demo page-heading-4">Lorum ipsum dolor sit amet, consectetur adipiscing elit.</div>
31
- </div>
32
-
33
- <div class="demo-row">
34
- <strong>page-heading-5</strong>
35
- <div class="class-demo page-heading-5">Lorum ipsum dolor sit amet, consectetur adipiscing elit.</div>
36
- </div>
37
-
38
- <div class="demo-row">
39
- <strong>page-heading-6</strong>
40
- <div class="class-demo page-heading-6">Lorum ipsum dolor sit amet, consectetur adipiscing elit.</div>
41
- </div>
42
- </PageRow>
43
- </template>
44
- </NuxtLayout>
45
- </div>
46
- </template>
47
-
48
- <script setup lang="ts">
49
- definePageMeta({
50
- layout: false,
51
- });
52
-
53
- useHead({
54
- title: "Typography",
55
- meta: [{ name: "description", content: "Typography" }],
56
- bodyAttrs: {
57
- class: "page-typography-heading",
58
- },
59
- });
60
- </script>
61
-
62
- <style lang="css">
63
- .page-typography-heading {
64
- .demo-row {
65
- margin-block-end: 1rem;
66
- strong {
67
- display: block;
68
- margin-block: 0;
69
- }
70
- .class-demo {
71
- display: block;
72
- margin-block-end: 1rem;
73
- }
74
- }
75
- }
76
- </style>
@@ -1,103 +0,0 @@
1
- <template>
2
- <div>
3
- <NuxtLayout name="default">
4
- <template #layout-content>
5
- <PageRow tag="div" variant="full" :style-class-passthrough="['mbe-20']">
6
- <h1 class="page-heading-1">Typography - Link Text</h1>
7
- <p class="page-body-normal">Page link styles</p>
8
- <p class="page-body-normal">Use within main body content</p>
9
-
10
- <div class="demo-row">
11
- <strong>page-link-large</strong>
12
- <a href="#" class="class-demo page-link-large">Lorum ipsum dolor sit amet, consectetur adipiscing elit.</a>
13
- </div>
14
-
15
- <div class="demo-row">
16
- <strong>page-link-large-semibold</strong>
17
- <a href="#" class="class-demo page-link-large-semibold">
18
- Lorum ipsum dolor sit amet, consectetur adipiscing elit.
19
- </a>
20
- </div>
21
-
22
- <div class="demo-row">
23
- <strong>page-link-medium</strong>
24
- <a href="#" class="class-demo page-link-medium">Lorum ipsum dolor sit amet, consectetur adipiscing elit.</a>
25
- </div>
26
-
27
- <div class="demo-row">
28
- <strong>page-link-medium-semibold</strong>
29
- <a href="#" class="class-demo page-link-medium-semibold">
30
- Lorum ipsum dolor sit amet, consectetur adipiscing elit.
31
- </a>
32
- </div>
33
-
34
- <div class="demo-row">
35
- <strong>page-link-normal</strong>
36
- <a href="#" class="class-demo page-link-normal">Lorum ipsum dolor sit amet, consectetur adipiscing elit.</a>
37
- </div>
38
-
39
- <div class="demo-row">
40
- <strong>page-link-normal-semibold</strong>
41
- <a href="#" class="class-demo page-link-normal-semibold">
42
- Lorum ipsum dolor sit amet, consectetur adipiscing elit.
43
- </a>
44
- </div>
45
-
46
- <div class="demo-row">
47
- <strong>page-link-small</strong>
48
- <a href="#" class="class-demo page-link-small">Lorum ipsum dolor sit amet, consectetur adipiscing elit.</a>
49
- </div>
50
-
51
- <div class="demo-row">
52
- <strong>page-link-small-semibold</strong>
53
- <a href="#" class="class-demo page-link-small-semibold">
54
- Lorum ipsum dolor sit amet, consectetur adipiscing elit.
55
- </a>
56
- </div>
57
-
58
- <div class="demo-row">
59
- <strong>page-link-xsmall</strong>
60
- <a href="#" class="class-demo page-link-xsmall">Lorum ipsum dolor sit amet, consectetur adipiscing elit.</a>
61
- </div>
62
-
63
- <div class="demo-row">
64
- <strong>page-link-xsmall-semibold</strong>
65
- <a href="#" class="class-demo page-link-xsmall-semibold">
66
- Lorum ipsum dolor sit amet, consectetur adipiscing elit.
67
- </a>
68
- </div>
69
- </PageRow>
70
- </template>
71
- </NuxtLayout>
72
- </div>
73
- </template>
74
-
75
- <script setup lang="ts">
76
- definePageMeta({
77
- layout: false,
78
- });
79
-
80
- useHead({
81
- title: "Typography",
82
- meta: [{ name: "description", content: "Typography" }],
83
- bodyAttrs: {
84
- class: "page-typography-link",
85
- },
86
- });
87
- </script>
88
-
89
- <style lang="css">
90
- .page-typography-link {
91
- .demo-row {
92
- margin-block-end: 1rem;
93
- strong {
94
- display: block;
95
- margin-block: 0;
96
- }
97
- .class-demo {
98
- display: inline-block;
99
- margin-block-end: 1rem;
100
- }
101
- }
102
- }
103
- </style>
@@ -1,211 +0,0 @@
1
- <template>
2
- <div>
3
- <NuxtLayout name="default">
4
- <template #layout-content>
5
- <PageRow tag="div" variant="popout" :style-class-passthrough="['mbe-20']">
6
- <h1 class="page-heading-2">Accordian</h1>
7
- <p>Any item open and/closed</p>
8
-
9
- <AccordianCore
10
- :item-count="data.length ?? 0"
11
- :animation-duration="1000"
12
- :style-class-passthrough="['class-modifier-narrow']"
13
- >
14
- <template v-for="(item, key) in data" :key="`summary-${key}`" #[`accordian-${key}-summary`]>
15
- {{ key }} - {{ item.title }}
16
- </template>
17
- <template v-for="(item, key) in data" :key="`icon-${key}`" #[`accordian-${key}-icon`]>
18
- <Icon name="bi:caret-down-fill" class="icon" />
19
- </template>
20
- <template v-for="(item, key) in data" :key="`content-${key}`" #[`accordian-${key}-content`]>
21
- <p class="pb-12">{{ item.content }}</p>
22
- </template>
23
- </AccordianCore>
24
- </PageRow>
25
-
26
- <PageRow tag="div" variant="popout" :style-class-passthrough="['mbe-20']">
27
- <h2 class="page-heading-2">Accordian</h2>
28
- <p>Only 1 item open, pass a name prop</p>
29
-
30
- <AccordianCore
31
- :item-count="3"
32
- :name="`accordian-${useId()}`"
33
- :animation-duration="400"
34
- :style-class-passthrough="['class-modifier-wide']"
35
- >
36
- <template v-for="(item, key) in data" :key="`summary-${key}`" #[`accordian-${key}-summary`]>
37
- {{ key }} - {{ item.title }}
38
- </template>
39
- <template v-for="(item, key) in data" :key="`icon-${key}`" #[`accordian-${key}-icon`]>
40
- <Icon name="bi:caret-down-fill" class="icon" />
41
- </template>
42
- <template #[`accordian-0-content`]>
43
- <p class="pb-12">This is content slot 0</p>
44
- </template>
45
- <template #[`accordian-1-content`]>
46
- <p class="pb-12">This is content slot 1</p>
47
- </template>
48
- <template #[`accordian-2-content`]>
49
- <p class="pb-12">This is content slot 2</p>
50
- </template>
51
- </AccordianCore>
52
- </PageRow>
53
- </template>
54
- </NuxtLayout>
55
- </div>
56
- </template>
57
-
58
- <script setup lang="ts">
59
- definePageMeta({
60
- layout: false,
61
- });
62
-
63
- useHead({
64
- title: "Display Accordian",
65
- meta: [{ name: "description", content: "Display Accordian" }],
66
- bodyAttrs: {
67
- class: "",
68
- },
69
- });
70
-
71
- interface IAccordianData {
72
- title: string;
73
- content: string;
74
- }
75
-
76
- const data = ref<IAccordianData[]>([
77
- {
78
- title: "Trigger Item 1",
79
- content:
80
- "Lorem ipsum dolor sit amet consectetur, adipisicing elit. Iusto, amet!. Lorem ipsum dolor sit, adipisicing elit. Iusto, amet!",
81
- },
82
- {
83
- title: "Trigger Item 2",
84
- content: "Lorem ipsum dolor sit amet consectetur, adipisicing elit. Iusto, amet!",
85
- },
86
- {
87
- title: "Trigger Item 3",
88
- content:
89
- "Lorem ipsum dolor sit amet consectetur, adipisicing elit. Iusto, amet!, Lorem ipsum dolor sit amet consectetur, adipisicing elit. Iusto, amet! Lorem ipsum dolor sit amet consectetur, adipisicing elit. Iusto, amet!",
90
- },
91
- {
92
- title: "Trigger Item 4",
93
- content:
94
- "Lorem ipsum dolor sit amet consectetur, adipisicing elit. Iusto, amet!, Lorem ipsum dolor sit amet consectetur, adipisicing elit. Iusto, amet! Lorem ipsum dolor sit amet consectetur, adipisicing elit. Iusto, amet!",
95
- },
96
- ]);
97
- </script>
98
-
99
- <style lang="css">
100
- .class-modifier-wide {
101
- &.display-accordian {
102
- max-width: 800px;
103
- margin: 0 auto;
104
- }
105
- }
106
-
107
- .class-modifier-narrow {
108
- &.display-accordian {
109
- max-width: 300px;
110
- margin: 0 auto;
111
-
112
- .accordian-item {
113
- &.expanding-panel {
114
- --_border-radius: 0.6rem;
115
- --_margin-block-end: 1rem;
116
-
117
- border: 1px solid var(--slate-00);
118
- /* transition:
119
- margin-block-end 300ms ease-in-out,
120
- border-radius 300ms ease-in-out; */
121
-
122
- /* Default state: first element gets top corners, last gets bottom corners */
123
- &:first-child {
124
- border-start-start-radius: var(--_border-radius);
125
- border-start-end-radius: var(--_border-radius);
126
- }
127
-
128
- &:last-child {
129
- border-end-start-radius: var(--_border-radius);
130
- border-end-end-radius: var(--_border-radius);
131
- }
132
-
133
- /* When current element is open: gets full border-radius and reduced margin */
134
- &:has(.expanding-panel-details[open]) {
135
- will-change: margin-block-end, border-radius;
136
- border-radius: var(--_border-radius);
137
- margin-block-end: var(--_margin-block-end);
138
-
139
- &:first-child {
140
- margin-block-end: var(--_margin-block-end);
141
- }
142
- }
143
-
144
- /* When immediately before an open element: gets bottom corners and margin */
145
- &:has(+ .expanding-panel .expanding-panel-details[open]) {
146
- will-change: margin-block-end, border-radius;
147
- border-end-start-radius: var(--_border-radius);
148
- border-end-end-radius: var(--_border-radius);
149
- margin-block-end: var(--_margin-block-end);
150
- }
151
-
152
- /* Override: if last child and previous element is open, keep bottom corners */
153
- &:last-child:has(.expanding-panel-details:not([open])) {
154
- border-end-start-radius: var(--_border-radius);
155
- border-end-end-radius: var(--_border-radius);
156
- }
157
-
158
- /* When following an open element: only gets top corners (not full border-radius) */
159
- &:has(.expanding-panel-details[open]) + .expanding-panel {
160
- border-start-start-radius: var(--_border-radius);
161
- border-start-end-radius: var(--_border-radius);
162
- }
163
-
164
- .expanding-panel-details {
165
- padding-block: 0.8rem;
166
- padding-inline: 1.4rem;
167
-
168
- .expanding-panel-summary {
169
- padding: 0.1rem;
170
-
171
- .label-wrapper {
172
- /* Custom css */
173
- }
174
- .icon-wrapper {
175
- /* Custom css */
176
-
177
- .icon {
178
- /* Custom css */
179
- }
180
- }
181
- }
182
-
183
- &[open] {
184
- .expanding-panel-summary {
185
- .icon-wrapper {
186
- .icon {
187
- /* Custom css */
188
- }
189
- }
190
- }
191
- + .expanding-panel-content {
192
- /* Custom css */
193
- .inner {
194
- /* Custom css */
195
- }
196
- }
197
- }
198
- }
199
-
200
- .expanding-panel-content {
201
- /* Custom css */
202
-
203
- .inner {
204
- /* Custom css */
205
- }
206
- }
207
- }
208
- }
209
- }
210
- }
211
- </style>
@@ -1,191 +0,0 @@
1
- <template>
2
- <div>
3
- <NuxtLayout name="default">
4
- <template #layout-content>
5
- <PageRow tag="div" variant="content" :style-class-passthrough="['mbe-4']">
6
- <h1 class="page-heading-1">Anchor Scroll — TabNavigation</h1>
7
- <p class="page-body-medium">
8
- Tests
9
- <code class="inline-code">TabNavigation</code>
10
- with anchor hrefs. The nav uses plain
11
- <code class="inline-code">&lt;a&gt;</code>
12
- tags for hash links (not
13
- <code class="inline-code">NuxtLink</code>
14
- ) to keep Vue Router out of the smooth-scroll path. The
15
- <code class="inline-code">:anchor-scroll-offset</code>
16
- prop passes a getter so the sticky bar height is read at scroll time.
17
- </p>
18
- </PageRow>
19
-
20
- <div ref="stickyNavRef" class="anchor-tab-nav-sticky">
21
- <PageRow tag="div" variant="content">
22
- <TabNavigation
23
- :nav-item-data="anchorNavData"
24
- :anchor-scroll-offset="() => stickyNavRef?.offsetHeight ?? 0"
25
- />
26
- </PageRow>
27
- </div>
28
-
29
- <section id="overview" class="anchor-tab-section">
30
- <PageRow tag="div" variant="content">
31
- <h2 class="page-heading-2">Overview</h2>
32
- <p class="page-body-medium">
33
- This section verifies that clicking the
34
- <strong>Overview</strong>
35
- link above scrolls here smoothly, with the heading landing below the sticky nav bar rather than behind it.
36
- </p>
37
- <p class="page-body-medium">
38
- The sticky nav's height is resolved at click time via the getter passed to
39
- <code class="inline-code">:anchor-scroll-offset</code>
40
- . Resize the viewport — the offset adjusts automatically.
41
- </p>
42
- <p class="page-body-medium">
43
- Hash links in
44
- <code class="inline-code">TabNavigation</code>
45
- render as plain
46
- <code class="inline-code">&lt;a&gt;</code>
47
- elements (not
48
- <code class="inline-code">NuxtLink</code>
49
- ), which prevents Vue Router from intercepting the click and triggering its own scroll behaviour.
50
- </p>
51
- </PageRow>
52
- </section>
53
-
54
- <section id="api" class="anchor-tab-section">
55
- <PageRow tag="div" variant="content">
56
- <h2 class="page-heading-2">API</h2>
57
- <p class="page-body-medium">
58
- This section verifies the
59
- <strong>API</strong>
60
- link. Confirm the heading lands below the sticky nav after scrolling.
61
- </p>
62
- <p class="page-body-medium">
63
- The
64
- <code class="inline-code">anchorScrollOffset</code>
65
- prop on
66
- <code class="inline-code">TabNavigation</code>
67
- accepts
68
- <code class="inline-code">number | (() => number)</code>
69
- — the same type as the
70
- <code class="inline-code">offset</code>
71
- option on
72
- <code class="inline-code">useAnchorScroll</code>
73
- directly. It is forwarded verbatim to the composable.
74
- </p>
75
- <div class="demo-code">
76
- const navItemData = { main: [ { text: "Overview", href: "#overview" }, { text: "API", href: "#api" }, {
77
- text: "Usage", href: "#usage" }, { text: "Motion", href: "#motion" }, ], };
78
- </div>
79
- <div class="demo-code">
80
- &lt;div ref="stickyNavRef"&gt; &lt;TabNavigation :nav-item-data="navItemData" :anchor-scroll-offset="() =>
81
- stickyNavRef?.offsetHeight ?? 0" /&gt; &lt;/div&gt;
82
- </div>
83
- </PageRow>
84
- </section>
85
-
86
- <section id="usage" class="anchor-tab-section">
87
- <PageRow tag="div" variant="content">
88
- <h2 class="page-heading-2">Usage</h2>
89
- <p class="page-body-medium">
90
- This section verifies the
91
- <strong>Usage</strong>
92
- link. Confirm the heading lands below the sticky nav after scrolling.
93
- </p>
94
- <p class="page-body-medium">
95
- Mixed navigation — routes and anchor hrefs in the same
96
- <code class="inline-code">navItemData</code>
97
- — is supported. Route items render as
98
- <code class="inline-code">NuxtLink</code>
99
- ; anchor items render as plain
100
- <code class="inline-code">&lt;a&gt;</code>
101
- . The handler is a no-op for routes so both types can share the same click binding.
102
- </p>
103
- <div class="demo-code">
104
- const navItemData = { main: [ { text: "About", href: "#about" }, // anchor — plain &lt;a&gt; { text:
105
- "Services", href: "#services" }, // anchor — plain &lt;a&gt; { text: "Blog", href: "/blog" }, // route —
106
- NuxtLink { text: "Contact", href: "#contact" }, // anchor — plain &lt;a&gt; ], };
107
- </div>
108
- </PageRow>
109
- </section>
110
-
111
- <section id="motion" class="anchor-tab-section">
112
- <PageRow tag="div" variant="content">
113
- <h2 class="page-heading-2">Reduced Motion</h2>
114
- <p class="page-body-medium">
115
- This section verifies the
116
- <strong>Reduced Motion</strong>
117
- link. With
118
- <em>Reduce Motion</em>
119
- enabled in OS accessibility settings, clicks should produce an instant jump rather than a smooth scroll —
120
- and the offset should still be respected.
121
- </p>
122
- <p class="page-body-medium">
123
- To test on macOS:
124
- <strong>System Settings → Accessibility → Display → Reduce Motion</strong>
125
- . Refresh the page after toggling, then click any section link above.
126
- </p>
127
- </PageRow>
128
- </section>
129
- </template>
130
- </NuxtLayout>
131
- </div>
132
- </template>
133
-
134
- <script setup lang="ts">
135
- import type { NavItemData } from "~/types/components";
136
-
137
- definePageMeta({ layout: false });
138
-
139
- const stickyNavRef = ref<HTMLElement | null>(null);
140
-
141
- const anchorNavData: NavItemData = {
142
- main: [
143
- { text: "Overview", href: "#overview" },
144
- { text: "API", href: "#api" },
145
- { text: "Usage", href: "#usage" },
146
- { text: "Reduced Motion", href: "#motion" },
147
- ],
148
- };
149
- </script>
150
-
151
- <style lang="css">
152
- .anchor-tab-nav-sticky {
153
- position: sticky;
154
- top: 0;
155
- z-index: 5;
156
- background-color: var(--page-bg, #000);
157
- border-block-end: 1px solid oklch(100% 0 0 / 10%);
158
- }
159
-
160
- .anchor-tab-section {
161
- min-block-size: 60vh;
162
- padding-block: 6rem 8rem;
163
- border-block-end: 1px solid oklch(100% 0 0 / 8%);
164
-
165
- &:last-child {
166
- border-block-end: none;
167
- }
168
-
169
- .page-heading-2 {
170
- margin-block-end: 2rem;
171
- }
172
-
173
- .page-body-medium {
174
- margin-block-end: 1.6rem;
175
- }
176
- }
177
-
178
- .demo-code {
179
- background-color: oklch(100% 0 0 / 4%);
180
- border: 1px solid oklch(100% 0 0 / 10%);
181
- border-radius: 0.6rem;
182
- padding: 1.8rem 2rem;
183
- overflow-x: auto;
184
- font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
185
- font-size: 1.3rem;
186
- line-height: 1.65;
187
- margin-block: 1.2rem 2rem;
188
- white-space: pre;
189
- color: var(--slate-01, currentColor);
190
- }
191
- </style>