@fattureincloud-mobile/fic-mobile-ds 1.0.0 → 1.2.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/LICENSE +20 -0
- package/README.md +31 -0
- package/lib/commonjs/components/Tag/Tag.js +44 -0
- package/lib/commonjs/components/Tag/Tag.js.map +1 -0
- package/lib/commonjs/components/Tag/index.js +14 -0
- package/lib/commonjs/components/Tag/index.js.map +1 -0
- package/lib/commonjs/components/Touchable/Touchable.js +79 -0
- package/lib/commonjs/components/Touchable/Touchable.js.map +1 -0
- package/lib/commonjs/components/Touchable/index.js +14 -0
- package/lib/commonjs/components/Touchable/index.js.map +1 -0
- package/lib/commonjs/components/base/DatePicker/DatePicker.js +257 -0
- package/lib/commonjs/components/base/DatePicker/DatePicker.js.map +1 -0
- package/lib/commonjs/components/base/DatePicker/index.js +14 -0
- package/lib/commonjs/components/base/DatePicker/index.js.map +1 -0
- package/lib/commonjs/components/base/HeaderArrows/HeaderArrows.js +77 -0
- package/lib/commonjs/components/base/HeaderArrows/HeaderArrows.js.map +1 -0
- package/lib/commonjs/components/base/HeaderArrows/index.js +14 -0
- package/lib/commonjs/components/base/HeaderArrows/index.js.map +1 -0
- package/lib/commonjs/components/buttons/FicButton/FicButton.js +42 -0
- package/lib/commonjs/components/buttons/FicButton/FicButton.js.map +1 -0
- package/lib/commonjs/components/buttons/FicButton/FicButton.types.js +6 -0
- package/lib/commonjs/components/buttons/FicButton/FicButton.types.js.map +1 -0
- package/lib/commonjs/components/buttons/FicButton/FicButtonIcon.js +104 -0
- package/lib/commonjs/components/buttons/FicButton/FicButtonIcon.js.map +1 -0
- package/lib/commonjs/components/buttons/FicButton/FicButtonPrimary.js +121 -0
- package/lib/commonjs/components/buttons/FicButton/FicButtonPrimary.js.map +1 -0
- package/lib/commonjs/components/buttons/FicButton/FicButtonSecondary.js +123 -0
- package/lib/commonjs/components/buttons/FicButton/FicButtonSecondary.js.map +1 -0
- package/lib/commonjs/components/buttons/FicButton/FicButtonTertiary.js +144 -0
- package/lib/commonjs/components/buttons/FicButton/FicButtonTertiary.js.map +1 -0
- package/lib/commonjs/components/buttons/FicButton/constants.js +23 -0
- package/lib/commonjs/components/buttons/FicButton/constants.js.map +1 -0
- package/lib/commonjs/components/buttons/FicButton/index.js +14 -0
- package/lib/commonjs/components/buttons/FicButton/index.js.map +1 -0
- package/lib/commonjs/components/buttons/FicButton/themes/dark.js +291 -0
- package/lib/commonjs/components/buttons/FicButton/themes/dark.js.map +1 -0
- package/lib/commonjs/components/buttons/FicButton/themes/index.js +14 -0
- package/lib/commonjs/components/buttons/FicButton/themes/index.js.map +1 -0
- package/lib/commonjs/components/buttons/FicButton/themes/light.js +311 -0
- package/lib/commonjs/components/buttons/FicButton/themes/light.js.map +1 -0
- package/lib/commonjs/components/buttons/FicButtonGroup/FicButtonGroup.js +54 -0
- package/lib/commonjs/components/buttons/FicButtonGroup/FicButtonGroup.js.map +1 -0
- package/lib/commonjs/components/buttons/FicButtonGroup/FicButtonGroup.types.js +6 -0
- package/lib/commonjs/components/buttons/FicButtonGroup/FicButtonGroup.types.js.map +1 -0
- package/lib/commonjs/components/buttons/FicButtonGroup/index.js +14 -0
- package/lib/commonjs/components/buttons/FicButtonGroup/index.js.map +1 -0
- package/lib/commonjs/components/notifications/Banner/Banner.js +96 -0
- package/lib/commonjs/components/notifications/Banner/Banner.js.map +1 -0
- package/lib/commonjs/components/notifications/Banner/Banner.types.js +6 -0
- package/lib/commonjs/components/notifications/Banner/Banner.types.js.map +1 -0
- package/lib/commonjs/components/notifications/Banner/index.js +14 -0
- package/lib/commonjs/components/notifications/Banner/index.js.map +1 -0
- package/lib/commonjs/components/notifications/Banner/themes/dark.js +47 -0
- package/lib/commonjs/components/notifications/Banner/themes/dark.js.map +1 -0
- package/lib/commonjs/components/notifications/Banner/themes/index.js +21 -0
- package/lib/commonjs/components/notifications/Banner/themes/index.js.map +1 -0
- package/lib/commonjs/components/notifications/Banner/themes/light.js +47 -0
- package/lib/commonjs/components/notifications/Banner/themes/light.js.map +1 -0
- package/lib/commonjs/components/typographies/Body/Body.js +35 -0
- package/lib/commonjs/components/typographies/Body/Body.js.map +1 -0
- package/lib/commonjs/components/typographies/Body/index.js +14 -0
- package/lib/commonjs/components/typographies/Body/index.js.map +1 -0
- package/lib/commonjs/components/typographies/ButtonTitle/ButtonTitle.js +45 -0
- package/lib/commonjs/components/typographies/ButtonTitle/ButtonTitle.js.map +1 -0
- package/lib/commonjs/components/typographies/ButtonTitle/index.js +14 -0
- package/lib/commonjs/components/typographies/ButtonTitle/index.js.map +1 -0
- package/lib/commonjs/components/typographies/Callout/Callout.js +35 -0
- package/lib/commonjs/components/typographies/Callout/Callout.js.map +1 -0
- package/lib/commonjs/components/typographies/Callout/index.js +14 -0
- package/lib/commonjs/components/typographies/Callout/index.js.map +1 -0
- package/lib/commonjs/components/typographies/CaptionOne/CaptionOne.js +35 -0
- package/lib/commonjs/components/typographies/CaptionOne/CaptionOne.js.map +1 -0
- package/lib/commonjs/components/typographies/CaptionOne/index.js +14 -0
- package/lib/commonjs/components/typographies/CaptionOne/index.js.map +1 -0
- package/lib/commonjs/components/typographies/CaptionTwo/CaptionTwo.js +35 -0
- package/lib/commonjs/components/typographies/CaptionTwo/CaptionTwo.js.map +1 -0
- package/lib/commonjs/components/typographies/CaptionTwo/index.js +14 -0
- package/lib/commonjs/components/typographies/CaptionTwo/index.js.map +1 -0
- package/lib/commonjs/components/typographies/Footnote/Footnote.js +35 -0
- package/lib/commonjs/components/typographies/Footnote/Footnote.js.map +1 -0
- package/lib/commonjs/components/typographies/Footnote/index.js +14 -0
- package/lib/commonjs/components/typographies/Footnote/index.js.map +1 -0
- package/lib/commonjs/components/typographies/Headline/Headline.js +35 -0
- package/lib/commonjs/components/typographies/Headline/Headline.js.map +1 -0
- package/lib/commonjs/components/typographies/Headline/index.js +14 -0
- package/lib/commonjs/components/typographies/Headline/index.js.map +1 -0
- package/lib/commonjs/components/typographies/LargeTitle/LargeTitle.js +35 -0
- package/lib/commonjs/components/typographies/LargeTitle/LargeTitle.js.map +1 -0
- package/lib/commonjs/components/typographies/LargeTitle/index.js +14 -0
- package/lib/commonjs/components/typographies/LargeTitle/index.js.map +1 -0
- package/lib/commonjs/components/typographies/README.md +22 -0
- package/lib/commonjs/components/typographies/Subhead/Subhead.js +35 -0
- package/lib/commonjs/components/typographies/Subhead/Subhead.js.map +1 -0
- package/lib/commonjs/components/typographies/Subhead/index.js +14 -0
- package/lib/commonjs/components/typographies/Subhead/index.js.map +1 -0
- package/lib/commonjs/components/typographies/TitleOne/TitleOne.js +35 -0
- package/lib/commonjs/components/typographies/TitleOne/TitleOne.js.map +1 -0
- package/lib/commonjs/components/typographies/TitleOne/index.js +14 -0
- package/lib/commonjs/components/typographies/TitleOne/index.js.map +1 -0
- package/lib/commonjs/components/typographies/TitleThree/TitleThree.js +35 -0
- package/lib/commonjs/components/typographies/TitleThree/TitleThree.js.map +1 -0
- package/lib/commonjs/components/typographies/TitleThree/index.js +14 -0
- package/lib/commonjs/components/typographies/TitleThree/index.js.map +1 -0
- package/lib/commonjs/components/typographies/TitleTwo/TitleTwo.js +35 -0
- package/lib/commonjs/components/typographies/TitleTwo/TitleTwo.js.map +1 -0
- package/lib/commonjs/components/typographies/TitleTwo/index.js +14 -0
- package/lib/commonjs/components/typographies/TitleTwo/index.js.map +1 -0
- package/lib/commonjs/components/typographies/font.js +33 -0
- package/lib/commonjs/components/typographies/font.js.map +1 -0
- package/lib/commonjs/hooks/useTheme.js +24 -0
- package/lib/commonjs/hooks/useTheme.js.map +1 -0
- package/lib/commonjs/index.js +206 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/providers/DesignSystemProvider/DesignSystemProvider.js +30 -0
- package/lib/commonjs/providers/DesignSystemProvider/DesignSystemProvider.js.map +1 -0
- package/lib/commonjs/providers/DesignSystemProvider/index.js +14 -0
- package/lib/commonjs/providers/DesignSystemProvider/index.js.map +1 -0
- package/lib/commonjs/providers/IconProvider/IconProvider.js +35 -0
- package/lib/commonjs/providers/IconProvider/IconProvider.js.map +1 -0
- package/lib/commonjs/providers/IconProvider/index.js +20 -0
- package/lib/commonjs/providers/IconProvider/index.js.map +1 -0
- package/lib/commonjs/providers/ThemeProvider/ThemeProvider.js +20 -0
- package/lib/commonjs/providers/ThemeProvider/ThemeProvider.js.map +1 -0
- package/lib/commonjs/styles/calendarTheme.js +6 -0
- package/lib/commonjs/styles/calendarTheme.js.map +1 -0
- package/lib/commonjs/styles/colors.js +109 -0
- package/lib/commonjs/styles/colors.js.map +1 -0
- package/lib/commonjs/styles/globalStyles.js +41 -0
- package/lib/commonjs/styles/globalStyles.js.map +1 -0
- package/lib/commonjs/styles/space.js +34 -0
- package/lib/commonjs/styles/space.js.map +1 -0
- package/lib/commonjs/styles/theme.js +421 -0
- package/lib/commonjs/styles/theme.js.map +1 -0
- package/lib/commonjs/utils/locale.js +50 -0
- package/lib/commonjs/utils/locale.js.map +1 -0
- package/lib/module/components/Tag/Tag.js +37 -0
- package/lib/module/components/Tag/Tag.js.map +1 -0
- package/lib/module/components/Tag/index.js +3 -0
- package/lib/module/components/Tag/index.js.map +1 -0
- package/lib/module/components/Touchable/Touchable.js +72 -0
- package/lib/module/components/Touchable/Touchable.js.map +1 -0
- package/lib/module/components/Touchable/index.js +3 -0
- package/lib/module/components/Touchable/index.js.map +1 -0
- package/lib/module/components/base/DatePicker/DatePicker.js +251 -0
- package/lib/module/components/base/DatePicker/DatePicker.js.map +1 -0
- package/lib/module/components/base/DatePicker/index.js +3 -0
- package/lib/module/components/base/DatePicker/index.js.map +1 -0
- package/lib/module/components/base/HeaderArrows/HeaderArrows.js +70 -0
- package/lib/module/components/base/HeaderArrows/HeaderArrows.js.map +1 -0
- package/lib/module/components/base/HeaderArrows/index.js +3 -0
- package/lib/module/components/base/HeaderArrows/index.js.map +1 -0
- package/lib/module/components/buttons/FicButton/FicButton.js +36 -0
- package/lib/module/components/buttons/FicButton/FicButton.js.map +1 -0
- package/lib/module/components/buttons/FicButton/FicButton.types.js +2 -0
- package/lib/module/components/buttons/FicButton/FicButton.types.js.map +1 -0
- package/lib/module/components/buttons/FicButton/FicButtonIcon.js +96 -0
- package/lib/module/components/buttons/FicButton/FicButtonIcon.js.map +1 -0
- package/lib/module/components/buttons/FicButton/FicButtonPrimary.js +114 -0
- package/lib/module/components/buttons/FicButton/FicButtonPrimary.js.map +1 -0
- package/lib/module/components/buttons/FicButton/FicButtonSecondary.js +116 -0
- package/lib/module/components/buttons/FicButton/FicButtonSecondary.js.map +1 -0
- package/lib/module/components/buttons/FicButton/FicButtonTertiary.js +137 -0
- package/lib/module/components/buttons/FicButton/FicButtonTertiary.js.map +1 -0
- package/lib/module/components/buttons/FicButton/constants.js +17 -0
- package/lib/module/components/buttons/FicButton/constants.js.map +1 -0
- package/lib/module/components/buttons/FicButton/index.js +3 -0
- package/lib/module/components/buttons/FicButton/index.js.map +1 -0
- package/lib/module/components/buttons/FicButton/themes/dark.js +285 -0
- package/lib/module/components/buttons/FicButton/themes/dark.js.map +1 -0
- package/lib/module/components/buttons/FicButton/themes/index.js +3 -0
- package/lib/module/components/buttons/FicButton/themes/index.js.map +1 -0
- package/lib/module/components/buttons/FicButton/themes/light.js +305 -0
- package/lib/module/components/buttons/FicButton/themes/light.js.map +1 -0
- package/lib/module/components/buttons/FicButtonGroup/FicButtonGroup.js +47 -0
- package/lib/module/components/buttons/FicButtonGroup/FicButtonGroup.js.map +1 -0
- package/lib/module/components/buttons/FicButtonGroup/FicButtonGroup.types.js +2 -0
- package/lib/module/components/buttons/FicButtonGroup/FicButtonGroup.types.js.map +1 -0
- package/lib/module/components/buttons/FicButtonGroup/index.js +3 -0
- package/lib/module/components/buttons/FicButtonGroup/index.js.map +1 -0
- package/lib/module/components/notifications/Banner/Banner.js +89 -0
- package/lib/module/components/notifications/Banner/Banner.js.map +1 -0
- package/lib/module/components/notifications/Banner/Banner.types.js +2 -0
- package/lib/module/components/notifications/Banner/Banner.types.js.map +1 -0
- package/lib/module/components/notifications/Banner/index.js +3 -0
- package/lib/module/components/notifications/Banner/index.js.map +1 -0
- package/lib/module/components/notifications/Banner/themes/dark.js +41 -0
- package/lib/module/components/notifications/Banner/themes/dark.js.map +1 -0
- package/lib/module/components/notifications/Banner/themes/index.js +4 -0
- package/lib/module/components/notifications/Banner/themes/index.js.map +1 -0
- package/lib/module/components/notifications/Banner/themes/light.js +41 -0
- package/lib/module/components/notifications/Banner/themes/light.js.map +1 -0
- package/lib/module/components/typographies/Body/Body.js +29 -0
- package/lib/module/components/typographies/Body/Body.js.map +1 -0
- package/lib/module/components/typographies/Body/index.js +3 -0
- package/lib/module/components/typographies/Body/index.js.map +1 -0
- package/lib/module/components/typographies/ButtonTitle/ButtonTitle.js +39 -0
- package/lib/module/components/typographies/ButtonTitle/ButtonTitle.js.map +1 -0
- package/lib/module/components/typographies/ButtonTitle/index.js +3 -0
- package/lib/module/components/typographies/ButtonTitle/index.js.map +1 -0
- package/lib/module/components/typographies/Callout/Callout.js +29 -0
- package/lib/module/components/typographies/Callout/Callout.js.map +1 -0
- package/lib/module/components/typographies/Callout/index.js +3 -0
- package/lib/module/components/typographies/Callout/index.js.map +1 -0
- package/lib/module/components/typographies/CaptionOne/CaptionOne.js +29 -0
- package/lib/module/components/typographies/CaptionOne/CaptionOne.js.map +1 -0
- package/lib/module/components/typographies/CaptionOne/index.js +3 -0
- package/lib/module/components/typographies/CaptionOne/index.js.map +1 -0
- package/lib/module/components/typographies/CaptionTwo/CaptionTwo.js +29 -0
- package/lib/module/components/typographies/CaptionTwo/CaptionTwo.js.map +1 -0
- package/lib/module/components/typographies/CaptionTwo/index.js +3 -0
- package/lib/module/components/typographies/CaptionTwo/index.js.map +1 -0
- package/lib/module/components/typographies/Footnote/Footnote.js +29 -0
- package/lib/module/components/typographies/Footnote/Footnote.js.map +1 -0
- package/lib/module/components/typographies/Footnote/index.js +3 -0
- package/lib/module/components/typographies/Footnote/index.js.map +1 -0
- package/lib/module/components/typographies/Headline/Headline.js +29 -0
- package/lib/module/components/typographies/Headline/Headline.js.map +1 -0
- package/lib/module/components/typographies/Headline/index.js +3 -0
- package/lib/module/components/typographies/Headline/index.js.map +1 -0
- package/lib/module/components/typographies/LargeTitle/LargeTitle.js +29 -0
- package/lib/module/components/typographies/LargeTitle/LargeTitle.js.map +1 -0
- package/lib/module/components/typographies/LargeTitle/index.js +3 -0
- package/lib/module/components/typographies/LargeTitle/index.js.map +1 -0
- package/lib/module/components/typographies/README.md +22 -0
- package/lib/module/components/typographies/Subhead/Subhead.js +29 -0
- package/lib/module/components/typographies/Subhead/Subhead.js.map +1 -0
- package/lib/module/components/typographies/Subhead/index.js +3 -0
- package/lib/module/components/typographies/Subhead/index.js.map +1 -0
- package/lib/module/components/typographies/TitleOne/TitleOne.js +29 -0
- package/lib/module/components/typographies/TitleOne/TitleOne.js.map +1 -0
- package/lib/module/components/typographies/TitleOne/index.js +3 -0
- package/lib/module/components/typographies/TitleOne/index.js.map +1 -0
- package/lib/module/components/typographies/TitleThree/TitleThree.js +29 -0
- package/lib/module/components/typographies/TitleThree/TitleThree.js.map +1 -0
- package/lib/module/components/typographies/TitleThree/index.js +3 -0
- package/lib/module/components/typographies/TitleThree/index.js.map +1 -0
- package/lib/module/components/typographies/TitleTwo/TitleTwo.js +29 -0
- package/lib/module/components/typographies/TitleTwo/TitleTwo.js.map +1 -0
- package/lib/module/components/typographies/TitleTwo/index.js +3 -0
- package/lib/module/components/typographies/TitleTwo/index.js.map +1 -0
- package/lib/module/components/typographies/font.js +26 -0
- package/lib/module/components/typographies/font.js.map +1 -0
- package/lib/module/hooks/useTheme.js +16 -0
- package/lib/module/hooks/useTheme.js.map +1 -0
- package/lib/module/index.js +26 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/providers/DesignSystemProvider/DesignSystemProvider.js +22 -0
- package/lib/module/providers/DesignSystemProvider/DesignSystemProvider.js.map +1 -0
- package/lib/module/providers/DesignSystemProvider/index.js +3 -0
- package/lib/module/providers/DesignSystemProvider/index.js.map +1 -0
- package/lib/module/providers/IconProvider/IconProvider.js +27 -0
- package/lib/module/providers/IconProvider/IconProvider.js.map +1 -0
- package/lib/module/providers/IconProvider/index.js +3 -0
- package/lib/module/providers/IconProvider/index.js.map +1 -0
- package/lib/module/providers/ThemeProvider/ThemeProvider.js +13 -0
- package/lib/module/providers/ThemeProvider/ThemeProvider.js.map +1 -0
- package/lib/module/styles/calendarTheme.js +2 -0
- package/lib/module/styles/calendarTheme.js.map +1 -0
- package/lib/module/styles/colors.js +103 -0
- package/lib/module/styles/colors.js.map +1 -0
- package/lib/module/styles/globalStyles.js +35 -0
- package/lib/module/styles/globalStyles.js.map +1 -0
- package/lib/module/styles/space.js +28 -0
- package/lib/module/styles/space.js.map +1 -0
- package/lib/module/styles/theme.js +414 -0
- package/lib/module/styles/theme.js.map +1 -0
- package/lib/module/utils/locale.js +42 -0
- package/lib/module/utils/locale.js.map +1 -0
- package/lib/package.json +138 -0
- package/lib/typescript/components/Tag/Tag.d.ts +13 -0
- package/lib/typescript/components/Tag/Tag.d.ts.map +1 -0
- package/lib/typescript/components/Tag/index.d.ts +3 -0
- package/lib/typescript/components/Tag/index.d.ts.map +1 -0
- package/lib/typescript/components/Touchable/Touchable.d.ts +16 -0
- package/lib/typescript/components/Touchable/Touchable.d.ts.map +1 -0
- package/lib/typescript/components/Touchable/index.d.ts +3 -0
- package/lib/typescript/components/Touchable/index.d.ts.map +1 -0
- package/lib/typescript/components/base/DatePicker/DatePicker.d.ts +60 -0
- package/lib/typescript/components/base/DatePicker/DatePicker.d.ts.map +1 -0
- package/lib/typescript/components/base/DatePicker/index.d.ts +4 -0
- package/lib/typescript/components/base/DatePicker/index.d.ts.map +1 -0
- package/lib/typescript/components/base/HeaderArrows/HeaderArrows.d.ts +16 -0
- package/lib/typescript/components/base/HeaderArrows/HeaderArrows.d.ts.map +1 -0
- package/lib/typescript/components/base/HeaderArrows/index.d.ts +3 -0
- package/lib/typescript/components/base/HeaderArrows/index.d.ts.map +1 -0
- package/lib/typescript/components/buttons/FicButton/FicButton.d.ts +5 -0
- package/lib/typescript/components/buttons/FicButton/FicButton.d.ts.map +1 -0
- package/lib/typescript/components/buttons/FicButton/FicButton.types.d.ts +87 -0
- package/lib/typescript/components/buttons/FicButton/FicButton.types.d.ts.map +1 -0
- package/lib/typescript/components/buttons/FicButton/FicButtonIcon.d.ts +5 -0
- package/lib/typescript/components/buttons/FicButton/FicButtonIcon.d.ts.map +1 -0
- package/lib/typescript/components/buttons/FicButton/FicButtonPrimary.d.ts +5 -0
- package/lib/typescript/components/buttons/FicButton/FicButtonPrimary.d.ts.map +1 -0
- package/lib/typescript/components/buttons/FicButton/FicButtonSecondary.d.ts +5 -0
- package/lib/typescript/components/buttons/FicButton/FicButtonSecondary.d.ts.map +1 -0
- package/lib/typescript/components/buttons/FicButton/FicButtonTertiary.d.ts +5 -0
- package/lib/typescript/components/buttons/FicButton/FicButtonTertiary.d.ts.map +1 -0
- package/lib/typescript/components/buttons/FicButton/constants.d.ts +13 -0
- package/lib/typescript/components/buttons/FicButton/constants.d.ts.map +1 -0
- package/lib/typescript/components/buttons/FicButton/index.d.ts +5 -0
- package/lib/typescript/components/buttons/FicButton/index.d.ts.map +1 -0
- package/lib/typescript/components/buttons/FicButton/themes/dark.d.ts +4 -0
- package/lib/typescript/components/buttons/FicButton/themes/dark.d.ts.map +1 -0
- package/lib/typescript/components/buttons/FicButton/themes/index.d.ts +3 -0
- package/lib/typescript/components/buttons/FicButton/themes/index.d.ts.map +1 -0
- package/lib/typescript/components/buttons/FicButton/themes/light.d.ts +4 -0
- package/lib/typescript/components/buttons/FicButton/themes/light.d.ts.map +1 -0
- package/lib/typescript/components/buttons/FicButtonGroup/FicButtonGroup.d.ts +5 -0
- package/lib/typescript/components/buttons/FicButtonGroup/FicButtonGroup.d.ts.map +1 -0
- package/lib/typescript/components/buttons/FicButtonGroup/FicButtonGroup.types.d.ts +10 -0
- package/lib/typescript/components/buttons/FicButtonGroup/FicButtonGroup.types.d.ts.map +1 -0
- package/lib/typescript/components/buttons/FicButtonGroup/index.d.ts +3 -0
- package/lib/typescript/components/buttons/FicButtonGroup/index.d.ts.map +1 -0
- package/lib/typescript/components/notifications/Banner/Banner.d.ts +5 -0
- package/lib/typescript/components/notifications/Banner/Banner.d.ts.map +1 -0
- package/lib/typescript/components/notifications/Banner/Banner.types.d.ts +50 -0
- package/lib/typescript/components/notifications/Banner/Banner.types.d.ts.map +1 -0
- package/lib/typescript/components/notifications/Banner/index.d.ts +3 -0
- package/lib/typescript/components/notifications/Banner/index.d.ts.map +1 -0
- package/lib/typescript/components/notifications/Banner/themes/dark.d.ts +4 -0
- package/lib/typescript/components/notifications/Banner/themes/dark.d.ts.map +1 -0
- package/lib/typescript/components/notifications/Banner/themes/index.d.ts +4 -0
- package/lib/typescript/components/notifications/Banner/themes/index.d.ts.map +1 -0
- package/lib/typescript/components/notifications/Banner/themes/light.d.ts +4 -0
- package/lib/typescript/components/notifications/Banner/themes/light.d.ts.map +1 -0
- package/lib/typescript/components/typographies/Body/Body.d.ts +12 -0
- package/lib/typescript/components/typographies/Body/Body.d.ts.map +1 -0
- package/lib/typescript/components/typographies/Body/index.d.ts +3 -0
- package/lib/typescript/components/typographies/Body/index.d.ts.map +1 -0
- package/lib/typescript/components/typographies/ButtonTitle/ButtonTitle.d.ts +10 -0
- package/lib/typescript/components/typographies/ButtonTitle/ButtonTitle.d.ts.map +1 -0
- package/lib/typescript/components/typographies/ButtonTitle/index.d.ts +3 -0
- package/lib/typescript/components/typographies/ButtonTitle/index.d.ts.map +1 -0
- package/lib/typescript/components/typographies/Callout/Callout.d.ts +12 -0
- package/lib/typescript/components/typographies/Callout/Callout.d.ts.map +1 -0
- package/lib/typescript/components/typographies/Callout/index.d.ts +3 -0
- package/lib/typescript/components/typographies/Callout/index.d.ts.map +1 -0
- package/lib/typescript/components/typographies/CaptionOne/CaptionOne.d.ts +12 -0
- package/lib/typescript/components/typographies/CaptionOne/CaptionOne.d.ts.map +1 -0
- package/lib/typescript/components/typographies/CaptionOne/index.d.ts +3 -0
- package/lib/typescript/components/typographies/CaptionOne/index.d.ts.map +1 -0
- package/lib/typescript/components/typographies/CaptionTwo/CaptionTwo.d.ts +12 -0
- package/lib/typescript/components/typographies/CaptionTwo/CaptionTwo.d.ts.map +1 -0
- package/lib/typescript/components/typographies/CaptionTwo/index.d.ts +3 -0
- package/lib/typescript/components/typographies/CaptionTwo/index.d.ts.map +1 -0
- package/lib/typescript/components/typographies/Footnote/Footnote.d.ts +12 -0
- package/lib/typescript/components/typographies/Footnote/Footnote.d.ts.map +1 -0
- package/lib/typescript/components/typographies/Footnote/index.d.ts +3 -0
- package/lib/typescript/components/typographies/Footnote/index.d.ts.map +1 -0
- package/lib/typescript/components/typographies/Headline/Headline.d.ts +12 -0
- package/lib/typescript/components/typographies/Headline/Headline.d.ts.map +1 -0
- package/lib/typescript/components/typographies/Headline/index.d.ts +3 -0
- package/lib/typescript/components/typographies/Headline/index.d.ts.map +1 -0
- package/lib/typescript/components/typographies/LargeTitle/LargeTitle.d.ts +12 -0
- package/lib/typescript/components/typographies/LargeTitle/LargeTitle.d.ts.map +1 -0
- package/lib/typescript/components/typographies/LargeTitle/index.d.ts +3 -0
- package/lib/typescript/components/typographies/LargeTitle/index.d.ts.map +1 -0
- package/lib/typescript/components/typographies/Subhead/Subhead.d.ts +12 -0
- package/lib/typescript/components/typographies/Subhead/Subhead.d.ts.map +1 -0
- package/lib/typescript/components/typographies/Subhead/index.d.ts +3 -0
- package/lib/typescript/components/typographies/Subhead/index.d.ts.map +1 -0
- package/lib/typescript/components/typographies/TitleOne/TitleOne.d.ts +12 -0
- package/lib/typescript/components/typographies/TitleOne/TitleOne.d.ts.map +1 -0
- package/lib/typescript/components/typographies/TitleOne/index.d.ts +3 -0
- package/lib/typescript/components/typographies/TitleOne/index.d.ts.map +1 -0
- package/lib/typescript/components/typographies/TitleThree/TitleThree.d.ts +12 -0
- package/lib/typescript/components/typographies/TitleThree/TitleThree.d.ts.map +1 -0
- package/lib/typescript/components/typographies/TitleThree/index.d.ts +3 -0
- package/lib/typescript/components/typographies/TitleThree/index.d.ts.map +1 -0
- package/lib/typescript/components/typographies/TitleTwo/TitleTwo.d.ts +12 -0
- package/lib/typescript/components/typographies/TitleTwo/TitleTwo.d.ts.map +1 -0
- package/lib/typescript/components/typographies/TitleTwo/index.d.ts +3 -0
- package/lib/typescript/components/typographies/TitleTwo/index.d.ts.map +1 -0
- package/lib/typescript/components/typographies/font.d.ts +9 -0
- package/lib/typescript/components/typographies/font.d.ts.map +1 -0
- package/lib/typescript/hooks/useTheme.d.ts +3 -0
- package/lib/typescript/hooks/useTheme.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +31 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/providers/DesignSystemProvider/DesignSystemProvider.d.ts +10 -0
- package/lib/typescript/providers/DesignSystemProvider/DesignSystemProvider.d.ts.map +1 -0
- package/lib/typescript/providers/DesignSystemProvider/index.d.ts +3 -0
- package/lib/typescript/providers/DesignSystemProvider/index.d.ts.map +1 -0
- package/lib/typescript/providers/IconProvider/IconProvider.d.ts +21 -0
- package/lib/typescript/providers/IconProvider/IconProvider.d.ts.map +1 -0
- package/lib/typescript/providers/IconProvider/index.d.ts +4 -0
- package/lib/typescript/providers/IconProvider/index.d.ts.map +1 -0
- package/lib/typescript/providers/ThemeProvider/ThemeProvider.d.ts +9 -0
- package/lib/typescript/providers/ThemeProvider/ThemeProvider.d.ts.map +1 -0
- package/lib/typescript/styles/calendarTheme.d.ts +24 -0
- package/lib/typescript/styles/calendarTheme.d.ts.map +1 -0
- package/lib/typescript/styles/colors.d.ts +100 -0
- package/lib/typescript/styles/colors.d.ts.map +1 -0
- package/lib/typescript/styles/globalStyles.d.ts +33 -0
- package/lib/typescript/styles/globalStyles.d.ts.map +1 -0
- package/lib/typescript/styles/space.d.ts +19 -0
- package/lib/typescript/styles/space.d.ts.map +1 -0
- package/lib/typescript/styles/theme.d.ts +183 -0
- package/lib/typescript/styles/theme.d.ts.map +1 -0
- package/lib/typescript/utils/locale.d.ts +15 -0
- package/lib/typescript/utils/locale.d.ts.map +1 -0
- package/package.json +30 -43
- package/src/components/Tag/Tag.tsx +59 -0
- package/src/components/Tag/index.ts +3 -0
- package/src/components/Touchable/Touchable.tsx +110 -0
- package/src/components/Touchable/index.ts +3 -0
- package/src/components/base/DatePicker/DatePicker.tsx +427 -0
- package/src/components/base/DatePicker/index.ts +4 -0
- package/src/components/base/HeaderArrows/HeaderArrows.tsx +93 -0
- package/src/components/base/HeaderArrows/index.ts +3 -0
- package/src/components/buttons/FicButton/FicButton.tsx +41 -0
- package/src/components/buttons/FicButton/FicButton.types.ts +114 -0
- package/src/components/buttons/FicButton/FicButtonIcon.tsx +161 -0
- package/src/components/buttons/FicButton/FicButtonPrimary.tsx +167 -0
- package/src/components/buttons/FicButton/FicButtonSecondary.tsx +168 -0
- package/src/components/buttons/FicButton/FicButtonTertiary.tsx +188 -0
- package/src/components/buttons/FicButton/constants.ts +23 -0
- package/src/components/buttons/FicButton/index.ts +5 -0
- package/src/components/buttons/FicButton/themes/dark.ts +273 -0
- package/src/components/buttons/FicButton/themes/index.ts +3 -0
- package/src/components/buttons/FicButton/themes/light.ts +293 -0
- package/src/components/buttons/FicButtonGroup/FicButtonGroup.tsx +40 -0
- package/src/components/buttons/FicButtonGroup/FicButtonGroup.types.ts +11 -0
- package/src/components/buttons/FicButtonGroup/index.ts +2 -0
- package/src/components/notifications/Banner/Banner.tsx +105 -0
- package/src/components/notifications/Banner/Banner.types.ts +69 -0
- package/src/components/notifications/Banner/index.ts +3 -0
- package/src/components/notifications/Banner/themes/dark.ts +43 -0
- package/src/components/notifications/Banner/themes/index.ts +4 -0
- package/src/components/notifications/Banner/themes/light.ts +43 -0
- package/src/components/typographies/Body/Body.tsx +38 -0
- package/src/components/typographies/Body/index.ts +3 -0
- package/src/components/typographies/ButtonTitle/ButtonTitle.tsx +51 -0
- package/src/components/typographies/ButtonTitle/index.ts +3 -0
- package/src/components/typographies/Callout/Callout.tsx +38 -0
- package/src/components/typographies/Callout/index.ts +3 -0
- package/src/components/typographies/CaptionOne/CaptionOne.tsx +38 -0
- package/src/components/typographies/CaptionOne/index.ts +4 -0
- package/src/components/typographies/CaptionTwo/CaptionTwo.tsx +38 -0
- package/src/components/typographies/CaptionTwo/index.ts +4 -0
- package/src/components/typographies/Footnote/Footnote.tsx +38 -0
- package/src/components/typographies/Footnote/index.ts +4 -0
- package/src/components/typographies/Headline/Headline.tsx +38 -0
- package/src/components/typographies/Headline/index.ts +4 -0
- package/src/components/typographies/LargeTitle/LargeTitle.tsx +38 -0
- package/src/components/typographies/LargeTitle/index.ts +3 -0
- package/src/components/typographies/README.md +22 -0
- package/src/components/typographies/Subhead/Subhead.tsx +38 -0
- package/src/components/typographies/Subhead/index.ts +4 -0
- package/src/components/typographies/TitleOne/TitleOne.tsx +38 -0
- package/src/components/typographies/TitleOne/index.ts +4 -0
- package/src/components/typographies/TitleThree/TitleThree.tsx +38 -0
- package/src/components/typographies/TitleThree/index.ts +4 -0
- package/src/components/typographies/TitleTwo/TitleTwo.tsx +38 -0
- package/src/components/typographies/TitleTwo/index.ts +4 -0
- package/src/components/typographies/font.ts +25 -0
- package/src/hooks/useTheme.ts +17 -0
- package/src/index.tsx +47 -0
- package/src/providers/DesignSystemProvider/DesignSystemProvider.tsx +31 -0
- package/src/providers/DesignSystemProvider/index.ts +3 -0
- package/src/providers/IconProvider/IconProvider.tsx +46 -0
- package/src/providers/IconProvider/index.ts +4 -0
- package/src/providers/ThemeProvider/ThemeProvider.tsx +17 -0
- package/src/styles/calendarTheme.ts +24 -0
- package/src/styles/colors.ts +119 -0
- package/src/styles/globalStyles.ts +36 -0
- package/src/styles/space.ts +27 -0
- package/src/styles/theme.ts +609 -0
- package/src/utils/locale.ts +50 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// @ts-ignore TS6133
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { FunctionComponent, useCallback, useMemo, useState } from 'react';
|
|
4
|
+
import {
|
|
5
|
+
GestureResponderEvent,
|
|
6
|
+
Platform,
|
|
7
|
+
Pressable as PressableIOS,
|
|
8
|
+
StyleProp,
|
|
9
|
+
View,
|
|
10
|
+
ViewStyle,
|
|
11
|
+
} from 'react-native';
|
|
12
|
+
import { TouchableHighlight } from 'react-native-gesture-handler';
|
|
13
|
+
import { useTheme } from '../../../hooks/useTheme';
|
|
14
|
+
import { Icon } from '../../../providers/IconProvider';
|
|
15
|
+
import {
|
|
16
|
+
FicButtonThemeProps,
|
|
17
|
+
FicIconProps,
|
|
18
|
+
onPressType,
|
|
19
|
+
} from './FicButton.types';
|
|
20
|
+
import { DEFAULT_ICON, DEFAULT_ICON_SIZE, HIT_SLOP } from './constants';
|
|
21
|
+
|
|
22
|
+
const FicButtonIcon: FunctionComponent<FicIconProps> = ({
|
|
23
|
+
iconName,
|
|
24
|
+
iconSize: _iconSize,
|
|
25
|
+
disabled,
|
|
26
|
+
error,
|
|
27
|
+
onPress,
|
|
28
|
+
onPressIn,
|
|
29
|
+
onPressOut,
|
|
30
|
+
containerStyle,
|
|
31
|
+
customPressedIconAreaSize,
|
|
32
|
+
colorContrastForLightTheme,
|
|
33
|
+
solid,
|
|
34
|
+
light,
|
|
35
|
+
duotone,
|
|
36
|
+
regular,
|
|
37
|
+
}) => {
|
|
38
|
+
const Pressable = Platform.OS === 'ios' ? PressableIOS : TouchableHighlight;
|
|
39
|
+
|
|
40
|
+
const INCREMENT_PRESSED_AREA_SIZE = 16;
|
|
41
|
+
const iconSize = _iconSize ?? DEFAULT_ICON_SIZE;
|
|
42
|
+
|
|
43
|
+
const { ficButton: theme } = useTheme() || {};
|
|
44
|
+
|
|
45
|
+
const buttonTheme = (theme?.['icon'] as FicButtonThemeProps) || {};
|
|
46
|
+
const themeProps = disabled
|
|
47
|
+
? buttonTheme.disabled
|
|
48
|
+
: error
|
|
49
|
+
? buttonTheme.error
|
|
50
|
+
: buttonTheme.default;
|
|
51
|
+
|
|
52
|
+
const [isPressed, setIsPressed] = useState(false);
|
|
53
|
+
|
|
54
|
+
const pressedAreaSize = useMemo(
|
|
55
|
+
() =>
|
|
56
|
+
customPressedIconAreaSize
|
|
57
|
+
? customPressedIconAreaSize
|
|
58
|
+
: iconSize + INCREMENT_PRESSED_AREA_SIZE,
|
|
59
|
+
[iconSize, customPressedIconAreaSize]
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const pressableAreaStyle: StyleProp<ViewStyle> = useMemo(
|
|
63
|
+
() => ({
|
|
64
|
+
position: 'absolute',
|
|
65
|
+
top: ((pressedAreaSize - iconSize) / 2) * -1,
|
|
66
|
+
left: ((pressedAreaSize - iconSize) / 2) * -1,
|
|
67
|
+
width: pressedAreaSize ?? iconSize,
|
|
68
|
+
height: pressedAreaSize ?? iconSize,
|
|
69
|
+
borderRadius: pressedAreaSize / 6,
|
|
70
|
+
...themeProps?.pressedStyle?.container,
|
|
71
|
+
}),
|
|
72
|
+
[iconSize, pressedAreaSize, themeProps]
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
const iconStyle: StyleProp<ViewStyle> = useMemo(
|
|
76
|
+
() => ({
|
|
77
|
+
textAlign: 'center',
|
|
78
|
+
lineHeight: iconSize,
|
|
79
|
+
width: iconSize,
|
|
80
|
+
height: iconSize,
|
|
81
|
+
fontSize: iconSize
|
|
82
|
+
? iconSize === 16
|
|
83
|
+
? iconSize - 2
|
|
84
|
+
: iconSize - 4
|
|
85
|
+
: DEFAULT_ICON_SIZE,
|
|
86
|
+
}),
|
|
87
|
+
[iconSize]
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
const iconColor = useMemo(() => {
|
|
91
|
+
return colorContrastForLightTheme && !error
|
|
92
|
+
? themeProps?.icon.colorContrastForLightTheme
|
|
93
|
+
? themeProps?.icon.colorContrastForLightTheme
|
|
94
|
+
: themeProps?.icon.color
|
|
95
|
+
: themeProps?.icon.color;
|
|
96
|
+
}, [colorContrastForLightTheme, error, themeProps]);
|
|
97
|
+
|
|
98
|
+
const handleOnPressIn: onPressType = (
|
|
99
|
+
e: GestureResponderEvent | undefined
|
|
100
|
+
) => {
|
|
101
|
+
if (onPressIn) onPressIn(e);
|
|
102
|
+
setIsPressed(true);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const handleOnPressOut: onPressType = (
|
|
106
|
+
e: GestureResponderEvent | undefined
|
|
107
|
+
) => {
|
|
108
|
+
if (onPressOut) onPressOut(e);
|
|
109
|
+
setIsPressed(false);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const handleOnPress: onPressType = (e: GestureResponderEvent | undefined) => {
|
|
113
|
+
if (onPress) onPress(e);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const FicIcon = useCallback(
|
|
117
|
+
() => (
|
|
118
|
+
<Icon
|
|
119
|
+
name={iconName ?? DEFAULT_ICON}
|
|
120
|
+
solid={solid}
|
|
121
|
+
light={light}
|
|
122
|
+
duotone={duotone}
|
|
123
|
+
regular={regular}
|
|
124
|
+
size={iconSize}
|
|
125
|
+
color={iconColor}
|
|
126
|
+
style={iconStyle}
|
|
127
|
+
/>
|
|
128
|
+
),
|
|
129
|
+
[
|
|
130
|
+
iconName,
|
|
131
|
+
iconSize,
|
|
132
|
+
colorContrastForLightTheme,
|
|
133
|
+
error,
|
|
134
|
+
iconStyle,
|
|
135
|
+
themeProps,
|
|
136
|
+
solid,
|
|
137
|
+
light,
|
|
138
|
+
regular,
|
|
139
|
+
duotone,
|
|
140
|
+
]
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<View style={{ width: _iconSize, height: _iconSize }}>
|
|
145
|
+
{isPressed ? <View style={[pressableAreaStyle]} /> : null}
|
|
146
|
+
<Pressable
|
|
147
|
+
style={[themeProps?.container, containerStyle]}
|
|
148
|
+
onPress={handleOnPress}
|
|
149
|
+
onPressIn={handleOnPressIn}
|
|
150
|
+
onPressOut={handleOnPressOut}
|
|
151
|
+
hitSlop={HIT_SLOP}
|
|
152
|
+
disabled={disabled}
|
|
153
|
+
underlayColor={'transparent'}
|
|
154
|
+
>
|
|
155
|
+
{FicIcon()}
|
|
156
|
+
</Pressable>
|
|
157
|
+
</View>
|
|
158
|
+
);
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export default FicButtonIcon;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
3
|
+
import {
|
|
4
|
+
GestureResponderEvent,
|
|
5
|
+
Platform,
|
|
6
|
+
Pressable,
|
|
7
|
+
StyleProp,
|
|
8
|
+
TextStyle,
|
|
9
|
+
View,
|
|
10
|
+
ViewStyle,
|
|
11
|
+
} from 'react-native';
|
|
12
|
+
import { TouchableHighlight } from 'react-native-gesture-handler';
|
|
13
|
+
import { useTheme } from '../../../hooks/useTheme';
|
|
14
|
+
import { Icon } from '../../../providers/IconProvider';
|
|
15
|
+
import { BORDER_RADIUS, PADDING } from '../../../styles/space';
|
|
16
|
+
import { Body } from '../../typographies/Body';
|
|
17
|
+
import {
|
|
18
|
+
BUTTON_INTERNAL_PADDING_HORIZONTAL,
|
|
19
|
+
DEFAULT_ICON,
|
|
20
|
+
DEFAULT_ICON_SIZE,
|
|
21
|
+
DEFAULT_TITLE,
|
|
22
|
+
ICON_HORIZONTAL_MARGIN,
|
|
23
|
+
} from './constants';
|
|
24
|
+
import {
|
|
25
|
+
FicButtonTextProps,
|
|
26
|
+
FicButtonThemeProps,
|
|
27
|
+
onPressType,
|
|
28
|
+
} from './FicButton.types';
|
|
29
|
+
|
|
30
|
+
const FicButtonPrimary: React.FC<FicButtonTextProps> = ({
|
|
31
|
+
title,
|
|
32
|
+
iconName,
|
|
33
|
+
iconSize,
|
|
34
|
+
onPress,
|
|
35
|
+
onPressIn,
|
|
36
|
+
onPressOut,
|
|
37
|
+
disabled,
|
|
38
|
+
error,
|
|
39
|
+
iconPosition,
|
|
40
|
+
fullWidth,
|
|
41
|
+
small,
|
|
42
|
+
solid,
|
|
43
|
+
regular,
|
|
44
|
+
light,
|
|
45
|
+
duotone,
|
|
46
|
+
containerStyle,
|
|
47
|
+
}) => {
|
|
48
|
+
const { ficButton: theme } = useTheme() || {};
|
|
49
|
+
|
|
50
|
+
const buttonTheme = (theme?.['primary'] as FicButtonThemeProps) || {};
|
|
51
|
+
const themeProps = disabled
|
|
52
|
+
? buttonTheme.disabled
|
|
53
|
+
: error
|
|
54
|
+
? buttonTheme.error
|
|
55
|
+
: buttonTheme.default;
|
|
56
|
+
const containerStyleObj = containerStyle ?? {};
|
|
57
|
+
|
|
58
|
+
const [isPressed, setIsPressed] = useState(false);
|
|
59
|
+
|
|
60
|
+
const styleBasedOnPress: StyleProp<ViewStyle> = useMemo(
|
|
61
|
+
() => ({
|
|
62
|
+
...(isPressed && !disabled
|
|
63
|
+
? themeProps?.pressedStyle?.container
|
|
64
|
+
: themeProps?.container),
|
|
65
|
+
}),
|
|
66
|
+
[disabled, themeProps, isPressed]
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
const ficPrimaryViewStyle: StyleProp<ViewStyle> = useMemo(
|
|
70
|
+
() => ({
|
|
71
|
+
paddingHorizontal: BUTTON_INTERNAL_PADDING_HORIZONTAL,
|
|
72
|
+
paddingVertical: small ? PADDING.SM : PADDING.LG,
|
|
73
|
+
width: fullWidth ? '100%' : 'auto',
|
|
74
|
+
flexDirection: 'row',
|
|
75
|
+
alignItems: 'center',
|
|
76
|
+
justifyContent: 'center',
|
|
77
|
+
}),
|
|
78
|
+
[fullWidth, small]
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
const bodyStyle: StyleProp<TextStyle> = useMemo(
|
|
82
|
+
() => ({
|
|
83
|
+
marginLeft: iconPosition === 'left' ? ICON_HORIZONTAL_MARGIN : 0,
|
|
84
|
+
marginRight: iconPosition === 'right' ? ICON_HORIZONTAL_MARGIN : 0,
|
|
85
|
+
...(isPressed && !disabled
|
|
86
|
+
? themeProps?.pressedStyle?.text
|
|
87
|
+
: themeProps?.text),
|
|
88
|
+
}),
|
|
89
|
+
[iconPosition, themeProps, disabled, isPressed]
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
const handleOnPressIn: onPressType = (
|
|
93
|
+
e: GestureResponderEvent | undefined
|
|
94
|
+
) => {
|
|
95
|
+
if (onPressIn) onPressIn(e);
|
|
96
|
+
setIsPressed(true);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const handleOnPressOut: onPressType = (
|
|
100
|
+
e: GestureResponderEvent | undefined
|
|
101
|
+
) => {
|
|
102
|
+
if (onPressOut) onPressOut(e);
|
|
103
|
+
setIsPressed(false);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const handleOnPress: onPressType = (e: GestureResponderEvent | undefined) => {
|
|
107
|
+
if (onPress) {
|
|
108
|
+
onPress(e);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const FicPrimary = useCallback(() => {
|
|
113
|
+
return (
|
|
114
|
+
<View style={ficPrimaryViewStyle}>
|
|
115
|
+
{iconPosition === 'left' ? (
|
|
116
|
+
<Icon
|
|
117
|
+
name={iconName || DEFAULT_ICON}
|
|
118
|
+
size={iconSize ?? DEFAULT_ICON_SIZE}
|
|
119
|
+
color={themeProps?.icon.color}
|
|
120
|
+
solid={solid}
|
|
121
|
+
regular={regular}
|
|
122
|
+
light={light}
|
|
123
|
+
duotone={duotone}
|
|
124
|
+
/>
|
|
125
|
+
) : null}
|
|
126
|
+
<Body text={title ?? DEFAULT_TITLE} style={bodyStyle} />
|
|
127
|
+
{iconPosition === 'right' ? (
|
|
128
|
+
<Icon
|
|
129
|
+
name={iconName || DEFAULT_ICON}
|
|
130
|
+
size={iconSize ?? DEFAULT_ICON_SIZE}
|
|
131
|
+
color={themeProps?.icon.color}
|
|
132
|
+
solid={solid}
|
|
133
|
+
regular={regular}
|
|
134
|
+
light={light}
|
|
135
|
+
duotone={duotone}
|
|
136
|
+
/>
|
|
137
|
+
) : null}
|
|
138
|
+
</View>
|
|
139
|
+
);
|
|
140
|
+
}, [iconPosition, iconName, iconSize, bodyStyle, title, ficPrimaryViewStyle, themeProps, solid, regular, light, duotone]);
|
|
141
|
+
|
|
142
|
+
return Platform.OS === 'android' ? (
|
|
143
|
+
<TouchableHighlight
|
|
144
|
+
disabled={disabled}
|
|
145
|
+
containerStyle={[containerStyleObj]}
|
|
146
|
+
style={[{ borderRadius: BORDER_RADIUS.SM }, styleBasedOnPress]}
|
|
147
|
+
onPress={handleOnPress}
|
|
148
|
+
onPressIn={handleOnPressIn}
|
|
149
|
+
onPressOut={handleOnPressOut}
|
|
150
|
+
underlayColor={themeProps?.pressedStyle?.container.backgroundColor}
|
|
151
|
+
>
|
|
152
|
+
{FicPrimary()}
|
|
153
|
+
</TouchableHighlight>
|
|
154
|
+
) : (
|
|
155
|
+
<Pressable
|
|
156
|
+
disabled={disabled}
|
|
157
|
+
style={[styleBasedOnPress, containerStyleObj]}
|
|
158
|
+
onPress={handleOnPress}
|
|
159
|
+
onPressIn={handleOnPressIn}
|
|
160
|
+
onPressOut={handleOnPressOut}
|
|
161
|
+
>
|
|
162
|
+
{FicPrimary()}
|
|
163
|
+
</Pressable>
|
|
164
|
+
);
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export default FicButtonPrimary;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
3
|
+
import {
|
|
4
|
+
GestureResponderEvent,
|
|
5
|
+
Platform,
|
|
6
|
+
Pressable,
|
|
7
|
+
StyleProp,
|
|
8
|
+
TextStyle,
|
|
9
|
+
View,
|
|
10
|
+
ViewStyle,
|
|
11
|
+
} from 'react-native';
|
|
12
|
+
import { TouchableHighlight } from 'react-native-gesture-handler';
|
|
13
|
+
import { useTheme } from '../../../hooks/useTheme';
|
|
14
|
+
import { Icon } from '../../../providers/IconProvider';
|
|
15
|
+
import { BORDER_RADIUS, PADDING } from '../../../styles/space';
|
|
16
|
+
import { Body } from '../../typographies/Body';
|
|
17
|
+
import {
|
|
18
|
+
BUTTON_INTERNAL_PADDING_HORIZONTAL,
|
|
19
|
+
DEFAULT_ICON,
|
|
20
|
+
DEFAULT_ICON_SIZE,
|
|
21
|
+
DEFAULT_TITLE,
|
|
22
|
+
ICON_HORIZONTAL_MARGIN,
|
|
23
|
+
} from './constants';
|
|
24
|
+
import {
|
|
25
|
+
FicButtonTextProps,
|
|
26
|
+
FicButtonThemeProps,
|
|
27
|
+
onPressType,
|
|
28
|
+
} from './FicButton.types';
|
|
29
|
+
|
|
30
|
+
const FicButtonSecondary: React.FC<FicButtonTextProps> = ({
|
|
31
|
+
title,
|
|
32
|
+
iconName,
|
|
33
|
+
iconSize,
|
|
34
|
+
onPress,
|
|
35
|
+
onPressIn,
|
|
36
|
+
onPressOut,
|
|
37
|
+
disabled,
|
|
38
|
+
error,
|
|
39
|
+
iconPosition,
|
|
40
|
+
fullWidth,
|
|
41
|
+
small,
|
|
42
|
+
solid,
|
|
43
|
+
regular,
|
|
44
|
+
light,
|
|
45
|
+
duotone,
|
|
46
|
+
containerStyle,
|
|
47
|
+
}) => {
|
|
48
|
+
const { ficButton: theme } = useTheme() || {};
|
|
49
|
+
|
|
50
|
+
const buttonTheme = (theme?.['secondary'] as FicButtonThemeProps) || {};
|
|
51
|
+
const themeProps = disabled
|
|
52
|
+
? buttonTheme.disabled
|
|
53
|
+
: error
|
|
54
|
+
? buttonTheme.error
|
|
55
|
+
: buttonTheme.default;
|
|
56
|
+
const containerStyleObj = containerStyle ?? {};
|
|
57
|
+
|
|
58
|
+
const [isPressed, setIsPressed] = useState(false);
|
|
59
|
+
|
|
60
|
+
const styleBasedOnPress: StyleProp<ViewStyle> = useMemo(
|
|
61
|
+
() => ({
|
|
62
|
+
...(isPressed && !disabled
|
|
63
|
+
? themeProps?.pressedStyle?.container
|
|
64
|
+
: themeProps?.container),
|
|
65
|
+
}),
|
|
66
|
+
[themeProps, disabled, isPressed]
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
const ficSecondaryViewStyle: StyleProp<ViewStyle> = useMemo(
|
|
70
|
+
() => ({
|
|
71
|
+
paddingHorizontal: BUTTON_INTERNAL_PADDING_HORIZONTAL,
|
|
72
|
+
width: fullWidth ? '100%' : 'auto',
|
|
73
|
+
// removing 1 borderWidth to match primary button height
|
|
74
|
+
paddingVertical:
|
|
75
|
+
(small ? PADDING.SM : PADDING.LG) -
|
|
76
|
+
(themeProps?.container?.borderWidth || 0),
|
|
77
|
+
flexDirection: 'row',
|
|
78
|
+
alignItems: 'center',
|
|
79
|
+
justifyContent: 'center',
|
|
80
|
+
}),
|
|
81
|
+
[fullWidth, themeProps]
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
const bodyStyle: StyleProp<TextStyle> = useMemo(
|
|
85
|
+
() => ({
|
|
86
|
+
marginLeft: iconPosition === 'left' ? ICON_HORIZONTAL_MARGIN : 0,
|
|
87
|
+
marginRight: iconPosition === 'right' ? ICON_HORIZONTAL_MARGIN : 0,
|
|
88
|
+
...(isPressed && !disabled
|
|
89
|
+
? themeProps?.pressedStyle?.text
|
|
90
|
+
: themeProps?.text),
|
|
91
|
+
}),
|
|
92
|
+
[themeProps, iconPosition, disabled, isPressed]
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
const handleOnPressIn: onPressType = (
|
|
96
|
+
e: GestureResponderEvent | undefined
|
|
97
|
+
) => {
|
|
98
|
+
if (onPressIn) onPressIn(e);
|
|
99
|
+
setIsPressed(true);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const handleOnPressOut: onPressType = (
|
|
103
|
+
e: GestureResponderEvent | undefined
|
|
104
|
+
) => {
|
|
105
|
+
if (onPressOut) onPressOut(e);
|
|
106
|
+
setIsPressed(false);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const handleOnPress: onPressType = (e: GestureResponderEvent | undefined) => {
|
|
110
|
+
if (onPress) onPress(e);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const FicSecondary = useCallback(() => {
|
|
114
|
+
return (
|
|
115
|
+
<View style={ficSecondaryViewStyle}>
|
|
116
|
+
{iconPosition === 'left' ? (
|
|
117
|
+
<Icon
|
|
118
|
+
name={iconName || DEFAULT_ICON}
|
|
119
|
+
size={iconSize ?? DEFAULT_ICON_SIZE}
|
|
120
|
+
color={themeProps?.icon.color}
|
|
121
|
+
solid={solid}
|
|
122
|
+
regular={regular}
|
|
123
|
+
light={light}
|
|
124
|
+
duotone={duotone}
|
|
125
|
+
/>
|
|
126
|
+
) : null}
|
|
127
|
+
<Body text={title ?? DEFAULT_TITLE} style={bodyStyle} />
|
|
128
|
+
{iconPosition === 'right' ? (
|
|
129
|
+
<Icon
|
|
130
|
+
name={iconName || DEFAULT_ICON}
|
|
131
|
+
size={iconSize ?? DEFAULT_ICON_SIZE}
|
|
132
|
+
color={themeProps?.icon.color}
|
|
133
|
+
solid={solid}
|
|
134
|
+
regular={regular}
|
|
135
|
+
light={light}
|
|
136
|
+
duotone={duotone}
|
|
137
|
+
/>
|
|
138
|
+
) : null}
|
|
139
|
+
</View>
|
|
140
|
+
);
|
|
141
|
+
}, [iconPosition, iconName, iconSize, bodyStyle, title]);
|
|
142
|
+
|
|
143
|
+
return Platform.OS === 'android' ? (
|
|
144
|
+
<TouchableHighlight
|
|
145
|
+
disabled={disabled}
|
|
146
|
+
containerStyle={containerStyleObj}
|
|
147
|
+
style={[{ borderRadius: BORDER_RADIUS.SM }, styleBasedOnPress]}
|
|
148
|
+
onPress={handleOnPress}
|
|
149
|
+
onPressIn={handleOnPressIn}
|
|
150
|
+
onPressOut={handleOnPressOut}
|
|
151
|
+
underlayColor={themeProps?.pressedStyle?.container.backgroundColor}
|
|
152
|
+
>
|
|
153
|
+
{FicSecondary()}
|
|
154
|
+
</TouchableHighlight>
|
|
155
|
+
) : (
|
|
156
|
+
<Pressable
|
|
157
|
+
style={[styleBasedOnPress, containerStyleObj]}
|
|
158
|
+
onPress={handleOnPress}
|
|
159
|
+
onPressIn={handleOnPressIn}
|
|
160
|
+
onPressOut={handleOnPressOut}
|
|
161
|
+
disabled={disabled}
|
|
162
|
+
>
|
|
163
|
+
{FicSecondary()}
|
|
164
|
+
</Pressable>
|
|
165
|
+
);
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export default FicButtonSecondary;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
3
|
+
import {
|
|
4
|
+
GestureResponderEvent,
|
|
5
|
+
Platform,
|
|
6
|
+
Pressable as PressableIOS,
|
|
7
|
+
StyleProp,
|
|
8
|
+
TextStyle,
|
|
9
|
+
View,
|
|
10
|
+
ViewStyle
|
|
11
|
+
} from 'react-native';
|
|
12
|
+
import { TouchableHighlight } from 'react-native-gesture-handler';
|
|
13
|
+
import { useTheme } from '../../../hooks/useTheme';
|
|
14
|
+
import { Icon } from '../../../providers/IconProvider';
|
|
15
|
+
import { PADDING } from '../../../styles/space';
|
|
16
|
+
import { Body } from '../../typographies/Body';
|
|
17
|
+
import { DEFAULT_ICON, DEFAULT_ICON_SIZE, DEFAULT_TITLE, HIT_SLOP, ICON_HORIZONTAL_MARGIN } from './constants';
|
|
18
|
+
import { FicButtonTextProps, FicButtonThemeProps, onPressType } from './FicButton.types';
|
|
19
|
+
|
|
20
|
+
const FicButtonTertiary: React.FC<FicButtonTextProps> = ({
|
|
21
|
+
title,
|
|
22
|
+
iconName,
|
|
23
|
+
iconSize,
|
|
24
|
+
onPress,
|
|
25
|
+
onPressIn,
|
|
26
|
+
onPressOut,
|
|
27
|
+
disabled,
|
|
28
|
+
error,
|
|
29
|
+
iconPosition,
|
|
30
|
+
colorContrastForLightTheme,
|
|
31
|
+
fullWidth,
|
|
32
|
+
small,
|
|
33
|
+
solid,
|
|
34
|
+
regular,
|
|
35
|
+
light,
|
|
36
|
+
duotone,
|
|
37
|
+
containerStyle
|
|
38
|
+
}) => {
|
|
39
|
+
const { ficButton: theme } = useTheme() || {};
|
|
40
|
+
|
|
41
|
+
const Pressable = Platform.OS === 'ios' ? PressableIOS : TouchableHighlight;
|
|
42
|
+
|
|
43
|
+
const buttonTheme = (theme?.['tertiary'] as FicButtonThemeProps) || {};
|
|
44
|
+
const themeProps = disabled ? buttonTheme.disabled : error ? buttonTheme.error : buttonTheme.default;
|
|
45
|
+
const _containerStyle = containerStyle ?? {};
|
|
46
|
+
|
|
47
|
+
const [isPressed, setIsPressed] = useState(false);
|
|
48
|
+
|
|
49
|
+
const iconColor = useMemo(() => {
|
|
50
|
+
return colorContrastForLightTheme && !error
|
|
51
|
+
? themeProps?.icon.colorContrastForLightTheme
|
|
52
|
+
? themeProps?.icon.colorContrastForLightTheme
|
|
53
|
+
: themeProps?.icon.color
|
|
54
|
+
: themeProps?.icon.color;
|
|
55
|
+
}, [themeProps, colorContrastForLightTheme, error]);
|
|
56
|
+
|
|
57
|
+
const bodyColor = useMemo(() => {
|
|
58
|
+
return colorContrastForLightTheme && !error
|
|
59
|
+
? themeProps?.text.colorContrastForLightTheme
|
|
60
|
+
? themeProps?.text.colorContrastForLightTheme
|
|
61
|
+
: themeProps?.text.color
|
|
62
|
+
: themeProps?.text.color;
|
|
63
|
+
}, [themeProps, colorContrastForLightTheme, error]);
|
|
64
|
+
|
|
65
|
+
const bodyStyle: StyleProp<TextStyle> = useMemo(
|
|
66
|
+
() => ({
|
|
67
|
+
marginLeft: iconPosition === 'left' ? ICON_HORIZONTAL_MARGIN : 0,
|
|
68
|
+
marginRight: iconPosition === 'right' ? ICON_HORIZONTAL_MARGIN : 0,
|
|
69
|
+
textDecorationLine: themeProps?.text.textDecorationLine ?? 'underline'
|
|
70
|
+
}),
|
|
71
|
+
[themeProps, iconPosition, isPressed, disabled]
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
const tertiaryPressedAreaStyle: StyleProp<ViewStyle> = useMemo(
|
|
75
|
+
() => ({
|
|
76
|
+
top: small ? -PADDING.SM : -PADDING.LG,
|
|
77
|
+
bottom: small ? -PADDING.SM : -PADDING.LG,
|
|
78
|
+
left: fullWidth ? 0 : PADDING.LG * -1,
|
|
79
|
+
right: fullWidth ? 0 : PADDING.LG * -1,
|
|
80
|
+
position: 'absolute',
|
|
81
|
+
...themeProps?.pressedStyle?.container
|
|
82
|
+
}),
|
|
83
|
+
[small, themeProps, fullWidth]
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
const dynamicContainerStyle: StyleProp<ViewStyle> = useMemo(
|
|
87
|
+
() => ({
|
|
88
|
+
paddingTop: small ? PADDING.SM : PADDING.LG,
|
|
89
|
+
paddingBottom: small ? PADDING.SM : PADDING.LG,
|
|
90
|
+
width: '100%',
|
|
91
|
+
...(isPressed ? themeProps?.pressedStyle?.container : themeProps?.container)
|
|
92
|
+
}),
|
|
93
|
+
[disabled, themeProps, isPressed]
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
const dynamicContainerStyleContainer: StyleProp<ViewStyle> = useMemo(
|
|
97
|
+
() => ({
|
|
98
|
+
width: '100%',
|
|
99
|
+
...(isPressed ? themeProps?.pressedStyle?.container : themeProps?.container)
|
|
100
|
+
}),
|
|
101
|
+
[disabled, themeProps, isPressed]
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
const handleOnPressIn: onPressType = (e: GestureResponderEvent | undefined) => {
|
|
105
|
+
if (onPressIn) onPressIn(e);
|
|
106
|
+
setIsPressed(true);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const handleOnPressOut: onPressType = (e: GestureResponderEvent | undefined) => {
|
|
110
|
+
if (onPressOut) onPressOut(e);
|
|
111
|
+
setIsPressed(false);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const handleOnPress: onPressType = (e: GestureResponderEvent | undefined) => {
|
|
115
|
+
if (onPress) onPress(e);
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const FicTertiary = useCallback(() => {
|
|
119
|
+
return (
|
|
120
|
+
<>
|
|
121
|
+
{iconPosition === 'left' ? (
|
|
122
|
+
<Icon
|
|
123
|
+
name={iconName || DEFAULT_ICON}
|
|
124
|
+
size={iconSize ?? DEFAULT_ICON_SIZE}
|
|
125
|
+
color={iconColor}
|
|
126
|
+
solid={solid}
|
|
127
|
+
regular={regular}
|
|
128
|
+
light={light}
|
|
129
|
+
duotone={duotone}
|
|
130
|
+
/>
|
|
131
|
+
) : null}
|
|
132
|
+
<Body text={title ?? DEFAULT_TITLE} style={bodyStyle} color={bodyColor} />
|
|
133
|
+
{iconPosition === 'right' ? (
|
|
134
|
+
<Icon
|
|
135
|
+
name={iconName || DEFAULT_ICON}
|
|
136
|
+
size={iconSize ?? DEFAULT_ICON_SIZE}
|
|
137
|
+
color={iconColor}
|
|
138
|
+
solid={solid}
|
|
139
|
+
regular={regular}
|
|
140
|
+
light={light}
|
|
141
|
+
duotone={duotone}
|
|
142
|
+
/>
|
|
143
|
+
) : null}
|
|
144
|
+
</>
|
|
145
|
+
);
|
|
146
|
+
}, [iconPosition, iconName, iconSize, buttonTheme, disabled, error, bodyStyle, title]);
|
|
147
|
+
|
|
148
|
+
return fullWidth ? (
|
|
149
|
+
<Pressable
|
|
150
|
+
style={[dynamicContainerStyle, Platform.OS === 'ios' ? _containerStyle : {}]}
|
|
151
|
+
containerStyle={[dynamicContainerStyleContainer, _containerStyle]}
|
|
152
|
+
onPress={handleOnPress}
|
|
153
|
+
onPressIn={handleOnPressIn}
|
|
154
|
+
onPressOut={handleOnPressOut}
|
|
155
|
+
disabled={disabled}
|
|
156
|
+
hitSlop={HIT_SLOP}
|
|
157
|
+
underlayColor={'transparent'}
|
|
158
|
+
>
|
|
159
|
+
{FicTertiary()}
|
|
160
|
+
</Pressable>
|
|
161
|
+
) : (
|
|
162
|
+
<View
|
|
163
|
+
style={[
|
|
164
|
+
{
|
|
165
|
+
position: 'relative',
|
|
166
|
+
alignSelf: 'flex-start',
|
|
167
|
+
width: fullWidth ? '100%' : 'auto'
|
|
168
|
+
},
|
|
169
|
+
_containerStyle
|
|
170
|
+
]}
|
|
171
|
+
>
|
|
172
|
+
{isPressed ? <View style={[tertiaryPressedAreaStyle]} /> : null}
|
|
173
|
+
<Pressable
|
|
174
|
+
style={themeProps?.container}
|
|
175
|
+
onPress={handleOnPress}
|
|
176
|
+
onPressIn={handleOnPressIn}
|
|
177
|
+
onPressOut={handleOnPressOut}
|
|
178
|
+
disabled={disabled}
|
|
179
|
+
hitSlop={HIT_SLOP}
|
|
180
|
+
underlayColor={'transparent'}
|
|
181
|
+
>
|
|
182
|
+
{FicTertiary()}
|
|
183
|
+
</Pressable>
|
|
184
|
+
</View>
|
|
185
|
+
);
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
export default FicButtonTertiary;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Insets } from 'react-native';
|
|
2
|
+
import { Colors } from '../../../styles/colors';
|
|
3
|
+
import { PADDING } from '../../../styles/space';
|
|
4
|
+
|
|
5
|
+
export const FONT_SIZE = 17;
|
|
6
|
+
|
|
7
|
+
export const ICON_HORIZONTAL_MARGIN = 8;
|
|
8
|
+
export const ICON_SIZE_BIG = 24;
|
|
9
|
+
|
|
10
|
+
export const DEFAULT_ICON_SIZE = 16;
|
|
11
|
+
export const DEFAULT_PRESSED_BG_COLOR = Colors.GREY_2;
|
|
12
|
+
|
|
13
|
+
export const DEFAULT_TITLE = 'Button';
|
|
14
|
+
export const DEFAULT_ICON = 'heart';
|
|
15
|
+
|
|
16
|
+
export const BUTTON_INTERNAL_PADDING_HORIZONTAL = PADDING.LG;
|
|
17
|
+
|
|
18
|
+
export const HIT_SLOP: Insets = {
|
|
19
|
+
top: 16,
|
|
20
|
+
left: 16,
|
|
21
|
+
right: 16,
|
|
22
|
+
bottom: 16,
|
|
23
|
+
};
|