cpk-ui 0.0.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/README.md +27 -0
- package/components/modals/AlertDialog/AlertDialog.js +80 -0
- package/components/modals/AlertDialog/AlertDialog.stories.tsx +80 -0
- package/components/modals/AlertDialog/AlertDialog.tsx +194 -0
- package/components/modals/Snackbar/Snackbar.js +94 -0
- package/components/modals/Snackbar/Snackbar.stories.tsx +98 -0
- package/components/modals/Snackbar/Snackbar.tsx +174 -0
- package/components/modals/Snackbar/const.js +5 -0
- package/components/modals/Snackbar/const.ts +4 -0
- package/components/uis/Accordion/Accordion.js +11 -0
- package/components/uis/Accordion/Accordion.stories.tsx +38 -0
- package/components/uis/Accordion/Accordion.test.tsx +128 -0
- package/components/uis/Accordion/Accordion.tsx +58 -0
- package/components/uis/Accordion/AccordionItem.js +102 -0
- package/components/uis/Accordion/AccordionItem.tsx +213 -0
- package/components/uis/Button/Button.js +161 -0
- package/components/uis/Button/Button.stories.tsx +81 -0
- package/components/uis/Button/Button.test.tsx +560 -0
- package/components/uis/Button/Button.tsx +335 -0
- package/components/uis/Checkbox/Checkbox.js +70 -0
- package/components/uis/Checkbox/Checkbox.stories.tsx +46 -0
- package/components/uis/Checkbox/Checkbox.test.tsx +139 -0
- package/components/uis/Checkbox/Checkbox.tsx +150 -0
- package/components/uis/Icon/Icon.js +3780 -0
- package/components/uis/Icon/Icon.stories.tsx +45 -0
- package/components/uis/Icon/Icon.test.tsx +19 -0
- package/components/uis/Icon/Icon.tsx +3800 -0
- package/components/uis/Icon/Pretendard-Bold.otf +0 -0
- package/components/uis/Icon/Pretendard-Regular.otf +0 -0
- package/components/uis/Icon/Pretendard-Thin.otf +0 -0
- package/components/uis/Icon/cpk.ttf +0 -0
- package/components/uis/Icon/selection.json +1 -0
- package/components/uis/IconButton/IconButton.js +120 -0
- package/components/uis/IconButton/IconButton.test.tsx +165 -0
- package/components/uis/IconButton/IconButton.tsx +252 -0
- package/components/uis/LoadingIndicator/LoadingIndicator.js +24 -0
- package/components/uis/LoadingIndicator/LoadingIndicator.tsx +79 -0
- package/components/uis/Rating/Rating.js +53 -0
- package/components/uis/Rating/Rating.test.tsx +72 -0
- package/components/uis/Rating/Rating.tsx +155 -0
- package/components/uis/StatusbarBrightness/StatusBarBrightness.js +13 -0
- package/components/uis/StatusbarBrightness/StatusBarBrightness.test.tsx +41 -0
- package/components/uis/StatusbarBrightness/StatusBarBrightness.tsx +17 -0
- package/components/uis/Styled/StyledComponents.js +130 -0
- package/components/uis/Styled/StyledComponents.tsx +200 -0
- package/components/uis/SwitchToggle/SwitchToggle.js +126 -0
- package/components/uis/SwitchToggle/SwitchToggle.test.tsx +70 -0
- package/components/uis/SwitchToggle/SwitchToggle.tsx +224 -0
- package/components/uis/Typography/Typography.js +90 -0
- package/components/uis/Typography/Typography.test.tsx +58 -0
- package/components/uis/Typography/Typography.tsx +132 -0
- package/hooks/useDebouncedColorScheme.js +21 -0
- package/hooks/useDebouncedColorScheme.tsx +30 -0
- package/index.js +16 -0
- package/index.tsx +18 -0
- package/package.json +35 -0
- package/providers/ThemeProvider.js +106 -0
- package/providers/ThemeProvider.tsx +180 -0
- package/providers/index.js +62 -0
- package/providers/index.tsx +125 -0
- package/react-native.config.cjs +5 -0
- package/utils/colors.js +124 -0
- package/utils/colors.ts +127 -0
- package/utils/createCtx.js +15 -0
- package/utils/createCtx.tsx +26 -0
- package/utils/guards.js +44 -0
- package/utils/guards.ts +93 -0
- package/utils/theme.js +5 -0
- package/utils/theme.ts +33 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type {ComponentProps} from 'react';
|
|
2
|
+
import {View} from 'react-native';
|
|
3
|
+
import {css} from '@emotion/native';
|
|
4
|
+
import type {Meta, StoryObj} from '@storybook/react';
|
|
5
|
+
import {Icon, iconList} from './Icon';
|
|
6
|
+
import {withThemeProvider} from '../../../../.storybook/decorators';
|
|
7
|
+
import {Typography} from '../Typography/Typography';
|
|
8
|
+
|
|
9
|
+
const meta = {
|
|
10
|
+
title: 'Icon',
|
|
11
|
+
component: (props) => (
|
|
12
|
+
<View
|
|
13
|
+
style={css`
|
|
14
|
+
align-items: center;
|
|
15
|
+
`}
|
|
16
|
+
>
|
|
17
|
+
<Icon {...props} />
|
|
18
|
+
<Typography.Body2
|
|
19
|
+
style={css`
|
|
20
|
+
font-size: 12px;
|
|
21
|
+
text-align: center;
|
|
22
|
+
`}
|
|
23
|
+
>
|
|
24
|
+
{props?.name}
|
|
25
|
+
</Typography.Body2>
|
|
26
|
+
</View>
|
|
27
|
+
),
|
|
28
|
+
argTypes: {
|
|
29
|
+
name: {
|
|
30
|
+
control: 'select',
|
|
31
|
+
options: iconList,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
decorators: [withThemeProvider],
|
|
35
|
+
} satisfies Meta<typeof Icon>;
|
|
36
|
+
|
|
37
|
+
export default meta;
|
|
38
|
+
|
|
39
|
+
type Story = StoryObj<typeof meta>;
|
|
40
|
+
|
|
41
|
+
export const Basic: Story = {
|
|
42
|
+
args: {
|
|
43
|
+
name: 'MagnifyingGlass',
|
|
44
|
+
},
|
|
45
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type {RenderAPI} from '@testing-library/react-native';
|
|
3
|
+
import {render} from '@testing-library/react-native';
|
|
4
|
+
import {createComponent} from '../../../../test/testUtils';
|
|
5
|
+
import {Icon} from './Icon';
|
|
6
|
+
|
|
7
|
+
let testingLib: RenderAPI;
|
|
8
|
+
|
|
9
|
+
const Component = (): JSX.Element => createComponent(<Icon name="Person" />);
|
|
10
|
+
|
|
11
|
+
describe('[Icon]', () => {
|
|
12
|
+
it('should render without crashing', () => {
|
|
13
|
+
testingLib = render(Component());
|
|
14
|
+
|
|
15
|
+
const json = testingLib.toJSON();
|
|
16
|
+
|
|
17
|
+
expect(json).toBeTruthy();
|
|
18
|
+
});
|
|
19
|
+
});
|