@bagelink/vue 1.21.30 → 1.21.36

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "1.21.30",
4
+ "version": "1.21.36",
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.30"
66
+ "@bagelink/sdk": "1.21.36"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "@bagelink/sdk": "*",
@@ -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
  }
@@ -239,6 +239,17 @@ const iconStyle = computed(() => {
239
239
  font-family: 'Material Symbols Outlined', serif !important;
240
240
  }
241
241
 
242
+ /* Morph outline ↔ filled (and weight) via the variable-font FILL/wght axes. */
243
+ .bgl_icon-font:not(.fa-brands) {
244
+ transition: font-variation-settings 0.2s ease;
245
+ }
246
+
247
+ @media (prefers-reduced-motion: reduce) {
248
+ .bgl_icon-font:not(.fa-brands) {
249
+ transition: none;
250
+ }
251
+ }
252
+
242
253
  .bgl_icon-font.bgl_icon-round {
243
254
  display: inline-flex;
244
255
  align-items: center;
@@ -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 class="primary-checkbox">
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
- appearance: none;
17
- accent-color: var(--bgl-accent-color);
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
- min-width: 0;
21
- display: flex;
22
- justify-content: center;
23
- align-items: center;
24
- cursor: pointer;
25
- border-radius: 100%;
26
- background: var(--bgl-box-bg);
27
- border: 2px solid var(--bgl-gray);
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
- height:var(--bgl-input-height);
32
- width:var(--bgl-input-height);
33
- display: flex;
34
- justify-content: center;
35
- align-items: center;
36
- transition: var(--bgl-transition);
37
- transform: scale(0.8);
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
- filter: brightness(90%);
77
+ filter: brightness(90%);
42
78
  }
43
79
 
44
80
  .primary-checkbox:active {
45
- filter: brightness(80%);
81
+ filter: brightness(80%);
46
82
  }
47
83
 
84
+ /* Dot (default): solid fill + inset white ring. */
48
85
  .primary-checkbox input:checked {
49
- background: var(--bgl-primary);
50
- box-shadow: inset 0 0 0px 2px white;
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>
@@ -297,10 +297,22 @@ justify-content: flex-start !important;
297
297
  }
298
298
  .app-header--m-single-flow > .app-header-side,
299
299
  .app-header--m-single-flow > .app-header-center,
300
- .app-header--m-single-flow > .app-header-side > .app-header-slot > *,
301
- .app-header--m-single-flow > .app-header-center > .app-header-slot > * {
300
+ .app-header--m-single-flow > .app-header-side > .app-header-slot > *:not(.bgl_btn),
301
+ .app-header--m-single-flow > .app-header-center > .app-header-slot > *:not(.bgl_btn){
302
302
  display: contents !important;
303
303
  }
304
+ .app-header.app-header--m-single-flow .page-top{
305
+ max-width: calc(100% - 5rem) !important;
306
+ }
307
+ .app-header.app-header--m-single-flow .top-subtitle{
308
+ display: block;
309
+ display: -webkit-box;
310
+ max-width: 100%;
311
+ -webkit-box-orient: vertical;
312
+ overflow: hidden;
313
+ text-overflow: ellipsis;
314
+ -webkit-line-clamp: 1;
315
+ }
304
316
  }
305
317
 
306
318
  </style>
@@ -16,6 +16,8 @@ const props = defineProps<{
16
16
  outline?: boolean
17
17
  thin?: boolean
18
18
  size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
19
+ /** Mobile-only size override (≤ 910px). e.g. size="lg" size-mobile="sm". */
20
+ sizeMobile?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
19
21
  fullWidth?: boolean
20
22
  fullWidthMobile?: boolean
21
23
  alignTxt?: 'center' | 'start' | 'end'
@@ -26,6 +28,11 @@ const props = defineProps<{
26
28
  iconEnd?: IconType
27
29
  iconSize?: number | string
28
30
  iconMobileSize?: number | string
31
+ /**
32
+ * On mobile (≤ 910px): equal-height tabs based on the tallest content
33
+ * (labels may wrap). When a tab has an icon, it stacks above the label.
34
+ */
35
+ iconAboveMobile?: boolean
29
36
  }>()
30
37
 
31
38
  const emit = defineEmits(['update:modelValue'])
@@ -18,6 +18,8 @@ const props = defineProps<{
18
18
  iconMobileSize?: number | string
19
19
  thin?: boolean
20
20
  size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
21
+ /** Mobile-only size override (≤ 910px). e.g. size="lg" size-mobile="sm". */
22
+ sizeMobile?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
21
23
  fullWidth?: boolean
22
24
  fullWidthMobile?: boolean
23
25
  alignTxt?: 'center' | 'start' | 'end'
@@ -27,6 +29,11 @@ const props = defineProps<{
27
29
  frame?: boolean
28
30
  /** Render only each tab's icon; its label becomes the tooltip + aria-label. */
29
31
  iconOnly?: boolean
32
+ /**
33
+ * On mobile (≤ 910px): equal-height tabs based on the tallest content
34
+ * (labels may wrap). When a tab has an icon, it stacks above the label.
35
+ */
36
+ iconAboveMobile?: boolean
30
37
  }>()
31
38
 
32
39
  const emit = defineEmits(['update:modelValue'])
@@ -158,6 +165,12 @@ function tabLabel(tab: Tab) {
158
165
  return tab.label
159
166
  }
160
167
 
168
+ /** True when this tab will render a leading/trailing icon. */
169
+ function tabHasIcon(tab: Tab) {
170
+ if (props.icon || props.iconEnd) { return true }
171
+ return typeof tab !== 'string' && !!tab.icon
172
+ }
173
+
161
174
  watch(
162
175
  () => props.modelValue,
163
176
  (value) => {
@@ -225,16 +238,31 @@ onBeforeUnmount(() => {
225
238
  </script>
226
239
 
227
240
  <template>
228
- <div ref="tabsWrap" class="grid auto-flow-columns relative fit-content bgl_tabs_wrap overflow-hidden" :class="{ 'bgl_flat-tabs': flat, 'bgl_vertical-tabs': vertical, 'bgl_tabs-outline': outline, 'bgl_tabs-frame': frame }">
241
+ <div
242
+ ref="tabsWrap"
243
+ class="grid auto-flow-columns relative fit-content bgl_tabs_wrap overflow-hidden"
244
+ :class="{
245
+ 'bgl_flat-tabs': flat,
246
+ 'bgl_vertical-tabs': vertical,
247
+ 'bgl_tabs-outline': outline,
248
+ 'bgl_tabs-frame': frame,
249
+ 'bgl_tabs-fit-height-mobile': iconAboveMobile,
250
+ }"
251
+ >
229
252
  <slot name="tabs" v-bind="{ selectTab, isActive, tabLabel, tabs: tabEls }">
230
253
  <button v-for="(tab, i) in props.tabs" :key="i" type="button" :class="[
231
254
  { active: isActive(tab) },
232
- {
255
+ {
233
256
  'bgl_tab-thin': thin,
234
257
  'bgl_tab-xs': size === 'xs',
235
258
  'bgl_tab-s': size === 'sm',
236
259
  'bgl_tab-l': size === 'lg',
237
260
  'bgl_tab-xl': size === 'xl',
261
+ 'bgl_tab-m-xs': sizeMobile === 'xs',
262
+ 'bgl_tab-m-s': sizeMobile === 'sm',
263
+ 'bgl_tab-m-md': sizeMobile === 'md',
264
+ 'bgl_tab-m-l': sizeMobile === 'lg',
265
+ 'bgl_tab-m-xl': sizeMobile === 'xl',
238
266
  'w-100p justify-center': fullWidth,
239
267
  'w-auto m_w-100p': fullWidthMobile,
240
268
  'bgl_tab-align-center': alignTxt === 'center',
@@ -243,8 +271,9 @@ onBeforeUnmount(() => {
243
271
  'bgl_tab-align-center-mobile': alignTxtMobile === 'center',
244
272
  'bgl_tab-align-start-mobile': alignTxtMobile === 'start',
245
273
  'bgl_tab-align-end-mobile': alignTxtMobile === 'end',
246
- }
247
- ]" class="bgl_tab relative z-1"
274
+ 'bgl_tab-icon-above-mobile': iconAboveMobile && tabHasIcon(tab),
275
+ }
276
+ ]" class="bgl_tab relative z-1 m_line-height-13"
248
277
  :aria-label="iconOnly ? tabLabel(tab) : undefined"
249
278
  v-tooltip="iconOnly ? tabLabel(tab) : undefined"
250
279
  @click="selectTab(tab)">
@@ -464,6 +493,96 @@ white-space: nowrap;
464
493
  gap: 0.25rem;
465
494
  padding: 0.25rem 0.5rem;
466
495
  }
496
+
497
+ /* Mobile size overrides — mirror desktop size tokens. */
498
+ .bgl_tab-m-xs {
499
+ padding-inline: calc(var(--bgl_tab-inline-padding) / 3);
500
+ font-size: calc(var(--bgl-input-font-size) * 0.6);
501
+ height: calc(var(--bgl-btn-height) * 0.5 - var(--bgl_tabs-block-padding) * 2);
502
+ }
503
+
504
+ .bgl_tab-m-s {
505
+ padding-inline: calc(var(--bgl_tab-inline-padding) / 1.5);
506
+ font-size: var(--bgl-input-font-size);
507
+ height: calc(var(--bgl-btn-height) * 0.7 - var(--bgl_tabs-block-padding) * 2);
508
+ }
509
+
510
+ .bgl_tab-m-md {
511
+ padding-inline: var(--bgl_tab-inline-padding);
512
+ font-size: var(--bgl-input-font-size);
513
+ height: calc(var(--bgl-btn-height) - var(--bgl_tabs-block-padding) * 2);
514
+ }
515
+
516
+ .bgl_tab-m-l {
517
+ padding-inline: calc(var(--bgl_tab-inline-padding) * 1.3);
518
+ font-size: calc(var(--bgl-input-font-size) * 1.1);
519
+ height: calc(var(--bgl-btn-height) * 1.2 - var(--bgl_tabs-block-padding) * 2);
520
+ }
521
+
522
+ .bgl_tab-m-xl {
523
+ padding-inline: calc(var(--bgl_tab-inline-padding) * 1.6);
524
+ font-size: calc(var(--bgl-input-font-size) * 1.3);
525
+ height: calc(var(--bgl-btn-height) * 1.5 - var(--bgl_tabs-block-padding) * 2);
526
+ }
527
+
528
+ /*
529
+ * iconAboveMobile: equal-height from tallest content (with or without icons).
530
+ * Tabs with an icon also get .bgl_tab-icon-above-mobile → column stack.
531
+ */
532
+ .bgl_tabs-fit-height-mobile.bgl_tabs_wrap {
533
+ align-items: stretch;
534
+ }
535
+
536
+ .bgl_tabs-fit-height-mobile .bgl_tab,
537
+ .bgl_tabs-fit-height-mobile .bgl_tab.bgl_tab-thin,
538
+ .bgl_tabs-fit-height-mobile .bgl_tab.bgl_tab-xs,
539
+ .bgl_tabs-fit-height-mobile .bgl_tab.bgl_tab-s,
540
+ .bgl_tabs-fit-height-mobile .bgl_tab.bgl_tab-l,
541
+ .bgl_tabs-fit-height-mobile .bgl_tab.bgl_tab-xl,
542
+ .bgl_tabs-fit-height-mobile .bgl_tab.bgl_tab-m-xs,
543
+ .bgl_tabs-fit-height-mobile .bgl_tab.bgl_tab-m-s,
544
+ .bgl_tabs-fit-height-mobile .bgl_tab.bgl_tab-m-md,
545
+ .bgl_tabs-fit-height-mobile .bgl_tab.bgl_tab-m-l,
546
+ .bgl_tabs-fit-height-mobile .bgl_tab.bgl_tab-m-xl {
547
+ align-items: center;
548
+ justify-content: center;
549
+ height: auto;
550
+ min-height: calc(var(--bgl-btn-height) - var(--bgl_tabs-block-padding) * 2);
551
+ white-space: normal;
552
+ text-align: center;
553
+ padding-block: 0.35rem;
554
+ line-height: 1.25;
555
+ }
556
+
557
+ .bgl_tabs-fit-height-mobile .bgl_tab.bgl_tab-icon-above-mobile {
558
+ flex-direction: column;
559
+ }
560
+
561
+ .bgl_tabs-fit-height-mobile .bgl_tab.bgl_tab-xs,
562
+ .bgl_tabs-fit-height-mobile .bgl_tab.bgl_tab-m-xs {
563
+ min-height: calc(var(--bgl-btn-height) * 0.5 - var(--bgl_tabs-block-padding) * 2);
564
+ }
565
+
566
+ .bgl_tabs-fit-height-mobile .bgl_tab.bgl_tab-s,
567
+ .bgl_tabs-fit-height-mobile .bgl_tab.bgl_tab-m-s,
568
+ .bgl_tabs-fit-height-mobile .bgl_tab.bgl_tab-thin {
569
+ min-height: calc(var(--bgl-btn-height) * 0.7 - var(--bgl_tabs-block-padding) * 2);
570
+ }
571
+
572
+ .bgl_tabs-fit-height-mobile .bgl_tab.bgl_tab-l,
573
+ .bgl_tabs-fit-height-mobile .bgl_tab.bgl_tab-m-l {
574
+ min-height: calc(var(--bgl-btn-height) * 1.2 - var(--bgl_tabs-block-padding) * 2);
575
+ }
576
+
577
+ .bgl_tabs-fit-height-mobile .bgl_tab.bgl_tab-xl,
578
+ .bgl_tabs-fit-height-mobile .bgl_tab.bgl_tab-m-xl {
579
+ min-height: calc(var(--bgl-btn-height) * 1.5 - var(--bgl_tabs-block-padding) * 2);
580
+ }
581
+
582
+ /* sizeMobile wins over desktop size for the content-height floor. */
583
+ .bgl_tabs-fit-height-mobile .bgl_tab.bgl_tab-m-md {
584
+ min-height: calc(var(--bgl-btn-height) - var(--bgl_tabs-block-padding) * 2);
585
+ }
467
586
  }
468
587
 
469
588
  </style>