Skip to content

Commit 2f0afd5

Browse files
committed
add interfaces for augmenting sizes and variants
1 parent f741758 commit 2f0afd5

File tree

6 files changed

+56
-43
lines changed

6 files changed

+56
-43
lines changed
Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
import type {ColorVariant} from '.'
1+
import {BaseColorVariant} from '.'
22

33
/**
44
* @external
55
*/
6-
type ButtonVariant =
7-
| ColorVariant
8-
| 'link'
9-
| 'outline-primary'
10-
| 'outline-secondary'
11-
| 'outline-success'
12-
| 'outline-danger'
13-
| 'outline-warning'
14-
| 'outline-info'
15-
| 'outline-light'
16-
| 'outline-dark'
6+
export interface BaseButtonVariant extends BaseColorVariant {
7+
'link': unknown
8+
'outline-primary': unknown
9+
'outline-secondary': unknown
10+
'outline-success': unknown
11+
'outline-danger': unknown
12+
'outline-warning': unknown
13+
'outline-info': unknown
14+
'outline-light': unknown
15+
'outline-dark': unknown
16+
}
17+
18+
type ButtonVariant = keyof BaseButtonVariant
1719

1820
export default ButtonVariant
Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
/**
22
* @external
33
*/
4-
type ColorVariant =
5-
| 'primary'
6-
| 'secondary'
7-
| 'success'
8-
| 'danger'
9-
| 'warning'
10-
| 'info'
11-
| 'light'
12-
| 'dark'
4+
export interface BaseColorVariant {
5+
'primary': unknown
6+
'secondary': unknown
7+
'success': unknown
8+
'danger': unknown
9+
'warning': unknown
10+
'info': unknown
11+
'light': unknown
12+
'dark': unknown
13+
}
14+
15+
type ColorVariant = keyof BaseColorVariant
1316

1417
export default ColorVariant
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
/**
22
* @external
33
*/
4-
type InputSize = 'sm' | 'md' | 'lg'
4+
export interface BaseInputSize {
5+
'sm': unknown,
6+
'md': unknown,
7+
'lg': unknown,
8+
}
9+
10+
type InputSize = keyof BaseInputSize
511

612
export default InputSize
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
/**
22
* @external
33
*/
4-
type Size = 'sm' | 'lg' | undefined
4+
export interface BaseSize {
5+
'sm': unknown,
6+
'lg': unknown,
7+
}
8+
9+
type Size = keyof BaseSize | undefined
510

611
export default Size
Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1+
import {BaseColorVariant} from '.'
2+
13
/**
24
* @external
35
*/
4-
type TextColorVariant =
5-
| 'primary'
6-
| 'secondary'
7-
| 'success'
8-
| 'danger'
9-
| 'warning'
10-
| 'info'
11-
| 'light'
12-
| 'dark'
13-
| 'white'
14-
| 'body'
15-
| 'muted'
16-
| 'black-50'
17-
| 'white-50'
18-
| 'reset'
6+
export interface BaseTextColorVariant extends BaseColorVariant {
7+
'white': unknown
8+
'body': unknown
9+
'muted': unknown
10+
'black-50': unknown
11+
'white-50': unknown
12+
'reset': unknown
13+
}
14+
15+
type TextColorVariant = keyof BaseTextColorVariant
1916

2017
export default TextColorVariant

packages/bootstrap-vue-3/src/types/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ export type {
1212
RowColsBreakpointProps,
1313
} from './BreakpointProps'
1414
export type {default as ButtonType} from './ButtonType'
15-
export type {default as ButtonVariant} from './ButtonVariant'
15+
export type {default as ButtonVariant, BaseButtonVariant} from './ButtonVariant'
1616
export type {default as ClassValue} from './ClassValue'
17-
export type {default as ColorVariant} from './ColorVariant'
17+
export type {default as ColorVariant, BaseColorVariant} from './ColorVariant'
1818
export type {ContainerHorizontalAlign, ContainerPosition, ContainerVerticalAlign} from './Container'
1919
export type {default as InputSize} from './InputSize'
2020
export type {default as InputType} from './InputType'
@@ -27,12 +27,12 @@ export type {default as PlaceholderSize} from './PlaceholderSize'
2727
export type {default as Position} from './Position'
2828
export type {default as RadioOption} from './RadioOption'
2929
export type {default as SelectOption} from './SelectOption'
30-
export type {default as Size} from './Size'
30+
export type {default as Size, BaseSize} from './Size'
3131
export type {default as SkeletonAnimation} from './SkeletonAnimation'
3232
export type {default as SkeletonType} from './SkeletonType'
3333
export type {default as SpinnerType} from './SpinnerType'
3434
export type {default as TableField, TableFieldObject} from './TableField'
3535
export type {default as TableItem} from './TableItem'
36-
export type {default as TextColorVariant} from './TextColorVariant'
36+
export type {default as TextColorVariant, BaseTextColorVariant} from './TextColorVariant'
3737
export type {default as TransitionMode} from './TransitionMode'
38-
export type {default as VerticalAlign} from './VerticalAlign'
38+
export type {default as VerticalAlign} from './VerticalAlign'

0 commit comments

Comments
 (0)