@tactics/toddle-styleguide 1.7.0 → 1.7.1
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/inline-error/inline-error.component.d.ts +6 -0
- package/src/components/molecules/inline-error/inline-error.component.tsx +27 -0
- package/src/components/molecules/inline-error/inline-error.preview.d.ts +2 -0
- package/src/components/molecules/inline-error/inline-error.preview.tsx +20 -0
- package/src/components/molecules/inline-error/inline-error.styles.d.ts +18 -0
- package/src/components/molecules/inline-error/inline-error.styles.js +22 -0
package/App.tsx
CHANGED
|
@@ -78,6 +78,7 @@ import { CountPreview } from './src/components/atoms/count/count.preview';
|
|
|
78
78
|
import { AmountPreview } from './src/components/molecules/amount/amount.preview';
|
|
79
79
|
import { BareTimePickerPreview } from './src/components/molecules/bare-time-picker/bare-time-picker.preview';
|
|
80
80
|
import { TimetableEditorPreview } from './src/components/organisms/timetable-editor/timetable-editor.preview';
|
|
81
|
+
import { InlineErrorPreview } from './src/components/molecules/inline-error/inline-error.preview';
|
|
81
82
|
|
|
82
83
|
import {
|
|
83
84
|
SafeAreaProvider,
|
|
@@ -199,6 +200,10 @@ const HomeScreen = ({navigation}: {navigation: any}) => {
|
|
|
199
200
|
title="Info Component"
|
|
200
201
|
onPress={() => navigation.push('info')}
|
|
201
202
|
/>
|
|
203
|
+
<ReactBtn
|
|
204
|
+
title="Inline Error"
|
|
205
|
+
onPress={() => navigation.push('inline-error')}
|
|
206
|
+
/>
|
|
202
207
|
<ReactBtn
|
|
203
208
|
title="Journal Entry"
|
|
204
209
|
onPress={() => navigation.push('journal-entry')}
|
|
@@ -511,6 +516,9 @@ function App() {
|
|
|
511
516
|
<Stack.Screen name="wide-button">
|
|
512
517
|
{() => <WideButtonPreview />}
|
|
513
518
|
</Stack.Screen>
|
|
519
|
+
<Stack.Screen name="inline-error">
|
|
520
|
+
{() => <InlineErrorPreview />}
|
|
521
|
+
</Stack.Screen>
|
|
514
522
|
</Stack.Navigator>
|
|
515
523
|
</NavigationContainer>
|
|
516
524
|
</ThemeCtx.Provider>
|
package/index.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ import { ContextLabel } from './src/components/molecules/context-label/context-l
|
|
|
63
63
|
import { Count } from './src/components/atoms/count/count.component';
|
|
64
64
|
import { Amount } from './src/components/molecules/amount/amount.component';
|
|
65
65
|
import { TimetableEditor } from './src/components/organisms/timetable-editor/timetable-editor.component';
|
|
66
|
+
import { InlineError } from './src/components/molecules/inline-error/inline-error.component';
|
|
66
67
|
import { BubbleAlignment } from './src/types/bubble-alignment.enum';
|
|
67
68
|
import { KeyBoardTypes } from './src/types/keyboard-types.enum';
|
|
68
69
|
import { Size } from './src/types/size.enum';
|
|
@@ -74,4 +75,4 @@ import { ToddleDateTime } from './src/utilities/toddle-datetime/toddle-datetime.
|
|
|
74
75
|
import { ThemeCtx } from './src/context/theme.context';
|
|
75
76
|
import { Scale } from './src/theme/scale/index';
|
|
76
77
|
import CreateResponsiveStyle from './src/theme/responsive/index';
|
|
77
|
-
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, Count, Amount, TimetableEditor, TimeSlotRecord, TimeSlotSequence };
|
|
78
|
+
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, Count, Amount, TimetableEditor, TimeSlotRecord, TimeSlotSequence, InlineError };
|
package/index.tsx
CHANGED
|
@@ -81,6 +81,7 @@ import { ContextLabel } from './src/components/molecules/context-label/context-l
|
|
|
81
81
|
import { Count } from './src/components/atoms/count/count.component';
|
|
82
82
|
import { Amount } from './src/components/molecules/amount/amount.component';
|
|
83
83
|
import { TimetableEditor } from './src/components/organisms/timetable-editor/timetable-editor.component';
|
|
84
|
+
import { InlineError } from './src/components/molecules/inline-error/inline-error.component';
|
|
84
85
|
|
|
85
86
|
// Exports of enums
|
|
86
87
|
import {BubbleAlignment} from './src/types/bubble-alignment.enum';
|
|
@@ -185,5 +186,6 @@ export {
|
|
|
185
186
|
Amount,
|
|
186
187
|
TimetableEditor,
|
|
187
188
|
TimeSlotRecord,
|
|
188
|
-
TimeSlotSequence
|
|
189
|
+
TimeSlotSequence,
|
|
190
|
+
InlineError
|
|
189
191
|
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {useContext} from 'react';
|
|
3
|
+
|
|
4
|
+
import {ThemeCtx} from '../../../context/theme.context';
|
|
5
|
+
import {View} from 'react-native';
|
|
6
|
+
import {Stylesheet} from './inline-error.styles';
|
|
7
|
+
import {SmallText} from '../../atoms/paragraph-components';
|
|
8
|
+
import { Icon } from '../../../icons';
|
|
9
|
+
|
|
10
|
+
type InlineErrorProps = {
|
|
11
|
+
label: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const InlineError = ({label}: InlineErrorProps) => {
|
|
15
|
+
const context = useContext(ThemeCtx);
|
|
16
|
+
const styles = Stylesheet(context);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<View style={styles.container}>
|
|
20
|
+
<Icon name='exclamation-circle' style='regular' color={context.colors.ui.error.dark} />
|
|
21
|
+
<SmallText addStyle={styles.label} textColor={context.colors.ui.error.dark}>
|
|
22
|
+
{label}
|
|
23
|
+
</SmallText>
|
|
24
|
+
</View>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
export {InlineError as InlineError};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InlineError } from './inline-error.component';
|
|
3
|
+
const {View} = require('react-native');
|
|
4
|
+
|
|
5
|
+
export const InlineErrorPreview = ({}: {}) => {
|
|
6
|
+
return (
|
|
7
|
+
<View
|
|
8
|
+
style={{
|
|
9
|
+
flex: 1,
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
justifyContent: 'center',
|
|
12
|
+
backgroundColor: 'white',
|
|
13
|
+
}}
|
|
14
|
+
>
|
|
15
|
+
<InlineError
|
|
16
|
+
label={'Deze dag is reeds gefactureerd. U kan deze enkel nog aanpassen in de beheerssoftware.'}
|
|
17
|
+
/>
|
|
18
|
+
</View>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function Stylesheet(context: any): {
|
|
2
|
+
container: {
|
|
3
|
+
flexDirection: "row";
|
|
4
|
+
gap: number;
|
|
5
|
+
width: "100%";
|
|
6
|
+
backgroundColor: any;
|
|
7
|
+
borderRadius: number;
|
|
8
|
+
alignItems: "center";
|
|
9
|
+
justifyContent: "flex-start";
|
|
10
|
+
paddingLeft: number;
|
|
11
|
+
paddingTop: number;
|
|
12
|
+
paddingRight: number;
|
|
13
|
+
paddingBottom: number;
|
|
14
|
+
};
|
|
15
|
+
label: {
|
|
16
|
+
flex: number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {StyleSheet} from 'react-native';
|
|
2
|
+
import {Scale} from '../../../theme/scale';
|
|
3
|
+
|
|
4
|
+
export const Stylesheet = (context) =>
|
|
5
|
+
StyleSheet.create({
|
|
6
|
+
container: {
|
|
7
|
+
flexDirection: 'row',
|
|
8
|
+
gap: Scale.m,
|
|
9
|
+
width: '100%',
|
|
10
|
+
backgroundColor: context.colors.ui.error.xlight,
|
|
11
|
+
borderRadius: Scale.s,
|
|
12
|
+
alignItems: 'center',
|
|
13
|
+
justifyContent: 'flex-start',
|
|
14
|
+
paddingLeft: Scale.m,
|
|
15
|
+
paddingTop: Scale.m,
|
|
16
|
+
paddingRight: Scale.m,
|
|
17
|
+
paddingBottom: Scale.m,
|
|
18
|
+
},
|
|
19
|
+
label: {
|
|
20
|
+
flex: 1
|
|
21
|
+
}
|
|
22
|
+
});
|