@via-profit/ui-kit 0.2.1-alpha.1 → 0.2.1-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.
Files changed (138) hide show
  1. package/Autocomplete/AutocompleteContainer.d.ts +33 -6
  2. package/Autocomplete/AutocompleteContainer.js +28 -24
  3. package/Autocomplete/AutocompleteItem.d.ts +1 -1
  4. package/Autocomplete/AutocompleteTextField.d.ts +3 -0
  5. package/Autocomplete/AutocompleteTextField.js +63 -1
  6. package/Autocomplete/OverrideMenuList.d.ts +4 -0
  7. package/Autocomplete/OverrideMenuList.js +39 -0
  8. package/Autocomplete/context.d.ts +9 -1
  9. package/Autocomplete/context.js +15 -1
  10. package/Autocomplete/index.js +9 -10
  11. package/Autocomplete2/Autocomplete2.d.ts +12 -0
  12. package/Autocomplete2/Autocomplete2.js +83 -0
  13. package/Autocomplete2/Autocomplete2TextField.d.ts +7 -0
  14. package/Autocomplete2/Autocomplete2TextField.js +39 -0
  15. package/Autocomplete2/index.d.ts +2 -0
  16. package/Autocomplete2/index.js +7 -0
  17. package/Avatar/index.js +1 -1
  18. package/Badge/BadgeDeleteButton.js +6 -6
  19. package/Badge/BadgeOutlined.js +2 -2
  20. package/Badge/BadgeStandard.js +1 -1
  21. package/Button/ButtonOutlined.js +1 -1
  22. package/Button/ButtonPlain.js +1 -1
  23. package/Button/ButtonStandard.js +4 -11
  24. package/Calendar/CalendarCell.js +6 -2
  25. package/Calendar/CalendarComponent.d.ts +226 -0
  26. package/Calendar/CalendarComponent.js +572 -0
  27. package/Calendar/CalendarControlButton.js +16 -9
  28. package/Calendar/CalendarDayBadge.js +1 -1
  29. package/Calendar/CalendarEmptyCell.d.ts +2 -2
  30. package/Calendar/CalendarEmptyCell.js +8 -3
  31. package/Calendar/CalendarHeading.js +2 -1
  32. package/Calendar/CalendarSubheading.js +3 -2
  33. package/Calendar/CalendarWeekDayCell.d.ts +10 -0
  34. package/Calendar/CalendarWeekDayCell.js +32 -0
  35. package/Calendar/CalendarWeekDayWeekNumber.d.ts +7 -0
  36. package/Calendar/CalendarWeekDayWeekNumber.js +38 -0
  37. package/Calendar/CalendarWeekRow.d.ts +2 -2
  38. package/Calendar/CalendarWeekRow.js +2 -1
  39. package/Calendar/CalendarWeekRowButton.d.ts +13 -0
  40. package/Calendar/CalendarWeekRowButton.js +31 -0
  41. package/Calendar/CalendarYearsSelector.d.ts +39 -1
  42. package/Calendar/CalendarYearsSelector.js +52 -16
  43. package/Calendar/IconChevronDown.d.ts +3 -0
  44. package/Calendar/IconChevronDown.js +31 -0
  45. package/Calendar/index.d.ts +7 -224
  46. package/Calendar/index.js +19 -281
  47. package/Calendar/use-calendar.d.ts +1 -1
  48. package/Color/Color.d.ts +138 -0
  49. package/Color/Color.js +324 -0
  50. package/Color/ColorGenerator.d.ts +29 -0
  51. package/Color/ColorGenerator.js +141 -0
  52. package/Color/ColorParser.d.ts +20 -0
  53. package/Color/ColorParser.js +284 -0
  54. package/Color/index.d.ts +4 -122
  55. package/Color/index.js +18 -473
  56. package/DatePicker/index.d.ts +2 -17
  57. package/DatePicker/index.js +47 -61
  58. package/DatePicker/useDatePickerFormat.js +5 -5
  59. package/ErrorBoundary/Fallback.d.ts +3 -0
  60. package/ErrorBoundary/Fallback.js +51 -0
  61. package/ErrorBoundary/RenderError.d.ts +6 -0
  62. package/ErrorBoundary/RenderError.js +80 -0
  63. package/ErrorBoundary/index.d.ts +7 -11
  64. package/ErrorBoundary/index.js +4 -51
  65. package/LoadingIndicator/Spinner.d.ts +5 -3
  66. package/LoadingIndicator/Spinner.js +61 -32
  67. package/LoadingIndicator/index.d.ts +3 -3
  68. package/LoadingIndicator/index.js +15 -2
  69. package/MaskedField/index.d.ts +1 -1
  70. package/MaskedField/index.js +11 -10
  71. package/Menu/AutoHeightWrapper.d.ts +6 -0
  72. package/Menu/AutoHeightWrapper.js +43 -0
  73. package/Menu/MeasuredItem.d.ts +10 -0
  74. package/Menu/MeasuredItem.js +51 -0
  75. package/Menu/MenuContainer.d.ts +51 -18
  76. package/Menu/MenuContainer.js +18 -11
  77. package/Menu/MenuItem.d.ts +24 -7
  78. package/Menu/MenuItem.js +13 -6
  79. package/Menu/MenuList.d.ts +4 -2
  80. package/Menu/MenuList.js +26 -6
  81. package/Menu/VirtualizedItem.d.ts +22 -0
  82. package/Menu/VirtualizedItem.js +69 -0
  83. package/Menu/VirtualizedList.d.ts +18 -0
  84. package/Menu/VirtualizedList.js +28 -0
  85. package/Menu/VirtualizedListComponent.d.ts +20 -0
  86. package/Menu/VirtualizedListComponent.js +305 -0
  87. package/Menu/index.d.ts +3 -1
  88. package/Menu/index.js +2 -0
  89. package/Popper/Popper.d.ts +7 -80
  90. package/Popper/Popper.js +26 -12
  91. package/Popper/PopperContainer.js +1 -1
  92. package/Popper/usePopprer.d.ts +88 -3
  93. package/Popper/usePopprer.js +240 -65
  94. package/Selectbox/SelectboxButton.d.ts +5 -0
  95. package/Selectbox/SelectboxButton.js +48 -8
  96. package/Selectbox/SelectboxButtonWrapper.d.ts +2 -0
  97. package/Selectbox/SelectboxButtonWrapper.js +1 -17
  98. package/Selectbox/SelectboxMenu.d.ts +12 -0
  99. package/Selectbox/SelectboxMenu.js +50 -0
  100. package/Selectbox/index.d.ts +5 -5
  101. package/Selectbox/index.js +115 -97
  102. package/Surface/index.js +1 -1
  103. package/Swiper/Swiper.d.ts +44 -0
  104. package/Swiper/Swiper.js +139 -0
  105. package/Swiper/SwiperContainer.d.ts +7 -0
  106. package/Swiper/SwiperContainer.js +14 -0
  107. package/Swiper/SwiperSlide.d.ts +7 -0
  108. package/Swiper/SwiperSlide.js +55 -0
  109. package/Swiper/SwiperTrack.d.ts +14 -0
  110. package/Swiper/SwiperTrack.js +58 -0
  111. package/Swiper/SwiperWrapper.d.ts +14 -0
  112. package/Swiper/SwiperWrapper.js +60 -0
  113. package/Swiper/index.d.ts +7 -0
  114. package/Swiper/index.js +26 -0
  115. package/Switch/SwitchDot.js +1 -1
  116. package/Switch/SwitchTrack.js +1 -1
  117. package/TextField/TextFieldContainer.d.ts +2 -2
  118. package/TextField/TextFieldContainer.js +5 -3
  119. package/TextField/TextFieldErrorText.d.ts +2 -2
  120. package/TextField/TextFieldErrorText.js +5 -4
  121. package/TextField/TextFieldIconWrapper.d.ts +3 -3
  122. package/TextField/TextFieldIconWrapper.js +5 -3
  123. package/TextField/TextFieldInput.d.ts +2 -2
  124. package/TextField/TextFieldInput.js +6 -4
  125. package/TextField/TextFieldInputWrapper.d.ts +2 -2
  126. package/TextField/TextFieldInputWrapper.js +5 -3
  127. package/TextField/TextFieldLabel.d.ts +2 -2
  128. package/TextField/TextFieldLabel.js +5 -3
  129. package/TextField/TextFieldLabelAsterisk.d.ts +2 -2
  130. package/TextField/TextFieldLabelAsterisk.js +5 -3
  131. package/TextField/index.d.ts +8 -1
  132. package/TextField/index.js +49 -22
  133. package/ThemeProvider/createTheme.js +2 -2
  134. package/package.json +1 -1
  135. package/Calendar/reducer.d.ts +0 -17
  136. package/Calendar/reducer.js +0 -50
  137. /package/Calendar/{IconChevronRight.d.ts → CalendarIconNext.d.ts} +0 -0
  138. /package/Calendar/{IconChevronRight.js → CalendarIconNext.js} +0 -0
@@ -17,10 +17,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  const react_1 = __importDefault(require("react"));
18
18
  const styled_1 = __importDefault(require("@emotion/styled"));
19
19
  const StyledCalendarSubheading = styled_1.default.div `
20
- font-weight: 200;
20
+ font-weight: 400;
21
21
  font-size: 1em;
22
- opacity: 0.6;
22
+ opacity: 0.8;
23
23
  margin-bottom: 1em;
24
+ text-align: center;
24
25
  `;
25
26
  const CalendarSubheading = (props, ref) => {
26
27
  const { children } = props, restProps = __rest(props, ["children"]);
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ export interface CalendarWeekCellProps extends React.HTMLAttributes<HTMLSpanElement> {
3
+ /**
4
+ * if cell day is today, then property will be true
5
+ */
6
+ readonly isToday?: boolean;
7
+ readonly inCurrentMonth?: boolean;
8
+ }
9
+ declare const _default: React.ForwardRefExoticComponent<CalendarWeekCellProps & React.RefAttributes<HTMLSpanElement>>;
10
+ export default _default;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ const react_1 = __importDefault(require("react"));
18
+ const styled_1 = __importDefault(require("@emotion/styled"));
19
+ const react_2 = require("@emotion/react");
20
+ const CalendarEmptyCell_1 = __importDefault(require("./CalendarEmptyCell"));
21
+ const Cell = (0, styled_1.default)(CalendarEmptyCell_1.default) `
22
+ color: currentColor;
23
+ ${({ $inCurrentMonth }) => !$inCurrentMonth &&
24
+ (0, react_2.css) `
25
+ opacity: 0.5;
26
+ `}
27
+ `;
28
+ const CalendarWeekDayCell = (props, ref) => {
29
+ const { isToday, children, inCurrentMonth } = props, restProps = __rest(props, ["isToday", "children", "inCurrentMonth"]);
30
+ return (react_1.default.createElement(Cell, Object.assign({}, restProps, { "$isToday": isToday, "$inCurrentMonth": inCurrentMonth, ref: ref }), children));
31
+ };
32
+ exports.default = react_1.default.forwardRef(CalendarWeekDayCell);
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { Week } from './use-calendar';
3
+ export interface CalendarWeekDayWeekNumberProps extends React.HTMLAttributes<HTMLSpanElement> {
4
+ readonly week: Week;
5
+ }
6
+ declare const _default: React.ForwardRefExoticComponent<CalendarWeekDayWeekNumberProps & React.RefAttributes<HTMLSpanElement>>;
7
+ export default _default;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ const react_1 = __importDefault(require("react"));
18
+ const styled_1 = __importDefault(require("@emotion/styled"));
19
+ const CalendarEmptyCell_1 = __importDefault(require("./CalendarEmptyCell"));
20
+ const Cell = (0, styled_1.default)(CalendarEmptyCell_1.default) `
21
+ font-weight: 800;
22
+ position: relative;
23
+ color: ${({ theme }) => theme.color.textPrimary.toString()};
24
+ &:before {
25
+ position: absolute;
26
+ content: '';
27
+ width: 1px;
28
+ right: 0;
29
+ top: 30%;
30
+ bottom: 30%;
31
+ background-color: currentColor;
32
+ }
33
+ `;
34
+ const CalendarWeekDayWeekNumber = (props, ref) => {
35
+ const { week, children } = props, restProps = __rest(props, ["week", "children"]);
36
+ return (react_1.default.createElement(Cell, Object.assign({}, restProps, { ref: ref }), children));
37
+ };
38
+ exports.default = react_1.default.forwardRef(CalendarWeekDayWeekNumber);
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- export type CalendarWeekRowProps = React.HTMLAttributes<HTMLDivElement>;
3
- declare const _default: React.ForwardRefExoticComponent<CalendarWeekRowProps & React.RefAttributes<HTMLDivElement>>;
2
+ export type CalendarWeekRowProps = React.HTMLAttributes<HTMLSpanElement>;
3
+ declare const _default: React.ForwardRefExoticComponent<CalendarWeekRowProps & React.RefAttributes<HTMLSpanElement>>;
4
4
  export default _default;
@@ -16,11 +16,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  const react_1 = __importDefault(require("react"));
18
18
  const styled_1 = __importDefault(require("@emotion/styled"));
19
- const StyledCalendarWeekRow = styled_1.default.div `
19
+ const StyledCalendarWeekRow = styled_1.default.span `
20
20
  display: flex;
21
21
  flex-direction: row;
22
22
  justify-content: center;
23
23
  align-items: stretch;
24
+ color: inherit;
24
25
  `;
25
26
  const CalendarWeekRow = (props, ref) => {
26
27
  const { children } = props, restProps = __rest(props, ["children"]);
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { Week } from './use-calendar';
3
+ export type CalendarWeekRowButtonProps = React.HTMLAttributes<HTMLButtonElement> & {
4
+ readonly isSelected?: boolean;
5
+ readonly accentColor: string;
6
+ readonly week: Week;
7
+ };
8
+ declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLButtonElement> & {
9
+ readonly isSelected?: boolean | undefined;
10
+ readonly accentColor: string;
11
+ readonly week: Week;
12
+ } & React.RefAttributes<HTMLButtonElement>>;
13
+ export default _default;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ const react_1 = __importDefault(require("react"));
18
+ const styled_1 = __importDefault(require("@emotion/styled"));
19
+ const Button_1 = __importDefault(require("../Button"));
20
+ const CalendarWeekRow_1 = __importDefault(require("./CalendarWeekRow"));
21
+ const StyleButton = (0, styled_1.default)(Button_1.default) `
22
+ padding: 0.2em 0.5em !important;
23
+ font-size: 1em;
24
+ border-radius: ${({ theme }) => theme.shape.radiusFactor * 3}em;
25
+ `;
26
+ const CalendarWeekRowButton = (props, ref) => {
27
+ const { children, isSelected, accentColor } = props, restProps = __rest(props, ["children", "isSelected", "accentColor"]);
28
+ return (react_1.default.createElement(StyleButton, Object.assign({ type: "button", variant: isSelected ? 'standard' : 'plain', color: isSelected ? accentColor : 'default' }, restProps, { ref: ref }),
29
+ react_1.default.createElement(CalendarWeekRow_1.default, null, children)));
30
+ };
31
+ exports.default = react_1.default.forwardRef(CalendarWeekRowButton);
@@ -1,4 +1,42 @@
1
1
  import React from 'react';
2
- export type CalendarYearsSelectorProps = React.HTMLAttributes<HTMLDivElement>;
2
+ import { CalendarYearCellProps } from './CalendarYearCell';
3
+ export type CalendarYearsSelectorProps = {
4
+ readonly years: readonly number[];
5
+ /**
6
+ * Cell accent color
7
+ */
8
+ readonly accentColor: 'primary' | 'secondary' | string;
9
+ /**
10
+ * calendar locale
11
+ */
12
+ readonly locale: string;
13
+ /**
14
+ * Calendar date
15
+ */
16
+ readonly date: Date;
17
+ /**
18
+ * Minimum date limit
19
+
20
+ */
21
+ readonly minDate: Date;
22
+ /**
23
+ * Maximum date limit
24
+ */
25
+ readonly maxDate: Date;
26
+ /**
27
+ * Selected year callback
28
+ */
29
+ readonly onChange: (year: number) => void;
30
+ /**
31
+ * Overridable components map
32
+ */
33
+ readonly overrides?: CalendarYearsSelectorOverrides;
34
+ };
35
+ export type CalendarYearsSelectorOverrides = {
36
+ /**
37
+ * Year cell element in years list
38
+ */
39
+ readonly YearCell?: React.ComponentType<CalendarYearCellProps & React.RefAttributes<HTMLButtonElement>>;
40
+ };
3
41
  declare const _default: React.ForwardRefExoticComponent<CalendarYearsSelectorProps & React.RefAttributes<HTMLDivElement>>;
4
42
  export default _default;
@@ -1,30 +1,66 @@
1
1
  "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
14
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
4
  };
16
5
  Object.defineProperty(exports, "__esModule", { value: true });
17
6
  const react_1 = __importDefault(require("react"));
18
7
  const styled_1 = __importDefault(require("@emotion/styled"));
8
+ const CalendarYearCell_1 = __importDefault(require("./CalendarYearCell"));
9
+ const use_calendar_1 = __importDefault(require("./use-calendar"));
10
+ const VirtualizedList_1 = __importDefault(require("../Menu/VirtualizedList"));
19
11
  const SelectorContainer = styled_1.default.div `
20
- flex: 1;
21
12
  display: flex;
22
- flex-wrap: wrap;
23
- overflow-y: auto;
13
+ flex: 1;
24
14
  padding: 0.8em;
15
+ height: 100%;
16
+ width: 100%;
17
+ `;
18
+ const SelectorContainerInner = styled_1.default.div `
19
+ flex: 1;
20
+ position: relative;
21
+ `;
22
+ const Chunk = styled_1.default.div `
23
+ display: flex;
24
+ align-items: center;
25
+ justify-content: space-between;
25
26
  `;
26
27
  const CalendarYearsSelector = (props, ref) => {
27
- const { children } = props, restProps = __rest(props, ["children"]);
28
- return (react_1.default.createElement(SelectorContainer, Object.assign({}, restProps, { ref: ref }), children));
28
+ const containerRef = react_1.default.useRef(null);
29
+ const { years, date, overrides, accentColor = 'primary', locale = 'ru-RU', minDate, maxDate, onChange, } = props;
30
+ const [maxHeight, setMaxHeight] = react_1.default.useState(undefined);
31
+ const overridesMap = react_1.default.useMemo(() => ({
32
+ YearCell: (overrides === null || overrides === void 0 ? void 0 : overrides.YearCell) || CalendarYearCell_1.default,
33
+ }), [overrides]);
34
+ const { getYearLabel } = (0, use_calendar_1.default)({
35
+ locale,
36
+ minDate,
37
+ maxDate,
38
+ weekStartDay: 'monday',
39
+ displayLeadingZero: false,
40
+ });
41
+ const items2 = react_1.default.useMemo(() => {
42
+ const list = [];
43
+ for (let i = 0; i < years.length; i += 3) {
44
+ list.push(years.slice(i, i + 3).map(year => {
45
+ const item = {
46
+ value: year,
47
+ label: getYearLabel(new Date(year, date.getMonth(), date.getDate(), 0, 0, 0, 0)),
48
+ };
49
+ return item;
50
+ }));
51
+ }
52
+ return list;
53
+ }, [date, getYearLabel, years]);
54
+ react_1.default.useLayoutEffect(() => {
55
+ if (containerRef.current) {
56
+ setMaxHeight(containerRef.current.getBoundingClientRect().height);
57
+ }
58
+ }, []);
59
+ const renderItem = react_1.default.useCallback((item) => (react_1.default.createElement(Chunk, null, item.map(item => {
60
+ const isSelected = date.getFullYear() === item.value;
61
+ return (react_1.default.createElement(overridesMap.YearCell, { key: item.value, accentColor: accentColor, isSelected: isSelected, onClick: () => onChange(item.value) }, item.label));
62
+ }))), [accentColor, date, onChange, overridesMap]);
63
+ return (react_1.default.createElement(SelectorContainer, { ref: ref },
64
+ react_1.default.createElement(SelectorContainerInner, { ref: containerRef }, maxHeight && react_1.default.createElement(VirtualizedList_1.default, { items: items2, renderItem: renderItem }))));
29
65
  };
30
66
  exports.default = react_1.default.forwardRef(CalendarYearsSelector);
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare const ForwardRef: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement>, "ref"> & React.RefAttributes<SVGSVGElement>>;
3
+ export default ForwardRef;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ const React = __importStar(require("react"));
27
+ const react_1 = require("react");
28
+ const IconChevronDown = (props, ref) => (React.createElement("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 512 512", ref: ref }, props),
29
+ React.createElement("path", { d: "m105.79 160.82a24 24 0 0 0-10.76 6.2109 24 24 0 0 0 0 33.941l144 144a24.002 24.002 0 0 0 33.941 0l144-144a24 24 0 0 0 0-33.941 24 24 0 0 0-33.941 0l-127.03 127.03-127.03-127.03a24 24 0 0 0-23.182-6.2109z", fill: "currentColor" })));
30
+ const ForwardRef = (0, react_1.forwardRef)(IconChevronDown);
31
+ exports.default = ForwardRef;
@@ -1,224 +1,7 @@
1
- import React from 'react';
2
- import { CalendarBodyProps } from './CalendarBody';
3
- import { CalendarCellProps } from './CalendarCell';
4
- import { CalendarEmptyCellProps } from './CalendarEmptyCell';
5
- import { CalendarPaperProps } from './CalendarPaper';
6
- import { CalendarHeaderProps } from './CalendarHeader';
7
- import { CalendarWeekRowProps } from './CalendarWeekRow';
8
- import { CalendarDateContainerProps } from './CalendarDateContainer';
9
- import { CalendarToolbarProps } from './CalendarToolbar';
10
- import { CalendarYearsSelectorProps } from './CalendarYearsSelector';
11
- import { CalendarMonthsSelectorProps } from './CalendarMonthsSelector';
12
- import { CalendarMonthCellProps } from './CalendarMonthCell';
13
- import { CalendarYearCellProps } from './CalendarYearCell';
14
- import { CalendarDayBadgeProps } from './CalendarDayBadge';
15
- import { CalendarFooterProps } from './CalendarFooter';
16
- import { CalendarControlButtonProps } from './CalendarControlButton';
17
- import { CalendarHeadingProps } from './CalendarHeading';
18
- import { CalendarSubheadingProps } from './CalendarSubheading';
19
- import { CalendarIconPrevProps } from './CalendarIconPrev';
20
- import { CalendarIconNextProps } from './IconChevronRight';
21
- import { CalendarWeekDaysBarProps, WeekNameLabelFormat } from './CalendarWeekDaysBar';
22
- import { CalendarValue, WeekDayName } from './use-calendar';
23
- import { CalendarView as CalendarViewName } from './reducer';
24
- export * from './use-calendar';
25
- export * from './CalendarWeekDaysBar';
26
- export type CalendarView = CalendarViewName;
27
- export type CalendarProps<Range extends boolean | undefined = undefined> = {
28
- readonly range?: Range;
29
- /**
30
- * Selected date
31
- */
32
- readonly value?: CalendarValue<Range>;
33
- /**
34
- * selected value if your component should not be controlled
35
- */
36
- readonly defaultValue?: CalendarValue<Range>;
37
- /**
38
- * It will be called at the moment of selecting the given
39
- */
40
- readonly onChange: (dates: CalendarValue<Range>) => void;
41
- /**
42
- * calendar locale\
43
- * **Default:** `ru-RU`
44
- */
45
- readonly locale?: string;
46
- /**
47
- * array of badges
48
- */
49
- readonly badges?: readonly CalendarBadge[];
50
- /**
51
- * Minimum date limit\
52
- * **Default:** -100 year
53
-
54
- */
55
- readonly minDate?: Date;
56
- /**
57
- * Maximum date limit\
58
- * **Default:** +100 year
59
- */
60
- readonly maxDate?: Date;
61
- /**
62
- * The day the week starts from\
63
- * **Default:** `monday`
64
- */
65
- readonly weekStartDay?: WeekDayName;
66
- /**
67
- * Int weekday format\
68
- * **Default:** `short`
69
- */
70
- readonly weekDayLabelFormat?: WeekNameLabelFormat;
71
- /**
72
- * Display days with leading zero
73
- * **Default:** `false`
74
- */
75
- readonly displayLeadingZero?: boolean;
76
- /**
77
- * Mark current day cell\
78
- * **Default:** `true`
79
- */
80
- readonly markToday?: boolean;
81
- /**
82
- * Cell accent color\
83
- * **Default:** `primary`
84
- */
85
- readonly accentColor?: 'primary' | 'secondary' | string;
86
- /**
87
- * Tooltip for the Prev month button
88
- */
89
- readonly prevMonthButtonTooltip?: string;
90
- /**
91
- * Tooltip for the Next month button
92
- */
93
- readonly nextMonthButtonTooltip?: string;
94
- /**
95
- * Tooltip for tne month selector button
96
- */
97
- readonly changeMonthButtonTooltip?: string;
98
- /**
99
- * Tooltip for the year selector button
100
- */
101
- readonly changeYearButtonTooltip?: string;
102
- /**
103
- * Label for the Reset button. If label passed, then button will be rendered
104
- */
105
- readonly resetButtonLabel?: string;
106
- /**
107
- * Label for the Today button. If label passed, then button will be rendered
108
- */
109
- readonly todayButtonLabel?: string;
110
- /**
111
- * Heading
112
- */
113
- readonly heading?: React.ReactNode;
114
- /**
115
- * Subheading
116
- */
117
- readonly subheading?: React.ReactNode;
118
- /**
119
- * Initial name of the view\
120
- * **Default:** `days`
121
- */
122
- readonly initialView?: CalendarView;
123
- /**
124
- * Posibility calendar views list
125
- */
126
- readonly views?: readonly CalendarView[];
127
- /**
128
- * Custom footer elements
129
- */
130
- readonly footer?: JSX.Element;
131
- /**
132
- * Overridable components map
133
- */
134
- readonly overrides?: CalendarOverrides;
135
- };
136
- export interface CalendarOverrides {
137
- /**
138
- * Element container
139
- */
140
- readonly Body?: React.ComponentType<CalendarBodyProps & React.RefAttributes<HTMLDivElement>>;
141
- /**
142
- * Day element
143
- */
144
- readonly Cell?: React.ComponentType<CalendarCellProps & React.RefAttributes<HTMLButtonElement>>;
145
- /**
146
- * Empty cell element
147
- */
148
- readonly EmptyCell?: React.ComponentType<CalendarEmptyCellProps & React.RefAttributes<HTMLButtonElement>>;
149
- /**
150
- * Common container element
151
- */
152
- readonly Paper?: React.ComponentType<CalendarPaperProps & React.RefAttributes<HTMLDivElement>>;
153
- /**
154
- * Header wrapper element
155
- */
156
- readonly Header?: React.ComponentType<CalendarHeaderProps & React.RefAttributes<HTMLDivElement>>;
157
- /**
158
- * Week row container element
159
- */
160
- readonly WeekRow?: React.ComponentType<CalendarWeekRowProps & React.RefAttributes<HTMLDivElement>>;
161
- /**
162
- * Days wrapper element
163
- */
164
- readonly DateContainer?: React.ComponentType<CalendarDateContainerProps & React.RefAttributes<HTMLDivElement>>;
165
- /**
166
- * Toolbar wrapper element
167
- */
168
- readonly Toolbar?: React.ComponentType<CalendarToolbarProps & React.RefAttributes<HTMLDivElement>>;
169
- /**
170
- * Years list element (year view)
171
- */
172
- readonly YearsSelector?: React.ComponentType<CalendarYearsSelectorProps & React.RefAttributes<HTMLDivElement>>;
173
- /**
174
- * Monthes list element (month view)
175
- */
176
- readonly MonthsSelector?: React.ComponentType<CalendarMonthsSelectorProps & React.RefAttributes<HTMLDivElement>>;
177
- /**
178
- * Month cell element in monthes list
179
- */
180
- readonly MonthCell?: React.ComponentType<CalendarMonthCellProps & React.RefAttributes<HTMLButtonElement>>;
181
- /**
182
- * Year cell element in years list
183
- */
184
- readonly YearCell?: React.ComponentType<CalendarYearCellProps & React.RefAttributes<HTMLButtonElement>>;
185
- /**
186
- * Badge of the day cell element
187
- */
188
- readonly DayBadge?: React.ComponentType<CalendarDayBadgeProps & React.RefAttributes<HTMLSpanElement>>;
189
- /**
190
- * Footer container element
191
- */
192
- readonly Footer?: React.ComponentType<CalendarFooterProps & React.RefAttributes<HTMLDivElement>>;
193
- /**
194
- * Common button element
195
- */
196
- readonly ControlButton?: React.ComponentType<CalendarControlButtonProps & React.RefAttributes<HTMLButtonElement>>;
197
- /**
198
- * Heading element
199
- */
200
- readonly Heading?: React.ComponentType<CalendarHeadingProps & React.RefAttributes<HTMLDivElement>>;
201
- /**
202
- * Subheading element
203
- */
204
- readonly Subheading?: React.ComponentType<CalendarSubheadingProps & React.RefAttributes<HTMLDivElement>>;
205
- /**
206
- * Prev icon element in prev month button
207
- */
208
- readonly IconPrev?: React.ComponentType<CalendarIconPrevProps & React.RefAttributes<SVGElement>>;
209
- /**
210
- * Next icon element in next month button
211
- */
212
- readonly IconNext?: React.ComponentType<CalendarIconNextProps & React.RefAttributes<SVGElement>>;
213
- /**
214
- * Weeks bar element
215
- */
216
- readonly WeekDaysBar?: React.ComponentType<CalendarWeekDaysBarProps & React.RefAttributes<HTMLDivElement>>;
217
- }
218
- export type CalendarBadge = {
219
- readonly date: Date;
220
- readonly badgeContent: React.ReactNode;
221
- readonly accentColor?: 'primary' | 'secondary' | string;
222
- };
223
- declare const Calendar: <Range_1 extends boolean | undefined = undefined>(props: CalendarProps<Range_1>) => React.ReactNode;
224
- export default Calendar;
1
+ import * as React from 'react';
2
+ import { CalendarProps, CalendarRef } from './CalendarComponent';
3
+ export * from './CalendarComponent';
4
+ declare const _default: <IsRangeValue extends boolean | undefined = undefined>(props: CalendarProps<IsRangeValue> & {
5
+ ref?: React.Ref<CalendarRef<IsRangeValue>> | undefined;
6
+ }) => React.ReactElement;
7
+ export default _default;