@react-fabric/core 1.0.0-beta.51 → 1.0.0-beta.52
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/_modal.css +2 -2
- package/dist/cjs/components/actionLabel/ActionLabel.js +23 -5
- package/dist/cjs/components/animations/Animations.js +92 -9
- package/dist/cjs/components/avatar/Avatar.js +33 -3
- package/dist/cjs/components/avatar/AvatarGroup.js +19 -1
- package/dist/cjs/components/badge/Badge.js +30 -1
- package/dist/cjs/components/breadcrumbs/Breadcrumbs.js +29 -0
- package/dist/cjs/components/button/Button.js +24 -1
- package/dist/cjs/components/button/ButtonGroup.js +26 -0
- package/dist/cjs/components/button/ConfirmButton.js +22 -1
- package/dist/cjs/components/button/ToggleButtonGroup.js +38 -12
- package/dist/cjs/components/callout/Callout.js +28 -0
- package/dist/cjs/components/card/Card.js +34 -0
- package/dist/cjs/components/card/CardCover.js +26 -0
- package/dist/cjs/components/card/FlipContent.js +21 -0
- package/dist/cjs/components/chip/Chip.js +22 -1
- package/dist/cjs/components/collapsable/Collapsable.js +26 -0
- package/dist/cjs/components/divider/Divider.js +19 -0
- package/dist/cjs/components/dropdown/Dropdown.js +42 -0
- package/dist/cjs/components/empty/EmptyContent.js +27 -0
- package/dist/cjs/components/icon/Icon.js +27 -1
- package/dist/cjs/components/media/Media.js +56 -0
- package/dist/cjs/components/menu/ContextMenu.js +19 -0
- package/dist/cjs/components/menu/Menu.js +30 -0
- package/dist/cjs/components/menu/MenuItem.js +21 -0
- package/dist/cjs/components/meter/Meter.js +24 -0
- package/dist/cjs/components/navigator/Navigator.js +22 -0
- package/dist/cjs/components/panel/Panel.js +37 -0
- package/dist/cjs/components/panel/PanelGroup.js +24 -0
- package/dist/cjs/components/panel/PanelStack.js +31 -0
- package/dist/cjs/components/progress/ProgressBar.js +21 -0
- package/dist/cjs/components/progress/ProgressCircle.js +20 -0
- package/dist/cjs/components/tabpanel/Tab.js +31 -0
- package/dist/cjs/components/tabpanel/TabPanel.js +33 -0
- package/dist/cjs/context/Global.js +25 -1
- package/dist/cjs/core/aside/Aside.js +39 -2
- package/dist/cjs/core/boundary/ErrorBoundary.js +17 -1
- package/dist/cjs/core/content/Content.js +6 -1
- package/dist/cjs/core/headfoot/HeadFoot.js +42 -0
- package/dist/cjs/core/page/Page.js +26 -1
- package/dist/cjs/core/responsive/Responsive.js +54 -1
- package/dist/cjs/core/theme/ThemeProvider.js +21 -1
- package/dist/cjs/core/viewport/Viewport.js +15 -1
- package/dist/cjs/hooks/useControlledValue.js +12 -0
- package/dist/cjs/hooks/useDebounce.js +13 -0
- package/dist/cjs/hooks/useEffectDebugger.js +52 -0
- package/dist/cjs/hooks/useIsDark.js +8 -0
- package/dist/cjs/hooks/useIsRtl.js +12 -0
- package/dist/cjs/hooks/useOverlayService.js +24 -0
- package/dist/cjs/hooks/usePropToggle.js +16 -5
- package/dist/cjs/hooks/useResize.js +18 -0
- package/dist/cjs/hooks/useResizeObserver.js +19 -0
- package/dist/cjs/hooks/useStorage.js +39 -0
- package/dist/cjs/types/icons.js +4 -0
- package/dist/cjs/typography/Abbr.js +28 -1
- package/dist/cjs/typography/Anchor.js +18 -1
- package/dist/cjs/typography/Mark.js +20 -1
- package/dist/cjs/typography/Text.js +27 -1
- package/dist/cjs/typography/Title.js +16 -1
- package/dist/esm/components/actionLabel/ActionLabel.js +23 -5
- package/dist/esm/components/animations/Animations.js +92 -9
- package/dist/esm/components/avatar/Avatar.js +33 -3
- package/dist/esm/components/avatar/AvatarGroup.js +19 -1
- package/dist/esm/components/badge/Badge.js +31 -2
- package/dist/esm/components/breadcrumbs/Breadcrumbs.js +29 -0
- package/dist/esm/components/button/Button.js +24 -1
- package/dist/esm/components/button/ButtonGroup.js +26 -0
- package/dist/esm/components/button/ConfirmButton.js +22 -1
- package/dist/esm/components/button/ToggleButtonGroup.js +39 -13
- package/dist/esm/components/callout/Callout.js +28 -0
- package/dist/esm/components/card/Card.js +34 -0
- package/dist/esm/components/card/CardCover.js +26 -0
- package/dist/esm/components/card/FlipContent.js +21 -0
- package/dist/esm/components/chip/Chip.js +22 -1
- package/dist/esm/components/collapsable/Collapsable.js +26 -0
- package/dist/esm/components/divider/Divider.js +19 -0
- package/dist/esm/components/dropdown/Dropdown.js +42 -0
- package/dist/esm/components/empty/EmptyContent.js +27 -0
- package/dist/esm/components/icon/Icon.js +27 -1
- package/dist/esm/components/media/Media.js +56 -0
- package/dist/esm/components/menu/ContextMenu.js +19 -0
- package/dist/esm/components/menu/Menu.js +30 -0
- package/dist/esm/components/menu/MenuItem.js +21 -0
- package/dist/esm/components/meter/Meter.js +24 -0
- package/dist/esm/components/navigator/Navigator.js +22 -0
- package/dist/esm/components/panel/Panel.js +37 -0
- package/dist/esm/components/panel/PanelGroup.js +24 -0
- package/dist/esm/components/panel/PanelStack.js +31 -0
- package/dist/esm/components/progress/ProgressBar.js +21 -0
- package/dist/esm/components/progress/ProgressCircle.js +20 -0
- package/dist/esm/components/tabpanel/Tab.js +31 -0
- package/dist/esm/components/tabpanel/TabPanel.js +33 -0
- package/dist/esm/context/Global.js +25 -1
- package/dist/esm/core/aside/Aside.js +39 -2
- package/dist/esm/core/boundary/ErrorBoundary.js +17 -1
- package/dist/esm/core/content/Content.js +6 -1
- package/dist/esm/core/headfoot/HeadFoot.js +42 -0
- package/dist/esm/core/page/Page.js +26 -1
- package/dist/esm/core/responsive/Responsive.js +54 -1
- package/dist/esm/core/theme/ThemeProvider.js +21 -1
- package/dist/esm/core/viewport/Viewport.js +15 -1
- package/dist/esm/hooks/useControlledValue.js +12 -0
- package/dist/esm/hooks/useDebounce.js +13 -0
- package/dist/esm/hooks/useEffectDebugger.js +52 -0
- package/dist/esm/hooks/useIsDark.js +8 -0
- package/dist/esm/hooks/useIsRtl.js +12 -0
- package/dist/esm/hooks/useOverlayService.js +24 -0
- package/dist/esm/hooks/usePropToggle.js +16 -5
- package/dist/esm/hooks/useResize.js +18 -0
- package/dist/esm/hooks/useResizeObserver.js +19 -0
- package/dist/esm/hooks/useStorage.js +39 -0
- package/dist/esm/types/icons.js +4 -0
- package/dist/esm/typography/Abbr.js +28 -1
- package/dist/esm/typography/Anchor.js +18 -1
- package/dist/esm/typography/Mark.js +20 -1
- package/dist/esm/typography/Text.js +27 -1
- package/dist/esm/typography/Title.js +16 -1
- package/dist/types/components/actionLabel/ActionLabel.d.ts +21 -2
- package/dist/types/components/animations/Animations.d.ts +80 -1
- package/dist/types/components/avatar/Avatar.d.ts +26 -2
- package/dist/types/components/avatar/AvatarGroup.d.ts +19 -1
- package/dist/types/components/badge/Badge.d.ts +25 -0
- package/dist/types/components/breadcrumbs/Breadcrumbs.d.ts +29 -0
- package/dist/types/components/button/Button.d.ts +23 -2
- package/dist/types/components/button/ButtonGroup.d.ts +26 -1
- package/dist/types/components/button/ConfirmButton.d.ts +23 -3
- package/dist/types/components/button/ToggleButtonGroup.d.ts +39 -11
- package/dist/types/components/callout/Callout.d.ts +26 -1
- package/dist/types/components/card/Card.d.ts +34 -0
- package/dist/types/components/card/CardCover.d.ts +25 -0
- package/dist/types/components/card/FlipContent.d.ts +21 -0
- package/dist/types/components/chip/Chip.d.ts +21 -1
- package/dist/types/components/collapsable/Collapsable.d.ts +26 -0
- package/dist/types/components/divider/Divider.d.ts +19 -0
- package/dist/types/components/dropdown/Dropdown.d.ts +40 -1
- package/dist/types/components/dropdown/DropdownTool.d.ts +25 -0
- package/dist/types/components/empty/EmptyContent.d.ts +26 -1
- package/dist/types/components/icon/Icon.d.ts +27 -2
- package/dist/types/components/media/Media.d.ts +54 -0
- package/dist/types/components/menu/ContextMenu.d.ts +19 -1
- package/dist/types/components/menu/Menu.d.ts +29 -0
- package/dist/types/components/menu/MenuItem.d.ts +22 -2
- package/dist/types/components/meter/Meter.d.ts +24 -0
- package/dist/types/components/navigator/Navigator.d.ts +22 -0
- package/dist/types/components/panel/Panel.d.ts +37 -0
- package/dist/types/components/panel/PanelGroup.d.ts +24 -0
- package/dist/types/components/panel/PanelStack.d.ts +31 -0
- package/dist/types/components/progress/ProgressBar.d.ts +20 -0
- package/dist/types/components/progress/ProgressCircle.d.ts +19 -0
- package/dist/types/components/tabpanel/Tab.d.ts +32 -1
- package/dist/types/components/tabpanel/TabPanel.d.ts +33 -0
- package/dist/types/context/Global.d.ts +24 -1
- package/dist/types/core/aside/Aside.d.ts +38 -1
- package/dist/types/core/boundary/ErrorBoundary.d.ts +17 -1
- package/dist/types/core/content/Content.d.ts +6 -1
- package/dist/types/core/headfoot/HeadFoot.d.ts +40 -0
- package/dist/types/core/page/Page.d.ts +26 -1
- package/dist/types/core/responsive/Responsive.d.ts +52 -1
- package/dist/types/core/section/Section.d.ts +16 -1
- package/dist/types/core/theme/ThemeProvider.d.ts +21 -1
- package/dist/types/core/viewport/Viewport.d.ts +15 -1
- package/dist/types/hooks/useControlledValue.d.ts +13 -2
- package/dist/types/hooks/useDebounce.d.ts +12 -0
- package/dist/types/hooks/useEffectDebugger.d.ts +49 -0
- package/dist/types/hooks/useIsDark.d.ts +8 -0
- package/dist/types/hooks/useIsRtl.d.ts +12 -0
- package/dist/types/hooks/useNavigator.d.ts +18 -1
- package/dist/types/hooks/useOverlayService.d.ts +25 -4
- package/dist/types/hooks/usePropToggle.d.ts +16 -5
- package/dist/types/hooks/useResize.d.ts +18 -0
- package/dist/types/hooks/useResizeObserver.d.ts +19 -0
- package/dist/types/hooks/useStorage.d.ts +38 -0
- package/dist/types/types/icons.d.ts +4 -0
- package/dist/types/typography/Abbr.d.ts +28 -1
- package/dist/types/typography/Anchor.d.ts +19 -2
- package/dist/types/typography/Copy.d.ts +15 -0
- package/dist/types/typography/Mark.d.ts +20 -1
- package/dist/types/typography/Text.d.ts +27 -1
- package/dist/types/typography/Title.d.ts +16 -1
- package/package.json +3 -3
- package/src/components/actionLabel/ActionLabel.tsx +23 -5
- package/src/components/animations/Animations.tsx +93 -14
- package/src/components/avatar/Avatar.tsx +32 -3
- package/src/components/avatar/AvatarGroup.tsx +19 -1
- package/src/components/badge/Badge.tsx +30 -2
- package/src/components/breadcrumbs/Breadcrumbs.tsx +29 -0
- package/src/components/button/Button.tsx +23 -1
- package/src/components/button/ButtonGroup.tsx +26 -0
- package/src/components/button/ConfirmButton.tsx +22 -1
- package/src/components/button/ToggleButtonGroup.tsx +70 -43
- package/src/components/callout/Callout.tsx +27 -0
- package/src/components/card/Card.tsx +34 -0
- package/src/components/card/CardCover.tsx +25 -0
- package/src/components/card/FlipContent.tsx +21 -0
- package/src/components/chip/Chip.tsx +21 -1
- package/src/components/collapsable/Collapsable.tsx +26 -0
- package/src/components/divider/Divider.tsx +19 -0
- package/src/components/dropdown/Dropdown.tsx +40 -0
- package/src/components/dropdown/DropdownTool.tsx +25 -0
- package/src/components/empty/EmptyContent.tsx +26 -0
- package/src/components/icon/Icon.tsx +27 -1
- package/src/components/media/Media.tsx +54 -0
- package/src/components/menu/ContextMenu.tsx +19 -0
- package/src/components/menu/Menu.tsx +29 -0
- package/src/components/menu/MenuItem.tsx +21 -0
- package/src/components/meter/Meter.tsx +24 -0
- package/src/components/navigator/Navigator.tsx +22 -0
- package/src/components/panel/Panel.tsx +37 -0
- package/src/components/panel/PanelGroup.tsx +24 -0
- package/src/components/panel/PanelStack.tsx +31 -0
- package/src/components/progress/ProgressBar.tsx +20 -0
- package/src/components/progress/ProgressCircle.tsx +19 -0
- package/src/components/tabpanel/Tab.tsx +31 -0
- package/src/components/tabpanel/TabPanel.tsx +33 -0
- package/src/context/Global.tsx +24 -1
- package/src/core/aside/Aside.tsx +39 -2
- package/src/core/boundary/ErrorBoundary.tsx +17 -1
- package/src/core/content/Content.tsx +6 -1
- package/src/core/headfoot/HeadFoot.tsx +40 -0
- package/src/core/page/Page.tsx +26 -1
- package/src/core/responsive/Responsive.tsx +52 -1
- package/src/core/section/Section.tsx +16 -1
- package/src/core/theme/ThemeProvider.tsx +21 -1
- package/src/core/viewport/Viewport.tsx +15 -1
- package/src/hooks/useControlledValue.tsx +12 -0
- package/src/hooks/useDebounce.ts +12 -0
- package/src/hooks/useEffectDebugger.ts +49 -0
- package/src/hooks/useIsDark.ts +8 -0
- package/src/hooks/useIsRtl.ts +12 -0
- package/src/hooks/useNavigator.tsx +18 -0
- package/src/hooks/useOverlayService.tsx +24 -0
- package/src/hooks/usePropToggle.ts +16 -5
- package/src/hooks/useResize.ts +18 -0
- package/src/hooks/useResizeObserver.ts +19 -0
- package/src/hooks/useStorage.ts +38 -0
- package/src/types/icons.ts +5 -1
- package/src/typography/Abbr.tsx +28 -1
- package/src/typography/Anchor.tsx +18 -1
- package/src/typography/Copy.tsx +15 -0
- package/src/typography/Mark.tsx +20 -1
- package/src/typography/Text.tsx +27 -1
- package/src/typography/Title.tsx +16 -1
|
@@ -27,12 +27,54 @@ var HeadFoot = function HeadFoot(_ref) {
|
|
|
27
27
|
children: children
|
|
28
28
|
}));
|
|
29
29
|
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Header component that wraps children in a header element.
|
|
33
|
+
* It uses the HeadFoot component to handle layout and styling.
|
|
34
|
+
* It accepts properties for direction, alignment, and justification,
|
|
35
|
+
* allowing for flexible layout configurations.
|
|
36
|
+
* The `as` prop is set to "header" to render the element as a header.
|
|
37
|
+
* The `area` prop is set to "head" to indicate that this is a header area.
|
|
38
|
+
* It can be used to create a consistent header layout across an application.
|
|
39
|
+
*
|
|
40
|
+
* @param {HeadFootProps} props - The properties for the Header component.
|
|
41
|
+
* @returns A header element containing the children wrapped in the HeadFoot component.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```jsx
|
|
45
|
+
* <Header className="custom-header" dir="ltr">
|
|
46
|
+
* <h1>Header content goes here</h1>
|
|
47
|
+
* </Header>
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
30
50
|
var Header = function Header(props) {
|
|
31
51
|
return /*#__PURE__*/jsx(HeadFoot, _objectSpread({
|
|
32
52
|
as: "header",
|
|
33
53
|
area: "head"
|
|
34
54
|
}, props));
|
|
35
55
|
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Footer component that wraps children in a footer element.
|
|
59
|
+
* It uses the HeadFoot component to handle layout and styling.
|
|
60
|
+
* It accepts properties for direction, alignment, and justification,
|
|
61
|
+
* allowing for flexible layout configurations.
|
|
62
|
+
* The `as` prop is set to "footer" to render the element as a footer.
|
|
63
|
+
* The `area` prop is set to "foot" to indicate that this is a footer area.
|
|
64
|
+
* It can be used to create a consistent footer layout across an application.
|
|
65
|
+
* * The Footer component is designed to be flexible and can be styled with custom classes.
|
|
66
|
+
* It supports both default and flex layouts, allowing for alignment and justification of its children.
|
|
67
|
+
*
|
|
68
|
+
* @param {HeadFootProps} props - The properties for the Footer component.
|
|
69
|
+
* @returns A footer element containing the children wrapped in the HeadFoot component.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```jsx
|
|
73
|
+
* <Footer className="custom-footer" dir="ltr">
|
|
74
|
+
* <p>Footer content goes here</p>
|
|
75
|
+
* </Footer>
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
36
78
|
var Footer = function Footer(props) {
|
|
37
79
|
return /*#__PURE__*/jsx(HeadFoot, _objectSpread({
|
|
38
80
|
as: "footer",
|
|
@@ -11,7 +11,32 @@ var _excluded = ["ref", "children", "paper", "title", "titleClassName", "icon",
|
|
|
11
11
|
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; }
|
|
12
12
|
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; }
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Page component that wraps children in a div element.
|
|
15
|
+
* It includes a title section with an optional icon and a loading indicator.
|
|
16
|
+
* The component can be styled with a paper effect, page icon and title.
|
|
17
|
+
* It also accepts a loading prop to display a loading indicator.
|
|
18
|
+
*
|
|
19
|
+
* @param {PageProps} props - The properties for the Page component.
|
|
20
|
+
* @returns A div element containing the title and children, with optional loading indicator.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```jsx
|
|
24
|
+
* <Page
|
|
25
|
+
* title="My Page"
|
|
26
|
+
* icon="home"
|
|
27
|
+
* iconBg="bg-blue-500"
|
|
28
|
+
* iconColor="text-white"
|
|
29
|
+
* loading={false}
|
|
30
|
+
* paper={true}
|
|
31
|
+
* data-testid="my-page"
|
|
32
|
+
* data-test-value="page-value"
|
|
33
|
+
* >
|
|
34
|
+
* <p>This is the content of the page.</p>
|
|
35
|
+
* </Page>
|
|
36
|
+
* // Renders a page with a title, icon, and content.
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--page} for more details.
|
|
15
40
|
*/
|
|
16
41
|
var Page = function Page(_ref) {
|
|
17
42
|
var ref = _ref.ref,
|
|
@@ -11,7 +11,20 @@ var _excluded = ["children", "fullWidth", "className", "gutter"],
|
|
|
11
11
|
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; }
|
|
12
12
|
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; }
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Container component that wraps children in a div element.
|
|
15
|
+
* It supports full width, gutter size, and additional CSS classes.
|
|
16
|
+
* It can be used to create a responsive layout with optional gutters for spacing.
|
|
17
|
+
* It accepts properties for full width, gutter size, and additional CSS classes.
|
|
18
|
+
*
|
|
19
|
+
* @param {ContainerProps} props - The properties for the Container component.
|
|
20
|
+
* @returns A div element containing the children with optional full width and gutter size.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```jsx
|
|
24
|
+
* <Container fullWidth={true} gutter="16px" className="custom-container">
|
|
25
|
+
* <p>This is a container with full width and gutter.</p>
|
|
26
|
+
* </Container>
|
|
27
|
+
* ```
|
|
15
28
|
*/
|
|
16
29
|
var Container = function Container(_ref) {
|
|
17
30
|
var children = _ref.children,
|
|
@@ -26,6 +39,27 @@ var Container = function Container(_ref) {
|
|
|
26
39
|
children: children
|
|
27
40
|
}));
|
|
28
41
|
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Row component that allows for flexible layout of columns.
|
|
45
|
+
* It supports various flex properties, alignment, and wrapping.
|
|
46
|
+
* It can be used to create a responsive layout with optional gutters for spacing.
|
|
47
|
+
* It accepts properties for gutter size, orientation, alignment, justification, and additional CSS classes.
|
|
48
|
+
*
|
|
49
|
+
* @param {RowProps} props - The properties for the Row component.
|
|
50
|
+
* @returns A div element representing a row with the specified flex and alignment properties.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```jsx
|
|
54
|
+
* <Row gutter="16px" orient="row" align="center" justify="between">
|
|
55
|
+
* <Col flex="fill">Column 1</Col>
|
|
56
|
+
* <Col flex="fill">Column 2</Col>
|
|
57
|
+
* </Row>
|
|
58
|
+
* // Renders a row with two columns, each taking equal space, centered vertically and spaced evenly.
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--responsive} for more details.
|
|
62
|
+
*/
|
|
29
63
|
var Row = function Row(_ref2) {
|
|
30
64
|
var children = _ref2.children,
|
|
31
65
|
gutter = _ref2.gutter,
|
|
@@ -44,6 +78,25 @@ var Row = function Row(_ref2) {
|
|
|
44
78
|
children: children
|
|
45
79
|
}));
|
|
46
80
|
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Column component that allows for flexible layout within a row.
|
|
84
|
+
* It supports various flex properties, alignment, and truncation.
|
|
85
|
+
* It can be used to create a responsive layout with optional stretching of inner content.
|
|
86
|
+
* It accepts properties for flex size, alignment, truncation, and additional CSS classes.
|
|
87
|
+
*
|
|
88
|
+
* @param {ColProps} props - The properties for the Col component.
|
|
89
|
+
* @returns A div element representing a column with the specified flex and alignment properties.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```jsx
|
|
93
|
+
* <Col flex="fill" align="center" truncate className="custom-col">
|
|
94
|
+
* <p>This is a column with flexible layout.</p>
|
|
95
|
+
* </Col>
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--responsive} for more details.
|
|
99
|
+
*/
|
|
47
100
|
var Col = function Col(_ref3) {
|
|
48
101
|
var children = _ref3.children,
|
|
49
102
|
flex = _ref3.flex,
|
|
@@ -30,7 +30,27 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* This component provides a way to set the theme for the application.
|
|
34
|
+
* It allows you to set the primary, accent, and tint colors, as well as the color scheme and rounding.
|
|
35
|
+
* It uses CSS variables to apply the colors and styles.
|
|
36
|
+
* It also applies the branding className to the root element.
|
|
37
|
+
* The component uses the `useApplicationContext` hook to get the current color scheme from the application context.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```jsx
|
|
41
|
+
* <ThemeProvider
|
|
42
|
+
* branding="my-branding"
|
|
43
|
+
* primaryColor="#ff0000"
|
|
44
|
+
* accentColor="#00ff00"
|
|
45
|
+
* tintColor="#0000ff"
|
|
46
|
+
* colorScheme="dark"
|
|
47
|
+
* rounding="md"
|
|
48
|
+
* >
|
|
49
|
+
* <div>Your content here</div>
|
|
50
|
+
* </ThemeProvider>
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-application--theme-provider} for more details.
|
|
34
54
|
*/
|
|
35
55
|
var ThemeProvider = function ThemeProvider(_ref) {
|
|
36
56
|
var children = _ref.children,
|
|
@@ -27,7 +27,21 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* This component is used to create a full-screen viewport
|
|
31
|
+
* that can be used to display content in a grid layout.
|
|
32
|
+
* It is typically used as a container for the main content of the application.
|
|
33
|
+
* It is styled to take up the full width and height of the viewport,
|
|
34
|
+
* and it uses absolute positioning to ensure it covers the entire screen.
|
|
35
|
+
* The component accepts children as props, allowing you to nest other components inside it.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```jsx
|
|
39
|
+
* <Viewport>
|
|
40
|
+
* <YourContentComponent />
|
|
41
|
+
* </Viewport>
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-application--viewport} for more details.
|
|
31
45
|
*/
|
|
32
46
|
var Viewport = function Viewport(_ref) {
|
|
33
47
|
var children = _ref.children;
|
|
@@ -4,6 +4,18 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
4
4
|
import { useState, useDeferredValue } from 'react';
|
|
5
5
|
import { useEffectDebugger } from './useEffectDebugger.js';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Custom hook to manage a controlled value with a default fallback for inputs.
|
|
9
|
+
* It updates the current value whenever the deferred value changes.
|
|
10
|
+
* This is useful for scenarios where you want to control the value of a component
|
|
11
|
+
* while also providing a default value if the controlled value is not set.
|
|
12
|
+
* This hook is particularly useful for form inputs or components that require a controlled value
|
|
13
|
+
* but also need to handle cases where the value might not be immediately available.
|
|
14
|
+
*
|
|
15
|
+
* @param value - The controlled value that may change.
|
|
16
|
+
* @param defaultValue - The default value to use if the controlled value is not set.
|
|
17
|
+
* @returns An object containing the current value and a function to update it.
|
|
18
|
+
*/
|
|
7
19
|
var useControlledValue = function useControlledValue(value, defaultValue) {
|
|
8
20
|
var _useState = useState(defaultValue),
|
|
9
21
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -25,6 +25,19 @@ import { useRef, useMemo } from 'react';
|
|
|
25
25
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Custom hook to debounce a function.
|
|
31
|
+
* This hook delays the processing of the function until after a specified delay period
|
|
32
|
+
* has elapsed since the last time the function was invoked. This is useful for optimizing
|
|
33
|
+
* performance in scenarios where a function may be called frequently, such as during
|
|
34
|
+
* user input or window resizing events.
|
|
35
|
+
*
|
|
36
|
+
* @param callback - The function to debounce.
|
|
37
|
+
* @param deps - The dependency array for the hook.
|
|
38
|
+
* @param delay - The debounce delay in milliseconds.
|
|
39
|
+
* @returns A debounced version of the callback function.
|
|
40
|
+
*/
|
|
28
41
|
var useDebounce = function useDebounce(callback, deps) {
|
|
29
42
|
var delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;
|
|
30
43
|
var timerRef = useRef(null);
|
|
@@ -56,6 +56,20 @@ var compareInputs = function compareInputs(oldInputs, newInputs, prefix, logger)
|
|
|
56
56
|
}].concat(diff));
|
|
57
57
|
});
|
|
58
58
|
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Custom hook to debug useMemo hooks.
|
|
62
|
+
* It compares the current and previous dependency arrays and logs any differences.
|
|
63
|
+
* @param func - The function to be memoized or executed in the effect.
|
|
64
|
+
* @param inputs - The dependency array for the hook.
|
|
65
|
+
* @param prefix - A prefix for the log messages to identify the hook.
|
|
66
|
+
* @returns The result of the memoized function or the effect.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```jsx
|
|
70
|
+
* const value = useMemoDebugger(() => computeValue(), [dependency1, dependency2], "MyComponent");
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
59
73
|
var useMemoDebugger = function useMemoDebugger(func, inputs, prefix) {
|
|
60
74
|
// Using a ref to hold the inputs from the previous run (or same run for initial run
|
|
61
75
|
var oldInputsRef = useRef(inputs);
|
|
@@ -73,6 +87,25 @@ var useMemoDebugger = function useMemoDebugger(func, inputs, prefix) {
|
|
|
73
87
|
return func();
|
|
74
88
|
}, inputs);
|
|
75
89
|
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Custom hook to debug useEffect and useLayoutEffect hooks.
|
|
93
|
+
* It compares the current and previous dependency arrays and logs any differences.
|
|
94
|
+
* @param func - The effect function to be executed.
|
|
95
|
+
* @param inputs - The dependency array for the effect.
|
|
96
|
+
* @param prefix - A prefix for the log messages to identify the effect.
|
|
97
|
+
* @returns A cleanup function if the effect returns one.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```jsx
|
|
101
|
+
* useEffectDebugger(() => {
|
|
102
|
+
* // Effect logic here
|
|
103
|
+
* return () => {
|
|
104
|
+
* // Cleanup logic here
|
|
105
|
+
* };
|
|
106
|
+
* }, [dependency1, dependency2], "MyComponent");
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
76
109
|
var useEffectDebugger = function useEffectDebugger(func, inputs, prefix) {
|
|
77
110
|
// Using a ref to hold the inputs from the previous run (or same run for initial run
|
|
78
111
|
var oldInputsRef = useRef(inputs);
|
|
@@ -90,6 +123,25 @@ var useEffectDebugger = function useEffectDebugger(func, inputs, prefix) {
|
|
|
90
123
|
return func();
|
|
91
124
|
}, inputs);
|
|
92
125
|
};
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Custom hook to debug useLayoutEffect hooks.
|
|
129
|
+
* It compares the current and previous dependency arrays and logs any differences.
|
|
130
|
+
* @param func - The layout effect function to be executed.
|
|
131
|
+
* @param inputs - The dependency array for the layout effect.
|
|
132
|
+
* @param prefix - A prefix for the log messages to identify the layout effect.
|
|
133
|
+
* @returns A cleanup function if the layout effect returns one.
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```jsx
|
|
137
|
+
* useLayoutEffectDebugger(() => {
|
|
138
|
+
* // Layout effect logic here
|
|
139
|
+
* return () => {
|
|
140
|
+
* // Cleanup logic here
|
|
141
|
+
* };
|
|
142
|
+
* }, [dependency1, dependency2], "MyComponent");
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
93
145
|
var useLayoutEffectDebugger = function useLayoutEffectDebugger(func, inputs, prefix) {
|
|
94
146
|
// Using a ref to hold the inputs from the previous run (or same run for initial run
|
|
95
147
|
var oldInputsRef = useRef(inputs);
|
|
@@ -4,6 +4,14 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
4
4
|
import { useState, useCallback } from 'react';
|
|
5
5
|
import { useLayoutEffectDebugger } from './useEffectDebugger.js';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Custom hook to determine if the current theme is dark.
|
|
9
|
+
* It checks the background color of the document's root element
|
|
10
|
+
* and sets the `isDark` state based on the red component of the RGB color.
|
|
11
|
+
* If the red component is less than 50, it considers the theme to be dark.
|
|
12
|
+
*
|
|
13
|
+
* @returns {boolean} - Returns true if the theme is dark, false otherwise.
|
|
14
|
+
*/
|
|
7
15
|
var useIsDark = function useIsDark() {
|
|
8
16
|
var _useState = useState(false),
|
|
9
17
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -5,6 +5,18 @@ import { useState } from 'react';
|
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { useLayoutEffectDebugger } from './useEffectDebugger.js';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Custom hook to determine if the current locale is RTL (Right-to-Left).
|
|
10
|
+
* It uses the i18n instance from react-i18next to check the direction.
|
|
11
|
+
*
|
|
12
|
+
* @returns {boolean} - Returns true if the current locale is RTL, false otherwise.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```jsx
|
|
16
|
+
* const isRtl = useIsRtl();
|
|
17
|
+
* // This will return true if the current locale is RTL, false otherwise.
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
8
20
|
var useIsRtl = function useIsRtl() {
|
|
9
21
|
var _useTranslation = useTranslation("core"),
|
|
10
22
|
i18n = _useTranslation.i18n;
|
|
@@ -11,6 +11,30 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
11
11
|
var _excluded = ["onClose"];
|
|
12
12
|
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
13
|
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
|
+
* Hook to manage overlay components like modals or flyouts.
|
|
16
|
+
* It provides a way to open an overlay with specified properties and handle its closure.
|
|
17
|
+
* This hook returns the current overlay component and a function to open it with props.
|
|
18
|
+
* It is useful for scenarios where you need to display overlays dynamically,
|
|
19
|
+
* such as modals, flyouts, or any other overlay components in a React application.
|
|
20
|
+
* The `openOverlay` function returns a promise that resolves with the result
|
|
21
|
+
* of the overlay when it is closed, allowing you to handle the result in a controlled manner.
|
|
22
|
+
*
|
|
23
|
+
* @param ModalOrFlyout - The component to be used as an overlay.
|
|
24
|
+
* @returns An array containing the current overlay and a function to open it.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```jsx
|
|
28
|
+
* const [Overlay, openOverlay] = useOverlayService(MyModalComponent);
|
|
29
|
+
* // To open the overlay:
|
|
30
|
+
* const handleOpen = async () => {
|
|
31
|
+
* const result = await openOverlay({ title: "My Modal", content: "Hello World" });
|
|
32
|
+
* console.log(result); // Handle the result from the overlay
|
|
33
|
+
* };
|
|
34
|
+
* <button onClick={handleOpen}>Open Modal</button>
|
|
35
|
+
* <Overlay />
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
14
38
|
var useOverlayService = function useOverlayService(ModalOrFlyout) {
|
|
15
39
|
var _useState = useState(null),
|
|
16
40
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -5,11 +5,22 @@ import { useRef, useState, useCallback } from 'react';
|
|
|
5
5
|
import { useLayoutEffectDebugger } from './useEffectDebugger.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* hook to
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @
|
|
8
|
+
* This hook is used to manage a toggle state based on a prop value.
|
|
9
|
+
* It allows you to toggle the state and also provides a reference to the current state.
|
|
10
|
+
* It is useful for scenarios where you want to control a toggle state from a parent component while also allowing local toggling.
|
|
11
|
+
*
|
|
12
|
+
* @param isOn - Initial state of the toggle (default: false)
|
|
13
|
+
* @param onToggle - Callback function that is called when the toggle state changes.
|
|
14
|
+
* @param key - Optional key to identify the toggle state, useful for multiple toggles.
|
|
15
|
+
* @returns A tuple containing the current toggle state, a function to toggle the state, and a reference to the current state.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```jsx
|
|
19
|
+
* const [isToggled, toggle, toggleRef] = usePropToggle(false, (newState) => {
|
|
20
|
+
* console.log("Toggle state changed to:", newState);
|
|
21
|
+
* });
|
|
22
|
+
* toggle(); // This will toggle the state and call the onToggle callback
|
|
23
|
+
* ```
|
|
13
24
|
*/
|
|
14
25
|
var usePropToggle = function usePropToggle() {
|
|
15
26
|
var isOn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
@@ -26,6 +26,24 @@ import { useIsRtl } from './useIsRtl.js';
|
|
|
26
26
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Custom hook to handle resizing of an element.
|
|
31
|
+
* It provides a ref to the element and a mouse down event handler to initiate resizing.
|
|
32
|
+
* The resizing is done by tracking mouse movements and calculating the difference in x and y coordinates.
|
|
33
|
+
* It supports both horizontal and vertical resizing, and can be configured to reverse the direction based on RTL (Right-to-Left) layout.
|
|
34
|
+
*
|
|
35
|
+
* @param onResize - callback to handle resize event with the difference in x and y
|
|
36
|
+
* @param options - options for resizing behavior
|
|
37
|
+
* @returns ref to the element and a mouse down event handler to initiate resizing
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```jsx
|
|
41
|
+
* const { ref, onMouseDown } = useResize((diff) => {
|
|
42
|
+
* console.log("Resize difference:", diff);
|
|
43
|
+
* }, { isReverse: true, isVertical: false });
|
|
44
|
+
* <div ref={ref} onMouseDown={onMouseDown}>Resize Me</div>
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
29
47
|
var useResize = function useResize(onResize, _ref) {
|
|
30
48
|
var _ref$isReverse = _ref.isReverse,
|
|
31
49
|
isReverse = _ref$isReverse === void 0 ? false : _ref$isReverse,
|
|
@@ -5,6 +5,25 @@ import { useRef, useTransition, useEffect } from 'react';
|
|
|
5
5
|
import ResizeObserver from 'resize-observer-polyfill';
|
|
6
6
|
import { useDebounce } from './useDebounce.js';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Custom hook to observe size changes of an element using ResizeObserver.
|
|
10
|
+
* It returns a ref that can be attached to the element you want to observe.
|
|
11
|
+
* The hook will call the provided `onResize` callback with the new size of the element
|
|
12
|
+
* whenever it changes.
|
|
13
|
+
* * This is useful for responsive designs where you need to adjust the layout or styles
|
|
14
|
+
* based on the size of an element.
|
|
15
|
+
*
|
|
16
|
+
* @param onResize Callback function that receives the new size of the element.
|
|
17
|
+
* @returns A ref object to be attached to the element you want to observe.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```jsx
|
|
21
|
+
* const ref = useResizeObserver((size) => {
|
|
22
|
+
* console.log("Element resized:", size);
|
|
23
|
+
* });
|
|
24
|
+
* <div ref={ref}>Resize me!</div>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
8
27
|
var useResizeObserver = function useResizeObserver(onResize) {
|
|
9
28
|
var ref = useRef(null);
|
|
10
29
|
var _useTransition = useTransition(),
|
|
@@ -5,6 +5,24 @@ import { useState } from 'react';
|
|
|
5
5
|
import { useClientService } from './useClientService.js';
|
|
6
6
|
import { useEffectDebugger } from './useEffectDebugger.js';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Custom hook to manage local storage state.
|
|
10
|
+
* This hook allows you to store and retrieve values from the browser's local storage,
|
|
11
|
+
* and provides a way to update the stored value while keeping the state in sync with local storage.
|
|
12
|
+
* It initializes the state with the value from local storage if it exists, or uses a default value if it does not.
|
|
13
|
+
* The hook returns a tuple containing the current value and a function to update the value.
|
|
14
|
+
* This is useful for persisting user preferences or application state across page reloads.
|
|
15
|
+
*
|
|
16
|
+
* @param key - The key under which the value is stored in local storage.
|
|
17
|
+
* @param defaultValue - The default value to use if the key does not exist in local storage.
|
|
18
|
+
* @returns A tuple containing the current value and a function to update the value.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```jsx
|
|
22
|
+
* const [settings, setSettings] = useLocalStorage("userSettings", { theme: "light" });
|
|
23
|
+
* // This will initialize the settings state from local storage or use the default value.
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
8
26
|
var useLocalStorage = function useLocalStorage(key, defaultValue) {
|
|
9
27
|
var _JSON$parse, _service$getItem;
|
|
10
28
|
var service = useClientService(localStorage);
|
|
@@ -22,6 +40,27 @@ var useLocalStorage = function useLocalStorage(key, defaultValue) {
|
|
|
22
40
|
};
|
|
23
41
|
return [value, changeValue];
|
|
24
42
|
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Custom hook to manage session storage state.
|
|
46
|
+
* This hook allows you to store and retrieve values from the browser's session storage,
|
|
47
|
+
* and provides a way to update the stored value while keeping the state in sync with session storage.
|
|
48
|
+
* It initializes the state with the value from session storage if it exists, or uses a default value if it does not.
|
|
49
|
+
* The hook returns a tuple containing the current value and a function to update the value.
|
|
50
|
+
* This is useful for persisting user preferences or application state during a single session,
|
|
51
|
+
* such as form data or temporary settings that should not persist across page reloads.
|
|
52
|
+
* This hook is similar to `useLocalStorage`, but it uses session storage instead of local storage.
|
|
53
|
+
*
|
|
54
|
+
* @param key - The key under which the value is stored in session storage.
|
|
55
|
+
* @param defaultValue - The default value to use if the key does not exist in session storage.
|
|
56
|
+
* @returns A tuple containing the current value and a function to update the value.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```jsx
|
|
60
|
+
* const [user, setUser] = useSessionStorage("user", { name: "", age: 0 });
|
|
61
|
+
* // This will initialize the user state from session storage or use the default value.
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
25
64
|
var useSessionStorage = function useSessionStorage(key, defaultValue) {
|
|
26
65
|
var _JSON$parse3, _service$getItem3;
|
|
27
66
|
var service = useClientService(sessionStorage);
|
package/dist/esm/types/icons.js
CHANGED
|
@@ -24,6 +24,10 @@
|
|
|
24
24
|
*/
|
|
25
25
|
/* istanbul ignore file */
|
|
26
26
|
/* eslint-disable @typescript-eslint/no-namespace */
|
|
27
|
+
/**
|
|
28
|
+
* Core icons used in the application.
|
|
29
|
+
* These icons are typically used for navigation, actions, and other UI elements.
|
|
30
|
+
*/
|
|
27
31
|
var CoreIcons;
|
|
28
32
|
(function (_CoreIcons) {
|
|
29
33
|
_CoreIcons.chevronDown = "M6.173 7.29l5.827 5.827 5.827-5.827 1.79 1.803-7.617 7.617-7.617-7.617 1.79-1.803z";
|
|
@@ -36,7 +36,34 @@ var AbbrText = function AbbrText(_ref) {
|
|
|
36
36
|
}));
|
|
37
37
|
};
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* A component that renders abbreviated text with tooltips for additional information.
|
|
40
|
+
* It allows you to define a list of abbreviations, each with a tooltip and optional color.
|
|
41
|
+
* The component will tokenize the children text and replace matching parts with the abbreviated version.
|
|
42
|
+
* It supports a copy action that can either copy the text or the tooltip content.
|
|
43
|
+
* This component is useful for displaying technical terms or acronyms in a user-friendly way,
|
|
44
|
+
* while providing additional context through tooltips.
|
|
45
|
+
*
|
|
46
|
+
* @param {AbbrProps} props - The properties for the Abbr component.
|
|
47
|
+
* @returns {JSX.Element} The rendered Abbr component.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```jsx
|
|
51
|
+
* <Abbr
|
|
52
|
+
* abbr={[
|
|
53
|
+
* ["HTML", "HyperText Markup Language", "primary"],
|
|
54
|
+
* ["CSS", "Cascading Style Sheets", "secondary"],
|
|
55
|
+
* ["JS", "JavaScript", "success"],
|
|
56
|
+
* ]}
|
|
57
|
+
* className="text-sm"
|
|
58
|
+
* copyContent="tooltip"
|
|
59
|
+
* >
|
|
60
|
+
* Learn more about HTML, CSS, and JS.
|
|
61
|
+
* </Abbr>
|
|
62
|
+
* // Renders the text with abbreviations for HTML, CSS, and JS,
|
|
63
|
+
* // each with a tooltip showing the full form and colored according to the specified color.
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-typography--abbr} for more details.
|
|
40
67
|
*/
|
|
41
68
|
var Abbr = function Abbr(_ref2) {
|
|
42
69
|
var children = _ref2.children,
|
|
@@ -14,7 +14,24 @@ var _excluded = ["ref", "as", "children", "className", "bg", "color", "family",
|
|
|
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; }
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* A versatile link component that supports polymorphic rendering, allowing it to be used as an anchor (`<a>`), button, or any other HTML element.
|
|
18
|
+
* It can be styled with background color, text color, font size, and font family.
|
|
19
|
+
* It accepts various properties such as `bg`, `color`, `size`, and `family` to customize its appearance.
|
|
20
|
+
* This component is useful for creating links that need to be styled consistently across an application, while also providing flexibility in terms of the HTML element used.
|
|
21
|
+
*
|
|
22
|
+
* @param {AnchorProps} props - The properties for the Anchor component.
|
|
23
|
+
* @param {Tag} as - The HTML element type to render as (default is "a").
|
|
24
|
+
* @returns {JSX.Element} - A styled anchor element with the specified properties.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```jsx
|
|
28
|
+
* <Anchor href="https://example.com" bg="blue-500" color="white" size="md">
|
|
29
|
+
* Click here
|
|
30
|
+
* </Anchor>
|
|
31
|
+
* // Renders a link with a blue background, white text, and medium font size.
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-typography--anchor} for more details.
|
|
18
35
|
*/
|
|
19
36
|
var Anchor = function Anchor(_ref) {
|
|
20
37
|
var ref = _ref.ref,
|
|
@@ -23,7 +23,26 @@ var MarkText = function MarkText(_ref) {
|
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* A component that highlights specific text parts with a mark element, allowing for custom rendering and color.
|
|
27
|
+
* It tokenizes the children string based on the provided `mark` array,
|
|
28
|
+
* which contains pairs of text parts and their corresponding colors.
|
|
29
|
+
* The component can use a custom renderer to display the marked text,
|
|
30
|
+
* allowing for greater flexibility in how the text is presented.
|
|
31
|
+
*
|
|
32
|
+
* @param {MarkProps} props - The properties for the Mark component.
|
|
33
|
+
* @returns {JSX.Element} The rendered Mark component.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* <Mark
|
|
37
|
+
* mark={[
|
|
38
|
+
* ["important", "red"],
|
|
39
|
+
* ["note", "blue"],
|
|
40
|
+
* ]}
|
|
41
|
+
* >
|
|
42
|
+
* This is an important note that should be highlighted.
|
|
43
|
+
* </Mark>
|
|
44
|
+
*
|
|
45
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-typography--mark} for more details.
|
|
27
46
|
*/
|
|
28
47
|
var Mark = function Mark(_ref2) {
|
|
29
48
|
var children = _ref2.children,
|