@widergy/mobile-ui 2.1.4 → 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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [2.2.0](https://github.com/widergy/mobile-ui/compare/v2.1.4...v2.2.0) (2025-11-28)
2
+
3
+
4
+ ### Features
5
+
6
+ * [EVEP-52] onboarding component ([#467](https://github.com/widergy/mobile-ui/issues/467)) ([277ff19](https://github.com/widergy/mobile-ui/commit/277ff194b397ca08001d151a9dd52ec17a4e63df))
7
+
1
8
  ## [2.1.4](https://github.com/widergy/mobile-ui/compare/v2.1.3...v2.1.4) (2025-11-19)
2
9
 
3
10
 
@@ -140,7 +140,7 @@ const UTTabs = ({
140
140
  onScroll={handleScroll}
141
141
  scrollEventThrottle={16}
142
142
  >
143
- {tabs.map(({ badge, label, icon }, index) => {
143
+ {tabs.map(({ badge, label, icon, walkthrough }, index) => {
144
144
  const selected = selectedTab === index;
145
145
  const colorThemeToUse = selected ? colorTheme : 'gray';
146
146
  return (
@@ -150,6 +150,7 @@ const UTTabs = ({
150
150
  key={`tab-${label || icon}`}
151
151
  onPress={() => setSelectedTab(index)}
152
152
  style={styles.scrollableTab}
153
+ {...walkthrough}
153
154
  >
154
155
  {icon && <UTIcon colorTheme={colorThemeToUse} name={icon} />}
155
156
  <UTLabel colorTheme={colorThemeToUse} shade="04" weight="medium" {...labelProps}>
@@ -162,7 +163,7 @@ const UTTabs = ({
162
163
  </ScrollView>
163
164
  ) : (
164
165
  <View style={styles.container}>
165
- {tabs.map(({ badge, label, icon }, index) => {
166
+ {tabs.map(({ badge, label, icon, walkthrough, walkthroughStyle }, index) => {
166
167
  const selected = selectedTab === index;
167
168
  const colorThemeToUse = selected ? colorTheme : 'gray';
168
169
  return (
@@ -170,7 +171,8 @@ const UTTabs = ({
170
171
  disabled={selected}
171
172
  key={`tab-${label || icon}`}
172
173
  onPress={() => setSelectedTab(index)}
173
- style={styles.tabContainer(tabs.length, index)}
174
+ style={() => [styles.tabContainer(tabs.length, index)(), ...(walkthroughStyle || [])]}
175
+ {...walkthrough}
174
176
  >
175
177
  <View style={styles.tabContent(selected)}>
176
178
  {icon && <UTIcon colorTheme={colorThemeToUse} name={icon} />}
@@ -123,6 +123,7 @@ export default StyleSheet.create(({ Palette: { accent, neutral, negative, light
123
123
  const distribution = getTabDistribution(tabs);
124
124
  const width = distribution.widths[index] || 'auto';
125
125
  return {
126
+ paddingBottom: 4,
126
127
  width,
127
128
  zIndex: 3
128
129
  };
@@ -0,0 +1,108 @@
1
+ import React from 'react';
2
+ import { View } from 'react-native';
3
+ import { func, object, array } from 'prop-types';
4
+
5
+ import UTLabel from '../UTLabel';
6
+ import UTButton from '../UTButton';
7
+
8
+ import ownStyles from './styles';
9
+
10
+ const UTWalkthroughStep = ({
11
+ buttonTexts,
12
+ containerStyle,
13
+ colors,
14
+ handleFinishWalkthrough,
15
+ next,
16
+ previous,
17
+ step,
18
+ stepsConfig,
19
+ walkthroughStepTestIds
20
+ }) => {
21
+ const styles = ownStyles(colors);
22
+ const stepNumber = stepsConfig.findIndex(s => s.identifier === step.identifier) + 1;
23
+
24
+ const currentStep = stepsConfig.find(stepConfig => stepConfig.identifier === step.identifier);
25
+ const isFirstStep = currentStep.identifier === stepsConfig[0].identifier;
26
+ const isLastStep = currentStep.identifier === stepsConfig[stepsConfig.length - 1].identifier;
27
+
28
+ return (
29
+ <View style={[styles.container, containerStyle]}>
30
+ <View style={styles.titleContainer}>
31
+ <UTLabel
32
+ colorTheme="light"
33
+ dataTestId={walkthroughStepTestIds.title}
34
+ style={styles.grow}
35
+ weight="medium"
36
+ withMarkdown
37
+ >
38
+ {currentStep.title}
39
+ </UTLabel>
40
+ <View style={styles.buttons}>
41
+ <UTButton
42
+ colorTheme="negative"
43
+ dataTestId={walkthroughStepTestIds.closeButton}
44
+ Icon="IconX"
45
+ onPress={handleFinishWalkthrough}
46
+ size="small"
47
+ variant="text"
48
+ />
49
+ </View>
50
+ </View>
51
+ <View style={styles.content}>
52
+ <UTLabel
53
+ colorTheme="light"
54
+ dataTestId={walkthroughStepTestIds.description}
55
+ variant="small"
56
+ withMarkdown
57
+ >
58
+ {currentStep.description}
59
+ </UTLabel>
60
+ </View>
61
+ <View style={styles.footer}>
62
+ <View style={styles.page}>
63
+ <UTLabel colorTheme="light" variant="small" withMarkdown>
64
+ {`${stepNumber} de ${stepsConfig.length}`}
65
+ </UTLabel>
66
+ </View>
67
+ <View style={styles.buttons}>
68
+ {!isFirstStep && (
69
+ <UTButton
70
+ colorTheme="negative"
71
+ dataTestId={walkthroughStepTestIds.previousButton}
72
+ onPress={previous}
73
+ size="small"
74
+ variant="text"
75
+ weight="medium"
76
+ >
77
+ {buttonTexts.previous}
78
+ </UTButton>
79
+ )}
80
+ <UTButton
81
+ colorTheme="negative"
82
+ dataTestId={walkthroughStepTestIds.nextButton}
83
+ onPress={isLastStep ? handleFinishWalkthrough : next}
84
+ size="small"
85
+ variant="filled"
86
+ weight="medium"
87
+ >
88
+ {isLastStep ? buttonTexts.finish : isFirstStep ? buttonTexts.start : buttonTexts.next}
89
+ </UTButton>
90
+ </View>
91
+ </View>
92
+ </View>
93
+ );
94
+ };
95
+
96
+ UTWalkthroughStep.propTypes = {
97
+ buttonTexts: object,
98
+ colors: object,
99
+ containerStyle: object,
100
+ handleFinishWalkthrough: func,
101
+ next: func,
102
+ previous: func,
103
+ step: object,
104
+ stepsConfig: array,
105
+ walkthroughStepTestIds: object
106
+ };
107
+
108
+ export default UTWalkthroughStep;
@@ -0,0 +1,41 @@
1
+ import { StyleSheet } from 'react-native';
2
+
3
+ export default StyleSheet.create(colors => {
4
+ return {
5
+ container: {
6
+ borderRadius: 4,
7
+ backgroundColor: colors.dark04,
8
+ display: 'flex',
9
+ width: 296,
10
+ padding: 16,
11
+ position: 'absolute'
12
+ },
13
+ titleContainer: {
14
+ flexDirection: 'row',
15
+ justifyContent: 'space-between',
16
+ alignItems: 'flex-start'
17
+ },
18
+ grow: {
19
+ flexShrink: 1,
20
+ flexGrow: 1,
21
+ marginRight: 8
22
+ },
23
+ buttons: {
24
+ flexDirection: 'row',
25
+ gap: 8
26
+ },
27
+
28
+ content: {
29
+ marginBottom: 8
30
+ },
31
+ footer: {
32
+ flexDirection: 'row',
33
+ justifyContent: 'space-between',
34
+ marginTop: 8,
35
+ alignItems: 'flex-end'
36
+ },
37
+ page: {
38
+ alignItems: 'center'
39
+ }
40
+ };
41
+ });
package/lib/index.js CHANGED
@@ -77,6 +77,7 @@ export { default as UTTooltip } from './components/UTTooltip';
77
77
  export { default as UTTracker } from './components/UTTracker';
78
78
  export { default as UTValidation } from './components/UTValidation';
79
79
  export { default as UTWorkflowContainer } from './components/UTWorkflowContainer';
80
+ export { default as UTWalkthroughStep } from './components/UTWalkthroughStep';
80
81
 
81
82
  // Theming
82
83
  export * from './theming';
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@widergy/mobile-ui",
3
3
  "description": "Widergy Mobile Components",
4
4
  "author": "widergy",
5
- "version": "2.1.4",
5
+ "version": "2.2.0",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [