@tactics/toddle-styleguide 0.0.2 → 0.0.4

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.
Files changed (59) hide show
  1. package/.github/workflows/publish_styleguide.yaml +30 -0
  2. package/App.tsx +30 -10
  3. package/index.tsx +39 -22
  4. package/package.json +5 -2
  5. package/src/components/atoms/avatar/avatar.component.tsx +1 -1
  6. package/src/components/atoms/button/button.component.tsx +1 -1
  7. package/src/components/atoms/calendar/__snapshots__/calendar.test.js.snap +5813 -0
  8. package/src/components/atoms/calendar/calendar.component.tsx +94 -0
  9. package/src/components/atoms/calendar/calendar.preview.tsx +44 -0
  10. package/src/components/atoms/calendar/calendar.styles.js +88 -0
  11. package/src/components/atoms/calendar/calendar.test.js +30 -0
  12. package/src/components/atoms/cancel-link/cancel-link.component.tsx +1 -1
  13. package/src/components/atoms/check-switch/check-switch.component.tsx +1 -1
  14. package/src/components/atoms/checkbox/checkbox.component.tsx +1 -1
  15. package/src/components/atoms/child-list-item/child-list-item.component.tsx +1 -1
  16. package/src/components/atoms/child-list-item/child-list-item.styles.js +5 -5
  17. package/src/components/atoms/contact-item/contact-item.component.tsx +1 -1
  18. package/src/components/atoms/filter-tab/filter-tab.component.tsx +1 -1
  19. package/src/components/atoms/form-actions/form-action.component.tsx +1 -1
  20. package/src/components/atoms/image-bubble/image-bubble.component.tsx +1 -1
  21. package/src/components/atoms/increment-input/__snapshots__/increment-input.test.js.snap +210 -0
  22. package/src/components/atoms/increment-input/increment-input.component.tsx +41 -0
  23. package/src/components/atoms/increment-input/increment-input.preview.tsx +28 -0
  24. package/src/components/atoms/increment-input/increment-input.styles.js +49 -0
  25. package/src/components/atoms/increment-input/increment-input.test.js +14 -0
  26. package/src/components/atoms/info/info.component.tsx +1 -1
  27. package/src/components/atoms/logo/__snapshots__/logo.test.js.snap +103 -0
  28. package/src/components/atoms/logo/logo.component.tsx +39 -0
  29. package/src/components/atoms/logo/logo.preview.tsx +15 -0
  30. package/src/components/atoms/logo/logo.test.js +16 -0
  31. package/src/components/atoms/pill/pill.component.tsx +1 -1
  32. package/src/components/atoms/popover/components/backdrop/backdrop.component.tsx +1 -1
  33. package/src/components/atoms/popover/components/foreground/foreground.component.tsx +1 -1
  34. package/src/components/atoms/popover/components/modal/close/close.component.tsx +1 -1
  35. package/src/components/atoms/popover/components/modal/heading/heading.component.tsx +1 -1
  36. package/src/components/atoms/popover/components/modal/modal.component.tsx +1 -1
  37. package/src/components/atoms/popover/components/modal/scroll-content/scroll-content.component.tsx +1 -1
  38. package/src/components/atoms/popover/popover.component.tsx +1 -1
  39. package/src/components/atoms/pressable-icon/pressable-icon.component.tsx +1 -1
  40. package/src/components/atoms/quick-filter/quick-filter.component.tsx +1 -1
  41. package/src/components/atoms/select-list-item/select-list-item.component.tsx +1 -1
  42. package/src/components/atoms/snackbar/snackbar.component.tsx +1 -1
  43. package/src/components/atoms/swipe/Swipe.styles.js +12 -0
  44. package/src/components/atoms/swipe/__snapshots__/swipe.test.js.snap +589 -0
  45. package/src/components/atoms/swipe/swipe.component.tsx +39 -0
  46. package/src/components/atoms/swipe/swipe.preview.tsx +64 -0
  47. package/src/components/atoms/swipe/swipe.test.js +46 -0
  48. package/src/components/atoms/tag/tag.component.tsx +1 -1
  49. package/src/components/atoms/text-bubble/text-bubble.component.tsx +1 -1
  50. package/src/components/atoms/text-input/text-input.component.tsx +1 -1
  51. package/src/components/atoms/text-input/text-input.preview.tsx +10 -4
  52. package/src/components/atoms/text-input/text-input.styles.js +1 -1
  53. package/src/components/atoms/time-tracker/time-tracker.component.tsx +1 -1
  54. package/src/components/atoms/timeline/__snapshots__/timeline.test.js.snap +181 -0
  55. package/src/components/atoms/timeline/timeline.component.tsx +161 -0
  56. package/src/components/atoms/timeline/timeline.preview.tsx +43 -0
  57. package/src/components/atoms/timeline/timeline.styles.js +41 -0
  58. package/src/components/atoms/timeline/timeline.test.js +18 -0
  59. package/src/components/atoms/wide-button/wide-button.component.tsx +1 -1
@@ -0,0 +1,30 @@
1
+ name: Create Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - '*'
7
+
8
+ jobs:
9
+ build:
10
+ name: Create Release
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Checkout code
14
+ uses: actions/checkout@v2
15
+ - name: Create Release
16
+ id: create_release
17
+ uses: actions/create-release@v1
18
+ env:
19
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20
+ with:
21
+ tag_name: ${{ github.ref }}
22
+ release_name: Release ${{ github.ref }}
23
+ draft: false
24
+ prerelease: false
25
+
26
+ - name: Publish to npm
27
+ uses: JS-DevTools/npm-publish@v1
28
+ with:
29
+ token: ${{ secrets.NPM_TOKEN }}
30
+ access: 'public'
package/App.tsx CHANGED
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import {ScrollView, Button as ReactBtn} from 'react-native';
2
+ import {Button as ReactBtn, ScrollView} from 'react-native';
3
3
  import {NavigationContainer} from '@react-navigation/native';
4
4
  import {createNativeStackNavigator} from '@react-navigation/native-stack';
5
5
 
@@ -23,7 +23,6 @@ import {IconOutlineWhitePreview} from './src/icons/outline/outline-white.preview
23
23
  import {IconOutlineDefaultPreview} from './src/icons/outline/outline-default.preview';
24
24
  import {IconOutlineGreyPreview} from './src/icons/outline/outline-grey.preview';
25
25
  import {TagPreview} from './src/components/atoms/tag/tag.preview';
26
- import {PopoverHeadingPreview} from './src/components/atoms/popover-heading/popover-heading.preview';
27
26
  import {FilterTabPreview} from './src/components/atoms/filter-tab/filter-tab.preview';
28
27
  import {ContactItemPreview} from './src/components/atoms/contact-item/contact-item.preview';
29
28
  import {SelectListItemPreview} from './src/components/atoms/select-list-item/select-list-item-preview';
@@ -32,9 +31,14 @@ import {CheckPreview} from './src/components/atoms/check-switch/check-switch.pre
32
31
  import {WideButtonPreview} from './src/components/atoms/wide-button/wide-button.preview';
33
32
  import {PressableIconPreview} from './src/components/atoms/pressable-icon/pressable-icon.preview';
34
33
  import {FormActionPreview} from './src/components/atoms/form-actions/form-action.preview';
34
+ import {CalendarPreview} from './src/components/atoms/calendar/calendar.preview';
35
35
  import {QuickFilterPreview} from './src/components/atoms/quick-filter/quick-filter.prevriew';
36
36
  import {TextInputPreview} from './src/components/atoms/text-input/text-input.preview';
37
- import {ChildListItemPreview} from "./src/components/atoms/child-list-item/child-list-item.preview";
37
+ import {ChildListItemPreview} from './src/components/atoms/child-list-item/child-list-item.preview';
38
+ import {TimeLinePreview} from './src/components/atoms/timeline/timeline.preview';
39
+ import {IncrementInputPreview} from './src/components/atoms/increment-input/increment-input.preview';
40
+ import {SwipePreview} from './src/components/atoms/swipe/swipe.preview';
41
+ import {LogoPreview} from './src/components/atoms/logo/logo.preview';
38
42
 
39
43
  const Stack = createNativeStackNavigator();
40
44
 
@@ -48,7 +52,8 @@ const HomeScreen = ({navigation}: {navigation: any}) => {
48
52
  alignItems: 'center',
49
53
  justifyContent: 'center',
50
54
  }}
51
- ><ReactBtn title="Avatar" onPress={() => navigation.push('avatar')} />
55
+ >
56
+ <ReactBtn title="Avatar" onPress={() => navigation.push('avatar')} />
52
57
  <ReactBtn title="Button" onPress={() => navigation.push('button')} />
53
58
  <ReactBtn title="Pill" onPress={() => navigation.push('pill')} />
54
59
  <ReactBtn title="Snackbar" onPress={() => navigation.push('snackbar')} />
@@ -89,8 +94,8 @@ const HomeScreen = ({navigation}: {navigation: any}) => {
89
94
  onPress={() => navigation.push('info')}
90
95
  />
91
96
  <ReactBtn
92
- title="child-list-item"
93
- onPress={() => navigation.push('childList')}
97
+ title="child-list-item"
98
+ onPress={() => navigation.push('childList')}
94
99
  />
95
100
  <ReactBtn
96
101
  title="Wide Button"
@@ -122,10 +127,17 @@ const HomeScreen = ({navigation}: {navigation: any}) => {
122
127
  title="formAction"
123
128
  onPress={() => navigation.push('form-action')}
124
129
  />
125
- <ReactBtn
130
+ <ReactBtn title="Calendar" onPress={() => navigation.push('calendar')} />
131
+ <ReactBtn
126
132
  title="quickFilter"
127
133
  onPress={() => navigation.push('quick-filter')}
128
134
  />
135
+ <ReactBtn
136
+ title="Increment input"
137
+ onPress={() => navigation.push('increment-input')}
138
+ />
139
+ <ReactBtn title="swiper" onPress={() => navigation.push('swiper')} />
140
+ <ReactBtn title="logo" onPress={() => navigation.push('logo')} />
129
141
  </ScrollView>
130
142
  );
131
143
  };
@@ -190,9 +202,6 @@ function App() {
190
202
  <Stack.Screen name="select-list-item">
191
203
  {() => <SelectListItemPreview />}
192
204
  </Stack.Screen>
193
- <Stack.Screen name="popover-heading">
194
- {() => <PopoverHeadingPreview />}
195
- </Stack.Screen>
196
205
  <Stack.Screen name="filter tab">
197
206
  {() => <FilterTabPreview />}
198
207
  </Stack.Screen>
@@ -206,12 +215,23 @@ function App() {
206
215
  <Stack.Screen name="form-action">
207
216
  {() => <FormActionPreview />}
208
217
  </Stack.Screen>
218
+ <Stack.Screen name="calendar">
219
+ {() => <CalendarPreview />}
220
+ </Stack.Screen>
209
221
  <Stack.Screen name="quick-filter">
210
222
  {() => <QuickFilterPreview />}
211
223
  </Stack.Screen>
212
224
  <Stack.Screen name="childList">
213
225
  {() => <ChildListItemPreview />}
214
226
  </Stack.Screen>
227
+ <Stack.Screen name="timeline">
228
+ {() => <TimeLinePreview />}
229
+ </Stack.Screen>
230
+ <Stack.Screen name="increment-input">
231
+ {() => <IncrementInputPreview />}
232
+ </Stack.Screen>
233
+ <Stack.Screen name="swiper">{() => <SwipePreview />}</Stack.Screen>
234
+ <Stack.Screen name="logo">{() => <LogoPreview />}</Stack.Screen>
215
235
  </Stack.Navigator>
216
236
  </NavigationContainer>
217
237
  </ThemeCtx.Provider>
package/index.tsx CHANGED
@@ -1,3 +1,10 @@
1
+ // Needed to run Expo
2
+ import registerRootComponent from 'expo/build/launch/registerRootComponent';
3
+
4
+ import App from './App';
5
+ registerRootComponent(App);
6
+
7
+ // Exports of components
1
8
  import {Avatar} from './src/components/atoms/avatar/avatar.component';
2
9
  import {Button} from './src/components/atoms/button/button.component';
3
10
  import {CancelLink} from './src/components/atoms/cancel-link/cancel-link.component';
@@ -20,28 +27,38 @@ import {TextBubble} from './src/components/atoms/text-bubble/text-bubble.compone
20
27
  import {TextInput} from './src/components/atoms/text-input/text-input.component';
21
28
  import {TimeTracker} from './src/components/atoms/time-tracker/time-tracker.component';
22
29
  import {WideButton} from './src/components/atoms/wide-button/wide-button.component';
30
+ import {Icon} from './src/icons';
31
+ import {Calendar} from './src/components/atoms/calendar/calendar.component';
32
+ import {IncrementInput} from './src/components/atoms/increment-input/increment-input.component';
33
+ import {Swipe} from './src/components/atoms/swipe/swipe.component';
34
+ import {Logo} from './src/components/atoms/logo/logo.component';
23
35
 
24
36
  export {
25
- Avatar,
26
- Button,
27
- CancelLink,
28
- Check,
29
- Checkbox,
30
- ChildListItem,
31
- ContactItem,
32
- FilterTab,
33
- FormAction,
34
- ImageBubble,
35
- Info,
36
- Pill,
37
- Popover,
38
- PressableIcon,
39
- QuickFilter,
40
- SelectListItem,
41
- Snackbar,
42
- Tag,
43
- TextBubble,
44
- TextInput,
45
- TimeTracker,
46
- WideButton
37
+ Avatar,
38
+ Button,
39
+ CancelLink,
40
+ Check,
41
+ Checkbox,
42
+ ChildListItem,
43
+ ContactItem,
44
+ FilterTab,
45
+ FormAction,
46
+ ImageBubble,
47
+ Info,
48
+ Pill,
49
+ Popover,
50
+ PressableIcon,
51
+ QuickFilter,
52
+ SelectListItem,
53
+ Snackbar,
54
+ Tag,
55
+ TextBubble,
56
+ TextInput,
57
+ TimeTracker,
58
+ WideButton,
59
+ Icon,
60
+ Calendar,
61
+ IncrementInput,
62
+ Swipe,
63
+ Logo,
47
64
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tactics/toddle-styleguide",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "main": "index.tsx",
5
5
  "types": "types/index.d.ts",
6
6
  "scripts": {
@@ -22,6 +22,7 @@
22
22
  "@react-navigation/native-stack": "^6.9.1",
23
23
  "@react-navigation/stack": "^6.3.3",
24
24
  "@tactics/kinderopvang-branding": "^1.0.1",
25
+ "@types/xdate": "^0.8.32",
25
26
  "expo": "~46.0.16",
26
27
  "expo-font": "^10.2.1",
27
28
  "expo-linear-gradient": "~11.4.0",
@@ -30,9 +31,11 @@
30
31
  "react": "18.0.0",
31
32
  "react-dom": "18.0.0",
32
33
  "react-native": "0.69.6",
34
+ "react-native-calendars": "^1.1292.0",
33
35
  "react-native-safe-area-context": "4.3.1",
34
36
  "react-native-screens": "~3.15.0",
35
37
  "react-native-svg": "12.3.0",
38
+ "react-native-swiper": "^1.6.0",
36
39
  "react-native-web": "~0.18.7",
37
40
  "react-test-renderer": "^18.2.0"
38
41
  },
@@ -41,7 +44,7 @@
41
44
  "@babel/preset-typescript": "^7.18.6",
42
45
  "@types/jest": "^29.2.1",
43
46
  "@types/node": "^18.11.7",
44
- "@types/react": "^18.0.24",
47
+ "@types/react": "^18.0.25",
45
48
  "@types/react-dom": "^18.0.8",
46
49
  "@types/react-native": "^0.70.7",
47
50
  "@types/react-test-renderer": "^18.0.0",
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { useContext } from 'react';
2
+ import {useContext} from 'react';
3
3
 
4
4
  import {Image, ImageSourcePropType, View, Text, ImageStyle} from 'react-native';
5
5
  import {ThemeCtx} from '../../../context/theme.context';
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { useContext } from 'react';
2
+ import {useContext} from 'react';
3
3
 
4
4
  import {Pressable, Text, View} from 'react-native';
5
5
  import {ThemeCtx} from '../../../context/theme.context';