@ovotech/element-native 2.2.0-canary-668a0ee-91 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion/Accordion.d.ts +2 -2
- package/dist/components/Accordion/Accordion.js +24 -21
- package/dist/components/Accordion/Group.js +32 -10
- package/dist/components/Accordion/Icon.js +14 -19
- package/dist/components/Accordion/hooks.d.ts +1 -1
- package/dist/components/Accordion/hooks.js +26 -3
- package/dist/components/Accordion/styles.d.ts +46 -688
- package/dist/components/Accordion/styles.js +49 -56
- package/dist/components/Badge/Badge.d.ts +46 -54
- package/dist/components/Badge/Badge.js +20 -35
- package/dist/components/CTAButton/CTAButton.d.ts +12 -7
- package/dist/components/CTAButton/CTAButton.js +27 -23
- package/dist/components/CTALink/CTALink.d.ts +4 -4
- package/dist/components/CTALink/CTALink.js +27 -5
- package/dist/components/Card/Card.d.ts +45 -47
- package/dist/components/Card/Card.js +25 -5
- package/dist/components/Checkbox/Checkbox.d.ts +3 -3
- package/dist/components/Checkbox/Checkbox.js +57 -18
- package/dist/components/Checkbox/CheckboxField.js +37 -7
- package/dist/components/DataTable/DataTable.d.ts +12 -3
- package/dist/components/DataTable/DataTable.js +98 -11
- package/dist/components/DataTable/index.d.ts +0 -2
- package/dist/components/DataTable/index.js +0 -16
- package/dist/components/DateField/DateField.d.ts +2 -2
- package/dist/components/DateField/DateField.js +28 -9
- package/dist/components/DescriptionList/DescriptionList.js +32 -8
- package/dist/components/DescriptionList/styled.d.ts +44 -50
- package/dist/components/DescriptionList/styled.js +34 -9
- package/dist/components/Disclosure/Disclosure.d.ts +3 -3
- package/dist/components/Disclosure/Disclosure.js +18 -12
- package/dist/components/Divider/Divider.js +7 -4
- package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.d.ts +1 -1
- package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.js +28 -6
- package/dist/components/ErrorText/ErrorText.d.ts +39 -45
- package/dist/components/ErrorText/ErrorText.js +4 -7
- package/dist/components/Field/Field.d.ts +2 -2
- package/dist/components/Field/Field.js +49 -18
- package/dist/components/FormGroup/FormGroup.js +3 -2
- package/dist/components/Grid/Col.d.ts +39 -45
- package/dist/components/Grid/Col.js +3 -4
- package/dist/components/Grid/Row.d.ts +41 -47
- package/dist/components/Grid/Row.js +10 -7
- package/dist/components/Heading/Heading.js +32 -21
- package/dist/components/HintText/HintText.d.ts +39 -45
- package/dist/components/HintText/HintText.js +4 -7
- package/dist/components/Icon/Icon.d.ts +4 -3
- package/dist/components/Icon/Icon.js +27 -5
- package/dist/components/Input/CurrencyInput.d.ts +6 -6
- package/dist/components/Input/CurrencyInput.js +25 -3
- package/dist/components/Input/EmailInput.d.ts +6 -6
- package/dist/components/Input/EmailInput.js +25 -3
- package/dist/components/Input/Input.d.ts +8 -8
- package/dist/components/Input/Input.js +32 -26
- package/dist/components/Input/NumberInput.d.ts +6 -6
- package/dist/components/Input/NumberInput.js +25 -3
- package/dist/components/Input/PasswordInput.d.ts +6 -6
- package/dist/components/Input/PasswordInput.js +25 -3
- package/dist/components/Input/PasswordInput.styled.d.ts +39 -45
- package/dist/components/Input/PasswordInput.styled.js +5 -2
- package/dist/components/Input/PasswordVisibilityToggle.js +29 -14
- package/dist/components/Input/TelInput.d.ts +10 -0
- package/dist/components/Input/TelInput.js +41 -0
- package/dist/components/Input/TextInput.d.ts +6 -6
- package/dist/components/Input/TextInput.js +25 -3
- package/dist/components/Input/TextareaInput.d.ts +6 -6
- package/dist/components/Input/TextareaInput.js +10 -13
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/Input/index.js +3 -3
- package/dist/components/LabelText/LabelText.d.ts +39 -45
- package/dist/components/LabelText/LabelText.js +4 -5
- package/dist/components/List/List.d.ts +131 -149
- package/dist/components/List/List.js +44 -30
- package/dist/components/Margin/Margin.d.ts +39 -45
- package/dist/components/Margin/Margin.js +3 -3
- package/dist/components/NavHeader/NavHeader.d.ts +1 -1
- package/dist/components/NavHeader/NavHeader.js +35 -34
- package/dist/components/Notification/Notification.d.ts +100 -104
- package/dist/components/Notification/Notification.js +49 -32
- package/dist/components/Radio/Radio.d.ts +3 -3
- package/dist/components/Radio/Radio.js +61 -16
- package/dist/components/Radio/RadioField.js +41 -11
- package/dist/components/SkeletonLoading/Skeleton.d.ts +39 -45
- package/dist/components/SkeletonLoading/SkeletonAnimation.js +33 -22
- package/dist/components/SkeletonLoading/SkeletonCTA.js +5 -4
- package/dist/components/SkeletonLoading/SkeletonCircle.js +6 -4
- package/dist/components/SkeletonLoading/SkeletonHeading.js +5 -4
- package/dist/components/SkeletonLoading/SkeletonText.js +5 -5
- package/dist/components/Stack/Stack.js +28 -6
- package/dist/components/Stretch/Stretch.js +2 -2
- package/dist/components/SubLabelText/SubLabelText.d.ts +39 -45
- package/dist/components/SubLabelText/SubLabelText.js +4 -5
- package/dist/components/SummaryList/SummaryList.js +32 -8
- package/dist/components/Tabs/Tab.d.ts +4 -4
- package/dist/components/Tabs/Tab.js +20 -23
- package/dist/components/Tabs/TabList.d.ts +222 -11
- package/dist/components/Tabs/TabList.js +18 -22
- package/dist/components/Tabs/TabPanel.js +10 -33
- package/dist/components/Tabs/Tabs.d.ts +227 -8
- package/dist/components/Tabs/Tabs.js +23 -26
- package/dist/components/Text/Text.d.ts +204 -234
- package/dist/components/Text/Text.js +20 -17
- package/dist/components/TextField/CurrencyField.d.ts +6 -6
- package/dist/components/TextField/CurrencyField.js +26 -3
- package/dist/components/TextField/EmailField.d.ts +6 -6
- package/dist/components/TextField/EmailField.js +26 -3
- package/dist/components/TextField/NumberField.d.ts +6 -6
- package/dist/components/TextField/NumberField.js +26 -3
- package/dist/components/TextField/PasswordField.d.ts +6 -6
- package/dist/components/TextField/PasswordField.js +26 -3
- package/dist/components/TextField/TelField.d.ts +6 -10
- package/dist/components/TextField/TelField.js +27 -9
- package/dist/components/TextField/TextField.d.ts +6 -6
- package/dist/components/TextField/TextField.js +26 -3
- package/dist/components/TextField/TextareaField.d.ts +6 -6
- package/dist/components/TextField/TextareaField.js +26 -3
- package/dist/components/TextField/index.d.ts +0 -1
- package/dist/components/TextField/index.js +1 -3
- package/dist/components/TextLink/TextLink.d.ts +4 -4
- package/dist/components/TextLink/TextLink.js +8 -5
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.js +0 -1
- package/dist/esm/components/Accordion/Accordion.js +26 -23
- package/dist/esm/components/Accordion/Group.js +9 -10
- package/dist/esm/components/Accordion/Icon.js +12 -20
- package/dist/esm/components/Accordion/hooks.js +3 -3
- package/dist/esm/components/Accordion/styles.js +48 -29
- package/dist/esm/components/Badge/Badge.js +17 -35
- package/dist/esm/components/CTAButton/CTAButton.js +28 -24
- package/dist/esm/components/CTALink/CTALink.js +4 -5
- package/dist/esm/components/Card/Card.js +25 -5
- package/dist/esm/components/Checkbox/Checkbox.js +34 -15
- package/dist/esm/components/Checkbox/CheckboxField.js +14 -7
- package/dist/esm/components/DataTable/DataTable.js +74 -10
- package/dist/esm/components/DataTable/index.js +0 -2
- package/dist/esm/components/DateField/DateField.js +28 -9
- package/dist/esm/components/DescriptionList/DescriptionList.js +9 -8
- package/dist/esm/components/DescriptionList/styled.js +31 -9
- package/dist/esm/components/Disclosure/Disclosure.js +19 -13
- package/dist/esm/components/Divider/Divider.js +4 -4
- package/dist/esm/components/ErrorSummaryNotification/ErrorSummaryNotification.js +5 -6
- package/dist/esm/components/ErrorText/ErrorText.js +4 -7
- package/dist/esm/components/Field/Field.js +26 -18
- package/dist/esm/components/FormGroup/FormGroup.js +3 -2
- package/dist/esm/components/Grid/Col.js +3 -4
- package/dist/esm/components/Grid/Row.js +7 -7
- package/dist/esm/components/Heading/Heading.js +29 -21
- package/dist/esm/components/HintText/HintText.js +4 -7
- package/dist/esm/components/Icon/Icon.js +4 -5
- package/dist/esm/components/Input/CurrencyInput.js +2 -3
- package/dist/esm/components/Input/EmailInput.js +2 -3
- package/dist/esm/components/Input/Input.js +33 -27
- package/dist/esm/components/Input/NumberInput.js +2 -3
- package/dist/esm/components/Input/PasswordInput.js +2 -3
- package/dist/esm/components/Input/PasswordInput.styled.js +5 -2
- package/dist/esm/components/Input/PasswordVisibilityToggle.js +7 -15
- package/dist/esm/components/Input/{PhoneInput.js → TelInput.js} +3 -4
- package/dist/esm/components/Input/TextInput.js +2 -3
- package/dist/esm/components/Input/TextareaInput.js +10 -13
- package/dist/esm/components/Input/index.js +1 -1
- package/dist/esm/components/LabelText/LabelText.js +4 -5
- package/dist/esm/components/List/List.js +45 -31
- package/dist/esm/components/Margin/Margin.js +3 -3
- package/dist/esm/components/NavHeader/NavHeader.js +32 -34
- package/dist/esm/components/Notification/Notification.js +50 -33
- package/dist/esm/components/Radio/Radio.js +38 -16
- package/dist/esm/components/Radio/RadioField.js +18 -11
- package/dist/esm/components/SkeletonLoading/SkeletonAnimation.js +11 -23
- package/dist/esm/components/SkeletonLoading/SkeletonCTA.js +5 -4
- package/dist/esm/components/SkeletonLoading/SkeletonCircle.js +6 -4
- package/dist/esm/components/SkeletonLoading/SkeletonHeading.js +5 -4
- package/dist/esm/components/SkeletonLoading/SkeletonText.js +5 -5
- package/dist/esm/components/Stack/Stack.js +5 -6
- package/dist/esm/components/Stretch/Stretch.js +2 -2
- package/dist/esm/components/SubLabelText/SubLabelText.js +4 -5
- package/dist/esm/components/SummaryList/SummaryList.js +9 -8
- package/dist/esm/components/Tabs/Tab.js +17 -23
- package/dist/esm/components/Tabs/TabList.js +18 -21
- package/dist/esm/components/Tabs/TabPanel.js +7 -10
- package/dist/esm/components/Tabs/Tabs.js +23 -25
- package/dist/esm/components/Text/Text.js +20 -17
- 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/TelField.js +4 -9
- 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 +0 -1
- package/dist/esm/components/TextLink/TextLink.js +8 -5
- package/dist/esm/components/index.js +0 -1
- package/dist/esm/hooks/use-breakpoint.js +4 -4
- package/dist/esm/providers/IconsProvider.js +2 -3
- package/dist/esm/providers/icons/ArrowDown.js +3 -2
- package/dist/esm/providers/icons/ArrowLeft.js +3 -2
- package/dist/esm/providers/icons/ArrowRight.js +3 -2
- package/dist/esm/providers/icons/ArrowUp.js +3 -2
- package/dist/esm/providers/icons/CaretDown.js +3 -2
- package/dist/esm/providers/icons/CaretLeft.js +3 -2
- package/dist/esm/providers/icons/CaretRight.js +3 -2
- package/dist/esm/providers/icons/CaretUp.js +3 -2
- package/dist/esm/providers/icons/Chart.js +3 -2
- package/dist/esm/providers/icons/Check.js +3 -2
- package/dist/esm/providers/icons/ChevronDown.js +3 -2
- package/dist/esm/providers/icons/ChevronLeft.js +3 -2
- package/dist/esm/providers/icons/ChevronLeftSmall.js +3 -2
- package/dist/esm/providers/icons/ChevronLeftSmallFirst.js +3 -2
- package/dist/esm/providers/icons/ChevronRight.js +3 -2
- package/dist/esm/providers/icons/ChevronRightSmall.js +3 -2
- package/dist/esm/providers/icons/ChevronRightSmallLast.js +3 -2
- package/dist/esm/providers/icons/ChevronUp.js +3 -2
- package/dist/esm/providers/icons/Cross.js +3 -2
- package/dist/esm/providers/icons/Dollar.js +3 -2
- package/dist/esm/providers/icons/Download.js +3 -2
- package/dist/esm/providers/icons/Electricity.js +3 -2
- package/dist/esm/providers/icons/Euro.js +3 -2
- package/dist/esm/providers/icons/Gas.js +4 -2
- package/dist/esm/providers/icons/Help.js +3 -2
- package/dist/esm/providers/icons/Hide.js +3 -2
- package/dist/esm/providers/icons/Home.js +3 -2
- package/dist/esm/providers/icons/Info.js +3 -2
- package/dist/esm/providers/icons/Link.js +4 -2
- package/dist/esm/providers/icons/Logo.js +4 -3
- package/dist/esm/providers/icons/Minus.js +3 -2
- package/dist/esm/providers/icons/NewWindow.js +3 -2
- package/dist/esm/providers/icons/PaymentCard.js +3 -2
- package/dist/esm/providers/icons/Plus.js +3 -2
- package/dist/esm/providers/icons/Pound.js +3 -2
- package/dist/esm/providers/icons/Search.js +3 -2
- package/dist/esm/providers/icons/Show.js +3 -2
- package/dist/esm/providers/icons/User.js +3 -2
- package/dist/esm/theme/create-theme.js +153 -0
- package/dist/esm/utils/utils.js +3 -7
- package/dist/hooks/use-breakpoint.js +4 -4
- package/dist/providers/IconsProvider.js +25 -3
- package/dist/providers/icons/ArrowDown.js +6 -2
- package/dist/providers/icons/ArrowLeft.js +6 -2
- package/dist/providers/icons/ArrowRight.js +6 -2
- package/dist/providers/icons/ArrowUp.js +6 -2
- package/dist/providers/icons/CaretDown.js +6 -2
- package/dist/providers/icons/CaretLeft.js +6 -2
- package/dist/providers/icons/CaretRight.js +6 -2
- package/dist/providers/icons/CaretUp.js +6 -2
- package/dist/providers/icons/Chart.js +6 -2
- package/dist/providers/icons/Check.js +6 -2
- package/dist/providers/icons/ChevronDown.js +6 -2
- package/dist/providers/icons/ChevronLeft.js +6 -2
- package/dist/providers/icons/ChevronLeftSmall.js +6 -2
- package/dist/providers/icons/ChevronLeftSmallFirst.js +6 -2
- package/dist/providers/icons/ChevronRight.js +6 -2
- package/dist/providers/icons/ChevronRightSmall.js +6 -2
- package/dist/providers/icons/ChevronRightSmallLast.js +6 -2
- package/dist/providers/icons/ChevronUp.js +6 -2
- package/dist/providers/icons/Cross.js +6 -2
- package/dist/providers/icons/Dollar.js +6 -2
- package/dist/providers/icons/Download.js +6 -2
- package/dist/providers/icons/Electricity.js +6 -2
- package/dist/providers/icons/Euro.js +6 -2
- package/dist/providers/icons/Gas.js +7 -2
- package/dist/providers/icons/Help.js +6 -2
- package/dist/providers/icons/Hide.js +6 -2
- package/dist/providers/icons/Home.js +6 -2
- package/dist/providers/icons/Info.js +6 -2
- package/dist/providers/icons/Link.js +7 -2
- package/dist/providers/icons/Logo.js +6 -2
- package/dist/providers/icons/Minus.js +6 -2
- package/dist/providers/icons/NewWindow.js +6 -2
- package/dist/providers/icons/PaymentCard.js +6 -2
- package/dist/providers/icons/Plus.js +6 -2
- package/dist/providers/icons/Pound.js +6 -2
- package/dist/providers/icons/Search.js +6 -2
- package/dist/providers/icons/Show.js +6 -2
- package/dist/providers/icons/User.js +6 -2
- package/dist/styled.native.d.ts +234 -270
- package/dist/theme/create-theme.js +153 -0
- package/dist/theme/index.d.ts +39 -45
- package/dist/theme/theme.d.ts +90 -0
- package/dist/utils/utils.d.ts +4 -5
- package/dist/utils/utils.js +26 -8
- package/package.json +5 -6
- package/dist/components/DataTable/TableRow.d.ts +0 -2
- package/dist/components/DataTable/TableRow.js +0 -31
- package/dist/components/DataTable/styles.d.ts +0 -2517
- package/dist/components/DataTable/styles.js +0 -77
- package/dist/components/DataTable/types.d.ts +0 -15
- package/dist/components/DataTable/types.js +0 -2
- package/dist/components/Input/PhoneInput.d.ts +0 -10
- package/dist/components/Input/PhoneInput.js +0 -19
- package/dist/components/SelectField/Select.d.ts +0 -244
- package/dist/components/SelectField/Select.js +0 -102
- package/dist/components/SelectField/SelectField.d.ts +0 -7
- package/dist/components/SelectField/SelectField.js +0 -33
- package/dist/components/SelectField/index.d.ts +0 -1
- package/dist/components/SelectField/index.js +0 -5
- package/dist/components/TextField/PhoneField.d.ts +0 -10
- package/dist/components/TextField/PhoneField.js +0 -33
- package/dist/esm/components/DataTable/TableRow.js +0 -27
- package/dist/esm/components/DataTable/styles.js +0 -51
- package/dist/esm/components/DataTable/types.js +0 -1
- package/dist/esm/components/SelectField/Select.js +0 -75
- package/dist/esm/components/SelectField/SelectField.js +0 -29
- package/dist/esm/components/SelectField/index.js +0 -1
- package/dist/esm/components/TextField/PhoneField.js +0 -30
|
@@ -210,6 +210,73 @@ function createTheme(customTheme, additional) {
|
|
|
210
210
|
borderColor: colors.borderMuted,
|
|
211
211
|
padding: [space[3], space[6], space[9]],
|
|
212
212
|
},
|
|
213
|
+
badge: {
|
|
214
|
+
fontFamily: fonts.bold,
|
|
215
|
+
lineHeight: lineHeights.standard,
|
|
216
|
+
paddingHorizontal: space[2],
|
|
217
|
+
borderRadius: radii.small,
|
|
218
|
+
fontSize: responsiveFontSizes.body,
|
|
219
|
+
variants: {
|
|
220
|
+
default: {
|
|
221
|
+
background: colors.primaryMuted,
|
|
222
|
+
foreground: colors.primaryAlt,
|
|
223
|
+
},
|
|
224
|
+
error: {
|
|
225
|
+
background: colors.errorMuted,
|
|
226
|
+
foreground: colors.errorAlt,
|
|
227
|
+
},
|
|
228
|
+
success: {
|
|
229
|
+
background: colors.successMuted,
|
|
230
|
+
foreground: colors.successAlt,
|
|
231
|
+
},
|
|
232
|
+
info: {
|
|
233
|
+
background: colors.infoMuted,
|
|
234
|
+
foreground: colors.infoAlt,
|
|
235
|
+
},
|
|
236
|
+
warning: {
|
|
237
|
+
background: colors.warningMuted,
|
|
238
|
+
foreground: colors.warningAlt,
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
cta: {
|
|
243
|
+
fontSize: responsiveFontSizes.body,
|
|
244
|
+
fontFamily: fonts.bold,
|
|
245
|
+
lineHeight: lineHeights.standard,
|
|
246
|
+
paddingVertical: space[2],
|
|
247
|
+
paddingHorizontal: space[3],
|
|
248
|
+
borderRadius: radii.small,
|
|
249
|
+
borderWidth: borderWidths.standard,
|
|
250
|
+
iconGap: space[1],
|
|
251
|
+
minHeight: space[11],
|
|
252
|
+
variants: {
|
|
253
|
+
primary: {
|
|
254
|
+
background: colors.primary,
|
|
255
|
+
foreground: colors.primaryContrast,
|
|
256
|
+
border: colors.primary,
|
|
257
|
+
},
|
|
258
|
+
secondary: {
|
|
259
|
+
background: colors.primaryContrast,
|
|
260
|
+
foreground: colors.primary,
|
|
261
|
+
border: colors.primary,
|
|
262
|
+
},
|
|
263
|
+
destructive: {
|
|
264
|
+
background: colors.error,
|
|
265
|
+
foreground: colors.errorContrast,
|
|
266
|
+
border: colors.error,
|
|
267
|
+
},
|
|
268
|
+
missionPrimary: {
|
|
269
|
+
background: colors.mission,
|
|
270
|
+
foreground: colors.missionContrast,
|
|
271
|
+
border: colors.mission,
|
|
272
|
+
},
|
|
273
|
+
missionSecondary: {
|
|
274
|
+
background: colors.primaryContrast,
|
|
275
|
+
foreground: colors.primary,
|
|
276
|
+
border: colors.primary,
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
},
|
|
213
280
|
checkbox: {
|
|
214
281
|
touchSize: space[11],
|
|
215
282
|
size: space[6],
|
|
@@ -224,6 +291,41 @@ function createTheme(customTheme, additional) {
|
|
|
224
291
|
checkColor: colors.info,
|
|
225
292
|
errorColor: colors.error,
|
|
226
293
|
},
|
|
294
|
+
notification: {
|
|
295
|
+
borderRadius: radii.small,
|
|
296
|
+
borderWidth: borderWidths.heavy,
|
|
297
|
+
borderColor: colors.error,
|
|
298
|
+
background: colors.errorMuted,
|
|
299
|
+
paddingX: [space[2], space[2]],
|
|
300
|
+
paddingY: [space[3], space[6]],
|
|
301
|
+
dismiss: {
|
|
302
|
+
touchSize: space[6],
|
|
303
|
+
size: space[4],
|
|
304
|
+
icon: 'cross',
|
|
305
|
+
},
|
|
306
|
+
variants: {
|
|
307
|
+
error: {
|
|
308
|
+
borderColor: colors.errorMuted,
|
|
309
|
+
background: colors.errorMuted,
|
|
310
|
+
textColor: colors.errorAlt,
|
|
311
|
+
},
|
|
312
|
+
success: {
|
|
313
|
+
borderColor: colors.successMuted,
|
|
314
|
+
background: colors.successMuted,
|
|
315
|
+
textColor: colors.successAlt,
|
|
316
|
+
},
|
|
317
|
+
info: {
|
|
318
|
+
borderColor: colors.infoMuted,
|
|
319
|
+
background: colors.infoMuted,
|
|
320
|
+
textColor: colors.infoAlt,
|
|
321
|
+
},
|
|
322
|
+
warning: {
|
|
323
|
+
borderColor: colors.warningMuted,
|
|
324
|
+
background: colors.warningMuted,
|
|
325
|
+
textColor: colors.warningAlt,
|
|
326
|
+
},
|
|
327
|
+
},
|
|
328
|
+
},
|
|
227
329
|
text: {
|
|
228
330
|
fontFamily: fonts.body,
|
|
229
331
|
lineHeight: 1,
|
|
@@ -324,6 +426,33 @@ function createTheme(customTheme, additional) {
|
|
|
324
426
|
iconGap: [space[1], space[2]],
|
|
325
427
|
panelGap: [space[2], space[3]],
|
|
326
428
|
},
|
|
429
|
+
dataTable: {
|
|
430
|
+
borderWidth: borderWidths.standard,
|
|
431
|
+
borderRadius: radii.small,
|
|
432
|
+
borderColor: colors.canvasMuted,
|
|
433
|
+
responsivePadding: {
|
|
434
|
+
vertical: [space[2], space[3]],
|
|
435
|
+
horizontal: [space[1], space[1]],
|
|
436
|
+
},
|
|
437
|
+
tableHeader: {
|
|
438
|
+
color: colors.heading,
|
|
439
|
+
backgroundColor: colors.canvas,
|
|
440
|
+
borderWidth: borderWidths.standard,
|
|
441
|
+
borderColor: colors.border,
|
|
442
|
+
fontFamily: fonts.bold,
|
|
443
|
+
},
|
|
444
|
+
tableCaption: {
|
|
445
|
+
color: colors.heading,
|
|
446
|
+
fontFamily: fonts.bold,
|
|
447
|
+
},
|
|
448
|
+
tableCell: {
|
|
449
|
+
color: colors.body,
|
|
450
|
+
},
|
|
451
|
+
tableRow: {
|
|
452
|
+
backgroundColor: colors.canvas,
|
|
453
|
+
stripeColor: colors.canvasMuted,
|
|
454
|
+
},
|
|
455
|
+
},
|
|
327
456
|
accordion: {
|
|
328
457
|
header: {
|
|
329
458
|
color: colors.primary,
|
|
@@ -332,6 +461,30 @@ function createTheme(customTheme, additional) {
|
|
|
332
461
|
iconGap: space[3],
|
|
333
462
|
},
|
|
334
463
|
},
|
|
464
|
+
tabs: {
|
|
465
|
+
tab: {
|
|
466
|
+
borderTopWidth: borderWidths.heavy,
|
|
467
|
+
borderBottomWidth: borderWidths.heavy,
|
|
468
|
+
borderColor: colors.canvas,
|
|
469
|
+
fontSize: responsiveFontSizes.body,
|
|
470
|
+
fontFamily: fonts.bold,
|
|
471
|
+
lineHeight: lineHeights.standard,
|
|
472
|
+
paddingHorizontal: [space[4], space[4]],
|
|
473
|
+
paddingVertical: [space[3], space[3]],
|
|
474
|
+
active: {
|
|
475
|
+
borderColor: colors.primary,
|
|
476
|
+
foregroundColor: colors.primary,
|
|
477
|
+
backgroundColor: colors.canvas,
|
|
478
|
+
},
|
|
479
|
+
inactive: {
|
|
480
|
+
foregroundColor: colors.heading,
|
|
481
|
+
backgroundColor: colors.canvas,
|
|
482
|
+
},
|
|
483
|
+
hover: {
|
|
484
|
+
foregroundColor: colors.primaryAlt,
|
|
485
|
+
},
|
|
486
|
+
},
|
|
487
|
+
},
|
|
335
488
|
}, theme, mergeOptions);
|
|
336
489
|
}
|
|
337
490
|
exports.createTheme = createTheme;
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -5,10 +5,10 @@ export declare const theme: import("./theme").Theme & {
|
|
|
5
5
|
borderWidth: Record<"small" | "medium" | "large", string>;
|
|
6
6
|
breakpoint: Record<"small" | "medium" | "large", string | number>;
|
|
7
7
|
mediaQuery: Record<"small" | "medium" | "large", string>;
|
|
8
|
-
space: Record<0 | 2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|
|
8
|
+
space: Record<0 | 2 | 1 | 10 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15, string>;
|
|
9
9
|
transition: Record<"medium" | "slow" | "fast", string>;
|
|
10
|
-
opacity: Record<"
|
|
11
|
-
color: Record<"
|
|
10
|
+
opacity: Record<"transparent" | "translucent" | "solid", string | number>;
|
|
11
|
+
color: Record<"sand" | "red" | "orange" | "yellow" | "lime" | "green" | "teal" | "blue" | "purple", {
|
|
12
12
|
lightest: string;
|
|
13
13
|
lighter: string;
|
|
14
14
|
light: string;
|
|
@@ -24,53 +24,71 @@ export declare const theme: import("./theme").Theme & {
|
|
|
24
24
|
web: string;
|
|
25
25
|
}>;
|
|
26
26
|
fontWeight: Record<"bold" | "book" | "black", string | number>;
|
|
27
|
-
fontSize: Record<"small" | "body" | "label" | "
|
|
27
|
+
fontSize: Record<"small" | "body" | "label" | "heading1" | "heading2" | "heading3" | "heading4" | "lead", {
|
|
28
28
|
small: string | number;
|
|
29
29
|
large: string | number;
|
|
30
30
|
}>;
|
|
31
|
-
lineHeight: Record<"small" | "body" | "label" | "
|
|
31
|
+
lineHeight: Record<"small" | "body" | "label" | "heading1" | "heading2" | "heading3" | "heading4" | "lead", {
|
|
32
32
|
small: string | number;
|
|
33
33
|
large: string | number;
|
|
34
34
|
}>;
|
|
35
|
-
letterSpacing: Record<"base" | "compressed" | "extraCompressed", number>;
|
|
36
35
|
};
|
|
37
36
|
semantic: {
|
|
38
37
|
surface: Record<"base" | "cutout" | "elevated", string>;
|
|
39
38
|
message: Record<"base" | "link" | "error" | "secondary" | "branded", string>;
|
|
40
39
|
border: Record<"graphic" | "differentiated" | "functional", string>;
|
|
41
|
-
focus: Record<"
|
|
42
|
-
inverted: Record<"
|
|
40
|
+
focus: Record<"outline" | "surface", string>;
|
|
41
|
+
inverted: Record<"surface" | "border", string> & {
|
|
43
42
|
message: Record<"base" | "link" | "secondary" | "branded", string>;
|
|
44
43
|
};
|
|
45
44
|
success: {
|
|
46
45
|
border: string;
|
|
47
46
|
surface: string;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
message: {
|
|
48
|
+
base: string;
|
|
49
|
+
secondary: string;
|
|
50
|
+
};
|
|
51
51
|
};
|
|
52
52
|
warning: {
|
|
53
53
|
border: string;
|
|
54
54
|
surface: string;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
message: {
|
|
56
|
+
base: string;
|
|
57
|
+
secondary: string;
|
|
58
|
+
};
|
|
58
59
|
};
|
|
59
60
|
error: {
|
|
60
61
|
border: string;
|
|
61
62
|
surface: string;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
message: {
|
|
64
|
+
base: string;
|
|
65
|
+
secondary: string;
|
|
66
|
+
};
|
|
65
67
|
};
|
|
66
68
|
info: {
|
|
67
69
|
border: string;
|
|
68
70
|
surface: string;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
message: {
|
|
72
|
+
base: string;
|
|
73
|
+
secondary: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
electricity: {
|
|
77
|
+
border: string;
|
|
78
|
+
surface: string;
|
|
79
|
+
message: {
|
|
80
|
+
base: string;
|
|
81
|
+
secondary: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
gas: {
|
|
85
|
+
border: string;
|
|
86
|
+
surface: string;
|
|
87
|
+
message: {
|
|
88
|
+
base: string;
|
|
89
|
+
secondary: string;
|
|
90
|
+
};
|
|
72
91
|
};
|
|
73
|
-
data: Record<"gas" | "branded" | "electric", Record<2 | 1 | 3 | 4, string>>;
|
|
74
92
|
};
|
|
75
93
|
component: {
|
|
76
94
|
heading1: {
|
|
@@ -201,30 +219,6 @@ export declare const theme: import("./theme").Theme & {
|
|
|
201
219
|
backgroundFocused: string;
|
|
202
220
|
};
|
|
203
221
|
};
|
|
204
|
-
badge: {
|
|
205
|
-
variants: {
|
|
206
|
-
red: {
|
|
207
|
-
foreground: string;
|
|
208
|
-
background: string;
|
|
209
|
-
};
|
|
210
|
-
orange: {
|
|
211
|
-
foreground: string;
|
|
212
|
-
background: string;
|
|
213
|
-
};
|
|
214
|
-
yellow: {
|
|
215
|
-
foreground: string;
|
|
216
|
-
background: string;
|
|
217
|
-
};
|
|
218
|
-
green: {
|
|
219
|
-
foreground: string;
|
|
220
|
-
background: string;
|
|
221
|
-
};
|
|
222
|
-
blue: {
|
|
223
|
-
foreground: string;
|
|
224
|
-
background: string;
|
|
225
|
-
};
|
|
226
|
-
};
|
|
227
|
-
};
|
|
228
222
|
};
|
|
229
223
|
};
|
|
230
224
|
export declare type Theme = typeof theme;
|
package/dist/theme/theme.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { BadgeVariantName, BadgeVariant } from '../components/Badge/Badge';
|
|
2
|
+
import { CTAVariantName, CTAVariant } from '../components/CTAButton/CTAButton';
|
|
3
|
+
import { NotificationVariant, NotificationVariantName } from '../components/Notification/Notification';
|
|
4
|
+
import { IconName } from '../providers';
|
|
1
5
|
declare type Shadow = {
|
|
2
6
|
color: string;
|
|
3
7
|
offset: string;
|
|
@@ -20,6 +24,26 @@ export declare type Theme = {
|
|
|
20
24
|
radii: Record<'small' | 'medium' | 'large', string>;
|
|
21
25
|
shadows: Record<'standard', Shadow>;
|
|
22
26
|
borderWidths: Record<'standard' | 'heavy' | 'heavier', string>;
|
|
27
|
+
badge: {
|
|
28
|
+
fontFamily: string;
|
|
29
|
+
lineHeight: number;
|
|
30
|
+
paddingHorizontal: string;
|
|
31
|
+
borderRadius: string;
|
|
32
|
+
fontSize: string[];
|
|
33
|
+
variants: Record<BadgeVariantName, BadgeVariant>;
|
|
34
|
+
};
|
|
35
|
+
cta: {
|
|
36
|
+
fontSize: string[];
|
|
37
|
+
fontFamily: string;
|
|
38
|
+
lineHeight: number;
|
|
39
|
+
paddingVertical: string;
|
|
40
|
+
paddingHorizontal: string;
|
|
41
|
+
borderRadius: number | string;
|
|
42
|
+
borderWidth: string;
|
|
43
|
+
iconGap: string;
|
|
44
|
+
minHeight: string;
|
|
45
|
+
variants: Record<CTAVariantName, CTAVariant>;
|
|
46
|
+
};
|
|
23
47
|
text: {
|
|
24
48
|
fontFamily: string;
|
|
25
49
|
lineHeight: number;
|
|
@@ -88,6 +112,21 @@ export declare type Theme = {
|
|
|
88
112
|
marginBottom: string[];
|
|
89
113
|
};
|
|
90
114
|
};
|
|
115
|
+
notification: {
|
|
116
|
+
borderRadius: string;
|
|
117
|
+
borderWidth: string;
|
|
118
|
+
borderColor: string;
|
|
119
|
+
background: string;
|
|
120
|
+
paddingX: string[];
|
|
121
|
+
paddingY: string[];
|
|
122
|
+
variants: Record<NotificationVariantName, NotificationVariant>;
|
|
123
|
+
dismiss: {
|
|
124
|
+
icon: IconName;
|
|
125
|
+
size: string;
|
|
126
|
+
color: string;
|
|
127
|
+
touchSize: string;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
91
130
|
radio: {
|
|
92
131
|
touchSize: string;
|
|
93
132
|
size: string;
|
|
@@ -181,6 +220,33 @@ export declare type Theme = {
|
|
|
181
220
|
maxWidth: string;
|
|
182
221
|
gutter: string[];
|
|
183
222
|
};
|
|
223
|
+
dataTable: {
|
|
224
|
+
borderWidth: string;
|
|
225
|
+
borderRadius: string;
|
|
226
|
+
borderColor: string;
|
|
227
|
+
responsivePadding: {
|
|
228
|
+
vertical: [string, string];
|
|
229
|
+
horizontal: [string, string];
|
|
230
|
+
};
|
|
231
|
+
tableHeader: {
|
|
232
|
+
color: string;
|
|
233
|
+
backgroundColor: string;
|
|
234
|
+
borderWidth: string;
|
|
235
|
+
borderColor: string;
|
|
236
|
+
fontFamily: string;
|
|
237
|
+
};
|
|
238
|
+
tableCaption: {
|
|
239
|
+
color: string;
|
|
240
|
+
fontFamily: string;
|
|
241
|
+
};
|
|
242
|
+
tableCell: {
|
|
243
|
+
color: string;
|
|
244
|
+
};
|
|
245
|
+
tableRow: {
|
|
246
|
+
backgroundColor: string;
|
|
247
|
+
stripeColor: string;
|
|
248
|
+
};
|
|
249
|
+
};
|
|
184
250
|
accordion: {
|
|
185
251
|
header: {
|
|
186
252
|
color: string;
|
|
@@ -189,5 +255,29 @@ export declare type Theme = {
|
|
|
189
255
|
paddingVertical: string[];
|
|
190
256
|
};
|
|
191
257
|
};
|
|
258
|
+
tabs: {
|
|
259
|
+
tab: {
|
|
260
|
+
fontSize: string[];
|
|
261
|
+
fontFamily: string;
|
|
262
|
+
lineHeight: number;
|
|
263
|
+
borderTopWidth: string;
|
|
264
|
+
borderBottomWidth: string;
|
|
265
|
+
borderColor: string;
|
|
266
|
+
paddingVertical: string[];
|
|
267
|
+
paddingHorizontal: string[];
|
|
268
|
+
active: {
|
|
269
|
+
backgroundColor: string;
|
|
270
|
+
foregroundColor: string;
|
|
271
|
+
borderColor: string;
|
|
272
|
+
};
|
|
273
|
+
inactive: {
|
|
274
|
+
backgroundColor: string;
|
|
275
|
+
foregroundColor: string;
|
|
276
|
+
};
|
|
277
|
+
hover: {
|
|
278
|
+
foregroundColor: string;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
};
|
|
192
282
|
};
|
|
193
283
|
export {};
|
package/dist/utils/utils.d.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { Ref, ReactNode,
|
|
1
|
+
import React, { Ref, ReactNode, ComponentType } from 'react';
|
|
2
2
|
import { ViewProps, View } from 'react-native';
|
|
3
3
|
import { BreakpointNames, Breakpoints } from '../hooks';
|
|
4
4
|
declare function mergeRefs<T>(ref1: undefined | Ref<T>, ref2: undefined | Ref<T>): (element: T) => void;
|
|
5
5
|
declare function getText(children: ReactNode): string;
|
|
6
6
|
declare function pxToNumber(px: string): number;
|
|
7
|
-
declare function
|
|
8
|
-
declare function styledComponentWithBreakpoints<T = ViewProps, C = View>(Component: ComponentType<T>): import("react").ForwardRefExoticComponent<import("react").PropsWithoutRef<Omit<T, BreakpointNames>> & import("react").RefAttributes<C>>;
|
|
7
|
+
declare function styledComponentWithBreakpoints<T = ViewProps, C = View>(Component: ComponentType<T>): React.ForwardRefExoticComponent<React.PropsWithoutRef<Omit<T, BreakpointNames>> & React.RefAttributes<C>>;
|
|
9
8
|
declare function responsiveStyle(property: string, value: any, breakpoints: Breakpoints, formatter?: (v: any) => string): any;
|
|
10
9
|
declare function getErrorMessage(id: string, errors: Array<{
|
|
11
10
|
id: string;
|
|
12
11
|
message: ReactNode;
|
|
13
12
|
}>): null | ReactNode;
|
|
14
13
|
declare function callAll(...fns: Array<Function | undefined>): (...args: any[]) => void;
|
|
15
|
-
declare function filterChildrenByType(children: ReactNode, type: ComponentType): ReactElement<any, string |
|
|
16
|
-
export { styledComponentWithBreakpoints, responsiveStyle, pxToNumber,
|
|
14
|
+
declare function filterChildrenByType(children: ReactNode, type: ComponentType): React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
|
|
15
|
+
export { styledComponentWithBreakpoints, responsiveStyle, pxToNumber, mergeRefs, getText, getErrorMessage, callAll, filterChildrenByType, };
|
package/dist/utils/utils.js
CHANGED
|
@@ -10,10 +10,32 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
13
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.filterChildrenByType = exports.callAll = exports.getErrorMessage = exports.getText = exports.mergeRefs = exports.
|
|
15
|
-
var
|
|
16
|
-
var react_1 = require("react");
|
|
37
|
+
exports.filterChildrenByType = exports.callAll = exports.getErrorMessage = exports.getText = exports.mergeRefs = exports.pxToNumber = exports.responsiveStyle = exports.styledComponentWithBreakpoints = void 0;
|
|
38
|
+
var react_1 = __importStar(require("react"));
|
|
17
39
|
var hooks_1 = require("../hooks");
|
|
18
40
|
function mergeRefs(ref1, ref2) {
|
|
19
41
|
return function (element) {
|
|
@@ -47,15 +69,11 @@ function pxToNumber(px) {
|
|
|
47
69
|
return parseFloat(px);
|
|
48
70
|
}
|
|
49
71
|
exports.pxToNumber = pxToNumber;
|
|
50
|
-
function numToPx(num) {
|
|
51
|
-
return "".concat(num, "px");
|
|
52
|
-
}
|
|
53
|
-
exports.numToPx = numToPx;
|
|
54
72
|
function styledComponentWithBreakpoints(Component) {
|
|
55
73
|
return (0, react_1.forwardRef)(function (props, ref) {
|
|
56
74
|
var breakpoints = (0, hooks_1.useBreakpoint)();
|
|
57
75
|
// @ts-ignore.
|
|
58
|
-
return
|
|
76
|
+
return react_1.default.createElement(Component, __assign({}, props, breakpoints, { ref: ref }));
|
|
59
77
|
});
|
|
60
78
|
}
|
|
61
79
|
exports.styledComponentWithBreakpoints = styledComponentWithBreakpoints;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ovotech/element-native",
|
|
3
|
-
"version": "2.2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
"url": "@ovotech/element"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@ovotech/element-core": "^1.1.0
|
|
17
|
-
"deepmerge": "^4.2.2"
|
|
16
|
+
"@ovotech/element-core": "^1.1.0"
|
|
18
17
|
},
|
|
19
18
|
"devDependencies": {
|
|
20
19
|
"@babel/core": "^7.11.5",
|
|
@@ -33,10 +32,10 @@
|
|
|
33
32
|
"babel-plugin-require-context-hook": "^1.0.0",
|
|
34
33
|
"jest": "^28.1.1",
|
|
35
34
|
"jest-styled-components": "^7.0.3",
|
|
36
|
-
"metro-react-native-babel-preset": "^0.
|
|
35
|
+
"metro-react-native-babel-preset": "^0.76.0",
|
|
37
36
|
"react": "18.2.0",
|
|
38
37
|
"react-is": "^16.13.0",
|
|
39
|
-
"react-native": "0.
|
|
38
|
+
"react-native": "0.71.8",
|
|
40
39
|
"react-native-reanimated": "^2.10.0",
|
|
41
40
|
"react-native-svg": "9.2.4",
|
|
42
41
|
"react-router-dom": "^5.1.2",
|
|
@@ -48,7 +47,7 @@
|
|
|
48
47
|
},
|
|
49
48
|
"peerDependencies": {
|
|
50
49
|
"react": "^16.9.0 || ^17.0.0",
|
|
51
|
-
"react-native": "^0.63.3 || ^0.71.0
|
|
50
|
+
"react-native": "^0.63.3 || ^0.71.0",
|
|
52
51
|
"react-native-reanimated": "^2.10.0",
|
|
53
52
|
"react-native-svg": "^13.5.0",
|
|
54
53
|
"styled-components": "^5.1.3"
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.TableRow = void 0;
|
|
15
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
-
var react_1 = require("react");
|
|
17
|
-
var react_is_1 = require("react-is");
|
|
18
|
-
var hooks_1 = require("../../hooks");
|
|
19
|
-
var styles_1 = require("./styles");
|
|
20
|
-
var TableRow = function (_a) {
|
|
21
|
-
var data = _a.data, index = _a.index, striped = _a.striped, rowHeadings = _a.rowHeadings, columnWidths = _a.columnWidths;
|
|
22
|
-
var breakpoints = (0, hooks_1.useBreakpoint)();
|
|
23
|
-
var cells = data.map(function (cellData, i) {
|
|
24
|
-
if (rowHeadings && i === 0) {
|
|
25
|
-
return ((0, react_1.createElement)(styles_1.RowHeading, __assign({}, breakpoints, { key: i, testID: "rowHeader", cellWidth: columnWidths[i] }), (0, react_is_1.isElement)(cellData) ? (cellData) : ((0, jsx_runtime_1.jsx)(styles_1.TableHeaderText, __assign({}, breakpoints, { children: cellData })))));
|
|
26
|
-
}
|
|
27
|
-
return ((0, react_1.createElement)(styles_1.TableCell, __assign({}, breakpoints, { key: i, testID: "cell", cellWidth: columnWidths[i] }), (0, react_is_1.isElement)(cellData) ? (cellData) : ((0, jsx_runtime_1.jsx)(styles_1.CellText, __assign({}, breakpoints, { children: cellData })))));
|
|
28
|
-
});
|
|
29
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.TableRow, __assign({ stripe: striped && index % 2 === 0 }, { children: cells })));
|
|
30
|
-
};
|
|
31
|
-
exports.TableRow = TableRow;
|