@react-fabric/core 1.0.0-beta.62 → 1.0.0-beta.63
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/css/components/_animations.css +7 -11
- package/css/components/_avatar.css +5 -5
- package/css/components/_badge.css +2 -1
- package/css/components/_breadcrumbs.css +5 -5
- package/css/components/_button.css +48 -14
- package/css/components/_card.css +9 -17
- package/css/components/_chip.css +0 -4
- package/css/components/_dropdown.css +1 -0
- package/css/components/_flyout.css +1 -1
- package/css/components/_media.css +2 -14
- package/css/components/_menu.css +1 -1
- package/css/components/_modal.css +1 -1
- package/css/components/_progress.css +1 -1
- package/css/components/_stepper.css +2 -1
- package/css/components/_tabPanel.css +4 -4
- package/css/core/_aside.css +3 -3
- package/css/core/_errorboundary.css +2 -10
- package/css/core/_page.css +1 -1
- package/css/core/_responsive.css +8 -0
- package/css/core/_viewport.css +1 -5
- package/css/reset/_reset.css +36 -41
- package/css/reset/_theme.css +214 -201
- package/css/styles.css +5 -0
- package/css/theme/_colors.css +14 -0
- package/css/theme/_utilities.css +103 -225
- package/css/theme/index.css +4 -6
- package/dist/cjs/components/actionLabel/ActionLabel.js +1 -1
- package/dist/cjs/components/animations/Animations.js +7 -7
- package/dist/cjs/components/avatar/Avatar.js +1 -1
- package/dist/cjs/components/avatar/AvatarGroup.js +1 -1
- package/dist/cjs/components/badge/Badge.js +5 -27
- package/dist/cjs/components/breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/cjs/components/button/Button.js +7 -5
- package/dist/cjs/components/button/ButtonGroup.js +1 -1
- package/dist/cjs/components/button/ConfirmButton.js +7 -6
- package/dist/cjs/components/button/ToggleButtonGroup.js +1 -1
- package/dist/cjs/components/callout/Callout.js +8 -7
- package/dist/cjs/components/card/Card.js +3 -3
- package/dist/cjs/components/card/CardCover.js +1 -1
- package/dist/cjs/components/card/FlipContent.js +2 -2
- package/dist/cjs/components/chip/Chip.js +8 -7
- package/dist/cjs/components/collapsable/Collapsable.js +4 -3
- package/dist/cjs/components/divider/Divider.js +2 -2
- package/dist/cjs/components/dropdown/Dropdown.js +18 -16
- package/dist/cjs/components/empty/EmptyContent.js +1 -1
- package/dist/cjs/components/icon/Icon.js +2 -16
- package/dist/cjs/components/media/Media.js +13 -13
- package/dist/cjs/components/menu/ContextMenu.js +23 -13
- package/dist/cjs/components/menu/Menu.js +16 -12
- package/dist/cjs/components/menu/MenuItem.js +4 -3
- package/dist/cjs/components/meter/Meter.js +1 -1
- package/dist/cjs/components/navigator/Navigator.js +5 -5
- package/dist/cjs/components/panel/Panel.js +6 -4
- package/dist/cjs/components/panel/PanelGroup.js +3 -3
- package/dist/cjs/components/panel/PanelStack.js +5 -5
- package/dist/cjs/components/progress/ProgressBar.js +2 -2
- package/dist/cjs/components/progress/ProgressCircle.js +2 -2
- package/dist/cjs/components/tabpanel/Tab.js +6 -4
- package/dist/cjs/components/tabpanel/TabPanel.js +4 -4
- package/dist/cjs/context/Global.js +2 -55
- package/dist/cjs/context/NotificationCenter.js +38 -39
- package/dist/cjs/context/context.js +59 -0
- package/dist/cjs/core/aside/Aside.js +9 -7
- package/dist/cjs/core/boundary/ErrorBoundary.js +2 -4
- package/dist/cjs/core/page/Page.js +4 -1
- package/dist/cjs/core/responsive/Responsive.js +3 -2
- package/dist/cjs/core/theme/ThemeProvider.js +2 -2
- package/dist/cjs/core/viewport/Viewport.js +1 -1
- package/dist/cjs/hooks/useContextMenu.js +103 -0
- package/dist/cjs/hooks/useIsDark.js +6 -4
- package/dist/cjs/hooks/useNavigator.js +2 -2
- package/dist/cjs/hooks/useOverlayService.js +10 -42
- package/dist/cjs/hooks/usePropToggle.js +2 -2
- package/dist/cjs/hooks/useResize.js +8 -6
- package/dist/cjs/hooks/useResizeObserver.js +5 -5
- package/dist/cjs/hooks/useStepper.js +2 -6
- package/dist/cjs/hotkeys/HotKey.js +2 -2
- package/dist/cjs/hotkeys/HotKeyWrapper.js +8 -13
- package/dist/cjs/hotkeys/commons.js +1 -1
- package/dist/cjs/hotkeys/context.js +36 -0
- package/dist/cjs/index.js +9 -5
- package/dist/cjs/overlays/alert/Alert.js +6 -5
- package/dist/cjs/overlays/flyout/Flyout.js +8 -6
- package/dist/cjs/overlays/message/Message.js +5 -5
- package/dist/cjs/overlays/modal/Modal.js +5 -3
- package/dist/cjs/overlays/toast/Toast.js +4 -4
- package/dist/cjs/overlays/tooltip/Tooltip.js +2 -16
- package/dist/cjs/typography/Abbr.js +4 -5
- package/dist/cjs/typography/Anchor.js +2 -2
- package/dist/cjs/typography/Copy.js +2 -2
- package/dist/cjs/typography/Mark.js +2 -4
- package/dist/cjs/typography/Text.js +4 -4
- package/dist/cjs/typography/Title.js +2 -2
- package/dist/cjs/utils/cloneElement.js +4 -4
- package/dist/cjs/utils/getBadgeProps.js +51 -0
- package/dist/cjs/utils/getIconProps.js +42 -0
- package/dist/cjs/utils/getTooltipProps.js +45 -0
- package/dist/esm/components/actionLabel/ActionLabel.js +1 -1
- package/dist/esm/components/animations/Animations.js +7 -7
- package/dist/esm/components/avatar/Avatar.js +1 -1
- package/dist/esm/components/avatar/AvatarGroup.js +1 -1
- package/dist/esm/components/badge/Badge.js +7 -28
- package/dist/esm/components/breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/esm/components/button/Button.js +8 -6
- package/dist/esm/components/button/ButtonGroup.js +3 -3
- package/dist/esm/components/button/ConfirmButton.js +8 -7
- package/dist/esm/components/button/ToggleButtonGroup.js +3 -3
- package/dist/esm/components/callout/Callout.js +8 -7
- package/dist/esm/components/card/Card.js +4 -4
- package/dist/esm/components/card/CardCover.js +1 -1
- package/dist/esm/components/card/FlipContent.js +2 -2
- package/dist/esm/components/chip/Chip.js +9 -8
- package/dist/esm/components/collapsable/Collapsable.js +4 -3
- package/dist/esm/components/divider/Divider.js +2 -2
- package/dist/esm/components/dropdown/Dropdown.js +19 -17
- package/dist/esm/components/empty/EmptyContent.js +1 -1
- package/dist/esm/components/icon/Icon.js +4 -17
- package/dist/esm/components/media/Media.js +13 -13
- package/dist/esm/components/menu/ContextMenu.js +24 -14
- package/dist/esm/components/menu/Menu.js +19 -15
- package/dist/esm/components/menu/MenuItem.js +5 -4
- package/dist/esm/components/meter/Meter.js +1 -1
- package/dist/esm/components/navigator/Navigator.js +6 -6
- package/dist/esm/components/panel/Panel.js +6 -4
- package/dist/esm/components/panel/PanelGroup.js +4 -4
- package/dist/esm/components/panel/PanelStack.js +6 -6
- package/dist/esm/components/progress/ProgressBar.js +2 -2
- package/dist/esm/components/progress/ProgressCircle.js +2 -2
- package/dist/esm/components/tabpanel/Tab.js +6 -4
- package/dist/esm/components/tabpanel/TabPanel.js +5 -5
- package/dist/esm/context/Global.js +3 -52
- package/dist/esm/context/NotificationCenter.js +38 -39
- package/dist/esm/context/context.js +56 -0
- package/dist/esm/core/aside/Aside.js +10 -8
- package/dist/esm/core/boundary/ErrorBoundary.js +1 -3
- package/dist/esm/core/page/Page.js +4 -1
- package/dist/esm/core/responsive/Responsive.js +3 -2
- package/dist/esm/core/theme/ThemeProvider.js +1 -1
- package/dist/esm/core/viewport/Viewport.js +1 -1
- package/dist/esm/hooks/useContextMenu.js +103 -0
- package/dist/esm/hooks/useIsDark.js +7 -5
- package/dist/esm/hooks/useNavigator.js +3 -3
- package/dist/esm/hooks/useOverlayService.js +8 -40
- package/dist/esm/hooks/usePropToggle.js +3 -3
- package/dist/esm/hooks/useResize.js +9 -7
- package/dist/esm/hooks/useResizeObserver.js +6 -6
- package/dist/esm/hooks/useStepper.js +2 -6
- package/dist/esm/hotkeys/HotKey.js +1 -1
- package/dist/esm/hotkeys/HotKeyWrapper.js +9 -12
- package/dist/esm/hotkeys/commons.js +1 -1
- package/dist/esm/hotkeys/context.js +35 -0
- package/dist/esm/index.js +7 -3
- package/dist/esm/overlays/alert/Alert.js +7 -6
- package/dist/esm/overlays/flyout/Flyout.js +9 -7
- package/dist/esm/overlays/message/Message.js +6 -6
- package/dist/esm/overlays/modal/Modal.js +6 -4
- package/dist/esm/overlays/toast/Toast.js +5 -5
- package/dist/esm/overlays/tooltip/Tooltip.js +4 -17
- package/dist/esm/typography/Abbr.js +4 -5
- package/dist/esm/typography/Anchor.js +2 -2
- package/dist/esm/typography/Copy.js +3 -3
- package/dist/esm/typography/Mark.js +2 -4
- package/dist/esm/typography/Text.js +5 -5
- package/dist/esm/typography/Title.js +2 -2
- package/dist/esm/utils/cloneElement.js +4 -4
- package/dist/esm/utils/getBadgeProps.js +51 -0
- package/dist/esm/utils/getIconProps.js +42 -0
- package/dist/esm/utils/getTooltipProps.js +45 -0
- package/dist/types/components/actionLabel/ActionLabel.d.ts +1 -1
- package/dist/types/components/animations/Animations.d.ts +6 -6
- package/dist/types/components/avatar/Avatar.d.ts +1 -1
- package/dist/types/components/avatar/AvatarGroup.d.ts +1 -1
- package/dist/types/components/badge/Badge.d.ts +2 -10
- package/dist/types/components/breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/types/components/button/Button.d.ts +1 -1
- package/dist/types/components/button/ButtonGroup.d.ts +1 -1
- package/dist/types/components/button/ConfirmButton.d.ts +1 -1
- package/dist/types/components/button/ToggleButtonGroup.d.ts +1 -1
- package/dist/types/components/callout/Callout.d.ts +7 -3
- package/dist/types/components/card/Card.d.ts +2 -2
- package/dist/types/components/card/CardCover.d.ts +1 -1
- package/dist/types/components/card/FlipContent.d.ts +1 -1
- package/dist/types/components/chip/Chip.d.ts +1 -1
- package/dist/types/components/collapsable/Collapsable.d.ts +1 -1
- package/dist/types/components/divider/Divider.d.ts +1 -1
- package/dist/types/components/dropdown/Dropdown.d.ts +7 -3
- package/dist/types/components/dropdown/DropdownTool.d.ts +1 -1
- package/dist/types/components/empty/EmptyContent.d.ts +3 -3
- package/dist/types/components/icon/Icon.d.ts +3 -4
- package/dist/types/components/index.d.ts +2 -2
- package/dist/types/components/media/Media.d.ts +2 -2
- package/dist/types/components/menu/ContextMenu.d.ts +1 -1
- package/dist/types/components/menu/Menu.d.ts +1 -1
- package/dist/types/components/menu/types.d.ts +1 -1
- package/dist/types/components/meter/Meter.d.ts +1 -1
- package/dist/types/components/navigator/Navigator.d.ts +1 -1
- package/dist/types/components/panel/Panel.d.ts +2 -2
- package/dist/types/components/panel/PanelGroup.d.ts +1 -1
- package/dist/types/components/panel/PanelStack.d.ts +1 -1
- package/dist/types/components/progress/ProgressBar.d.ts +1 -1
- package/dist/types/components/progress/ProgressCircle.d.ts +1 -1
- package/dist/types/components/tabpanel/Tab.d.ts +1 -1
- package/dist/types/components/tabpanel/TabPanel.d.ts +1 -1
- package/dist/types/context/Global.d.ts +0 -82
- package/dist/types/context/context.d.ts +85 -0
- package/dist/types/core/aside/Aside.d.ts +2 -2
- package/dist/types/core/responsive/Responsive.d.ts +5 -1
- package/dist/types/hooks/useContextMenu.d.ts +10 -0
- package/dist/types/hotkeys/HotKeyWrapper.d.ts +0 -9
- package/dist/types/hotkeys/context.d.ts +9 -0
- package/dist/types/index.d.ts +4 -2
- package/dist/types/overlays/alert/Alert.d.ts +2 -2
- package/dist/types/overlays/flyout/Flyout.d.ts +2 -2
- package/dist/types/overlays/message/Message.d.ts +2 -2
- package/dist/types/overlays/modal/Modal.d.ts +2 -2
- package/dist/types/overlays/toast/Toast.d.ts +2 -2
- package/dist/types/overlays/tooltip/Tooltip.d.ts +0 -3
- package/dist/types/types/index.d.ts +2 -2
- package/dist/types/typography/Abbr.d.ts +4 -8
- package/dist/types/typography/Anchor.d.ts +1 -1
- package/dist/types/typography/Copy.d.ts +1 -1
- package/dist/types/typography/Mark.d.ts +2 -2
- package/dist/types/typography/Text.d.ts +1 -1
- package/dist/types/typography/Title.d.ts +1 -1
- package/dist/types/utils/getBadgeProps.d.ts +9 -0
- package/dist/types/utils/getIconProps.d.ts +2 -0
- package/dist/types/utils/getTooltipProps.d.ts +4 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/package.json +14 -15
- package/src/components/actionLabel/ActionLabel.tsx +1 -1
- package/src/components/animations/Animations.tsx +6 -6
- package/src/components/avatar/Avatar.tsx +1 -1
- package/src/components/avatar/AvatarGroup.tsx +1 -1
- package/src/components/badge/Badge.tsx +8 -46
- package/src/components/breadcrumbs/Breadcrumbs.tsx +1 -1
- package/src/components/button/Button.tsx +24 -54
- package/src/components/button/ButtonGroup.tsx +1 -1
- package/src/components/button/ConfirmButton.tsx +23 -20
- package/src/components/button/ToggleButtonGroup.tsx +1 -1
- package/src/components/callout/Callout.tsx +14 -19
- package/src/components/card/Card.tsx +9 -11
- package/src/components/card/CardCover.tsx +1 -1
- package/src/components/card/FlipContent.tsx +2 -2
- package/src/components/chip/Chip.tsx +16 -33
- package/src/components/collapsable/Collapsable.tsx +2 -2
- package/src/components/divider/Divider.tsx +1 -1
- package/src/components/dropdown/Dropdown.tsx +42 -72
- package/src/components/dropdown/DropdownTool.tsx +1 -1
- package/src/components/empty/EmptyContent.tsx +3 -3
- package/src/components/icon/Icon.tsx +5 -32
- package/src/components/index.ts +2 -2
- package/src/components/media/Media.tsx +3 -3
- package/src/components/menu/ContextMenu.tsx +30 -30
- package/src/components/menu/Menu.tsx +32 -61
- package/src/components/menu/MenuItem.tsx +9 -28
- package/src/components/menu/types.ts +1 -1
- package/src/components/meter/Meter.tsx +1 -1
- package/src/components/navigator/Navigator.tsx +5 -10
- package/src/components/panel/Panel.tsx +13 -54
- package/src/components/panel/PanelGroup.tsx +3 -4
- package/src/components/panel/PanelStack.tsx +20 -25
- package/src/components/progress/ProgressBar.tsx +2 -2
- package/src/components/progress/ProgressCircle.tsx +2 -2
- package/src/components/tabpanel/Tab.tsx +9 -28
- package/src/components/tabpanel/TabPanel.tsx +11 -14
- package/src/context/Global.tsx +18 -125
- package/src/context/NotificationCenter.tsx +0 -1
- package/src/context/context.ts +100 -0
- package/src/core/aside/Aside.tsx +18 -55
- package/src/core/boundary/ErrorBoundary.tsx +8 -37
- package/src/core/page/Page.tsx +3 -5
- package/src/core/responsive/Responsive.tsx +10 -34
- package/src/core/theme/ThemeProvider.tsx +2 -7
- package/src/core/viewport/Viewport.tsx +1 -1
- package/src/hooks/useContextMenu.tsx +131 -0
- package/src/hooks/useIsDark.ts +7 -5
- package/src/hooks/useNavigator.tsx +12 -15
- package/src/hooks/useOverlayService.tsx +3 -11
- package/src/hooks/usePropToggle.ts +3 -3
- package/src/hooks/useResize.ts +14 -17
- package/src/hooks/useResizeObserver.ts +21 -21
- package/src/hooks/useStepper.tsx +1 -1
- package/src/hotkeys/HotKey.tsx +1 -1
- package/src/hotkeys/HotKeyWrapper.tsx +81 -105
- package/src/hotkeys/commons.ts +2 -0
- package/src/hotkeys/context.ts +32 -0
- package/src/index.ts +4 -7
- package/src/overlays/alert/Alert.tsx +12 -16
- package/src/overlays/flyout/Flyout.tsx +32 -69
- package/src/overlays/message/Message.tsx +11 -15
- package/src/overlays/modal/Modal.tsx +23 -57
- package/src/overlays/toast/Toast.tsx +16 -15
- package/src/overlays/tooltip/Tooltip.tsx +6 -29
- package/src/types/global.d.ts +12 -0
- package/src/types/index.ts +2 -2
- package/src/typography/Abbr.tsx +11 -39
- package/src/typography/Anchor.tsx +1 -1
- package/src/typography/Copy.tsx +4 -4
- package/src/typography/Mark.tsx +2 -3
- package/src/typography/Text.tsx +8 -6
- package/src/typography/Title.tsx +1 -1
- package/src/utils/getBadgeProps.ts +45 -0
- package/src/utils/getIconProps.ts +35 -0
- package/src/utils/getTooltipProps.ts +38 -0
- package/src/utils/index.ts +3 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var utilities = require('@react-fabric/utilities');
|
|
4
|
+
var react = require('react');
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* React Fabric
|
|
8
|
+
* @version: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* The MIT License (MIT)
|
|
12
|
+
* Copyright (c) 2026 Adarsh Pastakia
|
|
13
|
+
*
|
|
14
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
15
|
+
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
16
|
+
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
17
|
+
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
18
|
+
* subject to the following conditions:
|
|
19
|
+
*
|
|
20
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
21
|
+
* portions of the Software.
|
|
22
|
+
*
|
|
23
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
24
|
+
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
25
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
26
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Utility function to get badge properties from a badge value or object.
|
|
31
|
+
* It checks if the badge is an object and returns its properties,
|
|
32
|
+
*
|
|
33
|
+
* @param {string | number | BadgeType} badge - The badge value or object.
|
|
34
|
+
* @returns {AnyObject} An object containing badge properties.
|
|
35
|
+
*/
|
|
36
|
+
var getBadgeProps = function getBadgeProps(badge) {
|
|
37
|
+
if (utilities.isObject(badge) && ! /*#__PURE__*/react.isValidElement(badge)) {
|
|
38
|
+
return Object.assign({
|
|
39
|
+
forButton: true,
|
|
40
|
+
placement: ""
|
|
41
|
+
}, badge);
|
|
42
|
+
} else {
|
|
43
|
+
return {
|
|
44
|
+
value: badge,
|
|
45
|
+
forButton: true,
|
|
46
|
+
placement: ""
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
exports.getBadgeProps = getBadgeProps;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('react');
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* React Fabric
|
|
7
|
+
* @version: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* The MIT License (MIT)
|
|
11
|
+
* Copyright (c) 2026 Adarsh Pastakia
|
|
12
|
+
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
14
|
+
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
15
|
+
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
16
|
+
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
17
|
+
* subject to the following conditions:
|
|
18
|
+
*
|
|
19
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
20
|
+
* portions of the Software.
|
|
21
|
+
*
|
|
22
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
23
|
+
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
24
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
25
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
var getIconProps = function getIconProps(props) {
|
|
29
|
+
if (typeof props === "string") {
|
|
30
|
+
return {
|
|
31
|
+
icon: props
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
if (/*#__PURE__*/react.isValidElement(props)) {
|
|
35
|
+
return {
|
|
36
|
+
icon: props
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
return props;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
exports.getIconProps = getIconProps;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var utilities = require('@react-fabric/utilities');
|
|
4
|
+
var react = require('react');
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* React Fabric
|
|
8
|
+
* @version: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* The MIT License (MIT)
|
|
12
|
+
* Copyright (c) 2026 Adarsh Pastakia
|
|
13
|
+
*
|
|
14
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
15
|
+
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
16
|
+
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
17
|
+
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
18
|
+
* subject to the following conditions:
|
|
19
|
+
*
|
|
20
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
21
|
+
* portions of the Software.
|
|
22
|
+
*
|
|
23
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
|
24
|
+
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
25
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
26
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
var getTooltipProps = function getTooltipProps(tooltip, innerRef) {
|
|
30
|
+
if (utilities.isString(tooltip) || /*#__PURE__*/react.isValidElement(tooltip)) {
|
|
31
|
+
return {
|
|
32
|
+
ref: innerRef,
|
|
33
|
+
placement: "top",
|
|
34
|
+
content: tooltip
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
if (utilities.isObject(tooltip)) {
|
|
38
|
+
return Object.assign({
|
|
39
|
+
ref: innerRef,
|
|
40
|
+
placement: "top"
|
|
41
|
+
}, tooltip);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
exports.getTooltipProps = getTooltipProps;
|
|
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
19
19
|
* It supports custom alignment, disabled states, and can be easily styled with additional CSS classes.
|
|
20
20
|
*
|
|
21
21
|
* @param {ActionLabelProps} props - The properties for the ActionLabel component.
|
|
22
|
-
* @returns {
|
|
22
|
+
* @returns {React.ReactElement} The rendered ActionLabel component.
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```jsx
|
|
@@ -6,8 +6,8 @@ import classNames from 'classnames';
|
|
|
6
6
|
import { useMemo } from 'react';
|
|
7
7
|
import { useMemoDebugger } from '../../hooks/useEffectDebugger.js';
|
|
8
8
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
|
-
import { getColor } from '../../utils/getColor.js';
|
|
10
9
|
import '@react-fabric/utilities';
|
|
10
|
+
import { getColor } from '../../utils/getColor.js';
|
|
11
11
|
|
|
12
12
|
var _excluded = ["className", "color", "strokeColor", "type"],
|
|
13
13
|
_excluded2 = ["className"];
|
|
@@ -20,7 +20,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
20
20
|
* It also allows customization of the icon color and stroke color.
|
|
21
21
|
*
|
|
22
22
|
* @param {AnimationProps} props - The properties for the AnimationIndicator component.
|
|
23
|
-
* @returns {
|
|
23
|
+
* @returns {React.ReactElement} The rendered AnimationIndicator component.
|
|
24
24
|
*
|
|
25
25
|
* @example
|
|
26
26
|
* ```jsx
|
|
@@ -91,7 +91,7 @@ var AnimationIndicator = function AnimationIndicator(_ref) {
|
|
|
91
91
|
* @param {number | string} [props.size="2rem"] - The size of the loader icon.
|
|
92
92
|
* @param {string} props.icon - The icon to be displayed as the loader.
|
|
93
93
|
* @param {"sm" | "md" | "lg"} [props.maskBlur] - The blur effect for the background mask.
|
|
94
|
-
* @returns {
|
|
94
|
+
* @returns {React.ReactElement} The rendered AnimationLoader component.
|
|
95
95
|
*/
|
|
96
96
|
var AnimationLoader = function AnimationLoader(_ref2) {
|
|
97
97
|
var _ref2$color = _ref2.color,
|
|
@@ -123,7 +123,7 @@ var AnimationLoader = function AnimationLoader(_ref2) {
|
|
|
123
123
|
* @param {Object} props - The properties for the LoadingBars component.
|
|
124
124
|
* @param {ColorType | PaletteType | string} [props.color="tint-500"] - The color of the bars.
|
|
125
125
|
* @param {number | string} [props.size="2rem"] - The size of the bars.
|
|
126
|
-
* @returns {
|
|
126
|
+
* @returns {React.ReactElement} The rendered LoadingBars component.
|
|
127
127
|
*
|
|
128
128
|
* @example
|
|
129
129
|
* ```jsx
|
|
@@ -146,7 +146,7 @@ var LoadingBars = function LoadingBars(props) {
|
|
|
146
146
|
* @param {Object} props - The properties for the LoadingSpinner component.
|
|
147
147
|
* @param {ColorType | PaletteType | string} [props.color="tint-700"] - The color of the spinner.
|
|
148
148
|
* @param {number | string} [props.size="2rem"] - The size of the spinner.
|
|
149
|
-
* @returns {
|
|
149
|
+
* @returns {React.ReactElement} The rendered LoadingSpinner component.
|
|
150
150
|
*
|
|
151
151
|
* @example
|
|
152
152
|
* ```jsx
|
|
@@ -168,7 +168,7 @@ var LoadingSpinner = function LoadingSpinner(props) {
|
|
|
168
168
|
* providing a visual placeholder for content that is being loaded.
|
|
169
169
|
*
|
|
170
170
|
* @param {CssProp} props - The properties for the Skeleton component.
|
|
171
|
-
* @returns {
|
|
171
|
+
* @returns {React.ReactElement} The rendered Skeleton component.
|
|
172
172
|
*
|
|
173
173
|
* @example
|
|
174
174
|
* ```jsx
|
|
@@ -214,7 +214,7 @@ var Skeleton = function Skeleton(_ref3) {
|
|
|
214
214
|
* A component that displays a loading animation with a top border.
|
|
215
215
|
* It is typically used to indicate that content is being loaded in pages and page sections.
|
|
216
216
|
*
|
|
217
|
-
* @returns {
|
|
217
|
+
* @returns {React.ReactElement} The rendered Loading component.
|
|
218
218
|
*/
|
|
219
219
|
var LoadingLine = function LoadingLine() {
|
|
220
220
|
return /*#__PURE__*/jsx("div", {
|
|
@@ -29,7 +29,7 @@ var SizeMap = {
|
|
|
29
29
|
* It uses the Boring Avatars library for generating fallback avatars based on the user's name.
|
|
30
30
|
*
|
|
31
31
|
* @param {AvatarProps} props - The properties for the Avatar component.
|
|
32
|
-
* @returns {
|
|
32
|
+
* @returns {React.ReactElement} The rendered Avatar component.
|
|
33
33
|
*
|
|
34
34
|
* @example
|
|
35
35
|
* ```jsx
|
|
@@ -25,7 +25,7 @@ var SizeMap = {
|
|
|
25
25
|
* It automatically calculates the number of additional avatars based on the `totalCount` prop and the number of children provided.
|
|
26
26
|
*
|
|
27
27
|
* @param {AvatarGroupProps} props - The properties for the AvatarGroup component.
|
|
28
|
-
* @returns {
|
|
28
|
+
* @returns {React.ReactElement} The rendered AvatarGroup component.
|
|
29
29
|
*
|
|
30
30
|
* @example
|
|
31
31
|
* ```jsx
|
|
@@ -2,37 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
|
-
import {
|
|
5
|
+
import { isNil, isNumber, mergeRefs } from '@react-fabric/utilities';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
|
-
import {
|
|
8
|
-
import { Icon, getIconProps } from '../icon/Icon.js';
|
|
7
|
+
import { useMemo, isValidElement, cloneElement } from 'react';
|
|
9
8
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
|
+
import { getIconProps } from '../../utils/getIconProps.js';
|
|
10
|
+
import { Icon } from '../icon/Icon.js';
|
|
10
11
|
|
|
11
12
|
var _excluded = ["ref", "className", "value", "max", "ping", "block", "inline", "placement", "children", "forButton", "icon"];
|
|
12
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
|
-
/**
|
|
15
|
-
* Utility function to get badge properties from a badge value or object.
|
|
16
|
-
* It checks if the badge is an object and returns its properties,
|
|
17
|
-
*
|
|
18
|
-
* @param {string | number | BadgeType} badge - The badge value or object.
|
|
19
|
-
* @returns {AnyObject} An object containing badge properties.
|
|
20
|
-
*/
|
|
21
|
-
var getBadgeProps = function getBadgeProps(badge) {
|
|
22
|
-
if (isObject(badge) && ! /*#__PURE__*/isValidElement(badge)) {
|
|
23
|
-
return Object.assign({
|
|
24
|
-
forButton: true,
|
|
25
|
-
placement: ""
|
|
26
|
-
}, badge);
|
|
27
|
-
} else {
|
|
28
|
-
return {
|
|
29
|
-
value: badge,
|
|
30
|
-
forButton: true,
|
|
31
|
-
placement: ""
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
|
|
36
15
|
/**
|
|
37
16
|
* A component that displays a badge with a value, icon, and optional ping animation.
|
|
38
17
|
* It can be used to indicate notifications, messages, or other important information.
|
|
@@ -40,7 +19,7 @@ var getBadgeProps = function getBadgeProps(badge) {
|
|
|
40
19
|
* It can also wrap children elements, allowing for flexible usage in buttons or other components.
|
|
41
20
|
*
|
|
42
21
|
* @param {BadgeProps} props - The properties for the Badge component.
|
|
43
|
-
* @returns {
|
|
22
|
+
* @returns {React.ReactElement} The rendered Badge component.
|
|
44
23
|
*
|
|
45
24
|
* @example
|
|
46
25
|
* ```jsx
|
|
@@ -67,7 +46,7 @@ var Badge = function Badge(_ref) {
|
|
|
67
46
|
icon = _ref.icon,
|
|
68
47
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
69
48
|
var label = useMemo(function () {
|
|
70
|
-
if (
|
|
49
|
+
if (/*#__PURE__*/isValidElement(value)) {
|
|
71
50
|
return value;
|
|
72
51
|
}
|
|
73
52
|
if (!isNil(value)) {
|
|
@@ -101,4 +80,4 @@ var Badge = function Badge(_ref) {
|
|
|
101
80
|
});
|
|
102
81
|
};
|
|
103
82
|
|
|
104
|
-
export { Badge
|
|
83
|
+
export { Badge };
|
|
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
19
19
|
* It automatically manages the display of overflow items when there are too many links to fit in the available space, providing a dropdown for additional links.
|
|
20
20
|
*
|
|
21
21
|
* @param {BreadcrumbProps} props - The properties for the Breadcrumbs component.
|
|
22
|
-
* @returns {
|
|
22
|
+
* @returns {React.ReactElement} The rendered Breadcrumbs component.
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* ```jsx
|
|
@@ -5,16 +5,18 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
5
5
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
6
6
|
import { mergeRefs, isString, isObject, isNil } from '@react-fabric/utilities';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
|
-
import { useRef, useState,
|
|
8
|
+
import { useRef, useState, useEffectEvent, useEffect, useMemo, Fragment, isValidElement } from 'react';
|
|
9
9
|
import { useEffectDebugger } from '../../hooks/useEffectDebugger.js';
|
|
10
10
|
import { HotKey } from '../../hotkeys/HotKey.js';
|
|
11
11
|
import { HotKeyLabel } from '../../hotkeys/HotKeyLabel.js';
|
|
12
12
|
import { Tooltip } from '../../overlays/tooltip/Tooltip.js';
|
|
13
13
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
14
|
+
import { getBadgeProps } from '../../utils/getBadgeProps.js';
|
|
14
15
|
import { getColor } from '../../utils/getColor.js';
|
|
16
|
+
import { getIconProps } from '../../utils/getIconProps.js';
|
|
15
17
|
import { AnimationIndicator } from '../animations/Animations.js';
|
|
16
|
-
import {
|
|
17
|
-
import { Icon
|
|
18
|
+
import { Badge } from '../badge/Badge.js';
|
|
19
|
+
import { Icon } from '../icon/Icon.js';
|
|
18
20
|
|
|
19
21
|
var _excluded = ["as", "ref", "children", "className", "active", "color", "icon", "iconAlign", "altIcon", "rounded", "size", "disabled", "loading", "variant", "badge", "fullWidth", "spinOnHover", "onClick", "actionMessage", "preventDefault", "stopPropagation", "type", "hotKey", "showActionDone", "showActionDoneEvent", "tabIndex", "data-ref"];
|
|
20
22
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -26,7 +28,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
26
28
|
* It also includes features like after action tooltips, badges, and keyboard shortcuts.
|
|
27
29
|
*
|
|
28
30
|
* @param {ButtonProps} props - The properties for the Button component.
|
|
29
|
-
* @returns {
|
|
31
|
+
* @returns {React.ReactElement} The rendered Button component.
|
|
30
32
|
*
|
|
31
33
|
* @example
|
|
32
34
|
* ```jsx
|
|
@@ -88,7 +90,7 @@ var Button = function Button(_ref) {
|
|
|
88
90
|
setActionDone = _useState4[1];
|
|
89
91
|
|
|
90
92
|
// Handle click events
|
|
91
|
-
var clickHandler =
|
|
93
|
+
var clickHandler = useEffectEvent(function (e) {
|
|
92
94
|
setBusy(true);
|
|
93
95
|
preventDefault && e.preventDefault();
|
|
94
96
|
stopPropagation && e.stopPropagation();
|
|
@@ -99,7 +101,7 @@ var Button = function Button(_ref) {
|
|
|
99
101
|
setActionDone(true);
|
|
100
102
|
}
|
|
101
103
|
});
|
|
102
|
-
}
|
|
104
|
+
});
|
|
103
105
|
|
|
104
106
|
/** ***************** reset done state on timeout *******************/
|
|
105
107
|
useEffect(function () {
|
|
@@ -4,7 +4,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import { cloneElement } from 'react';
|
|
7
|
-
import { cloneChildren } from '../../utils/cloneElement.js';
|
|
7
|
+
import { cloneChildren as _cloneChildren } from '../../utils/cloneElement.js';
|
|
8
8
|
import '@react-fabric/utilities';
|
|
9
9
|
import { jsx } from 'react/jsx-runtime';
|
|
10
10
|
|
|
@@ -18,7 +18,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
18
18
|
* such as toolbars, action groups, or navigation buttons.
|
|
19
19
|
*
|
|
20
20
|
* @param {ButtonGroupProps} props - The properties for the ButtonGroup component.
|
|
21
|
-
* @returns {
|
|
21
|
+
* @returns {React.ReactElement} The rendered ButtonGroup component.
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
24
|
* ```jsx
|
|
@@ -52,7 +52,7 @@ var ButtonGroup = function ButtonGroup(_ref) {
|
|
|
52
52
|
"data-ref": "buttonGroup",
|
|
53
53
|
className: classNames("fabric-buttonGroup", className, fullWidth ? "flex" : "inline-flex", "flex-nowrap align-middle rounded", vertical && "vertical", vertical && "flex-col items-stretch")
|
|
54
54
|
}, aria), {}, {
|
|
55
|
-
children:
|
|
55
|
+
children: _cloneChildren(children, function (child) {
|
|
56
56
|
return /*#__PURE__*/cloneElement(child, _objectSpread({
|
|
57
57
|
color: color,
|
|
58
58
|
size: size,
|
|
@@ -6,7 +6,7 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
|
|
|
6
6
|
import { useFloating, autoUpdate, shift, flip, offset, arrow, useClick, useDismiss, useInteractions, FloatingPortal, FloatingFocusManager, FloatingArrow } from '@floating-ui/react';
|
|
7
7
|
import { mergeRefs } from '@react-fabric/utilities';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
|
-
import { useRef, useState,
|
|
9
|
+
import { useRef, useState, useEffectEvent, useEffect, useCallback, useMemo, Fragment } from 'react';
|
|
10
10
|
import { useTranslation } from 'react-i18next';
|
|
11
11
|
import { Button } from './Button.js';
|
|
12
12
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -23,7 +23,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
23
23
|
* It also supports custom placement of the dialog, and can display an action message when the action is completed.
|
|
24
24
|
*
|
|
25
25
|
* @param {ConfirmButtonProps} props - The properties for the ConfirmButton component.
|
|
26
|
-
* @returns {
|
|
26
|
+
* @returns {React.ReactElement} The rendered ConfirmButton component.
|
|
27
27
|
*
|
|
28
28
|
* @example
|
|
29
29
|
* ```jsx
|
|
@@ -40,6 +40,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
40
40
|
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-confirmbutton--docs} for more details.
|
|
41
41
|
*/
|
|
42
42
|
var ConfirmButton = function ConfirmButton(_ref) {
|
|
43
|
+
var _refs$domReference$cu, _refs$domReference$cu2;
|
|
43
44
|
var ref = _ref.ref,
|
|
44
45
|
message = _ref.message,
|
|
45
46
|
color = _ref.color,
|
|
@@ -69,7 +70,7 @@ var ConfirmButton = function ConfirmButton(_ref) {
|
|
|
69
70
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
70
71
|
actionDone = _useState6[0],
|
|
71
72
|
setActionDone = _useState6[1];
|
|
72
|
-
var clickHandler =
|
|
73
|
+
var clickHandler = useEffectEvent(function (e) {
|
|
73
74
|
setBusy(e);
|
|
74
75
|
var ret = onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
75
76
|
if (e) {
|
|
@@ -80,7 +81,7 @@ var ConfirmButton = function ConfirmButton(_ref) {
|
|
|
80
81
|
}
|
|
81
82
|
});
|
|
82
83
|
}
|
|
83
|
-
}
|
|
84
|
+
});
|
|
84
85
|
useEffect(function () {
|
|
85
86
|
if (actionDone) {
|
|
86
87
|
var timer = setTimeout(function () {
|
|
@@ -139,12 +140,12 @@ var ConfirmButton = function ConfirmButton(_ref) {
|
|
|
139
140
|
}, getReferenceProps()), {}, {
|
|
140
141
|
"data-dropdown-open": isOpen
|
|
141
142
|
})), isOpen && /*#__PURE__*/jsx(FloatingPortal, {
|
|
143
|
+
root: (_refs$domReference$cu = (_refs$domReference$cu2 = refs.domReference.current) === null || _refs$domReference$cu2 === void 0 ? void 0 : _refs$domReference$cu2.closest(".theme-base")) !== null && _refs$domReference$cu !== void 0 ? _refs$domReference$cu : undefined,
|
|
142
144
|
children: /*#__PURE__*/jsx(FloatingFocusManager, {
|
|
143
|
-
modal: true,
|
|
144
145
|
context: context,
|
|
145
146
|
children: /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
|
|
146
147
|
"data-color": color,
|
|
147
|
-
className: classNames("select-none not-italic rounded-capped shadow-lg outline outline-muted bg-
|
|
148
|
+
className: classNames("select-none not-italic rounded-capped shadow-lg outline outline-muted bg-default"),
|
|
148
149
|
ref: refs.setFloating,
|
|
149
150
|
style: _objectSpread({
|
|
150
151
|
zIndex: "var(--z-popover)"
|
|
@@ -183,7 +184,7 @@ var ConfirmButton = function ConfirmButton(_ref) {
|
|
|
183
184
|
ref: arrowRef,
|
|
184
185
|
context: context,
|
|
185
186
|
strokeWidth: 0.5,
|
|
186
|
-
className: "fill-
|
|
187
|
+
className: "fill-default stroke-muted"
|
|
187
188
|
})]
|
|
188
189
|
}))
|
|
189
190
|
})
|
|
@@ -7,7 +7,7 @@ import { isArray, EMPTY_ARRAY } from '@react-fabric/utilities';
|
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import { useCallback, cloneElement } from 'react';
|
|
9
9
|
import { useControlledValue } from '../../hooks/useControlledValue.js';
|
|
10
|
-
import { cloneChildren } from '../../utils/cloneElement.js';
|
|
10
|
+
import { cloneChildren as _cloneChildren } from '../../utils/cloneElement.js';
|
|
11
11
|
import { jsx } from 'react/jsx-runtime';
|
|
12
12
|
|
|
13
13
|
var _excluded = ["vertical", "className", "children", "variant", "rounded", "disabled", "fullWidth", "color", "size", "value", "onChange"];
|
|
@@ -20,7 +20,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
20
20
|
* such as toggle switches, selection groups, or multi-select options.
|
|
21
21
|
*
|
|
22
22
|
* @param {ToggleButtonGroupProps} props - The properties for the ToggleButtonGroup component.
|
|
23
|
-
* @returns {
|
|
23
|
+
* @returns {React.ReactElement} The rendered ToggleButtonGroup component.
|
|
24
24
|
*
|
|
25
25
|
* @example
|
|
26
26
|
* ```jsx
|
|
@@ -75,7 +75,7 @@ var ToggleButtonGroup = function ToggleButtonGroup(_ref) {
|
|
|
75
75
|
return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
|
|
76
76
|
className: classNames("fabric-buttonGroup", className, fullWidth ? "flex" : "inline-flex", "flex-nowrap align-middle", vertical && "vertical", vertical && "flex-col")
|
|
77
77
|
}, aria), {}, {
|
|
78
|
-
children:
|
|
78
|
+
children: _cloneChildren(children, function (child) {
|
|
79
79
|
return /*#__PURE__*/cloneElement(child, _objectSpread(_objectSpread({
|
|
80
80
|
color: color,
|
|
81
81
|
size: size,
|
|
@@ -6,14 +6,14 @@ import classNames from 'classnames';
|
|
|
6
6
|
import { Icon } from '../icon/Icon.js';
|
|
7
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
|
-
var _excluded = ["children", "color", "legend", "title", "icon", "border", "onClose", "className"];
|
|
9
|
+
var _excluded = ["children", "color", "legend", "legendClassName", "title", "icon", "border", "onClose", "className"];
|
|
10
10
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
11
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
12
|
// colors for different callout types
|
|
13
13
|
var colors = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
muted: "bg-
|
|
14
|
+
"default": "bg-default text-tint-900 border-tint-100",
|
|
15
|
+
dimmed: "bg-dimmed text-dimmed border-tint-200",
|
|
16
|
+
muted: "bg-muted text-muted border-tint-200",
|
|
17
17
|
primary: "bg-primary-50/50 text-primary-800 border-primary-300",
|
|
18
18
|
accent: "bg-accent-50/50 text-accent-800 border-accent-300",
|
|
19
19
|
info: "bg-info-50/50 text-info-800 border-info-300",
|
|
@@ -30,7 +30,7 @@ var colors = {
|
|
|
30
30
|
* such as alerts, notifications, or important messages.
|
|
31
31
|
*
|
|
32
32
|
* @param {CalloutProps} props - The properties for the Callout component.
|
|
33
|
-
* @returns {
|
|
33
|
+
* @returns {React.ReactElement} The rendered Callout component.
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
36
36
|
* ```jsx
|
|
@@ -53,6 +53,7 @@ var Callout = function Callout(_ref) {
|
|
|
53
53
|
_ref$color = _ref.color,
|
|
54
54
|
color = _ref$color === void 0 ? "default" : _ref$color,
|
|
55
55
|
legend = _ref.legend,
|
|
56
|
+
legendClassName = _ref.legendClassName,
|
|
56
57
|
title = _ref.title,
|
|
57
58
|
icon = _ref.icon,
|
|
58
59
|
border = _ref.border,
|
|
@@ -60,10 +61,10 @@ var Callout = function Callout(_ref) {
|
|
|
60
61
|
className = _ref.className,
|
|
61
62
|
aria = _objectWithoutProperties(_ref, _excluded);
|
|
62
63
|
return /*#__PURE__*/jsxs("fieldset", _objectSpread(_objectSpread({
|
|
63
|
-
className: classNames("block rounded-capped border max-w-full relative overflow-hidden
|
|
64
|
+
className: classNames("block rounded-capped border max-w-full relative overflow-hidden", colors[color], className, border === "dashed" && "border-dashed", border === "dotted" && "border-dotted")
|
|
64
65
|
}, aria), {}, {
|
|
65
66
|
children: [legend && /*#__PURE__*/jsx("legend", {
|
|
66
|
-
className: "px-2 mx-4 font-medium",
|
|
67
|
+
className: classNames("px-2 mx-4 font-medium", legendClassName),
|
|
67
68
|
"data-ref": "calloutLegend",
|
|
68
69
|
children: legend
|
|
69
70
|
}), /*#__PURE__*/jsxs("div", {
|
|
@@ -4,7 +4,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
4
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
5
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
|
-
import { useMemo, Children,
|
|
7
|
+
import { useMemo, Children, useEffectEvent } from 'react';
|
|
8
8
|
import { ErrorBoundary } from '../../core/boundary/ErrorBoundary.js';
|
|
9
9
|
import { Header, Footer } from '../../core/headfoot/HeadFoot.js';
|
|
10
10
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -23,7 +23,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
23
23
|
* It can be styled with custom CSS classes and supports features like selection indication and drag-and-drop functionality.
|
|
24
24
|
*
|
|
25
25
|
* @param {CardProps} props - The properties for the Card component.
|
|
26
|
-
* @returns {
|
|
26
|
+
* @returns {React.ReactElement} The rendered Card component.
|
|
27
27
|
*
|
|
28
28
|
* @example
|
|
29
29
|
* ```jsx
|
|
@@ -73,11 +73,11 @@ var Card = function Card(_ref) {
|
|
|
73
73
|
header = _useMemo2[0],
|
|
74
74
|
body = _useMemo2[1],
|
|
75
75
|
footer = _useMemo2[2];
|
|
76
|
-
var handleDragStart =
|
|
76
|
+
var handleDragStart = useEffectEvent(function (event) {
|
|
77
77
|
var _event$dataTransfer;
|
|
78
78
|
dragKey && ((_event$dataTransfer = event.dataTransfer) === null || _event$dataTransfer === void 0 ? void 0 : _event$dataTransfer.setData(dragKey, JSON.stringify(dragData)));
|
|
79
79
|
dragKey && (onDragStart === null || onDragStart === void 0 ? void 0 : onDragStart(event, dragKey, dragData));
|
|
80
|
-
}
|
|
80
|
+
});
|
|
81
81
|
var E = as !== null && as !== void 0 ? as : "div";
|
|
82
82
|
return /*#__PURE__*/jsx("div", {
|
|
83
83
|
className: classNames("fabric-cardWrapper", "rounded-capped relative grid", flex && "flex-1", selected && selectedRibbon && "selected", selected && "outline-1 outline-accent-500 outline-offset-2"),
|
|
@@ -25,7 +25,7 @@ var scheme = {
|
|
|
25
25
|
* It can be used to create visually appealing card layouts with media content.
|
|
26
26
|
*
|
|
27
27
|
* @param {CardCoverProps} props - The properties for the CardCover component.
|
|
28
|
-
* @returns {
|
|
28
|
+
* @returns {React.ReactElement} The rendered CardCover component.
|
|
29
29
|
*
|
|
30
30
|
* @example
|
|
31
31
|
* ```jsx
|
|
@@ -14,7 +14,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
14
14
|
* The `flipCard` method can be called to toggle the visibility of the back content.
|
|
15
15
|
*
|
|
16
16
|
* @param {Props} props - The properties for the FlipContent component.
|
|
17
|
-
* @returns {
|
|
17
|
+
* @returns {React.ReactElement} The rendered FlipContent component.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* ```jsx
|
|
@@ -46,7 +46,7 @@ var FlipContent = function FlipContent(_ref) {
|
|
|
46
46
|
children: Children.map(children, function (child, idx) {
|
|
47
47
|
var _child$props$classNam, _child$props;
|
|
48
48
|
return /*#__PURE__*/isValidElement(child) && /*#__PURE__*/cloneElement(child, {
|
|
49
|
-
className: classNames((_child$props$classNam = (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.className) !== null && _child$props$classNam !== void 0 ? _child$props$classNam : "", idx === 0 ? "bg-
|
|
49
|
+
className: classNames((_child$props$classNam = (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.className) !== null && _child$props$classNam !== void 0 ? _child$props$classNam : "", idx === 0 ? "bg-content relative" : "bg-content absolute inset-0"),
|
|
50
50
|
"data-card-flip-face": idx === 0 ? "front" : "back"
|
|
51
51
|
});
|
|
52
52
|
})
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
|
-
import {
|
|
6
|
+
import { useEffectEvent } from 'react';
|
|
7
7
|
import { useMemoDebugger } from '../../hooks/useEffectDebugger.js';
|
|
8
8
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
|
-
import { getColor } from '../../utils/getColor.js';
|
|
10
9
|
import '@react-fabric/utilities';
|
|
11
|
-
import {
|
|
10
|
+
import { getColor } from '../../utils/getColor.js';
|
|
11
|
+
import { getIconProps } from '../../utils/getIconProps.js';
|
|
12
|
+
import { Icon } from '../icon/Icon.js';
|
|
12
13
|
|
|
13
14
|
var _excluded = ["ref", "children", "className", "size", "color", "variant", "icon", "disabled", "onClick", "onIconClick", "onRemove", "rounded", "preventDefault", "stopPropagation", "as"];
|
|
14
15
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -30,7 +31,7 @@ var SizeMap = {
|
|
|
30
31
|
* It can also include an icon and a remove button, making it versatile for different use cases.
|
|
31
32
|
*
|
|
32
33
|
* @param {ChipProps} props - The properties for the Chip component.
|
|
33
|
-
* @returns {
|
|
34
|
+
* @returns {React.ReactElement} The rendered Chip component.
|
|
34
35
|
*
|
|
35
36
|
* @example
|
|
36
37
|
* ```jsx
|
|
@@ -72,15 +73,15 @@ var Chip = function Chip(_ref) {
|
|
|
72
73
|
}
|
|
73
74
|
return s;
|
|
74
75
|
}, [color, size], "Chip styles");
|
|
75
|
-
var clickHandler =
|
|
76
|
+
var clickHandler = useEffectEvent(function (e) {
|
|
76
77
|
preventDefault && e.preventDefault();
|
|
77
78
|
stopPropagation && e.stopPropagation();
|
|
78
79
|
onClick === null || onClick === void 0 || onClick(e);
|
|
79
|
-
}
|
|
80
|
-
var removeHandler =
|
|
80
|
+
});
|
|
81
|
+
var removeHandler = useEffectEvent(function (e) {
|
|
81
82
|
if (stopPropagation) e.stopPropagation();
|
|
82
83
|
onRemove === null || onRemove === void 0 || onRemove(e);
|
|
83
|
-
}
|
|
84
|
+
});
|
|
84
85
|
var E = as !== null && as !== void 0 ? as : "div";
|
|
85
86
|
return /*#__PURE__*/jsxs(E, _objectSpread(_objectSpread({
|
|
86
87
|
ref: ref,
|