@pingux/astro 2.36.0-alpha.1 → 2.36.0-alpha.3
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/Badge/Badge.d.ts +4 -0
- package/lib/cjs/components/Badge/Badge.js +5 -31
- package/lib/cjs/components/Badge/Badge.stories.js +1 -1
- package/lib/cjs/components/Badge/Badge.styles.d.ts +781 -0
- package/lib/cjs/components/Badge/Badge.test.d.ts +1 -0
- package/lib/cjs/components/Badge/index.d.ts +1 -0
- package/lib/cjs/components/Box/Box.stories.js +1 -1
- 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/context/BadgeContext/index.d.ts +2 -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 +20 -20
- package/lib/cjs/hooks/useRockerButton/useRockerButton.d.ts +3 -3
- package/lib/cjs/hooks/useSelectField/useSelectField.d.ts +2 -1
- package/lib/cjs/styles/ColorDocumentation.js +1 -1
- package/lib/cjs/styles/colors.d.ts +302 -0
- package/lib/cjs/types/badge.d.ts +27 -0
- package/lib/cjs/types/badge.js +6 -0
- package/lib/cjs/types/index.d.ts +1 -0
- package/lib/cjs/types/index.js +21 -10
- package/lib/cjs/utils/designUtils/figmaLinks.js +14 -2
- package/lib/components/Badge/Badge.js +5 -31
- package/lib/components/Badge/Badge.stories.js +1 -1
- package/lib/components/Box/Box.stories.js +1 -1
- 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/styles/ColorDocumentation.js +1 -1
- package/lib/types/badge.js +1 -0
- package/lib/types/index.js +1 -0
- package/lib/utils/designUtils/figmaLinks.js +14 -2
- package/package.json +2 -1
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumbAxe.test.js +0 -7
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumbAxe.test.js +0 -4
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './Badge';
|
@@ -13,7 +13,7 @@ var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
14
14
|
var _storybookDocsLayout = _interopRequireDefault(require("../../../.storybook/storybookDocsLayout"));
|
15
15
|
var _index = require("../../index");
|
16
|
-
var _colors = require("../../styles/colors
|
16
|
+
var _colors = require("../../styles/colors");
|
17
17
|
var _htmlElements = require("../../utils/devUtils/constants/htmlElements");
|
18
18
|
var _images = require("../../utils/devUtils/constants/images");
|
19
19
|
var _Box = _interopRequireDefault(require("./Box.mdx"));
|
@@ -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
|
}
|