Skip to content

Commit 96cdabd

Browse files
authored
feat: add comprehensive design system package (#472)
1 parent 40d2c4e commit 96cdabd

33 files changed

Lines changed: 6893 additions & 0 deletions

.storybook/main.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/**
2+
* Storybook Configuration for SubTrackr Design System
3+
*
4+
* Location: .storybook/main.js
5+
* Run: npm run storybook
6+
*/
7+
8+
module.exports = {
9+
stories: [
10+
'../src/design-system/stories/**/*.stories.{ts,tsx}',
11+
'../src/**/*.stories.{ts,tsx}',
12+
],
13+
addons: [
14+
'@storybook/addon-essentials',
15+
'@storybook/addon-ondevice-actions',
16+
'@storybook/addon-ondevice-backgrounds',
17+
'@storybook/addon-ondevice-controls',
18+
],
19+
framework: {
20+
name: '@storybook/react-native',
21+
options: {},
22+
},
23+
docs: {
24+
autodocs: 'tag',
25+
defaultName: 'Documentation',
26+
},
27+
typescript: {
28+
check: true,
29+
checkOptions: {},
30+
reactDocgenTypescriptOptions: {
31+
shouldExtractLiteralValuesAsTypes: true,
32+
shouldRemoveUndefinedFromOptional: true,
33+
propFilter: (prop: any) => {
34+
if (prop.parent) {
35+
return !prop.parent.fileName.includes('node_modules');
36+
}
37+
return true;
38+
},
39+
},
40+
},
41+
};

.storybook/preview.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* Storybook Preview Configuration
3+
*
4+
* Location: .storybook/preview.js
5+
*/
6+
7+
import * as React from 'react';
8+
import { View, SafeAreaView } from 'react-native';
9+
10+
export const parameters = {
11+
actions: { argTypesRegex: '^on[A-Z].*' },
12+
controls: {
13+
matchers: {
14+
color: /(background|color)$/i,
15+
date: /Date$/,
16+
},
17+
},
18+
backgrounds: {
19+
default: 'dark',
20+
values: [
21+
{ name: 'dark', value: '#0f172a' },
22+
{ name: 'light', value: '#f8fafc' },
23+
{ name: 'high-contrast', value: '#000000' },
24+
],
25+
},
26+
layout: 'centered',
27+
};
28+
29+
export const decorators = [
30+
(Story) => (
31+
<SafeAreaView style={{ flex: 1, backgroundColor: '#0f172a' }}>
32+
<View style={{ flex: 1, padding: 16, justifyContent: 'center' }}>
33+
<Story />
34+
</View>
35+
</SafeAreaView>
36+
),
37+
];
38+
39+
export const tags = ['autodocs'];

0 commit comments

Comments
 (0)