@dynamic-framework/ui-react 1.7.3 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/dynamic-ui-non-root.css +17060 -0
- package/dist/css/dynamic-ui-non-root.min.css +1 -0
- package/dist/css/{dynamic-root.css → dynamic-ui-root.css} +5 -0
- package/dist/css/{dynamic-root.min.css → dynamic-ui-root.min.css} +1 -1
- package/dist/css/dynamic-ui.css +132 -60
- package/dist/css/dynamic-ui.min.css +1 -1
- package/dist/index.esm.js +414 -551
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +572 -725
- package/dist/index.js.map +1 -1
- package/dist/types/components/{DAlert.d.ts → DAlert/DAlert.d.ts} +3 -5
- package/dist/types/components/DAlert/index.d.ts +2 -0
- package/dist/types/components/{DBadge.d.ts → DBadge/DBadge.d.ts} +2 -4
- package/dist/types/components/DBadge/index.d.ts +2 -0
- package/dist/types/components/DBoxFile/DBoxFile.d.ts +9 -0
- package/dist/types/components/DBoxFile/index.d.ts +2 -0
- package/dist/types/components/{DButton.d.ts → DButton/DButton.d.ts} +3 -5
- package/dist/types/components/DButton/index.d.ts +2 -0
- package/dist/types/components/DCard/DCard.d.ts +13 -0
- package/dist/types/components/DCard/components/DCardBody.d.ts +5 -0
- package/dist/types/components/DCard/components/DCardFooter.d.ts +5 -0
- package/dist/types/components/DCard/components/DCardHeader.d.ts +5 -0
- package/dist/types/components/DCard/index.d.ts +5 -0
- package/dist/types/components/DCardAccount/DCardAccount.d.ts +13 -0
- package/dist/types/components/DCardAccount/index.d.ts +2 -0
- package/dist/types/components/DCarousel/DCarousel.d.ts +10 -0
- package/dist/types/components/DCarousel/index.d.ts +3 -0
- package/dist/types/components/DChip/DChip.d.ts +10 -0
- package/dist/types/components/DChip/index.d.ts +2 -0
- package/dist/types/components/DCollapse/DCollapse.d.ts +11 -0
- package/dist/types/components/DCollapse/index.d.ts +2 -0
- package/dist/types/components/{DCollapseIconText.d.ts → DCollapseIconText/DCollapseIconText.d.ts} +3 -3
- package/dist/types/components/DCollapseIconText/index.d.ts +2 -0
- package/dist/types/components/DCurrencyText/DCurrencyText.d.ts +7 -0
- package/dist/types/components/DCurrencyText/index.d.ts +2 -0
- package/dist/types/components/DDatePicker/DDatePicker.d.ts +21 -0
- package/dist/types/components/DDatePicker/index.d.ts +2 -0
- package/dist/types/components/{DDatePickerHeader.d.ts → DDatePickerHeader/DDatePickerHeader.d.ts} +5 -4
- package/dist/types/components/DDatePickerHeader/index.d.ts +2 -0
- package/dist/types/components/{DDatePickerInput.d.ts → DDatePickerInput/DDatePickerInput.d.ts} +3 -2
- package/dist/types/components/DDatePickerInput/index.d.ts +2 -0
- package/dist/types/components/DDatePickerTime/DDatePickerTime.d.ts +9 -0
- package/dist/types/components/DDatePickerTime/index.d.ts +2 -0
- package/dist/types/components/DIcon/DIcon.d.ts +16 -0
- package/dist/types/components/DIcon/index.d.ts +2 -0
- package/dist/types/components/DInput/DInput.d.ts +15 -0
- package/dist/types/components/DInput/index.d.ts +2 -0
- package/dist/types/components/{DInputCheck.d.ts → DInputCheck/DInputCheck.d.ts} +3 -3
- package/dist/types/components/DInputCheck/index.d.ts +2 -0
- package/dist/types/components/DInputCounter/DInputCounter.d.ts +20 -0
- package/dist/types/components/DInputCounter/index.d.ts +2 -0
- package/dist/types/components/DInputCurrency/DInputCurrency.d.ts +21 -0
- package/dist/types/components/DInputCurrency/index.d.ts +2 -0
- package/dist/types/components/DInputCurrencyBase/DInputCurrencyBase.d.ts +23 -0
- package/dist/types/components/DInputCurrencyBase/index.d.ts +2 -0
- package/dist/types/components/DInputPassword/DInputPassword.d.ts +5 -0
- package/dist/types/components/DInputPassword/index.d.ts +2 -0
- package/dist/types/components/{DInputPin.d.ts → DInputPin/DInputPin.d.ts} +3 -3
- package/dist/types/components/DInputPin/index.d.ts +2 -0
- package/dist/types/components/DInputSearch/DInputSearch.d.ts +17 -0
- package/dist/types/components/DInputSearch/index.d.ts +2 -0
- package/dist/types/components/{DInputSelect.d.ts → DInputSelect/DInputSelect.d.ts} +3 -4
- package/dist/types/components/DInputSelect/index.d.ts +3 -0
- package/dist/types/components/{DInputSwitch.d.ts → DInputSwitch/DInputSwitch.d.ts} +4 -3
- package/dist/types/components/DInputSwitch/index.d.ts +2 -0
- package/dist/types/components/DList/DList.d.ts +14 -0
- package/dist/types/components/DList/components/DListItem.d.ts +10 -0
- package/dist/types/components/DList/index.d.ts +3 -0
- package/dist/types/components/DListItemMovement/DListItemMovement.d.ts +10 -0
- package/dist/types/components/DListItemMovement/index.d.ts +2 -0
- package/dist/types/components/DModal/DModal.d.ts +21 -0
- package/dist/types/components/DModal/components/DModalBody.d.ts +7 -0
- package/dist/types/components/DModal/components/DModalFooter.d.ts +7 -0
- package/dist/types/components/{DModalHeader.d.ts → DModal/components/DModalHeader.d.ts} +3 -2
- package/dist/types/components/DModal/index.d.ts +5 -0
- package/dist/types/components/DMonthPicker/DMonthPicker.d.ts +9 -0
- package/dist/types/components/DMonthPicker/index.d.ts +2 -0
- package/dist/types/components/DOffcanvas/DOffcanvas.d.ts +18 -0
- package/dist/types/components/DOffcanvas/components/DOffcanvasBody.d.ts +7 -0
- package/dist/types/components/{DOffcanvasFooter.d.ts → DOffcanvas/components/DOffcanvasFooter.d.ts} +3 -2
- package/dist/types/components/{DOffcanvasHeader.d.ts → DOffcanvas/components/DOffcanvasHeader.d.ts} +3 -2
- package/dist/types/components/DOffcanvas/index.d.ts +5 -0
- package/dist/types/components/DPaginator/index.d.ts +2 -0
- package/dist/types/components/{DPopover.d.ts → DPopover/DPopover.d.ts} +3 -2
- package/dist/types/components/DPopover/index.d.ts +2 -0
- package/dist/types/components/DProgress/DProgress.d.ts +10 -0
- package/dist/types/components/DProgress/index.d.ts +2 -0
- package/dist/types/components/{DQuickActionButton.d.ts → DQuickActionButton/DQuickActionButton.d.ts} +2 -4
- package/dist/types/components/DQuickActionButton/index.d.ts +2 -0
- package/dist/types/components/{DQuickActionCheck.d.ts → DQuickActionCheck/DQuickActionCheck.d.ts} +3 -3
- package/dist/types/components/DQuickActionCheck/index.d.ts +2 -0
- package/dist/types/components/{DQuickActionSelect.d.ts → DQuickActionSelect/DQuickActionSelect.d.ts} +3 -3
- package/dist/types/components/DQuickActionSelect/index.d.ts +2 -0
- package/dist/types/components/{DQuickActionSwitch.d.ts → DQuickActionSwitch/DQuickActionSwitch.d.ts} +3 -3
- package/dist/types/components/DQuickActionSwitch/index.d.ts +2 -0
- package/dist/types/components/DSkeleton/index.d.ts +2 -0
- package/dist/types/components/{DStepper.d.ts → DStepper/DStepper.d.ts} +3 -3
- package/dist/types/components/DStepper/index.d.ts +2 -0
- package/dist/types/components/{DStepperDesktop.d.ts → DStepperDesktop/DStepperDesktop.d.ts} +3 -2
- package/dist/types/components/DStepperDesktop/index.d.ts +2 -0
- package/dist/types/components/DStepperMobile/DStepperMobile.d.ts +12 -0
- package/dist/types/components/DStepperMobile/index.d.ts +2 -0
- package/dist/types/components/DTabs/DTabs.d.ts +19 -0
- package/dist/types/components/DTabs/TabContext.d.ts +8 -0
- package/dist/types/components/DTabs/components/DTabContent.d.ts +7 -0
- package/dist/types/components/DTabs/index.d.ts +5 -0
- package/dist/types/components/{DToastContainer.d.ts → DToastContainer/DToastContainer.d.ts} +3 -2
- package/dist/types/components/DToastContainer/index.d.ts +3 -0
- package/dist/types/{hooks → components/DToastContainer}/useToast.d.ts +1 -1
- package/dist/types/components/{DTooltip.d.ts → DTooltip/DTooltip.d.ts} +3 -4
- package/dist/types/components/DTooltip/index.d.ts +2 -0
- package/dist/types/components/index.d.ts +11 -26
- package/dist/types/components/interface.d.ts +9 -4
- package/dist/types/contexts/DContext.d.ts +13 -0
- package/dist/types/contexts/index.d.ts +1 -1
- package/dist/types/hooks/index.d.ts +3 -4
- package/dist/types/hooks/useInputCurrency.d.ts +16 -0
- package/dist/types/hooks/useProvidedRefOrCreate.d.ts +16 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/polymorphic.d.ts +37 -0
- package/dist/types/utils/index.d.ts +0 -1
- package/package.json +48 -55
- package/src/style/abstracts/variables/_buttons.scss +1 -1
- package/src/style/abstracts/variables/_forms.scss +4 -4
- package/src/style/abstracts/variables/_toasts.scss +1 -1
- package/src/style/abstracts/variables/_typography.scss +1 -1
- package/src/style/base/_+import.scss +0 -3
- package/src/style/components/_d-input.scss +10 -5
- package/src/style/components/_d-monthpicker.scss +8 -0
- package/src/style/dynamic-ui-non-root.scss +13 -0
- package/src/style/dynamic-ui-root.scss +5 -0
- package/src/style/dynamic-ui.scss +2 -0
- package/src/style/root/_+import.scss +2 -0
- package/src/style/{base → root}/_root.scss +6 -0
- package/dist/types/components/DBoxFile.d.ts +0 -9
- package/dist/types/components/DCard.d.ts +0 -7
- package/dist/types/components/DCardAccount.d.ts +0 -13
- package/dist/types/components/DCardBody.d.ts +0 -6
- package/dist/types/components/DCardFooter.d.ts +0 -6
- package/dist/types/components/DCardHeader.d.ts +0 -6
- package/dist/types/components/DCarousel.d.ts +0 -7
- package/dist/types/components/DChip.d.ts +0 -10
- package/dist/types/components/DCollapse.d.ts +0 -11
- package/dist/types/components/DCurrencyText.d.ts +0 -6
- package/dist/types/components/DDatePicker.d.ts +0 -20
- package/dist/types/components/DDatePickerTime.d.ts +0 -8
- package/dist/types/components/DFormikInput.d.ts +0 -7
- package/dist/types/components/DFormikInputCurrency.d.ts +0 -7
- package/dist/types/components/DFormikInputSelect.d.ts +0 -6
- package/dist/types/components/DIcon.d.ts +0 -16
- package/dist/types/components/DInput.d.ts +0 -32
- package/dist/types/components/DInputCounter.d.ts +0 -22
- package/dist/types/components/DInputCurrency.d.ts +0 -5
- package/dist/types/components/DInputCurrencyBase.d.ts +0 -25
- package/dist/types/components/DInputPassword.d.ts +0 -17
- package/dist/types/components/DInputSearch.d.ts +0 -19
- package/dist/types/components/DList.d.ts +0 -11
- package/dist/types/components/DListItem.d.ts +0 -10
- package/dist/types/components/DListItemMovement.d.ts +0 -10
- package/dist/types/components/DModal.d.ts +0 -14
- package/dist/types/components/DModalBody.d.ts +0 -6
- package/dist/types/components/DModalFooter.d.ts +0 -6
- package/dist/types/components/DMonthPicker.d.ts +0 -7
- package/dist/types/components/DOffcanvas.d.ts +0 -11
- package/dist/types/components/DOffcanvasBody.d.ts +0 -6
- package/dist/types/components/DProgress.d.ts +0 -9
- package/dist/types/components/DStepperMobile.d.ts +0 -11
- package/dist/types/components/DTabContent.d.ts +0 -6
- package/dist/types/components/DTabs.d.ts +0 -19
- package/dist/types/contexts/LiquidContext.d.ts +0 -14
- package/dist/types/hooks/useScreenshot.d.ts +0 -5
- package/dist/types/hooks/useScreenshotDownload.d.ts +0 -5
- package/dist/types/hooks/useScreenshotWebShare.d.ts +0 -5
- package/dist/types/stories/components/DBadge.stories.d.ts +0 -8
- package/dist/types/stories/components/DBoxFile.stories.d.ts +0 -6
- package/dist/types/stories/components/DButton.stories.d.ts +0 -35
- package/dist/types/stories/components/DChip.stories.d.ts +0 -9
- package/dist/types/stories/components/DCurrencyText.stories.d.ts +0 -6
- package/dist/types/stories/components/DDatePicker.stories.d.ts +0 -14
- package/dist/types/stories/components/DFormikInput.stories.d.ts +0 -7
- package/dist/types/stories/components/DFormikInputCurrency.stories.d.ts +0 -8
- package/dist/types/stories/components/DFormikInputSelect.stories.d.ts +0 -7
- package/dist/types/stories/components/DIcon.stories.d.ts +0 -7
- package/dist/types/stories/components/DInput.stories.d.ts +0 -11
- package/dist/types/stories/components/DInputCheck.stories.d.ts +0 -13
- package/dist/types/stories/components/DInputCounter.stories.d.ts +0 -9
- package/dist/types/stories/components/DInputCurrency.stories.d.ts +0 -11
- package/dist/types/stories/components/DInputCurrencyBase.stories.d.ts +0 -11
- package/dist/types/stories/components/DInputPassword.stories.d.ts +0 -10
- package/dist/types/stories/components/DInputPin.stories.d.ts +0 -10
- package/dist/types/stories/components/DInputSearch.stories.d.ts +0 -10
- package/dist/types/stories/components/DInputSelect.stories.d.ts +0 -14
- package/dist/types/stories/components/DInputSwitch.stories.d.ts +0 -11
- package/dist/types/stories/components/DList.stories.d.ts +0 -10
- package/dist/types/stories/components/DListItem.stories.d.ts +0 -9
- package/dist/types/stories/components/DListItemMovement.stories.d.ts +0 -7
- package/dist/types/stories/components/DPaginator.stories.d.ts +0 -10
- package/dist/types/stories/components/DProgress.stories.d.ts +0 -12
- package/dist/types/stories/components/DQuickActionButton.stories.d.ts +0 -10
- package/dist/types/stories/components/DQuickActionCheck.stories.d.ts +0 -8
- package/dist/types/stories/components/DQuickActionSelect.stories.d.ts +0 -8
- package/dist/types/stories/components/DQuickActionSwitch.stories.d.ts +0 -9
- package/dist/types/stories/components/DSkeleton.stories.d.ts +0 -6
- package/dist/types/stories/components/DStepper.stories.d.ts +0 -7
- package/dist/types/stories/components/DStepperDesktop.stories.d.ts +0 -7
- package/dist/types/stories/components/DStepperMobile.stories.d.ts +0 -6
- package/dist/types/stories/components/DTooltip.stories.d.ts +0 -18
- package/dist/types/stories/config/constants.d.ts +0 -7
- package/dist/types/stories/config/liquidConfig.d.ts +0 -1
- package/dist/types/stories/hooks/useFormatCurrency.stories.d.ts +0 -6
- package/dist/types/stories/hooks/useModalContext.stories.d.ts +0 -6
- package/dist/types/stories/hooks/useOffcanvasContext.stories.d.ts +0 -7
- package/dist/types/stories/hooks/useToast.stories.d.ts +0 -17
- package/dist/types/stories/patterns/DAlert.stories.d.ts +0 -24
- package/dist/types/stories/patterns/DCard.stories.d.ts +0 -10
- package/dist/types/stories/patterns/DCardAccount.stories.d.ts +0 -6
- package/dist/types/stories/patterns/DCarousel.stories.d.ts +0 -9
- package/dist/types/stories/patterns/DCollapse.stories.d.ts +0 -8
- package/dist/types/stories/patterns/DCollapseIconText.stories.d.ts +0 -6
- package/dist/types/stories/patterns/DModal.stories.d.ts +0 -12
- package/dist/types/stories/patterns/DOffcanvas.stories.d.ts +0 -12
- package/dist/types/stories/patterns/DPopover.stories.d.ts +0 -9
- package/dist/types/stories/patterns/DTabs.stories.d.ts +0 -7
- package/dist/types/utils/liquid-parser.d.ts +0 -20
- package/src/style/dynamic-root.scss +0 -6
- /package/dist/types/components/{DCarouselSlide.d.ts → DCarousel/components/DCarouselSlide.d.ts} +0 -0
- /package/dist/types/components/{DPaginator.d.ts → DPaginator/DPaginator.d.ts} +0 -0
- /package/dist/types/components/{DSkeleton.d.ts → DSkeleton/DSkeleton.d.ts} +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
import DModalHeader from './components/DModalHeader';
|
|
3
|
+
import DModalBody from './components/DModalBody';
|
|
4
|
+
import DModalFooter from './components/DModalFooter';
|
|
5
|
+
import type { BaseProps, ModalFullScreenFrom, ModalSize } from '../interface';
|
|
6
|
+
type Props = BaseProps & PropsWithChildren<{
|
|
7
|
+
name: string;
|
|
8
|
+
isStatic?: boolean;
|
|
9
|
+
isScrollable?: boolean;
|
|
10
|
+
isCentered?: boolean;
|
|
11
|
+
isFullScreen?: boolean;
|
|
12
|
+
fullScreenFrom?: ModalFullScreenFrom;
|
|
13
|
+
modalSize?: ModalSize;
|
|
14
|
+
}>;
|
|
15
|
+
declare function DModal({ name, className, style, isStatic, isScrollable, isCentered, isFullScreen, fullScreenFrom, modalSize, children, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare const _default: typeof DModal & {
|
|
17
|
+
Header: typeof DModalHeader;
|
|
18
|
+
Body: typeof DModalBody;
|
|
19
|
+
Footer: typeof DModalFooter;
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BaseProps } from '../../interface';
|
|
3
|
+
type Props = BaseProps & {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export default function DModalBody({ children, className, style, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
import type { BaseProps } from '../../interface';
|
|
3
|
+
type Props = BaseProps & PropsWithChildren<{
|
|
4
|
+
actionPlacement?: 'start' | 'end' | 'fill' | 'center';
|
|
5
|
+
}>;
|
|
6
|
+
export default function DModalFooter({ className, style, actionPlacement, children, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react';
|
|
2
|
-
type
|
|
2
|
+
import type { BaseProps } from '../../interface';
|
|
3
|
+
type Props = BaseProps & PropsWithChildren<{
|
|
3
4
|
showCloseButton?: boolean;
|
|
4
5
|
onClose?: () => void;
|
|
5
6
|
}>;
|
|
6
|
-
export default function DModalHeader({ showCloseButton, onClose, children, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default function DModalHeader({ showCloseButton, onClose, children, className, style, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactDatePickerProps } from 'react-datepicker';
|
|
2
|
+
import type { BaseProps } from '../interface';
|
|
3
|
+
type Props = BaseProps & Omit<ReactDatePickerProps, 'onChange' | 'selectsRange' | 'locale'> & {
|
|
4
|
+
date: string;
|
|
5
|
+
onChangeDate: (value: Date | null) => void;
|
|
6
|
+
locale?: Locale;
|
|
7
|
+
};
|
|
8
|
+
export default function DMonthPicker({ onChangeDate, date, locale, className, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
import DOffcanvasHeader from './components/DOffcanvasHeader';
|
|
3
|
+
import DOffcanvasBody from './components/DOffcanvasBody';
|
|
4
|
+
import DOffcanvasFooter from './components/DOffcanvasFooter';
|
|
5
|
+
import type { BaseProps, OffcanvasPositionToggleFrom } from '../interface';
|
|
6
|
+
type Props = BaseProps & PropsWithChildren<{
|
|
7
|
+
name: string;
|
|
8
|
+
isStatic?: boolean;
|
|
9
|
+
isScrollable?: boolean;
|
|
10
|
+
openFrom?: OffcanvasPositionToggleFrom;
|
|
11
|
+
}>;
|
|
12
|
+
declare function DOffcanvas({ name, className, style, isStatic, isScrollable, openFrom, children, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare const _default: typeof DOffcanvas & {
|
|
14
|
+
Header: typeof DOffcanvasHeader;
|
|
15
|
+
Body: typeof DOffcanvasBody;
|
|
16
|
+
Footer: typeof DOffcanvasFooter;
|
|
17
|
+
};
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BaseProps } from '../../interface';
|
|
3
|
+
type Props = BaseProps & {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export default function DOffcanvasBody({ children, className, style, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
package/dist/types/components/{DOffcanvasFooter.d.ts → DOffcanvas/components/DOffcanvasFooter.d.ts}
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react';
|
|
2
|
-
type
|
|
2
|
+
import type { BaseProps } from '../../interface';
|
|
3
|
+
type Props = BaseProps & PropsWithChildren<{
|
|
3
4
|
footerActionPlacement?: 'start' | 'end' | 'fill';
|
|
4
5
|
}>;
|
|
5
|
-
export default function DOffcanvasFooter({ footerActionPlacement, children, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default function DOffcanvasFooter({ footerActionPlacement, children, className, style, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
export {};
|
package/dist/types/components/{DOffcanvasHeader.d.ts → DOffcanvas/components/DOffcanvasHeader.d.ts}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react';
|
|
2
|
-
type
|
|
2
|
+
import type { BaseProps } from '../../interface';
|
|
3
|
+
type Props = BaseProps & PropsWithChildren<{
|
|
3
4
|
showCloseButton?: boolean;
|
|
4
5
|
onClose?: () => void;
|
|
5
6
|
}>;
|
|
6
|
-
export default function DOffcanvasHeader({ showCloseButton, onClose, children, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default function DOffcanvasHeader({ showCloseButton, onClose, children, className, style, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import DOffcanvas from './DOffcanvas';
|
|
2
|
+
export { default as DOffcanvasHeader } from './components/DOffcanvasHeader';
|
|
3
|
+
export { default as DOffcanvasBody } from './components/DOffcanvasBody';
|
|
4
|
+
export { default as DOffcanvasFooter } from './components/DOffcanvasFooter';
|
|
5
|
+
export default DOffcanvas;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
-
type
|
|
2
|
+
import type { BaseProps } from '../interface';
|
|
3
|
+
type Props = BaseProps & PropsWithChildren<{
|
|
3
4
|
renderComponent: (isOpen: boolean) => ReactElement;
|
|
4
5
|
isOpen: boolean;
|
|
5
6
|
setEventIsOpen?: (isOpen: boolean) => void;
|
|
6
7
|
adjustContentToRender?: boolean;
|
|
7
8
|
}>;
|
|
8
|
-
export default function DPopover({ children, renderComponent, isOpen, setEventIsOpen, adjustContentToRender, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default function DPopover({ children, renderComponent, isOpen, setEventIsOpen, adjustContentToRender, className, style, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BaseProps } from '../interface';
|
|
2
|
+
type Props = BaseProps & {
|
|
3
|
+
currentValue: number;
|
|
4
|
+
minValue?: number;
|
|
5
|
+
maxValue?: number;
|
|
6
|
+
hideCurrentValue?: boolean;
|
|
7
|
+
enableStripedAnimation?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export default function DProgress({ className, style, currentValue, minValue, maxValue, hideCurrentValue, enableStripedAnimation, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
package/dist/types/components/{DQuickActionButton.d.ts → DQuickActionButton/DQuickActionButton.d.ts}
RENAMED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
type Props = {
|
|
1
|
+
import type { BaseProps } from '../interface';
|
|
2
|
+
type Props = BaseProps & {
|
|
3
3
|
line1: string;
|
|
4
4
|
line2: string;
|
|
5
|
-
className?: string;
|
|
6
5
|
actionLinkText?: string;
|
|
7
6
|
actionLinkTheme?: string;
|
|
8
7
|
actionIcon?: string;
|
|
@@ -17,7 +16,6 @@ type Props = {
|
|
|
17
16
|
representativeIconFamilyPrefix?: string;
|
|
18
17
|
onClick?: () => void;
|
|
19
18
|
onClickSecondary?: () => void;
|
|
20
|
-
style?: CSSProperties;
|
|
21
19
|
};
|
|
22
20
|
export default function DQuickActionButton({ line1, line2, className, actionLinkText, actionLinkTheme, actionIcon, secondaryActionIcon, actionIconFamilyClass, actionIconFamilyPrefix, representativeImage, representativeIcon, representativeIconTheme, representativeIconHasCircle, representativeIconFamilyClass, representativeIconFamilyPrefix, onClick, onClickSecondary, style, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
23
21
|
export {};
|
package/dist/types/components/{DQuickActionCheck.d.ts → DQuickActionCheck/DQuickActionCheck.d.ts}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { ChangeEvent } from 'react';
|
|
2
|
-
type
|
|
2
|
+
import type { BaseProps } from '../interface';
|
|
3
|
+
type Props = BaseProps & {
|
|
3
4
|
id: string;
|
|
4
5
|
name: string;
|
|
5
6
|
value: string;
|
|
6
7
|
line1: string;
|
|
7
8
|
line2: string;
|
|
8
9
|
line3: string;
|
|
9
|
-
className?: string;
|
|
10
10
|
isChecked?: boolean;
|
|
11
11
|
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
12
12
|
};
|
|
13
|
-
export default function DQuickActionCheck({ id, name, value, line1, line2, line3, className, isChecked, onChange, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default function DQuickActionCheck({ id, name, value, line1, line2, line3, className, style, isChecked, onChange, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export {};
|
package/dist/types/components/{DQuickActionSelect.d.ts → DQuickActionSelect/DQuickActionSelect.d.ts}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { ChangeEvent } from 'react';
|
|
2
|
-
type
|
|
2
|
+
import type { BaseProps } from '../interface';
|
|
3
|
+
type Props = BaseProps & {
|
|
3
4
|
id: string;
|
|
4
5
|
name: string;
|
|
5
6
|
value: string;
|
|
6
7
|
line1: string;
|
|
7
8
|
line2: string;
|
|
8
|
-
className?: string;
|
|
9
9
|
isSelected?: boolean;
|
|
10
10
|
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
11
11
|
};
|
|
12
|
-
export default function DQuickActionSelect({ id, name, value, line1, line2, className, isSelected, onChange, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default function DQuickActionSelect({ id, name, value, line1, line2, className, style, isSelected, onChange, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export {};
|
package/dist/types/components/{DQuickActionSwitch.d.ts → DQuickActionSwitch/DQuickActionSwitch.d.ts}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
type
|
|
1
|
+
import type { BaseProps } from '../interface';
|
|
2
|
+
type Props = BaseProps & {
|
|
2
3
|
id: string;
|
|
3
4
|
name?: string;
|
|
4
5
|
label: string;
|
|
5
6
|
hint: string;
|
|
6
|
-
className?: string;
|
|
7
7
|
isChecked?: boolean;
|
|
8
8
|
isDisabled?: boolean;
|
|
9
9
|
onClick?: (isChecked: boolean | undefined) => void;
|
|
10
10
|
};
|
|
11
|
-
export default function DQuickActionSwitch({ id, name, label, hint,
|
|
11
|
+
export default function DQuickActionSwitch({ id, name, label, hint, isChecked, isDisabled, className, style, onClick, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { BreakpointSize } from '
|
|
1
|
+
import type { BaseProps, BreakpointSize } from '../interface';
|
|
2
2
|
export type Step = {
|
|
3
3
|
label: string;
|
|
4
4
|
value: number;
|
|
5
5
|
description?: string;
|
|
6
6
|
};
|
|
7
|
-
type Props = {
|
|
7
|
+
type Props = BaseProps & {
|
|
8
8
|
options: Array<Step>;
|
|
9
9
|
currentStep: number;
|
|
10
10
|
successIcon?: string;
|
|
11
11
|
isVertical?: boolean;
|
|
12
12
|
breakpoint?: BreakpointSize;
|
|
13
13
|
};
|
|
14
|
-
export default function DStepper({ options, currentStep, successIcon, isVertical, breakpoint, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default function DStepper({ options, currentStep, successIcon, isVertical, breakpoint, className, style, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import type { BaseProps } from '../interface';
|
|
1
2
|
type Step = {
|
|
2
3
|
label: string;
|
|
3
4
|
value: number;
|
|
4
5
|
};
|
|
5
|
-
type Props = {
|
|
6
|
+
type Props = BaseProps & {
|
|
6
7
|
options: Array<Step>;
|
|
7
8
|
currentStep: number;
|
|
8
9
|
successIcon?: string;
|
|
9
10
|
isVertical?: boolean;
|
|
10
11
|
};
|
|
11
|
-
export default function DStepper({ options, currentStep, successIcon, isVertical, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default function DStepper({ options, currentStep, successIcon, isVertical, className, style, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BaseProps } from '../interface';
|
|
2
|
+
type Step = {
|
|
3
|
+
label: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
value: number;
|
|
6
|
+
};
|
|
7
|
+
type Props = BaseProps & {
|
|
8
|
+
options: Array<Step>;
|
|
9
|
+
currentStep: number;
|
|
10
|
+
};
|
|
11
|
+
export default function DStepper({ options, currentStep, className, style, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
import DTabContent from './components/DTabContent';
|
|
3
|
+
import type { BaseProps } from '../interface';
|
|
4
|
+
export type DTabOption = {
|
|
5
|
+
label: string;
|
|
6
|
+
tab: string;
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
type Props = BaseProps & PropsWithChildren<{
|
|
10
|
+
onChange: (option: DTabOption) => void;
|
|
11
|
+
options: Array<DTabOption>;
|
|
12
|
+
defaultSelected: string;
|
|
13
|
+
isVertical?: boolean;
|
|
14
|
+
}>;
|
|
15
|
+
declare function DTabs({ children, defaultSelected, onChange, options, className, style, isVertical, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare const _default: typeof DTabs & {
|
|
17
|
+
Tab: typeof DTabContent;
|
|
18
|
+
};
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { DTabOption } from './DTabs';
|
|
3
|
+
type TabContextState = {
|
|
4
|
+
isSelected: (tab: DTabOption['tab']) => boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const TabContext: import("react").Context<TabContextState | undefined>;
|
|
7
|
+
export declare function useTabContext(): TabContextState;
|
|
8
|
+
export default TabContext;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
import type { BaseProps } from '../../interface';
|
|
3
|
+
type Props = BaseProps & PropsWithChildren<{
|
|
4
|
+
tab: string;
|
|
5
|
+
}>;
|
|
6
|
+
export default function DTabContent({ tab, children, className, style, }: Props): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export {};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
2
|
import type { ToastPosition } from 'react-toastify';
|
|
3
|
-
type
|
|
3
|
+
import type { BaseProps } from '../interface';
|
|
4
|
+
type Props = BaseProps & {
|
|
4
5
|
style?: CSSProperties & {
|
|
5
6
|
'--toastify-toast-width': any;
|
|
6
7
|
[index: string]: any;
|
|
7
8
|
};
|
|
8
9
|
position?: ToastPosition;
|
|
9
10
|
};
|
|
10
|
-
export default function DToastContainer({ style, position, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default function DToastContainer({ style, position, className, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { PropsWithChildren, ReactNode } from 'react';
|
|
2
2
|
import type { Placement } from '@floating-ui/react';
|
|
3
|
-
import type { ComponentSize } from '
|
|
4
|
-
export type Props = PropsWithChildren<{
|
|
3
|
+
import type { BaseProps, ComponentSize } from '../interface';
|
|
4
|
+
export type Props = BaseProps & PropsWithChildren<{
|
|
5
5
|
classNameContainer?: string;
|
|
6
|
-
className?: string;
|
|
7
6
|
offSet?: number;
|
|
8
7
|
padding?: number;
|
|
9
8
|
withHover?: boolean;
|
|
@@ -14,4 +13,4 @@ export type Props = PropsWithChildren<{
|
|
|
14
13
|
placement?: Placement;
|
|
15
14
|
Component: ReactNode;
|
|
16
15
|
}>;
|
|
17
|
-
export default function DTooltip({ classNameContainer, className, offSet, padding, withFocus, withClick, withHover, isOpen, placement, size, Component, children, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default function DTooltip({ classNameContainer, className, style, offSet, padding, withFocus, withClick, withHover, isOpen, placement, size, Component, children, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,43 +3,29 @@ export { default as DAlert } from './DAlert';
|
|
|
3
3
|
export { default as DBadge } from './DBadge';
|
|
4
4
|
export { default as DBoxFile } from './DBoxFile';
|
|
5
5
|
export { default as DButton } from './DButton';
|
|
6
|
-
export { default as DCard } from './DCard';
|
|
7
|
-
export { default as DCardBody } from './DCardBody';
|
|
8
|
-
export { default as DCardFooter } from './DCardFooter';
|
|
9
|
-
export { default as DCardHeader } from './DCardHeader';
|
|
6
|
+
export { default as DCard, DCardHeader, DCardBody, DCardFooter, } from './DCard';
|
|
10
7
|
export { default as DCardAccount } from './DCardAccount';
|
|
11
|
-
export { default as DCarousel } from './DCarousel';
|
|
12
|
-
export { default as DCarouselSlide } from './DCarouselSlide';
|
|
8
|
+
export { default as DCarousel, DCarouselSlide, } from './DCarousel';
|
|
13
9
|
export { default as DChip } from './DChip';
|
|
14
10
|
export { default as DCollapse } from './DCollapse';
|
|
15
11
|
export { default as DCollapseIconText } from './DCollapseIconText';
|
|
16
12
|
export { default as DCurrencyText } from './DCurrencyText';
|
|
17
13
|
export { default as DDatePicker } from './DDatePicker';
|
|
18
|
-
export { default as DFormikInput } from './DFormikInput';
|
|
19
|
-
export { default as DFormikInputCurrency } from './DFormikInputCurrency';
|
|
20
|
-
export { default as DFormikInputSelect } from './DFormikInputSelect';
|
|
21
14
|
export { default as DIcon } from './DIcon';
|
|
22
15
|
export { default as DInput } from './DInput';
|
|
23
|
-
export { default as DInputCheck } from './DInputCheck';
|
|
24
16
|
export { default as DInputCounter } from './DInputCounter';
|
|
25
|
-
export { default as DInputCurrency } from './DInputCurrency';
|
|
26
17
|
export { default as DInputCurrencyBase } from './DInputCurrencyBase';
|
|
18
|
+
export { default as DInputCurrency } from './DInputCurrency';
|
|
19
|
+
export { default as DInputSearch } from './DInputSearch';
|
|
27
20
|
export { default as DInputPassword } from './DInputPassword';
|
|
21
|
+
export { default as DInputCheck } from './DInputCheck';
|
|
28
22
|
export { default as DInputPin } from './DInputPin';
|
|
29
|
-
export { default as
|
|
30
|
-
export { default as DInputSelect, Props as DInputSelectProps } from './DInputSelect';
|
|
23
|
+
export { default as DInputSelect, DInputSelectProps } from './DInputSelect';
|
|
31
24
|
export { default as DInputSwitch } from './DInputSwitch';
|
|
32
|
-
export { default as DList } from './DList';
|
|
33
|
-
export { default as DListItem } from './DListItem';
|
|
25
|
+
export { default as DList, DListItem, } from './DList';
|
|
34
26
|
export { default as DListItemMovement } from './DListItemMovement';
|
|
35
|
-
export { default as DModal } from './DModal';
|
|
36
|
-
export { default as
|
|
37
|
-
export { default as DModalFooter } from './DModalFooter';
|
|
38
|
-
export { default as DModalHeader } from './DModalHeader';
|
|
39
|
-
export { default as DOffcanvas } from './DOffcanvas';
|
|
40
|
-
export { default as DOffcanvasBody } from './DOffcanvasBody';
|
|
41
|
-
export { default as DOffcanvasFooter } from './DOffcanvasFooter';
|
|
42
|
-
export { default as DOffcanvasHeader } from './DOffcanvasHeader';
|
|
27
|
+
export { default as DModal, DModalHeader, DModalBody, DModalFooter, } from './DModal';
|
|
28
|
+
export { default as DOffcanvas, DOffcanvasHeader, DOffcanvasBody, DOffcanvasFooter, } from './DOffcanvas';
|
|
43
29
|
export { default as DPaginator } from './DPaginator';
|
|
44
30
|
export { default as DPopover } from './DPopover';
|
|
45
31
|
export { default as DProgress } from './DProgress';
|
|
@@ -51,7 +37,6 @@ export { default as DSkeleton } from './DSkeleton';
|
|
|
51
37
|
export { default as DStepper } from './DStepper';
|
|
52
38
|
export { default as DStepperDesktop } from './DStepperDesktop';
|
|
53
39
|
export { default as DStepperMobile } from './DStepperMobile';
|
|
54
|
-
export { default as DTabContent } from './DTabContent';
|
|
55
40
|
export { default as DTooltip } from './DTooltip';
|
|
56
|
-
export { default as DTabs, useTabContext, DTabOption } from './DTabs';
|
|
57
|
-
export { default as DToastContainer } from './DToastContainer';
|
|
41
|
+
export { default as DTabs, useTabContext, DTabOption, DTabContent, } from './DTabs';
|
|
42
|
+
export { default as DToastContainer, useToast, } from './DToastContainer';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
1
2
|
export type ClassMap = {
|
|
2
3
|
[className: string]: boolean;
|
|
3
4
|
};
|
|
@@ -11,21 +12,25 @@ export type NavegableProps = {
|
|
|
11
12
|
};
|
|
12
13
|
export type ComponentSize = 'sm' | 'lg';
|
|
13
14
|
export type BreakpointSize = 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
14
|
-
export type
|
|
15
|
+
export type BaseProps = {
|
|
16
|
+
style?: CSSProperties;
|
|
17
|
+
className?: string;
|
|
18
|
+
};
|
|
19
|
+
export type FamilyIconProps = {
|
|
15
20
|
iconFamilyClass?: string;
|
|
16
21
|
iconFamilyPrefix?: string;
|
|
17
22
|
};
|
|
18
|
-
export type
|
|
23
|
+
export type LabelIconProps = {
|
|
19
24
|
labelIcon?: string;
|
|
20
25
|
labelIconFamilyClass?: string;
|
|
21
26
|
labelIconFamilyPrefix?: string;
|
|
22
27
|
};
|
|
23
|
-
export type
|
|
28
|
+
export type StartIconProps = {
|
|
24
29
|
iconStart?: string;
|
|
25
30
|
iconStartFamilyClass?: string;
|
|
26
31
|
iconStartFamilyPrefix?: string;
|
|
27
32
|
};
|
|
28
|
-
export type
|
|
33
|
+
export type EndIconProps = {
|
|
29
34
|
iconEnd?: string;
|
|
30
35
|
iconEndFamilyClass?: string;
|
|
31
36
|
iconEndFamilyPrefix?: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
export type Props = {
|
|
3
|
+
language?: string;
|
|
4
|
+
currency?: {
|
|
5
|
+
symbol: string;
|
|
6
|
+
precision: number;
|
|
7
|
+
separator: string;
|
|
8
|
+
decimal: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare const DContext: import("react").Context<Required<Props>>;
|
|
12
|
+
export declare function DContextProvider({ language, currency, children, }: PropsWithChildren<Props>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function useDContext(): Required<Props>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { default as useFormatCurrency } from './useFormatCurrency';
|
|
2
|
-
export { default as
|
|
3
|
-
export { default as
|
|
4
|
-
export { default as
|
|
5
|
-
export { default as useScreenshotWebShare } from './useScreenshotWebShare';
|
|
2
|
+
export { default as useInputCurrency } from './useInputCurrency';
|
|
3
|
+
export { default as useProvidedRefOrCreate } from './useProvidedRefOrCreate';
|
|
4
|
+
export { default as useStackState } from './useStackState';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { RefObject, ForwardedRef, FocusEvent, WheelEvent } from 'react';
|
|
2
|
+
import type { Options } from 'currency.js';
|
|
3
|
+
import type { CustomStyles } from '../components/interface';
|
|
4
|
+
export default function useInputCurrency(currencyOptions: Options, value?: number, onFocus?: (event: FocusEvent<HTMLInputElement>) => void, onChange?: (value?: number) => void, onBlur?: (event: FocusEvent<HTMLInputElement>) => void, ref?: ForwardedRef<HTMLInputElement>): {
|
|
5
|
+
inputRef: RefObject<HTMLInputElement>;
|
|
6
|
+
innerValue: string | undefined;
|
|
7
|
+
innerType: string;
|
|
8
|
+
handleOnFocus: (event: FocusEvent<HTMLInputElement>) => void;
|
|
9
|
+
handleOnChange: (newValue?: string) => void;
|
|
10
|
+
handleOnBlur: (event: FocusEvent<HTMLInputElement>) => void;
|
|
11
|
+
handleOnWheel: (event: WheelEvent<HTMLInputElement>) => void;
|
|
12
|
+
generateStyleVariables: CustomStyles;
|
|
13
|
+
generateSymbolStyleVariables: {
|
|
14
|
+
color: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is originally from `@primer/react`
|
|
3
|
+
* The original source for this lived in the URL below.
|
|
4
|
+
*
|
|
5
|
+
* @see https://github.com/primer/react/blob/216d2a9f57b8acb0701ab4e04a23e057fc325c90/src/hooks/useProvidedRefOrCreate.ts
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
/**
|
|
9
|
+
* There are some situations where we only want to create a new ref if one is not provided to a component
|
|
10
|
+
* or hook as a prop. However, due to the `rules-of-hooks`, we cannot conditionally make a call to `React.useRef`
|
|
11
|
+
* only in the situations where the ref is not provided as a prop.
|
|
12
|
+
* This hook aims to encapsulate that logic, so the consumer doesn't need to be concerned with violating `rules-of-hooks`.
|
|
13
|
+
* @param providedRef The ref to use - if undefined, will use the ref from a call to React.useRef
|
|
14
|
+
* @type TRef The type of the RefObject which should be created.
|
|
15
|
+
*/
|
|
16
|
+
export default function useProvidedRefOrCreate<TRef>(providedRef?: React.RefObject<TRef>): React.RefObject<TRef>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './polymorphic';
|