@bagelink/vue 1.21.30 → 1.21.32
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/{StructuredEditor-Vwn0_hXR.js → StructuredEditor-78Df0ADI.js} +1 -1
- package/dist/{StructuredEditor-CSpZb-WA.cjs → StructuredEditor-MXkv4nok.cjs} +1 -1
- package/dist/components/Card.vue.d.ts +4 -0
- package/dist/components/Card.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/Checkbox.vue.d.ts +13 -2
- package/dist/components/form/inputs/Checkbox.vue.d.ts.map +1 -1
- package/dist/core.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{src-FXpWQVAW.js → src-CeEsGKN7.js} +2977 -2938
- package/dist/{src-CbQepE2Q.cjs → src-Duj4FrLr.cjs} +34 -34
- package/dist/src.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/components/Card.vue +32 -0
- package/src/components/form/inputs/Checkbox.vue +75 -22
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bagelink/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.21.
|
|
4
|
+
"version": "1.21.32",
|
|
5
5
|
"description": "Bagel core sdk packages",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Bagel Studio",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@types/signature_pad": "^4.0.0",
|
|
64
64
|
"vue": "^3.5.45",
|
|
65
65
|
"vue-component-type-helpers": "^2.2.12",
|
|
66
|
-
"@bagelink/sdk": "1.21.
|
|
66
|
+
"@bagelink/sdk": "1.21.32"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"@bagelink/sdk": "*",
|
package/src/components/Card.vue
CHANGED
|
@@ -24,6 +24,10 @@ const props = defineProps<{
|
|
|
24
24
|
`#bottom-end` is present. For full control of the header center, use the
|
|
25
25
|
`#header` slot instead of `title`. */
|
|
26
26
|
title?: string
|
|
27
|
+
/** Background for the header row. Tone name (`primary`, `primary-tint`,
|
|
28
|
+
`gray`) or any CSS color / `var(...)`. When set, the header paints
|
|
29
|
+
edge-to-edge (and under the top corners when there is no `label`). */
|
|
30
|
+
headerBg?: string
|
|
27
31
|
thin?: boolean
|
|
28
32
|
outline?: boolean
|
|
29
33
|
h100?: boolean
|
|
@@ -97,6 +101,19 @@ const hasHeader = computed<boolean>(() =>
|
|
|
97
101
|
const hasFooter = computed<boolean>(() =>
|
|
98
102
|
!!(slots.footer || slots['bottom-start'] || slots['bottom-end']),
|
|
99
103
|
)
|
|
104
|
+
|
|
105
|
+
/** Resolve a tone name (`primary-tint`) to `var(--bgl-…)`, pass through CSS colors. */
|
|
106
|
+
function resolveHeaderBg(color?: string) {
|
|
107
|
+
if (!color) { return undefined }
|
|
108
|
+
if (['transparent', 'inherit', 'currentColor'].includes(color)) { return color }
|
|
109
|
+
const tone = color.replace(/^--bgl-|^bgl-/, '')
|
|
110
|
+
return /^[a-z][a-z0-9-]*$/i.test(tone) ? `var(--bgl-${tone})` : color
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const headerStyle = computed(() => {
|
|
114
|
+
const bg = resolveHeaderBg(props.headerBg)
|
|
115
|
+
return bg ? { background: bg } : undefined
|
|
116
|
+
})
|
|
100
117
|
</script>
|
|
101
118
|
|
|
102
119
|
<template>
|
|
@@ -123,6 +140,8 @@ const hasFooter = computed<boolean>(() =>
|
|
|
123
140
|
<div
|
|
124
141
|
v-if="hasHeader"
|
|
125
142
|
class="card_header flex space-between align-items-center w-100p"
|
|
143
|
+
:class="{ 'card_header--bg': !!headerBg, 'card_header--bg-top': !!headerBg && !label }"
|
|
144
|
+
:style="headerStyle"
|
|
126
145
|
>
|
|
127
146
|
<span v-if="$slots['top-start']" class="card_header_start flex align-items-center gap-05">
|
|
128
147
|
<slot name="top-start" />
|
|
@@ -177,6 +196,18 @@ margin-bottom: calc(var(--bgl-card-pad) / 2);
|
|
|
177
196
|
border-bottom: 1px solid var(--bgl-border-color);
|
|
178
197
|
min-height: 0;
|
|
179
198
|
}
|
|
199
|
+
/* Colored header: bleed to the card's inline edges so the paint isn't inset. */
|
|
200
|
+
.card_header--bg {
|
|
201
|
+
margin-inline: calc(var(--bgl-card-pad) * -1);
|
|
202
|
+
padding-inline: var(--bgl-card-pad);
|
|
203
|
+
}
|
|
204
|
+
/* No label above — also bleed under the top corners. */
|
|
205
|
+
.card_header--bg-top {
|
|
206
|
+
margin-top: calc(var(--bgl-card-pad) * -1);
|
|
207
|
+
padding-top: calc(var(--bgl-card-pad) / 2);
|
|
208
|
+
border-start-start-radius: var(--bgl-card-border-radius);
|
|
209
|
+
border-start-end-radius: var(--bgl-card-border-radius);
|
|
210
|
+
}
|
|
180
211
|
.card_header_main {
|
|
181
212
|
text-align: start;
|
|
182
213
|
min-width: 0;
|
|
@@ -219,6 +250,7 @@ padding: var(--bgl-card-pad);
|
|
|
219
250
|
.bgl_card.p-0 .card_header {
|
|
220
251
|
margin-inline: 0; padding-inline: 1rem; padding-block: 0.75rem; margin-bottom: 0;
|
|
221
252
|
}
|
|
253
|
+
.bgl_card.p-0 .card_header--bg-top { margin-top: 0; }
|
|
222
254
|
.bgl_card.p-0 .card_footer {
|
|
223
255
|
margin-inline: 0; padding-inline: 1rem; padding-block: 0.75rem; margin-top: 0;
|
|
224
256
|
}
|
|
@@ -1,10 +1,41 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
defineOptions({ name: 'BglCheckbox' })
|
|
3
|
+
import { computed } from 'vue'
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(defineProps<{
|
|
6
|
+
/** Checked fill tone (`primary`, `green`) or any CSS color. */
|
|
7
|
+
color?: string
|
|
8
|
+
/** Squared corners instead of the default circle. */
|
|
9
|
+
square?: boolean
|
|
10
|
+
/** Inner mark when checked. `dot` keeps the current ring-fill look. */
|
|
11
|
+
indicator?: 'dot' | 'check'
|
|
12
|
+
}>(), {
|
|
13
|
+
color: 'primary',
|
|
14
|
+
indicator: 'dot',
|
|
15
|
+
})
|
|
16
|
+
|
|
3
17
|
const val = defineModel<boolean>('modelValue', { default: false })
|
|
18
|
+
|
|
19
|
+
function resolveColor(color: string) {
|
|
20
|
+
if (['transparent', 'inherit', 'currentColor'].includes(color)) { return color }
|
|
21
|
+
const tone = color.replace(/^--bgl-|^bgl-/, '')
|
|
22
|
+
return /^[a-z][a-z0-9-]*$/i.test(tone) ? `var(--bgl-${tone})` : color
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const rootStyle = computed(() => ({
|
|
26
|
+
'--bgl-checkbox-color': resolveColor(props.color),
|
|
27
|
+
}))
|
|
4
28
|
</script>
|
|
5
29
|
|
|
6
30
|
<template>
|
|
7
|
-
<label
|
|
31
|
+
<label
|
|
32
|
+
class="primary-checkbox"
|
|
33
|
+
:class="{
|
|
34
|
+
'primary-checkbox--square': square,
|
|
35
|
+
'primary-checkbox--check': indicator === 'check',
|
|
36
|
+
}"
|
|
37
|
+
:style="rootStyle"
|
|
38
|
+
>
|
|
8
39
|
<slot name="label" />
|
|
9
40
|
<input v-model="val" type="checkbox">
|
|
10
41
|
</label>
|
|
@@ -13,41 +44,63 @@ const val = defineModel<boolean>('modelValue', { default: false })
|
|
|
13
44
|
<style scoped>
|
|
14
45
|
|
|
15
46
|
.primary-checkbox input {
|
|
16
|
-
|
|
17
|
-
|
|
47
|
+
appearance: none;
|
|
48
|
+
accent-color: var(--bgl-checkbox-color, var(--bgl-primary));
|
|
18
49
|
height: calc(var(--bgl-input-height) / 1.75);
|
|
19
50
|
width: calc(var(--bgl-input-height) / 1.75);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
51
|
+
min-width: 0;
|
|
52
|
+
display: flex;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
align-items: center;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
border-radius: 100%;
|
|
57
|
+
background: var(--bgl-box-bg);
|
|
58
|
+
border: 2px solid var(--bgl-gray);
|
|
59
|
+
transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.primary-checkbox--square input {
|
|
63
|
+
border-radius: 0.35rem;
|
|
28
64
|
}
|
|
29
65
|
|
|
30
66
|
.primary-checkbox {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
67
|
+
height: var(--bgl-input-height);
|
|
68
|
+
width: var(--bgl-input-height);
|
|
69
|
+
display: flex;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
align-items: center;
|
|
72
|
+
transition: var(--bgl-transition);
|
|
73
|
+
transform: scale(0.8);
|
|
38
74
|
}
|
|
39
75
|
|
|
40
76
|
.primary-checkbox:hover {
|
|
41
|
-
|
|
77
|
+
filter: brightness(90%);
|
|
42
78
|
}
|
|
43
79
|
|
|
44
80
|
.primary-checkbox:active {
|
|
45
|
-
|
|
81
|
+
filter: brightness(80%);
|
|
46
82
|
}
|
|
47
83
|
|
|
84
|
+
/* Dot (default): solid fill + inset white ring. */
|
|
48
85
|
.primary-checkbox input:checked {
|
|
49
|
-
|
|
50
|
-
|
|
86
|
+
background: var(--bgl-checkbox-color, var(--bgl-primary));
|
|
87
|
+
border-color: var(--bgl-checkbox-color, var(--bgl-primary));
|
|
88
|
+
box-shadow: inset 0 0 0 2px white;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* Check: solid fill + CSS checkmark, no ring. */
|
|
92
|
+
.primary-checkbox--check input:checked {
|
|
93
|
+
box-shadow: none;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.primary-checkbox--check input:checked::after {
|
|
97
|
+
content: "";
|
|
98
|
+
width: 28%;
|
|
99
|
+
height: 52%;
|
|
100
|
+
border: solid #fff;
|
|
101
|
+
border-width: 0 2px 2px 0;
|
|
102
|
+
transform: rotate(45deg) translate(-5%, -10%);
|
|
103
|
+
box-sizing: border-box;
|
|
51
104
|
}
|
|
52
105
|
|
|
53
106
|
</style>
|