@bagelink/vue 1.9.83 → 1.9.86
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/components/Avatar.vue.d.ts +1 -0
- package/dist/components/Avatar.vue.d.ts.map +1 -1
- package/dist/components/Badge.vue.d.ts +0 -1
- package/dist/components/Badge.vue.d.ts.map +1 -1
- package/dist/components/Btn.vue.d.ts.map +1 -1
- package/dist/components/Dropdown.vue.d.ts.map +1 -1
- package/dist/components/Loading.vue.d.ts +2 -1
- package/dist/components/Loading.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/index.vue.d.ts.map +1 -1
- package/dist/form-flow/FormFlow.vue.d.ts.map +1 -1
- package/dist/form-flow/form-flow.d.ts +9 -9
- package/dist/form-flow/form-flow.d.ts.map +1 -1
- package/dist/index.cjs +163 -85
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +25737 -25545
- package/dist/plugins/useToast.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/utils/filterRef.d.ts +15 -0
- package/dist/utils/filterRef.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/Avatar.vue +6 -2
- package/src/components/Badge.vue +14 -1084
- package/src/components/Btn.vue +37 -37
- package/src/components/Dropdown.vue +1 -1
- package/src/components/Loading.vue +15 -6
- package/src/components/form/inputs/RichText/index.vue +325 -221
- package/src/form-flow/FormFlow.vue +9 -0
- package/src/form-flow/form-flow.ts +13 -3
- package/src/index.ts +1 -1
- package/src/plugins/useToast.ts +14 -0
- package/src/styles/bagel.css +1 -0
- package/src/styles/base-colors.css +1429 -46
- package/src/styles/text.css +1755 -1755
- package/src/styles/toast-overrides.css +10 -0
- package/src/utils/filterRef.ts +133 -0
- package/src/styles/btnColors.css +0 -847
package/src/components/Btn.vue
CHANGED
|
@@ -59,6 +59,18 @@ const emit = defineEmits<{
|
|
|
59
59
|
|
|
60
60
|
const { $t } = useI18n()
|
|
61
61
|
|
|
62
|
+
const computedPairClass = computed(() => {
|
|
63
|
+
const theme = props.color || props.theme
|
|
64
|
+
if (!theme) {
|
|
65
|
+
// Only flat/border buttons get a default for visibility
|
|
66
|
+
if (props.flat || props.border || props.outline) {
|
|
67
|
+
return 'pair-black'
|
|
68
|
+
}
|
|
69
|
+
return undefined
|
|
70
|
+
}
|
|
71
|
+
return `pair-${theme}`
|
|
72
|
+
})
|
|
73
|
+
|
|
62
74
|
const isMobileScreen = ref(false)
|
|
63
75
|
|
|
64
76
|
function checkMobile() {
|
|
@@ -140,7 +152,7 @@ const slots: SetupContext['slots'] = useSlots()
|
|
|
140
152
|
|
|
141
153
|
<template>
|
|
142
154
|
<component
|
|
143
|
-
:is="isComponent" v-ripple="ripple" v-bind="bind" :disabled="disabled" class="bgl_btn" :class="{
|
|
155
|
+
:is="isComponent" v-ripple="ripple" v-bind="bind" :disabled="disabled" class="bgl_btn" :class="[{
|
|
144
156
|
'bgl_btn-icon': icon && !slots.default && !value,
|
|
145
157
|
thin,
|
|
146
158
|
'bgl_btn_xsSize': size === 'xs' || size === 'extra-small',
|
|
@@ -155,11 +167,9 @@ const slots: SetupContext['slots'] = useSlots()
|
|
|
155
167
|
'bgl_btn_alignStartMobile': alignTxtMobile === 'start',
|
|
156
168
|
'bgl_btn_alignEndMobile': alignTxtMobile === 'end',
|
|
157
169
|
round,
|
|
158
|
-
'
|
|
159
|
-
'
|
|
160
|
-
|
|
161
|
-
[`bgl_btn-${theme}`]: theme,
|
|
162
|
-
}" :tabindex="disabled ? -1 : 0" @click.stop="handleClick" @keydown.enter="handleClick" @keydown.space="handleClick"
|
|
170
|
+
'bgl_flatPill': flat,
|
|
171
|
+
'bgl_pill-border': border || outline,
|
|
172
|
+
}, computedPairClass]" :tabindex="disabled ? -1 : 0" @click.stop="handleClick" @keydown.enter="handleClick" @keydown.space="handleClick"
|
|
163
173
|
>
|
|
164
174
|
<Loading v-if="loading" class="h-100p" size="15" />
|
|
165
175
|
<div v-else class="bgl_btn-flex">
|
|
@@ -180,15 +190,14 @@ const slots: SetupContext['slots'] = useSlots()
|
|
|
180
190
|
</template>
|
|
181
191
|
|
|
182
192
|
<style scoped>
|
|
183
|
-
@import '../styles/
|
|
193
|
+
/* @import '../styles/base-colors.css'; */
|
|
184
194
|
|
|
185
195
|
.bgl_btn {
|
|
186
196
|
padding-left: var(--btn-padding);
|
|
187
197
|
padding-right: var(--btn-padding);
|
|
188
198
|
transition: var(--bgl-transition);
|
|
189
|
-
background: var(--btn-bg);
|
|
190
|
-
color: var(--btn-color);
|
|
191
199
|
text-decoration: none;
|
|
200
|
+
/* Colors now handled by pair-* classes */
|
|
192
201
|
}
|
|
193
202
|
|
|
194
203
|
.bgl_btn.bgl_btn-icon {
|
|
@@ -227,20 +236,7 @@ a {
|
|
|
227
236
|
filter: var(--bgl-active-filter);
|
|
228
237
|
}
|
|
229
238
|
|
|
230
|
-
.
|
|
231
|
-
background: transparent;
|
|
232
|
-
color: var(--btn-flat-color);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
.bgl_btn_flat:hover:not(:disabled),
|
|
236
|
-
.bgl_btn-icon.bgl_btn_flat:hover:not(:disabled) {
|
|
237
|
-
background: var(--bgl-gray-tint);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
.bgl_btn.bgl_btn_flat:active:not(:disabled),
|
|
241
|
-
.bgl_btn-icon.bgl_btn_flat:active:not(:disabled) {
|
|
242
|
-
background: var(--bgl-gray-tint-dark);
|
|
243
|
-
}
|
|
239
|
+
/* Flat hover/active styles now handled by base-colors.css */
|
|
244
240
|
|
|
245
241
|
.bgl_btn.round {
|
|
246
242
|
border-radius: 1000px !important;
|
|
@@ -254,20 +250,7 @@ a {
|
|
|
254
250
|
transform: rotateY(0deg);
|
|
255
251
|
}
|
|
256
252
|
|
|
257
|
-
.
|
|
258
|
-
.bgl_btn-icon.bgl_btn_flat.bgl_btn-border {
|
|
259
|
-
border: 1px solid var(--btn-flat-color);
|
|
260
|
-
background: transparent;
|
|
261
|
-
color: var(--btn-flat-color);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
.bgl_btn-border:hover {
|
|
265
|
-
color: var(--btn-flat-color);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
.bgl_btn-border:active:not(:disabled) {
|
|
269
|
-
filter: brightness(80%);
|
|
270
|
-
}
|
|
253
|
+
/* Border active styles now handled by base-colors.css */
|
|
271
254
|
|
|
272
255
|
.bgl_btn:disabled,
|
|
273
256
|
.bgl_btn[disabled=true] {
|
|
@@ -399,4 +382,21 @@ a {
|
|
|
399
382
|
justify-content: flex-end;
|
|
400
383
|
}
|
|
401
384
|
}
|
|
385
|
+
|
|
386
|
+
/* Ensure external color classes always override pair classes */
|
|
387
|
+
.bgl_btn.color-white {
|
|
388
|
+
color: white !important;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.bgl_btn.color-black {
|
|
392
|
+
color: black !important;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.bgl_btn.text-white {
|
|
396
|
+
color: white !important;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.bgl_btn.text-black {
|
|
400
|
+
color: black !important;
|
|
401
|
+
}
|
|
402
402
|
</style>
|
|
@@ -191,7 +191,7 @@ const computedPopperHideTriggers = computed((): TriggerEvent[] => {
|
|
|
191
191
|
|
|
192
192
|
const computedAutoHide = computed(() => autoHide)
|
|
193
193
|
|
|
194
|
-
const container = computed(() =>
|
|
194
|
+
const container = computed(() => 'body')
|
|
195
195
|
|
|
196
196
|
const computedDelay = computed((): number | { show: number, hide: number } | undefined => {
|
|
197
197
|
if (delay !== undefined) { return delay }
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import type { ThemeType } from '@bagelink/vue'
|
|
2
3
|
import type { SizeUnit, SizeType } from '../types/BtnOptions'
|
|
3
4
|
import { computed } from 'vue'
|
|
4
5
|
import { standardSize } from '../utils/sizeParsing'
|
|
@@ -10,7 +11,7 @@ const { type: theme = 'ring', size = 50, thickness, duration = 1.2, color, progr
|
|
|
10
11
|
thickness?: SizeUnit
|
|
11
12
|
duration?: number | string
|
|
12
13
|
type?: LoadingType
|
|
13
|
-
color?: string
|
|
14
|
+
color?: ThemeType | string
|
|
14
15
|
progress?: number
|
|
15
16
|
}>()
|
|
16
17
|
|
|
@@ -22,6 +23,14 @@ const computedBorder = computed(() => {
|
|
|
22
23
|
return standardSize(borderValue)
|
|
23
24
|
})
|
|
24
25
|
|
|
26
|
+
const computedColor = computed(() => {
|
|
27
|
+
if (!color) return 'var(--bgl-black)'
|
|
28
|
+
if (color.startsWith('#') || color.startsWith('rgb') || color.startsWith('var(')) {
|
|
29
|
+
return color // Custom color string
|
|
30
|
+
}
|
|
31
|
+
return `var(--bgl-${color})` // Convert theme color to CSS variable
|
|
32
|
+
})
|
|
33
|
+
|
|
25
34
|
// SVG progress calculations
|
|
26
35
|
const svgStrokeWidth = computed(() => {
|
|
27
36
|
const borderNumeric = Number.parseFloat(computedBorder.value)
|
|
@@ -40,14 +49,14 @@ const svgCircumference = computed(() => Math.PI * 2 * svgRadius.value)
|
|
|
40
49
|
<!-- Bar Theme -->
|
|
41
50
|
<template v-if="theme === 'bar'">
|
|
42
51
|
<slot />
|
|
43
|
-
<div class="lds-bar" :style="{ animationDuration, color }" />
|
|
52
|
+
<div class="lds-bar" :style="{ animationDuration, color: computedColor }" />
|
|
44
53
|
</template>
|
|
45
54
|
|
|
46
55
|
<!-- Ellipsis Theme -->
|
|
47
56
|
<template v-if="theme === 'ellipsis'">
|
|
48
57
|
<slot />
|
|
49
58
|
<div class="lds-ellipsis" :style="{ '--size': computedSize }">
|
|
50
|
-
<div v-for="n in 4" :key="n" :style="{ color, '--size': computedSize }" />
|
|
59
|
+
<div v-for="n in 4" :key="n" :style="{ 'color': computedColor, '--size': computedSize }" />
|
|
51
60
|
</div>
|
|
52
61
|
</template>
|
|
53
62
|
|
|
@@ -56,11 +65,11 @@ const svgCircumference = computed(() => Math.PI * 2 * svgRadius.value)
|
|
|
56
65
|
<template v-if="progress !== undefined">
|
|
57
66
|
<svg :width="computedSize" :height="computedSize" viewBox="0 0 100 100">
|
|
58
67
|
<circle
|
|
59
|
-
cx="50" cy="50" :r="svgRadius" fill="none" :stroke="
|
|
68
|
+
cx="50" cy="50" :r="svgRadius" fill="none" :stroke="computedColor"
|
|
60
69
|
:stroke-width="svgStrokeWidth" stroke-opacity="0.2"
|
|
61
70
|
/>
|
|
62
71
|
<circle
|
|
63
|
-
cx="50" cy="50" :r="svgRadius" fill="none" :stroke="
|
|
72
|
+
cx="50" cy="50" :r="svgRadius" fill="none" :stroke="computedColor"
|
|
64
73
|
:stroke-width="svgStrokeWidth" stroke-linecap="round"
|
|
65
74
|
:stroke-dasharray="`${(progress / 100) * svgCircumference} ${svgCircumference}`"
|
|
66
75
|
transform="rotate(-90 50 50)"
|
|
@@ -69,7 +78,7 @@ const svgCircumference = computed(() => Math.PI * 2 * svgRadius.value)
|
|
|
69
78
|
</template>
|
|
70
79
|
<div
|
|
71
80
|
v-for="n in 4" v-else :key="n" class="ring-segment" :style="{
|
|
72
|
-
color,
|
|
81
|
+
'color': computedColor,
|
|
73
82
|
'width': computedSize,
|
|
74
83
|
'height': computedSize,
|
|
75
84
|
'borderWidth': computedBorder,
|