@astral/ui 0.29.0 → 0.32.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.
Files changed (125) hide show
  1. package/ButtonBase/ButtonBase.d.ts +1 -1
  2. package/ButtonBase/ButtonBase.js +4 -4
  3. package/ContentState/ContentState.d.ts +35 -0
  4. package/ContentState/ContentState.js +33 -0
  5. package/ContentState/index.d.ts +2 -0
  6. package/ContentState/index.js +14 -0
  7. package/ContentState/types.d.ts +27 -0
  8. package/ContentState/types.js +2 -0
  9. package/DatePicker/DatePicker.d.ts +10 -2
  10. package/DatePicker/DatePicker.js +40 -38
  11. package/DatePicker/DatePickerDay/DatePickerDay.d.ts +7 -0
  12. package/DatePicker/DatePickerDay/DatePickerDay.js +20 -0
  13. package/DatePicker/DatePickerDay/index.d.ts +1 -0
  14. package/DatePicker/DatePickerDay/index.js +5 -0
  15. package/DatePicker/DatePickerDay/styled.d.ts +4 -0
  16. package/DatePicker/DatePickerDay/styled.js +11 -0
  17. package/DatePicker/DatePickerHeader/DatePickerHeader.d.ts +3 -0
  18. package/DatePicker/DatePickerHeader/DatePickerHeader.js +31 -0
  19. package/DatePicker/DatePickerHeader/index.d.ts +1 -0
  20. package/DatePicker/DatePickerHeader/index.js +5 -0
  21. package/DatePicker/DatePickerHeader/styled.d.ts +20 -0
  22. package/DatePicker/DatePickerHeader/styled.js +12 -0
  23. package/DatePicker/index.d.ts +1 -0
  24. package/DatePicker/index.js +1 -0
  25. package/DatePicker/styled.d.ts +5 -0
  26. package/DatePicker/styled.js +70 -0
  27. package/DatePicker/types.d.ts +0 -2
  28. package/DatePickerProvider/DatePickerProvider.d.ts +13 -0
  29. package/DatePickerProvider/DatePickerProvider.js +26 -0
  30. package/DatePickerProvider/index.d.ts +1 -0
  31. package/DatePickerProvider/index.js +13 -0
  32. package/DropdownButton/DropdownButton.d.ts +9 -0
  33. package/DropdownButton/DropdownButton.js +37 -0
  34. package/DropdownButton/index.d.ts +1 -0
  35. package/DropdownButton/index.js +13 -0
  36. package/DropdownButton/styles.d.ts +11 -0
  37. package/DropdownButton/styles.js +28 -0
  38. package/GlobalStyles/GlobalStyles.js +11 -0
  39. package/IconButton/IconButton.d.ts +1 -1
  40. package/IconButton/IconButton.js +4 -4
  41. package/IconButton/styled.d.ts +1 -5
  42. package/IconDropdownButton/IconDropdownButton.d.ts +9 -0
  43. package/IconDropdownButton/IconDropdownButton.js +36 -0
  44. package/IconDropdownButton/index.d.ts +1 -0
  45. package/IconDropdownButton/index.js +13 -0
  46. package/IconDropdownButton/styles.d.ts +11 -0
  47. package/IconDropdownButton/styles.js +19 -0
  48. package/MaskField/MaskField.d.ts +13 -1
  49. package/MaskField/MaskField.js +5 -2
  50. package/MaskField/types.d.ts +0 -7
  51. package/Menu/Menu.d.ts +3 -3
  52. package/Menu/Menu.js +2 -20
  53. package/Notification/NotificationTemplate/styled.d.ts +1 -5
  54. package/Placeholder/styled.js +1 -1
  55. package/Profile/Profile.js +3 -14
  56. package/esm/ButtonBase/ButtonBase.d.ts +1 -1
  57. package/esm/ButtonBase/ButtonBase.js +4 -3
  58. package/esm/ContentState/ContentState.d.ts +35 -0
  59. package/esm/ContentState/ContentState.js +29 -0
  60. package/esm/ContentState/index.d.ts +2 -0
  61. package/esm/ContentState/index.js +2 -0
  62. package/esm/ContentState/types.d.ts +27 -0
  63. package/esm/ContentState/types.js +1 -0
  64. package/esm/DatePicker/DatePicker.d.ts +10 -2
  65. package/esm/DatePicker/DatePicker.js +38 -39
  66. package/esm/DatePicker/DatePickerDay/DatePickerDay.d.ts +7 -0
  67. package/esm/DatePicker/DatePickerDay/DatePickerDay.js +16 -0
  68. package/esm/DatePicker/DatePickerDay/index.d.ts +1 -0
  69. package/esm/DatePicker/DatePickerDay/index.js +1 -0
  70. package/esm/DatePicker/DatePickerDay/styled.d.ts +4 -0
  71. package/esm/DatePicker/DatePickerDay/styled.js +8 -0
  72. package/esm/DatePicker/DatePickerHeader/DatePickerHeader.d.ts +3 -0
  73. package/esm/DatePicker/DatePickerHeader/DatePickerHeader.js +24 -0
  74. package/esm/DatePicker/DatePickerHeader/index.d.ts +1 -0
  75. package/esm/DatePicker/DatePickerHeader/index.js +1 -0
  76. package/esm/DatePicker/DatePickerHeader/styled.d.ts +20 -0
  77. package/esm/DatePicker/DatePickerHeader/styled.js +9 -0
  78. package/esm/DatePicker/index.d.ts +1 -0
  79. package/esm/DatePicker/index.js +1 -0
  80. package/esm/DatePicker/styled.d.ts +5 -0
  81. package/esm/DatePicker/styled.js +67 -0
  82. package/esm/DatePicker/types.d.ts +0 -2
  83. package/esm/DatePickerProvider/DatePickerProvider.d.ts +13 -0
  84. package/esm/DatePickerProvider/DatePickerProvider.js +19 -0
  85. package/esm/DatePickerProvider/index.d.ts +1 -0
  86. package/esm/DatePickerProvider/index.js +1 -0
  87. package/esm/DropdownButton/DropdownButton.d.ts +9 -0
  88. package/esm/DropdownButton/DropdownButton.js +34 -0
  89. package/esm/DropdownButton/index.d.ts +1 -0
  90. package/esm/DropdownButton/index.js +1 -0
  91. package/esm/DropdownButton/styles.d.ts +11 -0
  92. package/esm/DropdownButton/styles.js +25 -0
  93. package/esm/GlobalStyles/GlobalStyles.js +11 -0
  94. package/esm/IconButton/IconButton.d.ts +1 -1
  95. package/esm/IconButton/IconButton.js +4 -3
  96. package/esm/IconButton/styled.d.ts +1 -5
  97. package/esm/IconDropdownButton/IconDropdownButton.d.ts +9 -0
  98. package/esm/IconDropdownButton/IconDropdownButton.js +33 -0
  99. package/esm/IconDropdownButton/index.d.ts +1 -0
  100. package/esm/IconDropdownButton/index.js +1 -0
  101. package/esm/IconDropdownButton/styles.d.ts +11 -0
  102. package/esm/IconDropdownButton/styles.js +16 -0
  103. package/esm/MaskField/MaskField.d.ts +13 -1
  104. package/esm/MaskField/MaskField.js +5 -2
  105. package/esm/MaskField/types.d.ts +0 -7
  106. package/esm/Menu/Menu.d.ts +3 -3
  107. package/esm/Menu/Menu.js +2 -16
  108. package/esm/Notification/NotificationTemplate/styled.d.ts +1 -5
  109. package/esm/Placeholder/styled.js +1 -1
  110. package/esm/Profile/Profile.js +4 -15
  111. package/esm/hooks/index.d.ts +1 -0
  112. package/esm/hooks/index.js +1 -0
  113. package/esm/hooks/useMenu.d.ts +21 -0
  114. package/esm/hooks/useMenu.js +8 -0
  115. package/esm/index.d.ts +7 -1
  116. package/esm/index.js +7 -1
  117. package/esm/theme/components/MuiButton.js +9 -0
  118. package/hooks/index.d.ts +1 -0
  119. package/hooks/index.js +13 -0
  120. package/hooks/useMenu.d.ts +21 -0
  121. package/hooks/useMenu.js +12 -0
  122. package/index.d.ts +7 -1
  123. package/index.js +7 -1
  124. package/package.json +5 -4
  125. package/theme/components/MuiButton.js +9 -0
@@ -0,0 +1,29 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { Fragment } from 'react';
14
+ import { Button, CircularProgress, Placeholder, Typography } from '..';
15
+ export var ContentState = function (props) {
16
+ var isLoading = props.isLoading, _a = props.loadingContent, LoadingContent = _a === void 0 ? _jsx(CircularProgress, { color: "primary" }, void 0) : _a, isError = props.isError, errorState = props.errorState, isCustom = props.isCustom, customState = props.customState, children = props.children;
17
+ if (isLoading)
18
+ return _jsx(Fragment, { children: LoadingContent }, void 0);
19
+ if (isCustom && customState) {
20
+ return _jsx(Placeholder, __assign({}, customState), void 0);
21
+ }
22
+ if (isError && errorState) {
23
+ var _b = errorState.title, title = _b === void 0 ? 'Произошла ошибка' : _b, imgAlt = errorState.imgAlt, imgSrc = errorState.imgSrc, errorList = errorState.errorList, onRetry = errorState.onRetry, _c = errorState.actions, actions = _c === void 0 ? _jsx(Button, __assign({ onClick: onRetry }, { children: "\u041F\u043E\u043F\u0440\u043E\u0431\u043E\u0432\u0430\u0442\u044C \u0441\u043D\u043E\u0432\u0430" }), void 0) : _c;
24
+ var description = errorList.map(function (item, index) { return (_jsxs(Fragment, { children: [_jsx(Typography, __assign({ component: "span" }, { children: item }), void 0), _jsx("br", {}, void 0)] }, index)); });
25
+ return (_jsx(Placeholder, { title: title, description: description, imgAlt: imgAlt, imgSrc: imgSrc, Actions: actions }, void 0));
26
+ }
27
+ return _jsx(Fragment, { children: children }, void 0);
28
+ };
29
+ export default ContentState;
@@ -0,0 +1,2 @@
1
+ export * from './ContentState';
2
+ export * from './types';
@@ -0,0 +1,2 @@
1
+ export * from './ContentState';
2
+ export * from './types';
@@ -0,0 +1,27 @@
1
+ import { ReactNode } from 'react';
2
+ export declare type ContentStateErrorProps = {
3
+ /**
4
+ * Название ошибки
5
+ */
6
+ title?: string;
7
+ /**
8
+ * Изображение ошибки
9
+ */
10
+ imgSrc: string;
11
+ /**
12
+ * Alt атрибут для изображения
13
+ */
14
+ imgAlt: string;
15
+ /**
16
+ * Список ошибок для отображения
17
+ */
18
+ errorList: string[];
19
+ /**
20
+ * Элементы кнопок для дальнейших действий
21
+ */
22
+ actions?: ReactNode;
23
+ /**
24
+ * Функция для повторного действия
25
+ */
26
+ onRetry: () => void;
27
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,12 @@
1
1
  /// <reference types="react" />
2
- import { DatePickerProps } from './types';
3
- export declare const DatePicker: import("react").ForwardRefExoticComponent<DatePickerProps & import("react").RefAttributes<HTMLDivElement>>;
2
+ import { ReactDatePickerProps } from 'react-datepicker';
3
+ import { TextFieldProps } from '../TextField';
4
+ export declare type Props = Omit<ReactDatePickerProps, 'renderCustomHeader' | 'locale' | 'renderCustomHeader' | 'renderDayContents' | 'customInput' | 'selected' | 'value' | 'placeholderText'> & {
5
+ inputProps?: TextFieldProps;
6
+ value?: Date;
7
+ };
8
+ export declare const DatePicker: import("react").ForwardRefExoticComponent<Omit<ReactDatePickerProps<never, undefined>, "value" | "selected" | "locale" | "renderCustomHeader" | "renderDayContents" | "customInput" | "placeholderText"> & {
9
+ inputProps?: TextFieldProps | undefined;
10
+ value?: Date | undefined;
11
+ } & import("react").RefAttributes<HTMLInputElement>>;
4
12
  export default DatePicker;
@@ -21,47 +21,46 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
- import { forwardRef, useCallback } from 'react';
25
- import { DatePicker as MuiDatePicker } from '@mui/lab';
24
+ import { forwardRef, useContext } from 'react';
25
+ import ReactDatePicker from 'react-datepicker';
26
+ import { InputAdornment } from '@mui/material';
26
27
  import { CalendarOutlineMd } from '@astral/icons';
27
- import { TextField } from '../TextField';
28
- var componentsProps = {
29
- switchViewButton: {
30
- sx: {
31
- padding: 1,
32
- borderRadius: 1,
33
- },
34
- },
35
- leftArrowButton: {
36
- sx: {
37
- padding: 1,
38
- borderRadius: 1,
39
- },
40
- },
41
- rightArrowButton: {
42
- sx: {
43
- padding: 1,
44
- borderRadius: 1,
45
- },
46
- },
47
- };
28
+ import { isValid, parse } from 'date-fns';
29
+ import { MaskField } from '../MaskField';
30
+ import { DatePickerContext } from '../DatePickerProvider';
31
+ import { DatePickerWrapper } from './styled';
32
+ import { DatePickerHeader } from './DatePickerHeader';
33
+ import { DatePickerDay } from './DatePickerDay';
34
+ var MIN_YEAR = 1000;
48
35
  export var DatePicker = forwardRef(function (props, ref) {
49
- var _a = props.value, value = _a === void 0 ? new Date() : _a, _b = props.mask, mask = _b === void 0 ? '__.__.____' : _b, restProps = __rest(props, ["value", "mask"]);
50
- var renderInput = useCallback(function (params) {
51
- var textFieldParams = params;
52
- return _jsx(TextField, __assign({}, textFieldParams), void 0);
53
- }, []);
54
- return (_jsx(MuiDatePicker, __assign({}, restProps, { ref: ref, value: value, mask: mask, showDaysOutsideCurrentMonth: true, renderInput: renderInput, components: { OpenPickerIcon: CalendarOutlineMd }, componentsProps: componentsProps, OpenPickerButtonProps: {
55
- sx: {
56
- borderRadius: 1,
57
- },
58
- }, PaperProps: {
59
- sx: {
60
- marginTop: 2,
61
- boxShadow: function (theme) { return theme.elevation[200]; },
36
+ var value = props.value, onChange = props.onChange, _a = props.inputProps, inputProps = _a === void 0 ? {} : _a, _b = props.dateFormat, dateFormat = _b === void 0 ? 'dd.MM.yyyy' : _b, restProps = __rest(props, ["value", "onChange", "inputProps", "dateFormat"]);
37
+ var placeholder = inputProps.placeholder, restInputProps = __rest(inputProps, ["placeholder"]);
38
+ var locale = useContext(DatePickerContext).locale;
39
+ // уберкостыль, react-date-picker забирает значение из event.target.value
40
+ var handleMaskFieldAccept = function (val, _maskRef, _e, onMaskFieldChange) {
41
+ onMaskFieldChange === null || onMaskFieldChange === void 0 ? void 0 : onMaskFieldChange({
42
+ target: {
43
+ value: val,
62
44
  },
63
- }, PopperProps: {
64
- placement: 'bottom-start',
65
- } }), void 0));
45
+ });
46
+ };
47
+ var handleChangeRaw = function (e) {
48
+ var date = parse(e === null || e === void 0 ? void 0 : e.target.value, dateFormat, new Date());
49
+ // если инпут пустой - кладем в value null
50
+ if (!(e === null || e === void 0 ? void 0 : e.target.value)) {
51
+ onChange(null, e);
52
+ }
53
+ if (isValid(date) && date.getFullYear() >= MIN_YEAR) {
54
+ onChange(date, e);
55
+ }
56
+ };
57
+ return (_jsx(DatePickerWrapper, { children: _jsx(ReactDatePicker, __assign({}, restProps, { locale: locale, selected: value, openToDate: value !== null && value !== void 0 ? value : undefined, dateFormat: dateFormat, placeholderText: placeholder, onChange: onChange, onChangeRaw: handleChangeRaw, renderCustomHeader: function (renderProps) { return (_jsx(DatePickerHeader, __assign({}, renderProps), void 0)); }, renderDayContents: function (dayOfMonth) { return (_jsx(DatePickerDay, { dayOfMonth: dayOfMonth }, void 0)); }, customInput: _jsx(MaskField, __assign({}, restInputProps, { mask: Date, autofix: "pad", onAccept: handleMaskFieldAccept, InputProps: {
58
+ endAdornment: (_jsx(InputAdornment, __assign({ position: "end" }, { children: _jsx(CalendarOutlineMd, {}, void 0) }), void 0)),
59
+ }, inputRef: function (el) {
60
+ // если передан ref - пишем в ref.current элемент из MaskField (inputRef принимает только функцию)
61
+ if (ref) {
62
+ ref.current = el;
63
+ }
64
+ } }), void 0) }), void 0) }, void 0));
66
65
  });
67
66
  export default DatePicker;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ declare type Props = {
3
+ dayOfMonth: number;
4
+ date?: Date;
5
+ };
6
+ export declare const DatePickerDay: (props: Props) => JSX.Element;
7
+ export {};
@@ -0,0 +1,16 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { DatePickerDayButton } from './styled';
14
+ export var DatePickerDay = function (props) {
15
+ return (_jsx(DatePickerDayButton, __assign({ variant: "text" }, { children: props.dayOfMonth }), void 0));
16
+ };
@@ -0,0 +1 @@
1
+ export { DatePickerDay } from './DatePickerDay';
@@ -0,0 +1 @@
1
+ export { DatePickerDay } from './DatePickerDay';
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const DatePickerDayButton: import("@emotion/styled").StyledComponent<Pick<import("../../Button").ButtonProps, "disabled" | "component" | "href" | "onFocusVisible" | "tabIndex" | "type" | "action" | "children" | "form" | "slot" | "title" | "key" | "css" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "size" | "variant" | keyof import("@mui/material/OverridableComponent").CommonProps | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "sx" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "startIcon" | "loading" | "loadingIndicator" | "loadingPosition"> & import("react").RefAttributes<HTMLButtonElement> & {
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ }, {}, {}>;
@@ -0,0 +1,8 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import { Button } from '../../Button';
6
+ import { styled } from '../../styles';
7
+ export var DatePickerDayButton = styled(Button)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n min-width: 41px;\n height: 32px;\n"], ["\n min-width: 41px;\n height: 32px;\n"])));
8
+ var templateObject_1;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { ReactDatePickerCustomHeaderProps } from 'react-datepicker';
3
+ export declare const DatePickerHeader: (props: ReactDatePickerCustomHeaderProps) => JSX.Element;
@@ -0,0 +1,24 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { useContext, useMemo } from 'react';
14
+ import { NextOutlineMd, PreviousOutlineMd } from '@astral/icons';
15
+ import format from 'date-fns/format';
16
+ import { IconButton } from '../../IconButton';
17
+ import { DatePickerContext } from '../../DatePickerProvider';
18
+ import { DatePickerHeaderTitle, DatePickerHeaderWrapper } from './styled';
19
+ export var DatePickerHeader = function (props) {
20
+ var increaseMonth = props.increaseMonth, decreaseMonth = props.decreaseMonth, date = props.date;
21
+ var locale = useContext(DatePickerContext).locale;
22
+ var localizedDate = useMemo(function () { return format(date, 'LLLL yyy', { locale: locale }); }, [date]);
23
+ return (_jsxs(DatePickerHeaderWrapper, { children: [_jsx(IconButton, __assign({ variant: "text", onClick: decreaseMonth }, { children: _jsx(PreviousOutlineMd, {}, void 0) }), void 0), _jsx(DatePickerHeaderTitle, __assign({ variant: "h6" }, { children: localizedDate }), void 0), _jsx(IconButton, __assign({ variant: "text", onClick: increaseMonth }, { children: _jsx(NextOutlineMd, {}, void 0) }), void 0)] }, void 0));
24
+ };
@@ -0,0 +1 @@
1
+ export { DatePickerHeader } from './DatePickerHeader';
@@ -0,0 +1 @@
1
+ export { DatePickerHeader } from './DatePickerHeader';
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" />
2
+ export declare const DatePickerHeaderWrapper: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
+ export declare const DatePickerHeaderTitle: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
7
+ align?: "inherit" | "left" | "right" | "center" | "justify" | undefined;
8
+ children?: import("react").ReactNode;
9
+ classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
10
+ gutterBottom?: boolean | undefined;
11
+ noWrap?: boolean | undefined;
12
+ paragraph?: boolean | undefined;
13
+ sx?: import("@mui/system").SxProps<import("@mui/material").Theme> | undefined;
14
+ variant?: "inherit" | "small" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitle1" | "subtitle2" | "body1" | "body2" | "caption" | "button" | "overline" | "h7" | "h8" | "h9" | "ui" | "link" | "pointer" | "code" | "div" | undefined;
15
+ variantMapping?: Partial<Record<"inherit" | "small" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitle1" | "subtitle2" | "body1" | "body2" | "caption" | "button" | "overline" | "h7" | "h8" | "h9" | "ui" | "link" | "pointer" | "code" | "div", string>> | undefined;
16
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "tabIndex" | "children" | "className" | "slot" | "style" | "title" | "key" | "css" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & {
17
+ ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
18
+ }, "children" | "variant" | keyof import("@mui/material/OverridableComponent").CommonProps | "sx" | ("fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "p" | "color" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "typography" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint") | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & {
19
+ theme?: import("@emotion/react").Theme | undefined;
20
+ }, {}, {}>;
@@ -0,0 +1,9 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import { styled } from '../../styles';
6
+ import { Typography } from '../../Typography';
7
+ export var DatePickerHeaderWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"], ["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
8
+ export var DatePickerHeaderTitle = styled(Typography)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n text-transform: capitalize;\n"], ["\n text-transform: capitalize;\n"])));
9
+ var templateObject_1, templateObject_2;
@@ -1 +1,2 @@
1
1
  export * from './DatePicker';
2
+ export * from './types';
@@ -1 +1,2 @@
1
1
  export * from './DatePicker';
2
+ export * from './types';
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare const DatePickerWrapper: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,67 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import { styled } from '../styles';
6
+ export var DatePickerWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .react-datepicker {\n min-width: 320px;\n min-height: 300px;\n margin-top: ", ";\n padding: ", ";\n\n background-color: ", ";\n border-radius: ", ";\n box-shadow: ", ";\n\n & .react-datepicker__day-names,\n .react-datepicker__week {\n display: flex;\n justify-content: space-between;\n width: 287px;\n }\n\n & .react-datepicker__day {\n & > button {\n font-weight: ", ";\n }\n\n &--outside-month > button {\n color: ", ";\n }\n\n &--disabled > button {\n color: ", ";\n font-weight: ", ";\n\n cursor: default;\n }\n\n &--selected > button {\n color: ", ";\n\n background-color: ", ";\n }\n\n &--today > button {\n position: relative;\n\n font-weight: ", ";\n }\n\n &--disabled > button:focus {\n outline: none;\n }\n\n &--disabled:not(.react-datepicker__day--selected) > button:hover,\n &--disabled:not(.react-datepicker__day--selected) > button:active {\n background-color: transparent;\n }\n\n &--disabled:focus-visible {\n outline: none;\n }\n\n &--today > button::before {\n position: absolute;\n bottom: ", ";\n\n width: 33px;\n height: 2px;\n\n background-color: ", ";\n\n content: '';\n }\n\n &--today > .react-datepicker__day--selected > button::before {\n background-color: ", ";\n }\n\n &-name {\n width: 41px;\n margin-top: ", ";\n margin-bottom: ", ";\n\n color: ", ";\n font-weight: ", ";\n font-size: ", ";\n text-align: center;\n text-transform: uppercase;\n }\n }\n }\n"], ["\n .react-datepicker {\n min-width: 320px;\n min-height: 300px;\n margin-top: ", ";\n padding: ", ";\n\n background-color: ", ";\n border-radius: ", ";\n box-shadow: ", ";\n\n & .react-datepicker__day-names,\n .react-datepicker__week {\n display: flex;\n justify-content: space-between;\n width: 287px;\n }\n\n & .react-datepicker__day {\n & > button {\n font-weight: ", ";\n }\n\n &--outside-month > button {\n color: ", ";\n }\n\n &--disabled > button {\n color: ", ";\n font-weight: ", ";\n\n cursor: default;\n }\n\n &--selected > button {\n color: ", ";\n\n background-color: ", ";\n }\n\n &--today > button {\n position: relative;\n\n font-weight: ", ";\n }\n\n &--disabled > button:focus {\n outline: none;\n }\n\n &--disabled:not(.react-datepicker__day--selected) > button:hover,\n &--disabled:not(.react-datepicker__day--selected) > button:active {\n background-color: transparent;\n }\n\n &--disabled:focus-visible {\n outline: none;\n }\n\n &--today > button::before {\n position: absolute;\n bottom: ", ";\n\n width: 33px;\n height: 2px;\n\n background-color: ", ";\n\n content: '';\n }\n\n &--today > .react-datepicker__day--selected > button::before {\n background-color: ", ";\n }\n\n &-name {\n width: 41px;\n margin-top: ", ";\n margin-bottom: ", ";\n\n color: ", ";\n font-weight: ", ";\n font-size: ", ";\n text-align: center;\n text-transform: uppercase;\n }\n }\n }\n"])), function (_a) {
7
+ var theme = _a.theme;
8
+ return theme.spacing(2);
9
+ }, function (_a) {
10
+ var theme = _a.theme;
11
+ return theme.spacing(4);
12
+ }, function (_a) {
13
+ var theme = _a.theme;
14
+ return theme.palette.background.paper;
15
+ }, function (_a) {
16
+ var theme = _a.theme;
17
+ return theme.spacing(1);
18
+ }, function (_a) {
19
+ var theme = _a.theme;
20
+ return theme.elevation[200];
21
+ }, function (_a) {
22
+ var theme = _a.theme;
23
+ return theme.typography.fontWeightRegular;
24
+ }, function (_a) {
25
+ var theme = _a.theme;
26
+ return theme.palette.grey[600];
27
+ }, function (_a) {
28
+ var theme = _a.theme;
29
+ return theme.palette.grey[300];
30
+ }, function (_a) {
31
+ var theme = _a.theme;
32
+ return theme.typography.fontWeightRegular;
33
+ }, function (_a) {
34
+ var theme = _a.theme;
35
+ return theme.palette.common.white;
36
+ }, function (_a) {
37
+ var theme = _a.theme;
38
+ return theme.palette.primary.main;
39
+ }, function (_a) {
40
+ var theme = _a.theme;
41
+ return theme.typography.fontWeightMedium;
42
+ }, function (_a) {
43
+ var theme = _a.theme;
44
+ return theme.spacing(1);
45
+ }, function (_a) {
46
+ var theme = _a.theme;
47
+ return theme.palette.primary[900];
48
+ }, function (_a) {
49
+ var theme = _a.theme;
50
+ return theme.palette.primary[200];
51
+ }, function (_a) {
52
+ var theme = _a.theme;
53
+ return theme.spacing(3);
54
+ }, function (_a) {
55
+ var theme = _a.theme;
56
+ return theme.spacing(2);
57
+ }, function (_a) {
58
+ var theme = _a.theme;
59
+ return theme.palette.grey[600];
60
+ }, function (_a) {
61
+ var theme = _a.theme;
62
+ return theme.typography.fontWeightMedium;
63
+ }, function (_a) {
64
+ var theme = _a.theme;
65
+ return theme.typography.h7.fontSize;
66
+ });
67
+ var templateObject_1;
@@ -1,3 +1 @@
1
- import { DatePickerProps as MuiDatePickerProps } from '@mui/lab';
2
- export declare type DatePickerProps = Omit<MuiDatePickerProps<Date>, 'components' | 'renderInput' | 'showDaysOutsideCurrentMonth' | 'components' | 'componentsProps' | 'OpenPickerButtonProps' | 'PaperProps' | 'PopperProps'>;
3
1
  export declare type DatePickerValue = Date;
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ export declare const DatePickerContext: import("react").Context<{
3
+ locale: Locale;
4
+ }>;
5
+ declare type Props = {
6
+ children: ReactNode;
7
+ /**
8
+ * Локализация
9
+ */
10
+ locale?: Locale;
11
+ };
12
+ export declare const DatePickerProvider: (props: Props) => JSX.Element;
13
+ export {};
@@ -0,0 +1,19 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { createContext } from 'react';
14
+ import ru from 'date-fns/locale/ru';
15
+ export var DatePickerContext = createContext({ locale: ru });
16
+ export var DatePickerProvider = function (props) {
17
+ var children = props.children, _a = props.locale, locale = _a === void 0 ? ru : _a;
18
+ return (_jsx(DatePickerContext.Provider, __assign({ value: { locale: locale } }, { children: children }), void 0));
19
+ };
@@ -0,0 +1 @@
1
+ export * from './DatePickerProvider';
@@ -0,0 +1 @@
1
+ export * from './DatePickerProvider';
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { ButtonProps } from '../Button';
3
+ export declare type DropdownButtonProps = Omit<ButtonProps, 'endIcon' | 'loading'> & {
4
+ /**
5
+ * Название кнопки
6
+ */
7
+ name: string;
8
+ };
9
+ export declare const DropdownButton: import("react").ForwardRefExoticComponent<Pick<DropdownButtonProps, "disabled" | "component" | "href" | "onFocusVisible" | "tabIndex" | "type" | "action" | "children" | "form" | "slot" | "title" | "key" | "css" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "size" | "variant" | keyof import("@mui/material/OverridableComponent").CommonProps | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "sx" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "fullWidth" | "startIcon" | "loadingIndicator" | "loadingPosition"> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,34 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
24
+ import { ClickAwayListener } from '@mui/material';
25
+ import { forwardRef } from 'react';
26
+ import { ChevronDOutlineMd } from '@astral/icons';
27
+ import { useMenu } from '../hooks';
28
+ import { Menu } from '../Menu';
29
+ import { DropdownButtonWrapper } from './styles';
30
+ export var DropdownButton = forwardRef(function (_a, ref) {
31
+ var children = _a.children, name = _a.name, props = __rest(_a, ["children", "name"]);
32
+ var _b = useMenu(), open = _b.open, anchorRef = _b.anchorRef, handleOpenMenu = _b.handleOpenMenu, handleCloseMenu = _b.handleCloseMenu;
33
+ return (_jsxs(_Fragment, { children: [_jsx(ClickAwayListener, __assign({ ref: ref, onClickAway: handleCloseMenu }, { children: _jsx(DropdownButtonWrapper, __assign({}, props, { ref: anchorRef, onClick: handleOpenMenu, selected: open, endIcon: _jsx(ChevronDOutlineMd, {}, void 0) }, { children: name }), void 0) }), void 0), _jsx(Menu, __assign({ open: open, anchorEl: anchorRef.current }, { children: children }), void 0)] }, void 0));
34
+ });
@@ -0,0 +1 @@
1
+ export * from './DropdownButton';
@@ -0,0 +1 @@
1
+ export * from './DropdownButton';
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { ButtonProps } from '../Button';
3
+ export declare const DropdownButtonWrapper: import("@emotion/styled").StyledComponent<Pick<ButtonProps, "disabled" | "component" | "href" | "onFocusVisible" | "tabIndex" | "type" | "action" | "children" | "form" | "slot" | "title" | "key" | "css" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "size" | "variant" | keyof import("@mui/material/OverridableComponent").CommonProps | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "sx" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "startIcon" | "loading" | "loadingIndicator" | "loadingPosition"> & import("react").RefAttributes<HTMLButtonElement> & {
4
+ theme?: import("@emotion/react").Theme | undefined;
5
+ } & Omit<import("@mui/lab").LoadingButtonProps<"button", {}>, "color" | "variant"> & {
6
+ variant?: "link" | "light" | "contained" | "text" | undefined;
7
+ color?: "primary" | "error" | "success" | "warning" | undefined;
8
+ component?: import("react").ElementType<any> | undefined;
9
+ } & {
10
+ selected: boolean;
11
+ }, {}, {}>;
@@ -0,0 +1,25 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import { styled } from '../styles';
6
+ import { Button } from '../Button';
7
+ export var DropdownButtonWrapper = styled(Button, {
8
+ shouldForwardProp: function (prop) { return prop !== 'selected'; },
9
+ })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n\n background-color: ", ";\n\n .MuiButton-endIcon {\n transform: rotate(", ");\n\n transition: ", ";\n }\n"], ["\n color: ", ";\n\n background-color: ", ";\n\n .MuiButton-endIcon {\n transform: rotate(", ");\n\n transition: ", ";\n }\n"])), function (_a) {
10
+ var selected = _a.selected, theme = _a.theme;
11
+ return selected ? theme.palette.primary.contrastText : 'default';
12
+ }, function (_a) {
13
+ var selected = _a.selected, theme = _a.theme;
14
+ return selected ? theme.palette.grey['900'] : 'default';
15
+ }, function (_a) {
16
+ var selected = _a.selected;
17
+ return (selected ? '180deg' : '0');
18
+ }, function (_a) {
19
+ var theme = _a.theme;
20
+ return theme.transitions.create('transform', {
21
+ easing: theme.transitions.easing.easeOut,
22
+ duration: theme.transitions.duration.shorter,
23
+ });
24
+ });
25
+ var templateObject_1;
@@ -31,5 +31,16 @@ export var GlobalStyles = function (_a) {
31
31
  html: {
32
32
  fontSize: theme.typography.htmlFontSize,
33
33
  },
34
+ '*': {
35
+ scrollbarWidth: 'thin',
36
+ },
37
+ '*::-webkit-scrollbar': {
38
+ width: 4,
39
+ height: 4,
40
+ },
41
+ '*::-webkit-scrollbar-thumb': {
42
+ borderRadius: theme.shape.small,
43
+ backgroundColor: theme.palette.grey[300],
44
+ },
34
45
  } }, void 0)] }, void 0));
35
46
  };