@bwui/vue 0.1.9 → 0.1.11
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/date-picker.d.ts +36 -0
- package/dist/date-picker.js +25 -5
- package/dist/index.d.ts +7 -1
- package/dist/index.js +5 -1
- package/dist/modal.d.ts +75 -0
- package/dist/modal.js +124 -0
- package/dist/pages.d.ts +2 -2
- package/dist/popover.d.ts +100 -0
- package/dist/popover.js +182 -0
- package/dist/primitives.d.ts +738 -22
- package/dist/primitives.js +680 -26
- package/dist/stat.d.ts +216 -0
- package/dist/stat.js +111 -0
- package/package.json +3 -3
- package/src/date-picker.ts +70 -42
- package/src/index.ts +25 -0
- package/src/modal.ts +160 -0
- package/src/popover.ts +241 -0
- package/src/primitives.ts +914 -27
- package/src/stat.ts +138 -0
package/dist/stat.d.ts
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
/** Size axis for Stat, StatComparison and StatCard (STA-003, CB-17 subset sm|md|lg). */
|
|
3
|
+
export type StatSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
/** Chrome axis for Stat (STA-004). Default `card`. */
|
|
5
|
+
export type StatChrome = 'card' | 'plain';
|
|
6
|
+
/**
|
|
7
|
+
* Stat (docs/components/stat.md, D06 / R33).
|
|
8
|
+
* KPI tile rendering a label (overline) and a value (tabular numeral).
|
|
9
|
+
*/
|
|
10
|
+
export declare const Stat: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
11
|
+
label: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
value: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
size: {
|
|
20
|
+
type: PropType<StatSize>;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
chrome: {
|
|
24
|
+
type: PropType<StatChrome>;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
href: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
default: undefined;
|
|
30
|
+
};
|
|
31
|
+
loading: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
default: boolean;
|
|
34
|
+
};
|
|
35
|
+
class: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
39
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
40
|
+
[key: string]: any;
|
|
41
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
42
|
+
label: {
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
required: true;
|
|
45
|
+
};
|
|
46
|
+
value: {
|
|
47
|
+
type: StringConstructor;
|
|
48
|
+
required: true;
|
|
49
|
+
};
|
|
50
|
+
size: {
|
|
51
|
+
type: PropType<StatSize>;
|
|
52
|
+
default: string;
|
|
53
|
+
};
|
|
54
|
+
chrome: {
|
|
55
|
+
type: PropType<StatChrome>;
|
|
56
|
+
default: string;
|
|
57
|
+
};
|
|
58
|
+
href: {
|
|
59
|
+
type: StringConstructor;
|
|
60
|
+
default: undefined;
|
|
61
|
+
};
|
|
62
|
+
loading: {
|
|
63
|
+
type: BooleanConstructor;
|
|
64
|
+
default: boolean;
|
|
65
|
+
};
|
|
66
|
+
class: {
|
|
67
|
+
type: StringConstructor;
|
|
68
|
+
default: string;
|
|
69
|
+
};
|
|
70
|
+
}>> & Readonly<{}>, {
|
|
71
|
+
class: string;
|
|
72
|
+
size: StatSize;
|
|
73
|
+
href: string;
|
|
74
|
+
loading: boolean;
|
|
75
|
+
chrome: StatChrome;
|
|
76
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
77
|
+
/**
|
|
78
|
+
* StatComparison (STA-006). This-vs-last-period KPI tile.
|
|
79
|
+
*/
|
|
80
|
+
export declare const StatComparison: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
81
|
+
current: {
|
|
82
|
+
type: StringConstructor;
|
|
83
|
+
required: true;
|
|
84
|
+
};
|
|
85
|
+
previous: {
|
|
86
|
+
type: StringConstructor;
|
|
87
|
+
required: true;
|
|
88
|
+
};
|
|
89
|
+
label: {
|
|
90
|
+
type: StringConstructor;
|
|
91
|
+
default: undefined;
|
|
92
|
+
};
|
|
93
|
+
periodLabel: {
|
|
94
|
+
type: StringConstructor;
|
|
95
|
+
default: undefined;
|
|
96
|
+
};
|
|
97
|
+
size: {
|
|
98
|
+
type: PropType<StatSize>;
|
|
99
|
+
default: string;
|
|
100
|
+
};
|
|
101
|
+
class: {
|
|
102
|
+
type: StringConstructor;
|
|
103
|
+
default: string;
|
|
104
|
+
};
|
|
105
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
106
|
+
[key: string]: any;
|
|
107
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
108
|
+
current: {
|
|
109
|
+
type: StringConstructor;
|
|
110
|
+
required: true;
|
|
111
|
+
};
|
|
112
|
+
previous: {
|
|
113
|
+
type: StringConstructor;
|
|
114
|
+
required: true;
|
|
115
|
+
};
|
|
116
|
+
label: {
|
|
117
|
+
type: StringConstructor;
|
|
118
|
+
default: undefined;
|
|
119
|
+
};
|
|
120
|
+
periodLabel: {
|
|
121
|
+
type: StringConstructor;
|
|
122
|
+
default: undefined;
|
|
123
|
+
};
|
|
124
|
+
size: {
|
|
125
|
+
type: PropType<StatSize>;
|
|
126
|
+
default: string;
|
|
127
|
+
};
|
|
128
|
+
class: {
|
|
129
|
+
type: StringConstructor;
|
|
130
|
+
default: string;
|
|
131
|
+
};
|
|
132
|
+
}>> & Readonly<{}>, {
|
|
133
|
+
label: string;
|
|
134
|
+
class: string;
|
|
135
|
+
size: StatSize;
|
|
136
|
+
periodLabel: string;
|
|
137
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
138
|
+
/**
|
|
139
|
+
* StatGrid: responsive auto-fit composition grid (STA-007).
|
|
140
|
+
*/
|
|
141
|
+
export declare const StatGrid: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
142
|
+
class: {
|
|
143
|
+
type: StringConstructor;
|
|
144
|
+
default: string;
|
|
145
|
+
};
|
|
146
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
147
|
+
[key: string]: any;
|
|
148
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
149
|
+
class: {
|
|
150
|
+
type: StringConstructor;
|
|
151
|
+
default: string;
|
|
152
|
+
};
|
|
153
|
+
}>> & Readonly<{}>, {
|
|
154
|
+
class: string;
|
|
155
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
156
|
+
/**
|
|
157
|
+
* StatCard: marketing stat card (D06, .bw-stat-card).
|
|
158
|
+
*/
|
|
159
|
+
export declare const StatCard: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
160
|
+
value: {
|
|
161
|
+
type: StringConstructor;
|
|
162
|
+
required: true;
|
|
163
|
+
};
|
|
164
|
+
label: {
|
|
165
|
+
type: StringConstructor;
|
|
166
|
+
required: true;
|
|
167
|
+
};
|
|
168
|
+
note: {
|
|
169
|
+
type: StringConstructor;
|
|
170
|
+
default: undefined;
|
|
171
|
+
};
|
|
172
|
+
class: {
|
|
173
|
+
type: StringConstructor;
|
|
174
|
+
default: string;
|
|
175
|
+
};
|
|
176
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
177
|
+
[key: string]: any;
|
|
178
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
179
|
+
value: {
|
|
180
|
+
type: StringConstructor;
|
|
181
|
+
required: true;
|
|
182
|
+
};
|
|
183
|
+
label: {
|
|
184
|
+
type: StringConstructor;
|
|
185
|
+
required: true;
|
|
186
|
+
};
|
|
187
|
+
note: {
|
|
188
|
+
type: StringConstructor;
|
|
189
|
+
default: undefined;
|
|
190
|
+
};
|
|
191
|
+
class: {
|
|
192
|
+
type: StringConstructor;
|
|
193
|
+
default: string;
|
|
194
|
+
};
|
|
195
|
+
}>> & Readonly<{}>, {
|
|
196
|
+
class: string;
|
|
197
|
+
note: string;
|
|
198
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
199
|
+
/**
|
|
200
|
+
* StatCards: marketing stat-card grid container.
|
|
201
|
+
*/
|
|
202
|
+
export declare const StatCards: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
203
|
+
class: {
|
|
204
|
+
type: StringConstructor;
|
|
205
|
+
default: string;
|
|
206
|
+
};
|
|
207
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
208
|
+
[key: string]: any;
|
|
209
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
210
|
+
class: {
|
|
211
|
+
type: StringConstructor;
|
|
212
|
+
default: string;
|
|
213
|
+
};
|
|
214
|
+
}>> & Readonly<{}>, {
|
|
215
|
+
class: string;
|
|
216
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
package/dist/stat.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { defineComponent, h } from 'vue';
|
|
2
|
+
import { cn } from './cn';
|
|
3
|
+
/**
|
|
4
|
+
* Stat (docs/components/stat.md, D06 / R33).
|
|
5
|
+
* KPI tile rendering a label (overline) and a value (tabular numeral).
|
|
6
|
+
*/
|
|
7
|
+
export const Stat = defineComponent({
|
|
8
|
+
name: 'BwStat',
|
|
9
|
+
props: {
|
|
10
|
+
label: { type: String, required: true },
|
|
11
|
+
value: { type: String, required: true },
|
|
12
|
+
size: { type: String, default: 'md' },
|
|
13
|
+
chrome: { type: String, default: 'card' },
|
|
14
|
+
href: { type: String, default: undefined },
|
|
15
|
+
loading: { type: Boolean, default: false },
|
|
16
|
+
class: { type: String, default: '' },
|
|
17
|
+
},
|
|
18
|
+
setup(props, { slots }) {
|
|
19
|
+
return () => {
|
|
20
|
+
const cls = cn('bw-stat', `bw-stat--size-${props.size}`, props.chrome === 'plain' && 'bw-stat--chrome-plain', String(props.class || ''));
|
|
21
|
+
const inner = props.loading
|
|
22
|
+
? [
|
|
23
|
+
h('div', { class: 'bw-skeleton bw-skeleton--text', 'aria-hidden': 'true' }),
|
|
24
|
+
h('div', { class: 'bw-skeleton bw-skeleton--title', 'aria-hidden': 'true' }),
|
|
25
|
+
]
|
|
26
|
+
: [
|
|
27
|
+
h('span', { class: 'bw-stat__label' }, props.label),
|
|
28
|
+
h('span', { class: 'bw-stat__value' }, props.value),
|
|
29
|
+
slots.default?.(),
|
|
30
|
+
];
|
|
31
|
+
if (props.href) {
|
|
32
|
+
return h('a', { href: props.href, class: cls }, inner);
|
|
33
|
+
}
|
|
34
|
+
return h('div', { class: cls }, inner);
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* StatComparison (STA-006). This-vs-last-period KPI tile.
|
|
40
|
+
*/
|
|
41
|
+
export const StatComparison = defineComponent({
|
|
42
|
+
name: 'BwStatComparison',
|
|
43
|
+
props: {
|
|
44
|
+
current: { type: String, required: true },
|
|
45
|
+
previous: { type: String, required: true },
|
|
46
|
+
label: { type: String, default: undefined },
|
|
47
|
+
periodLabel: { type: String, default: undefined },
|
|
48
|
+
size: { type: String, default: 'md' },
|
|
49
|
+
class: { type: String, default: '' },
|
|
50
|
+
},
|
|
51
|
+
setup(props, { slots }) {
|
|
52
|
+
return () => {
|
|
53
|
+
const cls = cn('bw-stat-comparison', `bw-stat-comparison--size-${props.size}`, String(props.class || ''));
|
|
54
|
+
const previousContent = props.periodLabel
|
|
55
|
+
? [
|
|
56
|
+
props.previous,
|
|
57
|
+
h('span', { class: 'bw-stat-comparison__period' }, ` ${props.periodLabel}`),
|
|
58
|
+
]
|
|
59
|
+
: [props.previous];
|
|
60
|
+
return h('div', { class: cls }, [
|
|
61
|
+
props.label && h('span', { class: 'bw-stat-comparison__label' }, props.label),
|
|
62
|
+
h('span', { class: 'bw-stat-comparison__current' }, props.current),
|
|
63
|
+
h('span', { class: 'bw-stat-comparison__previous' }, previousContent),
|
|
64
|
+
slots.default?.(),
|
|
65
|
+
]);
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
/**
|
|
70
|
+
* StatGrid: responsive auto-fit composition grid (STA-007).
|
|
71
|
+
*/
|
|
72
|
+
export const StatGrid = defineComponent({
|
|
73
|
+
name: 'BwStatGrid',
|
|
74
|
+
props: {
|
|
75
|
+
class: { type: String, default: '' },
|
|
76
|
+
},
|
|
77
|
+
setup(props, { slots }) {
|
|
78
|
+
return () => h('div', { class: cn('bw-stat-grid', String(props.class || '')) }, slots.default?.());
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
/**
|
|
82
|
+
* StatCard: marketing stat card (D06, .bw-stat-card).
|
|
83
|
+
*/
|
|
84
|
+
export const StatCard = defineComponent({
|
|
85
|
+
name: 'BwStatCard',
|
|
86
|
+
props: {
|
|
87
|
+
value: { type: String, required: true },
|
|
88
|
+
label: { type: String, required: true },
|
|
89
|
+
note: { type: String, default: undefined },
|
|
90
|
+
class: { type: String, default: '' },
|
|
91
|
+
},
|
|
92
|
+
setup(props) {
|
|
93
|
+
return () => h('div', { class: cn('bw-stat-card', String(props.class || '')) }, [
|
|
94
|
+
h('p', { class: 'bw-stat-card__value' }, props.value),
|
|
95
|
+
h('p', { class: 'bw-stat-card__label' }, props.label),
|
|
96
|
+
props.note && h('p', { class: 'bw-stat-card__note' }, props.note),
|
|
97
|
+
]);
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
/**
|
|
101
|
+
* StatCards: marketing stat-card grid container.
|
|
102
|
+
*/
|
|
103
|
+
export const StatCards = defineComponent({
|
|
104
|
+
name: 'BwStatCards',
|
|
105
|
+
props: {
|
|
106
|
+
class: { type: String, default: '' },
|
|
107
|
+
},
|
|
108
|
+
setup(props, { slots }) {
|
|
109
|
+
return () => h('div', { class: cn('bw-stat-cards', String(props.class || '')) }, slots.default?.());
|
|
110
|
+
},
|
|
111
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bwui/vue",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "Vue 3 adapter for Brickwork: typed components bound to the Brickwork token substrate and bw-* class contract.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"vue": "^3.4.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@bwui/css": "0.1.
|
|
29
|
-
"@bwui/tokens": "0.1.
|
|
28
|
+
"@bwui/css": "0.1.11",
|
|
29
|
+
"@bwui/tokens": "0.1.11"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"typescript": "^5",
|
package/src/date-picker.ts
CHANGED
|
@@ -97,7 +97,7 @@ function Calendar(opts: {
|
|
|
97
97
|
type: 'button',
|
|
98
98
|
class: 'bw-calendar__day',
|
|
99
99
|
'aria-label': toISO(date),
|
|
100
|
-
'aria-
|
|
100
|
+
'aria-pressed': isSelected,
|
|
101
101
|
...(inRange ? { 'data-bw-in-range': '' } : {}),
|
|
102
102
|
onClick: () => opts.onSelect(date),
|
|
103
103
|
},
|
|
@@ -117,6 +117,8 @@ export const DatePicker = defineComponent({
|
|
|
117
117
|
placeholder: { type: String, default: 'YYYY-MM-DD' },
|
|
118
118
|
disabled: Boolean,
|
|
119
119
|
required: Boolean,
|
|
120
|
+
panelLabel: { type: String, default: 'Choose date' },
|
|
121
|
+
triggerLabel: { type: String, default: 'Open calendar' },
|
|
120
122
|
},
|
|
121
123
|
emits: ['update:modelValue'],
|
|
122
124
|
setup(props, { emit, attrs }) {
|
|
@@ -153,7 +155,9 @@ export const DatePicker = defineComponent({
|
|
|
153
155
|
{
|
|
154
156
|
type: 'button',
|
|
155
157
|
class: 'bw-date-picker-chrome__trigger',
|
|
156
|
-
'aria-label':
|
|
158
|
+
'aria-label': props.triggerLabel,
|
|
159
|
+
'aria-expanded': open.value,
|
|
160
|
+
'aria-haspopup': 'dialog',
|
|
157
161
|
disabled: props.disabled,
|
|
158
162
|
onClick: () => {
|
|
159
163
|
open.value = !open.value
|
|
@@ -162,19 +166,29 @@ export const DatePicker = defineComponent({
|
|
|
162
166
|
'Cal',
|
|
163
167
|
),
|
|
164
168
|
]),
|
|
165
|
-
h(
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
169
|
+
h(
|
|
170
|
+
'div',
|
|
171
|
+
{
|
|
172
|
+
class: 'bw-date-picker-chrome__panel',
|
|
173
|
+
role: 'dialog',
|
|
174
|
+
'aria-modal': 'true',
|
|
175
|
+
'aria-label': props.panelLabel,
|
|
176
|
+
hidden: !open.value,
|
|
177
|
+
},
|
|
178
|
+
[
|
|
179
|
+
Calendar({
|
|
180
|
+
view: view.value,
|
|
181
|
+
selected: parseISO(props.modelValue),
|
|
182
|
+
onView: (next) => {
|
|
183
|
+
view.value = next
|
|
184
|
+
},
|
|
185
|
+
onSelect: (date) => {
|
|
186
|
+
emit('update:modelValue', toISO(date))
|
|
187
|
+
open.value = false
|
|
188
|
+
},
|
|
189
|
+
}),
|
|
190
|
+
],
|
|
191
|
+
),
|
|
178
192
|
])
|
|
179
193
|
},
|
|
180
194
|
})
|
|
@@ -187,6 +201,8 @@ export const DateRangePicker = defineComponent({
|
|
|
187
201
|
startName: String,
|
|
188
202
|
endName: String,
|
|
189
203
|
disabled: Boolean,
|
|
204
|
+
panelLabel: { type: String, default: 'Choose dates' },
|
|
205
|
+
triggerLabel: { type: String, default: 'Open range calendar' },
|
|
190
206
|
},
|
|
191
207
|
emits: ['update:start', 'update:end'],
|
|
192
208
|
setup(props, { emit, attrs }) {
|
|
@@ -241,7 +257,9 @@ export const DateRangePicker = defineComponent({
|
|
|
241
257
|
{
|
|
242
258
|
type: 'button',
|
|
243
259
|
class: 'bw-date-picker-chrome__trigger',
|
|
244
|
-
'aria-label':
|
|
260
|
+
'aria-label': props.triggerLabel,
|
|
261
|
+
'aria-expanded': open.value,
|
|
262
|
+
'aria-haspopup': 'dialog',
|
|
245
263
|
disabled: props.disabled,
|
|
246
264
|
onClick: () => {
|
|
247
265
|
open.value = !open.value
|
|
@@ -250,33 +268,43 @@ export const DateRangePicker = defineComponent({
|
|
|
250
268
|
'Cal',
|
|
251
269
|
),
|
|
252
270
|
]),
|
|
253
|
-
h(
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
271
|
+
h(
|
|
272
|
+
'div',
|
|
273
|
+
{
|
|
274
|
+
class: 'bw-date-picker-chrome__panel',
|
|
275
|
+
role: 'dialog',
|
|
276
|
+
'aria-modal': 'true',
|
|
277
|
+
'aria-label': props.panelLabel,
|
|
278
|
+
hidden: !open.value,
|
|
279
|
+
},
|
|
280
|
+
[
|
|
281
|
+
Calendar({
|
|
282
|
+
view: view.value,
|
|
283
|
+
rangeStart: parseISO(props.start),
|
|
284
|
+
rangeEnd: parseISO(props.end),
|
|
285
|
+
onView: (next) => {
|
|
286
|
+
view.value = next
|
|
287
|
+
},
|
|
288
|
+
onSelect: (date) => {
|
|
289
|
+
const currentStart = parseISO(props.start)
|
|
290
|
+
const currentEnd = parseISO(props.end)
|
|
291
|
+
if (!currentStart || currentEnd) {
|
|
292
|
+
emit('update:start', toISO(date))
|
|
293
|
+
emit('update:end', '')
|
|
294
|
+
return
|
|
295
|
+
}
|
|
296
|
+
if (date < currentStart) {
|
|
297
|
+
emit('update:start', toISO(date))
|
|
298
|
+
emit('update:end', toISO(currentStart))
|
|
299
|
+
open.value = false
|
|
300
|
+
return
|
|
301
|
+
}
|
|
302
|
+
emit('update:end', toISO(date))
|
|
272
303
|
open.value = false
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
},
|
|
278
|
-
}),
|
|
279
|
-
]),
|
|
304
|
+
},
|
|
305
|
+
}),
|
|
306
|
+
],
|
|
307
|
+
),
|
|
280
308
|
],
|
|
281
309
|
)
|
|
282
310
|
},
|
package/src/index.ts
CHANGED
|
@@ -2,12 +2,19 @@ export {
|
|
|
2
2
|
Button,
|
|
3
3
|
ButtonLink,
|
|
4
4
|
Badge,
|
|
5
|
+
Chip,
|
|
5
6
|
Card,
|
|
6
7
|
Alert,
|
|
8
|
+
AlertTitle,
|
|
9
|
+
AlertBody,
|
|
10
|
+
Banner,
|
|
7
11
|
Stack,
|
|
8
12
|
Cluster,
|
|
9
13
|
Grid,
|
|
14
|
+
Inset,
|
|
10
15
|
Container,
|
|
16
|
+
Centre,
|
|
17
|
+
VisuallyHidden,
|
|
11
18
|
Field,
|
|
12
19
|
Form,
|
|
13
20
|
FormActions,
|
|
@@ -17,12 +24,20 @@ export {
|
|
|
17
24
|
Input,
|
|
18
25
|
Textarea,
|
|
19
26
|
Select,
|
|
27
|
+
Switch,
|
|
28
|
+
CopyButton,
|
|
20
29
|
Checkbox,
|
|
21
30
|
Radio,
|
|
31
|
+
Slider,
|
|
22
32
|
TimeInput,
|
|
23
33
|
DateTimeInput,
|
|
34
|
+
InputGroup,
|
|
24
35
|
SkipLink,
|
|
25
36
|
ThemeToggle,
|
|
37
|
+
Segmented,
|
|
38
|
+
NumberStepper,
|
|
39
|
+
Topbar,
|
|
40
|
+
PageHeader,
|
|
26
41
|
} from './primitives'
|
|
27
42
|
|
|
28
43
|
export { Combobox } from './combobox'
|
|
@@ -32,6 +47,16 @@ export { DatePicker, DateRangePicker } from './date-picker'
|
|
|
32
47
|
|
|
33
48
|
export { Homepage, Landing, ContactForm } from './pages'
|
|
34
49
|
|
|
50
|
+
export { Modal } from './modal'
|
|
51
|
+
|
|
52
|
+
export { Popover } from './popover'
|
|
53
|
+
export type { PopoverPlacement, PopoverCloseReason } from './popover'
|
|
54
|
+
|
|
55
|
+
export { Stat, StatComparison, StatGrid, StatCard, StatCards } from './stat'
|
|
56
|
+
export type { StatSize, StatChrome } from './stat'
|
|
57
|
+
|
|
35
58
|
export { cn } from './cn'
|
|
36
59
|
|
|
60
|
+
export { BwDescriptionList, BwDescriptionTerm, BwDescriptionDetails } from './primitives'
|
|
61
|
+
|
|
37
62
|
export * as tokens from '@bwui/tokens'
|