@ovotech/element-native 2.0.0 → 2.0.2
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/components/Accordion/Accordion.d.ts +5 -0
- package/dist/components/Accordion/Accordion.js +139 -0
- package/dist/components/Accordion/Group.d.ts +3 -0
- package/dist/components/Accordion/Group.js +41 -0
- package/dist/components/Accordion/Icon.d.ts +4 -0
- package/dist/components/Accordion/Icon.js +68 -0
- package/dist/components/Accordion/hooks.d.ts +6 -0
- package/dist/components/Accordion/hooks.js +43 -0
- package/dist/components/Accordion/index.d.ts +4 -0
- package/dist/components/Accordion/index.js +9 -0
- package/dist/components/Accordion/styles.d.ts +46 -0
- package/dist/components/Accordion/styles.js +52 -0
- package/dist/components/Accordion/types.d.ts +20 -0
- package/dist/components/Accordion/types.js +2 -0
- package/dist/components/Badge/Badge.d.ts +12 -0
- package/dist/components/Badge/Badge.js +79 -0
- package/dist/components/Badge/index.d.ts +1 -0
- package/dist/components/Badge/index.js +5 -0
- package/dist/components/CTAButton/CTAButton.d.ts +24 -0
- package/dist/components/CTAButton/CTAButton.js +107 -0
- package/dist/components/CTAButton/index.d.ts +1 -0
- package/dist/components/CTAButton/index.js +8 -0
- package/dist/components/CTALink/CTALink.d.ts +12 -0
- package/dist/components/CTALink/CTALink.js +45 -0
- package/dist/components/CTALink/index.d.ts +1 -0
- package/dist/components/CTALink/index.js +7 -0
- package/dist/components/Card/Card.d.ts +7 -0
- package/dist/components/Card/Card.js +33 -0
- package/dist/components/Card/index.d.ts +1 -0
- package/dist/components/Card/index.js +5 -0
- package/dist/components/Checkbox/Checkbox.d.ts +12 -0
- package/dist/components/Checkbox/Checkbox.js +121 -0
- package/dist/components/Checkbox/CheckboxField.d.ts +9 -0
- package/dist/components/Checkbox/CheckboxField.js +73 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Checkbox/index.js +7 -0
- package/dist/components/DataTable/DataTable.d.ts +13 -0
- package/dist/components/DataTable/DataTable.js +134 -0
- package/dist/components/DataTable/index.d.ts +1 -0
- package/dist/components/DataTable/index.js +5 -0
- package/dist/components/DateField/DateField.d.ts +21 -0
- package/dist/components/DateField/DateField.js +109 -0
- package/dist/components/DateField/index.d.ts +1 -0
- package/dist/components/DateField/index.js +5 -0
- package/dist/components/Disclosure/Disclosure.d.ts +8 -0
- package/dist/components/Disclosure/Disclosure.js +86 -0
- package/dist/components/Disclosure/index.d.ts +1 -0
- package/dist/components/Disclosure/index.js +17 -0
- package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.d.ts +18 -0
- package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.js +73 -0
- package/dist/components/ErrorSummaryNotification/index.d.ts +1 -0
- package/dist/components/ErrorSummaryNotification/index.js +5 -0
- package/dist/components/ErrorText/ErrorText.d.ts +13 -0
- package/dist/components/ErrorText/ErrorText.js +41 -0
- package/dist/components/ErrorText/index.d.ts +1 -0
- package/dist/components/ErrorText/index.js +5 -0
- package/dist/components/Field/Field.d.ts +13 -0
- package/dist/components/Field/Field.js +94 -0
- package/dist/components/Field/index.d.ts +1 -0
- package/dist/components/Field/index.js +17 -0
- package/dist/components/FormGroup/FormGroup.d.ts +8 -0
- package/dist/components/FormGroup/FormGroup.js +43 -0
- package/dist/components/FormGroup/index.d.ts +1 -0
- package/dist/components/FormGroup/index.js +5 -0
- package/dist/components/Grid/Col.d.ts +12 -0
- package/dist/components/Grid/Col.js +58 -0
- package/dist/components/Grid/Row.d.ts +9 -0
- package/dist/components/Grid/Row.js +76 -0
- package/dist/components/Grid/index.d.ts +2 -0
- package/dist/components/Grid/index.js +7 -0
- package/dist/components/Heading/Heading.d.ts +6 -0
- package/dist/components/Heading/Heading.js +115 -0
- package/dist/components/Heading/index.d.ts +1 -0
- package/dist/components/Heading/index.js +8 -0
- package/dist/components/HintText/HintText.d.ts +13 -0
- package/dist/components/HintText/HintText.js +41 -0
- package/dist/components/HintText/index.d.ts +1 -0
- package/dist/components/HintText/index.js +5 -0
- package/dist/components/Icon/Icon.d.ts +11 -0
- package/dist/components/Icon/Icon.js +62 -0
- package/dist/components/Icon/index.d.ts +1 -0
- package/dist/components/Icon/index.js +5 -0
- package/dist/components/Input/CurrencyInput.d.ts +15 -0
- package/dist/components/Input/CurrencyInput.js +59 -0
- package/dist/components/Input/EmailInput.d.ts +9 -0
- package/dist/components/Input/EmailInput.js +41 -0
- package/dist/components/Input/Input.d.ts +16 -0
- package/dist/components/Input/Input.js +102 -0
- package/dist/components/Input/NumberInput.d.ts +9 -0
- package/dist/components/Input/NumberInput.js +41 -0
- package/dist/components/Input/PasswordInput.d.ts +9 -0
- package/dist/components/Input/PasswordInput.js +55 -0
- package/dist/components/Input/TelInput.d.ts +9 -0
- package/dist/components/Input/TelInput.js +41 -0
- package/dist/components/Input/TextInput.d.ts +9 -0
- package/dist/components/Input/TextInput.js +41 -0
- package/dist/components/Input/TextareaInput.d.ts +15 -0
- package/dist/components/Input/TextareaInput.js +64 -0
- package/dist/components/Input/index.d.ts +7 -0
- package/dist/components/Input/index.js +17 -0
- package/dist/components/LabelText/LabelText.d.ts +13 -0
- package/dist/components/LabelText/LabelText.js +41 -0
- package/dist/components/LabelText/index.d.ts +1 -0
- package/dist/components/LabelText/index.js +5 -0
- package/dist/components/List/List.d.ts +29 -0
- package/dist/components/List/List.js +169 -0
- package/dist/components/List/index.d.ts +1 -0
- package/dist/components/List/index.js +10 -0
- package/dist/components/Margin/Margin.d.ts +23 -0
- package/dist/components/Margin/Margin.js +53 -0
- package/dist/components/Margin/index.d.ts +1 -0
- package/dist/components/Margin/index.js +5 -0
- package/dist/components/NavHeader/NavHeader.d.ts +15 -0
- package/dist/components/NavHeader/NavHeader.js +93 -0
- package/dist/components/NavHeader/index.d.ts +1 -0
- package/dist/components/NavHeader/index.js +5 -0
- package/dist/components/Notification/Notification.d.ts +31 -0
- package/dist/components/Notification/Notification.js +118 -0
- package/dist/components/Notification/index.d.ts +1 -0
- package/dist/components/Notification/index.js +9 -0
- package/dist/components/Radio/Radio.d.ts +12 -0
- package/dist/components/Radio/Radio.js +114 -0
- package/dist/components/Radio/RadioField.d.ts +11 -0
- package/dist/components/Radio/RadioField.js +78 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/Radio/index.js +7 -0
- package/dist/components/SkeletonLoading/Skeleton.d.ts +1 -0
- package/dist/components/SkeletonLoading/Skeleton.js +13 -0
- package/dist/components/SkeletonLoading/SkeletonCTA.d.ts +6 -0
- package/dist/components/SkeletonLoading/SkeletonCTA.js +41 -0
- package/dist/components/SkeletonLoading/SkeletonCircle.d.ts +6 -0
- package/dist/components/SkeletonLoading/SkeletonCircle.js +46 -0
- package/dist/components/SkeletonLoading/SkeletonHeading.d.ts +8 -0
- package/dist/components/SkeletonLoading/SkeletonHeading.js +41 -0
- package/dist/components/SkeletonLoading/SkeletonText.d.ts +6 -0
- package/dist/components/SkeletonLoading/SkeletonText.js +49 -0
- package/dist/components/SkeletonLoading/index.d.ts +5 -0
- package/dist/components/SkeletonLoading/index.js +21 -0
- package/dist/components/Stack/Stack.d.ts +10 -0
- package/dist/components/Stack/Stack.js +75 -0
- package/dist/components/Stack/index.d.ts +1 -0
- package/dist/components/Stack/index.js +5 -0
- package/dist/components/Stretch/Stretch.d.ts +7 -0
- package/dist/components/Stretch/Stretch.js +31 -0
- package/dist/components/Stretch/index.d.ts +1 -0
- package/dist/components/Stretch/index.js +17 -0
- package/dist/components/SubLabelText/SubLabelText.d.ts +13 -0
- package/dist/components/SubLabelText/SubLabelText.js +41 -0
- package/dist/components/SubLabelText/index.d.ts +1 -0
- package/dist/components/SubLabelText/index.js +5 -0
- package/dist/components/SummaryList/SummaryList.d.ts +10 -0
- package/dist/components/SummaryList/SummaryList.js +66 -0
- package/dist/components/SummaryList/index.d.ts +1 -0
- package/dist/components/SummaryList/index.js +6 -0
- package/dist/components/Tabs/Tab.d.ts +11 -0
- package/dist/components/Tabs/Tab.js +74 -0
- package/dist/components/Tabs/TabList.d.ts +1 -0
- package/dist/components/Tabs/TabList.js +74 -0
- package/dist/components/Tabs/TabPanel.d.ts +3 -0
- package/dist/components/Tabs/TabPanel.js +41 -0
- package/dist/components/Tabs/Tabs.d.ts +9 -0
- package/dist/components/Tabs/Tabs.js +95 -0
- package/dist/components/Tabs/index.d.ts +4 -0
- package/dist/components/Tabs/index.js +11 -0
- package/dist/components/Text/Text.d.ts +26 -0
- package/dist/components/Text/Text.js +96 -0
- package/dist/components/Text/index.d.ts +1 -0
- package/dist/components/Text/index.js +10 -0
- package/dist/components/TextField/CurrencyField.d.ts +11 -0
- package/dist/components/TextField/CurrencyField.js +56 -0
- package/dist/components/TextField/EmailField.d.ts +9 -0
- package/dist/components/TextField/EmailField.js +56 -0
- package/dist/components/TextField/NumberField.d.ts +9 -0
- package/dist/components/TextField/NumberField.js +56 -0
- package/dist/components/TextField/PasswordField.d.ts +9 -0
- package/dist/components/TextField/PasswordField.js +56 -0
- package/dist/components/TextField/TelField.d.ts +9 -0
- package/dist/components/TextField/TelField.js +56 -0
- package/dist/components/TextField/TextField.d.ts +9 -0
- package/dist/components/TextField/TextField.js +56 -0
- package/dist/components/TextField/TextareaField.d.ts +11 -0
- package/dist/components/TextField/TextareaField.js +56 -0
- package/dist/components/TextField/index.d.ts +7 -0
- package/dist/components/TextField/index.js +17 -0
- package/dist/components/TextLink/TextLink.d.ts +8 -0
- package/dist/components/TextLink/TextLink.js +75 -0
- package/dist/components/TextLink/index.d.ts +1 -0
- package/dist/components/TextLink/index.js +5 -0
- package/dist/components/index.d.ts +27 -0
- package/dist/components/index.js +43 -0
- package/dist/esm/components/Accordion/Accordion.js +111 -0
- package/dist/esm/components/Accordion/Group.js +14 -0
- package/dist/esm/components/Accordion/Icon.js +38 -0
- package/dist/esm/components/Accordion/hooks.js +16 -0
- package/dist/esm/components/Accordion/index.js +3 -0
- package/dist/esm/components/Accordion/styles.js +49 -0
- package/dist/esm/components/Accordion/types.js +1 -0
- package/dist/esm/components/Badge/Badge.js +49 -0
- package/dist/esm/components/Badge/index.js +1 -0
- package/dist/esm/components/CTAButton/CTAButton.js +78 -0
- package/dist/esm/components/CTAButton/index.js +1 -0
- package/dist/esm/components/CTALink/CTALink.js +17 -0
- package/dist/esm/components/CTALink/index.js +1 -0
- package/dist/esm/components/Card/Card.js +27 -0
- package/dist/esm/components/Card/index.js +1 -0
- package/dist/esm/components/Checkbox/Checkbox.js +95 -0
- package/dist/esm/components/Checkbox/CheckboxField.js +47 -0
- package/dist/esm/components/Checkbox/index.js +2 -0
- package/dist/esm/components/DataTable/DataTable.js +108 -0
- package/dist/esm/components/DataTable/index.js +1 -0
- package/dist/esm/components/DateField/DateField.js +83 -0
- package/dist/esm/components/DateField/index.js +1 -0
- package/dist/esm/components/Disclosure/Disclosure.js +60 -0
- package/dist/esm/components/Disclosure/index.js +1 -0
- package/dist/esm/components/ErrorSummaryNotification/ErrorSummaryNotification.js +47 -0
- package/dist/esm/components/ErrorSummaryNotification/index.js +1 -0
- package/dist/esm/components/ErrorText/ErrorText.js +15 -0
- package/dist/esm/components/ErrorText/index.js +1 -0
- package/dist/esm/components/Field/Field.js +68 -0
- package/dist/esm/components/Field/index.js +1 -0
- package/dist/esm/components/FormGroup/FormGroup.js +37 -0
- package/dist/esm/components/FormGroup/index.js +1 -0
- package/dist/esm/components/Grid/Col.js +32 -0
- package/dist/esm/components/Grid/Row.js +47 -0
- package/dist/esm/components/Grid/index.js +2 -0
- package/dist/esm/components/Heading/Heading.js +82 -0
- package/dist/esm/components/Heading/index.js +1 -0
- package/dist/esm/components/HintText/HintText.js +15 -0
- package/dist/esm/components/HintText/index.js +1 -0
- package/dist/esm/components/Icon/Icon.js +35 -0
- package/dist/esm/components/Icon/index.js +1 -0
- package/dist/esm/components/Input/CurrencyInput.js +33 -0
- package/dist/esm/components/Input/EmailInput.js +15 -0
- package/dist/esm/components/Input/Input.js +76 -0
- package/dist/esm/components/Input/NumberInput.js +15 -0
- package/dist/esm/components/Input/PasswordInput.js +29 -0
- package/dist/esm/components/Input/TelInput.js +15 -0
- package/dist/esm/components/Input/TextInput.js +15 -0
- package/dist/esm/components/Input/TextareaInput.js +38 -0
- package/dist/esm/components/Input/index.js +7 -0
- package/dist/esm/components/LabelText/LabelText.js +15 -0
- package/dist/esm/components/LabelText/index.js +1 -0
- package/dist/esm/components/List/List.js +138 -0
- package/dist/esm/components/List/index.js +1 -0
- package/dist/esm/components/Margin/Margin.js +47 -0
- package/dist/esm/components/Margin/index.js +1 -0
- package/dist/esm/components/NavHeader/NavHeader.js +63 -0
- package/dist/esm/components/NavHeader/index.js +1 -0
- package/dist/esm/components/Notification/Notification.js +92 -0
- package/dist/esm/components/Notification/index.js +1 -0
- package/dist/esm/components/Radio/Radio.js +85 -0
- package/dist/esm/components/Radio/RadioField.js +52 -0
- package/dist/esm/components/Radio/index.js +2 -0
- package/dist/esm/components/SkeletonLoading/Skeleton.js +7 -0
- package/dist/esm/components/SkeletonLoading/SkeletonCTA.js +34 -0
- package/dist/esm/components/SkeletonLoading/SkeletonCircle.js +39 -0
- package/dist/esm/components/SkeletonLoading/SkeletonHeading.js +34 -0
- package/dist/esm/components/SkeletonLoading/SkeletonText.js +42 -0
- package/dist/esm/components/SkeletonLoading/index.js +5 -0
- package/dist/esm/components/Stack/Stack.js +46 -0
- package/dist/esm/components/Stack/index.js +1 -0
- package/dist/esm/components/Stretch/Stretch.js +24 -0
- package/dist/esm/components/Stretch/index.js +1 -0
- package/dist/esm/components/SubLabelText/SubLabelText.js +15 -0
- package/dist/esm/components/SubLabelText/index.js +1 -0
- package/dist/esm/components/SummaryList/SummaryList.js +39 -0
- package/dist/esm/components/SummaryList/index.js +1 -0
- package/dist/esm/components/Tabs/Tab.js +45 -0
- package/dist/esm/components/Tabs/TabList.js +48 -0
- package/dist/esm/components/Tabs/TabPanel.js +34 -0
- package/dist/esm/components/Tabs/Tabs.js +69 -0
- package/dist/esm/components/Tabs/index.js +4 -0
- package/dist/esm/components/Text/Text.js +69 -0
- package/dist/esm/components/Text/index.js +1 -0
- package/dist/esm/components/TextField/CurrencyField.js +30 -0
- package/dist/esm/components/TextField/EmailField.js +30 -0
- package/dist/esm/components/TextField/NumberField.js +30 -0
- package/dist/esm/components/TextField/PasswordField.js +30 -0
- package/dist/esm/components/TextField/TelField.js +30 -0
- package/dist/esm/components/TextField/TextField.js +30 -0
- package/dist/esm/components/TextField/TextareaField.js +30 -0
- package/dist/esm/components/TextField/index.js +7 -0
- package/dist/esm/components/TextLink/TextLink.js +49 -0
- package/dist/esm/components/TextLink/index.js +1 -0
- package/dist/esm/components/index.js +27 -0
- package/dist/esm/hooks/index.js +2 -0
- package/dist/esm/hooks/use-breakpoint.js +12 -0
- package/dist/esm/hooks/use-full-width.js +16 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/providers/IconsProvider.js +65 -0
- package/dist/esm/providers/icons/ArrowDown.js +15 -0
- package/dist/esm/providers/icons/ArrowLeft.js +15 -0
- package/dist/esm/providers/icons/ArrowRight.js +15 -0
- package/dist/esm/providers/icons/ArrowUp.js +15 -0
- package/dist/esm/providers/icons/CaretDown.js +15 -0
- package/dist/esm/providers/icons/CaretLeft.js +15 -0
- package/dist/esm/providers/icons/CaretRight.js +15 -0
- package/dist/esm/providers/icons/CaretUp.js +15 -0
- package/dist/esm/providers/icons/Chart.js +15 -0
- package/dist/esm/providers/icons/Check.js +15 -0
- package/dist/esm/providers/icons/ChevronDown.js +15 -0
- package/dist/esm/providers/icons/ChevronLeft.js +15 -0
- package/dist/esm/providers/icons/ChevronLeftSmall.js +15 -0
- package/dist/esm/providers/icons/ChevronLeftSmallFirst.js +15 -0
- package/dist/esm/providers/icons/ChevronRight.js +15 -0
- package/dist/esm/providers/icons/ChevronRightSmall.js +15 -0
- package/dist/esm/providers/icons/ChevronRightSmallLast.js +15 -0
- package/dist/esm/providers/icons/ChevronUp.js +15 -0
- package/dist/esm/providers/icons/Cross.js +15 -0
- package/dist/esm/providers/icons/Dollar.js +15 -0
- package/dist/esm/providers/icons/Download.js +15 -0
- package/dist/esm/providers/icons/Electricity.js +15 -0
- package/dist/esm/providers/icons/Euro.js +15 -0
- package/dist/esm/providers/icons/Gas.js +16 -0
- package/dist/esm/providers/icons/Help.js +15 -0
- package/dist/esm/providers/icons/Hide.js +15 -0
- package/dist/esm/providers/icons/Home.js +15 -0
- package/dist/esm/providers/icons/Info.js +15 -0
- package/dist/esm/providers/icons/Link.js +16 -0
- package/dist/esm/providers/icons/Logo.js +15 -0
- package/dist/esm/providers/icons/Minus.js +15 -0
- package/dist/esm/providers/icons/NewWindow.js +15 -0
- package/dist/esm/providers/icons/PaymentCard.js +15 -0
- package/dist/esm/providers/icons/Plus.js +15 -0
- package/dist/esm/providers/icons/Pound.js +15 -0
- package/dist/esm/providers/icons/Search.js +15 -0
- package/dist/esm/providers/icons/Show.js +15 -0
- package/dist/esm/providers/icons/User.js +15 -0
- package/dist/esm/providers/icons/index.js +38 -0
- package/dist/esm/providers/index.js +2 -0
- package/dist/esm/providers/types.js +1 -0
- package/dist/esm/styled.native.js +4 -0
- package/dist/esm/theme/create-theme.js +504 -0
- package/dist/esm/theme/index.js +8 -0
- package/dist/esm/theme/theme.js +1 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/utils.js +93 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +18 -0
- package/dist/hooks/use-breakpoint.d.ts +7 -0
- package/dist/hooks/use-breakpoint.js +16 -0
- package/dist/hooks/use-full-width.d.ts +2 -0
- package/dist/hooks/use-full-width.js +20 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +19 -0
- package/dist/providers/IconsProvider.d.ts +8 -0
- package/dist/providers/IconsProvider.js +93 -0
- package/dist/providers/icons/ArrowDown.d.ts +2 -0
- package/dist/providers/icons/ArrowDown.js +22 -0
- package/dist/providers/icons/ArrowLeft.d.ts +2 -0
- package/dist/providers/icons/ArrowLeft.js +22 -0
- package/dist/providers/icons/ArrowRight.d.ts +2 -0
- package/dist/providers/icons/ArrowRight.js +22 -0
- package/dist/providers/icons/ArrowUp.d.ts +2 -0
- package/dist/providers/icons/ArrowUp.js +22 -0
- package/dist/providers/icons/CaretDown.d.ts +2 -0
- package/dist/providers/icons/CaretDown.js +22 -0
- package/dist/providers/icons/CaretLeft.d.ts +2 -0
- package/dist/providers/icons/CaretLeft.js +22 -0
- package/dist/providers/icons/CaretRight.d.ts +2 -0
- package/dist/providers/icons/CaretRight.js +22 -0
- package/dist/providers/icons/CaretUp.d.ts +2 -0
- package/dist/providers/icons/CaretUp.js +22 -0
- package/dist/providers/icons/Chart.d.ts +2 -0
- package/dist/providers/icons/Chart.js +22 -0
- package/dist/providers/icons/Check.d.ts +2 -0
- package/dist/providers/icons/Check.js +22 -0
- package/dist/providers/icons/ChevronDown.d.ts +2 -0
- package/dist/providers/icons/ChevronDown.js +22 -0
- package/dist/providers/icons/ChevronLeft.d.ts +2 -0
- package/dist/providers/icons/ChevronLeft.js +22 -0
- package/dist/providers/icons/ChevronLeftSmall.d.ts +2 -0
- package/dist/providers/icons/ChevronLeftSmall.js +22 -0
- package/dist/providers/icons/ChevronLeftSmallFirst.d.ts +2 -0
- package/dist/providers/icons/ChevronLeftSmallFirst.js +22 -0
- package/dist/providers/icons/ChevronRight.d.ts +2 -0
- package/dist/providers/icons/ChevronRight.js +22 -0
- package/dist/providers/icons/ChevronRightSmall.d.ts +2 -0
- package/dist/providers/icons/ChevronRightSmall.js +22 -0
- package/dist/providers/icons/ChevronRightSmallLast.d.ts +2 -0
- package/dist/providers/icons/ChevronRightSmallLast.js +22 -0
- package/dist/providers/icons/ChevronUp.d.ts +2 -0
- package/dist/providers/icons/ChevronUp.js +22 -0
- package/dist/providers/icons/Cross.d.ts +2 -0
- package/dist/providers/icons/Cross.js +22 -0
- package/dist/providers/icons/Dollar.d.ts +2 -0
- package/dist/providers/icons/Dollar.js +22 -0
- package/dist/providers/icons/Download.d.ts +2 -0
- package/dist/providers/icons/Download.js +22 -0
- package/dist/providers/icons/Electricity.d.ts +2 -0
- package/dist/providers/icons/Electricity.js +22 -0
- package/dist/providers/icons/Euro.d.ts +2 -0
- package/dist/providers/icons/Euro.js +22 -0
- package/dist/providers/icons/Gas.d.ts +2 -0
- package/dist/providers/icons/Gas.js +23 -0
- package/dist/providers/icons/Help.d.ts +2 -0
- package/dist/providers/icons/Help.js +22 -0
- package/dist/providers/icons/Hide.d.ts +2 -0
- package/dist/providers/icons/Hide.js +22 -0
- package/dist/providers/icons/Home.d.ts +2 -0
- package/dist/providers/icons/Home.js +22 -0
- package/dist/providers/icons/Info.d.ts +2 -0
- package/dist/providers/icons/Info.js +22 -0
- package/dist/providers/icons/Link.d.ts +2 -0
- package/dist/providers/icons/Link.js +23 -0
- package/dist/providers/icons/Logo.d.ts +2 -0
- package/dist/providers/icons/Logo.js +22 -0
- package/dist/providers/icons/Minus.d.ts +2 -0
- package/dist/providers/icons/Minus.js +22 -0
- package/dist/providers/icons/NewWindow.d.ts +2 -0
- package/dist/providers/icons/NewWindow.js +22 -0
- package/dist/providers/icons/PaymentCard.d.ts +2 -0
- package/dist/providers/icons/PaymentCard.js +22 -0
- package/dist/providers/icons/Plus.d.ts +2 -0
- package/dist/providers/icons/Plus.js +22 -0
- package/dist/providers/icons/Pound.d.ts +2 -0
- package/dist/providers/icons/Pound.js +22 -0
- package/dist/providers/icons/Search.d.ts +2 -0
- package/dist/providers/icons/Search.js +22 -0
- package/dist/providers/icons/Show.d.ts +2 -0
- package/dist/providers/icons/Show.js +22 -0
- package/dist/providers/icons/User.d.ts +2 -0
- package/dist/providers/icons/User.js +22 -0
- package/dist/providers/icons/index.d.ts +38 -0
- package/dist/providers/icons/index.js +54 -0
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.js +18 -0
- package/dist/providers/types.d.ts +4 -0
- package/dist/providers/types.js +2 -0
- package/dist/styled.native.d.ts +6 -0
- package/dist/styled.native.js +33 -0
- package/dist/theme/create-theme.d.ts +18 -0
- package/dist/theme/create-theme.js +511 -0
- package/dist/theme/index.d.ts +5 -0
- package/dist/theme/index.js +26 -0
- package/dist/theme/theme.d.ts +302 -0
- package/dist/theme/theme.js +2 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +17 -0
- package/dist/utils/utils.d.ts +15 -0
- package/dist/utils/utils.js +126 -0
- package/package.json +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Accordion"), exports);
|
|
18
|
+
__exportStar(require("./Badge"), exports);
|
|
19
|
+
__exportStar(require("./Card"), exports);
|
|
20
|
+
__exportStar(require("./Checkbox"), exports);
|
|
21
|
+
__exportStar(require("./CTAButton"), exports);
|
|
22
|
+
__exportStar(require("./CTALink"), exports);
|
|
23
|
+
__exportStar(require("./DateField"), exports);
|
|
24
|
+
__exportStar(require("./Disclosure"), exports);
|
|
25
|
+
__exportStar(require("./ErrorSummaryNotification"), exports);
|
|
26
|
+
__exportStar(require("./Field"), exports);
|
|
27
|
+
__exportStar(require("./Grid"), exports);
|
|
28
|
+
__exportStar(require("./NavHeader"), exports);
|
|
29
|
+
__exportStar(require("./Heading"), exports);
|
|
30
|
+
__exportStar(require("./Icon"), exports);
|
|
31
|
+
__exportStar(require("./Input"), exports);
|
|
32
|
+
__exportStar(require("./List"), exports);
|
|
33
|
+
__exportStar(require("./Margin"), exports);
|
|
34
|
+
__exportStar(require("./Notification"), exports);
|
|
35
|
+
__exportStar(require("./Radio"), exports);
|
|
36
|
+
__exportStar(require("./SummaryList"), exports);
|
|
37
|
+
__exportStar(require("./Stack"), exports);
|
|
38
|
+
__exportStar(require("./Tabs"), exports);
|
|
39
|
+
__exportStar(require("./Text"), exports);
|
|
40
|
+
__exportStar(require("./TextField"), exports);
|
|
41
|
+
__exportStar(require("./TextLink"), exports);
|
|
42
|
+
__exportStar(require("./DataTable"), exports);
|
|
43
|
+
__exportStar(require("./SkeletonLoading"), exports);
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __assign = (this && this.__assign) || function () {
|
|
17
|
+
__assign = Object.assign || function(t) {
|
|
18
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
+
s = arguments[i];
|
|
20
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
21
|
+
t[p] = s[p];
|
|
22
|
+
}
|
|
23
|
+
return t;
|
|
24
|
+
};
|
|
25
|
+
return __assign.apply(this, arguments);
|
|
26
|
+
};
|
|
27
|
+
import React, { useCallback, useMemo, useEffect } from 'react';
|
|
28
|
+
import { View, TouchableOpacity } from 'react-native';
|
|
29
|
+
import Animated, { useSharedValue, useAnimatedStyle, useDerivedValue, withTiming, runOnUI, interpolateColor, } from 'react-native-reanimated';
|
|
30
|
+
import { theme } from '../../theme';
|
|
31
|
+
import { Heading3 } from '../Heading';
|
|
32
|
+
import { AccordionIcon } from './Icon';
|
|
33
|
+
import { useLayout } from './hooks';
|
|
34
|
+
import { styles } from './styles';
|
|
35
|
+
var _a = theme.colors, canvas = _a.canvas, canvasMuted = _a.canvasMuted, primary = _a.primary, greyDarker = _a.brand.grey.darker;
|
|
36
|
+
export function withAnimated(WrappedComponent) {
|
|
37
|
+
var displayName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
38
|
+
// eslint-disable-next-line react/prefer-stateless-function
|
|
39
|
+
var WithAnimated = /** @class */ (function (_super) {
|
|
40
|
+
__extends(WithAnimated, _super);
|
|
41
|
+
function WithAnimated() {
|
|
42
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
43
|
+
}
|
|
44
|
+
WithAnimated.prototype.render = function () {
|
|
45
|
+
return React.createElement(WrappedComponent, __assign({}, this.props));
|
|
46
|
+
};
|
|
47
|
+
WithAnimated.displayName = "WithAnimated(".concat(displayName, ")");
|
|
48
|
+
return WithAnimated;
|
|
49
|
+
}(React.Component));
|
|
50
|
+
return Animated.createAnimatedComponent(WithAnimated);
|
|
51
|
+
}
|
|
52
|
+
export var Accordion = function (_a) {
|
|
53
|
+
var _b = _a.expanded, expanded = _b === void 0 ? false : _b, first = _a.first, _c = _a.headingComponent, headingComponent = _c === void 0 ? Heading3 : _c, last = _a.last, title = _a.title, children = _a.children, onToggle = _a.onToggle;
|
|
54
|
+
var AnimatedHeading = useMemo(function () { return withAnimated(headingComponent); }, [
|
|
55
|
+
headingComponent,
|
|
56
|
+
]);
|
|
57
|
+
var _d = useLayout(0), layout = _d[0], onLayout = _d[1];
|
|
58
|
+
var open = useSharedValue(expanded);
|
|
59
|
+
var handleHeightContent = useMemo(function () { return layout.height || 100; }, [
|
|
60
|
+
layout.height,
|
|
61
|
+
]);
|
|
62
|
+
var size = useSharedValue(handleHeightContent);
|
|
63
|
+
useEffect(function () {
|
|
64
|
+
runOnUI(function () {
|
|
65
|
+
'worklet';
|
|
66
|
+
if (expanded && handleHeightContent) {
|
|
67
|
+
size.value = handleHeightContent;
|
|
68
|
+
}
|
|
69
|
+
})();
|
|
70
|
+
}, [handleHeightContent, expanded, size]);
|
|
71
|
+
useEffect(function () {
|
|
72
|
+
runOnUI(function () {
|
|
73
|
+
'worklet';
|
|
74
|
+
if (handleHeightContent) {
|
|
75
|
+
size.value = handleHeightContent;
|
|
76
|
+
}
|
|
77
|
+
})();
|
|
78
|
+
}, [handleHeightContent, size]);
|
|
79
|
+
var progress = useDerivedValue(function () { return withTiming(open.value ? 1 : 0); });
|
|
80
|
+
var style = useAnimatedStyle(function () { return ({
|
|
81
|
+
height: size.value * progress.value + 1,
|
|
82
|
+
}); });
|
|
83
|
+
var toggleOpen = useCallback(function () {
|
|
84
|
+
onToggle === null || onToggle === void 0 ? void 0 : onToggle(!open.value);
|
|
85
|
+
if (size.value === 0) {
|
|
86
|
+
runOnUI(function () {
|
|
87
|
+
'worklet';
|
|
88
|
+
size.value = handleHeightContent;
|
|
89
|
+
})();
|
|
90
|
+
}
|
|
91
|
+
open.value = !open.value;
|
|
92
|
+
}, [handleHeightContent, open, size]);
|
|
93
|
+
var containerAnimatedStyle = useMemo(function () { return [styles.content, style]; }, [style]);
|
|
94
|
+
var headerStyle = useAnimatedStyle(function () { return ({
|
|
95
|
+
color: interpolateColor(progress.value, [0, 1], [greyDarker, primary]),
|
|
96
|
+
}); });
|
|
97
|
+
var backgroundStyle = useAnimatedStyle(function () { return ({
|
|
98
|
+
backgroundColor: interpolateColor(progress.value, [0, 1], [canvas, canvasMuted]),
|
|
99
|
+
}); });
|
|
100
|
+
return (React.createElement(Animated.View, { style: [
|
|
101
|
+
backgroundStyle,
|
|
102
|
+
styles.accordion,
|
|
103
|
+
first ? styles.topItem : null,
|
|
104
|
+
last ? styles.bottomItem : null,
|
|
105
|
+
] },
|
|
106
|
+
React.createElement(TouchableOpacity, { accessibilityState: { expanded: expanded }, onPress: toggleOpen, style: styles.accordionHeader },
|
|
107
|
+
React.createElement(AnimatedHeading, { style: [headerStyle, styles.accordionHeaderText] }, title),
|
|
108
|
+
React.createElement(AccordionIcon, { animationTiming: progress })),
|
|
109
|
+
React.createElement(Animated.View, { style: containerAnimatedStyle },
|
|
110
|
+
React.createElement(View, { onLayout: onLayout, style: styles.container }, children))));
|
|
111
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { Children, cloneElement, isValidElement, } from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
export var AccordionGroup = function (_a) {
|
|
4
|
+
var children = _a.children;
|
|
5
|
+
var childCount = Children.count(children);
|
|
6
|
+
return (React.createElement(View, null, Children.map(children, function (child, i) {
|
|
7
|
+
return isValidElement(child)
|
|
8
|
+
? cloneElement(child, {
|
|
9
|
+
first: i === 0,
|
|
10
|
+
last: i === childCount - 1,
|
|
11
|
+
})
|
|
12
|
+
: child;
|
|
13
|
+
})));
|
|
14
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Animated, { useAnimatedStyle, interpolateColor, useAnimatedProps, } from 'react-native-reanimated';
|
|
3
|
+
import { Path, Svg } from 'react-native-svg';
|
|
4
|
+
import { theme } from '../../theme';
|
|
5
|
+
var _a = theme.colors, canvas = _a.canvas, primary = _a.primary, primaryMuted = _a.primaryMuted;
|
|
6
|
+
var OVO_LOGO_ANGLE = 105;
|
|
7
|
+
var AnimatedPath = Animated.createAnimatedComponent(Path);
|
|
8
|
+
export function AccordionIcon(_a) {
|
|
9
|
+
var animationTiming = _a.animationTiming;
|
|
10
|
+
var outerAnimatedStyles = useAnimatedStyle(function () { return ({
|
|
11
|
+
backgroundColor: interpolateColor(animationTiming.value, [0, 1], [primaryMuted, primary]),
|
|
12
|
+
height: 36 - animationTiming.value * 4,
|
|
13
|
+
margin: 2 * animationTiming.value,
|
|
14
|
+
transform: [{ rotateZ: animationTiming.value * -OVO_LOGO_ANGLE + 'deg' }],
|
|
15
|
+
}); });
|
|
16
|
+
var innerAnimatedStyles = useAnimatedStyle(function () { return ({
|
|
17
|
+
transform: [{ rotateZ: animationTiming.value * OVO_LOGO_ANGLE + 'deg' }],
|
|
18
|
+
}); });
|
|
19
|
+
var plusAnimatedProps = useAnimatedProps(function () { return ({
|
|
20
|
+
opacity: 1 - animationTiming.value,
|
|
21
|
+
}); });
|
|
22
|
+
var minusAnimatedProps = useAnimatedProps(function () { return ({
|
|
23
|
+
opacity: animationTiming.value,
|
|
24
|
+
}); });
|
|
25
|
+
return (React.createElement(Animated.View, { style: [
|
|
26
|
+
{
|
|
27
|
+
backgroundColor: primaryMuted,
|
|
28
|
+
aspectRatio: 1,
|
|
29
|
+
alignItems: 'center',
|
|
30
|
+
justifyContent: 'center',
|
|
31
|
+
},
|
|
32
|
+
outerAnimatedStyles,
|
|
33
|
+
] },
|
|
34
|
+
React.createElement(Animated.View, { style: innerAnimatedStyles },
|
|
35
|
+
React.createElement(Svg, { width: "16", height: "16", viewBox: "0 0 16 16" },
|
|
36
|
+
React.createElement(AnimatedPath, { animatedProps: plusAnimatedProps, d: "M9 9H16V6.99H9V0H6.99V7H0V9.01H7V16.01H9.01V9.01L9 9Z", fill: primary }),
|
|
37
|
+
React.createElement(AnimatedPath, { animatedProps: minusAnimatedProps, d: "M16.3826 9.66663V7.66663H0.462646V9.66663H16.3826Z", fill: canvas })))));
|
|
38
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
export var useLayout = function (defaultHeight) {
|
|
3
|
+
var _a = useState({ height: defaultHeight || 0, width: 0, measured: false }), layout = _a[0], setLayout = _a[1];
|
|
4
|
+
var onLayout = React.useCallback(function (e) {
|
|
5
|
+
var _a = e.nativeEvent.layout, height = _a.height, width = _a.width;
|
|
6
|
+
if (height === layout.height && width === layout.width) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
setLayout({
|
|
10
|
+
height: height,
|
|
11
|
+
width: width,
|
|
12
|
+
measured: true
|
|
13
|
+
});
|
|
14
|
+
}, [layout.height, layout.width]);
|
|
15
|
+
return [layout, onLayout];
|
|
16
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { theme } from '../../theme';
|
|
3
|
+
var greyBase = theme.colors.brand.grey.base;
|
|
4
|
+
var styles = StyleSheet.create({
|
|
5
|
+
accordion: {
|
|
6
|
+
width: '100%',
|
|
7
|
+
borderWidth: parseInt(theme.borderWidths.standard),
|
|
8
|
+
borderBottomWidth: 0,
|
|
9
|
+
borderColor: greyBase,
|
|
10
|
+
},
|
|
11
|
+
topItem: {
|
|
12
|
+
borderTopLeftRadius: parseInt(theme.radii.small),
|
|
13
|
+
borderTopRightRadius: parseInt(theme.radii.small),
|
|
14
|
+
},
|
|
15
|
+
bottomItem: {
|
|
16
|
+
borderBottomLeftRadius: parseInt(theme.radii.small),
|
|
17
|
+
borderBottomRightRadius: parseInt(theme.radii.small),
|
|
18
|
+
borderBottomWidth: parseInt(theme.borderWidths.standard),
|
|
19
|
+
},
|
|
20
|
+
accordionHeader: {
|
|
21
|
+
paddingTop: parseInt(theme.space[5]),
|
|
22
|
+
paddingRight: 18,
|
|
23
|
+
paddingBottom: 18,
|
|
24
|
+
paddingLeft: parseInt(theme.space[3]),
|
|
25
|
+
flexDirection: 'row',
|
|
26
|
+
alignItems: 'flex-start',
|
|
27
|
+
justifyContent: 'space-between',
|
|
28
|
+
},
|
|
29
|
+
accordionHeaderText: {
|
|
30
|
+
paddingRight: parseInt(theme.space[3]),
|
|
31
|
+
marginTop: 0,
|
|
32
|
+
marginBottom: 0,
|
|
33
|
+
flexShrink: 1,
|
|
34
|
+
},
|
|
35
|
+
content: {
|
|
36
|
+
overflow: 'hidden',
|
|
37
|
+
},
|
|
38
|
+
container: {
|
|
39
|
+
position: 'absolute',
|
|
40
|
+
top: 0,
|
|
41
|
+
left: 0,
|
|
42
|
+
right: 0,
|
|
43
|
+
paddingTop: 0,
|
|
44
|
+
paddingRight: parseInt(theme.space[12]),
|
|
45
|
+
paddingBottom: parseInt(theme.space[6]),
|
|
46
|
+
paddingLeft: parseInt(theme.space[3]),
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
export { styles };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
+
var t = {};
|
|
18
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
+
t[p] = s[p];
|
|
20
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
+
t[p[i]] = s[p[i]];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
};
|
|
27
|
+
import React from 'react';
|
|
28
|
+
import { useBreakpoint } from '../../hooks';
|
|
29
|
+
import styled, { css } from '../../styled.native';
|
|
30
|
+
import { calculateLineHeight } from '../../theme';
|
|
31
|
+
var StyledBadge = styled.View(function (_a) {
|
|
32
|
+
var badge = _a.theme.badge, _b = _a.variant, variant = _b === void 0 ? 'default' : _b;
|
|
33
|
+
// @ts-ignore to support additional palettes.
|
|
34
|
+
var currentVariant = badge.variants[variant];
|
|
35
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 0 ", ";\n border-radius: ", ";\n background-color: ", ";\n align-self: flex-start;\n "], ["\n padding: 0 ", ";\n border-radius: ", ";\n background-color: ", ";\n align-self: flex-start;\n "])), badge.paddingHorizontal, badge.borderRadius, currentVariant.background);
|
|
36
|
+
});
|
|
37
|
+
var StyledBadgeText = styled.Text(function (_a) {
|
|
38
|
+
var badge = _a.theme.badge, _b = _a.variant, variant = _b === void 0 ? 'default' : _b;
|
|
39
|
+
// @ts-ignore to support additional palettes.
|
|
40
|
+
var currentVariant = badge.variants[variant];
|
|
41
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-family: ", ";\n font-weight: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n font-weight: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n "])), badge.fontFamily, badge.fontWeight, calculateLineHeight(badge.fontSize[1], badge.lineHeight), currentVariant.foreground, badge.fontSize[1]);
|
|
42
|
+
});
|
|
43
|
+
export var Badge = function (_a) {
|
|
44
|
+
var children = _a.children, variant = _a.variant, rest = __rest(_a, ["children", "variant"]);
|
|
45
|
+
var smallAndUp = useBreakpoint().smallAndUp;
|
|
46
|
+
return (React.createElement(StyledBadge, __assign({}, rest, { variant: variant }),
|
|
47
|
+
React.createElement(StyledBadgeText, { variant: variant, smallAndUp: smallAndUp }, children)));
|
|
48
|
+
};
|
|
49
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Badge } from './Badge';
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
+
var t = {};
|
|
18
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
+
t[p] = s[p];
|
|
20
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
+
t[p[i]] = s[p[i]];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
};
|
|
27
|
+
import React, { useContext, forwardRef, } from 'react';
|
|
28
|
+
import { useBreakpoint } from '../../hooks';
|
|
29
|
+
import styled, { css, ThemeContext } from '../../styled.native';
|
|
30
|
+
import { calculateLineHeight } from '../../theme';
|
|
31
|
+
import { Icon } from '../Icon/Icon';
|
|
32
|
+
var StyledCTAWrapper = styled.TouchableOpacity(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-self: flex-start;\n flex-direction: row;\n align-items: flex-start;\n"], ["\n align-self: flex-start;\n flex-direction: row;\n align-items: flex-start;\n"])));
|
|
33
|
+
var CTAButtonWrapper = function (_a) {
|
|
34
|
+
var children = _a.children, _b = _a.accessibilityRole, accessibilityRole = _b === void 0 ? 'button' : _b, _c = _a.activeOpacity, activeOpacity = _c === void 0 ? 0.8 : _c, rest = __rest(_a, ["children", "accessibilityRole", "activeOpacity"]);
|
|
35
|
+
return (React.createElement(StyledCTAWrapper, __assign({ accessibilityRole: accessibilityRole, activeOpacity: activeOpacity }, rest), children));
|
|
36
|
+
};
|
|
37
|
+
var StyledInner = styled.View(function (_a) {
|
|
38
|
+
var cta = _a.theme.cta, fullWidth = _a.fullWidth, variant = _a.variant;
|
|
39
|
+
// @ts-ignore to support additional palettes.
|
|
40
|
+
var currentVariant = cta.variants[variant];
|
|
41
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding: ", " ", ";\n border-color: ", ";\n background-color: ", ";\n border-width: ", ";\n border-radius: ", ";\n min-height: ", ";\n border-style: solid;\n justify-content: center;\n align-items: center;\n flex-direction: row;\n flex-grow: 1;\n\n ", ";\n "], ["\n padding: ", " ", ";\n border-color: ", ";\n background-color: ", ";\n border-width: ", ";\n border-radius: ", ";\n min-height: ", ";\n border-style: solid;\n justify-content: center;\n align-items: center;\n flex-direction: row;\n flex-grow: 1;\n\n ", ";\n "])), cta.paddingVertical, cta.paddingHorizontal, currentVariant.border, currentVariant.background, cta.borderWidth, cta.borderRadius, cta.minHeight, fullWidth === 'never'
|
|
42
|
+
? css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n flex-grow: 0;\n "], ["\n flex-grow: 0;\n "]))) : '');
|
|
43
|
+
});
|
|
44
|
+
var StyledRightIcon = styled(Icon)(function (_a) {
|
|
45
|
+
var cta = _a.theme.cta;
|
|
46
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-left: ", ";\n "], ["\n margin-left: ", ";\n "])), cta.iconGap);
|
|
47
|
+
});
|
|
48
|
+
var StyledLeftIcon = styled(Icon)(function (_a) {
|
|
49
|
+
var cta = _a.theme.cta;
|
|
50
|
+
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-right: ", ";\n "], ["\n margin-right: ", ";\n "])), cta.iconGap);
|
|
51
|
+
});
|
|
52
|
+
var StyledCTAButtonText = styled.Text(function (_a) {
|
|
53
|
+
var cta = _a.theme.cta, smallAndUp = _a.smallAndUp, variant = _a.variant;
|
|
54
|
+
var fontSize = smallAndUp ? cta.fontSize[1] : cta.fontSize[0];
|
|
55
|
+
// @ts-ignore to support additional palettes.
|
|
56
|
+
var currentVariant = cta.variants[variant];
|
|
57
|
+
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n text-align: left;\n flex-shrink: 2;\n "], ["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n text-align: left;\n flex-shrink: 2;\n "])), currentVariant.foreground, cta.fontFamily, fontSize, cta.fontWeight, calculateLineHeight(fontSize, cta.lineHeight));
|
|
58
|
+
});
|
|
59
|
+
var CTAButton = function (_a) {
|
|
60
|
+
var _b = _a.iconLeft, iconLeft = _b === void 0 ? 'off' : _b, _c = _a.iconRight, iconRight = _c === void 0 ? 'off' : _c, children = _a.children, _d = _a.fullWidth, fullWidth = _d === void 0 ? 'small' : _d, _e = _a.variant, variant = _e === void 0 ? 'primary' : _e, rest = __rest(_a, ["iconLeft", "iconRight", "children", "fullWidth", "variant"]);
|
|
61
|
+
var cta = useContext(ThemeContext).cta;
|
|
62
|
+
var smallAndUp = useBreakpoint().smallAndUp;
|
|
63
|
+
// @ts-ignore to support additional palettes.
|
|
64
|
+
var currentVariant = cta.variants[variant];
|
|
65
|
+
if (fullWidth === 'small') {
|
|
66
|
+
fullWidth = smallAndUp ? 'never' : 'always';
|
|
67
|
+
}
|
|
68
|
+
return (React.createElement(CTAButtonWrapper, __assign({}, rest),
|
|
69
|
+
React.createElement(StyledInner, { fullWidth: fullWidth, variant: variant },
|
|
70
|
+
iconLeft !== 'off' ? (React.createElement(StyledLeftIcon, { name: iconLeft, size: 16, color: currentVariant.foreground })) : null,
|
|
71
|
+
React.createElement(StyledCTAButtonText, { smallAndUp: smallAndUp, variant: variant }, children),
|
|
72
|
+
iconRight !== 'off' ? (React.createElement(StyledRightIcon, { name: iconRight, size: 16, color: currentVariant.foreground })) : null)));
|
|
73
|
+
};
|
|
74
|
+
var PrimaryCTAButton = forwardRef(function (props, ref) { return (React.createElement(CTAButton, __assign({ variant: "primary" }, props, { ref: ref }))); });
|
|
75
|
+
var SecondaryCTAButton = forwardRef(function (props, ref) { return (React.createElement(CTAButton, __assign({ variant: "secondary" }, props, { ref: ref }))); });
|
|
76
|
+
var DestructiveCTAButton = forwardRef(function (props, ref) { return (React.createElement(CTAButton, __assign({ variant: "destructive" }, props, { ref: ref }))); });
|
|
77
|
+
export { CTAButton, PrimaryCTAButton, SecondaryCTAButton, DestructiveCTAButton, };
|
|
78
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CTAButton, DestructiveCTAButton, PrimaryCTAButton, SecondaryCTAButton, } from './CTAButton';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import React, { forwardRef } from 'react';
|
|
13
|
+
import { CTAButton } from '../CTAButton';
|
|
14
|
+
var CTALink = forwardRef(function (props, ref) { return React.createElement(CTAButton, __assign({}, props, { ref: ref })); });
|
|
15
|
+
var PrimaryCTALink = forwardRef(function (props, ref) { return React.createElement(CTALink, __assign({ variant: "primary", ref: ref }, props)); });
|
|
16
|
+
var SecondaryCTALink = forwardRef(function (props, ref) { return (React.createElement(CTALink, __assign({ variant: "secondary", ref: ref }, props))); });
|
|
17
|
+
export { CTALink, PrimaryCTALink, SecondaryCTALink };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CTALink, PrimaryCTALink, SecondaryCTALink } from './CTALink';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { useBreakpoint } from '../../hooks';
|
|
14
|
+
import styled from '../../styled.native';
|
|
15
|
+
var StyledCard = styled.View(function (_a) {
|
|
16
|
+
var _b = _a.theme, card = _b.card, radii = _b.radii, smallAndUp = _a.smallAndUp, _c = _a.inline, inline = _c === void 0 ? false : _c;
|
|
17
|
+
var padding = smallAndUp
|
|
18
|
+
? "".concat(card.padding[2], " ").concat(card.padding[1])
|
|
19
|
+
: "".concat(card.padding[1], " ").concat(card.padding[0]);
|
|
20
|
+
var borderRadius = smallAndUp ? radii.medium : radii.small;
|
|
21
|
+
return "\n background: ".concat(card.background, ";\n border: ").concat(inline ? "".concat(card.borderWidth, " solid ").concat(card.borderColor) : 'none', ";\n padding: ").concat(padding, ";\n border-radius: ").concat(borderRadius, ";\n ");
|
|
22
|
+
});
|
|
23
|
+
var Card = function (props) {
|
|
24
|
+
var breakpoints = useBreakpoint();
|
|
25
|
+
return React.createElement(StyledCard, __assign({}, breakpoints, props));
|
|
26
|
+
};
|
|
27
|
+
export { Card };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Card } from './Card';
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
var __assign = (this && this.__assign) || function () {
|
|
6
|
+
__assign = Object.assign || function(t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
+
t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
return t;
|
|
13
|
+
};
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
+
var t = {};
|
|
18
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
+
t[p] = s[p];
|
|
20
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
+
t[p[i]] = s[p[i]];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
};
|
|
27
|
+
import React, { forwardRef, useContext, } from 'react';
|
|
28
|
+
import { TouchableOpacity, View, } from 'react-native';
|
|
29
|
+
import styled, { ThemeContext } from '../../styled.native';
|
|
30
|
+
import { pxToNumber } from '../../utils';
|
|
31
|
+
import { ErrorText } from '../ErrorText';
|
|
32
|
+
import { FormGroup } from '../FormGroup';
|
|
33
|
+
import { HintText } from '../HintText';
|
|
34
|
+
import { Icon } from '../Icon/Icon';
|
|
35
|
+
import { LabelText } from '../LabelText';
|
|
36
|
+
import { Stack } from '../Stack';
|
|
37
|
+
var StyledCheckboxInputWrapper = styled.View(function (_a) {
|
|
38
|
+
var checkbox = _a.theme.checkbox;
|
|
39
|
+
var checkboxSize = pxToNumber(checkbox.size);
|
|
40
|
+
var gap = pxToNumber(checkbox.gap);
|
|
41
|
+
return "\n width: ".concat(checkboxSize + gap, "px;\n height: ").concat(checkbox.touchSize, ";\n ");
|
|
42
|
+
});
|
|
43
|
+
var StyledCheckboxInput = styled.View(function (_a) {
|
|
44
|
+
var checkbox = _a.theme.checkbox, invalid = _a.invalid, checked = _a.checked;
|
|
45
|
+
var touchSize = pxToNumber(checkbox.touchSize);
|
|
46
|
+
var checkboxSize = pxToNumber(checkbox.size);
|
|
47
|
+
var checkboxDistance = (touchSize - checkboxSize) / 2;
|
|
48
|
+
return "\n width: ".concat(checkbox.size, ";\n height: ").concat(checkbox.size, ";\n border: ").concat(checkbox.borderWidth, " solid;\n margin-top: ").concat(checkboxDistance, "px;\n border-radius: ").concat(checkbox.borderRadius, ";\n border-color: ").concat(invalid
|
|
49
|
+
? checkbox.errorColor
|
|
50
|
+
: checked
|
|
51
|
+
? checkbox.checkColor
|
|
52
|
+
: checkbox.borderColor, ";\n background: ").concat(checked ? checkbox.checkedBackground : checkbox.background, ";\n ");
|
|
53
|
+
});
|
|
54
|
+
var CheckboxCheck = function (props) {
|
|
55
|
+
var checkbox = useContext(ThemeContext).checkbox;
|
|
56
|
+
return (React.createElement(Icon, __assign({ name: "check", size: pxToNumber(checkbox.checkSize), color: checkbox.checkColor }, props)));
|
|
57
|
+
};
|
|
58
|
+
var StyledCheckboxInputCheck = styled(CheckboxCheck)(function (_a) {
|
|
59
|
+
var checkbox = _a.theme.checkbox, checked = _a.checked;
|
|
60
|
+
var checkboxSize = pxToNumber(checkbox.size);
|
|
61
|
+
var checkSize = pxToNumber(checkbox.checkSize);
|
|
62
|
+
var borderWidth = pxToNumber(checkbox.borderWidth);
|
|
63
|
+
var checkDistance = (checkboxSize - checkSize) / 2 - borderWidth;
|
|
64
|
+
return "\n margin-top: ".concat(checkDistance, "px;\n margin-left: ").concat(checkDistance, "px;\n opacity: ").concat(checked ? 1 : 0, ";\n ");
|
|
65
|
+
});
|
|
66
|
+
var Input = function (_a) {
|
|
67
|
+
var checked = _a.checked, invalid = _a.invalid, rest = __rest(_a, ["checked", "invalid"]);
|
|
68
|
+
return (React.createElement(StyledCheckboxInputWrapper, __assign({}, rest),
|
|
69
|
+
React.createElement(StyledCheckboxInput, { invalid: invalid, checked: checked },
|
|
70
|
+
React.createElement(StyledCheckboxInputCheck, { checked: checked }))));
|
|
71
|
+
};
|
|
72
|
+
var CheckLabelText = styled(LabelText)(function (_a) {
|
|
73
|
+
var checkbox = _a.theme.checkbox;
|
|
74
|
+
return "\n padding-top: ".concat(checkbox.paddingTop, ";\n ");
|
|
75
|
+
});
|
|
76
|
+
var StyledWrapper = styled.View(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n"], ["\n flex-direction: row;\n"])));
|
|
77
|
+
var Checkbox = forwardRef(function (_a, ref) {
|
|
78
|
+
var label = _a.label, hint = _a.hint, error = _a.error, checked = _a.checked, optional = _a.optional, invalid = _a.invalid, _b = _a.activeOpacity, activeOpacity = _b === void 0 ? 0.8 : _b, rest = __rest(_a, ["label", "hint", "error", "checked", "optional", "invalid", "activeOpacity"]);
|
|
79
|
+
var hasError = !!error;
|
|
80
|
+
return (React.createElement(FormGroup, { error: hasError },
|
|
81
|
+
React.createElement(Stack, { spaceBetween: 1 },
|
|
82
|
+
error ? React.createElement(ErrorText, null, error) : null,
|
|
83
|
+
React.createElement(TouchableOpacity, __assign({ ref: ref, accessibilityRole: "checkbox", activeOpacity: activeOpacity, accessibilityState: { checked: checked },
|
|
84
|
+
// @ts-ignore
|
|
85
|
+
invalid: hasError || invalid }, rest),
|
|
86
|
+
React.createElement(StyledWrapper, null,
|
|
87
|
+
React.createElement(Input, { checked: checked, invalid: hasError || invalid }),
|
|
88
|
+
React.createElement(View, { style: { flexShrink: 1 } },
|
|
89
|
+
React.createElement(CheckLabelText, null,
|
|
90
|
+
label,
|
|
91
|
+
optional ? ' (optional)' : null),
|
|
92
|
+
hint ? React.createElement(HintText, null, hint) : null))))));
|
|
93
|
+
});
|
|
94
|
+
export { Checkbox };
|
|
95
|
+
var templateObject_1;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React, { Children, cloneElement, } from 'react';
|
|
24
|
+
import { View } from 'react-native';
|
|
25
|
+
import { ErrorText } from '../ErrorText';
|
|
26
|
+
import { FormGroup } from '../FormGroup';
|
|
27
|
+
import { HintText } from '../HintText';
|
|
28
|
+
import { LabelText } from '../LabelText';
|
|
29
|
+
import { Stack } from '../Stack';
|
|
30
|
+
var CheckboxField = function (_a) {
|
|
31
|
+
var label = _a.label, hint = _a.hint, error = _a.error, children = _a.children, _b = _a.optional, optional = _b === void 0 ? false : _b, rest = __rest(_a, ["label", "hint", "error", "children", "optional"]);
|
|
32
|
+
var hasError = !!error;
|
|
33
|
+
return (React.createElement(FormGroup, __assign({}, rest, { error: hasError }),
|
|
34
|
+
React.createElement(Stack, { spaceBetween: 1 },
|
|
35
|
+
React.createElement(View, null,
|
|
36
|
+
React.createElement(LabelText, null,
|
|
37
|
+
label,
|
|
38
|
+
optional ? ' (optional)' : null),
|
|
39
|
+
hint ? React.createElement(HintText, null, hint) : null,
|
|
40
|
+
error ? React.createElement(ErrorText, null, error) : null),
|
|
41
|
+
React.createElement(View, null, Children.map(children, function (child) {
|
|
42
|
+
return cloneElement(child, {
|
|
43
|
+
invalid: hasError ? true : child.props.invalid,
|
|
44
|
+
});
|
|
45
|
+
})))));
|
|
46
|
+
};
|
|
47
|
+
export { CheckboxField };
|