@brickflow/ui 0.0.50 → 0.0.51
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/module.json
CHANGED
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
rounded?: boolean
|
|
32
32
|
size?: ButtonSize
|
|
33
33
|
square?: boolean
|
|
34
|
+
target?: '_blank' | '_parent' | '_self' | '_top' | null | (Record<string, never> & string)
|
|
34
35
|
to?: RouteLocationRaw
|
|
35
36
|
trailingIcon?: string
|
|
36
37
|
type?: 'button' | 'reset' | 'submit'
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
icon: undefined,
|
|
42
43
|
rounded: false,
|
|
43
44
|
size: UI_CONFIG.sizeDefault,
|
|
45
|
+
target: undefined,
|
|
44
46
|
to: undefined,
|
|
45
47
|
trailingIcon: undefined,
|
|
46
48
|
type: 'button',
|
|
@@ -55,9 +57,9 @@
|
|
|
55
57
|
type ButtonSize = Extract<keyof typeof sizeClasses, string>
|
|
56
58
|
type ButtonVariant = Extract<keyof (typeof colorClasses)[ButtonColor], string>
|
|
57
59
|
|
|
58
|
-
const component = computed(() => (props.to === undefined ? 'button' : BaseLink))
|
|
59
|
-
const disabled = computed(() => props.disabled || props.loading)
|
|
60
60
|
const isButton = computed(() => props.to === undefined)
|
|
61
|
+
const component = computed(() => (isButton.value ? 'button' : BaseLink))
|
|
62
|
+
const disabled = computed(() => props.disabled || props.loading)
|
|
61
63
|
const classes = computed(() => [
|
|
62
64
|
UI_STYLE.base,
|
|
63
65
|
twMerge(sizeClasses[props.size], props.square && UI_STYLE.state.square),
|
|
@@ -82,6 +84,7 @@
|
|
|
82
84
|
:is="component"
|
|
83
85
|
v-bind="animationTapClass ? { onPointerupPassive: handleTap } : {}"
|
|
84
86
|
:to="props.to"
|
|
87
|
+
:target="isButton ? undefined : props.target"
|
|
85
88
|
:type="isButton ? props.type : undefined"
|
|
86
89
|
:disabled="isButton ? disabled : undefined"
|
|
87
90
|
:aria-busy="props.loading || undefined"
|