trepur_components 0.1.0

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.
Files changed (93) hide show
  1. package/.storybook/main.js +32 -0
  2. package/.storybook/preview.js +9 -0
  3. package/README.md +70 -0
  4. package/babel.config.json +18 -0
  5. package/craco.config.js +10 -0
  6. package/dist/App.css +42 -0
  7. package/dist/App.js +24 -0
  8. package/dist/Components/Breadcrumbs/Breadcrumbs.js +32 -0
  9. package/dist/Components/Breadcrumbs/Breadcrumbs.stories.js +164 -0
  10. package/dist/Components/Breadcrumbs/README.md +1 -0
  11. package/dist/Components/BreadcrumbsBordered/Breadcrumbs.js +49 -0
  12. package/dist/Components/BreadcrumbsBordered/Breadcrumbs.stories.js +164 -0
  13. package/dist/Components/BreadcrumbsBordered/README.md +1 -0
  14. package/dist/Components/Button/Button.js +35 -0
  15. package/dist/Components/Button/Button.stories.js +185 -0
  16. package/dist/Components/Button/README.md +1 -0
  17. package/dist/Components/ButtonSlide/ButtonSlide.js +37 -0
  18. package/dist/Components/ButtonSlide/ButtonSlide.stories.js +185 -0
  19. package/dist/Components/ButtonSlide/README.md +1 -0
  20. package/dist/Components/ButtonSlide/Styles.css +25 -0
  21. package/dist/Components/Card/Card.js +83 -0
  22. package/dist/Components/Card/Card.stories.js +204 -0
  23. package/dist/Components/Card/README.md +1 -0
  24. package/dist/Components/CardImageLink/CardImageLink.js +36 -0
  25. package/dist/Components/CardImageLink/CardImageLink.stories.js +89 -0
  26. package/dist/Components/CardImageLink/README.md +0 -0
  27. package/dist/Components/CardImageLinkList/CardImageLinkList.js +35 -0
  28. package/dist/Components/CardImageLinkList/CardImageLinkList.stories.js +63 -0
  29. package/dist/Components/CardImageLinkList/README.md +0 -0
  30. package/dist/Components/CardList/CardList.js +36 -0
  31. package/dist/Components/CardList/CardList.stories.js +204 -0
  32. package/dist/Components/CardList/README.md +1 -0
  33. package/dist/Components/Icon/Icon.js +45 -0
  34. package/dist/Components/Icon/Icon.stories.js +73 -0
  35. package/dist/Components/Icon/README.md +1 -0
  36. package/dist/Components/Jumbotron/Jumbotron.js +43 -0
  37. package/dist/Components/Jumbotron/Jumbotron.stories.js +81 -0
  38. package/dist/Components/Jumbotron/README.md +0 -0
  39. package/dist/Components/Nav.js +170 -0
  40. package/dist/Components/Profile.js +41 -0
  41. package/dist/Components/Search.js +43 -0
  42. package/dist/Components/SignedInLinks.js +27 -0
  43. package/dist/Components/SignedOutLinks.js +22 -0
  44. package/dist/index.css +67 -0
  45. package/dist/index.js +19 -0
  46. package/package.json +71 -0
  47. package/public/Breadcrumbs/Breadcrumbs.stories.js +144 -0
  48. package/public/Logo.png +0 -0
  49. package/public/index.html +10 -0
  50. package/public/manifest.json +25 -0
  51. package/public/robots.txt +3 -0
  52. package/public/user.jpeg +0 -0
  53. package/src/App.css +42 -0
  54. package/src/App.js +23 -0
  55. package/src/Components/Breadcrumbs/Breadcrumbs.js +27 -0
  56. package/src/Components/Breadcrumbs/Breadcrumbs.stories.js +158 -0
  57. package/src/Components/Breadcrumbs/README.md +1 -0
  58. package/src/Components/BreadcrumbsBordered/Breadcrumbs.js +35 -0
  59. package/src/Components/BreadcrumbsBordered/Breadcrumbs.stories.js +159 -0
  60. package/src/Components/BreadcrumbsBordered/README.md +1 -0
  61. package/src/Components/Button/Button.js +26 -0
  62. package/src/Components/Button/Button.stories.js +144 -0
  63. package/src/Components/Button/README.md +1 -0
  64. package/src/Components/ButtonSlide/ButtonSlide.js +26 -0
  65. package/src/Components/ButtonSlide/ButtonSlide.stories.js +144 -0
  66. package/src/Components/ButtonSlide/README.md +1 -0
  67. package/src/Components/ButtonSlide/Styles.css +25 -0
  68. package/src/Components/Card/Card.js +67 -0
  69. package/src/Components/Card/Card.stories.js +190 -0
  70. package/src/Components/Card/README.md +1 -0
  71. package/src/Components/CardImageLink/CardImageLink.js +22 -0
  72. package/src/Components/CardImageLink/CardImageLink.stories.js +73 -0
  73. package/src/Components/CardImageLink/README.md +0 -0
  74. package/src/Components/CardImageLinkList/CardImageLinkList.js +24 -0
  75. package/src/Components/CardImageLinkList/CardImageLinkList.stories.js +50 -0
  76. package/src/Components/CardImageLinkList/README.md +0 -0
  77. package/src/Components/CardList/CardList.js +29 -0
  78. package/src/Components/CardList/CardList.stories.js +201 -0
  79. package/src/Components/CardList/README.md +1 -0
  80. package/src/Components/Icon/Icon.js +28 -0
  81. package/src/Components/Icon/Icon.stories.js +49 -0
  82. package/src/Components/Icon/README.md +1 -0
  83. package/src/Components/Jumbotron/Jumbotron.js +31 -0
  84. package/src/Components/Jumbotron/Jumbotron.stories.js +66 -0
  85. package/src/Components/Jumbotron/README.md +0 -0
  86. package/src/Components/Nav.js +109 -0
  87. package/src/Components/Profile.js +25 -0
  88. package/src/Components/Search.js +26 -0
  89. package/src/Components/SignedInLinks.js +14 -0
  90. package/src/Components/SignedOutLinks.js +11 -0
  91. package/src/index.css +67 -0
  92. package/src/index.js +4 -0
  93. package/tailwind.config.js +69 -0
package/package.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "trepur_components",
3
+ "description": "component lib",
4
+ "author": "trepur_ttenneb",
5
+ "version": "0.1.0",
6
+ "private": false,
7
+ "dependencies": {
8
+ "@babel/polyfill": "^7.12.1",
9
+ "@craco/craco": "^6.4.0",
10
+ "@storybook/addon-knobs": "^6.3.1",
11
+ "@testing-library/jest-dom": "^5.14.1",
12
+ "@testing-library/react": "^11.2.7",
13
+ "@testing-library/user-event": "^12.8.3",
14
+ "react": "^17.0.2",
15
+ "react-dom": "^17.0.2",
16
+ "react-router-dom": "^6.2.1",
17
+ "react-scripts": "4.0.3",
18
+ "storybook": "^6.4.10",
19
+ "web-vitals": "^1.1.2"
20
+ },
21
+ "scripts": {
22
+ "start": "craco start",
23
+ "build": "rm -rf dist && NODE_ENV=production babel src --out-dir dist --copy-files",
24
+ "test": "craco test",
25
+ "eject": "react-scripts eject",
26
+ "storybook": "start-storybook -p 6006 -s public",
27
+ "build-storybook": "build-storybook -s public"
28
+ },
29
+ "eslintConfig": {
30
+ "extends": [
31
+ "react-app",
32
+ "react-app/jest"
33
+ ],
34
+ "overrides": [
35
+ {
36
+ "files": [
37
+ "**/*.stories.*"
38
+ ],
39
+ "rules": {
40
+ "import/no-anonymous-default-export": "off"
41
+ }
42
+ }
43
+ ]
44
+ },
45
+ "browserslist": {
46
+ "production": [
47
+ ">0.2%",
48
+ "not dead",
49
+ "not op_mini all"
50
+ ],
51
+ "development": [
52
+ "last 1 chrome version",
53
+ "last 1 firefox version",
54
+ "last 1 safari version"
55
+ ]
56
+ },
57
+ "devDependencies": {
58
+ "@babel/cli": "^7.16.8",
59
+ "@babel/core": "^7.16.7",
60
+ "@babel/preset-env": "^7.16.8",
61
+ "@storybook/addon-actions": "^6.3.12",
62
+ "@storybook/addon-essentials": "^6.3.12",
63
+ "@storybook/addon-links": "^6.3.12",
64
+ "@storybook/node-logger": "^6.3.12",
65
+ "@storybook/preset-create-react-app": "^3.2.0",
66
+ "@storybook/react": "^6.3.12",
67
+ "autoprefixer": "^9.8.8",
68
+ "postcss": "^7.0.39",
69
+ "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.17"
70
+ }
71
+ }
@@ -0,0 +1,144 @@
1
+ import React from 'react'
2
+ import { action } from '@storybook/addon-actions'
3
+ import Readme from './README.md'
4
+ import Button from '../../../public/Button/Button'
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
+ }
Binary file
@@ -0,0 +1,10 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ </head>
7
+ <body>
8
+ <div id="root"></div>
9
+ </body>
10
+ </html>
@@ -0,0 +1,25 @@
1
+ {
2
+ "short_name": "React App",
3
+ "name": "Create React App Sample",
4
+ "icons": [
5
+ {
6
+ "src": "favicon.ico",
7
+ "sizes": "64x64 32x32 24x24 16x16",
8
+ "type": "image/x-icon"
9
+ },
10
+ {
11
+ "src": "logo192.png",
12
+ "type": "image/png",
13
+ "sizes": "192x192"
14
+ },
15
+ {
16
+ "src": "logo512.png",
17
+ "type": "image/png",
18
+ "sizes": "512x512"
19
+ }
20
+ ],
21
+ "start_url": ".",
22
+ "display": "standalone",
23
+ "theme_color": "#000000",
24
+ "background_color": "#ffffff"
25
+ }
@@ -0,0 +1,3 @@
1
+ # https://www.robotstxt.org/robotstxt.html
2
+ User-agent: *
3
+ Disallow:
Binary file
package/src/App.css ADDED
@@ -0,0 +1,42 @@
1
+ .App {
2
+ text-align: center;
3
+ }
4
+
5
+ .App-logo {
6
+ height: 40vmin;
7
+ pointer-events: none;
8
+ }
9
+
10
+ @media (prefers-reduced-motion: no-preference) {
11
+ .App-logo {
12
+ animation: App-logo-spin infinite 20s linear;
13
+ }
14
+ }
15
+
16
+ .App-header {
17
+ background-color: #282c34;
18
+ min-height: 100vh;
19
+ display: flex;
20
+ flex-direction: column;
21
+ align-items: center;
22
+ justify-content: center;
23
+ font-size: calc(10px + 2vmin);
24
+ color: white;
25
+ }
26
+
27
+ .App-link {
28
+ color: #61dafb;
29
+ }
30
+
31
+ @keyframes App-logo-spin {
32
+ from {
33
+ transform: rotate(0deg);
34
+ }
35
+ to {
36
+ transform: rotate(360deg);
37
+ }
38
+ }
39
+
40
+ react-calendar__tile--now {
41
+ background: #31A3DD !important;
42
+ }
package/src/App.js ADDED
@@ -0,0 +1,23 @@
1
+ import './App.css';
2
+
3
+ function App() {
4
+ return (
5
+ <div className="App">
6
+ <header className="App-header">
7
+ <p>
8
+ Edit <code>src/App.js</code> and save to reload.
9
+ </p>
10
+ <a
11
+ className="App-link"
12
+ href="https://reactjs.org"
13
+ target="_blank"
14
+ rel="noopener noreferrer"
15
+ >
16
+ Learn React
17
+ </a>
18
+ </header>
19
+ </div>
20
+ );
21
+ }
22
+
23
+ export default App;
@@ -0,0 +1,27 @@
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>&nbsp; &#62; &nbsp;</p> : null}
18
+ </div>
19
+ </li>
20
+ </div>
21
+ )
22
+ })}
23
+ </ul>
24
+ )
25
+ }
26
+
27
+ export default Breadcrumbs
@@ -0,0 +1,158 @@
1
+ import React from 'react'
2
+ import { action } from '@storybook/addon-actions'
3
+ import Readme from './README.md'
4
+ import BreadCrumbs from './Breadcrumbs'
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
+ // }
@@ -0,0 +1 @@
1
+ hello this is an icon
@@ -0,0 +1,35 @@
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