@exakt/ui 0.0.43 → 0.0.45
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,15 @@ 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
|
+
opacity: 1;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
162
179
|
&:focus-visible {
|
|
163
180
|
transition: border-width 0.2s;
|
|
164
181
|
border: var(--e-color-dark) solid 0.1rem;
|
|
@@ -173,7 +190,8 @@ const hoverColor = computed(() => {
|
|
|
173
190
|
}
|
|
174
191
|
|
|
175
192
|
&:hover {
|
|
176
|
-
|
|
193
|
+
// background: rgba(98, 98, 98, 0.15);
|
|
194
|
+
opacity: 0.7;
|
|
177
195
|
border: transparent solid 0.1rem;
|
|
178
196
|
}
|
|
179
197
|
|
|
@@ -198,13 +216,13 @@ const hoverColor = computed(() => {
|
|
|
198
216
|
width: 100%;
|
|
199
217
|
}
|
|
200
218
|
|
|
201
|
-
&.
|
|
202
|
-
background-color: v-bind(
|
|
219
|
+
&.custom-color {
|
|
220
|
+
background-color: v-bind(backgroundColor);
|
|
203
221
|
color: v-bind(textColor);
|
|
204
222
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}
|
|
223
|
+
/* &:hover {
|
|
224
|
+
opacity: 0.9;
|
|
225
|
+
} */
|
|
208
226
|
}
|
|
209
227
|
|
|
210
228
|
&.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