srcdev-nuxt-components 6.1.15 → 6.1.17

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,120 @@
1
+ <template>
2
+ <component
3
+ :is="tag"
4
+ class="display-card"
5
+ :class="[variant, elementClasses, { 'has-dividers': hasDividers }, { 'no-outline': noOutline }]"
6
+ >
7
+ <div v-if="slots.header" class="card-row display-card-header">
8
+ <slot name="header"></slot>
9
+ </div>
10
+ <div v-if="slots.default" class="card-row display-card-content">
11
+ <slot name="default"></slot>
12
+ </div>
13
+ <div v-if="slots.footer" class="card-row display-card-footer">
14
+ <slot name="footer"></slot>
15
+ </div>
16
+ </component>
17
+ </template>
18
+
19
+ <script setup lang="ts">
20
+ const props = defineProps({
21
+ tag: {
22
+ type: String,
23
+ default: "div",
24
+ validator(value: string) {
25
+ return ["div", "section", "article", "aside", "main", "nav"].includes(value)
26
+ },
27
+ },
28
+ hasDividers: {
29
+ type: Boolean,
30
+ default: false,
31
+ },
32
+ noOutline: {
33
+ type: Boolean,
34
+ default: false,
35
+ },
36
+ variant: {
37
+ type: String,
38
+ default: "solid",
39
+ validator(value: string) {
40
+ return ["solid", "subtle", "soft", "outline"].includes(value)
41
+ },
42
+ },
43
+ styleClassPassthrough: {
44
+ type: Array as PropType<string[]>,
45
+ default: () => [],
46
+ },
47
+ })
48
+ const slots = useSlots()
49
+
50
+ const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
51
+
52
+ watch(
53
+ () => props.styleClassPassthrough,
54
+ () => {
55
+ resetElementClasses(props.styleClassPassthrough)
56
+ }
57
+ )
58
+ </script>
59
+
60
+ <style lang="css">
61
+ .display-card {
62
+ --_inner-padding: 1rem;
63
+ --_background-color: transparent;
64
+ --_border-color: transparent;
65
+ --_border-width: 0.2rem;
66
+ --_box-shadow-color: transparent;
67
+
68
+ display: grid;
69
+ grid-auto-flow: row;
70
+ /* gap: 1rem; */
71
+ border-radius: 0.5rem;
72
+ overflow: hidden;
73
+
74
+ background-color: var(--_background-color, transparent);
75
+ border: var(--_border-width) solid var(--_border-color, transparent);
76
+ box-shadow: 0 0 0.4rem var(--_border-width) var(--_box-shadow-color, transparent);
77
+
78
+ &.no-outline {
79
+ --_border-width: 0;
80
+ }
81
+
82
+ &.solid {
83
+ --_background-color: light-dark(var(--gray-0), var(--gray-12));
84
+ --_border-color: light-dark(var(--gray-4), var(--gray-8));
85
+ }
86
+
87
+ &.subtle {
88
+ --_background-color: color-mix(in oklab, light-dark(var(--gray-1), var(--gray-8)) 50%, transparent);
89
+ --_border-color: light-dark(var(--gray-3), var(--gray-9));
90
+ }
91
+
92
+ &.soft {
93
+ --_background-color: color-mix(in oklab, light-dark(var(--gray-1), var(--gray-8)) 20%, transparent);
94
+ --_box-shadow-color: color-mix(in oklab, light-dark(var(--gray-2), var(--gray-8)) 80%, transparent);
95
+ }
96
+
97
+ &.outline {
98
+ --_background-color: transparent;
99
+ --_border-color: light-dark(var(--gray-4), var(--gray-8));
100
+ }
101
+
102
+ &.has-dividers {
103
+ .card-row + .card-row {
104
+ border-top: 0.2rem solid var(--_border-color);
105
+ }
106
+ }
107
+
108
+ .display-card-header {
109
+ padding: var(--_inner-padding);
110
+ }
111
+
112
+ .display-card-content {
113
+ padding: var(--_inner-padding);
114
+ }
115
+
116
+ .display-card-footer {
117
+ padding: var(--_inner-padding);
118
+ }
119
+ }
120
+ </style>
@@ -0,0 +1,140 @@
1
+ <template>
2
+ <component :is="tag" class="glowing-border" :class="[elementClasses, variant]">
3
+ <slot></slot>
4
+ </component>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ const props = defineProps({
9
+ tag: {
10
+ type: String,
11
+ default: "div",
12
+ validator(value: string) {
13
+ return [
14
+ "div",
15
+ "p",
16
+ "span",
17
+ "section",
18
+ "article",
19
+ "aside",
20
+ "header",
21
+ "footer",
22
+ "main",
23
+ "nav",
24
+ "ul",
25
+ "ol",
26
+ ].includes(value)
27
+ },
28
+ },
29
+ variant: {
30
+ type: String,
31
+ default: "subtle",
32
+ validator(value: string) {
33
+ return ["subtle", "vivid", "silver", "steel"].includes(value)
34
+ },
35
+ },
36
+ styleClassPassthrough: {
37
+ type: Array as PropType<string[]>,
38
+ default: () => [],
39
+ },
40
+ })
41
+
42
+ const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
43
+
44
+ watch(
45
+ () => props.styleClassPassthrough,
46
+ () => {
47
+ resetElementClasses(props.styleClassPassthrough)
48
+ }
49
+ )
50
+ </script>
51
+
52
+ <style scoped lang="css">
53
+ @property --glow-deg {
54
+ syntax: "<angle>";
55
+ inherits: true;
56
+ initial-value: -90deg;
57
+ }
58
+
59
+ /* the colors don't need to be registed */
60
+ @property --clr-1 {
61
+ syntax: "<color>";
62
+ inherits: true;
63
+ initial-value: red;
64
+ }
65
+
66
+ @property --clr-2 {
67
+ syntax: "<color>";
68
+ inherits: true;
69
+ initial-value: yellow;
70
+ }
71
+
72
+ @property --clr-3 {
73
+ syntax: "<color>";
74
+ inherits: true;
75
+ initial-value: green;
76
+ }
77
+
78
+ @property --clr-4 {
79
+ syntax: "<color>";
80
+ inherits: true;
81
+ initial-value: blue;
82
+ }
83
+
84
+ @property --clr-5 {
85
+ syntax: "<color>";
86
+ inherits: true;
87
+ initial-value: purple;
88
+ }
89
+
90
+ .glowing-border {
91
+ &.vivid {
92
+ --clr-1: #ff0000;
93
+ --clr-2: #ffa500;
94
+ --clr-3: #ffff00;
95
+ --clr-4: #008000;
96
+ --clr-5: #0000ff;
97
+ }
98
+
99
+ &.subtle {
100
+ --clr-1: #ff9a9e;
101
+ --clr-2: #fad0c4;
102
+ --clr-3: #fad0c4;
103
+ --clr-4: #fbc2eb;
104
+ --clr-5: #a18cd1;
105
+ }
106
+
107
+ &.silver {
108
+ --clr-1: #d4d4d4;
109
+ --clr-2: #e4e4e4;
110
+ --clr-3: #f5f5f5;
111
+ --clr-4: #e4e4e4;
112
+ --clr-5: #d4d4d4;
113
+ }
114
+
115
+ &.steel {
116
+ --clr-1: #434343;
117
+ --clr-2: #5a5a5a;
118
+ --clr-3: #6e6e6e;
119
+ --clr-4: #5a5a5a;
120
+ --clr-5: #434343;
121
+ }
122
+
123
+ --gradient-glow: var(--clr-1), var(--clr-2), var(--clr-3), var(--clr-4), var(--clr-5), var(--clr-1);
124
+
125
+ border: var(--border-width, 3px) solid transparent;
126
+ border-radius: 30px;
127
+ background: linear-gradient(var(--surface, canvas) 0 0) padding-box,
128
+ conic-gradient(from var(--glow-deg), var(--gradient-glow)) border-box;
129
+
130
+ animation: glow 10s infinite linear;
131
+
132
+ overflow: hidden;
133
+ }
134
+
135
+ @keyframes glow {
136
+ 100% {
137
+ --glow-deg: 270deg;
138
+ }
139
+ }
140
+ </style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "srcdev-nuxt-components",
3
3
  "type": "module",
4
- "version": "6.1.15",
4
+ "version": "6.1.17",
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",