@pingux/astro 2.103.0 → 2.104.0-alpha.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/lib/cjs/components/Calendar/Calendar.js +11 -6
- package/lib/cjs/components/Calendar/Calendar.styles.d.ts +3 -1
- package/lib/cjs/components/Calendar/Calendar.styles.js +5 -1
- package/lib/cjs/components/DatePicker/DatePicker.stories.js +77 -9
- package/lib/cjs/utils/designUtils/figmaLinks.d.ts +13 -0
- package/lib/cjs/utils/designUtils/figmaLinks.js +13 -0
- package/lib/components/Calendar/Calendar.js +11 -6
- package/lib/components/Calendar/Calendar.styles.js +5 -1
- package/lib/components/DatePicker/DatePicker.stories.js +75 -6
- package/lib/utils/designUtils/figmaLinks.js +13 -0
- package/package.json +1 -1
- package/lib/cjs/components/Calendar/Calendar.stories.d.ts +0 -212
- package/lib/cjs/components/Calendar/Calendar.stories.js +0 -225
- package/lib/components/Calendar/Calendar.stories.js +0 -206
@@ -112,7 +112,8 @@ var Calendar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
112
112
|
variant: "itemTitle",
|
113
113
|
role: "heading",
|
114
114
|
"aria-level": 3,
|
115
|
-
fontWeight: 3
|
115
|
+
fontWeight: 3,
|
116
|
+
flex: 1
|
116
117
|
}, title);
|
117
118
|
return (0, _react2.jsx)(_index.Box, (0, _extends2["default"])({}, calendarProps, {
|
118
119
|
ref: calenderRef,
|
@@ -131,27 +132,30 @@ var Calendar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
131
132
|
return handleYearSelection(nav.PREVIOUS);
|
132
133
|
},
|
133
134
|
mx: "sm",
|
135
|
+
p: 0,
|
134
136
|
isDisabled: prevButtonProps.isDisabled,
|
135
137
|
"aria-label": "Previous year navigation"
|
136
138
|
}, (0, _react2.jsx)(_index.Icon, {
|
137
139
|
icon: _ChevronDoubleLeftIcon["default"],
|
138
|
-
size:
|
140
|
+
size: 25,
|
139
141
|
title: {
|
140
142
|
name: 'Chevron Double Left Icon'
|
141
143
|
}
|
142
144
|
})), (0, _react2.jsx)(_index.IconButton, (0, _extends2["default"])({}, prevButtonProps, {
|
143
|
-
"aria-label": "Previous month navigation"
|
145
|
+
"aria-label": "Previous month navigation",
|
146
|
+
p: 0
|
144
147
|
}), (0, _react2.jsx)(_index.Icon, {
|
145
148
|
icon: _ChevronLeftIcon["default"],
|
146
|
-
size:
|
149
|
+
size: 25,
|
147
150
|
title: {
|
148
151
|
name: 'Chevron Left Icon'
|
149
152
|
}
|
150
153
|
})), renderTitle, (0, _react2.jsx)(_index.IconButton, (0, _extends2["default"])({}, nextButtonProps, {
|
154
|
+
p: 0,
|
151
155
|
"aria-label": "Next month navigation"
|
152
156
|
}), (0, _react2.jsx)(_index.Icon, {
|
153
157
|
icon: _ChevronRightIcon["default"],
|
154
|
-
size:
|
158
|
+
size: 25,
|
155
159
|
title: {
|
156
160
|
name: 'Chevron Right Icon'
|
157
161
|
}
|
@@ -161,11 +165,12 @@ var Calendar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
161
165
|
return handleYearSelection(nav.NEXT);
|
162
166
|
},
|
163
167
|
mx: "sm",
|
168
|
+
p: 0,
|
164
169
|
isDisabled: nextButtonProps.isDisabled,
|
165
170
|
"aria-label": "Next year navigation"
|
166
171
|
}, (0, _react2.jsx)(_index.Icon, {
|
167
172
|
icon: _ChevronDoubleRightIcon["default"],
|
168
|
-
size:
|
173
|
+
size: 25,
|
169
174
|
title: {
|
170
175
|
name: 'Chevron Double Right Icon'
|
171
176
|
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
declare const _default: {
|
2
2
|
calendarBody: {
|
3
3
|
pb: string;
|
4
|
+
px: string;
|
4
5
|
borderTop: string;
|
5
6
|
borderTopColor: string;
|
6
7
|
'& > tr:nth-of-type(odd) ': {
|
@@ -26,9 +27,10 @@ declare const _default: {
|
|
26
27
|
boxShadow: string;
|
27
28
|
};
|
28
29
|
'&.is-focused': {
|
30
|
+
outlineOffset: string;
|
31
|
+
zIndex: number;
|
29
32
|
outline: string;
|
30
33
|
outlineColor: string;
|
31
|
-
outlineOffset: string;
|
32
34
|
};
|
33
35
|
'&.is-unavailable': {
|
34
36
|
backgroundColor: string;
|
@@ -19,6 +19,7 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
|
|
19
19
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
20
20
|
var calendarBody = {
|
21
21
|
pb: '10px',
|
22
|
+
px: '1px',
|
22
23
|
borderTop: '1px solid',
|
23
24
|
borderTopColor: 'neutral.80',
|
24
25
|
'& > tr:nth-of-type(odd) ': {
|
@@ -43,7 +44,10 @@ var calendarButton = {
|
|
43
44
|
outline: 'none',
|
44
45
|
boxShadow: 'none'
|
45
46
|
},
|
46
|
-
'&.is-focused': _objectSpread({}, _Buttons.defaultFocus),
|
47
|
+
'&.is-focused': _objectSpread(_objectSpread({}, _Buttons.defaultFocus), {}, {
|
48
|
+
outlineOffset: '0px',
|
49
|
+
zIndex: 1
|
50
|
+
}),
|
47
51
|
'&.is-unavailable': {
|
48
52
|
backgroundColor: 'neutral.80'
|
49
53
|
},
|
@@ -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.Required = exports.ReadOnly = exports.MinimumDate = exports.MaximumDate = exports.FormatHelperText = exports.Error = exports.Disabled = exports.DefaultValue = exports.DefaultOpen = exports.Default = exports.Controlled = void 0;
|
18
18
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
19
19
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
20
20
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
@@ -24,6 +24,7 @@ var _utils = require("@react-aria/utils");
|
|
24
24
|
var _addonActions = require("@storybook/addon-actions");
|
25
25
|
var _storybookDocsLayout = _interopRequireDefault(require("../../../.storybook/storybookDocsLayout"));
|
26
26
|
var _index = require("../../index");
|
27
|
+
var _figmaLinks = require("../../utils/designUtils/figmaLinks");
|
27
28
|
var _ariaAttributes = require("../../utils/docUtils/ariaAttributes");
|
28
29
|
var _DatePicker = _interopRequireDefault(require("./DatePicker"));
|
29
30
|
var _DatePicker2 = _interopRequireDefault(require("./DatePicker.mdx"));
|
@@ -43,6 +44,14 @@ var _default = {
|
|
43
44
|
page: function page() {
|
44
45
|
return (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_DatePicker2["default"], null), (0, _react2.jsx)(_storybookDocsLayout["default"], null));
|
45
46
|
}
|
47
|
+
},
|
48
|
+
a11y: {
|
49
|
+
config: {
|
50
|
+
rules: [{
|
51
|
+
id: 'color-contrast',
|
52
|
+
enabled: false
|
53
|
+
}]
|
54
|
+
}
|
46
55
|
}
|
47
56
|
},
|
48
57
|
argTypes: _objectSpread({
|
@@ -106,7 +115,7 @@ var _default = {
|
|
106
115
|
isDisabled: false,
|
107
116
|
isReadOnly: false,
|
108
117
|
isRequired: false,
|
109
|
-
label: 'Example
|
118
|
+
label: 'Example Label',
|
110
119
|
onChange: null
|
111
120
|
}
|
112
121
|
};
|
@@ -115,12 +124,24 @@ var Default = function Default(args) {
|
|
115
124
|
return (0, _react2.jsx)(_DatePicker["default"], args);
|
116
125
|
};
|
117
126
|
exports.Default = Default;
|
127
|
+
Default.parameters = {
|
128
|
+
design: {
|
129
|
+
type: 'figma',
|
130
|
+
url: _figmaLinks.FIGMA_LINKS.datePicker["default"]
|
131
|
+
}
|
132
|
+
};
|
118
133
|
var DefaultValue = function DefaultValue(args) {
|
119
134
|
return (0, _react2.jsx)(_DatePicker["default"], (0, _extends2["default"])({}, args, {
|
120
135
|
defaultValue: "2030-01-15"
|
121
136
|
}));
|
122
137
|
};
|
123
138
|
exports.DefaultValue = DefaultValue;
|
139
|
+
DefaultValue.parameters = {
|
140
|
+
design: {
|
141
|
+
type: 'figma',
|
142
|
+
url: _figmaLinks.FIGMA_LINKS.datePicker.defaultValue
|
143
|
+
}
|
144
|
+
};
|
124
145
|
var Controlled = function Controlled(args) {
|
125
146
|
var _useState = (0, _react.useState)(null),
|
126
147
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
@@ -150,12 +171,24 @@ var Disabled = function Disabled(args) {
|
|
150
171
|
}));
|
151
172
|
};
|
152
173
|
exports.Disabled = Disabled;
|
174
|
+
Disabled.parameters = {
|
175
|
+
design: {
|
176
|
+
type: 'figma',
|
177
|
+
url: _figmaLinks.FIGMA_LINKS.datePicker.disabled
|
178
|
+
}
|
179
|
+
};
|
153
180
|
var ReadOnly = function ReadOnly(args) {
|
154
181
|
return (0, _react2.jsx)(_DatePicker["default"], (0, _extends2["default"])({}, args, {
|
155
182
|
isReadOnly: true
|
156
183
|
}));
|
157
184
|
};
|
158
185
|
exports.ReadOnly = ReadOnly;
|
186
|
+
ReadOnly.parameters = {
|
187
|
+
design: {
|
188
|
+
type: 'figma',
|
189
|
+
url: _figmaLinks.FIGMA_LINKS.datePicker.readOnly
|
190
|
+
}
|
191
|
+
};
|
159
192
|
var UnavailableDates = function UnavailableDates(args) {
|
160
193
|
var unavailableRanges = [['2030-07-28', '2030-08-03'], ['2030-08-11', '2030-08-17'], ['2030-08-25', '2030-08-31']];
|
161
194
|
return (0, _react2.jsx)(_DatePicker["default"], (0, _extends2["default"])({}, args, {
|
@@ -164,6 +197,12 @@ var UnavailableDates = function UnavailableDates(args) {
|
|
164
197
|
}));
|
165
198
|
};
|
166
199
|
exports.UnavailableDates = UnavailableDates;
|
200
|
+
UnavailableDates.parameters = {
|
201
|
+
design: {
|
202
|
+
type: 'figma',
|
203
|
+
url: _figmaLinks.FIGMA_LINKS.datePicker.unavailableDates
|
204
|
+
}
|
205
|
+
};
|
167
206
|
var MinimumDate = function MinimumDate(args) {
|
168
207
|
return (0, _react2.jsx)(_DatePicker["default"], (0, _extends2["default"])({}, args, {
|
169
208
|
defaultValue: "2030-01-15",
|
@@ -171,6 +210,12 @@ var MinimumDate = function MinimumDate(args) {
|
|
171
210
|
}));
|
172
211
|
};
|
173
212
|
exports.MinimumDate = MinimumDate;
|
213
|
+
MinimumDate.parameters = {
|
214
|
+
design: {
|
215
|
+
type: 'figma',
|
216
|
+
url: _figmaLinks.FIGMA_LINKS.datePicker.minimumDate
|
217
|
+
}
|
218
|
+
};
|
174
219
|
var MaximumDate = function MaximumDate(args) {
|
175
220
|
return (0, _react2.jsx)(_DatePicker["default"], (0, _extends2["default"])({}, args, {
|
176
221
|
defaultValue: "2030-01-15",
|
@@ -178,18 +223,36 @@ var MaximumDate = function MaximumDate(args) {
|
|
178
223
|
}));
|
179
224
|
};
|
180
225
|
exports.MaximumDate = MaximumDate;
|
226
|
+
MaximumDate.parameters = {
|
227
|
+
design: {
|
228
|
+
type: 'figma',
|
229
|
+
url: _figmaLinks.FIGMA_LINKS.datePicker.maximumDate
|
230
|
+
}
|
231
|
+
};
|
181
232
|
var Required = function Required(args) {
|
182
233
|
return (0, _react2.jsx)(_DatePicker["default"], (0, _extends2["default"])({}, args, {
|
183
234
|
isRequired: true
|
184
235
|
}));
|
185
236
|
};
|
186
237
|
exports.Required = Required;
|
238
|
+
Required.parameters = {
|
239
|
+
design: {
|
240
|
+
type: 'figma',
|
241
|
+
url: _figmaLinks.FIGMA_LINKS.datePicker.required
|
242
|
+
}
|
243
|
+
};
|
187
244
|
var FormatHelperText = function FormatHelperText(args) {
|
188
245
|
return (0, _react2.jsx)(_DatePicker["default"], (0, _extends2["default"])({}, args, {
|
189
246
|
hasFormatHelpText: true
|
190
247
|
}));
|
191
248
|
};
|
192
249
|
exports.FormatHelperText = FormatHelperText;
|
250
|
+
FormatHelperText.parameters = {
|
251
|
+
design: {
|
252
|
+
type: 'figma',
|
253
|
+
url: _figmaLinks.FIGMA_LINKS.datePicker.formatHelperText
|
254
|
+
}
|
255
|
+
};
|
193
256
|
var DefaultOpen = function DefaultOpen(args) {
|
194
257
|
return (0, _react2.jsx)(_DatePicker["default"], (0, _extends2["default"])({}, args, {
|
195
258
|
isDefaultOpen: true,
|
@@ -197,6 +260,12 @@ var DefaultOpen = function DefaultOpen(args) {
|
|
197
260
|
}));
|
198
261
|
};
|
199
262
|
exports.DefaultOpen = DefaultOpen;
|
263
|
+
DefaultOpen.parameters = {
|
264
|
+
design: {
|
265
|
+
type: 'figma',
|
266
|
+
url: _figmaLinks.FIGMA_LINKS.datePicker.defaultOpen
|
267
|
+
}
|
268
|
+
};
|
200
269
|
var Error = function Error(args) {
|
201
270
|
return (0, _react2.jsx)(_DatePicker["default"], (0, _extends2["default"])({}, args, {
|
202
271
|
status: "error",
|
@@ -204,10 +273,9 @@ var Error = function Error(args) {
|
|
204
273
|
}));
|
205
274
|
};
|
206
275
|
exports.Error = Error;
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
}
|
212
|
-
};
|
213
|
-
exports.Success = Success;
|
276
|
+
Error.parameters = {
|
277
|
+
design: {
|
278
|
+
type: 'figma',
|
279
|
+
url: _figmaLinks.FIGMA_LINKS.datePicker.error
|
280
|
+
}
|
281
|
+
};
|
@@ -79,6 +79,19 @@ export declare const FIGMA_LINKS: {
|
|
79
79
|
countryPicker: {
|
80
80
|
default: string;
|
81
81
|
};
|
82
|
+
datePicker: {
|
83
|
+
default: string;
|
84
|
+
defaultValue: string;
|
85
|
+
disabled: string;
|
86
|
+
readOnly: string;
|
87
|
+
required: string;
|
88
|
+
formatHelperText: string;
|
89
|
+
error: string;
|
90
|
+
defaultOpen: string;
|
91
|
+
unavailableDates: string;
|
92
|
+
minimumDate: string;
|
93
|
+
maximumDate: string;
|
94
|
+
};
|
82
95
|
dateTimeRangePicker: {
|
83
96
|
default: string;
|
84
97
|
};
|
@@ -86,6 +86,19 @@ var FIGMA_LINKS = {
|
|
86
86
|
countryPicker: {
|
87
87
|
"default": 'https://www.figma.com/file/Oa6VYtJcUJzEJuuRp0p4ls/Astro?type=design&node-id=4568-7532&mode=design&t=eSfQYHRFNPf37J4C-0'
|
88
88
|
},
|
89
|
+
datePicker: {
|
90
|
+
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=54750-58556&mode=design&t=xKC70FhpRo7cbuqQ-4',
|
91
|
+
defaultValue: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&mode=design&node-id=53997-4894&t=xKC70FhpRo7cbuqQ-4',
|
92
|
+
disabled: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&mode=design&node-id=54750-58557&t=xKC70FhpRo7cbuqQ-4',
|
93
|
+
readOnly: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&mode=design&node-id=54750-58568&t=xKC70FhpRo7cbuqQ-4',
|
94
|
+
required: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&mode=design&node-id=54750-58706&t=xKC70FhpRo7cbuqQ-4',
|
95
|
+
formatHelperText: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&mode=design&node-id=54750-58722&t=xKC70FhpRo7cbuqQ-4',
|
96
|
+
error: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&mode=design&node-id=54752-58829&t=xKC70FhpRo7cbuqQ-4',
|
97
|
+
defaultOpen: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&mode=design&node-id=54752-58855&t=xKC70FhpRo7cbuqQ-4',
|
98
|
+
unavailableDates: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&mode=design&node-id=57486-7296&t=xKC70FhpRo7cbuqQ-4',
|
99
|
+
minimumDate: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&mode=design&node-id=57486-7812&t=xKC70FhpRo7cbuqQ-4',
|
100
|
+
maximumDate: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&mode=design&node-id=57486-7297&t=xKC70FhpRo7cbuqQ-4'
|
101
|
+
},
|
89
102
|
dateTimeRangePicker: {
|
90
103
|
"default": 'https://www.figma.com/design/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=49152-4497&t=n7OkhpTOBBWW4rme-0'
|
91
104
|
},
|
@@ -101,7 +101,8 @@ var Calendar = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
101
101
|
variant: "itemTitle",
|
102
102
|
role: "heading",
|
103
103
|
"aria-level": 3,
|
104
|
-
fontWeight: 3
|
104
|
+
fontWeight: 3,
|
105
|
+
flex: 1
|
105
106
|
}, title);
|
106
107
|
return ___EmotionJSX(Box, _extends({}, calendarProps, {
|
107
108
|
ref: calenderRef,
|
@@ -120,27 +121,30 @@ var Calendar = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
120
121
|
return handleYearSelection(nav.PREVIOUS);
|
121
122
|
},
|
122
123
|
mx: "sm",
|
124
|
+
p: 0,
|
123
125
|
isDisabled: prevButtonProps.isDisabled,
|
124
126
|
"aria-label": "Previous year navigation"
|
125
127
|
}, ___EmotionJSX(Icon, {
|
126
128
|
icon: ChevronDoubleLeftIcon,
|
127
|
-
size:
|
129
|
+
size: 25,
|
128
130
|
title: {
|
129
131
|
name: 'Chevron Double Left Icon'
|
130
132
|
}
|
131
133
|
})), ___EmotionJSX(IconButton, _extends({}, prevButtonProps, {
|
132
|
-
"aria-label": "Previous month navigation"
|
134
|
+
"aria-label": "Previous month navigation",
|
135
|
+
p: 0
|
133
136
|
}), ___EmotionJSX(Icon, {
|
134
137
|
icon: ChevronLeftIcon,
|
135
|
-
size:
|
138
|
+
size: 25,
|
136
139
|
title: {
|
137
140
|
name: 'Chevron Left Icon'
|
138
141
|
}
|
139
142
|
})), renderTitle, ___EmotionJSX(IconButton, _extends({}, nextButtonProps, {
|
143
|
+
p: 0,
|
140
144
|
"aria-label": "Next month navigation"
|
141
145
|
}), ___EmotionJSX(Icon, {
|
142
146
|
icon: ChevronRightIcon,
|
143
|
-
size:
|
147
|
+
size: 25,
|
144
148
|
title: {
|
145
149
|
name: 'Chevron Right Icon'
|
146
150
|
}
|
@@ -150,11 +154,12 @@ var Calendar = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
150
154
|
return handleYearSelection(nav.NEXT);
|
151
155
|
},
|
152
156
|
mx: "sm",
|
157
|
+
p: 0,
|
153
158
|
isDisabled: nextButtonProps.isDisabled,
|
154
159
|
"aria-label": "Next year navigation"
|
155
160
|
}, ___EmotionJSX(Icon, {
|
156
161
|
icon: ChevronDoubleRightIcon,
|
157
|
-
size:
|
162
|
+
size: 25,
|
158
163
|
title: {
|
159
164
|
name: 'Chevron Double Right Icon'
|
160
165
|
}
|
@@ -12,6 +12,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
12
12
|
import { defaultFocus } from '../Button/Buttons.styles';
|
13
13
|
var calendarBody = {
|
14
14
|
pb: '10px',
|
15
|
+
px: '1px',
|
15
16
|
borderTop: '1px solid',
|
16
17
|
borderTopColor: 'neutral.80',
|
17
18
|
'& > tr:nth-of-type(odd) ': {
|
@@ -36,7 +37,10 @@ var calendarButton = {
|
|
36
37
|
outline: 'none',
|
37
38
|
boxShadow: 'none'
|
38
39
|
},
|
39
|
-
'&.is-focused': _objectSpread({}, defaultFocus),
|
40
|
+
'&.is-focused': _objectSpread(_objectSpread({}, defaultFocus), {}, {
|
41
|
+
outlineOffset: '0px',
|
42
|
+
zIndex: 1
|
43
|
+
}),
|
40
44
|
'&.is-unavailable': {
|
41
45
|
backgroundColor: 'neutral.80'
|
42
46
|
},
|
@@ -17,6 +17,7 @@ import { chain } from '@react-aria/utils';
|
|
17
17
|
import { actions } from '@storybook/addon-actions';
|
18
18
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
19
19
|
import { Box, Button } from '../../index';
|
20
|
+
import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks';
|
20
21
|
import { ariaAttributeBaseArgTypes } from '../../utils/docUtils/ariaAttributes';
|
21
22
|
import DatePicker from './DatePicker';
|
22
23
|
import DatePickerReadme from './DatePicker.mdx';
|
@@ -32,6 +33,14 @@ export default {
|
|
32
33
|
page: function page() {
|
33
34
|
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(DatePickerReadme, null), ___EmotionJSX(DocsLayout, null));
|
34
35
|
}
|
36
|
+
},
|
37
|
+
a11y: {
|
38
|
+
config: {
|
39
|
+
rules: [{
|
40
|
+
id: 'color-contrast',
|
41
|
+
enabled: false
|
42
|
+
}]
|
43
|
+
}
|
35
44
|
}
|
36
45
|
},
|
37
46
|
argTypes: _objectSpread({
|
@@ -95,18 +104,30 @@ export default {
|
|
95
104
|
isDisabled: false,
|
96
105
|
isReadOnly: false,
|
97
106
|
isRequired: false,
|
98
|
-
label: 'Example
|
107
|
+
label: 'Example Label',
|
99
108
|
onChange: null
|
100
109
|
}
|
101
110
|
};
|
102
111
|
export var Default = function Default(args) {
|
103
112
|
return ___EmotionJSX(DatePicker, args);
|
104
113
|
};
|
114
|
+
Default.parameters = {
|
115
|
+
design: {
|
116
|
+
type: 'figma',
|
117
|
+
url: FIGMA_LINKS.datePicker["default"]
|
118
|
+
}
|
119
|
+
};
|
105
120
|
export var DefaultValue = function DefaultValue(args) {
|
106
121
|
return ___EmotionJSX(DatePicker, _extends({}, args, {
|
107
122
|
defaultValue: "2030-01-15"
|
108
123
|
}));
|
109
124
|
};
|
125
|
+
DefaultValue.parameters = {
|
126
|
+
design: {
|
127
|
+
type: 'figma',
|
128
|
+
url: FIGMA_LINKS.datePicker.defaultValue
|
129
|
+
}
|
130
|
+
};
|
110
131
|
export var Controlled = function Controlled(args) {
|
111
132
|
var _useState = useState(null),
|
112
133
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -134,11 +155,23 @@ export var Disabled = function Disabled(args) {
|
|
134
155
|
isDisabled: true
|
135
156
|
}));
|
136
157
|
};
|
158
|
+
Disabled.parameters = {
|
159
|
+
design: {
|
160
|
+
type: 'figma',
|
161
|
+
url: FIGMA_LINKS.datePicker.disabled
|
162
|
+
}
|
163
|
+
};
|
137
164
|
export var ReadOnly = function ReadOnly(args) {
|
138
165
|
return ___EmotionJSX(DatePicker, _extends({}, args, {
|
139
166
|
isReadOnly: true
|
140
167
|
}));
|
141
168
|
};
|
169
|
+
ReadOnly.parameters = {
|
170
|
+
design: {
|
171
|
+
type: 'figma',
|
172
|
+
url: FIGMA_LINKS.datePicker.readOnly
|
173
|
+
}
|
174
|
+
};
|
142
175
|
export var UnavailableDates = function UnavailableDates(args) {
|
143
176
|
var unavailableRanges = [['2030-07-28', '2030-08-03'], ['2030-08-11', '2030-08-17'], ['2030-08-25', '2030-08-31']];
|
144
177
|
return ___EmotionJSX(DatePicker, _extends({}, args, {
|
@@ -146,43 +179,79 @@ export var UnavailableDates = function UnavailableDates(args) {
|
|
146
179
|
defaultValue: "2030-08-07"
|
147
180
|
}));
|
148
181
|
};
|
182
|
+
UnavailableDates.parameters = {
|
183
|
+
design: {
|
184
|
+
type: 'figma',
|
185
|
+
url: FIGMA_LINKS.datePicker.unavailableDates
|
186
|
+
}
|
187
|
+
};
|
149
188
|
export var MinimumDate = function MinimumDate(args) {
|
150
189
|
return ___EmotionJSX(DatePicker, _extends({}, args, {
|
151
190
|
defaultValue: "2030-01-15",
|
152
191
|
minValue: "2030-01-15"
|
153
192
|
}));
|
154
193
|
};
|
194
|
+
MinimumDate.parameters = {
|
195
|
+
design: {
|
196
|
+
type: 'figma',
|
197
|
+
url: FIGMA_LINKS.datePicker.minimumDate
|
198
|
+
}
|
199
|
+
};
|
155
200
|
export var MaximumDate = function MaximumDate(args) {
|
156
201
|
return ___EmotionJSX(DatePicker, _extends({}, args, {
|
157
202
|
defaultValue: "2030-01-15",
|
158
203
|
maxValue: "2030-01-15"
|
159
204
|
}));
|
160
205
|
};
|
206
|
+
MaximumDate.parameters = {
|
207
|
+
design: {
|
208
|
+
type: 'figma',
|
209
|
+
url: FIGMA_LINKS.datePicker.maximumDate
|
210
|
+
}
|
211
|
+
};
|
161
212
|
export var Required = function Required(args) {
|
162
213
|
return ___EmotionJSX(DatePicker, _extends({}, args, {
|
163
214
|
isRequired: true
|
164
215
|
}));
|
165
216
|
};
|
217
|
+
Required.parameters = {
|
218
|
+
design: {
|
219
|
+
type: 'figma',
|
220
|
+
url: FIGMA_LINKS.datePicker.required
|
221
|
+
}
|
222
|
+
};
|
166
223
|
export var FormatHelperText = function FormatHelperText(args) {
|
167
224
|
return ___EmotionJSX(DatePicker, _extends({}, args, {
|
168
225
|
hasFormatHelpText: true
|
169
226
|
}));
|
170
227
|
};
|
228
|
+
FormatHelperText.parameters = {
|
229
|
+
design: {
|
230
|
+
type: 'figma',
|
231
|
+
url: FIGMA_LINKS.datePicker.formatHelperText
|
232
|
+
}
|
233
|
+
};
|
171
234
|
export var DefaultOpen = function DefaultOpen(args) {
|
172
235
|
return ___EmotionJSX(DatePicker, _extends({}, args, {
|
173
236
|
isDefaultOpen: true,
|
174
237
|
defaultValue: "2030-01-15"
|
175
238
|
}));
|
176
239
|
};
|
240
|
+
DefaultOpen.parameters = {
|
241
|
+
design: {
|
242
|
+
type: 'figma',
|
243
|
+
url: FIGMA_LINKS.datePicker.defaultOpen
|
244
|
+
}
|
245
|
+
};
|
177
246
|
export var Error = function Error(args) {
|
178
247
|
return ___EmotionJSX(DatePicker, _extends({}, args, {
|
179
248
|
status: "error",
|
180
249
|
helperText: "Here is some helpful text..."
|
181
250
|
}));
|
182
251
|
};
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
}
|
252
|
+
Error.parameters = {
|
253
|
+
design: {
|
254
|
+
type: 'figma',
|
255
|
+
url: FIGMA_LINKS.datePicker.error
|
256
|
+
}
|
188
257
|
};
|
@@ -79,6 +79,19 @@ export var FIGMA_LINKS = {
|
|
79
79
|
countryPicker: {
|
80
80
|
"default": 'https://www.figma.com/file/Oa6VYtJcUJzEJuuRp0p4ls/Astro?type=design&node-id=4568-7532&mode=design&t=eSfQYHRFNPf37J4C-0'
|
81
81
|
},
|
82
|
+
datePicker: {
|
83
|
+
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=54750-58556&mode=design&t=xKC70FhpRo7cbuqQ-4',
|
84
|
+
defaultValue: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&mode=design&node-id=53997-4894&t=xKC70FhpRo7cbuqQ-4',
|
85
|
+
disabled: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&mode=design&node-id=54750-58557&t=xKC70FhpRo7cbuqQ-4',
|
86
|
+
readOnly: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&mode=design&node-id=54750-58568&t=xKC70FhpRo7cbuqQ-4',
|
87
|
+
required: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&mode=design&node-id=54750-58706&t=xKC70FhpRo7cbuqQ-4',
|
88
|
+
formatHelperText: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&mode=design&node-id=54750-58722&t=xKC70FhpRo7cbuqQ-4',
|
89
|
+
error: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&mode=design&node-id=54752-58829&t=xKC70FhpRo7cbuqQ-4',
|
90
|
+
defaultOpen: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&mode=design&node-id=54752-58855&t=xKC70FhpRo7cbuqQ-4',
|
91
|
+
unavailableDates: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&mode=design&node-id=57486-7296&t=xKC70FhpRo7cbuqQ-4',
|
92
|
+
minimumDate: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&mode=design&node-id=57486-7812&t=xKC70FhpRo7cbuqQ-4',
|
93
|
+
maximumDate: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&mode=design&node-id=57486-7297&t=xKC70FhpRo7cbuqQ-4'
|
94
|
+
},
|
82
95
|
dateTimeRangePicker: {
|
83
96
|
"default": 'https://www.figma.com/design/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?node-id=49152-4497&t=n7OkhpTOBBWW4rme-0'
|
84
97
|
},
|
package/package.json
CHANGED
@@ -1,212 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { StoryFn } from '@storybook/react';
|
3
|
-
import { CalendarProps } from '../../types';
|
4
|
-
declare const _default: {
|
5
|
-
title: string;
|
6
|
-
component: React.ForwardRefExoticComponent<CalendarProps & React.RefAttributes<HTMLDivElement>>;
|
7
|
-
decorators: ((...args: any) => any)[];
|
8
|
-
parameters: {
|
9
|
-
actions: {
|
10
|
-
argTypesRegex: string;
|
11
|
-
};
|
12
|
-
docs: {
|
13
|
-
source: {
|
14
|
-
type: string;
|
15
|
-
};
|
16
|
-
page: () => React.JSX.Element;
|
17
|
-
};
|
18
|
-
};
|
19
|
-
argTypes: {
|
20
|
-
'aria-controls': {
|
21
|
-
control: {
|
22
|
-
type: string;
|
23
|
-
};
|
24
|
-
table: {
|
25
|
-
type: {
|
26
|
-
summary: string;
|
27
|
-
};
|
28
|
-
category: string;
|
29
|
-
};
|
30
|
-
description: string;
|
31
|
-
};
|
32
|
-
'aria-describedby': {
|
33
|
-
control: {
|
34
|
-
type: string;
|
35
|
-
};
|
36
|
-
table: {
|
37
|
-
type: {
|
38
|
-
summary: string;
|
39
|
-
};
|
40
|
-
category: string;
|
41
|
-
};
|
42
|
-
description: string;
|
43
|
-
};
|
44
|
-
'aria-details': {
|
45
|
-
control: {
|
46
|
-
type: string;
|
47
|
-
};
|
48
|
-
table: {
|
49
|
-
type: {
|
50
|
-
summary: string;
|
51
|
-
};
|
52
|
-
category: string;
|
53
|
-
};
|
54
|
-
description: string;
|
55
|
-
};
|
56
|
-
'aria-errormessage': {
|
57
|
-
control: {
|
58
|
-
type: string;
|
59
|
-
};
|
60
|
-
table: {
|
61
|
-
type: {
|
62
|
-
summary: string;
|
63
|
-
};
|
64
|
-
category: string;
|
65
|
-
};
|
66
|
-
description: string;
|
67
|
-
};
|
68
|
-
'aria-label': {
|
69
|
-
control: {
|
70
|
-
type: string;
|
71
|
-
};
|
72
|
-
table: {
|
73
|
-
type: {
|
74
|
-
summary: string;
|
75
|
-
};
|
76
|
-
category: string;
|
77
|
-
};
|
78
|
-
description: string;
|
79
|
-
};
|
80
|
-
'aria-labelledby': {
|
81
|
-
control: {
|
82
|
-
type: string;
|
83
|
-
};
|
84
|
-
table: {
|
85
|
-
type: {
|
86
|
-
summary: string;
|
87
|
-
};
|
88
|
-
category: string;
|
89
|
-
};
|
90
|
-
description: string;
|
91
|
-
};
|
92
|
-
customWeekDays: {
|
93
|
-
control: {
|
94
|
-
type: string;
|
95
|
-
};
|
96
|
-
};
|
97
|
-
value: {
|
98
|
-
control: {
|
99
|
-
type: string;
|
100
|
-
};
|
101
|
-
};
|
102
|
-
defaultValue: {
|
103
|
-
control: {
|
104
|
-
type: string;
|
105
|
-
};
|
106
|
-
};
|
107
|
-
hasAutoFocus: {
|
108
|
-
control: {
|
109
|
-
type: string;
|
110
|
-
};
|
111
|
-
};
|
112
|
-
id: {
|
113
|
-
control: {
|
114
|
-
type: string;
|
115
|
-
};
|
116
|
-
};
|
117
|
-
isDisabled: {
|
118
|
-
control: {
|
119
|
-
type: string;
|
120
|
-
};
|
121
|
-
};
|
122
|
-
isReadOnly: {
|
123
|
-
control: {
|
124
|
-
type: string;
|
125
|
-
};
|
126
|
-
};
|
127
|
-
isRequired: {
|
128
|
-
control: {
|
129
|
-
type: string;
|
130
|
-
};
|
131
|
-
};
|
132
|
-
maxValue: {
|
133
|
-
control: {
|
134
|
-
type: string;
|
135
|
-
};
|
136
|
-
};
|
137
|
-
minValue: {
|
138
|
-
control: {
|
139
|
-
type: string;
|
140
|
-
};
|
141
|
-
};
|
142
|
-
onChange: {
|
143
|
-
control: {
|
144
|
-
type: string;
|
145
|
-
};
|
146
|
-
action: string;
|
147
|
-
};
|
148
|
-
onFocusChange: {
|
149
|
-
control: {
|
150
|
-
type: string;
|
151
|
-
};
|
152
|
-
action: string;
|
153
|
-
};
|
154
|
-
};
|
155
|
-
args: {
|
156
|
-
hasAutoFocus: boolean;
|
157
|
-
isDisabled: boolean;
|
158
|
-
isReadOnly: boolean;
|
159
|
-
isRequired: boolean;
|
160
|
-
onChange: null;
|
161
|
-
onFocusChange: null;
|
162
|
-
defaultFocusedValue: string;
|
163
|
-
};
|
164
|
-
};
|
165
|
-
export default _default;
|
166
|
-
export declare const Default: StoryFn<CalendarProps>;
|
167
|
-
export declare const DefaultValue: {
|
168
|
-
(): React.JSX.Element;
|
169
|
-
parameters: {
|
170
|
-
design: {
|
171
|
-
type: string;
|
172
|
-
url: string;
|
173
|
-
};
|
174
|
-
};
|
175
|
-
};
|
176
|
-
export declare const Disabled: {
|
177
|
-
(args: any): React.JSX.Element;
|
178
|
-
parameters: {
|
179
|
-
design: {
|
180
|
-
type: string;
|
181
|
-
url: string;
|
182
|
-
};
|
183
|
-
};
|
184
|
-
};
|
185
|
-
export declare const UnavailableDates: {
|
186
|
-
(): React.JSX.Element;
|
187
|
-
parameters: {
|
188
|
-
design: {
|
189
|
-
type: string;
|
190
|
-
url: string;
|
191
|
-
};
|
192
|
-
};
|
193
|
-
};
|
194
|
-
export declare const MinimumDate: {
|
195
|
-
(): React.JSX.Element;
|
196
|
-
parameters: {
|
197
|
-
design: {
|
198
|
-
type: string;
|
199
|
-
url: string;
|
200
|
-
};
|
201
|
-
};
|
202
|
-
};
|
203
|
-
export declare const MaximumDate: {
|
204
|
-
(): React.JSX.Element;
|
205
|
-
parameters: {
|
206
|
-
design: {
|
207
|
-
type: string;
|
208
|
-
url: string;
|
209
|
-
};
|
210
|
-
};
|
211
|
-
};
|
212
|
-
export declare const Controlled: (args: any) => React.JSX.Element;
|
@@ -1,225 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
|
4
|
-
var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
5
|
-
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols");
|
6
|
-
var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter");
|
7
|
-
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
8
|
-
var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each");
|
9
|
-
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors");
|
10
|
-
var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties");
|
11
|
-
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
12
|
-
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
13
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
14
|
-
_Object$defineProperty(exports, "__esModule", {
|
15
|
-
value: true
|
16
|
-
});
|
17
|
-
exports["default"] = exports.UnavailableDates = exports.MinimumDate = exports.MaximumDate = exports.Disabled = exports.DefaultValue = exports.Default = exports.Controlled = void 0;
|
18
|
-
var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
|
19
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
20
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
21
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
|
22
|
-
var _react = _interopRequireWildcard(require("react"));
|
23
|
-
var _date = require("@internationalized/date");
|
24
|
-
var _storybookAddonDesigns = require("storybook-addon-designs");
|
25
|
-
var _storybookDocsLayout = _interopRequireDefault(require("../../../.storybook/storybookDocsLayout"));
|
26
|
-
var _figmaLinks = require("../../utils/designUtils/figmaLinks");
|
27
|
-
var _ariaAttributes = require("../../utils/docUtils/ariaAttributes");
|
28
|
-
var _Calendar = _interopRequireDefault(require("./Calendar.mdx"));
|
29
|
-
var _ = _interopRequireDefault(require("."));
|
30
|
-
var _react2 = require("@emotion/react");
|
31
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
32
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
33
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
34
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
35
|
-
var _default = {
|
36
|
-
title: 'Components/Calendar',
|
37
|
-
component: _["default"],
|
38
|
-
decorators: [_storybookAddonDesigns.withDesign],
|
39
|
-
parameters: {
|
40
|
-
actions: {
|
41
|
-
argTypesRegex: '^on.*'
|
42
|
-
},
|
43
|
-
docs: {
|
44
|
-
source: {
|
45
|
-
type: 'code'
|
46
|
-
},
|
47
|
-
page: function page() {
|
48
|
-
return (0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_Calendar["default"], null), (0, _react2.jsx)(_storybookDocsLayout["default"], null));
|
49
|
-
}
|
50
|
-
}
|
51
|
-
},
|
52
|
-
argTypes: _objectSpread({
|
53
|
-
customWeekDays: {
|
54
|
-
control: {
|
55
|
-
type: 'array'
|
56
|
-
}
|
57
|
-
},
|
58
|
-
value: {
|
59
|
-
control: {
|
60
|
-
type: 'text'
|
61
|
-
}
|
62
|
-
},
|
63
|
-
defaultValue: {
|
64
|
-
control: {
|
65
|
-
type: 'text'
|
66
|
-
}
|
67
|
-
},
|
68
|
-
hasAutoFocus: {
|
69
|
-
control: {
|
70
|
-
type: 'boolean'
|
71
|
-
}
|
72
|
-
},
|
73
|
-
id: {
|
74
|
-
control: {
|
75
|
-
type: 'text'
|
76
|
-
}
|
77
|
-
},
|
78
|
-
isDisabled: {
|
79
|
-
control: {
|
80
|
-
type: 'boolean'
|
81
|
-
}
|
82
|
-
},
|
83
|
-
isReadOnly: {
|
84
|
-
control: {
|
85
|
-
type: 'boolean'
|
86
|
-
}
|
87
|
-
},
|
88
|
-
isRequired: {
|
89
|
-
control: {
|
90
|
-
type: 'boolean'
|
91
|
-
}
|
92
|
-
},
|
93
|
-
maxValue: {
|
94
|
-
control: {
|
95
|
-
type: 'text'
|
96
|
-
}
|
97
|
-
},
|
98
|
-
minValue: {
|
99
|
-
control: {
|
100
|
-
type: 'text'
|
101
|
-
}
|
102
|
-
},
|
103
|
-
onChange: {
|
104
|
-
control: {
|
105
|
-
type: 'func'
|
106
|
-
},
|
107
|
-
action: 'change'
|
108
|
-
},
|
109
|
-
onFocusChange: {
|
110
|
-
control: {
|
111
|
-
type: 'func'
|
112
|
-
},
|
113
|
-
action: 'focus change'
|
114
|
-
}
|
115
|
-
}, _ariaAttributes.ariaAttributeBaseArgTypes),
|
116
|
-
args: {
|
117
|
-
hasAutoFocus: false,
|
118
|
-
isDisabled: false,
|
119
|
-
isReadOnly: false,
|
120
|
-
isRequired: false,
|
121
|
-
onChange: null,
|
122
|
-
onFocusChange: null,
|
123
|
-
defaultFocusedValue: '2030-01-15'
|
124
|
-
}
|
125
|
-
};
|
126
|
-
exports["default"] = _default;
|
127
|
-
var Default = function Default(args) {
|
128
|
-
return (0, _react2.jsx)(_["default"], (0, _extends2["default"])({}, args, {
|
129
|
-
"aria-label": "calendar-default"
|
130
|
-
}));
|
131
|
-
};
|
132
|
-
exports.Default = Default;
|
133
|
-
Default.parameters = {
|
134
|
-
design: {
|
135
|
-
type: 'figma',
|
136
|
-
url: _figmaLinks.FIGMA_LINKS.calendar["default"]
|
137
|
-
}
|
138
|
-
};
|
139
|
-
var DefaultValue = function DefaultValue() {
|
140
|
-
return (0, _react2.jsx)(_["default"], {
|
141
|
-
"aria-label": "calendar-with-default-value",
|
142
|
-
defaultValue: "2030-01-15"
|
143
|
-
});
|
144
|
-
};
|
145
|
-
exports.DefaultValue = DefaultValue;
|
146
|
-
DefaultValue.parameters = {
|
147
|
-
design: {
|
148
|
-
type: 'figma',
|
149
|
-
url: _figmaLinks.FIGMA_LINKS.calendar.defaultValue
|
150
|
-
}
|
151
|
-
};
|
152
|
-
var Disabled = function Disabled(args) {
|
153
|
-
return (0, _react2.jsx)(_["default"], (0, _extends2["default"])({}, args, {
|
154
|
-
"aria-label": "calendar-component-disabled",
|
155
|
-
isDisabled: true
|
156
|
-
}));
|
157
|
-
};
|
158
|
-
exports.Disabled = Disabled;
|
159
|
-
Disabled.parameters = {
|
160
|
-
design: {
|
161
|
-
type: 'figma',
|
162
|
-
url: _figmaLinks.FIGMA_LINKS.calendar.disabled
|
163
|
-
}
|
164
|
-
};
|
165
|
-
var UnavailableDates = function UnavailableDates() {
|
166
|
-
var unavailableRanges = [['2030-07-28', '2030-08-03'], ['2030-08-11', '2030-08-17'], ['2030-08-25', '2030-08-31']];
|
167
|
-
// This function is run against each date in the calendar
|
168
|
-
var isDateUnavailable = function isDateUnavailable(date) {
|
169
|
-
return (0, _some["default"])(unavailableRanges).call(unavailableRanges, function (interval) {
|
170
|
-
return date.compare((0, _date.parseDate)(interval[0])) >= 0 && date.compare((0, _date.parseDate)(interval[1])) <= 0;
|
171
|
-
});
|
172
|
-
};
|
173
|
-
return (0, _react2.jsx)(_["default"], {
|
174
|
-
"aria-label": "calendar-component-unavailable-dates",
|
175
|
-
defaultValue: "2030-08-07",
|
176
|
-
isDateUnavailable: isDateUnavailable
|
177
|
-
});
|
178
|
-
};
|
179
|
-
exports.UnavailableDates = UnavailableDates;
|
180
|
-
UnavailableDates.parameters = {
|
181
|
-
design: {
|
182
|
-
type: 'figma',
|
183
|
-
url: _figmaLinks.FIGMA_LINKS.calendar.unavailableDates
|
184
|
-
}
|
185
|
-
};
|
186
|
-
var MinimumDate = function MinimumDate() {
|
187
|
-
return (0, _react2.jsx)(_["default"], {
|
188
|
-
"aria-label": "calendar-component-min-date",
|
189
|
-
minValue: "2030-01-15",
|
190
|
-
defaultValue: "2030-01-15"
|
191
|
-
});
|
192
|
-
};
|
193
|
-
exports.MinimumDate = MinimumDate;
|
194
|
-
MinimumDate.parameters = {
|
195
|
-
design: {
|
196
|
-
type: 'figma',
|
197
|
-
url: _figmaLinks.FIGMA_LINKS.calendar.minimumDate
|
198
|
-
}
|
199
|
-
};
|
200
|
-
var MaximumDate = function MaximumDate() {
|
201
|
-
return (0, _react2.jsx)(_["default"], {
|
202
|
-
"aria-label": "calendar-component-max-date",
|
203
|
-
maxValue: "2030-01-15",
|
204
|
-
defaultValue: "2030-01-15"
|
205
|
-
});
|
206
|
-
};
|
207
|
-
exports.MaximumDate = MaximumDate;
|
208
|
-
MaximumDate.parameters = {
|
209
|
-
design: {
|
210
|
-
type: 'figma',
|
211
|
-
url: _figmaLinks.FIGMA_LINKS.calendar.maximumDate
|
212
|
-
}
|
213
|
-
};
|
214
|
-
var Controlled = function Controlled(args) {
|
215
|
-
var _useState = (0, _react.useState)(null),
|
216
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
217
|
-
date = _useState2[0],
|
218
|
-
setDate = _useState2[1];
|
219
|
-
return (0, _react2.jsx)(_["default"], (0, _extends2["default"])({}, args, {
|
220
|
-
"aria-label": "calendar-component-controlled",
|
221
|
-
value: date,
|
222
|
-
onChange: setDate
|
223
|
-
}));
|
224
|
-
};
|
225
|
-
exports.Controlled = Controlled;
|
@@ -1,206 +0,0 @@
|
|
1
|
-
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
2
|
-
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
3
|
-
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
4
|
-
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
5
|
-
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
6
|
-
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
7
|
-
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
8
|
-
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
9
|
-
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
10
|
-
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
11
|
-
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
12
|
-
import _someInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/some";
|
13
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
14
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
15
|
-
import React, { useState } from 'react';
|
16
|
-
import { parseDate } from '@internationalized/date';
|
17
|
-
import { withDesign } from 'storybook-addon-designs';
|
18
|
-
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
19
|
-
import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks';
|
20
|
-
import { ariaAttributeBaseArgTypes } from '../../utils/docUtils/ariaAttributes';
|
21
|
-
import CalendarReadme from './Calendar.mdx';
|
22
|
-
import Calendar from '.';
|
23
|
-
import { jsx as ___EmotionJSX } from "@emotion/react";
|
24
|
-
export default {
|
25
|
-
title: 'Components/Calendar',
|
26
|
-
component: Calendar,
|
27
|
-
decorators: [withDesign],
|
28
|
-
parameters: {
|
29
|
-
actions: {
|
30
|
-
argTypesRegex: '^on.*'
|
31
|
-
},
|
32
|
-
docs: {
|
33
|
-
source: {
|
34
|
-
type: 'code'
|
35
|
-
},
|
36
|
-
page: function page() {
|
37
|
-
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(CalendarReadme, null), ___EmotionJSX(DocsLayout, null));
|
38
|
-
}
|
39
|
-
}
|
40
|
-
},
|
41
|
-
argTypes: _objectSpread({
|
42
|
-
customWeekDays: {
|
43
|
-
control: {
|
44
|
-
type: 'array'
|
45
|
-
}
|
46
|
-
},
|
47
|
-
value: {
|
48
|
-
control: {
|
49
|
-
type: 'text'
|
50
|
-
}
|
51
|
-
},
|
52
|
-
defaultValue: {
|
53
|
-
control: {
|
54
|
-
type: 'text'
|
55
|
-
}
|
56
|
-
},
|
57
|
-
hasAutoFocus: {
|
58
|
-
control: {
|
59
|
-
type: 'boolean'
|
60
|
-
}
|
61
|
-
},
|
62
|
-
id: {
|
63
|
-
control: {
|
64
|
-
type: 'text'
|
65
|
-
}
|
66
|
-
},
|
67
|
-
isDisabled: {
|
68
|
-
control: {
|
69
|
-
type: 'boolean'
|
70
|
-
}
|
71
|
-
},
|
72
|
-
isReadOnly: {
|
73
|
-
control: {
|
74
|
-
type: 'boolean'
|
75
|
-
}
|
76
|
-
},
|
77
|
-
isRequired: {
|
78
|
-
control: {
|
79
|
-
type: 'boolean'
|
80
|
-
}
|
81
|
-
},
|
82
|
-
maxValue: {
|
83
|
-
control: {
|
84
|
-
type: 'text'
|
85
|
-
}
|
86
|
-
},
|
87
|
-
minValue: {
|
88
|
-
control: {
|
89
|
-
type: 'text'
|
90
|
-
}
|
91
|
-
},
|
92
|
-
onChange: {
|
93
|
-
control: {
|
94
|
-
type: 'func'
|
95
|
-
},
|
96
|
-
action: 'change'
|
97
|
-
},
|
98
|
-
onFocusChange: {
|
99
|
-
control: {
|
100
|
-
type: 'func'
|
101
|
-
},
|
102
|
-
action: 'focus change'
|
103
|
-
}
|
104
|
-
}, ariaAttributeBaseArgTypes),
|
105
|
-
args: {
|
106
|
-
hasAutoFocus: false,
|
107
|
-
isDisabled: false,
|
108
|
-
isReadOnly: false,
|
109
|
-
isRequired: false,
|
110
|
-
onChange: null,
|
111
|
-
onFocusChange: null,
|
112
|
-
defaultFocusedValue: '2030-01-15'
|
113
|
-
}
|
114
|
-
};
|
115
|
-
export var Default = function Default(args) {
|
116
|
-
return ___EmotionJSX(Calendar, _extends({}, args, {
|
117
|
-
"aria-label": "calendar-default"
|
118
|
-
}));
|
119
|
-
};
|
120
|
-
Default.parameters = {
|
121
|
-
design: {
|
122
|
-
type: 'figma',
|
123
|
-
url: FIGMA_LINKS.calendar["default"]
|
124
|
-
}
|
125
|
-
};
|
126
|
-
export var DefaultValue = function DefaultValue() {
|
127
|
-
return ___EmotionJSX(Calendar, {
|
128
|
-
"aria-label": "calendar-with-default-value",
|
129
|
-
defaultValue: "2030-01-15"
|
130
|
-
});
|
131
|
-
};
|
132
|
-
DefaultValue.parameters = {
|
133
|
-
design: {
|
134
|
-
type: 'figma',
|
135
|
-
url: FIGMA_LINKS.calendar.defaultValue
|
136
|
-
}
|
137
|
-
};
|
138
|
-
export var Disabled = function Disabled(args) {
|
139
|
-
return ___EmotionJSX(Calendar, _extends({}, args, {
|
140
|
-
"aria-label": "calendar-component-disabled",
|
141
|
-
isDisabled: true
|
142
|
-
}));
|
143
|
-
};
|
144
|
-
Disabled.parameters = {
|
145
|
-
design: {
|
146
|
-
type: 'figma',
|
147
|
-
url: FIGMA_LINKS.calendar.disabled
|
148
|
-
}
|
149
|
-
};
|
150
|
-
export var UnavailableDates = function UnavailableDates() {
|
151
|
-
var unavailableRanges = [['2030-07-28', '2030-08-03'], ['2030-08-11', '2030-08-17'], ['2030-08-25', '2030-08-31']];
|
152
|
-
// This function is run against each date in the calendar
|
153
|
-
var isDateUnavailable = function isDateUnavailable(date) {
|
154
|
-
return _someInstanceProperty(unavailableRanges).call(unavailableRanges, function (interval) {
|
155
|
-
return date.compare(parseDate(interval[0])) >= 0 && date.compare(parseDate(interval[1])) <= 0;
|
156
|
-
});
|
157
|
-
};
|
158
|
-
return ___EmotionJSX(Calendar, {
|
159
|
-
"aria-label": "calendar-component-unavailable-dates",
|
160
|
-
defaultValue: "2030-08-07",
|
161
|
-
isDateUnavailable: isDateUnavailable
|
162
|
-
});
|
163
|
-
};
|
164
|
-
UnavailableDates.parameters = {
|
165
|
-
design: {
|
166
|
-
type: 'figma',
|
167
|
-
url: FIGMA_LINKS.calendar.unavailableDates
|
168
|
-
}
|
169
|
-
};
|
170
|
-
export var MinimumDate = function MinimumDate() {
|
171
|
-
return ___EmotionJSX(Calendar, {
|
172
|
-
"aria-label": "calendar-component-min-date",
|
173
|
-
minValue: "2030-01-15",
|
174
|
-
defaultValue: "2030-01-15"
|
175
|
-
});
|
176
|
-
};
|
177
|
-
MinimumDate.parameters = {
|
178
|
-
design: {
|
179
|
-
type: 'figma',
|
180
|
-
url: FIGMA_LINKS.calendar.minimumDate
|
181
|
-
}
|
182
|
-
};
|
183
|
-
export var MaximumDate = function MaximumDate() {
|
184
|
-
return ___EmotionJSX(Calendar, {
|
185
|
-
"aria-label": "calendar-component-max-date",
|
186
|
-
maxValue: "2030-01-15",
|
187
|
-
defaultValue: "2030-01-15"
|
188
|
-
});
|
189
|
-
};
|
190
|
-
MaximumDate.parameters = {
|
191
|
-
design: {
|
192
|
-
type: 'figma',
|
193
|
-
url: FIGMA_LINKS.calendar.maximumDate
|
194
|
-
}
|
195
|
-
};
|
196
|
-
export var Controlled = function Controlled(args) {
|
197
|
-
var _useState = useState(null),
|
198
|
-
_useState2 = _slicedToArray(_useState, 2),
|
199
|
-
date = _useState2[0],
|
200
|
-
setDate = _useState2[1];
|
201
|
-
return ___EmotionJSX(Calendar, _extends({}, args, {
|
202
|
-
"aria-label": "calendar-component-controlled",
|
203
|
-
value: date,
|
204
|
-
onChange: setDate
|
205
|
-
}));
|
206
|
-
};
|