-
-
Notifications
You must be signed in to change notification settings - Fork 54
/
meta.ts
64 lines (55 loc) · 1.48 KB
/
meta.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import type { ExtractPublicPropTypes } from 'vue'
import { aLayerProps } from '@/composables/useLayer'
import { configurable as configurableProp, disabled as disabledProp } from '@/composables/useProps'
// ℹ️ Make sure to checkout meta definition rules
// 👉 Props
export const aBtnProps = {
...{
...aLayerProps,
color: {
...aLayerProps.color,
default: 'primary',
},
variant: {
...aLayerProps.variant,
default: 'fill',
},
states: {
...aLayerProps.states,
default: true,
},
},
/**
* Render icon before button text
*/
icon: configurableProp,
/**
* Append icon after button text
*/
appendIcon: configurableProp,
/**
* Mark button as icon only button to apply square styling
*/
iconOnly: Boolean,
/**
* Set component in disabled state
*/
disabled: disabledProp,
/**
* Set button loading state.
* Although, `loading` prop accepts boolean value, we set default value to `undefined` to indicate button won't ever use loading (show/hide) and won't render `ASpinner` component.
* However, if `loading` prop is set to any boolean value (`false`/`true`) it will always render `ASpinner` component.
*/
loading: {
type: Boolean,
default: undefined,
},
} as const
export type ABtnProps = ExtractPublicPropTypes<typeof aBtnProps>
// 👉 Slots
export const aBtnSlots = {
/**
* Default slot for rendering button content
*/
default: (_: any) => null as any,
} as const