@react-fabric/core 1.0.0-beta.51 → 1.0.0-beta.53
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/_breadcrumbs.css +3 -3
- package/css/components/_menu.css +2 -0
- package/css/components/_modal.css +2 -2
- package/css/core/_aside.css +2 -2
- package/css/theme/_utilities.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 +31 -2
- package/dist/cjs/components/breadcrumbs/Breadcrumbs.js +30 -1
- package/dist/cjs/components/button/Button.js +25 -2
- 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 +22 -1
- 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 +55 -2
- package/dist/cjs/core/section/Section.js +11 -27
- 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 +32 -3
- package/dist/esm/components/breadcrumbs/Breadcrumbs.js +30 -1
- package/dist/esm/components/button/Button.js +25 -2
- 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 +22 -1
- 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 +55 -2
- package/dist/esm/core/section/Section.js +11 -27
- 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 +18 -3
- 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 +33 -3
- package/src/components/breadcrumbs/Breadcrumbs.tsx +30 -1
- package/src/components/button/Button.tsx +24 -2
- 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 +22 -1
- 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 +53 -2
- package/src/core/section/Section.tsx +25 -2
- 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
|
@@ -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,
|
|
@@ -18,7 +18,33 @@ var _excluded = ["children", "className", "inline", "bg", "color", "family", "si
|
|
|
18
18
|
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
19
|
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; }
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* A component that renders text with various styles, supports line clamping, and provides a "show more" link if the text is clipped.
|
|
22
|
+
* It can be rendered as an inline element or a block element, and allows customization of background color, text color, font size, font family, and text alignment.
|
|
23
|
+
* It also supports line clamping to limit the number of visible lines, and provides a toggle to show more or less text when the content exceeds the specified clamp.
|
|
24
|
+
* The component uses a combination of CSS and JavaScript to achieve the desired effects, ensuring a smooth user experience.
|
|
25
|
+
* It leverages the ResizeObserver API to detect changes in the text container's size and adjust the line clamping accordingly.
|
|
26
|
+
*
|
|
27
|
+
* @param {TextProps} props - The properties for the Text component.
|
|
28
|
+
* @returns {JSX.Element} The rendered Text component.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```jsx
|
|
32
|
+
* <Text
|
|
33
|
+
* inline={false}
|
|
34
|
+
* bg="bg-gray-100"
|
|
35
|
+
* color="text-gray-800"
|
|
36
|
+
* size="md"
|
|
37
|
+
* family="sans"
|
|
38
|
+
* clamp={2}
|
|
39
|
+
* align="start"
|
|
40
|
+
* >
|
|
41
|
+
* This is a sample text that demonstrates the Text component with various styles applied.
|
|
42
|
+
* </Text>
|
|
43
|
+
* // Renders a block-level text with gray background, dark gray text, medium font size,
|
|
44
|
+
* // sans-serif font family, clamped to 2 lines, and left-aligned.
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-typography--text} for more details.
|
|
22
48
|
*/
|
|
23
49
|
var Text = function Text(_ref) {
|
|
24
50
|
var children = _ref.children,
|
|
@@ -14,7 +14,22 @@ var _excluded = ["children", "className", "as", "bg", "color", "size", "align",
|
|
|
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 component that renders a title with customizable styles such as background color, text color, size, alignment, and font family.
|
|
18
|
+
* It can be rendered as different HTML elements based on the `as` prop.
|
|
19
|
+
* This component is useful for creating headings or titles in a consistent style across an application.
|
|
20
|
+
*
|
|
21
|
+
* @param {TitleProps} props - The properties for the Title component.
|
|
22
|
+
* @returns {JSX.Element} The rendered Title component.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```jsx
|
|
26
|
+
* <Title as="h1" bg="blue-500" color="white" size="2xl" align="center">
|
|
27
|
+
* This is a Title
|
|
28
|
+
* </Title>
|
|
29
|
+
* // Renders a title as an h1 element with a blue background, white text color, size of 2xl, and centered alignment.
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-typography--title} for more details.
|
|
18
33
|
*/
|
|
19
34
|
var Title = function Title(_ref) {
|
|
20
35
|
var children = _ref.children,
|
|
@@ -15,7 +15,26 @@ export interface ActionLabelProps extends AriaProps, CssProp, ChildProp, TestPro
|
|
|
15
15
|
actions: ReactElement[];
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
* A
|
|
19
|
-
* useful
|
|
18
|
+
* A label with action buttons that can be aligned to the start or end.
|
|
19
|
+
* This component is useful for displaying a label with associated actions, such as buttons, that can be aligned based on the design requirements.
|
|
20
|
+
* It automatically calculates the width of the action buttons to ensure that the label text does not overflow the container.
|
|
21
|
+
* It uses CSS variables to manage the width of the label text dynamically based on the action buttons' width.
|
|
22
|
+
* This component is designed to be flexible and can be used in various contexts where a label with actions is needed.
|
|
23
|
+
* It supports custom alignment, disabled states, and can be easily styled with additional CSS classes.
|
|
24
|
+
*
|
|
25
|
+
* @param {ActionLabelProps} props - The properties for the ActionLabel component.
|
|
26
|
+
* @returns {JSX.Element} The rendered ActionLabel component.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```jsx
|
|
30
|
+
* <ActionLabel
|
|
31
|
+
* actions={[<Button>Action 1</Button>, <Button>Action 2</Button>]}
|
|
32
|
+
* align="end"
|
|
33
|
+
* >
|
|
34
|
+
* Label Text
|
|
35
|
+
* </ActionLabel>
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-action-label--docs} for more details.
|
|
20
39
|
*/
|
|
21
40
|
export declare const ActionLabel: ({ children, className, align, actions, disabled, ...rest }: ActionLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,14 +10,93 @@ export interface AnimationProps extends CssProp, AriaProps {
|
|
|
10
10
|
*/
|
|
11
11
|
strokeColor?: ColorType | PaletteType | string;
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* A component that displays an animated indicator with a customizable icon type and colors.
|
|
15
|
+
* It can be used to indicate various states such as success, error, or information.
|
|
16
|
+
* The component supports different icon types like check, cross, question, and exclamation.
|
|
17
|
+
* It also allows customization of the icon color and stroke color.
|
|
18
|
+
*
|
|
19
|
+
* @param {AnimationProps} props - The properties for the AnimationIndicator component.
|
|
20
|
+
* @returns {JSX.Element} The rendered AnimationIndicator component.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```jsx
|
|
24
|
+
* <AnimationIndicator
|
|
25
|
+
* type="check"
|
|
26
|
+
* color="primary-500"
|
|
27
|
+
* strokeColor="primary-700"
|
|
28
|
+
* className="my-custom-class"
|
|
29
|
+
* aria-label="Loading"
|
|
30
|
+
* />
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-animations--docs} for more details.
|
|
34
|
+
*/
|
|
13
35
|
export declare const AnimationIndicator: ({ className, color, strokeColor, type, ...aria }: AnimationProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
/**
|
|
37
|
+
* A component that displays an animated bars loader.
|
|
38
|
+
* It can be customized with color and size properties.
|
|
39
|
+
* This component is typically used to indicate loading states in the UI.
|
|
40
|
+
*
|
|
41
|
+
* @param {Object} props - The properties for the AnimationBars component.
|
|
42
|
+
* @param {ColorType | PaletteType | string} [props.color="tint-500"] - The color of the bars.
|
|
43
|
+
* @param {number | string} [props.size="2rem"] - The size of the bars.
|
|
44
|
+
* @returns {JSX.Element} The rendered AnimationBars component.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```jsx
|
|
48
|
+
* <AnimationBars color="primary-500" size="3rem" />
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-animations--docs} for more details.
|
|
52
|
+
*/
|
|
14
53
|
export declare const AnimationBars: ({ color, size, }: {
|
|
15
54
|
color?: ColorType | PaletteType | string;
|
|
16
55
|
size?: number | string;
|
|
17
56
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
/**
|
|
58
|
+
* A component that displays a spinner animation.
|
|
59
|
+
* It can be customized with color and size properties.
|
|
60
|
+
* This component is typically used to indicate loading states in the UI.
|
|
61
|
+
*
|
|
62
|
+
* @param {Object} props - The properties for the AnimationSpinner component.
|
|
63
|
+
* @param {ColorType | PaletteType | string} [props.color="tint-700"] - The color of the spinner.
|
|
64
|
+
* @param {number | string} [props.size="2rem"] - The size of the spinner.
|
|
65
|
+
* @returns {JSX.Element} The rendered AnimationSpinner component.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```jsx
|
|
69
|
+
* <AnimationSpinner color="primary-500" size="3rem" />
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-animations--docs} for more details.
|
|
73
|
+
*/
|
|
18
74
|
export declare const AnimationSpinner: ({ color, size, }: {
|
|
19
75
|
color?: ColorType | PaletteType | string;
|
|
20
76
|
size?: number | string;
|
|
21
77
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
|
|
78
|
+
/**
|
|
79
|
+
* A component that displays a skeleton loader with a placeholder for content.
|
|
80
|
+
* It can be customized with color and size properties.
|
|
81
|
+
* This component is typically used to indicate loading states in the cards, panels and virtual lists,
|
|
82
|
+
* providing a visual placeholder for content that is being loaded.
|
|
83
|
+
*
|
|
84
|
+
* @param {CssProp} props - The properties for the Skeleton component.
|
|
85
|
+
* @returns {JSX.Element} The rendered Skeleton component.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```jsx
|
|
89
|
+
* <Skeleton className="my-skeleton" />
|
|
90
|
+
* * // Renders a skeleton loader with a placeholder for content.
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-animations--docs} for more details.
|
|
94
|
+
*/
|
|
23
95
|
export declare const Skeleton: ({ className, ...rest }: CssProp) => import("react/jsx-runtime").JSX.Element;
|
|
96
|
+
/**
|
|
97
|
+
* A component that displays a loading animation with a top border.
|
|
98
|
+
* It is typically used to indicate that content is being loaded in pages and page sections.
|
|
99
|
+
*
|
|
100
|
+
* @returns {JSX.Element} The rendered Loading component.
|
|
101
|
+
*/
|
|
102
|
+
export declare const Loading: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { type PaletteType, type AriaProps, type ColorType, type CssProp, type RefProp, type SizeType, type TestProps } from "../../types";
|
|
3
2
|
export interface AvatarProps extends CssProp, AriaProps, TestProps, RefProp {
|
|
4
3
|
/**
|
|
@@ -43,6 +42,31 @@ export interface AvatarProps extends CssProp, AriaProps, TestProps, RefProp {
|
|
|
43
42
|
onClick?: React.MouseEventHandler;
|
|
44
43
|
}
|
|
45
44
|
/**
|
|
46
|
-
*
|
|
45
|
+
* A component that displays an avatar image or a fallback icon with customizable styles and properties.
|
|
46
|
+
* It supports various avatar types, including text-based avatars, and allows for customization of background color, icon color, size, and rounded corners.
|
|
47
|
+
* This component is useful for displaying user avatars in applications, providing a visual representation of users or entities.
|
|
48
|
+
* It can also handle cases where the avatar image fails to load by displaying a fallback icon or text.
|
|
49
|
+
* It uses the Boring Avatars library for generating fallback avatars based on the user's name.
|
|
50
|
+
*
|
|
51
|
+
* @param {AvatarProps} props - The properties for the Avatar component.
|
|
52
|
+
* @returns {JSX.Element} The rendered Avatar component.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```jsx
|
|
56
|
+
* <Avatar
|
|
57
|
+
* name="John Doe"
|
|
58
|
+
* avatar="https://example.com/avatar.jpg"
|
|
59
|
+
* fallbackIcon="fas fa-user"
|
|
60
|
+
* bg="bg-blue-500"
|
|
61
|
+
* color="text-white"
|
|
62
|
+
* size="md"
|
|
63
|
+
* rounded
|
|
64
|
+
* variant="beam"
|
|
65
|
+
* onClick={() => console.log("Avatar clicked")}
|
|
66
|
+
* />
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/story/core-components-avatar--docs} for more details.
|
|
70
|
+
* @see {@link https://boringavatars.com/} for more information on Boring Avatars.
|
|
47
71
|
*/
|
|
48
72
|
export declare const Avatar: ({ ref, name, avatar, fallbackIcon, bg, color, size, rounded, variant, className, viewBox, onClick, ...aria }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -18,7 +18,25 @@ export interface AvatarGroupProps extends CssProp, RefProp, AriaProps {
|
|
|
18
18
|
totalCount?: number;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* A component that groups multiple avatars together, displaying a count of additional avatars if the total exceeds the visible ones.
|
|
22
|
+
* It allows customization of size, rounding, and additional aria attributes.
|
|
23
|
+
* This component is useful for displaying a collection of user avatars in a compact format, such as in a chat application or user list.
|
|
24
|
+
* It automatically calculates the number of additional avatars based on the `totalCount` prop and the number of children provided.
|
|
25
|
+
*
|
|
26
|
+
* @param {AvatarGroupProps} props - The properties for the AvatarGroup component.
|
|
27
|
+
* @returns {JSX.Element} The rendered AvatarGroup component.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```jsx
|
|
31
|
+
* <AvatarGroup totalCount={5} size="md" className="my-avatar-group">
|
|
32
|
+
* <Avatar name="John Doe" avatar="https://example.com/avatar1.jpg" />
|
|
33
|
+
* <Avatar name="Jane Smith" avatar="https://example.com/avatar2.jpg" />
|
|
34
|
+
* <Avatar name="Alice Johnson" avatar="https://example.com/avatar3.jpg" />
|
|
35
|
+
* <Avatar name="Bob Brown" avatar="https://example.com/avatar4.jpg" />
|
|
36
|
+
* </AvatarGroup>
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-avatar--docs} for more details.
|
|
22
40
|
*/
|
|
23
41
|
export declare const AvatarGroup: ({ ref, children, className, totalCount, rounded, size, ...aria }: AvatarGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
42
|
export {};
|
|
@@ -25,5 +25,30 @@ export interface BadgeProps extends CssProp, RefProp, IconProps, Partial<ChildPr
|
|
|
25
25
|
*/
|
|
26
26
|
placement?: "top-start" | "top-end" | "bottom-start" | "bottom-end" | "top" | "bottom" | "start" | "end";
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Utility function to get badge properties from a badge value or object.
|
|
30
|
+
* It checks if the badge is an object and returns its properties,
|
|
31
|
+
*
|
|
32
|
+
* @param {string | number | BadgeType} badge - The badge value or object.
|
|
33
|
+
* @returns {AnyObject} An object containing badge properties.
|
|
34
|
+
*/
|
|
28
35
|
export declare const getBadgeProps: (badge?: string | number | BadgeType) => AnyObject;
|
|
36
|
+
/**
|
|
37
|
+
* A component that displays a badge with a value, icon, and optional ping animation.
|
|
38
|
+
* It can be used to indicate notifications, messages, or other important information.
|
|
39
|
+
* It supports various placements, inline or block display, and custom styling.
|
|
40
|
+
* It can also wrap children elements, allowing for flexible usage in buttons or other components.
|
|
41
|
+
*
|
|
42
|
+
* @param {BadgeProps} props - The properties for the Badge component.
|
|
43
|
+
* @returns {JSX.Element} The rendered Badge component.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```jsx
|
|
47
|
+
* <Badge value={5} max={10} ping>
|
|
48
|
+
* <button>Notifications</button>
|
|
49
|
+
* </Badge>
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-badge--docs} for more details.
|
|
53
|
+
*/
|
|
29
54
|
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;
|
|
@@ -14,4 +14,33 @@ export interface BreadcrumbProps extends CssProp, AriaProps, ChildrenProp<typeof
|
|
|
14
14
|
*/
|
|
15
15
|
color?: "primary" | "accent";
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* A navigation component that displays the current page's location within a hierarchy and allows users to navigate back to previous pages.
|
|
19
|
+
* It supports different styles, separators, and colors, and can handle a variable number of breadcrumb links.
|
|
20
|
+
* This component is useful for enhancing user navigation experience in applications with multiple levels of content hierarchy.
|
|
21
|
+
* It automatically manages the display of overflow items when there are too many links to fit in the available space, providing a dropdown for additional links.
|
|
22
|
+
*
|
|
23
|
+
* @param {BreadcrumbProps} props - The properties for the Breadcrumbs component.
|
|
24
|
+
* @returns {JSX.Element} The rendered Breadcrumbs component.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```jsx
|
|
28
|
+
* <Breadcrumbs
|
|
29
|
+
* variant="classic"
|
|
30
|
+
* separator=">"
|
|
31
|
+
* color="primary"
|
|
32
|
+
* className="my-custom-class"
|
|
33
|
+
* aria-label="Breadcrumbs"
|
|
34
|
+
* >
|
|
35
|
+
* <Anchor href="/">Home</Anchor>
|
|
36
|
+
* <Anchor href="/products">Products</Anchor>
|
|
37
|
+
* <Anchor href="/products/shoes">Shoes</Anchor>
|
|
38
|
+
* <Anchor href="/products/shoes/sneakers">Sneakers</Anchor>
|
|
39
|
+
* <Anchor href="/products/shoes/sneakers/nike">Nike</Anchor>
|
|
40
|
+
* <Anchor href="/products/shoes/sneakers/nike/airmax">Air Max</Anchor>
|
|
41
|
+
* </Breadcrumbs>
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-breadcrumbs--docs} for more details.
|
|
45
|
+
*/
|
|
17
46
|
export declare const Breadcrumbs: ({ variant, className, separator, children, color, ...aria }: BreadcrumbProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -91,7 +91,28 @@ type ButtonTypeProps = {
|
|
|
91
91
|
};
|
|
92
92
|
export type ButtonProps<Tag extends React.ElementType = "button"> = BaseProps & ButtonTypeProps & PolymorphicProps<Tag>;
|
|
93
93
|
/**
|
|
94
|
-
*
|
|
94
|
+
* A versatile button component that supports various styles, icons, and actions.
|
|
95
|
+
* It can be used as a primary action button, with options for loading states, action messages, and more.
|
|
96
|
+
* It supports polymorphic rendering, allowing it to be used as different HTML elements (e.g., button, a, div).
|
|
97
|
+
* It also includes features like after action tooltips, badges, and keyboard shortcuts.
|
|
98
|
+
*
|
|
99
|
+
* @param {ButtonProps} props - The properties for the Button component.
|
|
100
|
+
* @returns {JSX.Element} The rendered Button component.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```jsx
|
|
104
|
+
* <Button
|
|
105
|
+
* color="primary"
|
|
106
|
+
* size="md"
|
|
107
|
+
* variant="solid"
|
|
108
|
+
* icon="check"
|
|
109
|
+
* onClick={() => console.log("Button clicked!")}
|
|
110
|
+
* >
|
|
111
|
+
* Click Me
|
|
112
|
+
* </Button>
|
|
113
|
+
* ```
|
|
114
|
+
*
|
|
115
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-button--docs} for more details.
|
|
95
116
|
*/
|
|
96
|
-
export declare const Button: <Tag extends
|
|
117
|
+
export declare const Button: <Tag extends React.ElementType = "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
118
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { type AriaProps, type ChildrenProp, type ColorState, type CssProp, type RefProp, type SizeType, type TestProps } from "../../types";
|
|
3
2
|
import { type Button } from "./Button";
|
|
4
3
|
export interface ButtonGroupProps extends CssProp, AriaProps, TestProps, RefProp<HTMLDivElement>, ChildrenProp<React.ReactElement<typeof Button>> {
|
|
@@ -31,4 +30,30 @@ export interface ButtonGroupProps extends CssProp, AriaProps, TestProps, RefProp
|
|
|
31
30
|
*/
|
|
32
31
|
fullWidth?: boolean;
|
|
33
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* A component that groups buttons together, allowing for consistent styling and behavior across multiple buttons.
|
|
35
|
+
* It supports vertical orientation, various button styles, and can handle properties like size, color, and disabled state.
|
|
36
|
+
* This component is useful for creating button groups that maintain a uniform appearance and functionality,
|
|
37
|
+
* such as toolbars, action groups, or navigation buttons.
|
|
38
|
+
*
|
|
39
|
+
* @param {ButtonGroupProps} props - The properties for the ButtonGroup component.
|
|
40
|
+
* @returns {JSX.Element} The rendered ButtonGroup component.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```jsx
|
|
44
|
+
* <ButtonGroup
|
|
45
|
+
* variant="solid"
|
|
46
|
+
* color="primary"
|
|
47
|
+
* className="my-custom-class"
|
|
48
|
+
* aria-label="Button Group"
|
|
49
|
+
* vertical
|
|
50
|
+
* >
|
|
51
|
+
* <Button>Button 1</Button>
|
|
52
|
+
* <Button>Button 2</Button>
|
|
53
|
+
* <Button>Button 3</Button>
|
|
54
|
+
* </ButtonGroup>
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-buttongroup--docs} for more details.
|
|
58
|
+
*/
|
|
34
59
|
export declare const ButtonGroup: ({ vertical, className, children, variant, rounded, disabled, fullWidth, color, size, ...aria }: ButtonGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { type Placement } from "@floating-ui/react";
|
|
3
2
|
import { type CallbackReturn, type PolymorphicProps, type RefProp } from "../../types";
|
|
4
3
|
import { type BaseProps, type ButtonProps } from "./Button";
|
|
@@ -26,7 +25,28 @@ interface ExtendedProps extends Omit<BaseProps, "onClick">, RefProp {
|
|
|
26
25
|
}
|
|
27
26
|
export type ConfirmButtonProps = ExtendedProps & ButtonProps;
|
|
28
27
|
/**
|
|
29
|
-
*
|
|
28
|
+
* A button that shows a confirmation dialog when clicked, allowing the user to confirm or cancel an action.
|
|
29
|
+
* It supports custom messages, labels, and loading states.
|
|
30
|
+
* This component is useful for actions that require user confirmation, such as deleting items or submitting forms.
|
|
31
|
+
* It uses the Floating UI library to manage the positioning of the confirmation dialog, ensuring it appears correctly relative to the button.
|
|
32
|
+
* It also supports custom placement of the dialog, and can display an action message when the action is completed.
|
|
33
|
+
*
|
|
34
|
+
* @param {ConfirmButtonProps} props - The properties for the ConfirmButton component.
|
|
35
|
+
* @returns {JSX.Element} The rendered ConfirmButton component.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```jsx
|
|
39
|
+
* <ConfirmButton
|
|
40
|
+
* message="Are you sure you want to delete this item?"
|
|
41
|
+
* onClick={(confirmed) => {
|
|
42
|
+
* if (confirmed) {
|
|
43
|
+
* // Perform action
|
|
44
|
+
* }
|
|
45
|
+
* }}
|
|
46
|
+
* />
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @see {@link https://adarshpastakia.github.io/react-fabric/?path=/docs/core-components-confirmbutton--docs} for more details.
|
|
30
50
|
*/
|
|
31
|
-
export declare const ConfirmButton: <Tag extends
|
|
51
|
+
export declare const ConfirmButton: <Tag extends React.ElementType = "button">({ ref, message, color, okLabel, cancelLabel, onClick, loading, placement, actionMessage, showActionDone, showActionDoneEvent, ...props }: ConfirmButtonProps & PolymorphicProps<Tag>) => import("react/jsx-runtime").JSX.Element;
|
|
32
52
|
export {};
|