@kubit-ui-web/react-components 1.4.0 → 1.5.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/carousel/hooks/useCarousel.js +2 -1
- package/dist/cjs/components/carousel/hooks/useCarousel.js.map +1 -1
- package/dist/cjs/components/dropdownSelected/dropdownSelectedStandAlone.js +1 -1
- package/dist/cjs/components/dropdownSelected/dropdownSelectedStandAlone.js.map +1 -1
- package/dist/cjs/components/dropdownSelected/dropdownSelectedUncontrolled.js +10 -0
- package/dist/cjs/components/dropdownSelected/dropdownSelectedUncontrolled.js.map +1 -1
- package/dist/cjs/components/input/components/errorMessage.js +1 -1
- package/dist/cjs/components/input/components/errorMessage.js.map +1 -1
- package/dist/cjs/components/input/components/informationAssociated.js +1 -1
- package/dist/cjs/components/input/components/informationAssociated.js.map +1 -1
- package/dist/cjs/components/input/index.js +1 -0
- package/dist/cjs/components/input/index.js.map +1 -1
- package/dist/cjs/components/input/input.styled.js +1 -1
- package/dist/cjs/components/input/input.styled.js.map +1 -1
- package/dist/cjs/components/input/inputStandAlone.js.map +1 -1
- package/dist/cjs/components/inputCurrency/inputCurrencyStandAlone.js +11 -6
- package/dist/cjs/components/inputCurrency/inputCurrencyStandAlone.js.map +1 -1
- package/dist/cjs/components/inputDropdown/index.js +3 -1
- package/dist/cjs/components/inputDropdown/index.js.map +1 -1
- package/dist/cjs/components/inputPhone/inputPhoneStandAlone.js +1 -1
- package/dist/cjs/components/inputPhone/inputPhoneStandAlone.js.map +1 -1
- package/dist/cjs/components/inputPhone/stories/argtypes.js +11 -0
- package/dist/cjs/components/inputPhone/stories/argtypes.js.map +1 -1
- package/dist/cjs/components/inputSearch/helpers/filterOptions.js +2 -1
- package/dist/cjs/components/inputSearch/helpers/filterOptions.js.map +1 -1
- package/dist/cjs/components/inputSearch/inputSearchStandAlone.js +1 -1
- package/dist/cjs/components/inputSearch/inputSearchStandAlone.js.map +1 -1
- package/dist/cjs/components/inputSignature/hook/index.js +6 -0
- package/dist/cjs/components/inputSignature/hook/index.js.map +1 -0
- package/dist/cjs/components/inputSignature/hook/useDraw.js +131 -0
- package/dist/cjs/components/inputSignature/hook/useDraw.js.map +1 -0
- package/dist/cjs/components/inputSignature/index.js +15 -0
- package/dist/cjs/components/inputSignature/index.js.map +1 -0
- package/dist/cjs/components/inputSignature/inputSignature.styled.js +19 -0
- package/dist/cjs/components/inputSignature/inputSignature.styled.js.map +1 -0
- package/dist/cjs/components/inputSignature/inputSignatureControlled.js +25 -0
- package/dist/cjs/components/inputSignature/inputSignatureControlled.js.map +1 -0
- package/dist/cjs/components/inputSignature/inputSignatureStandAlone.js +23 -0
- package/dist/cjs/components/inputSignature/inputSignatureStandAlone.js.map +1 -0
- package/dist/cjs/components/inputSignature/inputSignatureUncontrolled.js +44 -0
- package/dist/cjs/components/inputSignature/inputSignatureUncontrolled.js.map +1 -0
- package/dist/cjs/components/inputSignature/stories/argTypes.js +94 -0
- package/dist/cjs/components/inputSignature/stories/argTypes.js.map +1 -0
- package/dist/cjs/components/inputSignature/types/index.js +7 -0
- package/dist/cjs/components/inputSignature/types/index.js.map +1 -0
- package/dist/cjs/components/inputSignature/types/inputSignature.js +3 -0
- package/dist/cjs/components/inputSignature/types/inputSignature.js.map +1 -0
- package/dist/cjs/components/inputSignature/types/inputSignatureState.js +12 -0
- package/dist/cjs/components/inputSignature/types/inputSignatureState.js.map +1 -0
- package/dist/cjs/components/inputSignature/types/inputSignatureTheme.js +3 -0
- package/dist/cjs/components/inputSignature/types/inputSignatureTheme.js.map +1 -0
- package/dist/cjs/components/inputSignature/utils/__tests__/getInputSignatureState.js +27 -0
- package/dist/cjs/components/inputSignature/utils/__tests__/getInputSignatureState.js.map +1 -0
- package/dist/cjs/components/inputSignature/utils/getInputSignatureState.js +21 -0
- package/dist/cjs/components/inputSignature/utils/getInputSignatureState.js.map +1 -0
- package/dist/cjs/components/inputSignature/utils/index.js +6 -0
- package/dist/cjs/components/inputSignature/utils/index.js.map +1 -0
- package/dist/cjs/components/layout/layoutStandAlone.js +1 -1
- package/dist/cjs/components/layout/layoutStandAlone.js.map +1 -1
- package/dist/cjs/components/link/link.js +7 -3
- package/dist/cjs/components/link/link.js.map +1 -1
- package/dist/cjs/components/link/link.styled.js +16 -20
- package/dist/cjs/components/link/link.styled.js.map +1 -1
- package/dist/cjs/components/link/linkStandAlone.js +1 -1
- package/dist/cjs/components/link/linkStandAlone.js.map +1 -1
- package/dist/cjs/components/mediaProgressBar/mediaProgressBar.styled.js +14 -8
- package/dist/cjs/components/mediaProgressBar/mediaProgressBar.styled.js.map +1 -1
- package/dist/cjs/components/message/message.styled.js +2 -8
- package/dist/cjs/components/message/message.styled.js.map +1 -1
- package/dist/cjs/components/message/messageStandAlone.js +2 -2
- package/dist/cjs/components/message/messageStandAlone.js.map +1 -1
- package/dist/cjs/components/pillSelector/pillSelectorControlled.js +1 -1
- package/dist/cjs/components/pillSelector/pillSelectorControlled.js.map +1 -1
- package/dist/cjs/components/radioButtonGroup/components/infoIconWithTooltipStandAlone/infoIconWithTooltipStandAlone.js +1 -1
- package/dist/cjs/components/radioButtonGroup/components/infoIconWithTooltipStandAlone/infoIconWithTooltipStandAlone.js.map +1 -1
- package/dist/cjs/components/radioButtonGroup/components/infoIconWithTooltipStandAlone/infoIconWithTooltipStandAlone.styled.js +3 -1
- package/dist/cjs/components/radioButtonGroup/components/infoIconWithTooltipStandAlone/infoIconWithTooltipStandAlone.styled.js.map +1 -1
- package/dist/cjs/components/radioButtonGroup/radioButtonGroupStandAlone.js +1 -1
- package/dist/cjs/components/radioButtonGroup/radioButtonGroupStandAlone.js.map +1 -1
- package/dist/cjs/components/table/component/listColumnHeaderPriority.js +5 -3
- package/dist/cjs/components/table/component/listColumnHeaderPriority.js.map +1 -1
- package/dist/cjs/components/table/component/listRowHeaderPriority.js +5 -3
- package/dist/cjs/components/table/component/listRowHeaderPriority.js.map +1 -1
- package/dist/cjs/components/table/component/tableRow.js +5 -3
- package/dist/cjs/components/table/component/tableRow.js.map +1 -1
- package/dist/cjs/components/table/hooks/useContent.js +3 -3
- package/dist/cjs/components/table/hooks/useContent.js.map +1 -1
- package/dist/cjs/components/table/stories/mockTable.js +1 -1
- package/dist/cjs/components/table/stories/mockTable.js.map +1 -1
- package/dist/cjs/components/text/text.styled.js +7 -6
- package/dist/cjs/components/text/text.styled.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/stylesName.js +1 -0
- package/dist/cjs/constants/stylesName.js.map +1 -1
- package/dist/cjs/designSystem/kubit/components/input/styles.js +4 -4
- package/dist/cjs/designSystem/kubit/components/input/styles.js.map +1 -1
- package/dist/cjs/designSystem/kubit/components/inputSignature/index.js +19 -0
- package/dist/cjs/designSystem/kubit/components/inputSignature/index.js.map +1 -0
- package/dist/cjs/designSystem/kubit/components/inputSignature/styles.js +87 -0
- package/dist/cjs/designSystem/kubit/components/inputSignature/styles.js.map +1 -0
- package/dist/cjs/designSystem/kubit/components/inputSignature/variants.js +8 -0
- package/dist/cjs/designSystem/kubit/components/inputSignature/variants.js.map +1 -0
- package/dist/cjs/designSystem/kubit/components/mediaButton/styles.js +44 -34
- package/dist/cjs/designSystem/kubit/components/mediaButton/styles.js.map +1 -1
- package/dist/cjs/designSystem/kubit/components/mediaProgressBar/styles.js +34 -22
- package/dist/cjs/designSystem/kubit/components/mediaProgressBar/styles.js.map +1 -1
- package/dist/cjs/designSystem/kubit/components/message/styles.js +11 -4
- package/dist/cjs/designSystem/kubit/components/message/styles.js.map +1 -1
- package/dist/cjs/designSystem/kubit/components/pageControlAutomate/styles.js +38 -15
- package/dist/cjs/designSystem/kubit/components/pageControlAutomate/styles.js.map +1 -1
- package/dist/cjs/designSystem/kubit/components/radioButtonGroup/styles.js +6 -0
- package/dist/cjs/designSystem/kubit/components/radioButtonGroup/styles.js.map +1 -1
- package/dist/cjs/designSystem/kubit/foundations/borders.js +1 -0
- package/dist/cjs/designSystem/kubit/foundations/borders.js.map +1 -1
- package/dist/cjs/designSystem/kubitWireframe/commons/components/message/styles.js +12 -4
- package/dist/cjs/designSystem/kubitWireframe/commons/components/message/styles.js.map +1 -1
- package/dist/cjs/hooks/useInput/useInput.js +3 -3
- package/dist/cjs/hooks/useInput/useInput.js.map +1 -1
- package/dist/cjs/hooks/useStyles/useStyles.js +2 -2
- package/dist/cjs/hooks/useStyles/useStyles.js.map +1 -1
- package/dist/cjs/hooks/useStyles/useStylesV2.js +1 -1
- package/dist/cjs/hooks/useStyles/useStylesV2.js.map +1 -1
- package/dist/cjs/styles/mixins/input.mixin.js +1 -1
- package/dist/cjs/styles/mixins/input.mixin.js.map +1 -1
- package/dist/cjs/utils/getStyles/getStyles.js +8 -7
- package/dist/cjs/utils/getStyles/getStyles.js.map +1 -1
- package/dist/cjs/utils/index.js +1 -0
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/structuredClone/index.js +18 -0
- package/dist/cjs/utils/structuredClone/index.js.map +1 -0
- package/dist/cjs/utils/structuredClone/structuredClone.js +9 -0
- package/dist/cjs/utils/structuredClone/structuredClone.js.map +1 -0
- package/dist/esm/components/carousel/hooks/useCarousel.js +2 -1
- package/dist/esm/components/carousel/hooks/useCarousel.js.map +1 -1
- package/dist/esm/components/dropdownSelected/dropdownSelectedStandAlone.js +1 -1
- package/dist/esm/components/dropdownSelected/dropdownSelectedStandAlone.js.map +1 -1
- package/dist/esm/components/dropdownSelected/dropdownSelectedUncontrolled.js +10 -0
- package/dist/esm/components/dropdownSelected/dropdownSelectedUncontrolled.js.map +1 -1
- package/dist/esm/components/input/components/errorMessage.js +2 -2
- package/dist/esm/components/input/components/errorMessage.js.map +1 -1
- package/dist/esm/components/input/components/informationAssociated.js +1 -1
- package/dist/esm/components/input/components/informationAssociated.js.map +1 -1
- package/dist/esm/components/input/index.d.ts +1 -0
- package/dist/esm/components/input/index.js +1 -0
- package/dist/esm/components/input/index.js.map +1 -1
- package/dist/esm/components/input/input.styled.js +1 -1
- package/dist/esm/components/input/input.styled.js.map +1 -1
- package/dist/esm/components/input/inputStandAlone.js.map +1 -1
- package/dist/esm/components/input/types/input.d.ts +1 -1
- package/dist/esm/components/input/utils/aria.utils.d.ts +1 -1
- package/dist/esm/components/inputCurrency/inputCurrencyStandAlone.js +11 -6
- package/dist/esm/components/inputCurrency/inputCurrencyStandAlone.js.map +1 -1
- package/dist/esm/components/inputCurrency/types/inputCurrencyTheme.d.ts +6 -0
- package/dist/esm/components/inputDropdown/index.d.ts +1 -0
- package/dist/esm/components/inputDropdown/index.js +1 -0
- package/dist/esm/components/inputDropdown/index.js.map +1 -1
- package/dist/esm/components/inputPhone/inputPhoneStandAlone.js +2 -2
- package/dist/esm/components/inputPhone/inputPhoneStandAlone.js.map +1 -1
- package/dist/esm/components/inputPhone/stories/argtypes.js +11 -0
- package/dist/esm/components/inputPhone/stories/argtypes.js.map +1 -1
- package/dist/esm/components/inputPhone/types/inputPhone.d.ts +3 -1
- package/dist/esm/components/inputSearch/helpers/filterOptions.js +1 -0
- package/dist/esm/components/inputSearch/helpers/filterOptions.js.map +1 -1
- package/dist/esm/components/inputSearch/inputSearchStandAlone.js +1 -1
- package/dist/esm/components/inputSearch/inputSearchStandAlone.js.map +1 -1
- package/dist/esm/components/inputSignature/hook/index.d.ts +1 -0
- package/dist/esm/components/inputSignature/hook/index.js +2 -0
- package/dist/esm/components/inputSignature/hook/index.js.map +1 -0
- package/dist/esm/components/inputSignature/hook/useDraw.d.ts +10 -0
- package/dist/esm/components/inputSignature/hook/useDraw.js +127 -0
- package/dist/esm/components/inputSignature/hook/useDraw.js.map +1 -0
- package/dist/esm/components/inputSignature/index.d.ts +5 -0
- package/dist/esm/components/inputSignature/index.js +8 -0
- package/dist/esm/components/inputSignature/index.js.map +1 -0
- package/dist/esm/components/inputSignature/inputSignature.styled.d.ts +9 -0
- package/dist/esm/components/inputSignature/inputSignature.styled.js +13 -0
- package/dist/esm/components/inputSignature/inputSignature.styled.js.map +1 -0
- package/dist/esm/components/inputSignature/inputSignatureControlled.d.ts +7 -0
- package/dist/esm/components/inputSignature/inputSignatureControlled.js +19 -0
- package/dist/esm/components/inputSignature/inputSignatureControlled.js.map +1 -0
- package/dist/esm/components/inputSignature/inputSignatureStandAlone.d.ts +4 -0
- package/dist/esm/components/inputSignature/inputSignatureStandAlone.js +16 -0
- package/dist/esm/components/inputSignature/inputSignatureStandAlone.js.map +1 -0
- package/dist/esm/components/inputSignature/inputSignatureUncontrolled.d.ts +6 -0
- package/dist/esm/components/inputSignature/inputSignatureUncontrolled.js +38 -0
- package/dist/esm/components/inputSignature/inputSignatureUncontrolled.js.map +1 -0
- package/dist/esm/components/inputSignature/stories/argTypes.d.ts +3 -0
- package/dist/esm/components/inputSignature/stories/argTypes.js +90 -0
- package/dist/esm/components/inputSignature/stories/argTypes.js.map +1 -0
- package/dist/esm/components/inputSignature/types/index.d.ts +3 -0
- package/dist/esm/components/inputSignature/types/index.js +3 -0
- package/dist/esm/components/inputSignature/types/index.js.map +1 -0
- package/dist/esm/components/inputSignature/types/inputSignature.d.ts +32 -0
- package/dist/esm/components/inputSignature/types/inputSignature.js +2 -0
- package/dist/esm/components/inputSignature/types/inputSignature.js.map +1 -0
- package/dist/esm/components/inputSignature/types/inputSignatureState.d.ts +7 -0
- package/dist/esm/components/inputSignature/types/inputSignatureState.js +9 -0
- package/dist/esm/components/inputSignature/types/inputSignatureState.js.map +1 -0
- package/dist/esm/components/inputSignature/types/inputSignatureTheme.d.ts +20 -0
- package/dist/esm/components/inputSignature/types/inputSignatureTheme.js +2 -0
- package/dist/esm/components/inputSignature/types/inputSignatureTheme.js.map +1 -0
- package/dist/esm/components/inputSignature/utils/__tests__/getInputSignatureState.d.ts +1 -0
- package/dist/esm/components/inputSignature/utils/__tests__/getInputSignatureState.js +25 -0
- package/dist/esm/components/inputSignature/utils/__tests__/getInputSignatureState.js.map +1 -0
- package/dist/esm/components/inputSignature/utils/getInputSignatureState.d.ts +9 -0
- package/dist/esm/components/inputSignature/utils/getInputSignatureState.js +17 -0
- package/dist/esm/components/inputSignature/utils/getInputSignatureState.js.map +1 -0
- package/dist/esm/components/inputSignature/utils/index.d.ts +1 -0
- package/dist/esm/components/inputSignature/utils/index.js +2 -0
- package/dist/esm/components/inputSignature/utils/index.js.map +1 -0
- package/dist/esm/components/layout/layoutStandAlone.js +1 -1
- package/dist/esm/components/layout/layoutStandAlone.js.map +1 -1
- package/dist/esm/components/link/link.js +8 -4
- package/dist/esm/components/link/link.js.map +1 -1
- package/dist/esm/components/link/link.styled.d.ts +2 -0
- package/dist/esm/components/link/link.styled.js +16 -20
- package/dist/esm/components/link/link.styled.js.map +1 -1
- package/dist/esm/components/link/linkStandAlone.js +1 -1
- package/dist/esm/components/link/linkStandAlone.js.map +1 -1
- package/dist/esm/components/link/types/link.d.ts +4 -3
- package/dist/esm/components/mediaProgressBar/mediaProgressBar.styled.d.ts +1 -1
- package/dist/esm/components/mediaProgressBar/mediaProgressBar.styled.js +13 -7
- package/dist/esm/components/mediaProgressBar/mediaProgressBar.styled.js.map +1 -1
- package/dist/esm/components/message/message.styled.d.ts +4 -3
- package/dist/esm/components/message/message.styled.js +1 -7
- package/dist/esm/components/message/message.styled.js.map +1 -1
- package/dist/esm/components/message/messageStandAlone.js +4 -4
- package/dist/esm/components/message/messageStandAlone.js.map +1 -1
- package/dist/esm/components/message/types/message.d.ts +2 -2
- package/dist/esm/components/message/types/messageTheme.d.ts +1 -0
- package/dist/esm/components/pillSelector/pillSelectorControlled.js +1 -1
- package/dist/esm/components/pillSelector/pillSelectorControlled.js.map +1 -1
- package/dist/esm/components/radioButtonGroup/components/infoIconWithTooltipStandAlone/infoIconWithTooltipStandAlone.js +1 -1
- package/dist/esm/components/radioButtonGroup/components/infoIconWithTooltipStandAlone/infoIconWithTooltipStandAlone.js.map +1 -1
- package/dist/esm/components/radioButtonGroup/components/infoIconWithTooltipStandAlone/infoIconWithTooltipStandAlone.styled.d.ts +2 -1
- package/dist/esm/components/radioButtonGroup/components/infoIconWithTooltipStandAlone/infoIconWithTooltipStandAlone.styled.js +3 -1
- package/dist/esm/components/radioButtonGroup/components/infoIconWithTooltipStandAlone/infoIconWithTooltipStandAlone.styled.js.map +1 -1
- package/dist/esm/components/radioButtonGroup/components/radioButton/types/radioButtonTheme.d.ts +1 -0
- package/dist/esm/components/radioButtonGroup/radioButtonGroupStandAlone.js +1 -1
- package/dist/esm/components/radioButtonGroup/radioButtonGroupStandAlone.js.map +1 -1
- package/dist/esm/components/table/component/listColumnHeaderPriority.js +5 -3
- package/dist/esm/components/table/component/listColumnHeaderPriority.js.map +1 -1
- package/dist/esm/components/table/component/listRowHeaderPriority.js +5 -3
- package/dist/esm/components/table/component/listRowHeaderPriority.js.map +1 -1
- package/dist/esm/components/table/component/tableRow.js +5 -3
- package/dist/esm/components/table/component/tableRow.js.map +1 -1
- package/dist/esm/components/table/hooks/useContent.d.ts +4 -1
- package/dist/esm/components/table/hooks/useContent.js +3 -3
- package/dist/esm/components/table/hooks/useContent.js.map +1 -1
- package/dist/esm/components/table/stories/mockTable.d.ts +2 -0
- package/dist/esm/components/table/stories/mockTable.js +1 -1
- package/dist/esm/components/table/stories/mockTable.js.map +1 -1
- package/dist/esm/components/table/types/table.d.ts +2 -0
- package/dist/esm/components/text/text.styled.d.ts +3 -1
- package/dist/esm/components/text/text.styled.js +1 -1
- package/dist/esm/components/text/text.styled.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/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/input/styles.js +4 -4
- package/dist/esm/designSystem/kubit/components/input/styles.js.map +1 -1
- package/dist/esm/designSystem/kubit/components/inputSignature/index.d.ts +2 -0
- package/dist/esm/designSystem/kubit/components/inputSignature/index.js +3 -0
- package/dist/esm/designSystem/kubit/components/inputSignature/index.js.map +1 -0
- package/dist/esm/designSystem/kubit/components/inputSignature/styles.d.ts +3 -0
- package/dist/esm/designSystem/kubit/components/inputSignature/styles.js +84 -0
- package/dist/esm/designSystem/kubit/components/inputSignature/styles.js.map +1 -0
- package/dist/esm/designSystem/kubit/components/inputSignature/variants.d.ts +3 -0
- package/dist/esm/designSystem/kubit/components/inputSignature/variants.js +5 -0
- package/dist/esm/designSystem/kubit/components/inputSignature/variants.js.map +1 -0
- package/dist/esm/designSystem/kubit/components/mediaButton/styles.js +44 -34
- package/dist/esm/designSystem/kubit/components/mediaButton/styles.js.map +1 -1
- package/dist/esm/designSystem/kubit/components/mediaProgressBar/styles.js +35 -23
- package/dist/esm/designSystem/kubit/components/mediaProgressBar/styles.js.map +1 -1
- package/dist/esm/designSystem/kubit/components/message/styles.js +11 -4
- package/dist/esm/designSystem/kubit/components/message/styles.js.map +1 -1
- package/dist/esm/designSystem/kubit/components/pageControlAutomate/styles.js +38 -15
- package/dist/esm/designSystem/kubit/components/pageControlAutomate/styles.js.map +1 -1
- package/dist/esm/designSystem/kubit/components/radioButtonGroup/styles.js +7 -1
- package/dist/esm/designSystem/kubit/components/radioButtonGroup/styles.js.map +1 -1
- package/dist/esm/designSystem/kubit/foundations/borders.d.ts +1 -0
- package/dist/esm/designSystem/kubit/foundations/borders.js +1 -0
- package/dist/esm/designSystem/kubit/foundations/borders.js.map +1 -1
- package/dist/esm/designSystem/kubit/index.d.ts +1 -0
- package/dist/esm/designSystem/kubitWireframe/commons/components/message/styles.js +12 -4
- package/dist/esm/designSystem/kubitWireframe/commons/components/message/styles.js.map +1 -1
- package/dist/esm/hooks/useInput/useInput.js +3 -3
- package/dist/esm/hooks/useInput/useInput.js.map +1 -1
- package/dist/esm/hooks/useStyles/useStyles.js +1 -1
- package/dist/esm/hooks/useStyles/useStyles.js.map +1 -1
- package/dist/esm/hooks/useStyles/useStylesV2.js +1 -1
- package/dist/esm/hooks/useStyles/useStylesV2.js.map +1 -1
- package/dist/esm/styles/mixins/input.mixin.js +1 -1
- package/dist/esm/styles/mixins/input.mixin.js.map +1 -1
- package/dist/esm/types/styles/position.d.ts +1 -0
- package/dist/esm/utils/getStyles/getStyles.js +8 -7
- package/dist/esm/utils/getStyles/getStyles.js.map +1 -1
- package/dist/esm/utils/index.d.ts +1 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/structuredClone/index.d.ts +1 -0
- package/dist/esm/utils/structuredClone/index.js +2 -0
- package/dist/esm/utils/structuredClone/index.js.map +1 -0
- package/dist/esm/utils/structuredClone/structuredClone.d.ts +1 -0
- package/dist/esm/utils/structuredClone/structuredClone.js +3 -0
- package/dist/esm/utils/structuredClone/structuredClone.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useDraw = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
function isImageDataEqual(a, b) {
|
|
6
|
+
if (a.width !== b.width || a.height !== b.height) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
for (let i = 0; i < a.data.length; i++) {
|
|
10
|
+
if (a.data[i] !== b.data[i]) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
const useDraw = (onChange) => {
|
|
17
|
+
const canvasRef = (0, react_1.useRef)(null);
|
|
18
|
+
const context = (0, react_1.useRef)();
|
|
19
|
+
const isDrawing = (0, react_1.useRef)(false);
|
|
20
|
+
const isFilled = (0, react_1.useRef)(false);
|
|
21
|
+
const signatureStylesRef = (0, react_1.useRef)({ color: 'black', lineWidth: 2 });
|
|
22
|
+
const canvasInnerData = (0, react_1.useRef)(null); // reference to the canvas data before drawing
|
|
23
|
+
const resetCanvas = () => {
|
|
24
|
+
if (!canvasRef.current) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
isFilled.current = false;
|
|
28
|
+
context.current.clearRect(0, 0, canvasRef.current.width, canvasRef.current.height);
|
|
29
|
+
};
|
|
30
|
+
const setSignatureStyles = (signatureStyles) => {
|
|
31
|
+
if (!signatureStyles) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
signatureStylesRef.current.color = signatureStyles.color;
|
|
35
|
+
signatureStylesRef.current.lineWidth = signatureStyles.lineWidth;
|
|
36
|
+
};
|
|
37
|
+
const startDrawing = event => {
|
|
38
|
+
let offsetX, offsetY;
|
|
39
|
+
if (event.type === 'touchstart' && canvasRef.current) {
|
|
40
|
+
const { touches } = event;
|
|
41
|
+
const { clientX, clientY } = touches[0];
|
|
42
|
+
const { left, top } = canvasRef.current.getBoundingClientRect();
|
|
43
|
+
offsetX = clientX - left;
|
|
44
|
+
offsetY = clientY - top;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
offsetX = event.offsetX;
|
|
48
|
+
offsetY = event.offsetY;
|
|
49
|
+
}
|
|
50
|
+
canvasInnerData.current = context.current.getImageData(0, 0, canvasRef.current?.width, canvasRef.current?.height);
|
|
51
|
+
context.current.beginPath();
|
|
52
|
+
context.current.moveTo(offsetX, offsetY);
|
|
53
|
+
isDrawing.current = true;
|
|
54
|
+
};
|
|
55
|
+
const draw = event => {
|
|
56
|
+
if (!isDrawing.current)
|
|
57
|
+
return;
|
|
58
|
+
let offsetX, offsetY;
|
|
59
|
+
event.preventDefault();
|
|
60
|
+
if (event.type === 'touchmove' && canvasRef.current) {
|
|
61
|
+
const { touches } = event;
|
|
62
|
+
const { clientX, clientY } = touches[0];
|
|
63
|
+
const { left, top } = canvasRef.current.getBoundingClientRect();
|
|
64
|
+
offsetX = clientX - left;
|
|
65
|
+
offsetY = clientY - top;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
offsetX = event.offsetX;
|
|
69
|
+
offsetY = event.offsetY;
|
|
70
|
+
}
|
|
71
|
+
context.current.lineTo(offsetX, offsetY);
|
|
72
|
+
context.current.stroke();
|
|
73
|
+
};
|
|
74
|
+
const stopDrawing = () => {
|
|
75
|
+
const currentLayout = context.current.getImageData(0, 0, canvasRef.current?.width, canvasRef.current?.height);
|
|
76
|
+
context.current.closePath();
|
|
77
|
+
isDrawing.current = false;
|
|
78
|
+
if (!canvasInnerData.current) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const isEqual = isImageDataEqual(currentLayout, canvasInnerData.current);
|
|
82
|
+
if (!isEqual) {
|
|
83
|
+
const dataUrl = canvasRef.current?.toDataURL();
|
|
84
|
+
onChange?.(dataUrl);
|
|
85
|
+
isFilled.current = true;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
(0, react_1.useEffect)(() => {
|
|
89
|
+
if (canvasRef.current === null) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const canvas = canvasRef.current;
|
|
93
|
+
context.current = canvas?.getContext('2d', {
|
|
94
|
+
willReadFrequently: true,
|
|
95
|
+
});
|
|
96
|
+
if (!context.current) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
// Configuración del estilo del trazo
|
|
100
|
+
context.current.strokeStyle = signatureStylesRef.current.color;
|
|
101
|
+
context.current.lineWidth = signatureStylesRef.current.lineWidth;
|
|
102
|
+
context.current.lineCap = 'round';
|
|
103
|
+
context.current.lineJoin = 'round';
|
|
104
|
+
// Añadir event listeners al canvas
|
|
105
|
+
canvas?.addEventListener('mousedown', startDrawing);
|
|
106
|
+
canvas?.addEventListener('mousemove', draw);
|
|
107
|
+
canvas?.addEventListener('mouseup', stopDrawing);
|
|
108
|
+
canvas?.addEventListener('mouseleave', stopDrawing);
|
|
109
|
+
canvas?.addEventListener('touchstart', startDrawing);
|
|
110
|
+
canvas?.addEventListener('touchmove', draw, { passive: false });
|
|
111
|
+
canvas?.addEventListener('touchend', stopDrawing);
|
|
112
|
+
return () => {
|
|
113
|
+
// Limpiar event listeners al desmontar el componente
|
|
114
|
+
canvas?.removeEventListener('mousedown', startDrawing);
|
|
115
|
+
canvas?.removeEventListener('mousemove', draw);
|
|
116
|
+
canvas?.removeEventListener('mouseup', stopDrawing);
|
|
117
|
+
canvas?.removeEventListener('mouseleave', stopDrawing);
|
|
118
|
+
canvas?.removeEventListener('touchstart', startDrawing);
|
|
119
|
+
canvas?.removeEventListener('touchmove', draw);
|
|
120
|
+
canvas?.removeEventListener('touchend', stopDrawing);
|
|
121
|
+
};
|
|
122
|
+
}, []);
|
|
123
|
+
return {
|
|
124
|
+
canvasRef,
|
|
125
|
+
filled: isFilled.current,
|
|
126
|
+
resetCanvas,
|
|
127
|
+
setSignatureStyles,
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
exports.useDraw = useDraw;
|
|
131
|
+
//# sourceMappingURL=useDraw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDraw.js","sourceRoot":"","sources":["../../../../../src/components/inputSignature/hook/useDraw.tsx"],"names":[],"mappings":";;;AAAA,iCAA0C;AAW1C,SAAS,gBAAgB,CAAC,CAAY,EAAE,CAAY;IAClD,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;QACjD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5B,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAEM,MAAM,OAA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B,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;YAC/C,MAAM,EAAE,mBAAmB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;QACvD,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,SAAS;QACT,MAAM,EAAE,QAAQ,CAAC,OAAO;QACxB,WAAW;QACX,kBAAkB;KACnB,CAAC;AACJ,CAAC,CAAC;AA5IW,QAAA,OAAO,WA4IlB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useDraw = exports.InputSignatureControlled = exports.InputSignatureUnControlled = exports.InputSignatureState = void 0;
|
|
4
|
+
// enum
|
|
5
|
+
var types_1 = require("./types");
|
|
6
|
+
Object.defineProperty(exports, "InputSignatureState", { enumerable: true, get: function () { return types_1.InputSignatureState; } });
|
|
7
|
+
// components
|
|
8
|
+
var inputSignatureUncontrolled_1 = require("./inputSignatureUncontrolled");
|
|
9
|
+
Object.defineProperty(exports, "InputSignatureUnControlled", { enumerable: true, get: function () { return inputSignatureUncontrolled_1.InputSignatureUnControlled; } });
|
|
10
|
+
var inputSignatureControlled_1 = require("./inputSignatureControlled");
|
|
11
|
+
Object.defineProperty(exports, "InputSignatureControlled", { enumerable: true, get: function () { return inputSignatureControlled_1.InputSignatureControlled; } });
|
|
12
|
+
// hook
|
|
13
|
+
var hook_1 = require("./hook");
|
|
14
|
+
Object.defineProperty(exports, "useDraw", { enumerable: true, get: function () { return hook_1.useDraw; } });
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/inputSignature/index.ts"],"names":[],"mappings":";;;AASA,OAAO;AACP,iCAA8C;AAArC,4GAAA,mBAAmB,OAAA;AAE5B,aAAa;AACb,2EAA0E;AAAjE,wIAAA,0BAA0B,OAAA;AACnC,uEAAsE;AAA7D,oIAAA,wBAAwB,OAAA;AAEjC,OAAO;AACP,+BAAiC;AAAxB,+FAAA,OAAO,OAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InputSignaturePlaceholderStyled = exports.InputSignatureCanvasStyled = exports.InputSignatureContainerStyled = void 0;
|
|
7
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
+
const utils_1 = require("../../utils");
|
|
9
|
+
exports.InputSignatureContainerStyled = styled_components_1.default.div `
|
|
10
|
+
${({ styles }) => (0, utils_1.getStyles)(styles)}
|
|
11
|
+
`;
|
|
12
|
+
exports.InputSignatureCanvasStyled = styled_components_1.default.canvas `
|
|
13
|
+
height: 100%;
|
|
14
|
+
width: 100%;
|
|
15
|
+
`;
|
|
16
|
+
exports.InputSignaturePlaceholderStyled = styled_components_1.default.div `
|
|
17
|
+
${({ styles }) => (0, utils_1.getStyles)(styles)}
|
|
18
|
+
`;
|
|
19
|
+
//# sourceMappingURL=inputSignature.styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputSignature.styled.js","sourceRoot":"","sources":["../../../../src/components/inputSignature/inputSignature.styled.ts"],"names":[],"mappings":";;;;;;AAAA,0EAAuC;AAGvC,mCAAoC;AAMvB,QAAA,6BAA6B,GAAG,2BAAM,CAAC,GAAG,CAAiB;IACpE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,IAAA,iBAAS,EAAC,MAAM,CAAC;CACpC,CAAC;AAEW,QAAA,0BAA0B,GAAG,2BAAM,CAAC,MAAM,CAAA;;;CAGtD,CAAC;AAEW,QAAA,+BAA+B,GAAG,2BAAM,CAAC,GAAG,CAAiB;IACtE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,IAAA,iBAAS,EAAC,MAAM,CAAC;CACpC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InputSignatureControlled = exports.InputSignatureControlledComponent = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const constants_1 = require("../../constants");
|
|
10
|
+
const hooks_1 = require("../../hooks");
|
|
11
|
+
const errorBoundary_1 = require("../../provider/errorBoundary");
|
|
12
|
+
const inputSignatureStandAlone_1 = require("./inputSignatureStandAlone");
|
|
13
|
+
exports.InputSignatureControlledComponent = react_1.default.forwardRef(({ variant, setSignatureStyles, ...props }, ref) => {
|
|
14
|
+
const { signatureStyle, ...styles } = (0, hooks_1.useStylesV2)({
|
|
15
|
+
styleName: constants_1.STYLES_NAME.INPUT_SIGNATURE,
|
|
16
|
+
variantName: variant,
|
|
17
|
+
});
|
|
18
|
+
setSignatureStyles?.(signatureStyle);
|
|
19
|
+
return (0, jsx_runtime_1.jsx)(inputSignatureStandAlone_1.InputSignatureStandAlone, { ref: ref, styles: styles[props.state], ...props });
|
|
20
|
+
});
|
|
21
|
+
exports.InputSignatureControlledComponent.displayName = 'InputSignatureControlledComponent';
|
|
22
|
+
const InputSignatureBoundary = (props, ref) => ((0, jsx_runtime_1.jsx)(errorBoundary_1.ErrorBoundary, { fallBackComponent: (0, jsx_runtime_1.jsx)(errorBoundary_1.FallbackComponent, { children: (0, jsx_runtime_1.jsx)(inputSignatureStandAlone_1.InputSignatureStandAlone, { ...props, ref: ref }) }), children: (0, jsx_runtime_1.jsx)(exports.InputSignatureControlledComponent, { ...props, ref: ref }) }));
|
|
23
|
+
const InputSignatureControlled = react_1.default.forwardRef(InputSignatureBoundary);
|
|
24
|
+
exports.InputSignatureControlled = InputSignatureControlled;
|
|
25
|
+
//# sourceMappingURL=inputSignatureControlled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputSignatureControlled.js","sourceRoot":"","sources":["../../../../src/components/inputSignature/inputSignatureControlled.tsx"],"names":[],"mappings":";;;;;;;AAAA,kDAA4C;AAE5C,2CAA0C;AAC1C,mCAAsC;AACtC,4DAA4E;AAE5E,yEAAsE;AAIzD,QAAA,iCAAiC,GAAG,eAAK,CAAC,UAAU,CAC/D,CACE,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,KAAK,EAAgC,EACvE,GAAiC,EACpB,EAAE;IACf,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,EAAE,GAAG,IAAA,mBAAW,EAA0B;QACzE,SAAS,EAAE,uBAAW,CAAC,eAAe;QACtC,WAAW,EAAE,OAAiB;KAC/B,CAA4B,CAAC;IAE9B,kBAAkB,EAAE,CAAC,cAAc,CAAC,CAAC;IAErC,OAAO,uBAAC,mDAAwB,IAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,KAAM,KAAK,GAAI,CAAC;AACxF,CAAC,CACF,CAAC;AACF,yCAAiC,CAAC,WAAW,GAAG,mCAAmC,CAAC;AAEpF,MAAM,sBAAsB,GAAG,CAC7B,KAAmC,EACnC,GAAuC,EAC1B,EAAE,CAAC,CAChB,uBAAC,6BAAa,IACZ,iBAAiB,EACf,uBAAC,iCAAiB,cAChB,uBAAC,mDAAwB,OAAM,KAA8C,EAAE,GAAG,EAAE,GAAG,GAAI,GACzE,YAGtB,uBAAC,yCAAiC,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,GAAI,GAC5C,CACjB,CAAC;AAEF,MAAM,wBAAwB,GAAG,eAAK,CAAC,UAAU,CAAC,sBAAsB,CAMxD,CAAC;AAER,4DAAwB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InputSignatureStandAlone = exports.InputSignatureStandAloneComponent = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const text_1 = require("../text");
|
|
10
|
+
const inputSignature_styled_1 = require("./inputSignature.styled");
|
|
11
|
+
const types_1 = require("./types");
|
|
12
|
+
const InputSignatureStandAloneComponent = ({ styles, canvasRef, ...props }, ref) => {
|
|
13
|
+
const hasPlaceholder = props.state === types_1.InputSignatureState.DEFAULT ||
|
|
14
|
+
props.state === types_1.InputSignatureState.ERROR ||
|
|
15
|
+
props.state === types_1.InputSignatureState.DISABLED;
|
|
16
|
+
const currentText = props.state === types_1.InputSignatureState.ERROR && props.errorText
|
|
17
|
+
? props.errorText
|
|
18
|
+
: props.placeholder;
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)(inputSignature_styled_1.InputSignatureContainerStyled, { ref: ref, "data-testid": props.dataTestid, styles: styles.container, tabIndex: -1, onBlur: props.onBlurContainer, onClick: props.onClickContainer, children: [(0, jsx_runtime_1.jsx)(inputSignature_styled_1.InputSignatureCanvasStyled, { ref: canvasRef, "data-testid": `${props.dataTestid}Canvas` }), hasPlaceholder && ((0, jsx_runtime_1.jsx)(inputSignature_styled_1.InputSignaturePlaceholderStyled, { styles: styles.placeholderContainer, children: (0, jsx_runtime_1.jsx)(text_1.Text, { ...styles.placeholderText, ...currentText, children: currentText.content }) }))] }));
|
|
20
|
+
};
|
|
21
|
+
exports.InputSignatureStandAloneComponent = InputSignatureStandAloneComponent;
|
|
22
|
+
exports.InputSignatureStandAlone = react_1.default.forwardRef(exports.InputSignatureStandAloneComponent);
|
|
23
|
+
//# sourceMappingURL=inputSignatureStandAlone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputSignatureStandAlone.js","sourceRoot":"","sources":["../../../../src/components/inputSignature/inputSignatureStandAlone.tsx"],"names":[],"mappings":";;;;;;;AAAA,kDAA0B;AAE1B,kCAA+B;AAC/B,mEAIiC;AACjC,mCAAyE;AAElE,MAAM,iCAAiC,GAAG,CAC/C,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,EAA6B,EAC1D,GAAuC,EAC1B,EAAE;IACf,MAAM,cAAc,GAClB,KAAK,CAAC,KAAK,KAAK,2BAAmB,CAAC,OAAO;QAC3C,KAAK,CAAC,KAAK,KAAK,2BAAmB,CAAC,KAAK;QACzC,KAAK,CAAC,KAAK,KAAK,2BAAmB,CAAC,QAAQ,CAAC;IAE/C,MAAM,WAAW,GACf,KAAK,CAAC,KAAK,KAAK,2BAAmB,CAAC,KAAK,IAAI,KAAK,CAAC,SAAS;QAC1D,CAAC,CAAC,KAAK,CAAC,SAAS;QACjB,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC;IAExB,OAAO,CACL,wBAAC,qDAA6B,IAC5B,GAAG,EAAE,GAAG,iBACK,KAAK,CAAC,UAAU,EAC7B,MAAM,EAAE,MAAM,CAAC,SAAS,EACxB,QAAQ,EAAE,CAAC,CAAC,EACZ,MAAM,EAAE,KAAK,CAAC,eAAe,EAC7B,OAAO,EAAE,KAAK,CAAC,gBAAgB,aAE/B,uBAAC,kDAA0B,IAAC,GAAG,EAAE,SAAS,iBAAe,GAAG,KAAK,CAAC,UAAU,QAAQ,GAAI,EACvF,cAAc,IAAI,CACjB,uBAAC,uDAA+B,IAAC,MAAM,EAAE,MAAM,CAAC,oBAAoB,YAClE,uBAAC,WAAI,OAAK,MAAM,CAAC,eAAe,KAAM,WAAW,YAC9C,WAAW,CAAC,OAAO,GACf,GACyB,CACnC,IAC6B,CACjC,CAAC;AACJ,CAAC,CAAC;AAjCW,QAAA,iCAAiC,qCAiC5C;AAEW,QAAA,wBAAwB,GAAG,eAAK,CAAC,UAAU,CAAC,yCAAiC,CAAC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InputSignatureUnControlled = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const hook_1 = require("./hook");
|
|
10
|
+
const inputSignatureControlled_1 = require("./inputSignatureControlled");
|
|
11
|
+
const utils_1 = require("./utils");
|
|
12
|
+
const InputSignatureUnControlledComponent = ({ disabled, error, onChange, ...props }, ref) => {
|
|
13
|
+
// refs
|
|
14
|
+
const innerRef = react_1.default.useRef(null);
|
|
15
|
+
// custom hook
|
|
16
|
+
const { canvasRef, filled, resetCanvas, setSignatureStyles } = (0, hook_1.useDraw)(onChange);
|
|
17
|
+
// active state
|
|
18
|
+
const [active, setActive] = react_1.default.useState(false);
|
|
19
|
+
// constants
|
|
20
|
+
const state = (0, utils_1.getInputSignatureState)({ active, filled, error, disabled });
|
|
21
|
+
react_1.default.useImperativeHandle(ref, () => ({
|
|
22
|
+
get InputSignature() {
|
|
23
|
+
return innerRef.current;
|
|
24
|
+
},
|
|
25
|
+
get reset() {
|
|
26
|
+
return resetCanvas;
|
|
27
|
+
},
|
|
28
|
+
}));
|
|
29
|
+
const _onClickContainer = e => {
|
|
30
|
+
if (disabled) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
e.stopPropagation();
|
|
34
|
+
setActive(true);
|
|
35
|
+
e.currentTarget.focus();
|
|
36
|
+
};
|
|
37
|
+
const _onBlurContainer = () => {
|
|
38
|
+
setActive(false);
|
|
39
|
+
};
|
|
40
|
+
return ((0, jsx_runtime_1.jsx)(inputSignatureControlled_1.InputSignatureControlled, { ref: innerRef, canvasRef: canvasRef, setSignatureStyles: setSignatureStyles, state: state, onBlurContainer: _onBlurContainer, onClickContainer: _onClickContainer, ...props }));
|
|
41
|
+
};
|
|
42
|
+
const InputSignatureUnControlled = react_1.default.forwardRef(InputSignatureUnControlledComponent);
|
|
43
|
+
exports.InputSignatureUnControlled = InputSignatureUnControlled;
|
|
44
|
+
//# sourceMappingURL=inputSignatureUncontrolled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputSignatureUncontrolled.js","sourceRoot":"","sources":["../../../../src/components/inputSignature/inputSignatureUncontrolled.tsx"],"names":[],"mappings":";;;;;;;AAAA,kDAA0B;AAE1B,iCAAiC;AACjC,yEAAsE;AAEtE,mCAAiD;AAEjD,MAAM,mCAAmC,GAAG,CAC1C,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAkC,EACvE,GAAiD,EACpC,EAAE;IACf,OAAO;IACP,MAAM,QAAQ,GAAG,eAAK,CAAC,MAAM,CAAwB,IAAI,CAAC,CAAC;IAC3D,cAAc;IACd,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,kBAAkB,EAAE,GAAG,IAAA,cAAO,EAAC,QAAQ,CAAC,CAAC;IACjF,eAAe;IACf,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAU,KAAK,CAAC,CAAC;IAC3D,YAAY;IACZ,MAAM,KAAK,GAAG,IAAA,8BAAsB,EAAC,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;IAE1E,eAAK,CAAC,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;QACpC,IAAI,cAAc;YAChB,OAAO,QAAQ,CAAC,OAAyB,CAAC;QAC5C,CAAC;QACD,IAAI,KAAK;YACP,OAAO,WAAW,CAAC;QACrB,CAAC;KACF,CAAC,CAAC,CAAC;IAEJ,MAAM,iBAAiB,GAAG,CAAC,CAAC,EAAE;QAC5B,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO;QACT,CAAC;QACD,CAAC,CAAC,eAAe,EAAE,CAAC;QAEpB,SAAS,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC,CAAC;IAEF,MAAM,gBAAgB,GAAG,GAAG,EAAE;QAC5B,SAAS,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC,CAAC;IAEF,OAAO,CACL,uBAAC,mDAAwB,IACvB,GAAG,EAAE,QAAQ,EACb,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,kBAAkB,EACtC,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,gBAAgB,EACjC,gBAAgB,EAAE,iBAAiB,KAC/B,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,0BAA0B,GAAG,eAAK,CAAC,UAAU,CAAC,mCAAmC,CAMvE,CAAC;AAER,gEAA0B"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.argtypes = void 0;
|
|
4
|
+
const constants_1 = require("../../../constants");
|
|
5
|
+
const argtypes = (variants, themeSelected) => {
|
|
6
|
+
return {
|
|
7
|
+
theme: {
|
|
8
|
+
table: {
|
|
9
|
+
disable: true,
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
variant: {
|
|
13
|
+
type: { name: 'string', required: true },
|
|
14
|
+
control: { type: 'select' },
|
|
15
|
+
description: 'Input Signature theme variant',
|
|
16
|
+
options: Object.keys(variants[themeSelected].InputDigitPasswordVariantType || {}),
|
|
17
|
+
table: {
|
|
18
|
+
type: {
|
|
19
|
+
summary: 'string',
|
|
20
|
+
},
|
|
21
|
+
category: constants_1.CATEGORY_CONTROL.MODIFIERS,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
placeholder: {
|
|
25
|
+
type: { name: 'string', required: true },
|
|
26
|
+
control: { type: 'object' },
|
|
27
|
+
description: 'Text to show when the signature is empty',
|
|
28
|
+
table: {
|
|
29
|
+
type: {
|
|
30
|
+
summary: 'InputSignatureText',
|
|
31
|
+
},
|
|
32
|
+
category: constants_1.CATEGORY_CONTROL.CONTENT,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
errorText: {
|
|
36
|
+
type: { name: 'string' },
|
|
37
|
+
control: { type: 'object' },
|
|
38
|
+
description: 'Text to show when the signature is invalid',
|
|
39
|
+
table: {
|
|
40
|
+
type: {
|
|
41
|
+
summary: 'InputSignatureText',
|
|
42
|
+
},
|
|
43
|
+
category: constants_1.CATEGORY_CONTROL.CONTENT,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
onChange: {
|
|
47
|
+
description: 'Function that is called when drawed on the component',
|
|
48
|
+
control: false,
|
|
49
|
+
table: {
|
|
50
|
+
type: {
|
|
51
|
+
summary: '(value: string) => void',
|
|
52
|
+
},
|
|
53
|
+
category: constants_1.CATEGORY_CONTROL.FUNCTIONS,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
disabled: {
|
|
57
|
+
type: { name: 'boolean' },
|
|
58
|
+
control: { type: 'boolean' },
|
|
59
|
+
description: 'Prop to disable the component',
|
|
60
|
+
table: {
|
|
61
|
+
type: {
|
|
62
|
+
summary: 'boolean',
|
|
63
|
+
},
|
|
64
|
+
defaultValue: { summary: false },
|
|
65
|
+
category: constants_1.CATEGORY_CONTROL.MODIFIERS,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
error: {
|
|
69
|
+
type: { name: 'boolean' },
|
|
70
|
+
control: { type: 'boolean' },
|
|
71
|
+
description: 'Prop to set the error state',
|
|
72
|
+
table: {
|
|
73
|
+
type: {
|
|
74
|
+
summary: 'boolean',
|
|
75
|
+
},
|
|
76
|
+
defaultValue: { summary: false },
|
|
77
|
+
category: constants_1.CATEGORY_CONTROL.MODIFIERS,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
dataTestId: {
|
|
81
|
+
control: { type: 'text' },
|
|
82
|
+
type: { name: 'string' },
|
|
83
|
+
description: 'Test id of the component. Internal components will concatenate from this test id',
|
|
84
|
+
table: {
|
|
85
|
+
type: {
|
|
86
|
+
summary: 'string',
|
|
87
|
+
},
|
|
88
|
+
category: constants_1.CATEGORY_CONTROL.TESTING,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
exports.argtypes = argtypes;
|
|
94
|
+
//# sourceMappingURL=argTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"argTypes.js","sourceRoot":"","sources":["../../../../../src/components/inputSignature/stories/argTypes.ts"],"names":[],"mappings":";;;AAAA,2CAA+C;AAIxC,MAAM,QAAQ,GAAG,CAAC,QAA8B,EAAE,aAAqB,EAAkB,EAAE;IAChG,OAAO;QACL,KAAK,EAAE;YACL,KAAK,EAAE;gBACL,OAAO,EAAE,IAAI;aACd;SACF;QACD,OAAO,EAAE;YACP,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YACxC,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC3B,WAAW,EAAE,+BAA+B;YAC5C,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,6BAA6B,IAAI,EAAE,CAAC;YACjF,KAAK,EAAE;gBACL,IAAI,EAAE;oBACJ,OAAO,EAAE,QAAQ;iBAClB;gBACD,QAAQ,EAAE,4BAAgB,CAAC,SAAS;aACrC;SACF;QACD,WAAW,EAAE;YACX,IAAI,EAAE,EAAE,IAAI,EA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EAAE,OAAO,EAAE,KAAK,EAAE;gBAChC,QAAQ,EAAE,4BAAgB,CAAC,SAAS;aACrC;SACF;QACD,UAAU,EAAE;YACV,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;YACzB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACxB,WAAW,EACT,kFAAkF;YACpF,KAAK,EAAE;gBACL,IAAI,EAAE;oBACJ,OAAO,EAAE,QAAQ;iBAClB;gBACD,QAAQ,EAAE,4BAAgB,CAAC,OAAO;aACnC;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AAxFW,QAAA,QAAQ,YAwFnB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InputSignatureState = void 0;
|
|
4
|
+
// enum
|
|
5
|
+
var inputSignatureState_1 = require("./inputSignatureState");
|
|
6
|
+
Object.defineProperty(exports, "InputSignatureState", { enumerable: true, get: function () { return inputSignatureState_1.InputSignatureState; } });
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/inputSignature/types/index.ts"],"names":[],"mappings":";;;AAYA,OAAO;AACP,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputSignature.js","sourceRoot":"","sources":["../../../../../src/components/inputSignature/types/inputSignature.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InputSignatureState = void 0;
|
|
4
|
+
var InputSignatureState;
|
|
5
|
+
(function (InputSignatureState) {
|
|
6
|
+
InputSignatureState["DEFAULT"] = "DEFAULT";
|
|
7
|
+
InputSignatureState["ACTIVE"] = "ACTIVE";
|
|
8
|
+
InputSignatureState["FILLED"] = "FILLED";
|
|
9
|
+
InputSignatureState["ERROR"] = "ERROR";
|
|
10
|
+
InputSignatureState["DISABLED"] = "DISABLED";
|
|
11
|
+
})(InputSignatureState || (exports.InputSignatureState = InputSignatureState = {}));
|
|
12
|
+
//# sourceMappingURL=inputSignatureState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputSignatureState.js","sourceRoot":"","sources":["../../../../../src/components/inputSignature/types/inputSignatureState.ts"],"names":[],"mappings":";;;AAAA,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,wCAAiB,CAAA;IACjB,wCAAiB,CAAA;IACjB,sCAAe,CAAA;IACf,4CAAqB,CAAA;AACvB,CAAC,EANW,mBAAmB,mCAAnB,mBAAmB,QAM9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputSignatureTheme.js","sourceRoot":"","sources":["../../../../../src/components/inputSignature/types/inputSignatureTheme.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const types_1 = require("../../types");
|
|
4
|
+
const getInputSignatureState_1 = require("../getInputSignatureState");
|
|
5
|
+
describe('getInputSignatureState', () => {
|
|
6
|
+
it('should return DISABLED if disabled is true', () => {
|
|
7
|
+
const state = (0, getInputSignatureState_1.getInputSignatureState)({ disabled: true, active: false, filled: false });
|
|
8
|
+
expect(state).toBe(types_1.InputSignatureState.DISABLED);
|
|
9
|
+
});
|
|
10
|
+
it('should return ERROR if error is true', () => {
|
|
11
|
+
const state = (0, getInputSignatureState_1.getInputSignatureState)({ error: true, active: false, filled: false });
|
|
12
|
+
expect(state).toBe(types_1.InputSignatureState.ERROR);
|
|
13
|
+
});
|
|
14
|
+
it('should return ACTIVE if active is true', () => {
|
|
15
|
+
const state = (0, getInputSignatureState_1.getInputSignatureState)({ active: true, filled: false });
|
|
16
|
+
expect(state).toBe(types_1.InputSignatureState.ACTIVE);
|
|
17
|
+
});
|
|
18
|
+
it('should return FILLED if filled is true', () => {
|
|
19
|
+
const state = (0, getInputSignatureState_1.getInputSignatureState)({ active: false, filled: true });
|
|
20
|
+
expect(state).toBe(types_1.InputSignatureState.FILLED);
|
|
21
|
+
});
|
|
22
|
+
it('should return DEFAULT if none of the conditions are met', () => {
|
|
23
|
+
const state = (0, getInputSignatureState_1.getInputSignatureState)({ active: false, filled: false });
|
|
24
|
+
expect(state).toBe(types_1.InputSignatureState.DEFAULT);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=getInputSignatureState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getInputSignatureState.js","sourceRoot":"","sources":["../../../../../../src/components/inputSignature/utils/__tests__/getInputSignatureState.ts"],"names":[],"mappings":";;AAAA,uCAAkD;AAClD,sEAAmE;AAEnE,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QACpD,MAAM,KAAK,GAAG,IAAA,+CAAsB,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QACvF,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,2BAAmB,CAAC,QAAQ,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC9C,MAAM,KAAK,GAAG,IAAA,+CAAsB,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QACpF,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,2BAAmB,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,KAAK,GAAG,IAAA,+CAAsB,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QACtE,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,2BAAmB,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,KAAK,GAAG,IAAA,+CAAsB,EAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QACtE,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,2BAAmB,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;QACjE,MAAM,KAAK,GAAG,IAAA,+CAAsB,EAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QACvE,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,2BAAmB,CAAC,OAAO,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInputSignatureState = void 0;
|
|
4
|
+
const inputSignatureState_1 = require("../types/inputSignatureState");
|
|
5
|
+
const getInputSignatureState = ({ active, filled, error, disabled, }) => {
|
|
6
|
+
if (disabled) {
|
|
7
|
+
return inputSignatureState_1.InputSignatureState.DISABLED;
|
|
8
|
+
}
|
|
9
|
+
else if (error) {
|
|
10
|
+
return inputSignatureState_1.InputSignatureState.ERROR;
|
|
11
|
+
}
|
|
12
|
+
else if (active) {
|
|
13
|
+
return inputSignatureState_1.InputSignatureState.ACTIVE;
|
|
14
|
+
}
|
|
15
|
+
else if (filled) {
|
|
16
|
+
return inputSignatureState_1.InputSignatureState.FILLED;
|
|
17
|
+
}
|
|
18
|
+
return inputSignatureState_1.InputSignatureState.DEFAULT;
|
|
19
|
+
};
|
|
20
|
+
exports.getInputSignatureState = getInputSignatureState;
|
|
21
|
+
//# sourceMappingURL=getInputSignatureState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getInputSignatureState.js","sourceRoot":"","sources":["../../../../../src/components/inputSignature/utils/getInputSignatureState.ts"],"names":[],"mappings":";;;AAAA,sEAAmE;AAS5D,MAAM,sBAAsB,GAAG,CAAC,EACrC,MAAM,EACN,MAAM,EACN,KAAK,EACL,QAAQ,GACe,EAAuB,EAAE;IAChD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,yCAAmB,CAAC,QAAQ,CAAC;IACtC,CAAC;SAAM,IAAI,KAAK,EAAE,CAAC;QACjB,OAAO,yCAAmB,CAAC,KAAK,CAAC;IACnC,CAAC;SAAM,IAAI,MAAM,EAAE,CAAC;QAClB,OAAO,yCAAmB,CAAC,MAAM,CAAC;IACpC,CAAC;SAAM,IAAI,MAAM,EAAE,CAAC;QAClB,OAAO,yCAAmB,CAAC,MAAM,CAAC;IACpC,CAAC;IAED,OAAO,yCAAmB,CAAC,OAAO,CAAC;AACrC,CAAC,CAAC;AAjBW,QAAA,sBAAsB,0BAiBjC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInputSignatureState = void 0;
|
|
4
|
+
var getInputSignatureState_1 = require("./getInputSignatureState");
|
|
5
|
+
Object.defineProperty(exports, "getInputSignatureState", { enumerable: true, get: function () { return getInputSignatureState_1.getInputSignatureState; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/inputSignature/utils/index.ts"],"names":[],"mappings":";;;AAAA,mEAAkE;AAAzD,gIAAA,sBAAsB,OAAA"}
|
|
@@ -11,7 +11,7 @@ const LayoutStandAlone = ({ headerContent, mainContent, asideContent, styles, ba
|
|
|
11
11
|
const columnsConfiguration = columnsConfig ?? styles.defaultColumnsConfig;
|
|
12
12
|
const gridConfiguration = gridConfig ?? styles.gridConfig;
|
|
13
13
|
const { header, main, aside, footer } = columnsConfiguration ?? {};
|
|
14
|
-
return ((0, jsx_runtime_1.jsxs)(layout_styled_1.LayoutContainer, { "$paddingBottom": styles.padding_botom_size, backgroundColor: backgroundColor, children: [headerContent && ((0, jsx_runtime_1.jsx)(grid_1.Grid, { addPaddingForLayout: true, config: gridConfiguration, "data-testid": `${dataTestId}Header`, children: (0, jsx_runtime_1.jsx)(grid_1.GridItem, { as: types_1.LayoutRoleType.header, desktop: header?.[breakpoints_1.DeviceBreakpointsType.DESKTOP], mobile: header?.[breakpoints_1.DeviceBreakpointsType.MOBILE], tablet: header?.[breakpoints_1.DeviceBreakpointsType.TABLET], children: headerContent }) })), (0, jsx_runtime_1.jsxs)(grid_1.Grid, { addPaddingForLayout: true, config: gridConfiguration, children: [(0, jsx_runtime_1.jsx)(grid_1.GridItem, { as: types_1.LayoutRoleType.main, desktop: asideContent ? main?.[breakpoints_1.DeviceBreakpointsType.DESKTOP] : main?.DESKTOP_FULL, mobile: main?.[breakpoints_1.DeviceBreakpointsType.MOBILE], tablet: main?.[breakpoints_1.DeviceBreakpointsType.TABLET], children: mainContent }), asideContent && ((0, jsx_runtime_1.jsx)(grid_1.GridItem, { as: types_1.LayoutRoleType.aside, desktop: aside?.[breakpoints_1.DeviceBreakpointsType.DESKTOP], mobile: aside?.[breakpoints_1.DeviceBreakpointsType.MOBILE], tablet: aside?.[breakpoints_1.DeviceBreakpointsType.TABLET], children: asideContent }))] }), footerContent && footer && ((0, jsx_runtime_1.jsx)(grid_1.Grid, { addPaddingForLayout: true, config: gridConfiguration, children: (0, jsx_runtime_1.jsx)(grid_1.GridItem, { as: types_1.LayoutRoleType.footer, desktop: footer[breakpoints_1.DeviceBreakpointsType.DESKTOP], mobile: footer[breakpoints_1.DeviceBreakpointsType.MOBILE], tablet: footer[breakpoints_1.DeviceBreakpointsType.TABLET], children: footerContent }) }))] }));
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)(layout_styled_1.LayoutContainer, { "$paddingBottom": styles.padding_botom_size, backgroundColor: backgroundColor, children: [headerContent && ((0, jsx_runtime_1.jsx)(grid_1.Grid, { addPaddingForLayout: true, config: gridConfiguration, "data-testid": `${dataTestId}Header`, children: (0, jsx_runtime_1.jsx)(grid_1.GridItem, { as: types_1.LayoutRoleType.header, desktop: header?.[breakpoints_1.DeviceBreakpointsType.DESKTOP], mobile: header?.[breakpoints_1.DeviceBreakpointsType.MOBILE], tablet: header?.[breakpoints_1.DeviceBreakpointsType.TABLET], children: headerContent }) })), (0, jsx_runtime_1.jsxs)(grid_1.Grid, { addPaddingForLayout: true, config: gridConfiguration, "data-testid": `${dataTestId}Main`, children: [(0, jsx_runtime_1.jsx)(grid_1.GridItem, { as: types_1.LayoutRoleType.main, desktop: asideContent ? main?.[breakpoints_1.DeviceBreakpointsType.DESKTOP] : main?.DESKTOP_FULL, mobile: main?.[breakpoints_1.DeviceBreakpointsType.MOBILE], tablet: main?.[breakpoints_1.DeviceBreakpointsType.TABLET], children: mainContent }), asideContent && ((0, jsx_runtime_1.jsx)(grid_1.GridItem, { as: types_1.LayoutRoleType.aside, "data-testid": `${dataTestId}Aside`, desktop: aside?.[breakpoints_1.DeviceBreakpointsType.DESKTOP], mobile: aside?.[breakpoints_1.DeviceBreakpointsType.MOBILE], tablet: aside?.[breakpoints_1.DeviceBreakpointsType.TABLET], children: asideContent }))] }), footerContent && footer && ((0, jsx_runtime_1.jsx)(grid_1.Grid, { addPaddingForLayout: true, config: gridConfiguration, "data-testid": `${dataTestId}Footer`, children: (0, jsx_runtime_1.jsx)(grid_1.GridItem, { as: types_1.LayoutRoleType.footer, desktop: footer[breakpoints_1.DeviceBreakpointsType.DESKTOP], mobile: footer[breakpoints_1.DeviceBreakpointsType.MOBILE], tablet: footer[breakpoints_1.DeviceBreakpointsType.TABLET], children: footerContent }) }))] }));
|
|
15
15
|
};
|
|
16
16
|
exports.LayoutStandAlone = LayoutStandAlone;
|
|
17
17
|
//# sourceMappingURL=layoutStandAlone.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layoutStandAlone.js","sourceRoot":"","sources":["../../../../src/components/layout/layoutStandAlone.tsx"],"names":[],"mappings":";;;;AAGA,YAAY;AACZ,4CAAmD;AACnD,qDAA4D;AAE5D,mDAAkD;AAClD,mCAA4D;AAErD,MAAM,gBAAgB,GAAG,CAAC,EAC/B,aAAa,EACb,WAAW,EACX,YAAY,EACZ,MAAM,EACN,eAAe,EACf,aAAa,EACb,UAAU,EACV,aAAa,EACb,UAAU,GAAG,QAAQ,GACH,EAAe,EAAE;IACnC,MAAM,oBAAoB,GAAG,aAAa,IAAI,MAAM,CAAC,oBAAoB,CAAC;IAC1E,MAAM,iBAAiB,GAAG,UAAU,IAAI,MAAM,CAAC,UAAU,CAAC;IAC1D,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,oBAAoB,IAAI,EAAE,CAAC;IAEnE,OAAO,CACL,wBAAC,+BAAe,sBAAiB,MAAM,CAAC,kBAAkB,EAAE,eAAe,EAAE,eAAe,aACzF,aAAa,IAAI,CAChB,uBAAC,WAAI,IAAC,mBAAmB,QAAC,MAAM,EAAE,iBAAiB,iBAAe,GAAG,UAAU,QAAQ,YACrF,uBAAC,eAAQ,IACP,EAAE,EAAE,sBAAc,CAAC,MAAM,EACzB,OAAO,EAAE,MAAM,EAAE,CAAC,mCAAqB,CAAC,OAAO,CAAC,EAChD,MAAM,EAAE,MAAM,EAAE,CAAC,mCAAqB,CAAC,MAAM,CAAC,EAC9C,MAAM,EAAE,MAAM,EAAE,CAAC,mCAAqB,CAAC,MAAM,CAAC,YAE7C,aAAa,GACL,GACN,CACR,EACD,wBAAC,WAAI,IAAC,mBAAmB,QAAC,MAAM,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"layoutStandAlone.js","sourceRoot":"","sources":["../../../../src/components/layout/layoutStandAlone.tsx"],"names":[],"mappings":";;;;AAGA,YAAY;AACZ,4CAAmD;AACnD,qDAA4D;AAE5D,mDAAkD;AAClD,mCAA4D;AAErD,MAAM,gBAAgB,GAAG,CAAC,EAC/B,aAAa,EACb,WAAW,EACX,YAAY,EACZ,MAAM,EACN,eAAe,EACf,aAAa,EACb,UAAU,EACV,aAAa,EACb,UAAU,GAAG,QAAQ,GACH,EAAe,EAAE;IACnC,MAAM,oBAAoB,GAAG,aAAa,IAAI,MAAM,CAAC,oBAAoB,CAAC;IAC1E,MAAM,iBAAiB,GAAG,UAAU,IAAI,MAAM,CAAC,UAAU,CAAC;IAC1D,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,oBAAoB,IAAI,EAAE,CAAC;IAEnE,OAAO,CACL,wBAAC,+BAAe,sBAAiB,MAAM,CAAC,kBAAkB,EAAE,eAAe,EAAE,eAAe,aACzF,aAAa,IAAI,CAChB,uBAAC,WAAI,IAAC,mBAAmB,QAAC,MAAM,EAAE,iBAAiB,iBAAe,GAAG,UAAU,QAAQ,YACrF,uBAAC,eAAQ,IACP,EAAE,EAAE,sBAAc,CAAC,MAAM,EACzB,OAAO,EAAE,MAAM,EAAE,CAAC,mCAAqB,CAAC,OAAO,CAAC,EAChD,MAAM,EAAE,MAAM,EAAE,CAAC,mCAAqB,CAAC,MAAM,CAAC,EAC9C,MAAM,EAAE,MAAM,EAAE,CAAC,mCAAqB,CAAC,MAAM,CAAC,YAE7C,aAAa,GACL,GACN,CACR,EACD,wBAAC,WAAI,IAAC,mBAAmB,QAAC,MAAM,EAAE,iBAAiB,iBAAe,GAAG,UAAU,MAAM,aACnF,uBAAC,eAAQ,IACP,EAAE,EAAE,sBAAc,CAAC,IAAI,EACvB,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,mCAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,YAAY,EAClF,MAAM,EAAE,IAAI,EAAE,CAAC,mCAAqB,CAAC,MAAM,CAAC,EAC5C,MAAM,EAAE,IAAI,EAAE,CAAC,mCAAqB,CAAC,MAAM,CAAC,YAE3C,WAAW,GACH,EACV,YAAY,IAAI,CACf,uBAAC,eAAQ,IACP,EAAE,EAAE,sBAAc,CAAC,KAAK,iBACX,GAAG,UAAU,OAAO,EACjC,OAAO,EAAE,KAAK,EAAE,CAAC,mCAAqB,CAAC,OAAO,CAAC,EAC/C,MAAM,EAAE,KAAK,EAAE,CAAC,mCAAqB,CAAC,MAAM,CAAC,EAC7C,MAAM,EAAE,KAAK,EAAE,CAAC,mCAAqB,CAAC,MAAM,CAAC,YAE5C,YAAY,GACJ,CACZ,IACI,EACN,aAAa,IAAI,MAAM,IAAI,CAC1B,uBAAC,WAAI,IAAC,mBAAmB,QAAC,MAAM,EAAE,iBAAiB,iBAAe,GAAG,UAAU,QAAQ,YACrF,uBAAC,eAAQ,IACP,EAAE,EAAE,sBAAc,CAAC,MAAM,EACzB,OAAO,EAAE,MAAM,CAAC,mCAAqB,CAAC,OAAO,CAAC,EAC9C,MAAM,EAAE,MAAM,CAAC,mCAAqB,CAAC,MAAM,CAAC,EAC5C,MAAM,EAAE,MAAM,CAAC,mCAAqB,CAAC,MAAM,CAAC,YAE3C,aAAa,GACL,GACN,CACR,IACe,CACnB,CAAC;AACJ,CAAC,CAAC;AAhEW,QAAA,gBAAgB,oBAgE3B"}
|
|
@@ -36,15 +36,19 @@ const genericComponentsProvider_1 = require("../../provider/genericComponents/ge
|
|
|
36
36
|
const disabled_1 = require("./helpers/disabled");
|
|
37
37
|
const linkStandAlone_1 = require("./linkStandAlone");
|
|
38
38
|
const types_2 = require("./types");
|
|
39
|
-
const LinkComponent = React.forwardRef(({ action = types_2.LinkActionType.NAVIGATION, decoration = types_1.TextDecorationType.AUTO, alignCenter = false, disabled = false, color: colorLinkProp, textVariant
|
|
39
|
+
const LinkComponent = React.forwardRef(({ action = types_2.LinkActionType.NAVIGATION, decoration = types_1.TextDecorationType.AUTO, alignCenter = false, disabled = false, color: colorLinkProp, textVariant, role: roleProp, variant, ctv, ...props }, ref) => {
|
|
40
40
|
const { LINK: genericLinkComponent } = (0, genericComponentsProvider_1.useGenericComponents)();
|
|
41
41
|
const { role } = (0, disabled_1.disabledLink)(disabled, roleProp);
|
|
42
42
|
const ariaDisabled = disabled || undefined;
|
|
43
43
|
const actionStyles = (0, useStyles_1.useStyles)(constants_1.STYLES_NAME.LINK, action, ctv?.[action]);
|
|
44
|
+
const textStyles = (0, hooks_1.useStylesV2)({
|
|
45
|
+
styleName: constants_1.STYLES_NAME.TEXT,
|
|
46
|
+
variantName: textVariant,
|
|
47
|
+
isOptional: true,
|
|
48
|
+
});
|
|
44
49
|
const styles = (variant && actionStyles?.[variant]) || {};
|
|
45
50
|
const isInline = action === types_2.LinkActionType.INLINE;
|
|
46
51
|
const textDecoration = isInline ? types_1.TextDecorationType.UNDERLINE : decoration;
|
|
47
|
-
const textVariant = textVariantProp ?? styles.container?.font_variant;
|
|
48
52
|
const weight = props.weight || styles.container?.font_weight;
|
|
49
53
|
const color = colorLinkProp || styles.font_color || styles.container?.color;
|
|
50
54
|
const { state, setRef } = (0, hooks_1.useManageState)({
|
|
@@ -52,7 +56,7 @@ const LinkComponent = React.forwardRef(({ action = types_2.LinkActionType.NAVIGA
|
|
|
52
56
|
ref,
|
|
53
57
|
disabled,
|
|
54
58
|
});
|
|
55
|
-
return ((0, jsx_runtime_1.jsx)(linkStandAlone_1.LinkStandAlone, { ...props, ref: setRef, action: action, alignCenter: alignCenter, "aria-disabled": ariaDisabled, color: color, component: genericLinkComponent, decoration: textDecoration, role: role, state: state, styles: styles,
|
|
59
|
+
return ((0, jsx_runtime_1.jsx)(linkStandAlone_1.LinkStandAlone, { ...props, ref: setRef, action: action, alignCenter: alignCenter, "aria-disabled": ariaDisabled, color: color, component: genericLinkComponent, decoration: textDecoration, role: role, state: state, styles: styles, textStyles: textStyles, weight: weight }));
|
|
56
60
|
});
|
|
57
61
|
LinkComponent.displayName = 'LinkComponent';
|
|
58
62
|
const LinkBoundary = (props, ref) => ((0, jsx_runtime_1.jsx)(errorBoundary_1.ErrorBoundary, { fallBackComponent: (0, jsx_runtime_1.jsx)(errorBoundary_1.FallbackComponent, { children: (0, jsx_runtime_1.jsx)(linkStandAlone_1.LinkStandAlone, { ...props, ref: ref }) }), children: (0, jsx_runtime_1.jsx)(LinkComponent, { ...props, ref: ref }) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../../../src/components/link/link.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA+B;AAC/B,6CAA+B;AAE/B,
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../../../src/components/link/link.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA+B;AAC/B,6CAA+B;AAE/B,mDAAoF;AACpF,2CAA0C;AAC1C,mCAA8D;AAC9D,2DAAwD;AACxD,4DAA4E;AAC5E,sGAA8F;AAE9F,iDAAkD;AAClD,qDAAkD;AAClD,mCAMiB;AAEjB,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CACpC,CACE,EACE,MAAM,GAAG,sBAAc,CAAC,UAAU,EAClC,UAAU,GAAG,0BAAkB,CAAC,IAAI,EACpC,WAAW,GAAG,KAAK,EACnB,QAAQ,GAAG,KAAK,EAChB,KAAK,EAAE,aAAa,EACpB,WAAW,EACX,IAAI,EAAE,QAAQ,EACd,OAAO,EACP,GAAG,EACH,GAAG,KAAK,EACF,E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