@bagelink/vue 1.20.78 → 1.20.80

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.20.78",
4
+ "version": "1.20.80",
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.43",
65
65
  "vue-component-type-helpers": "^2.2.12",
66
- "@bagelink/sdk": "1.20.78"
66
+ "@bagelink/sdk": "1.20.80"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "@bagelink/sdk": "*",
@@ -10,9 +10,9 @@ const props = defineProps<{
10
10
  error?: string
11
11
  /** Color of the entered digits. Accepts any CSS color or theme var (e.g. "primary", "var(--bgl-primary)", "#e11d48"). */
12
12
  color?: string
13
- /** Size of each digit box (width & height). Accepts any CSS length (e.g. "2.5rem", "40px"). Default: 3rem. */
13
+ /** Size of each digit box (sets --otp-input-width & --otp-input-height). Accepts any CSS length (e.g. "2.5rem", "40px"). Default: 3rem. */
14
14
  size?: string
15
- /** Digit box size below 910px. Falls back to `size` (or 3rem) when omitted. */
15
+ /** Digit box size below 910px (sets --otp-input-mobile-width & --otp-input-mobile-height). Falls back to `size` when omitted. */
16
16
  mobileSize?: string
17
17
  } & BagelInputShellProps>()
18
18
 
@@ -28,9 +28,15 @@ const digitColor = computed(() => {
28
28
 
29
29
  const shellStyle = computed(() => {
30
30
  const style = { ...(baseShellStyle.value ?? {}) } as Record<string, string>
31
- if (digitColor.value) { style['--bgl-otp-digit-color'] = digitColor.value }
32
- if (props.size) { style['--bgl-otp-digit-size'] = props.size }
33
- if (props.mobileSize) { style['--bgl-otp-digit-mobile-size'] = props.mobileSize }
31
+ if (digitColor.value) { style['--otp-input-color'] = digitColor.value }
32
+ if (props.size) {
33
+ style['--otp-input-width'] = props.size
34
+ style['--otp-input-height'] = props.size
35
+ }
36
+ if (props.mobileSize) {
37
+ style['--otp-input-mobile-width'] = props.mobileSize
38
+ style['--otp-input-mobile-height'] = props.mobileSize
39
+ }
34
40
  return Object.keys(style).length > 0 ? style : undefined
35
41
  })
36
42
 
@@ -127,7 +133,7 @@ function focusInput() {
127
133
  color: var(--bgl-red);
128
134
  }
129
135
  .otp_wrap.has-error .digit-box {
130
- outline: 1px solid var(--bgl-red) !important;
136
+ outline: var(--otp-input-outline-width) solid var(--bgl-red) !important;
131
137
  }
132
138
 
133
139
  .otp_wrap {
@@ -162,34 +168,50 @@ outline: none;
162
168
  .otp-hidden-input::selection { background: transparent; }
163
169
 
164
170
  .digit-box {
165
- height: var(--bgl-otp-digit-size, 3rem);
166
- aspect-ratio: 1;
171
+ width: var(--otp-input-width);
172
+ height: var(--otp-input-height);
167
173
  flex: 0 0 auto;
168
- color: var(--bgl-otp-digit-color, inherit);
169
- border: 1px solid var(--bgl-input-label-active-color, var(--bgl-primary-tint));
174
+ color: var(--otp-input-color);
175
+ border: var(--otp-input-border-width) solid var(--bgl-input-label-active-color, var(--bgl-primary-tint));
170
176
  display: inline-flex;
171
177
  align-items: center;
172
178
  justify-content: center;
173
- background: var(--bgl-gray-light);
174
- border-radius: 5px;
175
- margin: 5px;
179
+ background: var(--otp-input-bg);
180
+ border-radius: var(--otp-input-border-radius);
181
+ margin: var(--otp-input-gap);
176
182
  text-align: center;
177
- font-size: calc(var(--bgl-otp-digit-size, 3rem) * 0.8);
183
+ font-size: var(--otp-input-font-size);
184
+ font-weight: var(--otp-input-font-weight);
178
185
  font-variant-numeric: tabular-nums;
179
186
  user-select: none;
180
187
  transition: outline-color 0.2s ease, box-shadow 0.2s ease;
181
188
  }
182
189
 
183
190
  .digit-box.is-active {
184
- outline: 1px solid var(--bgl-input-label-active-color, var(--bgl-primary));
191
+ outline: var(--otp-input-outline-width) solid var(--bgl-input-label-active-color, var(--bgl-primary));
185
192
  filter: drop-shadow(0 0 0.25rem var(--bgl-input-label-active-color, var(--bgl-primary)));
186
- outline-offset: 1px;
193
+ outline-offset: var(--otp-input-outline-offset);
187
194
  }
188
195
 
189
196
  /* ── frame variant ──────────────────────────────────────────────────────── */
190
197
 
191
198
  .otp-input {
192
199
  width: 100%;
200
+ --otp-input-width: var(--bgl-otp-digit-size, 3rem);
201
+ --otp-input-height: var(--bgl-otp-digit-size, 3rem);
202
+ --otp-input-font-size: calc(var(--otp-input-height) * 0.8);
203
+ --otp-input-font-weight: 400;
204
+ --otp-input-border-radius: 5px;
205
+ --otp-input-border-width: 1px;
206
+ --otp-input-outline-width: 1px;
207
+ --otp-input-outline-offset: 1px;
208
+ --otp-input-gap: 5px;
209
+ --otp-input-bg: var(--bgl-gray-light);
210
+ --otp-input-color: var(--bgl-otp-digit-color, inherit);
211
+ --otp-input-mobile-width: var(--bgl-otp-digit-mobile-size, var(--otp-input-width));
212
+ --otp-input-mobile-height: var(--bgl-otp-digit-mobile-size, var(--otp-input-height));
213
+ --otp-input-mobile-font-size: calc(var(--otp-input-mobile-height) * 0.8);
214
+ --otp-input-mobile-padding: 0.25rem;
193
215
  }
194
216
 
195
217
  .otp-input.frame .digit-box {
@@ -216,9 +238,10 @@ outline-offset: -1px;
216
238
 
217
239
  @media screen and (max-width: 910px) {
218
240
  .digit-box {
219
- height: var(--bgl-otp-digit-mobile-size, var(--bgl-otp-digit-size, 3rem));
220
- font-size: calc(var(--bgl-otp-digit-mobile-size, var(--bgl-otp-digit-size, 3rem)) * 0.8);
221
- padding: 0.25rem;
241
+ width: var(--otp-input-mobile-width);
242
+ height: var(--otp-input-mobile-height);
243
+ font-size: var(--otp-input-mobile-font-size);
244
+ padding: var(--otp-input-mobile-padding);
222
245
  }
223
246
  }
224
247