Skip to content

Commit cd8757d

Browse files
authored
Merge pull request #158 from libvue/feature/improve-misc
Feature/improve misc
2 parents 01d0a77 + 3eb163b commit cd8757d

37 files changed

+72
-46
lines changed

src/docs/components/ComponentDetails.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<template>
22
<div class="component-details">
3-
<div v-if="props" v-space-after="1" class="props-table">
3+
<div v-if="props && rowsProps.length > 0" v-space-after="1" class="props-table">
44
<lv-heading v-space-after="1" :level="6">{{ title }} Props</lv-heading>
55
<lv-card>
66
<lv-table :rows="rowsProps" :columns="columnsProps"></lv-table>
77
</lv-card>
88
</div>
9-
<div v-if="emits" class="emits-table">
9+
<div v-if="emits" v-space-after="slots.length > 0 ? 1 : 0" class="emits-table">
1010
<lv-heading v-space-after="1" :level="6">{{ title }} Emits</lv-heading>
1111
<lv-card>
1212
<lv-table :rows="rowsEmits" :columns="columnsEmits" />

src/docs/views/documentation/components/lv-accordion.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</lv-accordion>
2727
</lv-card>
2828
<code-preview v-space-after="1" :code="code" lang="html" />
29-
<component-details component="LvAccordion"></component-details>
29+
<component-details :slots="['default']" component="LvAccordion"></component-details>
3030
</template>
3131

3232
<script>

src/docs/views/documentation/components/lv-avatar-group.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</lv-avatar-group>
1111
</lv-card>
1212
<code-preview v-space-after="1" :code="code" lang="html" />
13-
<component-details component="LvAvatarGroup"></component-details>
13+
<component-details :slots="['default']" component="LvAvatarGroup"></component-details>
1414
</template>
1515

1616
<script>

src/docs/views/documentation/components/lv-badge.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</lv-badge>
1919
</lv-card>
2020
<code-preview v-space-after="1" lang="html" :code="codeSlotted" />
21-
<component-details component="LvBadge"></component-details>
21+
<component-details :slots="['default']" component="LvBadge"></component-details>
2222
</template>
2323

2424
<script>

src/docs/views/documentation/components/lv-blockquote.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</lv-card>
77

88
<code-preview v-space-after="1" lang="html" :code="codeBlockquote" />
9-
<component-details component="LvBlockquote"></component-details>
9+
<component-details :slots="['default']" component="LvBlockquote"></component-details>
1010
</template>
1111

1212
<script>

src/docs/views/documentation/components/lv-button-group.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</lv-button-group>
1010
</lv-card>
1111
<code-preview v-space-after="1" lang="html" :code="code"/>
12-
<component-details component="LvButtonGroup"></component-details>
12+
<component-details :slots="['default']" component="LvButtonGroup"></component-details>
1313
</template>
1414

1515
<script>

src/docs/views/documentation/components/lv-button.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
</template>
121121
</lv-tabs>
122122

123-
<component-details v-space-after="1" component="LvButton"></component-details>
123+
<component-details v-space-after="1" :slots="['default']" component="LvButton"></component-details>
124124

125125
</template>
126126

src/docs/views/documentation/components/lv-card.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<code-preview v-space-after="1" lang="html" :code="codeNoBorder" />
2727
</template>
2828
</lv-tabs>
29-
<component-details component="LvCard"></component-details>
29+
<component-details :slots="['default']" component="LvCard"></component-details>
3030
</template>
3131

3232
<script>

src/docs/views/documentation/components/lv-code.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</lv-card>
88
<code-preview v-space-after="1" :code="code" lang="html" />
99

10-
<component-details component="LvCode"></component-details>
10+
<component-details :slots="['default']" component="LvCode"></component-details>
1111
</template>
1212

1313
<script>

src/docs/views/documentation/components/lv-cookie-consent.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<template>
22
<lv-heading v-space-after="0.5" :level="3">Cookie Consent</lv-heading>
33
<lv-heading v-space-after="2" sub :level="6">Because we have to somehow</lv-heading>
4-
<lv-heading v-space-after="1" :level="6">Default</lv-heading>
54
<lv-card v-space-after="1">
65
<lv-button color="solid-primary" label="Toggle Consent" @click="showCookieConsent = !showCookieConsent" />
76
<lv-cookie-consent
@@ -12,7 +11,7 @@
1211
/>
1312
</lv-card>
1413
<code-preview v-space-after="1" lang="html" :code="code" />
15-
<component-details component="LvCookieConsent"></component-details>
14+
<component-details :slots="['default']" component="LvCookieConsent"></component-details>
1615
</template>
1716

1817
<script>

src/docs/views/documentation/components/lv-description-list.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</lv-card>
1212
<code-preview v-space-after="1" :files="files" :active="activeFile" @change-file="(v) => activeFile = v" />
1313

14-
<component-details component="LvDescriptionList"></component-details>
14+
<component-details :slots="['%item.id%']" component="LvDescriptionList"></component-details>
1515
</template>
1616

1717
<script>

src/docs/views/documentation/components/lv-dialog.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
</lv-dialog>
3737
</lv-card>
3838
<code-preview v-space-after="1" :code="code" lang="html"/>
39-
<component-details component="LvDialog"></component-details>
39+
<component-details :slots="['default', 'header', 'content', 'footer']" component="LvDialog"></component-details>
4040
</template>
4141

4242
<script>

src/docs/views/documentation/components/lv-drawer.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</lv-flex>
2626
</lv-card>
2727
<code-preview v-space-after="1" lang="html" :code="code"/>
28-
<component-details component="LvDrawer"></component-details>
28+
<component-details :slots="['default']" component="LvDrawer"></component-details>
2929
</template>
3030

3131
<script>

src/docs/views/documentation/components/lv-fieldset.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
</lv-grid>
3131
</lv-card>
3232
<code-preview v-space-after="1" lang="html" :code="code"/>
33-
<component-details component="LvFieldset"></component-details>
33+
<component-details :slots="['default', 'hint', 'invalid']" component="LvFieldset"></component-details>
3434
</template>
3535

3636
<script>

src/docs/views/documentation/components/lv-flex.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
</lv-flex>
5757
</lv-card>
5858
<code-preview v-space-after="1" lang="html" :code="codeFill" />
59-
<component-details component="LvFlex"></component-details>
59+
<component-details :slots="['default']" component="LvFlex"></component-details>
6060
</template>
6161

6262
<script>

src/docs/views/documentation/components/lv-grid.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,18 @@
3030
</lv-card>
3131
<code-preview v-space-after="1" :code="code" lang="html" />
3232

33-
<component-details v-space-after="1" title="Grid" component="LvGrid"></component-details>
33+
<component-details v-space-after="1" :slots="['default']" title="Grid" component="LvGrid"></component-details>
3434

3535
<component-details
3636
v-space-after="1"
37+
:slots="['default']"
3738
title="Grid Row"
3839
component="LvGridRow"
3940
></component-details>
4041

4142
<component-details
4243
v-space-after="1"
44+
:slots="['default']"
4345
title="Grid Column"
4446
component="LvGridColumn"
4547
></component-details>

src/docs/views/documentation/components/lv-header.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</lv-card>
2121

2222
<code-preview v-space-after="1" lang="html" :code="code" />
23-
<component-details component="LvHeader" :slots="['branding', 'search', 'extra']"></component-details>
23+
<component-details component="LvHeader" :slots="['branding', 'search', 'navigation', 'extra']"></component-details>
2424
</template>
2525

2626
<script>

src/docs/views/documentation/components/lv-heading.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<lv-heading sub :level="6">Subheading</lv-heading>
2626
</lv-card>
2727
<code-preview v-space-after="1" lang="html" :code="codeSub" />
28-
<component-details component="LvHeading"></component-details>
28+
<component-details :slots="['default']" component="LvHeading"></component-details>
2929
</template>
3030

3131
<script>

src/docs/views/documentation/components/lv-hero.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
</template>
4848
</lv-tabs>
4949

50-
<component-details component="LvHero" :slots="['image', 'buttons']"></component-details>
50+
<component-details component="LvHero" :slots="['image', 'buttons', 'description', 'title']"></component-details>
5151
</template>
5252

5353
<script>

src/docs/views/documentation/components/lv-horizontal-nav.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@
2020
<code-preview v-space-after="1" lang="html" :code="code" />
2121
<component-details
2222
v-space-after="1"
23+
:slots="['default']"
2324
title="LvHorizontalNavItem"
2425
component="LvHorizontalNavItem"
2526
></component-details>
26-
<component-details title="LvHorizontalNavGroup" component="LvHorizontalNavGroup"></component-details>
27+
<component-details title="LvHorizontalNavGroup" :slots="['default']" component="LvHorizontalNavGroup"></component-details>
2728
</template>
2829

2930
<script>

src/docs/views/documentation/components/lv-image-carousel.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</lv-card>
1717
<code-preview v-space-after="1" lang="html" :code="code" />
1818

19-
<component-details component="LvImageCarousel"></component-details>
19+
<component-details :slots="['default']" component="LvImageCarousel"></component-details>
2020
</template>
2121

2222

src/docs/views/documentation/components/lv-keyboard.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</lv-card>
2222

2323
<code-preview v-space-after="1" lang="html" :code="code" />
24-
<component-details component="LvKeyboard"></component-details>
24+
<component-details :slots="['default']" component="LvKeyboard"></component-details>
2525
</template>
2626

2727
<script>

src/docs/views/documentation/components/lv-link.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<lv-link :zoom-on-hover="true"><lv-card>Any content</lv-card></lv-link>
2323
</lv-card>
2424
<code-preview v-space-after="1" lang="html" code='<lv-link :zoom-on-hover="true"><lv-card>Any content</lv-card></lv-link>' />
25-
<component-details component="LvLink"></component-details>
25+
<component-details :slots="['default']" component="LvLink"></component-details>
2626
</template>
2727

2828
<script>

src/docs/views/documentation/components/lv-list.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
</lv-card>
1313

1414
<code-preview v-space-after="1" lang="html" :code="code" />
15-
<component-details component="LvList" title="LvList"></component-details>
16-
<component-details component="LvListItem" title="LvListItem"></component-details>
15+
<component-details :slots="['default']" component="LvList" title="LvList"></component-details>
16+
<component-details :slots="['default']" component="LvListItem" title="LvListItem"></component-details>
1717
</template>
1818

1919
<script>

src/docs/views/documentation/components/lv-notice.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<code-preview v-space-after="1" lang="html" :code="codeIcons" />
7878
</template>
7979
</lv-tabs>
80-
<component-details component="LvNotice"></component-details>
80+
<component-details :slots="['default']" component="LvNotice"></component-details>
8181
</template>
8282

8383
<script>

src/docs/views/documentation/components/lv-popover.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</lv-flex>
3232
</lv-card>
3333
<code-preview v-space-after="1" lang="html" :code="code"/>
34-
<component-details component="LvPopover"></component-details>
34+
<component-details :slots="['reference', 'content']" component="LvPopover"></component-details>
3535
</template>
3636

3737
<script>

src/docs/views/documentation/components/lv-select.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</template>
3939
</lv-tabs>
4040

41-
<component-details component="LvSelect"></component-details>
41+
<component-details :slots="['option', 'no-options', 'value']" component="LvSelect"></component-details>
4242
</template>
4343

4444
<script>

src/docs/views/documentation/components/lv-table.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
</template>
9797
</lv-tabs>
9898

99-
<component-details component="LvTable"></component-details>
99+
<component-details :slots="['%column.key%']" component="LvTable"></component-details>
100100
</template>
101101

102102
<script>

src/docs/views/documentation/components/lv-tabs.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</lv-card>
1414
<code-preview v-space-after="1" lang="html" :code="codeTemplate" />
1515
<code-preview v-space-after="1" lang="javascript" :code="codeScript" />
16-
<component-details component="LvTabs"></component-details>
16+
<component-details :slots="['%tab.id%']" component="LvTabs"></component-details>
1717
</template>
1818

1919
<script>

src/docs/views/documentation/components/lv-text-editor.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{{ content }}
1010
</lv-text>
1111
<code-preview v-space-after="1" lang="html" :code="code"/>
12-
<component-details component="LvTextEditor"></component-details>
12+
<component-details :slots="['buttons']" component="LvTextEditor"></component-details>
1313
</template>
1414

1515
<script>

src/docs/views/documentation/components/lv-text.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<lv-text align="right"> Lorem ipsum dolor sit amet, consectetur adipiscing elit </lv-text>
1111
</lv-card>
1212
<code-preview v-space-after="1" lang="html" :code="codeParagraph" />
13-
<component-details component="LvText"></component-details>
13+
<component-details :slots="['default']" component="LvText"></component-details>
1414
</template>
1515

1616
<script>

src/docs/views/documentation/components/lv-toggle-group.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</lv-flex>
2929
</lv-card>
3030
<code-preview v-space-after="1" :code="code" lang="html"></code-preview>
31-
<component-details component="LvToggleGroup"></component-details>
31+
<component-details :slots="['default']" component="LvToggleGroup"></component-details>
3232
</template>
3333

3434
<script>

src/docs/views/documentation/components/lv-toggle.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</lv-flex>
2020
</lv-card>
2121
<code-preview v-space-after="1" :code="code" lang="html"></code-preview>
22-
<component-details component="LvToggle"></component-details>
22+
<component-details :slots="['default']" component="LvToggle"></component-details>
2323
</template>
2424

2525
<script>

src/docs/views/documentation/components/lv-vertical-nav.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
</lv-card>
1919
<code-preview v-space-after="1" lang="html" :code="code" />
2020

21-
<component-details v-space-after="1" title="LvVerticalNavItem" component="LvVerticalNavItem"></component-details>
22-
<component-details v-space-after="1" title="LvVerticalNavList" component="LvVerticalNavList"></component-details>
23-
<component-details title="LvVerticalNavGroup" component="LvVerticalNavGroup"></component-details>
21+
<component-details v-space-after="1" :slots="['default']" title="LvVerticalNavItem" component="LvVerticalNavItem"></component-details>
22+
<component-details v-space-after="1" :slots="['default']" title="LvVerticalNavList" component="LvVerticalNavList"></component-details>
23+
<component-details :slots="['default']" title="LvVerticalNavGroup" component="LvVerticalNavGroup"></component-details>
2424
</template>
2525

2626
<script>

src/docs/views/documentation/components/lv-window.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</lv-window>
88
</lv-card>
99
<code-preview v-space-after="1" :code="code" lang="html"></code-preview>
10-
<component-details component="LvWindow"></component-details>
10+
<component-details :slots="['default']" component="LvWindow"></component-details>
1111
</template>
1212

1313
<script>

src/docs/views/documentation/getting-started/install.vue

+21
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ app.directive('space-after', spaceAfter);
3232
3333
const registerScss = `
3434
@import '@libvue/core';
35+
@import 'theme-overrides';
3536
3637
html {
3738
min-height: 100%;
@@ -51,6 +52,25 @@ body {
5152
}
5253
`.trim();
5354
55+
const themeOverrides = `
56+
@mixin lightThemeOverrides {
57+
--color-primary: red;
58+
}
59+
60+
// Add it to the media query first
61+
@media (prefers-color-scheme: light) {
62+
:root {
63+
@include('lightThemeOverrides');
64+
}
65+
}
66+
67+
// Add it to the data-theme attribute second so it wins from the media query
68+
// This data-attribute can be added to the html or body tag
69+
[data-theme=light] {
70+
@include('lightThemeOverrides');
71+
}
72+
`.trim();
73+
5474
export default {
5575
data() {
5676
return {
@@ -59,6 +79,7 @@ export default {
5979
registerFiles: [
6080
{ id: 'main', filename: 'main.js', lang: 'js', code: registerScript },
6181
{ id: 'scss', filename: 'app.scss', lang: 'scss', code: registerScss },
82+
{ id: 'theme', filename: 'theme-overrides.scss', lang: 'scss', code: themeOverrides },
6283
],
6384
};
6485
},

0 commit comments

Comments
 (0)