@exakt/ui 0.0.43 → 0.0.44
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/dist/module.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
'my-2': solid,
|
|
15
15
|
loading,
|
|
16
16
|
fab,
|
|
17
|
-
|
|
17
|
+
...backgroundClass
|
|
18
18
|
}"
|
|
19
19
|
>
|
|
20
20
|
<div
|
|
@@ -41,8 +41,7 @@
|
|
|
41
41
|
</button>
|
|
42
42
|
</template>
|
|
43
43
|
<script lang="ts" setup>
|
|
44
|
-
import { computed, useNuxtApp,
|
|
45
|
-
//import { IonSpinner } from "@ionic/vue";
|
|
44
|
+
import { computed, useNuxtApp, } from "#imports";
|
|
46
45
|
const { $exakt } = useNuxtApp();
|
|
47
46
|
const props = withDefaults(
|
|
48
47
|
defineProps<{
|
|
@@ -86,14 +85,32 @@ const backgroundColorRgb = computed(() => {
|
|
|
86
85
|
if (!props.background || process.server) {
|
|
87
86
|
return { r: 0, g: 0, b: 0 };
|
|
88
87
|
}
|
|
89
|
-
return parseColor(
|
|
88
|
+
return parseColor($exakt.parseColor(props.background));
|
|
90
89
|
});
|
|
91
90
|
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
const isRootColor = computed(() => $exakt.rootColors.includes(props.background))
|
|
92
|
+
const backgroundClass = computed(() => {
|
|
93
|
+
const c: { [key: string]: boolean } = {}
|
|
94
|
+
|
|
95
|
+
if(props.background == 'transparent'){
|
|
96
|
+
c['transparent'] = true;
|
|
97
|
+
}else if (isRootColor.value) {
|
|
98
|
+
c["bg-" + props.background] = true
|
|
99
|
+
} else {
|
|
100
|
+
c['custom-color'] = true
|
|
101
|
+
}
|
|
95
102
|
|
|
103
|
+
return c
|
|
104
|
+
})
|
|
105
|
+
const backgroundColor = computed(() => {
|
|
106
|
+
if (isRootColor.value) { return 'unset' } else {
|
|
107
|
+
return props.background
|
|
108
|
+
}
|
|
109
|
+
})
|
|
96
110
|
const textColor = computed(() => {
|
|
111
|
+
if (isRootColor.value) {
|
|
112
|
+
return 'unset';
|
|
113
|
+
}
|
|
97
114
|
if (props.color) {
|
|
98
115
|
return props.color;
|
|
99
116
|
}
|
|
@@ -112,14 +129,7 @@ const textColor = computed(() => {
|
|
|
112
129
|
return "#FFFFFF";
|
|
113
130
|
});
|
|
114
131
|
|
|
115
|
-
const hoverColor = computed(() => {
|
|
116
|
-
if (parsedBackgroundProp.value === "transparent") {
|
|
117
|
-
return "rgba(98, 98, 98, 0.15)";
|
|
118
|
-
}
|
|
119
132
|
|
|
120
|
-
const rgb = backgroundColorRgb.value;
|
|
121
|
-
return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 0.9)`;
|
|
122
|
-
});
|
|
123
133
|
</script>
|
|
124
134
|
<style lang="scss" scoped>
|
|
125
135
|
.e-btn-content {
|
|
@@ -135,7 +145,6 @@ const hoverColor = computed(() => {
|
|
|
135
145
|
|
|
136
146
|
.e-btn {
|
|
137
147
|
user-select: none;
|
|
138
|
-
background: rgba(0, 0, 0, 0);
|
|
139
148
|
display: flex;
|
|
140
149
|
font-size: 1rem;
|
|
141
150
|
|
|
@@ -144,7 +153,6 @@ const hoverColor = computed(() => {
|
|
|
144
153
|
align-items: center;
|
|
145
154
|
padding: 0.3rem var(--e-core-padding-x);
|
|
146
155
|
overflow: hidden;
|
|
147
|
-
color: var(--e-color-dark);
|
|
148
156
|
outline: none;
|
|
149
157
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
150
158
|
border: none;
|
|
@@ -159,6 +167,14 @@ const hoverColor = computed(() => {
|
|
|
159
167
|
|
|
160
168
|
border: transparent solid 0.1rem;
|
|
161
169
|
|
|
170
|
+
&.transparent {
|
|
171
|
+
color: var(--e-color-dark);
|
|
172
|
+
background: rgba(0, 0, 0, 0);
|
|
173
|
+
&:hover {
|
|
174
|
+
background: rgba(98, 98, 98, 0.15);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
162
178
|
&:focus-visible {
|
|
163
179
|
transition: border-width 0.2s;
|
|
164
180
|
border: var(--e-color-dark) solid 0.1rem;
|
|
@@ -173,7 +189,8 @@ const hoverColor = computed(() => {
|
|
|
173
189
|
}
|
|
174
190
|
|
|
175
191
|
&:hover {
|
|
176
|
-
|
|
192
|
+
// background: rgba(98, 98, 98, 0.15);
|
|
193
|
+
opacity: 0.7;
|
|
177
194
|
border: transparent solid 0.1rem;
|
|
178
195
|
}
|
|
179
196
|
|
|
@@ -198,13 +215,13 @@ const hoverColor = computed(() => {
|
|
|
198
215
|
width: 100%;
|
|
199
216
|
}
|
|
200
217
|
|
|
201
|
-
&.
|
|
202
|
-
background-color: v-bind(
|
|
218
|
+
&.custom-color {
|
|
219
|
+
background-color: v-bind(backgroundColor);
|
|
203
220
|
color: v-bind(textColor);
|
|
204
221
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}
|
|
222
|
+
/* &:hover {
|
|
223
|
+
opacity: 0.9;
|
|
224
|
+
} */
|
|
208
225
|
}
|
|
209
226
|
|
|
210
227
|
&.solid {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="hr">
|
|
3
|
+
<slot />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
<style scoped>
|
|
7
|
+
.hr {
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
text-align: center;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.hr::before,
|
|
14
|
+
.hr::after {
|
|
15
|
+
content: '';
|
|
16
|
+
flex: 1;
|
|
17
|
+
border-bottom: .125em solid var(--e-color-elev);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.hr:not(:empty)::before {
|
|
21
|
+
margin-right: .75em;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.hr:not(:empty)::after {
|
|
25
|
+
margin-left: .75em;
|
|
26
|
+
}
|
|
27
|
+
</style>
|
package/dist/runtime/plugin.mjs
CHANGED