trepur_components 0.1.8 → 0.1.9
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/package.json +6 -2
- package/.storybook/main.js +0 -32
- package/.storybook/preview.js +0 -9
- package/babel.config.json +0 -18
- package/craco.config.js +0 -10
- package/rollup.config.js +0 -37
- package/src/Components/Breadcrumbs/Breadcrumbs.stories.js +0 -158
- package/src/Components/Breadcrumbs/README.md +0 -0
- package/src/Components/Breadcrumbs/index.js +0 -27
- package/src/Components/BreadcrumbsBordered/BreadcrumbsBordered.stories.js +0 -67
- package/src/Components/BreadcrumbsBordered/README.md +0 -0
- package/src/Components/BreadcrumbsBordered/index.css +0 -67
- package/src/Components/BreadcrumbsBordered/index.js +0 -35
- package/src/Components/Button/Button.stories.js +0 -144
- package/src/Components/Button/README.md +0 -0
- package/src/Components/Button/index.js +0 -26
- package/src/Components/ButtonSlide/ButtonSlide.stories.js +0 -144
- package/src/Components/ButtonSlide/README.md +0 -0
- package/src/Components/ButtonSlide/Styles.css +0 -25
- package/src/Components/ButtonSlide/index.js +0 -26
- package/src/Components/Card/Card.stories.js +0 -190
- package/src/Components/Card/README.md +0 -0
- package/src/Components/Card/index.js +0 -67
- package/src/Components/CardImageLink/CardImageLink.stories.js +0 -73
- package/src/Components/CardImageLink/README.md +0 -0
- package/src/Components/CardImageLink/index.js +0 -22
- package/src/Components/CardImageLinkList/CardImageLinkList.stories.js +0 -50
- package/src/Components/CardImageLinkList/README.md +0 -0
- package/src/Components/CardImageLinkList/index.js +0 -24
- package/src/Components/CardList/CardList.stories.js +0 -39
- package/src/Components/CardList/README.md +0 -0
- package/src/Components/CardList/index.js +0 -29
- package/src/Components/Icon/Icon.stories.js +0 -49
- package/src/Components/Icon/README.md +0 -0
- package/src/Components/Icon/index.js +0 -21
- package/src/Components/Jumbotron/Jumbotron.stories.js +0 -66
- package/src/Components/Jumbotron/README.md +0 -0
- package/src/Components/Jumbotron/index.js +0 -31
- package/src/Components/Nav/Nav.stories.js +0 -89
- package/src/Components/Nav/README.md +0 -0
- package/src/Components/Nav/index.js +0 -109
- package/src/Components/Profile/Profile.stories.js +0 -39
- package/src/Components/Profile/README.md +0 -0
- package/src/Components/Profile/index.js +0 -25
- package/src/Components/Search/README.md +0 -0
- package/src/Components/Search/Search.stories.js +0 -58
- package/src/Components/Search/index.js +0 -26
- package/src/Components/SignedInLinks/README.md +0 -0
- package/src/Components/SignedInLinks/SignedInLinks.stories.js +0 -39
- package/src/Components/SignedInLinks/index.js +0 -14
- package/src/Components/SignedOutLinks/README.md +0 -0
- package/src/Components/SignedOutLinks/SignedOutLinks.stories.js +0 -39
- package/src/Components/SignedOutLinks/index.js +0 -13
- package/src/Components/index.js +0 -3
- package/src/Components/test/index.js +0 -11
- package/src/index.css +0 -4
- package/src/index.js +0 -6
- package/tailwind.config.js +0 -69
package/package.json
CHANGED
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
"name": "trepur_components",
|
|
3
3
|
"description": "component lib",
|
|
4
4
|
"author": "trepur_ttenneb",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.9",
|
|
6
6
|
"private": false,
|
|
7
|
+
"keywords": ["react", "components", "ui"],
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"module": "dist/index.js",
|
|
10
|
+
"files": [ "dist", "README.md" ],
|
|
7
11
|
"dependencies": {
|
|
8
12
|
"@babel/polyfill": "^7.12.1",
|
|
9
13
|
"@craco/craco": "^6.4.0",
|
|
@@ -61,7 +65,6 @@
|
|
|
61
65
|
"@babel/preset-react": "^7.16.7",
|
|
62
66
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
63
67
|
"@storybook/addon-actions": "^6.3.12",
|
|
64
|
-
"@storybook/addon-essentials": "^6.3.12",
|
|
65
68
|
"@storybook/addon-links": "^6.3.12",
|
|
66
69
|
"@storybook/node-logger": "^6.3.12",
|
|
67
70
|
"@storybook/preset-create-react-app": "^3.2.0",
|
|
@@ -72,6 +75,7 @@
|
|
|
72
75
|
"rollup-plugin-babel": "^4.4.0",
|
|
73
76
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
74
77
|
"rollup-plugin-postcss": "^4.0.2",
|
|
78
|
+
"storybook-readme": "^5.0.9",
|
|
75
79
|
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.17"
|
|
76
80
|
}
|
|
77
81
|
}
|
package/.storybook/main.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
"stories": [
|
|
5
|
-
"../src/**/*.stories.mdx",
|
|
6
|
-
"../src/**/*.stories.@(js|jsx|ts|tsx)"
|
|
7
|
-
],
|
|
8
|
-
"addons": [
|
|
9
|
-
"@storybook/addon-links",
|
|
10
|
-
"@storybook/addon-essentials",
|
|
11
|
-
"@storybook/preset-create-react-app"
|
|
12
|
-
],
|
|
13
|
-
webpackFinal: async (config) => {
|
|
14
|
-
config.module.rules.push({
|
|
15
|
-
test: /\.css$/,
|
|
16
|
-
use: [
|
|
17
|
-
{
|
|
18
|
-
loader: 'postcss-loader',
|
|
19
|
-
options: {
|
|
20
|
-
ident: 'postcss',
|
|
21
|
-
plugins: [
|
|
22
|
-
require('tailwindcss'),
|
|
23
|
-
require('autoprefixer'),
|
|
24
|
-
],
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
include: path.resolve(__dirname, '../'),
|
|
29
|
-
})
|
|
30
|
-
return config
|
|
31
|
-
},
|
|
32
|
-
}
|
package/.storybook/preview.js
DELETED
package/babel.config.json
DELETED
package/craco.config.js
DELETED
package/rollup.config.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import babel from 'rollup-plugin-babel';
|
|
2
|
-
import resolve from '@rollup/plugin-node-resolve';
|
|
3
|
-
import external from 'rollup-plugin-peer-deps-external';
|
|
4
|
-
import { terser } from 'rollup-plugin-terser';
|
|
5
|
-
import postcss from 'rollup-plugin-postcss';
|
|
6
|
-
|
|
7
|
-
const config = [
|
|
8
|
-
{
|
|
9
|
-
input: './src/index.js',
|
|
10
|
-
output: [
|
|
11
|
-
{
|
|
12
|
-
file: 'dist/index.js',
|
|
13
|
-
format: 'cjs',
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
file: 'dist/index.es.js',
|
|
17
|
-
format: 'es',
|
|
18
|
-
exports: 'named',
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
plugins: [
|
|
22
|
-
postcss({
|
|
23
|
-
plugins: [],
|
|
24
|
-
minimize: true,
|
|
25
|
-
}),
|
|
26
|
-
babel({
|
|
27
|
-
exclude: 'node_modules/**',
|
|
28
|
-
presets: ['@babel/preset-react']
|
|
29
|
-
}),
|
|
30
|
-
external(),
|
|
31
|
-
resolve(),
|
|
32
|
-
//terser(),
|
|
33
|
-
]
|
|
34
|
-
}
|
|
35
|
-
];
|
|
36
|
-
|
|
37
|
-
export default config
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { action } from '@storybook/addon-actions'
|
|
3
|
-
import Readme from './README.md'
|
|
4
|
-
import BreadCrumbs from './index'
|
|
5
|
-
import '../../index.css';
|
|
6
|
-
|
|
7
|
-
const links = [
|
|
8
|
-
{
|
|
9
|
-
link: '/',
|
|
10
|
-
name: 'link 1'
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
link: '/',
|
|
14
|
-
name: 'link 2'
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
link: '/',
|
|
18
|
-
name: 'Link 3'
|
|
19
|
-
},
|
|
20
|
-
]
|
|
21
|
-
|
|
22
|
-
export default {
|
|
23
|
-
title: 'Components/Breadcrumbs',
|
|
24
|
-
argTypes: {
|
|
25
|
-
label: {
|
|
26
|
-
name: 'Text',
|
|
27
|
-
control: { type: 'text' },
|
|
28
|
-
defaultValue: 'Shop Now',
|
|
29
|
-
},
|
|
30
|
-
type: {
|
|
31
|
-
name: 'Type',
|
|
32
|
-
defaultValue: 'primary',
|
|
33
|
-
options: ['primary', 'secondary', 'ghost'],
|
|
34
|
-
control: { type: 'select' },
|
|
35
|
-
},
|
|
36
|
-
iconPlacement: {
|
|
37
|
-
name: 'Icon',
|
|
38
|
-
defaultValue: 'none',
|
|
39
|
-
options: ['left', 'right', 'both', 'none'],
|
|
40
|
-
control: { type: 'select' },
|
|
41
|
-
},
|
|
42
|
-
padded: {
|
|
43
|
-
name: 'Padded',
|
|
44
|
-
control: { type: 'boolean' },
|
|
45
|
-
defaultValue: false,
|
|
46
|
-
},
|
|
47
|
-
social: {
|
|
48
|
-
name: 'Social',
|
|
49
|
-
defaultValue: 'None',
|
|
50
|
-
options: ['Facebook', 'Twitter', 'Whatsapp', 'None'],
|
|
51
|
-
control: { type: 'select' },
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
decorators: [(story) => <div className={`p-4`}>{story()}</div>],
|
|
55
|
-
parameters: {
|
|
56
|
-
readme: {
|
|
57
|
-
sidebar: Readme,
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export const _Breadcrumbs = (args) => {
|
|
63
|
-
return (
|
|
64
|
-
<BreadCrumbs links={links}>
|
|
65
|
-
</BreadCrumbs>
|
|
66
|
-
)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// export const SecondaryButton = () => {
|
|
70
|
-
// return (
|
|
71
|
-
// <Button ctaText='I am a button'>
|
|
72
|
-
// </Button>
|
|
73
|
-
// )
|
|
74
|
-
// }
|
|
75
|
-
|
|
76
|
-
// export const WithIconRight = () => {
|
|
77
|
-
// return (
|
|
78
|
-
// <Button rightIcon='thumbs-up' ctaText='I am a button'>
|
|
79
|
-
// </Button>
|
|
80
|
-
// )
|
|
81
|
-
// }
|
|
82
|
-
|
|
83
|
-
// WithIconRight.story = {
|
|
84
|
-
// name: 'With Icon (right)',
|
|
85
|
-
// }
|
|
86
|
-
|
|
87
|
-
// export const WithIconLeft = () => {
|
|
88
|
-
// return (
|
|
89
|
-
// <Button leftIcon='sign-in' ctaText='I am a button'>
|
|
90
|
-
// </Button>
|
|
91
|
-
// )
|
|
92
|
-
// }
|
|
93
|
-
|
|
94
|
-
// WithIconLeft.story = {
|
|
95
|
-
// name: 'With Icon (left)',
|
|
96
|
-
// }
|
|
97
|
-
|
|
98
|
-
// export const WithBothIcons = () => {
|
|
99
|
-
// return (
|
|
100
|
-
// <Button leftIcon='star' rightIcon='star' ctaText='I am a button'>
|
|
101
|
-
// </Button>
|
|
102
|
-
// )
|
|
103
|
-
// }
|
|
104
|
-
|
|
105
|
-
// export const ButtonAsExternalLink = () => {
|
|
106
|
-
// return (
|
|
107
|
-
// <Button as='a-external' ctaText='I am a button'>
|
|
108
|
-
// </Button>
|
|
109
|
-
// )
|
|
110
|
-
// }
|
|
111
|
-
|
|
112
|
-
// ButtonAsExternalLink.story = {
|
|
113
|
-
// name: 'Button as external link',
|
|
114
|
-
// }
|
|
115
|
-
|
|
116
|
-
// export const ButtonAsSemanticHtmlButton = () => {
|
|
117
|
-
// return (
|
|
118
|
-
// <Button as='button' htmlType='button' ctaText='I am a button' url='/'>
|
|
119
|
-
// </Button>
|
|
120
|
-
// )
|
|
121
|
-
// }
|
|
122
|
-
|
|
123
|
-
// ButtonAsSemanticHtmlButton.story = {
|
|
124
|
-
// name: 'Button as semantic html button',
|
|
125
|
-
// }
|
|
126
|
-
|
|
127
|
-
// export const ButtonAsSemanticHtmlSubmitButton = () => {
|
|
128
|
-
// return (
|
|
129
|
-
// <Button as='button' htmlType='submit' ctaText='I am a button'>
|
|
130
|
-
// </Button>
|
|
131
|
-
// )
|
|
132
|
-
// }
|
|
133
|
-
|
|
134
|
-
// ButtonAsSemanticHtmlSubmitButton.story = {
|
|
135
|
-
// name: 'Button as semantic html submit button',
|
|
136
|
-
// }
|
|
137
|
-
|
|
138
|
-
// export const ButtonAsInternalLink = () => {
|
|
139
|
-
// return (
|
|
140
|
-
// <Button as='Link' ctaText='I am a button' url='/'>
|
|
141
|
-
// </Button>
|
|
142
|
-
// )
|
|
143
|
-
// }
|
|
144
|
-
|
|
145
|
-
// ButtonAsInternalLink.story = {
|
|
146
|
-
// name: 'Button as internal link',
|
|
147
|
-
// }
|
|
148
|
-
|
|
149
|
-
// export const WithOnClickMethod = () => {
|
|
150
|
-
// return (
|
|
151
|
-
// <Button ctaText='I am a button' onClick={action('button-click')}>
|
|
152
|
-
// </Button>
|
|
153
|
-
// )
|
|
154
|
-
// }
|
|
155
|
-
|
|
156
|
-
// WithOnClickMethod.story = {
|
|
157
|
-
// name: 'With onClick method',
|
|
158
|
-
// }
|
|
File without changes
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const Breadcrumbs = ({
|
|
2
|
-
className,
|
|
3
|
-
links,
|
|
4
|
-
}) => {
|
|
5
|
-
const linksLength = Object.keys(links).length
|
|
6
|
-
let classes = className + ' flex py-2 px-8 '
|
|
7
|
-
return (
|
|
8
|
-
<ul className={classes}>
|
|
9
|
-
{links && links.map((link, i) => {
|
|
10
|
-
return (
|
|
11
|
-
<div key={link.name}>
|
|
12
|
-
<li>
|
|
13
|
-
<div className='flex'>
|
|
14
|
-
{i+1 >= linksLength ? <p className=''>{link.name}</p> : <a className='text-social-facebook hover:underline' href={link.link}>
|
|
15
|
-
{link.name}
|
|
16
|
-
</a>}
|
|
17
|
-
{i+1 < linksLength ? <p> > </p> : null}
|
|
18
|
-
</div>
|
|
19
|
-
</li>
|
|
20
|
-
</div>
|
|
21
|
-
)
|
|
22
|
-
})}
|
|
23
|
-
</ul>
|
|
24
|
-
)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default Breadcrumbs
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import Readme from './README.md'
|
|
3
|
-
import Breadcrumbs from './index'
|
|
4
|
-
import './index.css';
|
|
5
|
-
|
|
6
|
-
const links = [
|
|
7
|
-
{
|
|
8
|
-
link: '/',
|
|
9
|
-
name: 'link 1'
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
link: '/',
|
|
13
|
-
name: 'link 2'
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
link: '/',
|
|
17
|
-
name: 'Link 3'
|
|
18
|
-
},
|
|
19
|
-
]
|
|
20
|
-
|
|
21
|
-
export default {
|
|
22
|
-
title: 'Components/BreadcrumbsBordered',
|
|
23
|
-
argTypes: {
|
|
24
|
-
label: {
|
|
25
|
-
name: 'Text',
|
|
26
|
-
control: { type: 'text' },
|
|
27
|
-
defaultValue: 'Shop Now',
|
|
28
|
-
},
|
|
29
|
-
type: {
|
|
30
|
-
name: 'Type',
|
|
31
|
-
defaultValue: 'primary',
|
|
32
|
-
options: ['primary', 'secondary', 'ghost'],
|
|
33
|
-
control: { type: 'select' },
|
|
34
|
-
},
|
|
35
|
-
iconPlacement: {
|
|
36
|
-
name: 'Icon',
|
|
37
|
-
defaultValue: 'none',
|
|
38
|
-
options: ['left', 'right', 'both', 'none'],
|
|
39
|
-
control: { type: 'select' },
|
|
40
|
-
},
|
|
41
|
-
padded: {
|
|
42
|
-
name: 'Padded',
|
|
43
|
-
control: { type: 'boolean' },
|
|
44
|
-
defaultValue: false,
|
|
45
|
-
},
|
|
46
|
-
social: {
|
|
47
|
-
name: 'Social',
|
|
48
|
-
defaultValue: 'None',
|
|
49
|
-
options: ['Facebook', 'Twitter', 'Whatsapp', 'None'],
|
|
50
|
-
control: { type: 'select' },
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
decorators: [(story) => <div className={`p-4`}>{story()}</div>],
|
|
54
|
-
|
|
55
|
-
parameters: {
|
|
56
|
-
readme: {
|
|
57
|
-
sidebar: Readme,
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export const _Breadcrumbs = (args) => {
|
|
63
|
-
return (
|
|
64
|
-
<Breadcrumbs links={links}>
|
|
65
|
-
</Breadcrumbs>
|
|
66
|
-
)
|
|
67
|
-
}
|
|
File without changes
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
@tailwind base;
|
|
2
|
-
@tailwind components;
|
|
3
|
-
@tailwind utilities;
|
|
4
|
-
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css');
|
|
5
|
-
|
|
6
|
-
.right-arrow {
|
|
7
|
-
@apply w-0;
|
|
8
|
-
@apply h-0;
|
|
9
|
-
border-top: 17px solid transparent;
|
|
10
|
-
border-bottom: 17px solid transparent;
|
|
11
|
-
border-left: 15px solid theme('colors.brand-border');
|
|
12
|
-
@apply absolute;
|
|
13
|
-
right: -15px;
|
|
14
|
-
@apply top-0;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.let-arrow {
|
|
18
|
-
@apply w-0;
|
|
19
|
-
@apply h-0;
|
|
20
|
-
border-top: 17px solid transparent;
|
|
21
|
-
border-bottom: 17px solid transparent;
|
|
22
|
-
border-left: 17px solid theme('colors.white');
|
|
23
|
-
@apply absolute;
|
|
24
|
-
left: 0px;
|
|
25
|
-
@apply top-0;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.test-arrow {
|
|
29
|
-
@apply w-0;
|
|
30
|
-
@apply h-0;
|
|
31
|
-
border-top: 17px solid transparent;
|
|
32
|
-
border-bottom: 17px solid transparent;
|
|
33
|
-
border-left: 15px solid theme('colors.brand-border');
|
|
34
|
-
@apply absolute;
|
|
35
|
-
left: -8px;
|
|
36
|
-
bottom: -11px;
|
|
37
|
-
transform: rotate(48deg);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.test-arrow-top {
|
|
41
|
-
@apply w-0;
|
|
42
|
-
@apply h-0;
|
|
43
|
-
border-top: 15px solid theme('colors.brand-border');
|
|
44
|
-
border-bottom: 17px solid transparent;
|
|
45
|
-
border-left: 17px solid transparent;
|
|
46
|
-
@apply absolute;
|
|
47
|
-
left: -17px;
|
|
48
|
-
top: 0px;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.voucherCode__btn {
|
|
52
|
-
@apply relative;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.voucherCode__btn:hover .right-arrow {
|
|
56
|
-
border-left-color: theme('colors.brand-primary');
|
|
57
|
-
}
|
|
58
|
-
.voucherCode__btn:hover .test-arrow {
|
|
59
|
-
border-left-color: theme('colors.brand-primary');
|
|
60
|
-
}
|
|
61
|
-
.voucherCode__btn:hover .test-arrow-top {
|
|
62
|
-
border-top-color: theme('colors.brand-primary');
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.voucherCode__code:focus {
|
|
66
|
-
@apply border-0;
|
|
67
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
const Breadcrumbs = ({
|
|
2
|
-
className,
|
|
3
|
-
links,
|
|
4
|
-
}) => {
|
|
5
|
-
const linksLength = Object.keys(links).length
|
|
6
|
-
let classes = 'flex py-2 px-8 ' + className
|
|
7
|
-
return (
|
|
8
|
-
<ul className={classes}>
|
|
9
|
-
{links && links.map((link, i) => {
|
|
10
|
-
return (
|
|
11
|
-
<div key={link.name}>
|
|
12
|
-
<li>
|
|
13
|
-
<div className=' px-4 mx-3 hover:bg-brand-primary bg-brand-border border-brand-primary voucherCode__btn h-8'>
|
|
14
|
-
{i+1 >= linksLength ?
|
|
15
|
-
<p className='pl-2 pt-1'><span className='test-arrow'></span><span className='test-arrow-top'></span><span className='left-arrow'></span>{link.name}<span className='right-arrow'></span></p>
|
|
16
|
-
:
|
|
17
|
-
<a href={link.link}><p className={i !== 0 ? 'pl-2 pt-1 text-social-facebook hover:underline':'pt-1 text-social-facebook hover:underline'}>
|
|
18
|
-
<span className='test-arrow'></span>
|
|
19
|
-
<span className='test-arrow-top'></span>
|
|
20
|
-
{i !== 0 ? <span className='left-arrow'></span> : null}
|
|
21
|
-
{link.name}
|
|
22
|
-
<span className='right-arrow'></span>
|
|
23
|
-
</p>
|
|
24
|
-
</a>
|
|
25
|
-
}
|
|
26
|
-
</div>
|
|
27
|
-
</li>
|
|
28
|
-
</div>
|
|
29
|
-
)
|
|
30
|
-
})}
|
|
31
|
-
</ul>
|
|
32
|
-
)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export default Breadcrumbs
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { action } from '@storybook/addon-actions'
|
|
3
|
-
import Readme from './README.md'
|
|
4
|
-
import Button from './index'
|
|
5
|
-
import '../../index.css';
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
title: 'Components/Button',
|
|
9
|
-
argTypes: {
|
|
10
|
-
label: {
|
|
11
|
-
name: 'Text',
|
|
12
|
-
control: { type: 'text' },
|
|
13
|
-
defaultValue: 'Shop Now',
|
|
14
|
-
},
|
|
15
|
-
type: {
|
|
16
|
-
name: 'Type',
|
|
17
|
-
defaultValue: 'primary',
|
|
18
|
-
options: ['primary', 'secondary', 'ghost'],
|
|
19
|
-
control: { type: 'select' },
|
|
20
|
-
},
|
|
21
|
-
iconPlacement: {
|
|
22
|
-
name: 'Icon',
|
|
23
|
-
defaultValue: 'none',
|
|
24
|
-
options: ['left', 'right', 'both', 'none'],
|
|
25
|
-
control: { type: 'select' },
|
|
26
|
-
},
|
|
27
|
-
padded: {
|
|
28
|
-
name: 'Padded',
|
|
29
|
-
control: { type: 'boolean' },
|
|
30
|
-
defaultValue: false,
|
|
31
|
-
},
|
|
32
|
-
social: {
|
|
33
|
-
name: 'Social',
|
|
34
|
-
defaultValue: 'None',
|
|
35
|
-
options: ['Facebook', 'Twitter', 'Whatsapp', 'None'],
|
|
36
|
-
control: { type: 'select' },
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
decorators: [(story) => <div className={`p-4`}>{story()}</div>],
|
|
40
|
-
|
|
41
|
-
parameters: {
|
|
42
|
-
readme: {
|
|
43
|
-
sidebar: Readme,
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export const _Button = (args) => {
|
|
49
|
-
return (
|
|
50
|
-
<Button ctaText='I am a button'>
|
|
51
|
-
</Button>
|
|
52
|
-
)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export const SecondaryButton = () => {
|
|
56
|
-
return (
|
|
57
|
-
<Button ctaText='I am a button'>
|
|
58
|
-
</Button>
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export const WithIconRight = () => {
|
|
63
|
-
return (
|
|
64
|
-
<Button rightIcon='thumbs-up' ctaText='I am a button'>
|
|
65
|
-
</Button>
|
|
66
|
-
)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
WithIconRight.story = {
|
|
70
|
-
name: 'With Icon (right)',
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export const WithIconLeft = () => {
|
|
74
|
-
return (
|
|
75
|
-
<Button leftIcon='sign-in' ctaText='I am a button'>
|
|
76
|
-
</Button>
|
|
77
|
-
)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
WithIconLeft.story = {
|
|
81
|
-
name: 'With Icon (left)',
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export const WithBothIcons = () => {
|
|
85
|
-
return (
|
|
86
|
-
<Button leftIcon='star' rightIcon='star' ctaText='I am a button'>
|
|
87
|
-
</Button>
|
|
88
|
-
)
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export const ButtonAsExternalLink = () => {
|
|
92
|
-
return (
|
|
93
|
-
<Button as='a-external' ctaText='I am a button'>
|
|
94
|
-
</Button>
|
|
95
|
-
)
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
ButtonAsExternalLink.story = {
|
|
99
|
-
name: 'Button as external link',
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export const ButtonAsSemanticHtmlButton = () => {
|
|
103
|
-
return (
|
|
104
|
-
<Button as='button' htmlType='button' ctaText='I am a button' url='/'>
|
|
105
|
-
</Button>
|
|
106
|
-
)
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
ButtonAsSemanticHtmlButton.story = {
|
|
110
|
-
name: 'Button as semantic html button',
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export const ButtonAsSemanticHtmlSubmitButton = () => {
|
|
114
|
-
return (
|
|
115
|
-
<Button as='button' htmlType='submit' ctaText='I am a button'>
|
|
116
|
-
</Button>
|
|
117
|
-
)
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
ButtonAsSemanticHtmlSubmitButton.story = {
|
|
121
|
-
name: 'Button as semantic html submit button',
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export const ButtonAsInternalLink = () => {
|
|
125
|
-
return (
|
|
126
|
-
<Button as='Link' ctaText='I am a button' url='/'>
|
|
127
|
-
</Button>
|
|
128
|
-
)
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
ButtonAsInternalLink.story = {
|
|
132
|
-
name: 'Button as internal link',
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export const WithOnClickMethod = () => {
|
|
136
|
-
return (
|
|
137
|
-
<Button ctaText='I am a button' onClick={action('button-click')}>
|
|
138
|
-
</Button>
|
|
139
|
-
)
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
WithOnClickMethod.story = {
|
|
143
|
-
name: 'With onClick method',
|
|
144
|
-
}
|
|
File without changes
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import Icon from '../Icon/index'
|
|
2
|
-
|
|
3
|
-
const Button = ({
|
|
4
|
-
ctaText,
|
|
5
|
-
ctaLink,
|
|
6
|
-
className,
|
|
7
|
-
onClick,
|
|
8
|
-
leftIcon,
|
|
9
|
-
rightIcon,
|
|
10
|
-
}) => {
|
|
11
|
-
let classes = className + ' py-2 px-8 rounded-lg text-black border-2 border-black border-gray-300 bg-white hover:bg-red hover:text-black transition-background-color duration-500 transform'
|
|
12
|
-
let iconLeft = <Icon type={leftIcon}></Icon>
|
|
13
|
-
let iconRight = <Icon type={rightIcon}></Icon>
|
|
14
|
-
return (
|
|
15
|
-
<button
|
|
16
|
-
className={classes}
|
|
17
|
-
onClick={onClick}
|
|
18
|
-
>
|
|
19
|
-
{leftIcon && iconLeft}
|
|
20
|
-
{ctaText}
|
|
21
|
-
{rightIcon && iconRight}
|
|
22
|
-
</button>
|
|
23
|
-
)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export default Button
|