@mezzanine-ui/react 0.9.2 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion/Accordion.js +5 -4
- package/Accordion/AccordionDetails.js +2 -2
- package/Accordion/AccordionSummary.js +3 -4
- package/Alert/Alert.js +1 -3
- package/AppBar/AppBar.js +1 -1
- package/AppBar/AppBarBrand.d.ts +1 -1
- package/AppBar/AppBarBrand.js +1 -1
- package/AppBar/AppBarMain.d.ts +1 -1
- package/AppBar/AppBarMain.js +1 -1
- package/AppBar/AppBarSupport.d.ts +1 -1
- package/AppBar/AppBarSupport.js +1 -1
- package/Badge/Badge.js +2 -2
- package/Badge/BadgeContainer.d.ts +1 -1
- package/Badge/BadgeContainer.js +1 -1
- package/Button/Button.d.ts +2 -2
- package/Button/Button.js +3 -3
- package/Button/ButtonGroup.js +3 -3
- package/Button/IconButton.d.ts +3 -3
- package/Button/IconButton.js +1 -1
- package/Calendar/Calendar.js +9 -10
- package/Calendar/CalendarCell.js +2 -2
- package/Calendar/CalendarContext.d.ts +3 -3
- package/Calendar/CalendarContext.js +20 -12
- package/Calendar/CalendarControls.js +3 -3
- package/Calendar/CalendarDayOfWeek.js +1 -1
- package/Calendar/CalendarDays.js +4 -5
- package/Calendar/CalendarMonths.js +4 -4
- package/Calendar/CalendarWeeks.js +4 -5
- package/Calendar/CalendarYears.js +4 -4
- package/Calendar/useCalendarControls.d.ts +2 -3
- package/Card/Card.js +5 -5
- package/Card/CardActions.js +1 -2
- package/Checkbox/CheckAll.js +2 -2
- package/Checkbox/Checkbox.js +2 -2
- package/Checkbox/CheckboxGroup.js +2 -2
- package/ConfirmActions/ConfirmActions.js +1 -2
- package/DatePicker/DatePicker.js +2 -3
- package/DatePicker/DatePickerCalendar.js +1 -1
- package/DateRangePicker/DateRangePicker.js +2 -3
- package/DateRangePicker/DateRangePickerCalendar.js +3 -4
- package/DateRangePicker/useDateRangeCalendarControls.d.ts +1 -2
- package/DateRangePicker/useDateRangePickerValue.d.ts +12 -13
- package/DateTimePicker/DateTimePicker.js +2 -3
- package/DateTimePicker/DateTimePickerPanel.js +1 -3
- package/Drawer/Drawer.js +1 -1
- package/Dropdown/Dropdown.js +2 -2
- package/Empty/Empty.js +3 -4
- package/Form/FormField.js +2 -2
- package/Form/FormLabel.js +1 -2
- package/Form/FormMessage.d.ts +1 -1
- package/Form/FormMessage.js +1 -1
- package/Form/useAutoCompleteValueControl.d.ts +30 -11
- package/Form/useAutoCompleteValueControl.js +71 -31
- package/Form/useInputWithTagsModeValue.js +2 -1
- package/Form/useSelectValueControl.d.ts +1 -1
- package/Icon/Icon.js +2 -2
- package/Input/Input.js +2 -3
- package/Loading/Loading.js +4 -5
- package/Menu/Menu.js +1 -1
- package/Menu/MenuDivider.d.ts +1 -1
- package/Menu/MenuDivider.js +1 -1
- package/Menu/MenuItem.js +2 -3
- package/Menu/MenuItemGroup.js +1 -2
- package/Message/Message.js +2 -3
- package/Modal/Modal.js +2 -2
- package/Modal/ModalActions.js +1 -1
- package/Modal/ModalBody.d.ts +1 -1
- package/Modal/ModalBody.js +1 -1
- package/Modal/ModalFooter.d.ts +1 -1
- package/Modal/ModalFooter.js +1 -1
- package/Modal/ModalHeader.js +2 -3
- package/Modal/useModalContainer.js +1 -1
- package/Navigation/Navigation.js +2 -2
- package/Navigation/NavigationItem.js +1 -1
- package/Navigation/NavigationSubMenu.js +3 -5
- package/Notification/Notification.js +2 -7
- package/Notifier/NotifierManager.js +1 -1
- package/Notifier/createNotifier.js +1 -1
- package/Overlay/Overlay.js +3 -3
- package/PageFooter/PageFooter.js +1 -2
- package/Pagination/Pagination.js +2 -3
- package/Pagination/PaginationItem.js +4 -4
- package/Pagination/PaginationJumper.js +2 -4
- package/Picker/PickerTrigger.js +1 -1
- package/Picker/RangePickerTrigger.js +1 -3
- package/Picker/usePickerInputValue.d.ts +2 -2
- package/Picker/usePickerValue.d.ts +6 -7
- package/Picker/useRangePickerValue.d.ts +9 -10
- package/Popconfirm/Popconfirm.js +1 -1
- package/Popover/Popover.js +2 -3
- package/Popper/Popper.js +2 -2
- package/Portal/Portal.js +1 -1
- package/Progress/Progress.js +5 -7
- package/Radio/Radio.js +2 -2
- package/Radio/RadioGroup.js +2 -2
- package/Select/AutoComplete.d.ts +40 -13
- package/Select/AutoComplete.js +37 -28
- package/Select/Option.js +2 -2
- package/Select/Select.d.ts +2 -50
- package/Select/Select.js +15 -49
- package/Select/SelectTrigger.d.ts +8 -1
- package/Select/SelectTrigger.js +8 -12
- package/Select/SelectTriggerTags.d.ts +19 -0
- package/Select/SelectTriggerTags.js +33 -0
- package/Select/TreeSelect.js +2 -3
- package/Select/index.d.ts +1 -0
- package/Select/index.js +1 -0
- package/Select/useSelectTriggerTags.d.ts +19 -0
- package/Select/useSelectTriggerTags.js +61 -0
- package/Skeleton/Skeleton.js +1 -1
- package/Slider/Slider.d.ts +1 -1
- package/Slider/Slider.js +7 -11
- package/Stepper/Step.js +2 -2
- package/Stepper/Stepper.js +1 -1
- package/Switch/Switch.js +2 -3
- package/Table/Table.d.ts +1 -1
- package/Table/Table.js +3 -10
- package/Table/TableBody.js +2 -4
- package/Table/TableBodyRow.js +4 -7
- package/Table/TableCell.js +3 -3
- package/Table/TableExpandedTable.js +5 -6
- package/Table/TableHeader.d.ts +2 -1
- package/Table/TableHeader.js +3 -6
- package/Table/editable/TableEditRenderWrapper.js +2 -2
- package/Table/expandable/TableExpandable.js +2 -2
- package/Table/pagination/TablePagination.js +1 -2
- package/Table/refresh/TableRefresh.js +1 -1
- package/Table/rowSelection/TableRowSelection.js +5 -6
- package/Table/sorting/TableSortingIcon.js +2 -2
- package/Table/sorting/useTableSorting.d.ts +2 -2
- package/Table/useTableScroll.d.ts +178 -178
- package/Tabs/Tab.js +2 -2
- package/Tabs/TabPane.js +1 -1
- package/Tabs/Tabs.js +1 -3
- package/Tag/Tag.js +3 -4
- package/TextField/TextField.js +3 -3
- package/TextField/useTextFieldControl.d.ts +2 -2
- package/Textarea/Textarea.js +2 -3
- package/TimePanel/TimePanel.js +1 -4
- package/TimePanel/TimePanelAction.js +1 -1
- package/TimePanel/TimePanelColumn.js +2 -5
- package/TimePicker/TimePicker.js +2 -3
- package/TimePicker/TimePickerPanel.js +1 -1
- package/Tooltip/Tooltip.js +3 -3
- package/Transition/Collapse.js +3 -2
- package/Transition/Fade.js +2 -2
- package/Transition/Grow.js +3 -2
- package/Transition/SlideFade.js +2 -2
- package/Transition/Transition.js +2 -2
- package/Transition/Zoom.js +2 -2
- package/Tree/Tree.js +1 -1
- package/Tree/TreeNode.js +5 -7
- package/Tree/TreeNodeList.js +5 -4
- package/Tree/getTreeNodeEntities.js +6 -3
- package/Typography/Typography.d.ts +2 -2
- package/Typography/Typography.js +2 -2
- package/Upload/UploadButton.js +2 -2
- package/Upload/UploadInput.js +1 -1
- package/Upload/UploadPicture.js +1 -1
- package/Upload/UploadPictureBlock.js +2 -8
- package/Upload/UploadPictureWall.d.ts +1 -1
- package/Upload/UploadPictureWall.js +1 -2
- package/Upload/UploadPictureWallItem.js +1 -1
- package/Upload/UploadResult.js +2 -5
- package/_internal/InputCheck/InputCheck.js +2 -3
- package/_internal/InputCheck/InputCheckGroup.js +1 -1
- package/_internal/InputTriggerPopper/InputTriggerPopper.js +2 -2
- package/_internal/SlideFadeOverlay/SlideFadeOverlay.js +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -0
- package/package.json +3 -3
package/Accordion/Accordion.js
CHANGED
|
@@ -17,16 +17,17 @@ const Accordion = forwardRef(function Accordion(props, ref) {
|
|
|
17
17
|
}, [onChange]);
|
|
18
18
|
const [summary, ...children] = Children.toArray(childrenProp);
|
|
19
19
|
const contextValue = useMemo(() => {
|
|
20
|
-
var _a, _b
|
|
20
|
+
var _a, _b;
|
|
21
21
|
return ({
|
|
22
|
-
detailsId: ((
|
|
22
|
+
detailsId: ((_a = summary === null || summary === void 0 ? void 0 : summary.props) === null || _a === void 0 ? void 0 : _a.id)
|
|
23
|
+
? `${summary.props.id}-details` : undefined,
|
|
23
24
|
disabled,
|
|
24
25
|
expanded: expandedProp || expanded,
|
|
25
|
-
summaryId: (
|
|
26
|
+
summaryId: (_b = summary === null || summary === void 0 ? void 0 : summary.props) === null || _b === void 0 ? void 0 : _b.id,
|
|
26
27
|
toggleExpanded: onToggleExpanded,
|
|
27
28
|
});
|
|
28
29
|
}, [disabled, expandedProp, expanded, onToggleExpanded, summary]);
|
|
29
|
-
return (jsx("div",
|
|
30
|
+
return (jsx("div", { ...rest, ref: ref, className: cx(accordionClasses.host, className), children: jsxs(AccordionControlContext.Provider, { value: contextValue, children: [summary, children] }) }));
|
|
30
31
|
});
|
|
31
32
|
var Accordion$1 = Accordion;
|
|
32
33
|
|
|
@@ -17,9 +17,9 @@ const AccordionDetails = forwardRef(function AccordionDetails(props, ref) {
|
|
|
17
17
|
}
|
|
18
18
|
return {};
|
|
19
19
|
}, [summaryId, detailsId]);
|
|
20
|
-
return (jsx(Collapse,
|
|
20
|
+
return (jsx(Collapse, { style: { width: '100%' }, in: expandedProp || expanded, children: jsx("div", { ...rest, ...ariaProps, ref: ref, className: cx(accordionClasses.details, {
|
|
21
21
|
[accordionClasses.detailsExpanded]: expandedProp || expanded,
|
|
22
|
-
}, className), role: "region"
|
|
22
|
+
}, className), role: "region", children: children }) }));
|
|
23
23
|
});
|
|
24
24
|
var AccordionDetails$1 = AccordionDetails;
|
|
25
25
|
|
|
@@ -39,12 +39,11 @@ const AccordionSummary = forwardRef(function AccordionSummary(props, ref) {
|
|
|
39
39
|
return (jsx(Icon, { color: disabled ? 'disabled' : 'primary', className: cx(accordionClasses.summaryIcon, {
|
|
40
40
|
[accordionClasses.summaryIconExpanded]: expanded,
|
|
41
41
|
[accordionClasses.summaryIconDisabled]: disabled,
|
|
42
|
-
}, iconClassNames, iconClassNameProp), icon: ChevronDownIcon, onClick: onToggle, onMouseDown: (evt) => evt.preventDefault(), role: "button" }
|
|
42
|
+
}, iconClassNames, iconClassNameProp), icon: ChevronDownIcon, onClick: onToggle, onMouseDown: (evt) => evt.preventDefault(), role: "button" }));
|
|
43
43
|
};
|
|
44
|
-
return (jsxs("div",
|
|
44
|
+
return (jsxs("div", { ...rest, ...ariaProps, ref: ref, className: cx(accordionClasses.summary, {
|
|
45
45
|
[accordionClasses.summaryDisabled]: disabled,
|
|
46
|
-
}, className), onClick: onToggle, onKeyDown: onKeyDown, role: "button", tabIndex: 0
|
|
47
|
-
suffixActions || (jsx(DefaultIcon, {}, void 0))] }), void 0));
|
|
46
|
+
}, className), onClick: onToggle, onKeyDown: onKeyDown, role: "button", tabIndex: 0, children: [jsxs("div", { className: accordionClasses.summaryMainPart, children: [suffixActions ? (prefixIcon || (jsx(DefaultIcon, { className: accordionClasses.summaryMainPartPrefix }))) : null, children] }), suffixActions || (jsx(DefaultIcon, {}))] }));
|
|
48
47
|
});
|
|
49
48
|
var AccordionSummary$1 = AccordionSummary;
|
|
50
49
|
|
package/Alert/Alert.js
CHANGED
|
@@ -12,9 +12,7 @@ import cx from 'clsx';
|
|
|
12
12
|
const Alert = forwardRef(function Alert(props, ref) {
|
|
13
13
|
const { className, children, onClose, severity = 'success', ...rest } = props;
|
|
14
14
|
const targetIcon = alertIcons[severity];
|
|
15
|
-
return (jsxs("div",
|
|
16
|
-
jsx("p", Object.assign({ className: alertClasses.message }, { children: children }), void 0),
|
|
17
|
-
jsx(Icon, { className: alertClasses.closeIcon, icon: TimesIcon, onClick: onClose, role: "button" }, void 0)] }), void 0));
|
|
15
|
+
return (jsxs("div", { ref: ref, className: cx(alertClasses.host, alertClasses.severity(severity), className), ...rest, children: [jsx(Icon, { className: alertClasses.icon, icon: targetIcon }), jsx("p", { className: alertClasses.message, children: children }), jsx(Icon, { className: alertClasses.closeIcon, icon: TimesIcon, onClick: onClose, role: "button" })] }));
|
|
18
16
|
});
|
|
19
17
|
var Alert$1 = Alert;
|
|
20
18
|
|
package/AppBar/AppBar.js
CHANGED
|
@@ -29,7 +29,7 @@ const AppBar = forwardRef((props, ref) => {
|
|
|
29
29
|
return 0;
|
|
30
30
|
return beforeOrder - afterOrder;
|
|
31
31
|
});
|
|
32
|
-
return (jsx("header",
|
|
32
|
+
return (jsx("header", { ...rest, ref: ref, className: cx(appBarClasses.host, appBarClasses[orientation], className), children: SortedChildren }));
|
|
33
33
|
});
|
|
34
34
|
var AppBar$1 = AppBar;
|
|
35
35
|
|
package/AppBar/AppBarBrand.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
3
3
|
export declare type AppBarBrandProps = NativeElementPropsWithoutKeyAndRef<'div'>;
|
|
4
|
-
declare const AppBarBrand: import("react").ForwardRefExoticComponent<
|
|
4
|
+
declare const AppBarBrand: import("react").ForwardRefExoticComponent<AppBarBrandProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
5
|
export default AppBarBrand;
|
package/AppBar/AppBarBrand.js
CHANGED
|
@@ -5,7 +5,7 @@ import cx from 'clsx';
|
|
|
5
5
|
|
|
6
6
|
const AppBarBrand = forwardRef((props, ref) => {
|
|
7
7
|
const { className, children, ...rest } = props;
|
|
8
|
-
return (jsx("div",
|
|
8
|
+
return (jsx("div", { ...rest, ref: ref, className: cx(appBarBrandClasses.host, className), children: children }));
|
|
9
9
|
});
|
|
10
10
|
var AppBarBrand$1 = AppBarBrand;
|
|
11
11
|
|
package/AppBar/AppBarMain.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
3
3
|
export declare type AppBarMainProps = NativeElementPropsWithoutKeyAndRef<'div'>;
|
|
4
|
-
declare const AppBarMain: import("react").ForwardRefExoticComponent<
|
|
4
|
+
declare const AppBarMain: import("react").ForwardRefExoticComponent<AppBarMainProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
5
|
export default AppBarMain;
|
package/AppBar/AppBarMain.js
CHANGED
|
@@ -5,7 +5,7 @@ import cx from 'clsx';
|
|
|
5
5
|
|
|
6
6
|
const AppBarMain = forwardRef((props, ref) => {
|
|
7
7
|
const { className, children, ...rest } = props;
|
|
8
|
-
return (jsx("div",
|
|
8
|
+
return (jsx("div", { ...rest, ref: ref, className: cx(appBarMainClasses.host, className), children: children }));
|
|
9
9
|
});
|
|
10
10
|
var AppBarMain$1 = AppBarMain;
|
|
11
11
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
3
3
|
export declare type AppBarSupportProps = NativeElementPropsWithoutKeyAndRef<'div'>;
|
|
4
|
-
declare const AppBarSupport: import("react").ForwardRefExoticComponent<
|
|
4
|
+
declare const AppBarSupport: import("react").ForwardRefExoticComponent<AppBarSupportProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
5
|
export default AppBarSupport;
|
package/AppBar/AppBarSupport.js
CHANGED
|
@@ -5,7 +5,7 @@ import cx from 'clsx';
|
|
|
5
5
|
|
|
6
6
|
const AppBarSupport = forwardRef((props, ref) => {
|
|
7
7
|
const { className, children, ...rest } = props;
|
|
8
|
-
return (jsx("div",
|
|
8
|
+
return (jsx("div", { ...rest, ref: ref, className: cx(appBarSupportClasses.host, className), children: children }));
|
|
9
9
|
});
|
|
10
10
|
var AppBarSupport$1 = AppBarSupport;
|
|
11
11
|
|
package/Badge/Badge.js
CHANGED
|
@@ -18,10 +18,10 @@ const Badge = forwardRef(function Badge(props, ref) {
|
|
|
18
18
|
children = childrenProp;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
return (jsx("span",
|
|
21
|
+
return (jsx("span", { ...rest, ref: ref, className: cx(badgeClasses.host, {
|
|
22
22
|
[badgeClasses.dot]: dot,
|
|
23
23
|
[badgeClasses.hide]: !dot && children === 0,
|
|
24
|
-
}, className)
|
|
24
|
+
}, className), children: children }));
|
|
25
25
|
});
|
|
26
26
|
var Badge$1 = Badge;
|
|
27
27
|
|
|
@@ -4,5 +4,5 @@ export declare type BadgeContainerProps = NativeElementPropsWithoutKeyAndRef<'sp
|
|
|
4
4
|
/**
|
|
5
5
|
* The react component for `mezzanine` badge container.
|
|
6
6
|
*/
|
|
7
|
-
declare const BadgeContainer: import("react").ForwardRefExoticComponent<
|
|
7
|
+
declare const BadgeContainer: import("react").ForwardRefExoticComponent<BadgeContainerProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
8
8
|
export default BadgeContainer;
|
package/Badge/BadgeContainer.js
CHANGED
|
@@ -8,7 +8,7 @@ import cx from 'clsx';
|
|
|
8
8
|
*/
|
|
9
9
|
const BadgeContainer = forwardRef(function BadgeContainer(props, ref) {
|
|
10
10
|
const { children, className, ...rest } = props;
|
|
11
|
-
return (jsx("span",
|
|
11
|
+
return (jsx("span", { ...rest, ref: ref, className: cx(badgeClasses.container, className), children: children }));
|
|
12
12
|
});
|
|
13
13
|
var BadgeContainer$1 = BadgeContainer;
|
|
14
14
|
|
package/Button/Button.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare type ButtonProps<C extends ButtonComponent = 'button'> = Componen
|
|
|
5
5
|
/**
|
|
6
6
|
* The react component for `mezzanine` button.
|
|
7
7
|
*/
|
|
8
|
-
declare const Button: import("react").ForwardRefExoticComponent<Pick<Pick<Pick<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | "form" | "slot" | "style" | "title" | "color" | "disabled" | "prefix" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "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" | "children" | "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">, "form" | "slot" | "style" | "title" | "color" | "disabled" | "prefix" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "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" | "children" | "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">, "form" | "slot" | "style" | "title" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "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" | "children" | "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"> & ButtonPropsBase, "form" | "slot" | "style" | "title" | "color" | "danger" | "disabled" | "loading" | "prefix" | "size" | "suffix" | "variant" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "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" | "children" | "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"> & {
|
|
9
|
-
component?:
|
|
8
|
+
declare const Button: import("react").ForwardRefExoticComponent<Omit<Omit<import("../utils/jsx-types").ComponentPropsWithoutKeyAndRef<"button">, keyof ButtonPropsBase> & ButtonPropsBase, "component"> & {
|
|
9
|
+
component?: ButtonComponent | undefined;
|
|
10
10
|
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
11
11
|
export default Button;
|
package/Button/Button.js
CHANGED
|
@@ -13,7 +13,7 @@ const Button = forwardRef(function Button(props, ref) {
|
|
|
13
13
|
let prefix = prefixProp;
|
|
14
14
|
let suffix = suffixProp;
|
|
15
15
|
if (loading) {
|
|
16
|
-
const loadingIcon = jsx(Icon, { icon: SpinnerIcon, spin: true }
|
|
16
|
+
const loadingIcon = jsx(Icon, { icon: SpinnerIcon, spin: true });
|
|
17
17
|
if (suffix && !prefix) {
|
|
18
18
|
suffix = loadingIcon;
|
|
19
19
|
}
|
|
@@ -22,7 +22,7 @@ const Button = forwardRef(function Button(props, ref) {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
const asIconBtn = children == null && !!(prefix || suffix);
|
|
25
|
-
return (jsxs(Component,
|
|
25
|
+
return (jsxs(Component, { ...rest, ref: ref, "aria-disabled": disabled, className: cx(buttonClasses.host, buttonClasses.variant(variant), buttonClasses.color(color), buttonClasses.size(size), {
|
|
26
26
|
[buttonClasses.danger]: danger,
|
|
27
27
|
[buttonClasses.disabled]: disabled,
|
|
28
28
|
[buttonClasses.icon]: asIconBtn,
|
|
@@ -31,7 +31,7 @@ const Button = forwardRef(function Button(props, ref) {
|
|
|
31
31
|
if (!disabled && !loading && onClick) {
|
|
32
32
|
onClick(event);
|
|
33
33
|
}
|
|
34
|
-
}
|
|
34
|
+
}, children: [prefix, children && jsx("span", { className: buttonClasses.label, children: children }), suffix] }));
|
|
35
35
|
});
|
|
36
36
|
var Button$1 = Button;
|
|
37
37
|
|
package/Button/ButtonGroup.js
CHANGED
|
@@ -13,10 +13,10 @@ const ButtonGroup = forwardRef(function ButtonGroup(props, ref) {
|
|
|
13
13
|
...styleProp,
|
|
14
14
|
...cssVars,
|
|
15
15
|
};
|
|
16
|
-
return (jsx("div",
|
|
16
|
+
return (jsx("div", { ref: ref, ...rest, "aria-orientation": orientation, className: cx(buttonGroupClasses.host, buttonGroupClasses.orientation(orientation), {
|
|
17
17
|
[buttonGroupClasses.fullWidth]: fullWidth,
|
|
18
18
|
[buttonGroupClasses.attached]: attached,
|
|
19
|
-
}, className), role: role, style: style
|
|
19
|
+
}, className), role: role, style: style, children: Children.map(children, (unknownChild) => {
|
|
20
20
|
var _a, _b;
|
|
21
21
|
const child = unknownChild;
|
|
22
22
|
if (!child) {
|
|
@@ -29,7 +29,7 @@ const ButtonGroup = forwardRef(function ButtonGroup(props, ref) {
|
|
|
29
29
|
size: child.props.size || size,
|
|
30
30
|
variant: child.props.variant || variant,
|
|
31
31
|
});
|
|
32
|
-
}) })
|
|
32
|
+
}) }));
|
|
33
33
|
});
|
|
34
34
|
var ButtonGroup$1 = ButtonGroup;
|
|
35
35
|
|
package/Button/IconButton.d.ts
CHANGED
|
@@ -10,12 +10,12 @@ export declare type IconButtonProps<C extends ButtonComponent = 'button'> = Comp
|
|
|
10
10
|
/**
|
|
11
11
|
* The react component for `mezzanine` button only has icon.
|
|
12
12
|
*/
|
|
13
|
-
declare const IconButton: import("react").ForwardRefExoticComponent<Pick<Pick<Pick<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "prefix" | "color" | "disabled" | "key" | "form" | "slot" | "style" | "title" | "children" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "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">, "prefix" | "color" | "disabled" | "form" | "slot" | "style" | "title" | "children" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "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">, "prefix" | "form" | "slot" | "style" | "title" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "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"> & Pick<ButtonPropsBase, "color" | "danger" | "disabled" | "loading" | "size" | "variant"> & {
|
|
13
|
+
declare const IconButton: import("react").ForwardRefExoticComponent<Omit<Omit<import("../utils/jsx-types").ComponentPropsWithoutKeyAndRef<"button">, "color" | "danger" | "disabled" | "loading" | "size" | "variant" | "children"> & Omit<ButtonPropsBase, "prefix" | "suffix"> & {
|
|
14
14
|
/**
|
|
15
15
|
* The icon element.
|
|
16
16
|
*/
|
|
17
17
|
children?: ReactNode;
|
|
18
|
-
}, "
|
|
19
|
-
component?:
|
|
18
|
+
}, "component"> & {
|
|
19
|
+
component?: ButtonComponent | undefined;
|
|
20
20
|
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
21
21
|
export default IconButton;
|
package/Button/IconButton.js
CHANGED
|
@@ -7,7 +7,7 @@ import Button from './Button.js';
|
|
|
7
7
|
*/
|
|
8
8
|
const IconButton = forwardRef(function IconButton(props, ref) {
|
|
9
9
|
const { children, ...rest } = props;
|
|
10
|
-
return (jsx(Button,
|
|
10
|
+
return (jsx(Button, { ...rest, ref: ref, prefix: children }));
|
|
11
11
|
});
|
|
12
12
|
var _IconButton = IconButton;
|
|
13
13
|
|
package/Calendar/Calendar.js
CHANGED
|
@@ -18,36 +18,35 @@ import cx from 'clsx';
|
|
|
18
18
|
const Calendar = forwardRef(function Calendar(props, ref) {
|
|
19
19
|
const { displayMonthLocale: displayMonthLocaleFromConfig, getMonth, getMonthShortName, getYear, } = useCalendarContext();
|
|
20
20
|
const { calendarDaysProps, calendarMonthsProps, calendarWeeksProps, calendarYearsProps, className, disableOnNext, disableOnPrev, displayMonthLocale = displayMonthLocaleFromConfig, displayWeekDayLocale, isDateDisabled, isDateInRange, isMonthDisabled, isMonthInRange, isWeekDisabled, isWeekInRange, isYearDisabled, isYearInRange, mode = 'day', onChange, onDateHover, onMonthControlClick, onMonthHover, onNext, onPrev, onWeekHover, onYearControlClick, onYearHover, referenceDate, value: valueProp, ...restCalendarProps } = props;
|
|
21
|
-
const value = valueProp
|
|
21
|
+
const value = valueProp ? castArray(valueProp) : undefined;
|
|
22
22
|
/** Compute which calendar to use */
|
|
23
23
|
let displayCalendar;
|
|
24
24
|
if (mode === 'day') {
|
|
25
|
-
displayCalendar = (jsx(CalendarDays,
|
|
25
|
+
displayCalendar = (jsx(CalendarDays, { ...calendarDaysProps, isDateDisabled: isDateDisabled, isDateInRange: isDateInRange, onClick: onChange, onDateHover: onDateHover, referenceDate: referenceDate, displayWeekDayLocale: displayWeekDayLocale, value: value }));
|
|
26
26
|
}
|
|
27
27
|
else if (mode === 'week') {
|
|
28
|
-
displayCalendar = (jsx(CalendarWeeks,
|
|
28
|
+
displayCalendar = (jsx(CalendarWeeks, { ...calendarWeeksProps, isWeekDisabled: isWeekDisabled, isWeekInRange: isWeekInRange, onClick: onChange, onWeekHover: onWeekHover, referenceDate: referenceDate, displayWeekDayLocale: displayWeekDayLocale, value: value }));
|
|
29
29
|
}
|
|
30
30
|
else if (mode === 'month') {
|
|
31
|
-
displayCalendar = (jsx(CalendarMonths,
|
|
31
|
+
displayCalendar = (jsx(CalendarMonths, { ...calendarMonthsProps, isMonthDisabled: isMonthDisabled, isMonthInRange: isMonthInRange, onClick: onChange, onMonthHover: onMonthHover, referenceDate: referenceDate, value: value }));
|
|
32
32
|
}
|
|
33
33
|
else if (mode === 'year') {
|
|
34
|
-
displayCalendar = (jsx(CalendarYears,
|
|
34
|
+
displayCalendar = (jsx(CalendarYears, { ...calendarYearsProps, isYearDisabled: isYearDisabled, isYearInRange: isYearInRange, onClick: onChange, onYearHover: onYearHover, referenceDate: referenceDate, value: value }));
|
|
35
35
|
}
|
|
36
36
|
/** Compute controls outcome */
|
|
37
37
|
const [start, end] = getYearRange(getYear(referenceDate), calendarYearModuler);
|
|
38
38
|
const displayYearRange = `${start} - ${end}`;
|
|
39
39
|
let controls;
|
|
40
40
|
if (mode === 'day' || mode === 'week') {
|
|
41
|
-
controls = (jsxs(Fragment, { children: [jsx("button",
|
|
42
|
-
jsx("button", Object.assign({ type: "button", className: cx(calendarClasses.button, calendarClasses.controlsButton), onClick: onYearControlClick }, { children: getYear(referenceDate) }), void 0)] }, void 0));
|
|
41
|
+
controls = (jsxs(Fragment, { children: [jsx("button", { type: "button", className: cx(calendarClasses.button, calendarClasses.controlsButton), onClick: onMonthControlClick, children: getMonthShortName(getMonth(referenceDate), displayMonthLocale) }), jsx("button", { type: "button", className: cx(calendarClasses.button, calendarClasses.controlsButton), onClick: onYearControlClick, children: getYear(referenceDate) })] }));
|
|
43
42
|
}
|
|
44
43
|
else if (mode === 'month') {
|
|
45
|
-
controls = (jsx("button",
|
|
44
|
+
controls = (jsx("button", { type: "button", className: cx(calendarClasses.button, calendarClasses.controlsButton), onClick: onYearControlClick, children: getYear(referenceDate) }));
|
|
46
45
|
}
|
|
47
46
|
else if (mode === 'year') {
|
|
48
|
-
controls = (jsx("button",
|
|
47
|
+
controls = (jsx("button", { type: "button", className: cx(calendarClasses.button, calendarClasses.controlsButton, calendarClasses.buttonDisabled), disabled: true, "aria-disabled": true, children: displayYearRange }));
|
|
49
48
|
}
|
|
50
|
-
return (jsxs("div",
|
|
49
|
+
return (jsxs("div", { ...restCalendarProps, ref: ref, className: cx(calendarClasses.host, className), children: [jsx(CalendarControls, { disableOnNext: disableOnNext, disableOnPrev: disableOnPrev, onNext: onNext ? () => { onNext(mode); } : undefined, onPrev: onPrev ? () => { onPrev(mode); } : undefined, children: controls }), displayCalendar] }));
|
|
51
50
|
});
|
|
52
51
|
var Calendar$1 = Calendar;
|
|
53
52
|
|
package/Calendar/CalendarCell.js
CHANGED
|
@@ -8,11 +8,11 @@ import cx from 'clsx';
|
|
|
8
8
|
*/
|
|
9
9
|
function CalendarCell(props) {
|
|
10
10
|
const { active, children, className, disabled, onClick, today, ...restCalendarCellProps } = props;
|
|
11
|
-
return (jsx("div",
|
|
11
|
+
return (jsx("div", { className: cx(calendarClasses.cell, {
|
|
12
12
|
[calendarClasses.cellActive]: active,
|
|
13
13
|
[calendarClasses.cellDisabled]: disabled,
|
|
14
14
|
[calendarClasses.cellToday]: today,
|
|
15
|
-
}, className)
|
|
15
|
+
}, className), ...restCalendarCellProps, children: jsx("span", { className: calendarClasses.cellInner, children: children }) }));
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export { CalendarCell as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { CalendarMethods
|
|
3
|
-
export interface CalendarConfigs extends CalendarMethods
|
|
2
|
+
import { CalendarMethods } from '@mezzanine-ui/core/calendar';
|
|
3
|
+
export interface CalendarConfigs extends CalendarMethods {
|
|
4
4
|
defaultDateFormat: string;
|
|
5
5
|
defaultTimeFormat: string;
|
|
6
6
|
displayMonthLocale: string;
|
|
@@ -13,7 +13,7 @@ export declare type CalendarConfigProviderProps = {
|
|
|
13
13
|
defaultTimeFormat?: string;
|
|
14
14
|
displayMonthLocale?: string;
|
|
15
15
|
displayWeekDayLocale?: string;
|
|
16
|
-
methods: CalendarMethods
|
|
16
|
+
methods: CalendarMethods;
|
|
17
17
|
valueLocale?: string;
|
|
18
18
|
};
|
|
19
19
|
export declare const CalendarContext: import("react").Context<CalendarConfigs | undefined>;
|
|
@@ -1,26 +1,34 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { createContext, useContext } from 'react';
|
|
2
|
+
import { createContext, useContext, useMemo } from 'react';
|
|
3
3
|
|
|
4
4
|
const CalendarContext = createContext(undefined);
|
|
5
5
|
function useCalendarContext() {
|
|
6
6
|
const configs = useContext(CalendarContext);
|
|
7
7
|
if (!configs) {
|
|
8
|
-
throw new Error('Cannot find values in your context. '
|
|
9
|
-
'Make sure you use `CalendarConfigProvider` in your app '
|
|
10
|
-
'and pass in one of the following as methods: `CalendarMethodsMoment`.');
|
|
8
|
+
throw new Error('Cannot find values in your context. '
|
|
9
|
+
+ 'Make sure you use `CalendarConfigProvider` in your app '
|
|
10
|
+
+ 'and pass in one of the following as methods: `CalendarMethodsMoment`.');
|
|
11
11
|
}
|
|
12
12
|
return configs;
|
|
13
13
|
}
|
|
14
14
|
function CalendarConfigProvider(props) {
|
|
15
15
|
const { children, defaultDateFormat = 'YYYY-MM-DD', defaultTimeFormat = 'HH:mm:ss', displayMonthLocale = 'en-us', displayWeekDayLocale = 'en-us', methods, valueLocale = 'en-us', } = props;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
const context = useMemo(() => ({
|
|
17
|
+
...methods,
|
|
18
|
+
defaultDateFormat,
|
|
19
|
+
defaultTimeFormat,
|
|
20
|
+
displayMonthLocale,
|
|
21
|
+
displayWeekDayLocale,
|
|
22
|
+
valueLocale,
|
|
23
|
+
}), [
|
|
24
|
+
methods,
|
|
25
|
+
defaultDateFormat,
|
|
26
|
+
defaultTimeFormat,
|
|
27
|
+
displayMonthLocale,
|
|
28
|
+
displayWeekDayLocale,
|
|
29
|
+
valueLocale,
|
|
30
|
+
]);
|
|
31
|
+
return (jsx(CalendarContext.Provider, { value: context, children: children }));
|
|
24
32
|
}
|
|
25
33
|
|
|
26
34
|
export { CalendarContext, CalendarConfigProvider as default, useCalendarContext };
|