@pingux/astro 2.70.0-alpha.1 → 2.70.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/AccordionItem/AccordionItem.d.ts +1 -1
- package/lib/cjs/components/AccordionItem/AccordionItem.js +1 -1
- package/lib/cjs/components/Calendar/Calendar.js +0 -4
- package/lib/cjs/components/Calendar/Calendar.mdx +1 -1
- package/lib/cjs/components/Calendar/Calendar.test.js +4 -1
- package/lib/cjs/components/Calendar/CalendarCell.js +1 -1
- package/lib/cjs/components/DatePicker/DatePicker.test.js +6 -62
- package/lib/cjs/index.d.ts +0 -2
- package/lib/cjs/index.js +26 -45
- package/lib/cjs/styles/variants/variants.js +0 -2
- package/lib/cjs/types/calendar.d.ts +16 -51
- package/lib/components/AccordionItem/AccordionItem.js +3 -0
- package/lib/components/Calendar/Calendar.js +0 -4
- package/lib/components/Calendar/Calendar.mdx +1 -1
- package/lib/components/Calendar/Calendar.test.js +4 -1
- package/lib/components/Calendar/CalendarCell.js +1 -1
- package/lib/components/DatePicker/DatePicker.test.js +6 -62
- package/lib/index.js +0 -2
- package/lib/styles/variants/variants.js +0 -2
- package/package.json +1 -1
- package/lib/cjs/components/RangeCalendar/RangeCalendar.d.ts +0 -7
- package/lib/cjs/components/RangeCalendar/RangeCalendar.js +0 -100
- package/lib/cjs/components/RangeCalendar/RangeCalendar.mdx +0 -39
- package/lib/cjs/components/RangeCalendar/RangeCalendar.stories.d.ts +0 -103
- package/lib/cjs/components/RangeCalendar/RangeCalendar.stories.js +0 -131
- package/lib/cjs/components/RangeCalendar/RangeCalendar.styles.d.ts +0 -104
- package/lib/cjs/components/RangeCalendar/RangeCalendar.styles.js +0 -118
- package/lib/cjs/components/RangeCalendar/RangeCalendar.test.d.ts +0 -1
- package/lib/cjs/components/RangeCalendar/RangeCalendar.test.js +0 -217
- package/lib/cjs/components/RangeCalendar/RangeCalendarCell.d.ts +0 -4
- package/lib/cjs/components/RangeCalendar/RangeCalendarCell.js +0 -96
- package/lib/cjs/components/RangeCalendar/RangeCalendarGrid.d.ts +0 -4
- package/lib/cjs/components/RangeCalendar/RangeCalendarGrid.js +0 -70
- package/lib/cjs/components/RangeCalendar/RangeCalendarHeader.d.ts +0 -4
- package/lib/cjs/components/RangeCalendar/RangeCalendarHeader.js +0 -85
- package/lib/cjs/components/RangeCalendar/index.d.ts +0 -2
- package/lib/cjs/components/RangeCalendar/index.js +0 -33
- package/lib/components/RangeCalendar/RangeCalendar.js +0 -86
- package/lib/components/RangeCalendar/RangeCalendar.mdx +0 -39
- package/lib/components/RangeCalendar/RangeCalendar.stories.js +0 -112
- package/lib/components/RangeCalendar/RangeCalendar.styles.js +0 -110
- package/lib/components/RangeCalendar/RangeCalendar.test.js +0 -208
- package/lib/components/RangeCalendar/RangeCalendarCell.js +0 -82
- package/lib/components/RangeCalendar/RangeCalendarGrid.js +0 -61
- package/lib/components/RangeCalendar/RangeCalendarHeader.js +0 -76
- package/lib/components/RangeCalendar/index.js +0 -2
@@ -1,61 +0,0 @@
|
|
1
|
-
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
|
-
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
3
|
-
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
4
|
-
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
5
|
-
import _keysInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/keys";
|
6
|
-
import React from 'react';
|
7
|
-
import { endOfMonth, getWeeksInMonth } from '@internationalized/date';
|
8
|
-
import { useCalendarGrid } from '@react-aria/calendar';
|
9
|
-
import { useLocale } from '@react-aria/i18n';
|
10
|
-
import { Table, TableBody, TableCell, TableHead, TableRow } from '../../index';
|
11
|
-
import RangeCalendarCell from './RangeCalendarCell';
|
12
|
-
import { jsx as ___EmotionJSX } from "@emotion/react";
|
13
|
-
var RangeCalendarGrid = function RangeCalendarGrid(props) {
|
14
|
-
var _context2, _context3;
|
15
|
-
var state = props.state,
|
16
|
-
_props$offset = props.offset,
|
17
|
-
offset = _props$offset === void 0 ? {} : _props$offset;
|
18
|
-
var visibleRange = state.visibleRange,
|
19
|
-
getDatesInWeek = state.getDatesInWeek;
|
20
|
-
var _useLocale = useLocale(),
|
21
|
-
locale = _useLocale.locale;
|
22
|
-
var startDate = visibleRange.start.add(offset);
|
23
|
-
var endDate = endOfMonth(startDate);
|
24
|
-
var _useCalendarGrid = useCalendarGrid({
|
25
|
-
startDate: startDate,
|
26
|
-
endDate: endDate
|
27
|
-
}, state),
|
28
|
-
gridProps = _useCalendarGrid.gridProps,
|
29
|
-
headerProps = _useCalendarGrid.headerProps,
|
30
|
-
weekDays = _useCalendarGrid.weekDays;
|
31
|
-
var weeksInMonth = getWeeksInMonth(startDate, locale);
|
32
|
-
var getKey = function getKey(day, index) {
|
33
|
-
var _context;
|
34
|
-
return _concatInstanceProperty(_context = "".concat(day, "-")).call(_context, index);
|
35
|
-
};
|
36
|
-
return ___EmotionJSX(Table, _extends({}, gridProps, {
|
37
|
-
role: "grid"
|
38
|
-
}), ___EmotionJSX(TableHead, headerProps, ___EmotionJSX(TableRow, null, _mapInstanceProperty(weekDays).call(weekDays, function (day, index) {
|
39
|
-
return ___EmotionJSX(TableCell, {
|
40
|
-
isHeading: true,
|
41
|
-
variant: "rangeCalendar.columnHeader",
|
42
|
-
key: getKey(day, index),
|
43
|
-
role: "columnheader"
|
44
|
-
}, day);
|
45
|
-
}))), ___EmotionJSX(TableBody, {
|
46
|
-
variant: "rangeCalendar.calendarBody"
|
47
|
-
}, _mapInstanceProperty(_context2 = _Array$from(_keysInstanceProperty(_context3 = Array(weeksInMonth)).call(_context3))).call(_context2, function (weekIndex) {
|
48
|
-
var _context4;
|
49
|
-
return ___EmotionJSX(TableRow, {
|
50
|
-
key: weekIndex
|
51
|
-
}, _mapInstanceProperty(_context4 = getDatesInWeek(weekIndex, startDate)).call(_context4, function (date) {
|
52
|
-
return (date === null || date === void 0 ? void 0 : date.day) && ___EmotionJSX(RangeCalendarCell, {
|
53
|
-
key: date.toString(),
|
54
|
-
state: state,
|
55
|
-
date: date,
|
56
|
-
currentMonth: startDate
|
57
|
-
});
|
58
|
-
}));
|
59
|
-
})));
|
60
|
-
};
|
61
|
-
export default RangeCalendarGrid;
|
@@ -1,76 +0,0 @@
|
|
1
|
-
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
|
-
import React from 'react';
|
3
|
-
import ChevronLeftIcon from '@pingux/mdi-react/ChevronLeftIcon';
|
4
|
-
import ChevronRightIcon from '@pingux/mdi-react/ChevronRightIcon';
|
5
|
-
import { useDateFormatter } from '@react-aria/i18n';
|
6
|
-
import { VisuallyHidden } from '@react-aria/visually-hidden';
|
7
|
-
import { Box, Icon, IconButton, Text } from '../../index';
|
8
|
-
import { jsx as ___EmotionJSX } from "@emotion/react";
|
9
|
-
var RangeCalendarHeader = function RangeCalendarHeader(props) {
|
10
|
-
var state = props.state,
|
11
|
-
calendarProps = props.calendarProps,
|
12
|
-
prevButtonProps = props.prevButtonProps,
|
13
|
-
nextButtonProps = props.nextButtonProps;
|
14
|
-
var monthDateFormatter = useDateFormatter({
|
15
|
-
month: 'long',
|
16
|
-
year: 'numeric',
|
17
|
-
timeZone: state.timeZone
|
18
|
-
});
|
19
|
-
|
20
|
-
// to remove warning for unknown event handler property `onFocusChange`.
|
21
|
-
delete prevButtonProps.onFocusChange;
|
22
|
-
delete nextButtonProps.onFocusChange;
|
23
|
-
return ___EmotionJSX(Box, {
|
24
|
-
variant: "rangeCalendar.calendarHeaderContainer",
|
25
|
-
isRow: true
|
26
|
-
}, ___EmotionJSX(VisuallyHidden, {
|
27
|
-
"aria-live": "assertive"
|
28
|
-
}, ___EmotionJSX(Text, null, calendarProps['aria-label'])), ___EmotionJSX(Box, {
|
29
|
-
isRow: true,
|
30
|
-
variant: "rangeCalendar.calendarHeader"
|
31
|
-
}, ___EmotionJSX(Box, {
|
32
|
-
style: {
|
33
|
-
position: 'absolute',
|
34
|
-
left: '10px'
|
35
|
-
}
|
36
|
-
}, ___EmotionJSX(IconButton, _extends({}, prevButtonProps, {
|
37
|
-
"aria-label": "Previous month navigation"
|
38
|
-
}), ___EmotionJSX(Icon, {
|
39
|
-
icon: ChevronLeftIcon,
|
40
|
-
size: 25,
|
41
|
-
title: {
|
42
|
-
name: 'Chevron Left Icon'
|
43
|
-
}
|
44
|
-
}))), ___EmotionJSX(Text, {
|
45
|
-
"aria-hidden": true,
|
46
|
-
variant: "itemTitle",
|
47
|
-
role: "heading",
|
48
|
-
"aria-level": 3,
|
49
|
-
fontWeight: 3
|
50
|
-
}, monthDateFormatter.format(state.visibleRange.start.toDate(state.timeZone)))), ___EmotionJSX(Box, {
|
51
|
-
isRow: true,
|
52
|
-
variant: "rangeCalendar.calendarHeader"
|
53
|
-
}, ___EmotionJSX(Text, {
|
54
|
-
"aria-hidden": true,
|
55
|
-
variant: "itemTitle",
|
56
|
-
role: "heading",
|
57
|
-
"aria-level": 3,
|
58
|
-
fontWeight: 3
|
59
|
-
}, monthDateFormatter.format(state.visibleRange.start.add({
|
60
|
-
months: 1
|
61
|
-
}).toDate(state.timeZone))), ___EmotionJSX(Box, {
|
62
|
-
style: {
|
63
|
-
position: 'absolute',
|
64
|
-
right: '10px'
|
65
|
-
}
|
66
|
-
}, ___EmotionJSX(IconButton, _extends({}, nextButtonProps, {
|
67
|
-
"aria-label": "Next month navigation"
|
68
|
-
}), ___EmotionJSX(Icon, {
|
69
|
-
icon: ChevronRightIcon,
|
70
|
-
size: 25,
|
71
|
-
title: {
|
72
|
-
name: 'Chevron Right Icon'
|
73
|
-
}
|
74
|
-
})))));
|
75
|
-
};
|
76
|
-
export default RangeCalendarHeader;
|