imbric-theme 0.3.1 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. package/.storybook/main.js +1 -1
  2. package/atoms/AlertModal/AlertModal.js +77 -0
  3. package/atoms/AlertModal/AlertModal.module.css +3 -0
  4. package/atoms/AlertModal/AlertModal.stories.js +30 -0
  5. package/atoms/AlertModal/constants.js +4 -0
  6. package/atoms/AlertModal/index.js +3 -0
  7. package/atoms/Button/Button.js +5 -2
  8. package/atoms/Button/Button.module.css +6 -3
  9. package/atoms/Checkbox/Checkbox.js +49 -0
  10. package/atoms/Checkbox/Checkbox.module.css +3 -0
  11. package/atoms/Checkbox/Checkbox.stories.js +28 -0
  12. package/atoms/Checkbox/constants.js +1 -0
  13. package/atoms/Checkbox/index.js +3 -0
  14. package/atoms/Heading/Heading.js +1 -1
  15. package/atoms/Heading/Heading.module.css +4 -0
  16. package/atoms/Heading/constants.js +1 -1
  17. package/atoms/Icon/constants.js +30 -6
  18. package/atoms/Icon/file-download-svgrepo-com.svg +13 -0
  19. package/atoms/Input/Input.js +21 -5
  20. package/atoms/Input/Input.module.css +26 -6
  21. package/atoms/Input/Input.stories.js +8 -2
  22. package/atoms/Input/__snapshots__/Input.stories.js.snap +5 -5
  23. package/atoms/Input/constants.js +1 -1
  24. package/atoms/Label/Label.js +31 -0
  25. package/atoms/Label/Label.module.css +38 -0
  26. package/atoms/Label/Label.stories.js +26 -0
  27. package/atoms/Label/constants.js +1 -0
  28. package/atoms/Label/index.js +3 -0
  29. package/atoms/Paragraph/Paragraph.module.css +4 -0
  30. package/index.js +20 -1
  31. package/jest.config.js +1 -1
  32. package/layout/DynamicTable/DynamicTable.js +207 -0
  33. package/layout/DynamicTable/DynamicTable.module.css +62 -0
  34. package/layout/DynamicTable/DynamicTable.stories.js +30 -0
  35. package/layout/DynamicTable/constants.js +840 -0
  36. package/layout/DynamicTable/index.js +3 -0
  37. package/layout/Navbar/Navbar.js +19 -11
  38. package/layout/Navbar/Navbar.module.css +4 -2
  39. package/layout/Navbar/Navbar.stories.js +2 -1
  40. package/layout/Sidebar/Sidebar.js +5 -3
  41. package/layout/Sidebar/Sidebar.module.css +1 -10
  42. package/layout/Sidebar/Sidebar.stories.js +1 -1
  43. package/layout/Sidebar/constants.js +228 -205
  44. package/molecules/CheckList/CheckList.js +135 -0
  45. package/molecules/CheckList/CheckList.module.css +94 -0
  46. package/molecules/CheckList/CheckList.stories.js +25 -0
  47. package/molecules/CheckList/constants.js +23 -0
  48. package/molecules/CheckList/index.js +3 -0
  49. package/molecules/ColumnTable/ColumnTable.js +123 -0
  50. package/molecules/ColumnTable/ColumnTable.module.css +9 -0
  51. package/molecules/ColumnTable/ColumnTable.stories.js +29 -0
  52. package/molecules/ColumnTable/constants.js +1 -0
  53. package/molecules/ColumnTable/index.js +3 -0
  54. package/molecules/DatePicker/DatePicker.js +223 -0
  55. package/molecules/DatePicker/DatePicker.module.css +38 -0
  56. package/molecules/DatePicker/DatePicker.stories.js +23 -0
  57. package/molecules/DatePicker/constants.js +3 -0
  58. package/molecules/DatePicker/index.js +3 -0
  59. package/molecules/Dropdown/Dropdown.js +25 -22
  60. package/molecules/Dropdown/Dropdown.module.css +21 -3
  61. package/molecules/DynamicSelect/DynamicSelect.js +109 -0
  62. package/molecules/DynamicSelect/DynamicSelect.module.css +10 -0
  63. package/molecules/DynamicSelect/DynamicSelect.stories.js +32 -0
  64. package/molecules/DynamicSelect/constants.js +7 -0
  65. package/molecules/DynamicSelect/index.js +3 -0
  66. package/molecules/Error/Error.js +2 -2
  67. package/molecules/Error/Error.module.css +3 -2
  68. package/molecules/ItemMenu/ItemMenu.js +34 -31
  69. package/molecules/ItemMenu/ItemMenu.module.css +13 -4
  70. package/molecules/ItemMenu/ItemMenu.stories.js +2 -1
  71. package/molecules/ItemMenu/constants.js +3 -0
  72. package/molecules/RowTable/RowTable.js +22 -0
  73. package/molecules/RowTable/RowTable.module.css +3 -0
  74. package/molecules/RowTable/RowTable.stories.js +23 -0
  75. package/molecules/RowTable/constants.js +1 -0
  76. package/molecules/RowTable/index.js +3 -0
  77. package/package.json +11 -2
  78. package/pages/Login/Login.js +102 -0
  79. package/pages/Login/Login.module.css +5 -0
  80. package/pages/Login/Login.stories.js +23 -0
  81. package/pages/Login/constants.js +1 -0
  82. package/pages/Login/index.js +3 -0
  83. package/pages/Login/validation/loginSchema.js +5 -0
  84. package/public/static/logologin.svg +16 -0
  85. package/scripts/create-component.js +2 -1
  86. package/storybook-static/0.263f852f.iframe.bundle.js +1 -0
  87. package/storybook-static/0.91dbd3f3aa2099d25061.manager.bundle.js +1 -0
  88. package/storybook-static/1.17e9ac7e.iframe.bundle.js +3 -0
  89. package/storybook-static/1.17e9ac7e.iframe.bundle.js.LICENSE.txt +8 -0
  90. package/storybook-static/1.17e9ac7e.iframe.bundle.js.map +1 -0
  91. package/storybook-static/2.cc4000c2.iframe.bundle.js +1 -0
  92. package/storybook-static/3.e9f95d01.iframe.bundle.js +1 -0
  93. package/storybook-static/4.be0a752c9f5176d6eec1.manager.bundle.js +2 -0
  94. package/storybook-static/4.be0a752c9f5176d6eec1.manager.bundle.js.LICENSE.txt +8 -0
  95. package/storybook-static/5.8efdde123acaf8fbb100.manager.bundle.js +1 -0
  96. package/storybook-static/6.2f82294ae0b087aecb24.manager.bundle.js +2 -0
  97. package/storybook-static/6.2f82294ae0b087aecb24.manager.bundle.js.LICENSE.txt +12 -0
  98. package/storybook-static/7.97068037.iframe.bundle.js +1 -0
  99. package/storybook-static/7.fa9452d2609e8a00f314.manager.bundle.js +1 -0
  100. package/storybook-static/8.66f5ef1c66fc4628f127.manager.bundle.js +1 -0
  101. package/storybook-static/8.b545d602.iframe.bundle.js +3 -0
  102. package/storybook-static/8.b545d602.iframe.bundle.js.LICENSE.txt +12 -0
  103. package/storybook-static/8.b545d602.iframe.bundle.js.map +1 -0
  104. package/storybook-static/9.269ed917.iframe.bundle.js +1 -0
  105. package/storybook-static/favicon.ico +0 -0
  106. package/storybook-static/iframe.html +348 -0
  107. package/storybook-static/index.html +59 -0
  108. package/storybook-static/main.157061c9.iframe.bundle.js +1 -0
  109. package/storybook-static/main.5a07347846ccf2d7e5dc.manager.bundle.js +1 -0
  110. package/storybook-static/runtime~main.a14e6e62.iframe.bundle.js +1 -0
  111. package/storybook-static/runtime~main.f78c3fae275fc212c109.manager.bundle.js +1 -0
  112. package/storybook-static/static/logo.svg +19 -0
  113. package/storybook-static/static/logologin.svg +16 -0
  114. package/storybook-static/static/logotipo.svg +50 -0
  115. package/storybook-static/static/logotipoS.svg +26 -0
  116. package/storybook-static/vendors~main.720e76f4.iframe.bundle.js +3 -0
  117. package/storybook-static/vendors~main.720e76f4.iframe.bundle.js.LICENSE.txt +110 -0
  118. package/storybook-static/vendors~main.720e76f4.iframe.bundle.js.map +1 -0
  119. package/storybook-static/vendors~main.fcd0b2a3431ddf75f5f7.manager.bundle.js +2 -0
  120. package/storybook-static/vendors~main.fcd0b2a3431ddf75f5f7.manager.bundle.js.LICENSE.txt +101 -0
  121. package/styles/globals.css +590 -3
  122. package/styles/tokens.css +2 -1
  123. package/tokens/index.js +2 -1
@@ -3,7 +3,7 @@ const cssModules = require('../webpack/cssModules')
3
3
  const reactInlineSvg = require('../webpack/reactInlineSvg')
4
4
 
5
5
  module.exports = {
6
- stories: ['../{tokens,atoms,molecules,layout}/**/*.stories.@(js|mdx)'],
6
+ stories: ['../{tokens,atoms,molecules,layout,pages}/**/*.stories.@(js|mdx)'],
7
7
  addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
8
8
  staticDirs: ['../public'],
9
9
  webpackFinal: loadConfigs([cssModules, reactInlineSvg]),
@@ -0,0 +1,77 @@
1
+ import React from 'react'
2
+ import PropTypes from 'prop-types'
3
+
4
+ import styles from './AlertModal.module.css'
5
+ import { options } from './constants'
6
+ import withStyles from '../../hocs/withStyles'
7
+ import withReactContent from 'sweetalert2-react-content'
8
+ import Swal from 'sweetalert2'
9
+
10
+ export const handleClickConfirmed = ( resultIsConfirmed ) => {
11
+ resultIsConfirmed
12
+ }
13
+
14
+
15
+ export const AlertModal = ({ children, getStyles, titleAlert, subTitleAlert, iconAlert, txtBtnAlert, resultIsConfirmed, resultIsDenied }) => {
16
+
17
+ const MySwal = withReactContent(Swal)
18
+
19
+ // MySwal.fire({
20
+ // title: <p>Hello World</p>,
21
+ // didOpen: () => {
22
+ // // `MySwal` is a subclass of `Swal` with all the same instance & static methods
23
+ // MySwal.showLoading()
24
+ // },
25
+ // }).then(() => {
26
+ // return MySwal.fire(<p>Shorthand works too</p>)
27
+ // })
28
+
29
+ // MySwal.fire(
30
+ // 'Good job!',
31
+ // 'You clicked the button!',
32
+ // 'success'
33
+ // )
34
+
35
+ MySwal.fire({
36
+ title: titleAlert,
37
+ icon: iconAlert,
38
+ html: subTitleAlert,
39
+ confirmButtonText: txtBtnAlert,
40
+ }).then((result) => {
41
+ /* Read more about isConfirmed, isDenied below */
42
+ if (result.isConfirmed) {
43
+
44
+ handleClickConfirmed(resultIsConfirmed)
45
+
46
+ } else if (result.isDenied) {
47
+ resultIsDenied
48
+ }
49
+ })
50
+
51
+
52
+ return <div className={getStyles('alert-modal')}>{children}</div>
53
+ }
54
+
55
+ AlertModal.propTypes = {
56
+ children: PropTypes.node,
57
+ getStyles: PropTypes.func.isRequired,
58
+ titleAlert: PropTypes.string.isRequired,
59
+ subTitleAlert: PropTypes.string.isRequired,
60
+ txtBtnAlert: PropTypes.string.isRequired,
61
+ resultIsConfirmed: PropTypes.any,
62
+ resultIsDenied: PropTypes.any,
63
+ iconAlert: PropTypes.oneOf(options.icon),
64
+ }
65
+
66
+ AlertModal.defaultProps = {
67
+ getStyles: () => {},
68
+ titleAlert: 'Felicidades!',
69
+ subTitleAlert: 'Ejemplo de subtitulo',
70
+ txtBtnAlert: 'Aceptar',
71
+ iconAlert: 'success',
72
+ // resultIsConfirmed: () => { setModalAlert(false)},
73
+ // resultIsConfirmed: (setModalAlert(false)),
74
+ // resultIsDenied: '',
75
+ }
76
+
77
+ export default withStyles(styles)(AlertModal)
@@ -0,0 +1,3 @@
1
+ .alert-modal {
2
+ display: flex;
3
+ }
@@ -0,0 +1,30 @@
1
+ import { AlertModal, styles, options } from '.'
2
+ options
3
+
4
+ import {
5
+ getTemplate,
6
+ getListTemplate,
7
+ getOptionsArgTypes,
8
+ } from '../../helpers/storybook'
9
+
10
+ const Template = getTemplate(AlertModal, styles)
11
+ const ListTemplate = getListTemplate(AlertModal, styles)
12
+
13
+ export default {
14
+ title: 'Atoms/AlertModal',
15
+ component: AlertModal,
16
+ args: {
17
+ titleAlert: 'Felicidades!',
18
+ subTitleAlert: 'Ejemplo de subtitulo',
19
+ txtBtnAlert: 'Aceptar',
20
+ // resultIsConfirmed: true,
21
+ // resultIsDenied: '',
22
+ },
23
+ argTypes: {
24
+ iconAlert: getOptionsArgTypes(options.icon),
25
+ },
26
+ }
27
+
28
+ export const Default = Template.bind({})
29
+ // export const List = ListTemplate.bind({})
30
+ // List.args = { items: options.types.map((type) => ({ type })) }
@@ -0,0 +1,4 @@
1
+ export const options = {
2
+ icon: ['success', 'error', 'warning', 'info', 'question'],
3
+ }
4
+
@@ -0,0 +1,3 @@
1
+ export { default, AlertModal } from './AlertModal'
2
+ export { options } from './constants'
3
+ export { default as styles } from './AlertModal.module.css'
@@ -24,6 +24,8 @@ export const Button = ({
24
24
  getStyles,
25
25
  }) => (
26
26
  <button
27
+ type="submit"
28
+ disabled={isMuted}
27
29
  className={getStyles('button', ['type'], {
28
30
  'is-inline': isInline || type === 'tertiary',
29
31
  'is-muted': isMuted && type === 'primary',
@@ -37,6 +39,7 @@ export const Button = ({
37
39
  isCentered
38
40
  isInline={isObject(addons) && !isEmpty(addons)}
39
41
  weight={'light'}
42
+ size={'xs'}
40
43
  >
41
44
  {children}
42
45
  </Heading>
@@ -60,8 +63,8 @@ Button.propTypes = {
60
63
 
61
64
  Button.defaultProps = {
62
65
  type: 'primary',
63
- getStyles: () => {},
64
- onClick: () => {},
66
+ getStyles: () => { },
67
+ onClick: () => { },
65
68
  isInline: false,
66
69
  }
67
70
 
@@ -2,10 +2,10 @@
2
2
  display: inline-flex;
3
3
  width: 100%;
4
4
  min-width: max-content;
5
- height: 45px;
5
+ height: 40px;
6
6
  align-items: center;
7
7
  justify-content: center;
8
- padding: 20px 30px;
8
+ padding: 12px 30px;
9
9
  border: var(--border-width-thin) solid var(--color-base-transparent);
10
10
  border-radius: var(--button-border-radius-none);
11
11
  box-shadow: var(--box-shadow-sm);
@@ -59,5 +59,8 @@
59
59
  }
60
60
 
61
61
  .is-muted {
62
- background: var(--color-primary-muted);
62
+ background: var(--color-font-muted);
63
+ cursor: default;
64
+ box-shadow: var(--box-shadow-none) !important;
65
+ filter: brightness(1) !important;
63
66
  }
@@ -0,0 +1,49 @@
1
+ import React from 'react'
2
+ import PropTypes from 'prop-types'
3
+
4
+ import styles from './Checkbox.module.css'
5
+ import { options } from './constants'
6
+ import withStyles from '../../hocs/withStyles'
7
+
8
+ export const Checkbox = ({ getStyles, onChange, label, id, value, name }) => {
9
+
10
+ const [checked, setChecked] = React.useState(false);
11
+
12
+
13
+ return (
14
+
15
+ <div className={getStyles('checkbox')}>
16
+
17
+ <input
18
+ type="checkbox"
19
+ id={id}
20
+ name={name}
21
+ label={label}
22
+ value={value}
23
+ onChange={onChange}
24
+ />
25
+ {label}
26
+ </div>
27
+
28
+ )
29
+ }
30
+
31
+ Checkbox.propTypes = {
32
+ getStyles: PropTypes.func.isRequired,
33
+ onChange: PropTypes.func.isRequired,
34
+ id: PropTypes.string.isRequired,
35
+ name: PropTypes.string.isRequired,
36
+ value: PropTypes.string.isRequired,
37
+ label: PropTypes.string
38
+ }
39
+
40
+ Checkbox.defaultProps = {
41
+ getStyles: () => { },
42
+ onChange: () => { },
43
+ id: '1',
44
+ name: '1',
45
+ value: true,
46
+ label: 'Hola',
47
+ }
48
+
49
+ export default withStyles(styles)(Checkbox)
@@ -0,0 +1,3 @@
1
+ .checkbox {
2
+ display: flex;
3
+ }
@@ -0,0 +1,28 @@
1
+ import { Checkbox, styles, options } from '.'
2
+
3
+ import {
4
+ getTemplate,
5
+ getListTemplate,
6
+ getOptionsArgTypes,
7
+ } from '../../helpers/storybook'
8
+
9
+ const Template = getTemplate(Checkbox, styles)
10
+ const ListTemplate = getListTemplate(Checkbox, styles)
11
+
12
+ export default {
13
+ title: 'Atoms/Checkbox',
14
+ component: Checkbox,
15
+ args: {
16
+ id: '1',
17
+ name: '1',
18
+ value: true,
19
+ label: 'Hola',
20
+ },
21
+ argTypes: {
22
+ // types: getOptionsArgTypes(options.types),
23
+ },
24
+ }
25
+
26
+ export const Default = Template.bind({})
27
+ // export const List = ListTemplate.bind({})
28
+ // List.args = { items: options.types.map((type) => ({ type })) }
@@ -0,0 +1 @@
1
+ export const options = { types: [] }
@@ -0,0 +1,3 @@
1
+ export { default, Checkbox } from './Checkbox'
2
+ export { options } from './constants'
3
+ export { default as styles } from './Checkbox.module.css'
@@ -19,7 +19,7 @@ export const Heading = ({ children, isCentered, isInline, getStyles }) => {
19
19
  }
20
20
 
21
21
  Heading.propTypes = {
22
- children: PropTypes.string.isRequired,
22
+ children: PropTypes.any.isRequired,
23
23
  getStyles: PropTypes.func.isRequired,
24
24
  isInline: PropTypes.bool,
25
25
  isCentered: PropTypes.bool,
@@ -20,6 +20,10 @@
20
20
  color: var(--color-tertiary);
21
21
  }
22
22
 
23
+ .color-black {
24
+ color: var(--color-base-black);
25
+ }
26
+
23
27
  .size-xs {
24
28
  font-size: var(--font-size-xs);
25
29
  }
@@ -1,5 +1,5 @@
1
1
  export const options = {
2
- colors: ['base', 'primary', 'tertiary', 'inverted'],
2
+ colors: ['base', 'primary', 'tertiary', 'inverted', 'black'],
3
3
  sizes: ['xs', 'sm', 'md', 'lg', 'xl', '2xl'],
4
4
  weights: ['light', 'normal', 'bold'],
5
5
  }
@@ -59,18 +59,18 @@ export const iconsMap = {
59
59
  d="M5,10L15,0l0.9,0.9L6.8,10l9.1,9.1L15,20L5,10z"
60
60
  />
61
61
 
62
-
62
+
63
63
  ),
64
64
  },
65
65
  angleRight: {
66
66
  viewBox: '0 0 20 20',
67
67
  svg: (
68
68
 
69
- <path
70
- fillRule="evenodd"
71
- clipRule="evenodd"
72
- d="M15.9,10l-10,10L5,19.1l9.1-9.1L5,0.9L5.9,0C5.9,0,15.9,10,15.9,10z"
73
- />
69
+ <path
70
+ fillRule="evenodd"
71
+ clipRule="evenodd"
72
+ d="M15.9,10l-10,10L5,19.1l9.1-9.1L5,0.9L5.9,0C5.9,0,15.9,10,15.9,10z"
73
+ />
74
74
 
75
75
 
76
76
  ),
@@ -85,6 +85,30 @@ export const iconsMap = {
85
85
  />
86
86
  ),
87
87
  },
88
+ angleUpDown: {
89
+ viewBox: '0 0 15 15',
90
+ svg: (
91
+ <path class="st0" d="M3.6,4.3c-0.3,0.3-0.3,0.7,0,1c0.3,0.3,0.7,0.3,1,0l2.9-2.9l2.9,2.9c0.3,0.3,0.7,0.3,1,0c0.3-0.3,0.3-0.7,0-1
92
+ L8,0.9C7.9,0.8,7.7,0.7,7.5,0.7C7.3,0.7,7.1,0.8,7,0.9L3.6,4.3z M11.4,10.7c0.3-0.3,0.3-0.7,0-1c-0.3-0.3-0.7-0.3-1,0l-2.9,2.9
93
+ L4.6,9.7c-0.3-0.3-0.7-0.3-1,0c-0.3,0.3-0.3,0.7,0,1L7,14.1c0.3,0.3,0.7,0.3,1,0L11.4,10.7z"/>
94
+ ),
95
+ },
96
+
97
+ fileDownload: {
98
+ viewBox: '0 0 21 21',
99
+ svg: (
100
+ <g transform="translate(4 2)">
101
+ <path d="M11.7,18.8H1.3c-1.7,0-3.1-1.4-3.1-3.1v-13c0-1.7,1.4-3.1,3.1-3.1h2.6c0.3,0,0.5,0.2,0.5,0.5S4.2,0.5,3.9,0.5H1.3
102
+ c-1.2,0-2.1,0.9-2.1,2.1v13c0,1.2,0.9,2.1,2.1,2.1h10.4c1.2,0,2.1-0.9,2.1-2.1l0-10.2L8.8,0.4c-0.2-0.2-0.2-0.5,0-0.7
103
+ s0.5-0.2,0.7,0l5.2,5.2c0.1,0.1,0.1,0.2,0.1,0.4l0,10.4C14.8,17.4,13.4,18.8,11.7,18.8z"/>
104
+ <path d="M6.5,13.6c-0.1,0-0.3,0-0.3-0.1L2.2,9.6C2,9.4,2,9.1,2.2,8.9c0.2-0.2,0.5-0.2,0.7,0l3.6,3.5l3.6-3.5c0.2-0.2,0.5-0.2,0.7,0
105
+ c0.2,0.2,0.2,0.5,0,0.7l-3.9,3.8C6.8,13.5,6.6,13.6,6.5,13.6z"/>
106
+ <path d="M6.5,13.6c-0.3,0-0.5-0.2-0.5-0.5V-1.3c0-0.3,0.2-0.5,0.5-0.5S7-1.6,7-1.3v14.3C7,13.3,6.8,13.6,6.5,13.6z" />
107
+ </g>
108
+ ),
109
+ },
110
+
111
+
88
112
  pauseCircle: {
89
113
  viewBox: '0 0 28 28',
90
114
  svg: (
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 25.4.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve">
5
+ <g transform="translate(4 2)">
6
+ <path d="M11.7,18.8H1.3c-1.7,0-3.1-1.4-3.1-3.1v-13c0-1.7,1.4-3.1,3.1-3.1h2.6c0.3,0,0.5,0.2,0.5,0.5S4.2,0.5,3.9,0.5H1.3
7
+ c-1.2,0-2.1,0.9-2.1,2.1v13c0,1.2,0.9,2.1,2.1,2.1h10.4c1.2,0,2.1-0.9,2.1-2.1l0-10.2L8.8,0.4c-0.2-0.2-0.2-0.5,0-0.7
8
+ s0.5-0.2,0.7,0l5.2,5.2c0.1,0.1,0.1,0.2,0.1,0.4l0,10.4C14.8,17.4,13.4,18.8,11.7,18.8z"/>
9
+ <path d="M6.5,13.6c-0.1,0-0.3,0-0.3-0.1L2.2,9.6C2,9.4,2,9.1,2.2,8.9c0.2-0.2,0.5-0.2,0.7,0l3.6,3.5l3.6-3.5c0.2-0.2,0.5-0.2,0.7,0
10
+ c0.2,0.2,0.2,0.5,0,0.7l-3.9,3.8C6.8,13.5,6.6,13.6,6.5,13.6z"/>
11
+ <path d="M6.5,13.6c-0.3,0-0.5-0.2-0.5-0.5V-1.3c0-0.3,0.2-0.5,0.5-0.5S7-1.6,7-1.3v14.3C7,13.3,6.8,13.6,6.5,13.6z"/>
12
+ </g>
13
+ </svg>
@@ -5,44 +5,60 @@ import styles from './Input.module.css'
5
5
  import { options } from './constants'
6
6
  import withStyles from '../../hocs/withStyles'
7
7
 
8
- const handleChange = ({ onChange }) => () => {
9
- onChange()
10
- }
8
+ // const handleChange = ({ onChange }) => () => {
9
+ // onChange()
10
+ // }
11
11
 
12
12
  export const Input = ({
13
13
  getStyles,
14
14
  type,
15
+ id,
15
16
  value,
16
17
  isInline,
18
+ isInlineCode,
19
+ isInputFilter,
17
20
  onChange,
21
+ onClick,
18
22
  placeholder,
19
23
  }) => (
20
24
  <input
21
25
  className={getStyles('input', {
22
26
  'is-inline': isInline,
27
+ 'is-inline-code': isInlineCode,
28
+ 'is-input-filter': isInputFilter,
23
29
  })}
24
30
  type={type}
31
+ id={id}
25
32
  value={value}
26
33
  placeholder={placeholder}
27
- onChange={handleChange({ onChange })}
34
+ onChange={onChange}
35
+ onClick={onClick}
28
36
  ></input>
29
37
  )
30
38
 
31
39
  Input.propTypes = {
32
40
  onChange: PropTypes.func.isRequired,
41
+ onClick: PropTypes.func,
33
42
  getStyles: PropTypes.func.isRequired,
34
43
  type: PropTypes.oneOf(options.types),
44
+ id: PropTypes.string.isRequired,
35
45
  value: PropTypes.string,
36
46
  placeholder: PropTypes.string,
37
47
  isInline: PropTypes.bool,
48
+ isInlineCode: PropTypes.bool,
49
+ isInputFilter: PropTypes.bool,
38
50
  }
39
51
 
40
52
  Input.defaultProps = {
41
53
  type: 'text',
42
- value: '',
54
+ // value: '',
55
+ id: '',
43
56
  placeholder: '',
44
57
  isInline: false,
58
+ isInlineCode: false,
59
+ isInputFilter: false,
45
60
  onChange: () => {},
61
+ onClick: () => {},
46
62
  getStyles: () => {},
47
63
  }
48
64
 
@@ -1,20 +1,21 @@
1
1
  .input {
2
2
  width: 100%;
3
3
  height: var(--input-height);
4
- padding: 12px 17px;
5
- border: var(--border-width-thin) solid var(--color-primary);
4
+ padding: 10px 17px;
5
+ border: var(--border-width-thin) solid var(--color-brand-white-lilac);
6
6
  background: var(--input-background);
7
- border-radius: var(--input-border-radius);
7
+ /* border-radius: var(--input-border-radius); */
8
8
  color: var(--color-font-base);
9
9
  font-family: var(--font-family-sans);
10
- font-size: var(--input-font-size);
10
+ font-size: var(--font-size-base);
11
11
  font-weight: var(--font-weight-medium);
12
- line-height: var(--line-height-tight);
12
+ line-height: var(--line-height-relaxed);
13
13
  transition: box-shadow 0.2s ease;
14
14
  }
15
15
 
16
16
  .input::placeholder {
17
- color: var(--color-font-highlight);
17
+ color: var(--color-brand-white-lilac);
18
+ font-weight: var(--font-weight-light);
18
19
  }
19
20
 
20
21
  .input:focus {
@@ -25,3 +26,22 @@
25
26
  .is-inline {
26
27
  max-width: max-content;
27
28
  }
29
+
30
+ .is-inline-code {
31
+ max-width: 38px;
32
+ padding: 7px 9px;
33
+ margin-right: 8px;
34
+ font-size: var(--font-size-md);
35
+ font-weight: var(--font-weight-bold);
36
+ text-align: center;
37
+ }
38
+
39
+ .is-input-filter {
40
+ border-radius: var(--border-radius-sm);
41
+ color: var(--color-font-highlight);
42
+ padding: 7px 9px;
43
+ font-size: var(--font-size-base);
44
+ font-weight: var(--font-weight-light);
45
+ text-align: left;
46
+ height: 28px;
47
+ }
@@ -13,7 +13,7 @@ export default {
13
13
  title: 'Atoms/Input',
14
14
  component: Input,
15
15
  args: {
16
- placeholder: 'Kingdom slowed',
16
+ placeholder: 'Et harum quidem',
17
17
  },
18
18
  argTypes: {
19
19
  type: getOptionsArgTypes(options.types),
@@ -23,10 +23,16 @@ export default {
23
23
  export const Default = Template.bind({})
24
24
 
25
25
  export const Value = Template.bind({})
26
- Value.args = { value: 'Others mainly cakehole Thorin moldy facial.' }
26
+ Value.args = { value: 'Nam libero tempore, cum soluta.' }
27
27
 
28
28
  export const Types = ListTemplate.bind({})
29
29
  Types.args = { items: options.types.map((type) => ({ type })) }
30
30
 
31
31
  export const Inline = Template.bind({})
32
32
  Inline.args = { isInline: true }
33
+
34
+ export const InlineCode = Template.bind({})
35
+ InlineCode.args = { isInlineCode: true }
36
+
37
+ export const isInputFilter = Template.bind({})
38
+ isInputFilter.args = { isisInputFilter: true }
@@ -18,7 +18,7 @@ exports[`Storyshots Atoms/Input Default 1`] = `
18
18
  <input
19
19
  className="input"
20
20
  onChange={[Function]}
21
- placeholder="Kingdom slowed"
21
+ placeholder="Et harum quidem"
22
22
  type="text"
23
23
  value=""
24
24
  />
@@ -43,7 +43,7 @@ exports[`Storyshots Atoms/Input Inline 1`] = `
43
43
  <input
44
44
  className="input is-inline"
45
45
  onChange={[Function]}
46
- placeholder="Kingdom slowed"
46
+ placeholder="Et harum quidem"
47
47
  type="text"
48
48
  value=""
49
49
  />
@@ -68,7 +68,7 @@ exports[`Storyshots Atoms/Input Types 1`] = `
68
68
  <input
69
69
  className="input"
70
70
  onChange={[Function]}
71
- placeholder="Kingdom slowed"
71
+ placeholder="Et harum quidem"
72
72
  type="text"
73
73
  value=""
74
74
  />
@@ -93,9 +93,9 @@ exports[`Storyshots Atoms/Input Value 1`] = `
93
93
  <input
94
94
  className="input"
95
95
  onChange={[Function]}
96
- placeholder="Kingdom slowed"
96
+ placeholder="Et harum quidem"
97
97
  type="text"
98
- value="Others mainly cakehole Thorin moldy facial."
98
+ value="Nam libero tempore, cum soluta."
99
99
  />
100
100
  </div>
101
101
  `;
@@ -1,3 +1,3 @@
1
1
  export const options = {
2
- types: ['text'],
2
+ types: ['text', 'password', 'date', 'number'],
3
3
  }
@@ -0,0 +1,31 @@
1
+ import React from 'react'
2
+ import PropTypes from 'prop-types'
3
+
4
+ import styles from './Label.module.css'
5
+ import { options } from './constants'
6
+ import withStyles from '../../hocs/withStyles'
7
+
8
+ export const Label = ({ children, getStyles, isHint }) => {
9
+ return (
10
+
11
+ <label className={getStyles('label', ['color'], { 'is-hint': isHint })}>{children}</label>
12
+
13
+ )
14
+ }
15
+
16
+ Label.propTypes = {
17
+ children: PropTypes.string,
18
+ getStyles: PropTypes.func.isRequired,
19
+ isHint: PropTypes.bool,
20
+ color: PropTypes.oneOf(options.colors),
21
+ // type: PropTypes.oneOf(options.types),
22
+ }
23
+
24
+ Label.defaultProps = {
25
+ getStyles: () => {},
26
+ children: 'label example',
27
+ isHint: false,
28
+ color: 'label',
29
+ }
30
+
31
+ export default withStyles(styles)(Label)
@@ -0,0 +1,38 @@
1
+ .label {
2
+ display: flex;
3
+ text-align: left;
4
+ width: 100%;
5
+ /* color: var(--color-brand-eastern-blue); */
6
+ font-family: var(--font-family-sans);
7
+ font-size: var(--font-size-mini);
8
+ font-weight: var(--font-weight-light);
9
+ line-height: var(--line-height-tight);
10
+ }
11
+
12
+ .is-hint {
13
+ font-size: 11px;
14
+ }
15
+
16
+ .color-label {
17
+ color: var(--color-brand-eastern-blue);
18
+ }
19
+
20
+ .color-base {
21
+ color: var(--color-font-base);
22
+ }
23
+
24
+ .color-inverted {
25
+ color: var(--color-font-inverted);
26
+ }
27
+
28
+ .color-muted {
29
+ color: var(--color-brand-mandy);
30
+ }
31
+
32
+ .color-primary {
33
+ color: var(--color-primary);
34
+ }
35
+
36
+ .color-tertiary {
37
+ color: var(--color-tertiary);
38
+ }
@@ -0,0 +1,26 @@
1
+ import { Label, styles, options } from '.'
2
+
3
+ import {
4
+ getTemplate,
5
+ getListTemplate,
6
+ getOptionsArgTypes,
7
+ } from '../../helpers/storybook'
8
+
9
+ const Template = getTemplate(Label, styles)
10
+ const ListTemplate = getListTemplate(Label, styles)
11
+
12
+ export default {
13
+ title: 'Atoms/Label',
14
+ component: Label,
15
+ args: {
16
+ isHint: false
17
+ },
18
+ argTypes: {
19
+ color: getOptionsArgTypes(options.colors),
20
+ },
21
+ }
22
+
23
+ export const Default = Template.bind({})
24
+
25
+ export const Colors = ListTemplate.bind({})
26
+ Colors.args = { items: options.colors.map((color) => ({ color })) }
@@ -0,0 +1 @@
1
+ export const options = { colors: ['label', 'base', 'muted', 'inverted', 'primary', 'tertiary'], }
@@ -0,0 +1,3 @@
1
+ export { default, Label } from './Label'
2
+ export { options } from './constants'
3
+ export { default as styles } from './Label.module.css'