@tactics/toddle-styleguide 1.4.10 → 1.4.11
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/App.tsx +8 -0
- package/index.d.ts +2 -1
- package/index.tsx +3 -1
- package/package.json +1 -1
- package/src/components/molecules/context-label/context-label.component.d.ts +6 -0
- package/src/components/molecules/context-label/context-label.component.tsx +31 -0
- package/src/components/molecules/context-label/context-label.preview.d.ts +2 -0
- package/src/components/molecules/context-label/context-label.preview.tsx +55 -0
- package/src/components/molecules/context-label/context-label.styles.d.ts +16 -0
- package/src/components/molecules/context-label/context-label.styles.js +21 -0
package/App.tsx
CHANGED
|
@@ -74,6 +74,7 @@ import {TabViewPreview} from './src/components/organisms/tab-view/tab-view.previ
|
|
|
74
74
|
import {LinePreview} from './src/components/atoms/line/line.preview';
|
|
75
75
|
import {JournalEntryPreview} from './src/components/organisms/journal-entry/journal-entry.preview';
|
|
76
76
|
import { TimetableEditPreview } from './src/components/organisms/timetable-edit/timetable-edit.preview';
|
|
77
|
+
import { ContextLabelPreview } from './src/components/molecules/context-label/context-label.preview';
|
|
77
78
|
|
|
78
79
|
import {
|
|
79
80
|
SafeAreaProvider,
|
|
@@ -128,6 +129,10 @@ const HomeScreen = ({navigation}: {navigation: any}) => {
|
|
|
128
129
|
title="Contact Role"
|
|
129
130
|
onPress={() => navigation.push('contact-role')}
|
|
130
131
|
/>
|
|
132
|
+
<ReactBtn
|
|
133
|
+
title="Context Label"
|
|
134
|
+
onPress={() => navigation.push('context-label')}
|
|
135
|
+
/>
|
|
131
136
|
<ReactBtn
|
|
132
137
|
title="Date Input"
|
|
133
138
|
onPress={() => navigation.push('date-input')}
|
|
@@ -347,6 +352,9 @@ function App() {
|
|
|
347
352
|
<Stack.Screen name="contact-role">
|
|
348
353
|
{() => <ContactRolePreview />}
|
|
349
354
|
</Stack.Screen>
|
|
355
|
+
<Stack.Screen name="context-label">
|
|
356
|
+
{() => <ContextLabelPreview />}
|
|
357
|
+
</Stack.Screen>
|
|
350
358
|
<Stack.Screen name="date-input">
|
|
351
359
|
{() => <DateInputPreview />}
|
|
352
360
|
</Stack.Screen>
|
package/index.d.ts
CHANGED
|
@@ -59,6 +59,7 @@ import { TabView } from './src/components/organisms/tab-view/tab-view.component'
|
|
|
59
59
|
import { Line } from './src/components/atoms/line/line.component';
|
|
60
60
|
import { JournalEntry } from './src/components/organisms/journal-entry/journal-entry.component';
|
|
61
61
|
import { TimetableEdit } from './src/components/organisms/timetable-edit/timetable-edit.component';
|
|
62
|
+
import { ContextLabel } from './src/components/molecules/context-label/context-label.component';
|
|
62
63
|
import { BubbleAlignment } from './src/types/bubble-alignment.enum';
|
|
63
64
|
import { KeyBoardTypes } from './src/types/keyboard-types.enum';
|
|
64
65
|
import { Size } from './src/types/size.enum';
|
|
@@ -68,4 +69,4 @@ import { ToddleDateTime } from './src/utilities/toddle-datetime/toddle-datetime.
|
|
|
68
69
|
import { ThemeCtx } from './src/context/theme.context';
|
|
69
70
|
import { Scale } from './src/theme/scale/index';
|
|
70
71
|
import CreateResponsiveStyle from './src/theme/responsive/index';
|
|
71
|
-
export { AllCapsHeading, Avatar, BackgroundGradient, BlockedMessage, Button, Calendar, CalendarSelect, CancelLink, Check, Checkbox, ChildListItem, ContactItem, ContactRole, DateInput, DaySelect, DefaultSelect, DepartmentLogo, FilterRange, FilterTab, Footer, Heading1, Heading2, Heading3, Heading4, Icon, ImageBubble, IncrementInput, Info, JournalEntry, LanguageButton, Line, LoadingIndicator, Logo, MessageInput, Modal, MoreInfoButton, MyChildListItem, Paragraph, PasswordInput, PersonInfoCard, Pill, Popover, PopOverAction, PressableIcon, QuickFilter, QuickMessage, Search, SelectLink, SelectListItem, SelectPicker, SmallText, Snackbar, SplitContainer, Swipe, TabView, Tag, TextBubble, TextInput, TimeLine, TimePicker, TimeTracker, TinyText, WaveBackground, WideButton, BubbleAlignment, Initials, KeyBoardTypes, Size, ThemeCtx, ToddleDateTime, VisualState, CreateResponsiveStyle, Scale, TimetableEdit };
|
|
72
|
+
export { AllCapsHeading, Avatar, BackgroundGradient, BlockedMessage, Button, Calendar, CalendarSelect, CancelLink, Check, Checkbox, ChildListItem, ContactItem, ContactRole, DateInput, DaySelect, DefaultSelect, DepartmentLogo, FilterRange, FilterTab, Footer, Heading1, Heading2, Heading3, Heading4, Icon, ImageBubble, IncrementInput, Info, JournalEntry, LanguageButton, Line, LoadingIndicator, Logo, MessageInput, Modal, MoreInfoButton, MyChildListItem, Paragraph, PasswordInput, PersonInfoCard, Pill, Popover, PopOverAction, PressableIcon, QuickFilter, QuickMessage, Search, SelectLink, SelectListItem, SelectPicker, SmallText, Snackbar, SplitContainer, Swipe, TabView, Tag, TextBubble, TextInput, TimeLine, TimePicker, TimeTracker, TinyText, WaveBackground, WideButton, BubbleAlignment, Initials, KeyBoardTypes, Size, ThemeCtx, ToddleDateTime, VisualState, CreateResponsiveStyle, Scale, TimetableEdit, ContextLabel };
|
package/index.tsx
CHANGED
|
@@ -77,6 +77,7 @@ import {TabView} from './src/components/organisms/tab-view/tab-view.component';
|
|
|
77
77
|
import {Line} from './src/components/atoms/line/line.component';
|
|
78
78
|
import {JournalEntry} from './src/components/organisms/journal-entry/journal-entry.component';
|
|
79
79
|
import {TimetableEdit} from './src/components/organisms/timetable-edit/timetable-edit.component';
|
|
80
|
+
import { ContextLabel } from './src/components/molecules/context-label/context-label.component';
|
|
80
81
|
|
|
81
82
|
// Exports of enums
|
|
82
83
|
import {BubbleAlignment} from './src/types/bubble-alignment.enum';
|
|
@@ -173,5 +174,6 @@ export {
|
|
|
173
174
|
VisualState,
|
|
174
175
|
CreateResponsiveStyle,
|
|
175
176
|
Scale,
|
|
176
|
-
TimetableEdit
|
|
177
|
+
TimetableEdit,
|
|
178
|
+
ContextLabel
|
|
177
179
|
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {useContext} from 'react';
|
|
3
|
+
|
|
4
|
+
import {View} from 'react-native';
|
|
5
|
+
import {ThemeCtx} from '../../../context/theme.context';
|
|
6
|
+
import {Stylesheet} from './context-label.styles';
|
|
7
|
+
import {Paragraph} from '../../atoms/paragraph-components';
|
|
8
|
+
|
|
9
|
+
type ContextLabelProps = {
|
|
10
|
+
label: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const ContextLabel = ({label}: ContextLabelProps) => {
|
|
14
|
+
const context = useContext(ThemeCtx);
|
|
15
|
+
const styles = Stylesheet(context);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<View style={styles.container}>
|
|
19
|
+
<Paragraph
|
|
20
|
+
bold={true}
|
|
21
|
+
textAlign={'center'}
|
|
22
|
+
ellipsizeMode={'tail'}
|
|
23
|
+
numberOfLines={1}
|
|
24
|
+
>
|
|
25
|
+
{label}
|
|
26
|
+
</Paragraph>
|
|
27
|
+
</View>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export {ContextLabel as ContextLabel};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ContextLabel } from './context-label.component';
|
|
3
|
+
import { Avatar } from '../avatar/avatar.component';
|
|
4
|
+
import { Size } from '../../../types/size.enum';
|
|
5
|
+
import { Initials } from '../../../models/initials.model';
|
|
6
|
+
import { Scale } from '../../../theme/scale';
|
|
7
|
+
import { Paragraph } from '../../atoms/paragraph-components';
|
|
8
|
+
const {View} = require('react-native');
|
|
9
|
+
|
|
10
|
+
export const ContextLabelPreview = ({}: {}) => {
|
|
11
|
+
return (
|
|
12
|
+
<View
|
|
13
|
+
style={{
|
|
14
|
+
flex: 1,
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
justifyContent: 'center',
|
|
17
|
+
backgroundColor: 'white',
|
|
18
|
+
}}
|
|
19
|
+
>
|
|
20
|
+
<ContextLabel label='Dirk Dingles' />
|
|
21
|
+
|
|
22
|
+
<View
|
|
23
|
+
style={{
|
|
24
|
+
flex: 1,
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
justifyContent: 'center',
|
|
27
|
+
backgroundColor: 'white',
|
|
28
|
+
flexDirection: 'row',
|
|
29
|
+
gap: Scale.xs
|
|
30
|
+
}}
|
|
31
|
+
>
|
|
32
|
+
<Avatar size={Size.SMALL} source={Initials.for('Dirk', 'Dingles')} />
|
|
33
|
+
<ContextLabel label='Dirk Dingles' />
|
|
34
|
+
</View>
|
|
35
|
+
|
|
36
|
+
<View
|
|
37
|
+
style={{
|
|
38
|
+
flex: 1,
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
justifyContent: 'center',
|
|
41
|
+
backgroundColor: 'white',
|
|
42
|
+
flexDirection: 'row',
|
|
43
|
+
gap: Scale.xs,
|
|
44
|
+
width: 250
|
|
45
|
+
}}
|
|
46
|
+
>
|
|
47
|
+
<View style={{width: '100%'}}><Paragraph>Toddle Logo</Paragraph></View>
|
|
48
|
+
<View style={{ flexWrap: 'nowrap', flexDirection: 'row', alignItems: 'center', gap: Scale.xs,}}>
|
|
49
|
+
<Avatar size={Size.SMALL} source={Initials.for('Dirk', 'DingleslangereNaam')} />
|
|
50
|
+
<ContextLabel label='Dirk DingleslangereNaamMaarDanEchtSuperLang' />
|
|
51
|
+
</View>
|
|
52
|
+
</View>
|
|
53
|
+
</View>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function Stylesheet(context: any): StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
|
|
2
|
+
container: {
|
|
3
|
+
flex: number;
|
|
4
|
+
borderRadius: number;
|
|
5
|
+
alignItems: string;
|
|
6
|
+
justifyContent: string;
|
|
7
|
+
height: number;
|
|
8
|
+
maxHeight: number;
|
|
9
|
+
paddingLeft: number;
|
|
10
|
+
paddingTop: number;
|
|
11
|
+
paddingRight: number;
|
|
12
|
+
paddingBottom: number;
|
|
13
|
+
backgroundColor: any;
|
|
14
|
+
}[];
|
|
15
|
+
}>;
|
|
16
|
+
import { StyleSheet } from 'react-native';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {StyleSheet} from 'react-native';
|
|
2
|
+
import {Scale} from '../../../theme/scale/index';
|
|
3
|
+
|
|
4
|
+
export const Stylesheet = (context) =>
|
|
5
|
+
StyleSheet.create({
|
|
6
|
+
container: [
|
|
7
|
+
{
|
|
8
|
+
flex: 1,
|
|
9
|
+
borderRadius: 50,
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
justifyContent: 'center',
|
|
12
|
+
height: 40,
|
|
13
|
+
maxHeight: 40,
|
|
14
|
+
paddingLeft: Scale.s,
|
|
15
|
+
paddingTop: Scale.xs,
|
|
16
|
+
paddingRight: Scale.s,
|
|
17
|
+
paddingBottom: Scale.xs,
|
|
18
|
+
backgroundColor: context.colors.ui.lightgrey,
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
});
|