@kubit-ui-web/react-components 1.11.0 → 1.12.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/cjs/components/actionBottomSheet/actionBottomSheet.styled.js +7 -1
- package/dist/cjs/components/actionBottomSheet/actionBottomSheet.styled.js.map +1 -1
- package/dist/cjs/components/actionBottomSheet/actionBottomSheetControlled.js +6 -2
- package/dist/cjs/components/actionBottomSheet/actionBottomSheetControlled.js.map +1 -1
- package/dist/cjs/components/actionBottomSheet/actionBottomSheetStandAlone.js +12 -1
- package/dist/cjs/components/actionBottomSheet/actionBottomSheetStandAlone.js.map +1 -1
- package/dist/cjs/components/calendar/calendarStandAlone.js +5 -1
- package/dist/cjs/components/calendar/calendarStandAlone.js.map +1 -1
- package/dist/cjs/components/calendar/list/list.js +8 -8
- package/dist/cjs/components/calendar/list/list.js.map +1 -1
- package/dist/cjs/components/calendar/selector/monthSelector/monthSelector.js +11 -6
- package/dist/cjs/components/calendar/selector/monthSelector/monthSelector.js.map +1 -1
- package/dist/cjs/components/calendar/selector/monthSelector/utils/monthSelector.utils.js +76 -19
- package/dist/cjs/components/calendar/selector/monthSelector/utils/monthSelector.utils.js.map +1 -1
- package/dist/cjs/components/calendar/selector/yearSelector/utils/yearSelector.utils.js +38 -19
- package/dist/cjs/components/calendar/selector/yearSelector/utils/yearSelector.utils.js.map +1 -1
- package/dist/cjs/components/calendar/selector/yearSelector/yearSelector.js +4 -4
- package/dist/cjs/components/calendar/selector/yearSelector/yearSelector.js.map +1 -1
- package/dist/cjs/components/calendar/utils/handleKeysmoves.js +90 -25
- package/dist/cjs/components/calendar/utils/handleKeysmoves.js.map +1 -1
- package/dist/cjs/components/drawer/drawerControlled.js +4 -2
- package/dist/cjs/components/drawer/drawerControlled.js.map +1 -1
- package/dist/cjs/components/icon/icon.js +2 -2
- package/dist/cjs/components/icon/icon.js.map +1 -1
- package/dist/cjs/components/index.js +1 -0
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/components/input/inputStandAlone.js +3 -7
- package/dist/cjs/components/input/inputStandAlone.js.map +1 -1
- package/dist/cjs/components/input/utils/aria.utils.js +5 -16
- package/dist/cjs/components/input/utils/aria.utils.js.map +1 -1
- package/dist/cjs/components/inputDate/components/popoverCalendar.js +4 -3
- package/dist/cjs/components/inputDate/components/popoverCalendar.js.map +1 -1
- package/dist/cjs/components/inputDate/hooks/useInputDate.js +7 -0
- package/dist/cjs/components/inputDate/hooks/useInputDate.js.map +1 -1
- package/dist/cjs/components/inputDate/inputDateStandAlone.js +4 -3
- package/dist/cjs/components/inputDate/inputDateStandAlone.js.map +1 -1
- package/dist/cjs/components/modal/modalControlled.js +5 -2
- package/dist/cjs/components/modal/modalControlled.js.map +1 -1
- package/dist/cjs/components/modalV2/fragments/index.js +6 -0
- package/dist/cjs/components/modalV2/fragments/index.js.map +1 -0
- package/dist/cjs/components/modalV2/fragments/modalHeader.js +17 -0
- package/dist/cjs/components/modalV2/fragments/modalHeader.js.map +1 -0
- package/dist/cjs/components/modalV2/index.js +9 -0
- package/dist/cjs/components/modalV2/index.js.map +1 -0
- package/dist/cjs/components/modalV2/modal.styled.js +81 -0
- package/dist/cjs/components/modalV2/modal.styled.js.map +1 -0
- package/dist/cjs/components/modalV2/modalControlled.js +56 -0
- package/dist/cjs/components/modalV2/modalControlled.js.map +1 -0
- package/dist/cjs/components/modalV2/modalStandAlone.js +47 -0
- package/dist/cjs/components/modalV2/modalStandAlone.js.map +1 -0
- package/dist/cjs/components/modalV2/modalUnControlled.js +62 -0
- package/dist/cjs/components/modalV2/modalUnControlled.js.map +1 -0
- package/dist/cjs/components/modalV2/types/index.js +19 -0
- package/dist/cjs/components/modalV2/types/index.js.map +1 -0
- package/dist/cjs/components/modalV2/types/modal.js +3 -0
- package/dist/cjs/components/modalV2/types/modal.js.map +1 -0
- package/dist/cjs/components/modalV2/types/modalTheme.js +3 -0
- package/dist/cjs/components/modalV2/types/modalTheme.js.map +1 -0
- package/dist/cjs/components/modalV2/utils/index.js +6 -0
- package/dist/cjs/components/modalV2/utils/index.js.map +1 -0
- package/dist/cjs/components/modalV2/utils/onlyDesktopSize.js +11 -0
- package/dist/cjs/components/modalV2/utils/onlyDesktopSize.js.map +1 -0
- package/dist/cjs/components/toggle/components/toggleThreePosition.js +1 -1
- package/dist/cjs/components/toggle/components/toggleThreePosition.js.map +1 -1
- package/dist/cjs/components/toggle/components/toggleTwoPositions.js +2 -6
- package/dist/cjs/components/toggle/components/toggleTwoPositions.js.map +1 -1
- package/dist/cjs/components/toggle/toggleControlled.js +2 -6
- package/dist/cjs/components/toggle/toggleControlled.js.map +1 -1
- package/dist/cjs/components/toggle/toggleUnControlled.js +5 -1
- package/dist/cjs/components/toggle/toggleUnControlled.js.map +1 -1
- package/dist/cjs/components/toggleWithLabel/toggleWithLabelStandAlone.js +2 -2
- package/dist/cjs/components/toggleWithLabel/toggleWithLabelStandAlone.js.map +1 -1
- package/dist/cjs/components/tooltip/tooltipStandAlone.js +2 -2
- package/dist/cjs/components/tooltip/tooltipStandAlone.js.map +1 -1
- package/dist/cjs/components/tooltip/tooltipUnControlled.js +1 -1
- package/dist/cjs/components/tooltip/tooltipUnControlled.js.map +1 -1
- package/dist/cjs/constants/keyboardKeys.js +2 -2
- package/dist/cjs/constants/keyboardKeys.js.map +1 -1
- package/dist/cjs/constants/stylesName.js +1 -0
- package/dist/cjs/constants/stylesName.js.map +1 -1
- package/dist/cjs/designSystem/kubit/components/actionBottomSheet/styles.js +9 -6
- package/dist/cjs/designSystem/kubit/components/actionBottomSheet/styles.js.map +1 -1
- package/dist/cjs/designSystem/kubit/components/modalV2/index.js +19 -0
- package/dist/cjs/designSystem/kubit/components/modalV2/index.js.map +1 -0
- package/dist/cjs/designSystem/kubit/components/modalV2/styles.js +231 -0
- package/dist/cjs/designSystem/kubit/components/modalV2/styles.js.map +1 -0
- package/dist/cjs/designSystem/kubit/components/modalV2/variants.js +10 -0
- package/dist/cjs/designSystem/kubit/components/modalV2/variants.js.map +1 -0
- package/dist/cjs/designSystem/kubit/components/styles.js +1 -0
- package/dist/cjs/designSystem/kubit/components/styles.js.map +1 -1
- package/dist/cjs/designSystem/kubit/components/variants.js +1 -0
- package/dist/cjs/designSystem/kubit/components/variants.js.map +1 -1
- package/dist/cjs/hooks/useRoveFocus/useRoveFocus.js +40 -2
- package/dist/cjs/hooks/useRoveFocus/useRoveFocus.js.map +1 -1
- package/dist/cjs/hooks/useScrollEffect/useScrollEffect.js +1 -1
- package/dist/cjs/hooks/useScrollEffect/useScrollEffect.js.map +1 -1
- package/dist/cjs/styles/mixins/input.mixin.js +3 -3
- package/dist/cjs/styles/mixins/input.mixin.js.map +1 -1
- package/dist/esm/components/actionBottomSheet/actionBottomSheet.styled.d.ts +2 -0
- package/dist/esm/components/actionBottomSheet/actionBottomSheet.styled.js +6 -0
- package/dist/esm/components/actionBottomSheet/actionBottomSheet.styled.js.map +1 -1
- package/dist/esm/components/actionBottomSheet/actionBottomSheetControlled.js +6 -2
- package/dist/esm/components/actionBottomSheet/actionBottomSheetControlled.js.map +1 -1
- package/dist/esm/components/actionBottomSheet/actionBottomSheetStandAlone.js +14 -3
- package/dist/esm/components/actionBottomSheet/actionBottomSheetStandAlone.js.map +1 -1
- package/dist/esm/components/actionBottomSheet/types/actionBottomSheet.d.ts +2 -0
- package/dist/esm/components/actionBottomSheet/types/actionBottomSheetTheme.d.ts +2 -0
- package/dist/esm/components/calendar/calendarStandAlone.js +5 -1
- package/dist/esm/components/calendar/calendarStandAlone.js.map +1 -1
- package/dist/esm/components/calendar/list/list.js +9 -9
- package/dist/esm/components/calendar/list/list.js.map +1 -1
- package/dist/esm/components/calendar/selector/monthSelector/monthSelector.js +12 -7
- package/dist/esm/components/calendar/selector/monthSelector/monthSelector.js.map +1 -1
- package/dist/esm/components/calendar/selector/monthSelector/types/monthSelector.d.ts +2 -2
- package/dist/esm/components/calendar/selector/monthSelector/utils/monthSelector.utils.d.ts +10 -2
- package/dist/esm/components/calendar/selector/monthSelector/utils/monthSelector.utils.js +73 -18
- package/dist/esm/components/calendar/selector/monthSelector/utils/monthSelector.utils.js.map +1 -1
- package/dist/esm/components/calendar/selector/yearSelector/utils/yearSelector.utils.d.ts +6 -2
- package/dist/esm/components/calendar/selector/yearSelector/utils/yearSelector.utils.js +33 -18
- package/dist/esm/components/calendar/selector/yearSelector/utils/yearSelector.utils.js.map +1 -1
- package/dist/esm/components/calendar/selector/yearSelector/yearSelector.js +5 -5
- package/dist/esm/components/calendar/selector/yearSelector/yearSelector.js.map +1 -1
- package/dist/esm/components/calendar/types/calendar.d.ts +1 -0
- package/dist/esm/components/calendar/utils/handleKeysmoves.d.ts +11 -9
- package/dist/esm/components/calendar/utils/handleKeysmoves.js +81 -20
- package/dist/esm/components/calendar/utils/handleKeysmoves.js.map +1 -1
- package/dist/esm/components/drawer/drawerControlled.js +4 -2
- package/dist/esm/components/drawer/drawerControlled.js.map +1 -1
- package/dist/esm/components/icon/icon.js +2 -2
- package/dist/esm/components/icon/icon.js.map +1 -1
- package/dist/esm/components/icon/types/icon.d.ts +1 -1
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/components/input/inputStandAlone.js +4 -8
- package/dist/esm/components/input/inputStandAlone.js.map +1 -1
- package/dist/esm/components/input/utils/aria.utils.d.ts +2 -9
- package/dist/esm/components/input/utils/aria.utils.js +4 -14
- package/dist/esm/components/input/utils/aria.utils.js.map +1 -1
- package/dist/esm/components/inputDate/components/popoverCalendar.js +4 -3
- package/dist/esm/components/inputDate/components/popoverCalendar.js.map +1 -1
- package/dist/esm/components/inputDate/hooks/useInputDate.js +7 -0
- package/dist/esm/components/inputDate/hooks/useInputDate.js.map +1 -1
- package/dist/esm/components/inputDate/inputDateStandAlone.js +4 -3
- package/dist/esm/components/inputDate/inputDateStandAlone.js.map +1 -1
- package/dist/esm/components/inputDate/types/inputDate.d.ts +2 -1
- package/dist/esm/components/modal/modalControlled.js +5 -2
- package/dist/esm/components/modal/modalControlled.js.map +1 -1
- package/dist/esm/components/modalV2/fragments/index.d.ts +1 -0
- package/dist/esm/components/modalV2/fragments/index.js +2 -0
- package/dist/esm/components/modalV2/fragments/index.js.map +1 -0
- package/dist/esm/components/modalV2/fragments/modalHeader.d.ts +7 -0
- package/dist/esm/components/modalV2/fragments/modalHeader.js +11 -0
- package/dist/esm/components/modalV2/fragments/modalHeader.js.map +1 -0
- package/dist/esm/components/modalV2/index.d.ts +3 -0
- package/dist/esm/components/modalV2/index.js +4 -0
- package/dist/esm/components/modalV2/index.js.map +1 -0
- package/dist/esm/components/modalV2/modal.styled.d.ts +12 -0
- package/dist/esm/components/modalV2/modal.styled.js +55 -0
- package/dist/esm/components/modalV2/modal.styled.js.map +1 -0
- package/dist/esm/components/modalV2/modalControlled.d.ts +7 -0
- package/dist/esm/components/modalV2/modalControlled.js +30 -0
- package/dist/esm/components/modalV2/modalControlled.js.map +1 -0
- package/dist/esm/components/modalV2/modalStandAlone.d.ts +3 -0
- package/dist/esm/components/modalV2/modalStandAlone.js +21 -0
- package/dist/esm/components/modalV2/modalStandAlone.js.map +1 -0
- package/dist/esm/components/modalV2/modalUnControlled.d.ts +7 -0
- package/dist/esm/components/modalV2/modalUnControlled.js +36 -0
- package/dist/esm/components/modalV2/modalUnControlled.js.map +1 -0
- package/dist/esm/components/modalV2/types/index.d.ts +2 -0
- package/dist/esm/components/modalV2/types/index.js +3 -0
- package/dist/esm/components/modalV2/types/index.js.map +1 -0
- package/dist/esm/components/modalV2/types/modal.d.ts +61 -0
- package/dist/esm/components/modalV2/types/modal.js +2 -0
- package/dist/esm/components/modalV2/types/modal.js.map +1 -0
- package/dist/esm/components/modalV2/types/modalTheme.d.ts +19 -0
- package/dist/esm/components/modalV2/types/modalTheme.js +2 -0
- package/dist/esm/components/modalV2/types/modalTheme.js.map +1 -0
- package/dist/esm/components/modalV2/utils/index.d.ts +1 -0
- package/dist/esm/components/modalV2/utils/index.js +2 -0
- package/dist/esm/components/modalV2/utils/index.js.map +1 -0
- package/dist/esm/components/modalV2/utils/onlyDesktopSize.d.ts +2 -0
- package/dist/esm/components/modalV2/utils/onlyDesktopSize.js +7 -0
- package/dist/esm/components/modalV2/utils/onlyDesktopSize.js.map +1 -0
- package/dist/esm/components/toggle/components/toggleThreePosition.js +1 -1
- package/dist/esm/components/toggle/components/toggleThreePosition.js.map +1 -1
- package/dist/esm/components/toggle/components/toggleTwoPositions.js +2 -6
- package/dist/esm/components/toggle/components/toggleTwoPositions.js.map +1 -1
- package/dist/esm/components/toggle/toggleControlled.js +2 -6
- package/dist/esm/components/toggle/toggleControlled.js.map +1 -1
- package/dist/esm/components/toggle/toggleUnControlled.js +5 -1
- package/dist/esm/components/toggle/toggleUnControlled.js.map +1 -1
- package/dist/esm/components/toggle/types/toggle.d.ts +2 -3
- package/dist/esm/components/toggleWithLabel/toggleWithLabelStandAlone.js +2 -2
- package/dist/esm/components/toggleWithLabel/toggleWithLabelStandAlone.js.map +1 -1
- package/dist/esm/components/toggleWithLabel/types/toggleWithLabel.d.ts +1 -1
- package/dist/esm/components/tooltip/tooltipStandAlone.js +2 -2
- package/dist/esm/components/tooltip/tooltipStandAlone.js.map +1 -1
- package/dist/esm/components/tooltip/tooltipUnControlled.js +1 -1
- package/dist/esm/components/tooltip/tooltipUnControlled.js.map +1 -1
- package/dist/esm/constants/keyboardKeys.js +2 -2
- package/dist/esm/constants/keyboardKeys.js.map +1 -1
- package/dist/esm/constants/stylesName.d.ts +1 -0
- package/dist/esm/constants/stylesName.js +1 -0
- package/dist/esm/constants/stylesName.js.map +1 -1
- package/dist/esm/designSystem/kubit/components/actionBottomSheet/styles.js +9 -6
- package/dist/esm/designSystem/kubit/components/actionBottomSheet/styles.js.map +1 -1
- package/dist/esm/designSystem/kubit/components/modalV2/index.d.ts +2 -0
- package/dist/esm/designSystem/kubit/components/modalV2/index.js +3 -0
- package/dist/esm/designSystem/kubit/components/modalV2/index.js.map +1 -0
- package/dist/esm/designSystem/kubit/components/modalV2/styles.d.ts +3 -0
- package/dist/esm/designSystem/kubit/components/modalV2/styles.js +228 -0
- package/dist/esm/designSystem/kubit/components/modalV2/styles.js.map +1 -0
- package/dist/esm/designSystem/kubit/components/modalV2/variants.d.ts +5 -0
- package/dist/esm/designSystem/kubit/components/modalV2/variants.js +7 -0
- package/dist/esm/designSystem/kubit/components/modalV2/variants.js.map +1 -0
- package/dist/esm/designSystem/kubit/components/styles.d.ts +1 -0
- package/dist/esm/designSystem/kubit/components/styles.js +1 -0
- package/dist/esm/designSystem/kubit/components/styles.js.map +1 -1
- package/dist/esm/designSystem/kubit/components/variants.d.ts +1 -0
- package/dist/esm/designSystem/kubit/components/variants.js +1 -0
- package/dist/esm/designSystem/kubit/components/variants.js.map +1 -1
- package/dist/esm/designSystem/kubit/index.d.ts +2 -0
- package/dist/esm/hooks/useRoveFocus/useRoveFocus.d.ts +3 -1
- package/dist/esm/hooks/useRoveFocus/useRoveFocus.js +41 -3
- package/dist/esm/hooks/useRoveFocus/useRoveFocus.js.map +1 -1
- package/dist/esm/hooks/useScrollEffect/useScrollEffect.d.ts +6 -1
- package/dist/esm/hooks/useScrollEffect/useScrollEffect.js +1 -1
- package/dist/esm/hooks/useScrollEffect/useScrollEffect.js.map +1 -1
- package/dist/esm/styles/mixins/input.mixin.d.ts +1 -1
- package/dist/esm/styles/mixins/input.mixin.js +3 -3
- package/dist/esm/styles/mixins/input.mixin.js.map +1 -1
- package/package.json +13 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modalControlled.js","sourceRoot":"","sources":["../../../../src/components/modal/modalControlled.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACpF,OA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EACpB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,YAAY,GAC1B,CACH,CAAC;IAEF,OAAO,QAAQ,CAAC,CAAC,CAAC,KAAC,MAAM,IAAC,SAAS,EAAE,QAAQ,YAAG,cAAc,GAAU,CAAC,CAAC,CAAC,cAAc,CAAC;AAC5F,CAAC,CACF,CAAC;AACF,wBAAwB,CAAC,WAAW,GAAG,0BAA0B,CAAC;AAElE,MAAM,aAAa,GAAG,CACpB,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAuB,EAC3C,GAA0D,EAC7C,EAAE;IACf,MAAM,cAAc,GAAG,KAAC,eAAe,OAAM,KAAqC,EAAE,GAAG,EAAE,GAAG,GAAI,CAAC;IAEjG,OAAO,CACL,KAAC,aAAa,IACZ,iBAAiB,EACf,KAAC,iBAAiB,cACf,QAAQ,CAAC,CAAC,CAAC,KAAC,MAAM,IAAC,SAAS,EAAE,QAAQ,YAAG,cAAc,GAAU,CAAC,CAAC,CAAC,cAAc,GACjE,YAGtB,KAAC,wBAAwB,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,GAAI,GACvD,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CAAC,aAAa,CAIjB,CAAC;AAEtC,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ModalHeader } from './modalHeader';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/modalV2/fragments/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IModalStandAlone } from '../types';
|
|
3
|
+
type PickedProps = 'styles' | 'dataTestId' | 'blocked' | 'closeIcon' | 'closeButton' | 'title';
|
|
4
|
+
export declare const ModalHeader: React.ForwardRefExoticComponent<Pick<IModalStandAlone, PickedProps> & {
|
|
5
|
+
titleIdFinal: string;
|
|
6
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Button } from '../../../components/button';
|
|
4
|
+
import { ElementOrIcon } from '../../../components/elementOrIcon';
|
|
5
|
+
import { Text, TextComponentType } from '../../../components/text';
|
|
6
|
+
import { ModalCloseButtonStyled, ModalFilledContainer, ModalHeaderStyled, TitleHiddenContainer, } from '../modal.styled';
|
|
7
|
+
const ModalHeaderComponent = (props, ref) => (_jsxs(ModalHeaderStyled, { ref: ref, "$styles": props.styles, children: [_jsx(ModalFilledContainer, { "$styles": props.styles }), props.title?.visible === undefined || props.title.visible ? (_jsx(_Fragment, { children: _jsx(Text, { component: TextComponentType.H1, customTypography: props.styles.title, dataTestId: `${props.dataTestId}Title`, id: props.titleIdFinal, ...props.title, children: props.title?.content }) })) : (_jsx(TitleHiddenContainer, { id: props.titleIdFinal, children: props.title?.content })), !props.blocked && props.closeIcon?.icon && (_jsx(ModalCloseButtonStyled, { "$styles": props.styles, children: _jsx(ElementOrIcon, { customIconStyles: props.styles?.closeButtonIcon, dataTestId: `${props.dataTestId}CloseIcon`, ...props.closeIcon }) })), !props.blocked &&
|
|
8
|
+
props.closeButton?.content &&
|
|
9
|
+
(props.styles.closeButton?.buttonVariant || props.closeButton?.variant) && (_jsx(Button, { variant: props.styles.closeButton?.buttonVariant, ...props.closeButton, children: props.closeButton.content }))] }));
|
|
10
|
+
export const ModalHeader = React.forwardRef(ModalHeaderComponent);
|
|
11
|
+
//# sourceMappingURL=modalHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modalHeader.js","source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M,EAAE,eAAe,EAC/C,UAAU,EAAE,GAAG,KAAK,CAAC,UAAU,WAAW,KACtC,KAAK,CAAC,SAAS,GACnB,GACqB,CAC1B,EACA,CAAC,KAAK,CAAC,OAAO;YACb,KAAK,CAAC,WAAW,EAAE,OAAO;YAC1B,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,aAAa,IAAI,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,IAAI,CACzE,KAAC,MAAM,IAAC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,aAAa,KAAM,KAAK,CAAC,WAAW,YAC5E,KAAK,CAAC,WAAW,CAAC,OAAO,GACnB,CACV,IACe,CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { ModalTitleTextType as ModalTitleTextTypeV2, ModalButtonType as ModalButtonTypeV2, ModalFooterType as ModalFooterTypeV2, ModalPopoverType as ModalPopoverTypeV2, IModalStyled as IModalStyledV2, IModalStandAlone as IModalStandAloneV2, IModalControlled as IModalControlledV2, IModalUnControlled as IModalUnControlledV2, ModalBaseStylesType as ModalBaseStylesTypeV2, ModalStylesType as ModalStylesTypeV2, } from './types';
|
|
2
|
+
export { ModalControlled as ModalControlledV2 } from './modalControlled';
|
|
3
|
+
export { ModalUnControlled as ModalV2 } from './modalUnControlled';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/modalV2/index.ts"],"names":[],"mappings":"AAcA,aAAa;AACb,OAAO,EAAE,eAAe,IAAI,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,iBAAiB,IAAI,OAAO,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IModalStyled } from './types';
|
|
2
|
+
type ModalShowScrollType = {
|
|
3
|
+
$minContentHeight?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const ModalStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, IModalStyled>> & string;
|
|
6
|
+
export declare const ModalHeaderStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, IModalStyled>> & string;
|
|
7
|
+
export declare const ModalFilledContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, IModalStyled>> & string;
|
|
8
|
+
export declare const TitleHiddenContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
9
|
+
export declare const ModalCloseButtonStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, IModalStyled>> & string;
|
|
10
|
+
export declare const ModalContentStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, IModalStyled & ModalShowScrollType>> & string;
|
|
11
|
+
export declare const ModalFooterStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, IModalStyled>> & string;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
//utils
|
|
3
|
+
import { getStyles } from '../../utils/getStyles/getStyles';
|
|
4
|
+
const commonModalContainerStyled = (mediaQuery, minWidth, minHeight, maxWidth, maxHeight, hasFooter = false) => mediaQuery &&
|
|
5
|
+
css `
|
|
6
|
+
${mediaQuery} {
|
|
7
|
+
${minWidth &&
|
|
8
|
+
css `
|
|
9
|
+
min-width: ${minWidth};
|
|
10
|
+
`}
|
|
11
|
+
${minHeight &&
|
|
12
|
+
css `
|
|
13
|
+
min-height: ${minHeight};
|
|
14
|
+
`};
|
|
15
|
+
${maxWidth &&
|
|
16
|
+
css `
|
|
17
|
+
max-width: ${maxWidth || '100vw'};
|
|
18
|
+
`}
|
|
19
|
+
${maxHeight &&
|
|
20
|
+
css `
|
|
21
|
+
max-height: ${maxHeight || '100vh'};
|
|
22
|
+
`}
|
|
23
|
+
padding-bottom: ${hasFooter ? '0' : null};
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
export const ModalStyled = styled.div `
|
|
27
|
+
${props => getStyles(props.$styles.container)};
|
|
28
|
+
${({ hasFooter, $minHeight, $minWidth, $maxHeight, $maxWidth, theme: { MEDIA_QUERIES: { onlyTablet, onlyDesktop, onlyMobile }, }, }) => css `
|
|
29
|
+
${commonModalContainerStyled(onlyDesktop, $minWidth, $minHeight, $maxWidth, $maxHeight, hasFooter)}
|
|
30
|
+
${commonModalContainerStyled(onlyTablet, $minWidth, $minHeight, $maxWidth, $maxHeight, hasFooter)}
|
|
31
|
+
${commonModalContainerStyled(onlyMobile, $minWidth, $minHeight, $maxWidth, $maxHeight, hasFooter)}
|
|
32
|
+
`}
|
|
33
|
+
`;
|
|
34
|
+
export const ModalHeaderStyled = styled.div `
|
|
35
|
+
${props => getStyles(props.$styles.headerContainer)}
|
|
36
|
+
`;
|
|
37
|
+
export const ModalFilledContainer = styled.div `
|
|
38
|
+
${props => getStyles(props.$styles.closeButtonIcon)};
|
|
39
|
+
`;
|
|
40
|
+
export const TitleHiddenContainer = styled.span `
|
|
41
|
+
display: none;
|
|
42
|
+
`;
|
|
43
|
+
export const ModalCloseButtonStyled = styled.div `
|
|
44
|
+
${props => getStyles(props.$styles.closeButtonContainer)};
|
|
45
|
+
`;
|
|
46
|
+
export const ModalContentStyled = styled.div `
|
|
47
|
+
word-break: break-word;
|
|
48
|
+
line-height: 1.5rem;
|
|
49
|
+
${props => getStyles(props.$styles.content)}
|
|
50
|
+
min-height: ${({ $minContentHeight }) => $minContentHeight};
|
|
51
|
+
`;
|
|
52
|
+
export const ModalFooterStyled = styled.div `
|
|
53
|
+
${props => getStyles(props.$styles.footer)}
|
|
54
|
+
`;
|
|
55
|
+
//# sourceMappingURL=modal.styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal.styled.js","sourceRoot":"","sources":["../../../../src/components/modalV2/modal.styled.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO;AACP,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAQxD,MAAM,0BAA0B,GAAG,CACjC,UAAkB,EAClB,QAAiB,EACjB,SAAkB,EAClB,QAAiB,EACjB,SAAkB,EAClB,SAAS,GAAG,KAAK,EACjB,EAAE,CACF,UAAU;IACV,GAAG,CAAA;MACC,UAAU;QACR,QAAQ;QACV,GAAG,CAAA;qBACY,QAAQ;OACtB;QACC,SAAS;QACX,GAAG,CAAA;sBACa,SAAS;OACxB;QACC,QAAQ;QACV,GAAG,CAAA;qBACY,QAAQ,IAAI,OAAO;OACjC;QACC,SAAS;QACX,GAAG,CAAA;sBACa,SAAS,IAAI,OAAO;OACnC;wBACiB,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI;;GAE3C,CAAC;AAEJ,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAc;IAC/C,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;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,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAc;IACrD,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;CAC3C,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { IModalControlled } from './types';
|
|
3
|
+
declare const ModalBoundary: <V extends string | unknown>({ portalId, ...props }: IModalControlled<V>, ref: React.ForwardedRef<HTMLDivElement> | undefined | null) => JSX.Element;
|
|
4
|
+
declare const ModalControlled: <V extends string | unknown>(props: React.PropsWithChildren<IModalControlled<V>> & {
|
|
5
|
+
ref?: React.ForwardedRef<HTMLDivElement> | undefined | null;
|
|
6
|
+
}) => ReturnType<typeof ModalBoundary>;
|
|
7
|
+
export { ModalControlled };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { STYLES_NAME } from '../../constants';
|
|
4
|
+
import { useMediaDevice, useScrollEffect, useStylesV2 } from '../../hooks';
|
|
5
|
+
import { ErrorBoundary } from '../../provider/errorBoundary/errorBoundary';
|
|
6
|
+
import { FallbackComponent } from '../../provider/errorBoundary/fallbackComponent';
|
|
7
|
+
import { Portal } from '../portal';
|
|
8
|
+
import { ModalStandAlone } from './modalStandAlone';
|
|
9
|
+
const ModalControlledComponent = React.forwardRef(({ variant, ctv, portalId, ...props }, ref) => {
|
|
10
|
+
const styles = useStylesV2({
|
|
11
|
+
styleName: STYLES_NAME.MODAL_V2,
|
|
12
|
+
variantName: variant,
|
|
13
|
+
customTokens: ctv,
|
|
14
|
+
});
|
|
15
|
+
const device = useMediaDevice();
|
|
16
|
+
const { scrollableRef, shadowRef } = useScrollEffect({
|
|
17
|
+
// The box_shadow token is need for the shadow effect
|
|
18
|
+
shadowStyles: styles?.headerContainer?.box_shadow,
|
|
19
|
+
});
|
|
20
|
+
const modalStructure = (_jsx(ModalStandAlone, { ...props, ref: ref, device: device, scrollableRef: scrollableRef, shadowRef: shadowRef, styles: styles }));
|
|
21
|
+
return portalId ? _jsx(Portal, { wrapperId: portalId, children: modalStructure }) : modalStructure;
|
|
22
|
+
});
|
|
23
|
+
ModalControlledComponent.displayName = 'ModalControlledComponent';
|
|
24
|
+
const ModalBoundary = ({ portalId, ...props }, ref) => {
|
|
25
|
+
const modalStructure = _jsx(ModalStandAlone, { ...props, ref: ref });
|
|
26
|
+
return (_jsx(ErrorBoundary, { fallBackComponent: _jsx(FallbackComponent, { children: portalId ? _jsx(Portal, { wrapperId: portalId, children: modalStructure }) : modalStructure }), children: _jsx(ModalControlledComponent, { ...props, ref: ref, portalId: portalId }) }));
|
|
27
|
+
};
|
|
28
|
+
const ModalControlled = React.forwardRef(ModalBoundary);
|
|
29
|
+
export { ModalControlled };
|
|
30
|
+
//# sourceMappingURL=modalControlled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modalControlled.js","sourceRoot":"","sources":["../../../../src/components/modalV2/modalControlled.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAE/E,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,MAAM,wBAAwB,GAAG,KAAK,CAAC,UAAU,CAC/C,CACE,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAuB,EACzD,GAA0D,EAC7C,EAAE;IACf,MAAM,MAAM,GAAG,WAAW,CAA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,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useId } from '../../hooks';
|
|
4
|
+
import { Footer } from '../footer';
|
|
5
|
+
import { Popover, PopoverComponentType, PopoverPositionVariantType } from '../popover';
|
|
6
|
+
import { ModalHeader } from './fragments';
|
|
7
|
+
import { ModalContentStyled, ModalFooterStyled, ModalStyled } from './modal.styled';
|
|
8
|
+
import { onlyDesktopSize } from './utils';
|
|
9
|
+
const ModalStandAloneComponent = ({ dataTestId = 'modalDataTestId', scrollableRef, shadowRef, customHeightAllDevices = false, customWidthAllDevices = false, ...props }, ref) => {
|
|
10
|
+
const uniqueModalId = useId('modal');
|
|
11
|
+
const modalId = props.id ?? uniqueModalId;
|
|
12
|
+
const uniqueTitleId = useId('modal-title');
|
|
13
|
+
const titleIdFinal = props.title?.id ?? uniqueTitleId;
|
|
14
|
+
const modalRef = React.useRef(null);
|
|
15
|
+
const modalFooterVariant = props.footer?.variant ?? props.styles.footerVariant;
|
|
16
|
+
return (_jsx(Popover, { "aria-labelledby": titleIdFinal, "aria-modal": props.open, clickOverlayClose: !props.blocked, component: PopoverComponentType.DIALOG, dataTestId: `${dataTestId}Popover`, hasBackDrop: true, id: modalId, open: props.open, positionVariant: PopoverPositionVariantType.FIXED, trapFocusInsideModal: true, variant: props.styles.popoverVariant, ...props.popover, children: _jsxs(ModalStyled, { ref: modalRef, "$maxHeight": props.maxHeight, "$maxWidth": props.maxWidth, "$minHeight": customHeightAllDevices ? props.minHeight : onlyDesktopSize(props.device, props.minHeight), "$minWidth": customWidthAllDevices ? props.minWidth : onlyDesktopSize(props.device, props.minWidth), "$styles": props.styles, "data-testid": dataTestId, hasFooter: !!props.footer?.content, onKeyDown: event => props.onKeyDown?.(event), children: [_jsx(ModalHeader, { ref: shadowRef, blocked: props.blocked, closeButton: props.closeButton, closeIcon: props.closeIcon, dataTestId: dataTestId, styles: props.styles, title: props.title, titleIdFinal: titleIdFinal }), _jsx(ModalContentStyled, { ref: ref => {
|
|
17
|
+
scrollableRef(ref);
|
|
18
|
+
}, "$minContentHeight": props.minContentHeight, "$styles": props.styles, "data-testid": `${dataTestId}Content`, children: props.content }), modalFooterVariant && props.footer?.content && (_jsx(ModalFooterStyled, { "$styles": props.styles, children: _jsx(Footer, { dataTestId: `${dataTestId}Navbar`, variant: modalFooterVariant, ...props.footer, children: props.footer?.content }) }))] }) }));
|
|
19
|
+
};
|
|
20
|
+
export const ModalStandAlone = React.forwardRef(ModalStandAloneComponent);
|
|
21
|
+
//# sourceMappingURL=modalStandAlone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modalStandAlone.js","sourceRoot":"","sources":["../../../../src/components/modalV2/modalStandAlone.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEpF,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,MAAM,wBAAwB,GAAG,CAC/B,EACE,UAAU,GAAG,iBAAiB,EAC9B,aAAa,EACb,SAAS,EACT,sBAAsB,GAAG,KAAK,EAC9B,qBAAqB,GAAG,KAAK,EAC7B,GAAG,KAAK,EACS,EACnB,GAA0D,EAC7C,EAAE;IACf,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;IACrC,MAAM,OAAO,GAAG,KAAK,CA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K,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,aAG5C,KAAC,WAAW,IACV,GAAG,EAAE,SAAS,EACd,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,YAAY,EAAE,YAAY,GAC1B,EAEF,KAAC,kBAAkB,IACjB,GAAG,EAAE,GAAG,CAAC,EAAE;wBACT,aAAa,CAAC,GAAG,CAAC,CAAC;oBACrB,CAAC,uBACkB,KAAK,CAAC,gBAAgB,aAChC,KAAK,CAAC,MAAM,iBACR,GAAG,UAAU,SAAS,YAElC,KAAK,CAAC,OAAO,GACK,EAEpB,kBAAkB,IAAI,KAAK,CAAC,MAAM,EAAE,OAAO,IAAI,CAC9C,KAAC,iBAAiB,eAAU,KAAK,CAAC,MAAM,YACtC,KAAC,MAAM,IACL,UAAU,EAAE,GAAG,UAAU,QAAQ,EACjC,OAAO,EAAE,kBAAkB,KACvB,KAAK,CAAC,MAAM,YAEf,KAAK,CAAC,MAAM,EAAE,OAAO,GACf,GACS,CACrB,IACW,GACN,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CAAC,wBAAwB,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IModalUnControlled } from './types';
|
|
3
|
+
declare const ModalUnControlledComponent: <V extends string | unknown>({ variant, onClose, closeIcon, closeButton, popover, ...props }: IModalUnControlled<V>, ref: React.ForwardedRef<HTMLDivElement> | undefined | null) => JSX.Element;
|
|
4
|
+
declare const ModalUnControlled: <V extends string | unknown>(props: React.PropsWithChildren<IModalUnControlled<V>> & {
|
|
5
|
+
ref?: React.ForwardedRef<HTMLDivElement> | undefined | null;
|
|
6
|
+
}) => ReturnType<typeof ModalUnControlledComponent>;
|
|
7
|
+
export { ModalUnControlled };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
import { isKeyEscapePressed } from '../../utils';
|
|
5
|
+
import { ModalControlled } from './modalControlled';
|
|
6
|
+
const ModalUnControlledComponent = ({ variant, onClose, closeIcon, closeButton, popover, ...props }, ref) => {
|
|
7
|
+
const [open, setOpen] = useState(props.open);
|
|
8
|
+
const onKeyDown = event => {
|
|
9
|
+
if (props?.blocked && isKeyEscapePressed(event.key)) {
|
|
10
|
+
return event.stopPropagation();
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
setOpen(props.open);
|
|
15
|
+
}, [props.open]);
|
|
16
|
+
const handleClose = () => {
|
|
17
|
+
setOpen(false);
|
|
18
|
+
onClose?.();
|
|
19
|
+
};
|
|
20
|
+
const handleCloseIconClick = e => {
|
|
21
|
+
handleClose();
|
|
22
|
+
closeIcon?.onClick?.(e);
|
|
23
|
+
};
|
|
24
|
+
const handlecloseButtonClick = e => {
|
|
25
|
+
handleClose();
|
|
26
|
+
closeButton?.onClick?.(e);
|
|
27
|
+
};
|
|
28
|
+
const handlePopoverCloseInternally = () => {
|
|
29
|
+
handleClose();
|
|
30
|
+
popover?.onCloseInternally?.();
|
|
31
|
+
};
|
|
32
|
+
return (_jsx(ModalControlled, { ...props, ref: ref, closeButton: closeButton && { ...closeButton, onClick: handlecloseButtonClick }, closeIcon: { ...closeIcon, onClick: handleCloseIconClick }, open: open, popover: { ...popover, onCloseInternally: handlePopoverCloseInternally }, variant: variant, onKeyDown: onKeyDown }));
|
|
33
|
+
};
|
|
34
|
+
const ModalUnControlled = React.forwardRef(ModalUnControlledComponent);
|
|
35
|
+
export { ModalUnControlled };
|
|
36
|
+
//# sourceMappingURL=modalUnControlled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modalUnControlled.js","sourceRoot":"","sources":["../../../../src/components/modalV2/modalUnControlled.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,MAAM,0BAA0B,GAAG,CACjC,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,KAAK,EAAyB,EACtF,GAA0D,EAC7C,EAAE;IACf,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAE7C,MAAM,SAAS,GAA+C,KAAK,CAAC,EAAE;QACpE,IAAI,KAAK,EAAE,OAAO,IAAI,kBAAkB,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YACpD,OAAO,KAAK,CAAC,eAAe,EAAE,CAAC;QACjC,CAAC;IACH,CAAC,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAEjB,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,OAAO,CAAC,KAAK,CAAC,CAAC;QACf,OAAO,EAAE,EAAE,CAAC;IACd,CAAC,CAAC;IAEF,MAAM,oBAAoB,GAAG,CAAC,CAAC,EAAE;QAC/B,WAAW,EAAE,CAAC;QACd,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,MAAM,sBAAsB,GAAG,CAAC,CAAC,EAAE;QACjC,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC,CAAC;IAEF,MAAM,4BAA4B,GAAG,GAAG,EAAE;QACxC,WAAW,EAAE,CAAC;QACd,OAAO,EAAE,iBAAiB,EAAE,EAAE,CAAC;IACjC,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,eAAe,OACV,KAAK,EACT,GAAG,EAAE,GAAG,EACR,WAAW,EAAE,WAAW,IAAI,EAAE,GAAG,WAAW,EAAE,OAAO,EAAE,sBAAsB,EAAE,EAC/E,SAAS,EAAE,EAAE,GAAG,SAAS,EAAE,OAAO,EAAE,oBAAoB,EAAE,EAC1D,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,EACxE,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,GACpB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,KAAK,CAAC,UAAU,CAAC,0BAA0B,CAMnB,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/modalV2/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { IButton } from '../../../components/button';
|
|
2
|
+
import { IElementOrIcon } from '../../../components/elementOrIcon';
|
|
3
|
+
import { IFooter } from '../../../components/footer';
|
|
4
|
+
import { IPopoverControlled } from '../../../components/popover';
|
|
5
|
+
import { IText } from '../../../components/text/types';
|
|
6
|
+
import { CustomTokenTypes, DeviceBreakpointsType } from '../../../types';
|
|
7
|
+
import { ModalBaseStylesType } from './modalTheme';
|
|
8
|
+
export type ModalTitleTextType = Omit<IText<string>, 'children'> & {
|
|
9
|
+
content?: React.ReactNode;
|
|
10
|
+
visible?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type ModalButtonType = Omit<IButton, 'children' | 'variant'> & {
|
|
13
|
+
content?: React.ReactNode;
|
|
14
|
+
variant?: string;
|
|
15
|
+
};
|
|
16
|
+
export type ModalFooterType = Omit<IFooter, 'children' | 'variant'> & {
|
|
17
|
+
content?: JSX.Element[] | JSX.Element;
|
|
18
|
+
variant?: string;
|
|
19
|
+
};
|
|
20
|
+
export type ModalPopoverType = Omit<IPopoverControlled, 'children' | 'open'>;
|
|
21
|
+
export interface IModalStyled {
|
|
22
|
+
$styles: ModalBaseStylesType;
|
|
23
|
+
$maxHeight?: string;
|
|
24
|
+
$minHeight?: string;
|
|
25
|
+
$maxWidth?: string;
|
|
26
|
+
$minWidth?: string;
|
|
27
|
+
hasFooter?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface IModalStandAlone {
|
|
30
|
+
styles: ModalBaseStylesType;
|
|
31
|
+
maxHeight?: string;
|
|
32
|
+
minHeight?: string;
|
|
33
|
+
maxWidth?: string;
|
|
34
|
+
minWidth?: string;
|
|
35
|
+
minContentHeight?: string;
|
|
36
|
+
customHeightAllDevices?: boolean;
|
|
37
|
+
customWidthAllDevices?: boolean;
|
|
38
|
+
id?: string;
|
|
39
|
+
open?: boolean;
|
|
40
|
+
popover?: ModalPopoverType;
|
|
41
|
+
blocked?: boolean;
|
|
42
|
+
title?: ModalTitleTextType;
|
|
43
|
+
closeIcon?: IElementOrIcon;
|
|
44
|
+
closeButton?: ModalButtonType;
|
|
45
|
+
content?: React.ReactNode;
|
|
46
|
+
footer?: ModalFooterType;
|
|
47
|
+
device: DeviceBreakpointsType;
|
|
48
|
+
dataTestId?: string;
|
|
49
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
|
|
50
|
+
scrollableRef: (node: any) => void;
|
|
51
|
+
shadowRef: (node: any) => void;
|
|
52
|
+
}
|
|
53
|
+
type OmitProps = 'styles' | 'device' | 'scrollableRef' | 'shadowRef' | 'zoomRef' | 'zoomRefChild';
|
|
54
|
+
export interface IModalControlled<V = undefined extends string ? unknown : string> extends Omit<IModalStandAlone, OmitProps>, Omit<CustomTokenTypes<ModalBaseStylesType>, 'cts' | 'extraCt'> {
|
|
55
|
+
variant: V;
|
|
56
|
+
portalId?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface IModalUnControlled<V = undefined extends string ? unknown : string> extends IModalControlled<V> {
|
|
59
|
+
onClose?: () => void;
|
|
60
|
+
}
|
|
61
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal.js","sourceRoot":"","sources":["../../../../../src/components/modalV2/types/modal.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CommonStyleType, IconTypes, TypographyTypes } from '../../../types';
|
|
2
|
+
export type ModalBaseStylesType = {
|
|
3
|
+
footerVariant?: string;
|
|
4
|
+
popoverVariant?: string;
|
|
5
|
+
container?: CommonStyleType;
|
|
6
|
+
headerContainer?: CommonStyleType;
|
|
7
|
+
imageHeader?: IconTypes;
|
|
8
|
+
title?: TypographyTypes;
|
|
9
|
+
content?: CommonStyleType;
|
|
10
|
+
closeButtonContainer?: CommonStyleType;
|
|
11
|
+
closeButtonIcon?: IconTypes;
|
|
12
|
+
footer?: CommonStyleType;
|
|
13
|
+
closeButton?: {
|
|
14
|
+
buttonVariant?: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export type ModalStylesType<P extends string | number | symbol> = {
|
|
18
|
+
[variant in P]?: ModalBaseStylesType;
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modalTheme.js","sourceRoot":"","sources":["../../../../../src/components/modalV2/types/modalTheme.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { onlyDesktopSize } from './onlyDesktopSize';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/modalV2/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DeviceBreakpointsType } from '../../../types';
|
|
2
|
+
export const onlyDesktopSize = (device, value) => {
|
|
3
|
+
return device === DeviceBreakpointsType.DESKTOP || device === DeviceBreakpointsType.LARGE_DESKTOP
|
|
4
|
+
? value
|
|
5
|
+
: undefined;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=onlyDesktopSize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onlyDesktopSize.js","sourceRoot":"","sources":["../../../../../src/components/modalV2/utils/onlyDesktopSize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEhD,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,MAA6B,EAC7B,KAAc,EACM,EAAE;IACtB,OAAO,MAAM,KAAK,qBAAqB,CAAC,OAAO,IAAI,MAAM,KAAK,qBAAqB,CAAC,aAAa;QAC/F,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -37,7 +37,7 @@ const ToggleThreePositionComponent = ({ inputValues = {
|
|
|
37
37
|
return (_jsxs(_Fragment, { children: [_jsx(ToggleRadioSwitchStyled, { "$height": props.styles?.thumb?.height, "$width": props.styles?.thumb?.width, "aria-describedby": props.screenReaderId, "aria-labelledby": props['aria-describedby'], disabled: props.disabled, id: `${position.toLowerCase()}Input`, name: radioButtonToggleName, tabIndex: -1, type: InputTypeType.RADIO, value: getValueOfRadioButton(position), onClick: e => {
|
|
38
38
|
if (!block) {
|
|
39
39
|
e.persist();
|
|
40
|
-
props.onClick?.(
|
|
40
|
+
props.onClick?.(e, position);
|
|
41
41
|
}
|
|
42
42
|
} }), _jsx(LabelWrapperStyled, { hasThreePositions: props.hasThreePositions, showLabel: position !== POSITIONS.CENTER && position === props.togglePosition, styles: props.styles, togglePosition: props.togglePosition, children: _jsx(Label, { color: props.styles?.label?.color, dataTestId: `${props.dataTestId}${position === POSITIONS.RIGHT ? 'On' : position === POSITIONS.CENTER ? 'Na' : 'Off'}LabelOption`, inputId: `${position.toLowerCase()}Input`, textVariant: (position === POSITIONS.LEFT && props.offText?.content) ||
|
|
43
43
|
(position === POSITIONS.RIGHT && props.onText?.content)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggleThreePosition.js","sourceRoot":"","sources":["../../../../../src/components/toggle/components/toggleThreePosition.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,IAAI,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAExD,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAK1B,MAAM,4BAA4B,GAAG,CACnC,EACE,WAAW,GAAG;IACZ,eAAe,EAAE,WAAW;IAC5B,gBAAgB,EAAE,uBAAuB;IACzC,cAAc,EAAE,YAAY;CAC7B,EACD,qBAAqB,GAAG,eAAe,EACvC,WAAW,GAAG,KAAK,EACnB,GAAG,KAAK,EACa,EACvB,GAA0D,EAC7C,EAAE;IACf,MAAM,mBAAmB,GAAG,CAAC,QAAmB,EAAE,E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C,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,EAAE,EAAE,GAAG,QAAQ,CAAC,WAAW,EAAE,OAAO,EACpC,IAAI,EAAE,qBAAqB,EAC3B,QAAQ,EAAE,CAAC,CAAC,EACZ,IAAI,EAAE,aAAa,CAAC,KAAK,EACzB,KAAK,EAAE,qBAAqB,CAAC,QAAQ,CAAC,EACtC,OAAO,EAAE,CAAC,CAAC,EAAE;wBACX,IAAI,CAAC,KAAK,EAAE,CAAC;4BACX,CAAC,CAAC,OAAO,EAAE,CAAC;4BACZ,KAAK,CAAC,OAAO,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"toggleThreePosition.js","sourceRoot":"","sources":["../../../../../src/components/toggle/components/toggleThreePosition.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,IAAI,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAExD,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAK1B,MAAM,4BAA4B,GAAG,CACnC,EACE,WAAW,GAAG;IACZ,eAAe,EAAE,WAAW;IAC5B,gBAAgB,EAAE,uBAAuB;IACzC,cAAc,EAAE,YAAY;CAC7B,EACD,qBAAqB,GAAG,eAAe,EACvC,WAAW,GAAG,KAAK,EACnB,GAAG,KAAK,EACa,EACvB,GAA0D,EAC7C,EAAE;IACf,MAAM,mBAAmB,GAA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C;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,CAAC,UAAU,CAAC,4BAA4B,CAAC,CAAC"}
|
|
@@ -14,15 +14,11 @@ const ToggleTwoPositionComponent = ({ ...props }, ref) => {
|
|
|
14
14
|
return (_jsxs(ToggleWrapperStyled, { ref: ref, "aria-checked": props.togglePosition === POSITIONS.RIGHT, "aria-describedby": props['aria-describedby'], "aria-label": props['aria-label'], "aria-labelledby": props['aria-labelledby'], "data-testid": props.dataTestId, disabled: props.disabled, hasThreePositions: props.hasThreePositions, id: props.id, role: ROLES.SWITCH, styles: props.styles, tabIndex: !props.disabled ? (props.tabIndex ?? 0) : undefined, togglePosition: props.togglePosition, onClick: e => {
|
|
15
15
|
e.persist();
|
|
16
16
|
const newPosition = props.togglePosition === POSITIONS.RIGHT ? POSITIONS.LEFT : POSITIONS.RIGHT;
|
|
17
|
-
props.onClick?.(
|
|
17
|
+
props.onClick?.(e, newPosition);
|
|
18
18
|
}, onKeyDown: e => {
|
|
19
19
|
e.persist();
|
|
20
20
|
props.onKeyDown?.(e);
|
|
21
|
-
}, children: [buildContent(POSITIONS.LEFT), buildContent(POSITIONS.RIGHT), _jsx(SliderContainerStyled, { "aria-hidden": "true", "data-testid": `${props.dataTestId}Thumb`, hasThreePositions: props.hasThreePositions, styles: props.styles, togglePosition: props.togglePosition
|
|
22
|
-
e.persist();
|
|
23
|
-
const newPosition = props.togglePosition === POSITIONS.RIGHT ? POSITIONS.LEFT : POSITIONS.RIGHT;
|
|
24
|
-
props.onClick?.(newPosition, e);
|
|
25
|
-
} })] }));
|
|
21
|
+
}, children: [buildContent(POSITIONS.LEFT), buildContent(POSITIONS.RIGHT), _jsx(SliderContainerStyled, { "aria-hidden": "true", "data-testid": `${props.dataTestId}Thumb`, hasThreePositions: props.hasThreePositions, styles: props.styles, togglePosition: props.togglePosition })] }));
|
|
26
22
|
};
|
|
27
23
|
export const ToggleTwoPosition = React.forwardRef(ToggleTwoPositionComponent);
|
|
28
24
|
//# sourceMappingURL=toggleTwoPositions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggleTwoPositions.js","sourceRoot":"","sources":["../../../../../src/components/toggle/components/toggleTwoPositions.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAK1B,MAAM,0BAA0B,GAAG,CACjC,EAAE,GAAG,KAAK,EAAsB,EAChC,GAA0D,EAC7C,EAAE;IACf,MAAM,eAAe,GAAG,CAAC,QAAmB,EAAE,EAAE;QAC9C,MAAM,IAAI,GAAG,QAAQ,KAAK,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;QACzE,OAAO,KAAC,aAAa,IAAC,gBAAgB,EAAE,KAAK,CAAC,MAAM,EAAE,IAAI,KAAM,IAAI,GAAI,CAAC;IAC3E,CAAC,CAAC;IAEF,MAAM,YAAY,GAAG,CAAC,QAAmB,EAAE,EAAE;QAC3C,OAAO,CACL,8BACE,KAAC,sBAAsB,eACZ,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,YAC5B,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,GAClC,EACF,KAAC,iBAAiB,mBACH,GAAG,KAAK,CAAC,UAAU,GAAG,QAAQ,KAAK,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,EACtF,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,EAC1C,SAAS,EAAE,QAAQ,KAAK,KAAK,CAAC,cAAc,EAC5C,MAAM,EAAE,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,7 +7,7 @@ import { isKeyEnterPressed, isKeySpacePressed } from '../../utils';
|
|
|
7
7
|
import { ToggleStandAlone } from './toggleStandAlone';
|
|
8
8
|
import { getToggleState } from './utils/getToggleState';
|
|
9
9
|
const TOGGLE_STYLES = 'TOGGLE_STYLES';
|
|
10
|
-
const ToggleControlledComponent = React.forwardRef(({ variant, ctv, hasThreePositions = false, togglePosition = hasThreePositions ? POSITIONS.CENTER : POSITIONS.LEFT, disabled = false, onChange,
|
|
10
|
+
const ToggleControlledComponent = React.forwardRef(({ variant, ctv, hasThreePositions = false, togglePosition = hasThreePositions ? POSITIONS.CENTER : POSITIONS.LEFT, disabled = false, onChange, onKeyDown, ...props }, ref) => {
|
|
11
11
|
const styleVariant = useStyles(TOGGLE_STYLES, variant, ctv);
|
|
12
12
|
const handleKeyDown = e => {
|
|
13
13
|
if (!disabled && (isKeySpacePressed(e.key) || isKeyEnterPressed(e.key))) {
|
|
@@ -23,13 +23,9 @@ const ToggleControlledComponent = React.forwardRef(({ variant, ctv, hasThreePosi
|
|
|
23
23
|
onKeyDown?.(e);
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
const handleOnClick = (newPosition, e) => {
|
|
27
|
-
onChange?.(newPosition);
|
|
28
|
-
onClick?.(e);
|
|
29
|
-
};
|
|
30
26
|
const state = getToggleState(hasThreePositions, togglePosition, disabled);
|
|
31
27
|
const styles = styleVariant[state];
|
|
32
|
-
return (_jsx(ToggleStandAlone, { ...props, ref: ref, disabled: disabled, hasThreePositions: hasThreePositions, styles: styles, togglePosition: togglePosition,
|
|
28
|
+
return (_jsx(ToggleStandAlone, { ...props, ref: ref, disabled: disabled, hasThreePositions: hasThreePositions, styles: styles, togglePosition: togglePosition, onKeyDown: handleKeyDown }));
|
|
33
29
|
});
|
|
34
30
|
ToggleControlledComponent.displayName = 'ToggleControlledComponent';
|
|
35
31
|
const ToggleBoundary = (props, ref) => (_jsx(ErrorBoundary, { fallBackComponent: _jsx(FallbackComponent, { children: _jsx(ToggleStandAlone, { ...props, ref: ref }) }), children: _jsx(ToggleControlledComponent, { ...props, ref: ref }) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggleControlled.js","sourceRoot":"","sources":["../../../../src/components/toggle/toggleControlled.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,aAAa,GAAG,eAAe,CAAC;AAEtC,MAAM,yBAAyB,GAAG,KAAK,CAAC,UAAU,CAChD,CACE,EACE,OAAO,EACP,GAAG,EACH,iBAAiB,GAAG,KAAK,EACzB,cAAc,GAAG,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,EACtE,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,
|
|
1
|
+
{"version":3,"file":"toggleControlled.js","sourceRoot":"","sources":["../../../../src/components/toggle/toggleControlled.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE/D,OAAO,EAAE,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E,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IAEnC,OAAO,CACL,KAAC,gBAAgB,OACX,KAAK,EACT,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,QAAQ,EAClB,iBAAiB,EAAE,iBAAiB,EACpC,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE,aAAa,GACxB,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AACF,yBAAyB,CAAC,WAAW,GAAG,2BAA2B,CAAC;AAEpE,MAAM,cAAc,GAAG,CACrB,KAA2B,EAC3B,GAA0D,EAC7C,EAAE,CAAC,CAChB,KAAC,aAAa,IACZ,iBAAiB,EACf,KAAC,iBAAiB,cAChB,KAAC,gBAAgB,OAAM,KAAsC,EAAE,GAAG,EAAE,GAAG,GAAI,GACzD,YAGtB,KAAC,yBAAyB,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,GAAI,GACpC,CACjB,CAAC;AAEF,MAAM,gBAAgB,GAAG,KAAK,CAAC,UAAU,CAAC,cAAc,CAIlB,CAAC;AAEvC;;;;;;GAMG;AACH,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -8,7 +8,11 @@ const ToggleUnControlledComponent = ({ variant, hasThreePositions = false, defau
|
|
|
8
8
|
setTogglePosition(newPosition);
|
|
9
9
|
onChange?.(newPosition);
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
const handleClick = (e, position) => {
|
|
12
|
+
handleChange(position);
|
|
13
|
+
props.onClick?.(e, position);
|
|
14
|
+
};
|
|
15
|
+
return (_jsx(ToggleControlled, { ...props, ref: ref, hasThreePositions: hasThreePositions, togglePosition: togglePosition ?? _togglePosition, variant: variant, onChange: handleChange, onClick: handleClick }));
|
|
12
16
|
};
|
|
13
17
|
const ToggleUnControlled = React.forwardRef(ToggleUnControlledComponent);
|
|
14
18
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggleUnControlled.js","sourceRoot":"","sources":["../../../../src/components/toggle/toggleUnControlled.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,MAAM,2BAA2B,GAAG,CAClC,EACE,OAAO,EACP,iBAAiB,GAAG,KAAK,EACzB,qBAAqB,GAAG,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,EAC7E,cAAc,EACd,QAAQ,EACR,GAAG,KAAK,EACe,EACzB,GAA0D,EAC7C,EAAE;IACf,MAAM,CAAC,eAAe,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC;IAEnF,MAAM,YAAY,GAAG,CAAC,WAAsB,EAAE,EAAE;QAC9C,iBAAiB,CAAC,WAAW,CAAC,CAAC;QAC/B,QAAQ,EAAE,CAAC,WAAW,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,gBAAgB,OACX,KAAK,EACT,GAAG,EAAE,GAAG,EACR,iBAAiB,EAAE,iBAAiB,EACpC,cAAc,EAAE,cAAc,IAAI,eAAe,EACjD,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"toggleUnControlled.js","sourceRoot":"","sources":["../../../../src/components/toggle/toggleUnControlled.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,MAAM,2BAA2B,GAAG,CAClC,EACE,OAAO,EACP,iBAAiB,GAAG,KAAK,EACzB,qBAAqB,GAAG,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,EAC7E,cAAc,EACd,QAAQ,EACR,GAAG,KAAK,EACe,EACzB,GAA0D,EAC7C,EAAE;IACf,MAAM,CAAC,eAAe,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC;IAEnF,MAAM,YAAY,GAAG,CAAC,WAAsB,EAAE,EAAE;QAC9C,iBAAiB,CAAC,WAAW,CAAC,CAAC;QAC/B,QAAQ,EAAE,CAAC,WAAW,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,CAAC,CAAgC,EAAE,QAAoB,EAAE,EAAE;QAC7E,YAAY,CAAC,QAAS,CAAC,CAAC;QACxB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC/B,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,gBAAgB,OACX,KAAK,EACT,GAAG,EAAE,GAAG,EACR,iBAAiB,EAAE,iBAAiB,EACpC,cAAc,EAAE,cAAc,IAAI,eAAe,EACjD,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,WAAW,GACpB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,KAAK,CAAC,UAAU,CAAC,2BAA2B,CAIpB,CAAC;AAEpD;;;;;;;;;GASG;AACH,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -40,10 +40,10 @@ export interface IToggleStandAlone extends ToggleAriaAttributes {
|
|
|
40
40
|
disabled?: boolean;
|
|
41
41
|
blockCenter?: boolean;
|
|
42
42
|
tabIndex?: number;
|
|
43
|
-
onClick?: (
|
|
43
|
+
onClick?: (e: React.MouseEvent<HTMLElement>, position?: POSITIONS) => void;
|
|
44
44
|
onKeyDown?: React.KeyboardEventHandler<HTMLElement>;
|
|
45
45
|
}
|
|
46
|
-
type propsToOmit = 'styles' | 'togglePosition' | 'hasThreePositions'
|
|
46
|
+
type propsToOmit = 'styles' | 'togglePosition' | 'hasThreePositions';
|
|
47
47
|
/**
|
|
48
48
|
* @name IToggleControlled
|
|
49
49
|
* @description
|
|
@@ -54,7 +54,6 @@ export interface IToggleControlled<V = undefined extends string ? unknown : stri
|
|
|
54
54
|
togglePosition?: POSITIONS;
|
|
55
55
|
hasThreePositions?: boolean;
|
|
56
56
|
onChange?: (position: POSITIONS) => void;
|
|
57
|
-
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
58
57
|
}
|
|
59
58
|
/**
|
|
60
59
|
* @name IToggleUnControlled
|