srcdev-nuxt-components 6.1.16 → 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.
@@ -1,12 +1,16 @@
1
1
  <template>
2
- <component :is="tag" class="display-card" :class="[variant, elementClasses]">
3
- <div v-if="slots.header" class="display-card-header">
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">
4
8
  <slot name="header"></slot>
5
9
  </div>
6
- <div v-if="slots.default" class="display-card-content">
10
+ <div v-if="slots.default" class="card-row display-card-content">
7
11
  <slot name="default"></slot>
8
12
  </div>
9
- <div v-if="slots.footer" class="display-card-footer">
13
+ <div v-if="slots.footer" class="card-row display-card-footer">
10
14
  <slot name="footer"></slot>
11
15
  </div>
12
16
  </component>
@@ -21,9 +25,17 @@ const props = defineProps({
21
25
  return ["div", "section", "article", "aside", "main", "nav"].includes(value)
22
26
  },
23
27
  },
28
+ hasDividers: {
29
+ type: Boolean,
30
+ default: false,
31
+ },
32
+ noOutline: {
33
+ type: Boolean,
34
+ default: false,
35
+ },
24
36
  variant: {
25
37
  type: String,
26
- default: "subtle",
38
+ default: "solid",
27
39
  validator(value: string) {
28
40
  return ["solid", "subtle", "soft", "outline"].includes(value)
29
41
  },
@@ -48,6 +60,10 @@ watch(
48
60
  <style lang="css">
49
61
  .display-card {
50
62
  --_inner-padding: 1rem;
63
+ --_background-color: transparent;
64
+ --_border-color: transparent;
65
+ --_border-width: 0.2rem;
66
+ --_box-shadow-color: transparent;
51
67
 
52
68
  display: grid;
53
69
  grid-auto-flow: row;
@@ -55,40 +71,49 @@ watch(
55
71
  border-radius: 0.5rem;
56
72
  overflow: hidden;
57
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
+
58
82
  &.solid {
59
- background-color: light-dark(var(--gray-0), var(--gray-12));
60
- border: 0.2rem solid light-dark(var(--gray-4), var(--gray-8));
83
+ --_background-color: light-dark(var(--gray-0), var(--gray-12));
84
+ --_border-color: light-dark(var(--gray-4), var(--gray-8));
61
85
  }
62
86
 
63
87
  &.subtle {
64
- background-color: color-mix(in oklab, light-dark(var(--gray-1), var(--gray-8)) 50%, transparent);
65
- border: 0.2rem solid light-dark(var(--gray-3), var(--gray-9));
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));
66
90
  }
67
91
 
68
92
  &.soft {
69
- background-color: color-mix(in oklab, light-dark(var(--gray-1), var(--gray-8)) 20%, transparent);
70
- box-shadow: 0px 0px 4px 2px color-mix(in oklab, light-dark(var(--gray-2), var(--gray-8)) 80%, transparent);
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);
71
95
  }
72
96
 
73
97
  &.outline {
74
- background-color: transparent;
75
- border: 0.2rem solid light-dark(var(--gray-4), var(--gray-8));
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
+ }
76
106
  }
77
107
 
78
108
  .display-card-header {
79
- /* background-color: darkblue; */
80
109
  padding: var(--_inner-padding);
81
- border-bottom: 0.2rem solid light-dark(var(--gray-1), var(--gray-8));
82
110
  }
83
111
 
84
112
  .display-card-content {
85
- /* background-color: darkgreen; */
86
113
  padding: var(--_inner-padding);
87
- border-bottom: 0.2rem solid light-dark(var(--gray-1), var(--gray-8));
88
114
  }
89
115
 
90
116
  .display-card-footer {
91
- /* background-color: darkslateblue; */
92
117
  padding: var(--_inner-padding);
93
118
  }
94
119
  }
@@ -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.16",
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",