mn-angular-lib 1.0.119 → 1.0.120
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.
|
@@ -229,6 +229,9 @@ const mnButtonVariants = tv({
|
|
|
229
229
|
outline: 'bg-transparent border',
|
|
230
230
|
text: 'bg-transparent',
|
|
231
231
|
textUnderline: 'bg-transparent underline underline-offset-2',
|
|
232
|
+
// Transparent button that only reveals a subtle surface on hover — the idiomatic
|
|
233
|
+
// icon-button look. Colors resolved via compoundVariants.
|
|
234
|
+
ghost: 'bg-transparent',
|
|
232
235
|
},
|
|
233
236
|
// Intentionally empty; resolved via compoundVariants
|
|
234
237
|
color: {
|
|
@@ -251,6 +254,14 @@ const mnButtonVariants = tv({
|
|
|
251
254
|
three_xl: 'rounded-3xl',
|
|
252
255
|
four_xl: 'rounded-4xl',
|
|
253
256
|
},
|
|
257
|
+
// Icon-button shape. `circle`/`square` drop the text padding and make the button a
|
|
258
|
+
// fixed square sized off `size` (see compoundVariants), overriding `borderRadius`.
|
|
259
|
+
// `default` leaves a normal text button untouched.
|
|
260
|
+
shape: {
|
|
261
|
+
default: '',
|
|
262
|
+
circle: 'p-0 shrink-0 rounded-full',
|
|
263
|
+
square: 'p-0 shrink-0 rounded-md',
|
|
264
|
+
},
|
|
254
265
|
disabled: {
|
|
255
266
|
true: 'opacity-50 pointer-events-none',
|
|
256
267
|
},
|
|
@@ -332,12 +343,36 @@ const mnButtonVariants = tv({
|
|
|
332
343
|
{ variant: 'textUnderline', color: 'success', hover: true, class: 'hover:bg-success/10' },
|
|
333
344
|
{ variant: 'textUnderline', color: 'accent', hover: true, class: 'hover:bg-accent/10' },
|
|
334
345
|
{ variant: 'textUnderline', color: 'gray', hover: true, class: 'hover:bg-base-content/10' },
|
|
346
|
+
// Ghost — base (transparent, colored text/icon)
|
|
347
|
+
{ variant: 'ghost', color: 'primary', class: 'text-primary' },
|
|
348
|
+
{ variant: 'ghost', color: 'secondary', class: 'text-neutral' },
|
|
349
|
+
{ variant: 'ghost', color: 'danger', class: 'text-error' },
|
|
350
|
+
{ variant: 'ghost', color: 'warning', class: 'text-warning' },
|
|
351
|
+
{ variant: 'ghost', color: 'success', class: 'text-success' },
|
|
352
|
+
{ variant: 'ghost', color: 'accent', class: 'text-accent' },
|
|
353
|
+
{ variant: 'ghost', color: 'gray', class: 'text-base-content' },
|
|
354
|
+
// Ghost — hover (reveal a subtle surface in the button's own hue)
|
|
355
|
+
{ variant: 'ghost', color: 'primary', hover: true, class: 'hover:bg-primary/10' },
|
|
356
|
+
{ variant: 'ghost', color: 'secondary', hover: true, class: 'hover:bg-neutral/10' },
|
|
357
|
+
{ variant: 'ghost', color: 'danger', hover: true, class: 'hover:bg-error/10' },
|
|
358
|
+
{ variant: 'ghost', color: 'warning', hover: true, class: 'hover:bg-warning/10' },
|
|
359
|
+
{ variant: 'ghost', color: 'success', hover: true, class: 'hover:bg-success/10' },
|
|
360
|
+
{ variant: 'ghost', color: 'accent', hover: true, class: 'hover:bg-accent/10' },
|
|
361
|
+
{ variant: 'ghost', color: 'gray', hover: true, class: 'hover:bg-base-content/10' },
|
|
362
|
+
// Icon-button square sizing — applies to both circle and square shapes, sized off `size`.
|
|
363
|
+
{ shape: 'circle', size: 'sm', class: 'h-8 w-8' },
|
|
364
|
+
{ shape: 'circle', size: 'md', class: 'h-10 w-10' },
|
|
365
|
+
{ shape: 'circle', size: 'lg', class: 'h-12 w-12' },
|
|
366
|
+
{ shape: 'square', size: 'sm', class: 'h-8 w-8' },
|
|
367
|
+
{ shape: 'square', size: 'md', class: 'h-10 w-10' },
|
|
368
|
+
{ shape: 'square', size: 'lg', class: 'h-12 w-12' },
|
|
335
369
|
],
|
|
336
370
|
defaultVariants: {
|
|
337
371
|
size: 'md',
|
|
338
372
|
variant: 'fill',
|
|
339
373
|
color: 'primary',
|
|
340
374
|
borderRadius: 'lg',
|
|
375
|
+
shape: 'default',
|
|
341
376
|
disabled: false,
|
|
342
377
|
loading: false,
|
|
343
378
|
wrap: false,
|
|
@@ -355,6 +390,7 @@ class MnButton {
|
|
|
355
390
|
variant: this.data.variant,
|
|
356
391
|
color: this.data.color,
|
|
357
392
|
borderRadius: this.data.borderRadius,
|
|
393
|
+
shape: this.data.shape,
|
|
358
394
|
disabled: this.data.disabled,
|
|
359
395
|
loading: this.data.loading,
|
|
360
396
|
wrap: this.data.wrap,
|