@ovotech/element-native 4.4.8 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion/Accordion.d.ts +2 -1
- package/dist/components/Accordion/Accordion.js +47 -116
- package/dist/components/Accordion/Group.d.ts +1 -1
- package/dist/components/Accordion/Group.js +12 -19
- package/dist/components/Accordion/Icon.js +20 -48
- package/dist/components/Accordion/index.js +3 -9
- package/dist/components/Accordion/styles.d.ts +95 -96
- package/dist/components/Accordion/styles.js +44 -59
- package/dist/components/Accordion/types.js +1 -2
- package/dist/components/ActionCard/ActionCard.d.ts +1 -1
- package/dist/components/ActionCard/ActionCard.js +59 -87
- package/dist/components/ActionCard/CloseIconShape.d.ts +1 -1
- package/dist/components/ActionCard/CloseIconShape.js +7 -41
- package/dist/components/ActionCard/IndicatorIconShape.d.ts +1 -1
- package/dist/components/ActionCard/IndicatorIconShape.js +7 -41
- package/dist/components/ActionCard/index.js +1 -5
- package/dist/components/ActionList/ActionList.d.ts +9 -7
- package/dist/components/ActionList/ActionList.js +22 -56
- package/dist/components/ActionList/index.js +1 -6
- package/dist/components/ActionList/styled.d.ts +228 -229
- package/dist/components/ActionList/styled.js +52 -60
- package/dist/components/Badge/Badge.d.ts +34 -34
- package/dist/components/Badge/Badge.js +27 -72
- package/dist/components/Badge/index.js +1 -5
- package/dist/components/CTAButton/CTAButton.d.ts +9 -11
- package/dist/components/CTAButton/CTAButton.js +62 -100
- package/dist/components/CTAButton/index.js +1 -8
- package/dist/components/CTALink/CTALink.d.ts +5 -8
- package/dist/components/CTALink/CTALink.js +6 -23
- package/dist/components/CTALink/index.js +1 -7
- package/dist/components/Card/Card.js +14 -43
- package/dist/components/Card/index.js +1 -5
- package/dist/components/Checkbox/Checkbox.d.ts +9 -7
- package/dist/components/Checkbox/Checkbox.js +50 -72
- package/dist/components/Checkbox/CheckboxField.js +16 -44
- package/dist/components/Checkbox/index.js +2 -7
- package/dist/components/CurrencyField/CurrencyField.d.ts +4 -11
- package/dist/components/CurrencyField/CurrencyField.js +5 -32
- package/dist/components/CurrencyField/index.js +1 -5
- package/dist/components/CurrencyInput/CurrencyInput.d.ts +4 -11
- package/dist/components/CurrencyInput/CurrencyInput.js +10 -36
- package/dist/components/CurrencyInput/index.js +1 -5
- package/dist/components/DataTable/DataTable.d.ts +1 -3
- package/dist/components/DataTable/DataTable.js +17 -44
- package/dist/components/DataTable/TableRow.js +15 -31
- package/dist/components/DataTable/index.js +3 -21
- package/dist/components/DataTable/styles.d.ts +404 -404
- package/dist/components/DataTable/styles.js +97 -84
- package/dist/components/DataTable/types.d.ts +1 -1
- package/dist/components/DataTable/types.js +1 -2
- package/dist/components/DateField/DateField.d.ts +8 -6
- package/dist/components/DateField/DateField.js +61 -82
- package/dist/components/DateField/index.js +1 -5
- package/dist/components/DescriptionList/DescriptionList.js +12 -44
- package/dist/components/DescriptionList/index.js +1 -6
- package/dist/components/DescriptionList/styled.d.ts +31 -31
- package/dist/components/DescriptionList/styled.js +34 -85
- package/dist/components/Disclosure/Disclosure.d.ts +574 -6
- package/dist/components/Disclosure/Disclosure.js +34 -79
- package/dist/components/Disclosure/index.js +1 -17
- package/dist/components/Display0/Display0.js +19 -69
- package/dist/components/Display0/index.js +1 -5
- package/dist/components/Display1/Display1.js +19 -69
- package/dist/components/Display1/index.js +1 -5
- package/dist/components/Display2/Display2.js +19 -69
- package/dist/components/Display2/index.js +1 -5
- package/dist/components/Display3/Display3.js +19 -69
- package/dist/components/Display3/index.js +1 -5
- package/dist/components/Divider/Divider.js +11 -41
- package/dist/components/Divider/index.js +1 -5
- package/dist/components/Em/Em.d.ts +31 -31
- package/dist/components/Em/Em.js +6 -13
- package/dist/components/Em/index.js +1 -5
- package/dist/components/EmailField/EmailField.d.ts +4 -9
- package/dist/components/EmailField/EmailField.js +5 -32
- package/dist/components/EmailField/index.js +1 -5
- package/dist/components/EmailInput/EmailInput.d.ts +2 -9
- package/dist/components/EmailInput/EmailInput.js +4 -19
- package/dist/components/EmailInput/index.js +1 -5
- package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.d.ts +1 -1
- package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.js +14 -43
- package/dist/components/ErrorSummaryNotification/index.js +1 -5
- package/dist/components/ErrorText/ErrorText.d.ts +33 -35
- package/dist/components/ErrorText/ErrorText.js +15 -40
- package/dist/components/ErrorText/index.js +1 -5
- package/dist/components/Field/Field.d.ts +9 -8
- package/dist/components/Field/Field.js +25 -48
- package/dist/components/Field/index.js +1 -17
- package/dist/components/FilterSelect/FilterSelect.js +55 -76
- package/dist/components/FilterSelect/index.js +1 -5
- package/dist/components/FormGroup/FormGroup.js +8 -42
- package/dist/components/FormGroup/index.js +1 -5
- package/dist/components/Grid/Col.d.ts +33 -34
- package/dist/components/Grid/Col.js +24 -48
- package/dist/components/Grid/Row.d.ts +6 -572
- package/dist/components/Grid/Row.js +34 -72
- package/dist/components/Grid/index.d.ts +1 -1
- package/dist/components/Grid/index.js +2 -7
- package/dist/components/Heading1/Heading1.js +19 -69
- package/dist/components/Heading1/index.js +1 -5
- package/dist/components/Heading2/Heading2.js +19 -69
- package/dist/components/Heading2/index.js +1 -5
- package/dist/components/Heading3/Heading3.js +19 -69
- package/dist/components/Heading3/index.js +1 -5
- package/dist/components/Heading4/Heading4.js +19 -69
- package/dist/components/Heading4/index.js +1 -5
- package/dist/components/HintText/HintText.d.ts +33 -35
- package/dist/components/HintText/HintText.js +15 -40
- package/dist/components/HintText/index.js +1 -5
- package/dist/components/Icon/Icon.d.ts +0 -1
- package/dist/components/Icon/Icon.js +10 -37
- package/dist/components/Icon/index.js +1 -5
- package/dist/components/Input/Input.d.ts +3 -8
- package/dist/components/Input/Input.js +64 -86
- package/dist/components/Label/Label.d.ts +7 -6
- package/dist/components/Label/Label.js +10 -51
- package/dist/components/Label/index.js +1 -5
- package/dist/components/LabelText/LabelText.d.ts +33 -35
- package/dist/components/LabelText/LabelText.js +13 -40
- package/dist/components/LabelText/index.js +1 -5
- package/dist/components/Lead/Lead.d.ts +7 -6
- package/dist/components/Lead/Lead.js +12 -53
- package/dist/components/Lead/index.js +1 -5
- package/dist/components/LineThrough/LineThrough.d.ts +31 -31
- package/dist/components/LineThrough/LineThrough.js +4 -13
- package/dist/components/LineThrough/index.js +1 -5
- package/dist/components/List/List.d.ts +1 -1
- package/dist/components/List/List.js +21 -29
- package/dist/components/List/index.js +1 -7
- package/dist/components/List/styled.d.ts +126 -127
- package/dist/components/List/styled.js +32 -45
- package/dist/components/Margin/Margin.d.ts +31 -31
- package/dist/components/Margin/Margin.js +34 -50
- package/dist/components/Margin/index.js +1 -5
- package/dist/components/NavHeader/IconButton.js +10 -18
- package/dist/components/NavHeader/NavHeader.js +21 -49
- package/dist/components/NavHeader/NavHeader.styles.d.ts +283 -284
- package/dist/components/NavHeader/NavHeader.styles.js +82 -78
- package/dist/components/NavHeader/index.js +1 -5
- package/dist/components/Notification/Notification.d.ts +79 -77
- package/dist/components/Notification/Notification.js +69 -92
- package/dist/components/Notification/index.js +1 -9
- package/dist/components/NumberField/NumberField.d.ts +4 -9
- package/dist/components/NumberField/NumberField.js +5 -32
- package/dist/components/NumberField/index.js +1 -5
- package/dist/components/NumberInput/NumberInput.d.ts +2 -9
- package/dist/components/NumberInput/NumberInput.js +4 -19
- package/dist/components/NumberInput/index.js +1 -5
- package/dist/components/P/P.d.ts +8 -7
- package/dist/components/P/P.js +13 -54
- package/dist/components/P/index.js +1 -5
- package/dist/components/PasswordField/PasswordField.d.ts +6 -11
- package/dist/components/PasswordField/PasswordField.js +5 -32
- package/dist/components/PasswordField/index.js +1 -5
- package/dist/components/PasswordInput/PasswordInput.d.ts +5 -11
- package/dist/components/PasswordInput/PasswordInput.js +7 -34
- package/dist/components/PasswordInput/PasswordInput.styled.d.ts +31 -32
- package/dist/components/PasswordInput/PasswordInput.styled.js +13 -37
- package/dist/components/PasswordInput/PasswordVisibilityToggle.js +14 -20
- package/dist/components/PasswordInput/index.js +1 -5
- package/dist/components/PhoneField/PhoneField.d.ts +4 -9
- package/dist/components/PhoneField/PhoneField.js +5 -32
- package/dist/components/PhoneField/index.js +1 -5
- package/dist/components/PhoneInput/PhoneInput.d.ts +2 -9
- package/dist/components/PhoneInput/PhoneInput.js +3 -18
- package/dist/components/PhoneInput/index.js +1 -5
- package/dist/components/ProductCarousel/NavigationDots.js +32 -61
- package/dist/components/ProductCarousel/ProductCarousel.d.ts +1 -0
- package/dist/components/ProductCarousel/ProductCarousel.js +54 -101
- package/dist/components/ProductCarousel/anchor-point.d.ts +198 -1
- package/dist/components/ProductCarousel/anchor-point.js +11 -21
- package/dist/components/ProductCarousel/index.js +1 -5
- package/dist/components/Radio/Radio.d.ts +10 -8
- package/dist/components/Radio/Radio.js +45 -61
- package/dist/components/Radio/RadioField.js +20 -48
- package/dist/components/Radio/index.js +2 -7
- package/dist/components/RadioCard/RadioCard.d.ts +11 -8
- package/dist/components/RadioCard/RadioCard.js +50 -65
- package/dist/components/RadioCard/index.js +1 -5
- package/dist/components/SegmentedControls/SegmentedControls.d.ts +1 -0
- package/dist/components/SegmentedControls/SegmentedControls.js +37 -89
- package/dist/components/SegmentedControls/components/SegmentButton.d.ts +1 -0
- package/dist/components/SegmentedControls/components/SegmentButton.js +41 -82
- package/dist/components/SegmentedControls/index.js +2 -5
- package/dist/components/SelectField/Select.d.ts +31 -31
- package/dist/components/SelectField/Select.js +84 -87
- package/dist/components/SelectField/SelectField.js +4 -33
- package/dist/components/SelectField/index.js +1 -5
- package/dist/components/SkeletonAnimation/SkeletonAnimation.d.ts +2 -2
- package/dist/components/SkeletonAnimation/SkeletonAnimation.js +12 -17
- package/dist/components/SkeletonAnimation/index.js +1 -5
- package/dist/components/SkeletonCTA/SkeletonCTA.js +11 -42
- package/dist/components/SkeletonCTA/index.js +1 -5
- package/dist/components/SkeletonCircle/SkeletonCircle.js +12 -45
- package/dist/components/SkeletonCircle/index.js +1 -5
- package/dist/components/SkeletonHeading/SkeletonHeading.js +9 -41
- package/dist/components/SkeletonHeading/index.js +1 -5
- package/dist/components/SkeletonText/SkeletonText.js +22 -47
- package/dist/components/SkeletonText/index.js +1 -5
- package/dist/components/Small/Small.d.ts +33 -35
- package/dist/components/Small/Small.js +8 -39
- package/dist/components/Small/index.js +1 -5
- package/dist/components/Spinner/Spinner.js +35 -63
- package/dist/components/Spinner/index.js +1 -5
- package/dist/components/Stack/Stack.js +15 -47
- package/dist/components/Stack/index.js +1 -5
- package/dist/components/Stretch/Stretch.js +11 -54
- package/dist/components/Stretch/index.js +1 -17
- package/dist/components/Strong/Strong.d.ts +31 -31
- package/dist/components/Strong/Strong.js +4 -11
- package/dist/components/Strong/index.js +1 -5
- package/dist/components/SubLabelText/SubLabelText.d.ts +33 -35
- package/dist/components/SubLabelText/SubLabelText.js +13 -40
- package/dist/components/SubLabelText/index.js +1 -5
- package/dist/components/Tabs/Tab.d.ts +582 -10
- package/dist/components/Tabs/Tab.js +64 -76
- package/dist/components/Tabs/TabList.d.ts +0 -1
- package/dist/components/Tabs/TabList.js +20 -77
- package/dist/components/Tabs/TabPanel.js +12 -64
- package/dist/components/Tabs/Tabs.js +32 -89
- package/dist/components/Tabs/index.js +4 -11
- package/dist/components/TextField/TextField.d.ts +4 -9
- package/dist/components/TextField/TextField.js +5 -32
- package/dist/components/TextField/index.js +1 -5
- package/dist/components/TextGroup/TextGroup.js +16 -39
- package/dist/components/TextGroup/index.js +1 -5
- package/dist/components/TextInput/TextInput.d.ts +6 -8
- package/dist/components/TextInput/TextInput.js +4 -19
- package/dist/components/TextInput/index.js +1 -5
- package/dist/components/TextLink/TextLink.d.ts +6 -6
- package/dist/components/TextLink/TextLink.js +20 -74
- package/dist/components/TextLink/index.js +1 -5
- package/dist/components/TextareaField/TextareaField.d.ts +4 -11
- package/dist/components/TextareaField/TextareaField.js +5 -32
- package/dist/components/TextareaField/index.js +1 -5
- package/dist/components/TextareaInput/TextareaInput.d.ts +1 -11
- package/dist/components/TextareaInput/TextareaInput.js +13 -67
- package/dist/components/TextareaInput/index.js +1 -5
- package/dist/components/Toast/Toast.d.ts +5 -5
- package/dist/components/Toast/Toast.js +88 -131
- package/dist/components/Toast/index.js +1 -6
- package/dist/components/Toggle/Toggle.d.ts +10 -7
- package/dist/components/Toggle/Toggle.js +18 -49
- package/dist/components/Toggle/index.js +1 -5
- package/dist/components/Toggle/styles.d.ts +130 -130
- package/dist/components/Toggle/styles.js +32 -24
- package/dist/components/index.js +67 -83
- package/dist/esm/components/Accordion/Accordion.js +35 -76
- package/dist/esm/components/Accordion/Group.js +9 -12
- package/dist/esm/components/Accordion/Icon.js +12 -13
- package/dist/esm/components/Accordion/styles.js +42 -28
- package/dist/esm/components/ActionCard/ActionCard.js +48 -46
- package/dist/esm/components/ActionCard/CloseIconShape.js +4 -8
- package/dist/esm/components/ActionCard/IndicatorIconShape.js +4 -8
- package/dist/esm/components/ActionList/ActionList.js +17 -47
- package/dist/esm/components/ActionList/styled.js +48 -30
- package/dist/esm/components/Badge/Badge.js +24 -42
- package/dist/esm/components/CTAButton/CTAButton.js +56 -65
- package/dist/esm/components/CTALink/CTALink.js +3 -15
- package/dist/esm/components/Card/Card.js +10 -32
- package/dist/esm/components/Checkbox/Checkbox.js +39 -55
- package/dist/esm/components/Checkbox/CheckboxField.js +7 -32
- package/dist/esm/components/CurrencyField/CurrencyField.js +3 -27
- package/dist/esm/components/CurrencyInput/CurrencyInput.js +7 -30
- package/dist/esm/components/DataTable/DataTable.js +8 -32
- package/dist/esm/components/DataTable/TableRow.js +8 -20
- package/dist/esm/components/DataTable/styles.js +95 -56
- package/dist/esm/components/DateField/DateField.js +49 -44
- package/dist/esm/components/DescriptionList/DescriptionList.js +7 -35
- package/dist/esm/components/DescriptionList/styled.js +29 -52
- package/dist/esm/components/Disclosure/Disclosure.js +29 -48
- package/dist/esm/components/Display0/Display0.js +14 -37
- package/dist/esm/components/Display1/Display1.js +14 -37
- package/dist/esm/components/Display2/Display2.js +14 -37
- package/dist/esm/components/Display3/Display3.js +14 -37
- package/dist/esm/components/Divider/Divider.js +8 -11
- package/dist/esm/components/Em/Em.js +5 -6
- package/dist/esm/components/EmailField/EmailField.js +3 -27
- package/dist/esm/components/EmailInput/EmailInput.js +1 -13
- package/dist/esm/components/ErrorSummaryNotification/ErrorSummaryNotification.js +6 -32
- package/dist/esm/components/ErrorText/ErrorText.js +11 -10
- package/dist/esm/components/Field/Field.js +16 -36
- package/dist/esm/components/FilterSelect/FilterSelect.js +43 -37
- package/dist/esm/components/FormGroup/FormGroup.js +4 -32
- package/dist/esm/components/Grid/Col.js +20 -18
- package/dist/esm/components/Grid/Row.js +29 -41
- package/dist/esm/components/Grid/index.js +1 -1
- package/dist/esm/components/Heading1/Heading1.js +14 -37
- package/dist/esm/components/Heading2/Heading2.js +14 -37
- package/dist/esm/components/Heading3/Heading3.js +14 -37
- package/dist/esm/components/Heading4/Heading4.js +14 -37
- package/dist/esm/components/HintText/HintText.js +11 -10
- package/dist/esm/components/Icon/Icon.js +6 -29
- package/dist/esm/components/Input/Input.js +58 -54
- package/dist/esm/components/Label/Label.js +7 -22
- package/dist/esm/components/LabelText/LabelText.js +9 -10
- package/dist/esm/components/Lead/Lead.js +9 -24
- package/dist/esm/components/LineThrough/LineThrough.js +3 -6
- package/dist/esm/components/List/List.js +11 -14
- package/dist/esm/components/List/styled.js +30 -17
- package/dist/esm/components/Margin/Margin.js +26 -36
- package/dist/esm/components/NavHeader/IconButton.js +5 -9
- package/dist/esm/components/NavHeader/NavHeader.js +10 -11
- package/dist/esm/components/NavHeader/NavHeader.styles.js +79 -46
- package/dist/esm/components/Notification/Notification.js +63 -60
- package/dist/esm/components/NumberField/NumberField.js +3 -27
- package/dist/esm/components/NumberInput/NumberInput.js +1 -13
- package/dist/esm/components/P/P.js +10 -25
- package/dist/esm/components/PasswordField/PasswordField.js +3 -27
- package/dist/esm/components/PasswordInput/PasswordInput.js +4 -28
- package/dist/esm/components/PasswordInput/PasswordInput.styled.js +10 -8
- package/dist/esm/components/PasswordInput/PasswordVisibilityToggle.js +9 -10
- package/dist/esm/components/PhoneField/PhoneField.js +3 -27
- package/dist/esm/components/PhoneInput/PhoneInput.js +1 -13
- package/dist/esm/components/ProductCarousel/NavigationDots.js +28 -30
- package/dist/esm/components/ProductCarousel/ProductCarousel.js +40 -57
- package/dist/esm/components/ProductCarousel/anchor-point.js +11 -17
- package/dist/esm/components/Radio/Radio.js +38 -48
- package/dist/esm/components/Radio/RadioField.js +10 -35
- package/dist/esm/components/RadioCard/RadioCard.js +44 -53
- package/dist/esm/components/SegmentedControls/SegmentedControls.js +33 -58
- package/dist/esm/components/SegmentedControls/components/SegmentButton.js +33 -44
- package/dist/esm/components/SelectField/Select.js +76 -49
- package/dist/esm/components/SelectField/SelectField.js +1 -26
- package/dist/esm/components/SkeletonAnimation/SkeletonAnimation.js +4 -5
- package/dist/esm/components/SkeletonCTA/SkeletonCTA.js +6 -30
- package/dist/esm/components/SkeletonCircle/SkeletonCircle.js +8 -34
- package/dist/esm/components/SkeletonHeading/SkeletonHeading.js +5 -30
- package/dist/esm/components/SkeletonText/SkeletonText.js +15 -33
- package/dist/esm/components/Small/Small.js +5 -10
- package/dist/esm/components/Spinner/Spinner.js +30 -31
- package/dist/esm/components/Stack/Stack.js +7 -33
- package/dist/esm/components/Stretch/Stretch.js +8 -24
- package/dist/esm/components/Strong/Strong.js +3 -4
- package/dist/esm/components/SubLabelText/SubLabelText.js +9 -10
- package/dist/esm/components/Tabs/Tab.js +60 -46
- package/dist/esm/components/Tabs/TabList.js +15 -45
- package/dist/esm/components/Tabs/TabPanel.js +9 -34
- package/dist/esm/components/Tabs/Tabs.js +24 -54
- package/dist/esm/components/TextField/TextField.js +3 -27
- package/dist/esm/components/TextGroup/TextGroup.js +11 -30
- package/dist/esm/components/TextInput/TextInput.js +1 -13
- package/dist/esm/components/TextLink/TextLink.js +14 -42
- package/dist/esm/components/TextareaField/TextareaField.js +3 -27
- package/dist/esm/components/TextareaInput/TextareaInput.js +8 -36
- package/dist/esm/components/Toast/Toast.js +67 -82
- package/dist/esm/components/Toggle/Toggle.js +13 -41
- package/dist/esm/components/Toggle/styles.js +29 -15
- package/dist/esm/hooks/use-breakpoint.js +3 -3
- package/dist/esm/hooks/use-full-width.js +5 -6
- package/dist/esm/hooks/use-layout.js +6 -6
- package/dist/esm/providers/IconsProvider.js +9 -18
- package/dist/esm/providers/icons/Address.js +1 -12
- package/dist/esm/providers/icons/Advice.js +1 -12
- package/dist/esm/providers/icons/Archive.js +1 -12
- package/dist/esm/providers/icons/ArrowDown.js +1 -12
- package/dist/esm/providers/icons/ArrowLeft.js +1 -12
- package/dist/esm/providers/icons/ArrowRight.js +1 -12
- package/dist/esm/providers/icons/ArrowUp.js +1 -12
- package/dist/esm/providers/icons/Award.js +1 -12
- package/dist/esm/providers/icons/Battery.js +1 -12
- package/dist/esm/providers/icons/Cal.js +1 -12
- package/dist/esm/providers/icons/CalBook.js +1 -12
- package/dist/esm/providers/icons/CaretArrowDown.js +1 -12
- package/dist/esm/providers/icons/CaretArrowLeft.js +1 -12
- package/dist/esm/providers/icons/CaretArrowRight.js +1 -12
- package/dist/esm/providers/icons/CaretArrowUp.js +1 -12
- package/dist/esm/providers/icons/CaretDown.js +1 -12
- package/dist/esm/providers/icons/CaretLeft.js +1 -12
- package/dist/esm/providers/icons/CaretRight.js +1 -12
- package/dist/esm/providers/icons/CaretUp.js +1 -12
- package/dist/esm/providers/icons/Chart.js +1 -12
- package/dist/esm/providers/icons/ChartFilled.js +1 -12
- package/dist/esm/providers/icons/Check.js +1 -12
- package/dist/esm/providers/icons/CheckCircle.js +1 -12
- package/dist/esm/providers/icons/ChevronDown.js +1 -12
- package/dist/esm/providers/icons/ChevronLeft.js +1 -12
- package/dist/esm/providers/icons/ChevronLeftSmall.js +1 -12
- package/dist/esm/providers/icons/ChevronLeftSmallFirst.js +1 -12
- package/dist/esm/providers/icons/ChevronRight.js +1 -12
- package/dist/esm/providers/icons/ChevronRightSmall.js +1 -12
- package/dist/esm/providers/icons/ChevronRightSmallLast.js +1 -12
- package/dist/esm/providers/icons/ChevronUp.js +1 -12
- package/dist/esm/providers/icons/Circle.js +1 -12
- package/dist/esm/providers/icons/CloseCircle.js +1 -12
- package/dist/esm/providers/icons/Cross.js +1 -12
- package/dist/esm/providers/icons/Doc.js +1 -12
- package/dist/esm/providers/icons/Dollar.js +1 -12
- package/dist/esm/providers/icons/Download.js +1 -12
- package/dist/esm/providers/icons/Eco.js +1 -12
- package/dist/esm/providers/icons/EcoHome.js +1 -12
- package/dist/esm/providers/icons/Edit.js +1 -12
- package/dist/esm/providers/icons/ElectricCar.js +1 -12
- package/dist/esm/providers/icons/ElectricHome.js +1 -12
- package/dist/esm/providers/icons/Electricity.js +1 -12
- package/dist/esm/providers/icons/EnergyAdvice.js +1 -12
- package/dist/esm/providers/icons/Equals.js +1 -12
- package/dist/esm/providers/icons/Euro.js +1 -12
- package/dist/esm/providers/icons/Gas.js +1 -12
- package/dist/esm/providers/icons/GlobeAddress.js +1 -12
- package/dist/esm/providers/icons/Help.js +1 -12
- package/dist/esm/providers/icons/HelpFilled.js +1 -12
- package/dist/esm/providers/icons/Hide.js +1 -12
- package/dist/esm/providers/icons/Home.js +1 -12
- package/dist/esm/providers/icons/HomeFilled.js +1 -12
- package/dist/esm/providers/icons/HydroPower.js +1 -12
- package/dist/esm/providers/icons/Info.js +1 -12
- package/dist/esm/providers/icons/Link.js +1 -12
- package/dist/esm/providers/icons/Logo.js +1 -12
- package/dist/esm/providers/icons/Mail.js +1 -12
- package/dist/esm/providers/icons/MailOpen.js +1 -12
- package/dist/esm/providers/icons/Menu.js +1 -12
- package/dist/esm/providers/icons/Message.js +1 -12
- package/dist/esm/providers/icons/MessageFilled.js +1 -12
- package/dist/esm/providers/icons/Minus.js +1 -12
- package/dist/esm/providers/icons/Mobile.js +1 -12
- package/dist/esm/providers/icons/NewWindow.js +1 -12
- package/dist/esm/providers/icons/PaymentCard.js +1 -12
- package/dist/esm/providers/icons/PaymentCardFilled.js +1 -12
- package/dist/esm/providers/icons/Phone.js +1 -12
- package/dist/esm/providers/icons/Plus.js +1 -12
- package/dist/esm/providers/icons/Pound.js +1 -12
- package/dist/esm/providers/icons/Pricing.js +1 -12
- package/dist/esm/providers/icons/PricingFilled.js +1 -12
- package/dist/esm/providers/icons/Search.js +1 -12
- package/dist/esm/providers/icons/Security.js +1 -12
- package/dist/esm/providers/icons/Shop.js +1 -12
- package/dist/esm/providers/icons/ShopFilled.js +1 -12
- package/dist/esm/providers/icons/Show.js +1 -12
- package/dist/esm/providers/icons/SmartHome.js +1 -12
- package/dist/esm/providers/icons/SmartMeter.js +1 -12
- package/dist/esm/providers/icons/Solar.js +1 -12
- package/dist/esm/providers/icons/Star.js +1 -12
- package/dist/esm/providers/icons/StarFilled.js +1 -12
- package/dist/esm/providers/icons/Sun.js +1 -12
- package/dist/esm/providers/icons/Torch.js +1 -12
- package/dist/esm/providers/icons/Trees.js +1 -12
- package/dist/esm/providers/icons/Tune.js +1 -12
- package/dist/esm/providers/icons/User.js +1 -12
- package/dist/esm/providers/icons/UserFilled.js +1 -12
- package/dist/esm/providers/icons/Wallet.js +1 -12
- package/dist/esm/providers/icons/WalletFilled.js +1 -12
- package/dist/esm/providers/icons/WarmHome.js +1 -12
- package/dist/esm/providers/icons/Warning.js +1 -12
- package/dist/esm/providers/icons/WebAddress.js +1 -12
- package/dist/esm/providers/icons/WindPower.js +1 -12
- package/dist/esm/styled.native.js +1 -1
- package/dist/esm/utils/utils.js +23 -50
- package/dist/hooks/index.js +2 -18
- package/dist/hooks/use-breakpoint.js +6 -10
- package/dist/hooks/use-full-width.js +7 -12
- package/dist/hooks/use-layout.js +7 -11
- package/dist/index.js +3 -19
- package/dist/providers/IconsProvider.js +107 -121
- package/dist/providers/icons/Address.js +3 -41
- package/dist/providers/icons/Advice.js +3 -41
- package/dist/providers/icons/Archive.js +3 -41
- package/dist/providers/icons/ArrowDown.js +3 -41
- package/dist/providers/icons/ArrowLeft.js +3 -41
- package/dist/providers/icons/ArrowRight.js +3 -41
- package/dist/providers/icons/ArrowUp.js +3 -41
- package/dist/providers/icons/Award.js +3 -41
- package/dist/providers/icons/Battery.js +3 -41
- package/dist/providers/icons/Cal.js +3 -41
- package/dist/providers/icons/CalBook.js +3 -41
- package/dist/providers/icons/CaretArrowDown.js +3 -41
- package/dist/providers/icons/CaretArrowLeft.js +3 -41
- package/dist/providers/icons/CaretArrowRight.js +3 -41
- package/dist/providers/icons/CaretArrowUp.js +3 -41
- package/dist/providers/icons/CaretDown.js +3 -41
- package/dist/providers/icons/CaretLeft.js +3 -41
- package/dist/providers/icons/CaretRight.js +3 -41
- package/dist/providers/icons/CaretUp.js +3 -41
- package/dist/providers/icons/Chart.js +3 -41
- package/dist/providers/icons/ChartFilled.js +3 -41
- package/dist/providers/icons/Check.js +3 -41
- package/dist/providers/icons/CheckCircle.js +3 -41
- package/dist/providers/icons/ChevronDown.js +3 -41
- package/dist/providers/icons/ChevronLeft.js +3 -41
- package/dist/providers/icons/ChevronLeftSmall.js +3 -41
- package/dist/providers/icons/ChevronLeftSmallFirst.js +3 -41
- package/dist/providers/icons/ChevronRight.js +3 -41
- package/dist/providers/icons/ChevronRightSmall.js +3 -41
- package/dist/providers/icons/ChevronRightSmallLast.js +3 -41
- package/dist/providers/icons/ChevronUp.js +3 -41
- package/dist/providers/icons/Circle.js +3 -41
- package/dist/providers/icons/CloseCircle.js +3 -41
- package/dist/providers/icons/Cross.js +3 -41
- package/dist/providers/icons/Doc.js +3 -41
- package/dist/providers/icons/Dollar.js +3 -41
- package/dist/providers/icons/Download.js +3 -41
- package/dist/providers/icons/Eco.js +3 -41
- package/dist/providers/icons/EcoHome.js +3 -41
- package/dist/providers/icons/Edit.js +3 -41
- package/dist/providers/icons/ElectricCar.js +3 -41
- package/dist/providers/icons/ElectricHome.js +3 -41
- package/dist/providers/icons/Electricity.js +3 -41
- package/dist/providers/icons/EnergyAdvice.js +3 -41
- package/dist/providers/icons/Equals.js +3 -41
- package/dist/providers/icons/Euro.js +3 -41
- package/dist/providers/icons/Gas.js +3 -41
- package/dist/providers/icons/GlobeAddress.js +3 -41
- package/dist/providers/icons/Help.js +3 -41
- package/dist/providers/icons/HelpFilled.js +3 -41
- package/dist/providers/icons/Hide.js +3 -41
- package/dist/providers/icons/Home.js +3 -41
- package/dist/providers/icons/HomeFilled.js +3 -41
- package/dist/providers/icons/HydroPower.js +3 -41
- package/dist/providers/icons/Info.js +3 -41
- package/dist/providers/icons/Link.js +3 -41
- package/dist/providers/icons/Logo.js +3 -41
- package/dist/providers/icons/Mail.js +3 -41
- package/dist/providers/icons/MailOpen.js +3 -41
- package/dist/providers/icons/Menu.js +3 -41
- package/dist/providers/icons/Message.js +3 -41
- package/dist/providers/icons/MessageFilled.js +3 -41
- package/dist/providers/icons/Minus.js +3 -41
- package/dist/providers/icons/Mobile.js +3 -41
- package/dist/providers/icons/NewWindow.js +3 -41
- package/dist/providers/icons/PaymentCard.js +3 -41
- package/dist/providers/icons/PaymentCardFilled.js +3 -41
- package/dist/providers/icons/Phone.js +3 -41
- package/dist/providers/icons/Plus.js +3 -41
- package/dist/providers/icons/Pound.js +3 -41
- package/dist/providers/icons/Pricing.js +3 -41
- package/dist/providers/icons/PricingFilled.js +3 -41
- package/dist/providers/icons/Search.js +3 -41
- package/dist/providers/icons/Security.js +3 -41
- package/dist/providers/icons/Shop.js +3 -41
- package/dist/providers/icons/ShopFilled.js +3 -41
- package/dist/providers/icons/Show.js +3 -41
- package/dist/providers/icons/SmartHome.js +3 -41
- package/dist/providers/icons/SmartMeter.js +3 -41
- package/dist/providers/icons/Solar.js +3 -41
- package/dist/providers/icons/Star.js +3 -41
- package/dist/providers/icons/StarFilled.js +3 -41
- package/dist/providers/icons/Sun.js +3 -41
- package/dist/providers/icons/Torch.js +3 -41
- package/dist/providers/icons/Trees.js +3 -41
- package/dist/providers/icons/Tune.js +3 -41
- package/dist/providers/icons/User.js +3 -41
- package/dist/providers/icons/UserFilled.js +3 -41
- package/dist/providers/icons/Wallet.js +3 -41
- package/dist/providers/icons/WalletFilled.js +3 -41
- package/dist/providers/icons/WarmHome.js +3 -41
- package/dist/providers/icons/Warning.js +3 -41
- package/dist/providers/icons/WebAddress.js +3 -41
- package/dist/providers/icons/WindPower.js +3 -41
- package/dist/providers/icons/index.js +93 -109
- package/dist/providers/index.js +2 -18
- package/dist/providers/types.js +1 -2
- package/dist/styled.native.d.ts +186 -188
- package/dist/styled.native.js +4 -33
- package/dist/theme/index.js +1 -17
- package/dist/utils/index.js +1 -17
- package/dist/utils/utils.d.ts +3 -3
- package/dist/utils/utils.js +27 -64
- package/package.json +37 -34
|
@@ -1,25 +1,19 @@
|
|
|
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
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
2
|
import Animated, { Extrapolate, interpolate, interpolateColor, useAnimatedStyle, } from 'react-native-reanimated';
|
|
7
3
|
import styled, { useTheme } from '../../styled.native';
|
|
8
|
-
export function NavigationDots(
|
|
9
|
-
|
|
10
|
-
return (_jsx(SDotsContainer, { children: data.map(function (_, index) { return (_jsx(Dot, { index: index, length: data.length, animatedValue: animatedValue }, index)); }) }));
|
|
4
|
+
export function NavigationDots({ data, animatedValue, }) {
|
|
5
|
+
return (_jsx(SDotsContainer, { children: data.map((_, index) => (_jsx(Dot, { index: index, length: data.length, animatedValue: animatedValue }, index))) }));
|
|
11
6
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (index === 0 && (animatedValue === null || animatedValue === void 0 ? void 0 : animatedValue.value) > length - 1) {
|
|
7
|
+
const Dot = ({ animatedValue, index, length, width = 10 }) => {
|
|
8
|
+
const theme = useTheme();
|
|
9
|
+
const animatedStyle = useAnimatedStyle(() => {
|
|
10
|
+
let inputRange = [index - 1, index, index + 1];
|
|
11
|
+
let outputRange = [-width, 0, width];
|
|
12
|
+
if (index === 0 && animatedValue?.value > length - 1) {
|
|
19
13
|
inputRange = [length - 1, length, length + 1];
|
|
20
14
|
outputRange = [-width, 0, width];
|
|
21
15
|
}
|
|
22
|
-
|
|
16
|
+
const backgroundColor = interpolateColor(animatedValue?.value, inputRange, [
|
|
23
17
|
theme.core.color.brand.forest,
|
|
24
18
|
theme.core.color.brand.energised,
|
|
25
19
|
theme.core.color.brand.forest,
|
|
@@ -27,24 +21,28 @@ var Dot = function (_a) {
|
|
|
27
21
|
return {
|
|
28
22
|
transform: [
|
|
29
23
|
{
|
|
30
|
-
translateX: interpolate(animatedValue
|
|
24
|
+
translateX: interpolate(animatedValue?.value, inputRange, outputRange, Extrapolate.CLAMP),
|
|
31
25
|
},
|
|
32
26
|
],
|
|
33
|
-
backgroundColor
|
|
27
|
+
backgroundColor,
|
|
34
28
|
};
|
|
35
29
|
}, [animatedValue, index, length]);
|
|
36
30
|
return (_jsx(SDot, { "$width": width, children: _jsx(SAnimatedDot, { style: animatedStyle }) }));
|
|
37
31
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
32
|
+
const SDotsContainer = styled.View `
|
|
33
|
+
position: absolute;
|
|
34
|
+
bottom: 20px;
|
|
35
|
+
flex-direction: row;
|
|
36
|
+
gap: 10px;
|
|
37
|
+
`;
|
|
38
|
+
const SDot = styled.View `
|
|
39
|
+
background-color: ${({ theme }) => theme.core.color.brand.forest};
|
|
40
|
+
width: ${({ $width }) => $width}px;
|
|
41
|
+
height: ${({ $width }) => $width}px;
|
|
42
|
+
border-radius: 50px;
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
`;
|
|
45
|
+
const SAnimatedDot = styled(Animated.View) `
|
|
46
|
+
border-radius: 20px;
|
|
47
|
+
flex: 1;
|
|
48
|
+
`;
|
|
@@ -1,23 +1,8 @@
|
|
|
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
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
2
|
import { numToPx } from '@ovotech/element-core';
|
|
18
3
|
import { useRef } from 'react';
|
|
19
4
|
import { useWindowDimensions, View } from 'react-native';
|
|
20
|
-
import Animated, {
|
|
5
|
+
import Animated, { Extrapolation, interpolate, useAnimatedStyle, useSharedValue, } from 'react-native-reanimated';
|
|
21
6
|
import Carousel from 'react-native-reanimated-carousel';
|
|
22
7
|
import Svg, { Path } from 'react-native-svg';
|
|
23
8
|
import { useBreakpoint } from '../../hooks';
|
|
@@ -25,52 +10,48 @@ import styled, { useTheme } from '../../styled.native';
|
|
|
25
10
|
import { Icon } from '../Icon';
|
|
26
11
|
import { NavigationDots } from './NavigationDots';
|
|
27
12
|
import { withAnchorPoint } from './anchor-point';
|
|
28
|
-
export function ProductCarousel(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return (_jsxs(View, { children: [mediumAndUp ? null : _jsx(SkewLine, {}), _jsxs(SCarouselContainer, { children: [_jsx(Carousel, { ref: carouselRef, data: data, renderItem: function (_a) {
|
|
37
|
-
var item = _a.item, animationValue = _a.animationValue;
|
|
38
|
-
return (_jsx(Card, { animationValue: animationValue, height: height, width: carouselWidth, children: children(item) }));
|
|
39
|
-
}, vertical: false, width: carouselWidth, height: height, onProgressChange: function (_, absoluteProgress) {
|
|
40
|
-
return (progressValue.value = absoluteProgress);
|
|
41
|
-
}, panGestureHandlerProps: {
|
|
13
|
+
export function ProductCarousel({ data, children, width, height, fullWidth, showArrows = true, showDots = false, loop = true, arrowsDistanceFromTop, }) {
|
|
14
|
+
const theme = useTheme();
|
|
15
|
+
const { mediumAndUp } = useBreakpoint();
|
|
16
|
+
const carouselRef = useRef(null);
|
|
17
|
+
const progressValue = useSharedValue(0);
|
|
18
|
+
const windowWidth = useWindowDimensions().width;
|
|
19
|
+
const carouselWidth = fullWidth ? windowWidth : width || windowWidth;
|
|
20
|
+
return (_jsxs(View, { children: [mediumAndUp ? null : _jsx(SkewLine, {}), _jsxs(SCarouselContainer, { children: [_jsx(Carousel, { ref: carouselRef, data: data, renderItem: ({ item, animationValue }) => (_jsx(Card, { animationValue: animationValue, height: height, width: carouselWidth, children: children(item) })), vertical: false, width: carouselWidth, height: height, onProgressChange: (_, absoluteProgress) => (progressValue.value = absoluteProgress), panGestureHandlerProps: {
|
|
42
21
|
activeOffsetX: [-20, 20],
|
|
43
|
-
}, loop: loop, testID: "carousel", scrollAnimationDuration: 700 }), showArrows && data.length > 1 && (_jsxs(_Fragment, { children: [_jsx(SActionPressable, { onPress:
|
|
22
|
+
}, loop: loop, testID: "carousel", scrollAnimationDuration: 700 }), showArrows && data.length > 1 && (_jsxs(_Fragment, { children: [_jsx(SActionPressable, { onPress: () => carouselRef.current?.prev(), "$top": arrowsDistanceFromTop, mediumAndUp: mediumAndUp, hitSlop: {
|
|
44
23
|
top: 32,
|
|
45
24
|
bottom: 32,
|
|
46
25
|
left: 16,
|
|
47
26
|
right: 16,
|
|
48
|
-
}, children: _jsx(Icon, { name: "arrow-left", size: 32, color: theme.core.color.brand.white }) }), _jsx(SActionPressable, { "$next": true, onPress:
|
|
27
|
+
}, children: _jsx(Icon, { name: "arrow-left", size: 32, color: theme.core.color.brand.white }) }), _jsx(SActionPressable, { "$next": true, onPress: () => carouselRef.current?.next(), "$top": arrowsDistanceFromTop, mediumAndUp: mediumAndUp, hitSlop: {
|
|
49
28
|
top: 32,
|
|
50
29
|
bottom: 32,
|
|
51
30
|
left: 16,
|
|
52
31
|
right: 16,
|
|
53
32
|
}, children: _jsx(Icon, { name: "arrow-right", size: 32, color: theme.core.color.brand.white }) })] })), showDots && data.length > 1 && (_jsx(NavigationDots, { data: data, animatedValue: progressValue }))] })] }));
|
|
54
33
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
var transform = {
|
|
34
|
+
const Card = ({ children, animationValue, height, width, }) => {
|
|
35
|
+
const WIDTH = width / 1.3;
|
|
36
|
+
const HEIGHT = height / 1.3;
|
|
37
|
+
const cardStyle = useAnimatedStyle(() => {
|
|
38
|
+
const scale = interpolate(animationValue.value, [-0.1, 0, 1], [0.95, 1, 1], Extrapolation.CLAMP);
|
|
39
|
+
const opacity = interpolate(animationValue.value, [-0.75, 0, 1], [0, 1, 0]);
|
|
40
|
+
const translateX = interpolate(animationValue.value, [-1, -0.2, 0, 1], [0, WIDTH * 0.3, 0, 0]);
|
|
41
|
+
const transform = {
|
|
64
42
|
transform: [
|
|
65
|
-
{ scale
|
|
66
|
-
{ translateX
|
|
43
|
+
{ scale },
|
|
44
|
+
{ translateX },
|
|
67
45
|
{ perspective: 200 },
|
|
68
46
|
{
|
|
69
|
-
rotateY:
|
|
47
|
+
rotateY: `${interpolate(animationValue.value, [-1, 0, 0.4, 1], [30, 0, -25, -25], Extrapolation.CLAMP)}deg`,
|
|
70
48
|
},
|
|
71
49
|
],
|
|
72
50
|
};
|
|
73
|
-
return
|
|
51
|
+
return {
|
|
52
|
+
...withAnchorPoint(transform, { x: 0.5, y: 0.5 }, { width: WIDTH, height: HEIGHT }),
|
|
53
|
+
opacity,
|
|
54
|
+
};
|
|
74
55
|
}, []);
|
|
75
56
|
return (_jsx(Animated.View, { style: {
|
|
76
57
|
flex: 1,
|
|
@@ -84,15 +65,17 @@ var Card = function (_a) {
|
|
|
84
65
|
cardStyle,
|
|
85
66
|
], children: children }) }));
|
|
86
67
|
};
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
|
|
68
|
+
const SCarouselContainer = styled.View `
|
|
69
|
+
align-items: center;
|
|
70
|
+
background-color: #0a9828;
|
|
71
|
+
overflow: hidden;
|
|
72
|
+
margin-top: -0.5px;
|
|
73
|
+
`;
|
|
74
|
+
const SActionPressable = styled.Pressable `
|
|
75
|
+
position: absolute;
|
|
76
|
+
top: ${({ $top }) => ($top ? `${$top}px` : '30%')};
|
|
77
|
+
${({ theme, $next, mediumAndUp }) => $next
|
|
78
|
+
? `right: ${mediumAndUp ? '25%' : numToPx(theme.core.space[14])}`
|
|
79
|
+
: `left: ${mediumAndUp ? '25%' : numToPx(theme.core.space[14])}`};
|
|
80
|
+
`;
|
|
81
|
+
const SkewLine = (props) => (_jsx(Svg, { width: "100%", height: 69, ...props, children: _jsx(Path, { fill: "#0A9828", d: "M768 0 0 68.776h768V0Z" }) }));
|
|
@@ -1,31 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
-
if (ar || !(i in from)) {
|
|
4
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
-
ar[i] = from[i];
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
-
};
|
|
10
|
-
var isValidSize = function (size) {
|
|
1
|
+
const isValidSize = (size) => {
|
|
11
2
|
'worklet';
|
|
12
3
|
return size && size.width > 0 && size.height > 0;
|
|
13
4
|
};
|
|
14
|
-
|
|
15
|
-
export
|
|
5
|
+
const defaultAnchorPoint = { x: 0.5, y: 0.5 };
|
|
6
|
+
export const withAnchorPoint = (transform, anchorPoint, size) => {
|
|
16
7
|
'worklet';
|
|
17
8
|
if (!isValidSize(size))
|
|
18
9
|
return transform;
|
|
19
|
-
|
|
10
|
+
let injectedTransform = transform.transform;
|
|
20
11
|
if (!injectedTransform)
|
|
21
12
|
return transform;
|
|
22
13
|
if (anchorPoint.x !== defaultAnchorPoint.x && size.width) {
|
|
23
|
-
|
|
14
|
+
const shiftTranslateX = [];
|
|
24
15
|
// shift before rotation
|
|
25
16
|
shiftTranslateX.push({
|
|
26
17
|
translateX: size.width * (anchorPoint.x - defaultAnchorPoint.x),
|
|
27
18
|
});
|
|
28
|
-
injectedTransform =
|
|
19
|
+
injectedTransform = [
|
|
20
|
+
...shiftTranslateX,
|
|
21
|
+
...injectedTransform,
|
|
22
|
+
];
|
|
29
23
|
// shift after rotation
|
|
30
24
|
injectedTransform.push({
|
|
31
25
|
translateX: size.width * (defaultAnchorPoint.x - anchorPoint.x),
|
|
@@ -34,12 +28,12 @@ export var withAnchorPoint = function (transform, anchorPoint, size) {
|
|
|
34
28
|
if (!Array.isArray(injectedTransform))
|
|
35
29
|
return { transform: injectedTransform };
|
|
36
30
|
if (anchorPoint.y !== defaultAnchorPoint.y && size.height) {
|
|
37
|
-
|
|
31
|
+
const shiftTranslateY = [];
|
|
38
32
|
// shift before rotation
|
|
39
33
|
shiftTranslateY.push({
|
|
40
34
|
translateY: size.height * (anchorPoint.y - defaultAnchorPoint.y),
|
|
41
35
|
});
|
|
42
|
-
injectedTransform =
|
|
36
|
+
injectedTransform = [...shiftTranslateY, ...injectedTransform];
|
|
43
37
|
// shift after rotation
|
|
44
38
|
injectedTransform.push({
|
|
45
39
|
translateY: size.height * (defaultAnchorPoint.y - anchorPoint.y),
|
|
@@ -1,62 +1,52 @@
|
|
|
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
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
2
|
import { numToPx } from '@ovotech/element-core';
|
|
25
|
-
import { forwardRef } from 'react';
|
|
26
3
|
import { TouchableOpacity, View, } from 'react-native';
|
|
27
4
|
import styled from '../../styled.native';
|
|
28
5
|
import { HintText } from '../HintText';
|
|
29
6
|
import { LabelText } from '../LabelText';
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
7
|
+
const StyledRadioInputWrapper = styled.View(({ theme: { core } }) => {
|
|
8
|
+
return `
|
|
9
|
+
width: ${numToPx(core.space[6])};
|
|
10
|
+
height: ${numToPx(core.space[6])};
|
|
11
|
+
margin-right: 10px;
|
|
12
|
+
`;
|
|
33
13
|
});
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
14
|
+
const StyledRadioInput = styled.View(({ theme: { core, semantic }, invalid, checked }) => {
|
|
15
|
+
return `
|
|
16
|
+
width: ${numToPx(core.space[6])};
|
|
17
|
+
height: ${numToPx(core.space[6])};
|
|
18
|
+
border: ${numToPx(core.borderWidth.small)} solid;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
border-radius: ${numToPx(core.space[6])};
|
|
22
|
+
border-color: ${invalid
|
|
37
23
|
? semantic.message.error
|
|
38
24
|
: checked
|
|
39
25
|
? core.color.blue.dark
|
|
40
|
-
: semantic.border.functional
|
|
26
|
+
: semantic.border.functional};
|
|
27
|
+
background: ${checked ? core.color.blue.lightest : 'transparent'};
|
|
28
|
+
`;
|
|
41
29
|
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
30
|
+
const StyledRadioInputDot = styled.View(({ theme: { core }, checked }) => {
|
|
31
|
+
return `
|
|
32
|
+
width: ${numToPx(core.space[3])};
|
|
33
|
+
height: ${numToPx(core.space[3])};
|
|
34
|
+
border-radius: ${numToPx(core.space[3])};
|
|
35
|
+
background: ${core.color.blue.dark};
|
|
36
|
+
opacity: ${checked ? 1 : 0};
|
|
37
|
+
`;
|
|
45
38
|
});
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
const Input = ({ checked, invalid, testID, ...rest }) => {
|
|
40
|
+
return (_jsx(StyledRadioInputWrapper, { ...rest, children: _jsx(StyledRadioInput, { invalid: invalid, checked: checked, testID: testID, children: _jsx(StyledRadioInputDot, { checked: checked }) }) }));
|
|
41
|
+
};
|
|
42
|
+
const StyledWrapper = styled.View(({ theme: { core } }) => `
|
|
43
|
+
padding-top: ${numToPx(core.space[3])};
|
|
44
|
+
flex-direction: row;
|
|
45
|
+
`);
|
|
46
|
+
const Radio = ({ label, hint, checked, invalid,
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
48
|
+
value, // "value" is needed for RadioGroup, but isn't actually used in the radio anywhere
|
|
49
|
+
activeOpacity = 0.8, testID, ref, ...rest }) => {
|
|
50
|
+
return (_jsx(TouchableOpacity, { ref: ref, accessible: true, accessibilityRole: "radio", activeOpacity: activeOpacity, accessibilityState: { checked }, ...rest, children: _jsxs(StyledWrapper, { children: [_jsx(Input, { checked: checked, invalid: invalid, testID: testID }), _jsxs(View, { style: { flexShrink: 1 }, children: [_jsx(LabelText, { children: label }), hint ? _jsx(HintText, { children: hint }) : null] })] }) }));
|
|
49
51
|
};
|
|
50
|
-
var StyledWrapper = styled.View(function (_a) {
|
|
51
|
-
var core = _a.theme.core;
|
|
52
|
-
return "\n padding-top: ".concat(numToPx(core.space[3]), ";\n flex-direction: row;\n ");
|
|
53
|
-
});
|
|
54
|
-
var Radio = forwardRef(function (_a, ref) {
|
|
55
|
-
var label = _a.label, hint = _a.hint, checked = _a.checked, invalid = _a.invalid,
|
|
56
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
57
|
-
value = _a.value, // "value" is needed for RadioGroup, but isn't actually used in the radio anywhere
|
|
58
|
-
_b = _a.activeOpacity, // "value" is needed for RadioGroup, but isn't actually used in the radio anywhere
|
|
59
|
-
activeOpacity = _b === void 0 ? 0.8 : _b, testID = _a.testID, rest = __rest(_a, ["label", "hint", "checked", "invalid", "value", "activeOpacity", "testID"]);
|
|
60
|
-
return (_jsx(TouchableOpacity, __assign({ ref: ref, accessible: true, accessibilityRole: "radio", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest, { children: _jsxs(StyledWrapper, { children: [_jsx(Input, { checked: checked, invalid: invalid, testID: testID }), _jsxs(View, { style: { flexShrink: 1 }, children: [_jsx(LabelText, { children: label }), hint ? _jsx(HintText, { children: hint }) : null] })] }) })));
|
|
61
|
-
});
|
|
62
52
|
export { Radio };
|
|
@@ -1,25 +1,3 @@
|
|
|
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
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
24
2
|
import { Children, cloneElement } from 'react';
|
|
25
3
|
import { View } from 'react-native';
|
|
@@ -29,18 +7,15 @@ import { FormGroup } from '../FormGroup';
|
|
|
29
7
|
import { HintText } from '../HintText';
|
|
30
8
|
import { LabelText } from '../LabelText';
|
|
31
9
|
import { Stack } from '../Stack';
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
onPress: callAll(onValueChange && (function () { return onValueChange(child.props.value); }), child.props.onPress),
|
|
43
|
-
});
|
|
44
|
-
}) })] }) })));
|
|
10
|
+
const RadioField = ({ label, hint, error, children, optional = false, value, onValueChange, ...rest }) => {
|
|
11
|
+
const hasError = !!error;
|
|
12
|
+
const validChildren = getValidChildren(children);
|
|
13
|
+
return (_jsx(FormGroup, { ...rest, error: hasError, children: _jsxs(Stack, { spaceBetween: 1, children: [_jsxs(View, { children: [_jsxs(LabelText, { children: [label, optional ? ' (optional)' : null] }), hint ? _jsx(HintText, { children: hint }) : null, error ? _jsx(ErrorText, { children: error }) : null] }), _jsx(View, { accessible: true, accessibilityRole: "radiogroup", children: Children.map(validChildren, child => cloneElement(child, {
|
|
14
|
+
invalid: hasError ? true : child.props.invalid,
|
|
15
|
+
checked: child.props.checked != null
|
|
16
|
+
? child.props.checked
|
|
17
|
+
: value && (value === child.props.value ? true : false),
|
|
18
|
+
onPress: callAll(onValueChange && (() => onValueChange(child.props.value)), child.props.onPress),
|
|
19
|
+
})) })] }) }));
|
|
45
20
|
};
|
|
46
21
|
export { RadioField };
|
|
@@ -1,66 +1,57 @@
|
|
|
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
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
2
|
import { numToPx } from '@ovotech/element-core';
|
|
29
|
-
import { forwardRef } from 'react';
|
|
30
3
|
import { TouchableOpacity, } from 'react-native';
|
|
31
4
|
import { css } from 'styled-components';
|
|
32
5
|
import styled from '../../styled.native';
|
|
33
6
|
import { LabelText } from '../LabelText';
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
7
|
+
const StyledRadioInputWrapper = styled.View(({ theme: { core } }) => {
|
|
8
|
+
return `
|
|
9
|
+
width: ${numToPx(core.space[6])};
|
|
10
|
+
height: ${numToPx(core.space[6])};
|
|
11
|
+
margin-top: ${numToPx(core.space[2])};
|
|
12
|
+
`;
|
|
37
13
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
14
|
+
const StyledRadioInput = styled.View(({ theme: { core, semantic }, invalid, checked }) => {
|
|
15
|
+
return `
|
|
16
|
+
width: ${numToPx(core.space[6])};
|
|
17
|
+
height: ${numToPx(core.space[6])};
|
|
18
|
+
border: ${numToPx(core.borderWidth.small)} solid;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
border-radius: ${numToPx(core.space[6])};
|
|
22
|
+
border-color: ${invalid
|
|
41
23
|
? semantic.message.error
|
|
42
24
|
: checked
|
|
43
25
|
? core.color.blue.dark
|
|
44
|
-
: semantic.border.functional
|
|
26
|
+
: semantic.border.functional};
|
|
27
|
+
background: ${checked ? core.color.blue.lightest : 'transparent'};
|
|
28
|
+
`;
|
|
45
29
|
});
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
30
|
+
const StyledRadioInputDot = styled.View(({ theme: { core }, checked }) => {
|
|
31
|
+
return `
|
|
32
|
+
width: ${numToPx(core.space[3])};
|
|
33
|
+
height: ${numToPx(core.space[3])};
|
|
34
|
+
border-radius: ${numToPx(core.space[3])};
|
|
35
|
+
background: ${core.color.blue.dark};
|
|
36
|
+
opacity: ${checked ? 1 : 0};
|
|
37
|
+
`;
|
|
49
38
|
});
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
const Input = ({ checked, invalid, testID, ...rest }) => {
|
|
40
|
+
return (_jsx(StyledRadioInputWrapper, { ...rest, children: _jsx(StyledRadioInput, { invalid: invalid, checked: checked, testID: testID, children: _jsx(StyledRadioInputDot, { checked: checked }) }) }));
|
|
41
|
+
};
|
|
42
|
+
const StyledWrapper = styled.View(({ theme: { core, semantic }, checked, invalid }) => css `
|
|
43
|
+
align-items: center;
|
|
44
|
+
background: ${semantic.surface.elevated};
|
|
45
|
+
padding: ${numToPx(core.space[2])};
|
|
46
|
+
min-width: 82px;
|
|
47
|
+
border-radius: ${numToPx(core.radius.small)};
|
|
48
|
+
border: ${numToPx(core.borderWidth.medium)} solid;
|
|
49
|
+
border-color: ${invalid
|
|
50
|
+
? semantic.message.error
|
|
51
|
+
: checked
|
|
52
|
+
? core.color.blue.dark
|
|
53
|
+
: 'transparent'};
|
|
54
|
+
`);
|
|
55
|
+
export const RadioCard = ({ label, checked, invalid, activeOpacity = 0.8, testID, hasInput = true, ref, ...rest }) => {
|
|
56
|
+
return (_jsx(TouchableOpacity, { ref: ref, accessible: true, accessibilityRole: "radio", activeOpacity: activeOpacity, accessibilityState: { checked }, ...rest, children: _jsxs(StyledWrapper, { checked: checked, invalid: invalid, children: [typeof label === 'string' ? _jsx(LabelText, { children: label }) : label, hasInput ? (_jsx(Input, { checked: checked, invalid: invalid, testID: testID })) : null] }) }));
|
|
53
57
|
};
|
|
54
|
-
var StyledWrapper = styled.View(function (_a) {
|
|
55
|
-
var _b = _a.theme, core = _b.core, semantic = _b.semantic, checked = _a.checked, invalid = _a.invalid;
|
|
56
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n background: ", ";\n padding: ", ";\n min-width: 82px;\n border-radius: ", ";\n border: ", " solid;\n border-color: ", ";\n "], ["\n align-items: center;\n background: ", ";\n padding: ", ";\n min-width: 82px;\n border-radius: ", ";\n border: ", " solid;\n border-color: ", ";\n "])), semantic.surface.elevated, numToPx(core.space[2]), numToPx(core.radius.small), numToPx(core.borderWidth.medium), invalid
|
|
57
|
-
? semantic.message.error
|
|
58
|
-
: checked
|
|
59
|
-
? core.color.blue.dark
|
|
60
|
-
: 'transparent');
|
|
61
|
-
});
|
|
62
|
-
export var RadioCard = forwardRef(function (_a, ref) {
|
|
63
|
-
var label = _a.label, checked = _a.checked, invalid = _a.invalid, _b = _a.activeOpacity, activeOpacity = _b === void 0 ? 0.8 : _b, testID = _a.testID, _c = _a.hasInput, hasInput = _c === void 0 ? true : _c, rest = __rest(_a, ["label", "checked", "invalid", "activeOpacity", "testID", "hasInput"]);
|
|
64
|
-
return (_jsx(TouchableOpacity, __assign({ ref: ref, accessible: true, accessibilityRole: "radio", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest, { children: _jsxs(StyledWrapper, { checked: checked, invalid: invalid, children: [typeof label === 'string' ? _jsx(LabelText, { children: label }) : label, hasInput ? (_jsx(Input, { checked: checked, invalid: invalid, testID: testID })) : null] }) })));
|
|
65
|
-
});
|
|
66
|
-
var templateObject_1;
|