srcdev-nuxt-components 9.4.9 → 9.4.11
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/commands/migrate-component.md +38 -6
- package/.claude/component-ledger/audit.json +1 -1
- package/.claude/component-ledger/build.mjs +26 -0
- package/.claude/component-ledger/output.html +8 -3
- package/.claude/component-ledger/template.html +7 -2
- package/.claude/skills/component-dynamic-slots.md +1 -1
- package/.claude/skills/components/alert-mask-core.md +84 -0
- package/.claude/skills/components/canvas-switcher.md +1 -1
- package/.claude/skills/components/carousel-flip.md +112 -168
- package/.claude/skills/components/container-glow.md +123 -0
- package/.claude/skills/components/dashboard-quad-grid.md +98 -0
- package/.claude/skills/components/dashboard-stats-grid.md +103 -0
- package/.claude/skills/components/display-theme-switch.md +60 -0
- package/.claude/skills/components/glowing-border.md +66 -0
- package/.claude/skills/components/input-number-core.md +214 -0
- package/.claude/skills/components/input-range-core.md +142 -0
- package/.claude/skills/components/input-select-core.md +151 -0
- package/.claude/skills/components/input-text-core.md +16 -0
- package/.claude/skills/components/input-textarea-core.md +154 -0
- package/.claude/skills/components/section-parallax.md +32 -10
- package/.claude/skills/components/select-menu.md +195 -0
- package/.claude/skills/components/toggle-switch-core.md +150 -0
- package/.claude/skills/components/ui-block-decorated.md +56 -0
- package/.claude/skills/components/wipe-away-vertical.md +98 -0
- package/.claude/skills/icon-sets.md +1 -1
- package/.claude/skills/index.md +15 -1
- package/.vscode/css-custom-data.json +38 -0
- package/.vscode/settings.json +3 -0
- package/.vscode/srcdev-component-alert-mask-core.code-snippets +31 -0
- package/.vscode/srcdev-component-carousel-flip.code-snippets +41 -0
- package/.vscode/srcdev-component-container-glow.code-snippets +33 -0
- package/.vscode/srcdev-component-dashboard-quad-grid.code-snippets +36 -0
- package/.vscode/srcdev-component-dashboard-stats-grid.code-snippets +35 -0
- package/.vscode/srcdev-component-display-theme-switch.code-snippets +27 -0
- package/.vscode/srcdev-component-glowing-border.code-snippets +23 -0
- package/.vscode/srcdev-component-input-number.code-snippets +65 -0
- package/.vscode/srcdev-component-input-range.code-snippets +85 -0
- package/.vscode/srcdev-component-input-select.code-snippets +42 -0
- package/.vscode/srcdev-component-input-textarea.code-snippets +40 -0
- package/.vscode/srcdev-component-section-parallax.code-snippets +27 -0
- package/.vscode/srcdev-component-select-menu.code-snippets +65 -0
- package/.vscode/srcdev-component-toggle-switch.code-snippets +49 -0
- package/.vscode/srcdev-component-ui-block-decorated.code-snippets +24 -0
- package/.vscode/srcdev-component-wipe-away-vertical.code-snippets +25 -0
- package/README.md +18 -37
- package/app/components/{alert-mask → 01.atoms/alert-mask}/AlertMaskCore.vue +16 -17
- package/app/components/01.atoms/alert-mask/CONSUMER-STYLING.md +46 -0
- package/app/components/01.atoms/alert-mask/stories/AlertMaskCore.stories.ts +79 -0
- package/app/components/{alert-mask → 01.atoms/alert-mask}/tests/AlertMaskCore.spec.ts +10 -10
- package/app/components/01.atoms/animations/container-glow/CONSUMER-STYLING.md +86 -0
- package/app/components/01.atoms/animations/container-glow/ContainerGlow.vue +299 -0
- package/app/components/01.atoms/animations/container-glow/stories/ContainerGlow.stories.ts +175 -0
- package/app/components/01.atoms/animations/container-glow/tests/ContainerGlow.spec.ts +131 -0
- package/app/components/01.atoms/animations/container-glow/tests/__snapshots__/ContainerGlow.spec.ts.snap +14 -0
- package/app/components/01.atoms/animations/glowing-border/CONSUMER-STYLING.md +61 -0
- package/app/components/01.atoms/animations/glowing-border/GlowingBorder.vue +132 -0
- package/app/components/01.atoms/animations/glowing-border/stories/GlowingBorder.stories.ts +165 -0
- package/app/components/01.atoms/animations/glowing-border/tests/GlowingBorder.spec.ts +94 -0
- package/app/components/01.atoms/animations/glowing-border/tests/__snapshots__/GlowingBorder.spec.ts.snap +3 -0
- package/app/components/01.atoms/animations/marquee-scroller/CONSUMER-STYLING.md +1 -1
- package/app/components/01.atoms/animations/marquee-scroller/MarqueeScroller.vue +1 -1
- package/app/components/01.atoms/animations/marquee-scroller/stories/MarqueeScroller.stories.ts +1 -1
- package/app/components/01.atoms/animations/section-parallax/CONSUMER-STYLING.md +44 -0
- package/app/components/{parallax → 01.atoms/animations/section-parallax}/SectionParallax.vue +11 -10
- package/app/components/01.atoms/animations/section-parallax/stories/SectionParallax.stories.ts +98 -0
- package/app/components/01.atoms/animations/section-parallax/tests/SectionParallax.spec.ts +102 -0
- package/app/components/01.atoms/animations/section-parallax/tests/__snapshots__/SectionParallax.spec.ts.snap +9 -0
- package/app/components/01.atoms/animations/view-timeline/CONSUMER-STYLING.md +70 -0
- package/app/components/01.atoms/animations/view-timeline/WipeAwayVertical.vue +181 -0
- package/app/components/01.atoms/animations/view-timeline/stories/WipeAwayVertical.stories.ts +269 -0
- package/app/components/01.atoms/animations/view-timeline/tests/WipeAwayVertical.spec.ts +127 -0
- package/app/components/01.atoms/canvas-switcher/CONSUMER-STYLING.md +3 -3
- package/app/components/01.atoms/canvas-switcher/CanvasSwitcher.vue +2 -2
- package/app/components/01.atoms/canvas-switcher/stories/CanvasSwitcher.stories.ts +1 -1
- package/app/components/01.atoms/card/CardCore.vue +4 -4
- package/app/components/01.atoms/clipped-panel/CONSUMER-STYLING.md +2 -2
- package/app/components/01.atoms/clipped-panel/ClippedPanel.vue +2 -2
- package/app/components/01.atoms/content-wrappers/layout-grid/dashboard-quad-grid/CONSUMER-STYLING.md +42 -0
- package/app/components/{layout-grids/LayoutGridA.vue → 01.atoms/content-wrappers/layout-grid/dashboard-quad-grid/DashboardQuadGrid.vue} +23 -13
- package/app/components/{layout-grids/stories/LayoutGridA.stories.ts → 01.atoms/content-wrappers/layout-grid/dashboard-quad-grid/stories/DashboardQuadGrid.stories.ts} +151 -23
- package/app/components/{layout-grids/tests/LayoutGridA.spec.ts → 01.atoms/content-wrappers/layout-grid/dashboard-quad-grid/tests/DashboardQuadGrid.spec.ts} +25 -25
- package/app/components/01.atoms/content-wrappers/layout-grid/dashboard-stats-grid/CONSUMER-STYLING.md +41 -0
- package/app/components/01.atoms/content-wrappers/layout-grid/dashboard-stats-grid/DashboardStatsGrid.vue +133 -0
- package/app/components/{layout-grids/stories/LayoutGridB.stories.ts → 01.atoms/content-wrappers/layout-grid/dashboard-stats-grid/stories/DashboardStatsGrid.stories.ts} +24 -24
- package/app/components/{layout-grids/tests/LayoutGridB.spec.ts → 01.atoms/content-wrappers/layout-grid/dashboard-stats-grid/tests/DashboardStatsGrid.spec.ts} +23 -23
- package/app/components/01.atoms/display-tooltip/CONSUMER-STYLING.md +8 -8
- package/app/components/01.atoms/display-tooltip/DisplayTooltip.vue +8 -8
- package/app/components/01.atoms/pop-over/CONSUMER-STYLING.md +6 -6
- package/app/components/01.atoms/pop-over/PopOver.vue +6 -6
- package/app/components/01.atoms/ui-block-decorated/CONSUMER-STYLING.md +39 -0
- package/app/components/01.atoms/ui-block-decorated/UiBlockDecorated.vue +141 -0
- package/app/components/01.atoms/ui-block-decorated/stories/UiBlockDecorated.stories.ts +148 -0
- package/app/components/01.atoms/ui-block-decorated/tests/UiBlockDecorated.spec.ts +80 -0
- package/app/components/01.atoms/ui-block-decorated/tests/__snapshots__/UiBlockDecorated.spec.ts.snap +3 -0
- package/app/components/02.molecules/alert-masked-content/tests/AlertMaskedContent.spec.ts +6 -6
- package/app/components/02.molecules/display-theme-switch/CONSUMER-STYLING.md +34 -0
- package/app/components/02.molecules/display-theme-switch/DisplayThemeSwitch.vue +102 -0
- package/app/components/02.molecules/display-theme-switch/stories/DisplayThemeSwitch.stories.ts +115 -0
- package/app/components/02.molecules/display-theme-switch/tests/DisplayThemeSwitch.spec.ts +86 -0
- package/app/components/02.molecules/navigation/deep-expanding-menu/CONSUMER-STYLING.md +1 -1
- package/app/components/02.molecules/navigation/deep-expanding-menu/DeepExpandingMenu.vue +1 -1
- package/app/components/02.molecules/navigation/deep-expanding-menu-classic/CONSUMER-STYLING.md +1 -1
- package/app/components/02.molecules/navigation/deep-expanding-menu-classic/DeepExpandingMenuClassic.vue +1 -1
- package/app/components/02.molecules/select-menu/CONSUMER-STYLING.md +168 -0
- package/app/components/02.molecules/select-menu/SelectMenu.vue +384 -0
- package/app/components/02.molecules/select-menu/stories/SelectMenu.stories.ts +359 -0
- package/app/components/02.molecules/select-menu/tests/SelectMenu.spec.ts +476 -0
- package/app/components/02.molecules/select-menu/tests/__snapshots__/SelectMenu.spec.ts.snap +42 -0
- package/app/components/03.organisms/image-galleries/carousel-flip/CONSUMER-STYLING.md +46 -0
- package/app/components/{carousels → 03.organisms/image-galleries/carousel-flip}/CarouselFlip.vue +63 -42
- package/app/components/{carousels → 03.organisms/image-galleries/carousel-flip}/stories/CarouselFlip.stories.ts +114 -29
- package/app/components/{carousels → 03.organisms/image-galleries/carousel-flip}/tests/CarouselFlip.spec.ts +80 -0
- package/app/components/05.forms/form-field/FormField.vue +1 -1
- package/app/components/05.forms/form-wrapper/FormWrapper.vue +1 -1
- package/app/components/05.forms/input-button/CONSUMER-STYLING.md +2 -7
- package/app/components/05.forms/input-button/InputButtonCore.vue +1 -5
- package/app/components/05.forms/input-number/CONSUMER-STYLING.md +26 -6
- package/app/components/05.forms/input-number/InputNumberCore.vue +125 -85
- package/app/components/05.forms/input-number/stories/InputNumberCore.stories.ts +92 -0
- package/app/components/05.forms/input-number/tests/InputNumberCore.spec.ts +119 -0
- package/app/components/05.forms/input-number/variants/InputNumberDefault.vue +30 -22
- package/app/components/05.forms/input-number/variants/stories/InputNumberDefault.stories.ts +123 -0
- package/app/components/05.forms/input-number/variants/tests/InputNumberDefault.spec.ts +143 -0
- package/app/components/05.forms/input-range/CONSUMER-STYLING.md +45 -0
- package/app/components/05.forms/input-range/InputRangeCore.vue +79 -143
- package/app/components/05.forms/input-range/stories/InputRangeCore.stories.ts +126 -0
- package/app/components/05.forms/input-range/tests/InputRangeCore.spec.ts +124 -0
- package/app/components/05.forms/input-range/variants/InputRangeDefault.vue +9 -32
- package/app/components/05.forms/input-range/variants/stories/InputRangeDefault.stories.ts +108 -0
- package/app/components/05.forms/input-range/variants/tests/InputRangeDefault.spec.ts +140 -0
- package/app/components/05.forms/input-select/InputSelectCore.vue +23 -30
- package/app/components/05.forms/input-select/stories/InputSelectCore.stories.ts +2 -2
- package/app/components/05.forms/input-select/stories/InputSelectWithLabel.stories.ts +115 -0
- package/app/components/05.forms/input-select/tests/InputSelectCore.spec.ts +129 -0
- package/app/components/05.forms/input-select/variants/InputSelectWithLabel.vue +1 -1
- package/app/components/05.forms/input-select/variants/tests/InputSelectWithLabel.spec.ts +87 -0
- package/app/components/05.forms/input-text/tests/InputTextAsNumberWithLabel.spec.ts +14 -0
- package/app/components/05.forms/input-text/variants/InputTextAsNumberWithLabel.vue +1 -1
- package/app/components/05.forms/input-textarea/CONSUMER-STYLING.md +55 -0
- package/app/components/05.forms/input-textarea/InputTextareaCore.vue +24 -16
- package/app/components/05.forms/input-textarea/stories/InputTextareaWithLabel.stories.ts +1 -1
- package/app/components/05.forms/input-textarea/tests/InputTextareaCore.spec.ts +119 -0
- package/app/components/05.forms/input-textarea/variants/InputTextareaWithLabel.vue +3 -13
- package/app/components/05.forms/input-textarea/variants/tests/InputTextareaWithLabel.spec.ts +93 -0
- package/app/components/05.forms/patterns/stories/MigratedFieldsForm.stories.ts +220 -0
- package/app/components/05.forms/toggle-switch/CONSUMER-STYLING.md +29 -0
- package/app/components/05.forms/toggle-switch/ToggleSwitchCore.vue +120 -119
- package/app/components/05.forms/toggle-switch/stories/ToggleSwitchCore.stories.ts +1 -1
- package/app/components/05.forms/toggle-switch/stories/ToggleSwitchWithLabel.stories.ts +1 -1
- package/app/components/05.forms/toggle-switch/stories/ToggleSwitchWithLabelInline.stories.ts +2 -2
- package/app/components/05.forms/toggle-switch/tests/ToggleSwitchCore.spec.ts +101 -0
- package/app/components/05.forms/toggle-switch/variants/ToggleSwitchWithLabel.vue +3 -5
- package/app/components/05.forms/toggle-switch/variants/ToggleSwitchWithLabelInline.vue +1 -2
- package/app/components/05.forms/toggle-switch/variants/tests/ToggleSwitchWithLabel.spec.ts +77 -0
- package/app/components/05.forms/toggle-switch/variants/tests/ToggleSwitchWithLabelInline.spec.ts +66 -0
- package/app/components/05.forms/triple-toggle-switch/CONSUMER-STYLING.md +20 -6
- package/app/components/05.forms/triple-toggle-switch/TripleToggleSwitchCore.vue +12 -10
- package/app/types/components/container-glow.d.ts +8 -0
- package/app/types/components/index.ts +2 -1
- package/app/types/components/select-menu.d.ts +5 -0
- package/package.json +3 -2
- package/.vscode/srcdev-component-toggle-switch-core.code-snippets +0 -13
- package/app/components/05.forms/input-range-fancy/InputRangeFancyCore.vue +0 -426
- package/app/components/05.forms/input-range-fancy/InputRangeFancyWithLabel.vue +0 -94
- package/app/components/carousels/CarouselBasic.vue +0 -317
- package/app/components/carousels/CarouselInfinite.vue +0 -358
- package/app/components/container-glow/ContainerGlowCore.vue +0 -296
- package/app/components/container-glow/stories/ContainerGlowCore.stories.ts +0 -337
- package/app/components/display-theme-switch/DisplayThemeSwitch.vue +0 -189
- package/app/components/display-theme-switch/stories/DisplayThemeSwitch.stories.ts +0 -154
- package/app/components/glowing-border/GlowingBorder.vue +0 -142
- package/app/components/glowing-border/stories/GlowingBorder.stories.ts +0 -141
- package/app/components/layout-grids/LayoutGridB.vue +0 -134
- package/app/components/test-storybook/TestStorybook.vue +0 -49
- package/app/components/test-storybook/stories/TestStorybook.stories.ts +0 -28
- package/app/components/ui-block-decorated/UiBlockDecorated.vue +0 -167
- package/app/components/view-timeline/WipeAwayVertical.vue +0 -180
- package/app/types/components/carousel-basic.d.ts +0 -19
|
@@ -115,13 +115,13 @@ watch(
|
|
|
115
115
|
width: var(--display-tooltip-popover-width, 30rem);
|
|
116
116
|
|
|
117
117
|
outline: var(--display-tooltip-popover-outline-width, 0.1rem) solid
|
|
118
|
-
var(--display-tooltip-popover-outline-colour,
|
|
119
|
-
color: var(--display-tooltip-popover-text-colour,
|
|
120
|
-
background-color: var(--display-tooltip-popover-background-colour,
|
|
118
|
+
var(--display-tooltip-popover-outline-colour, var(--slate-02));
|
|
119
|
+
color: var(--display-tooltip-popover-text-colour, var(--slate-09));
|
|
120
|
+
background-color: var(--display-tooltip-popover-background-colour, var(--slate-00));
|
|
121
121
|
border-radius: var(--display-tooltip-popover-border-radius, 0.8rem);
|
|
122
122
|
box-shadow: var(
|
|
123
123
|
--display-tooltip-popover-shadow,
|
|
124
|
-
|
|
124
|
+
0 0.4rem 1.6rem rgba(0, 0, 0, 0.12)
|
|
125
125
|
);
|
|
126
126
|
|
|
127
127
|
position-anchor: var(--_anchor-name);
|
|
@@ -147,9 +147,9 @@ watch(
|
|
|
147
147
|
.display-tooltip-close-button {
|
|
148
148
|
all: unset;
|
|
149
149
|
cursor: pointer;
|
|
150
|
-
color: var(--display-tooltip-close-button-colour,
|
|
150
|
+
color: var(--display-tooltip-close-button-colour, var(--slate-09));
|
|
151
151
|
border: var(--display-tooltip-close-button-border-width, 0.1rem) solid
|
|
152
|
-
var(--display-tooltip-close-button-border-colour,
|
|
152
|
+
var(--display-tooltip-close-button-border-colour, var(--slate-03));
|
|
153
153
|
outline: var(--display-tooltip-close-button-outline-width, 0.1rem) solid transparent;
|
|
154
154
|
|
|
155
155
|
font-weight: 600;
|
|
@@ -160,11 +160,11 @@ watch(
|
|
|
160
160
|
text-decoration: underline;
|
|
161
161
|
border-color: var(
|
|
162
162
|
--display-tooltip-close-button-border-colour-hover,
|
|
163
|
-
|
|
163
|
+
var(--slate-06)
|
|
164
164
|
);
|
|
165
165
|
outline-color: var(
|
|
166
166
|
--display-tooltip-close-button-outline-colour-hover,
|
|
167
|
-
|
|
167
|
+
var(--slate-06)
|
|
168
168
|
);
|
|
169
169
|
outline-offset: 0.2rem;
|
|
170
170
|
}
|
|
@@ -9,21 +9,21 @@
|
|
|
9
9
|
| `--pop-over-trigger-outline-colour-hover` | `var(--theme-ring)` | Trigger outline colour on focus-visible |
|
|
10
10
|
| `--pop-over-width` | `30rem` | Popover panel width |
|
|
11
11
|
| `--pop-over-border-width` | `0.1rem` | Popover panel border width |
|
|
12
|
-
| `--pop-over-border-colour` | `
|
|
12
|
+
| `--pop-over-border-colour` | `var(--slate-02)` | Popover panel border colour |
|
|
13
13
|
| `--pop-over-border-radius` | `0.8rem` | Popover panel corner radius |
|
|
14
|
-
| `--pop-over-background-colour` | `
|
|
15
|
-
| `--pop-over-text-colour` | `
|
|
16
|
-
| `--pop-over-shadow` | `
|
|
14
|
+
| `--pop-over-background-colour` | `var(--slate-00)` | Popover panel background |
|
|
15
|
+
| `--pop-over-text-colour` | `var(--slate-09)` | Popover panel text colour |
|
|
16
|
+
| `--pop-over-shadow` | `0 0.4rem 1.6rem rgba(0,0,0,.12)` | Popover panel elevation shadow |
|
|
17
17
|
| `--pop-over-transition-duration` | `200ms` | Open/close fade duration |
|
|
18
18
|
| `--pop-over-content-padding` | `1.6rem` | Padding around the `content` slot |
|
|
19
19
|
| `--pop-over-content-padding-block-start` | `3.2rem` | Extra top padding so content clears the close button |
|
|
20
20
|
| `--pop-over-close-button-offset` | `0.8rem` | Distance of the close button from the panel's top/right edges |
|
|
21
21
|
| `--pop-over-close-button-size` | `2.4rem` | Close button box width/height |
|
|
22
22
|
| `--pop-over-close-button-border-radius` | `50%` | Close button corner radius |
|
|
23
|
-
| `--pop-over-close-button-colour` | `
|
|
23
|
+
| `--pop-over-close-button-colour` | `var(--slate-06)` | Close button icon colour |
|
|
24
24
|
| `--pop-over-close-button-icon-size` | `1.4rem` | Close button icon glyph size |
|
|
25
25
|
| `--pop-over-close-button-outline-width` | `0.1rem` | Close button focus/hover outline width |
|
|
26
|
-
| `--pop-over-close-button-surface-hover` | `
|
|
26
|
+
| `--pop-over-close-button-surface-hover` | `var(--slate-01)` | Close button background on hover/focus-visible |
|
|
27
27
|
| `--pop-over-close-button-outline-colour-hover` | `var(--theme-ring)` | Close button outline colour on hover/focus-visible |
|
|
28
28
|
|
|
29
29
|
```css
|
|
@@ -102,13 +102,13 @@ watch(
|
|
|
102
102
|
margin: 0;
|
|
103
103
|
inset: auto;
|
|
104
104
|
border: var(--pop-over-border-width, 0.1rem) solid
|
|
105
|
-
var(--pop-over-border-colour,
|
|
105
|
+
var(--pop-over-border-colour, var(--slate-02));
|
|
106
106
|
border-radius: var(--pop-over-border-radius, 0.8rem);
|
|
107
|
-
background-color: var(--pop-over-background-colour,
|
|
108
|
-
color: var(--pop-over-text-colour,
|
|
107
|
+
background-color: var(--pop-over-background-colour, var(--slate-00));
|
|
108
|
+
color: var(--pop-over-text-colour, var(--slate-09));
|
|
109
109
|
box-shadow: var(
|
|
110
110
|
--pop-over-shadow,
|
|
111
|
-
|
|
111
|
+
0 0.4rem 1.6rem rgba(0, 0, 0, 0.12)
|
|
112
112
|
);
|
|
113
113
|
width: var(--pop-over-width, 30rem);
|
|
114
114
|
|
|
@@ -139,12 +139,12 @@ watch(
|
|
|
139
139
|
width: var(--pop-over-close-button-size, 2.4rem);
|
|
140
140
|
height: var(--pop-over-close-button-size, 2.4rem);
|
|
141
141
|
border-radius: var(--pop-over-close-button-border-radius, 50%);
|
|
142
|
-
color: var(--pop-over-close-button-colour,
|
|
142
|
+
color: var(--pop-over-close-button-colour, var(--slate-06));
|
|
143
143
|
outline: var(--pop-over-close-button-outline-width, 0.1rem) solid transparent;
|
|
144
144
|
|
|
145
145
|
&:hover,
|
|
146
146
|
&:focus-visible {
|
|
147
|
-
background-color: var(--pop-over-close-button-surface-hover,
|
|
147
|
+
background-color: var(--pop-over-close-button-surface-hover, var(--slate-01));
|
|
148
148
|
outline-color: var(--pop-over-close-button-outline-colour-hover, var(--theme-ring));
|
|
149
149
|
outline-offset: 0.1rem;
|
|
150
150
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# UiBlockDecorated — Consumer Styling Guide
|
|
2
|
+
|
|
3
|
+
## Public token API
|
|
4
|
+
|
|
5
|
+
Each strength level (border 1-6, shadow 1-6, inner shadow 1-4) has its own token, defaulting to a
|
|
6
|
+
built-in elevation/border scale. Only the tokens for the strength levels actually in use need
|
|
7
|
+
overriding.
|
|
8
|
+
|
|
9
|
+
| Token | Default | Controls |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| `--ui-block-decorated-border-1` .. `-6` | `1px` .. `6px solid var(--theme-border)` | Border at each strength level |
|
|
12
|
+
| `--ui-block-decorated-shadow-1` .. `-6` | `0 1px 2px rgba(0,0,0,0.08)` .. `0 24px 32px rgba(0,0,0,0.18)` | Drop shadow at each strength level |
|
|
13
|
+
| `--ui-block-decorated-inner-shadow-1` .. `-4` | `inset 0 1px 2px rgba(0,0,0,0.08)` .. `inset 0 6px 8px rgba(0,0,0,0.14)` | Inset shadow at each strength level |
|
|
14
|
+
| `--ui-block-decorated-inner-shadow-highlight` | `inset 0 1px 0 rgba(255,255,255,0.15)` | Highlight layered on top of every inner shadow strength |
|
|
15
|
+
|
|
16
|
+
```css
|
|
17
|
+
.my-page {
|
|
18
|
+
--ui-block-decorated-shadow-3: 0 6px 12px rgba(0, 0, 0, 0.2);
|
|
19
|
+
--ui-block-decorated-border-2: 2px dashed hotpink;
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Or scope to a single instance via `styleClassPassthrough`:
|
|
24
|
+
|
|
25
|
+
```vue
|
|
26
|
+
<UiBlockDecorated :shadow-strength="3" style-class-passthrough="promo-block">...</UiBlockDecorated>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```css
|
|
30
|
+
.promo-block {
|
|
31
|
+
--ui-block-decorated-shadow-3: 0 6px 12px rgba(0, 0, 0, 0.2);
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Strength props apply at most one class each
|
|
36
|
+
|
|
37
|
+
`borderStrength`, `shadowStrength` and `innerShadowStrength` are independent — a value of `0`
|
|
38
|
+
(the default) applies no class for that decoration. All three can be combined on the same
|
|
39
|
+
instance (e.g. a border and a shadow together).
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="tag"
|
|
4
|
+
class="ui-block-decorated"
|
|
5
|
+
:class="[
|
|
6
|
+
{ [`ui-block-decorated-border-${borderStrength}`]: borderStrength > 0 },
|
|
7
|
+
{ [`ui-block-decorated-shadow-${shadowStrength}`]: shadowStrength > 0 },
|
|
8
|
+
{ [`ui-block-decorated-inner-shadow-${innerShadowStrength}`]: innerShadowStrength > 0 },
|
|
9
|
+
elementClasses,
|
|
10
|
+
]"
|
|
11
|
+
>
|
|
12
|
+
<slot name="default"></slot>
|
|
13
|
+
</component>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup lang="ts">
|
|
17
|
+
interface Props {
|
|
18
|
+
tag?: "div" | "p" | "span" | "section" | "article" | "aside" | "header" | "footer" | "main" | "nav" | "ul" | "ol";
|
|
19
|
+
borderStrength?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
20
|
+
shadowStrength?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
21
|
+
innerShadowStrength?: 0 | 1 | 2 | 3 | 4;
|
|
22
|
+
styleClassPassthrough?: string | string[];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
26
|
+
tag: "div",
|
|
27
|
+
borderStrength: 0,
|
|
28
|
+
shadowStrength: 0,
|
|
29
|
+
innerShadowStrength: 0,
|
|
30
|
+
styleClassPassthrough: () => [],
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
34
|
+
|
|
35
|
+
watch(
|
|
36
|
+
() => props.styleClassPassthrough,
|
|
37
|
+
() => {
|
|
38
|
+
resetElementClasses(props.styleClassPassthrough);
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<style lang="css">
|
|
44
|
+
@layer components {
|
|
45
|
+
.ui-block-decorated {
|
|
46
|
+
/*
|
|
47
|
+
* Border strength classes
|
|
48
|
+
*/
|
|
49
|
+
&.ui-block-decorated-border-1 {
|
|
50
|
+
border: var(--ui-block-decorated-border-1, 1px solid var(--theme-border));
|
|
51
|
+
}
|
|
52
|
+
&.ui-block-decorated-border-2 {
|
|
53
|
+
border: var(--ui-block-decorated-border-2, 2px solid var(--theme-border));
|
|
54
|
+
}
|
|
55
|
+
&.ui-block-decorated-border-3 {
|
|
56
|
+
border: var(--ui-block-decorated-border-3, 3px solid var(--theme-border));
|
|
57
|
+
}
|
|
58
|
+
&.ui-block-decorated-border-4 {
|
|
59
|
+
border: var(--ui-block-decorated-border-4, 4px solid var(--theme-border));
|
|
60
|
+
}
|
|
61
|
+
&.ui-block-decorated-border-5 {
|
|
62
|
+
border: var(--ui-block-decorated-border-5, 5px solid var(--theme-border));
|
|
63
|
+
}
|
|
64
|
+
&.ui-block-decorated-border-6 {
|
|
65
|
+
border: var(--ui-block-decorated-border-6, 6px solid var(--theme-border));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/*
|
|
69
|
+
* Shadow strength classes
|
|
70
|
+
*/
|
|
71
|
+
&.ui-block-decorated-shadow-1 {
|
|
72
|
+
box-shadow: var(--ui-block-decorated-shadow-1, 0 1px 2px rgba(0, 0, 0, 0.08));
|
|
73
|
+
}
|
|
74
|
+
&.ui-block-decorated-shadow-2 {
|
|
75
|
+
box-shadow: var(--ui-block-decorated-shadow-2, 0 2px 4px rgba(0, 0, 0, 0.1));
|
|
76
|
+
}
|
|
77
|
+
&.ui-block-decorated-shadow-3 {
|
|
78
|
+
box-shadow: var(--ui-block-decorated-shadow-3, 0 4px 8px rgba(0, 0, 0, 0.12));
|
|
79
|
+
}
|
|
80
|
+
&.ui-block-decorated-shadow-4 {
|
|
81
|
+
box-shadow: var(--ui-block-decorated-shadow-4, 0 8px 16px rgba(0, 0, 0, 0.14));
|
|
82
|
+
}
|
|
83
|
+
&.ui-block-decorated-shadow-5 {
|
|
84
|
+
box-shadow: var(--ui-block-decorated-shadow-5, 0 16px 24px rgba(0, 0, 0, 0.16));
|
|
85
|
+
}
|
|
86
|
+
&.ui-block-decorated-shadow-6 {
|
|
87
|
+
box-shadow: var(--ui-block-decorated-shadow-6, 0 24px 32px rgba(0, 0, 0, 0.18));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/*
|
|
91
|
+
* Inner shadow strength classes
|
|
92
|
+
* Could use substring match [class*="ui-block-decorated-inner-shadow"] but not as performant
|
|
93
|
+
*/
|
|
94
|
+
|
|
95
|
+
&.ui-block-decorated-inner-shadow-1,
|
|
96
|
+
&.ui-block-decorated-inner-shadow-2,
|
|
97
|
+
&.ui-block-decorated-inner-shadow-3,
|
|
98
|
+
&.ui-block-decorated-inner-shadow-4 {
|
|
99
|
+
position: relative;
|
|
100
|
+
isolation: isolate;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&.ui-block-decorated-inner-shadow-1::before,
|
|
104
|
+
&.ui-block-decorated-inner-shadow-2::before,
|
|
105
|
+
&.ui-block-decorated-inner-shadow-3::before,
|
|
106
|
+
&.ui-block-decorated-inner-shadow-4::before {
|
|
107
|
+
content: "";
|
|
108
|
+
display: block;
|
|
109
|
+
position: absolute;
|
|
110
|
+
inset: 0;
|
|
111
|
+
pointer-events: none;
|
|
112
|
+
border-radius: inherit;
|
|
113
|
+
z-index: 2;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&.ui-block-decorated-inner-shadow-1::before {
|
|
117
|
+
box-shadow:
|
|
118
|
+
var(--ui-block-decorated-inner-shadow-1, inset 0 1px 2px rgba(0, 0, 0, 0.08)),
|
|
119
|
+
var(--ui-block-decorated-inner-shadow-highlight, inset 0 1px 0 rgba(255, 255, 255, 0.15));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&.ui-block-decorated-inner-shadow-2::before {
|
|
123
|
+
box-shadow:
|
|
124
|
+
var(--ui-block-decorated-inner-shadow-2, inset 0 2px 4px rgba(0, 0, 0, 0.1)),
|
|
125
|
+
var(--ui-block-decorated-inner-shadow-highlight, inset 0 1px 0 rgba(255, 255, 255, 0.15));
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&.ui-block-decorated-inner-shadow-3::before {
|
|
129
|
+
box-shadow:
|
|
130
|
+
var(--ui-block-decorated-inner-shadow-3, inset 0 4px 6px rgba(0, 0, 0, 0.12)),
|
|
131
|
+
var(--ui-block-decorated-inner-shadow-highlight, inset 0 1px 0 rgba(255, 255, 255, 0.15));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&.ui-block-decorated-inner-shadow-4::before {
|
|
135
|
+
box-shadow:
|
|
136
|
+
var(--ui-block-decorated-inner-shadow-4, inset 0 6px 8px rgba(0, 0, 0, 0.14)),
|
|
137
|
+
var(--ui-block-decorated-inner-shadow-highlight, inset 0 1px 0 rgba(255, 255, 255, 0.15));
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
</style>
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import UiBlockDecorated from "../UiBlockDecorated.vue";
|
|
2
|
+
import type { Meta, StoryObj } from "@nuxtjs/storybook";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof UiBlockDecorated> = {
|
|
5
|
+
title: "Atoms/UiBlockDecorated",
|
|
6
|
+
component: UiBlockDecorated,
|
|
7
|
+
argTypes: {
|
|
8
|
+
tag: {
|
|
9
|
+
control: { type: "select" },
|
|
10
|
+
options: ["div", "p", "span", "section", "article", "aside", "header", "footer", "main", "nav", "ul", "ol"],
|
|
11
|
+
description: "Root element tag",
|
|
12
|
+
table: { category: "Basic" },
|
|
13
|
+
},
|
|
14
|
+
borderStrength: {
|
|
15
|
+
control: { type: "select" },
|
|
16
|
+
options: [0, 1, 2, 3, 4, 5, 6],
|
|
17
|
+
description: "Border strength level (0 = none)",
|
|
18
|
+
table: { category: "Basic" },
|
|
19
|
+
},
|
|
20
|
+
shadowStrength: {
|
|
21
|
+
control: { type: "select" },
|
|
22
|
+
options: [0, 1, 2, 3, 4, 5, 6],
|
|
23
|
+
description: "Drop shadow strength level (0 = none)",
|
|
24
|
+
table: { category: "Basic" },
|
|
25
|
+
},
|
|
26
|
+
innerShadowStrength: {
|
|
27
|
+
control: { type: "select" },
|
|
28
|
+
options: [0, 1, 2, 3, 4],
|
|
29
|
+
description: "Inner shadow strength level (0 = none)",
|
|
30
|
+
table: { category: "Basic" },
|
|
31
|
+
},
|
|
32
|
+
styleClassPassthrough: {
|
|
33
|
+
table: { disable: true },
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
parameters: {
|
|
37
|
+
docs: {
|
|
38
|
+
description: {
|
|
39
|
+
component:
|
|
40
|
+
"A plain block wrapper that applies independent border / drop-shadow / inner-shadow strength levels via CSS custom properties (see CONSUMER-STYLING.md).",
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export default meta;
|
|
47
|
+
type Story = StoryObj<typeof UiBlockDecorated>;
|
|
48
|
+
|
|
49
|
+
const blockStyle = "padding: 2rem; background: var(--theme-surface, #fff);";
|
|
50
|
+
|
|
51
|
+
export const Default: Story = {
|
|
52
|
+
args: {
|
|
53
|
+
tag: "div",
|
|
54
|
+
},
|
|
55
|
+
render: (args) => ({
|
|
56
|
+
components: { UiBlockDecorated },
|
|
57
|
+
setup() {
|
|
58
|
+
return { args, blockStyle };
|
|
59
|
+
},
|
|
60
|
+
template: `<UiBlockDecorated v-bind="args" :style="blockStyle">No decoration</UiBlockDecorated>`,
|
|
61
|
+
}),
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const Border: Story = {
|
|
65
|
+
args: {
|
|
66
|
+
tag: "div",
|
|
67
|
+
borderStrength: 3,
|
|
68
|
+
},
|
|
69
|
+
render: (args) => ({
|
|
70
|
+
components: { UiBlockDecorated },
|
|
71
|
+
setup() {
|
|
72
|
+
return { args, blockStyle };
|
|
73
|
+
},
|
|
74
|
+
template: `<UiBlockDecorated v-bind="args" :style="blockStyle">Border strength 3</UiBlockDecorated>`,
|
|
75
|
+
}),
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const Shadow: Story = {
|
|
79
|
+
args: {
|
|
80
|
+
tag: "div",
|
|
81
|
+
shadowStrength: 4,
|
|
82
|
+
},
|
|
83
|
+
render: (args) => ({
|
|
84
|
+
components: { UiBlockDecorated },
|
|
85
|
+
setup() {
|
|
86
|
+
return { args, blockStyle };
|
|
87
|
+
},
|
|
88
|
+
template: `<UiBlockDecorated v-bind="args" :style="blockStyle">Shadow strength 4</UiBlockDecorated>`,
|
|
89
|
+
}),
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const InnerShadow: Story = {
|
|
93
|
+
args: {
|
|
94
|
+
tag: "div",
|
|
95
|
+
innerShadowStrength: 3,
|
|
96
|
+
},
|
|
97
|
+
render: (args) => ({
|
|
98
|
+
components: { UiBlockDecorated },
|
|
99
|
+
setup() {
|
|
100
|
+
return { args, blockStyle };
|
|
101
|
+
},
|
|
102
|
+
template: `<UiBlockDecorated v-bind="args" :style="blockStyle">Inner shadow strength 3</UiBlockDecorated>`,
|
|
103
|
+
}),
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const AllCombined: Story = {
|
|
107
|
+
args: {
|
|
108
|
+
tag: "div",
|
|
109
|
+
borderStrength: 2,
|
|
110
|
+
shadowStrength: 3,
|
|
111
|
+
innerShadowStrength: 2,
|
|
112
|
+
},
|
|
113
|
+
render: (args) => ({
|
|
114
|
+
components: { UiBlockDecorated },
|
|
115
|
+
setup() {
|
|
116
|
+
return { args, blockStyle };
|
|
117
|
+
},
|
|
118
|
+
template: `<UiBlockDecorated v-bind="args" :style="blockStyle">All three combined</UiBlockDecorated>`,
|
|
119
|
+
}),
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export const CustomTokens: Story = {
|
|
123
|
+
args: {
|
|
124
|
+
tag: "div",
|
|
125
|
+
shadowStrength: 3,
|
|
126
|
+
},
|
|
127
|
+
render: (args) => ({
|
|
128
|
+
components: { UiBlockDecorated },
|
|
129
|
+
setup() {
|
|
130
|
+
return { args, blockStyle };
|
|
131
|
+
},
|
|
132
|
+
template: `
|
|
133
|
+
<UiBlockDecorated
|
|
134
|
+
v-bind="args"
|
|
135
|
+
:style="blockStyle + ' --ui-block-decorated-shadow-3: 0 6px 12px rgba(0, 0, 0, 0.25);'"
|
|
136
|
+
>
|
|
137
|
+
Custom shadow-3 token
|
|
138
|
+
</UiBlockDecorated>
|
|
139
|
+
`,
|
|
140
|
+
}),
|
|
141
|
+
parameters: {
|
|
142
|
+
docs: {
|
|
143
|
+
description: {
|
|
144
|
+
story: "Overriding a strength level's token via an inline `--ui-block-decorated-*` custom property.",
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { mountSuspended } from "@nuxt/test-utils/runtime";
|
|
3
|
+
import UiBlockDecorated from "../UiBlockDecorated.vue";
|
|
4
|
+
|
|
5
|
+
describe("UiBlockDecorated", () => {
|
|
6
|
+
it("mounts without error", async () => {
|
|
7
|
+
const wrapper = await mountSuspended(UiBlockDecorated);
|
|
8
|
+
expect(wrapper.vm).toBeTruthy();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it("renders correct HTML structure (default props)", async () => {
|
|
12
|
+
const wrapper = await mountSuspended(UiBlockDecorated);
|
|
13
|
+
expect(wrapper.html()).toMatchSnapshot();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it("renders a <div> by default", async () => {
|
|
17
|
+
const wrapper = await mountSuspended(UiBlockDecorated);
|
|
18
|
+
expect(wrapper.element.tagName).toBe("DIV");
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("renders the given tag", async () => {
|
|
22
|
+
const wrapper = await mountSuspended(UiBlockDecorated, { props: { tag: "section" } });
|
|
23
|
+
expect(wrapper.element.tagName).toBe("SECTION");
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("applies no strength classes by default", async () => {
|
|
27
|
+
const wrapper = await mountSuspended(UiBlockDecorated);
|
|
28
|
+
expect(wrapper.classes()).toEqual(["ui-block-decorated"]);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("applies the border strength class", async () => {
|
|
32
|
+
const wrapper = await mountSuspended(UiBlockDecorated, { props: { borderStrength: 3 } });
|
|
33
|
+
expect(wrapper.classes()).toContain("ui-block-decorated-border-3");
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("applies the shadow strength class", async () => {
|
|
37
|
+
const wrapper = await mountSuspended(UiBlockDecorated, { props: { shadowStrength: 5 } });
|
|
38
|
+
expect(wrapper.classes()).toContain("ui-block-decorated-shadow-5");
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("applies the inner shadow strength class", async () => {
|
|
42
|
+
const wrapper = await mountSuspended(UiBlockDecorated, { props: { innerShadowStrength: 2 } });
|
|
43
|
+
expect(wrapper.classes()).toContain("ui-block-decorated-inner-shadow-2");
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("combines all three strength classes together", async () => {
|
|
47
|
+
const wrapper = await mountSuspended(UiBlockDecorated, {
|
|
48
|
+
props: { borderStrength: 1, shadowStrength: 2, innerShadowStrength: 3 },
|
|
49
|
+
});
|
|
50
|
+
expect(wrapper.classes()).toContain("ui-block-decorated-border-1");
|
|
51
|
+
expect(wrapper.classes()).toContain("ui-block-decorated-shadow-2");
|
|
52
|
+
expect(wrapper.classes()).toContain("ui-block-decorated-inner-shadow-3");
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it("renders slot content", async () => {
|
|
56
|
+
const wrapper = await mountSuspended(UiBlockDecorated, {
|
|
57
|
+
slots: { default: "<p class='slot-child'>Hello</p>" },
|
|
58
|
+
});
|
|
59
|
+
expect(wrapper.find(".slot-child").exists()).toBe(true);
|
|
60
|
+
expect(wrapper.find(".slot-child").text()).toBe("Hello");
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it("applies styleClassPassthrough classes", async () => {
|
|
64
|
+
const wrapper = await mountSuspended(UiBlockDecorated, {
|
|
65
|
+
props: { styleClassPassthrough: ["custom-class"] },
|
|
66
|
+
});
|
|
67
|
+
expect(wrapper.classes()).toContain("custom-class");
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it("resets classes when styleClassPassthrough prop changes", async () => {
|
|
71
|
+
const wrapper = await mountSuspended(UiBlockDecorated, {
|
|
72
|
+
props: { styleClassPassthrough: ["initial-class"] },
|
|
73
|
+
});
|
|
74
|
+
expect(wrapper.classes()).toContain("initial-class");
|
|
75
|
+
|
|
76
|
+
await wrapper.setProps({ styleClassPassthrough: ["updated-class"] });
|
|
77
|
+
expect(wrapper.classes()).not.toContain("initial-class");
|
|
78
|
+
expect(wrapper.classes()).toContain("updated-class");
|
|
79
|
+
});
|
|
80
|
+
});
|
|
@@ -135,11 +135,11 @@ describe("AlertMaskedContent", () => {
|
|
|
135
135
|
const wrapper = await mountSuspended(AlertMaskedContent, { props: { theme: "info" } });
|
|
136
136
|
const contentEl = wrapper.find(".alert-mask-content");
|
|
137
137
|
const style = (contentEl.element as HTMLElement).style;
|
|
138
|
-
// Default borderLeft: 6 → --
|
|
139
|
-
expect(style.getPropertyValue("--
|
|
140
|
-
expect(style.getPropertyValue("--
|
|
141
|
-
expect(style.getPropertyValue("--
|
|
142
|
-
expect(style.getPropertyValue("--
|
|
138
|
+
// Default borderLeft: 6 → --_inset-inline-start: 6px
|
|
139
|
+
expect(style.getPropertyValue("--_inset-inline-start")).toBe("6px");
|
|
140
|
+
expect(style.getPropertyValue("--_inset-block-start")).toBe("1px");
|
|
141
|
+
expect(style.getPropertyValue("--_inset-inline-end")).toBe("1px");
|
|
142
|
+
expect(style.getPropertyValue("--_inset-block-end")).toBe("1px");
|
|
143
143
|
});
|
|
144
144
|
|
|
145
145
|
it("merges custom maskConfig over defaults", async () => {
|
|
@@ -148,6 +148,6 @@ describe("AlertMaskedContent", () => {
|
|
|
148
148
|
});
|
|
149
149
|
const contentEl = wrapper.find(".alert-mask-content");
|
|
150
150
|
const style = (contentEl.element as HTMLElement).style;
|
|
151
|
-
expect(style.getPropertyValue("--
|
|
151
|
+
expect(style.getPropertyValue("--_inset-inline-start")).toBe("12px");
|
|
152
152
|
});
|
|
153
153
|
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# DisplayThemeSwitch — Consumer Styling Guide
|
|
2
|
+
|
|
3
|
+
## No tokens of its own — delegates entirely to TripleToggleSwitchCore
|
|
4
|
+
|
|
5
|
+
`DisplayThemeSwitch` is a thin wrapper around `TripleToggleSwitchCore` (see
|
|
6
|
+
`app/components/05.forms/triple-toggle-switch/CONSUMER-STYLING.md`) and declares no
|
|
7
|
+
`--display-theme-switch-*` tokens of its own. Every colour token documented there
|
|
8
|
+
(`--triple-toggle-switch-surface`, `--triple-toggle-switch-border`, `--triple-toggle-switch-marker-surface`,
|
|
9
|
+
etc.) applies unchanged, since `DisplayThemeSwitch` renders that component directly with no
|
|
10
|
+
intermediate styling layer.
|
|
11
|
+
|
|
12
|
+
## `small` class — compact sizing
|
|
13
|
+
|
|
14
|
+
Pass `"small"` via `styleClassPassthrough` for a more compact gap/padding/icon-size, useful in a
|
|
15
|
+
tight header/nav slot:
|
|
16
|
+
|
|
17
|
+
```vue
|
|
18
|
+
<DisplayThemeSwitch style-class-passthrough="small" />
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This sets `TripleToggleSwitchCore`'s public `--triple-toggle-switch-gap`/`-padding`/
|
|
22
|
+
`-option-padding`/`-icon-size` tokens to smaller values (`0.2rem`/`0.2rem`/`0.2rem`/`1.6rem` vs the
|
|
23
|
+
default `0.4rem`/`0.4rem`/`0.4rem`/`2rem` — both already more compact than `TripleToggleSwitchCore`'s
|
|
24
|
+
own defaults of `1rem`/`0.6rem`/`0.5rem`/`2rem`). Override any of the four directly for a custom
|
|
25
|
+
size instead of using `small`:
|
|
26
|
+
|
|
27
|
+
```vue
|
|
28
|
+
<DisplayThemeSwitch style="--triple-toggle-switch-icon-size: 2.4rem;" />
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Class passthrough
|
|
32
|
+
|
|
33
|
+
`styleClassPassthrough` also accepts any other class for layout purposes, alongside or instead of
|
|
34
|
+
`small`.
|