@autoguru/overdrive 4.45.2 → 4.47.0
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/components/Calendar/Calendar.css.d.ts +8 -0
- package/dist/components/Calendar/Calendar.css.d.ts.map +1 -0
- package/dist/components/Calendar/Calendar.css.js +113 -0
- package/dist/components/Calendar/Calendar.d.ts +64 -0
- package/dist/components/Calendar/Calendar.d.ts.map +1 -0
- package/dist/components/Calendar/Calendar.js +122 -0
- package/dist/components/Calendar/CalendarButton.d.ts +7 -0
- package/dist/components/Calendar/CalendarButton.d.ts.map +1 -0
- package/dist/components/{DateTimePicker → Calendar}/CalendarButton.js +4 -3
- package/dist/components/{DateTimePicker → Calendar}/CalendarGrid.d.ts +4 -1
- package/dist/components/Calendar/CalendarGrid.d.ts.map +1 -0
- package/dist/components/{DateTimePicker → Calendar}/CalendarGrid.js +8 -7
- package/dist/components/Calendar/index.d.ts +3 -0
- package/dist/components/Calendar/index.d.ts.map +1 -0
- package/dist/components/Calendar/index.js +3 -0
- package/dist/components/DatePicker/DatePicker.css.d.ts +2 -1
- package/dist/components/DatePicker/DatePicker.css.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.css.js +60 -30
- package/dist/components/DatePicker/DatePicker.d.ts +83 -5
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.js +160 -43
- package/dist/components/DateTimePicker/DateTimePicker.css.d.ts +0 -15
- package/dist/components/DateTimePicker/DateTimePicker.css.d.ts.map +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.css.js +16 -99
- package/dist/components/DateTimePicker/DateTimePicker.d.ts +5 -2
- package/dist/components/DateTimePicker/DateTimePicker.d.ts.map +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.js +24 -80
- package/dist/components/OptionGrid/OptionGrid.css.d.ts +33 -34
- package/dist/components/OptionGrid/OptionGrid.css.d.ts.map +1 -1
- package/dist/components/OptionGrid/OptionGrid.css.js +208 -146
- package/dist/components/OptionGrid/OptionGrid.d.ts +16 -5
- package/dist/components/OptionGrid/OptionGrid.d.ts.map +1 -1
- package/dist/components/OptionGrid/OptionGrid.js +38 -13
- package/dist/components/OptionList/OptionList.css.d.ts +2 -10
- package/dist/components/OptionList/OptionList.css.d.ts.map +1 -1
- package/dist/components/OptionList/OptionList.css.js +92 -92
- package/dist/components/OptionList/OptionList.d.ts +10 -3
- package/dist/components/OptionList/OptionList.d.ts.map +1 -1
- package/dist/components/OptionList/OptionListItem.js +3 -3
- package/dist/components/Popover/Popover.css.d.ts +4 -0
- package/dist/components/Popover/Popover.css.d.ts.map +1 -0
- package/dist/components/Popover/Popover.css.js +46 -0
- package/dist/components/Popover/Popover.d.ts +34 -0
- package/dist/components/Popover/Popover.d.ts.map +1 -0
- package/dist/components/Popover/Popover.js +127 -0
- package/dist/components/Popover/PopoverTrigger.d.ts +51 -0
- package/dist/components/Popover/PopoverTrigger.d.ts.map +1 -0
- package/dist/components/Popover/PopoverTrigger.js +94 -0
- package/dist/components/Popover/index.d.ts +5 -0
- package/dist/components/Popover/index.d.ts.map +1 -0
- package/dist/components/Popover/index.js +4 -0
- package/dist/components/SearchBar/SearchBar.css.d.ts +7 -12
- package/dist/components/SearchBar/SearchBar.css.d.ts.map +1 -1
- package/dist/components/SearchBar/SearchBar.css.js +121 -66
- package/dist/components/SearchBar/SearchBar.d.ts.map +1 -1
- package/dist/components/SearchBar/SearchBar.js +17 -10
- package/dist/components/Slider/Slider.css.d.ts +9 -0
- package/dist/components/Slider/Slider.css.d.ts.map +1 -0
- package/dist/components/Slider/Slider.css.js +92 -0
- package/dist/components/Slider/Slider.d.ts +47 -0
- package/dist/components/Slider/Slider.d.ts.map +1 -0
- package/dist/components/Slider/Slider.js +137 -0
- package/dist/components/Slider/index.d.ts +2 -0
- package/dist/components/Slider/index.d.ts.map +1 -0
- package/dist/components/Slider/index.js +3 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/hooks/useMedia/useMedia.spec.d.ts +2 -0
- package/dist/hooks/useMedia/useMedia.spec.d.ts.map +1 -0
- package/dist/hooks/useMedia/useMedia.spec.js +288 -0
- package/dist/styles/selectors.d.ts +14 -0
- package/dist/styles/selectors.d.ts.map +1 -0
- package/dist/styles/selectors.js +27 -0
- package/dist/utils/css.d.ts +0 -22
- package/dist/utils/css.d.ts.map +1 -1
- package/dist/utils/css.js +0 -52
- package/dist/utils/css.spec.d.ts +2 -0
- package/dist/utils/css.spec.d.ts.map +1 -0
- package/dist/utils/css.spec.js +66 -0
- package/dist/utils/dateFormat.d.ts +24 -0
- package/dist/utils/dateFormat.d.ts.map +1 -0
- package/dist/utils/dateFormat.js +57 -0
- package/dist/utils/object.spec.d.ts +2 -0
- package/dist/utils/object.spec.d.ts.map +1 -0
- package/dist/utils/object.spec.js +135 -0
- package/dist/utils/responsiveStyle.spec.d.ts +2 -0
- package/dist/utils/responsiveStyle.spec.d.ts.map +1 -0
- package/dist/utils/responsiveStyle.spec.js +134 -0
- package/dist/utils/utils.spec.d.ts.map +1 -1
- package/dist/utils/utils.spec.js +342 -0
- package/package.json +25 -25
- package/dist/components/DateTimePicker/CalendarButton.d.ts +0 -4
- package/dist/components/DateTimePicker/CalendarButton.d.ts.map +0 -1
- package/dist/components/DateTimePicker/CalendarGrid.d.ts.map +0 -1
|
@@ -1,57 +1,56 @@
|
|
|
1
1
|
import { type RecipeVariants } from '@vanilla-extract/recipes';
|
|
2
|
+
import { cssLayerComponent } from '../../styles/layers.css';
|
|
2
3
|
export declare const gridContainer: string;
|
|
3
4
|
export declare const gridContainerStyle: string;
|
|
4
|
-
export declare const
|
|
5
|
+
export declare const gridVariants: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
5
6
|
columns: {
|
|
6
7
|
'1': {};
|
|
7
8
|
'2': {
|
|
8
|
-
'@
|
|
9
|
-
[
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
'@layer': {
|
|
10
|
+
[cssLayerComponent]: {
|
|
11
|
+
'@container': {
|
|
12
|
+
[x: string]: {
|
|
13
|
+
gridTemplateColumns: "repeat(2, 1fr)";
|
|
14
|
+
} | {
|
|
15
|
+
gridTemplateColumns: "repeat(3, 1fr)";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
13
18
|
};
|
|
14
19
|
};
|
|
15
20
|
};
|
|
16
21
|
'3': {
|
|
17
|
-
'@
|
|
18
|
-
[
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
'@layer': {
|
|
23
|
+
[cssLayerComponent]: {
|
|
24
|
+
'@container': {
|
|
25
|
+
[x: string]: {
|
|
26
|
+
gridTemplateColumns: "repeat(2, 1fr)";
|
|
27
|
+
} | {
|
|
28
|
+
gridTemplateColumns: "repeat(3, 1fr)";
|
|
29
|
+
};
|
|
30
|
+
};
|
|
22
31
|
};
|
|
23
32
|
};
|
|
24
33
|
};
|
|
25
34
|
'4': string;
|
|
26
35
|
'5': (string | {
|
|
27
|
-
'@
|
|
28
|
-
[
|
|
29
|
-
|
|
36
|
+
'@layer': {
|
|
37
|
+
[cssLayerComponent]: {
|
|
38
|
+
'@container': {
|
|
39
|
+
[x: string]: {
|
|
40
|
+
gridTemplateColumns: "repeat(5, 1fr)";
|
|
41
|
+
};
|
|
42
|
+
};
|
|
30
43
|
};
|
|
31
44
|
};
|
|
32
45
|
})[];
|
|
33
46
|
};
|
|
34
47
|
}>;
|
|
35
|
-
export type
|
|
36
|
-
export declare const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
export type StyledGridItemProps = NonNullable<RecipeVariants<typeof styledGridItem>>;
|
|
42
|
-
export declare const styleIndicator: string;
|
|
43
|
-
export declare const styledCheckbox: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
44
|
-
[x: string]: {
|
|
45
|
-
[x: string]: string | import("@vanilla-extract/css").ComplexStyleRule;
|
|
46
|
-
};
|
|
47
|
-
}>;
|
|
48
|
-
export type StyledCheckboxProps = NonNullable<RecipeVariants<typeof styledCheckbox>>;
|
|
49
|
-
export declare const styledRadioButton: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
50
|
-
[x: string]: {
|
|
51
|
-
[x: string]: string | import("@vanilla-extract/css").ComplexStyleRule;
|
|
52
|
-
};
|
|
53
|
-
}>;
|
|
54
|
-
export type StyledRadioButtonProps = NonNullable<RecipeVariants<typeof styledRadioButton>>;
|
|
48
|
+
export type GridVariants = NonNullable<RecipeVariants<typeof gridVariants>>;
|
|
49
|
+
export declare const gridItemContainerStyle: string;
|
|
50
|
+
export declare const gridItemStyle: string;
|
|
51
|
+
export declare const indicatorStyle: string;
|
|
52
|
+
export declare const checkboxStyle: string;
|
|
53
|
+
export declare const radioButtonStyle: string;
|
|
55
54
|
export declare const labelStyle: string;
|
|
56
55
|
export declare const descriptionStyle: string;
|
|
57
56
|
//# sourceMappingURL=OptionGrid.css.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OptionGrid.css.d.ts","sourceRoot":"","sources":["../../../lib/components/OptionGrid/OptionGrid.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"OptionGrid.css.d.ts","sourceRoot":"","sources":["../../../lib/components/OptionGrid/OptionGrid.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAGvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAQ5D,eAAO,MAAM,aAAa,QAAoB,CAAC;AAC/C,eAAO,MAAM,kBAAkB,QAO7B,CAAC;AA4BH,eAAO,MAAM,YAAY;;;;;gBAWpB,CAAC,iBAAiB,CAAC;;;;;;;;kBASlB;;;;;gBAKD,CAAC,iBAAiB,CAAC;;;;;;;;kBAUlB;;;;;;gBAQA,CAAC,iBAAiB,CAAC;;;;;;kBAMlB;;;;EASL,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,cAAc,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC;AAY5E,eAAO,MAAM,sBAAsB,QAsBjC,CAAC;AAEH,eAAO,MAAM,aAAa,QA8CxB,CAAC;AAIH,eAAO,MAAM,cAAc,QAOzB,CAAC;AAEH,eAAO,MAAM,aAAa,QAkCxB,CAAC;AA4BH,eAAO,MAAM,gBAAgB,QAkC3B,CAAC;AAIH,eAAO,MAAM,UAAU,QAA+B,CAAC;AACvD,eAAO,MAAM,gBAAgB,QAA+B,CAAC"}
|
|
@@ -5,36 +5,46 @@ __vanilla_filescope__.setFileScope("lib/components/OptionGrid/OptionGrid.css.ts"
|
|
|
5
5
|
import { createContainer, style } from '@vanilla-extract/css';
|
|
6
6
|
import { recipe } from '@vanilla-extract/recipes';
|
|
7
7
|
import { focusOutlineStyle } from "../../styles/focusOutline.css.js";
|
|
8
|
+
import { cssLayerComponent } from "../../styles/layers.css.js";
|
|
9
|
+
import { selectors } from "../../styles/selectors.js";
|
|
8
10
|
import { sprinkles } from "../../styles/sprinkles.css.js";
|
|
9
11
|
import { breakpoints } from "../../themes/makeTheme.js";
|
|
10
|
-
import { overdriveTokens as tokens } from "../../themes/theme.css.js";
|
|
11
|
-
import { interactionStyle, notDisabled, notSelected } from "../../utils/css.js"; // === Container styles
|
|
12
|
+
import { overdriveTokens as tokens } from "../../themes/theme.css.js"; // === Container styles
|
|
12
13
|
export const gridContainer = createContainer("gridContainer");
|
|
13
14
|
export const gridContainerStyle = style({
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
'@layer': {
|
|
16
|
+
[cssLayerComponent]: {
|
|
17
|
+
containerName: gridContainer,
|
|
18
|
+
containerType: 'inline-size'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
16
21
|
}, "gridContainerStyle");
|
|
17
22
|
|
|
18
|
-
//
|
|
23
|
+
// === Grid styles
|
|
24
|
+
|
|
19
25
|
const minWidth1200 = '(min-width: 1200px)';
|
|
20
26
|
const repeat2Col = 'repeat(2, 1fr)';
|
|
21
27
|
const repeat3Col = 'repeat(3, 1fr)';
|
|
22
28
|
const repeat4Col = 'repeat(4, 1fr)';
|
|
23
29
|
const repeat5Col = 'repeat(5, 1fr)';
|
|
24
30
|
const grid4ColStyle = style({
|
|
25
|
-
'@
|
|
26
|
-
[
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
'@layer': {
|
|
32
|
+
[cssLayerComponent]: {
|
|
33
|
+
'@container': {
|
|
34
|
+
[`${gridContainer} (min-width: ${breakpoints.mobile})`]: {
|
|
35
|
+
gridTemplateColumns: repeat2Col
|
|
36
|
+
},
|
|
37
|
+
[`${gridContainer} (min-width: ${breakpoints.tablet})`]: {
|
|
38
|
+
gridTemplateColumns: repeat3Col
|
|
39
|
+
},
|
|
40
|
+
[`${gridContainer} (min-width: ${breakpoints.desktop})`]: {
|
|
41
|
+
gridTemplateColumns: repeat4Col
|
|
42
|
+
}
|
|
43
|
+
}
|
|
34
44
|
}
|
|
35
45
|
}
|
|
36
46
|
}, "grid4ColStyle");
|
|
37
|
-
export const
|
|
47
|
+
export const gridVariants = recipe({
|
|
38
48
|
base: sprinkles({
|
|
39
49
|
display: 'grid',
|
|
40
50
|
gridColumns: {
|
|
@@ -46,30 +56,42 @@ export const styledGrid = recipe({
|
|
|
46
56
|
columns: {
|
|
47
57
|
'1': {},
|
|
48
58
|
'2': {
|
|
49
|
-
'@
|
|
50
|
-
[
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
59
|
+
'@layer': {
|
|
60
|
+
[cssLayerComponent]: {
|
|
61
|
+
'@container': {
|
|
62
|
+
[`${gridContainer} (min-width: 640px)`]: {
|
|
63
|
+
gridTemplateColumns: repeat2Col
|
|
64
|
+
},
|
|
65
|
+
[`${gridContainer} ${minWidth1200}`]: {
|
|
66
|
+
gridTemplateColumns: repeat3Col
|
|
67
|
+
}
|
|
68
|
+
}
|
|
55
69
|
}
|
|
56
70
|
}
|
|
57
71
|
},
|
|
58
72
|
'3': {
|
|
59
|
-
'@
|
|
60
|
-
[
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
73
|
+
'@layer': {
|
|
74
|
+
[cssLayerComponent]: {
|
|
75
|
+
'@container': {
|
|
76
|
+
[`${gridContainer} (min-width: 550px)`]: {
|
|
77
|
+
gridTemplateColumns: repeat2Col
|
|
78
|
+
},
|
|
79
|
+
[`${gridContainer} (min-width: ${breakpoints.desktop})`]: {
|
|
80
|
+
gridTemplateColumns: repeat3Col
|
|
81
|
+
}
|
|
82
|
+
}
|
|
65
83
|
}
|
|
66
84
|
}
|
|
67
85
|
},
|
|
68
86
|
'4': grid4ColStyle,
|
|
69
87
|
'5': [grid4ColStyle, {
|
|
70
|
-
'@
|
|
71
|
-
[
|
|
72
|
-
|
|
88
|
+
'@layer': {
|
|
89
|
+
[cssLayerComponent]: {
|
|
90
|
+
'@container': {
|
|
91
|
+
[`${gridContainer} ${minWidth1200}`]: {
|
|
92
|
+
gridTemplateColumns: repeat5Col
|
|
93
|
+
}
|
|
94
|
+
}
|
|
73
95
|
}
|
|
74
96
|
}
|
|
75
97
|
}]
|
|
@@ -78,139 +100,179 @@ export const styledGrid = recipe({
|
|
|
78
100
|
defaultVariants: {
|
|
79
101
|
columns: '2'
|
|
80
102
|
}
|
|
81
|
-
}, "
|
|
103
|
+
}, "gridVariants");
|
|
82
104
|
// === Option item styles
|
|
105
|
+
|
|
83
106
|
const optionTransition = style({
|
|
84
|
-
|
|
107
|
+
'@layer': {
|
|
108
|
+
[cssLayerComponent]: {
|
|
109
|
+
transition: 'background 100ms ease-in, border-color 100ms ease-in'
|
|
110
|
+
}
|
|
111
|
+
}
|
|
85
112
|
}, "optionTransition");
|
|
86
|
-
export const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}, interactionStyle({
|
|
101
|
-
hover: {
|
|
102
|
-
cursor: 'pointer'
|
|
103
|
-
},
|
|
104
|
-
selected: {
|
|
113
|
+
export const gridItemContainerStyle = style([sprinkles({
|
|
114
|
+
alignItems: 'center',
|
|
115
|
+
borderRadius: 'md',
|
|
116
|
+
borderStyle: 'solid',
|
|
117
|
+
borderWidth: '1',
|
|
118
|
+
display: 'flex',
|
|
119
|
+
gap: '2',
|
|
120
|
+
px: '4',
|
|
121
|
+
py: '3',
|
|
122
|
+
position: 'relative',
|
|
123
|
+
userSelect: 'none'
|
|
124
|
+
}), {
|
|
125
|
+
'@layer': {
|
|
126
|
+
[cssLayerComponent]: {
|
|
105
127
|
backgroundColor: tokens.colours.background.body,
|
|
106
|
-
borderColor: tokens.border.colours.
|
|
128
|
+
borderColor: tokens.border.colours.gray,
|
|
129
|
+
minHeight: '80px'
|
|
107
130
|
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
131
|
+
}
|
|
132
|
+
}], "gridItemContainerStyle");
|
|
133
|
+
export const gridItemStyle = style([gridItemContainerStyle, {
|
|
134
|
+
'@layer': {
|
|
135
|
+
[cssLayerComponent]: {
|
|
136
|
+
backgroundColor: tokens.colours.background.body,
|
|
137
|
+
borderColor: tokens.border.colours.gray,
|
|
138
|
+
minHeight: '80px',
|
|
139
|
+
selectors: {
|
|
140
|
+
[selectors.hover]: {
|
|
141
|
+
cursor: 'pointer'
|
|
142
|
+
},
|
|
143
|
+
[selectors.selected]: {
|
|
144
|
+
backgroundColor: tokens.colours.background.body,
|
|
145
|
+
borderColor: tokens.border.colours.dark
|
|
146
|
+
},
|
|
147
|
+
[`${selectors.hoverNotSelected}, ${selectors.focusVisibleNotSelected}`]: {
|
|
148
|
+
backgroundColor: tokens.border.colours.light,
|
|
149
|
+
borderColor: tokens.border.colours.light
|
|
150
|
+
},
|
|
151
|
+
[`&[data-selected]:after`]: {
|
|
152
|
+
borderRadius: 'inherit',
|
|
153
|
+
content: '',
|
|
154
|
+
display: 'block',
|
|
155
|
+
height: '100%',
|
|
156
|
+
left: 0,
|
|
157
|
+
outlineColor: tokens.colours.gamut.black900,
|
|
158
|
+
outlineStyle: 'solid',
|
|
159
|
+
outlineWidth: tokens.border.width[2],
|
|
160
|
+
position: 'absolute',
|
|
161
|
+
top: 0,
|
|
162
|
+
width: '100%'
|
|
163
|
+
},
|
|
164
|
+
[selectors.disabled]: {
|
|
165
|
+
backgroundColor: tokens.colours.gamut.gray100,
|
|
166
|
+
borderColor: 'transparent',
|
|
167
|
+
color: tokens.colours.gamut.black500,
|
|
168
|
+
cursor: 'not-allowed'
|
|
169
|
+
}
|
|
126
170
|
}
|
|
127
171
|
}
|
|
128
|
-
}
|
|
129
|
-
}, "
|
|
172
|
+
}
|
|
173
|
+
}, optionTransition, focusOutlineStyle], "gridItemStyle");
|
|
174
|
+
|
|
130
175
|
// === Indicator styles
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
borderColor: tokens.border.colours.gray,
|
|
138
|
-
borderRadius: tokens.border.radius['sm'],
|
|
139
|
-
borderStyle: 'solid',
|
|
140
|
-
borderWidth: tokens.border.width[1],
|
|
141
|
-
color: 'transparent'
|
|
142
|
-
}, interactionStyle({
|
|
143
|
-
selected: {
|
|
144
|
-
backgroundColor: tokens.colours.foreground.body,
|
|
145
|
-
color: tokens.colours.background.body
|
|
176
|
+
|
|
177
|
+
export const indicatorStyle = style({
|
|
178
|
+
'@layer': {
|
|
179
|
+
[cssLayerComponent]: {
|
|
180
|
+
height: '26px',
|
|
181
|
+
width: '26px'
|
|
146
182
|
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
183
|
+
}
|
|
184
|
+
}, "indicatorStyle");
|
|
185
|
+
export const checkboxStyle = style([sprinkles({
|
|
186
|
+
alignItems: 'center',
|
|
187
|
+
borderColour: 'gray',
|
|
188
|
+
borderRadius: 'sm',
|
|
189
|
+
borderStyle: 'solid',
|
|
190
|
+
borderWidth: '1',
|
|
191
|
+
display: 'flex',
|
|
192
|
+
flexShrink: '0',
|
|
193
|
+
justifyContent: 'center',
|
|
194
|
+
size: '6'
|
|
195
|
+
}), {
|
|
196
|
+
'@layer': {
|
|
197
|
+
[cssLayerComponent]: {
|
|
198
|
+
color: 'transparent',
|
|
199
|
+
selectors: {
|
|
200
|
+
[selectors.selected]: {
|
|
201
|
+
backgroundColor: tokens.colours.foreground.body,
|
|
202
|
+
color: tokens.colours.background.body
|
|
203
|
+
},
|
|
204
|
+
[`${selectors.hoverNotSelected}, ${selectors.focusVisibleNotSelected}`]: {
|
|
205
|
+
backgroundColor: tokens.colours.gamut.gray300,
|
|
206
|
+
color: tokens.colours.background.body
|
|
207
|
+
},
|
|
208
|
+
[selectors.disabled]: {
|
|
209
|
+
borderColor: tokens.colours.gamut.gray200
|
|
210
|
+
}
|
|
152
211
|
}
|
|
153
212
|
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
display: 'flex',
|
|
157
|
-
flexShrink: '0',
|
|
158
|
-
justifyContent: 'center',
|
|
159
|
-
size: '6'
|
|
160
|
-
}), optionTransition]
|
|
161
|
-
}, "styledCheckbox");
|
|
213
|
+
}
|
|
214
|
+
}, optionTransition], "checkboxStyle");
|
|
162
215
|
const pseudoRadio = style({
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
216
|
+
'@layer': {
|
|
217
|
+
[cssLayerComponent]: {
|
|
218
|
+
selectors: {
|
|
219
|
+
'&:after': {
|
|
220
|
+
borderRadius: 'inherit',
|
|
221
|
+
content: '',
|
|
222
|
+
display: 'block',
|
|
223
|
+
height: '100%',
|
|
224
|
+
left: 0,
|
|
225
|
+
position: 'absolute',
|
|
226
|
+
top: 0,
|
|
227
|
+
transform: 'scale(0.475)',
|
|
228
|
+
width: '100%'
|
|
229
|
+
},
|
|
230
|
+
[`${selectors.hover}:after, ${selectors.focusVisible}:after`]: {
|
|
231
|
+
background: tokens.colours.gamut.gray200
|
|
232
|
+
},
|
|
233
|
+
[`&[data-selected]:after`]: {
|
|
234
|
+
background: tokens.colours.gamut.white
|
|
235
|
+
}
|
|
236
|
+
}
|
|
180
237
|
}
|
|
181
238
|
}
|
|
182
239
|
}, "pseudoRadio");
|
|
183
|
-
export const
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
backgroundColor: tokens.colours.
|
|
194
|
-
borderColor: tokens.border.colours.
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
240
|
+
export const radioButtonStyle = style([sprinkles({
|
|
241
|
+
alignItems: 'center',
|
|
242
|
+
borderRadius: 'full',
|
|
243
|
+
borderStyle: 'solid',
|
|
244
|
+
borderWidth: '1',
|
|
245
|
+
position: 'relative',
|
|
246
|
+
size: '6'
|
|
247
|
+
}), {
|
|
248
|
+
'@layer': {
|
|
249
|
+
[cssLayerComponent]: {
|
|
250
|
+
backgroundColor: tokens.colours.background.body,
|
|
251
|
+
borderColor: tokens.border.colours.gray,
|
|
252
|
+
selectors: {
|
|
253
|
+
[selectors.selected]: {
|
|
254
|
+
backgroundColor: tokens.colours.foreground.body,
|
|
255
|
+
borderColor: tokens.border.colours.dark
|
|
256
|
+
},
|
|
257
|
+
[`${selectors.hoverNotSelected}, ${selectors.focusVisibleNotSelected}`]: {
|
|
258
|
+
backgroundColor: tokens.colours.gamut.gray300,
|
|
259
|
+
borderColor: tokens.colours.gamut.gray300
|
|
260
|
+
},
|
|
261
|
+
[selectors.disabled]: {
|
|
262
|
+
backgroundColor: tokens.colours.gamut.gray100,
|
|
263
|
+
borderColor: tokens.colours.gamut.gray200
|
|
264
|
+
}
|
|
204
265
|
}
|
|
205
266
|
}
|
|
206
|
-
}
|
|
207
|
-
}, "
|
|
267
|
+
}
|
|
268
|
+
}, pseudoRadio, optionTransition], "radioButtonStyle");
|
|
269
|
+
|
|
208
270
|
// === Label styles
|
|
209
271
|
|
|
210
|
-
export const labelStyle =
|
|
211
|
-
fontSize:
|
|
212
|
-
}
|
|
213
|
-
export const descriptionStyle =
|
|
214
|
-
fontSize:
|
|
215
|
-
}
|
|
272
|
+
export const labelStyle = sprinkles({
|
|
273
|
+
fontSize: '4'
|
|
274
|
+
});
|
|
275
|
+
export const descriptionStyle = sprinkles({
|
|
276
|
+
fontSize: '2'
|
|
277
|
+
});
|
|
216
278
|
__vanilla_filescope__.endFileScope();
|
|
@@ -3,7 +3,7 @@ import { type ListBoxProps } from 'react-aria-components';
|
|
|
3
3
|
import { type SelectionMode } from 'react-stately';
|
|
4
4
|
import type { TestIdProp } from '../../types';
|
|
5
5
|
import { type IconEl } from '../Icon';
|
|
6
|
-
import { type
|
|
6
|
+
import { type GridVariants } from './OptionGrid.css';
|
|
7
7
|
export interface OptionItem {
|
|
8
8
|
name: string;
|
|
9
9
|
label: string;
|
|
@@ -13,6 +13,10 @@ export interface OptionItem {
|
|
|
13
13
|
*/
|
|
14
14
|
icon?: IconEl;
|
|
15
15
|
description?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Whether this option should be disabled
|
|
18
|
+
*/
|
|
19
|
+
disabled?: boolean;
|
|
16
20
|
}
|
|
17
21
|
export interface OptionGridProps<T> extends Omit<ListBoxProps<T>, 'items'>, TestIdProp {
|
|
18
22
|
/**
|
|
@@ -34,7 +38,11 @@ export interface OptionGridProps<T> extends Omit<ListBoxProps<T>, 'items'>, Test
|
|
|
34
38
|
/**
|
|
35
39
|
* Number of columns to display the options in
|
|
36
40
|
*/
|
|
37
|
-
columns?:
|
|
41
|
+
columns?: GridVariants['columns'];
|
|
42
|
+
/**
|
|
43
|
+
* Loading state
|
|
44
|
+
*/
|
|
45
|
+
isLoading?: boolean;
|
|
38
46
|
}
|
|
39
47
|
/**
|
|
40
48
|
* The OptionGrid is primarily used in the booking flow to provide large selectable tiles to the user. It is not a form
|
|
@@ -42,13 +50,16 @@ export interface OptionGridProps<T> extends Omit<ListBoxProps<T>, 'items'>, Test
|
|
|
42
50
|
* and implements a listbox behaviour without wrapping an input element. It supports controlled and uncontrolled usage.
|
|
43
51
|
* Following ARIA guidelines, the arrow keys can be used to navigate withing the group of options.
|
|
44
52
|
*
|
|
53
|
+
* The ListBox implementation provides a Set of selected keys to the `onSelectionChange` handler. To preselect options
|
|
54
|
+
* in uncontrolled usage, simply provide a default selection using the `defaultSelectedKeys` prop.
|
|
45
55
|
* See more details on react-aria [ListBox props](https://react-spectrum.adobe.com/react-aria/ListBox.html#listbox-1).
|
|
46
56
|
*
|
|
47
|
-
* Not yet implemented: disabled appearance, empty state, loading state, error state.
|
|
48
|
-
*
|
|
49
57
|
* Accessibility note: The ARIA spec prohibits listbox items from including interactive content such as buttons,
|
|
50
58
|
* tooltips, etc. For these cases a completely different implementation is required (e.g. react-aria [GridList](
|
|
51
59
|
* https://react-spectrum.adobe.com/react-aria/GridList.html))
|
|
52
60
|
*/
|
|
53
|
-
export declare const OptionGrid:
|
|
61
|
+
export declare const OptionGrid: {
|
|
62
|
+
({ className, columns, indicator, isLoading, label, layout, selectionMode, testId, ...props }: OptionGridProps<OptionItem>): React.JSX.Element;
|
|
63
|
+
displayName: string;
|
|
64
|
+
};
|
|
54
65
|
//# sourceMappingURL=OptionGrid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OptionGrid.d.ts","sourceRoot":"","sources":["../../../lib/components/OptionGrid/OptionGrid.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAIN,KAAK,YAAY,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"OptionGrid.d.ts","sourceRoot":"","sources":["../../../lib/components/OptionGrid/OptionGrid.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAIN,KAAK,YAAY,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAG5C,OAAO,EAUN,KAAK,YAAY,EACjB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AACD,MAAM,WAAW,eAAe,CAAC,CAAC,CACjC,SAAQ,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EACrC,UAAU;IACX;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC;IAC1C;;OAEG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IAClC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,UAAU;mGAWpB,eAAe,CAAC,UAAU,CAAC;;CAgG7B,CAAC"}
|