@ovotech/element-native 2.2.0 → 3.0.0-canary-edaf96f-93
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 -2
- package/dist/components/Accordion/Accordion.js +22 -25
- package/dist/components/Accordion/Group.js +10 -32
- package/dist/components/Accordion/Icon.js +19 -14
- package/dist/components/Accordion/hooks.d.ts +1 -1
- package/dist/components/Accordion/hooks.js +3 -26
- package/dist/components/Accordion/styles.d.ts +688 -46
- package/dist/components/Accordion/styles.js +56 -49
- package/dist/components/Badge/Badge.d.ts +54 -46
- package/dist/components/Badge/Badge.js +35 -20
- package/dist/components/CTAButton/CTAButton.d.ts +7 -12
- package/dist/components/CTAButton/CTAButton.js +23 -27
- package/dist/components/CTALink/CTALink.d.ts +4 -4
- package/dist/components/CTALink/CTALink.js +5 -27
- package/dist/components/Card/Card.d.ts +47 -45
- package/dist/components/Card/Card.js +5 -25
- package/dist/components/Checkbox/Checkbox.d.ts +3 -3
- package/dist/components/Checkbox/Checkbox.js +18 -57
- package/dist/components/Checkbox/CheckboxField.js +7 -37
- package/dist/components/DataTable/DataTable.d.ts +3 -12
- package/dist/components/DataTable/DataTable.js +11 -98
- package/dist/components/DataTable/TableRow.d.ts +2 -0
- package/dist/components/DataTable/TableRow.js +31 -0
- package/dist/components/DataTable/index.d.ts +2 -0
- package/dist/components/DataTable/index.js +16 -0
- package/dist/components/DataTable/styles.d.ts +2517 -0
- package/dist/components/DataTable/styles.js +77 -0
- package/dist/components/DataTable/types.d.ts +15 -0
- package/dist/components/DataTable/types.js +2 -0
- package/dist/components/DateField/DateField.d.ts +2 -2
- package/dist/components/DateField/DateField.js +9 -28
- package/dist/components/DescriptionList/DescriptionList.js +8 -32
- package/dist/components/DescriptionList/styled.d.ts +50 -44
- package/dist/components/DescriptionList/styled.js +9 -34
- package/dist/components/Disclosure/Disclosure.d.ts +3 -3
- package/dist/components/Disclosure/Disclosure.js +12 -18
- package/dist/components/Divider/Divider.js +4 -7
- package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.d.ts +1 -1
- package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.js +6 -28
- package/dist/components/ErrorText/ErrorText.d.ts +45 -39
- package/dist/components/ErrorText/ErrorText.js +7 -4
- package/dist/components/Field/Field.d.ts +2 -2
- package/dist/components/Field/Field.js +18 -49
- package/dist/components/FormGroup/FormGroup.js +2 -3
- package/dist/components/Grid/Col.d.ts +45 -39
- package/dist/components/Grid/Col.js +4 -3
- package/dist/components/Grid/Row.d.ts +47 -41
- package/dist/components/Grid/Row.js +7 -10
- package/dist/components/Heading/Heading.js +21 -32
- package/dist/components/HintText/HintText.d.ts +45 -39
- package/dist/components/HintText/HintText.js +7 -4
- package/dist/components/Icon/Icon.d.ts +3 -4
- package/dist/components/Icon/Icon.js +5 -27
- package/dist/components/Input/CurrencyInput.d.ts +6 -6
- package/dist/components/Input/CurrencyInput.js +3 -25
- package/dist/components/Input/EmailInput.d.ts +6 -6
- package/dist/components/Input/EmailInput.js +3 -25
- package/dist/components/Input/Input.d.ts +8 -8
- package/dist/components/Input/Input.js +26 -32
- package/dist/components/Input/NumberInput.d.ts +6 -6
- package/dist/components/Input/NumberInput.js +3 -25
- package/dist/components/Input/PasswordInput.d.ts +6 -6
- package/dist/components/Input/PasswordInput.js +3 -25
- package/dist/components/Input/PasswordInput.styled.d.ts +45 -39
- package/dist/components/Input/PasswordInput.styled.js +2 -5
- package/dist/components/Input/PasswordVisibilityToggle.js +14 -29
- package/dist/components/Input/PhoneInput.d.ts +10 -0
- package/dist/components/Input/PhoneInput.js +19 -0
- package/dist/components/Input/TextInput.d.ts +6 -6
- package/dist/components/Input/TextInput.js +3 -25
- package/dist/components/Input/TextareaInput.d.ts +6 -6
- package/dist/components/Input/TextareaInput.js +13 -10
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/Input/index.js +3 -3
- package/dist/components/LabelText/LabelText.d.ts +45 -39
- package/dist/components/LabelText/LabelText.js +5 -4
- package/dist/components/List/List.d.ts +149 -131
- package/dist/components/List/List.js +30 -44
- package/dist/components/Margin/Margin.d.ts +45 -39
- package/dist/components/Margin/Margin.js +3 -3
- package/dist/components/NavHeader/NavHeader.d.ts +1 -1
- package/dist/components/NavHeader/NavHeader.js +34 -35
- package/dist/components/Notification/Notification.d.ts +104 -100
- package/dist/components/Notification/Notification.js +32 -49
- package/dist/components/Radio/Radio.d.ts +3 -3
- package/dist/components/Radio/Radio.js +16 -61
- package/dist/components/Radio/RadioField.js +11 -41
- package/dist/components/SelectField/Select.d.ts +244 -0
- package/dist/components/SelectField/Select.js +102 -0
- package/dist/components/SelectField/SelectField.d.ts +7 -0
- package/dist/components/SelectField/SelectField.js +33 -0
- package/dist/components/SelectField/index.d.ts +1 -0
- package/dist/components/SelectField/index.js +5 -0
- package/dist/components/SkeletonLoading/Skeleton.d.ts +45 -39
- package/dist/components/SkeletonLoading/SkeletonAnimation.js +22 -33
- package/dist/components/SkeletonLoading/SkeletonCTA.js +4 -5
- package/dist/components/SkeletonLoading/SkeletonCircle.js +4 -6
- package/dist/components/SkeletonLoading/SkeletonHeading.js +4 -5
- package/dist/components/SkeletonLoading/SkeletonText.js +5 -5
- package/dist/components/Stack/Stack.js +6 -28
- package/dist/components/Stretch/Stretch.js +2 -2
- package/dist/components/SubLabelText/SubLabelText.d.ts +45 -39
- package/dist/components/SubLabelText/SubLabelText.js +5 -4
- package/dist/components/SummaryList/SummaryList.js +8 -32
- package/dist/components/Tabs/Tab.d.ts +4 -4
- package/dist/components/Tabs/Tab.js +23 -20
- package/dist/components/Tabs/TabList.d.ts +11 -222
- package/dist/components/Tabs/TabList.js +22 -18
- package/dist/components/Tabs/TabPanel.js +33 -10
- package/dist/components/Tabs/Tabs.d.ts +8 -227
- package/dist/components/Tabs/Tabs.js +26 -23
- package/dist/components/Text/Text.d.ts +234 -204
- package/dist/components/Text/Text.js +17 -20
- package/dist/components/TextField/CurrencyField.d.ts +6 -6
- package/dist/components/TextField/CurrencyField.js +3 -26
- package/dist/components/TextField/EmailField.d.ts +6 -6
- package/dist/components/TextField/EmailField.js +3 -26
- package/dist/components/TextField/NumberField.d.ts +6 -6
- package/dist/components/TextField/NumberField.js +3 -26
- package/dist/components/TextField/PasswordField.d.ts +6 -6
- package/dist/components/TextField/PasswordField.js +3 -26
- package/dist/components/TextField/PhoneField.d.ts +10 -0
- package/dist/components/TextField/PhoneField.js +33 -0
- package/dist/components/TextField/TelField.d.ts +10 -6
- package/dist/components/TextField/TelField.js +9 -27
- package/dist/components/TextField/TextField.d.ts +6 -6
- package/dist/components/TextField/TextField.js +3 -26
- package/dist/components/TextField/TextareaField.d.ts +6 -6
- package/dist/components/TextField/TextareaField.js +3 -26
- package/dist/components/TextField/index.d.ts +1 -0
- package/dist/components/TextField/index.js +3 -1
- package/dist/components/TextLink/TextLink.d.ts +4 -4
- package/dist/components/TextLink/TextLink.js +5 -8
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/esm/components/Accordion/Accordion.js +25 -28
- package/dist/esm/components/Accordion/Group.js +10 -9
- package/dist/esm/components/Accordion/Icon.js +20 -12
- package/dist/esm/components/Accordion/hooks.js +3 -3
- package/dist/esm/components/Accordion/styles.js +29 -48
- package/dist/esm/components/Badge/Badge.js +35 -17
- package/dist/esm/components/CTAButton/CTAButton.js +24 -28
- package/dist/esm/components/CTALink/CTALink.js +5 -4
- package/dist/esm/components/Card/Card.js +5 -25
- package/dist/esm/components/Checkbox/Checkbox.js +15 -34
- package/dist/esm/components/Checkbox/CheckboxField.js +7 -14
- package/dist/esm/components/DataTable/DataTable.js +10 -74
- package/dist/esm/components/DataTable/TableRow.js +27 -0
- package/dist/esm/components/DataTable/index.js +2 -0
- package/dist/esm/components/DataTable/styles.js +51 -0
- package/dist/esm/components/DataTable/types.js +1 -0
- package/dist/esm/components/DateField/DateField.js +9 -28
- package/dist/esm/components/DescriptionList/DescriptionList.js +8 -9
- package/dist/esm/components/DescriptionList/styled.js +9 -31
- package/dist/esm/components/Disclosure/Disclosure.js +13 -19
- package/dist/esm/components/Divider/Divider.js +4 -4
- package/dist/esm/components/ErrorSummaryNotification/ErrorSummaryNotification.js +6 -5
- package/dist/esm/components/ErrorText/ErrorText.js +7 -4
- package/dist/esm/components/Field/Field.js +18 -26
- package/dist/esm/components/FormGroup/FormGroup.js +2 -3
- package/dist/esm/components/Grid/Col.js +4 -3
- package/dist/esm/components/Grid/Row.js +7 -7
- package/dist/esm/components/Heading/Heading.js +21 -29
- package/dist/esm/components/HintText/HintText.js +7 -4
- package/dist/esm/components/Icon/Icon.js +5 -4
- package/dist/esm/components/Input/CurrencyInput.js +3 -2
- package/dist/esm/components/Input/EmailInput.js +3 -2
- package/dist/esm/components/Input/Input.js +27 -33
- package/dist/esm/components/Input/NumberInput.js +3 -2
- package/dist/esm/components/Input/PasswordInput.js +3 -2
- package/dist/esm/components/Input/PasswordInput.styled.js +2 -5
- package/dist/esm/components/Input/PasswordVisibilityToggle.js +15 -7
- package/dist/esm/components/Input/{TelInput.js → PhoneInput.js} +4 -3
- package/dist/esm/components/Input/TextInput.js +3 -2
- package/dist/esm/components/Input/TextareaInput.js +13 -10
- package/dist/esm/components/Input/index.js +1 -1
- package/dist/esm/components/LabelText/LabelText.js +5 -4
- package/dist/esm/components/List/List.js +31 -45
- package/dist/esm/components/Margin/Margin.js +3 -3
- package/dist/esm/components/NavHeader/NavHeader.js +34 -32
- package/dist/esm/components/Notification/Notification.js +33 -50
- package/dist/esm/components/Radio/Radio.js +16 -38
- package/dist/esm/components/Radio/RadioField.js +11 -18
- package/dist/esm/components/SelectField/Select.js +75 -0
- package/dist/esm/components/SelectField/SelectField.js +29 -0
- package/dist/esm/components/SelectField/index.js +1 -0
- package/dist/esm/components/SkeletonLoading/SkeletonAnimation.js +23 -11
- package/dist/esm/components/SkeletonLoading/SkeletonCTA.js +4 -5
- package/dist/esm/components/SkeletonLoading/SkeletonCircle.js +4 -6
- package/dist/esm/components/SkeletonLoading/SkeletonHeading.js +4 -5
- package/dist/esm/components/SkeletonLoading/SkeletonText.js +5 -5
- package/dist/esm/components/Stack/Stack.js +6 -5
- package/dist/esm/components/Stretch/Stretch.js +2 -2
- package/dist/esm/components/SubLabelText/SubLabelText.js +5 -4
- package/dist/esm/components/SummaryList/SummaryList.js +8 -9
- package/dist/esm/components/Tabs/Tab.js +23 -17
- package/dist/esm/components/Tabs/TabList.js +21 -18
- package/dist/esm/components/Tabs/TabPanel.js +10 -7
- package/dist/esm/components/Tabs/Tabs.js +25 -23
- package/dist/esm/components/Text/Text.js +17 -20
- package/dist/esm/components/TextField/CurrencyField.js +3 -3
- package/dist/esm/components/TextField/EmailField.js +3 -3
- package/dist/esm/components/TextField/NumberField.js +3 -3
- package/dist/esm/components/TextField/PasswordField.js +3 -3
- package/dist/esm/components/TextField/PhoneField.js +30 -0
- package/dist/esm/components/TextField/TelField.js +9 -4
- package/dist/esm/components/TextField/TextField.js +3 -3
- package/dist/esm/components/TextField/TextareaField.js +3 -3
- package/dist/esm/components/TextField/index.js +1 -0
- package/dist/esm/components/TextLink/TextLink.js +5 -8
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/hooks/use-breakpoint.js +4 -4
- package/dist/esm/providers/IconsProvider.js +3 -2
- package/dist/esm/providers/icons/ArrowDown.js +2 -3
- package/dist/esm/providers/icons/ArrowLeft.js +2 -3
- package/dist/esm/providers/icons/ArrowRight.js +2 -3
- package/dist/esm/providers/icons/ArrowUp.js +2 -3
- package/dist/esm/providers/icons/CaretDown.js +2 -3
- package/dist/esm/providers/icons/CaretLeft.js +2 -3
- package/dist/esm/providers/icons/CaretRight.js +2 -3
- package/dist/esm/providers/icons/CaretUp.js +2 -3
- package/dist/esm/providers/icons/Chart.js +2 -3
- package/dist/esm/providers/icons/Check.js +2 -3
- package/dist/esm/providers/icons/ChevronDown.js +2 -3
- package/dist/esm/providers/icons/ChevronLeft.js +2 -3
- package/dist/esm/providers/icons/ChevronLeftSmall.js +2 -3
- package/dist/esm/providers/icons/ChevronLeftSmallFirst.js +2 -3
- package/dist/esm/providers/icons/ChevronRight.js +2 -3
- package/dist/esm/providers/icons/ChevronRightSmall.js +2 -3
- package/dist/esm/providers/icons/ChevronRightSmallLast.js +2 -3
- package/dist/esm/providers/icons/ChevronUp.js +2 -3
- package/dist/esm/providers/icons/Cross.js +2 -3
- package/dist/esm/providers/icons/Dollar.js +2 -3
- package/dist/esm/providers/icons/Download.js +2 -3
- package/dist/esm/providers/icons/Electricity.js +2 -3
- package/dist/esm/providers/icons/Euro.js +2 -3
- package/dist/esm/providers/icons/Gas.js +2 -4
- package/dist/esm/providers/icons/Help.js +2 -3
- package/dist/esm/providers/icons/Hide.js +2 -3
- package/dist/esm/providers/icons/Home.js +2 -3
- package/dist/esm/providers/icons/Info.js +2 -3
- package/dist/esm/providers/icons/Link.js +2 -4
- package/dist/esm/providers/icons/Logo.js +3 -4
- package/dist/esm/providers/icons/Minus.js +2 -3
- package/dist/esm/providers/icons/NewWindow.js +2 -3
- package/dist/esm/providers/icons/PaymentCard.js +2 -3
- package/dist/esm/providers/icons/Plus.js +2 -3
- package/dist/esm/providers/icons/Pound.js +2 -3
- package/dist/esm/providers/icons/Search.js +2 -3
- package/dist/esm/providers/icons/Show.js +2 -3
- package/dist/esm/providers/icons/User.js +2 -3
- package/dist/esm/theme/create-theme.js +0 -153
- package/dist/esm/utils/utils.js +7 -3
- package/dist/hooks/use-breakpoint.js +4 -4
- package/dist/providers/IconsProvider.js +3 -25
- package/dist/providers/icons/ArrowDown.js +2 -6
- package/dist/providers/icons/ArrowLeft.js +2 -6
- package/dist/providers/icons/ArrowRight.js +2 -6
- package/dist/providers/icons/ArrowUp.js +2 -6
- package/dist/providers/icons/CaretDown.js +2 -6
- package/dist/providers/icons/CaretLeft.js +2 -6
- package/dist/providers/icons/CaretRight.js +2 -6
- package/dist/providers/icons/CaretUp.js +2 -6
- package/dist/providers/icons/Chart.js +2 -6
- package/dist/providers/icons/Check.js +2 -6
- package/dist/providers/icons/ChevronDown.js +2 -6
- package/dist/providers/icons/ChevronLeft.js +2 -6
- package/dist/providers/icons/ChevronLeftSmall.js +2 -6
- package/dist/providers/icons/ChevronLeftSmallFirst.js +2 -6
- package/dist/providers/icons/ChevronRight.js +2 -6
- package/dist/providers/icons/ChevronRightSmall.js +2 -6
- package/dist/providers/icons/ChevronRightSmallLast.js +2 -6
- package/dist/providers/icons/ChevronUp.js +2 -6
- package/dist/providers/icons/Cross.js +2 -6
- package/dist/providers/icons/Dollar.js +2 -6
- package/dist/providers/icons/Download.js +2 -6
- package/dist/providers/icons/Electricity.js +2 -6
- package/dist/providers/icons/Euro.js +2 -6
- package/dist/providers/icons/Gas.js +2 -7
- package/dist/providers/icons/Help.js +2 -6
- package/dist/providers/icons/Hide.js +2 -6
- package/dist/providers/icons/Home.js +2 -6
- package/dist/providers/icons/Info.js +2 -6
- package/dist/providers/icons/Link.js +2 -7
- package/dist/providers/icons/Logo.js +2 -6
- package/dist/providers/icons/Minus.js +2 -6
- package/dist/providers/icons/NewWindow.js +2 -6
- package/dist/providers/icons/PaymentCard.js +2 -6
- package/dist/providers/icons/Plus.js +2 -6
- package/dist/providers/icons/Pound.js +2 -6
- package/dist/providers/icons/Search.js +2 -6
- package/dist/providers/icons/Show.js +2 -6
- package/dist/providers/icons/User.js +2 -6
- package/dist/styled.native.d.ts +270 -234
- package/dist/theme/create-theme.js +0 -153
- package/dist/theme/index.d.ts +45 -39
- package/dist/theme/theme.d.ts +0 -90
- package/dist/utils/utils.d.ts +5 -4
- package/dist/utils/utils.js +8 -26
- package/package.json +6 -5
- package/dist/components/Input/TelInput.d.ts +0 -10
- package/dist/components/Input/TelInput.js +0 -41
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
|
-
import { Breakpoints } from '../../hooks';
|
|
4
3
|
export declare type NotificationVariantName = 'error' | 'success' | 'info' | 'warning';
|
|
5
|
-
export declare type NotificationVariant = {
|
|
6
|
-
background: string;
|
|
7
|
-
borderColor: string;
|
|
8
|
-
textColor: string;
|
|
9
|
-
};
|
|
10
4
|
declare type NotificationProps = Omit<ComponentProps<typeof Notification>, 'variant'>;
|
|
11
5
|
export declare const NotificationContentBox: import("styled-components").StyledComponent<typeof import("react-native").View, import("../../theme/theme").Theme & {
|
|
12
6
|
core: {
|
|
@@ -14,10 +8,10 @@ export declare const NotificationContentBox: import("styled-components").StyledC
|
|
|
14
8
|
borderWidth: Record<"small" | "medium" | "large", string>;
|
|
15
9
|
breakpoint: Record<"small" | "medium" | "large", string | number>;
|
|
16
10
|
mediaQuery: Record<"small" | "medium" | "large", string>;
|
|
17
|
-
space: Record<0 | 2 | 1 |
|
|
11
|
+
space: Record<0 | 2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15, string>;
|
|
18
12
|
transition: Record<"medium" | "slow" | "fast", string>;
|
|
19
|
-
opacity: Record<"
|
|
20
|
-
color: Record<"
|
|
13
|
+
opacity: Record<"solid" | "transparent" | "translucent", string | number>;
|
|
14
|
+
color: Record<"neutral" | "red" | "orange" | "yellow" | "green" | "blue", {
|
|
21
15
|
lightest: string;
|
|
22
16
|
lighter: string;
|
|
23
17
|
light: string;
|
|
@@ -33,71 +27,53 @@ export declare const NotificationContentBox: import("styled-components").StyledC
|
|
|
33
27
|
web: string;
|
|
34
28
|
}>;
|
|
35
29
|
fontWeight: Record<"bold" | "book" | "black", string | number>;
|
|
36
|
-
fontSize: Record<"small" | "body" | "label" | "
|
|
30
|
+
fontSize: Record<"small" | "body" | "label" | "lead" | "heading1" | "heading2" | "heading3" | "heading4", {
|
|
37
31
|
small: string | number;
|
|
38
32
|
large: string | number;
|
|
39
33
|
}>;
|
|
40
|
-
lineHeight: Record<"small" | "body" | "label" | "
|
|
34
|
+
lineHeight: Record<"small" | "body" | "label" | "lead" | "heading1" | "heading2" | "heading3" | "heading4", {
|
|
41
35
|
small: string | number;
|
|
42
36
|
large: string | number;
|
|
43
37
|
}>;
|
|
38
|
+
letterSpacing: Record<"base" | "compressed" | "extraCompressed", number>;
|
|
44
39
|
};
|
|
45
40
|
semantic: {
|
|
46
41
|
surface: Record<"base" | "cutout" | "elevated", string>;
|
|
47
42
|
message: Record<"base" | "link" | "error" | "secondary" | "branded", string>;
|
|
48
43
|
border: Record<"graphic" | "differentiated" | "functional", string>;
|
|
49
|
-
focus: Record<"outline" | "
|
|
50
|
-
inverted: Record<"
|
|
44
|
+
focus: Record<"surface" | "outline" | "hover", string>;
|
|
45
|
+
inverted: Record<"border" | "surface", string> & {
|
|
51
46
|
message: Record<"base" | "link" | "secondary" | "branded", string>;
|
|
52
47
|
};
|
|
53
48
|
success: {
|
|
54
49
|
border: string;
|
|
55
50
|
surface: string;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
};
|
|
51
|
+
surfaceEmphasis: string;
|
|
52
|
+
message: string;
|
|
53
|
+
messageOnEmphasis: string;
|
|
60
54
|
};
|
|
61
55
|
warning: {
|
|
62
56
|
border: string;
|
|
63
57
|
surface: string;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
};
|
|
58
|
+
surfaceEmphasis: string;
|
|
59
|
+
message: string;
|
|
60
|
+
messageOnEmphasis: string;
|
|
68
61
|
};
|
|
69
62
|
error: {
|
|
70
63
|
border: string;
|
|
71
64
|
surface: string;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
};
|
|
65
|
+
surfaceEmphasis: string;
|
|
66
|
+
message: string;
|
|
67
|
+
messageOnEmphasis: string;
|
|
76
68
|
};
|
|
77
69
|
info: {
|
|
78
70
|
border: string;
|
|
79
71
|
surface: string;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
electricity: {
|
|
86
|
-
border: string;
|
|
87
|
-
surface: string;
|
|
88
|
-
message: {
|
|
89
|
-
base: string;
|
|
90
|
-
secondary: string;
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
gas: {
|
|
94
|
-
border: string;
|
|
95
|
-
surface: string;
|
|
96
|
-
message: {
|
|
97
|
-
base: string;
|
|
98
|
-
secondary: string;
|
|
99
|
-
};
|
|
72
|
+
surfaceEmphasis: string;
|
|
73
|
+
message: string;
|
|
74
|
+
messageOnEmphasis: string;
|
|
100
75
|
};
|
|
76
|
+
data: Record<"gas" | "branded" | "electric", Record<2 | 1 | 3 | 4, string>>;
|
|
101
77
|
};
|
|
102
78
|
component: {
|
|
103
79
|
heading1: {
|
|
@@ -228,20 +204,42 @@ export declare const NotificationContentBox: import("styled-components").StyledC
|
|
|
228
204
|
backgroundFocused: string;
|
|
229
205
|
};
|
|
230
206
|
};
|
|
207
|
+
badge: {
|
|
208
|
+
variants: {
|
|
209
|
+
red: {
|
|
210
|
+
foreground: string;
|
|
211
|
+
background: string;
|
|
212
|
+
};
|
|
213
|
+
orange: {
|
|
214
|
+
foreground: string;
|
|
215
|
+
background: string;
|
|
216
|
+
};
|
|
217
|
+
yellow: {
|
|
218
|
+
foreground: string;
|
|
219
|
+
background: string;
|
|
220
|
+
};
|
|
221
|
+
green: {
|
|
222
|
+
foreground: string;
|
|
223
|
+
background: string;
|
|
224
|
+
};
|
|
225
|
+
blue: {
|
|
226
|
+
foreground: string;
|
|
227
|
+
background: string;
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
231
|
};
|
|
232
|
-
}, {
|
|
233
|
-
variant: NotificationVariantName | (string & {});
|
|
234
|
-
} & Breakpoints, never>;
|
|
232
|
+
}, {}, never>;
|
|
235
233
|
export declare const NotificationTitleBox: import("styled-components").StyledComponent<typeof import("react-native").View, import("../../theme/theme").Theme & {
|
|
236
234
|
core: {
|
|
237
235
|
radius: Record<"small" | "medium" | "large" | "max", string>;
|
|
238
236
|
borderWidth: Record<"small" | "medium" | "large", string>;
|
|
239
237
|
breakpoint: Record<"small" | "medium" | "large", string | number>;
|
|
240
238
|
mediaQuery: Record<"small" | "medium" | "large", string>;
|
|
241
|
-
space: Record<0 | 2 | 1 |
|
|
239
|
+
space: Record<0 | 2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15, string>;
|
|
242
240
|
transition: Record<"medium" | "slow" | "fast", string>;
|
|
243
|
-
opacity: Record<"
|
|
244
|
-
color: Record<"
|
|
241
|
+
opacity: Record<"solid" | "transparent" | "translucent", string | number>;
|
|
242
|
+
color: Record<"neutral" | "red" | "orange" | "yellow" | "green" | "blue", {
|
|
245
243
|
lightest: string;
|
|
246
244
|
lighter: string;
|
|
247
245
|
light: string;
|
|
@@ -257,71 +255,53 @@ export declare const NotificationTitleBox: import("styled-components").StyledCom
|
|
|
257
255
|
web: string;
|
|
258
256
|
}>;
|
|
259
257
|
fontWeight: Record<"bold" | "book" | "black", string | number>;
|
|
260
|
-
fontSize: Record<"small" | "body" | "label" | "
|
|
258
|
+
fontSize: Record<"small" | "body" | "label" | "lead" | "heading1" | "heading2" | "heading3" | "heading4", {
|
|
261
259
|
small: string | number;
|
|
262
260
|
large: string | number;
|
|
263
261
|
}>;
|
|
264
|
-
lineHeight: Record<"small" | "body" | "label" | "
|
|
262
|
+
lineHeight: Record<"small" | "body" | "label" | "lead" | "heading1" | "heading2" | "heading3" | "heading4", {
|
|
265
263
|
small: string | number;
|
|
266
264
|
large: string | number;
|
|
267
265
|
}>;
|
|
266
|
+
letterSpacing: Record<"base" | "compressed" | "extraCompressed", number>;
|
|
268
267
|
};
|
|
269
268
|
semantic: {
|
|
270
269
|
surface: Record<"base" | "cutout" | "elevated", string>;
|
|
271
270
|
message: Record<"base" | "link" | "error" | "secondary" | "branded", string>;
|
|
272
271
|
border: Record<"graphic" | "differentiated" | "functional", string>;
|
|
273
|
-
focus: Record<"outline" | "
|
|
274
|
-
inverted: Record<"
|
|
272
|
+
focus: Record<"surface" | "outline" | "hover", string>;
|
|
273
|
+
inverted: Record<"border" | "surface", string> & {
|
|
275
274
|
message: Record<"base" | "link" | "secondary" | "branded", string>;
|
|
276
275
|
};
|
|
277
276
|
success: {
|
|
278
277
|
border: string;
|
|
279
278
|
surface: string;
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
};
|
|
279
|
+
surfaceEmphasis: string;
|
|
280
|
+
message: string;
|
|
281
|
+
messageOnEmphasis: string;
|
|
284
282
|
};
|
|
285
283
|
warning: {
|
|
286
284
|
border: string;
|
|
287
285
|
surface: string;
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
};
|
|
286
|
+
surfaceEmphasis: string;
|
|
287
|
+
message: string;
|
|
288
|
+
messageOnEmphasis: string;
|
|
292
289
|
};
|
|
293
290
|
error: {
|
|
294
291
|
border: string;
|
|
295
292
|
surface: string;
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
};
|
|
293
|
+
surfaceEmphasis: string;
|
|
294
|
+
message: string;
|
|
295
|
+
messageOnEmphasis: string;
|
|
300
296
|
};
|
|
301
297
|
info: {
|
|
302
298
|
border: string;
|
|
303
299
|
surface: string;
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
};
|
|
308
|
-
};
|
|
309
|
-
electricity: {
|
|
310
|
-
border: string;
|
|
311
|
-
surface: string;
|
|
312
|
-
message: {
|
|
313
|
-
base: string;
|
|
314
|
-
secondary: string;
|
|
315
|
-
};
|
|
316
|
-
};
|
|
317
|
-
gas: {
|
|
318
|
-
border: string;
|
|
319
|
-
surface: string;
|
|
320
|
-
message: {
|
|
321
|
-
base: string;
|
|
322
|
-
secondary: string;
|
|
323
|
-
};
|
|
300
|
+
surfaceEmphasis: string;
|
|
301
|
+
message: string;
|
|
302
|
+
messageOnEmphasis: string;
|
|
324
303
|
};
|
|
304
|
+
data: Record<"gas" | "branded" | "electric", Record<2 | 1 | 3 | 4, string>>;
|
|
325
305
|
};
|
|
326
306
|
component: {
|
|
327
307
|
heading1: {
|
|
@@ -452,22 +432,46 @@ export declare const NotificationTitleBox: import("styled-components").StyledCom
|
|
|
452
432
|
backgroundFocused: string;
|
|
453
433
|
};
|
|
454
434
|
};
|
|
435
|
+
badge: {
|
|
436
|
+
variants: {
|
|
437
|
+
red: {
|
|
438
|
+
foreground: string;
|
|
439
|
+
background: string;
|
|
440
|
+
};
|
|
441
|
+
orange: {
|
|
442
|
+
foreground: string;
|
|
443
|
+
background: string;
|
|
444
|
+
};
|
|
445
|
+
yellow: {
|
|
446
|
+
foreground: string;
|
|
447
|
+
background: string;
|
|
448
|
+
};
|
|
449
|
+
green: {
|
|
450
|
+
foreground: string;
|
|
451
|
+
background: string;
|
|
452
|
+
};
|
|
453
|
+
blue: {
|
|
454
|
+
foreground: string;
|
|
455
|
+
background: string;
|
|
456
|
+
};
|
|
457
|
+
};
|
|
458
|
+
};
|
|
455
459
|
};
|
|
456
460
|
}, {
|
|
457
|
-
variant: NotificationVariantName
|
|
461
|
+
variant: NotificationVariantName;
|
|
458
462
|
noMargin?: boolean | undefined;
|
|
459
|
-
|
|
460
|
-
}
|
|
461
|
-
export declare const Notification:
|
|
462
|
-
variant?:
|
|
463
|
-
title
|
|
463
|
+
dismissible: boolean;
|
|
464
|
+
}, never>;
|
|
465
|
+
export declare const Notification: import("react").ForwardRefExoticComponent<{
|
|
466
|
+
variant?: NotificationVariantName | undefined;
|
|
467
|
+
title: string;
|
|
464
468
|
noMargin?: boolean | undefined;
|
|
465
469
|
children?: ReactNode;
|
|
466
|
-
|
|
470
|
+
dismissible?: boolean | undefined;
|
|
467
471
|
onDismiss?: (() => void) | undefined;
|
|
468
|
-
} &
|
|
469
|
-
export declare const ErrorNotification:
|
|
470
|
-
export declare const SuccessNotification:
|
|
471
|
-
export declare const InfoNotification:
|
|
472
|
-
export declare const WarningNotification:
|
|
472
|
+
} & import("react").RefAttributes<View>>;
|
|
473
|
+
export declare const ErrorNotification: import("react").ForwardRefExoticComponent<Pick<NotificationProps, "children" | "title" | "key" | "noMargin" | "dismissible" | "onDismiss"> & import("react").RefAttributes<View>>;
|
|
474
|
+
export declare const SuccessNotification: import("react").ForwardRefExoticComponent<Pick<NotificationProps, "children" | "title" | "key" | "noMargin" | "dismissible" | "onDismiss"> & import("react").RefAttributes<View>>;
|
|
475
|
+
export declare const InfoNotification: import("react").ForwardRefExoticComponent<Pick<NotificationProps, "children" | "title" | "key" | "noMargin" | "dismissible" | "onDismiss"> & import("react").RefAttributes<View>>;
|
|
476
|
+
export declare const WarningNotification: import("react").ForwardRefExoticComponent<Pick<NotificationProps, "children" | "title" | "key" | "noMargin" | "dismissible" | "onDismiss"> & import("react").RefAttributes<View>>;
|
|
473
477
|
export {};
|
|
@@ -50,69 +50,52 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
50
50
|
};
|
|
51
51
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
52
|
exports.WarningNotification = exports.InfoNotification = exports.SuccessNotification = exports.ErrorNotification = exports.Notification = exports.NotificationTitleBox = exports.NotificationContentBox = void 0;
|
|
53
|
-
var
|
|
53
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
54
|
+
var react_1 = require("react");
|
|
54
55
|
var react_native_1 = require("react-native");
|
|
55
|
-
var hooks_1 = require("../../hooks");
|
|
56
56
|
var styled_native_1 = __importStar(require("../../styled.native"));
|
|
57
57
|
var Icon_1 = require("../Icon");
|
|
58
|
-
var pxToNumber = function (value) { return parseInt(value.replace('px', '')); };
|
|
59
|
-
var numberToPx = function (value) { return "".concat(value, "px"); };
|
|
60
58
|
var NotificationBox = styled_native_1.default.View(function (_a) {
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
var currentVariant = notification.variants[variant];
|
|
64
|
-
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n border: ", " solid ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n background-color: ", ";\n "], ["\n position: relative;\n border: ", " solid ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n background-color: ", ";\n "])), notification.borderWidth, currentVariant.borderColor, notification.borderRadius, noMargin ? 0 : space[4], colors.canvas);
|
|
59
|
+
var core = _a.theme.core, noMargin = _a.noMargin;
|
|
60
|
+
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n border: ", " solid ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n overflow: hidden;\n "], ["\n position: relative;\n border: ", " solid ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n overflow: hidden;\n "])), core.borderWidth.medium, core.color.brand.white, core.radius.small, noMargin ? 0 : core.space[4]);
|
|
65
61
|
});
|
|
66
62
|
exports.NotificationContentBox = styled_native_1.default.View(function (_a) {
|
|
67
|
-
var
|
|
68
|
-
|
|
69
|
-
var currentVariant = variants[variant];
|
|
70
|
-
return (0, styled_native_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: ", " ", ";\n\n a {\n color: ", ";\n :hover {\n color: ", ";\n }\n }\n ul {\n list-style-type: square;\n }\n li {\n color: ", ";\n }\n "], ["\n padding: ", " ", ";\n\n a {\n color: ", ";\n :hover {\n color: ", ";\n }\n }\n ul {\n list-style-type: square;\n }\n li {\n color: ", ";\n }\n "])), paddingX[smallAndUp ? 1 : 0], paddingY[smallAndUp ? 1 : 0], currentVariant.textColor, colors.body, currentVariant.textColor);
|
|
63
|
+
var core = _a.theme.core;
|
|
64
|
+
return (0, styled_native_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "], ["\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "])), core.color.brand.white, core.space[2], core.space[3], core.space[4], core.space[4]);
|
|
71
65
|
});
|
|
72
66
|
exports.NotificationTitleBox = styled_native_1.default.View(function (_a) {
|
|
73
|
-
var
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "], ["\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "])), currentVariant.background, notification.paddingX[smallAndUp ? 1 : 0], notification.paddingX[smallAndUp ? 1 : 0], notification.paddingY[smallAndUp ? 1 : 0], dismissable
|
|
77
|
-
? numberToPx(pxToNumber(notification.dismiss.touchSize) -
|
|
78
|
-
pxToNumber(notification.dismiss.size))
|
|
79
|
-
: notification.paddingY[smallAndUp ? 1 : 0]);
|
|
67
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, variant = _a.variant, dismissible = _a.dismissible;
|
|
68
|
+
var currentVariant = semantic[variant];
|
|
69
|
+
return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-direction: row;\n align-items: center;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "], ["\n flex-direction: row;\n align-items: center;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "])), currentVariant.surface, core.space[2], core.space[2], core.space[4], dismissible ? core.space[3] : core.space[4]);
|
|
80
70
|
});
|
|
81
71
|
var NotificationTitleText = styled_native_1.default.Text(function (_a) {
|
|
82
|
-
var _b = _a.theme,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return (0, styled_native_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n "], ["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n "])), currentVariant.textColor, fonts.bold, responsiveFontSizes.body[0]);
|
|
72
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, variant = _a.variant;
|
|
73
|
+
var currentVariant = semantic[variant];
|
|
74
|
+
return (0, styled_native_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-size: ", ";\n font-family: ", ";\n color: ", ";\n "], ["\n font-size: ", ";\n font-family: ", ";\n color: ", ";\n "])), core.fontSize.body.small, core.fontFamily.bodyBold.native, currentVariant.message);
|
|
86
75
|
});
|
|
87
|
-
var DismissButton = styled_native_1.default.TouchableOpacity(function (
|
|
88
|
-
|
|
89
|
-
|
|
76
|
+
var DismissButton = styled_native_1.default.TouchableOpacity(function () {
|
|
77
|
+
return (0, styled_native_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: 16px;\n height: 16px;\n margin-left: auto;\n "], ["\n width: 16px;\n height: 16px;\n margin-left: auto;\n "])));
|
|
78
|
+
});
|
|
79
|
+
var StyledIcon = (0, styled_native_1.default)(Icon_1.Icon)(function (_a) {
|
|
80
|
+
var semantic = _a.theme.semantic, variant = _a.variant;
|
|
81
|
+
var currentVariant = semantic[variant];
|
|
82
|
+
return (0, styled_native_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), currentVariant.message);
|
|
90
83
|
});
|
|
91
84
|
exports.Notification = (0, react_1.forwardRef)(function (_a, ref) {
|
|
92
|
-
var _b = _a.variant, variant = _b === void 0 ? 'info' : _b, children = _a.children, title = _a.title, noMargin = _a.noMargin,
|
|
93
|
-
var breakpoints = (0, hooks_1.useBreakpoint)();
|
|
94
|
-
var theme = (0, react_1.useContext)(styled_native_1.ThemeContext);
|
|
85
|
+
var _b = _a.variant, variant = _b === void 0 ? 'info' : _b, children = _a.children, title = _a.title, noMargin = _a.noMargin, dismissible = _a.dismissible, onDismiss = _a.onDismiss, rest = __rest(_a, ["variant", "children", "title", "noMargin", "dismissible", "onDismiss"]);
|
|
95
86
|
var _c = (0, react_1.useState)(false), dismissed = _c[0], setDismissed = _c[1];
|
|
96
|
-
if (dismissed ||
|
|
87
|
+
if (dismissed || !children) {
|
|
97
88
|
return null;
|
|
98
89
|
}
|
|
99
|
-
return (
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
if (onDismiss) {
|
|
106
|
-
onDismiss();
|
|
107
|
-
}
|
|
108
|
-
} },
|
|
109
|
-
react_1.default.createElement(Icon_1.Icon, { name: theme.notification.dismiss.icon, size: theme.notification.dismiss.size,
|
|
110
|
-
// @ts-ignore
|
|
111
|
-
color: theme.notification.variants[variant].textColor }))) : null,
|
|
112
|
-
children ? (react_1.default.createElement(exports.NotificationContentBox, __assign({ "data-testid": "el-notification-box", variant: variant }, breakpoints), children)) : null)));
|
|
90
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, __assign({ ref: ref }, rest, { children: (0, jsx_runtime_1.jsxs)(NotificationBox, __assign({ noMargin: noMargin, testID: "nb-notification" }, { children: [(0, jsx_runtime_1.jsxs)(exports.NotificationTitleBox, __assign({ variant: variant, dismissible: dismissible }, { children: [(0, jsx_runtime_1.jsx)(NotificationTitleText, __assign({ variant: variant }, { children: title })), dismissible ? ((0, jsx_runtime_1.jsx)(DismissButton, __assign({ accessibilityLabel: "Dismiss", testID: "nb-notification-dismiss", onPress: function () {
|
|
91
|
+
setDismissed(true);
|
|
92
|
+
if (onDismiss) {
|
|
93
|
+
onDismiss();
|
|
94
|
+
}
|
|
95
|
+
} }, { children: (0, jsx_runtime_1.jsx)(StyledIcon, { variant: variant, name: "cross", size: "16" }) }))) : null] })), children ? ((0, jsx_runtime_1.jsx)(exports.NotificationContentBox, __assign({ "data-testid": "el-notification-box" }, { children: children }))) : null] })) })));
|
|
113
96
|
});
|
|
114
|
-
exports.ErrorNotification = (0, react_1.forwardRef)(function (props, ref) { return (
|
|
115
|
-
exports.SuccessNotification = (0, react_1.forwardRef)(function (props, ref) { return (
|
|
116
|
-
exports.InfoNotification = (0, react_1.forwardRef)(function (props, ref) { return
|
|
117
|
-
exports.WarningNotification = (0, react_1.forwardRef)(function (props, ref) { return
|
|
118
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
97
|
+
exports.ErrorNotification = (0, react_1.forwardRef)(function (props, ref) { return (0, jsx_runtime_1.jsx)(exports.Notification, __assign({ ref: ref, variant: "error" }, props)); });
|
|
98
|
+
exports.SuccessNotification = (0, react_1.forwardRef)(function (props, ref) { return ((0, jsx_runtime_1.jsx)(exports.Notification, __assign({ ref: ref, variant: "success" }, props))); });
|
|
99
|
+
exports.InfoNotification = (0, react_1.forwardRef)(function (props, ref) { return (0, jsx_runtime_1.jsx)(exports.Notification, __assign({ ref: ref, variant: "info" }, props)); });
|
|
100
|
+
exports.WarningNotification = (0, react_1.forwardRef)(function (props, ref) { return (0, jsx_runtime_1.jsx)(exports.Notification, __assign({ ref: ref, variant: "warning" }, props)); });
|
|
101
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { TouchableOpacity, TouchableOpacityProps } from 'react-native';
|
|
3
|
-
declare const Radio:
|
|
3
|
+
declare const Radio: import("react").ForwardRefExoticComponent<Omit<TouchableOpacityProps, "children"> & {
|
|
4
4
|
label: ReactNode;
|
|
5
5
|
value: string;
|
|
6
6
|
hint?: ReactNode;
|
|
@@ -8,5 +8,5 @@ declare const Radio: React.ForwardRefExoticComponent<Omit<TouchableOpacityProps,
|
|
|
8
8
|
invalid?: boolean | undefined;
|
|
9
9
|
onValueChange?: ((value?: string) => void) | undefined;
|
|
10
10
|
activeOpacity?: number | undefined;
|
|
11
|
-
} &
|
|
11
|
+
} & import("react").RefAttributes<TouchableOpacity>>;
|
|
12
12
|
export { Radio };
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
2
|
var __assign = (this && this.__assign) || function () {
|
|
7
3
|
__assign = Object.assign || function(t) {
|
|
8
4
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -14,29 +10,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
14
10
|
};
|
|
15
11
|
return __assign.apply(this, arguments);
|
|
16
12
|
};
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
-
}) : function(o, v) {
|
|
31
|
-
o["default"] = v;
|
|
32
|
-
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
13
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
41
14
|
var t = {};
|
|
42
15
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -53,60 +26,42 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
53
26
|
};
|
|
54
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
28
|
exports.Radio = void 0;
|
|
56
|
-
var
|
|
29
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
30
|
+
var react_1 = require("react");
|
|
57
31
|
var react_native_1 = require("react-native");
|
|
58
32
|
var styled_native_1 = __importDefault(require("../../styled.native"));
|
|
59
|
-
var utils_1 = require("../../utils");
|
|
60
33
|
var HintText_1 = require("../HintText");
|
|
61
34
|
var LabelText_1 = require("../LabelText");
|
|
62
35
|
var StyledRadioInputWrapper = styled_native_1.default.View(function (_a) {
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
var gap = (0, utils_1.pxToNumber)(radio.gap);
|
|
66
|
-
return "\n width: ".concat(radioSize + gap, "px;\n height: ").concat(radio.touchSize, ";\n ");
|
|
36
|
+
var core = _a.theme.core;
|
|
37
|
+
return "\n width: ".concat(core.space[6], ";\n height: ").concat(core.space[6], ";\n margin-right: 10px;\n ");
|
|
67
38
|
});
|
|
68
39
|
var StyledRadioInput = styled_native_1.default.View(function (_a) {
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
var radioDistance = (touchSize - radioSize) / 2;
|
|
73
|
-
return "\n width: ".concat(radio.size, ";\n height: ").concat(radio.size, ";\n border: ").concat(radio.borderWidth, " solid;\n margin-top: ").concat(radioDistance, "px;\n border-radius: ").concat(radioSize / 2, "px;\n border-color: ").concat(invalid
|
|
74
|
-
? radio.errorColor
|
|
40
|
+
var _b = _a.theme, core = _b.core, semantic = _b.semantic, invalid = _a.invalid, checked = _a.checked;
|
|
41
|
+
return "\n width: ".concat(core.space[6], ";\n height: ").concat(core.space[6], ";\n border: ").concat(core.borderWidth.small, " solid;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n border-color: ").concat(invalid
|
|
42
|
+
? semantic.error.border
|
|
75
43
|
: checked
|
|
76
|
-
?
|
|
77
|
-
:
|
|
44
|
+
? core.color.blue.dark
|
|
45
|
+
: semantic.border.functional, ";\n background: ").concat(checked ? core.color.blue.lightest : 'transparent', ";\n ");
|
|
78
46
|
});
|
|
79
47
|
var StyledRadioInputDot = styled_native_1.default.View(function (_a) {
|
|
80
|
-
var
|
|
81
|
-
|
|
82
|
-
var dotSize = (0, utils_1.pxToNumber)(radio.dotSize);
|
|
83
|
-
var borderWidth = (0, utils_1.pxToNumber)(radio.borderWidth);
|
|
84
|
-
var dotDistance = (radioSize - dotSize) / 2 - borderWidth;
|
|
85
|
-
return "\n width: ".concat(radio.dotSize, ";\n height: ").concat(radio.dotSize, ";\n margin: ").concat(dotDistance, "px;\n border-radius: ").concat(radioSize / 2, "px;\n background: ").concat(radio.dotColor, ";\n opacity: ").concat(checked ? 1 : 0, ";\n ");
|
|
48
|
+
var core = _a.theme.core, checked = _a.checked;
|
|
49
|
+
return "\n width: ".concat(core.space[3], ";\n height: ").concat(core.space[3], ";\n border-radius: 50%;\n background: ").concat(core.color.blue.dark, ";\n opacity: ").concat(checked ? 1 : 0, ";\n ");
|
|
86
50
|
});
|
|
87
51
|
var Input = function (_a) {
|
|
88
52
|
var checked = _a.checked, invalid = _a.invalid, testID = _a.testID, rest = __rest(_a, ["checked", "invalid", "testID"]);
|
|
89
|
-
return (
|
|
90
|
-
react_1.default.createElement(StyledRadioInput, { invalid: invalid, checked: checked, testID: testID },
|
|
91
|
-
react_1.default.createElement(StyledRadioInputDot, { checked: checked }))));
|
|
53
|
+
return ((0, jsx_runtime_1.jsx)(StyledRadioInputWrapper, __assign({}, rest, { children: (0, jsx_runtime_1.jsx)(StyledRadioInput, __assign({ invalid: invalid, checked: checked, testID: testID }, { children: (0, jsx_runtime_1.jsx)(StyledRadioInputDot, { checked: checked }) })) })));
|
|
92
54
|
};
|
|
93
|
-
var
|
|
94
|
-
var
|
|
95
|
-
return "\n padding-top: ".concat(space[3], ";\n ");
|
|
55
|
+
var StyledWrapper = styled_native_1.default.View(function (_a) {
|
|
56
|
+
var core = _a.theme.core;
|
|
57
|
+
return "\n padding-top: ".concat(core.space[3], ";\n flex-direction: row;\n ");
|
|
96
58
|
});
|
|
97
|
-
var StyledWrapper = styled_native_1.default.View(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n"], ["\n flex-direction: row;\n"])));
|
|
98
59
|
var Radio = (0, react_1.forwardRef)(function (_a, ref) {
|
|
99
60
|
var label = _a.label, hint = _a.hint, checked = _a.checked, invalid = _a.invalid,
|
|
100
61
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
101
62
|
value = _a.value, // "value" is needed for RadioGroup, but isn't actually used in the radio anywhere
|
|
102
63
|
_b = _a.activeOpacity, // "value" is needed for RadioGroup, but isn't actually used in the radio anywhere
|
|
103
64
|
activeOpacity = _b === void 0 ? 0.8 : _b, testID = _a.testID, rest = __rest(_a, ["label", "hint", "checked", "invalid", "value", "activeOpacity", "testID"]);
|
|
104
|
-
return (
|
|
105
|
-
react_1.default.createElement(StyledWrapper, null,
|
|
106
|
-
react_1.default.createElement(Input, { checked: checked, invalid: invalid, testID: testID }),
|
|
107
|
-
react_1.default.createElement(react_native_1.View, { style: { flexShrink: 1 } },
|
|
108
|
-
react_1.default.createElement(RadioLabelText, null, label),
|
|
109
|
-
hint ? react_1.default.createElement(HintText_1.HintText, null, hint) : null))));
|
|
65
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, __assign({ ref: ref, accessibilityRole: "radio", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest, { children: (0, jsx_runtime_1.jsxs)(StyledWrapper, { children: [(0, jsx_runtime_1.jsx)(Input, { checked: checked, invalid: invalid, testID: testID }), (0, jsx_runtime_1.jsxs)(react_native_1.View, __assign({ style: { flexShrink: 1 } }, { children: [(0, jsx_runtime_1.jsx)(LabelText_1.LabelText, { children: label }), hint ? (0, jsx_runtime_1.jsx)(HintText_1.HintText, { children: hint }) : null] }))] }) })));
|
|
110
66
|
});
|
|
111
67
|
exports.Radio = Radio;
|
|
112
|
-
var templateObject_1;
|