srcdev-nuxt-components 0.0.8 → 0.0.10
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.
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="layout-row" :class="[variant, elementClasses]">
|
|
3
|
+
<component :is="tag" :data-testid="dataTestid" class="layout-row-inner">
|
|
4
|
+
<slot name="default"></slot>
|
|
5
|
+
</component>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script lang="ts">
|
|
10
|
+
const TAGS_ALLOWED = <string[]>['div', 'section', 'article', 'aside', 'header', 'footer', 'main', 'nav', 'ul', 'ol'];
|
|
11
|
+
|
|
12
|
+
const VARIANT_CLASSES = <string[]>[
|
|
13
|
+
'full',
|
|
14
|
+
'full-start',
|
|
15
|
+
'full-end',
|
|
16
|
+
'popout',
|
|
17
|
+
'popout-start',
|
|
18
|
+
'popout-end',
|
|
19
|
+
'content',
|
|
20
|
+
'content-start',
|
|
21
|
+
'content-end',
|
|
22
|
+
'inset-content',
|
|
23
|
+
'inset-content-start',
|
|
24
|
+
'inset-content-end',
|
|
25
|
+
'full-width',
|
|
26
|
+
'full-content',
|
|
27
|
+
'full-content-nopad',
|
|
28
|
+
'full-content',
|
|
29
|
+
];
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<script setup lang="ts">
|
|
33
|
+
const props = defineProps({
|
|
34
|
+
dataTestid: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: 'layout-row',
|
|
37
|
+
},
|
|
38
|
+
tag: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: 'div',
|
|
41
|
+
validator(value: string) {
|
|
42
|
+
return TAGS_ALLOWED.includes(value);
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
variant: {
|
|
46
|
+
type: String,
|
|
47
|
+
required: true,
|
|
48
|
+
validator(value: string) {
|
|
49
|
+
return VARIANT_CLASSES.includes(value);
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
styleClassPassthrough: {
|
|
53
|
+
type: Array as PropType<string[]>,
|
|
54
|
+
default: () => [],
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const { elementClasses, updateElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<style lang="css">
|
|
62
|
+
/*
|
|
63
|
+
* Page Layout by https://layout-breakouts-builder.vercel.app
|
|
64
|
+
**/
|
|
65
|
+
.layout-row > *,
|
|
66
|
+
.full-width > * {
|
|
67
|
+
grid-column: content;
|
|
68
|
+
}
|
|
69
|
+
.layout-row,
|
|
70
|
+
.full-width {
|
|
71
|
+
--minimum-content-padding: 1rem;
|
|
72
|
+
|
|
73
|
+
/** TRACK WIDTHS **/
|
|
74
|
+
--full-max-width: 1fr;
|
|
75
|
+
--popout-max-width: 1400px;
|
|
76
|
+
--content-max-width: 1060px;
|
|
77
|
+
--inset-content-max-width: 840px;
|
|
78
|
+
|
|
79
|
+
/** TRACK SIZES **/
|
|
80
|
+
--full: minmax(var(--minimum-content-padding), 1fr);
|
|
81
|
+
--popout: minmax(0, calc((var(--popout-max-width) - var(--content-max-width)) * 0.5));
|
|
82
|
+
--content: minmax(0, calc((var(--content-max-width) - var(--inset-content-max-width)) * 0.5));
|
|
83
|
+
--inset-content: min(var(--inset-content-max-width), 100% - var(--minimum-content-padding) * 2);
|
|
84
|
+
|
|
85
|
+
display: grid;
|
|
86
|
+
grid-template-columns:
|
|
87
|
+
[full-start]
|
|
88
|
+
var(--full)
|
|
89
|
+
[popout-start]
|
|
90
|
+
var(--popout)
|
|
91
|
+
[content-start]
|
|
92
|
+
var(--content)
|
|
93
|
+
[inset-content-start]
|
|
94
|
+
var(--inset-content)
|
|
95
|
+
[inset-content-end]
|
|
96
|
+
var(--content)
|
|
97
|
+
[content-end]
|
|
98
|
+
var(--popout)
|
|
99
|
+
[popout-end]
|
|
100
|
+
var(--full)
|
|
101
|
+
[full-end];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** CLASSES **/
|
|
105
|
+
.full {
|
|
106
|
+
grid-column: full;
|
|
107
|
+
}
|
|
108
|
+
.full-start {
|
|
109
|
+
grid-column-start: full-start;
|
|
110
|
+
}
|
|
111
|
+
.full-end {
|
|
112
|
+
grid-column-end: full-end;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.popout {
|
|
116
|
+
grid-column: popout;
|
|
117
|
+
}
|
|
118
|
+
.popout-start {
|
|
119
|
+
grid-column-start: popout-start;
|
|
120
|
+
}
|
|
121
|
+
.popout-end {
|
|
122
|
+
grid-column-end: popout-end;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.content {
|
|
126
|
+
grid-column: content;
|
|
127
|
+
}
|
|
128
|
+
.content-start {
|
|
129
|
+
grid-column-start: content-start;
|
|
130
|
+
}
|
|
131
|
+
.content-end {
|
|
132
|
+
grid-column-end: content-end;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.inset-content {
|
|
136
|
+
grid-column: inset-content;
|
|
137
|
+
}
|
|
138
|
+
.inset-content-start {
|
|
139
|
+
grid-column-start: inset-content-start;
|
|
140
|
+
}
|
|
141
|
+
.inset-content-end {
|
|
142
|
+
grid-column-end: inset-content-end;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.full-width {
|
|
146
|
+
grid-column: full;
|
|
147
|
+
}
|
|
148
|
+
.full-content,
|
|
149
|
+
.full-content-nopad {
|
|
150
|
+
grid-column: full;
|
|
151
|
+
}
|
|
152
|
+
.full-content {
|
|
153
|
+
padding-inline: var(--minimum-content-padding);
|
|
154
|
+
}
|
|
155
|
+
</style>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "srcdev-nuxt-components",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.10",
|
|
5
5
|
"main": "nuxt.config.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"clean": "rm -rf .nuxt && rm -rf .output && rm -rf .playground/.nuxt && rm -rf .playground/.output",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"eslint": "9.15.0",
|
|
29
29
|
"nuxt": "3.14.1592",
|
|
30
30
|
"release-it": "17.10.0",
|
|
31
|
-
"typescript": "5.
|
|
31
|
+
"typescript": "^5.7.2"
|
|
32
32
|
},
|
|
33
33
|
"release-it": {
|
|
34
34
|
"$schema": "https://unpkg.com/release-it/schema/release-it.json",
|
|
@@ -39,5 +39,8 @@
|
|
|
39
39
|
"release": true,
|
|
40
40
|
"releaseName": "v${version}"
|
|
41
41
|
}
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"modern-normalize": "3.0.1"
|
|
42
45
|
}
|
|
43
46
|
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="page-row" :class="[elementClasses]" :data-testid="dataTestid">
|
|
3
|
-
<div class="page-row-inner" :class="[{ 'full-width': isFullWidth }]">
|
|
4
|
-
<slot name="default"></slot>
|
|
5
|
-
</div>
|
|
6
|
-
</div>
|
|
7
|
-
</template>
|
|
8
|
-
|
|
9
|
-
<script setup lang="ts">
|
|
10
|
-
const props = defineProps({
|
|
11
|
-
dataTestid: {
|
|
12
|
-
type: String,
|
|
13
|
-
default: 'page-row',
|
|
14
|
-
},
|
|
15
|
-
isFullWidth: {
|
|
16
|
-
type: Boolean,
|
|
17
|
-
default: false,
|
|
18
|
-
},
|
|
19
|
-
styleClassPassthrough: {
|
|
20
|
-
type: Array as PropType<string[]>,
|
|
21
|
-
default: () => [],
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
26
|
-
</script>
|
|
27
|
-
|
|
28
|
-
<style lang="css">
|
|
29
|
-
.page-row {
|
|
30
|
-
--_gutter-width: 24px;
|
|
31
|
-
--_content-width: 1fr;
|
|
32
|
-
--_grid-template-columns: var(--_gutter-width) 1fr var(--_gutter-width);
|
|
33
|
-
|
|
34
|
-
display: grid;
|
|
35
|
-
grid-template-columns: var(--_grid-template-columns);
|
|
36
|
-
|
|
37
|
-
@media screen and (min-width: 1024px) {
|
|
38
|
-
--_gutter-width: 24px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
@media screen and (min-width: 1280px) {
|
|
42
|
-
--_gutter-width: 32px;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.page-row-inner {
|
|
46
|
-
grid-column: 2;
|
|
47
|
-
|
|
48
|
-
&.full-width {
|
|
49
|
-
--_grid-template-columns: 0fr 1fr 0fr;
|
|
50
|
-
grid-column: 1 / span 3;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
</style>
|