@pingux/astro 2.36.0-alpha.1 → 2.36.0-alpha.2
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/lib/cjs/components/Button/Button.stories.d.ts +51 -5
- package/lib/cjs/components/Button/Button.stories.js +89 -40
- package/lib/cjs/components/Button/Buttons.styles.d.ts +72 -1
- package/lib/cjs/components/Button/Buttons.styles.js +18 -1
- package/lib/cjs/components/Calendar/Calendar.stories.js +48 -19
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +16 -10
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentalBreadcrumbUniversal.test.js +10 -0
- package/lib/cjs/hooks/useColumnStyles/index.d.ts +1 -0
- package/lib/cjs/hooks/useColumnStyles/useColumnStyles.d.ts +11 -0
- package/lib/cjs/hooks/useColumnStyles/useColumnStyles.js +7 -3
- package/lib/cjs/hooks/useField/useField.d.ts +4 -4
- package/lib/cjs/hooks/useSelectField/useSelectField.d.ts +2 -1
- package/lib/cjs/utils/designUtils/figmaLinks.js +14 -2
- package/lib/components/Button/Button.stories.js +83 -34
- package/lib/components/Button/Buttons.styles.js +18 -1
- package/lib/components/Calendar/Calendar.stories.js +45 -15
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.test.js +13 -7
- package/lib/components/EnvironmentBreadcrumb/EnvironmentalBreadcrumbUniversal.test.js +8 -0
- package/lib/hooks/useColumnStyles/useColumnStyles.js +7 -3
- package/lib/utils/designUtils/figmaLinks.js +14 -2
- package/package.json +1 -1
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumbAxe.test.js +0 -7
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumbAxe.test.js +0 -4
@@ -28,9 +28,51 @@ export declare const Default: {
|
|
28
28
|
};
|
29
29
|
};
|
30
30
|
};
|
31
|
-
export declare const
|
32
|
-
|
33
|
-
|
31
|
+
export declare const Primary: {
|
32
|
+
(): React.JSX.Element;
|
33
|
+
parameters: {
|
34
|
+
design: {
|
35
|
+
type: string;
|
36
|
+
url: string;
|
37
|
+
};
|
38
|
+
};
|
39
|
+
};
|
40
|
+
export declare const Critical: {
|
41
|
+
(): React.JSX.Element;
|
42
|
+
parameters: {
|
43
|
+
design: {
|
44
|
+
type: string;
|
45
|
+
url: string;
|
46
|
+
};
|
47
|
+
};
|
48
|
+
};
|
49
|
+
export declare const InlineButton: {
|
50
|
+
(): React.JSX.Element;
|
51
|
+
parameters: {
|
52
|
+
design: {
|
53
|
+
type: string;
|
54
|
+
url: string;
|
55
|
+
};
|
56
|
+
};
|
57
|
+
};
|
58
|
+
export declare const TextIconButton: {
|
59
|
+
(): React.JSX.Element;
|
60
|
+
parameters: {
|
61
|
+
design: {
|
62
|
+
type: string;
|
63
|
+
url: string;
|
64
|
+
};
|
65
|
+
};
|
66
|
+
};
|
67
|
+
export declare const Disabled: {
|
68
|
+
(): React.JSX.Element;
|
69
|
+
parameters: {
|
70
|
+
design: {
|
71
|
+
type: string;
|
72
|
+
url: string;
|
73
|
+
};
|
74
|
+
};
|
75
|
+
};
|
34
76
|
export declare const ColorBlockButton: {
|
35
77
|
(args: any): React.JSX.Element;
|
36
78
|
argTypes: {
|
@@ -41,6 +83,10 @@ export declare const ColorBlockButton: {
|
|
41
83
|
defaultValue: boolean;
|
42
84
|
};
|
43
85
|
};
|
86
|
+
parameters: {
|
87
|
+
design: {
|
88
|
+
type: string;
|
89
|
+
url: string;
|
90
|
+
};
|
91
|
+
};
|
44
92
|
};
|
45
|
-
export declare const Critical: () => React.JSX.Element;
|
46
|
-
export declare const Primary: () => React.JSX.Element;
|
@@ -60,71 +60,114 @@ Default.parameters = {
|
|
60
60
|
url: _figmaLinks.FIGMA_LINKS.button["default"]
|
61
61
|
}
|
62
62
|
};
|
63
|
-
var
|
63
|
+
var Primary = function Primary() {
|
64
64
|
return (0, _react2.jsx)(_index.Button, {
|
65
|
-
|
65
|
+
variant: "primary"
|
66
66
|
}, "Button Text");
|
67
67
|
};
|
68
|
-
exports.
|
69
|
-
|
68
|
+
exports.Primary = Primary;
|
69
|
+
Primary.parameters = {
|
70
|
+
design: {
|
71
|
+
type: 'figma',
|
72
|
+
url: _figmaLinks.FIGMA_LINKS.button.primary
|
73
|
+
}
|
74
|
+
};
|
75
|
+
var Critical = function Critical() {
|
70
76
|
return (0, _react2.jsx)(_index.Button, {
|
77
|
+
variant: "critical"
|
78
|
+
}, "Button Text");
|
79
|
+
};
|
80
|
+
exports.Critical = Critical;
|
81
|
+
Critical.parameters = {
|
82
|
+
design: {
|
83
|
+
type: 'figma',
|
84
|
+
url: _figmaLinks.FIGMA_LINKS.button.critical
|
85
|
+
}
|
86
|
+
};
|
87
|
+
var InlineButton = function InlineButton() {
|
88
|
+
return (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Button, {
|
89
|
+
mb: "sm",
|
90
|
+
mr: "auto",
|
91
|
+
variant: "inline"
|
92
|
+
}, "Button Text"), (0, _react2.jsx)(_index.Button, {
|
93
|
+
mb: "sm",
|
94
|
+
mr: "auto",
|
95
|
+
variant: "inlinePrimary"
|
96
|
+
}, "Button Text"));
|
97
|
+
};
|
98
|
+
exports.InlineButton = InlineButton;
|
99
|
+
InlineButton.parameters = {
|
100
|
+
design: {
|
101
|
+
type: 'figma',
|
102
|
+
url: _figmaLinks.FIGMA_LINKS.button.inlineButton
|
103
|
+
}
|
104
|
+
};
|
105
|
+
var TextIconButton = function TextIconButton() {
|
106
|
+
return (0, _react2.jsx)(_index.Box, {
|
107
|
+
width: 20
|
108
|
+
}, (0, _react2.jsx)(_index.Button, {
|
71
109
|
mb: "sm",
|
72
110
|
variant: "withIcon"
|
73
|
-
}, (0, _react2.jsx)(_index.Box, {
|
74
|
-
isRow: true,
|
75
|
-
alignItems: "center"
|
76
111
|
}, (0, _react2.jsx)(_index.Icon, {
|
77
112
|
icon: _PlusIcon["default"],
|
78
113
|
mr: "xs",
|
79
|
-
color: "
|
114
|
+
color: "accent.30",
|
80
115
|
size: 20,
|
81
116
|
title: {
|
82
117
|
name: 'Add Circle Icon'
|
83
118
|
}
|
84
|
-
}), "
|
85
|
-
};
|
86
|
-
exports.TextIconButton = TextIconButton;
|
87
|
-
var InlineButton = function InlineButton() {
|
88
|
-
return (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Button, {
|
89
|
-
mb: "sm",
|
90
|
-
mr: "auto",
|
91
|
-
variant: "inline"
|
92
|
-
}, "Inline"), (0, _react2.jsx)(_index.Button, {
|
119
|
+
}), "Button Text"), (0, _react2.jsx)(_index.Button, {
|
93
120
|
mb: "sm",
|
94
121
|
mr: "auto",
|
95
122
|
variant: "inlineWithIcon"
|
96
123
|
}, (0, _react2.jsx)(_index.Icon, {
|
97
124
|
icon: _PlusIcon["default"],
|
98
125
|
mr: "xs",
|
99
|
-
color: "
|
126
|
+
color: "accent.30",
|
100
127
|
size: 15,
|
101
128
|
title: {
|
102
129
|
name: 'Add Circle Icon'
|
103
130
|
}
|
104
|
-
}), "
|
105
|
-
mb: "sm",
|
106
|
-
mr: "auto",
|
107
|
-
variant: "inlinePrimary"
|
108
|
-
}, "Inline primary"), (0, _react2.jsx)(_index.Button, {
|
131
|
+
}), "Button Text"), (0, _react2.jsx)(_index.Button, {
|
109
132
|
mb: "sm",
|
110
133
|
mr: "auto",
|
111
134
|
variant: "inlinePrimaryWithIcon"
|
112
135
|
}, (0, _react2.jsx)(_index.Icon, {
|
113
136
|
icon: _PlusIcon["default"],
|
114
137
|
mr: "xs",
|
115
|
-
color: "
|
138
|
+
color: "accent.30",
|
116
139
|
size: 15,
|
117
140
|
title: {
|
118
141
|
name: 'Add Circle Icon'
|
119
142
|
}
|
120
|
-
}), "
|
143
|
+
}), "Button Text"));
|
144
|
+
};
|
145
|
+
exports.TextIconButton = TextIconButton;
|
146
|
+
TextIconButton.parameters = {
|
147
|
+
design: {
|
148
|
+
type: 'figma',
|
149
|
+
url: _figmaLinks.FIGMA_LINKS.button.textIconButton
|
150
|
+
}
|
151
|
+
};
|
152
|
+
var Disabled = function Disabled() {
|
153
|
+
return (0, _react2.jsx)(_index.Button, {
|
154
|
+
isDisabled: true
|
155
|
+
}, "Button Text");
|
156
|
+
};
|
157
|
+
exports.Disabled = Disabled;
|
158
|
+
Disabled.parameters = {
|
159
|
+
design: {
|
160
|
+
type: 'figma',
|
161
|
+
url: _figmaLinks.FIGMA_LINKS.button.disabled
|
162
|
+
}
|
121
163
|
};
|
122
|
-
exports.InlineButton = InlineButton;
|
123
164
|
var ColorBlockButton = function ColorBlockButton(args) {
|
124
165
|
// Change `isConfigured` property in storybook controls
|
125
166
|
var isConfigured = args.isConfigured,
|
126
167
|
props = (0, _objectWithoutProperties2["default"])(args, _excluded);
|
127
|
-
return (0, _react2.jsx)(_index.Button, (0, _extends2["default"])({
|
168
|
+
return (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Button, (0, _extends2["default"])({
|
169
|
+
mb: "sm"
|
170
|
+
}, props, {
|
128
171
|
variant: "colorBlock",
|
129
172
|
className: isConfigured ? 'is-configured' : ''
|
130
173
|
}), (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Text, {
|
@@ -136,7 +179,19 @@ var ColorBlockButton = function ColorBlockButton(args) {
|
|
136
179
|
title: {
|
137
180
|
name: 'Create Icon'
|
138
181
|
}
|
139
|
-
}))
|
182
|
+
})), (0, _react2.jsx)(_index.Button, (0, _extends2["default"])({}, props, {
|
183
|
+
variant: "colorBlockPrimary",
|
184
|
+
className: isConfigured ? 'is-configured' : ''
|
185
|
+
}), (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Text, {
|
186
|
+
variant: "buttonTitle"
|
187
|
+
}, "Title"), (0, _react2.jsx)(_index.Text, {
|
188
|
+
variant: "buttonSubtitle"
|
189
|
+
}, "Info")), (0, _react2.jsx)(_index.Icon, {
|
190
|
+
icon: _CreateIcon["default"],
|
191
|
+
title: {
|
192
|
+
name: 'Create Icon'
|
193
|
+
}
|
194
|
+
})));
|
140
195
|
};
|
141
196
|
exports.ColorBlockButton = ColorBlockButton;
|
142
197
|
ColorBlockButton.argTypes = {
|
@@ -147,15 +202,9 @@ ColorBlockButton.argTypes = {
|
|
147
202
|
defaultValue: false
|
148
203
|
}
|
149
204
|
};
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
}
|
155
|
-
|
156
|
-
var Primary = function Primary() {
|
157
|
-
return (0, _react2.jsx)(_index.Button, {
|
158
|
-
variant: "primary"
|
159
|
-
}, "Button Text");
|
160
|
-
};
|
161
|
-
exports.Primary = Primary;
|
205
|
+
ColorBlockButton.parameters = {
|
206
|
+
design: {
|
207
|
+
type: 'figma',
|
208
|
+
url: _figmaLinks.FIGMA_LINKS.button.colorBlockButton
|
209
|
+
}
|
210
|
+
};
|
@@ -564,6 +564,77 @@ declare const _default: {
|
|
564
564
|
borderColor: string;
|
565
565
|
};
|
566
566
|
};
|
567
|
+
colorBlockPrimary: {
|
568
|
+
'& span': {
|
569
|
+
color: string;
|
570
|
+
textAlign: string;
|
571
|
+
};
|
572
|
+
'&.is-hovered': {
|
573
|
+
backgroundColor: string;
|
574
|
+
color: string;
|
575
|
+
bg: string;
|
576
|
+
border: string;
|
577
|
+
borderColor: string;
|
578
|
+
boxShadow: string;
|
579
|
+
};
|
580
|
+
'&.is-pressed': {
|
581
|
+
backgroundColor: string;
|
582
|
+
border: string;
|
583
|
+
borderColor: string;
|
584
|
+
bg: string;
|
585
|
+
color: string;
|
586
|
+
path: {
|
587
|
+
fill: string;
|
588
|
+
};
|
589
|
+
};
|
590
|
+
bg: string;
|
591
|
+
border: string;
|
592
|
+
borderColor: string;
|
593
|
+
color: string;
|
594
|
+
path: {
|
595
|
+
fill: string;
|
596
|
+
};
|
597
|
+
borderRadius: number;
|
598
|
+
outline: string;
|
599
|
+
cursor: string;
|
600
|
+
width: number;
|
601
|
+
height: string;
|
602
|
+
p: string;
|
603
|
+
display: string;
|
604
|
+
justifyContent: string;
|
605
|
+
alignItems: string;
|
606
|
+
'&.is-focused': {
|
607
|
+
outline: string;
|
608
|
+
outlineColor: string;
|
609
|
+
outlineOffset: string;
|
610
|
+
};
|
611
|
+
'&>div': {
|
612
|
+
alignItems: string;
|
613
|
+
};
|
614
|
+
'&>svg': {
|
615
|
+
color: string;
|
616
|
+
fill: string;
|
617
|
+
};
|
618
|
+
'&.is-configured': {
|
619
|
+
bg: string;
|
620
|
+
borderColor: string;
|
621
|
+
'& span': {
|
622
|
+
color: string;
|
623
|
+
};
|
624
|
+
'&>svg': {
|
625
|
+
color: string;
|
626
|
+
fill: string;
|
627
|
+
};
|
628
|
+
};
|
629
|
+
'&.is-configured.is-hovered': {
|
630
|
+
bg: string;
|
631
|
+
borderColor: string;
|
632
|
+
};
|
633
|
+
'&.is-configured.is-pressed': {
|
634
|
+
bg: string;
|
635
|
+
borderColor: string;
|
636
|
+
};
|
637
|
+
};
|
567
638
|
exampleText: {
|
568
639
|
'&.is-hovered': {
|
569
640
|
textDecoration: string;
|
@@ -600,6 +671,7 @@ declare const _default: {
|
|
600
671
|
bg: string;
|
601
672
|
border: string;
|
602
673
|
borderColor: string;
|
674
|
+
display: string;
|
603
675
|
'&.is-hovered': {
|
604
676
|
bg: string;
|
605
677
|
border: string;
|
@@ -625,7 +697,6 @@ declare const _default: {
|
|
625
697
|
fontWeight: number;
|
626
698
|
color: string;
|
627
699
|
fontFamily: string;
|
628
|
-
display: string;
|
629
700
|
overflowWrap: string;
|
630
701
|
maxWidth: string;
|
631
702
|
wordWrap: string;
|
@@ -82,10 +82,11 @@ var primary = _objectSpread(_objectSpread({}, base), {}, {
|
|
82
82
|
'&.is-focused': _objectSpread({}, defaultFocus)
|
83
83
|
});
|
84
84
|
var withIcon = _objectSpread(_objectSpread({}, base), {}, {
|
85
|
-
padding: '
|
85
|
+
padding: '10px 15px 10px 10px',
|
86
86
|
bg: 'white',
|
87
87
|
border: '1px solid',
|
88
88
|
borderColor: 'active',
|
89
|
+
display: 'inline-flex',
|
89
90
|
'&.is-hovered': _objectSpread({}, defaultHover),
|
90
91
|
'&.is-pressed': _objectSpread({}, defaultActive),
|
91
92
|
'&.is-focused': _objectSpread({}, defaultFocus)
|
@@ -247,6 +248,21 @@ var colorBlock = {
|
|
247
248
|
borderColor: 'accent.20'
|
248
249
|
}
|
249
250
|
};
|
251
|
+
var colorBlockPrimary = _objectSpread(_objectSpread(_objectSpread({}, colorBlock), defaultActive), {}, {
|
252
|
+
'& span': {
|
253
|
+
color: 'white',
|
254
|
+
textAlign: 'left'
|
255
|
+
},
|
256
|
+
'&.is-hovered': _objectSpread(_objectSpread({}, defaultHover), {}, {
|
257
|
+
backgroundColor: 'accent.40',
|
258
|
+
color: 'white'
|
259
|
+
}),
|
260
|
+
'&.is-pressed': _objectSpread(_objectSpread({}, defaultActive), {}, {
|
261
|
+
backgroundColor: 'accent.20',
|
262
|
+
border: '1px solid',
|
263
|
+
borderColor: 'accent.20'
|
264
|
+
})
|
265
|
+
});
|
250
266
|
var headerBar = _objectSpread(_objectSpread({}, base), {}, {
|
251
267
|
backgroundColor: 'white',
|
252
268
|
'&.is-hovered': _objectSpread(_objectSpread({}, defaultHover), {}, {
|
@@ -286,6 +302,7 @@ var _default = {
|
|
286
302
|
quiet: quiet,
|
287
303
|
success: success,
|
288
304
|
colorBlock: colorBlock,
|
305
|
+
colorBlockPrimary: colorBlockPrimary,
|
289
306
|
exampleText: exampleText,
|
290
307
|
withIcon: withIcon,
|
291
308
|
inlineWithIcon: inlineWithIcon,
|
@@ -14,7 +14,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
|
|
14
14
|
_Object$defineProperty(exports, "__esModule", {
|
15
15
|
value: true
|
16
16
|
});
|
17
|
-
exports["default"] = exports.UnavailableDates = exports.
|
17
|
+
exports["default"] = exports.UnavailableDates = exports.MinimumDate = exports.MaximumDate = exports.Disabled = exports.DefaultValue = exports.Default = exports.Controlled = exports.Autofocus = void 0;
|
18
18
|
var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
|
19
19
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
20
20
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
@@ -142,18 +142,12 @@ var DefaultValue = function DefaultValue(args) {
|
|
142
142
|
}));
|
143
143
|
};
|
144
144
|
exports.DefaultValue = DefaultValue;
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
return (0, _react2.jsx)(_Calendar["default"], (0, _extends2["default"])({}, args, {
|
151
|
-
"aria-label": "calendar-component-controlled",
|
152
|
-
value: date,
|
153
|
-
onChange: setDate
|
154
|
-
}));
|
145
|
+
DefaultValue.parameters = {
|
146
|
+
design: {
|
147
|
+
type: 'figma',
|
148
|
+
url: _figmaLinks.FIGMA_LINKS.calendar.defaultValue
|
149
|
+
}
|
155
150
|
};
|
156
|
-
exports.Controlled = Controlled;
|
157
151
|
var Disabled = function Disabled(args) {
|
158
152
|
return (0, _react2.jsx)(_Calendar["default"], (0, _extends2["default"])({}, args, {
|
159
153
|
"aria-label": "calendar-component-disabled",
|
@@ -161,13 +155,12 @@ var Disabled = function Disabled(args) {
|
|
161
155
|
}));
|
162
156
|
};
|
163
157
|
exports.Disabled = Disabled;
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
}
|
158
|
+
Disabled.parameters = {
|
159
|
+
design: {
|
160
|
+
type: 'figma',
|
161
|
+
url: _figmaLinks.FIGMA_LINKS.calendar.disabled
|
162
|
+
}
|
169
163
|
};
|
170
|
-
exports.ReadOnly = ReadOnly;
|
171
164
|
var UnavailableDates = function UnavailableDates(args) {
|
172
165
|
var unavailableRanges = [['2022-07-29', '2022-08-05'], ['2022-08-15', '2022-08-20'], ['2022-08-25', '2022-08-26']];
|
173
166
|
// This function is run against each date in the calendar
|
@@ -183,6 +176,12 @@ var UnavailableDates = function UnavailableDates(args) {
|
|
183
176
|
}));
|
184
177
|
};
|
185
178
|
exports.UnavailableDates = UnavailableDates;
|
179
|
+
UnavailableDates.parameters = {
|
180
|
+
design: {
|
181
|
+
type: 'figma',
|
182
|
+
url: _figmaLinks.FIGMA_LINKS.calendar.unavailableDates
|
183
|
+
}
|
184
|
+
};
|
186
185
|
var MinimumDate = function MinimumDate(args) {
|
187
186
|
return (0, _react2.jsx)(_Calendar["default"], (0, _extends2["default"])({}, args, {
|
188
187
|
"aria-label": "calendar-component-min-date",
|
@@ -191,6 +190,12 @@ var MinimumDate = function MinimumDate(args) {
|
|
191
190
|
}));
|
192
191
|
};
|
193
192
|
exports.MinimumDate = MinimumDate;
|
193
|
+
MinimumDate.parameters = {
|
194
|
+
design: {
|
195
|
+
type: 'figma',
|
196
|
+
url: _figmaLinks.FIGMA_LINKS.calendar.minimumDate
|
197
|
+
}
|
198
|
+
};
|
194
199
|
var MaximumDate = function MaximumDate(args) {
|
195
200
|
return (0, _react2.jsx)(_Calendar["default"], (0, _extends2["default"])({}, args, {
|
196
201
|
"aria-label": "calendar-component-max-date",
|
@@ -199,10 +204,34 @@ var MaximumDate = function MaximumDate(args) {
|
|
199
204
|
}));
|
200
205
|
};
|
201
206
|
exports.MaximumDate = MaximumDate;
|
207
|
+
MaximumDate.parameters = {
|
208
|
+
design: {
|
209
|
+
type: 'figma',
|
210
|
+
url: _figmaLinks.FIGMA_LINKS.calendar.maximumDate
|
211
|
+
}
|
212
|
+
};
|
202
213
|
var Autofocus = function Autofocus(args) {
|
203
214
|
return (0, _react2.jsx)(_Calendar["default"], (0, _extends2["default"])({}, args, {
|
204
215
|
"aria-label": "calendar-component",
|
205
216
|
hasAutoFocus: true
|
206
217
|
}));
|
207
218
|
};
|
208
|
-
exports.Autofocus = Autofocus;
|
219
|
+
exports.Autofocus = Autofocus;
|
220
|
+
Autofocus.parameters = {
|
221
|
+
design: {
|
222
|
+
type: 'figma',
|
223
|
+
url: _figmaLinks.FIGMA_LINKS.calendar.autofocus
|
224
|
+
}
|
225
|
+
};
|
226
|
+
var Controlled = function Controlled(args) {
|
227
|
+
var _useState = (0, _react.useState)(null),
|
228
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
229
|
+
date = _useState2[0],
|
230
|
+
setDate = _useState2[1];
|
231
|
+
return (0, _react2.jsx)(_Calendar["default"], (0, _extends2["default"])({}, args, {
|
232
|
+
"aria-label": "calendar-component-controlled",
|
233
|
+
value: date,
|
234
|
+
onChange: setDate
|
235
|
+
}));
|
236
|
+
};
|
237
|
+
exports.Controlled = Controlled;
|
@@ -20,7 +20,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
|
|
20
20
|
_Object$defineProperty(exports, "__esModule", {
|
21
21
|
value: true
|
22
22
|
});
|
23
|
-
exports.
|
23
|
+
exports.renderSectionsComponent = exports.renderComponent = void 0;
|
24
24
|
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
25
25
|
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
26
26
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
|
@@ -91,18 +91,17 @@ var defaultWithSectionsProps = {
|
|
91
91
|
items: itemsWithSections
|
92
92
|
};
|
93
93
|
var onSelectionChange = jest.fn();
|
94
|
-
var
|
95
|
-
return (0,
|
94
|
+
var renderComponent = function renderComponent(props) {
|
95
|
+
return (0, _react2.jsx)(_.OverlayProvider, null, (0, _react2.jsx)(_.EnvironmentBreadcrumb, (0, _extends2["default"])({}, defaultProps, props), function (item) {
|
96
96
|
return (0, _react2.jsx)(_.Item, {
|
97
97
|
key: item.name,
|
98
98
|
"data-testid": item.name
|
99
99
|
}, item.name);
|
100
|
-
}))
|
100
|
+
}));
|
101
101
|
};
|
102
|
-
exports.
|
103
|
-
var
|
104
|
-
|
105
|
-
return (0, _testWrapper.render)((0, _react2.jsx)(_.OverlayProvider, null, (0, _react2.jsx)(_.EnvironmentBreadcrumb, (0, _extends2["default"])({}, defaultWithSectionsProps, props), function (section) {
|
102
|
+
exports.renderComponent = renderComponent;
|
103
|
+
var renderSectionsComponent = function renderSectionsComponent(props) {
|
104
|
+
return (0, _react2.jsx)(_.OverlayProvider, null, (0, _react2.jsx)(_.EnvironmentBreadcrumb, (0, _extends2["default"])({}, defaultWithSectionsProps, props), function (section) {
|
106
105
|
return (
|
107
106
|
// eslint-disable-next-line testing-library/no-node-access
|
108
107
|
(0, _react2.jsx)(_reactStately.Section, {
|
@@ -118,9 +117,16 @@ var getSectionsComponent = function getSectionsComponent() {
|
|
118
117
|
}, item.name);
|
119
118
|
})
|
120
119
|
);
|
121
|
-
}))
|
120
|
+
}));
|
121
|
+
};
|
122
|
+
exports.renderSectionsComponent = renderSectionsComponent;
|
123
|
+
var getComponent = function getComponent(props) {
|
124
|
+
return (0, _testWrapper.render)(renderComponent(props));
|
125
|
+
};
|
126
|
+
var getSectionsComponent = function getSectionsComponent() {
|
127
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
128
|
+
return (0, _testWrapper.render)(renderSectionsComponent(props));
|
122
129
|
};
|
123
|
-
exports.getSectionsComponent = getSectionsComponent;
|
124
130
|
beforeAll(function () {
|
125
131
|
jest.spyOn(window.HTMLElement.prototype, 'clientWidth', 'get').mockImplementation(function () {
|
126
132
|
return 1000;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _universalComponentTest = require("../../utils/testUtils/universalComponentTest");
|
4
|
+
var _EnvironmentBreadcrumb = require("./EnvironmentBreadcrumb.test");
|
5
|
+
(0, _universalComponentTest.universalComponentTests)({
|
6
|
+
renderComponent: _EnvironmentBreadcrumb.renderComponent
|
7
|
+
});
|
8
|
+
(0, _universalComponentTest.universalComponentTests)({
|
9
|
+
renderComponent: _EnvironmentBreadcrumb.renderSectionsComponent
|
10
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './useColumnStyles';
|
@@ -0,0 +1,11 @@
|
|
1
|
+
export type LabelMode = 'default' | 'float' | 'left';
|
2
|
+
interface UseColumnStylesProps {
|
3
|
+
labelMode: LabelMode;
|
4
|
+
}
|
5
|
+
interface LabelStyleProps {
|
6
|
+
sx: {
|
7
|
+
gridTemplateColumns: string;
|
8
|
+
};
|
9
|
+
}
|
10
|
+
declare const useColumnStyles: ({ labelMode }: UseColumnStylesProps) => LabelStyleProps;
|
11
|
+
export default useColumnStyles;
|
@@ -10,13 +10,17 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/hel
|
|
10
10
|
var _react = require("react");
|
11
11
|
var useColumnStyles = function useColumnStyles(_ref) {
|
12
12
|
var labelMode = _ref.labelMode;
|
13
|
-
var _useState = (0, _react.useState)(
|
13
|
+
var _useState = (0, _react.useState)({
|
14
|
+
sx: {
|
15
|
+
gridTemplateColumns: ''
|
16
|
+
}
|
17
|
+
}),
|
14
18
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
15
19
|
labelStyleProps = _useState2[0],
|
16
|
-
|
20
|
+
setLabelStyleProps = _useState2[1];
|
17
21
|
(0, _react.useEffect)(function () {
|
18
22
|
if (labelMode === 'left') {
|
19
|
-
|
23
|
+
setLabelStyleProps({
|
20
24
|
sx: {
|
21
25
|
gridTemplateColumns: '40% auto'
|
22
26
|
}
|
@@ -118,6 +118,8 @@ declare const useField: <T>(props: UseFieldProps<T>) => {
|
|
118
118
|
variant?: string | undefined;
|
119
119
|
as?: string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | import("react").ReactPortal | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | null | undefined;
|
120
120
|
style?: string | import("react").CSSProperties | undefined;
|
121
|
+
float?: import("theme-ui").StylePropertyValue<import("csstype").Property.Float | undefined>;
|
122
|
+
left?: import("theme-ui").StylePropertyValue<import("csstype").Property.Left<string | number> | undefined>;
|
121
123
|
grid?: import("theme-ui").StylePropertyValue<import("csstype").Property.Grid | undefined>;
|
122
124
|
accentColor?: import("theme-ui").StylePropertyValue<import("csstype").Property.AccentColor | undefined>;
|
123
125
|
alignContent?: import("theme-ui").StylePropertyValue<import("csstype").Property.AlignContent | undefined>;
|
@@ -228,7 +230,6 @@ declare const useField: <T>(props: UseFieldProps<T>) => {
|
|
228
230
|
flexGrow?: import("theme-ui").StylePropertyValue<import("csstype").Property.FlexGrow | undefined>;
|
229
231
|
flexShrink?: import("theme-ui").StylePropertyValue<import("csstype").Property.FlexShrink | undefined>;
|
230
232
|
flexWrap?: import("theme-ui").StylePropertyValue<import("csstype").Property.FlexWrap | undefined>;
|
231
|
-
float?: import("theme-ui").StylePropertyValue<import("csstype").Property.Float | undefined>;
|
232
233
|
fontFamily?: import("theme-ui").StylePropertyValue<import("csstype").Property.FontFamily | undefined>;
|
233
234
|
fontFeatureSettings?: import("theme-ui").StylePropertyValue<import("csstype").Property.FontFeatureSettings | undefined>;
|
234
235
|
fontKerning?: import("theme-ui").StylePropertyValue<import("csstype").Property.FontKerning | undefined>;
|
@@ -281,7 +282,6 @@ declare const useField: <T>(props: UseFieldProps<T>) => {
|
|
281
282
|
justifyItems?: import("theme-ui").StylePropertyValue<import("csstype").Property.JustifyItems | undefined>;
|
282
283
|
justifySelf?: import("theme-ui").StylePropertyValue<import("csstype").Property.JustifySelf | undefined>;
|
283
284
|
justifyTracks?: import("theme-ui").StylePropertyValue<import("csstype").Property.JustifyTracks | undefined>;
|
284
|
-
left?: import("theme-ui").StylePropertyValue<import("csstype").Property.Left<string | number> | undefined>;
|
285
285
|
letterSpacing?: import("theme-ui").StylePropertyValue<import("csstype").Property.LetterSpacing<string | number> | undefined>;
|
286
286
|
lineBreak?: import("theme-ui").StylePropertyValue<import("csstype").Property.LineBreak | undefined>;
|
287
287
|
lineHeight?: import("theme-ui").StylePropertyValue<import("csstype").Property.LineHeight<string | number> | undefined>;
|
@@ -1050,7 +1050,7 @@ declare const useField: <T>(props: UseFieldProps<T>) => {
|
|
1050
1050
|
onTransitionEndCapture?: import("react").TransitionEventHandler<import("../../types").FocusableElement> | undefined;
|
1051
1051
|
};
|
1052
1052
|
fieldLabelProps: {
|
1053
|
-
labelMode?: "
|
1053
|
+
labelMode?: "default" | "float" | "left" | undefined;
|
1054
1054
|
statusClasses?: {
|
1055
1055
|
[className: string]: boolean;
|
1056
1056
|
} | undefined;
|
@@ -1365,7 +1365,7 @@ declare const useField: <T>(props: UseFieldProps<T>) => {
|
|
1365
1365
|
isRequired: boolean | undefined;
|
1366
1366
|
mode: string | undefined;
|
1367
1367
|
} | {
|
1368
|
-
labelMode?: "
|
1368
|
+
labelMode?: "default" | "float" | "left" | undefined;
|
1369
1369
|
statusClasses?: {
|
1370
1370
|
[className: string]: boolean;
|
1371
1371
|
} | undefined;
|
@@ -4,6 +4,7 @@ import { SelectState } from 'react-stately';
|
|
4
4
|
import { CollectionChildren } from '@react-types/shared';
|
5
5
|
import { LabelProps as ThemeUILabelProps } from 'theme-ui';
|
6
6
|
import { Axis, BoxProps, FocusableElement, PlacementAxis, ReactRef, StyleProps } from '../../types';
|
7
|
+
import { LabelMode } from '../useColumnStyles/useColumnStyles';
|
7
8
|
import { FieldControlInputProps } from '../useField/useField';
|
8
9
|
interface UseSelectFieldProps<T> {
|
9
10
|
children: CollectionChildren<T>;
|
@@ -34,7 +35,7 @@ interface UseSelectFieldProps<T> {
|
|
34
35
|
listBoxProps?: BoxProps;
|
35
36
|
labelProps?: ThemeUILabelProps;
|
36
37
|
containerProps?: BoxProps;
|
37
|
-
labelMode:
|
38
|
+
labelMode: LabelMode;
|
38
39
|
}
|
39
40
|
interface UseSelectFieldReturnProps {
|
40
41
|
columnStyleProps: StyleProps;
|
@@ -34,7 +34,13 @@ var FIGMA_LINKS = {
|
|
34
34
|
overflowing: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=45064-7148&mode=design&t=0RGDgLyKBzT6bOXO-0'
|
35
35
|
},
|
36
36
|
button: {
|
37
|
-
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=
|
37
|
+
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=44916%3A47047&mode=dev',
|
38
|
+
disabled: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=45003%3A54887&mode=dev',
|
39
|
+
textIconButton: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=45003%3A54941&mode=dev',
|
40
|
+
inlineButton: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=44916%3A47247&mode=dev',
|
41
|
+
colorBlockButton: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=44916%3A47405&mode=dev',
|
42
|
+
critical: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=44916%3A47237&mode=dev',
|
43
|
+
primary: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=44916%3A47151&mode=dev'
|
38
44
|
},
|
39
45
|
buttonBar: {
|
40
46
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=46080%3A753&mode=dev',
|
@@ -43,7 +49,13 @@ var FIGMA_LINKS = {
|
|
43
49
|
secondaryRightAligned: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=46080%3A788&mode=dev'
|
44
50
|
},
|
45
51
|
calendar: {
|
46
|
-
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=
|
52
|
+
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=47640-5789&mode=design&t=SZGzEV7PufQjYBN5-4',
|
53
|
+
defaultValue: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-14593&mode=design&t=PX1Q47IuuVvOafDQ-4',
|
54
|
+
disabled: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-15106&mode=design&t=PX1Q47IuuVvOafDQ-4',
|
55
|
+
unavailableDates: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-15681&mode=design&t=PX1Q47IuuVvOafDQ-4',
|
56
|
+
minimumDate: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-16197&mode=design&t=PX1Q47IuuVvOafDQ-4',
|
57
|
+
maximumDate: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-16454&mode=design&t=PX1Q47IuuVvOafDQ-4',
|
58
|
+
autofocus: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-16768&mode=design&t=PX1Q47IuuVvOafDQ-4'
|
47
59
|
},
|
48
60
|
callout: {
|
49
61
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=14289-33201&t=VgqEexa1CXAXfPpp-0'
|
@@ -51,68 +51,109 @@ Default.parameters = {
|
|
51
51
|
url: FIGMA_LINKS.button["default"]
|
52
52
|
}
|
53
53
|
};
|
54
|
-
export var
|
54
|
+
export var Primary = function Primary() {
|
55
55
|
return ___EmotionJSX(Button, {
|
56
|
-
|
56
|
+
variant: "primary"
|
57
57
|
}, "Button Text");
|
58
58
|
};
|
59
|
-
|
59
|
+
Primary.parameters = {
|
60
|
+
design: {
|
61
|
+
type: 'figma',
|
62
|
+
url: FIGMA_LINKS.button.primary
|
63
|
+
}
|
64
|
+
};
|
65
|
+
export var Critical = function Critical() {
|
60
66
|
return ___EmotionJSX(Button, {
|
67
|
+
variant: "critical"
|
68
|
+
}, "Button Text");
|
69
|
+
};
|
70
|
+
Critical.parameters = {
|
71
|
+
design: {
|
72
|
+
type: 'figma',
|
73
|
+
url: FIGMA_LINKS.button.critical
|
74
|
+
}
|
75
|
+
};
|
76
|
+
export var InlineButton = function InlineButton() {
|
77
|
+
return ___EmotionJSX(Box, null, ___EmotionJSX(Button, {
|
78
|
+
mb: "sm",
|
79
|
+
mr: "auto",
|
80
|
+
variant: "inline"
|
81
|
+
}, "Button Text"), ___EmotionJSX(Button, {
|
82
|
+
mb: "sm",
|
83
|
+
mr: "auto",
|
84
|
+
variant: "inlinePrimary"
|
85
|
+
}, "Button Text"));
|
86
|
+
};
|
87
|
+
InlineButton.parameters = {
|
88
|
+
design: {
|
89
|
+
type: 'figma',
|
90
|
+
url: FIGMA_LINKS.button.inlineButton
|
91
|
+
}
|
92
|
+
};
|
93
|
+
export var TextIconButton = function TextIconButton() {
|
94
|
+
return ___EmotionJSX(Box, {
|
95
|
+
width: 20
|
96
|
+
}, ___EmotionJSX(Button, {
|
61
97
|
mb: "sm",
|
62
98
|
variant: "withIcon"
|
63
|
-
}, ___EmotionJSX(Box, {
|
64
|
-
isRow: true,
|
65
|
-
alignItems: "center"
|
66
99
|
}, ___EmotionJSX(Icon, {
|
67
100
|
icon: PlusIcon,
|
68
101
|
mr: "xs",
|
69
|
-
color: "
|
102
|
+
color: "accent.30",
|
70
103
|
size: 20,
|
71
104
|
title: {
|
72
105
|
name: 'Add Circle Icon'
|
73
106
|
}
|
74
|
-
}), "
|
75
|
-
};
|
76
|
-
export var InlineButton = function InlineButton() {
|
77
|
-
return ___EmotionJSX(Box, null, ___EmotionJSX(Button, {
|
78
|
-
mb: "sm",
|
79
|
-
mr: "auto",
|
80
|
-
variant: "inline"
|
81
|
-
}, "Inline"), ___EmotionJSX(Button, {
|
107
|
+
}), "Button Text"), ___EmotionJSX(Button, {
|
82
108
|
mb: "sm",
|
83
109
|
mr: "auto",
|
84
110
|
variant: "inlineWithIcon"
|
85
111
|
}, ___EmotionJSX(Icon, {
|
86
112
|
icon: PlusIcon,
|
87
113
|
mr: "xs",
|
88
|
-
color: "
|
114
|
+
color: "accent.30",
|
89
115
|
size: 15,
|
90
116
|
title: {
|
91
117
|
name: 'Add Circle Icon'
|
92
118
|
}
|
93
|
-
}), "
|
94
|
-
mb: "sm",
|
95
|
-
mr: "auto",
|
96
|
-
variant: "inlinePrimary"
|
97
|
-
}, "Inline primary"), ___EmotionJSX(Button, {
|
119
|
+
}), "Button Text"), ___EmotionJSX(Button, {
|
98
120
|
mb: "sm",
|
99
121
|
mr: "auto",
|
100
122
|
variant: "inlinePrimaryWithIcon"
|
101
123
|
}, ___EmotionJSX(Icon, {
|
102
124
|
icon: PlusIcon,
|
103
125
|
mr: "xs",
|
104
|
-
color: "
|
126
|
+
color: "accent.30",
|
105
127
|
size: 15,
|
106
128
|
title: {
|
107
129
|
name: 'Add Circle Icon'
|
108
130
|
}
|
109
|
-
}), "
|
131
|
+
}), "Button Text"));
|
132
|
+
};
|
133
|
+
TextIconButton.parameters = {
|
134
|
+
design: {
|
135
|
+
type: 'figma',
|
136
|
+
url: FIGMA_LINKS.button.textIconButton
|
137
|
+
}
|
138
|
+
};
|
139
|
+
export var Disabled = function Disabled() {
|
140
|
+
return ___EmotionJSX(Button, {
|
141
|
+
isDisabled: true
|
142
|
+
}, "Button Text");
|
143
|
+
};
|
144
|
+
Disabled.parameters = {
|
145
|
+
design: {
|
146
|
+
type: 'figma',
|
147
|
+
url: FIGMA_LINKS.button.disabled
|
148
|
+
}
|
110
149
|
};
|
111
150
|
export var ColorBlockButton = function ColorBlockButton(args) {
|
112
151
|
// Change `isConfigured` property in storybook controls
|
113
152
|
var isConfigured = args.isConfigured,
|
114
153
|
props = _objectWithoutProperties(args, _excluded);
|
115
|
-
return ___EmotionJSX(
|
154
|
+
return ___EmotionJSX(Box, null, ___EmotionJSX(Button, _extends({
|
155
|
+
mb: "sm"
|
156
|
+
}, props, {
|
116
157
|
variant: "colorBlock",
|
117
158
|
className: isConfigured ? 'is-configured' : ''
|
118
159
|
}), ___EmotionJSX(Box, null, ___EmotionJSX(Text, {
|
@@ -124,7 +165,19 @@ export var ColorBlockButton = function ColorBlockButton(args) {
|
|
124
165
|
title: {
|
125
166
|
name: 'Create Icon'
|
126
167
|
}
|
127
|
-
}))
|
168
|
+
})), ___EmotionJSX(Button, _extends({}, props, {
|
169
|
+
variant: "colorBlockPrimary",
|
170
|
+
className: isConfigured ? 'is-configured' : ''
|
171
|
+
}), ___EmotionJSX(Box, null, ___EmotionJSX(Text, {
|
172
|
+
variant: "buttonTitle"
|
173
|
+
}, "Title"), ___EmotionJSX(Text, {
|
174
|
+
variant: "buttonSubtitle"
|
175
|
+
}, "Info")), ___EmotionJSX(Icon, {
|
176
|
+
icon: CreateIcon,
|
177
|
+
title: {
|
178
|
+
name: 'Create Icon'
|
179
|
+
}
|
180
|
+
})));
|
128
181
|
};
|
129
182
|
ColorBlockButton.argTypes = {
|
130
183
|
isConfigured: {
|
@@ -134,13 +187,9 @@ ColorBlockButton.argTypes = {
|
|
134
187
|
defaultValue: false
|
135
188
|
}
|
136
189
|
};
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
}
|
142
|
-
export var Primary = function Primary() {
|
143
|
-
return ___EmotionJSX(Button, {
|
144
|
-
variant: "primary"
|
145
|
-
}, "Button Text");
|
190
|
+
ColorBlockButton.parameters = {
|
191
|
+
design: {
|
192
|
+
type: 'figma',
|
193
|
+
url: FIGMA_LINKS.button.colorBlockButton
|
194
|
+
}
|
146
195
|
};
|
@@ -72,10 +72,11 @@ var primary = _objectSpread(_objectSpread({}, base), {}, {
|
|
72
72
|
'&.is-focused': _objectSpread({}, defaultFocus)
|
73
73
|
});
|
74
74
|
var withIcon = _objectSpread(_objectSpread({}, base), {}, {
|
75
|
-
padding: '
|
75
|
+
padding: '10px 15px 10px 10px',
|
76
76
|
bg: 'white',
|
77
77
|
border: '1px solid',
|
78
78
|
borderColor: 'active',
|
79
|
+
display: 'inline-flex',
|
79
80
|
'&.is-hovered': _objectSpread({}, defaultHover),
|
80
81
|
'&.is-pressed': _objectSpread({}, defaultActive),
|
81
82
|
'&.is-focused': _objectSpread({}, defaultFocus)
|
@@ -234,6 +235,21 @@ var colorBlock = {
|
|
234
235
|
borderColor: 'accent.20'
|
235
236
|
}
|
236
237
|
};
|
238
|
+
var colorBlockPrimary = _objectSpread(_objectSpread(_objectSpread({}, colorBlock), defaultActive), {}, {
|
239
|
+
'& span': {
|
240
|
+
color: 'white',
|
241
|
+
textAlign: 'left'
|
242
|
+
},
|
243
|
+
'&.is-hovered': _objectSpread(_objectSpread({}, defaultHover), {}, {
|
244
|
+
backgroundColor: 'accent.40',
|
245
|
+
color: 'white'
|
246
|
+
}),
|
247
|
+
'&.is-pressed': _objectSpread(_objectSpread({}, defaultActive), {}, {
|
248
|
+
backgroundColor: 'accent.20',
|
249
|
+
border: '1px solid',
|
250
|
+
borderColor: 'accent.20'
|
251
|
+
})
|
252
|
+
});
|
237
253
|
var headerBar = _objectSpread(_objectSpread({}, base), {}, {
|
238
254
|
backgroundColor: 'white',
|
239
255
|
'&.is-hovered': _objectSpread(_objectSpread({}, defaultHover), {}, {
|
@@ -273,6 +289,7 @@ export default {
|
|
273
289
|
quiet: quiet,
|
274
290
|
success: success,
|
275
291
|
colorBlock: colorBlock,
|
292
|
+
colorBlockPrimary: colorBlockPrimary,
|
276
293
|
exampleText: exampleText,
|
277
294
|
withIcon: withIcon,
|
278
295
|
inlineWithIcon: inlineWithIcon,
|
@@ -128,16 +128,11 @@ export var DefaultValue = function DefaultValue(args) {
|
|
128
128
|
defaultValue: "2022-08-10"
|
129
129
|
}));
|
130
130
|
};
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
return ___EmotionJSX(Calendar, _extends({}, args, {
|
137
|
-
"aria-label": "calendar-component-controlled",
|
138
|
-
value: date,
|
139
|
-
onChange: setDate
|
140
|
-
}));
|
131
|
+
DefaultValue.parameters = {
|
132
|
+
design: {
|
133
|
+
type: 'figma',
|
134
|
+
url: FIGMA_LINKS.calendar.defaultValue
|
135
|
+
}
|
141
136
|
};
|
142
137
|
export var Disabled = function Disabled(args) {
|
143
138
|
return ___EmotionJSX(Calendar, _extends({}, args, {
|
@@ -145,11 +140,11 @@ export var Disabled = function Disabled(args) {
|
|
145
140
|
isDisabled: true
|
146
141
|
}));
|
147
142
|
};
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
}
|
143
|
+
Disabled.parameters = {
|
144
|
+
design: {
|
145
|
+
type: 'figma',
|
146
|
+
url: FIGMA_LINKS.calendar.disabled
|
147
|
+
}
|
153
148
|
};
|
154
149
|
export var UnavailableDates = function UnavailableDates(args) {
|
155
150
|
var unavailableRanges = [['2022-07-29', '2022-08-05'], ['2022-08-15', '2022-08-20'], ['2022-08-25', '2022-08-26']];
|
@@ -165,6 +160,12 @@ export var UnavailableDates = function UnavailableDates(args) {
|
|
165
160
|
isDateUnavailable: isDateUnavailable
|
166
161
|
}));
|
167
162
|
};
|
163
|
+
UnavailableDates.parameters = {
|
164
|
+
design: {
|
165
|
+
type: 'figma',
|
166
|
+
url: FIGMA_LINKS.calendar.unavailableDates
|
167
|
+
}
|
168
|
+
};
|
168
169
|
export var MinimumDate = function MinimumDate(args) {
|
169
170
|
return ___EmotionJSX(Calendar, _extends({}, args, {
|
170
171
|
"aria-label": "calendar-component-min-date",
|
@@ -172,6 +173,12 @@ export var MinimumDate = function MinimumDate(args) {
|
|
172
173
|
defaultDate: "2022-09-14"
|
173
174
|
}));
|
174
175
|
};
|
176
|
+
MinimumDate.parameters = {
|
177
|
+
design: {
|
178
|
+
type: 'figma',
|
179
|
+
url: FIGMA_LINKS.calendar.minimumDate
|
180
|
+
}
|
181
|
+
};
|
175
182
|
export var MaximumDate = function MaximumDate(args) {
|
176
183
|
return ___EmotionJSX(Calendar, _extends({}, args, {
|
177
184
|
"aria-label": "calendar-component-max-date",
|
@@ -179,9 +186,32 @@ export var MaximumDate = function MaximumDate(args) {
|
|
179
186
|
defaultValue: "2022-10-05"
|
180
187
|
}));
|
181
188
|
};
|
189
|
+
MaximumDate.parameters = {
|
190
|
+
design: {
|
191
|
+
type: 'figma',
|
192
|
+
url: FIGMA_LINKS.calendar.maximumDate
|
193
|
+
}
|
194
|
+
};
|
182
195
|
export var Autofocus = function Autofocus(args) {
|
183
196
|
return ___EmotionJSX(Calendar, _extends({}, args, {
|
184
197
|
"aria-label": "calendar-component",
|
185
198
|
hasAutoFocus: true
|
186
199
|
}));
|
200
|
+
};
|
201
|
+
Autofocus.parameters = {
|
202
|
+
design: {
|
203
|
+
type: 'figma',
|
204
|
+
url: FIGMA_LINKS.calendar.autofocus
|
205
|
+
}
|
206
|
+
};
|
207
|
+
export var Controlled = function Controlled(args) {
|
208
|
+
var _useState = useState(null),
|
209
|
+
_useState2 = _slicedToArray(_useState, 2),
|
210
|
+
date = _useState2[0],
|
211
|
+
setDate = _useState2[1];
|
212
|
+
return ___EmotionJSX(Calendar, _extends({}, args, {
|
213
|
+
"aria-label": "calendar-component-controlled",
|
214
|
+
value: date,
|
215
|
+
onChange: setDate
|
216
|
+
}));
|
187
217
|
};
|
@@ -83,17 +83,16 @@ var defaultWithSectionsProps = {
|
|
83
83
|
items: itemsWithSections
|
84
84
|
};
|
85
85
|
var onSelectionChange = jest.fn();
|
86
|
-
export var
|
87
|
-
return
|
86
|
+
export var renderComponent = function renderComponent(props) {
|
87
|
+
return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(EnvironmentBreadcrumb, _extends({}, defaultProps, props), function (item) {
|
88
88
|
return ___EmotionJSX(Item, {
|
89
89
|
key: item.name,
|
90
90
|
"data-testid": item.name
|
91
91
|
}, item.name);
|
92
|
-
}))
|
92
|
+
}));
|
93
93
|
};
|
94
|
-
export var
|
95
|
-
|
96
|
-
return render(___EmotionJSX(OverlayProvider, null, ___EmotionJSX(EnvironmentBreadcrumb, _extends({}, defaultWithSectionsProps, props), function (section) {
|
94
|
+
export var renderSectionsComponent = function renderSectionsComponent(props) {
|
95
|
+
return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(EnvironmentBreadcrumb, _extends({}, defaultWithSectionsProps, props), function (section) {
|
97
96
|
return (
|
98
97
|
// eslint-disable-next-line testing-library/no-node-access
|
99
98
|
___EmotionJSX(Section, {
|
@@ -109,7 +108,14 @@ export var getSectionsComponent = function getSectionsComponent() {
|
|
109
108
|
}, item.name);
|
110
109
|
})
|
111
110
|
);
|
112
|
-
}))
|
111
|
+
}));
|
112
|
+
};
|
113
|
+
var getComponent = function getComponent(props) {
|
114
|
+
return render(renderComponent(props));
|
115
|
+
};
|
116
|
+
var getSectionsComponent = function getSectionsComponent() {
|
117
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
118
|
+
return render(renderSectionsComponent(props));
|
113
119
|
};
|
114
120
|
beforeAll(function () {
|
115
121
|
jest.spyOn(window.HTMLElement.prototype, 'clientWidth', 'get').mockImplementation(function () {
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { universalComponentTests } from '../../utils/testUtils/universalComponentTest';
|
2
|
+
import { renderComponent, renderSectionsComponent } from './EnvironmentBreadcrumb.test';
|
3
|
+
universalComponentTests({
|
4
|
+
renderComponent: renderComponent
|
5
|
+
});
|
6
|
+
universalComponentTests({
|
7
|
+
renderComponent: renderSectionsComponent
|
8
|
+
});
|
@@ -2,13 +2,17 @@ import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
|
2
2
|
import { useEffect, useState } from 'react';
|
3
3
|
var useColumnStyles = function useColumnStyles(_ref) {
|
4
4
|
var labelMode = _ref.labelMode;
|
5
|
-
var _useState = useState(
|
5
|
+
var _useState = useState({
|
6
|
+
sx: {
|
7
|
+
gridTemplateColumns: ''
|
8
|
+
}
|
9
|
+
}),
|
6
10
|
_useState2 = _slicedToArray(_useState, 2),
|
7
11
|
labelStyleProps = _useState2[0],
|
8
|
-
|
12
|
+
setLabelStyleProps = _useState2[1];
|
9
13
|
useEffect(function () {
|
10
14
|
if (labelMode === 'left') {
|
11
|
-
|
15
|
+
setLabelStyleProps({
|
12
16
|
sx: {
|
13
17
|
gridTemplateColumns: '40% auto'
|
14
18
|
}
|
@@ -27,7 +27,13 @@ export var FIGMA_LINKS = {
|
|
27
27
|
overflowing: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=45064-7148&mode=design&t=0RGDgLyKBzT6bOXO-0'
|
28
28
|
},
|
29
29
|
button: {
|
30
|
-
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=
|
30
|
+
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=44916%3A47047&mode=dev',
|
31
|
+
disabled: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=45003%3A54887&mode=dev',
|
32
|
+
textIconButton: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=45003%3A54941&mode=dev',
|
33
|
+
inlineButton: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=44916%3A47247&mode=dev',
|
34
|
+
colorBlockButton: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=44916%3A47405&mode=dev',
|
35
|
+
critical: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=44916%3A47237&mode=dev',
|
36
|
+
primary: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=44916%3A47151&mode=dev'
|
31
37
|
},
|
32
38
|
buttonBar: {
|
33
39
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=46080%3A753&mode=dev',
|
@@ -36,7 +42,13 @@ export var FIGMA_LINKS = {
|
|
36
42
|
secondaryRightAligned: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=46080%3A788&mode=dev'
|
37
43
|
},
|
38
44
|
calendar: {
|
39
|
-
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=
|
45
|
+
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=47640-5789&mode=design&t=SZGzEV7PufQjYBN5-4',
|
46
|
+
defaultValue: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-14593&mode=design&t=PX1Q47IuuVvOafDQ-4',
|
47
|
+
disabled: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-15106&mode=design&t=PX1Q47IuuVvOafDQ-4',
|
48
|
+
unavailableDates: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-15681&mode=design&t=PX1Q47IuuVvOafDQ-4',
|
49
|
+
minimumDate: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-16197&mode=design&t=PX1Q47IuuVvOafDQ-4',
|
50
|
+
maximumDate: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-16454&mode=design&t=PX1Q47IuuVvOafDQ-4',
|
51
|
+
autofocus: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-16768&mode=design&t=PX1Q47IuuVvOafDQ-4'
|
40
52
|
},
|
41
53
|
callout: {
|
42
54
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=14289-33201&t=VgqEexa1CXAXfPpp-0'
|
package/package.json
CHANGED
@@ -1,7 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
4
|
-
var _testAxe = _interopRequireDefault(require("../../utils/testUtils/testAxe"));
|
5
|
-
var _EnvironmentBreadcrumb = require("./EnvironmentBreadcrumb.test");
|
6
|
-
(0, _testAxe["default"])(_EnvironmentBreadcrumb.getComponent);
|
7
|
-
(0, _testAxe["default"])(_EnvironmentBreadcrumb.getSectionsComponent);
|