@ovotech/element-native 3.8.1 → 4.0.0-canary-a872093-246
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/components/package.json +6 -0
- package/dist/components/Accordion/Accordion.d.ts +2 -3
- package/dist/components/Accordion/Accordion.js +130 -97
- package/dist/components/Accordion/Group.js +21 -21
- package/dist/components/Accordion/Icon.js +60 -59
- package/dist/components/Accordion/index.d.ts +1 -1
- package/dist/components/Accordion/index.js +9 -19
- package/dist/components/Accordion/styles.d.ts +20 -2
- package/dist/components/Accordion/styles.js +59 -50
- package/dist/components/Accordion/types.d.ts +2 -2
- package/dist/components/Accordion/types.js +2 -1
- package/dist/components/ActionCard/ActionCard.d.ts +1 -1
- package/dist/components/ActionCard/ActionCard.js +104 -376
- package/dist/components/ActionCard/CloseIconShape.js +40 -14
- package/dist/components/ActionCard/IndicatorIconShape.js +40 -11
- package/dist/components/ActionCard/index.js +5 -185
- package/dist/components/ActionList/ActionList.d.ts +3 -4
- package/dist/components/ActionList/ActionList.js +56 -202
- package/dist/components/ActionList/index.js +6 -100
- package/dist/components/ActionList/styled.d.ts +523 -5
- package/dist/components/ActionList/styled.js +65 -152
- package/dist/components/Badge/Badge.d.ts +9 -3
- package/dist/components/Badge/Badge.js +96 -39
- package/dist/components/Badge/index.js +5 -8
- package/dist/components/CTAButton/CTAButton.d.ts +9 -8
- package/dist/components/CTAButton/CTAButton.js +118 -181
- package/dist/components/CTAButton/index.js +8 -100
- package/dist/components/CTALink/CTALink.d.ts +5 -5
- package/dist/components/CTALink/CTALink.js +22 -105
- package/dist/components/CTALink/index.js +7 -100
- package/dist/components/Card/Card.d.ts +7 -483
- package/dist/components/Card/Card.js +43 -17
- package/dist/components/Card/index.js +5 -7
- package/dist/components/Checkbox/Checkbox.js +78 -173
- package/dist/components/Checkbox/CheckboxField.d.ts +1 -1
- package/dist/components/Checkbox/CheckboxField.js +43 -39
- package/dist/components/Checkbox/index.js +7 -105
- package/dist/components/CurrencyField/CurrencyField.d.ts +1 -1
- package/dist/components/CurrencyField/CurrencyField.js +32 -109
- package/dist/components/CurrencyField/index.js +5 -108
- package/dist/components/CurrencyInput/CurrencyInput.d.ts +2 -2
- package/dist/components/CurrencyInput/CurrencyInput.js +36 -118
- package/dist/components/CurrencyInput/index.d.ts +1 -1
- package/dist/components/CurrencyInput/index.js +5 -100
- package/dist/components/DataTable/DataTable.js +45 -62
- package/dist/components/DataTable/TableRow.js +35 -44
- package/dist/components/DataTable/index.js +20 -25
- package/dist/components/DataTable/styles.d.ts +78 -0
- package/dist/components/DataTable/styles.js +86 -119
- package/dist/components/DataTable/types.d.ts +4 -4
- package/dist/components/DataTable/types.js +2 -1
- package/dist/components/DateField/DateField.d.ts +3 -4
- package/dist/components/DateField/DateField.js +87 -229
- package/dist/components/DateField/index.js +5 -107
- package/dist/components/DescriptionList/DescriptionList.d.ts +2 -2
- package/dist/components/DescriptionList/DescriptionList.js +43 -25
- package/dist/components/DescriptionList/index.js +6 -13
- package/dist/components/DescriptionList/styled.d.ts +6 -0
- package/dist/components/DescriptionList/styled.js +85 -42
- package/dist/components/Disclosure/Disclosure.js +79 -153
- package/dist/components/Disclosure/index.js +16 -96
- package/dist/components/Divider/Divider.d.ts +1 -1
- package/dist/components/Divider/Divider.js +43 -12
- package/dist/components/Divider/index.js +5 -7
- package/dist/components/Em/Em.d.ts +6 -0
- package/dist/components/Em/Em.js +12 -8
- package/dist/components/Em/index.js +5 -6
- package/dist/components/EmailField/EmailField.d.ts +1 -1
- package/dist/components/EmailField/EmailField.js +32 -108
- package/dist/components/EmailField/index.js +5 -107
- package/dist/components/EmailInput/EmailInput.d.ts +1 -1
- package/dist/components/EmailInput/EmailInput.js +18 -106
- package/dist/components/EmailInput/index.js +5 -98
- package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.d.ts +2 -2
- package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.js +50 -115
- package/dist/components/ErrorSummaryNotification/index.js +5 -104
- package/dist/components/ErrorText/ErrorText.d.ts +6 -0
- package/dist/components/ErrorText/ErrorText.js +42 -22
- package/dist/components/ErrorText/index.js +5 -11
- package/dist/components/Field/Field.d.ts +2 -2
- package/dist/components/Field/Field.js +58 -62
- package/dist/components/Field/index.js +16 -16
- package/dist/components/FilterSelect/FilterSelect.d.ts +2 -2
- package/dist/components/FilterSelect/FilterSelect.js +77 -201
- package/dist/components/FilterSelect/index.js +5 -102
- package/dist/components/FormGroup/FormGroup.d.ts +1 -1
- package/dist/components/FormGroup/FormGroup.js +42 -9
- package/dist/components/FormGroup/index.js +5 -8
- package/dist/components/Grid/Col.d.ts +7 -1
- package/dist/components/Grid/Col.js +58 -32
- package/dist/components/Grid/Row.d.ts +6 -0
- package/dist/components/Grid/Row.js +72 -34
- package/dist/components/Grid/index.js +7 -13
- package/dist/components/Heading1/Heading1.js +70 -36
- package/dist/components/Heading1/index.js +5 -10
- package/dist/components/Heading2/Heading2.js +70 -36
- package/dist/components/Heading2/index.js +5 -10
- package/dist/components/Heading3/Heading3.js +70 -36
- package/dist/components/Heading3/index.js +5 -10
- package/dist/components/Heading4/Heading4.js +70 -36
- package/dist/components/Heading4/index.js +5 -10
- package/dist/components/HintText/HintText.d.ts +6 -0
- package/dist/components/HintText/HintText.js +42 -22
- package/dist/components/HintText/index.js +5 -11
- package/dist/components/Icon/Icon.d.ts +2 -2
- package/dist/components/Icon/Icon.js +38 -103
- package/dist/components/Icon/index.js +5 -93
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Input/Input.js +97 -198
- package/dist/components/Label/Label.js +50 -18
- package/dist/components/Label/index.js +5 -8
- package/dist/components/LabelText/LabelText.d.ts +6 -0
- package/dist/components/LabelText/LabelText.js +42 -20
- package/dist/components/LabelText/index.js +5 -11
- package/dist/components/Lead/Lead.js +52 -18
- package/dist/components/Lead/index.js +5 -8
- package/dist/components/LineThrough/LineThrough.d.ts +6 -0
- package/dist/components/LineThrough/LineThrough.js +12 -7
- package/dist/components/LineThrough/index.js +5 -6
- package/dist/components/List/List.d.ts +1 -1
- package/dist/components/List/List.js +32 -38
- package/dist/components/List/index.js +7 -16
- package/dist/components/List/styled.d.ts +25 -0
- package/dist/components/List/styled.js +52 -37
- package/dist/components/Margin/Margin.d.ts +8 -2
- package/dist/components/Margin/Margin.js +50 -68
- package/dist/components/Margin/index.js +5 -11
- package/dist/components/NavHeader/IconButton.d.ts +2 -2
- package/dist/components/NavHeader/IconButton.js +18 -119
- package/dist/components/NavHeader/NavHeader.d.ts +11 -3
- package/dist/components/NavHeader/NavHeader.js +65 -181
- package/dist/components/NavHeader/NavHeader.styles.d.ts +543 -7
- package/dist/components/NavHeader/NavHeader.styles.js +72 -81
- package/dist/components/NavHeader/index.d.ts +1 -1
- package/dist/components/NavHeader/index.js +5 -104
- package/dist/components/Notification/Notification.d.ts +14 -2
- package/dist/components/Notification/Notification.js +103 -190
- package/dist/components/Notification/index.js +9 -100
- package/dist/components/NumberField/NumberField.d.ts +1 -1
- package/dist/components/NumberField/NumberField.js +32 -108
- package/dist/components/NumberField/index.js +5 -107
- package/dist/components/NumberInput/NumberInput.d.ts +1 -1
- package/dist/components/NumberInput/NumberInput.js +18 -106
- package/dist/components/NumberInput/index.js +5 -98
- package/dist/components/P/P.js +54 -23
- package/dist/components/P/index.js +5 -10
- package/dist/components/PasswordField/PasswordField.d.ts +1 -1
- package/dist/components/PasswordField/PasswordField.js +32 -110
- package/dist/components/PasswordField/index.js +5 -109
- package/dist/components/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/components/PasswordInput/PasswordInput.js +33 -123
- package/dist/components/PasswordInput/PasswordInput.styled.d.ts +7 -1
- package/dist/components/PasswordInput/PasswordInput.styled.js +37 -18
- package/dist/components/PasswordInput/PasswordVisibilityToggle.d.ts +1 -1
- package/dist/components/PasswordInput/PasswordVisibilityToggle.js +26 -128
- package/dist/components/PasswordInput/index.js +5 -100
- package/dist/components/PhoneField/PhoneField.d.ts +1 -1
- package/dist/components/PhoneField/PhoneField.js +32 -108
- package/dist/components/PhoneField/index.js +5 -107
- package/dist/components/PhoneInput/PhoneInput.d.ts +1 -1
- package/dist/components/PhoneInput/PhoneInput.js +17 -106
- package/dist/components/PhoneInput/index.js +5 -98
- package/dist/components/ProductCarousel/NavigationDots.js +74 -57
- package/dist/components/ProductCarousel/ProductCarousel.js +126 -2174
- package/dist/components/ProductCarousel/anchor-point.js +51 -31
- package/dist/components/ProductCarousel/index.js +5 -101
- package/dist/components/Radio/Radio.js +67 -69
- package/dist/components/Radio/RadioField.d.ts +1 -1
- package/dist/components/Radio/RadioField.js +47 -46
- package/dist/components/Radio/index.js +7 -18
- package/dist/components/RadioCard/RadioCard.js +71 -68
- package/dist/components/RadioCard/index.js +5 -13
- package/dist/components/SelectField/Select.d.ts +8 -2
- package/dist/components/SelectField/Select.js +93 -852
- package/dist/components/SelectField/SelectField.d.ts +1 -1
- package/dist/components/SelectField/SelectField.js +32 -125
- package/dist/components/SelectField/index.js +5 -108
- package/dist/components/SkeletonAnimation/SkeletonAnimation.js +34 -47
- package/dist/components/SkeletonAnimation/index.js +5 -7
- package/dist/components/SkeletonCTA/SkeletonCTA.d.ts +1 -1
- package/dist/components/SkeletonCTA/SkeletonCTA.js +41 -17
- package/dist/components/SkeletonCTA/index.js +5 -12
- package/dist/components/SkeletonCircle/SkeletonCircle.d.ts +1 -1
- package/dist/components/SkeletonCircle/SkeletonCircle.js +44 -16
- package/dist/components/SkeletonCircle/index.js +5 -10
- package/dist/components/SkeletonHeading/SkeletonHeading.d.ts +1 -1
- package/dist/components/SkeletonHeading/SkeletonHeading.js +40 -29
- package/dist/components/SkeletonHeading/index.js +5 -12
- package/dist/components/SkeletonText/SkeletonText.d.ts +1 -1
- package/dist/components/SkeletonText/SkeletonText.js +50 -33
- package/dist/components/SkeletonText/index.js +5 -12
- package/dist/components/Small/Small.d.ts +6 -0
- package/dist/components/Small/Small.js +38 -17
- package/dist/components/Small/index.js +5 -11
- package/dist/components/Spinner/Spinner.d.ts +2 -2
- package/dist/components/Spinner/Spinner.js +68 -61
- package/dist/components/Spinner/index.js +5 -9
- package/dist/components/Stack/Stack.d.ts +1 -1
- package/dist/components/Stack/Stack.js +48 -30
- package/dist/components/Stack/index.js +5 -11
- package/dist/components/Stretch/Stretch.d.ts +1 -1
- package/dist/components/Stretch/Stretch.js +55 -11
- package/dist/components/Stretch/index.js +16 -8
- package/dist/components/Strong/Strong.d.ts +6 -0
- package/dist/components/Strong/Strong.js +10 -9
- package/dist/components/Strong/index.js +5 -6
- package/dist/components/SubLabelText/SubLabelText.d.ts +6 -0
- package/dist/components/SubLabelText/SubLabelText.js +42 -20
- package/dist/components/SubLabelText/index.js +5 -11
- package/dist/components/Tabs/Tab.d.ts +1 -2
- package/dist/components/Tabs/Tab.js +76 -60
- package/dist/components/Tabs/TabList.d.ts +2 -2
- package/dist/components/Tabs/TabList.js +77 -37
- package/dist/components/Tabs/TabPanel.js +64 -15
- package/dist/components/Tabs/Tabs.d.ts +2 -3
- package/dist/components/Tabs/Tabs.js +97 -46
- package/dist/components/Tabs/index.js +11 -19
- package/dist/components/TextField/TextField.d.ts +1 -1
- package/dist/components/TextField/TextField.js +32 -108
- package/dist/components/TextField/index.js +5 -107
- package/dist/components/TextGroup/TextGroup.js +40 -23
- package/dist/components/TextGroup/index.js +5 -7
- package/dist/components/TextInput/TextInput.d.ts +1 -1
- package/dist/components/TextInput/TextInput.js +18 -97
- package/dist/components/TextInput/index.js +5 -98
- package/dist/components/TextLink/TextLink.js +74 -118
- package/dist/components/TextLink/index.js +5 -97
- package/dist/components/TextareaField/TextareaField.d.ts +1 -1
- package/dist/components/TextareaField/TextareaField.js +32 -108
- package/dist/components/TextareaField/index.js +5 -107
- package/dist/components/TextareaInput/TextareaInput.d.ts +2 -2
- package/dist/components/TextareaInput/TextareaInput.js +65 -114
- package/dist/components/TextareaInput/index.d.ts +1 -1
- package/dist/components/TextareaInput/index.js +5 -98
- package/dist/components/Toast/Toast.d.ts +1 -1
- package/dist/components/Toast/Toast.js +159 -730
- package/dist/components/Toast/index.js +6 -105
- package/dist/components/Toggle/Toggle.d.ts +1 -1
- package/dist/components/Toggle/Toggle.js +55 -73
- package/dist/components/Toggle/index.js +5 -14
- package/dist/components/Toggle/styles.d.ts +25 -1
- package/dist/components/Toggle/styles.js +28 -38
- package/dist/components/index.d.ts +0 -3
- package/dist/components/index.js +77 -296
- package/dist/esm/components/Accordion/Accordion.js +106 -0
- package/dist/esm/components/Accordion/Group.js +18 -0
- package/dist/esm/components/Accordion/Icon.js +35 -0
- package/dist/esm/components/Accordion/index.js +3 -0
- package/dist/esm/components/Accordion/styles.js +31 -0
- package/dist/esm/components/ActionCard/ActionCard.js +77 -0
- package/dist/esm/components/ActionCard/CloseIconShape.js +11 -0
- package/dist/esm/components/ActionCard/IndicatorIconShape.js +11 -0
- package/dist/esm/components/ActionCard/index.js +1 -0
- package/dist/esm/components/ActionList/ActionList.js +54 -0
- package/dist/esm/components/ActionList/index.js +1 -0
- package/dist/esm/components/ActionList/styled.js +40 -0
- package/dist/esm/components/Badge/Badge.js +70 -0
- package/dist/esm/components/Badge/index.js +1 -0
- package/dist/esm/components/CTAButton/CTAButton.js +90 -0
- package/dist/esm/components/CTAButton/index.js +1 -0
- package/dist/esm/components/CTALink/CTALink.js +18 -0
- package/dist/esm/components/CTALink/index.js +1 -0
- package/dist/esm/components/Card/Card.js +37 -0
- package/dist/esm/components/Card/index.js +1 -0
- package/dist/esm/components/Checkbox/Checkbox.js +74 -0
- package/dist/esm/components/Checkbox/CheckboxField.js +42 -0
- package/dist/esm/components/Checkbox/index.js +2 -0
- package/dist/esm/components/CurrencyField/CurrencyField.js +30 -0
- package/dist/esm/components/CurrencyField/index.js +1 -0
- package/dist/esm/components/CurrencyInput/CurrencyInput.js +34 -0
- package/dist/esm/components/CurrencyInput/index.js +1 -0
- package/dist/esm/components/DataTable/DataTable.js +43 -0
- package/dist/esm/components/DataTable/TableRow.js +33 -0
- package/dist/esm/components/DataTable/index.js +3 -0
- package/dist/esm/components/DataTable/styles.js +61 -0
- package/dist/esm/components/DataTable/types.js +1 -0
- package/dist/esm/components/DateField/DateField.js +63 -0
- package/dist/esm/components/DateField/index.js +1 -0
- package/dist/esm/components/DescriptionList/DescriptionList.js +40 -0
- package/dist/esm/components/DescriptionList/index.js +1 -0
- package/dist/esm/components/DescriptionList/styled.js +58 -0
- package/dist/esm/components/Disclosure/Disclosure.js +55 -0
- package/dist/esm/components/Disclosure/index.js +1 -0
- package/dist/esm/components/Divider/Divider.js +17 -0
- package/dist/esm/components/Divider/index.js +1 -0
- package/dist/esm/components/Em/Em.js +7 -0
- package/dist/esm/components/Em/index.js +1 -0
- package/dist/esm/components/EmailField/EmailField.js +30 -0
- package/dist/esm/components/EmailField/index.js +1 -0
- package/dist/esm/components/EmailInput/EmailInput.js +16 -0
- package/dist/esm/components/EmailInput/index.js +1 -0
- package/dist/esm/components/ErrorSummaryNotification/ErrorSummaryNotification.js +49 -0
- package/dist/esm/components/ErrorSummaryNotification/index.js +1 -0
- package/dist/esm/components/ErrorText/ErrorText.js +17 -0
- package/dist/esm/components/ErrorText/index.js +1 -0
- package/dist/esm/components/Field/Field.js +58 -0
- package/dist/esm/components/Field/index.js +1 -0
- package/dist/esm/components/FilterSelect/FilterSelect.js +52 -0
- package/dist/esm/components/FilterSelect/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 +33 -0
- package/dist/esm/components/Grid/Row.js +47 -0
- package/dist/esm/components/Grid/index.js +2 -0
- package/dist/esm/components/Heading1/Heading1.js +46 -0
- package/dist/esm/components/Heading1/index.js +1 -0
- package/dist/esm/components/Heading2/Heading2.js +46 -0
- package/dist/esm/components/Heading2/index.js +1 -0
- package/dist/esm/components/Heading3/Heading3.js +46 -0
- package/dist/esm/components/Heading3/index.js +1 -0
- package/dist/esm/components/Heading4/Heading4.js +46 -0
- package/dist/esm/components/Heading4/index.js +1 -0
- package/dist/esm/components/HintText/HintText.js +17 -0
- package/dist/esm/components/HintText/index.js +1 -0
- package/dist/esm/components/Icon/Icon.js +36 -0
- package/dist/esm/components/Icon/index.js +1 -0
- package/dist/esm/components/Input/Input.js +74 -0
- package/dist/esm/components/Label/Label.js +25 -0
- package/dist/esm/components/Label/index.js +1 -0
- package/dist/esm/components/LabelText/LabelText.js +17 -0
- package/dist/esm/components/LabelText/index.js +1 -0
- package/dist/esm/components/Lead/Lead.js +27 -0
- package/dist/esm/components/Lead/index.js +1 -0
- package/dist/esm/components/LineThrough/LineThrough.js +7 -0
- package/dist/esm/components/LineThrough/index.js +1 -0
- package/dist/esm/components/List/List.js +29 -0
- package/dist/esm/components/List/index.js +1 -0
- package/dist/esm/components/List/styled.js +27 -0
- package/dist/esm/components/Margin/Margin.js +46 -0
- package/dist/esm/components/Margin/index.js +1 -0
- package/dist/esm/components/NavHeader/IconButton.js +16 -0
- package/dist/esm/components/NavHeader/NavHeader.js +42 -0
- package/dist/esm/components/NavHeader/NavHeader.styles.js +44 -0
- package/dist/esm/components/NavHeader/index.js +1 -0
- package/dist/esm/components/Notification/Notification.js +78 -0
- package/dist/esm/components/Notification/index.js +1 -0
- package/dist/esm/components/NumberField/NumberField.js +30 -0
- package/dist/esm/components/NumberField/index.js +1 -0
- package/dist/esm/components/NumberInput/NumberInput.js +16 -0
- package/dist/esm/components/NumberInput/index.js +1 -0
- package/dist/esm/components/P/P.js +29 -0
- package/dist/esm/components/P/index.js +1 -0
- package/dist/esm/components/PasswordField/PasswordField.js +30 -0
- package/dist/esm/components/PasswordField/index.js +1 -0
- package/dist/esm/components/PasswordInput/PasswordInput.js +32 -0
- package/dist/esm/components/PasswordInput/PasswordInput.styled.js +12 -0
- package/dist/esm/components/PasswordInput/PasswordVisibilityToggle.js +23 -0
- package/dist/esm/components/PasswordInput/index.js +1 -0
- package/dist/esm/components/PhoneField/PhoneField.js +30 -0
- package/dist/esm/components/PhoneField/index.js +1 -0
- package/dist/esm/components/PhoneInput/PhoneInput.js +15 -0
- package/dist/esm/components/PhoneInput/index.js +1 -0
- package/dist/esm/components/ProductCarousel/NavigationDots.js +50 -0
- package/dist/esm/components/ProductCarousel/ProductCarousel.js +98 -0
- package/dist/esm/components/ProductCarousel/anchor-point.js +49 -0
- package/dist/esm/components/ProductCarousel/index.js +1 -0
- package/dist/esm/components/Radio/Radio.js +62 -0
- package/dist/esm/components/Radio/RadioField.js +46 -0
- package/dist/esm/components/Radio/index.js +2 -0
- package/dist/esm/components/RadioCard/RadioCard.js +66 -0
- package/dist/esm/components/RadioCard/index.js +1 -0
- package/dist/esm/components/SelectField/Select.js +66 -0
- package/dist/esm/components/SelectField/SelectField.js +29 -0
- package/dist/esm/components/SelectField/index.js +1 -0
- package/dist/esm/components/SkeletonAnimation/SkeletonAnimation.js +31 -0
- package/dist/esm/components/SkeletonAnimation/index.js +1 -0
- package/dist/esm/components/SkeletonCTA/SkeletonCTA.js +35 -0
- package/dist/esm/components/SkeletonCTA/index.js +1 -0
- package/dist/esm/components/SkeletonCircle/SkeletonCircle.js +38 -0
- package/dist/esm/components/SkeletonCircle/index.js +1 -0
- package/dist/esm/components/SkeletonHeading/SkeletonHeading.js +34 -0
- package/dist/esm/components/SkeletonHeading/index.js +1 -0
- package/dist/esm/components/SkeletonText/SkeletonText.js +45 -0
- package/dist/esm/components/SkeletonText/index.js +1 -0
- package/dist/esm/components/Small/Small.js +13 -0
- package/dist/esm/components/Small/index.js +1 -0
- package/dist/esm/components/Spinner/Spinner.js +44 -0
- package/dist/esm/components/Spinner/index.js +1 -0
- package/dist/esm/components/Stack/Stack.js +43 -0
- package/dist/esm/components/Stack/index.js +1 -0
- package/dist/esm/components/Stretch/Stretch.js +29 -0
- package/dist/esm/components/Stretch/index.js +1 -0
- package/dist/esm/components/Strong/Strong.js +5 -0
- package/dist/esm/components/Strong/index.js +1 -0
- package/dist/esm/components/SubLabelText/SubLabelText.js +17 -0
- package/dist/esm/components/SubLabelText/index.js +1 -0
- package/dist/esm/components/Tabs/Tab.js +53 -0
- package/dist/esm/components/Tabs/TabList.js +51 -0
- package/dist/esm/components/Tabs/TabPanel.js +38 -0
- package/dist/esm/components/Tabs/Tabs.js +72 -0
- package/dist/esm/components/Tabs/index.js +4 -0
- package/dist/esm/components/TextField/TextField.js +30 -0
- package/dist/esm/components/TextField/index.js +1 -0
- package/dist/esm/components/TextGroup/TextGroup.js +39 -0
- package/dist/esm/components/TextGroup/index.js +1 -0
- package/dist/esm/components/TextInput/TextInput.js +16 -0
- package/dist/esm/components/TextInput/index.js +1 -0
- package/dist/esm/components/TextLink/TextLink.js +49 -0
- package/dist/esm/components/TextLink/index.js +1 -0
- package/dist/esm/components/TextareaField/TextareaField.js +30 -0
- package/dist/esm/components/TextareaField/index.js +1 -0
- package/dist/esm/components/TextareaInput/TextareaInput.js +41 -0
- package/dist/esm/components/TextareaInput/index.js +1 -0
- package/dist/esm/components/Toast/Toast.js +141 -0
- package/dist/esm/components/Toast/index.js +1 -0
- package/dist/esm/components/Toggle/Toggle.js +53 -0
- package/dist/esm/components/Toggle/index.js +1 -0
- package/dist/esm/components/Toggle/styles.js +23 -0
- package/dist/esm/components/index.js +62 -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/hooks/use-layout.js +16 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/providers/IconsProvider.js +115 -0
- package/dist/esm/providers/icons/Address.js +14 -0
- package/dist/esm/providers/icons/Advice.js +14 -0
- package/dist/esm/providers/icons/Archive.js +14 -0
- package/dist/esm/providers/icons/ArrowDown.js +14 -0
- package/dist/esm/providers/icons/ArrowLeft.js +14 -0
- package/dist/esm/providers/icons/ArrowRight.js +14 -0
- package/dist/esm/providers/icons/ArrowUp.js +14 -0
- package/dist/esm/providers/icons/Award.js +14 -0
- package/dist/esm/providers/icons/Battery.js +14 -0
- package/dist/esm/providers/icons/Cal.js +14 -0
- package/dist/esm/providers/icons/CalBook.js +14 -0
- package/dist/esm/providers/icons/CaretDown.js +14 -0
- package/dist/esm/providers/icons/CaretLeft.js +14 -0
- package/dist/esm/providers/icons/CaretRight.js +14 -0
- package/dist/esm/providers/icons/CaretUp.js +14 -0
- package/dist/esm/providers/icons/Chart.js +14 -0
- package/dist/esm/providers/icons/ChartFilled.js +14 -0
- package/dist/esm/providers/icons/Check.js +14 -0
- package/dist/esm/providers/icons/CheckCircle.js +14 -0
- package/dist/esm/providers/icons/ChevronDown.js +14 -0
- package/dist/esm/providers/icons/ChevronLeft.js +14 -0
- package/dist/esm/providers/icons/ChevronLeftSmall.js +14 -0
- package/dist/esm/providers/icons/ChevronLeftSmallFirst.js +14 -0
- package/dist/esm/providers/icons/ChevronRight.js +14 -0
- package/dist/esm/providers/icons/ChevronRightSmall.js +14 -0
- package/dist/esm/providers/icons/ChevronRightSmallLast.js +14 -0
- package/dist/esm/providers/icons/ChevronUp.js +14 -0
- package/dist/esm/providers/icons/Circle.js +14 -0
- package/dist/esm/providers/icons/CloseCircle.js +14 -0
- package/dist/esm/providers/icons/Cross.js +14 -0
- package/dist/esm/providers/icons/Doc.js +14 -0
- package/dist/esm/providers/icons/Dollar.js +14 -0
- package/dist/esm/providers/icons/Download.js +14 -0
- package/dist/esm/providers/icons/Eco.js +14 -0
- package/dist/esm/providers/icons/EcoHome.js +14 -0
- package/dist/esm/providers/icons/Edit.js +14 -0
- package/dist/esm/providers/icons/ElectricCar.js +14 -0
- package/dist/esm/providers/icons/ElectricHome.js +14 -0
- package/dist/esm/providers/icons/Electricity.js +14 -0
- package/dist/esm/providers/icons/EnergyAdvice.js +14 -0
- package/dist/esm/providers/icons/Equals.js +14 -0
- package/dist/esm/providers/icons/Euro.js +14 -0
- package/dist/esm/providers/icons/Gas.js +14 -0
- package/dist/esm/providers/icons/GlobeAddress.js +14 -0
- package/dist/esm/providers/icons/Help.js +14 -0
- package/dist/esm/providers/icons/HelpFilled.js +14 -0
- package/dist/esm/providers/icons/Hide.js +14 -0
- package/dist/esm/providers/icons/Home.js +14 -0
- package/dist/esm/providers/icons/HomeFilled.js +14 -0
- package/dist/esm/providers/icons/HydroPower.js +14 -0
- package/dist/esm/providers/icons/Info.js +14 -0
- package/dist/esm/providers/icons/Link.js +14 -0
- package/dist/esm/providers/icons/Logo.js +14 -0
- package/dist/esm/providers/icons/Mail.js +14 -0
- package/dist/esm/providers/icons/MailOpen.js +14 -0
- package/dist/esm/providers/icons/Menu.js +14 -0
- package/dist/esm/providers/icons/Message.js +14 -0
- package/dist/esm/providers/icons/MessageFilled.js +14 -0
- package/dist/esm/providers/icons/Minus.js +14 -0
- package/dist/esm/providers/icons/Mobile.js +14 -0
- package/dist/esm/providers/icons/NewWindow.js +14 -0
- package/dist/esm/providers/icons/PaymentCard.js +14 -0
- package/dist/esm/providers/icons/PaymentCardFilled.js +14 -0
- package/dist/esm/providers/icons/Phone.js +14 -0
- package/dist/esm/providers/icons/Plus.js +14 -0
- package/dist/esm/providers/icons/Pound.js +14 -0
- package/dist/esm/providers/icons/Pricing.js +14 -0
- package/dist/esm/providers/icons/Search.js +14 -0
- package/dist/esm/providers/icons/Security.js +14 -0
- package/dist/esm/providers/icons/Show.js +14 -0
- package/dist/esm/providers/icons/SmartHome.js +14 -0
- package/dist/esm/providers/icons/SmartMeter.js +14 -0
- package/dist/esm/providers/icons/Solar.js +14 -0
- package/dist/esm/providers/icons/Star.js +14 -0
- package/dist/esm/providers/icons/StarFilled.js +14 -0
- package/dist/esm/providers/icons/Sun.js +14 -0
- package/dist/esm/providers/icons/Torch.js +14 -0
- package/dist/esm/providers/icons/Trees.js +14 -0
- package/dist/esm/providers/icons/Tune.js +14 -0
- package/dist/esm/providers/icons/User.js +14 -0
- package/dist/esm/providers/icons/UserFilled.js +14 -0
- package/dist/esm/providers/icons/Wallet.js +14 -0
- package/dist/esm/providers/icons/WalletFilled.js +14 -0
- package/dist/esm/providers/icons/WarmHome.js +14 -0
- package/dist/esm/providers/icons/Warning.js +14 -0
- package/dist/esm/providers/icons/WebAddress.js +14 -0
- package/dist/esm/providers/icons/WindPower.js +14 -0
- package/dist/esm/providers/icons/index.js +87 -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/index.js +1 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/utils.js +95 -0
- package/dist/hooks/index.js +17 -8
- package/dist/hooks/use-breakpoint.d.ts +2 -2
- package/dist/hooks/use-breakpoint.js +15 -15
- package/dist/hooks/use-full-width.d.ts +1 -1
- package/dist/hooks/use-full-width.js +19 -16
- package/dist/hooks/use-layout.js +19 -17
- package/dist/index.d.ts +0 -2
- package/dist/index.js +18 -320
- package/dist/providers/IconsProvider.js +118 -189
- package/dist/providers/icons/Address.js +40 -13
- package/dist/providers/icons/Advice.js +40 -11
- package/dist/providers/icons/Archive.js +40 -13
- package/dist/providers/icons/ArrowDown.js +40 -11
- package/dist/providers/icons/ArrowLeft.js +40 -11
- package/dist/providers/icons/ArrowRight.js +40 -11
- package/dist/providers/icons/ArrowUp.js +40 -11
- package/dist/providers/icons/Award.js +40 -13
- package/dist/providers/icons/Battery.js +40 -13
- package/dist/providers/icons/Cal.js +40 -11
- package/dist/providers/icons/CalBook.js +40 -13
- package/dist/providers/icons/CaretDown.js +40 -5
- package/dist/providers/icons/CaretLeft.js +40 -5
- package/dist/providers/icons/CaretRight.js +40 -5
- package/dist/providers/icons/CaretUp.js +40 -5
- package/dist/providers/icons/Chart.js +40 -13
- package/dist/providers/icons/ChartFilled.js +40 -11
- package/dist/providers/icons/Check.js +40 -11
- package/dist/providers/icons/CheckCircle.js +40 -13
- package/dist/providers/icons/ChevronDown.js +40 -11
- package/dist/providers/icons/ChevronLeft.js +40 -11
- package/dist/providers/icons/ChevronLeftSmall.js +40 -11
- package/dist/providers/icons/ChevronLeftSmallFirst.js +40 -13
- package/dist/providers/icons/ChevronRight.js +40 -11
- package/dist/providers/icons/ChevronRightSmall.js +40 -11
- package/dist/providers/icons/ChevronRightSmallLast.js +40 -13
- package/dist/providers/icons/ChevronUp.js +40 -11
- package/dist/providers/icons/Circle.js +17 -5
- package/dist/providers/icons/CloseCircle.js +40 -13
- package/dist/providers/icons/Cross.js +40 -11
- package/dist/providers/icons/Doc.js +40 -11
- package/dist/providers/icons/Dollar.js +40 -13
- package/dist/providers/icons/Download.js +40 -13
- package/dist/providers/icons/Eco.js +40 -11
- package/dist/providers/icons/EcoHome.js +40 -13
- package/dist/providers/icons/Edit.js +40 -13
- package/dist/providers/icons/ElectricCar.js +40 -13
- package/dist/providers/icons/ElectricHome.js +40 -13
- package/dist/providers/icons/Electricity.js +40 -11
- package/dist/providers/icons/EnergyAdvice.js +40 -13
- package/dist/providers/icons/Equals.js +40 -13
- package/dist/providers/icons/Euro.js +40 -13
- package/dist/providers/icons/Gas.js +40 -11
- package/dist/providers/icons/GlobeAddress.js +40 -11
- package/dist/providers/icons/Help.js +40 -13
- package/dist/providers/icons/HelpFilled.d.ts +2 -0
- package/dist/providers/icons/HelpFilled.js +41 -0
- package/dist/providers/icons/Hide.js +40 -11
- package/dist/providers/icons/Home.js +40 -11
- package/dist/providers/icons/HomeFilled.js +40 -11
- package/dist/providers/icons/HydroPower.js +40 -13
- package/dist/providers/icons/Info.js +40 -13
- package/dist/providers/icons/Link.js +39 -40
- package/dist/providers/icons/Logo.js +17 -11
- package/dist/providers/icons/Mail.js +40 -11
- package/dist/providers/icons/MailOpen.js +40 -11
- package/dist/providers/icons/Menu.js +40 -13
- package/dist/providers/icons/Message.js +40 -11
- package/dist/providers/icons/MessageFilled.js +40 -11
- package/dist/providers/icons/Minus.js +40 -5
- package/dist/providers/icons/Mobile.js +40 -13
- package/dist/providers/icons/NewWindow.js +39 -22
- package/dist/providers/icons/PaymentCard.js +40 -13
- package/dist/providers/icons/PaymentCardFilled.d.ts +2 -0
- package/dist/providers/icons/PaymentCardFilled.js +41 -0
- package/dist/providers/icons/Phone.js +40 -11
- package/dist/providers/icons/Plus.js +40 -11
- package/dist/providers/icons/Pound.js +40 -13
- package/dist/providers/icons/Pricing.js +40 -11
- package/dist/providers/icons/Search.js +40 -11
- package/dist/providers/icons/Security.js +40 -13
- package/dist/providers/icons/Show.js +40 -13
- package/dist/providers/icons/SmartHome.js +40 -13
- package/dist/providers/icons/SmartMeter.js +40 -13
- package/dist/providers/icons/Solar.js +40 -11
- package/dist/providers/icons/Star.js +40 -11
- package/dist/providers/icons/StarFilled.d.ts +2 -0
- package/dist/providers/icons/StarFilled.js +41 -0
- package/dist/providers/icons/Sun.js +40 -13
- package/dist/providers/icons/Torch.js +39 -13
- package/dist/providers/icons/Trees.js +40 -13
- package/dist/providers/icons/Tune.js +40 -13
- package/dist/providers/icons/User.js +40 -13
- package/dist/providers/icons/UserFilled.js +40 -11
- package/dist/providers/icons/Wallet.js +40 -13
- package/dist/providers/icons/WalletFilled.js +40 -11
- package/dist/providers/icons/WarmHome.js +40 -13
- package/dist/providers/icons/Warning.js +40 -13
- package/dist/providers/icons/WebAddress.js +40 -11
- package/dist/providers/icons/WindPower.js +40 -11
- package/dist/providers/icons/index.d.ts +3 -0
- package/dist/providers/icons/index.js +102 -171
- package/dist/providers/index.js +17 -92
- package/dist/providers/types.d.ts +3 -3
- package/dist/providers/types.js +2 -1
- package/dist/styled.native.d.ts +36 -0
- package/dist/styled.native.js +32 -8
- package/dist/theme/index.js +15 -970
- package/dist/utils/index.js +16 -14
- package/dist/utils/utils.d.ts +2 -1
- package/dist/utils/utils.js +104 -57
- package/package.json +13 -21
- package/dist/components/components.spec.native.js +0 -199
- package/dist/index-zQHKJ0fC.js +0 -180
- package/dist/styled.native-KEscfVp7.js +0 -3872
- package/dist/test/utils.d.ts +0 -4
- package/dist/test/utils.js +0 -16127
- package/dist/theme-native--5aKgQLJ.js +0 -482
- package/dist/theme-web-MrdqV6Ln.js +0 -482
- package/dist/utils-HsZygzDh.js +0 -26
- /package/dist/{components/components.spec.native.d.ts → esm/components/Accordion/types.js} +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
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 { createElement as _createElement } from "react";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { isElement as isReactElement } from 'react-is';
|
|
15
|
+
import { Dimensions } from 'react-native';
|
|
16
|
+
import { useBreakpoint } from '../../hooks';
|
|
17
|
+
import { CellText, RowHeading, TableCell, TableHeaderText, TableRow as StyledTableRow, SeparatorRowText, StyledSeparatorRow, } from './styles';
|
|
18
|
+
export var TableRow = function (_a) {
|
|
19
|
+
var data = _a.data, index = _a.index, striped = _a.striped, rowHeadings = _a.rowHeadings, columnWidths = _a.columnWidths;
|
|
20
|
+
var breakpoints = useBreakpoint();
|
|
21
|
+
var cells = data.map(function (cellData, i) {
|
|
22
|
+
if (typeof cellData === 'object' &&
|
|
23
|
+
(cellData === null || cellData === void 0 ? void 0 : cellData.hasOwnProperty('isSeparator')) &&
|
|
24
|
+
(cellData === null || cellData === void 0 ? void 0 : cellData.hasOwnProperty('content'))) {
|
|
25
|
+
return (_jsx(StyledSeparatorRow, { testID: "separatorRow", width: Dimensions.get('window').width, children: _jsx(SeparatorRowText, __assign({}, breakpoints, { children: cellData === null || cellData === void 0 ? void 0 : cellData.content })) }, i));
|
|
26
|
+
}
|
|
27
|
+
if (rowHeadings && i === 0) {
|
|
28
|
+
return (_createElement(RowHeading, __assign({}, breakpoints, { key: i, testID: "rowHeader", cellWidth: columnWidths[i] }), isReactElement(cellData) ? (cellData) : (_jsx(TableHeaderText, __assign({}, breakpoints, { children: cellData })))));
|
|
29
|
+
}
|
|
30
|
+
return (_createElement(TableCell, __assign({}, breakpoints, { key: i, testID: "cell", cellWidth: columnWidths[i] }), isReactElement(cellData) ? (cellData) : (_jsx(CellText, __assign({}, breakpoints, { children: cellData })))));
|
|
31
|
+
});
|
|
32
|
+
return (_jsx(StyledTableRow, { stripe: striped && index % 2 === 0, children: cells }));
|
|
33
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
import { numToPx } from '@ovotech/element-core';
|
|
6
|
+
import styled, { css } from '../../styled.native';
|
|
7
|
+
export var StyledTableContainer = styled.View(function (_a) {
|
|
8
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic;
|
|
9
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-grow: 1;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "], ["\n flex-grow: 1;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "])), numToPx(core.borderWidth.small), semantic.border.differentiated);
|
|
10
|
+
});
|
|
11
|
+
export var TableHeader = styled.View(function (_a) {
|
|
12
|
+
var core = _a.theme.core, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
|
|
13
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n flex: ", ";\n align-self: stretch;\n flex-direction: row;\n width: ", ";\n "], ["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n flex: ", ";\n align-self: stretch;\n flex-direction: row;\n width: ", ";\n "])), numToPx(core.space[smallAndUp ? 3 : 2]), numToPx(core.space[smallAndUp ? 3 : 2]), numToPx(core.space[1]), numToPx(core.space[1]), cellWidth === 'auto' ? 1 : 0, cellWidth);
|
|
14
|
+
});
|
|
15
|
+
export var TableHeaderText = styled.Text(function (_a) {
|
|
16
|
+
var _b = _a.theme, semantic = _b.semantic, core = _b.core, smallAndUp = _a.smallAndUp;
|
|
17
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n text-align: left;\n flex-wrap: wrap;\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n text-align: left;\n flex-wrap: wrap;\n "])), core.fontFamily.bodyBold.native, numToPx(core.lineHeight.body[smallAndUp ? 'large' : 'small']), numToPx(core.fontSize.body[smallAndUp ? 'large' : 'small']), semantic.message.base);
|
|
18
|
+
});
|
|
19
|
+
export var TableCaptionText = styled.Text(function (_a) {
|
|
20
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
|
|
21
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n text-align: left;\n flex-wrap: wrap;\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n color: ", ";\n text-align: left;\n flex-wrap: wrap;\n "])), core.fontFamily.bodyBold.native, numToPx(core.fontSize.heading4[smallAndUp ? 'large' : 'small']), numToPx(core.lineHeight.heading4[smallAndUp ? 'large' : 'small']), semantic.message.branded);
|
|
22
|
+
});
|
|
23
|
+
export var CellText = styled.Text(function (_a) {
|
|
24
|
+
var core = _a.theme.core, smallAndUp = _a.smallAndUp;
|
|
25
|
+
return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n "])), core.fontFamily.body.native, numToPx(core.lineHeight.body.large), numToPx(core.fontSize.body[smallAndUp ? 'large' : 'small']));
|
|
26
|
+
});
|
|
27
|
+
export var TableCaption = styled.View(function (_a) {
|
|
28
|
+
var core = _a.theme.core;
|
|
29
|
+
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n padding: ", " ", ";\n "], ["\n padding: ", " ", ";\n "])), numToPx(core.space[4]), numToPx(core.space[2]));
|
|
30
|
+
});
|
|
31
|
+
export var TableRow = styled.View(function (_a) {
|
|
32
|
+
var _b = _a.theme, semantic = _b.semantic, core = _b.core, stripe = _a.stripe;
|
|
33
|
+
return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n background-color: ", ";\n flex-direction: row;\n align-items: stretch;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "], ["\n background-color: ", ";\n flex-direction: row;\n align-items: stretch;\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n "])), stripe
|
|
34
|
+
? semantic.surface.cutout
|
|
35
|
+
: semantic.surface.base, stripe ? '0px' : numToPx(core.borderWidth.small), stripe
|
|
36
|
+
? 'transparent'
|
|
37
|
+
: "".concat(semantic.border.differentiated));
|
|
38
|
+
});
|
|
39
|
+
export var TableRowHeading = styled.View(function (_a) {
|
|
40
|
+
var _b = _a.theme, semantic = _b.semantic, core = _b.core;
|
|
41
|
+
return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background-color: ", ";\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n flex-direction: row;\n align-items: stretch;\n "], ["\n background-color: ", ";\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n flex-direction: row;\n align-items: stretch;\n "])), semantic.surface.base, numToPx(core.borderWidth.small), semantic.border.functional);
|
|
42
|
+
});
|
|
43
|
+
export var TableBody = styled.View(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n flex-direction: column;\n flex-wrap: nowrap;\n"], ["\n flex-direction: column;\n flex-wrap: nowrap;\n"])));
|
|
44
|
+
export var TableCell = styled.View(function (_a) {
|
|
45
|
+
var core = _a.theme.core, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
|
|
46
|
+
return css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n width: ", ";\n flex: ", ";\n "], ["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n width: ", ";\n flex: ", ";\n "])), numToPx(core.space[smallAndUp ? 3 : 2]), numToPx(core.space[smallAndUp ? 3 : 2]), numToPx(core.space[2]), numToPx(core.space[2]), cellWidth, cellWidth === 'auto' ? 1 : 0);
|
|
47
|
+
});
|
|
48
|
+
export var RowHeading = styled.View(function (_a) {
|
|
49
|
+
var core = _a.theme.core, cellWidth = _a.cellWidth, smallAndUp = _a.smallAndUp;
|
|
50
|
+
return css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n width: ", ";\n flex: ", ";\n "], ["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n width: ", ";\n flex: ", ";\n "])), numToPx(core.space[smallAndUp ? 3 : 2]), numToPx(core.space[smallAndUp ? 3 : 2]), numToPx(core.space[2]), numToPx(core.space[2]), cellWidth, cellWidth === 'auto' ? 1 : 0);
|
|
51
|
+
});
|
|
52
|
+
export var StyledSeparatorRow = styled.View(function (_a) {
|
|
53
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, width = _a.width;
|
|
54
|
+
var minWidth = width ? "".concat(width - core.space[2] * 2, "px") : '100%';
|
|
55
|
+
return "\n min-width: ".concat(minWidth, ";\n flex: 1;\n flex-direction: row;\n background-color: ").concat(semantic.surface.elevated, ";\n padding: ").concat(numToPx(core.space[1]), " ").concat(numToPx(core.space[2]), ";\n ");
|
|
56
|
+
});
|
|
57
|
+
export var SeparatorRowText = styled.Text(function (_a) {
|
|
58
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
|
|
59
|
+
return "\n flex: 1;\n font-family: ".concat(core.fontFamily.body.native, ";\n font-size: ").concat(numToPx(core.fontSize.small[smallAndUp ? 'large' : 'small']), ";\n line-height: ").concat(numToPx(core.lineHeight.small[smallAndUp ? 'large' : 'small']), ";\n color: ").concat(semantic.message.secondary, ";\n");
|
|
60
|
+
});
|
|
61
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
import { numToPx } from '@ovotech/element-core';
|
|
18
|
+
import { forwardRef, createRef } from 'react';
|
|
19
|
+
import { TouchableWithoutFeedback, View } from 'react-native';
|
|
20
|
+
import styled, { css } from '../../styled.native';
|
|
21
|
+
import { mergeRefs, getText } from '../../utils';
|
|
22
|
+
import { ErrorText } from '../ErrorText';
|
|
23
|
+
import { FormGroup } from '../FormGroup';
|
|
24
|
+
import { HintText } from '../HintText';
|
|
25
|
+
import { LabelText } from '../LabelText';
|
|
26
|
+
import { NumberInput } from '../NumberInput';
|
|
27
|
+
import { Stack } from '../Stack';
|
|
28
|
+
import { SubLabelText } from '../SubLabelText';
|
|
29
|
+
var InlineFields = styled.View(function (_a) {
|
|
30
|
+
var stretch = _a.stretch, core = _a.theme.core;
|
|
31
|
+
var margin = numToPx(core.space[1]);
|
|
32
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-left: -", ";\n margin-right: -", ";\n flex-direction: row;\n ", "\n "], ["\n margin-left: -", ";\n margin-right: -", ";\n flex-direction: row;\n ", "\n "])), margin, margin, stretch ? '' : "width: 265px;");
|
|
33
|
+
});
|
|
34
|
+
var SubField = styled(Stack)(function (_a) {
|
|
35
|
+
var core = _a.theme.core;
|
|
36
|
+
var padding = numToPx(core.space[1]);
|
|
37
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-right: ", ";\n padding-left: ", ";\n "], ["\n padding-right: ", ";\n padding-left: ", ";\n "])), padding, padding);
|
|
38
|
+
});
|
|
39
|
+
var DayField = styled(SubField)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 25%;\n"], ["\n width: 25%;\n"])));
|
|
40
|
+
var MonthField = styled(SubField)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: 25%;\n"], ["\n width: 25%;\n"])));
|
|
41
|
+
var YearField = styled(SubField)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: 50%;\n"], ["\n width: 50%;\n"])));
|
|
42
|
+
export var DateField = forwardRef(function (_a, ref) {
|
|
43
|
+
var label = _a.label, hint = _a.hint, error = _a.error, _b = _a.optional, optional = _b === void 0 ? false : _b, _c = _a.fullWidth, fullWidth = _c === void 0 ? false : _c, onChange = _a.onChange, value = _a.value, testID = _a.testID, _d = _a.editable, editable = _d === void 0 ? false : _d;
|
|
44
|
+
var hasError = !!error;
|
|
45
|
+
var handleChange = function (key) { return function (datePartValue) {
|
|
46
|
+
var _a;
|
|
47
|
+
onChange &&
|
|
48
|
+
onChange(__assign(__assign({}, value), (_a = {}, _a[key] = datePartValue, _a)));
|
|
49
|
+
}; };
|
|
50
|
+
var dayRef = createRef();
|
|
51
|
+
var monthRef = createRef();
|
|
52
|
+
var yearRef = createRef();
|
|
53
|
+
var accessibilityLabel = function (labelText) {
|
|
54
|
+
return [labelText, getText(hint), getText(error)].filter(Boolean).join(', ');
|
|
55
|
+
};
|
|
56
|
+
var focusRef = function (internalRef) { return function () {
|
|
57
|
+
if (internalRef.current) {
|
|
58
|
+
internalRef.current.focus();
|
|
59
|
+
}
|
|
60
|
+
}; };
|
|
61
|
+
return (_jsx(FormGroup, { 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] }), _jsxs(InlineFields, { stretch: fullWidth, children: [_jsxs(DayField, { spaceBetween: 1, children: [_jsx(TouchableWithoutFeedback, { onPress: focusRef(dayRef), accessible: false, children: _jsx(SubLabelText, { children: "Day" }) }), _jsx(NumberInput, { ref: mergeRefs(dayRef, ref), accessibilityLabel: accessibilityLabel('Day'), invalid: hasError, value: value.day, onChangeText: handleChange('day'), testID: testID, stretch: true, editable: editable })] }), _jsxs(MonthField, { spaceBetween: 1, children: [_jsx(TouchableWithoutFeedback, { onPress: focusRef(monthRef), accessible: false, children: _jsx(SubLabelText, { children: "Month" }) }), _jsx(NumberInput, { ref: monthRef, accessibilityLabel: accessibilityLabel('Month'), invalid: hasError, value: value.month, onChangeText: handleChange('month'), testID: "".concat(testID, "-month"), stretch: true, editable: editable })] }), _jsxs(YearField, { spaceBetween: 1, children: [_jsx(TouchableWithoutFeedback, { onPress: focusRef(yearRef), accessible: false, children: _jsx(SubLabelText, { children: "Year" }) }), _jsx(NumberInput, { ref: yearRef, accessibilityLabel: accessibilityLabel('Year'), invalid: hasError, value: value.year, onChangeText: handleChange('year'), testID: "".concat(testID, "-year"), stretch: true, editable: editable })] })] })] }) }));
|
|
62
|
+
});
|
|
63
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DateField } from './DateField';
|
|
@@ -0,0 +1,40 @@
|
|
|
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 { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import { Children, cloneElement } from 'react';
|
|
25
|
+
import { getValidChildren } from '../../utils';
|
|
26
|
+
import { Dd, Dl, Dt } from './styled';
|
|
27
|
+
var DescriptionList = function (_a) {
|
|
28
|
+
var children = _a.children, rest = __rest(_a, ["children"]);
|
|
29
|
+
var validChildren = getValidChildren(children);
|
|
30
|
+
return (_jsx(Dl, __assign({}, rest, { children: Children.map(validChildren, function (child, index) {
|
|
31
|
+
return cloneElement(child, {
|
|
32
|
+
index: index,
|
|
33
|
+
});
|
|
34
|
+
}) })));
|
|
35
|
+
};
|
|
36
|
+
var DescriptionItem = function (_a) {
|
|
37
|
+
var label = _a.label, children = _a.children, index = _a.index, rest = __rest(_a, ["label", "children", "index"]);
|
|
38
|
+
return (_jsxs(_Fragment, { children: [_jsx(Dt, { style: index === 0 ? { marginTop: 0 } : undefined, children: label }), _jsx(Dd, __assign({}, rest, { children: children }))] }));
|
|
39
|
+
};
|
|
40
|
+
export { DescriptionList, DescriptionItem };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DescriptionList, DescriptionItem } from './DescriptionList';
|
|
@@ -0,0 +1,58 @@
|
|
|
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 { jsx as _jsx } from "react/jsx-runtime";
|
|
28
|
+
import { numToPx } from '@ovotech/element-core';
|
|
29
|
+
import { View } from 'react-native';
|
|
30
|
+
import styled, { css } from '../../styled.native';
|
|
31
|
+
import { styledComponentWithBreakpoints } from '../../utils';
|
|
32
|
+
export var Dl = styled.View(function (_a) {
|
|
33
|
+
var core = _a.theme.core, smallAndUp = _a.smallAndUp;
|
|
34
|
+
return "\n flex-direction: column;\n flex: 1;\n margin-vertical: ".concat(smallAndUp ? numToPx(core.space[3]) : numToPx(core.space[2]), ";\n");
|
|
35
|
+
});
|
|
36
|
+
var StyledDtText = styled.Text(function (_a) {
|
|
37
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic;
|
|
38
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n flex: 1;\n "])), core.fontFamily.bodyBold.native, numToPx(core.lineHeight.body.small), numToPx(core.fontSize.body.small), semantic.message.base);
|
|
39
|
+
});
|
|
40
|
+
var DtText = styledComponentWithBreakpoints(StyledDtText);
|
|
41
|
+
var StyledDtItem = styled.View(function (_a) {
|
|
42
|
+
var core = _a.theme.core, smallAndUp = _a.smallAndUp;
|
|
43
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-top: ", ";\n flex-direction: row;\n "], ["\n margin-top: ", ";\n flex-direction: row;\n "])), numToPx(core.space[smallAndUp ? 4 : 3]));
|
|
44
|
+
});
|
|
45
|
+
var DtItem = styledComponentWithBreakpoints(StyledDtItem);
|
|
46
|
+
export var Dt = function (_a) {
|
|
47
|
+
var children = _a.children, rest = __rest(_a, ["children"]);
|
|
48
|
+
return (_jsx(DtItem, __assign({}, rest, { children: _jsx(DtText, { children: children }) })));
|
|
49
|
+
};
|
|
50
|
+
var StyledDdText = styled.Text(function (_a) {
|
|
51
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic;
|
|
52
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "], ["\n font-family: ", ";\n line-height: ", ";\n color: ", ";\n font-size: ", ";\n flex: 1;\n "])), core.fontFamily.body.native, numToPx(core.lineHeight.body.small), semantic.message.secondary, numToPx(core.fontSize.body.small));
|
|
53
|
+
});
|
|
54
|
+
export var Dd = function (_a) {
|
|
55
|
+
var children = _a.children, rest = __rest(_a, ["children"]);
|
|
56
|
+
return (_jsx(View, __assign({ style: { flexDirection: 'row' } }, rest, { children: _jsx(StyledDdText, { children: children }) })));
|
|
57
|
+
};
|
|
58
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -0,0 +1,55 @@
|
|
|
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 { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
28
|
+
import { numToPx } from '@ovotech/element-core';
|
|
29
|
+
import { forwardRef, useState } from 'react';
|
|
30
|
+
import { useBreakpoint } from '../../hooks';
|
|
31
|
+
import styled, { css } from '../../styled.native';
|
|
32
|
+
import { Icon } from '../Icon';
|
|
33
|
+
var DisclosureButton = styled.TouchableOpacity(function () { return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n "], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n "]))); });
|
|
34
|
+
var DisclosureButtonIcon = styled(Icon)(function (_a) {
|
|
35
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, expanded = _a.expanded, smallAndUp = _a.smallAndUp;
|
|
36
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n transform: ", ";\n margin-right: ", ";\n color: ", ";\n "], ["\n transform: ", ";\n margin-right: ", ";\n color: ", ";\n "])), expanded ? 'rotate(0deg)' : 'rotate(-90deg)', numToPx(core.space[smallAndUp ? 2 : 1]), semantic.message.link);
|
|
37
|
+
});
|
|
38
|
+
var DisclosureButtonText = styled.Text(function (_a) {
|
|
39
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
|
|
40
|
+
return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n text-decoration: underline;\n text-decoration-color: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n text-decoration: underline;\n text-decoration-color: ", ";\n color: ", ";\n "])), core.fontFamily.body.native, numToPx(core.fontSize.body[smallAndUp ? 'large' : 'small']), numToPx(core.lineHeight.body[smallAndUp ? 'large' : 'small']), semantic.message.link, semantic.message.link);
|
|
41
|
+
});
|
|
42
|
+
var DisclosurePanel = styled.View(function (_a) {
|
|
43
|
+
var core = _a.theme.core, smallAndUp = _a.smallAndUp;
|
|
44
|
+
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-top: ", ";\n padding-left: ", ";\n "], ["\n margin-top: ", ";\n padding-left: ", ";\n "])), numToPx(core.space[smallAndUp ? 3 : 2]), numToPx(core.space[smallAndUp ? 2 : 1]));
|
|
45
|
+
});
|
|
46
|
+
export var Disclosure = forwardRef(function (_a, ref) {
|
|
47
|
+
var children = _a.children, title = _a.title, _b = _a.expanded, expanded = _b === void 0 ? false : _b, onToggle = _a.onToggle, rest = __rest(_a, ["children", "title", "expanded", "onToggle"]);
|
|
48
|
+
var _c = useState(expanded), isExpanded = _c[0], setIsExpanded = _c[1];
|
|
49
|
+
var breakpoints = useBreakpoint();
|
|
50
|
+
return (_jsxs(_Fragment, { children: [_jsxs(DisclosureButton, __assign({ onPress: function () {
|
|
51
|
+
setIsExpanded(!isExpanded);
|
|
52
|
+
onToggle && onToggle(!isExpanded);
|
|
53
|
+
}, ref: ref, accessibilityState: { expanded: isExpanded } }, rest, { children: [_jsx(DisclosureButtonIcon, __assign({ name: "caret-down" }, breakpoints, { size: 14, expanded: isExpanded })), _jsx(DisclosureButtonText, __assign({}, breakpoints, { children: title }))] })), isExpanded && (_jsx(DisclosurePanel, __assign({}, breakpoints, { children: children })))] }));
|
|
54
|
+
});
|
|
55
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Disclosure';
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import styled, { css } from '../../styled.native';
|
|
7
|
+
var StyledDivider = styled.View(function (_a) {
|
|
8
|
+
var semantic = _a.theme.semantic, _b = _a.type, type = _b === void 0 ? 'default' : _b, _c = _a.width, width = _c === void 0 ? '100%' : _c;
|
|
9
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 1px;\n background: ", ";\n width: ", ";\n "], ["\n height: 1px;\n background: ", ";\n width: ", ";\n "])), type === 'default'
|
|
10
|
+
? semantic.border.graphic
|
|
11
|
+
: semantic.border.differentiated, width);
|
|
12
|
+
});
|
|
13
|
+
export var Divider = function (_a) {
|
|
14
|
+
var type = _a.type, width = _a.width;
|
|
15
|
+
return _jsx(StyledDivider, { type: type, width: width });
|
|
16
|
+
};
|
|
17
|
+
var templateObject_1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Divider } from './Divider';
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
import styled from '../../styled.native';
|
|
6
|
+
export var Em = styled.Text(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */\n font-family: 'System font';\n font-style: italic;\n"], ["\n /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */\n font-family: 'System font';\n font-style: italic;\n"])));
|
|
7
|
+
var templateObject_1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Em } from './Em';
|
|
@@ -0,0 +1,30 @@
|
|
|
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 { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { forwardRef } from 'react';
|
|
25
|
+
import { Field } from '../Field';
|
|
26
|
+
import { EmailInput } from '../EmailInput';
|
|
27
|
+
export var EmailField = forwardRef(function (_a, ref) {
|
|
28
|
+
var rest = __rest(_a, []);
|
|
29
|
+
return (_jsx(Field, __assign({}, rest, { ref: ref, children: _jsx(EmailInput, {}) })));
|
|
30
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EmailField } from './EmailField';
|
|
@@ -0,0 +1,16 @@
|
|
|
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 { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { forwardRef } from 'react';
|
|
14
|
+
import { Input } from '../Input/Input';
|
|
15
|
+
var EmailInput = forwardRef(function (props, ref) { return (_jsx(Input, __assign({}, props, { keyboardType: "email-address", autoCapitalize: "none", autoCorrect: false, ref: ref }))); });
|
|
16
|
+
export { EmailInput };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EmailInput } from './EmailInput';
|
|
@@ -0,0 +1,49 @@
|
|
|
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 { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { createRef, useEffect } from 'react';
|
|
25
|
+
import { findNodeHandle, AccessibilityInfo, } from 'react-native';
|
|
26
|
+
import { Ul, Li } from '../List';
|
|
27
|
+
import { ErrorNotification } from '../Notification';
|
|
28
|
+
import { P } from '../P';
|
|
29
|
+
var ErrorSummaryNotification = function (_a) {
|
|
30
|
+
var errors = _a.errors, scrollViewRef = _a.scrollViewRef, _b = _a.scrollPos, scrollPos = _b === void 0 ? { x: 0, y: 0 } : _b, rest = __rest(_a, ["errors", "scrollViewRef", "scrollPos"]);
|
|
31
|
+
var ref = createRef();
|
|
32
|
+
useEffect(function () {
|
|
33
|
+
if (errors.length && scrollViewRef.current && ref.current) {
|
|
34
|
+
scrollViewRef.current.scrollTo(scrollPos);
|
|
35
|
+
// Timeout ensures element receives focus after current action.
|
|
36
|
+
setTimeout(function () {
|
|
37
|
+
var node = findNodeHandle(ref.current);
|
|
38
|
+
node && AccessibilityInfo.setAccessibilityFocus(node);
|
|
39
|
+
}, 200);
|
|
40
|
+
}
|
|
41
|
+
// This means that errors needs to have referential integrity otherwise the notification
|
|
42
|
+
// will be focused all the time.
|
|
43
|
+
}, [errors, scrollViewRef.current, ref.current]);
|
|
44
|
+
return (_jsx(ErrorNotification, __assign({ ref: ref }, rest, { children: errors.length === 0 ? null : (_jsx(Ul, { children: errors.map(function (_a) {
|
|
45
|
+
var message = _a.message, fieldId = _a.id;
|
|
46
|
+
return (_jsx(Li, { children: _jsx(P, { children: message }) }, fieldId));
|
|
47
|
+
}) })) })));
|
|
48
|
+
};
|
|
49
|
+
export { ErrorSummaryNotification };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ErrorSummaryNotification } from './ErrorSummaryNotification';
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
import { numToPx } from '@ovotech/element-core';
|
|
6
|
+
import styled, { css } from '../../styled.native';
|
|
7
|
+
import { styledComponentWithBreakpoints } from '../../utils';
|
|
8
|
+
var StyledErrorText = styled.Text(function (_a) {
|
|
9
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, smallAndUp = _a.smallAndUp;
|
|
10
|
+
var fontSize = smallAndUp
|
|
11
|
+
? core.fontSize.body.large
|
|
12
|
+
: core.fontSize.body.small;
|
|
13
|
+
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n "], ["\n font-family: ", ";\n line-height: ", ";\n font-size: ", ";\n color: ", ";\n "])), core.fontFamily.body.native, numToPx(smallAndUp ? core.lineHeight.body.large : core.lineHeight.body.small), numToPx(fontSize), semantic.message.error);
|
|
14
|
+
});
|
|
15
|
+
var ErrorText = styledComponentWithBreakpoints(StyledErrorText);
|
|
16
|
+
export { ErrorText };
|
|
17
|
+
var templateObject_1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ErrorText } from './ErrorText';
|
|
@@ -0,0 +1,58 @@
|
|
|
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 { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { Children, cloneElement, isValidElement, createRef, forwardRef, } from 'react';
|
|
25
|
+
import { TouchableWithoutFeedback, View } from 'react-native';
|
|
26
|
+
import { getText, mergeRefs } from '../../utils';
|
|
27
|
+
import { ErrorText } from '../ErrorText';
|
|
28
|
+
import { FormGroup } from '../FormGroup';
|
|
29
|
+
import { HintText } from '../HintText';
|
|
30
|
+
import { LabelText } from '../LabelText';
|
|
31
|
+
import { Stack } from '../Stack';
|
|
32
|
+
import { Stretch } from '../Stretch';
|
|
33
|
+
export var Field = forwardRef(function (_a, ref) {
|
|
34
|
+
var children = _a.children, label = _a.label, _b = _a.optional, optional = _b === void 0 ? false : _b, hint = _a.hint, error = _a.error, fullWidth = _a.fullWidth, _c = _a.characters, characters = _c === void 0 ? 25 : _c, _d = _a.affixWidth, affixWidth = _d === void 0 ? 0 : _d, rest = __rest(_a, ["children", "label", "optional", "hint", "error", "fullWidth", "characters", "affixWidth"]);
|
|
35
|
+
var hasError = !!error;
|
|
36
|
+
var inputRef = createRef();
|
|
37
|
+
var labelText = optional ? "".concat(label, " (optional)") : label;
|
|
38
|
+
var accessibilityLabel = [labelText, getText(hint), getText(error)]
|
|
39
|
+
.filter(Boolean)
|
|
40
|
+
.join(', ');
|
|
41
|
+
return (_jsx(FormGroup, { error: hasError || undefined, testID: "nb-field-form-group", children: _jsxs(Stack, { spaceBetween: 1, children: [_jsx(TouchableWithoutFeedback, { onPress: function () {
|
|
42
|
+
if (inputRef.current) {
|
|
43
|
+
// @ts-ignore. Toggle picker if this is a select menu.
|
|
44
|
+
if (inputRef.current.togglePicker) {
|
|
45
|
+
// @ts-ignore
|
|
46
|
+
inputRef.current.togglePicker();
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
// @ts-ignore
|
|
50
|
+
inputRef.current.focus();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}, children: _jsxs(View, { children: [_jsxs(LabelText, { children: [label, optional ? ' (optional)' : null] }), hint ? _jsx(HintText, { children: hint }) : null, error ? _jsx(ErrorText, { children: error }) : null] }) }), _jsx(Stretch, { defaultWidth: "".concat(Math.ceil(characters * 0.8 * 16) + affixWidth, "px"), fullWidth: fullWidth, children: Children.map(children, function (child) {
|
|
54
|
+
return isValidElement(child)
|
|
55
|
+
? cloneElement(child, __assign({ invalid: hasError || undefined, ref: mergeRefs(inputRef, ref), accessibilityLabel: accessibilityLabel }, rest))
|
|
56
|
+
: child;
|
|
57
|
+
}) })] }) }));
|
|
58
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Field';
|