@react-fabric/core 1.0.0-beta.3 → 1.0.0-beta.30
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/index.js +14 -14
- package/css/reset/_reset.css +1 -1
- package/dist/cjs/components/actionLabel/ActionLabel.js +1 -0
- package/dist/cjs/components/animations/Animations.js +14 -7
- package/dist/cjs/components/avatar/Avatar.js +8 -10
- package/dist/cjs/components/avatar/AvatarGroup.js +1 -0
- package/dist/cjs/components/badge/Badge.js +5 -4
- package/dist/cjs/components/breadcrumbs/Breadcrumbs.js +5 -2
- package/dist/cjs/components/button/Button.js +5 -4
- package/dist/cjs/components/button/Button.module.css +1 -1
- package/dist/cjs/components/button/ButtonGroup.js +3 -1
- package/dist/cjs/components/button/ConfirmButton.js +7 -2
- package/dist/cjs/components/button/ToggleButtonGroup.js +2 -1
- package/dist/cjs/components/callout/Callout.js +7 -2
- package/dist/cjs/components/card/Card.js +5 -3
- package/dist/cjs/components/card/CardCover.js +1 -1
- package/dist/cjs/components/chip/Chip.js +9 -4
- package/dist/cjs/components/chip/Chip.module.css +1 -1
- package/dist/cjs/components/collapsable/Collapsable.js +3 -2
- package/dist/cjs/components/divider/Divider.js +4 -3
- package/dist/cjs/components/divider/Divider.module.css +1 -0
- package/dist/cjs/components/dropdown/Dropdown.js +4 -2
- package/dist/cjs/components/dropdown/DropdownTool.js +4 -3
- package/dist/cjs/components/icon/Icon.js +14 -12
- package/dist/cjs/components/icon/Icon.module.css +1 -1
- package/dist/cjs/components/menu/ContextMenu.js +30 -10
- package/dist/cjs/components/menu/Menu.js +39 -20
- package/dist/cjs/components/menu/MenuItem.js +29 -14
- package/dist/cjs/components/navigator/Navigator.js +16 -9
- package/dist/cjs/components/panel/Panel.js +3 -1
- package/dist/cjs/components/progress/ProgressBar.js +2 -1
- package/dist/cjs/components/progress/ProgressCircle.js +2 -1
- package/dist/cjs/components/tabpanel/Tab.js +55 -36
- package/dist/cjs/components/tabpanel/TabPanel.js +19 -14
- package/dist/cjs/components/tabpanel/TabPanel.module.css +1 -1
- package/dist/cjs/core/aside/Aside.js +6 -2
- package/dist/cjs/core/content/Content.js +8 -5
- package/dist/cjs/core/headfoot/HeadFoot.js +3 -2
- package/dist/cjs/core/headfoot/HeadFoot.module.css +1 -1
- package/dist/cjs/core/page/Page.js +1 -0
- package/dist/cjs/core/responsive/Responsive.js +1 -1
- package/dist/cjs/core/section/Section.module.css +1 -1
- package/dist/cjs/hooks/useNavigator.js +6 -4
- package/dist/cjs/index.js +7 -2
- package/dist/cjs/overlays/alert/Alert.js +42 -17
- package/dist/cjs/overlays/alert/Alert.module.css +1 -1
- package/dist/cjs/overlays/flyout/Flyout.js +40 -42
- package/dist/cjs/overlays/message/Message.js +1 -1
- package/dist/cjs/overlays/modal/Modal.js +4 -5
- package/dist/cjs/overlays/toast/Toast.js +1 -1
- package/dist/cjs/overlays/tooltip/Tooltip.js +3 -3
- package/dist/cjs/overlays/tooltip/Tooltip.module.css +1 -1
- package/dist/cjs/types/icons.js +3 -0
- package/dist/cjs/typography/Abbr.js +1 -1
- package/dist/cjs/typography/{Link.js → Anchor.js} +4 -3
- package/dist/cjs/typography/Mark.js +1 -1
- package/dist/cjs/typography/Text.js +2 -2
- package/dist/cjs/typography/Title.js +3 -2
- package/dist/cjs/typography/Typography.module.css +1 -1
- package/dist/cjs/utils/cloneElement.js +44 -0
- package/dist/esm/components/actionLabel/ActionLabel.js +1 -0
- package/dist/esm/components/animations/Animations.js +14 -7
- package/dist/esm/components/avatar/Avatar.js +9 -11
- package/dist/esm/components/avatar/AvatarGroup.js +1 -0
- package/dist/esm/components/badge/Badge.js +5 -4
- package/dist/esm/components/breadcrumbs/Breadcrumbs.js +5 -2
- package/dist/esm/components/button/Button.js +5 -4
- package/dist/esm/components/button/Button.module.css +1 -1
- package/dist/esm/components/button/ButtonGroup.js +4 -2
- package/dist/esm/components/button/ConfirmButton.js +7 -2
- package/dist/esm/components/button/ToggleButtonGroup.js +3 -2
- package/dist/esm/components/callout/Callout.js +7 -2
- package/dist/esm/components/card/Card.js +5 -3
- package/dist/esm/components/card/CardCover.js +1 -1
- package/dist/esm/components/chip/Chip.js +9 -4
- package/dist/esm/components/chip/Chip.module.css +1 -1
- package/dist/esm/components/collapsable/Collapsable.js +3 -2
- package/dist/esm/components/divider/Divider.js +4 -3
- package/dist/esm/components/divider/Divider.module.css +1 -0
- package/dist/esm/components/dropdown/Dropdown.js +4 -2
- package/dist/esm/components/dropdown/DropdownTool.js +4 -3
- package/dist/esm/components/icon/Icon.js +14 -12
- package/dist/esm/components/icon/Icon.module.css +1 -1
- package/dist/esm/components/menu/ContextMenu.js +32 -12
- package/dist/esm/components/menu/Menu.js +41 -22
- package/dist/esm/components/menu/MenuItem.js +23 -8
- package/dist/esm/components/navigator/Navigator.js +16 -9
- package/dist/esm/components/panel/Panel.js +3 -1
- package/dist/esm/components/progress/ProgressBar.js +2 -1
- package/dist/esm/components/progress/ProgressCircle.js +2 -1
- package/dist/esm/components/tabpanel/Tab.js +56 -37
- package/dist/esm/components/tabpanel/TabPanel.js +19 -14
- package/dist/esm/components/tabpanel/TabPanel.module.css +1 -1
- package/dist/esm/core/aside/Aside.js +6 -2
- package/dist/esm/core/content/Content.js +8 -5
- package/dist/esm/core/headfoot/HeadFoot.js +3 -2
- package/dist/esm/core/headfoot/HeadFoot.module.css +1 -1
- package/dist/esm/core/page/Page.js +1 -0
- package/dist/esm/core/responsive/Responsive.js +1 -1
- package/dist/esm/core/section/Section.module.css +1 -1
- package/dist/esm/hooks/useNavigator.js +7 -5
- package/dist/esm/index.js +4 -1
- package/dist/esm/overlays/alert/Alert.js +31 -6
- package/dist/esm/overlays/alert/Alert.module.css +1 -1
- package/dist/esm/overlays/flyout/Flyout.js +41 -43
- package/dist/esm/overlays/message/Message.js +1 -1
- package/dist/esm/overlays/modal/Modal.js +5 -6
- package/dist/esm/overlays/toast/Toast.js +1 -1
- package/dist/esm/overlays/tooltip/Tooltip.js +3 -3
- package/dist/esm/overlays/tooltip/Tooltip.module.css +1 -1
- package/dist/esm/types/icons.js +3 -0
- package/dist/esm/typography/Abbr.js +1 -1
- package/dist/esm/typography/{Link.js → Anchor.js} +4 -3
- package/dist/esm/typography/Mark.js +1 -1
- package/dist/esm/typography/Text.js +2 -2
- package/dist/esm/typography/Title.js +3 -2
- package/dist/esm/typography/Typography.module.css +1 -1
- package/dist/esm/utils/cloneElement.js +44 -0
- package/dist/types/components/actionLabel/ActionLabel.d.ts +2 -2
- package/dist/types/components/animations/Animations.d.ts +1 -1
- package/dist/types/components/badge/Badge.d.ts +5 -1
- package/dist/types/components/breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/dist/types/components/button/Button.d.ts +5 -3
- package/dist/types/components/button/ConfirmButton.d.ts +6 -1
- package/dist/types/components/card/Card.d.ts +3 -3
- package/dist/types/components/chip/Chip.d.ts +1 -1
- package/dist/types/components/collapsable/Collapsable.d.ts +5 -1
- package/dist/types/components/dropdown/DropdownTool.d.ts +2 -1
- package/dist/types/components/media/Media.d.ts +2 -2
- package/dist/types/components/menu/ContextMenu.d.ts +2 -1
- package/dist/types/components/menu/MenuItem.d.ts +1 -1
- package/dist/types/components/navigator/Navigator.d.ts +3 -3
- package/dist/types/components/tabpanel/Tab.d.ts +4 -4
- package/dist/types/components/tabpanel/TabPanel.d.ts +10 -1
- package/dist/types/core/aside/Aside.d.ts +7 -3
- package/dist/types/core/content/Content.d.ts +3 -2
- package/dist/types/core/responsive/Responsive.d.ts +1 -1
- package/dist/types/core/theme/ThemeProvider.d.ts +1 -1
- package/dist/types/hooks/useOverlayService.d.ts +3 -3
- package/dist/types/index.d.ts +3 -0
- package/dist/types/overlays/alert/Alert.d.ts +9 -1
- package/dist/types/overlays/flyout/Flyout.d.ts +3 -2
- package/dist/types/overlays/modal/Modal.d.ts +4 -3
- package/dist/types/types/icons.d.ts +3 -0
- package/dist/types/types/index.d.ts +8 -1
- package/dist/types/typography/{Link.d.ts → Anchor.d.ts} +2 -2
- package/dist/types/typography/index.d.ts +1 -1
- package/dist/types/utils/cloneElement.d.ts +2 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +5 -5
- package/src/components/actionLabel/ActionLabel.tsx +13 -3
- package/src/components/animations/Animations.tsx +9 -3
- package/src/components/avatar/Avatar.tsx +69 -81
- package/src/components/avatar/AvatarGroup.tsx +1 -0
- package/src/components/badge/Badge.tsx +9 -4
- package/src/components/breadcrumbs/Breadcrumbs.tsx +9 -4
- package/src/components/button/Button.module.css +8 -1
- package/src/components/button/Button.tsx +12 -9
- package/src/components/button/ButtonGroup.tsx +3 -2
- package/src/components/button/ConfirmButton.tsx +15 -5
- package/src/components/button/ToggleButtonGroup.tsx +3 -2
- package/src/components/callout/Callout.tsx +12 -3
- package/src/components/card/Card.tsx +4 -0
- package/src/components/chip/Chip.module.css +4 -1
- package/src/components/chip/Chip.tsx +9 -4
- package/src/components/collapsable/Collapsable.tsx +6 -0
- package/src/components/divider/Divider.module.css +32 -0
- package/src/components/divider/Divider.tsx +3 -2
- package/src/components/dropdown/Dropdown.tsx +3 -2
- package/src/components/dropdown/DropdownTool.tsx +4 -2
- package/src/components/icon/Icon.module.css +0 -1
- package/src/components/icon/Icon.tsx +48 -58
- package/src/components/media/Media.tsx +2 -2
- package/src/components/menu/ContextMenu.tsx +36 -11
- package/src/components/menu/Menu.tsx +51 -30
- package/src/components/menu/MenuItem.tsx +14 -3
- package/src/components/navigator/Navigator.tsx +17 -4
- package/src/components/panel/Panel.tsx +3 -1
- package/src/components/tabpanel/Tab.tsx +74 -59
- package/src/components/tabpanel/TabPanel.module.css +19 -30
- package/src/components/tabpanel/TabPanel.tsx +33 -10
- package/src/core/aside/Aside.tsx +17 -3
- package/src/core/content/Content.tsx +16 -10
- package/src/core/headfoot/HeadFoot.module.css +2 -0
- package/src/core/headfoot/HeadFoot.tsx +1 -1
- package/src/core/page/Page.tsx +1 -0
- package/src/core/responsive/Responsive.tsx +3 -2
- package/src/core/section/Section.module.css +1 -1
- package/src/core/theme/ThemeProvider.tsx +1 -1
- package/src/hooks/useNavigator.tsx +10 -5
- package/src/hooks/useOverlayService.tsx +12 -4
- package/src/index.ts +4 -0
- package/src/overlays/alert/Alert.module.css +1 -1
- package/src/overlays/alert/Alert.tsx +30 -4
- package/src/overlays/flyout/Flyout.tsx +63 -62
- package/src/overlays/modal/Modal.tsx +13 -8
- package/src/overlays/tooltip/Tooltip.module.css +7 -7
- package/src/overlays/tooltip/Tooltip.tsx +4 -4
- package/src/types/icons.ts +6 -0
- package/src/types/index.ts +10 -9
- package/src/typography/{Link.tsx → Anchor.tsx} +3 -3
- package/src/typography/Text.tsx +1 -1
- package/src/typography/Title.tsx +0 -1
- package/src/typography/Typography.module.css +4 -2
- package/src/typography/index.ts +1 -1
- package/src/utils/cloneElement.ts +44 -0
- package/src/utils/index.ts +1 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
|
-
import { useState, useCallback, useMemo } from 'react';
|
|
4
|
+
import { useState, useRef, useCallback, useMemo } from 'react';
|
|
5
5
|
import { jsxs } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
7
|
var useNavigator = function useNavigator() {
|
|
@@ -11,17 +11,19 @@ var useNavigator = function useNavigator() {
|
|
|
11
11
|
_useState2 = _slicedToArray(_useState, 2),
|
|
12
12
|
currentIndex = _useState2[0],
|
|
13
13
|
setCurrentIndex = _useState2[1];
|
|
14
|
+
var refCurrent = useRef(defaultIndex);
|
|
14
15
|
var onNavigate = useCallback(function (dir) {
|
|
15
16
|
if (dir === -1) {
|
|
16
|
-
|
|
17
|
+
refCurrent.current = refCurrent.current > 0 ? refCurrent.current - 1 : totalCount - 1;
|
|
17
18
|
}
|
|
18
19
|
if (dir === 1) {
|
|
19
|
-
|
|
20
|
+
refCurrent.current = refCurrent.current + 1 < totalCount ? refCurrent.current + 1 : 0;
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
+
setCurrentIndex(refCurrent.current);
|
|
23
|
+
}, [totalCount]);
|
|
22
24
|
var headLabel = useMemo(function () {
|
|
23
25
|
return /*#__PURE__*/jsxs("span", {
|
|
24
|
-
className: "text-muted leading-none",
|
|
26
|
+
className: "text-muted leading-none select-none",
|
|
25
27
|
children: [currentIndex + 1, "/", totalCount]
|
|
26
28
|
});
|
|
27
29
|
}, [currentIndex, totalCount]);
|
package/dist/esm/index.js
CHANGED
|
@@ -44,20 +44,22 @@ export { ThemeProvider } from './core/theme/ThemeProvider.js';
|
|
|
44
44
|
export { Viewport } from './core/viewport/Viewport.js';
|
|
45
45
|
export { addTranslationBundle } from './i18n/index.js';
|
|
46
46
|
import '@babel/runtime/helpers/defineProperty';
|
|
47
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
47
48
|
import '@floating-ui/react';
|
|
48
49
|
import 'classnames';
|
|
49
50
|
import 'react';
|
|
50
51
|
import 'react-i18next';
|
|
51
52
|
export { CoreIcons } from './types/icons.js';
|
|
52
53
|
export { Title } from './typography/Title.js';
|
|
54
|
+
export { cloneChildren } from './utils/cloneElement.js';
|
|
53
55
|
import '@react-fabric/utilities';
|
|
54
56
|
import 'react/jsx-runtime';
|
|
55
57
|
export { Flyout } from './overlays/flyout/Flyout.js';
|
|
56
58
|
export { Modal } from './overlays/modal/Modal.js';
|
|
57
59
|
export { Tooltip } from './overlays/tooltip/Tooltip.js';
|
|
58
60
|
export { Abbr } from './typography/Abbr.js';
|
|
61
|
+
export { Anchor } from './typography/Anchor.js';
|
|
59
62
|
export { Copy } from './typography/Copy.js';
|
|
60
|
-
export { Link } from './typography/Link.js';
|
|
61
63
|
export { Mark } from './typography/Mark.js';
|
|
62
64
|
export { Text } from './typography/Text.js';
|
|
63
65
|
export { useClientService } from './hooks/useClientService.js';
|
|
@@ -72,4 +74,5 @@ export { useResizeObserver } from './hooks/useResizeObserver.js';
|
|
|
72
74
|
export { useLocalStorage, useSessionStorage } from './hooks/useStorage.js';
|
|
73
75
|
export { HotKey } from './hotkeys/HotKey.js';
|
|
74
76
|
export { HotKeyLabel } from './hotkeys/HotKeyLabel.js';
|
|
77
|
+
export { HotKeyWrapper } from './hotkeys/HotKeyWrapper.js';
|
|
75
78
|
export { ApplicationProvider, useApplicationContext, useGlobals, useNotificationService } from './context/Global.js';
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
5
|
import { useFloating, useDismiss, useRole, useInteractions, FloatingPortal, FloatingOverlay, FloatingFocusManager } from '@floating-ui/react';
|
|
5
6
|
import classNames from 'classnames';
|
|
6
|
-
import { useMemo, useCallback, useLayoutEffect } from 'react';
|
|
7
|
+
import { useState, useMemo, useCallback, useLayoutEffect } from 'react';
|
|
7
8
|
import { useTranslation } from 'react-i18next';
|
|
8
9
|
import { AnimationIndicator } from '../../components/animations/Animations.js';
|
|
9
10
|
import { Button } from '../../components/button/Button.js';
|
|
10
11
|
import { Icon } from '../../components/icon/Icon.js';
|
|
11
12
|
import { CoreIcons } from '../../types/icons.js';
|
|
12
13
|
import { Title } from '../../typography/Title.js';
|
|
14
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
13
15
|
import { getColorClass, getBorderClass } from '../../utils/getColor.js';
|
|
14
16
|
import '@react-fabric/utilities';
|
|
15
17
|
import classes from './Alert.module.css';
|
|
16
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
17
18
|
|
|
18
19
|
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; }
|
|
19
20
|
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; }
|
|
@@ -28,9 +29,15 @@ var Alert = function Alert(_ref) {
|
|
|
28
29
|
onClose = _ref.onClose,
|
|
29
30
|
type = _ref.type,
|
|
30
31
|
okLabel = _ref.okLabel,
|
|
31
|
-
cancelLabel = _ref.cancelLabel
|
|
32
|
+
cancelLabel = _ref.cancelLabel,
|
|
33
|
+
placeholder = _ref.placeholder,
|
|
34
|
+
defaultValue = _ref.defaultValue;
|
|
32
35
|
var _useTranslation = useTranslation("core"),
|
|
33
36
|
t = _useTranslation.t;
|
|
37
|
+
var _useState = useState(defaultValue),
|
|
38
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
39
|
+
value = _useState2[0],
|
|
40
|
+
setValue = _useState2[1];
|
|
34
41
|
var _useFloating = useFloating({
|
|
35
42
|
open: true,
|
|
36
43
|
onOpenChange: function onOpenChange() {
|
|
@@ -107,11 +114,29 @@ var Alert = function Alert(_ref) {
|
|
|
107
114
|
className: classNames("area-[icon] text-lg py-2"),
|
|
108
115
|
children: iconType
|
|
109
116
|
}), /*#__PURE__*/jsx(Title, {
|
|
110
|
-
className: "font-medium area-[title]",
|
|
117
|
+
className: "font-medium area-[title] self-center",
|
|
111
118
|
children: title
|
|
112
|
-
}), /*#__PURE__*/jsx("
|
|
119
|
+
}), /*#__PURE__*/jsx("div", {
|
|
113
120
|
className: "area-[message] py-4",
|
|
114
121
|
children: message
|
|
122
|
+
}), type === "prompt" && /*#__PURE__*/jsx("input", {
|
|
123
|
+
value: value,
|
|
124
|
+
placeholder: placeholder,
|
|
125
|
+
className: classNames("area-[input] appearance-none outline-0 ring-".concat(color, "-500 border rounded border-").concat(color, "-200 w-full px-2 py-1")),
|
|
126
|
+
ref: function ref(e) {
|
|
127
|
+
return e != null && setTimeout(function () {
|
|
128
|
+
return e.focus();
|
|
129
|
+
}, 100);
|
|
130
|
+
},
|
|
131
|
+
onBlur: function onBlur(e) {
|
|
132
|
+
return e.target.focus();
|
|
133
|
+
},
|
|
134
|
+
onChange: function onChange(e) {
|
|
135
|
+
return setValue(e.target.value);
|
|
136
|
+
},
|
|
137
|
+
onKeyDown: function onKeyDown(e) {
|
|
138
|
+
return e.key === "Enter" && handleClose(value);
|
|
139
|
+
}
|
|
115
140
|
}), /*#__PURE__*/jsxs("div", {
|
|
116
141
|
className: "flex gap-1 justify-center flex-nowrap pt-2 area-[actions]",
|
|
117
142
|
children: [/*#__PURE__*/jsx("div", {
|
|
@@ -133,7 +158,7 @@ var Alert = function Alert(_ref) {
|
|
|
133
158
|
variant: "solid",
|
|
134
159
|
color: color,
|
|
135
160
|
onClick: function onClick() {
|
|
136
|
-
return handleClose(true);
|
|
161
|
+
return handleClose(type === "prompt" ? value : true);
|
|
137
162
|
},
|
|
138
163
|
children: okLabel !== null && okLabel !== void 0 ? okLabel : t("action.ok", "OK")
|
|
139
164
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer comp{.alert{gap:.5rem 1rem;grid-template:"icon title" auto "
|
|
1
|
+
@layer comp{.alert{gap:.5rem 1rem;grid-template:"icon title" auto "message message" auto "input input" auto "actions actions" auto/auto 1fr;margin-top:-100%;opacity:0;transition:margin .4s,opacity .3s .2s;z-index:var(--z-overlay);&[data-show=true]{margin-top:0;opacity:1}}}
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
5
|
import { useFloating, useDismiss, useRole, useInteractions, FloatingOverlay, FloatingPortal, FloatingFocusManager } from '@floating-ui/react';
|
|
6
|
+
import { isString } from '@react-fabric/utilities';
|
|
6
7
|
import classNames from 'classnames';
|
|
7
|
-
import { useCallback, useEffect, Fragment } from 'react';
|
|
8
|
+
import { useCallback, useEffect, Fragment, isValidElement } from 'react';
|
|
8
9
|
import { Loading } from '../../components/animations/Animations.js';
|
|
9
10
|
import { Icon } from '../../components/icon/Icon.js';
|
|
10
11
|
import { Header } from '../../core/headfoot/HeadFoot.js';
|
|
@@ -47,6 +48,7 @@ var Flyout = function Flyout(_ref) {
|
|
|
47
48
|
context = _useFloating.context;
|
|
48
49
|
var dismiss = useDismiss(context, {
|
|
49
50
|
outsidePressEvent: "mousedown",
|
|
51
|
+
outsidePress: !hideMask,
|
|
50
52
|
escapeKey: true
|
|
51
53
|
});
|
|
52
54
|
var role = useRole(context);
|
|
@@ -73,9 +75,7 @@ var Flyout = function Flyout(_ref) {
|
|
|
73
75
|
}, [onBeforeClose, onClose]);
|
|
74
76
|
useEffect(function () {
|
|
75
77
|
setTimeout(function () {
|
|
76
|
-
var _refs$floating$curren2;
|
|
77
78
|
refs.floating.current && (refs.floating.current.dataset.show = "true");
|
|
78
|
-
(_refs$floating$curren2 = refs.floating.current) === null || _refs$floating$curren2 === void 0 || (_refs$floating$curren2 = _refs$floating$curren2.querySelector('[role="dialog"]')) === null || _refs$floating$curren2 === void 0 || _refs$floating$curren2.focus();
|
|
79
79
|
}, 50);
|
|
80
80
|
}, []);
|
|
81
81
|
var tryClosing = useCallback(function (e) {
|
|
@@ -103,47 +103,45 @@ var Flyout = function Flyout(_ref) {
|
|
|
103
103
|
children: /*#__PURE__*/jsx(Wrapper, {
|
|
104
104
|
children: /*#__PURE__*/jsx(FloatingFocusManager, {
|
|
105
105
|
context: context,
|
|
106
|
-
children: /*#__PURE__*/jsx(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
children: /*#__PURE__*/jsxs(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
})]
|
|
138
|
-
}), loading && /*#__PURE__*/jsx(Loading, {}), /*#__PURE__*/jsx("div", {
|
|
139
|
-
role: "dialog",
|
|
140
|
-
className: classNames(classes.flyoutBody, "flex-1 grid overflow-hidden"),
|
|
141
|
-
tabIndex: 0,
|
|
142
|
-
children: children
|
|
106
|
+
children: /*#__PURE__*/jsx("div", _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
107
|
+
"data-align": align,
|
|
108
|
+
className: classNames(classes.flyout, "fixed inset-y-0 overflow-hidden flex flex-col flex-nowrap pointer-events-auto shadow-xl", align === "start" ? "start-0" : "end-0", size === "sm" && "w-[20rem]", size === "md" && "w-[40rem]", size === "lg" && "w-[60vw]", size === "xl" && "w-[80vw]"),
|
|
109
|
+
style: {
|
|
110
|
+
width: width,
|
|
111
|
+
minWidth: minWidth
|
|
112
|
+
},
|
|
113
|
+
onMouseUpCapture: tryClosing,
|
|
114
|
+
ref: refs.setFloating
|
|
115
|
+
}, getFloatingProps()), aria), aria), {}, {
|
|
116
|
+
children: /*#__PURE__*/jsxs(HotKeyWrapper, {
|
|
117
|
+
children: [/*#__PURE__*/jsxs(Header, {
|
|
118
|
+
flex: true,
|
|
119
|
+
className: classNames(classes.flyoutHeader, headerClassName),
|
|
120
|
+
children: [isString(icon) && /*#__PURE__*/jsx(Icon, {
|
|
121
|
+
icon: icon,
|
|
122
|
+
bg: iconBg,
|
|
123
|
+
color: iconColor,
|
|
124
|
+
className: classNames(iconClassName, "p-1"),
|
|
125
|
+
rtlFlip: rtlFlip
|
|
126
|
+
}), /*#__PURE__*/isValidElement(icon) && icon, /*#__PURE__*/jsx("label", {
|
|
127
|
+
className: "flex-1 truncate py-2 px-1",
|
|
128
|
+
children: title
|
|
129
|
+
}), actions, /*#__PURE__*/jsx(Icon, {
|
|
130
|
+
"data-ref": "panelClose",
|
|
131
|
+
className: classNames(classes.panelAction, "cursor-pointer p-1 text-xl self-stretch"),
|
|
132
|
+
icon: CoreIcons.close,
|
|
133
|
+
onClick: function onClick() {
|
|
134
|
+
return handleClose(false);
|
|
135
|
+
}
|
|
143
136
|
})]
|
|
144
|
-
})
|
|
145
|
-
|
|
146
|
-
|
|
137
|
+
}), loading && /*#__PURE__*/jsx(Loading, {}), /*#__PURE__*/jsx("div", {
|
|
138
|
+
role: "dialog",
|
|
139
|
+
className: classNames(classes.flyoutBody, "flex-1 grid overflow-hidden"),
|
|
140
|
+
tabIndex: 0,
|
|
141
|
+
children: children
|
|
142
|
+
})]
|
|
143
|
+
})
|
|
144
|
+
}))
|
|
147
145
|
})
|
|
148
146
|
})
|
|
149
147
|
});
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { useRef, useCallback, useLayoutEffect } from 'react';
|
|
5
5
|
import { Icon } from '../../components/icon/Icon.js';
|
|
6
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
7
|
import { getBgClass, getColorClass } from '../../utils/getColor.js';
|
|
7
8
|
import '@react-fabric/utilities';
|
|
8
9
|
import classes from './Message.module.css';
|
|
9
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
10
|
|
|
11
11
|
/*
|
|
12
12
|
* React Fabric
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
5
|
import { useFloating, useDismiss, useRole, useInteractions, FloatingPortal, FloatingOverlay, FloatingFocusManager } from '@floating-ui/react';
|
|
6
|
+
import { isString } from '@react-fabric/utilities';
|
|
6
7
|
import classNames from 'classnames';
|
|
7
|
-
import { useCallback, useEffect } from 'react';
|
|
8
|
+
import { useCallback, useEffect, isValidElement } from 'react';
|
|
8
9
|
import { Loading } from '../../components/animations/Animations.js';
|
|
9
10
|
import { Icon } from '../../components/icon/Icon.js';
|
|
10
11
|
import { Header } from '../../core/headfoot/HeadFoot.js';
|
|
@@ -71,9 +72,7 @@ var Modal = function Modal(_ref) {
|
|
|
71
72
|
}, [onBeforeClose, onClose]);
|
|
72
73
|
useEffect(function () {
|
|
73
74
|
setTimeout(function () {
|
|
74
|
-
var _refs$floating$curren2;
|
|
75
75
|
refs.floating.current && (refs.floating.current.dataset.show = "true");
|
|
76
|
-
(_refs$floating$curren2 = refs.floating.current) === null || _refs$floating$curren2 === void 0 || (_refs$floating$curren2 = _refs$floating$curren2.querySelector("[role='dialog']")) === null || _refs$floating$curren2 === void 0 || _refs$floating$curren2.focus();
|
|
77
76
|
}, 50);
|
|
78
77
|
}, []);
|
|
79
78
|
return /*#__PURE__*/jsx(FloatingPortal, {
|
|
@@ -82,7 +81,7 @@ var Modal = function Modal(_ref) {
|
|
|
82
81
|
style: {
|
|
83
82
|
zIndex: "var(--z-overlay-mask)"
|
|
84
83
|
},
|
|
85
|
-
className: "bg-base/
|
|
84
|
+
className: "bg-base/20 backdrop-blur-sm grid place-items-center",
|
|
86
85
|
children: /*#__PURE__*/jsx(FloatingFocusManager, {
|
|
87
86
|
context: context,
|
|
88
87
|
children: /*#__PURE__*/jsx("dialog", _objectSpread(_objectSpread(_objectSpread({
|
|
@@ -99,13 +98,13 @@ var Modal = function Modal(_ref) {
|
|
|
99
98
|
children: [/*#__PURE__*/jsxs(Header, {
|
|
100
99
|
flex: true,
|
|
101
100
|
className: classNames(classes.modalHeader, headerClassName),
|
|
102
|
-
children: [icon && /*#__PURE__*/jsx(Icon, {
|
|
101
|
+
children: [isString(icon) && /*#__PURE__*/jsx(Icon, {
|
|
103
102
|
icon: icon,
|
|
104
103
|
bg: iconBg,
|
|
105
104
|
color: iconColor,
|
|
106
105
|
className: classNames(iconClassName, "p-1"),
|
|
107
106
|
rtlFlip: rtlFlip
|
|
108
|
-
}), /*#__PURE__*/jsx("label", {
|
|
107
|
+
}), /*#__PURE__*/isValidElement(icon) && icon, /*#__PURE__*/jsx("label", {
|
|
109
108
|
className: "flex-1 truncate py-2 px-1",
|
|
110
109
|
children: title
|
|
111
110
|
}), actions, /*#__PURE__*/jsx(Icon, {
|
|
@@ -7,10 +7,10 @@ import { AnimationIndicator } from '../../components/animations/Animations.js';
|
|
|
7
7
|
import { Button } from '../../components/button/Button.js';
|
|
8
8
|
import { Icon } from '../../components/icon/Icon.js';
|
|
9
9
|
import { CoreIcons } from '../../types/icons.js';
|
|
10
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
10
11
|
import { getColorClass, getBorderClass, getBgClass } from '../../utils/getColor.js';
|
|
11
12
|
import '@react-fabric/utilities';
|
|
12
13
|
import classes from './Toast.module.css';
|
|
13
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
14
14
|
|
|
15
15
|
/*
|
|
16
16
|
* React Fabric
|
|
@@ -97,7 +97,7 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
97
97
|
};
|
|
98
98
|
return /*#__PURE__*/jsx("span", {
|
|
99
99
|
role: "none",
|
|
100
|
-
className: "ms-2 cursor-pointer text-
|
|
100
|
+
className: "ms-2 cursor-pointer text-dimmed flex-content opacity-75 hover:opacity-90 active:opacity-60",
|
|
101
101
|
onClick: handler,
|
|
102
102
|
children: /*#__PURE__*/jsx(Icon, {
|
|
103
103
|
icon: CoreIcons.copy
|
|
@@ -113,12 +113,12 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
113
113
|
children: /*#__PURE__*/jsxs("dfn", _objectSpread(_objectSpread({
|
|
114
114
|
"data-ref": "tooltip",
|
|
115
115
|
"data-color": color,
|
|
116
|
-
className: classNames(classes.tooltip, "select-none text-sm not-italic flex py-1 px-2 rounded shadow-md bg-current"),
|
|
116
|
+
className: classNames(classes.tooltip, "select-none text-sm not-italic flex py-1 px-2 !max-w-64 rounded shadow-md bg-current"),
|
|
117
117
|
ref: refs.setFloating,
|
|
118
118
|
style: floatingStyles
|
|
119
119
|
}, getFloatingProps()), {}, {
|
|
120
120
|
children: [/*#__PURE__*/jsx("span", {
|
|
121
|
-
className: classNames("font-medium text-
|
|
121
|
+
className: classNames("font-medium text-dimmed flex-1 break-all", isString(content) && "whitespace-pre-wrap mixed-lang"),
|
|
122
122
|
children: content
|
|
123
123
|
}), copyEl, /*#__PURE__*/jsx(FloatingArrow, {
|
|
124
124
|
ref: arrowRef,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer comp{.tooltip{color:theme(backgroundColor.
|
|
1
|
+
@layer comp{.tooltip{color:theme(backgroundColor.dimmed);z-index:var(--z-tooltip);&[data-color=primary]{color:theme(colors.primary.200)}&[data-color=accent]{color:theme(colors.accent.200)}&[data-color=info]{color:theme(colors.info.200)}&[data-color=danger]{color:theme(colors.danger.200)}&[data-color=success]{color:theme(colors.success.200)}&[data-color=warning]{color:theme(colors.warning.200)}}}
|
package/dist/esm/types/icons.js
CHANGED
|
@@ -52,6 +52,8 @@ var CoreIcons;
|
|
|
52
52
|
_CoreIcons.caretUp = "M7,15L12,10L17,15H7Z";
|
|
53
53
|
_CoreIcons.expand = "M5 2c-0.828 0-1.58 0.337-2.121 0.879s-0.879 1.293-0.879 2.121v14c0 0.828 0.337 1.58 0.879 2.121s1.293 0.879 2.121 0.879h14c0.828 0 1.58-0.337 2.121-0.879s0.879-1.293 0.879-2.121v-14c0-0.828-0.337-1.58-0.879-2.121s-1.293-0.879-2.121-0.879zM5 4h14c0.276 0 0.525 0.111 0.707 0.293s0.293 0.431 0.293 0.707v14c0 0.276-0.111 0.525-0.293 0.707s-0.431 0.293-0.707 0.293h-14c-0.276 0-0.525-0.111-0.707-0.293s-0.293-0.431-0.293-0.707v-14c0-0.276 0.111-0.525 0.293-0.707s0.431-0.293 0.707-0.293zM8 13h3v3c0 0.552 0.448 1 1 1s1-0.448 1-1v-3h3c0.552 0 1-0.448 1-1s-0.448-1-1-1h-3v-3c0-0.552-0.448-1-1-1s-1 0.448-1 1v3h-3c-0.552 0-1 0.448-1 1s0.448 1 1 1z";
|
|
54
54
|
_CoreIcons.collapse = "M5 2c-0.828 0-1.58 0.337-2.121 0.879s-0.879 1.293-0.879 2.121v14c0 0.828 0.337 1.58 0.879 2.121s1.293 0.879 2.121 0.879h14c0.828 0 1.58-0.337 2.121-0.879s0.879-1.293 0.879-2.121v-14c0-0.828-0.337-1.58-0.879-2.121s-1.293-0.879-2.121-0.879zM5 4h14c0.276 0 0.525 0.111 0.707 0.293s0.293 0.431 0.293 0.707v14c0 0.276-0.111 0.525-0.293 0.707s-0.431 0.293-0.707 0.293h-14c-0.276 0-0.525-0.111-0.707-0.293s-0.293-0.431-0.293-0.707v-14c0-0.276 0.111-0.525 0.293-0.707s0.431-0.293 0.707-0.293zM8 13h8c0.552 0 1-0.448 1-1s-0.448-1-1-1h-8c-0.552 0-1 0.448-1 1s0.448 1 1 1z";
|
|
55
|
+
_CoreIcons.expandActive = "M17,13H13V17H11V13H7V11H11V7H13V11H17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z";
|
|
56
|
+
_CoreIcons.collapseActive = "M17,13H7V11H17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z";
|
|
55
57
|
_CoreIcons.expandAll = "M5.293 16.707l6 6c0.391 0.391 1.024 0.391 1.414 0l6-6c0.391-0.391 0.391-1.024 0-1.414s-1.024-0.391-1.414 0l-5.293 5.293-5.293-5.293c-0.391-0.391-1.024-0.391-1.414 0s-0.391 1.024 0 1.414zM18.707 7.293l-6-6c-0.391-0.391-1.024-0.391-1.414 0l-6 6c-0.391 0.391-0.391 1.024 0 1.414s1.024 0.391 1.414 0l5.293-5.293 5.293 5.293c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414z";
|
|
56
58
|
_CoreIcons.colapseAll = "M18.707 21.293l-6-6c-0.391-0.391-1.024-0.391-1.414 0l-6 6c-0.391 0.391-0.391 1.024 0 1.414s1.024 0.391 1.414 0l5.293-5.293 5.293 5.293c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414zM5.293 2.707l6 6c0.391 0.391 1.024 0.391 1.414 0l6-6c0.391-0.391 0.391-1.024 0-1.414s-1.024-0.391-1.414 0l-5.293 5.293-5.293-5.293c-0.391-0.391-1.024-0.391-1.414 0s-0.391 1.024 0 1.414z";
|
|
57
59
|
_CoreIcons.folderClosed = "M20,18H4V8H20M20,6H12L10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6Z";
|
|
@@ -118,6 +120,7 @@ var CoreIcons;
|
|
|
118
120
|
_CoreIcons.mic = "M12 2c0.553 0 1.051 0.223 1.414 0.586s0.586 0.861 0.586 1.414v8c0 0.553-0.223 1.051-0.586 1.414s-0.861 0.586-1.414 0.586-1.051-0.223-1.414-0.586-0.586-0.861-0.586-1.414v-8c0-0.553 0.223-1.051 0.586-1.414s0.861-0.586 1.414-0.586zM12 0c-1.104 0-2.106 0.449-2.828 1.172s-1.172 1.724-1.172 2.828v8c0 1.104 0.449 2.106 1.172 2.828s1.724 1.172 2.828 1.172 2.106-0.449 2.828-1.172 1.172-1.724 1.172-2.828v-8c0-1.104-0.449-2.106-1.172-2.828s-1.724-1.172-2.828-1.172zM8 24h8c0.552 0 1-0.448 1-1s-0.448-1-1-1h-3v-2.062c1.809-0.226 3.432-1.056 4.657-2.281 1.446-1.447 2.343-3.448 2.343-5.657v-2c0-0.552-0.448-1-1-1s-1 0.448-1 1v2c0 1.657-0.67 3.156-1.757 4.243s-2.586 1.757-4.243 1.757-3.156-0.67-4.243-1.757-1.757-2.586-1.757-4.243v-2c0-0.552-0.448-1-1-1s-1 0.448-1 1v2c0 2.209 0.897 4.21 2.343 5.657 1.225 1.225 2.847 2.055 4.657 2.281v2.062h-3c-0.552 0-1 0.448-1 1s0.448 1 1 1z";
|
|
119
121
|
_CoreIcons.play = "M5.541 2.159c-0.153-0.1-0.34-0.159-0.541-0.159-0.552 0-1 0.448-1 1v18c-0.001 0.182 0.050 0.372 0.159 0.541 0.299 0.465 0.917 0.599 1.382 0.3l14-9c0.114-0.072 0.219-0.174 0.3-0.3 0.299-0.465 0.164-1.083-0.3-1.382zM6 4.832l11.151 7.168-11.151 7.168z";
|
|
120
122
|
_CoreIcons.pause = "M6 3c-0.552 0-1 0.448-1 1v16c0 0.552 0.448 1 1 1h4c0.552 0 1-0.448 1-1v-16c0-0.552-0.448-1-1-1zM7 5h2v14h-2zM14 3c-0.552 0-1 0.448-1 1v16c0 0.552 0.448 1 1 1h4c0.552 0 1-0.448 1-1v-16c0-0.552-0.448-1-1-1zM15 5h2v14h-2z";
|
|
123
|
+
_CoreIcons.stop = "M18,18H6V6H18V18Z";
|
|
121
124
|
_CoreIcons.volumeOn = "M10 7.081v9.839l-3.375-2.7c-0.17-0.137-0.388-0.22-0.625-0.22h-3v-4h3c0.218 0.001 0.439-0.071 0.625-0.219zM10.375 4.219l-4.726 3.781h-3.649c-0.552 0-1 0.448-1 1v6c0 0.552 0.448 1 1 1h3.649l4.726 3.781c0.431 0.345 1.061 0.275 1.406-0.156 0.148-0.185 0.22-0.407 0.219-0.625v-14c0-0.552-0.448-1-1-1-0.237 0-0.455 0.083-0.625 0.219zM18.363 5.637c1.757 1.758 2.635 4.059 2.635 6.364 0 2.304-0.878 4.605-2.635 6.362-0.39 0.391-0.39 1.024 0 1.414s1.024 0.39 1.414 0c2.147-2.147 3.22-4.963 3.221-7.776s-1.074-5.63-3.221-7.778c-0.39-0.391-1.024-0.391-1.414 0s-0.391 1.024 0 1.414zM14.833 9.167c0.781 0.781 1.171 1.803 1.171 2.828s-0.39 2.047-1.171 2.828c-0.39 0.391-0.39 1.024 0 1.414s1.024 0.39 1.414 0c1.171-1.171 1.757-2.708 1.757-4.242s-0.586-3.071-1.757-4.242c-0.39-0.391-1.024-0.391-1.414 0s-0.391 1.024 0 1.414z";
|
|
122
125
|
_CoreIcons.volumeOff = "M10 7.081v9.839l-3.375-2.7c-0.17-0.137-0.388-0.22-0.625-0.22h-3v-4h3c0.218 0.001 0.439-0.071 0.625-0.219zM10.375 4.219l-4.726 3.781h-3.649c-0.552 0-1 0.448-1 1v6c0 0.552 0.448 1 1 1h3.649l4.726 3.781c0.431 0.345 1.061 0.275 1.406-0.156 0.148-0.185 0.22-0.407 0.219-0.625v-14c0-0.552-0.448-1-1-1-0.237 0-0.455 0.083-0.625 0.219zM16.293 9.707l2.293 2.293-2.293 2.293c-0.391 0.391-0.391 1.024 0 1.414s1.024 0.391 1.414 0l2.293-2.293 2.293 2.293c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414l-2.293-2.293 2.293-2.293c0.391-0.391 0.391-1.024 0-1.414s-1.024-0.391-1.414 0l-2.293 2.293-2.293-2.293c-0.391-0.391-1.024-0.391-1.414 0s-0.391 1.024 0 1.414z";
|
|
123
126
|
_CoreIcons.alignLeft = "M3,3H21V5H3V3M3,7H15V9H3V7M3,11H21V13H3V11M3,15H15V17H3V15M3,19H21V21H3V19Z";
|
|
@@ -7,9 +7,9 @@ import classNames from 'classnames';
|
|
|
7
7
|
import { useCallback, Fragment, useMemo } from 'react';
|
|
8
8
|
import { useMemoDebugger } from '../hooks/useEffectDebugger.js';
|
|
9
9
|
import { Tooltip, getTooltipProps } from '../overlays/tooltip/Tooltip.js';
|
|
10
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
10
11
|
import { getColorClass, getColor } from '../utils/getColor.js';
|
|
11
12
|
import classes from './Typography.module.css';
|
|
12
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
13
13
|
|
|
14
14
|
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; }
|
|
15
15
|
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; }
|
|
@@ -4,10 +4,11 @@ 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 { useMemoDebugger } from '../hooks/useEffectDebugger.js';
|
|
7
|
+
import 'react';
|
|
8
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
9
|
import { getColor, getBgClass, getColorClass } from '../utils/getColor.js';
|
|
8
10
|
import '@react-fabric/utilities';
|
|
9
11
|
import { TextSizeMap } from './types.js';
|
|
10
|
-
import { jsx } from 'react/jsx-runtime';
|
|
11
12
|
|
|
12
13
|
var _excluded = ["ref", "as", "children", "className", "bg", "color", "family", "size"];
|
|
13
14
|
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; }
|
|
@@ -15,7 +16,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
15
16
|
/**
|
|
16
17
|
* Typography link component
|
|
17
18
|
*/
|
|
18
|
-
var
|
|
19
|
+
var Anchor = function Anchor(_ref) {
|
|
19
20
|
var ref = _ref.ref,
|
|
20
21
|
as = _ref.as,
|
|
21
22
|
children = _ref.children,
|
|
@@ -52,4 +53,4 @@ var Link = function Link(_ref) {
|
|
|
52
53
|
}));
|
|
53
54
|
};
|
|
54
55
|
|
|
55
|
-
export {
|
|
56
|
+
export { Anchor };
|
|
@@ -6,9 +6,9 @@ import { isString, isEmpty, tokenize } from '@react-fabric/utilities';
|
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import { useCallback, Fragment } from 'react';
|
|
8
8
|
import { useMemoDebugger } from '../hooks/useEffectDebugger.js';
|
|
9
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
9
10
|
import { getBgClass, getColor } from '../utils/getColor.js';
|
|
10
11
|
import classes from './Typography.module.css';
|
|
11
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
12
12
|
|
|
13
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; }
|
|
14
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; }
|
|
@@ -10,10 +10,10 @@ import { useTranslation } from 'react-i18next';
|
|
|
10
10
|
import { useLayoutEffectDebugger, useMemoDebugger } from '../hooks/useEffectDebugger.js';
|
|
11
11
|
import { usePropToggle } from '../hooks/usePropToggle.js';
|
|
12
12
|
import { calculateTextHeight } from '../utils/calculateDimensions.js';
|
|
13
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
13
14
|
import { getColor, getBgClass, getColorClass } from '../utils/getColor.js';
|
|
14
15
|
import classes from './Typography.module.css';
|
|
15
16
|
import { TextSizeMap } from './types.js';
|
|
16
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
17
17
|
|
|
18
18
|
var _excluded = ["children", "className", "inline", "bg", "color", "family", "size", "clamp", "align"];
|
|
19
19
|
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; }
|
|
@@ -98,7 +98,7 @@ var Text = function Text(_ref) {
|
|
|
98
98
|
"--text-clamp": showMore ? "unset" : clamp !== null && clamp !== void 0 ? clamp : "unset"
|
|
99
99
|
},
|
|
100
100
|
children: /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
|
|
101
|
-
className: classNames(classes.text, "
|
|
101
|
+
className: classNames(classes.text, "mixed-lang px-[2px] whitespace-pre-wrap", family && "font-".concat(family), bg && getBgClass(bg), color && getColorClass(color), clamp && "line-clamp-1"),
|
|
102
102
|
style: styles
|
|
103
103
|
}, aria), {}, {
|
|
104
104
|
children: children
|
|
@@ -4,11 +4,12 @@ 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 { useMemoDebugger } from '../hooks/useEffectDebugger.js';
|
|
7
|
+
import 'react';
|
|
8
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
9
|
import { getColor, getBgClass, getColorClass } from '../utils/getColor.js';
|
|
8
10
|
import '@react-fabric/utilities';
|
|
9
11
|
import { TitleSizeMap } from './types.js';
|
|
10
12
|
import classes from './Typography.module.css';
|
|
11
|
-
import { jsx } from 'react/jsx-runtime';
|
|
12
13
|
|
|
13
14
|
var _excluded = ["children", "className", "as", "bg", "color", "size", "align", "family"];
|
|
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; }
|
|
@@ -48,7 +49,7 @@ var Title = function Title(_ref) {
|
|
|
48
49
|
}, [bg, color, size, align], "Title styles");
|
|
49
50
|
var E = as !== null && as !== void 0 ? as : "p";
|
|
50
51
|
return /*#__PURE__*/jsx(E, _objectSpread(_objectSpread({
|
|
51
|
-
className: classNames(classes.title,
|
|
52
|
+
className: classNames(classes.title, className, family && "font-".concat(family), !as && "text-lg", bg && getBgClass(bg), color && getColorClass(color)),
|
|
52
53
|
style: styles
|
|
53
54
|
}, aria), {}, {
|
|
54
55
|
children: children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer comp{.title{line-height:1.125}.moreLink{margin:-.25rem 0
|
|
1
|
+
@layer comp{.title{line-height:1.125;padding:4px 2px;white-space:prewrap}.moreLink{margin:-.25rem 0 .25rem;text-align:end;&>span{color:theme(colors.accent.700);cursor:pointer;font-size:.75rem;user-select:none;&:hover{color:theme(colors.accent.500);text-decoration:underline;text-underline-offset:2px}}}}@layer util{.text{-webkit-line-clamp:var(--text-clamp)}.abbr{--abbr-color:var(--accent);color:color-mix(in lab,var(--abbr-color) 50%,var(--fabric-text))}.mark{--mark-color:var(--primary);background-color:color-mix(in lab,var(--mark-color) 25%,var(--fabric-bg))}}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Children, isValidElement } from 'react';
|
|
4
|
+
import { Fragment } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* React Fabric
|
|
8
|
+
* @version: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* The MIT License (MIT)
|
|
12
|
+
* Copyright (c) 2024 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 cloneChildren = function cloneChildren(children, callback) {
|
|
30
|
+
var _Children$map;
|
|
31
|
+
return (_Children$map = Children.map(children, function (c) {
|
|
32
|
+
if ( /*#__PURE__*/isValidElement(c)) {
|
|
33
|
+
if (c.type === Fragment) {
|
|
34
|
+
var _c$props;
|
|
35
|
+
// just compare to `Fragment`
|
|
36
|
+
return cloneChildren((_c$props = c.props) === null || _c$props === void 0 ? void 0 : _c$props.children, callback);
|
|
37
|
+
}
|
|
38
|
+
return c;
|
|
39
|
+
}
|
|
40
|
+
return c;
|
|
41
|
+
})) === null || _Children$map === void 0 ? void 0 : _Children$map.flat().filter(Boolean).map(callback);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export { cloneChildren };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactElement } from "react";
|
|
2
|
-
import { type AriaProps, type ChildProp, type CssProp } from "../../types";
|
|
3
|
-
export interface ActionLabelProps extends AriaProps, CssProp, ChildProp {
|
|
2
|
+
import { type AriaProps, type ChildProp, type CssProp, type TestProps } from "../../types";
|
|
3
|
+
export interface ActionLabelProps extends AriaProps, CssProp, ChildProp, TestProps {
|
|
4
4
|
/**
|
|
5
5
|
* action buttons aligment
|
|
6
6
|
*/
|
|
@@ -20,4 +20,4 @@ export declare const AnimationSpinner: ({ color, size, }: {
|
|
|
20
20
|
size?: number | string;
|
|
21
21
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
export declare const Loading: () => import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
export declare const Skeleton: () => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const Skeleton: ({ className, ...rest }: CssProp) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,6 +4,10 @@ export interface BadgeProps extends CssProp, RefProp, IconProps, Partial<ChildPr
|
|
|
4
4
|
* make wrapper a block element
|
|
5
5
|
*/
|
|
6
6
|
block?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* inline badge
|
|
9
|
+
*/
|
|
10
|
+
inline?: boolean;
|
|
7
11
|
/**
|
|
8
12
|
* badge value
|
|
9
13
|
*/
|
|
@@ -22,4 +26,4 @@ export interface BadgeProps extends CssProp, RefProp, IconProps, Partial<ChildPr
|
|
|
22
26
|
placement?: "top-start" | "top-end" | "bottom-start" | "bottom-end" | "top" | "bottom" | "start" | "end";
|
|
23
27
|
}
|
|
24
28
|
export declare const getBadgeProps: (badge?: string | number | BadgeType) => AnyObject;
|
|
25
|
-
export declare const Badge: ({ ref, className, value, max, ping, block, placement, children, forButton, icon, iconBg, iconColor, rtlFlip, ...rest }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare const Badge: ({ ref, className, value, max, ping, block, inline, placement, children, forButton, icon, iconBg, iconColor, rtlFlip, ...rest }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AriaProps, type ChildrenProp, type CssProp } from "../../types";
|
|
2
|
-
import {
|
|
3
|
-
export interface BreadcrumbProps extends CssProp, AriaProps, ChildrenProp<typeof
|
|
2
|
+
import { Anchor } from "../../typography/Anchor";
|
|
3
|
+
export interface BreadcrumbProps extends CssProp, AriaProps, ChildrenProp<typeof Anchor> {
|
|
4
4
|
/**
|
|
5
5
|
* breadcrumb styling
|
|
6
6
|
*/
|
|
@@ -24,7 +24,7 @@ export interface BaseProps extends CssProp, AriaProps, IconProps, RefProp, TestP
|
|
|
24
24
|
/**
|
|
25
25
|
* button styling
|
|
26
26
|
*/
|
|
27
|
-
variant?: "outline" | "solid" | "link";
|
|
27
|
+
variant?: "outline" | "soft" | "solid" | "link";
|
|
28
28
|
/**
|
|
29
29
|
* active state with click disabled
|
|
30
30
|
*/
|
|
@@ -82,14 +82,16 @@ export interface BaseProps extends CssProp, AriaProps, IconProps, RefProp, TestP
|
|
|
82
82
|
onMouseLeave?: MouseEventHandler;
|
|
83
83
|
onWheel?: WheelEventHandler;
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
type ButtonTypeProps = {
|
|
86
86
|
children: string | React.ReactElement;
|
|
87
87
|
"aria-label"?: string;
|
|
88
88
|
} | {
|
|
89
89
|
children?: never;
|
|
90
90
|
"aria-label": string;
|
|
91
91
|
};
|
|
92
|
+
export type ButtonProps<Tag extends React.ElementType = "button"> = BaseProps & ButtonTypeProps & PolymorphicProps<Tag>;
|
|
92
93
|
/**
|
|
93
94
|
* Clickable action button
|
|
94
95
|
*/
|
|
95
|
-
export declare const Button: <Tag extends import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> = "button">({ as, ref, children, className, active, color, icon, iconBg, iconColor, iconAlign, altIcon, rtlFlip, rounded, size, disabled, loading, variant, badge, fullWidth, spinOnHover, onClick, actionMessage, stopPropagation, type, hotKey, showActionDone, showActionDoneEvent, tabIndex, "data-ref": dataRef, ...aria }:
|
|
96
|
+
export declare const Button: <Tag extends import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> = "button">({ as, ref, children, className, active, color, icon, iconBg, iconColor, iconAlign, altIcon, rtlFlip, rounded, size, disabled, loading, variant, badge, fullWidth, spinOnHover, onClick, actionMessage, stopPropagation, type, hotKey, showActionDone, showActionDoneEvent, tabIndex, "data-ref": dataRef, ...aria }: ButtonProps<Tag>) => import("react/jsx-runtime").JSX.Element;
|
|
97
|
+
export {};
|